Skip to main content

Posts

Showing posts from 2007

gusty firefox + google toolbar = hang

I love google toolbar and it's my number one online bookmark for a long time. After upgrade to gusty I feel that my firefox is not stable as it use to be. My firefox is freeze on some site that try to open second window. I'm not sure what's wrong firefox or toolbar but I know that after uninstall toolbar the problem gone. [to uninstall go to "Settings" > "Help" > "Uninstall" option on toolbar] Now I need something to replace google toobar jobs. Not too hard to find this. "Firefox Google Bookmark" for bookmarks. After install this extensions your firefox will has new menu "GBookmarks". below is screenshot Another thing i need is gmail notifyer, there are many firefox extension and linux apps can do this job. For me i choose checkgmail. pnix@pnix-a7n:~$ sudo aptitude install checkgmail Reading package lists... Done Building dependency tree ... Building tag database... Done pnix@pnix-a7n:~$ note: for now look...

using cron to execute sqlscript in oracle

Using cron to run sql script is a good idea to apply with a periodic database job. When running any scripts, cron doesn't know any environment variable. So, in the script, we always -use full path with execute command. -define all environment variable. ex. to see data in customer table in oracle database and log in customer_rpt.log, I create sql script[testsc1.sql] like this [oracle@oracle1 ~]$ cat testsc1.sql spool /home/oracle/customer_rpt.log select * from customer; quit; [oracle@oracle1 ~]$ next create shell script file to run sql script file. [oracle@oracle1 ~]$ cat mydbshell.cron #!/bin/bash ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1; export ORACLE_HOME; ORACLE_SID= my_sid ; export ORACLE_SID; /u01/app/oracle/product/10.1.0/db_1/bin/sqlplus user/password @/home/oracle/testsc1.sql [oracle@oracle1 ~]$ note that oracle_home, oracle_sid variable must be defined and sqlplus command called with full path. Now, we define new cron job by 'crontab -e' in console and make...

sopcast on gutsy

