zsh is really awesome

Jan 31 2012

A few months ago, I decided to try out zsh as my default shell. It’s very similar to bash, but is much more powerful. My favourite features so far:

  1. Shared command line history among all sessions. I usually have at least 4-5 shells open, and the command history being shared among them is awesome. Means I don’t have to hunt in which shell I typed that huge pipe command, it’s just available across all the shells!
  2. Better file globbing. ls **/, simulates find. Replacing ls by another command is equivalent to find -exec. Less typing!
  3. Programmable prompt.  My zsh shows the git/svn branch name in the prompt itself.  People have gone so far to have written a prompt which displays the battery status right there. One word, zsh is extensible, very extensible. zsh also has two prompts, one which appears on the left side (the normal one), and another on the right side.
  4. Auto-completion built in. bash-completion offers many of the auto completion features, but zsh has far more commands in the list.
  5. Command arguments expansion. Pressing tab on a command with wildcards/backtick commands expands them. So something like ls *avi, will actually fill in in all the .avi files in the prompt, so I know what’s going on.

You don’t even have to bother with your zshrc

My zsh experience improved ten-fold after I installed robbyrussel’s oh-my-zsh. Setting it up is just two commands (and another for changing your default shell):

oh-my-zsh will provide plugins (git, yum, deb, svn etc) , themes (I currently use afowler), a lot of sane configuration options, and better keyboard shortcuts.

 

You won’t go back to bash once you use zsh. :)

 

No responses yet

Permission Denied

Nov 05 2010

Update: The problem is solved now, it was because the parent directory had the +i flag set.

I ran into a weird problem today. I was cleaning up disk space and ran into a file that refused to delete.

geekbox:/media/7/ # rm file.iso

rm: cannot remove `file.iso’: Permission denied

No problem, huh? Did everything I could think of:

geekbox:/media/7/ # rm -f file.iso

Permissions?

geekbox:/media/7/ # chmod 777 file.iso

geekbox:/media/7/ # chown root:root file.iso

geekbox:/media/7/ # rm -f file.iso

rm: cannot remove `file.iso’: Permission denied

Filesystem problems?

geekbox:/media/7/ # fsck -f /dev/sdc2

7: 194131/31514624 files (0.3% non-contiguous), 119735268/126050006 blocks

Corrupted file?

geekbox:/media/7/ # dd if=file.iso of=/dev/null

7472920576 bytes (7.5 GB) copied, 302.342 s, 24.7 MB/s

Immutable bit set?

geekbox:/media/7/ # lsattr file.iso

————-e- file.iso

strace points me to this:

unlinkat(AT_FDCWD, “file.iso”, 0) = -1 EACCES (Permission denied)

I got my disk space back at least,

geekbox:/media/7/ # echo “” > file.iso

But now I’m stuck with a file I don’t know what to do with.

2 responses so far

TV Shows

Sep 10 2010

Inspired by Rohan, I too decided to make a list of the TV shows I have seen/currently seeing. And (hopefully) by the end of next three years, I will have caught up on him. ;) (The numbers in the bracket are the number of seasons seen).

Comedy:

  1. Friends (10/10) – It’s a good comedy, but the way people watch it over and over again makes me cringe.
  2. That 70′s Show (8/8) – I loved it, though it gets a bit boring halfway through.
  3. The IT Crowd (4/4) – Already a post dedicated to it.
  4. Happy Days (4/11) – I like watching old series, and seriously, The Fonz is awesome.
  5. Mind Your Language (1/3) – Gets very repetitive.
  6. The Cosby Show (8/8) – This is one show that gets better with each season, though it has does have its share of boring episodes.
  7. It’s Always Sunny in Philadelphia (1/5)
  8. The Big Bang Theory (3/3) – Ranks next to The IT Crowd.
  9. Cheers (3/11)
  10. Lucky Louie (1/1) – Why did this one last only one season?

Animation/Anime:

  1. Dragon Ball (all)
  2. Dragon Ball Z (all) – Frieza saga sucks, but the rest is very good.
  3. Dragon Ball GT (all) – Worth watching if you like the first two.
  4. Detective Academy Q (1/1) – The first anime I ever saw, the mysteries are totally amazing.
  5. Avatar: The Last Airbender (3/3) – I found this a bit cliched.
  6. South Park (14.5/14.5) – Some episodes are insanely funny, but quite a lot are bland (lots of Western cultural references).
  7. Star Trek: The Animated Series (2/2)

Mystery/Thriller/Action:

  1. Sherlock (1/1) – A very intriguing reboot of the old Sherlock.
  2. Sherlock Holmes (2/7) – The old series, faithful to the book as far as I have observed.
  3. Spartacus: Blood And Sand (1/1) – One of the best series in the last season. Looking forward to the next season.
  4. Star Trek: TOS (3/3) – A very good series considering it’s close to 50 years old.
  5. Star Trek: Enterprise (4/4) – I started with this series, it’s nowhere near to the others.
  6. Star Trek: Deep Space 9 (2/7) – The starting is boring, but I have been told it picks up in the 3rd season.
  7. Star Trek: The Next Generation (7/7) – The best of the canon. I wish there were more episodes.
  8. Mission Impossible (2/7)
  9. Xena: Warrior Princess (1/6)
  10. Heroes (4/4) – Only the first season is worth watching.
  11. 24 (7/8) – Started off good, but got boring and slow as it progressed.

3 responses so far

The IT crowd

Apr 26 2010

…. is  an awesome sitcom. 18 episodes of pure humor. If you have not seen it yet, go get it and watch it.

And now, a true incident that happened today (inspired by The IT Crowd, of course).

I happened to go to the server room today.

JP: We are, izzin, having some issues, izzin, with the faculty mail server. It’s, izzin, giving input/output errors, izzin with the disk, izzin.

I (trying very hard to keep a straight face): Did you try turning it off and then turning it back on again?

5 responses so far

How To: Using CoreAVC on Linux for fast HD video playback

Mar 31 2010

CoreAVC is a fast proprietary codec for decoding H.264/AVC video. It enables low-end systems to play videos without any lag, present in other decoders.

Step 1: Preparing for installation

  1. First of all, remove any existing MPlayer installations. On OpenSuSE this can be done by:
  2. zypper rm MPlayer

  3. Next, install the dependencies for MPlayer by

    zypper si -d MPlayer

  4. Install wine

    zypper in wine

Step 2: Install dshowserver

  1. Install CoreAVC. You will need a licensed copy to get beyond this step.

    wine CoreAVC-Setup.exe

  2. Download the source:

    svn co http://coreavc-for-linux.googlecode.com/svn/trunk/ coreavc-for-linux
    cd coreavc-for-linux/dshowserver

  3. Compile and install:

    make && make install
    sudo cp “$HOME/.wine/drive_c/Program Files/CoreCodec/CoreAVC Professional Edition/CoreAVCDecoder.ax” /usr/local/share/dshowserver

  4. Verify whether dshowserver is installed correctly

    dshowserver -c CoreAVCDecoder.ax

    should show something like:

    Starting wine dshowserver.exe.so
    No id specified, assuming test mode
    Using default width for CoreAVCDecoder.ax: 1280
    Using default height for CoreAVCDecoder.ax: 720
    Using default fourcc for CoreAVCDecoder.ax: 0×34363248
    Using default outfmt for CoreAVCDecoder.ax: 0×30323449
    Using default outbit for CoreAVCDecoder.ax: 12
    Using default GUID for CoreAVCDecoder.ax: 09571a4b-f1fe-4c60-9760de6d310c7c31
    Opening device (port is 0)
    len: 992
    ProductVersion: 2.0.0
    fixme:thread:SetThreadIdealProcessor (0x8c): stub
    fixme:thread:SetThreadIdealProcessor (0×90): stub
    Decoder supports the following YUV formats: YUY2 UYVY YV12 I420
    Decoder is capable of YUV output (flags 0x2b)
    Setting fmt
    Starting
    Initialization is complete

Step 3: Install Mplayer

  1. Download the source:

    cd ..
    wget http://www.mplayerhq.hu/MPlayer/releases/mplayer-checkout-snapshot.tar.bz2
    tar xvjf mplayer-checkout-snapshot.tar.bz2
    cd mplayer-export-*

  2. Patch the source:

    patch -p0 < ./mplayer/dshowserver.patch

  3. Compile and install. Grab a cup of coffee while it compiles, it takes a few minutes.

    ./configure && make && sudo make install

Step 4: Final steps

Copy this codecs.conf to your $HOME/.mplayer/ directory.

Test out playback with

mplayer -vc coreserve <filename>

No responses yet

How to study at IIIT @ Rs. 100

Mar 27 2010

Last year’s recession and this years budget have left a big hole’s in people’s pockets. So, here I (thanks to Sanrag) bring to you a once in a lifetime opportunity to study at IIIT-H for Rs. 100.  (Of course, if you are a heartless monster, you can pay Re. 1 and still get away).

Ingredients:

You must be an “abroad” student (or get a Camouflage passport) and Fire{fox,bug}

Recipe:

1) Fill up the main form. The form field at bottom is edited by Firebug.

The “form input sanity check” which is done by Javascript, is also bypassed, so empty fields work.

Step 1

2) After clicking on next, you are redirected to the payment page

3)

4) Final step, enter your details and get ready for admission in IIIT.

PS: Although there is supposedly a “criteria” for admission, but knowing IIIT, you will surely get admission.

13 responses so far

My reply to Prof. Sangal’s post

Jan 17 2010

If you have not already read the post, The Al-Qaeda of Jeevan Vidya,  by Rishabh and Prof. Sangal’s reply to that post, Prof. Sangal’s reply to “The Al-Qaeda of Jeevan Vidya”, then I suggest you read them first because my post is a direct response to Prof. Sangal’s reply.

