TECH INSIGHT
FOR THE
CURIOUS MIND

ping the universe, send your echo,
In the terminal of life, be the sudo.
exit the fear, reboot the cheer,
In the shell of existence,
hold your dreams near..

Join Newsletter

VI Editor Search and Replace

:s/foo/bar/g Change each ‘foo’ to ‘bar’ in the current line. :%s/foo/bar/g Change each ‘foo’ to ‘bar’ in all lines. :5,12s/foo/bar/g Change each ‘foo’ to ‘bar’ for all lines from line 5 to line 12 inclusive. :’a,’bs/foo/bar/g Change each ‘foo’ to ‘bar’ for all lines from mark a to mark b inclusive. :.,$s/foo/bar/g Change each ‘foo’ … Read more

How To Install openVPN in Centos 6

How To Install VPN in Centos from Source Make sure you have these packages installed:1. yum install gcc make rpm-build autoconf.noarch zlib-devel pam-devel openssl-devel -y Download LZO RPM and Configure RPMForge Repo:2. wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm (Release can be different)3. wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm (Release can be Different) Build the rpm packages:4. rpmbuild –rebuild lzo-1.08-4.rf.src.rpm5. rpm -Uvh lzo-*.rpm6. rpm … Read more

Basic Linux Administraiton, User/Group Mgmt

to make a new user>>> useradd change password>> passwd “existing username” to create a group>> groupadd create a new user and put in the existing group>> useradd “groupname” “username” to add an existing user into an existing group >> usermod –G “groupname” “username” To check the list of permission >>> ls –l to change permission … Read more

Change / Update MySQLadmin Password

mysqladmin -u root password newpassword change or update root password mysqladmin -u root -p ‘oldpassword’ password ‘newpassword’ MySQL Grant Privileges CREATE USER ‘username’@’localhost’ IDENTIFIED BY ‘newpassword’; GRANT ALL PRIVILEGES ON database.* ‘username’@’localhost’ WITH GRANT OPTION;

How to comment all lines in VI editor ?

This can be done with a using a command like ‘search and replace’1.Open the file in ‘vi’ editor.2.Press Escape and type :1,$s/^/##/g3.Press Enter 1,$s/^/##/g can be broken down as1: To start from 1st line $s :To end at the last line/^ : Search for the start of the line/##:Replace with ##/g: Replace all occurrences

How to Install RedMine on CentOS

Install Redmine on Centos 6.3 1. As a Root Install Following Packages. yum install make gcc gcc-c++ zlib-devel ruby-devel rubygems ruby-libs apr-devel apr-util-devel httpd-devel mysql-devel mysql-server automake autoconf ImageMagick ImageMagick-devel curl-devel 2. gem install bundle 3. Install Redmine    mkdir /var/www/redmine    wget http://rubyforge.org/frs/download.php/76255/redmine-1.4.4.tar.gz    (I am not sure if this method will work for newer version) 4. … Read more

Basic VI Editor

Go to Command line Type vi space “file Name” To Insert Text: I Type texts what you want to type. Press Esc To save :R To quite without save :q!

Replication of MySQL Server

For Master to Slave Replication do following steps: 1. vi /etc/my.cnf and add following linesFor ServerA        server-id = 5        replicate-same-server-id = 0        auto-increment-increment = 2        auto-increment-offset = 1        relay-log = /var/lib/mysql/serverA-relay-bin        relay-log-index = /var/lib/mysql/serverA-relay-bin.index        log-error = /var/log/mysql/mysql.err        master-info-file = /var/lib/mysql/mysql-master.info        relay-log-info-file = /var/lib/mysql/serverA-relay-log.info        log-bin = /var/lib/mysql/ServerA-bin For ServerB        server-id = 6        replicate-same-server-id = 0        auto-increment-increment … Read more

Command Differents – Windows/Linux/Centos

Command’s Purpose MS-DOS Linux Basic Linux Example Copies files copy cp cp thisfile.txt /home/thisdirectory Moves files move mv mv thisfile.txt /home/thisdirectory Lists files dir ls ls Clears screen cls clear clear Closes prompt window exit exit exit Displays or sets date date date date Deletes files del rm rm thisfile.txt “Echoes” output on the screen … Read more