FOSS

Annoying your friend with Shell (not sea shell)

Trick

I was playing around with my friends a little and came up with this super annoying prank. It is potentially hazardous to leave your machine unlocked in a public place, if you find that your friend has violated this condition, its time to play a small prank on him/her.

What we will try to do is kill his/her terminal as soon as it is opened. Trust me this can be super frustrating for the victim.

Simply open ~/.bashrc (if it is not there then make one) and paste the following lines of code in it

a=`ps -eaf | grep terminal | cut -f 3 -d ” ” | head -n 1`
kill $a

Tada !! you are done. Next time when your friend tries to open his/her terminal, well they cannot it will just shut down ūüôā

Explaination

The script is very simple and deserves only a single line of explanation. Find the process named terminal, get its pid and then kill it. The reason why I do a head -n 1 is because ps will output 2 processes containing the keyword terminal. One of them will belong to grep (The second one). So we chose the first one.

Oh Lord make it stop

If you have fallen a victim to this prank, switch to tty1 (try pressing crtl+alt+f1), login, open the ~/.bashrc file and just delete the 2 lines mentioned above. Be sure to logout.

This did not work

Your victim is smarter than you. His default shell is not bash or his gtk window is not named terminal. Figure it out yourself.

I feel more adventurous 

Every recipe can be spiced up. Try the one below

a=`ps -eaf | grep terminal | cut -f 3 -d ” ” | head -n 1`
echo “I will not work today. I am going to sleep !!”
# If you are not sure if beep is installed on your friends machine, leave the next line out
beep -f 800 -l 500
sleep 2
kill $a

Have fun, you can maybe check the man page of those commands and see if there are other more innovative ways of playing with the script.

A prank is only fun as long as you don’t cross the line ūüôā

 

 

Rage – SOPA & PIPA

Rage - SOPA-PIPA

Eminent websites like wordpress.org, Google, wikipedia English and Reddit¬†have expressed their dissatisfaction against this act. The Stop Online Piracy Act(SOPA) and Protect IP Act(PIPA)¬†will require websites like Google, AOL, Facebook etc. to monitor the content uploaded by every user or face legal¬†prosecution. Quoting a paragraph from the Google website –

The U.S. government could order the blocking of sites using methods similar to those employed by China. Among other things, search engines could be forced to delete entire websites from their search results. That’s why 41 human rights organizations and 110 prominent law professors have expressed grave concerns about the bills.

What that means in simple language is, that WordPress would be forced to delete this post as it contains graphic images exercising our rights to Free Speech. As many of my readers come from India, you might ask why should we bother with something that happens in a government 8,422 miles away from us. The answer is simple, we being the largest democracy in the world are soon to follow suite. It has already started, please read Vinay Rai vs Facebook: Govt uses court to sensor the internet.

You can find a wonderful video on the Google website here.

Wake up fellow Indians and spread this message far and wide.

IPhone’s 15,200 words Terms and Condition has some hidden treasure.

I was just going through random Wikipedia articles on Apple inc and found some disturbing facts. Quoting the Wikipedia sections –

Since April 20, 2011, a hidden unencrypted file on the iPhone and other iOS devices has been widely discussed in the media.[219][220] It was alleged that the file, labeled “consolidated.db”, constantly stores the iPhone user’s movement by approximating geographic locations calculated by triangulating nearby cell phone towers, a technology proven to be inaccurate at times.[221] The file was released with the June 2010 update of Apple iOS4 and may contain almost one year’s worth of data. Previous versions of iOS stored similar information in a file called “h-cells.plist”

F-Secure has stated that the information is transmitted to apple twice a day, in Apple’s effort to generate a global locations database similar to Google. However unlike Google latitude Apple does not provide the user with any EULA(End user License Aggrement). Apple has put this in its 15,200 word long iphone terms and conditions. This reminds me of the famous South Park episode –¬†http://www.southparkstudios.com/full-episodes/s15e01-humancentipad

Apple claims it has reduced the size of cache, which previously stored data worth a year, which apple claims was just a mistake.

Bottom line is that EULA and Terms and Conditions are equally important as your house agreement. When you lease your house, don’t you read the words on the stamp paper a hundred times, then why be lazy while reading the terms and conditions. Remember they too have an equal importance.

Link to the Wikipedia Article – http://en.wikipedia.org/wiki/IPhone#Intellectual_property

Minidebconf[0]

