Sunday, March 29, 2009

Why google don't index my forum powered by phpbb 3.0.4 www.dotaart.com

Tried really hard to solve the dynamic link problem.
Finally resolved it with the help of Advanced phpBB3 SEO mod Rewrite

Don't forget to change you "AllowOverride none" to "AllowOverride ALL" to enable mod_rewrite for your websites. I am stunk at this point for quite a long time ...
For me this is modified at
"/etc/apache2/sites-enabled/000-default" where I configured my virtual hosts.

Now the forum looks better.
Originally, the URL look like this,
"
www.dotaart.com/viewforum.php?f=2
"
Now the url looks static like this
"
"
This is more search engine robot friendly.
Which is considered as part of SEO (Search engine optimization)


However, I still don't manage to get google crawl my page.
In the web master portal, I can see that google didn't index a single page of my site.
I'm sure this is a problem of duplicate contents, however, really difficult to fix

But now, www.dotaart.com, a forum to share dota video, images, and musics has more than 2000 clicks from 40 countries in just 2 days. I think it will grow more and more popular in the near future.

Wednesday, March 25, 2009

Finally tcpdump on GPhone G1 Android

Timur helped me a lot with this.

Step 1.
You need to get the tcpdump binary from here or here.
If you want to know where this binary is from, refer to Timur's post about cross-compilation.
If you don't want to bother, just download the tcpdump binary.

Step 2.
Install Android SDK in your machine.
See here for details.
They have good support for Windows, Linux and Mac.

Step 3.
Go to android-sdk-linux_x86-1.1_r1/tools
or xxx/tools depending on which build version of android you are using.
run
"sudo ./adb push ./tcpdump-arm /data/local"
You can push the tcpdump binary from your computer to the phone's directory "/data/local".
According to Timur, we can remount the gphone and make other directory writable to user "shell", however, by default, I only found "/data/local" is writable to user "shell" (maybe wrong, but at least it works)

Step.
run "sudo ./adb kill-server"
run "sudo ./adb shell"
Now you have logined into Gphone's shell command

You can see this
"
* daemon not running. starting it now *
* daemon started successfully *
$
"

Run "su"
You will see
"#" and now you are in root mode.
(Our Gphone is a holiday version which is not for sale.
For normal GPhone, I guessed, you can not enter root mode, hence not be able to run "tcpdump". For GPhone Dev version, you can definitely enter root mode)

Run
"cd /data/local"

Run
"chmod 777 tcpdump-arm"
To change the binary executable

then
run
"./tcpdump-arm"

If you see
"tcpdump: no suitable device found"
Then it means that you need to be root to run tcpdump.

Have fun dumping traffic on your GPhone Adroid

Android SDK adb shell error: device not found

Thanks Timur for pointing this link to me.
Really helpful.

I followed all the steps to install Android SDK on a Ubuntu Linux machine.
I went to the "/android-sdk-linux_x86-1.1_r1/tools" directory and run "adb shell"
it replies,
"
* daemon not running. starting it now *
* daemon started successfully *
error: device not found
"

The problem is that we need to run everything with root.
So by any chance, if you met the same problem with me, run

"

sudo ./adb kill-server
sudo ./adb shell

"

Then you can use "sudo ./adb push" or "sudo ./adb pull" to copy file between a Android Gphone and a computer

Thursday, March 12, 2009

GNUPlot: How to remove the blank margin space on the left

When you plot a figure using gnuplot, sometimes, there will be an extra blank margin on the left. To make the figure more condense, you can use a bash script to remove the extra blank margin. The basic idea is to adjust the Bounding Box for eps more intelligently.

Usage:
bash fixbb *.eps

The original image may look like this

The original eps file will be replaced with the adjusted eps file

The new eps file may look like this.




You can download this script from here.
Or, copy the following lines into a file named "fixbb" or something else whatever you like.

You can also copy this file (Assume you are using Linux)
to /usr/local/bin
and run "sudo chmod +x /usr/local/bin/fixbb"
Then in your terminal, you can directly run
"fixbb *.eps"

This script helps us a lot for our paper.

#!/bin/bash

# This is fixbb version 0.31. Copyright 2000 by Jeff Spirko.
# Redistributable under the GNU General Public License.
# See http://topquark.dhs.org/~spirko/fixbb/

