<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CkQERnYzfyp7ImA9WhRUF0g.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170</id><updated>2012-01-28T19:31:47.887+08:00</updated><category term="Fedora" /><category term="postgresql" /><category term="tools" /><category term="DNS" /><category term="dd" /><category term="rsync" /><category term="one-liner" /><category term="ping" /><category term="webmin" /><category term="migrate" /><category term="regexp" /><category term="backuppc" /><category term="upgrade" /><category term="RPM" /><category term="service" /><category term="sed" /><category term="chrome" /><category term="suse" /><category term="firefox" /><category term="awk" /><category term="yum" /><category term="Backup" /><category term="tips" /><category term="grep" /><category term="strace" /><category term="hard disk" /><category term="tunnelling" /><category term="dpkg" /><category term="scp" /><category term="vim" /><category term="cron" /><category term="solaris" /><category term="fstab" /><category term="wget" /><category term="xen" /><category term="bind" /><category term="serial" /><category term="virtualbox" /><category term="fastcgi" /><category term="mysql" /><category term="LVM" /><category term="vmware" /><category term="security" /><category term="perl modules" /><category term="apt" /><category term="OpenOffice" /><category term="bash" /><category term="user management" /><category term="split" /><category term="editor" /><category term="ip scan" /><category term="filesystem" /><category term="rootsh" /><category term="opensource news" /><category term="html" /><category term="partition" /><category term="network" /><category term="svn" /><category term="subversion" /><category term="label" /><category term="virtualization" /><category term="mail" /><category term="proxy" /><category term="grub" /><category term="perl" /><category term="dimdim" /><category term="http" /><category term="application" /><category term="mailserver" /><category term="archive" /><category term="download" /><category term="find" /><category term="General" /><category term="gnome mainmenu package hack" /><category term="shell" /><category term="python" /><category term="browser" /><category term="internet" /><category term="script" /><category term="debian" /><category term="web-browser" /><category term="windows" /><category term="maintenance" /><category term="nfs" /><category term="livecd" /><category term="cmd" /><category term="file" /><category term="audio/video" /><category term="dbmail" /><category term="update" /><category term="hardware" /><category term="repository" /><category term="named" /><category term="Centos" /><category term="ssh-tunnel" /><category term="share" /><category term="openSuSE" /><category term="apache" /><category term="screen" /><category term="Redhat" /><category term="vi. vim" /><category term="TimeDate" /><category term="vi" /><category term="cygwin" /><category term="netbios" /><category term="sftp" /><category term="files" /><category term="ssh" /><category term="tr" /><category term="deb" /><category term="sudo" /><category term="terminal" /><category term="wireless" /><category term="chntpw" /><category term="unix" /><category term="swap" /><category term="server" /><category term="samba" /><category term="Ubuntu" /><category term="md5" /><category term="checksum" /><title>linuxwave</title><subtitle type="html">Linux is for everybody. Lets enjoy it.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://linuxwave.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>145</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Linuxwave" /><feedburner:info uri="linuxwave" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;C0ADRXs-fyp7ImA9WhRVEko.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-8978693040189309047</id><published>2012-01-11T16:15:00.003+08:00</published><updated>2012-01-11T16:49:34.557+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-11T16:49:34.557+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ping" /><category scheme="http://www.blogger.com/atom/ns#" term="tools" /><category scheme="http://www.blogger.com/atom/ns#" term="network" /><category scheme="http://www.blogger.com/atom/ns#" term="bash" /><title>Ping a list of servers</title><content type="html">To do this, you need to put all the hosts that need to be checked in a file. For example, I put all my hosts in a file called ping_list:&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;cat ping_list&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;cat.myhost.net&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;dog.myhost.net&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;tiger.myhost.net&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;bird.myhost.net&lt;/span&gt;&lt;/pre&gt;There are a few ways to ping multiple hostnames, I'll list out what I have tried before:&lt;br /&gt;&lt;br /&gt;1. Use nmap&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;nmap -sP -iL ping_list&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Failed to resolve given hostname/IP: cat.myhost.net.  Note that you can't use '/mask' AND '1-4,7,100-' style IP ranges&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Failed to resolve given hostname/IP: dog.myhost.net.  Note that you can't use '/mask' AND '1-4,7,100-' style IP ranges&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Host 192.168.0.99 is up (0.00036s latency).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Host 192.168.0.100 is up (0.00061s latency).&lt;/span&gt;&lt;/pre&gt;where -sP is for ping test and -iL is for inputting from files.&lt;br /&gt;&lt;br /&gt;2. One liner for loop&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;for i in `cat ping_list`; do ping -c1 $i; done&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;ping: unknown host cat.myhost.net&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;ping: unknown host dog.myhost.net&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;PING tiger.myhost.net (192.168.0.99) 56(84) bytes of data.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;--- tiger.myhost.net ping statistics ---&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;1 packets transmitted, 0 received, 100% packet loss, time 0ms&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;PING tiger.myhost.net (192.168.0.100) 56(84) bytes of data.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt; --- bird.myhost.net ping statistics ---&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt; 1 packets transmitted, 0 received, 100% packet loss, time 0ms&lt;/span&gt;&lt;/pre&gt;I believe there are other tools or scripts beside those I listed above, but I always these 2 methods to ping multiple hosts. If you have other tools or script, please leave a comment.&lt;br /&gt;&lt;br /&gt;Thanks&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-8978693040189309047?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/e0A9aV0chvQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/8978693040189309047/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=8978693040189309047" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/8978693040189309047?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/8978693040189309047?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/e0A9aV0chvQ/ping-list-of-servers.html" title="Ping a list of servers" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2012/01/ping-list-of-servers.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AMRXc4eip7ImA9WhRQEUk.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-2940230927603944248</id><published>2011-12-06T10:49:00.003+08:00</published><updated>2011-12-06T11:23:04.932+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-06T11:23:04.932+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="subversion" /><category scheme="http://www.blogger.com/atom/ns#" term="svn" /><title>Store svn password</title><content type="html">To store your cert and password, all you have to do is:&lt;br /&gt;&lt;br /&gt;1. Go to .subversion in your home folder&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;$ cd ~/.subversion&lt;/span&gt;&lt;/pre&gt;2. Run below command. This command will add &lt;span style="color: rgb(0, 153, 0);"&gt;store-auth-creds = yes&lt;/span&gt; and &lt;span style="color: rgb(0, 153, 0);"&gt;store-passwords = yes&lt;/span&gt; to your bottom of config file&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;$ echo -e "store-auth-creds = yes\nstore-&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;passwords = yes" &amp;gt;&amp;gt; config&lt;/span&gt;&lt;/pre&gt;3. Run any svn command, and choose &lt;span style="color: rgb(0, 153, 0);"&gt;p&lt;/span&gt; for permanent accept certificate, and &lt;span style="color: rgb(0, 153, 0);"&gt;yes&lt;/span&gt; for storing your password.&lt;br /&gt;&lt;br /&gt;Now you won't be asked for svn password anymore.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-2940230927603944248?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/Ij55oXz5FXc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/2940230927603944248/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=2940230927603944248" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/2940230927603944248?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/2940230927603944248?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/Ij55oXz5FXc/store-svn-password.html" title="Store svn password" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/12/store-svn-password.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EBQX86cSp7ImA9WhRREkw.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-675507529504240413</id><published>2011-11-25T15:42:00.003+08:00</published><updated>2011-11-25T17:00:50.119+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-25T17:00:50.119+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="fstab" /><category scheme="http://www.blogger.com/atom/ns#" term="filesystem" /><category scheme="http://www.blogger.com/atom/ns#" term="swap" /><title>Add file type swap to linux</title><content type="html">To add swap to linux machine:&lt;br /&gt;&lt;br /&gt;1. Create a swap file. Size depends on your preference. Let's say we want to create a swap file with 8GB size (1024 x 1024 x 8 = 8388608).&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;dd if=/dev/zero of=/swapfile bs=1024 count=8388608&lt;/span&gt;&lt;/pre&gt;where &lt;span style="color: rgb(255, 0, 0);"&gt;if&lt;/span&gt; is source, &lt;span style="color: rgb(255, 0, 0);"&gt;of&lt;/span&gt; is output file for dd to write to which is &lt;span style="color: rgb(51, 204, 0);"&gt;/swapfile&lt;/span&gt; in this case, &lt;span style="color: rgb(255, 0, 0);"&gt;bs&lt;/span&gt; is read/write byte size at a time and &lt;span style="color: rgb(255, 0, 0);"&gt;count&lt;/span&gt; is number of blocks.&lt;br /&gt;&lt;br /&gt;2. Once created, make it a swap file&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;mkswap /swapfile&lt;/span&gt;&lt;/pre&gt;3. Activate your swap file&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;swapon /swapfile&lt;/span&gt;&lt;/pre&gt;4. Check your newly created swap space using free or top&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;free -m&lt;/span&gt;&lt;/pre&gt;or&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;top&lt;/span&gt;&lt;/pre&gt;5. To make it appear even after reboot, put it into fstab&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;echo "swapfile swap swap defaults 0 0" &amp;gt;&amp;gt; /etc/fstab&lt;/span&gt;&lt;/pre&gt;It will look like this:&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;cat /etc/fstab &lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;/swapfile1 swap swap defaults 0 0&lt;/span&gt;&lt;br /&gt;...&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-675507529504240413?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/jEAaFMtQaxA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/675507529504240413/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=675507529504240413" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/675507529504240413?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/675507529504240413?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/jEAaFMtQaxA/add-file-type-swap-to-linux.html" title="Add file type swap to linux" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/11/add-file-type-swap-to-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08DQnYyfip7ImA9WhRTEk8.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-1484339972034416551</id><published>2011-11-01T11:28:00.004+08:00</published><updated>2011-11-02T17:24:33.896+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-02T17:24:33.896+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ssh-tunnel" /><category scheme="http://www.blogger.com/atom/ns#" term="ssh" /><category scheme="http://www.blogger.com/atom/ns#" term="tunnelling" /><title>ssh forward tunnel</title><content type="html">To make this happen, the command is like below:&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;ssh -L 10022:target.local:22 middle.local&lt;/span&gt;&lt;/pre&gt;where:&lt;br /&gt;-L is for forward tunnel, 10022 is the port at localhost that we want to use, target.local is our target, 22 is the target's port that we want to forward and middle.local is our middleman server.&lt;br /&gt;&lt;br /&gt;What the above command do is forwarding port 22 of target.local to port 10022 of localhost by using middle.local as a middleman. Once done, you can access port 22 of target.local just by SSHing into port 10022 in your localhost like below:&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;ssh localhost -p10022&lt;/span&gt;&lt;/pre&gt;and voila, you will be directed to target.local instead. This technique is useful when you have firewall blocking some ports, and you have server behind the firewall than can access those ports witth openssh installed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-1484339972034416551?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/vvNDxk9SSfw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/1484339972034416551/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=1484339972034416551" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/1484339972034416551?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/1484339972034416551?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/vvNDxk9SSfw/ssh-forward-tunnel.html" title="ssh forward tunnel" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/11/ssh-forward-tunnel.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIFSH4ycSp7ImA9WhdaFU0.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-7770461328887983988</id><published>2011-10-25T09:57:00.003+08:00</published><updated>2011-10-25T10:08:39.099+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-25T10:08:39.099+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="perl modules" /><category scheme="http://www.blogger.com/atom/ns#" term="perl" /><category scheme="http://www.blogger.com/atom/ns#" term="script" /><title>Small script to test perl module</title><content type="html">To test any perl module, just put below lines in a file, make it executable (&lt;span style="color: rgb(255, 0, 0);"&gt;chmod +x&lt;/span&gt;) and run it (&lt;span style="color: rgb(255, 0, 0);"&gt;./&lt;/span&gt;).&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;#!/usr/bin/perl&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;use DBD-Pg;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;print "No errors!\n" &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;where DBD-Pg is example of perl module. This script will return "&lt;span style="color: rgb(51, 204, 0);"&gt;No errors!&lt;/span&gt;" if the module is available. If the module is not installed, an error like "&lt;span style="color: rgb(51, 204, 0);"&gt;Can't locate ....&lt;/span&gt;" will appear instead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-7770461328887983988?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/fgu6yEiGaVI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/7770461328887983988/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=7770461328887983988" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/7770461328887983988?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/7770461328887983988?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/fgu6yEiGaVI/small-script-to-test-perl-module.html" title="Small script to test perl module" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/10/small-script-to-test-perl-module.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8AQnw4fyp7ImA9WhdaFU0.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-7081549851953165537</id><published>2011-10-06T17:06:00.005+08:00</published><updated>2011-10-25T09:57:23.237+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-25T09:57:23.237+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="hard disk" /><category scheme="http://www.blogger.com/atom/ns#" term="LVM" /><title>Extending LVM logical volume</title><content type="html">To extend the lv (logical volume), the command is lvextend. Please check beforehand that you have free disk space to be extended to.&lt;br /&gt;&lt;br /&gt;Check which volume group the partition belongs to:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;df -lh&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Filesystem            Size  Used Avail Use% Mounted on&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;a style="color: rgb(51, 204, 0);" name="bugnotes" id="bugnotes"&gt;/dev/mapper/vg01-db   6.0T  6.0T   20K 100% /var/lib/hwbackup/db&lt;/a&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;lvdisplay vg01&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;--- Logical volume ---&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  LV Name                /dev/vg01/db&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  VG Name                vg01&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  LV UUID                2LvWW6-5TIG-ovrl-GUJt-1y3N-M6ME-3LgtUY&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  LV Write Access        read/write&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  LV Status              available&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  # open                 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  LV Size                5.99 TB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Current LE             1569792&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Segments               5&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Allocation             inherit&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Read ahead sectors     auto&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  - currently set to     4096&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Block device           253:2&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, our lv belongs to vg01&lt;br /&gt;&lt;br /&gt;Now let's check how much space we have for vg01:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;vgdisplay vg01&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Alloc PE / Size       4059648 / 15.49 TB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Free  PE / Size       232788 / 909.33 GB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  VG UUID               iaFnIb-hKjs-q3fQ-yuTy-tKKl-uqSp-EXGyHF&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So we know that it got 909.33 GB unused space.&lt;br /&gt;&lt;br /&gt;Lets do the extension, let's say we want to extend by 300GB. Run a test run first:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;lvextend -t -v -L +300G /dev/mapper/vg01-db&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Test mode: Metadata will NOT be updated.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Finding volume group vg01&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Using stripesize of last segment 512.00 KB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Test mode: Skipping archiving of volume group.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Extending logical volume db to 6.28 TB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Found volume group "vg01"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Found volume group "vg01"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Found volume group "vg01"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Test mode: Skipping volume group backup.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Logical volume db successfully resized&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Test mode: Wiping internal cache&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Wiping internal VG cache&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;[root@hitw-gc-backup-1 ~]# lvextend -v -L +300G /dev/mapper/vg01-db&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Finding volume group vg01&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Using stripesize of last segment 512.00 KB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Archiving volume group "vg01" metadata (seqno 19).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Extending logical volume db to 6.28 TB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Found volume group "vg01"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Found volume group "vg01"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Loading vg01-db table (253:2)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Suspending vg01-db (253:2) with device flush&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Found volume group "vg01"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Resuming vg01-db (253:2)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Creating volume group backup "/etc/lvm/backup/vg01" (seqno 20).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Logical volume db successfully resized&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;where -t is for test mode, -v for verbose and -L is for the size that you want to extend&lt;br /&gt;&lt;br /&gt;If we are OK with the test, proceed to the real extension by removing -t:&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;lvextend -v -L +300G /dev/mapper/vg01-db&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Finding volume group vg01&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Using stripesize of last segment 512.00 KB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Archiving volume group "vg01" metadata (seqno 19).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Extending logical volume db to 6.28 TB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Found volume group "vg01"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Found volume group "vg01"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Loading vg01-db table (253:2)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Suspending vg01-db (253:2) with device flush&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Found volume group "vg01"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Resuming vg01-db (253:2)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;    Creating volume group backup "/etc/lvm/backup/vg01" (seqno 20).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;  Logical volume db successfully resized&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Check your new lv size, it is now being extended by 300GB:&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;lvdisplay /dev/mapper/vg01-db&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt; LV Size                6.28 TB&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To make your filesystem aware of the extension, run resize2fs (for ext3 filesystem). Please unmount the partition beofre you run resize2fs&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;umount &lt;/span&gt;&lt;a name="bugnotes" id="bugnotes"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;/dev/mapper/vg01-db&lt;/span&gt;&lt;br /&gt;&lt;/a&gt;&lt;/pre&gt;&lt;pre&gt;#&lt;a name="bugnotes" id="bugnotes"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="font-family:monospace;"&gt; &lt;/span&gt;resize2fs &lt;/span&gt;&lt;/a&gt;&lt;a name="bugnotes" id="bugnotes"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;/dev/mapper/vg01-db&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;a name="bugnotes" id="bugnotes"&gt;&lt;/a&gt;&lt;a style="color: rgb(51, 51, 51);" name="bugnotes" id="bugnotes"&gt;#&lt;/a&gt;&lt;a name="bugnotes" id="bugnotes"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="font-family:monospace;"&gt; &lt;/span&gt;mount &lt;/span&gt;&lt;/a&gt;&lt;a style="color: rgb(255, 0, 0);" name="bugnotes" id="bugnotes"&gt;/dev/mapper/vg01-db &lt;/a&gt;&lt;a name="bugnotes" id="bugnotes"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;/var/lib/hwbackup/db&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/pre&gt;For xfs, you can resize it on the fly without unmounting it:&lt;br /&gt;&lt;pre&gt;&lt;a name="bugnotes" id="bugnotes"&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;#&lt;/span&gt; &lt;/a&gt;&lt;a style="color: rgb(255, 0, 0);" name="bugnotes" id="bugnotes"&gt;xfs_growfs /var/lib/hwbackup/db&lt;/a&gt;&lt;a name="bugnotes" id="bugnotes"&gt;&lt;span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/pre&gt;&lt;a name="bugnotes" id="bugnotes"&gt;&lt;/a&gt;Now you can enjoy your newly extended lv:&lt;br /&gt;&lt;pre&gt;&lt;a name="bugnotes" id="bugnotes"&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;#&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;df -lh&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Filesystem            Size  Used Avail Use% Mounted on&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;/dev/mapper/vg01-db   6.3T  5.7T  608G  91% /var/lib/hwbackup/db&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-7081549851953165537?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/YtWpPPIgozk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/7081549851953165537/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=7081549851953165537" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/7081549851953165537?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/7081549851953165537?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/YtWpPPIgozk/extending-lvm-logical-volume.html" title="Extending LVM logical volume" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/10/extending-lvm-logical-volume.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkINQn06fip7ImA9WhdUEko.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-4379128504693505710</id><published>2011-09-29T14:36:00.004+08:00</published><updated>2011-09-29T14:43:13.316+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-29T14:43:13.316+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="awk" /><category scheme="http://www.blogger.com/atom/ns#" term="editor" /><category scheme="http://www.blogger.com/atom/ns#" term="tips" /><category scheme="http://www.blogger.com/atom/ns#" term="sed" /><category scheme="http://www.blogger.com/atom/ns#" term="tr" /><title>Replacing space with newline</title><content type="html">There are a few ways to achieve that:&lt;br /&gt;&lt;br /&gt;1. sed&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;echo "one two three" | sed 's/ /\n/g'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;one&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;two&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;three&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;2. awk&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;echo "one two three" | awk '$1=$1' RS= OFS="\n"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;one&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;two&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;three&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;3. tr&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;echo "one two three" | tr -s ' ' '\n'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;one&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;two&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;three&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;3 ways to do it, have fun&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-4379128504693505710?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/1iMHZfAqslE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/4379128504693505710/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=4379128504693505710" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/4379128504693505710?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/4379128504693505710?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/1iMHZfAqslE/replacing-space-with-newline.html" title="Replacing space with newline" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/09/replacing-space-with-newline.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EFRn0_cCp7ImA9WhdUEEQ.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-1144314678953761371</id><published>2011-09-27T10:38:00.004+08:00</published><updated>2011-09-27T10:46:57.348+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-27T10:46:57.348+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="one-liner" /><category scheme="http://www.blogger.com/atom/ns#" term="sed" /><title>Multiple sed expression in one line</title><content type="html">To do multiple sed expression in one line, you can use &lt;span style="color: rgb(255, 0, 0);"&gt;-e&lt;/span&gt; a few times according to your need. For example:&lt;br /&gt;&lt;br /&gt;To subtitute 'little' with 'big' and 'lamb' with 'cow' in "Mary had a little lamb" we can use:&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;echo 'Mary had a little lamb' | sed -e 's/little/big/' -e 's/lamb/cow/'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Mary had a big cow&lt;/span&gt;&lt;/pre&gt;where &lt;span style="color: rgb(255, 0, 0);"&gt;-e&lt;/span&gt; is for expression flag, &lt;span style="color: rgb(255, 0, 0);"&gt;'s/little/big/'&lt;/span&gt; is the first expression and &lt;span style="color: rgb(255, 0, 0);"&gt;'s/lamb/cow/'&lt;/span&gt; is the second expression&lt;br /&gt;&lt;br /&gt;That's all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-1144314678953761371?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/kR6-nR1edgw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/1144314678953761371/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=1144314678953761371" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/1144314678953761371?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/1144314678953761371?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/kR6-nR1edgw/multiple-sed-expression-in-one-line.html" title="Multiple sed expression in one line" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/09/multiple-sed-expression-in-one-line.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAASH0yeyp7ImA9WhdVF0k.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-220615733191416197</id><published>2011-09-23T10:40:00.003+08:00</published><updated>2011-09-23T11:32:29.393+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-23T11:32:29.393+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="http" /><category scheme="http://www.blogger.com/atom/ns#" term="Fedora" /><category scheme="http://www.blogger.com/atom/ns#" term="python" /><category scheme="http://www.blogger.com/atom/ns#" term="Redhat" /><title>Simple http server using python</title><content type="html">This tip is really useful when you need a really quick web server running without too much hassle. Python comes with http server built-in that you can activate in a matter of seconds if you have python already installed. If you haven't install it, you might need an additional few minutes to install it. Below are the steps (this is assuming you are using redhat/fedora linux):&lt;br /&gt;&lt;br /&gt;1. open a terminal and install python&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;yum install python&lt;/span&gt;&lt;/pre&gt;2. Once done, browse to any directory that you want to be your document root directory, in this example I'll use /home/myuser&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;cd /home/myuser&lt;/span&gt;&lt;/pre&gt;3. Run the below command to start the simple http server, where 8000 is the port number the server will use&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;python -m SimpleHTTPServer 8000&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Serving HTTP on 0.0.0.0 port 8000 ...&lt;/span&gt;&lt;/pre&gt;4. Now open a browser, and type &lt;span style="color: rgb(255, 0, 0);"&gt;http://192.168.1.2:8000&lt;/span&gt; to access the server, where 192.168.1.2 is your machine's ip address&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-220615733191416197?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/ZCoErpfgzRg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/220615733191416197/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=220615733191416197" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/220615733191416197?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/220615733191416197?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/ZCoErpfgzRg/simple-http-server-using-python.html" title="Simple http server using python" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/09/simple-http-server-using-python.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEICR3o_eSp7ImA9WhdQE0o.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-3720732204674083379</id><published>2011-08-15T10:38:00.003+08:00</published><updated>2011-08-15T10:49:26.441+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-15T10:49:26.441+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tools" /><category scheme="http://www.blogger.com/atom/ns#" term="download" /><category scheme="http://www.blogger.com/atom/ns#" term="wget" /><category scheme="http://www.blogger.com/atom/ns#" term="apache" /><title>Download apache directory listings recursively</title><content type="html">To apache directory listings recursively, use wget like below:
&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;wget -r -np -nH -R index.html http://filestodownload/&lt;/span&gt;
&lt;br /&gt;&lt;/pre&gt;where &lt;span style="color: rgb(255, 0, 0);"&gt;-r&lt;/span&gt; is for recursive retrieving, &lt;span style="color: rgb(255, 0, 0);"&gt;-np&lt;/span&gt; is for no-parent option where wget won't get the parent directory when retrieving recursively, &lt;span style="color: rgb(255, 0, 0);"&gt;-nH&lt;/span&gt; equals to no host diretories where generation of host-prefixed directories will be disabled and &lt;span style="color: rgb(255, 0, 0);"&gt;-R&lt;/span&gt; is to omit index.html.
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-3720732204674083379?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/Ew6mK0xQOso" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/3720732204674083379/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=3720732204674083379" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/3720732204674083379?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/3720732204674083379?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/Ew6mK0xQOso/download-apache-directory-listings.html" title="Download apache directory listings recursively" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/08/download-apache-directory-listings.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4GRn48cSp7ImA9WhdRFU4.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-5085232153721265676</id><published>2011-08-05T15:42:00.002+08:00</published><updated>2011-08-05T15:55:27.079+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-05T15:55:27.079+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="archive" /><category scheme="http://www.blogger.com/atom/ns#" term="RPM" /><title>Extract rpm without installing</title><content type="html">Run below command:&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;rpm2cpio packagename.rpm | cpio -idmv&lt;/span&gt; &lt;/pre&gt;where &lt;span style="color: rgb(255, 0, 0);"&gt;rpm2cpio&lt;/span&gt; will change rpm file to cpio, &lt;span style="color: rgb(255, 0, 0);"&gt;-i&lt;/span&gt; is for extract, &lt;span style="color: rgb(255, 0, 0);"&gt;-d&lt;/span&gt; is to create leading directories where needed, &lt;span style="color: rgb(255, 0, 0);"&gt;-m&lt;/span&gt; is to preserve modification time and &lt;span style="color: rgb(255, 0, 0);"&gt;-v&lt;/span&gt; is for verbose mode.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-5085232153721265676?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/HDD7rz9O7AU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/5085232153721265676/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=5085232153721265676" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/5085232153721265676?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/5085232153721265676?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/HDD7rz9O7AU/extract-rpm-without-installing.html" title="Extract rpm without installing" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/08/extract-rpm-without-installing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UHRXY8eCp7ImA9WhdSGE4.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-8430621991872798418</id><published>2011-07-28T15:32:00.003+08:00</published><updated>2011-07-28T15:47:14.870+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-28T15:47:14.870+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="split" /><category scheme="http://www.blogger.com/atom/ns#" term="dd" /><category scheme="http://www.blogger.com/atom/ns#" term="file" /><title>Creating a lot of same sized files</title><content type="html">Let's say you need to create 10 files with 100kB size. All you need to do is create a 1MB files and split it into 10 files.&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;dd if=/dev/zero of=myfile bs=1024 count=1024&lt;/span&gt;&lt;br /&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;ls -lh&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 1.0M Jul 28 15:33 myfile&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;where if is input file, of is output file, bs is byte size and count is the multipler of bs&lt;br /&gt;&lt;br /&gt;and then&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;split -b 100k myfile x&lt;/span&gt;&lt;br /&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;ls -lh&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 100K Jul 28 15:35 xaa&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 100K Jul 28 15:35 xab&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 100K Jul 28 15:35 xac&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 100K Jul 28 15:35 xad&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 100K Jul 28 15:35 xae&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 100K Jul 28 15:35 xaf&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 100K Jul 28 15:35 xag&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 100K Jul 28 15:35 xah&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 100K Jul 28 15:35 xai&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner 100K Jul 28 15:35 xaj&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;-rw-rw-r--. 1 owner owner  24K Jul 28 15:35 xak&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;where -b is byte size, myfile is your file input name and x is your prefix.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-8430621991872798418?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/dcHF8u3RjZg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/8430621991872798418/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=8430621991872798418" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/8430621991872798418?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/8430621991872798418?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/dcHF8u3RjZg/creating-lot-of-same-sized-files.html" title="Creating a lot of same sized files" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/07/creating-lot-of-same-sized-files.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQGSX8zcCp7ImA9WhZbEE8.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-419148682804265738</id><published>2011-06-14T11:23:00.005+08:00</published><updated>2011-06-14T11:32:08.188+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-14T11:32:08.188+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="TimeDate" /><title>Convert time to unix timestamp and vice versa</title><content type="html">To convert current time to unix timestamp&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;date +%s&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;1308021863&lt;/span&gt;&lt;/pre&gt;where &lt;span style="color: rgb(255, 0, 0);"&gt;%s&lt;/span&gt; is seconds since 1970-01-01 00:00:00 UTC&lt;br /&gt;&lt;br /&gt;To convert a unix timestamp to a readable time/date&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;date -d @1308021863&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Mon Jun 13 22:24:23 CDT 2011&lt;/span&gt;&lt;/pre&gt;where &lt;span style="color: rgb(255, 0, 0);"&gt;-d&lt;/span&gt; is for displaying time described by the string after @&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-419148682804265738?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/EixHKTOf1AY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/419148682804265738/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=419148682804265738" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/419148682804265738?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/419148682804265738?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/EixHKTOf1AY/convert-time-to-unix-timestamp-and-vice.html" title="Convert time to unix timestamp and vice versa" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/06/convert-time-to-unix-timestamp-and-vice.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUCRXg9fSp7ImA9WhZVE0w.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-3116800164188022151</id><published>2011-05-25T17:13:00.004+08:00</published><updated>2011-05-25T17:37:44.665+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-25T17:37:44.665+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Fedora" /><category scheme="http://www.blogger.com/atom/ns#" term="OpenOffice" /><title>Install Al-Quran extension in openoffice</title><content type="html">This was done in Fedora 13 with openoffice 3.2.0. Please follow below steps to install it:&lt;br /&gt;&lt;br /&gt;1. Download the installation files&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;wget&lt;/span&gt; &lt;a href="http://www.blogger.com/wget%20http://qioo.googlecode.com/files/QiOO-0.4b.zip"&gt;http://qioo.googlecode.com/files/QiOO-0.4b.zip&lt;/a&gt;&lt;/pre&gt;&lt;br /&gt;2. Extract it to somewhere&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;unzip QiOO-0.4b.zip&lt;/span&gt;&lt;br /&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;ls QiOO-0.4b&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;CHANGELOG  QiOO-0.4b.oxt  README.txt  ScheherazadeRegOT.ttf&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;3. Copy ScheherazadeRegOT.ttf to /usr/share/fonts&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;sudo mkdir /usr/share/fonts/ScheherazadeRegOT; sudo cp -apv QiOO-0.4b/ScheherazadeRegOT.ttf /usr/share/fonts/ScheherazadeRegOT&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;4. Install the extension by opening openoffice writer and go to &lt;span style="color: rgb(255, 0, 0);"&gt;Tools &amp;gt; Extension Manager &amp;gt; Add&lt;/span&gt;, and search for the QiOO-0.4b.oxt plugin.&lt;br /&gt;&lt;br /&gt;5. Activate CTL by going to&lt;span style="color: rgb(255, 0, 0);"&gt; Tools &amp;gt; Option &amp;gt; Language Settings &amp;gt; Languages &amp;gt; Enable For CTL(Complex Text Layout)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;6. If all went well, you can see AlQuran menu in your openoffice writer's menubar like below.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-RHcMgF2QQUs/TdzNp9huvNI/AAAAAAAAAG4/rI6D6c-FLGQ/s1600/Screenshot-5.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 74px;" src="http://4.bp.blogspot.com/-RHcMgF2QQUs/TdzNp9huvNI/AAAAAAAAAG4/rI6D6c-FLGQ/s320/Screenshot-5.png" alt="" id="BLOGGER_PHOTO_ID_5610585356571163858" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That's all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-3116800164188022151?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/7AlYd1ZwvZM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/3116800164188022151/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=3116800164188022151" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/3116800164188022151?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/3116800164188022151?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/7AlYd1ZwvZM/install-al-quran-in-openoffice.html" title="Install Al-Quran extension in openoffice" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-RHcMgF2QQUs/TdzNp9huvNI/AAAAAAAAAG4/rI6D6c-FLGQ/s72-c/Screenshot-5.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/05/install-al-quran-in-openoffice.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8FQ3kyfCp7ImA9WhZWGEU.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-5417207773816863105</id><published>2011-05-20T16:44:00.010+08:00</published><updated>2011-05-20T17:30:12.794+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-20T17:30:12.794+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="virtualization" /><category scheme="http://www.blogger.com/atom/ns#" term="vmware" /><title>Cloning virtual machine on vmware esx using vmware-cmd</title><content type="html">Below are the steps:&lt;br /&gt;&lt;br /&gt;1. List down all the virtual machines that you have&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;/usr/bin/vmware-cmd -l&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;/vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/server-1/server-1.vmx&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;/vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/server-2/server-2.vmx&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;/vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/server-3/server-3.vmx&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;2. Shutdown the machine that you are going to clone. Let say the machine is server-1&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;/usr/bin/vmware-cmd /vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/server-1/server-1.vmx stop&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;3. Use hard stop if you cannot stop it using above command&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;/usr/bin/vmware-cmd /vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/server-1/server-1.vmx stop hard&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;4. Make sure the vm is shutdown by viewing the state&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;/usr/bin/vmware-cmd /vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/server-1/server-1.vmx getstate&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;5. Copy the whole directory&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;cp /vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/server-1/ /vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/newserver/&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;6. Once done, rename all the files to new name&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;rename server-1 newserver /vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/newserver/*&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;7. Change all occurrence of "server-1" to "newserver" in .vmx, .vmdk and .vmxf&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;cd /vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/newserver/&lt;/span&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;sed -i 's/server-1/newserver/g' {newserver.vmdk,newserver.vmx,newserver.vmxf}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;8. Edit newserver.vmx file and remove below lines&lt;br /&gt;&lt;pre style="color: rgb(0, 0, 153);"&gt;ethernet0.generatedAddress = "....."&lt;br /&gt;ethernet0.generatedAddressOffset = "....."&lt;br /&gt;uuid.location = "....."&lt;br /&gt;uuid.bios = "....."&lt;/pre&gt;&lt;br /&gt;9. Add below line to newserver.vmx&lt;br /&gt;&lt;pre style="color: rgb(0, 0, 153);"&gt;uuid.action = "keep"&lt;/pre&gt;&lt;br /&gt;10. Register your newly cloned virtual machine. Please use the full path to register as below&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;vmware-cmd -s register /vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/newserver/newserver.vmx&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;11. Start your new vm after registration.&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;/usr/bin/vmware-cmd /vmfs/volumes/47971de9-34657d96-8ac4-001d09068c0c/newserver/newserver.vmx start&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-5417207773816863105?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/7Es8B37ncmY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/5417207773816863105/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=5417207773816863105" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/5417207773816863105?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/5417207773816863105?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/7Es8B37ncmY/cloning-virtual-machine-on-vmware-esx.html" title="Cloning virtual machine on vmware esx using vmware-cmd" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/05/cloning-virtual-machine-on-vmware-esx.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMHQn08fip7ImA9Wx9VF0Q.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-4976163048845770139</id><published>2011-02-04T11:56:00.003+08:00</published><updated>2011-02-04T12:23:53.376+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-04T12:23:53.376+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="editor" /><category scheme="http://www.blogger.com/atom/ns#" term="vi. vim" /><title>vim comment lines</title><content type="html">In linux, while editing configuration files, we always used # sign for comments. How do we do it to multiple lines in vi easily?&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;br /&gt;1. Edit the files using vi&lt;br /&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;vi files.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2. set line number in vi (for us to easily determine what is the line number that we want to edit)&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;:se nu&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3. replace start of lines with # (for example, put # sign in front of line 2 to line 5). The meaning of below command is for line 2 - 5, subtitute (s) start of line (^) with # sign, and press enter&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;:2,5s/^/#/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&amp;lt;enter&amp;gt;&lt;/enter&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4. It is done. Save your file (w) and quit (q)&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;:wq&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-4976163048845770139?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/fCRGJAZzVXo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/4976163048845770139/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=4976163048845770139" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/4976163048845770139?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/4976163048845770139?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/fCRGJAZzVXo/vim-comment-lines.html" title="vim comment lines" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2011/02/vim-comment-lines.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ABRn48cSp7ImA9Wx9SF0U.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-1800661962103131729</id><published>2010-12-02T09:45:00.003+08:00</published><updated>2010-12-08T12:15:57.079+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-08T12:15:57.079+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Fedora" /><category scheme="http://www.blogger.com/atom/ns#" term="Redhat" /><category scheme="http://www.blogger.com/atom/ns#" term="yum" /><title>yum plugin to remove dependencies</title><content type="html">You can remove dependencies using yum-plugin-remove-with-leaves plug-in.&lt;br /&gt;&lt;br /&gt;To install:&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;yum install yum-plugin-remove-with-leaves&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;To use:&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;yum remove --remove-leaves &amp;lt;package-name&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;That's all folks :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-1800661962103131729?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/SUz0OYwWsAY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/1800661962103131729/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=1800661962103131729" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/1800661962103131729?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/1800661962103131729?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/SUz0OYwWsAY/yum-plugin-to-remove-dependencies.html" title="yum plugin to remove dependencies" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2010/12/yum-plugin-to-remove-dependencies.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQNRnw7eyp7ImA9Wx9SGUk.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-6435084118056332213</id><published>2010-11-26T06:18:00.006+08:00</published><updated>2010-12-10T09:09:57.203+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-10T09:09:57.203+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="vi" /><category scheme="http://www.blogger.com/atom/ns#" term="vim" /><title>Using markers in vi/vim</title><content type="html">This feature is useful if for example we want to delete a few lines or characters but we are too lazy to count the lines or characters to use dd or dw command. We can set up to 26 marker using lowercase a-z as the marker's name. The main usage of marker is to mark any location in file.&lt;br /&gt;&lt;br /&gt;How to use (we put 'a' as the marker's name):&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;ma&lt;/span&gt; - mark current cursor position as marker named 'a'&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;`a&lt;/span&gt; (backquote a) - move to character marked as 'a'&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;'a&lt;/span&gt; (quote a) - move to first non blank character (line) containing marker 'a'&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;``&lt;/span&gt; (backquote backquote) - move to last operated marker or toggles with last cursor position, if no marker is set, cursor moves to beginning of file (BOF)&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;''&lt;/span&gt; (quote quote) - move to beginning og line (BOL) operated marker or toggles with BOL of last cursor position, if no marker is set, cursor moves to BOF&lt;br /&gt;&lt;br /&gt;Example on using marker:&lt;br /&gt;&lt;br /&gt;If you want to indent 5 lines starting from current line: &lt;span style="color: rgb(255, 0, 0);"&gt;majjjjj&gt;'a&lt;/span&gt;&lt;br /&gt;If you want to delete five words using marker: &lt;span style="color: rgb(255, 0, 0);"&gt;mawwwwwmb`ad`b&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;That's all friends :)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-6435084118056332213?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/oaPnC9xbVUQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/6435084118056332213/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=6435084118056332213" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/6435084118056332213?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/6435084118056332213?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/oaPnC9xbVUQ/using-markers-in-vivim.html" title="Using markers in vi/vim" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2010/11/using-markers-in-vivim.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4MSHw4eSp7ImA9Wx5aFk0.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-6514577207875688068</id><published>2010-11-13T07:23:00.005+08:00</published><updated>2010-11-13T07:36:29.231+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-13T07:36:29.231+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="gnome mainmenu package hack" /><title>Edit main menu in fedora</title><content type="html">Starting from fedora 12, I found out that I cannot edit my main menu anymore. This is kind of frustrating since I installed many custom applications, and I would like it to be easily accessible from the main menu. After searching around, i found out that one package is not included in fedora 12 livecd. The package is called alacarte.&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;rpm -qi alacarte&lt;/span&gt;&lt;br /&gt;Name        : alacarte                     Relocations: (not relocatable)&lt;br /&gt;Version     : 0.12.4                            Vendor: Fedora Project&lt;br /&gt;Release     : 1.fc12                        Build Date: Tue 22 Sep 2009 08:41:26 AM MYT&lt;br /&gt;Install Date: Sat 13 Nov 2010 07:17:32 AM MYT      Build Host: xenbuilder4.fedora.phx.redhat.com&lt;br /&gt;Group       : Applications/System           Source RPM: alacarte-0.12.4-1.fc12.src.rpm&lt;br /&gt;Size        : 367423                           License: LGPLv2+&lt;br /&gt;Signature   : RSA/8, Thu 01 Oct 2009 03:42:28 AM MYT, Key ID 9d1cc34857bbccba&lt;br /&gt;Packager    : Fedora Project&lt;br /&gt;URL         : http://www.gnome.org&lt;br /&gt;Summary     : Menu editor for the GNOME desktop&lt;br /&gt;Description :&lt;br /&gt;Alacarte is a graphical menu editor that lets you edit, add, and delete&lt;br /&gt;menu entries. It follows the freedesktop.org menu specification and&lt;br /&gt;should work with any desktop environment that uses this specification.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, just install the alacarte package using yum, and select "System -&gt; Preferences -&gt; Main Menu", and you can now edit your main menu.&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;yum install alacarte -y&lt;/span&gt;&lt;/pre&gt;That's all folks&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-6514577207875688068?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/uLiMozSsc0M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/6514577207875688068/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=6514577207875688068" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/6514577207875688068?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/6514577207875688068?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/uLiMozSsc0M/edit-main-menu-in-fedora.html" title="Edit main menu in fedora" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2010/11/edit-main-menu-in-fedora.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMDQXk_fSp7ImA9Wx9XEUQ.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-4979964904950900028</id><published>2010-10-26T11:02:00.006+08:00</published><updated>2011-01-05T11:01:10.745+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-05T11:01:10.745+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="TimeDate" /><category scheme="http://www.blogger.com/atom/ns#" term="virtualization" /><category scheme="http://www.blogger.com/atom/ns#" term="xen" /><title>Xen's domU always depend on dom0's time and date</title><content type="html">By default, the time and date in domU is following dom0. To reset that, below are just what you have to do to decouple the domU's date from dom0&lt;br /&gt;&lt;br /&gt;On dom0:&lt;br /&gt;&lt;br /&gt;Append xen.independent_wallclock=1 to /etc/sysctl.conf &lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;echo "xen.independent_wallclock=1"  &gt;&gt; /etc/sysctl.conf&lt;/span&gt;&lt;/pre&gt;Activate the change&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;sysctl -p&lt;/span&gt;&lt;/pre&gt;Append extra="clocksource=jiffies" to the domU's configuration file.&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;echo "extra=\"clocksource=jiffies\"" &gt;&gt; /etc/xen/&amp;lt;domU's name&amp;gt;&lt;domu's&gt;.cfg &lt;/domu's&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;On domU:&lt;br /&gt;&lt;br /&gt;Append xen.independent_wallclock=1&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;echo "xen.independent_wallclock=1"  &gt;&gt; /etc/sysctl.conf &lt;/span&gt;&lt;/pre&gt;Activate the change&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;sysctl -p &lt;/span&gt;&lt;/pre&gt;Append jiffies to /sys/devices/system/clocksource/clocksource0/current_clocksource&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;echo "jiffies" &gt;&gt; /sys/devices/system/clocksource/clocksource0/current_clocksource&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Now you can set your domU's date using "date" command or "ntpdate" to get update from ntp servers.&lt;br /&gt;&lt;br /&gt;That's all folks&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-4979964904950900028?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/G2wDRnnavvQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/4979964904950900028/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=4979964904950900028" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/4979964904950900028?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/4979964904950900028?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/G2wDRnnavvQ/xens-domu-always-depend-on-dom0s-time.html" title="Xen's domU always depend on dom0's time and date" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2010/10/xens-domu-always-depend-on-dom0s-time.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MBSHk7eCp7ImA9Wx5UEUw.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-2662296559817497533</id><published>2010-10-15T11:51:00.006+08:00</published><updated>2010-10-15T12:04:19.700+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-15T12:04:19.700+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="firefox" /><category scheme="http://www.blogger.com/atom/ns#" term="ssh" /><category scheme="http://www.blogger.com/atom/ns#" term="internet" /><category scheme="http://www.blogger.com/atom/ns#" term="proxy" /><category scheme="http://www.blogger.com/atom/ns#" term="browser" /><title>Using ssh as proxy</title><content type="html">To create ssh tunnel is very easy. Let's say  you want to use machine1.example.com as your ssh proxy, your username is foo and you choose port 8080 on your localhost to be your local proxy port. Type below command on your localhost:&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;ssh -D 8080 foo@machine1.example.com&lt;/span&gt;&lt;/pre&gt;Once connected, set your browser to use Socks5 proxy on port 8080 on your local machine. For firefox, the setting is "&lt;span style="color: rgb(0, 0, 153);"&gt;Tools -&gt; Options -&gt; Advanced -&gt; Network -&gt; Settings -&gt; Manual proxy configuration&lt;/span&gt;" and follow below picture for the proxy setting. Just make sure to keep the ssh connection connected to reap the ssh proxy benefits :)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_7fF0k-ob7JM/TLfRdGx5TwI/AAAAAAAAAGo/_7-ejZnRNlo/s1600/socks+5+proxy.png"&gt;&lt;img style="cursor: pointer; width: 292px; height: 320px;" src="http://3.bp.blogspot.com/_7fF0k-ob7JM/TLfRdGx5TwI/AAAAAAAAAGo/_7-ejZnRNlo/s320/socks+5+proxy.png" alt="" id="BLOGGER_PHOTO_ID_5528117365586874114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That's all :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-2662296559817497533?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/cnxYsXFkqck" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/2662296559817497533/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=2662296559817497533" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/2662296559817497533?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/2662296559817497533?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/cnxYsXFkqck/using-ssh-as-proxy.html" title="Using ssh as proxy" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_7fF0k-ob7JM/TLfRdGx5TwI/AAAAAAAAAGo/_7-ejZnRNlo/s72-c/socks+5+proxy.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2010/10/using-ssh-as-proxy.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08FSXY6eip7ImA9Wx5UEU0.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-1801380484737616608</id><published>2010-10-15T10:19:00.003+08:00</published><updated>2010-10-15T10:30:18.812+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-15T10:30:18.812+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><category scheme="http://www.blogger.com/atom/ns#" term="cygwin" /><title>Cygwin man search problem</title><content type="html">If you are a windows user, and you use cygwin, there is a problem with man page.  The search function is a bit weird, where it cannot find something like "-D" in ssh man page. To overcome this, you have to set the LANG environment variable to c. To do this, just add &lt;span style="color: rgb(0, 0, 153);"&gt;export LANG=c&lt;/span&gt; to your .bashrc:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ &lt;span style="color: rgb(255, 0, 0);"&gt;echo "export LANG=c" &gt;&gt; .bashrc&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;That's all folks :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-1801380484737616608?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/7IxZB8Tmn7w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/1801380484737616608/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=1801380484737616608" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/1801380484737616608?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/1801380484737616608?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/7IxZB8Tmn7w/cygwin-man-search-problem.html" title="Cygwin man search problem" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2010/10/cygwin-man-search-problem.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMARnw6fyp7ImA9Wx5UEE8.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-8095098226290013441</id><published>2010-10-07T14:32:00.005+08:00</published><updated>2010-10-14T10:30:47.217+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-14T10:30:47.217+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="user management" /><title>Forcing user to change password the first time they log in</title><content type="html">If you are creating new user in your machine, and you would like them to change password the first time they login, using command &lt;span style="font-weight: bold;"&gt;chage&lt;/span&gt; is the way. Let's say our user is foo.&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;chage -d 0 foo&lt;/span&gt;&lt;/pre&gt;where -d is for lastday. When we set it to 0, it will ask for password change the first time foo logs in.&lt;br /&gt;&lt;br /&gt;That's all folks :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-8095098226290013441?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/8q4nqaEZ3Fs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/8095098226290013441/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=8095098226290013441" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/8095098226290013441?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/8095098226290013441?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/8q4nqaEZ3Fs/forcing-user-to-change-password-first.html" title="Forcing user to change password the first time they log in" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2010/10/forcing-user-to-change-password-first.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYBQnw_eSp7ImA9Wx5SFU0.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-445156512512833907</id><published>2010-08-11T12:38:00.004+08:00</published><updated>2010-08-11T13:05:53.241+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-11T13:05:53.241+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="fastcgi" /><category scheme="http://www.blogger.com/atom/ns#" term="apache" /><category scheme="http://www.blogger.com/atom/ns#" term="Centos" /><title>Installing apache mod_fastcgi(fastcgi module) on CentOS 5</title><content type="html">In the &lt;a href="http://linuxwave.blogspot.com/2010/08/installing-apache-fastcgi.html"&gt;previous post&lt;/a&gt;, I have written about installing apache mod_fcgid module to enable fastcgi support on apache. This time, I will write on how to install mod_fastcgi module to enable fastcgi module on apache installed on CentOS 5. Since by the time of this writing, there is no rpm for apache mod_fastcgi, we have to compile the mod_fastcgi module.&lt;br /&gt;&lt;br /&gt;1. Install requirements for compilation&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;yum install httpd-devel apr apr-devel libtool&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;2. Download latest mod_fastcgi source code&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;cd /opt&lt;/span&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;wget &lt;/span&gt;&lt;a href="http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz"&gt;http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz&lt;/a&gt;&lt;/pre&gt;&lt;br /&gt;3. Untar the package.&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;tar -xvzf mod_fastcgi-current.tar.gz&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;4. Install the module. You can find the installation guide on the INSTALL.AP2 file. We have to specify top_dir in the make and make install commands because we install apache2/httpd using yum&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;cd mod_fastcgi-2.4.6&lt;/span&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;cp Makefile.AP2 Makefile&lt;/span&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;make top_dir=/usr/lib/httpd&lt;/span&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;make install top_dir=/usr/lib/httpd&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;5. Add "&lt;span style="color: rgb(0, 0, 102);"&gt;LoadModule fastcgi_module modules/mod_fastcgi.so&lt;/span&gt;" to /etc/httpd/conf/httpd.conf to tell apache to load the new module&lt;br /&gt;&lt;br /&gt;6. Restart apache&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;/etc/init.d/httpd restart&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;7. You can assure that the mod is loaded by apache2, by looking at /var/log/httpd/error_log&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;grep -i "FastCGI" /var/log/httpd/error_log &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;&lt;br /&gt;[Wed Aug 11 12:26:27 2010] [notice] FastCGI: process manager initialized (pid 8853)&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;That's all :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-445156512512833907?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/WbUfxJvVS0Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/445156512512833907/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=445156512512833907" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/445156512512833907?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/445156512512833907?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/WbUfxJvVS0Y/installing-apache-modfastcgifastcgi.html" title="Installing apache mod_fastcgi(fastcgi module) on CentOS 5" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2010/08/installing-apache-modfastcgifastcgi.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QER3g5fCp7ImA9Wx9RE0o.&quot;"><id>tag:blogger.com,1999:blog-2150109385261698170.post-4869255958837464611</id><published>2010-08-11T10:16:00.009+08:00</published><updated>2010-12-15T09:08:26.624+08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-15T09:08:26.624+08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="fastcgi" /><category scheme="http://www.blogger.com/atom/ns#" term="apache" /><category scheme="http://www.blogger.com/atom/ns#" term="Centos" /><title>Installing apache mod_fcgid(fastcgi module) on CentOS 5</title><content type="html">For apache to support FastCGI, you have to install either mod_fastcgi or mod_fcgid. In this example, I will show how to install mod_fcgid on existing apache webserver on centos 5.&lt;br /&gt;&lt;br /&gt;First of all, the rpm is available at kbsingh's centos testing repository.To install kbsingh's centos repository:&lt;br /&gt;&lt;br /&gt;1. Download kbsingh-CentOS-Extras.repo to /etc/yum.repos.d/&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;cd /etc/yum.repos.d&lt;/span&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;wge&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(255, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:'Times New Roman';font-size:medium;"  &gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-style: italic; line-height: 13px;font-family:'Courier New',Courier,mono;font-size:12px;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;t&lt;/span&gt; &lt;a href="http://centos.karan.org/kbsingh-CentOS-Extras.repo"&gt;http://centos.karan.org/kbsingh-CentOS-Extras.repo&lt;/a&gt;&lt;/pre&gt;&lt;br /&gt;2. Enable karansingh's testing repo by setting gpgcheck to 0 and enabled to 1 in the [kbs-CentOS-Testing]&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:'Times New Roman';font-size:medium;"  &gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; line-height: 18px;font-family:verdana,sans-serif;font-size:12px;"  &gt;&lt;span class="system" style="margin: 0px; padding: 0px; font-style: italic;font-family:'Courier New',Courier,mono;font-size:12px;color:black;"   &gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;sed -i "s/enabled=0/enabled=1/g" /etc/yum.repos.d/kbsingh-CentOS-Extras.repo&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;3. Install mod_fcgid&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;yum install mod_fcgid&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;4. Restart apache, and verify whether fcgid_module is available by using the second command below&lt;br /&gt;&lt;pre&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;/etc/init.d/httpd restart&lt;/span&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;httpd -t -D DUMP_MODULES&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;5. If the module is still not loaded, add "&lt;span style="color: rgb(0, 0, 153);"&gt;LoadModule fcgid_module modules/mod_fcgid.so&lt;/span&gt;" to your /etc/httpd/conf/httpd.conf, and restart apache.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That's all :)&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:'Times New Roman';font-size:medium;"  &gt;&lt;span class="Apple-style-span" style="color: rgb(17, 17, 17); line-height: 22px;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;font-size:14px;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2150109385261698170-4869255958837464611?l=linuxwave.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Linuxwave/~4/vux4pHiBUpg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://linuxwave.blogspot.com/feeds/4869255958837464611/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2150109385261698170&amp;postID=4869255958837464611" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/4869255958837464611?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2150109385261698170/posts/default/4869255958837464611?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Linuxwave/~3/vux4pHiBUpg/installing-apache-fastcgi.html" title="Installing apache mod_fcgid(fastcgi module) on CentOS 5" /><author><name>blackorga</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://linuxwave.blogspot.com/2010/08/installing-apache-fastcgi.html</feedburner:origLink></entry></feed>