To celebrate liverpool winning today[not yet but I'm so sure :D],this post will show you how to watch tv on gutsy. First goto sopcast download page and get these two rpm files, qsopcast-0.3.5-2mgc.i686.rpm and sp-sc-1.0.2-1mgc.i686.rpm. Then to convert rpm packages to deb we need alien pnix@pnix-a7n:sopcast$ sudo aptitude install alien [sudo] password for pnix: 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 automatically installed: libbeecrypt6 libneon25 librpm4 rpm The following NEW packages will be installed: alien libbeecrypt6 libneon25 librpm4 rpm 0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded. Need to get 1911kB of archives. After unpacking 6488kB will be used. Do you want to continue? [Y/n/?] y ... Building tag database... Done pnix@pnix-a7n:sop...

color your nano

nano editor is no syntax highlight for any language by default. It is only black and white as in the picture below. To enable syntax highlight, you can uncomment the line [# include "/usr/share/nano/ruby.nanorc"]in /etc/nanorc[for global effect]. Or if you just want this effect to your user only. create ~/.nanorc and include default[sample] language specific config file from /usr/share/nano. Here is my java syntax highlight .nanorc file include "/usr/share/nano/java.nanorc"

export db in hibernate3 ant

I try the example in "Hibernate Quickly" ebook and found that using SchemaExportTask to export database in build.xml file is not work in hibernate3. In hibernate3, export database done by use annotations like this <target name="schema-export" > <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="schema.classpath" /> <hibernatetool destdir="${sql.dir}"> <annotationconfiguration configurationfile="${src.java.dir}/hibernate.cfg.xml" /> <hbm2ddldir}/hibernate.cfg.xml" drop="true" create="true" export="true" outputfilename="helloworld-ddl.sql" delimiter=";" format="true"/> </hibernatetool> </target> thanks, Jon Rose for ho...

Install win32 codecs for mplayer in Ubuntu Gutsy

If you have trouble in playing media file, stream [like me] may be this will help. Today I try open video stream with mplayer and get no sound. So I go to run mplayer from terminal and get errors about codecs below pnix@pnix-a7n:progdl$ mplayer mms://61.47.35.66/NTTV MPlayer 2:1.0~rc1-0ubuntu13 (C) 2000-2006 MPlayer Team CPU: AMD Athlon(tm) (Family: 6, Model: 8, Stepping: 1) CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0 ... Opening video decoder: [dmo] DMO video codecs Win32 LoadLibrary failed to load: wmv9dmod.dll, /usr/lib/win32/wmv9dmod.dll, /usr/local/lib/win32/wmv9dmod.dll IMediaObject ERROR: 0x8773d96 could not open DMO DLL (0x0 : 0) Failed to create DMO filter ERROR: Could not open required DirectShow codec wmv9dmod.dll. You need to upgrade/install the binary codecs package. Go to http://www.mplayerhq.hu/dload.html VDecoder init failed :( Opening video decoder: [dmo] DMO video codecs Win32 LoadLibrary failed to load: wmvdmod.dll, /usr/lib/win32/wmvdmod.dll, /usr/...

pnix report on gutsy

I start upgrading to Gutsy on last Friday night with slow speed. Estimate time to finish package download is vary from 3 hours to 2 days depend on speed it get at that time so I just go to bed and come back again on Saturday 11AM. Downloading is finished it waiting for my response to config some package to install. After that it reboot and try to startx first time and fail!! It ask me to config my display.Monitor are detected correctly[dell 1905FP] but resolution only give me 800x600. I go to Graphic Card tab, the driver said vesa. At this point if I go to choose nvidia or nv x will fell to failsafe xserver and reconfig my xorg.conf to use vesa driver. Checking on Xorg.0.log I saw my old friend. "The NVIDIA kernel module does not appear to be receiving interrupts". Nvidia driver is installed but on Gutsy my "acpi=off irqpoll" kernel option doesn't seem to work anymore. I stumble many kernel option for three days and last night I found that for my gutsy it need t...

I change my mind...

Look like everyone try to upgrade now, maybe I should be patient and wait for one or two days. Update-manager has a hard time to connect to server. I have 1M adsl but download upgrade tool give me 7KB/S.

Prepare the box before get Gutsy

Gutsy is already released now. It should be better to have original updated Feisty before upgrading. I mean no software from 3rd party repos. What I have are wine, fm2007[under wine] and compiz-fusion. First uninstall FM2007 leave me some menu entry that i need to manually delete it. I will post about this later. Afterthat i remove wine then compiz-fusion. Compiz-fusion set has a few packages installed and I can't remember the names what i do is .. pnix@pnix-a7n:~$ echo "sudo aptitude remove "`sudo dpkg -l |egrep compiz| awk '{print $2}'`|sudo bash 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 packages will be REMOVED: compiz compiz-core compiz-fusion-plugins-extra compiz-fusion-plugins-main compiz-fusion-plugins-unofficial compiz-fusion-plugins-unsupported compiz-gnome compiz-plugins com...

VM crash on Feisty

During use netbeans5.5 to create webapps. I insert table and suddenly netbeans crash. It generate error log[hs_err_pidxxxx.log] in my home dir and here is it said. # # An unexpected error has been detected by Java Runtime Environment: # # SIGSEGV (0xb) at pc=0xb51b8d5a, pid=5417, tid=3025587088 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [libmawt.so+0x81d5a] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Few months ago, I add "AWT_TOOLKIT=MToolkit" to fix blank window problem in swing application when enable "Desktop Effect" and now look like java hotspot has problem with MToolkit too:( "AWT_TOOLKIT=XToolkit" fix the problem but i will get blank window under compiz-fusion. So for now my solution is no eye-candy when use java apps.

Gutsy Gibbon

It's about a week from today that Gutsy[ubuntu 7.10] will come out. I read through new feature in beta version and feel enthusiastic to see the change. - new gnome2.2, it's new feature here . - compiz fusion will be in official repos. that good, on feisty i use third party repos. and sometime got error when updating for last few weeks. - ntfs writing enable. i rarely need to write file on ntfs partition, anyway it may be useful. - automatic printer installation, this will be great for other[I have no printer at my house] I really hope that my hardware[athlonXP1700+,512DDR,fx6200 and A7N8X-E] can run gutsy with 3D effect smoothly.:)

Avidemux on ubuntu feisty

