Saturday, 21 February 2009

Howto Display more than 5 bookmarks in gnome-panel "Places" menu

1) Open Terminal

2a) Install apt-build

sudo apt-get update
sudo apt-get install apt-build

2b) Configure apt-build:

* Optimization level: Medium
* Add apt-build repository to sources.list: Yes
* Architecture: SELECT YOUR ARCHITECTURE

3) Install files required to build gnome-panel from source and download the source

sudo apt-get build-dep gnome-panel
sudo apt-build source gnome-panel

4) Navigate to the downloaded gnome-panel source folder and open the menu items file

cd /var/cache/apt-build/build/gnome-panel-*
sudo gedit gnome-panel/panel-menu-items.c

5) Set the the maximum number of bookmarks to display before placing them in the Bookmarks submenu

Find the line:
PHP Code:
if (g_slist_length (add_bookmarks) <= MAX_ITEMS_OR_SUBMENU) {
and replace it with:
PHP Code:
if (g_slist_length (add_bookmarks) <= 20) {
Save the file.

6) Install the modified gnome-panel and restart it

sudo ./configure
sudo make
sudo make install
killall gnome-panel

Read More......

How to tether AT&T's Fuze phone (AT&T version of HTC's Touch Pro) to Ubuntu Linux

This is a tutorial showing folks how to tether AT&T's Fuze phone (AT&T version of HTC's Touch Pro) to Ubuntu Linux via USB. It is a little different from tethering a regular Windows Mobile phone to Ubuntu.

To tether the Fuze to Ubuntu Linux, 3 things need to be done:

* Crack the phone so that any connection can be shared
* Create a connection on the phone other than AT&T's MEdia Net
* Mod usb-rndis-lite to allow connection from Fuze

Please note that this tutorial is ONLY for the HTC Fuze on the AT&T (USA) Network.

This tutorial is done under Ubuntu Linux 8.10 aka Intrepid Ibex with software up-to-date (according to the update manager). It is also recommended that you have an unlimited data plan with AT&T. Tethering plan is recommended but not required.

PART I: Allow any connection on phone to be shared

AT&T has modded the registry of the Fuze so that ONLY folks with dedicated tethering plans can tether. If you have a tethering plan with AT&T, please move on to part 2. Otherwise complete this step.

1. Download a registry editor for Windows Mobile. We recommend PHM Registry Editor for Pocket PC. This links directly to the install file, so I would recommend downloading this to the phone.
2. Open File Explorer (Start > Programs > Tools > File Explorer) and navigate to where you saved the install file. Install it by tapping it once.
3. Once it installs, open it. It should be in Start > Programs.
4. Navigate to HKEY_LOCAL_MACHINE/Comm/InternetSharing/Settings.
5. You will notice a key in settings called "ForceCellConnection". Delete it.
6. That's it. Any connection can be used for tethering. Verify this by opening Internet Sharing and seeing that there are two combo boxes (one for PC Connection and one for Network Connection)

PART II: Create a connection alternative to MEdia Net

AT&T configures the Fuze's network slightly differently from its other WinMo phones. but when tethering with it's MEdia Net connection, I can never seem to log on in Ubuntu. This wasn't a problem on my Windows box, but that box ain't my main box. Anyway this step is rather simple.

1. On your phone, go to Start > Settings and tap on the connections tab. Open Wireless Manager and make sure that Data Connection is turned OFF.
2. Close Wireless Manager and go into Connections. You should see "MEdia Net" and "My Work Network". Under MEdia Net, tap "Manage existing connections".
3. You should see a radio botton labled "MEdia Net". Tap and hold it to bring up the menu and select "Delete"
4. Now tap the "New" Button. In the dialog that comes up, enter a name for your connection. This name will be the name you select in Internet Sharing later. From the combo box below it, select "Cellular Line (GPRS, 3G)". Tap Next.
5. Leave the Access Point Name box blank. Tap Next. Leave those boxes blank as well and tap finish.
6. If you did all right, you should be able to get on the web. Verify this by opening Opera on the Fuze. If web pages load, it worked.

PART III: Mod usb-rndis-lite to allow Fuze connection

