Launch Thunderbird with European formatted dates

2011-05-10 by xpheas
BASH-Code:
1
2
3
#!/bin/sh
export LC_TIME=en_GB.utf8
thunderbird

Make the script executable and change the launcher properties. Browse to the directory where you saved the script and select it.

  » comments (0)

Firefox 4 - save tabs on close

2011-05-04 by xpheas
Firefox 3.6 ask if you want to save your session if you have multiple tabs open and close the browser. For some reason Firefox 4 doesen't. I fixed the issue by changing the value of browser.showQuitWarning from false to true in about:config

  » comments (0)

Ubuntu Natty: activate old scrollbars in Ubuntu Classic

2011-05-04 by xpheas
Natty comes with new overlay scrollbars. The work fine in the filebrowser but not in Eclipse (the overlay does not appear). So i deactivated the new scrollbars to get the old one back.
BASH-Code:
1
2
sudo su
echo "export LIBOVERLAY_SCROLLBAR=0" > /etc/X11/Xsession.d/80-disableoverlayscrollbars

  » comments (1)

MySQL FROM_UNIXTIME() with negative timestamp

2011-04-01 by xpheas
The MySQL FROM_UNIXTIME() function does not support negative epoch timestamps, it returns NULL.

I used the DATE_ADD function to work with negative timestamps:
BASH-Code:
1
SELECT DATE_ADD(FROM_UNIXTIME(0), INTERVAL <timestamp> SECOND) FROM <table>

  » comments (0)

Port forwarding with iptables

2011-02-27 by xpheas
I am using a Linux gateway with an public IP-address to access the Internet.
To access an internal machine on port 80 beind the gateway from outside I created the following forwarding rule (iptables).
BASH-Code:
1
2
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j DNAT --to 192.168.100.50:80
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth0 -j ACCEPT

The first rule does the forwaring job, the second allows new incomming connections on port 80.

Now the webserver on Port 80 behind the gateway is accessible over the public IP.

  » comments (0)

Guake Terminal

2011-02-16 by xpheas
Want a really cool terminanl?
Check out Guake. Guake is a top-down terminal for Gnome.

guake-terminal

  » comments (0)

MDB2 connet to multiple MySQL databases

2011-02-06 by xpheas
If you connet to multiple databases MDB2 uses only the first db.

To fix the issue add "new_link=true" to the DSN.

CODE-Code:
1
mysql://username:password@server/database?new_link=true

  » comments (2)

Gimp save all layers

2011-01-06 by xpheas
I needed to export multipe layers to separate JPG files. Gimp does not support that by default but i found a nice script that can export each layer.

Download the script

Source: http://flashingtwelve.brickfilms.com/GIMP/Scripts/sg-save-all-layers.scm

  » comments (0)

Mount a remote share using SSHFS

2011-01-05 by xpheas
Install SSHFS on you local machine:
BASH-Code:
1
apt-get install sshfs

Add your user to the fuse group
BASH-Code:
1
sudo gpasswd -a $USER fuse

Create the mount point
BASH-Code:
1
mkdir ~/remote_share

Now we can mount the remote share
BASH-Code:
1
sshfs -o idmap=user $USER@host:/path/to/share ~/remote_share

To unmount type:
BASH-Code:
1
fusermount -u ~/remote_share

To add the share permanetly add it to your fstab
BASH-Code:
1
nano /etc/fstab

BASH-Code:
1
sshfs#$USER@host:/path/to/share /home/$USER/remote_share fuse users,exec,allow_other,_netdev,reconnect,transform_symlinks,uid=1000,gid=1000,defaults,idmap=user 0 0

For passwordless authentication put your public rsa key on the remote machine.

  » comments (0)

SOCKS Proxy over SSH Tunnel

2010-11-03 by xpheas
If you are in a foreign network and want to secure up your HTTP traffic you can use an SSH Tunnel:
BASH-Code:
1
ssh user@host -NfD 8080

Configure Firefox:

SOCKS-Host: localhost
Port: 8080

To tunnel DNS lookups open about:config and change network.proxy.socks_remote_dns to true

  » comments (0)

 « newer Posts  older Posts »