Video editing on ubuntu will be not too hard, thanks for Nathan's comment in last post that remind me about avidemux. On feisty you can find avidemux from multiverse repos. pnix@pnix-a7n:~$ sudo aptitude install avidemux 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 automatically installed: lame libfaad2-0 libmjpegtools0c2a libmozjs0d libnspr4-0d libquicktime0 mjpegtools toolame The following NEW packages will be installed: avidemux lame libfaad2-0 libmjpegtools0c2a libmozjs0d libnspr4-0d libquicktime0 mjpegtools toolame 0 packages upgraded, 9 newly installed, 0 to remove and 0 not upgraded. Need to get 5403kB of archives. After unpacking 13.8MB will be used. Do you want to continue? [Y/n/?] y ... Setting up toolame (02l-3) ... localepurge: Disk space freed in /usr/share/loca...

Encoding avi to mpg with mencoder

I just finish downloading japanese series from bittorrent, Nodame Cantabile . 12 avi files are now on my disk. I need to covert it to mpg before burn to vcd. After searching, look like mencoder is a good choice do this job. let try. pnix@pnix-a7n:~$ sudo aptitude install mencoder 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: mencoder 0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 3557kB of archives. After unpacking 8946kB will be used. Writing extended state information... Done Get:1 http://security.ubuntu.com feisty-security/multiverse mencoder 2:1.0~rc1-0ubuntu9.1 [3557kB] Fetched 3557kB in 4m54s (12.1kB/s) Selecting previously deselected package mencoder. (Reading database ... 1...

Enable Nvidia AGP Fast Writes and Side Band Addressing on ubuntu Feisty

Today I found tutorial about turn on AGP Fast Writes and Side Band Addressing on nvidia graphic card that not enable by default [ my SBA is already enable, don't know why? ] . Even I'm not sure what it for? I guess it's something that increase 3D performance. Anyway I still want to enable it if my card can support. Since last time I play with my graphic card , my status is pnix@pnix-a7n:~$ cat /proc/driver/nvidia/agp/status Status: Enabled Driver: NVIDIA AGP Rate: 8x Fast Writes: Disabled SBA: Enabled First check that your card and motherboard are support by pnix@pnix-a7n:~$ cat /proc/driver/nvidia/agp/card Fast Writes: Supported SBA: Supported AGP Rates: 8x 4x Registers: 0xff000e1b:0x1f004302 pnix@pnix-a7n:~$ cat /proc/driver/nvidia/agp/host-bridge Host Bridge: PCI device 10de:01e0 Fast Writes: Supported SBA: Supported AGP Rates: 8x 4x Registers: 0x1f00421b:0x00000302 pni...

Resurrect my old ide disk

I've got the problem with my old ide harddrive fews day ago. At last i found that it's ide cable is bad and that destroy the partition table. Anyway today after recover and backup the files, I create new partition table with fdisk and here is the new table. Disk /dev/hda: 60.0 GB, 60022480896 bytes 16 heads, 63 sectors/track, 116301 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System /dev/hda1 1 58130 29297488+ 7 HPFS/NTFS /dev/hda2 58131 116301 29318184 83 Linux 50/50 ntfs and ext3 should be fair :). After repartition, Ubuntu know only hda1 as 10GB partition[my old config]. what i forget? May be need to fotmat it first. I'm not sure how to format ntfs partition in ubuntu so i reboot to winxp, format it then turn back to ubuntu again. Now I format hda2 like this. pnix@pnix-a7n:~$ sudo mke2fs -j /dev/hda2 mke2fs 1.40-WIP (14-Nov-2006) Filesystem label= OS type: ...

ssl+apache2 feisty

This will be part2 of my setting up apache2 on feisty[ part1 here ]. As I remember to enable ssl on apache first we need to run 'apache2-ssl-certificate' to create certificate file. But apache2-ssl-certificate is not come with apache2 package in feisty so the procedure need little change. First, create 'ssl' dir in '/etc/apache2' and create cert. file with 'make-ssl-cert'. pnix@pnix-a7n:~$ sudo mkdir /etc/apache2/ssl Password: pnix@pnix-a7n:~$ sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache2.pem pnix@pnix-a7n:~$ Enable ssl module. pnix@pnix-a7n:~$ sudo a2enmod ssl Module ssl installed; run /etc/init.d/apache2 force-reload to enable. pnix@pnix-a7n:~$ Add "Listen 443" to /etc/apache2/ports.conf. pnix@pnix-a7n:~$ echo "Listen 443" | sudo tee -a /etc/apache2/ports.conf Listen 443 pnix@pnix-a7n:~$ Create ssl site pnix@pnix-a7n:~$ sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl pnix@pn...