# Changes by Petr Mikulik:
# - 8. 9. 2000: working file in the $TMP directory; remove backup file
# - 18. 10. 2000: AWKPARSEBB to support multiple-page (non-EPS) documents
# - 26. 10. 2000: error if bounding box not determined (GS < gsopts="-dQUIET -dBATCH -dNOPAUSE -sDEVICE=bbox" awkprog="'{" 1 ="=" awkprog="'" 1 ="=" found="1;" awkparsebb="'" x1="99999;" y1="99999;" x2="0;" y2="0;" page="0">$2 { x1=$2 }
y1>$3 { y1=$3 }
x2<$4 { x2=$4 } y2<$5 { y2=$5 } { page++; printf "Page " page ": " $0 " max = " x1 " " y1 " " x2 " " y2 " \t\r" >"/dev/stderr" }
END { printf "\t\t\t\t\t\t\t\r" >"/dev/stderr"
print x1 " " y1 " " x2 " " y2 }
'

export bbox

# Each command-line argument is assumed to be a file to process
for FILE in $* ; do

# BAK=${FILE}~
# if [ "$TMP" = "" ]; then TMP="."; fi; BAK=$TMP\fixbb__.ps
BAK='fixbb$$.ps'

# Get the correct BoundingBox from ghostscript.
# Old: bbox=`gs ${GSOPTS} ${FILE} 2>&1 | gsort | head -1 | cut -d\ -f 2-`
bbox=`/usr/bin/gs ${GSOPTS} ${FILE} 2>&1 | awk "$AWKPARSEBB"`

case $bbox in
"99999 99999 0 0")
echo "Bounding box was NOT determined (empty pages or Ghostscript >= 5.50 required)"
exit ;;
esac

echo "Bounding box for \""$FILE"\" is: "$bbox

# Save the old version of the file
mv $FILE $BAK

# Create the new version, replacing the old BoundingBox
awk "$AWKPROG" $BAK > $FILE

case `uname` in
"OS/2") dos2unix $FILE ;;
esac

# delete the backup file
rm -f $BAK

done

Saturday, March 7, 2009

VIM is such an amazing tool!!!

Will post something in the future for VIM.
I really love it like crazy.
100 times better than gedit emacs notepad and notepad++ (lol)!!!

How to remove Kubuntu and Xubuntu from Ubuntu

Remove Kubuntu:

sudo apt-get remove adept akregator amarok amarok-common amarok-engine-xine apport-qt ark dolphin dragonplayer exiv2 foomatic-db-gutenprint gdebi-kde gnupg-agent gtk-qt-engine guidance-power-manager gwenview hpijs-ppds hplip-gui ijsgutenprint imagemagick install-package jockey-kde k3b k3b-data kaddressbook kamera kate kde-icons-oxygen kde-printer-applet kde-window-manager kde-zeroconf kdebase-bin kdebase-data kdebase-plasma kdebase-runtime kdebase-runtime-bin-kde4 kdebase-runtime-data kdebase-runtime-data-common kdebase-workspace-bin kdebase-workspace-data kdebase-workspace-libs4+5 kdebluetooth kdegraphics-strigi-plugins kdelibs-bin kdelibs-data kdelibs4c2a kdelibs5 kdelibs5-data kdemultimedia-kio-plugins kdepasswd kdepim-kresources kdepim-strigi-plugins kdepim-wizards kdepimlibs-data kdepimlibs5 kdeplasma-addons kdeplasma-addons-data kdeplasma-addons-libs4 kdesudo kdm kfind kgrubeditor khelpcenter4 klipper kmag kmail kmix kmousetool knotes konqueror konqueror-nsplugins konqueror-plugin-searchbar konsole kontact konversation kopete korganizer krdc krfb ksnapshot ksysguard ksysguardd ksystemlog ktimetracker ktorrent kubuntu-artwork-usplash kubuntu-default-settings kubuntu-desktop kubuntu-docs kubuntu-konqueror-shortcuts kuser kvkbd kwalletmanager language-selector-qt libakonadiprivate1 libarts1c2a libartsc0 libaudio2 libavahi-qt3-1 libcapseo0 libcaptury0 libclucene0ldbl libdbus-1-qt3 libdbus-qt-1-1c2 libexiv2-4 libfftw3-3 libflac++6 libgeoip1 libifp4 libk3b3 libkcddb4 libkdecorations4 libkdepim4 libkholidays4 libkipi-common libkipi5 libkleo4 libkonq5 libkonq5-templates libkpgp4 libksieve4 libkwineffects1 liblua50 liblualib50 libmimelib4 libmodplug0c2 libmpcdec3 libmysqlclient15off libnjb5 libofa0 libokularcore1 libphonon4 libplasma2 libpoppler-qt4-3 libpq5 libqca2 libqca2-plugin-ossl libqimageblitz4 libqt3-mt libqt4-assistant libqt4-core libqt4-dbus libqt4-designer libqt4-help libqt4-network libqt4-opengl libqt4-qt3support libqt4-script libqt4-sql libqt4-sql-mysql libqt4-svg libqt4-test libqt4-webkit libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4 libraptor1 librasqal0 librdf0 libruby1.8 libsearchclient0 libsoprano4 libstreamanalyzer0 libstreams0 libstrigihtmlgui0 libstrigiqtdbusclient0 libtunepimp5 libvncserver0 libxcb-shape0 libxcb-shm0 libxcb-xv0 libxine1 libxine1-bin libxine1-console libxine1-misc-plugins libxine1-x libxvmc1 libzip1 mediamanager mysql-common network-manager-kde okular okular-extra-backends openoffice.org-kde openoffice.org-style-crystal oxygen-cursor-theme phonon phonon-backend-gstreamer phonon-backend-xine pinentry-gtk2 pinentry-qt4 plasmoid-quickaccess python-kde4 python-qt3 python-qt4 python-qt4-common python-qt4-dbus python-reportlab python-sip4 qt4-qtconfig raptor-utils redland-utils ruby ruby1.8 software-properties-kde soprano-daemon speedcrunch strigi-client strigi-daemon system-config-printer-kde systemsettings ttf-dustin update-manager-kde update-notifier-kde && sudo apt-get install ubuntu-desktop

