Sunday, July 29, 2007

Timidity++ Midi Player

Timidity is a Linux MIDI Player, and it could be installed easily using this command :

sudo apt-get install timidity timidity-interfaces-extra freepats

Only for the first time, right click on any midi file (from Nautilus), and select open with other application, and type "timidity"

Monday, July 23, 2007

Simple and Stable Ubuntu Feisty Fawn from scratch

I start experiencing problems several days lately, and I couldn't find the exact cause of the problem, so it's time to reinstall Ubuntu Feisty Fawn from scratch, and this time I will try minimum configuration (without eye candy) that is suitable for daily work.

First, install Ubuntu from CD as usual. After installation finished, then reboot, and do software updates (from main server repository), then reboot again.

Then install my preferred applications :

# this is the basic applications
sudo apt-get install kerry beagle gparted vlc samba cups-pdf ntfs-config ntfs-3g libmeanwhile1 gaim

# this one for supporting my iPod
sudo apt-get install banshee gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-bad gstreamer0.8-faad gstreamer0.10-ffmpeg gstreamer0.10-plugins-ugly

# some manual install is required (newer version than from the repo)
thunderbird v2.0.0.4 # download this and extract to /opt
lightning # could be installed from thunderbird add-in

# vmware - must be patched - follow the vmware server installation here

Wednesday, July 18, 2007

Optimizing Windows XP guest OS by disabling some services

Refer to : http://www.sanx.org/tipShow.asp?index=65

I disabled the bold ones (btw., some services below is not available on my guest os - may be because it's running on a VM, and some hardware is not emulated) :

* Alerter
* Application Layer Gateway Services
This serivce should only be disabled if you are not running the built-in Windows firewall on any network interface and if you are not using internet connection sharing from that computer
* Automatic Updates
Many users prefer to manually download updates from Microsoft. If you wish to use the automatic update facility, leave this service enabled.
* Background Intelligent Transfer Service
This service is utilised by many core Microsoft services and applications (and a few third-party ones) for effecting file transfers. Windows Update uses it, as does MSN Messenger. Applications should be tested following disabling this service to ensure functionality.
* ClipBook
* Computer Browser
This service should only be disabled if you are not running in a Windows NT / 2000 Domain environment
* Distributed Link Tracking Client
* Error Reporting Service
* Fast User Switching Compatibility
* Fax
* Human Interface Device Access
This service should remain enabled if you use user-defined hot-keys on keyboards, remote controls, etc.
* IIS Admin
This service should only be enabled if you run the personal version of IIS on Windows XP
* IMAPI CD-Burning COM Service
This service should only be disabled if you do not have / use a CD-Writer.
* Indexing Service
* Infrared Monitor
This service should only be disabled if you do not have an IR port on your computer, or if you do not use IR communications.
* Internet Connection Firewall (ICF) / Internet Connection Sharing (ICS)
This service should only be disabled if you do not use either ICS or the ICF.
* Messenger
Now disabled by default on installation of Windows XP Service Pack 2
* MS Software Shadow Copy Provider
* NetMeeting Remote Desktop Sharing
This service should only be disabled if you do not use the Desktop Sharing facility in NetMeeting
* Portable Media Serial Number
This service should only be disabled if you do not have a portable MP3 or music device that connects directly to your computer via a digital interface.
* QoS RSVP
* Remote Desktop Help Session Manager
This service should only be disabled if you do not use the Remote Assistance feature of Windows XP
* Remote Registry
Certain third-party applications utilise the Remote Registry service to modify the local machine's registry. Symantec (Norton) Anti-Virus is one such utility, mainly because they were too lazy to code up seperate installers for local and remote installations.
* Removable Storage
* Routing and Remote Access
* Smart Card
* Smart Card Helper
* SSDP Discovery Service
This service should only be disabled if you do not have any Universal PnP devices on your network.
* System Restore Service
This service should only be disabled if you do not use the System Restore functionality of Windows XP.
* Telnet
* Terminal Services
This service underpins the following functions:
o Remote Desktop
o Remote Assistance
o Fast User Switching
Terminal Services should only be disabled if none of the above are in use
* Themes
* Uninterruptible Power Supply
* Universal Plug and Play Device Host
* Upload Manager
* Volume Shadow Copy
* WebClient
* Windows Image Acquisition (WIA)
This service should only be disabled if you do not have a scanner or digital camera connected to your computer.
* Windows Time
This service should only be disabled if not operating in a Windows NT / Windows 2000 Domain / Windows Server 2003.
* Wireless Zero Configuration
This service should only be disabled if you're not using a WLAN (WiFi, 802.11) card on your computer
* WMI Performance Adapter
* World Wide Web Publishing
This service should only be disabled if you're not running the personal version of IIS on your computer.

Tuesday, July 17, 2007

Easy way to install NTFS support for Read/Write Windows XP Partition

To enable read/write support on NTFS volume, you could install "ntfs-3g" and "ntfs-config" :

sudo apt-get install ntfs-config # install everything including ntfs-3g

sudo ntfs-config # this command starts the NTFS configuration GUI, you could also find the icon inside the applications - system tools

Below are some example of a mounted NTFS volume (USB disk drive) :

thartono@thartono-linux:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on

/dev/sdc1 39062012 38934512 127500 100% /media/New Volume # this is the USB Disk with NTFS filesystem. The utilization is 100% because it's full (not because of an error)

thartono@thartono-linux:~$ mount

/dev/sdc1 on /media/New Volume type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)
# the filesystem is displayed as fuseblk

