2008年4月15日 星期二

Configure kernel on Ubuntu

1. install necessary complier and libraries.

# libncurses5-dev is developer's libraries and doc for ncurses
sudo apt-get install build-essential libncurses5-dev

2. download source linux-x.y.z.tar.bz2 from http://www.kernel.org
3. extract it then enter the directory and type

# console-based color menu
make menuconfig
# X-based GUI
make xconfig

Run GUI programs with cron on Linux

you have to tell cron what display the program should use. For that you use:

export DISPLAY=:0


so you'll add the export variable like this:

* * * * * export DISPLAY=:0 && somecommand

2008年3月27日 星期四

Enable Compiz Fusion on Ubuntu with VIA Unichrome Pro IGP

1. download VIA UniChrome (Pro) Family Display Driver from http://www.viaarena.com/default.aspx?PageID=420&OSID=45&CatID=3220&SubCatID=150

2. extract it then run to install

sudo sh VIA_Ubuntu710_Unichrome_GFX_v40072d.run

3. Select the option 1. Install driver to install the pre-compiled driver binary package.

Verifying archive integrity… All good.
Uncompressing VIA UniChrome (Pro) Family Linux Graphics Driver for Ubuntu 7.10 v40072d………
Please choose the job you want to do:
1. Install driver
2. Uninstall driver

4. Reboot to restart the X server

5. To verify whether the 3D functionality is enabled, use the commands glxinfo and
glxgears to check in X-Window. If the 3D function is enabled, you should see

direct rendering: Yes

6. In order to customize the desktop effects you want to use, you have to install compiz manager

sudo apt-get install compizconfig-settings-manager

7. In addition, you have to modify /usr/bin/compiz and add via to driver whitelist

# Driver whitelist
WHITELIST="via nvidia intel ati radeon i810"

8. To make Compiz Fusion enable, go to System -> Preferences -> Appearance -> Visual Effects tab, make sure that Custom is selected.

9. To configure Compiz Fusion, go to System > Preferences > Advanced Desktop Effects Settings

10. Here's a list of the most common Compiz Fusion keyboard shortcuts:

SUPER+SHIFT+DRAG LEFT MOUSE = draw fire
SUPER+SHIFT+C = clear fire
CTRL+ALT+DRAG LEFT MOUSE = rotate cube
CTRL+ALT+LEFT ARROW = rotate cube
CTRL+ALT+DOWN ARROW = flat desktop
SHIFT+ALT+UP = initiate window picker
CTRL+ALT+DOWN = unfold cube
ALT+TAB = window switch
SUPER+TAB = flip switcher or ring switcher
ALT+F7 = initiate 'move windows'
SHIFT+F9 = water effect
SHIFT+F10 = slow animations
CTRL+ALT+D = show desktop
SUPER+E = expo

For Grouping and Tabbing:
SUPER+S = select single window
SUPER+T = tab group
SUPER+Left = change left tab
SUPER+Right = change right tab
SUPER+G = group windows
SUPER+U = ungroup windows
SUPER+R = remove group window
SUPER+C = close group
SUPER+X = ignore group
Hold the SUPER button then select the windows you want to group and then hit SUPER+G.

SUPER key is the Windows key on most keyboards.

2008年3月12日 星期三

Install flash add-on for firefox on Ubuntu

1. install adobe flash player

sudo apt-get install flashplugin-nonfree

2. if firefox cannot show flash pages, check is there any file related to flash plugin under /usr/lib/firefox/plugins. if not, do

sudo ln -s /usr/lib/flashplugin-nonfree/libflashplayer.so /usr/lib/firefox/plugins

2008年2月19日 星期二

Install centrally-managed VPN system, hamachi on Ubuntu

1. load IP tunneling module

sudo modprobe tun

also, you can add tun to the list of modules which are loaded while booting

sudo vi /etc/modules

2. make sure if a valid tunnel has been created

ls /dev/net/tun

if you get a "No Such File or Directory" error, you need to create a new node

sudo mkdir /dev/net
sudo mknod /dev/net/tun c 10 200

4. download hamachi from https://secure.logmein.com/ then extract it

