Linux/Unix

Redmine installation guide

This is a guide to install Redmine (svn trunk) on Ubuntu 9.10.

The assumed location of Redmine is /srv/redmine

Phase 1: Setup Redmine

Step 1 Install required packages.

$ sudo apt-get install ruby rake ruby-dev rubygems libmysqlclient-dev libopenssl-ruby

Step 2 Check out Redmine trunk.

$ cd /srv $ sudo svn co http://redmine.rubyforge.org/svn/trunk redmine

Step 3 Install required ruby gems:

$ sudo gem install rails mongrel mongrel_cluster daemons mysql actionmailer

Note 1: We may ... read more ...

Automatic virtual host with Apache

When developing with CakePHP, we can setup Apache to automatically redirect a domain to a specific CakePHP application.

We can set computer’s aliases using hosts file. Apache will automatically map aliases to different DocumentRoot:

app1.mybox.com -> /var/www/cakephp/app1.mybox.com/webroot app2.somewhere.com -> /var/www/cakephp/app2.somewhere.com/webroot

Step 1: Enable the mod_vhost_alias:

$ sudo a2enmod vhost_alias

Step 2: Replace the DocumentRoot statement in default virtualhost configuration file with two lines:

UseCanonicalName    Off VirtualDocumentRoot /var/www/cakephp/%0/webroot

(If ... read more ...

How to hide files in Nautilus

In Linux, files which name start by a dot ‘.’ are hidden by default in most file managers. However, there are cases when we want to hide dot-file from our view. For examples:

Desktop folder in our home folder. Dropbox lost+found directory at the partition root …

In Nautilus (default GNOME file manager) there’s a way. Add a file named

.hidden

with each line is the ... read more ...

Rename files from upper case filename to lower case (in bash)

Here is a way to rename files in bash, from upper case filenames to lowercase ones

for i in *; do mv $i `echo $i | tr [:upper:] [:lower:]`; done

via Rename files from upper case filename to lower case (in ... read more ...

Pyinotify

Pyinotify is a pure Python module for monitoring filesystems changes. Pyinotify relies on inotify, a Linux Kernel functionnality (since kernel 2.6.13). inotify is an event-driven notification mechanism, its notifications are exported to user space through three system calls. Pyinotify binds these system calls and provides an implementation on top of them.

via ... read more ...

Giữ một phiên làm việc SSH

Khi bạn làm việc với máy chủ thông qua SSH thì bạn sẽ thường gặp một vấn đề nhỏ. Đó là dịch vụ SSH sẽ đóng kết nối của bạn sau một khoảng thời gian nhất định. Để ngăn dịch vụ SSH đóng kết nối thì chúng ta có cách sau:

Sửa file

/etc/ssh/ssh_config

hoặc

$HOME/.ssh/config

và thêm vào đó dòng dưới đây

ServerAliveInterval 60

Chương trình ... read more ...