Thursday, July 12, 2007

Connect to the Internet via Mobile Phone with 3G via Bluetooth

Configuring Nokia 6280 as 3G bluetooth modem for Ubuntu Feisty

Required Software
Already installed in Ubuntu Feisty Fawn : bluetooth & wvdial
Additional : gnome-ppp
sudo apt-get install gnome-ppp

Pairing with Nokia
sudo vi /etc/bluetooth/hcid.conf
change on options : set security auto

Restart Bluetooth
sudo /etc/init.d/bluetooth restart

Pair with Nokia
discover Nokia MAC address :
hcitool scan
00:15:DE:DF:0C:44 Deux Trois

Discover channel number
sdptool browse 00:15:DE:DF:0C:44

Browsing 00:15:DE:DF:0C:44 ...
Service Name: Dial-up networking
Service RecHandle: 0x10000
Service Class ID List:
"Dialup Networking" (0x1103)
"Generic Networking" (0x1201)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1 #---------> it's a channel #1 !

Edit rfcomm.conf
sudo vi /etc/bluetooth/rfcomm.conf

rfcomm0 {
bind yes;
device 00:15:DE:DF:0C:44;
channel 1;
comment “Bluetooth PPP Connection”;
}

Restart & Check Bluetooth
sudo /etc/init.d/bluetooth restart

rfcomm
rfcomm0: 00:15:DE:DF:0C:44 channel 1 clean

Connect using GNOME-PPP
sudo gnome-ppp

username : wap
password : wap123
phone number : *99#

Complete configuration of wvdial.conf
sudo more /root/.wvdial.conf

[Dialer Defaults]
Modem = /dev/rfcomm0
ISDN = off
Modem Type = Analog Modem
Baud = 115200
Init = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 =
Init4 =
Init5 =
Init6 =
Init7 =
Init8 =
Init9 =
Phone = *99#
Phone1 =
Phone2 =
Phone3 =
Phone4 =
Dial Prefix =
Dial Attempts = 1
Dial Command = ATM1L3DT
Ask Password = off
Password = wap123
Username = wap
Auto Reconnect = off
Abort on Busy = off
Carrier Check = on
Check Def Route = on
Abort on No Dialtone = on
Stupid Mode = on
Idle Seconds = 0
Auto DNS = on
;Minimize = off
;Dock = off

