Category Archives: Linux (Ubuntu)

FreeNX, NXserver, NeatX and more NX problems

After upgrading to Lucid, I noticed I was having problems with nxserver. I couldn’t lock my screen from work anymore. I tried everything under the sun but I still kept getting the “Error: couldn’t find RGB GLX visual or fbconfig” message with glxinfo in my forwarded screen. glxinfo works fine when at the computer itself. I read that X11 forwarding has had some problems with this recently. I uninstalled nxserver and reinstalled the latest version. no luck. It made it worse and now I couldn’t even get CAPS lock to work on the remote screen. Then I found neatx. Neatx is google’s version of nxserver and which is based on nxserver. My first thoughts on neatx were that is looks the same as nxserver but a little slower. My keyboard and mouse, however, function properly but still no lock screen or screen saver. My next option: Try KDE. I installed KDE but still got the glxinfo error. Screen lock worked though! Waiting for a fix on X11 forwarding with ssh, in the mean while, I keep KDE.

How to install Kiba Dock on Karmic and Lucid

Just managed to install kiba dock on my system today. I wanted to see what the hype was all about. I followed this guide on ubuntu-forums.

make sure you have compiz running before you install kiba dock.


1. sudo apt-get remove automake1.4

2. sudo apt-get install fakeroot automake1.9 build-essential libpango1.0-dev libgtk2.0-dev libgconf2-dev libglitz-glx1-dev librsvg2-dev libglade2-dev libxcomposite-dev subversion libtool libgtop2-dev python-gtk2-dev libgnome-menu-dev libgnomeui-dev libgnomevfs2-dev intltool libxml2-dev libglitz1-dev libcairo2 libdbus-1-dev libgtop2-7 libgnomevfs2-0 libgnomeui-0 librsvg2-2 python-feedparser libasound2-dev libsdl1.2-dev libdbus-glib-1-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libgstreamer0.10-0 pidgin-dev libpurple-dev

3. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/akamaru/ akamaru

4. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/kiba-dock/ kiba-dock

5. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/kiba-plugins/ kiba-plugins

6. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/kiba-dbus-plugins/ kiba-dbus-plugins

7. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/kiba-gaim-plugin kiba-gaim-plugin

8. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/kiba-ephy-extension kiba-ephy-extension

9. cd kiba-dock

10. svn update -r 602 *

Follow this if you have 32 bit

cd akamaru/
./autogen.sh --prefix=/usr --exec-prefix=/usr
sudo make install
cd ..

cd kiba-dock/
./autogen.sh
sudo make install
cd ..

cd kiba-plugins/
./autogen.sh
sudo make install
cd ..

cd kiba-dbus-plugins/
./autogen.sh
sudo make install
cd ..

Follow this if you have 64 bit

cd akamaru/
./autogen.sh --prefix=/usr --exec-prefix=/usr --libdir=/usr/lib64
sudo make install
cd ..

cd kiba-dock/
./autogen.sh --prefix=/usr --libdir=/usr/lib64
sudo make install
cd ..

cd kiba-plugins/
CC="gcc -fPIC" ./autogen.sh --prefix=/usr --libdir=/usr/lib64
sudo make install
cd ..

cd kiba-dbus-plugins/
./autogen.sh --prefix=/usr --libdir=/usr/lib64
sudo make install
cd ..


Now add it to the startup applications

Go to System -> Preferences -> Startup Applications and add.

Name = Kiba Dock

Command = kiba-dock

Troubleshooting:

If you are getting compilation errors, then automake is probably causing problems. You need to gedit configuration.in or configuration.ac and change all the AC_SUBST("$WHATEVER") to AC_SUBST(WHATEVER)

Getting root on your new Nexus One Android Google Phone

The Nexus one was rooted before it even got released. Paul at modaco forums showed us how to perform this hack. I’ll try to simplify the method here.

1. First unlock your bootloader if you have a T-mobile Nexus One (this voids the warranty) or get an unlocked version from Google for like $550:

a. download fastboot
b. open terminal or command line and type
– Windows fastboot-windows oem unlock
– Mac ./fastboot-mac oem unlock
– Linux ./fastboot-linux oem unlock

2. Rewrite the Bootloader to obtain root privileges:

a. Download either SuperBoot or InsecureBoot and extract. (The difference is that with the insecure boot you won’t make any changes to the system and you would have to launch su manually)
b. Put the device in bootloader mode:
– Turn off the phone and restart holding the trackball.
c. Flash the bootloader:
– Windows = double click the windows bat file
– Mac = open terminal and cd to the directory containing the file. type
chmod +x install-superboot-mac.sh
./install-superboot-mac.sh

– Linux = open terminal and cd to the directory containing the file. type
chmod +x install-superboot-linux.sh
./install-superboot-linux.sh

Now you should have root!

Rooted Nexus One Google Phone
Pic courtesy of Stericson.

Automatic website backup without SSH enabled over FTP

