Wednesday, August 24, 2011

Rsync - What on earth did I do!

I created a new document related to a course I am teaching on my netbook. I rsync'd my netbook to the desktop. To my horror, the lecture notes I had prepared on the desktop were over-written by the version on the netbook.

Why can't software prevent me from doing something so dumb.

Well, I should have examined the implications more carefully for bi-directional rsync.


Another often used flag not included in -a is -u, which says not to overwrite newer files. If we wanted to do a Briefcase style synchronization, we need -u, and we need to do the rsync in two directions:
rsync -aHu a/* b
rsync -aHu b/* a

Monday, August 22, 2011

Arch Linux - experience with kernel 3.0

Upgrading to kernel 3.0 on Lenovo S10-3 did have a couple of issues. The first issue was that the wifi was not functioning. This was easily solved by following the instruction on Arch Wiki and blacklisting the conflicting bcma driver.

The other issue was that waking from sleep is not working any more. This is in spite of  adding 'intel_idle.max_cstate=0' to the kernel boot options. Hence, I reverted to kernel 2.6.39 until I have time to examine the problem in more detail and see if  there is a workaround.

Incidentally, I have been facing erratic behaviour with waking from sleep on Lenovo S10-3 with Ubuntu 11.4 with 2.6.38 kernel and Fedora 15 with 2.6.40(!) kernel. I thought that the reason may be that I am using x64 versions of Ubuntu and Fedora whereas on Arch Linux I have installed the i386 version.

Update: A silly mistake in Fedora 15 grub.conf file. I had typed 'state' instead of 'cstate'. Initial tests of sleep work on Fedora 15 with kernel 2.6.38 but not with 2.6.40 (presumably the same as mainline 3.0). I will have to check if the behaviour of waking from sleep on Fedora is consistent as on Arch Linux or erratic as on Ubuntu.

Update 2 -  I found that there is a bug report of the waking from sleep issue on Debian bugs list when upgrading from 2.6 to 3.0.

Retraction of Farewell to Education

About 5 years ago, I had given up on education in India. From August, I started to teach a course - Software Engineering. The difference is that it is at IIT, Ropar, instead of a college affiliated to a university.

After two weeks, I was wondering what makes the difference to me. I am sure the students are very good; however, I had enough good students that that was never a de-motivational issue.

The major impact for me is the control over the course. I am experimenting with a lab - I may be wrong but I think it is worth trying and seeing if the students learn more. The fact that the lab grade matters, the students are willing to be a part of my experiment. I just have to convince them that the experiment will not be unfair to any.

I suddenly realised that I was covering more content than I expected. I can choose to leave out parts I do not think are very important today and add content related to agile processes which appeals to me a lot more. I can also choose to emphasise tools which I believe help create better software. I do not have to worry about the paper setter or complaints of 'out of syllabus' from students of another college.

Bottom line - I am enjoying it and enjoying the effort I have to put into fine tuning the course to hopefully make it more effective.

Monday, July 25, 2011

More Experience on Canon LBP2900B

I have found a few workarounds by which the Canon LBP2900B works reasonably.
  • On Fedora 15, we need to restart the ccpd after it has booted
    • $ sudo systemctl restart ccpd.service
  • If the printer is out of paper, the print job is stuck. 
    • The button on the printer seems to have no effect
    • Cancel the print job
    • Enable/resume the printer
  • Printing from some applications fails (e.g.printing an image, Adobe's Document Viewer). Workaround was:
    • Print to a pdf file
    • Print the pdf file using a Linux application(evince or okular)

Friday, June 17, 2011

Blogspot problems

I was surprised to find problems in loading any blog on blogspot.com this morning. Occasional problems are present but even in the evening it was not loading and searched to see if there was a problem reported. Instead I found this http://www.labnol.org/india/blogspot-blogs-inaccessible/18670/ and found that the following suggestion in the post  worked!

http://sethanil.blogspot.com.nyud.net 
Publish Post
Wonder why? 

Friday, June 3, 2011

Another case for Rolling distribution

While it is nice to read a news item like  "Asus will preload Ubuntu Linux on three Eee PCs", statements like the following cause a discordant note:
"The only question left is Asus' decision to ship Ubuntu 10.10 although Ubuntu 11.04 came out back in April."

In the case of open source, the users get to try the software before the vendors get around to it. Hence, rolling distributions are ideal. The vendor-supported OS will not be obsolete from the perspective advanced users and, worse, trade press, which will influence the non-tech consumers.

I wish some vendor would latch on to Arch Linux :)

Fedora 15, CUPS - Why does Canon LBP2900B behave so erratically?

I installed a Canon LBP2900B printer and discovered that the drivers are not included in Fedora. It was easy to get them from http://support-asia.canon-asia.com/contents/ASIA/EN/0900772407.html.

The printer worked but after a reboot, the printer did not seem to work. CUPS insisted on creating an additional LBP2900-2 printer for device usb://Canon/LBP2900, while the correct LBP2900 was on device ccp://localhost:59687.

Ignoring all the false steps, the problem would be overcome by stopping the ccpd server and restarting it.

It took a number of reboots and installing it on Ubuntu 11.04 as well to identify that while the additional entry for the same printer by CUPS was confusing, it was harmless.

The real problem was that /etc/init.d/ccpd service should have two processes. On Fedora 15, it was having only one. However, when I stopped the service and restarted it, it would start correctly with two processes:
$ sudo systemctl status ccpd.service
ccpd.service - LSB: Start Canon Printer Daemon for CUPS
      Loaded: loaded (/etc/rc.d/init.d/ccpd)
      Active: active (running) since Fri, 03 Jun 2011 09:56:52 +0530; 11min ago
     Process: 5681 ExecStop=/etc/rc.d/init.d/ccpd stop (code=exited, status=0/SUCCESS)
     Process: 5693 ExecStart=/etc/rc.d/init.d/ccpd start (code=exited, status=0/SUCCESS)
    Main PID: 5698 (ccpd)
      CGroup: name=systemd:/system/ccpd.service
          ├ 5698 /usr/sbin/ccpd
          ├ 5702 /usr/sbin/ccpd
          └ 5703 captmon2 --data-write-fd=8 --data-read-fd=12 --cmd...
The issue appears to be somehow related to systemd starting services in parallel. The ccpd server probably expects some service to be running which has not yet started.