Reinstall GRUB

Sometime you need to reinstall GRUB, simply do the following :

sudo grub
find /boot/grub/stage1 #find the grub location, i.e. hd0,5
root (hd0,5)
setup (hd0)
quit

WiFi with WPA

To connect to an WiFi Access Point with WPA :

Click on the nm-applet, select connect to other wireless network
network name: network_name
wireless security: WPA Enterprise
Key Type : TKIP
Identity: user_id
Password: password

SAMBA

Install SAMBA
sudo apt-get install samba samba-common

Connect to windows server
smb://windows_server_name

Configuration
Example of SAMBA configuration file :

/etc/samba/smb.conf:

[global]
workgroup = MSHOME
netbios name = THARTONO-LINUX
security = share
auth methods = guest # VM will be able to connect without any authentication
domain master = No
wins support = no
hosts allow = 127.0.0.1 # only virtual machine could connect to this server
hosts deny = 0.0.0.0/0 # any other machine can't connect to this server
#
[shared]
path = /home/thartono/data/shared # this is the shared folder
comment = read write
available = yes
browsable = yes
public = yes
writable = yes

Print to PDF

To be able to print to PDF file from any program, you could install cups-pdf, then add printer via system-admin-printing and select generic postcript (don't select the color postcript printer, it wont work) :

sudo apt-get install cups-pdf

If your company using CEPS (Cisco Enterprise Printer Server), you could configure it :

printer server : CEPS
and specify the queue, i.e. jakarta-hp4050 (consult to your printer administator for the correct printer name)

MP3 Player

You could install xmms to play MP3. The user interface is very similar with winamp :)

sudo apt-get install xmms

Wednesday, July 11, 2007

XPS Reader for Linux

A friend sent me a document with XPS extension. Turned out it's the new Microsoft XML format, which functions similar to PDF. The problem is that I can only use Internet Explorer to open it, since Microsoft have not provided stand alone XPS reader that runs on Linux. Well, I have it in my VMware server, so I created the following script to be able to open XPS document simply by clicking it from Linux (or right click and select "ie") :

ie :

#!/bin/bash

#fullscreen only
echo rdesktop -D -K -g 1024x768 -a 16 -S 18 -s "'"C:\\Program Files\\Internet Explorer\\iexplore.exe \"$@\""'" thartono-wxp:3389 -u thartono -p xxxxxx >~/Desktop/rdesktop.cmd.txt

cat ~/Desktop/rdesktop.cmd.txt | sed "s_/_\\\_g" | sed " s_\\\home\\\thartono\\\data\\\customers_z:\\\customers_g " | sed s_\\\home\\\thartono\\\data\\\products_z:\\\products_g " | sed "s_\\\home\\\thartono\\\data\\\shared_z:_g " |sh

rm ~/Desktop/rdesktop.cmd.txt

Ubuntu Software Update and Upgrade

If you receive a new software update notification, it's better to use command line (via terminal) to call the software update/upgrade manager. One main reason is that you will be ensured to enter the super user password, and if there's a problem, you will know it via the terminal.

Software update :
sudo update-manager

Synaptic package manager :
sudo synaptic

Monday, July 9, 2007

Configuring Beagle

Install Beagle
sudo apt-get install kerry beagle acl # acl is required to manually reset user_xattr later

Setup Inotify
inotify already supported in Feisty Fawn, however it needs to be activated in the /etc/fstab, add user_xattr in the mount option, below is my example (I want to index some folders inside my /home/thartono/data) :

thartono@thartono-linux:~$ cat /etc/fstab|grep user_xattr
UUID=6e889e0a-44d4-46ab-9134-109f4212d61a /home/thartono/data ext3 defaults,errors=remount-ro,user_xattr 0 1

Check if the user_xattr already active :

thartono@thartono-linux:~$ mount|grep user_xattr
/dev/sdb5 on /home/thartono/data type ext3 (rw,errors=remount-ro,user_xattr)

