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!

Sunday, November 28, 2010

Maha Shoonya Teen

It's more than an year at my workplace in Sakinaka. Travelling is mostly by the bus routes 398, 488 etc. Lately, I have been staying late and generally have another colleague for company. He is more than two years here, actually a senior from SP.

So many times recently, it was me and him going home in a rick. Phew! Too costly. But the body does not have the strength and courage to go for a bus at 9:45 pm. Atleast it pretends so. More so when it has experienced the comforts of a swift airy ride.

So it happens that as usual, I get out of the gate and show the rick begging hand accompanied with few forced tired words. After one or two misses, it is a hit. "Borivali?". The rickwallah gives a condescending nod. As soon as we get in, my colleague asked him," Meter thik hai na?". And the rickwallah says a non-chalant , "MH-03 hai. Thoda idhar udhar ho sakta hai." We got down and I asked my office mate what made him ask that question. He said, "MH-03 tha. isliye poocha."

And then came the revelation. Apparently, MH-03 ricks (also nicknamed Ghatkopar ricks) are infamous for having rigged meters. More the distance, more the loot. That is when I started observing that the only ricks that were going empty were the "Maha Shoonya Teen"s with MH-02 scattered sparsely. A Google search after returning home also confirmed the allegation. In fact, the very next day, I tried my hand at the MH-03 for a short distance near office which will generally cost me around Rs.14. The meter screamed a Rs. 20. Thanks to the enlightenment attained under the Bodhirickshaw a day ago, I had already cleared matters with the rickwallah confirming that I will only pay what I generally do for that distance.

Made me wonder how much I have lost already within my tenure here... what about ppl who are not aware of this? Suno bhaai suno..

Saturday, September 18, 2010

Black and white

Black and white...contrasting enough to be conspicuously spotted together. White shining over black, black engraved in white. Maybe that's the reason why we use the idiom "in black and white" to denote something "in writing". Because the very act of writing things down make them clear as does black on white or white on black.

But I doubt if many are fans of writing. They do not prefer it, they prefer verbal conversation; They prefer orange, green, yellow, sky blue, pinkish brownish red, but no...not black and white. Black and white is "mail baaji" for them.

Well, I agree, to the fullest extent, be it art, literature, nothing is as good as verbally expressing it with all the body that you got. Even I was held by my legs and dipped into this pool of communication skills, made to "rrrratofy" the advantages of oral communication over written. That just speaks about my desperation, no pointer pointing towards anyone who taught us communication skills. MG ma'am, to tell you, you were the best!

But as far as what I have experienced, I have always found "mail-baaji" to the advantage. Take down the notes of advantages of writing over blabbering:

Foremost. You are a busy person. You hardly get time to talk, or are in a place where networks are no good, but you have a phone where you can read mails. What is the best way to get in touch with you?? Writing a mail.

2. With reference to the first point again. If you are busy, no problem. You can refer to my mail later. The very essence which led the NOMADIC man to write things down when it's official :). It gets recorded!

3. I said something to you. Now few days later I twist my point. Do you have a proof of that?? NO. Consider the otherwise with writing.

4. Can you cascade oral communication?? hehe...with mails, just reply or forward and the great technology helps you link mails wrt a specific topic.

OK. it was a 5 mark question. With 4 points, you get a mark less or whatever, but believe me, atleast I do, those 4 points are worth more.

Oh....just when the bell was going to ring and the exam to end, I remembered, ...you can attach things to mails..documents, drawings etc. etc.Thats a fivey now..hehe..added this here since I did not want to disturb the end.

And, by the way, for people who like colours, try the font color options, smileys...there's every colour "in black and white".

Sunday, August 22, 2010

The Bus Game on the Lunar Land


I thought of the title " An Hour at the Bus Stop" but that would have made it look like a 2nd Std Essay and would have taken away the exciting part of the 'game' that it is. So basically, this is a very interesting game that one gets to play at the Dindoshi bus depot. It requires a lot of brain, vigilance and physical power. People weak at any of these should not enter the Dindoshi Bus Depot.
RULE 1: This game is played from Mon-Fri.

So it is 8 15 in the morning. You are fully charged to face another day at the office. And you enter the lunar-surfaced Depot - but with two differences.
1. g(Dindoshi lunar surface)= g(Earth) in Dindoshi area.
2. This lunar surface has not traces of water but gallons of them. ISRO could supersede NASA this time in researching water on moon. I am here to help :)

After knowing all these technicalities, you reach a safe area doing the astronaut jumps.

RULE 2: Check if the game is already over.

You look around to see if the daily faces are still there or they have beaten you in the game for that day.

Now you start looking for THE resource: the BUS. There are options and their numbers mean nothing unless it takes you to or near your destination. But intelligent people will analyse to select the right bus.

RULE 3: Late entries are not given the liberty to use their intelligence.

Then comes in the vigilance - the most important quality required to win this game. There are many things to keep an eye on:
a. The BEST honey comb: the place from where the driver bee and the conductor bee come out. You should know the already standing bus (flower) on which they will land. Experience comes handy here.
b. The opponents. In case you are not good at point a, this one helps you. Observe each opponent very carefully. Not directly in the eye(they will shoot with their snipers..beware), but look askance. Try to read their inscrutable faces. Their excitement of seeing the driver come towards the bus will surely betray their will to be stolid.
c. The gate of the depot from where a bus could already come loaded with the driver and conductor.


So you have two threads already running in your OS. Now another one adds in. The one that actuates the process of running. As soon as the observation thread of three cases throws an event, the thread for "running" should chip in without any latency.

RULE 4: Go for the front door if you are a female. The front door is a female dominated place. Do not dare to try it if you are a male. Snipers galore. Males, go for the back door.

Now comes the physical test. You need the strength of a Spartan to push away everyone behind you and get into that door to heaven. Most lose their hope at this stage and the victors go to the next level- THE ENTHRONEMENT.

The Enthronement rules have recently undergone a revision; Rev 3 to be precise, which has made the game all the more difficult for males. But that makes it more challenging and men are always good at taking challenges...hihaha. In a ruling that speaks about growing female dominance, 6 rows on the right side (12 whole seats!!) have been reserved for females now. Damn it! OK..so the victors from the last level have to catch the right throne keeping in mind all kinds of reserved seats for the females, the aged and the handicapped. The reserved seats, if unused, can be used unless the owner comes to claim it. Failure to show respect to reservations can result in disqualification.

This ends the game. The rule for deciding the winners is as follows:

RULE 5: Window seat winners stand at first place. The "pillion" seat achievers stand at second. The "standing" stand nowhere and get their punishment during the journey. If the top two places feel pity about you, you could be promoted to their positions when they are already satisfied with the comforts the seat offers...though it hardly offers anything..something better than nothing should we say..the vigilance tips can help here to know the possible candidates who are oversatisfied with their positions.
So that's the BUS game..And there is always a chance to take revenge on your opponent...the next day and the next and the next...Interested ppl are welcome.....unwillingly :(