Saturday, December 10, 2011

Reco..gnition

Seen some of my friends get recommendation letters from professors during the last years at degree college and seen them complain. During the last 3 months, I was fortunate to experience the process and unfortunate to have an experience worse than that of my friends. And frankly, I do not know why...

Experience: Out of the three recos I needed, one went extremely smooth, effortlessly. Hats off to the prof! The remaining two made and continue to make me beg and plead and cry. Why? One, the two didn't seem to have the time to submit them, because they were "extremely busy". That, I can never believe. Second, The account does not seem to open or there is some problem with the email account. Well, when did you realise that? Now? Or was I the lucky one to enlighten you about it? Three, "I was busy and now I am on a vacation". Aaargh!! I have met people at my workplace who are genuinely extremely busy, and generally tend to forget your request in the rush of things. But twice, maybe thrice reminding them does the thing. I think the reminder count in my case must have gone upto 12-15 considering missed calls, messages and e-mails. It starts frustrating you especially when it blends positively with the frustration at workplace sometimes. and you start to think...are you so insignificant that people do not care about your plans...so insignificant that the professor forgets for a moment that you have asked and confirmed from him for a reco...and asks you, " How can you assume that I will give a reco?" All this, as it appears to me, stems only from the "i m busy" phenomenon. So how much time does it take to fill up recos? If the prof has a draft ready, probably 10 min. for each. In fact I was a lucky witness to a record breaking feat of 7 recos within half an hour. I mean, are you really that busy then, that it took so many days? The most frustrating thing of all, is that you stay up late at night for completing applications much in advance, balancing work and these guys just keep dallying. So inconsiderate! All your hard work goes in vain.

After the count of 15 reminders, I personally visited the college twice, first in vain and in the second I nailed it for one prof, thanks to the "informer". One still remains, I continue, messaging and calling with no response from the other end with personal visits in the past all in vain. Wish me luck!

Some lessons learnt*:
1. Be good to professors at college. Be in his good lists. Do projects under him proactively when in college. If you take a break from college for work, be in touch with him. I probably did only 30% of this and hence I am to blame. Remember, if you need a reco, you need to have reco-gnition..
2. Be in touch with juniors who can update you on the prof's availability.
3. Be extremely calm with the prof, even if he swears at you. Do not forget, you need him. He does not.
4. The best thing is to take up a job at the college, if you are open to it. Then, you can remind him at your will.

Now I go back to waiting for the last one...

*: Lessons apply more for people who have studied from my college. Though they are general in nature, there may be some changes and modifications here and there....

Sunday, November 13, 2011

PDF play

Last few months, I have been scanning a lot of documents. Also converting word to pdf, merging pdf files, splitting them etc. In this process, I have found few good programs for this task.

I have an HP Deskjet F4288 All-in-One scanner-printer-copier at home. If you scan a document, by default, it starts an HP utility for managing the scan, which is buggy, big-time and tedious to use too. So, began my search for the ultimate tool. Enter Softi Scan to PDF. Though it is a 30-day trial, if you uninstall it and install again, it restarts the 30 day trial..;)..so gr8. This app has a simple scan button. It has settings where you can select the scan document size, the compression ratio that is needed. This helps when you want the scanned pdf file size to be very small and the quality of scan does not bother you..esp. when upload sites limit the file size. If it is a multi-file pdf, just keep pressing "scan" after each document and it keeps appending the pages and when you are done with all pages, click on "Save PDF". Simple.

Some of my documents to be scanned were of the A3 size and could not be scanned at home since my scanner supports A4 only. Got it scanned from a print/xerox shop and the size of the files that he created were enormous. 16MB for 10 pages. I tried opening the file and printing it again using CutePDF. I thought it will compress the file in the process. No change. Then, me and google started another search and we found "Bullzip PDF". Excellent utility. Similar to CutePDF. But with this, when I tried printing the 16MB file to PDF again, it reduced the size to 5MB. That was great compression and without any visible loss of quality. Now it has also replaced CutePDF as my word-to-PDF converter. I fondly call it "Bull#$%@ PDF"..hehe.

I had all my documents separately scanned and converted to pdf. Now came the requirement of merging/splitting different PDF files together/apart as per requirement. Again...google to the rescue with freely available "PDFSAM (PDF split and merge)". Though it calls itself "Split and merge", it does much more. The feature I love the most is "Visual reorder". You can see the thumbnail view of all pages within a document, delete certain pages if you wish, rotate specific pages, change the order of pages according to their importance and after you are done, just save it as another PDF file.

Let me know if you have heard of any good ones.....

Sunday, November 6, 2011

Changing Grub Splash screen in Debian 6.0.3

Recently changed my MTNL plan from the Rs. 748 plan (2 Mbps, 5GB download limit) to the newly introduced Happy Hours plan Unlimited 666 (Rs. 666 service charges, 320 kbps during the day and 1 Mbps after 8 pm, unlimited download). This after receiving a hefty bill of Rs. 4500 last month accompanied by a severe dressing down from mom and dad. We concluded after an experiment that Skype was the culprit. Anyways, this brought good along. I am now free to download any file size and have already downloaded and installed the latest Ubuntu 11.10 and Debian 6.0.3 (Squeeze) in the last few days.

So coming back to the topic, I was always curious about changing the boring splash screen that we get at startup. I knew it was and is easy. But just wanted to tick another point in my "to-do" list.

First of all, where does Debian store all the pre-login wallpapers? The location is 

/usr/share/images/desktop-base/       (was actually trying to TAB my way while typing this...:D)

All the grub configuration gets stored in the grub.cfg file. The exact location is 

/boot/grub/grub.cfg

This is an auto generated config file that uses the templates from the /etc/grub.d and settings from /etc/default/grubWhen you want to change the timeout of the splash screen or the default boot selection of the OS list, the /etc/default/grub is the file to use. It has variables defined as GRUB_DEFAULT and GRUB_TIMEOUT for the same. Root privileges are required for these changes and also for the steps that follow. The 05_debian_theme file in /etc/grub.d is the brain behind deciding the grub background that goes into the grub.cfg file. Now after studying the 05_debian_theme file, I have found there are 3 ways of setting the desktop background:


1. Simplest: Just copy the required image into the /boot/grub/ folder and run "update-grub". Done. This method has second priority.


2. Define a variable GRUB_BACKGROUND in the /etc/default/grub file and provide the path of the image as its value.


GRUB_BACKGROUND = /usr/share/images/desktop-base/james_bond.jpg


(Yes, I have Daniel Craig as my splash screen..:D)

Save and exit. Then run "update-grub".


This method is given the highest priority. So if you have defined the one image as a variable and also pasted another image in the /boot/grub/ folder, the variable value will be considered.


3. The next method is using another file grub_background.sh. This method has third priority. In the file /usr/share/desktop-base/grub_background.sh, just define the variable WALLPAPER as the path of the image.

WALLPAPER = /usr/share/images/desktop-base/james_bond.jpg

Save and exit. Then run "update-grub".


If the 05_debian_theme file finds none of the above images or defined variables, it will load the default desktop background "desktop-grub.png". If it does not find the desktop-grub.png file too, it will load the default theme, which is just a black background and a blue foreground for the text.

After any change in the grub configuration, the command "update-grub" is necessary. While this command runs, it shows that it has accepted the background image. This command actually generates the updated grub.cfg file (auto-generated, as I have mentioned before) which is used during the booting process. You can check the updated file for confirmation.

Now just give the "poweroff" command and reboot again (Prior to power off, save any other open files). Noted one more thing, this release behaves differently on the "reboot" command. When you say "reboot", it actually assumes that you will be back into Debian and so you do not even see the OS selection grub menu and boot directly into Debian. Hence, I mentioned using the "poweroff" command.

So, there you go, my PC is now dressed to kill...even before the OS boots..:D


Sunday, May 22, 2011

SSH......

Took up the activity of trying out SSH today. what is it? I am sure you have heard of telnet. We know it as a remote login client. Similarly there is another called rlogin. SSH is a very secure implementation of telnet or rlogin using encryption. Hence, very unsurprisingly, SSH is Secure Shell.

The two guinea pigs involved were my HP Pavilion dv6000 laptop running Ubuntu 11.04 (the latest one!) and an assembled desktop PC running Windows XP.

On the XP machine I downloaded the putty software package. On the website you will find a zip folder that carries all the Putty client variants like Putty, PSCP, Pageant,Puttygen. I downloaded the same. On the Ubuntu machine, i installed the OpenSSH server using the following command:

sudo apt-get install openssh-server