This is a mod to Ubuntu now. Not the phone. Apparently HTC phones have some issues tethering to Ubuntu. This is usually due to rndis failing with some packets exceeding error. Here we will modify and recompile the source code for usb-rndis-lite to ignore that error.

1. Open up a terminal and do this:
Code:

sudo apt-get install subversion

This will install subversion, which is needed to get the latest version of usb-rndis-lite.
2. Using that same terminal, do this:

svn co http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite

This will download the latest code of usb-rndis-lite.
3. Still in the terminal, move into the folder by doing this:

cd usb-rndis-lite

4. Terminal again, open the source file we are going to edit by doing this:

gedit rndis_host.c

5. Around line 524, find the following code

if (tmp < dev->hard_mtu) {
dev_err(&intf->dev,
"dev can't take %u byte packets (max %u)\n",
dev->hard_mtu, tmp);
goto fail;
}

and change it to this:

if (tmp < dev->hard_mtu) {
dev_err(&intf->dev,
"dev can't take %u byte packets (max %u)\n",
dev->hard_mtu, tmp);
retval = -EINVAL;
/* goto fail;*/
}

Save and close the file
6. Returning to the terminal, type the commands in this order to compile and install it:

make
sudo ./clean.sh
sudo make install

Now that the steps are completed, verify everything worked by plugging your Fuze into your preferred USB port. Open the Internet Sharing app on the Fuze (somewhere in Start > Programs), select USB for PC Connection and the name of the network you typed earlier for Network Connection, and tap Connect. Ubuntu should see and connect to the phone, and you should be able to browse the web, get email, IM, and so on.

From this point on, all you should need to do is open Internet Sharing, select the right things and hit "Connect" to connect.

ONE THING TO NOTE: updating usb-rndis-lite will break this. To fix it, just repeat part 3 and your good to go.

Read More......

Thursday, 12 February 2009

Howto SetUp Dual-Dual NIC Bonding On Ubuntu

Bonding is creation of a single bonded interface by combining 2 or more ethernet interfaces. This helps in high availability and performance improvement.

How to setup dual-dual bonding (two bonds of two interfaces each) on Ubuntu as quickly as possible.

1. Add two lines to /etc/modules

bonding bond0 -o bond0 mode=1 miimon=100

bonding bond1 -o bond1 mode=1 miimon=100

If you’re very good at managing your time, just remember that miimon’s option determines how often the bond is monitored for failure and that mode can be one of:

0 - Round robin balancing

1 - Active back-up

2 - Transmit based on MAC address for load balancing/fault tolerance

3 - Broadcasting - provides fault tolerance by transmitting on all slave interfaces

4 - Aggregates links, assuming all nics support same speeds and duplex settings

5 - Transmit load balancing - balancing is handled by the bond based on load

6 - Same as 5, but also uses arp to balance load “better

2. Install the ifenslave package if you haven’t already. You can use apt-get to grab it if you don’t:

sudo apt-get install ifenslave-x.x

3. Ensure that the package actually installed:

sudo dpkg –get-selections | grep enslave

ifenslave-x.x install

4. Set up your interface files:

# cat /etc/network/interfaces (only including the parts you probably need - substitute IP addresses, netmasks, etc):

auto lo

iface lo inet loopback

auto bond0

iface bond0 inet static

address 10.10.125.88

netmask 255.255.255.0

network 10.10.125.0

gateway 10.10.125.1

post-up ifenslave bond0 eth0 eth2

pre-down ifenslave -d bond0 eth0 eth2

auto bond1

iface bond1 inet static

address 10.10.127.88

netmask 255.255.255.0

network 10.10.127.0

gateway 10.10.127.1

post-up ifenslave bond1 eth1 eth3

pre-down ifenslave -d bond1 eth1 eth3

5. Add lines to the bottom of your architecture’s modprobe files, reboot and pray:

sudo cat /etc/modprobe.d/arch/i386

alias bond0 bonding

options bond0 mode=1 miimon=5000 max_bonds=2

alias bond1 bonding

options bond1 mode=1 miimon=5000 max_bonds=2

Read More......