tar -zxvf hamachi-0.9.9.9-20-lnx.tar.gz

5. install hamachi and tuncfg must always be ran to get the interface up and working while hamachi is running

sudo make install
sudo tuncfg

6. set socket permissions

sudo chmod 766 /var/run/tuncfg.sock

7. by running hamachi-init, it will make a configuration directory under your home directory by default.

hamachi-init

8. the hamachi binary is compressed with upx. try unpacking it if nothing happens when you start hamachi

sudo apt-get install upx-ucl-beta
sudo upx -d hamachi

8. For easier use, download and install the GUI for hamachi linux from http://hamachi-gui.sourceforge.net/

2008年2月1日 星期五

Install KTorrent with WebGUI on Ubuntu

1. ktorrent needs php executable path to show web interface so you have to install php command-line interpreter as well

sudo apt-get install php5-cli ktorrent

2. go to Settings / Plugins to load Web Interface plugin first

3. switch to WebInterface Options. if php executable path field shows "Php executable isn't in default path, please enter the path manually" or the light color is red, just set the path to /usr/bin/php then it'll turn green.

2008年1月17日 星期四

Enable Analog TV Card with Remote Control to Watch TV on Ubuntu

linux kernel has saa7134 module built-in. All you need is to load it.

1. create a module setting file for booting use

sudo vi /etc/modprobe.d/saa7134

# This setting is for LifeView FlyTV Prime 3X / FlyVIDEO3000
# you can find correct values from http://gentoo-wiki.com/HARDWARE_saa7134
options saa7134 card=2 tuner=50

2. in order to load saa7134 while booting, add the name of module into /etc/modules

sudo vi /etc/modules

saa7134

3. reboot to enable the above settings

# some useful commands for module
modprobe <name> # load module manually
lsmod # list all modules have been loaded
rmmod <name> # remove module manually

4. install tv software

sudo apt-get install tvtime

5. start tvtime from Application -> Sound & Video -> tvtime

6. control TV with arrow keys
↑ +channel
↓ -ch
→ +volume
← -vol

7. check if IR Receiver has been found

dmesg | grep IR

