Elijah Lofgren

I follow Jesus Christ and enjoy reading, writing, helping people, and making websites. Who is Jesus?

My life mission: "Whatever you do, do it all for the glory of God." - 1 Corinthians 10:31

You are here: Home » Linux Tips » Familiar Linux Tips

Contents

Familiar Linux Tips

Tips on this page are for Familiar Linux which runs on iPAQ Pocket PCs. I use the Open Palmtop Integrated Environment (Opie). I have a H3850 iPAQ Pocket PC.

This page is a work in progress. ;)

Networking

Connect to the Internet through the USB connection of your cradle.

Adapted from: Connecting Your Linux Handheld to a Linux Desktop via USB

Note: These command need to executed on the host PC that your are connecting your Pocket PC to, unless specified otherwise.

Note Also: These instructions are what worked for me with Kubuntu 6.06 and Familiar 0.8.3

  1. Add usbnet to be autoloaded on startup by running the following 2 commands as root (sudo -i):

    echo "usbnet" > /etc/modutils/usbnet
    update-modules
  2. Add the following to /etc/network/interfaces

     mapping hotplug       
    script grep
    map usb0

    iface usb0 inet static
    address 192.168.2.200
    netmask 255.255.255.0
    broadcast 192.168.2.255
    pre-up /etc/network/ipaq

    Note: I had to use 192.168.2.200 (notice using 192.168.2 instead of 192.168.0 or 192.168.1) because 192.168.1 and 192.168.0 were already being used for eth0 and eth1.

  3. Add script /etc/network/ipaq

     #!/bin/sh
    sleep 5
    exit 0
  4. Ensure that /etc/network/ipaq is executable

    sudo chmod a+x /etc/network/ipaq
  5. Now on the Pocket PC add this in /etc/network/interfaces

    iface usbf inet static
    address 192.168.2.202
    netmask 255.255.255.0
    network 192.168.2.0
    gateway 192.168.2.200
  6. Put PocketPC in cradle
  7. Run the following on host (This fixes freeze on PocketPC):

    sudo ifup usb0
  8. Add the following line to /etc/hosts:

    192.168.2.202 ipaq
  9. Try pinging your iPAQ:

    ping ipaq
  10. If that does not work, maybe run modprobe usb-eth on Pocket PC or maybe run ifup usbf on Pocket PC.
  11. Use firestarter to enable NAT (Internet Connection Sharing) for Local network connected device "usb0":

    1. Open firestarter.
    2. Click on "Edit -> Preferences"
    3. Click on "Network Settings"
    4. Under "Local network connected device":

      1. Next to "Detected device(s):" select "Unknown device (usb0)"
      2. Check the "Enable Internet connection sharing" box.
    5. Click the "Accept" button.
  12. Copy /etc/resolv.conf into your ipaq:

    sudo scp /etc/resolv.conf  ipaq:/etc
  13. Try pinging google.com on your iPAQ:

    ping google.com

How to copy files to and from your Pocket PC

To Backup PocketPC:

mkdir ~/pocketpc/
sudo scp -rv ipaq:/home/root/ ~/pocketpc/

Use scp to copy files to your pocket PC. For example:

sudo scp ~/LQ-Podcast-033006.mp3  ipaq:/home/root

How to ssh into your Pocket PC

Run something like this:

ssh ipaq -l root

Installing

Settings I used when installing Familiar with minicom

Adapted from Modify your h2200 cradle to provide a serial port

  1. Using minicom on the host, start with:

    minicom -s

    (you don't need to be root, but you do need privilleges for the port)

  2. Set the port parameters:

       A   Serial Device    /dev/ttyS0 
    B Lockfile Location /var/lock
    C Callin Program
    D Callout Program
    E Bps/Par/Bits 115200 8N1
    F Hardware Flow Control Yes*
    G Software Flow Control No
  3. Save settings as default, insert your iPaq in it's cradle and restart minicom with:

    minicom -o

Cool Programs


Prevent lost todo items on reboot

Modified: 2006-09-14 21:02:23

It seems that Opie Todo caches TODO items and does not write them to the flash memory until you exit the TODO program. I have lost several TODOs from times when my iPAQ would reboot or freeze. The solution is just to close the TODO app each time you change something so that it will write your list to the memory so it will not be lost when the iPAQ is rebooted.

See: todo items lost on reboot in opie-todo

Program Tips

 

Kopi

Modified: 2006-08-28 14:05:37

I just found out about Ko/pi. It looks VERY cool. I found it while searching for a way to import iCal files into Opie's datebook. I plan to export my Google Calender data to an ical file and import it into Kopi.

You can install it by running:

ipgk install kopi

Convert Checkbook qcb files to csv files

Modified: 2007-01-06 11:12:32

Your transactions are stored in .qcb file in the /home/root/Applications/checkbook folder on your handheld.

If you'd like to convert a .qcb file to a .csv file you can use the following qcb2csv.php script:

<?php
// Created by Elijah Lofgren
// Website: http://www.elijahlofgren.com
$lines = file('./Checking.qcb');

$stop_adding = FALSE;

foreach ($lines as $line_num => $line)
{
$matches = '';
$pattern = '/^\[[0-9]+\]/';
preg_match($pattern, $line, $matches, PREG_OFFSET_CAPTURE);

if (FALSE == empty($matches))
{
$trans_id = $matches[0][0];
$trans_id = trim($trans_id, '[');
$trans_id = trim($trans_id, ']');
$matching = TRUE;
}
else
{
$pos = strpos($line, ' = ');

if ($pos === false)
{
// We're done if we reach the '[Account]' line
if ('[Account]' == trim($line))
{
$stop_adding = true;
}
else
{
echo "The string was not found in the line: ".$line;
}

}
else
{
if (false == $stop_adding)
{
$name = substr($line, 0, $pos);
$value = substr($line, $pos + 2);
$value = trim(str_replace(',',' +',$value));
$transactions[$trans_id][$name] = $value;
// If this was a payment, add negative sign to amount
if ($name == 'Payment' && $value == 'true')
{
$transactions[$trans_id]['Amount'] = '-'.$transactions[$trans_id]['Amount'];
}

}
}

}

}
echo 'Date,Amount,Category,Description,Comments,CheckNumber,Number,Next,Payment,TransactionFee,Type'."\n";
// Sort by transaction id
ksort($transactions);
foreach ($transactions as $number => $data)
{
echo $data['Date'].','.$data['Amount'].','.$data['Category'].',';
echo $data['Description'].','.$data['Comments'].','.$data['CheckNumber'].','.$number.',';
echo $data['Next'].','.$data['Payment'].','.$data['TransactionFee'].',';
echo $data['Type']."\n";
}
?>

How to undo things in the text editor

Modified: 2007-01-06 11:09:43

In the Text Editor included with Opie you can undo stuff by clicking on "CTRL + z" using the on screen keyboard.

For a long time, I thought that the text editor didn't have undo capabilities since it did not have undo in the menu or as a toolbar button. Thankfully, I thought of trying to hit "CTRL + z" on the on screen keyboard.

How I back up my PocketPC running Opie on Familiar Linux

Modified: 2007-08-22 18:00:29

sudo ls
sudo ifup usb0
sudo scp -rv ipaq:/home/root/ ~/pocketpc/
sudo ifdown usb0