Remove Kubuntu KDE 4

sudo apt-get remove adept akregator amarok amarok-common amarok-engine-xine apport-qt ark dolphin dragonplayer exiv2 foomatic-db-gutenprint gdebi-kde gnupg-agent gtk-qt-engine guidance-power-manager gwenview hpijs-ppds hplip-gui ijsgutenprint imagemagick install-package jockey-kde k3b k3b-data kaddressbook kamera kate kde-icons-oxygen kde-printer-applet kde-window-manager kde-zeroconf kdebase-bin kdebase-data kdebase-plasma kdebase-runtime kdebase-runtime-bin-kde4 kdebase-runtime-data kdebase-runtime-data-common kdebase-workspace-bin kdebase-workspace-data kdebase-workspace-libs4+5 kdebluetooth kdegraphics-strigi-plugins kdelibs-bin kdelibs-data kdelibs4c2a kdelibs5 kdelibs5-data kdemultimedia-kio-plugins kdepasswd kdepim-kresources kdepim-strigi-plugins kdepim-wizards kdepimlibs-data kdepimlibs5 kdeplasma-addons kdeplasma-addons-data kdeplasma-addons-libs4 kdesudo kdm kfind kgrubeditor khelpcenter4 klipper kmag kmail kmix kmousetool knotes konqueror konqueror-nsplugins konqueror-plugin-searchbar konsole kontact konversation kopete korganizer krdc krfb ksnapshot ksysguard ksysguardd ksystemlog ktimetracker ktorrent kubuntu-artwork-usplash kubuntu-default-settings kubuntu-desktop kubuntu-docs kubuntu-konqueror-shortcuts kuser kvkbd kwalletmanager language-selector-qt libakonadiprivate1 libarts1c2a libartsc0 libaudio2 libavahi-qt3-1 libcapseo0 libcaptury0 libclucene0ldbl libdbus-1-qt3 libdbus-qt-1-1c2 libexiv2-4 libfftw3-3 libflac++6 libgeoip1 libifp4 libk3b3 libkcddb4 libkdecorations4 libkdepim4 libkholidays4 libkipi-common libkipi5 libkleo4 libkonq5 libkonq5-templates libkpgp4 libksieve4 libkwineffects1 liblua50 liblualib50 libmimelib4 libmodplug0c2 libmpcdec3 libmysqlclient15off libnjb5 libofa0 libokularcore1 libphonon4 libplasma2 libpoppler-qt4-3 libpq5 libqca2 libqca2-plugin-ossl libqimageblitz4 libqt3-mt libqt4-assistant libqt4-core libqt4-dbus libqt4-designer libqt4-help libqt4-network libqt4-opengl libqt4-qt3support libqt4-script libqt4-sql libqt4-sql-mysql libqt4-svg libqt4-test libqt4-webkit libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4 libraptor1 librasqal0 librdf0 libruby1.8 libsearchclient0 libsoprano4 libstreamanalyzer0 libstreams0 libstrigihtmlgui0 libstrigiqtdbusclient0 libtunepimp5 libvncserver0 libxcb-shape0 libxcb-shm0 libxcb-xv0 libxine1 libxine1-bin libxine1-console libxine1-misc-plugins libxine1-x libxvmc1 libzip1 mediamanager mysql-common network-manager-kde okular okular-extra-backends openoffice.org-kde openoffice.org-style-crystal oxygen-cursor-theme phonon phonon-backend-gstreamer phonon-backend-xine pinentry-gtk2 pinentry-qt4 plasmoid-quickaccess python-kde4 python-qt3 python-qt4 python-qt4-common python-qt4-dbus python-reportlab python-sip4 qt4-qtconfig raptor-utils redland-utils ruby ruby1.8 software-properties-kde soprano-daemon speedcrunch strigi-client strigi-daemon system-config-printer-kde systemsettings ttf-dustin update-manager-kde update-notifier-kde

