| Subcribe via RSS

Recursively delete file or folder from sub-directory

March 21st, 2010 | No Comments | Posted in Mac OSX, Ubuntu

I used an example from deleting all .svn from sub-directory.

1
rm -rf `find . -type d -name .svn`

Mastering Vi Common in just 10 minutes

January 5th, 2010 | No Comments | Posted in Knowledges, Mac OSX, Ubuntu

I have just finished my Unix exam. I know somebody hates VI very much, because it is very hard to use. It is so command-line, something like that. But learning to use this editor is very useful because you never know when will you unable to use X-Window or when will you face with command-line configuration.

So, just easing you in. VI is an editor in Unix and Unix-like system. It is command-line-based and very easy to use. You can learn its basics in just 10 minutes. VI has two modes; command mode and insert mode. Command mode is where you put your command and insert mode is where you put your text. Easy!

How to switch between two modes

1. In VI editor, press ESC to switch command mode, and press ESC again to insert mode. If you’re not sure, always press ESC two times, it will always be command mode. You will hear the beep sound.

How to insert text

1. In VI editor, press ESC two times to command mode, and press “i” or “a” and then type your text. “i” is insert, “a” is append your text

How to delete your text

1. In VI editor, press ESC two times to command mode, and where the cursor is press “x” to delete the character you want.

How to navigate in VI

1. In VI editor, you cannot use arrow keys in your keyboard to up, down, left or right. So how?, In VI editor, press ESC two times to command mode, and press “h” to navigate left, “j” to go down, “k” to go up and “l” to go left.

How to save and exit in VI

1. In VI editor, press ESC two times to command mode and then press “:wq” to save and exit the program.

See how easy is that, but VI is more than this you can read its documentation or visit this

Linux : Everything you need to know about configuration files

August 1st, 2008 | No Comments | Posted in Ubuntu

http://www.ibm.com/developerworks/linux/library/l-config.html

Subversion : subversion on ubuntu

June 18th, 2008 | No Comments | Posted in Subversion, Ubuntu

So, I have just created my googlecode project. And I have to deal with subversion which is quite new for me. Anyway, basically, this topic I will present how to create your own repository in ubuntu. I recommended this book which is very good for anyone who is new to subversion.

Note : I am using ubuntu 8.04. This version is different from the others that it uses htpasswd instead of htpasswd2.

Step 1, install subversion

COMMAND
$ sudo apt-get install subversion

Step 2, install Apache2. I’m using this server to use WEBDAV and because it’s a very extensible web server.

COMMAND
$ sudo apt-get install apache2 libapache2-svn

Step 3, make your own repository locally

COMMAND
$ sudo mkdir -p /var/local/svn <– This is your repository
$ sudo svnadmin create –fs-type fsfs /var/local/svn <– Bind it to subversion
$ sudo chown -R www-data:www-data /var/local/svn <– Change permission

Step 4, Set configuration for apache2 subversion module. This step, you have to re-configure your apache. It’s a xml-like config file.

COMMAND
sudo gedit /etc/apache2/mods-enabled/dav_svn.conf

Modified the file to look like this. Everything you need to know about this file is in the file itself. Just for one thing. If you plan to use multiple repositories use SVNParentPath. But If you have only one repository use SVNPath instead

/etc/apache2/mods-enabled/dav_svn.conf
<Location /svn>
DAV svn
SVNParentPath /var/local/svn
</Location>

Step 5, You have two choices. One is Basic authentication, and SSL access.
In this topic I use Basic authentication. So, modified the same file dav_svn.conf

/etc/apache2/mods-enabled/dav_svn.conf
<Location /svn>
DAV svn
SVNParentPath /var/local/svn
AuthType Basic <– for basic authentication
AuthName “Subversion Repository” <– name
AuthUserFile /etc/apache2/dav_svn.passwd <– password file
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>

Step 6, Create user and password

COMMAND
& sudo htpasswd -cm /etc/apache2/dav_svn.passwd ${yours username}

Step 7, Reload the setting

COMMAND
$ sudo /etc/init.d/apache2 reload

So, now you should be able to access your repository via http://127.0.0.1/svn/${yours repository}
if you want to change your server name. just edit the file /etc/hosts

Reference : http://ubuntuforums.org/showthread.php?t=187739

Tags: , ,

Ubuntu : GEdit looks like TextMate

June 13th, 2008 | No Comments | Posted in Ubuntu

This is how you can change your gedit style.

Reference : http://weblog.punneng.com/2008/5/11/gedit-looks-like-textmate

Ubuntu : Local DNS Cache for Faster Browsing

June 11th, 2008 | No Comments | Posted in Ubuntu

Local DNS Cache for faster browsing