2009年3月23日 星期一

Install WTorrent which is one of Web Interfaces of RTorrent on Ubuntu

1. wtorrent requires webserver( lighttpd or apache ), php, scgi module, sqlite, xmlrpc so install them

sudo apt-get install apache2 libapache2-mod-scgi php5 php5-sqlite libxmlrpc-c3

2. enable scgi module in apache

sudo a2enmod scgi

# a2dismod is to disable

a2enmod is the command which automatically create symbolic links for module_name.conf and module_name.load under mods-enabled from mods-available

3. add the following line to /etc/apache2/httpd.conf

SCGIMount /RPC2 127.0.0.1:5000

4. download wtorrent from http://www.wtorrent-project.org/trac/ and extract

unzip wtorrent.zip

5. move wtorrent to root of your webserver and and create necessary directory for wtorrent

mv wtorrent/ /var/www/

6. make sure necessary directories of wtorrent exist, torrents/, db/, tpl_c/ and conf/

mkdir /var/www/wtorrent/tpl_c/

7. change permission for wtorrent read and write usage

chmod -R 777 /var/www/wtorrent/

8. open install.php in your browser

http://localhost/wtorrent/install.php

9. delete install.php after proper installation

rm /var/www/wtorrent/install.php

2009年3月20日 星期五

Install VNC Server on Xubuntu

vino isn't integrated into xfce, which is same vnc server that gnome uses for remote desktop feature

1. install vino

sudo apt-get install vino

2. open the config window, totally as same as gnome's

vino-preferences

3. Application -> Settings -> Setting Manager -> Autostarted Apps -> Add -> Command:

/usr/lib/vino/vino-server

4. run vino-server from ssh session

export DISPLAY=:0


/usr/lib/vino/vino-server &

2009年3月11日 星期三

Map Remote Servers into the Space of the Local Apache Server with Authentication on Ubuntu

1. delete symbolic link of the default proxy.conf

sudo rm /etc/apache2/mods-enabled/proxy.conf

2. make another copy of proxy.conf in the same folder, mods-enabled

sudo cp /etc/apache2/mods-available/proxy.conf /etc/apache2/mods-enabled/proxy.conf

3. edit it

sudo vi /etc/apache2/mods-enabled/proxy.conf
--

ProxyVia On

ProxyPass /mirror/ http://address:port/
ProxyPassReverse /mirror/ http://address:port/

<Location /motion/>
AuthName "TITLE"
AuthType Basic
AuthUserFile /var/www/.htpasswd
require valid-user
</Location>

# ProxyPass causes a local request for the http://localhost/mirror/ to be internally converted into a proxy request to http://address:port/
# ProxyPassReverse provides location header on http adjusting which redirects http://localhost/mirror/sub/ to http://address:port/sub/ also

4. generate apache password file, /var/www/.htpasswd

sudo htpasswd -c /var/www/.htpasswd username

2009年3月10日 星期二

Convert Text to Hex on Linux

xxd creates a hex dump of a given file or standard input.


echo "something" | xxd -c 256 -ps


-c 256: 256 octets per line
-ps: plain style