We boarded a dual axle KSRTC bus, ridiculously expensive if you ask me, from Swargate and off we were on 26th at around 18:30. Summarizing the bus journey which was similar to any other bus journey, complying with all standards of an inter-state entertainment experience Рshow a movie which is dreaded by everyone, stop for food and tea at least twice and make as many toilet stops as the number of male candidates on the bus. We arrived at the Updupi early next morning, two hours before the estimated time. Neither Praveen nor I had ever come to Manglore and being unfamiliar with the local language added to our anxiety, we were waiting for Ranjan to arrive. Ranjan, a student volunteer from NITTE had graciously taken up the responsibility of delivering (I deliberately use the word delivering here, because like bundled up packages both of us were useless if left alone in this new city) Praveen and me to the NITTE campus . After a short trip of the Manipal campus we were picked up by Bushan and his ominous looking Maruthi Omni. Owing to the lack of time you (the unfortunate reader) will have to refer the diagram given below and draw complex inferences from it.

We reached the NITTE hostel campus at around 9:00 a.m. and met Christian who was returning from his morning jog. We joined Christian for breakfast after we had freshened up and started attacking the wireless access point, in hope that we will win. We lost shamefully and went for lunch, our heads down with shame and stomach growling for food. Ohh I forgot to mention we also visited the NITTE hostel garden and wandered around in their museum, thus productively utilizing the time between our breakfast and lunch. After lunch praveen retired while I, the¬†diligent fellow that I am, started adding more features to the Diaspora atom feed. Nothing interesting happened for the rest of the day except – Lightning which feel less than 800 meters away from us, the gruesome war we were having with wireless access point, electricity going on and off and yes we were again hungry. After a calm and quiet dinner at the NITTE hostel we gathered the courage and sat down to reduce Shirish’s¬†mammoth presentation. The only other interesting event which transcribed before we went to sleep was – saying hi to Jonas and Pavithran, they arrived at 23:00.

Having said this we shall increment our array index and move on to the next day …… [ If you do not see the link to my next post here, its not up yet. You can still try clicking it. I assure you will not be greeted with a segmentation fault ]

Is typing on a black screen with white colored text really archaic ?

What are the first things that come in your mind when you see your friend working on a terminal –

“What a hipster”
“That is too main stream for me. I cannot use the terminal”
“What an idiot still using a black and white terminal”

All these arguments look pretty convincing and I may ‘agree’ to a couple of them however what happens when all you are left is just that black and white terminal.
“Nah!! that will never happen to me. I am using Ubuntu with its super cool Unity desktop. My Fedora Gnome 3 machine will never give up on me”, come on go ahead say those things. ¬†If you made those statements in your mind I completely support it. Presuming that you made those statements it would be safe for me assume that you are not a developer, if you were then you would always prefer to work on the latest software which no doubt will crash.

A couple of  weeks back I upgraded my kernel to 3.0.4 and anxiously booted up my system. I was not too surprised when gdm (gnome display manager) refused to start up. My faithful Nvidia driver had done it again. The problem however was extremely straight forward. All that I needed  to do was to recompile the Nvidia kernel module and instruct the X11 config file to load the modules. My theory was sound however I had completely forgotten the required commands. This is were w3m came handy.

w3m is a command line browser which uses ncurses and is fairly comfortable to work with. Unlike lynx you do not need to specify options during the ./configure phase to enable SSL support. You can download w3m and give it a quick try. For starters you can point in to google :

 w3m http://www.google.com

Gmail worked fine however I need a tool which I could use to download the source code from sourceforge.  wget was the obvious tool of choice here. For those new to wget let me start by saying it is an excellent tool which you can use to download  content. It is one of the best application if you have an unreliable internet connection. It automatically resumes from were it last left of. An extremely useful feature of wget is its ability to download content recursively, -level  can be used to specify the depth of recursion.

The funny thing was I could not understand the exact version to download. IRC was the place to go but how do I reach there? ¬†The solution was extremely simple¬† – irssi. irssi is a brilliant command line IRC client. All you need is knowledge of basic IRC commands which are generic across multiple clients. ‘/’ is used to differentiate commands from chat text. A couple of command to get you started in case you are stuck in a sticky situation –

/server irc.oftc.net
Connects to the the oftc server. Replace the server name with the one you wish to connect to.  A word of advise, if you are using a mobile connection specially Airtel the above command will not connect to the server. You must specify the port number 7000 which by default is 6777 6667.
/server irc.oftc.net:7000

To join a specific channel once you have connected to the server just run –
/join #debian-in
Replace the part after the # with the channel you wish to connect to.

Lets say you have to change your nickname. The /nick command will do the trick.
/nick sh

The above commands should get you connected in no time. There are a zillion other commands but I will cover them in a later post if time permits.

For all those who read IRC and skipped the complete command part (I know many of you did) there is an alternative. Lets continue with the story. Having found the required information I needed on IRC I now wanted to get in touch with an oversees friend who wanted me to trouble shoot his laptop. The problem was he hated IRC and insisted we chat on gtalk. Not a problem, finch to the rescue.