Remove Xubuntu

sudo apt-get remove a2ps abiword abiword-common abiword-help abiword-plugin-grammar abiword-plugin-mathview abiword-plugins aumix catfish cupsys-driver-gutenprint exo-utils gnumeric gnumeric-common gnumeric-gtk gpicview gtk2-engines-xfce imagemagick latex-xft-fonts libaiksaurus-1.2-0c2a libaiksaurus-1.2-data libaiksaurusgtk-1.2-0c2a libdiscid0 libexo-0.3-0 libfftw3-3 libgda3-3 libgda3-bin libgda3-common libgdl-1-0 libgdl-1-common libgdome2-0 libgdome2-cpp-smart0c2a libgoffice-0-6 libgoffice-0-6-common libgoffice-gtk-0-6 libgsf-gnome-1-114 libgtkmathview0c2a liblink-grammar4 libloudmouth1-0 libmad0 libmpcdec3 libnotify-bin libofa0 libots0 libt1-5 libtagc0 libthunar-vfs-1-2 libtunepimp5 libxfce4mcs-client3 libxfce4mcs-manager3 libxfce4util4 libxfcegui4-4 link-grammar-dictionaries-en listen mousepad mozilla-thunderbird orage psutils python-ctypes python-gnome2-extras python-musicbrainz2 python-mutagen python-ogg python-pymad python-pyogg python-pysqlite2 python-pyvorbis python-tunepimp scim-modules-table scim-tables-additional slocate tango-icon-theme tango-icon-theme-common tcl8.4 thunar thunar-archive-plugin thunar-data thunar-media-tags-plugin thunar-thumbnailers thunar-volman thunderbird vim-runtime wdiff xchat xchat-common xfce4-appfinder xfce4-battery-plugin xfce4-clipman-plugin xfce4-cpugraph-plugin xfce4-dict xfce4-fsguard-plugin xfce4-governor-plugin xfce4-icon-theme xfce4-mailwatch-plugin xfce4-mcs-manager xfce4-mcs-plugins xfce4-mcs-plugins-extra xfce4-mixer xfce4-mixer-alsa xfce4-mount-plugin xfce4-netload-plugin xfce4-notes-plugin xfce4-panel xfce4-places-plugin xfce4-quicklauncher-plugin xfce4-screenshooter-plugin xfce4-session xfce4-smartbookmark-plugin xfce4-systemload-plugin xfce4-terminal xfce4-utils xfce4-verve-plugin xfce4-weather-plugin xfce4-xkb-plugin xfdesktop4 xfdesktop4-data xfprint4 xfwm4 xfwm4-themes xubuntu-artwork-usplash xubuntu-default-settings xubuntu-desktop xubuntu-docs && sudo apt-get install ubuntu-desktop


When you are asked whether to stop KDM, choose NO. Otherwise, you will jump into terminal enviroment.

Wednesday, March 4, 2009

Remote desktop from Mac OS X 10.5 laptop to Ubuntu linux 8.10 desktop server via VNC

I have a Macbook and want to connect to my ubuntu desktop machine via remote desktop. It seems really trivial to do this.

Step 1. Open remote desktop preferences in your desktop linux machine
System->Preferences->Remote Desktop
Step 2. Enable sharing, better check all
Step 3. Enable Security, the password is limited to be 8 characters at most ...
Step 4. In you mac, download and install VNC client for it. JollyFastVNC is a good choice.
Step 5. Using your VNC to connect to your remote Linux machine.

I suggest not use encryption in your desktop's remote desktop setting.

Have fun!