intial commit

This commit is contained in:
Dhananjay Balan 2017-01-22 22:30:42 +01:00
commit f1bf5b6c0d
71 changed files with 1706 additions and 0 deletions

26
.gitignore vendored Normal file
View File

@ -0,0 +1,26 @@
dist
dist-*
cabal-dev
*.o
*.hi
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack-work/
cabal.project.local
.HTF/
# hakyll specific ones
_cache
# generated content, ignore for now
_site

5
about.rst Normal file
View File

@ -0,0 +1,5 @@
---
title: About
---
This is intentianally left blank!

11
blogng.cabal Normal file
View File

@ -0,0 +1,11 @@
name: blogng
version: 0.1.0.0
build-type: Simple
cabal-version: >= 1.10
executable site
main-is: site.hs
build-depends: base == 4.*
, hakyll == 4.9.*
ghc-options: -threaded
default-language: Haskell2010

5
contact.markdown Normal file
View File

@ -0,0 +1,5 @@
---
title: Contact
---
Is this really real?

56
css/default.css Normal file
View File

@ -0,0 +1,56 @@
body {
color: black;
font-size: 16px;
margin: 0px auto 0px auto;
width: 600px;
}
div#header {
border-bottom: 2px solid black;
margin-bottom: 30px;
padding: 12px 0px 12px 0px;
}
div#logo a {
color: black;
float: left;
font-size: 18px;
font-weight: bold;
text-decoration: none;
}
div#header #navigation {
text-align: right;
}
div#header #navigation a {
color: black;
font-size: 18px;
font-weight: bold;
margin-left: 12px;
text-decoration: none;
text-transform: uppercase;
}
div#footer {
border-top: solid 2px black;
color: #555;
font-size: 12px;
margin-top: 30px;
padding: 12px 0px 12px 0px;
text-align: right;
}
h1 {
font-size: 24px;
}
h2 {
font-size: 20px;
}
div.info {
color: #555;
font-size: 14px;
font-style: italic;
}

BIN
images/bird_32_gray.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

BIN
images/code_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

BIN
images/dotted-border.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

BIN
images/email.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

BIN
images/gsoc_2013.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
images/haskell-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
images/job_hunt_plot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
images/line-tile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

BIN
images/noise.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
images/rss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

BIN
images/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

16
index.html Normal file
View File

@ -0,0 +1,16 @@
---
title: Home
---
<h2>Welcome</h2>
<img src="/images/haskell-logo.png" style="float: right; margin: 10px;" />
<p>Welcome to my blog!</p>
<p>I've reproduced a list of recent posts here for your reading pleasure:</p>
<h2>Posts</h2>
$partial("templates/post-list.html")$
<p>…or you can find more in the <a href="/archive.html">archives</a>.</p>

View File

@ -0,0 +1,14 @@
---
author: dhananjayishere
comments: true
date: 2011-03-21 01:23:00
layout: post
slug: long-time
title: Long time.
wordpress_id: 47145570
categories: Update Posterous
---
Its been long time, Almost a year. Lots of things happened. Good and bad, I dont want to recollect and dump all the past here, But future, I promise you to speak about it, :-)
Im moving to posterous from my old blog (obviously).

View File

