2008年12月17日 星期三

Play restricted formats on Ubuntu

1. the package, ubuntu-restricted-extras supports for mp3 playback and decoding, various other audio formats, microsoft fonts, java runtime environment, flash plugin, lame, and dvd playback.

sudo apt-get install ubuntu-restricted-extras

2. about real media files like .rm .rmvb, you'll need w32 codecs because there is no native support in linux

adding the repositories

sudo wget http://www.medibuntu.org/sources.list.d/hardy.list --output-document=/etc/apt/sources.list.d/medibuntu.list

3. add the gpg key

sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

4. install codecs

sudo apt-get install w32codecs

5. to play encrypted dvd, the libdvdcss2 package is essential. it is a simple library designed for accessing dvd without having to bother about the decryption

sudo apt-get install libdvdcss2

2008年12月13日 星期六

VirtualBox Open Source Edition on Ubuntu

1. install open source edition of virtualbox and its module

sudo apt-get install virtualbox-ose virtualbox-ose-modules-generic

2. from console output or /var/log/apt/term.log, you can see there is no matching virtualbox-ose module for kernel 2.6.24-22. virtualbox-ose-modules-generic is linked to kernel 2.6.24-21 so apt-get installs linux-image-2.6.24-21-generic automatically.

in short, we have to change default boot number of grub to kernel 2.6.24-21

sudo vi /boot/grub/menu.lst
--
default n

3. scim conflicts with virtualbox-ose. it results keyboard is locked in both host and guest os when you press key or mouse which is captuered in guest os. below is the solution

sudo apt-get install scim-bridge-client-qt
im-switch -z en_US -s scim-bridge

4. reboot then done

5. before sharing folders between host and guest, you must install Guest Additions. once installed it, go to Devices -> Shared Folders.. to set your sharing folders. if guest os is windows, run

net use x: \\vboxsvr\FolderName

2008年11月18日 星期二

Add image resizing and rotating to Gnome on Ubuntu

1. the package name is nautilus-image-converter, nautilus extension to mass resize or rotate images

sudo apt-get install nautilus-image-converter

2. logout and login again, or reboot, you will find right-click pop menu on image has the features we need

2008年11月17日 星期一

Set up a Tor relay node on Ubuntu

1. verify that your clock is set correctly

2. install tor

sudo apt-get install tor

3. make sure to define at least Nickname and the listening port, ORPort

sudo vi /etc/tor/torrc

--
.
.
SocksPort 9050 # what port to open for local application connections
SocksListenAddress 127.0.0.1 # accept connections only from localhost
.
Nickname ididnteditheconfig
.
RelayBandwidthRate 20 KBytes # Throttle traffic to 100KB/s (800Kbps)
RelayBandwidthBurst 40 KBytes # But allow bursts up to 200KB/s (1600Kbps)
.
ORPort 9001
.
.

5. restart tor to reload config

sudo /etc/init.d/tor restart

4. add this line to privoxy configuration file /etc/privoxy/config

forward-socks4a / localhost:9050 .

it means tor listens socks4a on port 9050
In the SOCKS 4A protocol, the DNS resolution of the target hostname happens on the SOCKS server, while in SOCKS 4 it happens locally.

5. according the default setting in /etc/privoxy/config

listen-address 127.0.0.1:8118

port 8118 should be used as http proxy

6. when your browser is set with privoxy proxy, you can check this website to verify

https://torcheck.xenobite.eu/


7. when you check log file, /var/log/tor/log
you may notice the warning message

MMM ddd hh:mm:ss.xxx [warn] Your application (using socks4 to port 80) is giving Tor only an IP address. Applications that do DNS resolves themselves may leak information. Consider using Socks4A (e.g. via privoxy or socat) instead. For more information, please see http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#SOCKSAndDNS.

2008年11月11日 星期二

Set up CACTI on Ubuntu

1. install cacti, it depends on many packages like snmpd, apache2, mysql-server

sudo apt-get install cacti

2. installation in progress
password of your database's administrative user: password of mysql administrator
mysql application password for cacti: leave it blank, cacti will create a random password
webserver type: apache2

3. visit the webpage of your cacti server, http://localhost/cacti
follow cacti installation guide in your web-browse

4. login with default username and password, admin / admin

5. Devices -> Add
Description: Give this host a meaningful description.
Hostname: localhost
Host Template: Generic SNMP-enabled Host
SNMP Version: Version 1
SNMP Community: public
create

6. Associated Graph Templates -> Add Graph Template
add any you need

7. Associated Data Queries -> Add Data Query
add SNMP - Get Mounted Partitions and SNMP - Interface Statistics
save

8. Create Graphs for this Host
select any items you need
create

9. Graph Trees -> Add
Name: A useful name for this graph tree.
create

10 Tree Item -> Add
Tree Item Type: host
Tree Item Value -> Host: choose what you just created
create

2008年11月2日 星期日

Surface and Bad Blocks check of Hard Disk on Unix

1. unmount the device you want to check

umount /dev/sda1

2. search the device for bad blocks

# -s: show the progress of the scan
# -v: verbose mode

badblocks -sv /dev/sda1

--
create a filesystem that excludes the badblocks which have been checked

mke2fs -c /dev/sda1

2008年11月1日 星期六

Could not update ICEauthority file /home/user/.ICEauthority

this error makes me fail to login gnome

1. boot into recovery mode
press ESC while loading grub

2. chown user:user /home/user/.ICEauthority

3. chmod 644 /home/user/.ICEauthority

4. shutdown -r now
restart