Last time I backed up my website with rsync and ssh, but on my new host they disabled SSH. Rsync does not work over ftp. I do not want to do incremental backups with delta files like is done with rdiff-backup or duplicity. I need to have an exact mirror of my site. But remember that your sql databases won’t be backed up.

Curlftpfs is the key! In this tutorial I will show you how to backup from one server to a backup location which can be your hard drive, another web host, dropbox folder, Box.net via webdav, etc.

Download curlftpfs, rsync and ncftp:
sudo apt-get install curlftpfs ncftp rsync

make directories to mount your ftp server:
sudo mkdir /media/hydtechblog
sudo mkdir /media/hydtechbackupserver

edit fstab to mount the ftp servers using curlftpfs:
sudo gedit /etc/fstab

add the lines and modify them according to your server:
curlftpfs#username:password@hydtechblog.com /media/hydtechblog fuse rw,allow_other,uid=root 0 0
curlftpfs#username:password@hydtechbackupserver /media/hydtechbackupserver fuse rw,allow_other,uid=root 0 0

One thing to remember is that these two will not mount automatically because when the computer restarts, the fstab is done while you are not connected to the network. To fix this we can just add the mount commands in our crontab.

Edit crontab:
sudo crontab -e
enter the following lines and modify accordingly:
00 09 * * * mount /media/hydtechblog
00 09 * * * mount /media/hydtechbackup
01 09 * * * rsync -avz –rsync-path=/usr/bin/rsync /media/hydtechblog/public_html /media/hydtechbackup/public_html

ctrl + o to write and ctrl + x to save

This will tell cron to mount the folders at 9:00 am and start rsync at 9:01 am. You can replace the backup location to another folder on your hard drive or your dropbox or ubuntu one folder. You can also mount box.net with webdav and use this method.

For encrypted incremental backups checkout duplicity, it also works with webdav and ftp.

Revealing Opera wand passwords on Ubuntu Linux and OS X

There are several utilities in Windows which reveal the opera wand password and I haven’t used windows in forever. The Opera wiki has a Power button which can help capture your password while logging in to the site. Click this link in Opera and it will install a button which you can drag to any panel. While on a page which requires a password, you can click on this new wand instead of your original wand.

Voila!

Backing up my wordpress blog and website using Ubuntu

I’ve been noticing that my webhost server keeps going down for a few hours every day and it scares me that I’ll lose all my data. So, I started looking for automatic backup solutions and this is the best way I could come up with.

Backing up the wordpress database:

I’ve tried the following plugins

1. WordPressbackup.com
This plugin backs up my data to their server automatically. only backs up the database though. must register for a free account at wordpressbackup.com. The backups occur once every few days.

2. Bei-fen
This plugin backs up my data including images and files to a location on my server

3. DBC Backup
Does a cron backup automatically at any location on my server at any time interval I set it for. Only backs up the database.

4. WP-DB-Backup
Can schedule the database to automatically backup to your server or automatically email them.

5. SMEStorage Backup
Based on WP-DB-Backup. Must register for a free account at http://www.smetube.com/smestorage/ and you can backup your data to a cloud storage service like Amazon S3 or Box.net. You can even have the backups sent to your email.

Backing up my whole website from my webhost to my computer:

I use a tool call rsync in linux to automatically sync my public_html directory on my webserver to a backup folder on my Computer which is synced automatically with Dropbox. You can also use Ubuntu One. For this tutorial your web host must have ssh enabled. If you can’t get ssh, then backup your wordpress website over ftp with curlftpfs on Linux.

Follow these steps:

1. Sign up for an Ubuntu One account or a DropBox account and download/install the desktop client. You can get a 2GB account for free.

2. Download the necessary files
sudo apt-get rsync ssh

3. Set up autologin with ssh so you won’t have to enter your password each time.
sudo ssh-keygen -t dsa
press enter each time without changing anything. this will make a id_dsa.pub key in you .ssh folder.
copy the ssh key to your server using scp
scp /home/user/.ssh/id_dsa.pub user@yourserver.com:
login to your server using ssh
ssh user@yourserver.com
enter password and append the key to authorized_keys
cat id_dsa.pub >> .ssh/authorized_keys
remove the key from the home directory on your server
rm id_dsa.pub

4. Set up a cron job to sync the public_html folder to your dropbox folder
crontab -e (do not sudo)
open with editor like nano
enter something similar to the following line
* */5 * * * rsync -avz --rsync-path=/usr/bin/rsync -e ssh user@yourserver.com:home/useronserver/public_html /media/sdawhatever/locationof/dropbox/backup/
(this is telling cron to sync every 5 hours, for more help with cron check wiki)
press ctrl+O to save file, enter to save, ctrl + X to exit.

thats it, your done!

Connect your android on Ubuntu in recovery mode, fastboot mode, or unactivated

To boot into recovery mode: Press and hold Home + Power
To boot into fastboot mode: Press and hold Camera + Power

