October 30, 2008

Basics of password protecting a directory on your Apache server.

"To create the file, use the htpasswd utility that came with Apache. This will be located in the bin directory of wherever you installed Apache. To create the file, type:

htpasswd -c /usr/local/apache/passwd/passwords rbowen

htpasswd will ask you for the password, and then ask you to type it again to confirm it:

# htpasswd -c /usr/local/apache/passwd/passwords rbowen
New password: mypassword
Re-type new password: mypassword
Adding password for user rbowen " httpd.apache.org

October 29, 2008

SOLVED: tortoise(svn) + putty(ssh) + pageant = no password input needed

"Lets do this step by step:

- login to your server
- type: ssh-keygen -b 1024 -t dsa -N passphrase -f mykey
- change "passphrase" to a secret keyword only you know
- type: ls -l mykey*

We just created a SSH2 DSA key with 1024 bit keyphrase. You will see two files. One named "mykey" and one named "mykey.pub". As you might guess, the .pub file is the public key file, the other is the private one. Next create a user on the server with a home directory:

- type: useradd -m myuser

You will have a directory under /home with the name "myuser", create a new directory in "myuser" called ".ssh":

- type: cd /home/myuser
- type: mkdir .ssh

Then go to the directory where you created your keys and copy the public key to the .ssh userfolder with the following command:

- type: cp mykey.pub /home/myuser/.ssh/authorized_keys

or if you already have some keys in place

- type: cat mykey.pub >> /home/myuser/.ssh/authorized_keys

Please pay attention to the filename, it really must be "authorized_keys". In some old OpenSSH implementations, it was "authorized_keys2". Now download the private key file to your client computer. Remember, the file was "mykey"

SSH key generation and connection check (client)
Grab the tools we need for doing SSH on windows on this site:

Just go to the download section and get "Putty", "Plink", "Pageant" and "Puttygen"

In order to use the private key we get from the server, we have to convert it to a putty format. This is because the private key file format is not specified by some standard body. To do this we simple open "puttygen" and open the "conversions" menu and chose "Import Key". Then browse to your file "mykey" which you got from the server enter your provided passphrase upon creation of the key. Finally click "Save private key" and save the file as "mykey.PPK" somewhere on disk.

Now we are ready to use this key for the first time to test the connection. In order to do this, we open the program "putty" and create a new session like this:

Session->HostName: Hostname or IP Adress of your server
Session->Protocol: SSH
Session->Saved Sessions: MyConnection
SSH->Prefered SSH Protocol version: 2
SSH->Auth->Private Key file for auth: $PATH$\mykey.PKK (replace $PATH$ with real path to the mykey.PKK file)

Then go back to Session tab and hit "save" button. You will see "MyConnection" in the list of available connections." tortoisesvn.net

SOLVED: curl + lighttpd upload POST problem

($ch, CURLOPT_HTTPHEADER, array('Expect:'));
" de3.php.net

October 28, 2008

Windows Xming Installation How-To

"Xming provides a minimalist yet functional X11 server for use in a Windows environment. This allows users to utilize graphical applications on a remote *nix workstation without the need for large amounts of hard drive space." gears.aset.psu.edu

October 17, 2008

October 13, 2008

SOLVED: Entry point IsThreadDesktopComposited could not be located...

"Thanks for the information. The problem was caused by the presence of the
file DWMAPI.DLL which was installed with IE7. I reverted to IE6, renamed
the file and the error went away."

October 4, 2008

Fix permissions to the repository

"$ find /var/svn/project -type f -exec chmod 660 {} \; $ find /var/svn/project -type d -exec chmod 2770 {} \; " trac.edgewall.org

Unpacking .tar.gz files

"To unpack a .tar.gz file, say, foo.tar.gz, use the following command:

gunzip -c foo.tar.gz | tar xopf -

The newly extracted files will be created in the current directory. If you also wish to see a list of the files as they are extracted, instead use the command

gunzip -c foo.tar.gz | tar xopft -" magma.maths.usyd.edu.au

October 2, 2008

Pngcrush = png compressor

"Pngcrush is an optimizer for PNG (Portable Network Graphics) files. It can be run from a commandline in an MSDOS window, or from a UNIX or LINUX commandline"pmt.sourceforge.net