Category: Computers

Mint

Every time I install Mate desktop (a flavor of Ubuntu Linux, packaged as Linux Mint), I have to run through a series of steps to get it back up and running for my needs. Problem is, I have to re-discover many of these as random things stop working next time around. This post is more of a document for myself, than for the world out there.

The Need
I need a Linux server that is always available into which I can either ssh into or vnc in to get things done. Also, this would have my (now) 23 year old home directory, that has everything – old source code, emails, documents, etc. The idea is that this is a protected environment, and I use all my other terminals as a means to access this server.
Continue reading

Lenovo S400 IdeaPad – Upgrading RAM & Wireless Card + Installing Ubuntu

I bought a Lenovo S400 IdeaPad back in December last year, and well, it wasn’t such a great decision. To begin with, the pros of this laptop distract you so much that it is hard to get away from the idea of owning it. It’s very:

  • lightweight and sleek

That’s about the entire list of its pros. Can’t think of anything better.

So I decided to get rid of the cons. Here they are:
Continue reading

How to use a GPG key and encrypt stuff?

In the wake of increased attempts at online frauds and information stealing, I thought it only befitting to write this step by step tutorial down for people who have never heard of GPG.

Simply put, GPG keys are used to encrypt information. To “encrypt information” means to make the information secure in a way that only a particular person can see what it contains. In other words, you lock the information and only the person having the key to the lock can open it.

Use Case 1: Bank account information over emails
Never send your bank account information (your account number, the name on the account, type of account, card number etc.) by email. Don’t even send the bank/branch you hold accounts in. Nothing – just don’t send any information at all over email.

So then how do you send information if you need to? Use GPG. Follow these simple steps:

  1. Put your account information in a text file (using your favorite text editor).
  2. Save the file and call it, say, account.txt.
  3. Run these commands (on your Linux/Unix/FreeBSD box):
# curl -L 'https://fryol.net/r/rishi-public-key' | gpg --import
# gpg --output account.gpg  -r 0x0B5267B1E3662EBB --encrypt account.txt

If you try and open account.gpg in the same text editor, you would see some garbage in there, which can now only be decrypted by the person whose key you used to encrypt account.txt.
Command 1 (of step 3)  was where  you downloaded my key (hosted on the link http://fryol.net/?u=key) and imported it into your gpg keyring.
Command 2 (of step 3) was to tell gpg to use  0x0B5267B1E3662EBB (which is a public key identifier of the key you imported) to encrypt the file account.txt.

For people who use Windows, there’s an easier way out: http://gpg4win.org/. The steps above would be very similar – I am sure there would be a way to import a key into that program using a URL. So then, all you do is provide it the URL of the person whose key you want to import and it should be able to use that key.

The file  account.gpg is now ready to be sent over email (to the person whose key you imported in command 1 of step 3).

This tutorial is only about encryption – decryption is a separate topic. (..and my primary motive for this post is to let people emailing me quickly encypt stuff).

See also: [http://www.madboa.com/geek/gpg-quickstart/#tosomeone].

I Don't Tweet

Twitter has been downright silly for me since the very beginning – but then I thought may be that is because I don’t use/understand it well. Then I saw this: http://theoatmeal.com/comics/twitter_stop and was very glad. Some nuisance about twitter:

  • “tweet tweet” – someone is doing something somewhere – go check
  • “tweet tweet” – retweet – someone really did it
  • “tweet tweet” – this url is f**king bit.ly – you have to f***ing click it to see what the heck I am talking about
  • “tweet tweet” – gawd this news I heard was really the same one every one else knows about – retweet!
  • “tweet tweet” – i want to so follow you for the reason of you following me in reciprocation – puhleez
  • “tweet tweet” – sent from my chuck-phone – I bought a $500 device to tweet all the time, how cool!

All that said, I still am on twitter in some automated way, where blog posts get tweeted. Heh.

Well, I just thought I’d add this one in too: http://theoatmeal.com/story/reddit_how, on how bloggers and tweeters have a gazillion share buttons on their blogs/posts or anywhere else. And then, once again like:

  • “tweet tweet” – that road is like blocked for the last 2 years, but let’s tweet about it #road #bangalore #fail #totallyapocalypticfailure
  • “tweet tweet” – the keys I forgot in my backpack, came thru from my car’s back seat #keys #forgetting #stupidme #stupidyou #car
  • “tweet tweet” – vote my ?post=3441 on reddit #reddit #mybloodyawesomeblog.com #my…com?post=3441

Affinity for processors

My old roommate comes visting yesterday and we have a technical discussion with exchange of technologies we’ve been experiencing.

So there is this taskset command on Linux which you can use to actually move a process to a particular CPU on your system. Thing is, these guys are using an OS called SixWind (also WindRiver) that is used to run on one out of the two cores on their machine. The other core is used to run other binaries which include their customized application and anything else that is needed. Essentially, the OS runs separately against the application helping maximum usage of resources.

Now I tried doing a taskset on my dual core CPU (in my lappy), for a process (a small executable having an infinite while loop). Turns out that the process at first instance doesn’t get allocated to the CPU. My roommate couldn’t figure out the anomaly here and left. I kept on to it cuz the possibilities were limitless. I kept on doing additional things, killing the process and experimenting with larger processes and real world applications – like Thunderbird and Firefox. Eventually, I figure out that it really won’t matter if I set the affinity of one process onto one CPU or the other. How it started to work was when I went into super user mode and started switching affinity for some of the k* processes. The whole thing crashed and I was glad.

I was more careful next time and started off with setting affinity for kswapd (which is seldom working). Then I wrote a bunch of programs (using some virtual memory code from here) and managed to see how kswapd was working very well on just cpu#1. There’s still some performance to be tested, but I guess that helped me in getting to a point where I could see that when I let Thunderbird compact folders and ran test programs, things were better than wehn there was no affinity.

Mp3tag

Rewind to somewhere in May 2000.

I had a small pet project of converting all our Jagjit Singh audio CDs into mp3. I had access to a computer only during Summers and I had very little time (about a month and a half). So I would have to do too many things in much little time. I would rip the CDs using a primitive CD cutting software (AudioRipper may be) and then edit the mp3 tags in Winamp. There was CDDB sans Jagjit Singh. So I would manually look up track names on the back of the jewel case, type in and then use another software to submit data back to CDDB.

It became a tedious affair to tag the mp3s after they were created. Well, there was a Goto.com (the real overture) in those days that helped me find a nifty utility called mp3tagEditor(beware of look alikes – there’s just one mp3tag.de). The damn thing was so awesome that mp3 conversion became my summer hobby! I wouldn’t mind playing with blade/lame as long as this coolio was around. (dbpowerAmp came some time in 2001 I guess).

Well, what makes me write this after 8 years at 3 AM in the morning is the fact that mp3tag editor has grown up with me! I just tried it (after a really long time; I decided to do some mp3 management). The bloody thing is so so awesome that you just have to kill yourself to dream of something that it can’t do. Floran (Heidenrich) is one awesome guy. I just wish all other software matured like this super cool utility. The only glitch is that this is still a Windows utility, and though I haven’t tried it, I hope it would run on Wine.

So what did I really like about it is the fact that when you do a Tag to Filename or vice versa, you’ve got some awesome functions, regexes and extra fields that makes it much more fun. Another thing was the inclusion of getting Tag sources using a “web search”! Just give it the album name and it would pick out a list of albums from the FreeDB and match against your files. May be there’s other software doing similar things, but nothing can be better than free, tried and tested.