Tuesday, March 27, 2012

Creating a presentation for showing source code

Giving a presentation which has source code fragments has never been easy.

Normally, I have been pasting code fragments in an OpenOffice presentation. The effort in getting it right has been sufficiently irritating that I try to avoid it.

I finally used a process which I found very convenient.

1. Use vim :TOhtml command to get color coded source code. It was even easier using gvim.

2. Open the html file in OpenOffice. Change the font size to 16.

3. Create a new OpenOffice text document. Choose page size as A5 and landscape orientation.

4. Copy paste the fragments. Add comments, etc. Edit like a normal text document.

5. Export it to pdf.

6. Show it using the presentation mode in evince or  okular.




Monday, March 5, 2012

Overcoming Slow Boot of Fedora 16 after LiveCD installation

I had failed to upgrade Lenovo S10-3 netbook to Fedora 16 using yum as I have been doing for several years and successfully did on my desktop. The system became unusable under Fedora; so, I could not diagnose the cause.

I installed KDE livecd spin on the netbook. The boot time seemed to be ages in comparison to Fedora 15 and, especially, Arch Linux which I normally use on this netbook.

Searching the net for plausible reasons led to using "systemd-analyze blame". The top of the list was "udev-settle.service", which really is not the issue.

Anyway, I noticed that there were livesys.service and livesys-late.service which are not needed once the livecd is installed. The time shown for these by "systemd-analyze blame" was 290ms and 44msec respectively. Hardly something to worry about. However, disabling the livesys and livesys-late services resulted in the userspace boot time decreasing from 87 sec to 36 sec! The overall decrease was 97 sec to 44  sec :)

Now, "systemd-analyze blame" gave a little more useful details. The top entry was iscsi.service. Wikipedia entry indicated that this was not something I was likely to use. Disabling iscsi and iscsid services reduced the userspace boot time to 27 sec and overall time to 37 sec.

Removing mdmonitor-takeover and lvm2-monitor services did not make any significant difference.

Disabling httpd and and mysqld, which I normally do not need on the netbook, saved another 5 sec and the boot time now is 32 sec of which 22 is the userspace time.

Next step is to use bootchart to see if I can understand where the time goes before the system becomes usable.