Wrong keyboard mapping in GNOME when working with VNC/XRDP

To fix the subj issue
add the following lines:


export XKL_XMODMAP_DISABLE=1
gconftool-2 -t bool --set /apps/gnome_settings_daemon/plugins/keyboard/active false


at the top of /etc/X11/Xsession

If you need any help with RDP on Linux, let me know

P.S Tested on Ubuntu 9.10

How to align window's control buttons in Ubuntu 10.4 to left


gconftool-2 --set "/apps/metacity/general/button_layout" --type string "menu:minimize,maximize,close"

Change grub2 font-size

I searched and searched for the answer to the following question: «How do I change the font size in grub2?» It seems that no one on the entire Internet knew!

Well, I did a lot of digging into the grub2 documentation and the scripts bundled with Ubuntu and I finally have the answer!

1. Pick a font you want to use for your menu. I recommend a nice easy-to-read monospace font such as DejaVu Sans Mono (it's in the example below).
2. Convert the font to grub2's format using the grub-mkfont command, taking the extra step of setting the font size:

sudo grub-mkfont --output=/boot/grub/DejaVuSansMono.pf2 \
--size=24 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf

3. GRUB_FONT=/boot/grub/DejaVuSansMono.pf2
GRUB_FONT=/boot/grub/DejaVuSansMono.pf2

4.

sudo update-grub



FYI: I believe the "--size=" indicates point size but I'm not entirely sure (the documentation doesn't say). If it is based on the point scale I don't believe it is taking dpi into account since I tried "--size=72" on a 120dpi display and letters were only about half an inch tall (72 points is precisely one inch).

By riskable

Opera 10.51 — The fastest browser on Earth

According to the last Peacekeeper bulletin new version of Opera Web Browser has reached an awesome record in their browser benchmark.
New score it is a result of polishing their new Java Script engine called «Carakan».

Full comparison table of different browser's scores:
http://service.futuremark.com/peacekeeper/results.action?key=3BYq

Opera's test record on Peacekeeper

Congratulations to Opera Desktop Team, that succeed to boost their browser for a such huge leap!
Don't wait and download a new world fastest browser right now.

Backing up your mysql on linux box per each database


#!/bin/bash
MUSER="root"
MPASS="password"
MHOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
BAK="/mnt/backupdir"
GZIP="$(which gzip)"
NOW=$(date +"%d_%m_%Y")
for i in `find $BAK -ctime +22`; do rm $i; done
[ ! -d $BAK ] && mkdir -p $BAK
DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
for db in $DBS
do
 FILE=$BAK/$db.$NOW.gz
 $MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
done


it deletes every 22 days old backups if you want to change life-time,
you can change the value of ctime in the followed line: for i in `find $BAK -ctime +22`; do rm $i; done

Java + Httpd + Tomcat + Sakai installation (step-by-step)

Please change paths according to your failsystem layout ;)

JAVA INSTALLATION:
— 1.
# cp jdk-1_5_0_22-linux-amd64.bin /srv
# cd /srv
# sh jdk-1_5_0_22-linux-amd64.bin
# ln -s jdk1.5.0_22 jdk

# updatedb;locate javac |grep bin
/srv/jdk1.5.0_22/bin/javac



( Continue )

How to Tunnel Remote Desktop Through SSH on a Windows Computer

What you need



Setting up PuTTY


  1. Start PuTTY (double-click on putty.exe). You will see a window similar to this one:
    "

  2. Next, enable compression. Select SSH protocol level 2 as the default in the SSH subcategory for better security:"


( Read more )

Allow your web site for specific IP addresses using .htaccess

Hello All,
Here is small note, how to allow specific IP addresses to be accessed to your website by using .htaccess,
you may need it while maintenance website.
By assuming your hoster allows using .htaccess
all of you need it is create file named .htaccess
copy paste the code bellow (note some servers want the file be utf-8 encoded otherwise you will get 500 error)
replacing to your actual IPs.


        RewriteEngine on
	RewriteCond %{REMOTE_HOST} !^192\.168\.  #any ip from 192.168.0.0 to 192.168.255.255
	RewriteCond %{REMOTE_HOST} !^192\.190\.1\.86 #just some IP that will be allowed too
	RewriteCond %{REQUEST_URI} /.*$ 
	RewriteCond %{REQUEST_URI} !/maintenance\.html$ #users that aren't allowed will see this page
	RewriteCond %{REQUEST_URI} !(css|png|jpg)$ # if maintenance.html consists images, you have to allow them either.
	RewriteRule .* maintenance.html [R=301,L]


Also you can block users by IP, by changing a little the rules above.

From web to PDF

Some of you who use eBook gadgets may be interested to meet service who let you generate a real PDF-file from any web page with one click only.

So, to receive PDF-version of your web-site all what you need is go to pdfmyurl.com, type URL and click «OK».
  • +1
  • January 20, 2010, 11:24am
  • touki
  • 1+1

Multiple tables deletion in Mysql using wildcards

I've found some solution on mysql website, how to delete multiple tables according to some condition, you will need it when you will want delete specific tables from your DB.



( Read more )