Command output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
rssh molly-guard openssh-blacklist openssh-blacklist-extra
The following NEW packages will be installed:
openssh-server
0 upgraded, 1 newly installed, 0 to remove and 43 not upgraded.
Need to get 0 B/311 kB of archives.
After this operation, 840 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package openssh-server.
(Reading database ... 130586 files and directories currently installed.)
Unpacking openssh-server (from .../openssh-server_1%3a5.8p1-1ubuntu3_i386.deb) ...
Processing triggers for ureadahead ...
Processing triggers for ufw ...
Processing triggers for man-db ...
Setting up openssh-server (1:5.8p1-1ubuntu3) ...
ssh start/running, process 18521
amit@HP-Pavilion-dv6000:~$ ps -A|grep sshd
18521 ? 00:00:00 sshd

This command not only installs the server application but also executes it. The last line in the command output shows the PID for the sshd server task. You can also confirm the same using:

ps -A|grep sshd
Command output:
18521 ? 00:00:00 sshd (which matches with the earlier mentioned PID)

Next I extracted the Putty archive and executed the Putty.exe application on the XP machine. Putty.exe can serve as an SSH, Telnet and Rlogin client. Entered the IP address of the laptop. Selected SSH as the protocol. Kept the port value to its default of 22. You get a prompt "login as:". So we have to enter the username of the account in ubuntu ("amit" in my case). next you are prompted for the account password. Once you enter that, you are IN. Done. Simplest remote access using SSH complete. To add some level of security, we can change the default port to something other than 22, say 202. The same change has to be done on the Ubuntu side. This helps protect the server from brute force attacks especially if the server is exposed to the Internet.

So, run

sudo vi /etc/ssh/sshd_config

The above command opens the sshd_config file in the vi editor. Go into the Insert mode in vi by pressing 'i'. The first uncommented line in this file is "Port 22". Change that to "Port 202". Press "ESC" and type ":wq" to save the changes. Now run Putty session again maintaining the port as 22. You will get an error "Network error: Connection refused". Change the port to 202 (or value as written in the config file) and run the putty session. You will be prompted for the username and password as you were earlier.

You can also specify the username in the Hostname field itself..i.e. instead of just writing the IP address(eg. 192.168.1.3), we can write username@IPaddress(eg. amit@192.168.1.2). With this, you will only be required to enter the password everytime. This is because, you can save the hostname and port information as a session and use this information again later by selecting the session from the list and clicking on "Load".

Another good practice that helps protect the server from brute-force SSH attacks is disabling the SSH login for root account. This is because in case of a root account,for a hacker, it is one less parameter to be guessed. he only has to crack the password. Assigning non-standard usernames helps in a great way, say SSH users. This can be done by giving a "no" for the PermitRootLogin field in the sshd_config file.

Next post would be on using keys for authentication...a special feature of OpenSSH and putty......

Saturday, March 26, 2011

Reverse telescopic view

No no.. not a techie post...see i tagged it "Daily thoughts". So no worries, read on.

A telescope. What a masterpiece. Made possible the discovery of distant marvels in space. Made possible looking far away objects in more detail. Made possible the telescopic view mounted on weapons to have a magnified view of the target so that one can study and attack accordingly. Details, more details, more depth, is that all? i think not.

An observation and an experience. In our bid to get more focus, we try to get to the subsets and in the process, could forget the superset, the "bigger picture". A job could be of multiple phases, multiple levels. As you concentrate on each of the phase, you study, you use the telescopic view. You go into details. You know you are bang on target. You move on to the next phase. Finally, you think you are done with all levels. And then the time comes to evaluate the system on the whole. You are confident that each of the phases are correct. As things start falling in, you start relating to what the aim was in the beginning. Level 1 correct, level 2 wrong. but level 2 was right. all coz of that bloody level 1. How could I forget it? level 3 correct. level 4 wrong again. this time it's coz of that filthy level 5. Why? How could I go wrong with my concepts? Well, me thinks..Concept right, but you got the wrong map or no map at all.

So what's the remedy? THE REVERSE TELESCOPIC VIEW. Whatzztat? Just a new way to look at things. While you are busy "telescoping" things, You must also make it a point to turn the telescope around regularly and look at the work from the other end. Why called so? Basically to evaluate the work, you need something that will take you out of your world and see it from a space station. A telescope does just that, without moving you an inch. Just have to turn it around for a change. So a periodic peep. Is it looking good? Is that what I want to achieve from this block? I think just this small step can help one put a map in place of the way things should be. Use the telescope..both ways!