Otherwise you need to remount the /home/thartono/data

Beagle Force Indexing
I often force my Beagle to reindex (every several days if I have made a lot of changes in my folders), so I created the following script to force Beagle Index :

#!/bin/bash
echo Shutdown Beagle
beagle-shutdown
echo Removing old indexes
rm -rf /home/thartono/.beagle
beagle-config indexing AddRoot /home/thartono/data/products
beagle-config indexing AddRoot /home/thartono/data/customers
echo Reset Extended Attributes
setfacl -R -b /home/thartono/data/products
setfacl -R -b /home/thartono/data/customers
echo Indexing Beagle
export BEAGLE_EXERCISE_THE_DOG=1
beagled
beagle-status

NOTE
Don't forget to export BEAGLE_EXERCISE_THE_DOG=0 once Beagle finish indexing, otherwise your CPU utilization will all be eaten by Beagle.....

Sunday, July 8, 2007

Running Windows XP without EXPLORER.EXE

One big process running in Windows XP system is Explorer.exe. It's actually the Windows XP GUI, identical with Window Manager in Unix/Linux system. This process is CPU and Memory hog. It is possible, however, not to run this process to make Windows XP run faster :)

Install Windows XP inside Virtual Machine :)

Below is the XP task manager screen capture :




I haven't done any fine tuning on the Windows XP virtual machine. So further memory/cpu utilization reduction is still possible (i.e. not running indexing service, etc.).

Linux also has much better memory management. If you are running many Windows applications, for example below I am running 6 active windows applications : taskmgr, 2x large visio, 2x large powerpoint, 1x large word documets, I am consuming full 256MB DRAM (seen from taskmgr), but only 34MB DRAM actually used from Linux side..... So far no paging file is utilized. Every process running purely on DRAM !





The largest memory utilization on Linux is XGL, almost 200MB, because I am running Compiz Fusion with many virtual desktop.

Saturday, July 7, 2007

Productive with Compiz Fusion Expo and Scale

I set F8 to activate Expo and F9 to activate Scale

Expo
In my opinion Expo is more convenient compared to Scale, since the application's window position is never changed. For example, if we put Thunderbird in viewport 3 (top right corner) then we can always switch to Thunderbird by going to the top right corner.



Expo always divide the screen into equally sized viewport regardless of number of running applications, this could make Expo less desirable to for a small number of running application.

Scale
Scale is very similar with Mac's Expose. One benefit of Scale is that it divide the computer screen equally for every running application. If we have only 2 applications running then we will see the two application equally at the same size on the screen, this make scale better than expo.


The downside is that application position is always changed. If we have many applications, then activating Scale requires us to search where the application is on the cluttered screen.

Beagle vs GDLinux (Google Desktop Linux)

Beagle
- Slow (3-4 second) when searching something
- Must be forced reindex all documents regularly, otherwise Beagle accuracy will be decreased. I created a script to force index Beagle at least once a week to maintain Beagle accuracy
+ Can be manually forced to use all CPU for indexing, so indexing document is very fast. In my case (around 10 GB data), indexing is finished within 3 hours (estimation only)
+ Can find text inside any Microsoft Office document

GDLinux (beta)
+ Very fast when searching something
- Can not be manually forced to use all CPU for indexing. Building index only done using idle time. In my case, building index for a 10GB data took around 5 hrs idle time, and in reality the index finished in one day (around 15 hours....)
- Can not find text inside Microsoft Office documents - looks like this version of gdlinux only index the title of Microsoft Office documents

Recommendation
So far, I think the best solution is using Beagle for searching Microsoft Office documents only, and using GDlinux for searching the rest.

Compiz Fusion with Emerald

Emerald must be installed first :
sudo apt-get install emerald

Then start Compiz with :
compiz --replace -c emerald &

Below is the screen capture of Compiz+Emerald with Expo plugin :

Friday, July 6, 2007

Compiz Fusion

