Sep 302010
 

Edit your ~/.bashrc :

#PATH=$PATH:$HOME/bin:/usr/local/bin
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:

[[ -r ~/.bashrc ]] && . ~/.bashrc

resources

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Sep 272010
 

http://code.google.com/p/eclectus/wiki/Install

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 http://ppa.launchpad.net/cburgmer/ppa/ubuntu lucid main 
deb-src http://ppa.launchpad.net/cburgmer/ppa/ubuntu lucid main" | sudo tee /etc/apt/sources.list.d/eclectus.sources.list

Add the signing key, update package list and install:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2B553E3C
sudo aptitude update
sudo aptitude install eclectus
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Sep 262010
 

http://kb.mozillazine.org/Command_line_arguments

Create a terminal shortcut for Firefox:

sudo ln -s /Applications/Firefox.app/Contents/MacOS/firefox-bin /usr/local/bin/firefox

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

open -a Firefox http://google.de
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Sep 232010
 

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

Apache

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

PHP

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

LoadModule php5_module        libexec/apache2/libphp5.so

and restart Apache:

sudo apachectl restart

MySQL

Go to http://dev.mysql.com/downloads/mysql/ and download the latest package of the x86, 64-bit DMG version of MySQL. Install mysql, the startup item and the preference pane. Then start MySQL in the preference pane and test it’s working:

Sep 192010
 

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
Hostname rudolf-web.net
Port 22
User rudolf
Protocol 2
Compression yes
ServerAliveInterval 15
ForwardX11 no
#LocalForward 20001 8.8.8.8:80

To connect to that host via ssh you can now simply type the following on the terminal:

ssh rudolf

Now to get a shortcut, mark the following text and drag it to the desktop:

ssh://rudolf

It will create a connection shortcut file. If you move this file to a subfolder of the Applications folder called terminal connections you have a convenient way to access your SSH connections via Spotlight.

Sep 162010
 

http://wiki.ubuntuusers.de/apache/webdav

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 /etc/apache2/sites-available/000-default:

Alias /webdav "/var/webdav/"
<Directory "/var/webdav/">
  DAV on
  Options +Indexes
  AuthType Basic
  AuthName DAV
  AuthUserFile /etc/apache2/passwords
  Require valid-user
  php_flag engine Off
  BrowserMatch "gvfs/*" redirect-carefully
  AllowOverride None
</Directory>

php_flag tells php not to execute files when accessing php files on the webdav share.

Sep 112010
 

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
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Sep 062010
 

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 | sudo tee -a /etc/openvpn/easy-rsa/vars >/dev/null
export KEY_COUNTRY="DE"
export KEY_PROVINCE="Hesse"
export KEY_CITY="Frankfurt"
export KEY_ORG="Your Organization"
export KEY_EMAIL="contact@example.org"
EOF

create the server certificates:

cd /etc/openvpn/easy-rsa/
source vars
./clean-all
./build-dh
./pkitool --initca
./pkitool --server server
cd keys
openvpn --genkey --secret ta.key
sudo cp server.crt server.key ca.crt dh1024.pem ta.key /etc/openvpn/

After making changes to the configuration restart the server: