Wednesday, July 12, 2017

Disabling Some Argument In Shell Command (Linux)

To disable any shell command's argument, all you need to do is to add following code in any of the initialization script of your shell/terminal.
cats_dont_meaow() { 
  if [ $1 = "meaow"]; then
    echo "Cats don\'t meaow in parallel universe."
  else
    cat $*
  fi
}
alias cat=cats_dont_meaow
Thanks to https://cdn.meme.am/
Consider the application of the script in case you have cached your git credentials and you accidentally hit enter after randomly typing some keys that may become git push origin master. This function will save your gits (pun intended).
block_git_push() {
  if [ $1 = "push" ]; then
    echo "\"push\" is blocked temporarily to prevent volcano eruption."
  else
    git $*
  fi
}
alias git=block_git_push
Gist: https://gist.github.com/fahadsiddiqui/ecb81755ae19eb5add1fce17bf7c730a

Tuesday, July 11, 2017

Customize Your Linux Dude

How can you use Unity without any tweaking? Why don't you feel the need to change your desktop appearance? I think it is time for me to write something that can put a new cloth on your lets-not-touch-it-we'll-break-it OS. I know you fear. I know your fingers shake when you type sudo. I know you are a coward and think you will break something like apt-get or you will get like 374 error messages and 34 warnings next time you boot. Nothing is going to happen. Try these.

1. Numix
Numix is an open-source project having icon sets and appearances for Debian/Android for free. You can go to their website and install (its pretty straight forward). Just add their PPA
sudo add-apt-repository ppa:numix/ppa
For more information go to https://numixproject.org/.
To change the theme/appearance you must install some tweak tool first. I prefer unity-tweak-tool, easily available from default repository
sudo apt-get install unity-tweak-tool
You are good to go.

2. Hyper
Do you like the default terminal? That's okay. But I would suggest you to try Hyper once. Built on top of Electron (by Github) framework, Hyper provides you much customization. I mean who wouldn't want to watch a YouTube video on your BASH terminal just by pasting a YouTube link? Interesting? Okay, go for it then. https://hyper.is/
A word of advice, do install node package manager and node itself before installing plugins in your Hyper terminal. Hyper internally uses node.js to install its packages. It also has its own package manager named "hpm". Try these packages https://github.com/bnb/awesome-hyper.

3. Atom
I wouldn't suggest this if you are a geek. Sure you'd want VIM or EMACS. But if your pokemons are evolved, and you have heard of Sublime text, you should try Atom (by Github). Click https://atom.io/.

4. f.lux
Do your eyes feel tired working straight 8 hours a day? They should be, you are wasting them.
Try f.lux (https://justgetflux.com). The reason why I recommend everyone to use f.lux is the blue screen hazard. It blinds you over time. You should read the research over here https://justgetflux.com/research.html.
Installation instructions are pretty straight forward, you just have to install the application indicator and run some scripts. See https://github.com/xflux-gui/xflux-gui.
Another option for screen color temperature adjustment is redshift-gtk, but it sometimes goes too off while adjusting (too warm for eyes).

And for God sake, change the default wallpaper. Huh.

Tuesday, June 20, 2017

پرندے مر نہیں جاتے

قفس کی ان سلاخوں میں
جو صدیاں قید رکھتی ہیں
پرندے مر نہیں جاتے
نہ اڑنا بھول جاتے ہیں
نہ اڑنے کی تڑپ دل س
کبھی بھی ختم ہوتی ہے
خدا بھی دیکھنے والا
انھیں مرنے نہیں دیتا
اندھیرا کتنا گہرا ہو
انھیں ڈرنے نہیں دیتا
پرندے جانتے ہیں وہ
ہوا کے ایک جھونکے سے
قفس کو توڑھ ڈالے گا
پرندوں کی تو سنتا ہے
میں تیرا ماننے والا
تیری خلقت میں افضل ہو
میری بھی مانلے یا رب
میں خود کو توڑ بیٹھا ہوں
بہت امید ہے تجھسے
میں دنیا چھوڑ بیٹھا ہوں
(فہد صدیقی)

Wednesday, May 31, 2017

دنیا خواب سی ہو جاتی ہے

پیارے بابا عرصہ پہلے
تم نے مجھ سے پوچھا تھا
"بیٹا تم کیوں جاگ رہی ہو؟"
رات کی چادر اوڑھے دیکھو
سب کی آنکھ مے نیند ہے بیٹا
"تم کیوں نیند سے بھاگ رہی ہو؟"
اتنا سن کر
کالے بادل
رات اندھیری
پھر بھی تیری بات سے میری
آنکھیں بند سی ہو جاتی تھیں
بابا تیری پیاری بیٹی
گھوڑے بچ کے سو جاتی تھی
عرصہ گزرا
بابا اب وہ
نیند کی چادر
روز ہی رات کو کھو جاتی ہے
ساری دنیا سو جاتی ہے
بابا نیند سے پہلے میری
دنیا خواب سی ہو جاتی ہے
بابا میری
دنیا خواب سی ہو جاتی ہے
(فہد صدیقی)