Launch Thunderbird with European formatted dates
2011-05-10 by xpheasBASH-Code:
| #!/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.
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
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:
| sudo su echo "export LIBOVERLAY_SCROLLBAR=0" > /etc/X11/Xsession.d/80-disableoverlayscrollbars |
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:
I used the DATE_ADD function to work with negative timestamps:
BASH-Code:
| SELECT DATE_ADD(FROM_UNIXTIME(0), INTERVAL <timestamp> SECOND) FROM <table> |
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).
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.
To access an internal machine on port 80 beind the gateway from outside I created the following forwarding rule (iptables).
BASH-Code:
| 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.
Guake Terminal
2011-02-16 by xpheasMDB2 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.
To fix the issue add "new_link=true" to the DSN.
CODE-Code:
| mysql://username:password@server/database?new_link=true |
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
Download the script
Source: http://flashingtwelve.brickfilms.com/GIMP/Scripts/sg-save-all-layers.scm
Mount a remote share using SSHFS
2011-01-05 by xpheas
Install SSHFS on you local machine:
Add your user to the fuse group
Create the mount point
Now we can mount the remote share
To unmount type:
To add the share permanetly add it to your fstab
For passwordless authentication put your public rsa key on the remote machine.
BASH-Code:
| apt-get install sshfs |
Add your user to the fuse group
BASH-Code:
| sudo gpasswd -a $USER fuse |
Create the mount point
BASH-Code:
| mkdir ~/remote_share |
Now we can mount the remote share
BASH-Code:
| sshfs -o idmap=user $USER@host:/path/to/share ~/remote_share |
To unmount type:
BASH-Code:
| fusermount -u ~/remote_share |
To add the share permanetly add it to your fstab
BASH-Code:
| nano /etc/fstab |
BASH-Code:
| 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.
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:
Configure Firefox:
SOCKS-Host: localhost
Port: 8080
To tunnel DNS lookups open about:config and change network.proxy.socks_remote_dns to true
BASH-Code:
| 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