vsftpd restrict access

If you run vsftp as your ftp server, may be you want to config
in /etc/vsftpd/vsftpd.conf

To disable anonymous ftp logins, change anonymous_enable to NO [Default: YES]


To jail some user in their home dir uncomment two following line [Default: NO]
and put a list of user [to be jailed] in /etc/vsftpd/chroot_list.
Note that if chroot_local_user set to YES, meaning of list will be a list that not to be jailed.

To jail all user in their home dir, add chroot_local_user=YES [Default: NO]


True transparent Tilda Terminal on Ubuntu Feisty

On Feisty Fawn, Compiz [a compositing window manager that uses 3D graphics acceleration via OpenGL] will be installed by default. This provides effects and features on desktop environment like Desktop Effect. This post is about how to install tilda terminal and make it real transparent on ubuntu Feisty.

You must be already installed nvidia driver and enabled the "Desktop Effect" function.
First download tilda source package and install other packages to satisfy the build dependencies of tilda source

pnix@pnix-a7n:~/build$ apt-get source tilda
Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 133kB of source archives.
Get:1 http://th.archive.ubuntu.com feisty/universe tilda 0.09.4-0ubuntu2 (dsc) [662B]
Get:2 http://th.archive.ubuntu.com feisty/universe tilda 0.09.4-0ubuntu2 (tar) [126kB]
Get:3 http://th.archive.ubuntu.com feisty/universe tilda 0.09.4-0ubuntu2 (diff) [6782B]
Fetched 133kB in 1s (95.7kB/s)
gpg: Signature made Wed 24 Jan 2007 08:08:51 AM ICT using DSA key ID C88ABDA3
gpg: Can't check signature: public key not found
dpkg-source: extracting tilda in tilda-0.09.4
dpkg-source: unpacking tilda_0.09.4.orig.tar.gz
dpkg-source: applying ./tilda_0.09.4-0ubuntu2.diff.gz
pnix@pnix-a7n:~/build$ sudo apt-get build-dep tilda
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
build-essential cdbs debhelper docbook-xsl g++ g++-4.1 gettext html2text intltool-debian libatk1.0-dev libc6-dev
libcairo2-dev libconfuse-dev libconfuse0 libexpat1-dev libfontconfig1-dev libfreetype6-dev libglib2.0-dev
Setting up build-essential (11.3) ...
Now you should have directory name tilda-0.09.4 in your current directory.
Next create dir name patches under tilda-0.09.4/debian, download a tilda transparency patch for 0.09.4 from here and move it to patches dir, change it's extension to .patch.
pnix@pnix-a7n:~/build$ mv tiltilda-0.09.4-real-transparency.patch_.txt tilda-0.09.4/debian/patches/tilda-0.09.4-real-transparency.patch

Under tilda-0.09.4 dir build deb package by type 'dpkg-buildpackage -rfakeroot'. maybe you have this error[like me].
/usr/bin/dpkg-buildpackage: 212: fakeroot: not found

it's mean you need fakeroot package too. Install it.
pnix@pnix-a7n:~/build/tilda-0.09.4$ sudo aptitude install fakeroot
Reading package lists... Done
The following NEW packages will be installed:
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 99.4kB of archives. After unpacking 397kB will be used.
Writing extended state information... Done
Get:1 http://th.archive.ubuntu.com feisty/main fakeroot 1.5.10ubuntu2 [99.4kB]
Fetched 99.4kB in 8s (11.7kB/s)
Selecting previously deselected package fakeroot.
(Reading database ... 107534 files and directories currently installed.)
Unpacking fakeroot (from .../fakeroot_1.5.10ubuntu2_i386.deb) ...
Setting up fakeroot (1.5.10ubuntu2) ...


Now we're ready to build. Do it again.
pnix@pnix-a7n:~/build/tilda-0.09.4$ dpkg-buildpackage -rfakeroot
dpkg-buildpackage: source package is tilda
dpkg-buildpackage: source version is 0.09.4-0ubuntu2
dpkg-buildpackage: source changed by Áron Sisak
dpkg-buildpackage: host architecture i386
dpkg-buildpackage: source version without epoch 0.09.4-0ubuntu2
fakeroot debian/rules clean
test -x debian/rules
test "`id -u`" = 0

It's a good idea to change version before 'dpkg-buildpackage' to prevent autoupdate try to update with a version in repos. To do that add .1 to end of current version# in debian/changelog file.
After fiished tilda_0.09.4-0ubuntu2_i386.deb should be built. So install it by type 'sudo dpkg -i yourdebpkg.deb'.
pnix@pnix-a7n:~/build/tilda-0.09.4$ cd ..
pnix@pnix-a7n:~/build$ ls
tilda-0.09.4 tilda_0.09.4-0ubuntu2_i386.changes
tilda_0.09.4-0ubuntu2.diff.gz tilda_0.09.4-0ubuntu2_i386.deb
tilda_0.09.4-0ubuntu2.dsc tilda_0.09.4.orig.tar.gz
pnix@pnix-a7n:~/build$ sudo dpkg -i tilda_0.09.4-0ubuntu2_i386.deb
Selecting previously deselected package tilda.
(Reading database ... 107569 files and directories currently installed.)
Unpacking tilda (from tilda_0.09.4-0ubuntu2_i386.deb) ...
Setting up tilda (0.09.4-0ubuntu2) ...


ref: http://forum.beryl-project.org/viewtopic.php?f=51&p=31430


Desktop effects on Feisty, Cube and JAVA Swing problems

Even the "desktop effects" is just technology preview on Feisty. It still has some bugs but I like it. To enable go to System > Preferences > Destop Effects, then click "Enable Desktop Effects" button.
It has two effects for now[as I known], "Windows wobble when move" and "Workspaces on a Cube".
After enable it, windows wobble is work fine but not the cube effect. Notice that number of workspace will change to 1. If set it back to 2, when I change workspace[e.g. Ctrl+Alt+->] sometime it loose both panels[top and bottom] or sometime it give me blank screen[no panel,no icon]

To make cube effect work open terminal and

pnix@pnix-a7n:~$ gconftool-2 --type int --set /apps/compiz/general/screen0/options/hsize 4
pnix@pnix-a7n:~$ gconftool-2 --type int --set /apps/compiz/general/screen0/options/number_of_desktops 1
or use gui tool by type "gconf-editor" in terminal
And navigate to: apps > compiz > general > screen0 > options
and change value of “hsize” to 4 and “number_of_desktops” to 1.

Another thing is enabling "Desktop Effects" will causes java swing component show as blank window. In my box it happen when start I netbeans. I read somewhere that this is java bug. Hope that sun will fix this in next jdk version.

To fix this, you need to set the variable AWT_TOOLKIT to "MToolKit". Add the code below in your $HOME/.bashrc [For me I put it in /etc/profile coz i need to run netbeans from menu]
export AWT_TOOLKIT=MToolkit

update: If you have stability problem with AWT_TOOLKIT=MToolkit[like me], may be you need to make a choice.


Mount ISO, CUE/BIN, NRG, IMG, MDF files in ubuntu

I known that to mount iso file

pnix@pnix-a7n:~$ sudo mount -o loop file.iso mountpoint
pnix@pnix-a7n:~$ sudo mount -o loop -t iso9660 file.iso mountpoint

and for cue/bin file ,I convert it to iso first use bchunk
pnix@pnix-a7n:~$ bchunk file.bin file.cue file.iso

