I have been using BSNL broadband connection for around 4 years. Recently they introduced FUP (Fair Usage Policy). As per this policy every month, I get to use 6 GB of data at 1 Mbps speed and after that, the speed drops to 512 kps. Today, being 1st of the month, I supposed to get 1 Mbps, but I was only getting 512 Kbps. This is because I rarely switch off my modem/router. I had to reboot it to fix it.
My IBM ThinkPad R52 completed six years.
I am not sure whether the title is a good one for blog entry. But I just wanted to write about my laptop which served me for more than 6 years and still alive and kicking.
Ever since I started using computers, it was my dream to own one. But during school days it did not materialize because I was not earning and also my father could not afford it. I was desperate to get one when I was in college but could not. I got job on campus and after finishing my course I joined the company and within an year I bought my first computer and it was IBM ThinkPad R52. Now it is owned by Lenovo.
Exactly on July 7th, 2005 I bought this machine on which I am typing now. I paid a very high price for the configuration below at that time. At times I feel bad that I paid around Rs. 65K for this configuration.
| Component | Details |
|---|---|
| Processor | Pentium M 750(1.8GHz) |
| RAM | 256MB RAM |
| Disk Space | 60GB 4200rpm HDD |
| Display | 15in 1400×1050 LCD |
| Graphics | Intel 900 |
| Optical Media | 24x24x24x/8x CD-RW/DVD |
| Wireless | Intel 802.11bg wireless |
| Modem | In built modem |
| Ethernet | 1Gb Ethernet |
| Mouse | UltraNav |
| Sec Chip | |
| Ports | IEEE 1394, USB |
| Battery | 6 cell Li-Ion batt |
| Operating System | WinXP Pro |
As you could see it was just having 256 MB RAM. Midway in 2006, I added 512MB more RAM when I was in U.S.A.
Initially it came with WinXP Pro loaded but with 256 MB RAM, the OS was running too slow. The response was not great. In college days I used Debian so I straight away installed an early version of Debian on that and configured Enlightenment window manager. The response was really great. I never looked back to Windows. Now it runs Debian Squeeze (aka 6.0) along with Enlightenment DR17 as window manager.
I use this laptop for all my computer works no matter what, developing software, watching movies, browsing, manipulating video files and editing images, you name it.
This laptop travelled several times to U.S.A and inside India. I carried this on local bus, train, flight and also on ship to Lakshdweep. I admire the ThinkPad build quality from IBM. I only had one issue with LCD couple of times. Once in warranty, other when it was out of warranty.
I hope this lovely piece of device will keep on serving me. No matter what may come, I will not be selling this. This may end up as an antique. I don’t know but I love it a lot.
Setup org2blog for blogging from emacs.
org2blog is written by Puneeth Chaganti. It is an emacs extension to post org mode sub trees as wordpress blog entries. In order to set this up clone the repository from github.
# clone org2blog git repository git clone http://github.com/punchagan/org2blog.git
Add the following snippet to ~/.emacs
(add-to-list 'load-path "~/site-lisp/org2blog") (require 'org2blog-autoloads) (setq org2blog/wp-blog-alist '(("noorul.com" :url "http://noorul.com/blog/xmlrpc.php" :username "admin" :tags-as-categories t))) (org2blog/wp-login)
Then I can go to the entry and call M-x org2blog/wp-post-subtree to post a draft or C-u M-x org2blog/wp-post-subtree to publish it.
Using google web font for my site.
I was looking for a better font for my blog. My search ended with Droid Sans. This particular font is one among the many fonts that are available as part of Google Web Fonts project. How do I use this inside HTML? Just add the following line under the <head> tag.
<link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold|Droid+Sans+Mono" />
Then in your CSS definition use Droid Sans and Droid Sans Mono as required. For example I have something like this.
body, input, textarea {
color: #444;
font: 14px "Droid Sans", arial, helvetica, sans-serif;
line-height: 1.5em;
}
This font looks really great. I like it.
Apple Warranty Support – Win!
Last July I bought an iPod touch from U.S through one of my colleagues. Recently the home button stopped working. I took it to Reliance Digital iStore, Chennai for servicing. Since the device is still under warranty they said, they will replace the whole unit. They said I will be able to collect the new one after 5 working days. And after 5 days it happened. I went and collected a new iPod and I restored my old iPod settings to the new one. Win!
Debian Squeeze (aka 6.0) on IBM ThinkPad R52.
Installing the latest version of Debian ThinkPad R52 was not as straight forward as I thought. I had only one issue and this blog post talks about that. Since I manually solved this problem, I hope a blog post might be useful for others.
The problem occurs while detecting “Network devices”. The installer is unable to proceed because the process (ethdetect) which detects all network devices never returns control to the installer. Since IBM ThinkPad R52 comes with Intel wireless chip, the driver needs firmware which are not part of Debian official release.
noorul@laptop:~$ lspci | grep Wireless
04:02.0 Network controller: Intel Corporation PRO/Wireless 2200BG [Calexico2] Network Connection (rev 05)
The installer keeps on looking for this firmware in /dev/fd0 (i.e floppy disk) which my machine don’t have and it loops. See below.
Feb 6 11:18:09 kernel: [ 210.472933] FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
Feb 6 11:18:13 kernel: [ 214.710322] end_request: I/O error, dev fd0, sector 0
Feb 6 11:18:26 kernel: [ 227.758197] end_request: I/O error, dev fd0, sector 0
Feb 6 11:18:26 kernel: [ 227.758207] FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
Feb 6 11:18:30 kernel: [ 231.454131] kjournald starting. Commit interval 5 seconds
Feb 6 11:18:30 kernel: [ 231.454335] EXT3 FS on sda9, internal journal
Feb 6 11:18:30 kernel: [ 231.454338] EXT3-fs: mounted filesystem with ordered data mode.
Feb 6 11:18:39 kernel: [ 240.810198] end_request: I/O error, dev fd0, sector 0
Feb 6 11:18:39 kernel: [ 240.810207] FAT: unable to read boot sector
Feb 6 11:18:52 kernel: [ 253.874008] end_request: I/O error, dev fd0, sector 0
Feb 6 11:19:05 kernel: [ 266.933613] end_request: I/O error, dev fd0, sector 0
Feb 6 11:19:05 kernel: [ 266.933630] attempt to access beyond end of device
Feb 6 11:19:05 kernel: [ 266.933633] fd0: rw=0, want=66, limit=8
Feb 6 11:19:05 kernel: [ 266.933636] isofs_fill_super: bread failed, dev=fd0, iso_blknum=16, block=32
As a solution, I choose “expert mode” installation and before setting Network devices, I switched over to another virtual terminal (Alt-F2) and got a shell. I ran “ethdetect” command there so that this runs as a separate process independent of the installer. This step will not block the installer and you can continue with setting up network from the menu skipping detecting network devices.
Write consistently!
I started this blog to learn writing and communicate with outside world. Also to make my presence on the web felt. But I am not updating this blog regularly which is very bad.
I am a person who admires Sacha Chua (http://sachachua.com) in this particular skill. I have been following her blog ever since she started blogging using emacs-muse and planner (both of them are major modes of Emacs). Over the time I could see a change in her style of writing and look and feel of her blog. She has evolved and I like this evolution. I could learn one thing from this, start small and things will fall in place.
Recently I contacted her to become my mentor. She agreed to do the same. I hope with lots of tips and guidance from her, I can make this blog active. The very first thing she told me is that I should write first and forget about style, English and look and feel which will become better as time progress. So this is my first post towards new beginning. Thank you Sacha!
Orgmode – Generate custom report using external python script.
I use orgmode in emacs as a to-do list manager. End of every week I send my status report to the team. Earlier I used to do this manually by going through the agenda for the week and collecting relevant information. I thought of automating it since this is repeated every week.
It was super easy for me because, I strictly associate each task with a corresponding tag to uniquely identify it. These tags are related to my office projects and the script is a custom one which suits my requirement.
Here is the emacs part.
(defun noorul/gen_weekly_report (startPos endPos)
"Generate weekly report using external pythong script"
(interactive "r")
(let (scriptName)
(setq scriptName "~/work/python/gen_weekly_report.py")
(shell-command-on-region startPos endPos scriptName "*Weekly Report*"
nil nil t)
))
(global-set-key (kbd "<f6> r") 'noorul/gen_weekly_report)
Here is the python supporting script.
#!/usr/bin/env python
import sys
import re
report_dict = {}
cubit_issue_id_regex = re.compile('.*(cubit\d+):.*$')
artf_issue_id_regex = re.compile('.*(artf\d+):.*$')
issue_desc_regex = re.compile('.*(WAITING|DONE|NEXT) (.*) :.*$')
for line in sys.stdin.readlines():
id_match = re.match(cubit_issue_id_regex, line)
if not id_match:
id_match = re.match(artf_issue_id_regex, line)
if id_match:
issue = id_match.groups()[0]
issue_desc = ''
desc_match = re.match(issue_desc_regex, line)
if desc_match:
issue_desc = desc_match.groups()[1]
if issue not in report_dict.keys():
report_dict[issue] = issue_desc
print 'This Week:\n'
for issue in sorted(report_dict.keys()):
print '* %-10s: %s' % (issue, report_dict[issue])
Now to collect my report, all what I have to do is, go to the agenda buffer switch to log mode and mark the week area and press ‘F6 r’.
I think I can avoid the region marking step and that will be an enhancement.
Filtering IMAP mails using imapfilter
I use gnus to read my mails. Gnus is a very powerful emacs tool. Basically we don’t require a client side filtering system if one is provided by the server like Google Mail. But we do require one if the server is not supporting filtering mechanism.
Initially I was using inbuilt filtering system from gnus. Since I run emacs all the time on my machine and the filtering mechanism was interfering with my editing task, I thought of decoupling the same from Gnus. Google helped me to find imapfilter which is a very powerful tool.
Getting imapfiler
You can download the software from here http://imapfilter.hellug.gr/.
Installing
You can compile and install the program from the sources by typing:
tar -zxvf imapfilter-x.y.z.tar.gz cd imapfilter-x.y.z make make install
Configuring
imapfilter uses lua as extension language. Here is an example ~/.imapfilter/config.lua
You can configure multiple mail accounts. Since I have only one
non-gmail account I have not tried that. The syntax is self explanatory.
- Define an account like this.
account1 = IMAP {
server = 'your.exchage.server.com',
username = 'username',
password = 'reallysecret',
ssl = 'ssl3'
}
- Filter messages based on different header fields like this.
msgs = account1.INBOX:contain_field('To', 'x-mailing-list@mail.com')
msgs = account1.INBOX:contain_field('Subject', 'Joke')
msgs = account1.INBOX:contain_field('From', 'support@bank.com')
You can use complex filters like
msgs = account1.INBOX:contain_field('To', 'y-mailing-list@mail.com') +
account1.INBOX:contain_field('Cc', 'y-mailing-list@mail.com')
- Perform an action on the filters messages
account1.INBOX:move_messages(account1['x-mailing-list'], msgs)
- If we combine everything into a function.
function sortMail()
options.timeout = 120
options.subscribe = true
account1 = IMAP {
server = 'your.exchage.server.com',
username = 'username',
password = 'reallysecret',
ssl = 'ssl3'
}
msgs = account1.INBOX:contain_field('To', 'x-mailing-list@mail.com')
account1.INBOX:move_messages(account1['x-mailing-list'], msgs)
msgs = account1.INBOX:contain_field('Subject', 'Joke')
account1.INBOX:move_messages(account1['jokes'], msgs)
msgs = account1.INBOX:contain_field('From', 'support@bank.com')
account1.INBOX:move_messages(account1['bank'], msgs)
msgs = account1.INBOX:contain_field('To', 'y-mailing-list@mail.com') +
account1.INBOX:contain_field('Cc', 'y-mailing-list@mail.com')
account1.INBOX:move_messages(account1['y-mailing-list'], msgs)
end
become_daemon(300, sortMail)
Now we have a simple complete imapfilter config.lua. This file should
reside in ~/.imapfilter/ folder. This is the default location.
Executing imapfilter
Just run the following command. The option -l is used to specify log file.
imapfilter -l /tmp/imapfilter.log
Trouble
I had one issue with imapfilter so far. Sometimes the program terminates because of some protocol handling issue with the exchange server. So I have a script watch_imapfilter.sh added to crontab to monitor imapfilter process.
#!/bin/sh
result=`pgrep imapfilter`
if [ $result ]
then
echo "imapfilter is already running"
else
echo "imapfilter is not running"
echo "Starting imapfilter...."
/usr/local/bin/imapfilter -l /tmp/imapfilter.log
fi
And the crontab entry looks like this.
# m h dom mon dow command */1 * * * * /home/noorul/bin/watch_imapfilter.sh >/dev/null 2>&1
Further reading
The imapfilter and imapfilter_config manual pages are available online.
Web presence!
I am already there on the internet but I never had a consistent web location were people can reach me. So I decided to effectively use my already existing domain noorul.com along with a new hosting provider.
I bought noorul.com domain on 02-Aug-2006, almost 4 years from today. The idea was to host my own web page and blog. Though the deal for domain registration was cheap but hosting became expensive. Even though I hosted my blog at noorul.com for sometime later I pulled back because my hosting account got expired. Now I got a good deal from HostSo and I thought I will bring it back and stick to it forever.
Along with blog I am planning to move all mailing related activities to noorul.com.
This is what I am planning to do with my domain.
Mail and Chat
- I already have Google Apps setup for this domain. My mail account noorul {at} noorul {dot} com was up and running for a long time but I never advertised it.
- Also I can use the same e-mail address for google-talk.
Invite all gmail friends for chat. This can be done easily using bitlbee - Import all contacts from my old Google Account
- E-mail all contacts to inform address change.
Blog
- Setup WordPress blog engine at noorul.com
- Choose basic theme and later I tweak it.
- Import all posts from old blog to this new site.
Feed
- Update feedburner with new blog feed details.
The most important thing is to keep this blog active for which I have to consciously keep trying.