Skip navigation

I have been working on a project which used composer to manage dependencies. If you are a PHP developer and do not know about it, I think you
should learn about it. If you happen to worry about the combination in the topic, that means you are already using composer. Great.

In a project I was working on at work was using composer and composer.phar was added to the version control (we use git). Composer.phar is a binary file that would change sometimes when you run

php composer.phar self-update

I didn’t like the idea of having a binary file in version call that would occasionally require a pointless commits in the history. So I went reading about what’s the right thing to do. It was bit of a messy subject but finally I decided that there is no point of adding composer.phar to version control.

Also I found that composer.lock should be in version control (which was not in the project I mentioned). So here it is right from the horse’s mouth.

Commit your application’s composer.lock (along with composer.json) into version control.

This is important because the install command checks if a lock file is present, and if it is, it downloads the versions specified there (regardless of what composer.json says).

So you add composer.lock to version control but keep composer.phar out of it. But what about when you want to use composer.phar? You just get it with

wget -O - https://getcomposer.org/installer | php

Maybe add the instructions to the project’s README file. Also add it to .gitignore to avoid accidents from colleagues who do ‘git add .’

So if you were losing sleep over this, I think now you know what to do.

The music lover in me was heart broken with the famous Amarok screw up waaay back then. I then used Cmus for a short period and then came across MoC (Music on Console) on crunchbang forums IIRC. MoC was my primary music player ever since. In MoC I would just browse to my music directory and play a song. MoC will keep playing all the music there. This was just the behavior I needed. Yes it supports play-lists but I never looked in to it.

There was a time I was obsessed with simple lightweight command line apps. In my search I found stjerm and I fell in love with it. I use it to date but only for one thing, as a home to MoC. MoC and stjerm are a nifty combo I must say.

One of those boring evening at works I realized I need to bind my multimedia keys to work with MoC. This completed the ‘The thinnest music interface’ for me.

I am using Ubuntu so I am going to show you how to get the TMI setup on Ubuntu.

First you need to install MoC and stjerm.

sudo apt-get install moc stjerm

You can run MoC with the command mocp and quit it with Q. h for help. Check my dotfiles for my moc configuration.

Then you can customize how stjerm looks and assign a keyboard shortcut to it. Oh and have it load on startup.

Following command will run stjerm with f12 function key bound to it and with mentioned opacity and font colors.
stjerm -k f12 -o 60 -fg 66ff11

Adding following line to your startup applications would run this at the startup, automatically.
/usr/bin/stjerm -k f12 -o 60 -fg 66ff11

adding-stjerm-to-startup-programs

Adding stjerm to startup programs

Then comes binding keys. You can add custom keyboard short cuts (System Settings > Keyboard > shortcuts) and bind key combinations to following commands.
mocp -f
mocp -r
mocp -G
mocp -s

Those are for previous, next, play and stop in that order.

keyboard-shortcuts-for-mocp

Add keyboard shortcuts for mocp

I really like this setup for my music.

Aaron Swartz has committed suicide. That news struck me hard. I only know him from his web presence but when something came up on my radar with Aaron’s name tag on it, I expected it to be good if not great. I thought he was a wise old man until I found today that he is of my age. Shocker!

This got me thinking. First, he is orders of magnitudes accomplished than I am. second, he is not there anymore. He broke. I can’t help debating with voices in my head about suicide.

I strongly believe suicide is never the answer. What made me think so? I believe there are two reasons. My father was strongly anti suicide. He even refused to attend the funeral of a suicide victim. Now he is not that extremist about it and I don’t know how wrong he was back then but he obviously had a great influence on me. The other reason is one of many ‘religious facts’ I was exposed to in my young age. I am a Buddhist and they said that suicide is one of the greatest sins. Those ideas have apparently made a significant impact on how I look at life.

Suicide is apparently something that happens too frequently in social circles I take part in. The last one that had me concerned was the death of Ilya Zhitomirskiy who was a co founder of Diaspora social network. His death had an effect similar to what I’m currently going through. I was thinking about sucide. In my soliloquy I realized I’m kind of afraid of suicide [Not death. Mind you.] I won’t ever be able to do that to myself. I will fight the fights, veer through the struggles, drag my emotional self thorugh cold and dark caverns of life but not suicide.

One of those days I felt ‘content’, I read about a long prison sentence. I was imagining that happening to me. Spice that up with a crime I never did. I was scared shitless. I thought a long enough confinement would make my life meaningless that I’d rather die. Would I suicide? I couldn’t make up my mind.

Again I was thinking of a time I lose everything that makes me what I am. Losing these abilities to walk, to talk, to think and code. To dream, to laugh, to sing and smoke (just to make it rhyme. Seriously!). That’s scary to be stuck in the cave that is my body. I’d prefer getting euthinized at this stage. See, it’s not suicide. I’m not doing that to myself.

Whichever route I take in my wanders in my thought space, I never ended up at suicide. It’s not a rational move in my book. But taking all those journeys I realized that to one who does not have a mind hardened enough, suicide may very well look like a good option. Even the best. The one last winning move.

The truth is it is not.

“Treasure your life for all the adventures it may take you through.”

PS: I don’t pretend to be that I can walk in the same boots of those who made the wrong decision. I don’t say my thought expeditions are any close to the real shit one would go through. I don’t say I have it all figured out. I just say that I wouldn’t ever make THAT wrong decision. I would not. Check back when I die.

I was always worried about having to go up in a unix directory tree with cd ../. Then I was introduced to this project at work where I noticed that I was doing so much cd-ing around. Sometimes I went so deep in the directory tree I had this scary feeling inside that I’d get lost in a dark pit (true story).

I wanted a better way to do it. So I did what anyone these days would do. But the best the internet could offer were using pusd/popd, aliasing multiple ../s to ..n and using CDPATH. None of these felt natural enough.

So on one boring evening at work I started to scratch my own itch. I started to do it in python but I ended up in a simpler, much better solution. A function for my bashrc.

I call it za because …

cd to za

cd to za (image: markhillary flickr)

you can use za to jumpback any number of directories up to your $HOME directory. Just put the following function in your .bashrc

za 2 #will jump 2 directories up
za #will jump one directory up

Just see it in action.

za-in-action

za in action

Hope you find it useful.

PS: My blog marked 6 years to yesterday (8th August 2012). I’m out of (a year?) long block with this post :)

Update (07-03-2014): There’s a Fish Shell port of Za now.

You were the father of C which definitely changed the world. You created Unix with Ken Thompson and it was probably the most important piece of technology for practical computing.

some great people are great because they make their greatest contributions to the world and leave silently. You good sir will forever live in hearts of boring nerds like me.

[No picture. Because I don't remember you from your photo. I remember you as some sort of a super power that rules a green on black world.]

Thank you for C. Thank you for Unix. Thank you for a computing environment that is comfortable for boring nerds.

Rest in peace.

Follow

Get every new post delivered to your Inbox.

Join 1,048 other followers