Monthly Archive: August 2016

grep LINUX COMMAND (SEARCH)

grep –colour “KEYWORD” | grep php searching for “KEYWORD” in php (name/file related) -r  = recursively -n = show number of line in files -i = case insensitive -v = exclude

Vim Search & Replace

http://www.cyberciti.biz/faq/vim-text-editor-find-and-replace-all-text/   EX  ~  :s/eth0/br0/g Search for current line to replace only EX   ~ :%s/eth1/br1/g Search all occureance to replace

Nginx sites enabled procedure

cd /etc/nginx/sites-available/ cp vn.momoko.co um.momoko.co vim um.momoko.co cd /etc/nginx/sites-enabled/ ln -s /etc/nginx/sites-available/um.momoko.co /etc/init.d/nginx reload

SQL VS PHP (Object oriented connection)

HOW TO ESTABLISH THE CONNECTION WITH DATABASE $db = new mysqli(<HOST NAME>,<DB USER>,<DB PASS>,<DB NAME>); HOW TO EXECUTE QUERY $query = “YOUR QUERY”; $result = $db->query($query); HOW TO LIST YOUR QUERY RESULT while($row =...

Unzipping files & Zipping files

UNZIP BZ files , tar -xjf <Filename> GZ files, tar -xzf<Filename> ZIP tar -zcvf archive_name.tar.gz directory_to_compress Zip Command To compress: zip squash.zip file1 file2 file3 or to zip a directory zip -r squash.zip dir1...

Tmux Short Key

Session is a set of windows, plus a notion of which window is current. Window is a single screen covered with panes. (Once might compare it to a ‘virtual desktop’ or a ‘space’.) Pane...