but how about the others. After some search, I collect tips to handle many types of image file in linux.
For nrg[ nero image ], img [ clone cd] and mdf [ alcohol 120% ] files, We need nrg2iso, ccd2iso and mdf2iso to convert those image files to iso image. Luckily, All are in Feisty repos.
pnix@pnix-a7n:~$ sudo aptitude install nrg2iso ccd2iso mdf2iso
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:
ccd2iso mdf2iso nrg2iso
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 19.1kB of archives. After unpacking 193kB will be used.
Writing extended state information... Done
Get:1 http://th.archive.ubuntu.com feisty/universe ccd2iso 0.3-1 [7004B]
Get:2 http://th.archive.ubuntu.com feisty/universe mdf2iso 0.3.0-0ubuntu2 [7066B]
Get:3 http://th.archive.ubuntu.com feisty/universe nrg2iso 0.4-1.1 [4996B]
Fetched 19.1kB in 1s (17.8kB/s)
Selecting previously deselected package ccd2iso.
(Reading database ... 107513 files and directories currently installed.)
Unpacking ccd2iso (from .../ccd2iso_0.3-1_i386.deb) ...
Selecting previously deselected package mdf2iso.
Unpacking mdf2iso (from .../mdf2iso_0.3.0-0ubuntu2_i386.deb) ...
Selecting previously deselected package nrg2iso.
Unpacking nrg2iso (from .../nrg2iso_0.4-1.1_i386.deb) ...
Setting up ccd2iso (0.3-1) ...
Setting up mdf2iso (0.3.0-0ubuntu2) ...
Setting up nrg2iso (0.4-1.1) ...

then to covert to iso use command
pnix@pnix-a7n:~$ mdf2iso file.mdf file.iso
pnix@pnix-a7n:~$ ccd2iso file.img file.iso
pnix@pnix-a7n:~$ nrg2iso file.nrg file.iso

for nrg file, we can mount it directly by
pnix@pnix-a7n:~$ sudo mount -o loop,offset=307200 file.nrg mountpoint

Other choices
cdemu[a kernel module for mounting Cue/Bin files directly] with nautilus script.more
AcetoneISO gui app to mount all image file.


Your site is valued at: $136

Do you want to know the value of your website? I found this page calculate for you. My 2 months old blog, lj4newbies, was $136. wow..

How about others?

www.osnews.com $4,734,127
freshmeat.net $21,656,733
slashdot.org $63,259,220
digg.com $479,965,116
www.microsoft.com $1,105,511,784
Google.com $3,138,729,453
yahoo.com $3,224,760,776


RealPlayer on Feisty