1) You’ve mentioned four conditions that were laid before you chose human values. I don’t remember the content of Jeevan Vidya shivirs, and though I’m sure you can prove that it satisfies the conditions, but that is no means to measure the success. Satisfying the conditions is only the theoretical aspect, I may say. Today, if I look at Human Values from a practical part, I dare to say that it has failed to capture the interests of the IIIT student masses and thus, is not successful.

2) JV probably doesn’t preach us to do things. I don’t remember. It tells a thousand things during a week’s shivir, any normal person is bound to like a few of them. That is, by no means, a measure of JV’s success. Many of the things discussed in JV are already known to the person, and if he has already chosen not to apply them in his life, then there is no use preaching these things to him.

3) I think the philosophy of “open source” is grossly misunderstood here. An open source concept is open to modification, something which I’ve not seen in JV. The negative feedback from the student masses has been floating around ever since JV was introduced, and the feedback is always more negative with each passing year.

I wouldn’t classify JV as a religion, for a religion makes us believe things without understanding. JV is a cult. A cult that everyone in IIIT is being “forced” to follow. I still use the word “force” because of the changes I have seen in IIIT over my 3.5 years of stay – changes like compulsory washing of plates, owl and lark separation of students (and changing course timings in such a way to force them to be more lark like), forcing canteens to close at midnight. No wonder, the hacker culture has very much disappeared from IIIT. Everything comes at a cost.

4) The concept of compulsory courses stems from the stream (in our case, computers or electronics) a person is studying in, and it is the UGC which decides what goes into the list of these courses. Humanities courses are separate from these “core and compulsory” courses.

I agree with your idea of a broad course structure requiring humanities, but my main conflict here is with the current HSSM courses being offered in IIIT-H. There is no breadth in the courses being offered in the Humanities stream. Rishabh’s earlier post about this, discusses these issues in detail. Humanities is as vast as area as is computer science, and limiting students to very similar options by offering such courses is akin to an illusion of choice because after all he has to complete his degree.

PS: Not that I hate anonymous comments, but if you’ve a hate comment to add, then do not do it.

One response so far

Kulbir needs an intervention

Nov 20 2009

Do you know that his videocache plugin caches only one version of the youtube video? That means if someone has seen a low quality version and they want to see the higher quality version – they can’t.

We (I, Rishabh and Sanrag) went to his lab to force him to fix that.

Now the list of WTF’s

1) He sits in CIE (Center for Internet Explorer).

2) His working notebook:

3) And more:

4) His room too houses Microsoft items – another keyboard and a mouse to be more specific.

5) His software works true Micrsoft style – does not do what it’s supposed to do.

All these proofs have led us to believe that Kulbir is a secret agent for Microsoft and he uses Linux as an undercover operation. You’ve been warned – don’t trust him.

23 responses so far

How to piss off a MS fanboy

Sep 12 2009

Situation: Me and the MS fanboy were chatting about some random stuff and as usual were not in agreement.

MS Fanboy: Sucker !

me: Sure

Whatever gives you pleasure

MS Fanboy: Right now…closing this chat window

me: Be my guest

MS Fanboy: wtf !… u opened it again… biatch

me: Why don’t you try the “block” feature instead

MS Fanboy: Why don’t u just stop pinging me instead of suggesting alternatives

me: I will do what I wanna do shithead, you do what you can to avoid me

MS Fanboy: **sighs**

Arrogant Ppl !!

me: It is better to be arrogant rather than been an irrational sucker

MS Fanboy: Unfortunately… u r both !

me: As I said, whatever suits you

MS Fanboy has signed off.

(At this point, I was blocked)

PS0: The Internetz for the one who guesses the MS fanboy.

23 responses so far

Homeopathy

Aug 15 2009

This post might be offending to homeopathy aficionados. I don’t care.

Got this mail in the evening:

Dear All,

The Campus Life council has arranged for the availability of the Homeopathic Medicine which helps to develop immunity against all kinds of Flu including the Swine Flu. For this purpose, we have appointed representatives in the Hostels who will be distributing the medicine.

Does homeopathy work? Various articles I found over the net claim it doesn’t. Wikipedia article says: Homeopathy is unsupported by modern scientific research. The extreme dilutions used in homeopathic preparations usually leave none of the original material in the final product.

Homeopathy medicines are based upon the “water memory” effect. The idea is as plainly epic as it sounds. The idea is, the more you “dilute” the drug, the more “potent” it becomes because the water actually “remembers” the drug.

Physicist Robert L. Park, former executive director of the American Physical Society, has noted that (from Wikipedia).

Since the least amount of a substance in a solution is one molecule, a 30C solution would have to have at least one molecule of the original substance dissolved in a minimum of 1,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 molecules of water. This would require a container more than 30,000,000,000 times the size of the Earth.

No, I don’t believe in homeopathy. And for something like swine flu, I suggest you too don’t.

PS0: Happy Independence Day to you all!

10 responses so far

Older »