Wednesday, June 11, 2008

Migration to WordPress

I’m migration the blog to WordPress.

In the process I’m changing/fixing:

  • the overall look of the blog
  • the post categories
  • some html related problems/improvements in some posts

I’m also redirecting http://lof-ubuntu-xp.lofspot.net/ from Blogspot to WordPress.

All the posts from the old blog are already migrated.

Please, let me know what you think.

last updated: 11-06-2008

Tuesday, June 10, 2008

ufw - Ucomplicated Firewall

I'm starting to play around with ufw (Ucomplicated Firewall), a firewall for Linux.

It's command line based, but simple enough.

I'll update this post as I play along.

Enable/disable ufw

  • enable
sudo ufw enable
  • disable
sudo ufw disable

Default policy

  • mostly open ports
sudo ufw default allow
  • mostly closed ports
sudo ufw default deny

Add rules syntax

sudo ufw allow|deny [proto *protocol*] [from *address* [port *port*]] [to *address* [port *port*]]

Delete rules syntax

sudo ufw delete *rule type* from *ip address* to any port *port number*

Firewall status

sudo ufw status

Firewall loaded

To Action From
-- ------ ----
24800:tcp ALLOW 100.000.1.1

Examples

sudo ufw allow proto tcp from 100.000.1.1 to any port 24800
sudo ufw delete allow proto tcp from 100.000.1.1 to any port 24800

Further reading

last updated: 10-06-2008

Thursday, June 5, 2008

Removing old kernels from your system

After a while you're starting to collect kernel versions on your system.

Since Hardy came out, with kernel 2.6.24-16, we had two kernel updates, so, in grub we have now entries to kernels 2.6.24-16, 2.6.24-17 and 2.6.24-18.

We just need one to boot in, and we and the most recent one of course. Still, when deciding to remove an old kernel be aware of possible problems.

Virtualbox for instance, needs a module to the specific kernel you're running. Every time a new kernel is released your Virtualbox setup will not work until your upgrade the said module.
So, if you need to use Virtualbox and you don't yet have the new module, you could just restart into the old kernel.

So, think before you remove old kernels.

Removing old kernels

  • Check what versions you have installed
sudo dpkg --list | grep linux-image
  • Output example

ii  linux-image-2.6.24-16-generic                  2.6.24-16.30                                       Linux kernel image for version 2.6.24 on x86
ii linux-image-2.6.24-17-generic 2.6.24-17.31 Linux kernel image for version 2.6.24 on x86
ii linux-image-2.6.24-18-generic 2.6.24-18.32 Linux kernel image for version 2.6.24 on x86
ii linux-image-generic 2.6.24.18.20 Generic Linux kernel image
ii virtualbox-ose-guest-modules-2.6.24-16-generic 24 virtualbox-ose-guest module for linux-image-
ii virtualbox-ose-guest-modules-2.6.24-17-generic 24.0.1 virtualbox-ose-guest module for linux-image-
ii virtualbox-ose-modules-2.6.24-16-generic 24 virtualbox-ose module for linux-image-2.6.24
ii virtualbox-ose-modules-2.6.24-17-generic 24.0.1 virtualbox-ose module for linux-image-2.6.24

  • In this example, only the first 3 rows are candidates to go. Make sure you don't remove the kernel you're using.
uname -r
  • To remove, for instance 2.6.24-16
sudo apt-get remove linux-image-2.6.24-16-generic
  • Update your grub list
sudo update-grub


And that is that.


Further reading:


last updated: 05-06-2008

Wednesday, June 4, 2008

Syncing Windows Mobile 5/6 with Synce (updated)

UPDATE 04/06: Sync-engine and create partnership commands changed (Hardy users after system update).
UPDATE 05/06: What to do when you update your kernel (check "Kernel module" bellow).

One of my "to achieve" points was syncing my calendar and contact information from my Windows Mobile 5.0 Smartphone (Qtek 9100).

After trying for some time, I used a tip from Synce mailing lists. This tip was great for me because the author was also having troubles and started from scratch.

I think my problem was the config.xml file. I believe that if I just followed the instructions from the good folks from Synce, as I first did, but changed the config.xml, as in the mailing list, I wouldn't have needed to clean my system.

So, if you are starting, you probably could skip the "clean your system" part.

I will show how I'm syncing my phone with Evolution using Synce in Ubuntu 8.04.
This is based in Synce wiki and Synce mailing lists.

Note: save this post if you're using Gnome Network Manager, because you'll probably stay without Internet after installing the core libraries. It's very easy to fix though.


Adding repositories

  • Go to System > Administration > Software Sources
  • Add the following Third Party software
deb http://ppa.launchpad.net/synce/ubuntu hardy main
  • Close and Reload, as asked, your sources

Kernel module


  • Unload the current modules:
sudo rmmod rndis_host cdc_ether usbnet
  • Now we have to delete the old drivers, such that the kernel will not reload them next time:
sudo rm /lib/modules/`uname -r`/kernel/drivers/net/usb/{rndis_host,cdc_ether,usbnet}.ko
  • Now we have to get and compile the new drivers:
sudo apt-get install usb-rndis-source cdbs
sudo module-assistant auto-install usb-rndis

Every time you update your system kernel redo this steps. Everything should be fine again :-)


Core libraries

  • Get the core libraries
sudo apt-get install odccm librra0-tools librapi2-tools
  • Connect your device and run
synce-pls

You should see a list of files on your device. If so you have a working connection to your device!


Password protected device

When running synce-pls, if you have the following error, your device is password protected. If so, install SynCE-GNOME or SynCE-KPM to provide a password prompt on device connect.

I didn't try this because my device isn't password protected...

. WARNING **: synce_info_from_odccm: Failed to get a connection for : Not authenticated, you need to call !ProvidePassword with the correct password. pls: Could not find configuration at path '(Default)'


Gnome Network Manager

If you're running
Gnome Network Manager you don't have Internet by now because your phone is now the new default network connection.

Follow this and you should be fine:

  • Check what ethernet device was given to your phone
ifconfig -a | grep 80:00:60:0f:e8:00 | cut -d " " -f 1
  • In my case is rndis0
  • Add the next line to /etc/network/interfaces (replace rndis0 with the result from the previous command)
sudo vi /etc/network/interfaces
add iface rndis0 inet dhcp to the file
  • This will make Gnome Network Manager ignore the interface
  • Restart your network
sudo /etc/init.d/networking restart


No devices are connected to odccm

If you get an error that no devices are connected to odccm you should probably blacklist ipaq module:

  • Add the next line to /etc/modprobe.d/blacklist
sudo vi /etc/modprobe.d/blacklist
add blacklist ipaq to the file
  • After that you can remove any currently active ipaq modules
sudo rmmod ipaq


Clean your system

If you have been playing around with Synce without success you may want to clean your system before continuing.
Check this tip for more info.

  • Check what packages to remove from the result of each of the following
dpkg-query -l *sync*
dpkg-query -l *dccm*
dpkg-query -l *rra*
dpkg-query -l *rapi*
dpkg-query -l *multis*
dpkg-query -l *opensync*
  • I then did
sudo apt-get remove libsynce0 multisync-tools opensync-module-python opensync-plugin-evolution opensync-plugin-synce python-opensync synce-kpm synce-sync-engine
sudo apt-get remove odccm
sudo apt-get remove librra0 librra0-tools
sudo apt-get remove librapi2 librapi2-tools
sudo apt-get remove multisync-tools
sudo apt-get remove libopensync0
  • Remove your Synce home config folder
rm -rf ~/.synce
  • Removed the byte compiled file
sudo rm -f /usr/lib/opensync/python-plugins/synce-opensync-plugin-2x.pyc


Syncing with OpenSync (needed packages)

In order to sync your device you need to use OpenSync.

sudo apt-get install odccm librra0-tools librapi2-tools multisync-tools opensync-plugin-kdepim opensync-plugin-synce
sudo apt-get install multisync-tools opensync-plugin-evolution opensync-plugin-synce


Sync-engine

Sync-engine must be running in order to sync your phone.

  • Download the config.xml file needed by sync-engine
cd ~/.synce/
wget
http://synce.svn.sf.net/svnroot/synce/trunk/sync-engine/config/config.xml

Now the tip. The current config.xml has the AutoSyncCommand and the Disable commented. Uncommented, leaving it disabled.

  • You can download my own
cd ~/.synce/
wget http://lofspot.net/synce/config.xml
  • Start sync-engine
synce-sync-engine

Connect your phone via usb. You shouldn't get any errors.


Create a partnership

You have to create a partnership between device and computer using one of two methods:
  1. Via command line
  2. Using synce-kpm (graphical and recommend)

(1) You can then use the command

synce-create-partnership "Linux desktop" "Contacts,Calendar"

The "Linux desktop" string can be any string of 20 characters or less. The available items for synchronization are:

* Contacts
* Calendar
* Tasks
* Files

When specifying items to sync, they must be separated by commas. You must also surround the list in double quotes and the string must not contain any whitespace.

(2) Or install synce-kpm

sudo apt-get install synce-kpm

Now run synce-kpm

synce-kpm

Go to Partnership manager. You probably have already partnerships created if you ever synced your phone under Windows.

My advice, after playing around is to delete every partnerships you already have and create a new one. I choose to sync Calendar, Contacts and Tasks.


synce-opensync-plugin

Check the list of the available plugins:

msynctool --listplugins

You should have synce-opensync-plugin.

If you don't see the above plugin in the output of msynctool, then download the plugin and copy this file to /usr/lib/opensync/python-plugins.

I already had the plugin.


Create OpenSync group

A group between SynCE and your chosen PIM application must be initiated.

I'm using Evolution (evo2-sync).

msynctool --addgroup synce-sync
msynctool --addmember synce-sync synce-opensync-plugin
msynctool --addmember synce-sync evo2-sync


Syncing your device (finally)

  • Start sync-engine and connect your device
