Sunday, June 20, 2010

Fun with gtkpod on FC-13

Connected my Ipod Video to my FC-13 machine. It was immediately detected and mounted. Fired up gtkpod and got the file listing without hitch. Made a few changes by adding and deleting a few songs. This too went ahead smoothly. I then quit after saving changes,

After the ipod was unmounted and detached from the USB port, all the songs had DISAPPEARED! But the available space indicated that the files were in there somewhere. Plugged it bak into the USB and gtkpod faithfully listed all the files.

Went back to Itunes on my Vista laptop. Initially vista would not detect the ipod. I reset the ipod while it was still plugged into the USB. Then it got detected. Started itunes, first and foremost updated to the latest firmware version 1.13. After the new firmware got installed, the ipod did a self reset. iTunes then displayed all the songs without any loss.

Did a thorough research on the net and found that in order to not mess up the ipod database the following has to be done before first time using gtkpod:

1. Plug in the ipod into the USB.

2. Open a terminal window. Become superuser by "su -" command.

3. Run command "mount" You can see the mount details of the ipod.
This line will have the actual name of the ipod and its mount
point usually in the /media folder. We need two values from
this line. In my case they were "/dev/sdb2" and "/media/STEVE".
STEVE is the name of my ipod. The first value is the device
associated to the ipod and the second its mount point.

4. Run the command:

/usr/bin/ipod-read-sysinfo-extended /dev/sdb2 /media/STEVE

Replace the two values as per the result of your "mount" command.

5. Unmount the ipod and replug it. Now you can run gtkpod safely
to file manipulations in the ipod without making the files disappear :-)

I found http://gtkpod.wikispaces.com quite useful in my quest to restore my ipod without losing anything.

Thursday, June 10, 2010

GnuCash 2.2.9 on FC-13

FC-13 comes bundled with the 2.3.11 version of GnuCash. Unfortunately this version is not compatible with 2.2 and earlier versions and will not recognize the file headers while trying to open data files of those versions. This means doom for users who upgraded mid-year and found data incompatibility.

I ran :

rpm -qa | grep gnucash

Then the following were listed:

gnucash-2.3.11-1.fc13.i686
gnucash-docs-2.2.0-4.fc12.noarch

removed the two packages separately using

rpm -ev package-full-name --nodeps

I downloaded the source 2.2.9 tar file from the GnuCash website and got about compiling it in FC-13. So here is the procedure I had to adopt to get it running.

Afer the above tar file is extracted. Run the "./configure" command as root from the extracted directory. This may have to be done many times because each time some lib files etc., may be found missing and we need to install them through the Gnome software manager.

After a clean exit is made from "./configure". Run the "make" command, in my case I got an error "goffice/graph/gog-style.h: No such file or directory".

From wiki.gnucash.org, I found the solution.

uninstalled "goffice-devel-0.8.1-1.fc13.i686" and "goffice-0.8.1-1.fc13.i686" using

rpm -ev package-full-name --nodeps

downloaded "goffice-0.6.6-4.fc12.i686.rpm" and "goffice-devel-0.6.6-4.fc12.i686.rpm" from "http://rpm.pbone.net"

installed these by

rpm -ivh package-full-name --nodeps

Ran the "./configure" and "make" commands again.

This time, the "make" exited without error. Then I ran the "make install" command and a working GnuCash 2.2.9 got installed.

Tuesday, November 17, 2009

BSNL Broadband free night surfing UTStarcom 3002G4

Many plans in BSNL Broadband ofer free surfing during 02:00 to 08:00 Hours. The twist is that the user must re-login after 02:00 Hours. Any usage starting before the free period but continuing into it will be charged at the usual rate. If are using a UTStarcom 3002G4 router in the bridged (always on) mode all you need to attain is a re-boot of the router after 02:00 AM.

Scheduling text based downloads to take advantage of the free period without having to wait till 2:00 AM to switch-off and switch-on the router can be avoided using a few shell scripts. While attempting the these instructions please make sure that your system time is set to IST correctly. To make matters a bit safer, I have scripted in such a way that the router re-boots at 02:10 AM to accomodate for upto 10 minute discrepancy between the system clock and IST.

It is quite simple to set a cron job at 02:10 AM to re-boot the modem and to run the scripts for starting the download. But I found that cron jobs run in the background so when we need to stop the downloads and to re-boot the router as 08:00 AM approaches, we have to wade through a whole host of processes using "ps -ef" and ensure that we individually "kill -9" all relevant processes set off by our script.

Therefore I devised a couple of scripts. All we have to do is execute the first script (dlstart.sh), at our convenience, anytime on the previous day from a terminal. After that we can switch-off the monitor and save some power too.

The procedure first calculates the number of seconds until the next 02:10 AM and issues a "sleep" for this period. Subsequent to sleeping, the script can invoke any download command of our choice like "wget","downloadcurses" or any other.

Before 08:00 AM, switch on the monitor and close the ongoing download process and re-boot the router by typing without quotes "router-reboot.sh | telnet" or by simply toggling it off and on.

Main Script "dlstart.sh" to be placed in /usr/bin with mode 777

==========
#!/bin/bash

# Automatic Download from 02:00 HRS

cd /home/ebby/Downloads/rsdown_linux

# Calculating seconds till next 02:10 HRS

da="$(date +%Y)-$(date +%m)-$(date +%d)"
day1=$(date -d "$da +1 day" +%s)
day2=$(date +%s)
slp=`expr $day1 - $day2 + 7800`

echo sleeping for $slp seconds !

sleep $slp

sh router-reboot.sh | telnet

sh "your favourite dowload command with path"
============

Script "router-reboot.sh" to be placed at /usr/bin with 777 mode

=============
#!/bin/bash

# script to be used with telnet to reboot UTStarcom 3003G4 router usually supplied by BSNL

# Put this file in /usr/bin directory with 777 mode
# Type without quotes "router-reboot.sh | telnet" to reboot the router

echo 'o 192.168.1.1 23'

sleep 2
echo 'admin'

sleep 2
echo 'admin'

sleep 2

echo 'reboot'

sleep 60
===========



Disclaimer:

The author has tested this procedure successfully only a UTRStarcom 3002G4 router. Anyone trying it out shall doing so at his/her own risk. The author shall not be resposible for any damage or loss that may occur on account of running these scripts.

This works only for bridged (always on) routers