Better way to manage services in Ubuntu with rcconf

I want to prevent apache2 from autostart but update-rc.d is not let me do that. Look like update-rc.d is only for install and remove scripts[ not for update ]. pnix@pnix-a7n:~$ ls /etc/rc2.d README S20hotkey-setup S89cron S05vbesave S20makedev S90binfmt-support S10powernowd.early S20nvidia-kernel S91apache2 S10sysklogd S20privoxy S98usplash S10xserver-xorg-input-wacom S20rsync S99acpi-support S11klogd S20tor S99rc.local S12dbus S50acpid S99rmnologin S13gdm S89anacron S99stop-readahead S20apport S89atd pnix@pnix-a7n:~$ sudo update-rc.d apache2 stop 91 0 1 2 6 . System startup links for /etc/init.d/apache2 already exist. pnix@pnix-a7n:~$ rcconf, the debian runlevel configuration tool, is more suit for this job. Let's install and run it from teminal. pnix@pnix-a7n:~$ sudo aptitude in...

Apache2 web server on Feisty

Apache2 installation on feisty is just one line 'sudo aptitude install apache2'. pnix@pnix-a7n:~$ sudo aptitude install apache2 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 automatically installed: apache2-mpm-worker apache2-utils apache2.2-common libapr1 libaprutil1 The following NEW packages will be installed: apache2 apache2-mpm-worker apache2-utils apache2.2-common libapr1 libaprutil1 0 packages upgraded, 6 newly installed, 0 to remove and 0 not upgraded. . . Setting up apache2-mpm-worker (2.2.3-3.2ubuntu0.1) ... * Starting web server (apache2)... apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [ OK ] Setting up apache2 (2.2.3-3.2ubuntu0.1) ... pnix@pnix-a7n:~$ ...

Ubuntu kill your hard drive???

I've got a problem with my desktop box again and look like it's happen periodically [every 5 months I think]. In the box, I have two hard drives. The new one, sata, is installed as dual boot disk, feisty and xp and another is 5 years old ide. I use it to store some unimportance files. Yesterday I start up ubuntu and can't mount the old one. It made some noise at boot time but this is nothing weird, It's sound terrible like this every day. The difference is this time it can't mount. Until now I still not sure my old ide is bad. Almost parts in the box are almost 5 years old, it can die at anytime. Maybe it's power supply, I don't know, it run at least 5 hours a day everyday for almost five years. Anyway my main SATA still healthy. I found this thread on ubuntuforums, he said ubuntu kill his laptop drive. This is because upon power off, the kernel sends the FLUSH CACHE message to the disk to flush the disk write cache, which cause it to spin up. Then it sudde...

Bad version number in .class file

I need a new free java server because myjavaserver.com, free host that i use for along time has a problem. My friend tell me to check out eatj.com, another free java host. I think it's great for doing a test. I just register for a free account and upload my testing web app to it. Testing my first apps give me "Bad version number" as you see below. javax.servlet.ServletException: Bad version number in .class file org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) I guess these caused by eatj.com tomcat is running with j2se 1.5 but I compile my servlet with j2se 1.6. Anyway, the problem is easily solve by recompile with option -target 1.5 .

3D Windows, Cube Atlantis and more effects for Compiz Fusion on Ubuntu Feisty

When I looked at others screenshot posted on the web I noticed that some have window float off the cube when rotating. I love it and looking for what effect to do like that. Someone on ubuntuforums said "just enable 3D windows effect" but my "compizconfig setting manager" didn't has that effect to enable :(. or others said "it's for beryl only" that hard to believe. I try to search for plugin package and found that I miss two of four plugins packages, unofficial and unsupported[on tuxfamily.org]. Pick the leftover packages. pnix@pnix-a7n:~$ sudo aptitude install compiz-fusion-plugins-unofficial compiz-fusion-plugins-unsupported 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: compiz-fusion-plugins-unofficial compiz-fusion-plugins-unsupported 0 pa...

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.

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 ke...

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.

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/cac...

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.

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.

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 ...

My choice for music player on ubuntu.