@ -0,0 +1,12 @@
---
author: dhananjayishere
comments: true
date: 2011-03-24 07:16:42
layout: post
slug: school-memories
title: School Memories
wordpress_id: 47147523
categories: Friends
---
[![Ron_01-jan-05_1-43-59](http://dbalan.files.wordpress.com/2011/03/81726-ron_01-jan-05_1-43-59.jpg)](http://dbalan.files.wordpress.com/2011/03/81726-ron_01-jan-05_1-43-59.jpg)

View File

@ -0,0 +1,12 @@
---
author: dhananjayishere
comments: true
date: 2011-03-26 21:25:00
layout: post
slug: earth-hour-official-video
title: Earth Hour
wordpress_id: 47451256
categories: Thoughts
---
[youtube http://www.youtube.com/watch?v=4Mxjbip6y04?wmode=transparent]

View File

@ -0,0 +1,17 @@
---
author: dhananjayishere
comments: true
date: 2011-03-26 20:58:00
layout: post
slug: firefox
title: Firefox 4
wordpress_id: 47448980
categories: Debian 'Free software'
---
[![Firefox](http://dbalan.files.wordpress.com/2011/03/144e7-firefox.png)](http://dbalan.files.wordpress.com/2011/03/144e7-firefox.png)
Its been three days Firefox 4 released, and I am still using the beta,
What a shame? Update!!
Debian users, FInd your cutie pie iceweasel 4 Here : [http://mozilla.debian.net/](http://mozilla.debian.net/)

View File

@ -0,0 +1,12 @@
---
author: dhananjayishere
comments: true
date: 2011-04-01 06:08:00
layout: post
slug: compski-night-firends-and-fun
title: Compski Night - Friends and Fun
wordpress_id: 48042401
categories: Friends Trivandrum
---
[![Me](http://dbalan.files.wordpress.com/2011/04/a9ff5-me.jpg)](http://dbalan.files.wordpress.com/2011/04/a9ff5-me.jpg)[![Img_3093-20](http://dbalan.files.wordpress.com/2011/04/9dafe-img_3093-20.jpg)](http://dbalan.files.wordpress.com/2011/04/9dafe-img_3093-20.jpg)[![Img_3093-17](http://dbalan.files.wordpress.com/2011/04/bfa6a-img_3093-17.jpg)](http://dbalan.files.wordpress.com/2011/04/bfa6a-img_3093-17.jpg)[![Img_3093-0](http://dbalan.files.wordpress.com/2011/04/3bf0a-img_3093-0.jpg)](http://dbalan.files.wordpress.com/2011/04/3bf0a-img_3093-0.jpg)[![Img_3093-2](http://dbalan.files.wordpress.com/2011/04/55f5c-img_3093-2.jpg)](http://dbalan.files.wordpress.com/2011/04/55f5c-img_3093-2.jpg)[![Img_3093-1](http://dbalan.files.wordpress.com/2011/04/2862a-img_3093-1.jpg)](http://dbalan.files.wordpress.com/2011/04/2862a-img_3093-1.jpg)[![Img_3093-3](http://dbalan.files.wordpress.com/2011/04/827eb-img_3093-3.jpg)](http://dbalan.files.wordpress.com/2011/04/827eb-img_3093-3.jpg)[![Img_3093-4](http://dbalan.files.wordpress.com/2011/04/ddc4c-img_3093-4.jpg)](http://dbalan.files.wordpress.com/2011/04/ddc4c-img_3093-4.jpg)[![Img_3093-9](http://dbalan.files.wordpress.com/2011/04/76429-img_3093-9.jpg)](http://dbalan.files.wordpress.com/2011/04/76429-img_3093-9.jpg)[![Img_3093-5](http://dbalan.files.wordpress.com/2011/04/982f5-img_3093-5.jpg)](http://dbalan.files.wordpress.com/2011/04/982f5-img_3093-5.jpg)[![Img_3093-12](http://dbalan.files.wordpress.com/2011/04/b882d-img_3093-12.jpg)](http://dbalan.files.wordpress.com/2011/04/b882d-img_3093-12.jpg)[![Img_3093-10](http://dbalan.files.wordpress.com/2011/04/fa011-img_3093-10.jpg)](http://dbalan.files.wordpress.com/2011/04/fa011-img_3093-10.jpg)[![Img_3093-13](http://dbalan.files.wordpress.com/2011/04/cce9a-img_3093-13.jpg)](http://dbalan.files.wordpress.com/2011/04/cce9a-img_3093-13.jpg)[![Img_3093-21](http://dbalan.files.wordpress.com/2011/04/93fa8-img_3093-21.jpg)](http://dbalan.files.wordpress.com/2011/04/93fa8-img_3093-21.jpg)[![Img_3093-7](http://dbalan.files.wordpress.com/2011/04/3f468-img_3093-7.jpg)](http://dbalan.files.wordpress.com/2011/04/3f468-img_3093-7.jpg)[![Img_3093-8](http://dbalan.files.wordpress.com/2011/04/49cd8-img_3093-8.jpg)](http://dbalan.files.wordpress.com/2011/04/49cd8-img_3093-8.jpg)[![Img_3093-6](http://dbalan.files.wordpress.com/2011/04/5c51e-img_3093-6.jpg)](http://dbalan.files.wordpress.com/2011/04/5c51e-img_3093-6.jpg)[![Img_3093-14](http://dbalan.files.wordpress.com/2011/04/c37ae-img_3093-14.jpg)](http://dbalan.files.wordpress.com/2011/04/c37ae-img_3093-14.jpg)[![Img_3093-15](http://dbalan.files.wordpress.com/2011/04/fd4a4-img_3093-15.jpg)](http://dbalan.files.wordpress.com/2011/04/fd4a4-img_3093-15.jpg)[![Img_3093-16](http://dbalan.files.wordpress.com/2011/04/349f1-img_3093-16.jpg)](http://dbalan.files.wordpress.com/2011/04/349f1-img_3093-16.jpg)[![Img_3093-18](http://dbalan.files.wordpress.com/2011/04/84898-img_3093-18.jpg)](http://dbalan.files.wordpress.com/2011/04/84898-img_3093-18.jpg)[![Img_3093-11](http://dbalan.files.wordpress.com/2011/04/0abbb-img_3093-11.jpg)](http://dbalan.files.wordpress.com/2011/04/0abbb-img_3093-11.jpg)

View File

@ -0,0 +1,15 @@
---
author: dhananjayishere
comments: true
date: 2011-04-03 19:16:34
layout: post
slug: happy-birthday-colin
title: Happy Birthday Colin.
wordpress_id: 48338565
categories: Friends
---
Today was Colins' Birthday, and this is what we gave him - 5 raw eggs
straight on the face.
[![Img_3153](http://dbalan.files.wordpress.com/2011/04/35c3b-img_3153.jpg)](http://dbalan.files.wordpress.com/2011/04/35c3b-img_3153.jpg)[![Img_3150](http://dbalan.files.wordpress.com/2011/04/18496-img_3150.jpg)](http://dbalan.files.wordpress.com/2011/04/18496-img_3150.jpg)

View File

@ -0,0 +1,15 @@
---
author: dhananjayishere
comments: true
date: 2011-04-05 15:08:24
layout: post
slug: sharing-the-posterous-way
title: Sharing the posterous way..
wordpress_id: 48536674
categories: College
---
For people with no idea, This is our mathematics assignment, shared in
a posterous way.
[![04042011497](http://dbalan.files.wordpress.com/2011/04/176ee-04042011497.jpg)](http://dbalan.files.wordpress.com/2011/04/176ee-04042011497.jpg)[![04042011498](http://dbalan.files.wordpress.com/2011/04/ffd34-04042011498.jpg)](http://dbalan.files.wordpress.com/2011/04/ffd34-04042011498.jpg)[![04042011499](http://dbalan.files.wordpress.com/2011/04/7c1e6-04042011499.jpg)](http://dbalan.files.wordpress.com/2011/04/7c1e6-04042011499.jpg)[![04042011500](http://dbalan.files.wordpress.com/2011/04/49004-04042011500.jpg)](http://dbalan.files.wordpress.com/2011/04/49004-04042011500.jpg)[![04042011501](http://dbalan.files.wordpress.com/2011/04/98026-04042011501.jpg)](http://dbalan.files.wordpress.com/2011/04/98026-04042011501.jpg)[![04042011502](http://dbalan.files.wordpress.com/2011/04/078bb-04042011502.jpg)](http://dbalan.files.wordpress.com/2011/04/078bb-04042011502.jpg)[![04042011503](http://dbalan.files.wordpress.com/2011/04/cdfbb-04042011503.jpg)](http://dbalan.files.wordpress.com/2011/04/cdfbb-04042011503.jpg)[![04042011504](http://dbalan.files.wordpress.com/2011/04/c8ede-04042011504.jpg)](http://dbalan.files.wordpress.com/2011/04/c8ede-04042011504.jpg)[![04042011505](http://dbalan.files.wordpress.com/2011/04/5141f-04042011505.jpg)](http://dbalan.files.wordpress.com/2011/04/5141f-04042011505.jpg)[![04042011506](http://dbalan.files.wordpress.com/2011/04/cbda6-04042011506.jpg)](http://dbalan.files.wordpress.com/2011/04/cbda6-04042011506.jpg)[![04042011507](http://dbalan.files.wordpress.com/2011/04/d8075-04042011507.jpg)](http://dbalan.files.wordpress.com/2011/04/d8075-04042011507.jpg)[![04042011508](http://dbalan.files.wordpress.com/2011/04/acdf3-04042011508.jpg)](http://dbalan.files.wordpress.com/2011/04/acdf3-04042011508.jpg)[![04042011509](http://dbalan.files.wordpress.com/2011/04/9bf5b-04042011509.jpg)](http://dbalan.files.wordpress.com/2011/04/9bf5b-04042011509.jpg)[![04042011510](http://dbalan.files.wordpress.com/2011/04/2210c-04042011510.jpg)](http://dbalan.files.wordpress.com/2011/04/2210c-04042011510.jpg)[![04042011511](http://dbalan.files.wordpress.com/2011/04/52f62-04042011511.jpg)](http://dbalan.files.wordpress.com/2011/04/52f62-04042011511.jpg)[![04042011512](http://dbalan.files.wordpress.com/2011/04/63b74-04042011512.jpg)](http://dbalan.files.wordpress.com/2011/04/63b74-04042011512.jpg)

View File

@ -0,0 +1,14 @@
---
author: dhananjayishere
comments: true
date: 2011-04-19 04:35:25
layout: post
slug: bed-of-roses
title: Bed of Roses
wordpress_id: 50054557
categories: Trivandrum
---
[![Bedofroses](http://dbalan.files.wordpress.com/2011/04/c8a04-bedofroses.jpg)](http://dbalan.files.wordpress.com/2011/04/c8a04-bedofroses.jpg)
Back in Trivandrum.

View File

@ -0,0 +1,21 @@
---
author: dhananjayishere
comments: true
date: 2011-04-20 11:56:22
layout: post
slug: happy
title: happy
wordpress_id: 50200868
categories: Friends Thoughts
---
[hap-ee] adjective, -pier, -piest.
1.delighted, pleased, or glad, as over a particular thing: to be happy to see a person.
2.characterized by or indicative of pleasure, contentment, or joy: a happy mood; a happy frame of mind.
3.favored by fortune; fortunate or lucky: a happy, fruitful land.
4. apt or felicitous, as actions, utterances, or ideas.
5. obsessed by or quick to use the item indicated (usually used in combination): a trigger-happy gangster. Everybody is gadget-happy these days.

View File

@ -0,0 +1,27 @@
---
author: dhananjayishere
comments: true
date: 2011-04-28 06:23:27
layout: post
slug: adept
title: Adept
wordpress_id: 51072398
categories: Thoughts
---
We all want things to remain same, afraid of change always. set out to
live misery so we can be happy together. I wish I could explain
everything in my damn head and be out of the heavyness I feel now, but
being no natural speaker dont know how to do it without hurting the
dear ones whos life path crosses with mine.
One thing I learned from all this was to hope something that will
never happen was always an easy way out of the miseries in this world,
cheating is the only way to get out and usually cheating yourself.
Trying to let it go from my mind, staring at this screen and trying
not to express my feelings outside this window, I understand what is
mean by transfixing between emotions as someone told me before. I
never believed in saving for future but when it comes to taking hard
decisions its better to cry now than later because crying later means
some other is crying now.

View File

@ -0,0 +1,12 @@
---
author: dhananjayishere
comments: true
date: 2011-05-02 03:42:58
layout: post
slug: the-story-of-linux
title: The Story Of Linux
wordpress_id: 51514829
categories: Thoughts
---
[youtube http://www.youtube.com/watch?v=5ocq6_3-nEw?wmode=transparent]

View File

@ -0,0 +1,20 @@
---
author: dhananjayishere
comments: true
date: 2011-05-07 10:52:33
layout: post
slug: gsoc-2011-i-am-in
title: GSoC 2011, I am in.
wordpress_id: 52138307
categories:
- Free software
- GSoC
- Thoughts
---
I am too lazy to do anything these days, it took a long time to get over all that mind set. Sorry for not posting this guys,
I have been selected to this years Google Summer Of Code Program, Under Google Open Source Programs Office,
This is my proposal
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/dhananjay/1](http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/dhananjay/1)

View File

@ -0,0 +1,29 @@
---
author: dhananjayishere
comments: true
date: 2011-05-14 00:37:00
layout: post
slug: welcome-to-acm-courtesy-of-google
title: Welcome to ACM, Courtesy of Google
wordpress_id: 52982430
categories:
- Free software
- GSoC
- Thoughts
---
So when I opened my mailbox today, this was watinig for me. It may not exactly fall into the type but still kind of first salary to me.
---------- Forwarded message ----------
From: **** <[acmhelp@acm.org](mailto:acmhelp@acm.org)>
Date: 14 May 2011 02:47
Subject: Welcome to ACM, Courtesy of Google
To: [mb.dhananjay@gmail.com](mailto:mb.dhananjay@gmail.com)
Dear Dhananjay Balan:
Welcome to the ACM Community, courtesy of Google! An ACM Student Membership has been created for you,

View File

@ -0,0 +1,11 @@
---
author: dhananjayishere
comments: true
date: 2011-05-28 08:44:00
layout: post
slug: hmm-vacation-work-time
title: Hmm, Vacation (Work) Time.
wordpress_id: 54729006
---
Finally my exams are over and I am set free to do watever I like. Now I can start working on my GSoC. People say work is what defines a person, his contributions, however small, is what makes his life worthy of living. I am looking forward to a joyful vacation doing what I like the most, some serious hacking and doing my part of work. A million thanks to the creators of the Summer of code program, and also to my mentor, Steffan. You guys rock.

View File

@ -0,0 +1,13 @@
---
author: dhananjayishere
comments: true
date: 2011-06-04 22:48:00
layout: post
slug: distributed-computing
title: Distributed Computing.
wordpress_id: 55668225
categories: Boinc Computing GSoC
---
Since I got involved with distributed computing for my GSoC some my non technical friends were asking questions about the project, heres an article I suggest you all. I am sure this will solve almost all your questions.
[http://boinc.berkeley.edu/boinc2.pdf](http://boinc.berkeley.edu/boinc2.pdf)

View File

@ -0,0 +1,17 @@
---
author: dhananjayishere
comments: true
date: 2011-06-05 00:23:40
layout: post
slug: random-reverbations
title: Random reverbations.
wordpress_id: 55677606
categories: Friends
---
Never underestimate an old hard disk, this was the lesson I learned this morning, So the hard-earned memories,
[![Dsc02841](http://dbalan.files.wordpress.com/2011/06/3f39e-dsc02841.jpg)](http://dbalan.files.wordpress.com/2011/06/3f39e-dsc02841.jpg)[![Dsc00853](http://dbalan.files.wordpress.com/2011/06/fef26-dsc00853.jpg)](http://dbalan.files.wordpress.com/2011/06/fef26-dsc00853.jpg)[![0dsc00853](http://dbalan.files.wordpress.com/2011/06/2eedf-0dsc00853.jpg)](http://dbalan.files.wordpress.com/2011/06/2eedf-0dsc00853.jpg)[![Dsc00952](http://dbalan.files.wordpress.com/2011/06/7cda9-dsc00952.jpg)](http://dbalan.files.wordpress.com/2011/06/7cda9-dsc00952.jpg)[![Dsc00954](http://dbalan.files.wordpress.com/2011/06/4784a-dsc00954.jpg)](http://dbalan.files.wordpress.com/2011/06/4784a-dsc00954.jpg)[![Dsc02780](http://dbalan.files.wordpress.com/2011/06/1b6ee-dsc02780.jpg)](http://dbalan.files.wordpress.com/2011/06/1b6ee-dsc02780.jpg)[![Dsc02782](http://dbalan.files.wordpress.com/2011/06/740d5-dsc02782.jpg)](http://dbalan.files.wordpress.com/2011/06/740d5-dsc02782.jpg)[![Dsc02835](http://dbalan.files.wordpress.com/2011/06/c708e-dsc02835.jpg)](http://dbalan.files.wordpress.com/2011/06/c708e-dsc02835.jpg)[![Dsc02843](http://dbalan.files.wordpress.com/2011/06/a3ab0-dsc02843.jpg)](http://dbalan.files.wordpress.com/2011/06/a3ab0-dsc02843.jpg)[![Image0641](http://dbalan.files.wordpress.com/2011/06/6dc4d-image0641.jpg)](http://dbalan.files.wordpress.com/2011/06/6dc4d-image0641.jpg)[![Image0657](http://dbalan.files.wordpress.com/2011/06/fe2ec-image0657.jpg)](http://dbalan.files.wordpress.com/2011/06/fe2ec-image0657.jpg)[![Ron_22-feb-08_5-20-44_pm](http://dbalan.files.wordpress.com/2011/06/b3371-ron_22-feb-08_5-20-44_pm.jpg)](http://dbalan.files.wordpress.com/2011/06/b3371-ron_22-feb-08_5-20-44_pm.jpg)[![Ron_01-jan-05_3-14-39_pm](http://dbalan.files.wordpress.com/2011/06/0c61d-ron_01-jan-05_3-14-39_pm.jpg)](http://dbalan.files.wordpress.com/2011/06/0c61d-ron_01-jan-05_3-14-39_pm.jpg)

View File

@ -0,0 +1,15 @@
---
author: dhananjayishere
comments: true
date: 2011-07-19 06:30:00
layout: post
slug: birthday-food-for-thought
title: 'Birthday: Food for thought.'
wordpress_id: 64888968
categories: Thoughts
---
[![Me](http://dbalan.files.wordpress.com/2011/07/62d42-me.jpg)](http://dbalan.files.wordpress.com/2011/07/62d42-me.jpg)
Turning Twenty.. Still Confused As I was then.

View File

@ -0,0 +1,19 @@
---
author: dhananjayishere
comments: true
date: 2011-08-23 12:54:29
layout: post
slug: sigsegv
title: SIGSEGV
wordpress_id: 66702565
categories: Markers Thoughts
---
**"Experience is the most brutal of all teachers."
-- C.S Lewis
**
Day I never gonna forget and forgiveness,
not in my hands
Past is it now,
Neither change,
You nor can deny.

View File

@ -0,0 +1,23 @@
---
author: dhananjayishere
comments: true
date: 2011-08-30 06:12:22
layout: post
slug: what-you-do-when-you-get-a-free-day
title: What you do when you get a free day?
wordpress_id: 67570727
categories: Thoughts
---
By free I never meant something like a holiday you get in ages which
exactly pumps you up. By "free" I meant day you dont have a clue to do
anything. You suddenly find yourself nothing interesting to do. Gets you
bored to the bones. A couple of people can cheer me up these times but unfortunately none
are around.
I hate it, because it breaks the barriers I've put in mind to the past.
On a blink, mind gets filled with everything that has happened in the
twenty years thats me, and most of them are not good things.
Writing never been my favorite, but its the only way left. So I am
falling back to my little diary. Nobodys' been a good listener.

View File

@ -0,0 +1,14 @@
---
author: dhananjayishere
comments: true
date: 2011-09-10 16:41:46
layout: post
slug: good-to-be-back
title: Good to be back.
wordpress_id: 69482578
categories: Trivandrum
---
[![20110910_0024_01](http://dbalan.files.wordpress.com/2011/09/78df1-20110910_0024_01.jpg)](http://dbalan.files.wordpress.com/2011/09/78df1-20110910_0024_01.jpg)
Vacations' over, Good to be back in Trivandrum.

View File

@ -0,0 +1,15 @@
---
author: dhananjayishere
comments: true
date: 2011-09-11 14:49:25
layout: post
slug: nothing-else-matters
title: Nothing Else Matters.
wordpress_id: 69645449
categories: Thoughts
---
**"Our integrity sells for so little, but it is all we really have, It is the very last inch of us.**
**But within that inch...**
**... we are free."**
**--Valerie, V For Vendetta.**

View File

@ -0,0 +1,14 @@
---
author: dhananjayishere
comments: true
date: 2011-09-16 13:08:11
layout: post
slug: crazy
title: Crazy
wordpress_id: 70601600
categories: Thoughts
---
[![Dsc_0120](http://dbalan.files.wordpress.com/2011/09/e3003-dsc_0120.jpg)](http://dbalan.files.wordpress.com/2011/09/e3003-dsc_0120.jpg)
Yeh, Thats me. :-)

View File

@ -0,0 +1,32 @@
---
author: dhananjayishere
comments: true
date: 2011-10-11 03:33:00
layout: post
slug: ffmepg-nokia-7210-video-clips
title: FFmpeg + Nokia 7210 Video Clips.
wordpress_id: 74980538
categories: GNU/Linux Multimedia Tips
---
Nokia 7210 supports video clips of container mp4 with following specifications.
Video Codec: mpeg4
Video Size: 320x240
Bit Rate: 500
Frame Rate: Auto
Aspect: Auto
Same Quality: False
Audio:
Audio Codec: mpeg4aac
Bit Rate: 96
Sample Rate: 44100
Channels: 1 (Mono)
Disable Audio: False
So to make a clip playable in phone,
Use
** ffmpeg -i <infile> -b 500 -s 320x240 -f mp4 -acodec libfaac -vcodec mpeg4 <outfile>**

View File

@ -0,0 +1,19 @@
---
author: dhananjayishere
comments: true
date: 2011-10-11 10:18:00
layout: post
slug: latex-on-the-go
title: LaTeX on the go.
wordpress_id: 75017934
categories: LaTeX Tips
---
This is just another day I thanked web 2.0, this time the story goes like this.
I needed to prepare a LaTeX document on the go, had no laptop with me and I couldnt find one with LaTeX installed, and installing LaTeX with current internet speeds, was the unthinkable.
I tried to settle with a word processor, but the idea hit me that I should search web, a simple search took me to [http://duckduckgo.com/?q=online+latex+editors](http://duckduckgo.com/?q=online+latex+editors)
I selected two links from the top,
[MonkeyTex](http://monkeytex.bradcater.webfactional.com/) has a really simple no frills yet beautiful interface, where [ScribeTex](https://www.scribtex.com/) offer a feature filled one. They also offer paid plans, other than a free plan which restricts you in number of projects and collaborators.

View File

@ -0,0 +1,16 @@
---
author: dhananjayishere
comments: true
date: 2011-10-28 16:02:00
layout: post
slug: falling-slowly
title: Falling Slowly.
wordpress_id: 77612351
categories: Thoughts
---
Its a song from the movie [Once](http://www.imdb.com/title/tt0907657/), very beautiful one. The song was exactly
about me. Searching for someone to hold me together, someone who will be
there guiding the sparrow home.
Then, I found you.

View File

@ -0,0 +1,39 @@
---
author: dhananjayishere
comments: true
date: 2012-01-09 14:30:00
layout: post
slug: arrow-keys-input-in-python
title: Arrow Keys input in python.
wordpress_id: 93005403
categories:
- Programing
- Python
---
I had an assignment to write an applicaion to control a toy helicopter. It should accept the inputs from the arrow keys and then generate a serial signal. The serial port is connected to the interfacing circutary.
The major problem I faced was how to take arrow keys as input? Using the technical jargon - implement a non-bufferd input. A code to do it in console can be found [here](http://code.activestate.com/recipes/134892-getch-like-unbuffered-character-reading-from-stdin/). But its dirty and is implemented in a complex way that usage is little bit diffcult. At console level the code becomes more os-specific, as you can see from the above code. It has diffrent defenitions to implement the feature in each os.
The easy way to do this is using any windowing tool kits around, they all have a key logging abstraction implemented. Like this [code](http://stackoverflow.com/a/4205490). it uses the tkinter toolkit to read input. The way I suggest is using pygame, because it is designed to this stuff. (Which game doesnt have a single use arrow key used?)
You can get the keys from
{% codeblock lang:python %}
pressed_keys = pygame.key.get_pressed()
{% endcodeblock %}
and the key name as
{% codeblock lang:python %}
for key_constant in pressed_keys:
key_name = pygame.key.name(key_constant)
{% endcodeblock %}
Then its just a matter of comparing them with the key name,( of arrow keys in our case).
{% codeblock lang:python %}
if key_constant == 'up':
port.write(_up_data)
{% endcodeblock %}
The complete code is available in [github](https://github.com/dhananjaynav/Scripts/blob/master/castalia/helicontrol.py)

View File

@ -0,0 +1,62 @@
---
author: dhananjayishere
comments: true
date: 2012-03-18 02:56:00
layout: post
slug: progress-bar-in-mercurial-pushpull
title: Progress bar in mercurial push/pull
wordpress_id: 112432788
categories:
- Free software
- Programing
- Revision Control
---
I admit I am a huge Git fanatic. Infact I havent used anything else for managing the code (except some checkout from svn). I was trying to build [orange](http://orange.biolab.si/), so I wasnt very happy when I realised they use [mercurial](http://mercurial.selenic.com/wiki/Mercurial) for the revision control (I, like all my fellow programmers is a lazy person to adapt ;-) ).
The first problem I faced was when cloning the code (checkout, subversion guys!), by default mecurial doesnt give you any progress dialogs. It can get frustrating if you are cloning a substantially large repository.
Good thing is mercurial from 1.5 onwards contains an extensoin for doing this, called [progress](http://mercurial.selenic.com/wiki/ProgressExtension). Only thng is you have to enable it explicitly.
Note that as per the mercurial documentation,system wide hg configuration file is stored in any of the following paths,
```
(Unix) /etc/mercurial/hgrc
or
/etc/mercurial/hgrc.d/*.rc
(Windows) Mercurial.ini or(Windows) hgrc.d*.rc
or
HKEY_LOCAL_MACHINESOFTWAREMercurial
```
and repositroy specific configuration in
```
/.hg/hgrc [ from man hgrc ]
```
To enable the progress extention, Create the file if it doesnt exist and add the fllowing to it.
```
[extensions]progress =
```
This enables the progress extention. You can define the configuration specific to this extention, by creating a sperate section in hgrc named [progress]. Information about thease options can be obtained by executing
```
[dhananjay@dlab orange]$ hg help progress|head
progress extension - show progress bars for some actionsThis extension uses the progress information logged by hg commands to drawprogress bars that are as informative as possible. Some progress bars onlyoffer indeterminate information, while others have a definite end point...
```
For example if you want a progress bar with refresh time 05 second, your hgrc should be like this,
```
[dhananjay@dlab orange]$ cat ~/.hgrc
[extensions]
progress =
[progress]
refresh = 0.5
```
Note: This blog is heavily inspired from [http://stackoverflow.com/questions/308491/show-progress-of-mercurial-push-pull](http://stackoverflow.com/questions/308491/show-progress-of-mercurial-push-pull).

View File

@ -0,0 +1,16 @@
---
author: dhananjayishere
comments: true
date: 2012-03-29 18:34:38
layout: post
slug: thamarassery-mountain-pass-wayanad
title: Thamarassery Mountain Pass, Wayanad.
wordpress_id: 116868927
categories: Trips
---
[![Thamarasery](http://dbalan.files.wordpress.com/2012/03/7777a-thamarasery.jpg)](http://dbalan.files.wordpress.com/2012/03/7777a-thamarasery.jpg)
A snap from the recent trip. ;)

View File

@ -0,0 +1,28 @@
---
author: dhananjayishere
comments: true
date: 2012-11-21 21:45:00
layout: post
slug: netbsd-chronicles
title: NetBSD Chronicles.
wordpress_id: 169330104
categories: NetBSD
---
To be frank I wasn't doing much for almost an year, got lazy as one can ever be. Today was the day to break it. Got a little push do something and I got down to do it. I was looking at BSD development for a long time, and thought this is the best time to get involved. I am a total noob at BSD, I never really used one. So it was challenging when I started to install NetBSD into an old Comapq nx6120 that was lying around. I know anyone could get to the root shell easily, with help from brilliant click and go installers, configuring and customizing was the real problem.
Its 0300 now, and I got my laptop running NetBSD 6.0, and connected to wireless (easier than I thought - thanks to legacy hardware.)
**Configuring Intel PRO/Wireless **
** **Unlike linux, BSD can include all the microcode (firmware) in the distribution itself, due the flexibility of licensing system. Reading up _iwi(4)_ reveals youve to accept the EULA by setting the sysctl variable hw.iwi.accept_eula to 1
```
# sysctl -w hw.iwi.accept_eula=1
```
The university wireless is open, so I didnt had to mess too much.
```
# ifconfig ssid "SSID" iwi0 dhclient iwi0
```

View File

@ -0,0 +1,23 @@
---
author: dhananjayishere
comments: true
date: 2012-11-24 05:44:19
layout: post
slug: my-perfect-terminal
title: My perfect terminal
wordpress_id: 169555417
categories:
- GNU/Linux
- ZSH
- Terminator
- Archlinux
- Solarized
---
1. Install [ZSH](http://www.zsh.org/)
2. Install [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
3. Install [solarized](http://ethanschoonover.com/solarized) color theme [~~for gnome-terminal~~](https://github.com/sigurdga/gnome-terminal-colors-solarized). Shifted to [Terminator](http://software.jessies.org/terminator/) with a [base16](https://github.com/chriskempson/base16) theme.
4. Install a [powerline patched font](https://gist.github.com/1595572).
5. Set the zsh theme to [agnoster](https://gist.github.com/3712874).
Happy Hacking. :-)

View File

@ -0,0 +1,43 @@
---
author: dhananjayishere
comments: true
date: 2012-12-06 18:26:00
layout: post
slug: rooting-a-nexus-7
title: Rooting a nexus 7
wordpress_id: 171074083
categories:
- Android
- Programing
- Hack
- Rooting
---
Lot of posts in the web about this is just bogus, all of them want you
to download a fat rootkit and click on the root.exe :-/
Being a developer device, rooting nexus 7 is easy.
1. Gain developer privilege (figure out yourself :-P)
2. Reboot to bootloader
```
$ adb reboot bootloader
```
3. Unlock the bootloader
```
$ fastboot oem unlock # Might have to be the superuser.
```
4. Download the recovery image for device from [here](http://clockworkmod.com/rommanager)
and flash it
```
$ fastboot flash recovery
```
5. Get the [superuser binary](http://forum.xda-developers.com/showthread.php?t=1538053).
6. Reboot the device and put it in the sdcard (or any storage you have,)
7. Reboot to the recovery and flash it.
```
$ adb reboot recovery
```
Note: People suggested using this to [keep root priviliges](https://play.google.com/store/apps/details?id=org.projectvoodoo.otarootkeeper&feature=search_result#?t=W251bGwsMSwxLDEsIm9yZy5wcm9qZWN0dm9vZG9vLm90YXJvb3RrZWVwZXIiXQ..) after OTA -

View File

@ -0,0 +1,37 @@
---
author: dhananjayishere
comments: true
date: 2012-12-12 10:51:00
layout: post
slug: name-your-servers
title: Name your servers.
wordpress_id: 171537089
categories:
- Terminal
- SSH
- GNU/Linux
- Hack
---
If your day involves ssh-ing into various servers, you know how
cumbersome is to type all that details again and again. When the number
becomes large, you tend to confuse between host names, IPs and
usernames.
But, ssh allows you to alias them into cute nicknames you prefer.
The configuration file needed to be edited is ``` ~/.ssh/config. ```
The sample configuration that should be append to this file for adding
alias _server_ to `user@example.org` is :
```
Host server
Hostname example.org
User user
```
Now all you have to do is
```
$ ssh server
```

View File

@ -0,0 +1,19 @@
---
author: dhananjayishere
comments: true
date: 2013-01-01 00:28:00
layout: post
slug: a-thank-you-note
title: A Thank You Note.
wordpress_id: 173304734
categories:
- Life
---
[![4918647118_e1c7e4644f_d](http://dbalan.files.wordpress.com/2013/01/869b2-4918647118_e1c7e4644f_d.jpg)](http://dbalan.files.wordpress.com/2013/01/869b2-4918647118_e1c7e4644f_d.jpg)
Love makes you see the world a lot different than you used to. Life suddenly gets filled with warm glowing colors. Opens up the each and every long sealed corridors of you heart and makes them beat in rhythm, orchestrating a symphony of life. The amount of happiness your life gets filled with might be the real definition of infinity
Being in love is a privilege, Gifted by a heart indeed is the greatest ever. Even parting hearts cant take away your happiness. We loose and keep some fragments and memories weaved in golden threads. For me, they will be sufficient to push the emptiness of existence out for a life time. More than enough to remain in love
_[Photo](http://www.flickr.com/photos/juniperberry/4918647118/sizes/m/in/photostream/) reused under a cc license_

View File

@ -0,0 +1,16 @@
---
layout: post
title: "New Home"
date: 2013-05-03 21:01
comments: true
categories:
- Posterous
- Update
- Octopress
---
I loved posterous. I don't know how I missed it but till the final day I had no clue they were shutting down. It was an hour of panic. I had every itch not to go back to wordpress. It was bloated and just not my thing, and Jekyll was way to much work!
Then I found Octopress - just the right thing, simply perfect. And it was love at first sight. :)
Welcome to my new home, [Backtrace](http://dbalan.github.io)

View File

@ -0,0 +1,100 @@
---
layout: post
title: "Getting started with RTEMS on Archlinux"
date: 2013-05-28 21:24
comments: true
categories:
- RTEMS
- GSoC
- Archlinux
---
The default RTEMS geting started does not cover the toolchain setup as it should be. It either redirects the user to download a ~1 GB distro or some pretty old RPMs. This shouldn't be like this.
There is an excellent tool called ***rtems source builder*** which can help a newbie setup RTEMS environment in a brisk. This post is the authors journal about how he did it, shared beacuse it might be beneficial to people looking to bootstrap RTEMS.
RTEMS is a real time operating system. It works on various type of hardware, and a devlopment setup is specific to the hardware of developers choice. Here I will demonstrate setting up a sparc toolchain with b-sis simulator.
### Setting up toolchain
First step of our RTEMS journey. A toolchain consists of a compiler, linker, debuggger and a simulator for the hardware. We need these tools to compile the RTEMS code and execute our programs.
This was a painful step in past. Cross compiler environments are nasty to get right. But dont worry, we have our wonderful rtems-source-builder to rescue.
rtems-source-builder automates the task of setting up this toolchain - it downloads the source files, builds them and installs in the system. It also have the option to make a tarball.
The actuall steps are documented here - [rtems-source-builder documentation][1], but if you prefer a capsule
- Setup directories and get source
```
$ cd
$ mkdir -p development/rtems/src
$ cd development/rtems/src
$ git clone git://git.rtems.org/rtems-source-builder.git
$ cd rtems-source-builder
```
- Check environment.
```
$ ./source-builder/sb-check
RTEMS Source Builder environment is ok
```
- Build a sparc target
```
$ cd rtems
$ ../source-builder/sb-set-builder --log=l-sparc.txt /
--prefix=$HOME/development/rtems/4.11 4.11/rtems-sparc
```
this will produce binaries in `$HOME/development/rtems/4.11` directory.
__Note__: Default version of makeinfo in archlinux is incomaptible with tools we build, source-builder documentations says
>Archlinux, by default installs texinfo-5 which is incompatible for building GCC 4.7 tree. You will have to obtain texinfo-legacy from AUR and provide a manual override.
```
# pacman -R texinfo
$ yaourt -S texinfo-legacy
# ln -s /usr/bin/makeinfo-4.13a /usr/bin/makeinfo
```
### Building RTEMS
- First obtain the RTEMS code from github.
```
$ cd
$ mkdir -p development/rtems/repo
$ cd development/rtems/repo
$ git clone git@github.com:RTEMS/rtems.git
$ cd rtems
```
- Bootstrap the rtems and build code.
```
$ export PATH=/home/dhananjay/build/rtems/4.11/bin:$PATH
$ ./bootstrap
```
- Build a b-sis simulator code.
```
$ cd ..
$ mkdir b-sis && cd b-sis
$ ../rtems/configure --target=sparc-rtems4.11 --enable-rtemsbsp=sis --enable-tests=samples --enable-posix --prefix=/home/dhananjay/build/rtems/src/
$ make
```
### Running example code.
- Find the sample applications and execute them.
```
$ cd sparc-rtems4.11/c/sis/testsuites/samples/hello
$ ls
hello.exe hello.num hello.ralf init.o Makefile
$ sparc-rtems4.11-run hello.exe
*** GSOC HELLO WORLD TEST ***
Hello RTEMS World
Dhananjay Balan
*** END OF HELLO WORLD TEST ***
```
*Update*: Newer versions of RSB builds RTEMS automatically, no manual intervention needed. You can skip this step altogether.
[1]: http://www.rtems.org/ftp/pub/rtems/people/chrisj/source-builder/source-builder.html "rtems-source-builder documentation"

View File

@ -0,0 +1,10 @@
---
layout: post
title: "Summer of Code 2013"
date: 2013-05-28 12:35
comments: true
categories: GSoC Update RTEMS
---
{% img /images/gsoc_2013.jpg %}
Google published summer of code results yesterday. I am happy that I was selected. My project is titled __Better GDB support for RTEMS__, it is mentored by _Ms. Jennifer Averett_ from RTEMS. You can find [my proposal here](http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/dhananjay/35002).

View File

@ -0,0 +1,40 @@
---
layout: post
title: "Debugging RTEMS with GDB"
date: 2013-06-23 19:40
comments: true
categories:
- RTEMS
- GSoC
- GDB
---
RTEMS is difficult to debug, since the default GDB behaviour follows a language based approch and developer will have to debug the application+RTEMS stack as a whole. We are in process of developing a new set of extenstions for GDB to play nice with RTEMS. The intial code is available in this [github repository](https://github.com/dbalan/rtems-gdb).
To use the extenstion,
- Clone the repository
{% codeblock lang:bash %}
git clone git@github.com:dbalan/rtems-gdb.git
{% endcodeblock %}
- Assuming you have a working [RTEMS toolchain](/blog/2013/05/28/getting-started-with-rtems-on-archlinux/), spin up the GDB and source the code.
{% codeblock lang:bash %}
$ sparc-rtems4.11-gdb
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=sparc-rtems4.11".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) source path/to/clone/__init__.py
RTEMS GDB Support loaded
(gdb)
{% endcodeblock %}
Here is a sneak peak of what will be capable:
{% gist 5428535 %}
{% gist 5488653 %}

View File

@ -0,0 +1,26 @@
---
layout: post
title: "Automatic log-in for ACT Broadband"
date: 2014-08-16 19:14
comments: true
categories:
- scripts
- bangalore
- ACT broadband
---
In my openion [ACT](http://portal.acttv.in) is the best ISP in [Bangalore](http://en.wikipedia.org/wiki/Bangalore), I found this network to be much better than any other provider in terms of reliability and the bandwidth, they seem very hacker friendly too, logging in as straightforward as a simple HTTP POST.
I have this script running in my router so that I never have to bother logging in.
```bash
#!/bin/bash
USERNAME=""
PASSWORD=""
curl --data 'act_username=${USERNAME}&act_password=${PASSWORD}&login=login' \
http://portal.acttv.in -o /dev/null
```

View File

@ -0,0 +1,44 @@
---
layout: post
title: "Syslog on Mac OS X: Cheat Sheet"
date: 2015-02-21 00:41
comments: true
categories:
- mac
- osx
- syslog
- cheatsheet
---
This is a quick cheatsheet to work with [`syslog(1)`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/syslog.1.html) implementation OS X uses.
`Console.app` provides a nice UI to access logs in mac, you can do some basic filtering and search, but its limited in terms of raw control a terminal gives you.
`/usr/bin/syslog` can be used to both send and receive logs. Alternatively [`logger(1)`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/logger.1.html) can be used to send logs to syslog.
## Print logs from a specific facilitiy
```bash
# -w: similar to tailf
syslog -k Facility local1 -w
```
## Sending logs
```bash
# -l severity level
syslog -s "message"
```
## Sending logs upstream to another syslog server
Syslog can forward your logs too. The configuration resides in `/etc/syslog.conf`. You can append forwarding rules in this file, format is
```
# Tab separated
Facility.Level @IPADDR:PORT
```
After this reload syslog daemon.
```
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plistp
```
# Extra reading
1. [`asl.conf(5)`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/asl.conf.5.html) - Configuration file for Apple Syslog Log (A syslog superset apple implements), this is where all the logic to route logs are set
facility.level

View File

@ -0,0 +1,26 @@
---
layout: post
title: "State of Terminal: 2015 Edition"
date: 2015-03-28 00:28
comments: true
categories:
- computing
- emacs
- osx
- terminal
- zsh
---
I do this every year to keep track of the changes in my style. This is the first that goes public though
- I've moved to a __Macbook air 2013__ edition as my primary laptop (a work perk, thanks [@plivo](https://twitter.com/plivo.com)).
- __Emacs__ is the primary editor - I use [el-get](https://github.com/dimitri/el-get) to manage my emacs packages (my `init.el` is [hosted here](https://github.com/dbalan/.emacs.d/blob/master/init.el)), I also use [`mg`](http://homepage.boetes.org/software/mg/) heavily while I'm inside a terminal.
- __iTerm2__ for terminal. (My [cheetsheet for for iterm is availabe here](https://gist.github.com/dbalan/378d2f3e4e6a27f0aae8))
- __zsh__ for shell, with [antigen](https://github.com/zsh-users/antigen) managing plugins and dependencies.
- __vagrant__ for VMs, I tried using `docker` with boot2docker, but my needs are diffrent. I just need a linux box that runs all the time.
- [__Spectacle__](http://spectacleapp.com/) to manage windows. (Yes, I do miss Xmonad and i3)
- __Firefox__ is the primary browser, sometimes __chromium__ running for some special sites and tasks.
- __Todoist__ is a great app to track todo lists, and the concept of gaming the task completion frequency and awarding points is a joy!
- __Evernote__ everything goes inside this.
- __KeePassX__ manages all my passwords.
- __Tarsnap__ for backups, nuff said.

View File

@ -0,0 +1,130 @@
---
layout: post
title: "Notes on cgo"
date: 2015-03-29 00:28
comments: true
categories:
- golang
- c
---
## Referencing c from go.
### Basic operation
import "C" imports the C namespace into go, the comment just above this statement is treated as C.
```c
/*
#include "add.h"
*/
import "C"
```
Everything you exported from c library is available in the C namespace.
```go
func main() {
fmt.Println(
C.add_two_numbers(3,4)
)
}
```
Building code is as easy as `go build`
Accessing standard types are easy as `C.char`, `C.int`. For complex types, prepend the type name with an underscore at end e.g `C.struct_stat`.
### Pointers and memory operations
Go provides an `unsafe` module. Gos GC cannot manage the memory allocated in C code, you should call `C.free(unsafe.Pointer)` (`free` is defined in `<stdlib.h>` ensure that this library is imported) to deallocate.
There are some special functions which convert Go types to C types and vice versa. (lifted from cgo documentation)
```go
// Go string to C string
// The C string is allocated in the C heap using malloc.
// It is the caller's responsibility to arrange for it to be
// freed, such as by calling C.free (be sure to include stdlib.h
// if C.free is needed).
func C.CString(string) *C.char
// C string to Go string
func C.GoString(*C.char) string
// C string, length to Go string
func C.GoStringN(*C.char, C.int) string
// C pointer, length to Go []byte
func C.GoBytes(unsafe.Pointer, C.int) []byte
```
### Accessing complex objects
Accessing structs from Go
```go
/*
struct person {
int age;
*/
// this can be used in go as
var p C.struct_person
p.age = 23
```
You can also pass pointers
```go
C.function_accepts_ptr_to_struct(&p)
```
Accessing Unions : No native counterpart, instead of converting it to a type, go treats them as a block of memory represented as byte array. Accessing data is done by casting unsafe.Pointer
```go
/*
union quant {
float weight;
int count;
};
*/
var q C.union_quant
ptr := (*float32)(unsafe.Pointer(&q))
*ptr = 3.14
```
## Extra goodies
### Compiler Flags
Compiler flags can be set using the `#cgo` directive. (`CFLAGS`, `LDFLAGS` etc)
```go
/*
#cgo: LDFLAGS: -lmath
#include <math.h>
*/
import "C"
```
### Restricting building
In many cases using cgo breaks the portability of your app, use build constraints to specify compatibility in source. Build constraints are comments which begin with
```go
// +build
```
Now, build comment must appear before package clause and should be followed by a blank line To restrict building just to Linux with cgo,
```go
// +build linux,cgo !darwin
package main
```
These are evaluated as `OR` of each constraint so the above line becomes `(linux AND cgo) OR (NOT darwin)`, also multiple build tags can be embedded in file.
There are other methods to restrict builds, see references.
## Reference
- [Link to example code gist](https://gist.github.com/dbalan/ace29f0c43638ee4f81d)
- [cgo Talk by Rajesh Ramachandran (Gophercon India)](https://www.youtube.com/watch?v=oeEVtyypYPg)
- [Conditional compilation with go build](http://dave.cheney.net/2013/10/12/how-to-use-conditional-compilation-with-the-go-build-tool)
- [cgo compiler directives](http://golang.org/cmd/cgo/)

View File

@ -0,0 +1,18 @@
---
layout: post
title: "Static site generators"
date: 2015-06-30 00:28
comments: true
categories:
- blogging
- octopress
- meta
---
I use octopress with github hosting my pages.
Everytime I sit down to write, I have to look up commands in my bash history and read documentation. Its very distracting when you just want to write.
Maybe its my workflow thats wrong, I should replace all this with a set of small shell scripts :-P, maybe octopress 3.0 (insert another tool) will solve this.
But at this point I dont even remember which branch in my repo has what, and I should switch to a firendlier paltform (ghost or posthaven) or do a massive cleanup ASAP.
_EDIT: I finally managed to do that clean up_

View File

@ -0,0 +1,23 @@
---
layout: post
title: "Recursion"
date: 2015-08-22 00:28
comments: true
categories:
- haskell
- recursion
- fibonacci numbers
---
```haskell
fibonacci :: [Integer]
fibonacci = 1:1:(zipWith (+) fibonacci (tail fibonacci))
```
Above is a simple function that generates an infinite stream of fibonacci numbers. Its written in haskell.
This is a piece of code that made me think a lot lately, it make clever use of recursion to define the stream and computes with a linear number of additions. I think its pretty damn sexy!
## Notes:
- Many thanks to a co-worker who helped me figure this out.
- I hear that there are more efficient ways to compute fibonacci numbers (namley O(logn)). - should investigate this

View File

@ -0,0 +1,37 @@
---
layout: post
title: "A Random rant"
date: 2015-12-01 00:00
comments: false
categories:
- life
- rant
- filesystems
---
```
/me sets +rant
```
Yesterday, Found an old portable hard disk in the attic. Face lights up. Connect to computer, doesnt work. The connection probabaly fried. Its probabaly the connector, HDD internally uses a `SATA` bus.
I know what to do, lets oopen the server box and connect to the motherboard. Cant find any SATA cable. `find sata ~house`
Finally hard disk plugged in, `FreeBSD` boots. `dmesg` shows everything is alright, except `ext4`. #sigh
Somebody suggests `fuse`. Alright, thats it then. Compile, `kldld` and booyeah!
Okay, its full of photos from past. Wow! I need to see them, lets share it to something with a monitor. Thatd be my mac. `sshfs`? Sorry dude, you need the whole `XCode` suite and should sacrifice an extra kidney to load unsigned `kext`s.
But there are other ways of sharing files. `SMB` FTW!
Why the fuck are there three samba versions in ports. `cd /usr/ports/samba$(random_ver)`
Okay, samba is setup and mounted, tears
Nooo - I cant access the hard disk. Why? huh perms fucking perms!
I got this! gonna chmod the shit out, but except… it doesnt work. What the fuck does not implemented mean?
JFGI. JFGI POints to ext4 code - ext4 fuse is strictly read only. (facepalm)
Story still continues…

View File

@ -0,0 +1,46 @@
---
layout: post
title: "Swanthathralokam '15"
date: 2015-12-28 12:52
comments: true
categories:
- rationality
- malayalam
- trivandrum
- freethought
---
_[Swathathralokam '15](http://swathanthralokam2015.com/) was a conference on rationality and free thought that happened during 24th and 25th of december 2015_
This was my first experience of attending a non tech conference. Also, first one with malayalam as the primary language. I have been to conferences which dealt with intersection of technology with other things, like hillhacks and hackbeach. But SL caters to an entirely different crowd.
I was the only one actively using a laptop, first stint of culture difference. At Least I could tether my mobile internet without interfering wifi APs. Except two of the linux boxes organisers were running, everything else was windows. I guess desktop linux has to catch up a lot more than I previously thought.
SL is put together by an organisation called “Kerala Freethinkers Forum”, the way this community has come together using social media, esp facebook is amazing. It did push my dilema further about maintaining a facebook account. Definitely delayed the decision to eventually delete the account. Some more thinking is needed.
The conference had around 20 talks spanned over two days, I found the talks to be dense, more than my feeble brain could process. I had to take an extra break between talks (sadly, missing a part of next one) to reflect on the newly obtained information.
Language was a barrier. Malayalm has become a bit more cumbersome to process. I seem to have lost the fluidity in using it, like a machine that has kept unused for long. At this moment giving a formal talk is way too hard for me (this was also, my first malayalam talk)
I found that out during my ten minute pitch of [Nemos Bug bounty for homeopathy](http://captnemo.in/homeopathy/). I had to switch languages - which I'm afraid got interpreted as an elitist talk. Anyway, it did produce results. I got to meet [Dr. Manoj Komet](https://www.researchgate.net/profile/Manoj_Komath) who has written [many articles against homeopathy](http://yukthiyugam.com/tag/manoj-komath/) and state of health sciences in general. I am going to go through all the content he pointed out and do something about it.
I got [one more donor for bug bounty](https://github.com/captn3m0/captn3m0.github.com/pull/8) as well. :-)
These were my favourite talks from SL -
Megha's talk on __"Phantoms in human nature"__ was a spot on because I just finished _"Thinking fast and slow"_ and was scouring _LessWrong_ for more content. She did a good job of explaining. I enjoyed talking to her post session very much.
Nishad's Talk on __"Wason selection task and rational thinking"__, He introduced wason selection task and went ahead to explain _Necessary and sufficient conditions_. The simplicity in which he introduced the math behind was amazing.
__"Luca, Luci and me"__ was a talk by Dr. KP Aravindan on evolution. It was refreshing to go through those contents again. It made me dig up my old notes from my brilliant genetics teacher [a grad student in genetic engineering at that time] and refresh them when I was home.
_I was told that recordings will be uploaded to youtube soon. Will try to link them as soon as they are up._
There was an open forum on _"Family and rationality"_. I felt it contained way too much anecdotal statements (of kind “I have this experience so I support this worldview of family”). It was also loosely structured, making it a bit difficult to follow. I guess that's the difference between a debate and an open forum(?). I don't think it helped me much. I would have been much happier with a proper debate with bit more moderation. The gender parity was at the forum was another concern. There were fewer women speakers.
Last but not least, I did encounter some cool tech in the conference venue. The org tech team, [Rahul](https://www.facebook.com/2ar.rahul), [Abhay](https://www.facebook.com/abhai.sasidharan), and [Akhil](https://www.facebook.com/profile.php?id=100009322327244&fref=ts) setup a [live feed using gstreamer](https://gist.github.com/ar-rahul/50b5044aca38918223e7). They used UDP multicast to stream the feed to monitors in surrounding buildings. It worked very well, except for a bit noisy audio signal due to poor earthing.
Overall, it was a nice conference,met a lot of old friends, made few new ones. perfect way to start the winter break.

View File

@ -0,0 +1,132 @@
---
layout: post
title: "go: `:=` operator causes accidental shadowing"
date: 2016-01-14 21:13
comments: true
categories:
- go
---
Go provides `:=` operator to make declaring variables easier. It is a [shorthand to declare and set a value of a variable](https://golang.org/ref/spec#Short_variable_declarations). for example,
```go
var x int
x = 42
```
can be written as
```go
x := 42
```
But if not careful, this can accidently shadow variable bindings. Let's look at the fictitious piece of code.
```go
package main
import "fmt"
func fictitiousFunc() (int, error) {
return 42, nil
}
func main() {
x := 10;
x, err := fictitiousFunc()
if err != nil {
fmt.Println("I'll never print")
}
fmt.Println("value of x: ", x)
}
```
This produces following output
```
value of x: 42
```
While, this following piece of code will fail to compile
```go
package main
import "fmt"
func fictitiousFunc() (int, error) {
return 42, nil
}
func main() {
x := 10
// replace :=
var x int
var err error
x, err = fictitiousFunc()
if err != nil {
fmt.Println("I'll never print")
}
fmt.Println("value of x: ", x)
}
```
output:
```
prog.go:12: x redeclared in this block
previous declaration at prog.go:10
```
So we can see that the operator is somewhat intelligent, and does not redeclare the variables.
Now what if we push it down a scope? See the following code
```go
package main
import "fmt"
func fictitiousFunc() (int, error) {
return 42, nil
}
func main() {
someCondition := true
x := -1;
if someCondition {
x, err := fictitiousFunc()
if err != nil {
fmt.Println("I'll never print")
}
fmt.Println("value of x inside: ", x)
}
fmt.Println("value x outside: ", x)
}
```
This produces,
```go
value of x inside: 42
value x outside: -1
```
At line: 16, since the immediate scope (line:15-32) does not have variable `x` declared, `:=` is redeclaring the variable. a.k.a the __variable `x` gets shadowed__.
Only workaround I can think of is not to use `:=`, i.e change the code to
```go
if someCondition {
var err error
x, err = fictitiousFunc()
if err != nil {
fmt.Println("I'll never print")
}
fmt.Println("value of x inside: ", x)
}
```
If you know something better let me know.

View File

@ -0,0 +1,60 @@
---
layout: post
title: "Finding a programming job"
date: 2016-03-31 17:01
comments: true
categories:
- progamming
- job
---
** TL;DR** My learning from job hunting as a programmer._
Sometime ago I decided that I need a change of scenery and decided to look for new gigs.
My current job is my first real job after university. Looking back, now that I've more experience of the hiring process, I feel landing it was ridiculously easy ! So you can see job hunting is a quite new territory for me. This is in no way a definitive guide for finding a job; merely my experience.
I've couple of friends who insist it's a sellers market - but there are lot more variables that are at play.
The first obvious approach was to apply to all the companies I care about. Fill up the forms in `https://company.com/careers`. Turns out this is far from truth. Almost no one replied, so I started scouring job boards.
Here is the data from my experiments
{% img /images/job_hunt_plot.png %}
I did my due diligence before applying to these companies, reading the job description thoroughly, googling a bit about the engineering, etc. Even then, the conversion rate to an interview is really really small. Most of the organisations don't reply at all.
This are the things I picked up from my efforts -
## Write a good cover letter.
This is really important if you are applying via email. In the beginning, my cover letters were mostly focused on my interest in the position and organisation with resume which talked about the profile and work experience. The moment I started moving more info into the cover letter, response rate increased. Its OK if you end up duplicating information, try to cram more info onto the letter without increasing the word count much.
Also, be very open about your status, if you'd need sponsorship for VISA, mention it in the beginning itself, saves time for both you and the organisation.
## Automate all possible things
Nobody has time to write a billion emails and manage regular work, so automate them. In my case I separated my cover letter into parts that are common and specific to a position.
Then I wrote a small script that reads the email and the specific bits from an spreadsheet and sends out application emails.
## Use the network
This is so far the best option to search for a job. Friends can give you a direct connection to a prospective employer. Also, conversion rate is really huge because the recommender often has a good idea about job and the candidate.
## Find a real person
The job descriptions usually is too generic and most times there'll be hidden requirements. Find a direct contact in the company and ask about their current stack, engineering workflow and exact needs. This person can also turn out to be your biggest ally in the process.
## Get a good calendar application
Interviews mean lots of meetings spanned across multiple time zones, so add everything to a calendar and stick to it. Pay extra attention to time zone conversions.
## Get over with rejection
There are plenty of reasons to get rejected, and it may not be anything you control. Maybe the company is going through a restructuring, maybe the position is no longer available or the all time favourite VISA restrictions.
Important thing is to get feedback so that you can fix all possible issues. [Interviewers are generally hesitant to give feedback](https://www.quora.com/Why-do-interviewers-refuse-to-give-valuable-feedback-to-rejected-candidates-after-interviews). But there is no harm in asking.
_thanks [@technikhil](https://twitter.com/technikhil), [@imdonatello](https://twitter.com/imdonatello), [@tsudot](https://twitter.com/tsudot) and [@\_gsin\_](https://twitter.com/_gsin_) for reading the draft._

67
site.hs Normal file
View File

@ -0,0 +1,67 @@
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid (mappend)
import Hakyll
--------------------------------------------------------------------------------
main :: IO ()
main = hakyll $ do
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler
match (fromList ["about.rst", "contact.markdown"]) $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
create ["archive.html"] $ do
route idRoute
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let archiveCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Archives" `mappend`
defaultContext
makeItem ""
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
>>= relativizeUrls
match "index.html" $ do
route idRoute
compile $ do
posts <- recentFirst =<< loadAll "posts/*"
let indexCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Home" `mappend`
defaultContext
getResourceBody
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls
match "templates/*" $ compile templateBodyCompiler
--------------------------------------------------------------------------------
postCtx :: Context String
postCtx =
dateField "date" "%B %e, %Y" `mappend`
defaultContext

67
stack.yaml Normal file
View File

@ -0,0 +1,67 @@
# This file was automatically generated by 'stack init'
#
# Some commonly used options have been documented as comments in this file.
# For advanced use and comprehensive documentation of the format, please see:
# http://docs.haskellstack.org/en/stable/yaml_configuration/
# Resolver to choose a 'specific' stackage snapshot or a compiler version.
# A snapshot resolver dictates the compiler version and the set of packages
# to be used for project dependencies. For example:
#
# resolver: lts-3.5
# resolver: nightly-2015-09-21
# resolver: ghc-7.10.2
# resolver: ghcjs-0.1.0_ghc-7.10.2
# resolver:
# name: custom-snapshot
# location: "./custom-snapshot.yaml"
resolver: nightly-2016-10-31
# User packages to be built.
# Various formats can be used as shown in the example below.
#
# packages:
# - some-directory
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
# - location:
# git: https://github.com/commercialhaskell/stack.git
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a
# extra-dep: true
# subdirs:
# - auto-update
# - wai
#
# A package marked 'extra-dep: true' will only be built if demanded by a
# non-dependency (i.e. a user package), and its test suites and benchmarks
# will not be run. This is useful for tweaking upstream packages.
packages:
- '.'
- '../../public/hakyll'
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps: []
# Override default flag values for local packages and extra-deps
flags: {}
# Extra package databases containing global packages
extra-package-dbs: []
# Control whether we use the GHC we find on the path
# system-ghc: true
#
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: ">=1.3"
#
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
#
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
#
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor

2
templates/archive.html Normal file
View File

@ -0,0 +1,2 @@
Here you can find all my previous posts:
$partial("templates/post-list.html")$

33
templates/default.html Normal file
View File

@ -0,0 +1,33 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Hakyll Blog - $title$</title>
<link rel="stylesheet" href="/css/default.css" />
</head>
<body>
<div id="header">
<div id="logo">
<a href="/">My Hakyll Blog</a>
</div>
<div id="navigation">
<a href="/">Home</a>
<a href="/about.html">About</a>
<a href="/contact.html">Contact</a>
<a href="/archive.html">Archive</a>
</div>
</div>
<div id="content">
<h1>$title$</h1>
$body$
</div>
<div id="footer">
Site proudly generated by
<a href="http://jaspervdj.be/hakyll">Hakyll</a>
</div>
</body>
</html>

7
templates/post-list.html Normal file
View File

@ -0,0 +1,7 @@
<ul>
$for(posts)$
<li>
<a href="$url$">$title$</a> - $date$
</li>
$endfor$
</ul>

8
templates/post.html Normal file
View File

@ -0,0 +1,8 @@
<div class="info">
Posted on $date$
$if(author)$
by $author$
$endif$
</div>
$body$