Install the latest Compiz Fusion from repository, create /etc/apt/sources.list.d/compizfusion.list with the following info :

deb http://download.tuxfamily.org/3v1deb feisty eyecandy
deb-src http://download.tuxfamily.org/3v1deb feisty eyecandy

Then install compiz etc. from synaptics
Exit WM, and login with XGL session
then execute compiz --replace

Seamless Command Prompt and Task Manager ( xpcmd and xptaskmgr )

I created two small script for XP Command Prompt and XP Task Manager to make them appear like Ubuntu native applications :

thartono@thartono-linux:~/data/bin$ more xpcmd
#!/bin/bash
rdesktop -D -K -g 660x480 -a 16 -S 18 -T "xpcmd" -s "cmd" thartono-wxp:3389 -u t
hartono -p xxxxxx

thartono@thartono-linux:~/data/bin$ more xptaskmgr
#!/bin/bash
rdesktop -D -K -g 480x480 -a 16 -S 18 -T "xptaskmgr" -s "taskmgr" thartono-wxp:3
389 -u thartono -p xxxxxx
thartono@thartono-linux:~/data/bin$

Thursday, July 5, 2007

Rdesktop One Application

Rdesktop with only one application does not require seamlessrdpshell running on the XP VM, nor explorer.exe (that consume a lot of memory), and this brings some benefits :
  • usually mapped to the WINDOWS key on the XP VM (can't be disabled), but now this key is completely disabled on the XP VM, so we can freely use this key for Ubuntu only
  • Windows program will be perfectly full screen, without any border
  • The minimized button on the Windows program is disabled, and click on the minimize button will minimize the Ubuntu window instead
The modified "powerpnt" script will look like this :

#fullscreen only
echo rdesktop -D -K -g 1024x768 -a 16 -S 18 -s "'"C:\\Program Files\\Microsoft O
ffice\\office11\\powerpnt.exe \"$@\""'" thartono-wxp:3389 -u thartono -p xxxxxx
>~/Desktop/rdesktop.cmd.txt
cat ~/Desktop/rdesktop.cmd.txt | sed "s_/_\\\_g" | sed " s_\\\home\\\thartono\\\
data\\\customers_z:\\\customers_g " | sed "s_\\\home\\\thartono\\\data\\\produc
ts_z:\\\products_g " | sed "s_\\\home\\\thartono\\\data\\\shared_z:_g " |sh

Wednesday, July 4, 2007

Really Transparent Windows Application with scripted SeamlessRDP

I created the following script to enable really seamless Windows XP and Linux integration. Just click to any file (as long as the file is shared with the VM) to open it with appropriate Windows program :

thartono@thartono-linux:~$ more bin/visio
#!/bin/bash
echo rdesktop -A -s "'"c:\\seamlessrdp\\seamlessrdpshell.exe C:\\Program Files\\Microsoft Office\\visio11\\visio.exe \"$@\""'" thartono-wxp:3389 -u thartono -p xxxxxx
>~/Desktop/rdesktop.cmd.txt
cat ~/Desktop/rdesktop.cmd.txt | sed "s_/_\\\_g" | sed " s_\\\home\\\thartono\\\data\\\customers_z:\\\customers_g " | sed "s_\\\home\\\thartono\\\data\\\products_z:\\
\products_g " | sed "s_\\\home\\\thartono\\\data\\\shared_z:_g " |sh
rm ~/Desktop/rdesktop.cmd.txt

Tuesday, July 3, 2007

VPNC replace Cisco VPNClient

Cisco VPNClient needs to be patched when installed in Ubuntu Feisty Fawn.

If you don't want to run patched software, you could use VPNC :

sudo apt-get install vpnc resolvconf network-manager-vpnc resolvconf

then create the configuration file inside /etc/vpnc , for example /etc/vpnc/abc.conf . Below is the example of abc.conf (ask your VPN server administrator for XXXXXX/YYYYYY below) :

IPSec gateway abc.company.com
IPSec ID XXXXXX
IPSec secret YYYYYY
Xauth username thartono
NAT Traversal Mode cisco-udp
Cisco UDP Encapsulation Port 10000

To connect to abc you just type "sudo vpnc abc"

UPDATE
Thanks for Februaris input, using VPNC we could specify which destination network should be reached using the tunnel interface. Below is the modified vpnc configuration file :

IPSec gateway abc.company.com
IPSec ID XXXXXX
IPSec secret YYYYYY
Xauth username thartono
NAT Traversal Mode cisco-udp
Cisco UDP Encapsulation Port 10000
target networks 171.70.0.0/16 171.71.0.0/16

The last line specifies that any packet destined to 171.70.x.x or 171.71.x.x should be sent via tunnel. Otherwise use different interface, as shown with "route" command below :

thartono@thartono-linux:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
dns-xx.xxxxx.co * 255.255.255.255 UH 0 0 0 tun0
dns-xxx.xxxxx.c * 255.255.255.255 UH 0 0 0 tun0
xxx-vpn-cluster jkr-vlan300-hsr 255.255.255.255 UGH 0 0 0 eth1
64.104.68.0 * 255.255.255.0 U 0 0 0 eth1
192.168.184.0 * 255.255.255.0 U 0 0 0 vmnet1
192.168.207.0 * 255.255.255.0 U 0 0 0 vmnet8
171.71.0.0 * 255.255.0.0 U 0 0 0 tun0
171.70.0.0 * 255.255.0.0 U 0 0 0 tun0
link-local * 255.255.0.0 U 1000 0 0 eth1
default xxx-vlan300-hsr 0.0.0.0 UG 0 0 0 eth1

Sunday, July 1, 2007

SOCKS Proxy

If your VPNClient software does not work well on your network/location (may be because of timeout issue), you could use create SOCKS proxy instead. Based on my experience, SOCKS Proxy is more reliable than VPNClient. I tried to disconnect the network for 3.5 minutes, and SSH tunnel still up.

SOCKS Proxy is builtin and could be initiated by this command :

ssh -D 1080 username@ssh.company.com

SOCKS Proxy could be used with any browser (Firefox) and email client (Thunderbird+Lightning). If you want to use it with Evolution, you will need tsocks. Install tsocks with this command :

sudo apt-get install tsocks

and you could tunnel Evolution with this command :

tsocks evolution

If you are using Thunderbird, you could configure the socks proxy inside Thunderbird. But if you're using LDAP with Thunderbird, you have to tunnel Thunderbird with tsocks, otherwise LDAP will be failed :

tsocks thunderbird

Replacing VPNClient+Outlook with SOCKS Proxy+Thunderbird+Lightning

Install Thunderbird
Download thunderbird version 2 and place it to Desktop

I want to install Thunderbird into my /opt directory :
cd /opt
sudo tar -zxvf ~/Desktop/thunderbird-2.0.0.4.tar.gz
cd thunderbird
./thunderbird

Offline Folders
Thunderbird support offline folders. The contents of the folders will be available at anytime even though you are not connected to the network.

Use SOCKS Proxy with Thunderbird
Preferences - Advanced - Connection - Manual Proxy - Socks Host : 127.0.0.1 port 1080



Install Lightning
Download Lightning and place it to Desktop
From Thunderbird, select Tools - Add-Ons - Installs - and select the downloaded file.



Issue with Lightning and Exchange Calendar
I can accept any calendar invitation, but I can not send a calendar invitation. I have to use OWA or my push client software (Goodlink - installed on my smartphone).

Setup Google Desktop Linux for Thunderbird
Go to your Firefox or Thunderbird extensions directory. In my case it is in the /opt/thunderbird/extensions, so :
cd /opt/thunderbird/extensions
sudo ln -s /opt/google/desktop/plugin/thunderbird/ desktop@google.com

Restart Thunderbird, and verify that google desktop already inside the add-on :