Today I'm looking for mp3 player for my ubuntu. Feisty come with rhythmbox but after few months using I think it's time to try something better. Rhythmbox does not let me edit idv3 tags and [for me]it's hard to manage library so it's not acceptable. All I wants are a) idv3 tags must editable. This is important for me because some of my mp3 collection don't have info in tags or some have a wrong info. b) full support thai language. c) gtk+ application will be good. I found this blog [http://onlyubuntu.blogspot.com/2007/03/media-players-available-for-ubuntu.html] list some media players in ubuntu. I choose some to try[all are easy to install in Feisty just 'sudo aptitude install <packagename>'] Beep Media Player is like xmms. If I'm not wrong I think the project is stop now. Amarok come with great interface, full of features but it's KDE app so it's need some other kde package to install and run. Exaile, like KDE's Amarok but it's G...

convert mp3 id3 tags to unicode.

The problem about playlist on media player are unreadable when it use thai character. This is caused by different encoding used in id3 tags and in media player. Id3 tags use cp874[don't know why] but in current linux distribution, player use unicode. This will not be a problem if tags are english characters that cp874 and unicode has the same value e.g. 'A' is '0x41' for cp874 and '0x0041' for unicode, but not for thai character. To correct thai character in playlist. There is a script to convert 1-byte charsets to unicode[ download ] by Kopats Andrei. Now what to do: 1. download the script. You'll get 'tag2utf.py'. 2. install requirement software sudo apt-get install python-eyed3 3. in the script, looking for charsets = {'cp1251':'c','koi8-r':'k' } and replace with your language encoding[ for thai change it to charsets = {'tis-620':'t' } ] Now we ready to convert mp3 tags. run script by 'tag2u...

uhh.. I got hacked

Yesterday, In the morning my boss tell me to looking at the router. It blinks like it'll going to blow up. Something in our network use almost 60% of my bandwidth. I look around and see that network light on the acient small box on the floor blinks too. It's a secondhand computer from japan and I almost forget it. On that box,I install dapper server,postfix,courier,mysql and use it as a mail server with no firewall. poor me. :( This is first time I got hacked(as I know hah ha). I've no idea what to do first. I go to check /var/log/auth.log and found many ssh attack. 'who' give me two users online, me and test1[the hacker]. 'top' show that user test1 run tons of ssh-scan process. I can't remember that did I create that test1 user myself or the hacker do a dictionary attack, found my password then create test1 user. What I do at that time is restart computer, delete test1 user then create a firewall . Then I go to ubuntuforums and found this thread . It lo...

Manage services on ubuntu

To add/remove service in ubuntu. Manually you can put init script in /etc/init.d then create symbolic link from /etc/rc?.d/S[NN]name or K[NN]name to /etc/init.d/scriptname.[S for start and K for stop] In ubuntu has a tool to manage init scripts call update-rc.d. For example if you want to start serviceA in runlevel 2 3 4 5 with sequence number 18 and stop in runlevel 0 1 6 with sequence number 99 use the command.[the scriptA must already create in /etc/init.d] pnix@pnix-a7n:~$ sudo update-rc.d serviceA start 18 2 3 4 5 . stop 99 0 1 6 In redhat base linux, i use chkconfig do the same thing. For more detail try 'man chkconfig'.

Clean up your ubuntu box

After running the system for a long time. Today I found few things I should do to clean the box. First clean the old package files in cache, When you do "sudo aptitude update|upgraed|install", the packages will be downloaded to your local disk[ locate at /var/cache/apt/archives/ ] then installed. If you try ls that directory you will see how many packages you've download. To prevent these cache from growing we should remove some outdated package by pnix@pnix-a7n:~$ sudo apt-get autoclean Password: Reading package lists... Done Building dependency tree Reading state information... Done Del compizconfig-settings-manager 0.1.0+git20070717~3v1ubuntu0 [461kB] Del libcompizconfig-backend-gconf 0.1+git20070709~3v1ubuntu0 [29.5kB] . . Del libdecoration0 1:0.5.1+git20070706~3v1ubuntu1 [2401B] pnix@pnix-a7n:~$ next install localepurge. [ These package will remove all locale in your system except what you choose to keep ] pnix@pnix-a7n:~$ sudo aptitude install localepurge it wi...

Directive tag in more details

From last post about tag in jsp. This post is about directive tag in more details. Directive tag can devide into three types e.g. page, include and taglib <%@ directive attribute="value" %> page directive : page directive will provide the information about the page for jsp engine to compile that page. Below are some importance attributes of page directive : language tells the engine about language that the page is using. usage: <%@ page language="java" %> extends tell jsp engine that this page will extend from specify class. usage: <%@ page extends="test.myclass" %> import used to import any class to use in our jsp page. We can use comma(,) to import more than one packages. usage: <%@ page import="java.sql.*,mypackage.myclass" %> session="true|false" , default is true so jsp pages are session enable. usage: <%@ page session="true" %> buffer , control buffer usage for that jsp page. usage: <...

wine0.9.40 and utorrent1.7 on win2000 mode get black screen

Today I upgrade utorrent[sure on feisty] from 1.6 to 1.7 then restart utorrent. This upgrading cause unused parts of uTorrent's window are black. That's annoying me. After some searching, look like it wine bug , I run with wine 0.9.40, the newest one. The black window area will happen when use in mode

JSP TAGS

JSP is the html page that add java code[called JSP tags] into it. JSP tags can be devided into 6 different types. These are: Comment tag use to add comment. <% --comment here-- %> or <! --comment here-- > Declarations tag use to define the variables,methods or classes to use in the JSP page. <%! Declaration1; Declaration2; %> Scriplets tag use to insert java statements. <% Statement 1; Statement 2; Statement n; %> Expressions tag use to print out any data on the page. These data are automatically converted to string. <%=[Value] or [Expression]%> Directives tag is used for many purposes depend on directive and attribute in tag. there are three directives page, include and taglib. <%@ directive attribute="value" %> Action tag is use to transfer control to other server objects[ex. pages] or perform operations on other objects. <jsp:action attributes /> action tag has three types e.g. include,forward and usebean.

Compiz Fusion on Fiesty

Two weeks ago, I read on ubuntuforums and found this thread about how to get compiz fusion work on ubuntu fiesty . It show you clearly step by step how to. Today I'm just decide to try and it's real amazing. 3D Cube and many effect feel smoother than the old compiz from repos. It's work on my asus n6200td 128M card, my memory is 512M, athlon xp 1700+ and A7N8X-E mobo. Compiz fusion still development version but for me it's very very very stable. So I urge you to try it now. Compiz Fusion is merging of compiz and beryl project. It's not on feisty repos yet but may be on Gutsy Gibbon.

Using HttpURLConnection

Usually when I want to make a request over network in java I familiar to use Socket class like this. Socket theSock = new Socket(server,port); PrintStream ps = new PrintStream(theSock.getOutputStream()); then uses ps.println() to send a request and uses theSock.getInputStream() to reciece response to see everything that sent over output stream. But this maybe not suitable for all situation. Talking with web server will be done through HTTP message[request,response] that consists of header and body . So to make a post,get http request [with Socket class] //Post ps.println("POST uri HTTP/1.1"); ps.println("Content-Length: "+body.length()); ps.println("Content-Type: "+contenttype); ps.println(); ps.println( body ); //or Get ps.println("GET uri HTTP/1.1"); ps.println("Connection: Close"); ps.println(); and web server will responds with HTTP response like. Here's the example. HTTP/1.1 200 OK Date: Wed, 04 Jul 2007 10:14:54 GMT . Conte...

3DES/Base64 encryption in java

Last week I need to post data in xml format to one server. For security reason one node[xml] require 3DES encryption and encode to Base64 before send. It's a good idea to encrypt sensitive data before store in database or transfer over internet but I'm not even know what 3DES is. After some search, I found that it's not too hard. This post is about how i encrypt data in java. 3DES algorithm use symetric key[secret key] to encrypt or decrypt data. So.. First define a key [ length must be 24 bytes ]. I do this by getBytes() from random string. byte [] seed_key = (new String("er48nsjhwlG593mjhgdb20ih")).getBytes() create Cipher object SecretKeySpec keySpec = new SecretKeySpec(seed_key,"TripleDES"); Cipher nCipher=Cipher.getInstance("TripleDES"); nCipher.init( Cipher.ENCRYPT_MODE, keySpec ); Cipher class provides the functionality of a cryptographic cipher for encryption and decryption. To create cipher object, pass transformation to getInstance m...

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] anonymous_enable=NO To jail some user in their home dir uncomment two following line [Default: NO] chroot_list_enable=YES chroot_list_file=/etc/vsftpd/chroot_list 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] chroot_local_user=YES

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 > optio...

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 or 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 archiv...