Simply put finch is the back end for pidgen and you can achieve all the functionality from finch as you would from pidgen. It requires some getting used to, but ones you have mastered it there is nothing like it. finch majorly relies on key board shortcuts rather that commands and supports an array of protocols – AIM, IRC, XMPP (facebook, gtalk), Yahoo, MSN (unfortunate) etc.

A quick list of key board shortcuts to get you started –

alt+a  Opens up the a small menu. If you are using finch for the very first time select Accounts. Tab can be used to navigate between between buttons.
alt+c  Will close the current window.
alt+q  Exit finch
alt+n  Cycle to the next window.
alt+p  Cycle to the previous window.
alt+m Move the current window around. Once the window has been highlighted use the arrow keys to move it.

Having finished helping my friend with his system I shifted my attention back to the current task. A small fact I forgot to mention here was that while all this was happening to prevent me from dozing of I was listening to music. Startled command line + listening to music, go on read ahead.

xmms2 is your perfect partner in such situations to keep you entertained. You can do tons of things with it including but not limited to playing music from internet URL (perfect for podcast) , shuffle etc.
There are a whole  bunch of options which can be used with xmms2 fortunately only a couple are needed to get you started.

xmms2 radd ~/Music
xmms2 play
xmms2 next
xmms2 list
xmms2 seek
xmms2 pause
xmms2 play

Most of the above command are self explanatory. radd will add the contents of the ~/Music directory recursively to your default playlist and seek can be used to jump to a specific file.

If you need to adjust your volume fire up the command alsamixer in your command line.

Finally I had got my GUI to work !! A question still remains. How did I manage all these user interfaces simultaneously. If you thought the answer was using tty0 tty1 .. then you could not have been more wrong. Its too irritating to switch between them. Is there a better way? Yes there is.

screen is the answer to your hypothetical question. A small warning here screen is an extremely complex utility. I will however take you guys over some common usage scenarios –

Type the command screen in¬†your terminal, hit enter¬†¬†and sit back. You will be¬†greeted by an introduction screen, do not read it just hit enter. Now you can use this new session you have just created to fire up programs similar to the way you would do if it were a normal bash terminal. Lets say I run the finch command here and start chatting with my friends. My friend now sends me this really nice article on UEFI BIOS. I need to run w3m to browse this article. So how do I do it without closing finch. Simple really, I just detach the current session. You can do this by hitting the keys crtl+a+d. Once back to my terminal I run the screen command again followed by w3m inside it. To reattach the session you can use screen -r. If there are multiple screens to reattach -r will return all the id’s of the current session. Pass the id of the session you wish to attach to -r (TAB works here). A small note to clear any confusion,¬†detaching¬†a session does not pause or terminate the processes running inside it. They will continue to run.

All said, one more question still remains – “What if I do not have a application and I am too chickened to use apt-get. Is there a alternative, maybe with a¬†rudimentary¬†interface which I can use on the terminal, something like Synaptic Package manager”. The answer is YES, there is. Its called apptitude-curses !!

Its finally here !!

They are round, they have a hole in the center and are really light weight but they pack a whole lot of excitement in them. No they are not chocolate coated¬†Doughnuts but DVD’s from Blender Foundation. Blender Foundation was¬†gracious enough to send us ( Chamba Team ) six ¬†DVD’s containing a series of tutorials on various topics like character animation,¬†digital painting and character modelling. Now let me be very clear here I am a complete newbie when it comes to 3D animation or for that matter with any kind of animation. So the first DVD I unpacked from its plastic casing was Yo Frankie – a game made by Blender Foundation to showcase the power of Blender game engine. I was a bit¬†reluctant to start the game at first owing to my previous experience of ¬†running open source games on a Linux box. The thumb rule was that these games never run out of the box. They always need some configuration, small but tedious amount of compiling and loads of googling to start them. However Yo Frankie was an exception. All I had to do was run the right binary file and ¬†the game came to life. It was really that simple !!

At this point you might be thinking ¬†“Another open source game. Must have choppy game play, 1990’s graphics and tons of bugs. Lets not waste time reading this. ¬†“. But wait this game was different ( yes you must have heard that loads of time too ) from the rest of those open source games on the internet. With its ¬†addictive¬†sand box environment and ¬†pleasing graphics it was fun game to play. You play the role of Frankie from the movie Big Buck Bunny whose main aim is to trouble and annoy all the other animals. There are loads of in-game characters you can pick a fight with like sheep (innocent), rodents (pests hard to kill) and oxen(very strong). The game play is smooth and the controls are trivial. Remember this game is just a prototype showcasing the quality of work you can output from Blender.

