msgbartop
A cronological documentation test project, nothing serious, really!
msgbarbottom

05 Sep 2008 Create a PDF document from man page

man -t passwd | ps2pdf -> passwd.pdf

Tags:

Posted by

04 Sep 2008 Secure browsing with Firefox and SOCKS v5

This post describes how you can setup secure web browsing using Firefox3 and by setting up a SSH tunnel from your PC/host to a remote PC/host. Your PC will then act as a local SOCKS proxy and all applications that supports SOCKS5 interface to this port. This is a handy solution if you are on a untrusted net like a wireless connection. The solution can also be used in Thunderbird if you would like.
Note
It is important to note that it’s only the connection between your host and the remote host that is secure. It is also important to note that Firefox will do DNS queries to the untrusted netwoork. This can be fixed by opening the about:config page and change network.proxy.socks_remote_dns to true.

Start a SSH connection to a host that you want to proxy through. Use the -D option to specify a SOCKS5 port on your localhost. The port doesn’t really matter. Just make sure you use the same port in your SOCKS client application.

# ssh -D 3333 username@example.com

In Firefox select “Tools | Options… | Advanced | Network |Settings… button”.

Then select “Manual proxy configuration”. All you need to fill out is “SOCKS Host: Localhost”, “Port: 3333″, then select “SOCKS v5″.

Type in “localhost” in the SOCKS host field and press the OK button.

You are now ready to surf using Firefox3 and SOCKS5 througt a SSH tunnel.

Configure a secure tunnel using Putty

You can also use Putty if you are a Windows user. The configuration is then as follows:

Tags: , , ,

Posted by

04 Sep 2008 Share a bash session using screen

This is a short post on how you can “share” a bash session/prompt with other users.

  1. User A connects to the server and types in the command
    # screen
  2. User A hist the key combination <Ctrl + a> and the type
    :multiuser on
  3. User B connects to the same server as user A and can the join the session by typing
    # screen -x

Serveral users can connect and share the same session at once.

To close the screen session just use the key combination <Ctrl + a>

Tags: ,

Posted by

04 Sep 2008 Store Debian boot messages in log

You can enable boolog in /etc/default/bootlogd

BOOTLOGD_ENABLE=Yes

The log is saved in /var/log/boot

This tip also applies to Ubuntu systems.

Tags: ,

Posted by

03 Sep 2008 Using vlogger to split Apache logs

Vlogger is a program that handles large amounts of virtualhost logs and splits it to separate files.
This is a short HOWTO to configure it using Apache.

Install vlogger in debian etch

# aptitude install vlogger

Make sure you have working Apache server

Configuring vlogger

Change the LogFormat line (there are multiple LogFormat lines – in this example we will change the one that is named combined) in /etc/apache2/apache2.conf. We must add the string %v at the beginning of it

vi /etc/apache2/apache2.conf

#LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”" combined
LogFormat “%v %h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”" combined

Add the following CustomLog line to the same file (you can put it directly after the LogFormat line)

vi /etc/apache2/apache2.conf

CustomLog “| /usr/sbin/vlogger -s access.log /var/log/apache2″ combined

NOTE
We only need one CustomLog directive in our whole Apache configuration. Please disable all other CustomLog directives, especially in your virtual host configurations.

Restart apache

# /etc/init.d/apache2 restart

Vlogger will now create subdirectories in the /var/log/apache2 directory, one per virtual host, and create access logs that contain the current date in the file name. It will also create a symlink called access.log that points to the current log file.

Let’s assume we have two virtual hosts, www.example1.com and www.example2.com. Then this is how the /var/log/apache2 directory will look like:

# ls /var/log/apache2/

www.example1.com/
09022008-access.log
09012008-access.log
access.log -> 09022008-access.log
www.example2.com/
09022008-access.log
09012008-access.log
access.log -> 09022008-access.log

Tags: ,

Posted by