synce-sync-engine
  • Start synce-kpm
synce-kpm
  • Sync with OpenSync
msynctool --sync synce-sync

This could take some time the first time, so be patient. You can check your progress in synce-kpm.

After the msynctool command ends completely check Evolution :-)


Day to day config

To simplify I created a script to synchronize my phone.

touch sync_smartphone.sh
chmod a+x sync_smartphone.sh
vi sync_smartphone.sh

Add to the file:

#!/bin/bash
synce-sync-engine &
sleep 20
synce-kpm &
sleep 20
msynctool --sync synce-sync

Now connect your phone, run sync_smartphone.sh and check your progress in synce-kpm graphical UI.



Please, feel free to post a comment or email me at lof-ubuntu-xp [(at)] lofspot.net.

This is just a "this is how I did it" post. I probably won't be able to help you, especially in another distribution/version or phone, still feel free to share your experience.


Further reading:

last updated: 05-06-2008
original post: 21-05-2008

Sunday, June 1, 2008

Firefox Guinness World Record

Help Firefox get the Guinness World Record for the most software downloads in 24 hours.

All you have to do is download Firefox 3 within the 24 hour after is release.

The launch day will be announced soon, so bookmark this link.

You can also get involved, and spread this record attempt.

Download Day 2008

last updated: 01-06-2008

Thursday, May 1, 2008

NFS file sharing

Here's how you share files between two Linux machines, using NFS.

Installation

  • Go to the Synaptic Package Manager
  • Find nfs-kernel-server and install
Configuration in machine 1 (where the shared folder is)
  • Define the shares you want to provide
sudo vi /etc/exports
  • Add your shares to the file
/home/mach1user/Public *(ro,sync)
/home/mach1user/Documents 100.000.00.01(ro,sync)
/home/mach1user/Share 100.000.00.01/20(rw,sync)
  • Make your changes be known
sudo exportfs -a

Configuration in machine 2
(where the shared folder are going to be accessed)
  • Create a folder, where the share will be mounted
mkdir /home/mach2user/HomeNetwork/Public
mkdir /home/mach2user/HomeNetwork/Documents
mkdir /home/mach2user/HomeNetwork/Share
  • Mount the shares (the IP is from machine 1)
sudo mount 100.000.0.05:/home/mach1user/Public /home/mach2user/HomeNetwork/Public
sudo mount 100.000.0.05:/home/mach1user/Documents /home/mach2user/HomeNetwork/Documents
sudo mount 100.000.0.05:/home/mach1user/Share /home/mach2user/HomeNetwork/Share
  • Make the shares available after rebooting
sudo vi /etc/fstab
  • Add to the file (the IP is from machine 1)
100.000.0.05:/home/mach1user/Public /home/mach2user/HomeNetwork/Public nfs ro,hard,intr 0 0
100.000.0.05:/home/mach1user/Documents /home/mach2user/HomeNetwork/Documents nfs ro,hard,intr 0 0
100.000.0.05:/home/mach1user/Share /home/mach2user/HomeNetwork/Share nfs ro,hard,intr 0 0

And that should do it.


Further reading:
last updated: 01-05-2008

Windows under Linux

Ok, some things I may need to do in Windows (for now).
So I will install a virtual Windows machine using VirtualBox.

Install

  • Applications > Add/Remove Applications
  • Show: All available applications
  • Search: virtualbox
  • Check VirtualBox OSE and Apply Changes
  • Run VirtualBox (Applications > System Tools > VirtualBox OSE)
Creating a new Virtual Machine
  • Click New and follow the instructions (a virtual hard disk is needed, but you'll be easily guided through the installer)
  • Go to Synaptic Package Manager
  • Search for virtualbox
  • Install virtualbox-ose module for your kernel (like linux-image-2.6.24-16-generic)
  • Install virtualbox-ose-guest module for your kernel (like linux-image-2.6.24-16-generic)
  • Go to System > Administration > Users and Groups
  • In Manage Groups find vboxusers, click Properties and add your user to this Group
  • Logout from Ubuntu
  • Back to VirtualBox
  • Go to Settings > CD/DVD-ROM and mount your Windows CD or iso Windows file
  • Start the Virtual Machine and install Windows
  • Tip: Click in the VirtualBox window to get the mouse pointer into Windows and click Alt+Ctrl to get the mouse pointer back to Ubuntu
  • Note: I used Brasero to create a ISO image of Windows XP
Share folders with the Virtual Machine
  • In the VirtualBox window go to Devices > Install Guest Additions
  • This will download an iso image file, mounting it in Windows and install Guest Additions for Windows
  • Shutdown Windows
  • Go to Settings > Shared Folder and add the folders you want to share
  • Start Windows and map a Network Drive to:
\\vboxsvr\yoursharedfolder

VirtualBox running modes
  • Windowed: in this case Windows will be displayed in a window
  • Fullscreen: in this case Windows will be displayed in full screen
  • Seemless mode: in this case Windows will be integrated into Gnome


Further reading:

last updated: 01-05-2008