8/26/07

Momo scores the 7000th league goal for Reds

Momo Sissoko scores his first goal for liverpool after playing 75 games. It's also the 7000th league goal for the club since Malcolm McVean got the first goal a century ago.
Yesterday [actually it's few hours ago] at the stadium of light, Liverpool got 2-0 won over Sunderland from Sissoko in 37th minute then confirmed by Andriy Voronin at almost the end of game. Very very good start for this season.

8/20/07

More secure your ssh server with public/private keys

To add more secure on ssh server it's good idea to make our server allow only user who has a key to login. Today I found this trick from ubuntuforums.

Gen the keys: First, on client box, we generate keys pair and copy the public key file to server box.

[poj@client ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/poj/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/poj/.ssh/id_dsa.
Your public key has been saved in /home/poj/.ssh/id_dsa.pub.
The key fingerprint is:
38:58:74:7b:4c:5a:11:d7:70:de:c0:41:c2:93:c4:b9 poj@client
[poj@client ~]$ ls .ssh
id_dsa id_dsa.pub known_hosts
[poj@client ~]$ scp .ssh/id_dsa.pub poj@192.168.1.122:./id_dsa.pub
poj@192.168.1.122's password:
id_dsa.pub 100% 598 0.6KB/s 00:00
[poj@client ~]$
During key gen., we will be asked for place to save the key. Just enter for default, then for passpharse, we enter a strong password. This will generate keys pair file [id_dsa and id_dsa.pub] in $HOME/.ssh .

Install the key: In your $HOME, on server box, cat our publickey file to $HOME/.ssh/authorized_keys
[poj@client ~]$ ssh -l poj 192.168.1.122
poj@192.168.1.122's password:
Last login: Mon Aug 20 16:49:38 2007 from 192.168.1.73
[poj@server ~]$ cat id_dsa.pub >> .ssh/authorized_keys
[poj@server ~]$


Config the server: Next on server box go to edit /etc/ssh/sshd_config by change or add this two lines then restart ssh service.
PasswordAuthentication no
UsePAM no


Now, try to ssh again
[poj@client ~]$ ssh -l poj 192.168.1.122
Enter passphrase for key '/home/poj/.ssh/id_dsa':
Last login: Mon Aug 20 17:54:11 2007 from 192.168.1.69
[poj@server ~]$
Notice that this time it ask for passphrase not password
for other client box, ssh request will be denied.
[poj@client2 ~]$ ssh -l poj 192.168.1.122
Permission denied (publickey,gssapi-with-mic).
[poj@client2 ~]$

8/13/07

Customize icons on ubuntu desktop

One thing I want to do for a long time is remove mounted partition icons that default show on my ubuntu desktop. Nothing wrong with those icons, it's just too many icons and some I never go to browse into it. Now what to do. Open gconf-editor by hit [Alt+F2] and type gconf-editor. Go to apps->nautilus->desktop then check out "volume_visible".

You can also customize others as you want like adding computer and trash icon to your desktop.

8/12/07

Add truetype fonts on X client side

The pdf file [as I understand] encapsulate text, images and fonts so it should give me same result on any os. Many of pdf files I have are generated on windows and use windows fonts. When I open these files with evince [default document viewer] some can't render fonts correctly because windows fonts aren't embedded and not exist on ubuntu too.
What I need to do is make application has correct fonts to use. There are two places that we can add fonts, the first is on server[Xserver] side and the second is on client side. Here I choose second choice by copy fonts required by the document from windows to $HOME/.fonts then caching new fonts by run command 'fc-cache -fv .fonts'. Below is result after adding fonts.

pnix@pnix-a7n:~$ ls .fonts
ANGSAB.TTF ANGSA.TTF ANGSAUI.TTF ANGSAUZ.TTF timesbd.ttf timesi.ttf
ANGSAI.TTF ANGSAUB.TTF ANGSAU.TTF ANGSAZ.TTF timesbi.ttf times.ttf
pnix@pnix-a7n:~$ fc-cache -fv .fonts
/home/pnix/.fonts: caching, 12 fonts, 0 dirs
/var/cache/fontconfig: not cleaning unwritable cache directory
/home/pnix/.fontconfig: cleaning cache directory
fc-cache: succeeded
pnix@pnix-a7n:~$

8/8/07

package utility command in linux

Have you ever want to know Where is the files go when you install any package? or What package this file belong to? This post is about some package utility command that I've use many time but never remember.

To list all files in the package.

dpkg -L package-name

rpm -ql package-name


To find out which package[ we installed ] contains this file.
dpkg -S file

rpm -qf file


To list installed package.
dpkg -l

rpm -qa


To find out which package[ we not installed ] contains this file.
apt-file search file

yum whatprovides file

Many situations in linux that you're complained about missing some library file to do something. Use this command to find the required package.

8/6/07

No window border, window title in compiz-fusion

Update I just found that this problem is about xorg.conf. After add code below it gone

Section "Extensions"
Option "Composite" "Enable"
EndSection


-------------------
Sometime when enable compiz-fusion with
compiz --replace

Window border will disappear and it's not comeback after restart X or even restart system[in my case]. To bring window border back, Alt-F2 then type
metacity --replace

Don't know why but it's work beleive me. After run this command your desktop will have no 3D effect, now you can try enable compiz again.

8/4/07

Bygfoot the Football Manager game on linux

Long long time ago when I'm university student, one popular game on computer I've played is Championship Manager. At that time it's no 3D graphic only color bar to show stat of attack, defend percentage and comentary text. Today during surf the net I found bygfoot that remind me of the old football manager game.
To install
On ubuntu, I search repos and found that it's there. so nothing to do just type 'sudo aptitude install bygfoot'.

pnix@pnix-a7n:~$ apt-cache search bygfoot
bygfoot - soccer (football) manager game featuring the most important European leagues
pnix@pnix-a7n:~$ sudo aptitude install bygfoot
Password:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following NEW packages will be installed:
bygfoot
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1519kB of archives. After unpacking 5923kB will be used.
Writing extended state information... Done
Get:1 http://th.archive.ubuntu.com feisty/universe bygfoot 2.0.1-1ubuntu2 [1519kB]
Fetched 1519kB in 1m30s (16.7kB/s)
Selecting previously deselected package bygfoot.
(Reading database ... 112069 files and directories currently installed.)
Unpacking bygfoot (from .../bygfoot_2.0.1-1ubuntu2_i386.deb) ...
Setting up bygfoot (2.0.1-1ubuntu2) ...

localepurge: Disk space freed in /usr/share/locale: 560K
pnix@pnix-a7n:~$

First match
In the game, you can selling and buying players, improving the stadium, sharing revenue to improve youth, setting rate for scout and physio.

Due to copyright, trademark or something current version don't use real player names, to get it need to run update script. It will ask for your definitions dir, give '$HOME/.bygfoot/definitions'.
pnix@pnix-a7n:~$ bygfoot-update

bygfoot-update: A bash script keeping your Bygfoot Football Manager up-to-date.
Version 2.0.1.
See the file UPDATE for some more information.
Call bygfoot-update -h|--help for usage information.


** b-u: checking for sed... ok
** b-u: checking for tar... ok
** b-u: checking for bzip2... ok
** b-u: checking for wget... ok
** b-u: checking for patch... ok
** b-u: checking for cvs... failed

** WARNING: Didn't find working cvs, maybe it's not in your PATH.
** WARNING: You might not be able to use all bygfoot-update features.

** b-u: checking for zenity... 2.18.1 found.
** b-u: User input: 2

** b-u: User input: /home/pnix/.bygfoot/definitions


** b-u: Country dir set to
** b-u: /home/pnix/.bygfoot/definitions

** b-u: Fetching official team names and
** b-u: team definitions files.
+ Adding official names to italy...
+ Adding official names to germany...
+ Adding official names to england...
+ Adding official names to wales...
+ Adding official names to ireland...
.
.


After update ,as liverpool manager, I've got real name players like Gerrard, Carragher . But data is not up to date I still have Baros, Morientes, Hamann, Biscan and others. Not all team are updated, For england, data update available only teams in this list.
pnix@pnix-a7n:teams$ ls team_england_*.xml
team_england_barnsley.xml team_england_leicester.xml
team_england_blackpool.xml team_england_liverpool.xml
team_england_bournemouth.xml team_england_luton.xml
team_england_bradford.xml team_england_millwall.xml
team_england_brentford.xml team_england_norwich.xml
team_england_brighton.xml team_england_plymouth.xml
team_england_bristolc.xml team_england_preston.xml
team_england_burnley.xml team_england_qpr.xml
team_england_cardiff.xml team_england_reading.xml
team_england_coventry.xml team_england_sheffieldu.xml
team_england_crewe.xml team_england_sheffieldw.xml
team_england_crystal.xml team_england_southampton.xml
team_england_derby.xml team_england_stoke.xml
team_england_hull.xml team_england_watford.xml
team_england_ipswich.xml team_england_wolves.xml
team_england_leeds.xml
pnix@pnix-a7n:teams$

Anyway you can edit or add any data for your favorite team by yourself[ all files will locate at $HOME/.bygfoot/definitions/teams]. Game running is very fast , You don't need to wait for a long time to play next match. I think this is another choice if you don't want to play FM on ubuntu with wine.