Setup UDEV to recognize your HTC Android device:

Setting up UDEV to recognize HTC Device –
Open up terminal and type:
sudo gedit /etc/udev/rules.d/51-android.rules
Add the following:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
save and close.
sudo /etc/init.d/udev restart

Installing adb & fastboot:

Download the Android SDK here.
Extract it to the root or home directory.
Download fastboot and place it in the /AndroidSDK/tools directory.
Right click fastboot -> Properties -> Permissions -> Allow executing file as program.

Adding tools directory to bash:

sudo gedit /home/user/.bashrc
Add the location of you tools directory:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools

close and save.

I got most of this information from this post.

How to make the Broadcom 4312 Wireless driver work in BackTrack 4 on the Lenovo S10

This guide is adapted from Kazalku’s guide on remote exploit forums. Thanks Kazalku.

Download this driver and transfer it with a USB or boot up into another OS on your multiboot and save it in the BT root folder from here.

Untar it:

tar -xvzf hybrid-portsrc-x86_32-v5_10_91_9-3.tar.gz

makefile:
make -C /lib/modules/`uname -r`/build M=`pwd`

Insert the modules:
modprobe ieee80211_crypt_tkip
insmod wl.ko

Now you should have the network Claimed. you can check by:
lshw -C network

Bring it up:
ifconfig eth1 up

To load the module upon boot:

cp wl.ko /lib/modules/`uname -r`/kernel/net/wireless
depmod -a
modprobe wl

Load the module at every startup:
kate /etc/modules

add the following and close the text editor:
ieee80211_crypt_tkip
wl

Load NetworkManager and Configure KnetworkManager:
Type NetworkManager in a konsole and configure the wireless at the bottom right.

Delete the files you created in the root folder now that you dont need them.

How to connect to Ad Hoc networks using Tmobile G1 Android

Intro

The G1 does not connect to ad hoc networks through the wifi manager but we can hack it to allow scanning and connecting to ad hocs. I’ve been trying to figure this out for the longest time. Before you begin, you need to root your G1 and be comfortable using the command line. We will be editing tiwlan.ini and wpa_supplicant.conf. I will be showing you 2 ways to edit the files. Using vi and adb.


Settings

edit tiwlan.ini to read:

WiFiAdHoc = 1
dot11DesiredSSID = HydtechAdhoc (or whatever name u want)
dot11DesiredBSSType = 0

edit wpa_supplicant.conf to read:

ctrl_interface=tiwlan0
update_config=1
eapol_version=1
ap_scan=2 (tells wpa_supplicant to scan hidden networks)

network={
ssid=”HydtechAdhoc”
scan_ssid=1 (for APs with multiple SSIDS)
mode=1
key_mgmt=NONE
group=WEP104
auth_alg=SHARED
wep_key0=”MyWepKey” (replace MyWepKey with your key)
}

How to edit using vi:

Download terminal from the market and type:

su (for superuser mode)
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system (mount partition as writable)
vi /system/etc/wifi/tiwlan.ini (open tiwlan.ini in vi text editor)

now type A to enter editing mode, finish editing your file and hold trackball+1 to stop editing. To save and exit type :wq

vi /data/misc/wifi/wpa_supplicant.conf (open file for editing)

edit with the settings given above and exit and don’t forget to change the partition back to read only
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system

reboot

How to edit files with adb on Ubuntu:

Connect your g1 to the computer using a usb cable and make sure USB debugging in enabled
Open up terminal and type
cd /home/hydtech/[android sdk folder]/tools (navigate to the directory which has you adb tool)

get the files from the device and place them in the root folder
sudo ./adb pull /system/etc/wifi/tiwlan.ini /
sudo ./adb pull /data/misc/wifi/wpa_supplicant.conf /

edit and save the files with the settings provided above using gedit or kate or what have you

make the partition read writable
adb shell
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
exit

place the files back onto the device
sudo ./adb push /tiwlan.ini /system/etc/wifi/tiwlan.ini
sudo ./adb push /wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf

make partition read only again
adb shell
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
exit

reboot device.

Troubleshooting

shows connected but no internet
1. I was having a problem where the connection would keep disconnecting and when it would connect, it wouldn’t load pages. To fix this I had to disable my WEP key.

SSID not showing
2. If the SSID isn’t showing up in the list, make sure you have ap_scan=2 in your wpa_supplicant

Unsuccessful connection
3. Try enabling static IP if DHCP isn’t working for you. It’s under advanced menu.

Sponsored by Chromehost.net

Loud beeps from speaker in Lenovo S10

The lenovo S series netbooks can get pretty annoying with the speaker beeping all the time. To disable the speaker beep while plugging and removing the charger, you can change the setting in the BIOS. If there is no option, you must upgrade the BIOS.

Other annoying beep sound when I shut down my Ubuntu. To get rid of this I blacklisted my pc speaker:

gedit /etc/modprobe.d/blacklist

add line
blacklist pcspkr

Save and reboot.