--
input: saa7134 IR (LifeView FlyVIDEO30 as /devices/pci0000:00/0000:00:1e.0/0000:01:00.0/input/input4

8. figure out what number of event is registered

cat /proc/bus/input/devices

--
I: Bus=0001 Vendor=5168 Product=0138 Version=0001
N: Name="saa7134 IR (LifeView FlyVIDEO30"
P: Phys=pci-0000:01:00.0/ir0
S: Sysfs=/devices/pci0000:00/0000:00:1e.0/0000:01:00.0/input/input4
U: Uniq=
H: Handlers=kbd event4
B: EV=100003
B: KEY=c0304 390000 0 0 0 0 0 0 c0000002 1e0000 0 0 10000ffc

9. install and configure lirc

sudo apt-get install lirc

--
choose Linux input layer (/dev/input/eventX) as remote
choose None as IR transmitter which is able to both send and receive
choose /dev/input/eventX as custom event interface

9. make sure lirc is running

sudo ps -ef | grep lirc

if not, start it

sudo /etc/init.d/lirc start

10. use irw command to check if the device does work

irw

--
# press any button on your remote control
0000000000010175 00 MODE linux-input-layer
0000000000010189 00 VIDEO linux-input-layer
0000000000010188 00 AUDIO linux-input-layer
.
.

11. then begin to record your own definition, follow the instructions on screen

sudo irrecord -H devinput -d /dev/input/event4 /etc/lirc/lircd.conf

--
# Please make this file available to others
# by sending it to
#
# this config file was automatically generated
# using lirc-0.8.3(devinput) on Mon Nov 10 00:57:50 2008
#
# contributed by Luke
#
# brand: LifeView
# model no. of remote control: FlyVIDEO30
# devices being controlled by this remote: FlyTV Prime 3X Series
#

begin remote

name FlyVIDEO30
bits 16
eps 30
aeps 100

one 0 0
zero 0 0
pre_data_bits 16
pre_data 0x8001
gap 207867
toggle_bit_mask 0x80010006

begin codes
Air/CATV 0x0175
Video 0x0189
Audio 0x0188
Power 0x0074
AV_Source 0x0182
FullScreen 0x0174
Stereo 0x0170
Mute 0x0071
1 0x0002
2 0x0003
3 0x0004
4 0x0005
5 0x0006
6 0x0007
7 0x0008
8 0x0009
9 0x000A
0 0x000B
Recall 0x0081
Enter 0x001C
VOL+ 0x0073
VOL- 0x0072
CH+ 0x0192
CH- 0x0193
end codes

end remote



reload the new lircd.conf

sudo /etc/init.d/lirc reload

12. make .lircrc for tvtime-command execution

vi .lircrc

--
# This is an example config file for your LIRC remote. All buttons
# depend on what you have configured in your lircd.conf file. Please
# refer to this and adjust the labels below accordingly.
#
# tvtime is controlled through a separate program called tvtime-command.
# For a list of commands, see 'man tvtime-command'. Key events can
# be 'faked' using the command KEY_EVENT, which allows for mapping a
# single remote control button to both a menu mode command and a normal
# mode command.
#
# begin
# prog = irexec
# button = DISPLAY
# config = tvtime-command DISPLAY_INFO
# end


# This section includes two configs, what this does is that it allows
# you to open tvtime and close tvtime with one button. If your remote
# has seperate buttons for this, then you can break it apart.
begin
prog = irexec
button = POWER
config = tvtime &
config = tvtime-command QUIT
end


# The following defines most of the common buttons found on a remote and
# what commads they would map to inside tvtime.
begin
prog = irexec
button = Air/CATV
config = tvtime-command DISPLAY_INFO
repeat = 1
end
begin
prog = irexec
button = Video
config = tvtime-command SHOW_MENU
end
begin
prog = irexec
button = AV_Source
config = tvtime-command TOGGLE_INPUT
end
begin
prog = irexec
button = FullScreen
config = tvtime-command TOGGLE_FULLSCREEN
end

begin
prog = irexec
button = Audio
config = tvtime-command TOGGLE_AUDIO_MODE
end
begin
prog = irexec
button = Stereo
config = tvtime-command SET_AUDIO_MODE stereo
config = tvtime-command SET_AUDIO_MODE mono
end
begin
prog = irexec
button = Mute
config = tvtime-command TOGGLE_MUTE
end

# Menu navigation.
begin
prog = irexec
button = CH+
config = tvtime-command UP
repeat = 1
end
begin
prog = irexec
button = CH-
config = tvtime-command DOWN
repeat = 1
end
begin
prog = irexec
button = VOL+
config = tvtime-command RIGHT
repeat = 2
end
begin
prog = irexec
button = VOL-
config = tvtime-command LEFT
repeat = 2
end

begin
prog = irexec
button = Recall
config = tvtime-command CHANNEL_JUMP
repeat = 1
end

begin
prog = irexec
button = 1
config = tvtime-command CHANNEL_1
end
begin
prog = irexec
button = 2
config = tvtime-command CHANNEL_2
end
begin
prog = irexec
button = 3
config = tvtime-command CHANNEL_3
end
begin
prog = irexec
button = 4
config = tvtime-command CHANNEL_4
end
begin
prog = irexec
button = 5
config = tvtime-command CHANNEL_5
end
begin
prog = irexec
button = 6
config = tvtime-command CHANNEL_6
end
begin
prog = irexec
button = 7
config = tvtime-command CHANNEL_7
end
begin
prog = irexec
button = 8
config = tvtime-command CHANNEL_8
end
begin
prog = irexec
button = 9
config = tvtime-command CHANNEL_9
end
begin
prog = irexec
button = 0
config = tvtime-command CHANNEL_0
end
begin
prog = irexec
button = Enter
config = tvtime-command ENTER
end

commands support by tvtime-command, see http://tvtime.sourceforge.net/usage.html#tvtimecommand

13. irexec should be started before running tvtime, tvtime is signalled from lirc using this helper application. if we need it start after gnome login, go to

System -> Preference -> Sessions
Startup Programs -> Add
Name: irexec
Command: /usr/bin/irexec -d
Comment:

Save