What is the point of getting a bunch of DVD’s full of Blender tutorials if you don’t even try them out ? I decided to start with¬†character animation tutorials¬†without any prior animation related experience. ¬†Well how hard could it be ?¬†Surprisingly¬†it was not that hard. The tutorials were very well structured and all the concepts were explained from ground zero. The best part was that the DVD’s came packed with loads of demos you could play and experiment with. After going through a couple of tutorial videos and some light googling I managed to import the demo characters into my shoot, and assign posses to them. Remember when I started off I did not even know how to move an object in Blender. The bottom line here is that the video tutorials are presented in an extremely newbie friendly manner. Hats off Blender team for spending so much time and money into making these comprehensive video tutorials.

There were two more DVD’s covering various other tutorials like modelling and digital painting. Sadly I ran out of time to review them, maybe next time. Big Buck Bunny and Sintel came in their own flashy looking DVD cases. You might ask ” I can download these movies from the net. Why go through the trouble of ordering them from Blender “. The answer is for the extras and tutorials. The DVD’s don’t just contain the HD quality movie but also the .blend files that went into making the movie licensed under Common Creative License. They also contained extras like concept art, live edits and my favorite 4 split video (image on the right). All in all it was great fun exploring the art of making animated movies and I thank my stars for the¬†existence¬†of Common Creative License ūüôā

I don’t believe you actually read this far. Now that you have reached this far let me add one more thing which I was saving for the end.

All the DVD’s were shipped to us by Blender Foundation free of cost. All the content inside the DVD’s is licensed under Common Creative License which means you can modify and distribute it without any legal barriers.

At Chamba we are also trying to do something similar. We welcome all those who want to learn Blender (Free of course), understand the concept of story board or just have a joyous time making an animated movie. Join us at http://www.chambaproject.in

Quick Links : #Chamba wiki, #blender foundation, #sintel, #big buck bunny, #elephants dream, #creative common license

Kde.in – Day 1

Bus journeys always make me nervous. Just the idea of being confined in an enclosed structure with wheels for fifteen hours is a horrendous thought. All said and done we ( j4v4m4n, me , smk ) boarded the bus to Banglore.

After spending a sleepless night in the bus and watching a completely retarded movie I was glad that we had finally reached Banglore at 6:30 in the morning. I usually get extremely confused during such situations, were getting down at the right stop is as important as studying the right part for an exam to pass it. Lucky ( at least I thought I was lucky ) for me we were supposed to get down at the last stop. As soon as we got down we were engulfed by auto rickshaw drivers who were hungry for our money. We chose a rickshaw at random following the ostrich algorithm and headed off too RV college situated on the outskirts of the city.

After having a quick bath in the guest house and a satisfying breakfast we headed of for the¬†inaugural¬†ceremony which was followed by Lydia’s keynote. Frankly speaking I did not understand much of what Lydia was saying owing to an extremely poor audio quality. Prashanth N Udupa took over after Lydia’s keynote and made the atmosphere in the room a bit more lively with his short stories and jokes. Once everyone was relaxed Prashanth started with the basics of Qt, writing the most simple program know to man – “Hello World

Abhishek Patil, an employee of VCreate Logic explained how the Qt designer could be used, what signals and slots were and wrote a ¬†simple program displaying a bunch of buttons on the screen in some predefined layout. ¬†It was 13:00 by this time and my stomach was telling me – ” If you do not feed me by now ….. Come on just feed me !! ” . ¬†After a quick registration at the registration desk ( we could not do it in the morning because we were late and they closed down the counters ) we headed off for lunch.

Prashanth continued with Qt after lunch teaching us how to make custom widgets. The session was extremely informative and Prashanth was bombarded with dozens of questions from¬†enthusiastic¬†¬†students. We also learnt a very important thing – There is a reason why the buttons are shaded in the manner they are and it has been scientifically proven using human psychology ( who would have imagined this ūüėÄ ). The session was concluded by Prashanth making a basic image gallery.

As it got darker j4v4m4n’s hunger grew ( for food off course ) and we headed off in search of a good restaurant to eat at. After a lot of debate on which restaurant was better and were we should go we ended up eating at the restaurant right outside the college gate. I can’t really say what I ate partly because I do not remember what it was called and partly because I am clueless what it contained. Dinner was followed by an unusual combination of¬†hot lemon tea and cold sugar cane juice ( which was available in a variety of different¬†flavors¬†). Stomachs full ( at least mine was ) we made our way back to the quest room, It was time for Jishnu’s blender tutorial session.

After saturating my brain with dozens of blender shortcuts I finally managed to animate a small cone ¬†falling on a rather¬†funnily modeled monkey’s head, I named this kill monkey. So there I was all set to become the next Matt¬†¬†Stone or Trey Parker.