Posts from 2010-09

Bash Aliases ( bashrc , bash_profile and bash_login )

Edit your ~/.bashrc :

alias firefox="open -a Firefox"
alias l="ls -l"
alias la="ls -la"

and reload the .bashrc file using . ~/.bashrc or source ~/.bashrc

You might want to add the following line to your ~/.bash_profile in order to get the ~/.bashrc loaded at the start of an interactive bash session:


Read on

Install eclectus Chinese Dictionary

eclectus is a great piece of software! It can use CEDICT (Chinese English incl. pinyin) and HanDeDict (German - Chinese).

Add the repository to the package sources:

echo "deb lucid main 
deb-src lucid main" | sudo tee /etc/apt/sources.list.d/eclectus.sources.list

Add the signing key, update...

Read on

Terminal Shortcut for Firefox on Mac OS X

Create a terminal shortcut for Firefox:

sudo ln -s /Applications/ /usr/local/bin/firefox

or simply use the open tool with the application option -a Firefox:

open -a Firefox

Read on

Apache Webserver with PHP and MySQL

Mac OS X 10.6 ships with Apache as well as PHP5. This blog post describes how to activate it.


To run Apache: Enable Web Sharing in the System Preferences → Sharing. Websites are stored in /Library/WebServer/Documents/


To activate PHP: uncomment a line in /etc/apache2/httpd.conf:

LoadModule php5_module       ...

Read on

ssh Shortcuts using .ssh/config

To create an ssh shortcut, add the following text (adopted to your setup) to .ssh/config:

# You can add multiple blocks like this to your .ssh/config
Host rudolf
Port 22
User rudolf
Protocol 2
Compression yes
ServerAliveInterval 15
ForwardX11 no
#LocalForward 20001

To connect to that host via ssh you can now simply type the following...

Read on

Set up WebDAV-Server

First install apache2:

sudo aptitude install apache2 apache2-doc

Then enable the needed mods dav and dav_fs:

sudo a2enmod dav
sudo a2enmod dav_fs

and reload the apache2 configuration:

sudo /etc/init.d/apache2 reload

Now setup a directory for webdav access. You can do this by adding the following lines in the file...

Read on

Check contents and delete resource forks from the command line

Assume we have a file on Mac OS X on a HFS or HFS+ file system named XX.

If you want to see the content of the resource fork for the file do:

cat XX/..namedfork/rsrc

If you want to delete its resource fork:

cat /dev/null >XX/..namedfork/rsrc

Read on

Show Hidden Files in Finder

If you want to see hidden system files (that have a dot at the beginning on UNIX systems) run:

defaults write AppleShowAllFiles -bool true

use false to revert the change.


Read on


Install OpenVPN

sudo aptitude install openvpn
# open port 1194 (as shown here for the ufw firewall interface):
sudo ufw allow 1194

Become an Certificate Authority

Alternative to this way: Use TinyCA (there are Ubuntu packages available).

sudo mkdir /etc/openvpn/easy-rsa/
sudo cp -R /usr/share/doc/openvpn/examples/easy-rsa/2.0/* /etc/openvpn/easy-rsa/
sudo chown -R $USER /etc/openvpn/easy-rsa/
cat << EOF...

Read on

Unmount a CD or Volume Via Command Line on Mac OS X 10.6

You can do this on the terminal via the full UNIX device descriptor:

hdiutil eject /dev/disk1s1

you might want to add -force to the command to enforce the operation.


Read on