Today I try to open ptvthai.com[ the website that live broadcast rally against "council for national security" from sanamluang bangkok, uhh no politic here, Pls don't censor me ha ha ]. It needs realplayer plugin for firefox but "Plugin Finder Service" can't install it automatically.
RealPlayer isn't on feisty repos yet for now and i can't wait. So to install i download RealPlayer10GOLD.bin, add execute permission and install it in $HOME/app/RealPlayer[ without sudo privileges ].

pnix@pnix-a7n:~/progdl$ wget  http://forms.real.com/real/player/download.html?f=unix/RealPlayer10GOLD.bin
--23:26:37-- http://forms.real.com/real/player/download.html?f=unix/RealPlayer10GOLD.bin
=> `download.html?f=unix%2FRealPlayer10GOLD.bin'
Connecting to software-dl.real.com||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5,802,563 (5.5M) [application/octet-stream]

100%[=================================================================================>] 5,802,563 89.78K/s ETA 00:00

23:27:55 (73.43 KB/s) - `RealPlayer10GOLD.bin' saved [5802563/5802563]

pnix@pnix-a7n:~/progdl$ chmod +x RealPlayer10GOLD.bin
pnix@pnix-a7n:~/progdl$ ./RealPlayer10GOLD.bin
Extracting files for RealPlayer installation........................

Welcome to the RealPlayer ( Setup for UNIX
Setup will help you get RealPlayer running on your computer.
Press [Enter] to continue...

Enter the complete path to the directory where you want
RealPlayer to be installed. You must specify the full
pathname of the directory and have write privileges to
the chosen directory.
Directory: [/home/pnix/progdl/RealPlayer]: /home/pnix/app/RealPlayer
Cleaning up installation files...

Then I try again, still not work, when open the site I've got "Could not find an appropriate hxplay/realplay in the system path to use as an embedded player". Firefox has plugins loaded[ check by about:plugins ] and links in $HOME/.mozilla/plugins look ok.
pnix@pnix-a7n:~/progdl$ ls -l ~/.mozilla/plugins/
total 6892
-rw-r--r-- 1 pnix pnix 856 2006-12-15 13:51 flashplayer.xpt
-rwxr-xr-x 1 pnix pnix 7040080 2006-12-15 13:51 libflashplayer.so
lrwxrwxrwx 1 pnix pnix 44 2007-06-13 23:34 nphelix.so -> /home/pnix/app/RealPlayer/mozilla/nphelix.so
lrwxrwxrwx 1 pnix pnix 45 2007-06-13 23:34 nphelix.xpt -> /home/pnix/app/RealPlayer/mozilla/nphelix.xpt

I'm not sure why may be because I don't install it with sudo privileges. Anyway it complains about path to realplay. Just try add link realplay in $HOME/bin[ that we have path to ] then it works.
pnix@pnix-a7n:~$ cd bin
pnix@pnix-a7n:~/bin$ ln -s ~/app/RealPlayer/realplay realplay


backslash, regex and replaceAll function in java

The Java String class has several methods that allow you to perform an operation using a regular expression on that string. One is replaceAll(String regex, String replacement) that take strings as arguments. Java string use the literal string "\\" for single backslash and in regular expression, the "\\" matches a single backslash too. This make [the regular expression as java string] single backslash becomes "\\\\". e.g. If you have a string "c:\test\test2\" and want to change to "c:/test/test2/", your code should look like

class Bsl{ 
public static void main(String args[]){
String s="c:\\test\\test2";
String foreslash="/";
String regex="\\\\";

[poj@mail cronprog]$ java Bsl
[poj@mail cronprog]$

another example: the string "$" must be "\$" for java and again "\\$" for regex. So to change "$" to "/" .
class DS{
public static void main(String args[]){
String foreslash="/";
String ds="150$";

[poj@mail cronprog]$ java DS
[poj@mail cronprog]$

note that the regex "$" will not work.


Diable ipv6 on linux???

I found this on ubuntuforums. It's about disabling ipv6 on ubuntu but should apply to every distros. Here is how to..

Make your /etc/modprobe.d/aliases look like this.

alias net-pf-8 atm
alias net-pf-9 x25
# 1, 2, 3 new lines
alias net-pf-10 ipv6 off <<-- add
alias net-pf-10 off <<-- add
alias ipv6 off <<-- add
#alias net-pf-10 ipv6 >>===comment the original line out
alias net-pf-11 rose
alias net-pf-12 decnet

Anyway the method above doesn't work for me. After changing,reboot ifconfig output still had an ipv6 address and "ip a | grep inet6" output told me samething. To diable[on my machine] I change "alias net-pf-10 ipv6" to "alias net-pf-10 off ipv6"[like snowx1000 does] and ipv6 address will not show anymore.
The more importance is why disable ipv6
The idea is they want to make a connection to destination faster. Someone say apps will first attempt a connection on IPv6. When this fails, they'll then switch to IPv4. It's this first attempt that causes the delay. Remmeber that it can't increase bandwidth after the connection is made. It's may reduce the time it takes to connect. But manyone said they feel they can download faster[that's impossible for me :P]. So, it's up to you. If you have a hard time to make connection to any website and disabling ipv6 make it better, you should diable it.


Make sure Nvidia drivers is used by agp

After install nvidia drivers I notice that agp driver status says I use agpgart not nvidia drivers.

pnix@pnix-a7n:~$ cat /proc/driver/nvidia/agp/status
Status: Enabled
AGP Rate: 8x
Fast Writes: Disabled
SBA: Enabled

even nvidia module is already loaded.
pnix@pnix-a7n:~$ lsmod|grep agpgart
agpgart 35400 2 nvidia,nvidia_agp

Some old tutorials will advice you try to disable agpgart[for 2.4 kernel] but not for 2.6.

From nvidia readme appendix F

"On Linux 2.6, the agpgart.ko frontend module will always be loaded, as it is used by the NVIDIA kernel module to determine if an AGPGART backend module is loaded. When the NVIDIA AGP driver is to be used on a Linux 2.6 system, it is recommended that you make sure the AGPGART backend drivers are built as modules and that they are not loaded."
this confirm by
pnix@pnix-a7n:~$ modinfo nvidia
filename: /lib/modules/2.6.20-16-generic/volatile/nvidia.ko
license: NVIDIA
alias: char-major-195-*
alias: pci:v000010DEd*sv*sd*bc03sc02i00*
alias: pci:v000010DEd*sv*sd*bc03sc00i00*
depends: agpgart,i2c-core
vermagic: 2.6.20-16-generic SMP mod_unload 586
parm: NVreg_VideoMemoryTypeOverride:int
parm: NVreg_RMEdgeIntrCheck:int
parm: nv_disable_pat:int

So anyways agpgart will be loaded because it's needed by nvidia drivers.
As I understand, There are two drivers nvidia_agp[the kernel module for NForce motherboards] and nvidia[proprietary drivers from nvidia]. If both are loaded together, nvidia_agp will be choosed and used as agp driver. To make sure nvidia drivers will be loaded, open /etc/modprobe.d/blacklist with your text editor, add "blacklist nvidia_agp"[for my case] to the end of file then reboot.
blacklist nvidia_agp

Check agp driver status again. Now it says NVIDIA
pnix@pnix-a7n:~$ cat /proc/driver/nvidia/agp/status
Status: Enabled
Driver: NVIDIA
AGP Rate: 8x
Fast Writes: Disabled
SBA: Enabled
pnix@pnix-a7n:~$ lsmod|grep agpgart
agpgart 35400 1 nvidia

Note: module to block is depend on output of lsmod|grep agpgart. It can be amd64_agp,sis_agp or something else.


Converting dat to mpeg file, to burn vcd on ubuntu

Creating vcd [from dat file] on WinXP, I use "Nero Burning Rom". It can burn dat file to vcd directly.
On ubuntu, AFAIK, No burning cd software to burn dat to vcd. I use k3b but it can't burn dat file. It support only mpeg-1 and mpeg-2 format. Dat file need to convert to mpeg first.

Thist post will show how I install and use vcdgear to convert dat file to mpeg file.

pnix@pnix-a7n:~/progdl$ wget http://www.vcdgear.com/files/vcdgear176-040415_linux.tar.gz
--04:21:14-- http://www.vcdgear.com/files/vcdgear176-040415_linux.tar.gz
=> `vcdgear176-040415_linux.tar.gz'
Resolving www.vcdgear.com...
Connecting to www.vcdgear.com||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 442,937 (433K) [application/x-tar]

100%[====================================>] 442,937 105.23K/s ETA 00:00

04:21:20 (87.02 KB/s) - `vcdgear176-040415_linux.tar.gz' saved [442937/442937]

pnix@pnix-a7n:~/progdl$ tar xzf vcdgear176-040415_linux.tar.gz -C ~/app
pnix@pnix-a7n:~/progdl$ cd ~/app/vcdgear
pnix@pnix-a7n:~/app/vcdgear$ ./vcdgear -dat2mpg /media/hda7/Evil_Alines/d1/avseq03.dat /media/hda7/Evil_Alines/d1/d1.mpg

VCDGear 1.76 final build 040415 coded by Dracore (vcdgear@hotmail.com)
Testing and quality control by MACKerMD

Using configuration: vcdgear.cfg

Language: English
Version: 3.50 - Jan. 1, 2003
Translation by: Dracore

processing method :: (dat2mpg)
.dat src(In) -> /media/hda7/Evil_Alines/d1/avseq03.dat
.mpg dest(Out) -> /media/hda7/Evil_Alines/d1/d1.mpg

Setting read size to: 2352
Setting write size to: 2324

# 99% [00:00:01] -> writing...
# OK!

Fecora Core 7 release

"Fedora 7 has been released. The release features GNOME 2.18, KDE 3.5.6, fast user switching, hotplugging of display devices, a new theme, kvm, the exprimental Nouveau driver, and much more." from osnews
other infomation this version will be..
-The first Fedora distribution with full Live CD/DVD capability.
-Start with resizing and reading of NTFS file systems.