<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4280792773714639752</atom:id><lastBuildDate>Sat, 07 Sep 2024 22:02:39 +0000</lastBuildDate><category>howto</category><category>script</category><category>MySQL</category><category>wallpaper</category><category>ftp</category><category>ssh</category><category>ubuntu</category><category>apache</category><category>ext3</category><category>monitor</category><category>nagios</category><category>GPartEd</category><category>Heartbeat</category><category>NFS</category><category>NRPE</category><category>XAMPP</category><category>fileMonitor</category><category>format</category><category>group</category><category>grub</category><category>haproxy</category><category>history</category><category>load balancer</category><category>network</category><category>php</category><category>ram</category><category>rsync</category><category>sort</category><category>sudo</category><category>swap</category><category>twitter</category><category>uid</category><category>uniq</category><category>user</category><title>crzyORC - Linux</title><description>Linux for IT and more</description><link>http://crzyorc-linux.blogspot.com/</link><managingEditor>noreply@blogger.com (crzyOrc@)</managingEditor><generator>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-195313775040030524</guid><pubDate>Sun, 05 Dec 2010 13:15:00 +0000</pubDate><atom:updated>2010-12-05T15:16:34.531+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ext3</category><category domain="http://www.blogger.com/atom/ns#">format</category><category domain="http://www.blogger.com/atom/ns#">howto</category><title>How To Format Disk in linux</title><description>In the previous post we discussed how to re-size disk space,&lt;br /&gt;
Now lest say you want to add additional disk to your machine.&lt;br /&gt;
&lt;br /&gt;
Follow the commands:&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;step 1 -&amp;nbsp; Partition&lt;/b&gt;&lt;br /&gt;
&lt;i style=&quot;color: #b45f06;&quot;&gt;# fdisk -l | grep Disk&lt;/i&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;Disk /dev/sda: 549.7 GB, 549755813888 bytes
Disk /dev/sdb: 107.3 GB, 107374182400 bytes 
&lt;/pre&gt;&lt;br /&gt;
you&#39;ll see the disks on your machine, we want to partition the new disk /dev/sdb&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;br /&gt;
&lt;i&gt;# fdisk /dev/sdb&lt;/i&gt;&lt;/div&gt;&lt;b&gt;n&lt;/b&gt; - add new partition - follow the instruction &lt;br /&gt;
&lt;b&gt;p&lt;/b&gt; - print the partition table - check the partition&lt;br /&gt;
&lt;b&gt;w&lt;/b&gt; - write table to disk and exit&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;step 2 - Format&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;code&gt;&lt;/code&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;code&gt;#&amp;nbsp;&lt;/code&gt;mkfs.ext3 /dev/sdb1&lt;/i&gt;&lt;i&gt;&lt;code&gt; &lt;/code&gt;&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;&lt;code&gt;step 3 - Mount &lt;/code&gt;&lt;/b&gt;&lt;br /&gt;
&lt;i style=&quot;color: #b45f06;&quot;&gt;# mkdir /New-Disk&lt;/i&gt;&lt;br /&gt;
&lt;i style=&quot;color: #b45f06;&quot;&gt;# mount /dev/sdb1 /New-Disk &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;step 4 - Update /etc/fstab&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;code&gt;# &lt;/code&gt;&lt;/i&gt;&lt;i style=&quot;color: #b45f06;&quot;&gt;vi /etc/fstab &lt;/i&gt;&lt;/div&gt;add the next line to the file:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;/dev/sdb1     /New-Disk     ext3     defaults     1 2
&lt;/pre&gt;Save and close the file.&lt;br /&gt;
&lt;br /&gt;
Now check the changes:&lt;br /&gt;
&lt;i style=&quot;color: #b45f06;&quot;&gt;# df -h&lt;/i&gt;</description><link>http://crzyorc-linux.blogspot.com/2010/12/how-to-format-disk-in-linux.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-6659493393571365114</guid><pubDate>Tue, 02 Nov 2010 11:23:00 +0000</pubDate><atom:updated>2010-11-02T13:23:09.934+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">history</category><category domain="http://www.blogger.com/atom/ns#">howto</category><title>How To display Timestamp in History command</title><description>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
By default, the &lt;i&gt;history&lt;/i&gt; command shows just the command number and the command.&lt;br /&gt;
it could be very useful to add a timestamp to be shown, this can help you to monitor things by the time you run something.&lt;br /&gt;
&lt;br /&gt;
To add the timestamp you need to export the next command:&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;# &amp;nbsp;export HISTTIMEFORMAT=&#39;%F %T &#39;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
if you want, you can add this line to your profile, so next you boot your machine, it will run automatic:&lt;br /&gt;
just edit &lt;i&gt;/etc/profile&lt;/i&gt; &amp;nbsp;and add the line above.&lt;br /&gt;
&lt;br /&gt;
Best Regards</description><link>http://crzyorc-linux.blogspot.com/2010/11/how-to-display-timestamp-in-history.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-3075727579223321093</guid><pubDate>Mon, 01 Nov 2010 15:13:00 +0000</pubDate><atom:updated>2010-11-01T17:17:24.777+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ext3</category><category domain="http://www.blogger.com/atom/ns#">GPartEd</category><category domain="http://www.blogger.com/atom/ns#">howto</category><title>How to resize ext3 partition - GPartEd</title><description>Hi, couple of days ago was asked to increase ext3 partition without LVM.&lt;br /&gt;
After searching the web I found a cool Linux Live CD called &lt;a href=&quot;http://gparted.sourceforge.net/&quot;&gt;GPatrEd&lt;/a&gt;.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/_XmKe6WzPzf0/TM7WxLc0nwI/AAAAAAAAA6c/tOS4kbxH4gI/s1600/gparted.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://1.bp.blogspot.com/_XmKe6WzPzf0/TM7WxLc0nwI/AAAAAAAAA6c/tOS4kbxH4gI/s200/gparted.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;because&amp;nbsp;it has just one partition &amp;nbsp;&quot; &lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;/dav/sda1 on / &lt;/span&gt;&lt;/i&gt;&quot; &amp;nbsp;i could not unmount it the resize it with the new space.&lt;br /&gt;
I was had to used a live CD.&lt;br /&gt;
I&#39;m talking about virtual machine, so first I increased the disk space of the virtual machine&lt;br /&gt;
then I restart and boot from GPartEd live CD.&lt;br /&gt;
The UI is very simple and fun a&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; white-space: nowrap;&quot;&gt;ctually,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; white-space: nowrap;&quot;&gt;all you need to do is to resize the partition with the mouse the click APPLY.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; white-space: nowrap;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_XmKe6WzPzf0/TM7XGVM7__I/AAAAAAAAA6g/V8NwKcNoBG8/s1600/image003.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;http://4.bp.blogspot.com/_XmKe6WzPzf0/TM7XGVM7__I/AAAAAAAAA6g/V8NwKcNoBG8/s320/image003.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; white-space: nowrap;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; white-space: nowrap;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; white-space: nowrap;&quot;&gt;After finishing, I restart the machine again and WALLA I had new partition space on my server.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; white-space: nowrap;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; white-space: nowrap;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; white-space: nowrap;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; white-space: nowrap;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;</description><link>http://crzyorc-linux.blogspot.com/2010/11/how-to-resize-ext3-partition-gparted.html</link><author>noreply@blogger.com (crzyOrc@)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_XmKe6WzPzf0/TM7WxLc0nwI/AAAAAAAAA6c/tOS4kbxH4gI/s72-c/gparted.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-3684382938969109205</guid><pubDate>Mon, 11 Oct 2010 15:27:00 +0000</pubDate><atom:updated>2010-10-13T17:18:09.968+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">haproxy</category><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">load balancer</category><title>How To install Load Balancer with HAProxy on Debian</title><description>Hi, today I want to discuss on how to install a LB for web servers base on http (linux or windows) on debian.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Installation:&lt;/b&gt;&lt;br /&gt;
First we need to add the source of the installation to &lt;i&gt;sources.list&lt;/i&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;b&gt;# &lt;/b&gt;vi /etc/apt/sources.list&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; 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;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: &#39;Courier New&#39;,Courier,mono; font-size: 12px; line-height: 13px;&quot;&gt;and add the following lines:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;deb http://ftp2.de.debian.org/debian/ etch main
deb-src http://ftp2.de.debian.org/debian/ etch main

deb http://ftp2.de.debian.org/debian/ lenny main

deb http://security.debian.org/ etch/updates main contrib
deb-src http://security.debian.org/ etch/updates main contrib
&lt;/pre&gt;&lt;br /&gt;
Next we need to update the sources and install the HAproxy&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: &#39;Times New Roman&#39;; font-size: medium; 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;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: &#39;Courier New&#39;,Courier,mono; font-size: 12px; line-height: 13px;&quot;&gt;# apt-get update&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: &#39;Times New Roman&#39;; font-size: medium; 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;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: &#39;Courier New&#39;,Courier,mono; font-size: 12px; line-height: 13px;&quot;&gt;# apt-get install haproxy&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;color: black;&quot;&gt;&lt;b&gt;Configuration:&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;First we backup the original configuration&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;b&gt;# &lt;/b&gt;cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.orig&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# cat /dav/null &amp;gt; /etc/haproxy/haproxy.cfg&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;and new we create a new configuration for our Round Robin&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; 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;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: verdana,sans-serif; font-size: 11px; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;/span&gt; LB.&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;edit the haproxy.cfg file and add the following lines:&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;i style=&quot;color: #b45f06;&quot;&gt;# vi /etc/haproxy/haproxy.cfg &lt;/i&gt;&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;global
        log 127.0.0.1   local0
        log 127.0.0.1   local1 notice
        maxconn 4096
        user haproxy
        group haproxy

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        retries 3
        redispatch
        maxconn 2000
        contimeout      5000
        clitimeout      50000
        srvtimeout      50000

listen webfarm &lt;span style=&quot;color: red;&quot;&gt;LB-IPAddress&lt;/span&gt;:80
       mode http
       stats enable
       stats auth &lt;span style=&quot;color: red;&quot;&gt;someuser&lt;/span&gt;:&lt;span style=&quot;color: red;&quot;&gt;somepassword&lt;/span&gt;
       balance roundrobin
       cookie JSESSIONID prefix
       option httpclose
       option forwardfor
       server webA &lt;span style=&quot;color: red;&quot;&gt;serverA-IP&lt;/span&gt;:80 cookie A check
       server webB &lt;span style=&quot;color: red;&quot;&gt;serverB-IP&lt;/span&gt;:80 cookie B check&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
make sure you change the &lt;span style=&quot;color: red;&quot;&gt;RED&lt;/span&gt; lines to your settings.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
and now we need to ENABLE the haproxy in &lt;i&gt;/etc/default/haproxy&lt;/i&gt;&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# vi /etc/default/haproxy&lt;/i&gt;&lt;/div&gt;and set &lt;i&gt;ENABLE=1&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
to start haproxy just run:&lt;br /&gt;
&lt;i style=&quot;color: #b45f06;&quot;&gt;# /etc/init.d/haproxy start&lt;/i&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
that&#39;s it you have a Load Balancer Installed and work.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;HAproxy Statistics:&lt;/b&gt; &lt;br /&gt;
In this configuration we enable the statistics of haproxy, you can acsses from you browser by enter &lt;i style=&quot;color: blue;&quot;&gt;http://LB-IPAddress/&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: &#39;Times New Roman&#39;; font-size: medium; 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;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: &#39;Courier New&#39;,Courier,mono; font-size: 12px; line-height: 18px;&quot;&gt;haproxy?stats&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/_XmKe6WzPzf0/TLMrdkudDfI/AAAAAAAAA6Y/vax1pIDDiBo/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;271&quot; src=&quot;http://3.bp.blogspot.com/_XmKe6WzPzf0/TLMrdkudDfI/AAAAAAAAA6Y/vax1pIDDiBo/s400/1.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The user and the password is like you type in the configuration in &quot;&lt;i&gt;stats auth &lt;span style=&quot;color: red;&quot;&gt;someuser&lt;/span&gt;:&lt;span style=&quot;color: red;&quot;&gt;somepassword&lt;span style=&quot;color: black;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Enjoy and please comment !!!&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;</description><link>http://crzyorc-linux.blogspot.com/2010/10/how-to-install-load-balancer-with.html</link><author>noreply@blogger.com (crzyOrc@)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_XmKe6WzPzf0/TLMrdkudDfI/AAAAAAAAA6Y/vax1pIDDiBo/s72-c/1.png" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-2900684533414131897</guid><pubDate>Mon, 04 Oct 2010 08:21:00 +0000</pubDate><atom:updated>2010-10-13T09:43:41.531+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">apache</category><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">MySQL</category><category domain="http://www.blogger.com/atom/ns#">php</category><category domain="http://www.blogger.com/atom/ns#">XAMPP</category><title>How To install Apache MySQL and PHP</title><description>The easy way to install a web server with apache MySQL and PHP is by a project called &lt;a href=&quot;http://www.apachefriends.org/en/xampp.html&quot;&gt;XAMPP&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.apachefriends.org/img/xampp-logo-new.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.apachefriends.org/img/xampp-logo-new.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;XAMPP is a project of apache friends how let you the easy way to install&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana,helvetica; font-size: 12px; line-height: 16px;&quot;&gt;Apache distribution containing MySQL, PHP and Perl.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana,helvetica; font-size: 12px; line-height: 16px;&quot;&gt;&lt;/span&gt;I was trying to create a new WordPress blog on one of my servers. and I found this project very helpful.&lt;br /&gt;
All you have to do is to download a &lt;i&gt;tar&lt;/i&gt; file from from XAMPP website untar him and thats it.&lt;br /&gt;
I will show you how it goes:&lt;br /&gt;
&lt;br /&gt;
Download the last version of XAMPP from here -&amp;nbsp;&lt;a href=&quot;http://www.apachefriends.org/en/xampp-linux.html#374&quot;&gt;http://www.apachefriends.org/en/xampp-linux.html#374&lt;/a&gt;&lt;br /&gt;
Run the command:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;tar xvfz xampp-linux-1.7.3a.tar.gz -C /opt&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
That&#39;s all. XAMPP is now installed below the &lt;i&gt;/opt/lampp&lt;/i&gt; directory.&lt;br /&gt;
All you need to do to start the XAMPP is:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# /opt/lampp/lampp start&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You should now see something like this on your screen:Starting XAMPP 1.7.3a...&lt;br /&gt;
&lt;i&gt;LAMPP: Starting Apache...&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;LAMPP: Starting MySQL...&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;LAMPP started.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
Go to your server via you browser ~ http://localhost&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.apachefriends.org/images/380.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;273&quot; src=&quot;http://www.apachefriends.org/images/380.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana,helvetica; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 16px;&quot;&gt;for more information and tricks go to the main project website -&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.apachefriends.org/en/xampp.html&quot;&gt;http://www.apachefriends.org/&lt;/a&gt;</description><link>http://crzyorc-linux.blogspot.com/2010/10/how-to-install-apache-mysql-and-php.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-1586274583489021796</guid><pubDate>Mon, 27 Sep 2010 14:08:00 +0000</pubDate><atom:updated>2010-09-27T16:09:27.032+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">apache</category><category domain="http://www.blogger.com/atom/ns#">wallpaper</category><title>Apache Compile Wallpaper</title><description>&lt;div&gt;&lt;div style=&quot;color: #595653; font-family: Verdana, sans-serif; font-size: 11px; padding-right: 5px; padding-top: 10px; text-align: left;&quot;&gt;A new Wallpaper I found &lt;/div&gt;&lt;div style=&quot;color: #595653; font-family: Verdana, sans-serif; font-size: 11px; padding-right: 5px; padding-top: 10px; text-align: left;&quot;&gt;Discover Simple, Private Sharing at &lt;a href=&quot;http://drop.io/linuxinside/asset/apache-compile-wallpaper-dark-jpg&quot;&gt;Drop.io&lt;/a&gt; &lt;/div&gt;&lt;a href=&quot;http://drop.io/linuxinside/asset/apache-compile-wallpaper-dark-jpg&quot;&gt;&lt;img height=&quot;319&quot; src=&quot;http://drop.io/download/public/avikwilcgvuq3dkl1xsq/c347d25cff48566c9c4cc0d154dec96c97004d2b/Asset/9309336/v3/large_thumbnail&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</description><link>http://crzyorc-linux.blogspot.com/2010/09/apache-compile-wallpaper.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-5076037020150302101</guid><pubDate>Mon, 02 Aug 2010 12:07:00 +0000</pubDate><atom:updated>2010-10-13T17:18:50.386+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">ssh</category><title>How To make SSH Tunnel</title><description>Hi,&lt;br /&gt;
In this post I&#39;ll discuss no how to make ssh tunnel&lt;br /&gt;
this how to will show you the basic, and I hope you will take the good from it to your needs.&lt;br /&gt;
&lt;br /&gt;
the main configuration is:&lt;br /&gt;
edit /etc/ssh/ssh_config with your favorite editor &lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# vi /etc/ssh/ssh_config&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
and add flowing lines in the end&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;Host test
HostName localhost
User your_user_name
LocalForward 2022 SERVER1_IP:22
LocalForward 2080 SERVER2_IP:80
LocalForwars 2025 SERVER3_IP:25
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
save the file.&lt;br /&gt;
and run: &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# ssh test&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
now if you&#39;ll try to access to localhost on port 2080 you&#39;ll go to SERVER2 on port 80, you can test it from your browser - &lt;a href=&quot;http://localhost:2080/&quot;&gt;http://localhost:2080/&lt;/a&gt; or try to ssh to locahost with port 2022&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# ssh -p 2080 localhost&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
and you&#39;ll see you go to SERVER1.&lt;br /&gt;
&lt;br /&gt;
You can run the ssh tunnel from one command line instead of edit the ssh_config.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# ssh -N -f User_Name@SERVER2_IP -L 2080/localhost/80 &lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
this script tell the server to forward all the traffic to port 2080 to SERVER2 on port 80&lt;br /&gt;
&lt;br /&gt;
Or if you want to make REVERSE tunnel you can run the same command but with -R instead of -L&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# ssh -N -f User_Name@SERVER2_IP -R 2022/localhost/22&lt;/i&gt;&lt;/span&gt; &lt;br /&gt;
(with this script you can access from the remote machine (SERVER2) via ssh to your machine with port 2022)&lt;br /&gt;
run &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# ssh &lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;-p 2022 &lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;localhost &lt;/i&gt;&lt;/span&gt;from SERVER2&lt;br /&gt;
&lt;br /&gt;
I&#39;m hoping this post will help you to understand the basic of ssh tunneling&lt;br /&gt;
Please comment</description><link>http://crzyorc-linux.blogspot.com/2010/08/how-to-make-ssh-tunnel.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-5919940102695241858</guid><pubDate>Tue, 20 Jul 2010 12:15:00 +0000</pubDate><atom:updated>2010-09-27T15:57:51.832+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ram</category><category domain="http://www.blogger.com/atom/ns#">script</category><title>Ram Usage Per Application</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;Hi all,&lt;br /&gt;
I found a cool script that&amp;nbsp;show you very nicely&amp;nbsp;how many ram memory every application on your server used:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border-bottom: rgb(153,153,153) 1px dashed; border-left: rgb(153,153,153) 1px dashed; border-right: rgb(153,153,153) 1px dashed; border-top: rgb(153,153,153) 1px dashed; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 95%;&quot;&gt;444.0 KiB + &amp;nbsp; 0.0 KiB = 444.0 KiB &amp;nbsp; &amp;nbsp; &amp;nbsp; atd
536.0 KiB + &amp;nbsp; 0.0 KiB = 536.0 KiB &amp;nbsp; &amp;nbsp; &amp;nbsp; portmap
620.0 KiB + &amp;nbsp; 0.0 KiB = 620.0 KiB &amp;nbsp; &amp;nbsp; &amp;nbsp; ping
640.0 KiB + &amp;nbsp; 0.0 KiB = 640.0 KiB &amp;nbsp; &amp;nbsp; &amp;nbsp; acpid
748.0 KiB + &amp;nbsp; 0.0 KiB = 748.0 KiB &amp;nbsp; &amp;nbsp; &amp;nbsp; init
764.0 KiB + &amp;nbsp; 0.0 KiB = 764.0 KiB &amp;nbsp; &amp;nbsp; &amp;nbsp; rpc.statd
788.0 KiB + &amp;nbsp; 0.0 KiB = 788.0 KiB &amp;nbsp; &amp;nbsp; &amp;nbsp; dhcdbd
904.0 KiB + &amp;nbsp; 0.0 KiB = 904.0 KiB &amp;nbsp; &amp;nbsp; &amp;nbsp; check_ping
956.0 KiB + &amp;nbsp; 0.0 KiB = 956.0 KiB &amp;nbsp; &amp;nbsp; &amp;nbsp; xinetd
960.0 KiB + &amp;nbsp; 0.0 KiB = 960.0 KiB &amp;nbsp; &amp;nbsp; &amp;nbsp; hald-addon-acpi
&amp;nbsp;&amp;nbsp;1.0 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 1.0 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; cron
&amp;nbsp;&amp;nbsp;1.0 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 1.0 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; dbus-daemon
&amp;nbsp;&amp;nbsp;1.1 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 1.1 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; system-tools-ba
&amp;nbsp;&amp;nbsp;1.1 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 1.1 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; hald-addon-inpu
&amp;nbsp;&amp;nbsp;1.1 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 1.1 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; hald-runner
&amp;nbsp;&amp;nbsp;1.2 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 1.2 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; kerneloops
&amp;nbsp;&amp;nbsp;1.2 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 1.2 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; NetworkManagerD
&amp;nbsp;&amp;nbsp;2.0 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 2.0 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; rsyslogd
&amp;nbsp;&amp;nbsp;2.0 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 2.0 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; avahi-daemon (2)
&amp;nbsp;&amp;nbsp;2.1 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 2.1 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; NetworkManager
&amp;nbsp;&amp;nbsp;2.2 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 2.2 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; pickup
&amp;nbsp;&amp;nbsp;2.2 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 2.2 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; master
&amp;nbsp;&amp;nbsp;2.2 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 2.2 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; nagios (2)
&amp;nbsp;&amp;nbsp;2.3 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 2.3 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; hald-addon-stor (2)
&amp;nbsp;&amp;nbsp;2.3 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 2.3 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; cupsd
&amp;nbsp;&amp;nbsp;2.3 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 2.3 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; udevd
&amp;nbsp;&amp;nbsp;2.4 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 2.4 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; qmgr
&amp;nbsp;&amp;nbsp;3.0 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 3.0 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; screen (2)
&amp;nbsp;&amp;nbsp;3.0 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 3.0 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; hald
&amp;nbsp;&amp;nbsp;3.4 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 3.4 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; getty (6)
&amp;nbsp;&amp;nbsp;4.2 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 4.2 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; sshd (2)
&amp;nbsp;&amp;nbsp;4.6 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 4.6 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; gdm (2)
&amp;nbsp;&amp;nbsp;5.3 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 5.3 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; snmpd
&amp;nbsp;&amp;nbsp;6.2 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 6.2 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; Xorg
&amp;nbsp;&amp;nbsp;7.0 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 7.0 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; munin-node
&amp;nbsp;&amp;nbsp;9.0 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp; 9.0 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; collect2.pl
&amp;nbsp;17.6 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp;17.6 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; bash (5)
&amp;nbsp;25.6 MiB + &amp;nbsp; 0.0 KiB = &amp;nbsp;25.6 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; gdmgreeter
120.5 MiB + &amp;nbsp; 0.0 KiB = 120.5 MiB &amp;nbsp; &amp;nbsp; &amp;nbsp; apache2 (11)

&amp;nbsp;Private &amp;nbsp;+ &amp;nbsp;Shared &amp;nbsp;= &amp;nbsp;RAM used &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Program
&lt;/pre&gt;&lt;a href=&quot;http://0.tqn.com/d/pcsupport/1/0/5/1/-/-/cpumetergadget.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;http://0.tqn.com/d/pcsupport/1/0/5/1/-/-/cpumetergadget.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
download the script from &lt;a href=&quot;http://drop.io/hidden/m7rr7ukdzyse2c/asset/cHMtbWVtLXBs&quot;&gt;HERE&lt;/a&gt;&amp;nbsp;-&amp;nbsp;&lt;a href=&quot;http://drop.io/hidden/m7rr7ukdzyse2c/asset/cHMtbWVtLXBs&quot; title=&quot;ps-mem-pl&quot;&gt;ps-mem.pl&lt;/a&gt;&lt;br /&gt;
to run the script to need to type:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;#&amp;nbsp;python ./ps_mem.pl&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
Enjoy (-:&lt;br /&gt;
&lt;br /&gt;
Please leave a comment if you like this post.</description><link>http://crzyorc-linux.blogspot.com/2010/07/ram-usage-per-application.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-6999017168784360318</guid><pubDate>Sun, 27 Jun 2010 09:50:00 +0000</pubDate><atom:updated>2010-11-01T19:08:32.080+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">monitor</category><category domain="http://www.blogger.com/atom/ns#">nagios</category><category domain="http://www.blogger.com/atom/ns#">NRPE</category><title>HowTo Install NRPE on Debian-Host</title><description>Hi,&lt;br /&gt;
Later in my last post - &lt;a href=&quot;http://crzyorc-linux.blogspot.com/2010/06/how-to-install-nagios-on-ubuntu.html&quot;&gt;How To Install Nagios&lt;/a&gt;&lt;br /&gt;
I want to show you how to install NRPE plugin on your Debian-Hosts to monitoring from Nagios.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Install NRPE-Daemon and Nagios-Plugins on Debian-Linux Host.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1. Make sure you have a C compiler installed&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# apt-get install make gcc g++&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
2. Install SSL for secure communication between Nagios-Server and Debian-Host&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# apt-get install libssl-dev&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
3. Install SNMP (in case you like to query some SNMP via NRPE)&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# apt-get install snmpd&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# apt-get install snmp scli tkmib&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
4. Create Nagios user&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# useradd -p nagios nagios&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
5. Install Nagios-Plugins&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# cd /usr/src&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# wget http://internode.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# tar -xzvf nagios-plugins-1.4.13.tar.gz&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# cd nagios-plugins-1.4.13&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# ./configure&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# make&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# make install&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
6. Fix permission for the Nagios director &lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# chown -R nagios:nagios /usr/local/nagios/&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
7. Install Xinetd&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# apt-get install xinetd&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
8. Install and configure NRPE&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# cd /usr/src&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# wget http://waix.dl.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# tar -xzvf nrpe-2.12.tar.gz&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# cd nrpe-2.12&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# ./configure&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# make all &lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# make install-plugin&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# make install-daemon&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# make install-daemon-config&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# make install-xinetd&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Edit /etc/xinetd.d/nrpe&lt;br /&gt;
&lt;i style=&quot;color: #b45f06;&quot;&gt;# vi /etc/xinetd.d/nrpe&lt;/i&gt; &lt;br /&gt;
and add to only_from= your Nagios server IP&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border-bottom: rgb(153,153,153) 1px dashed; border-left: rgb(153,153,153) 1px dashed; border-right: rgb(153,153,153) 1px dashed; border-top: rgb(153,153,153) 1px dashed; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 95%;&quot;&gt;only_from = 127.0.0.1 192.168.1.101
&lt;/pre&gt;&lt;br /&gt;
Add the following entry for the NRPE daemon to the /etc/services file.&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# echo &quot;nrpe 5666/tcp #NRPE&quot; &amp;gt;&amp;gt; /etc/services&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Restart the NRPE service&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# /etc/init.d/xinetd restart&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Test if NRPE is listening:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# netstat -l | grep nrpe&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
The output out this command should show something like this:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border-bottom: rgb(153,153,153) 1px dashed; border-left: rgb(153,153,153) 1px dashed; border-right: rgb(153,153,153) 1px dashed; border-top: rgb(153,153,153) 1px dashed; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 95%;&quot;&gt;tcp 0 0 *:nrpe *:* LISTEN
&lt;/pre&gt;&lt;br /&gt;
Next, check to make sure the NRPE daemon is functioning properly. To do this, run the check_nrpe plugin that was installed for testing purposes.&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# /usr/local/nagios/libexec/check_nrpe -H localhost&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
If everything is fine you will see this output:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border-bottom: rgb(153,153,153) 1px dashed; border-left: rgb(153,153,153) 1px dashed; border-right: rgb(153,153,153) 1px dashed; border-top: rgb(153,153,153) 1px dashed; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 95%;&quot;&gt;NRPE v2.12
&lt;/pre&gt;&lt;br /&gt;
9. Test the NRPE from the Nagios-Server&lt;br /&gt;
Now we want to test if we can query some information from the Debian-Host via NRPE from the Nagios-Server.&lt;br /&gt;
So switch into /usr/local/nagios/libexec on your Nagios Server and check if you have the check_nrpe plugin.&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# ls - l check_ nrpe&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
In case you dont have the check_nrpe plugin you need to download and compile NRPE. (See Step 8)&lt;br /&gt;
run the next command:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# ./check_nrpe -H &lt;span style=&quot;color: red;&quot;&gt;HostIPAddress&lt;/span&gt; -c check_users&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
You should get something like this back:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border-bottom: rgb(153,153,153) 1px dashed; border-left: rgb(153,153,153) 1px dashed; border-right: rgb(153,153,153) 1px dashed; border-top: rgb(153,153,153) 1px dashed; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 95%;&quot;&gt;USERS OK - 1 users currently logged in |users=1;5;10;0
&lt;/pre&gt;&lt;br /&gt;
Great! Your Nagios server is able to communicate with the Debian-Host.</description><link>http://crzyorc-linux.blogspot.com/2010/06/install-nrpe-on-debian-host.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-8434320445765556205</guid><pubDate>Sun, 20 Jun 2010 18:37:00 +0000</pubDate><atom:updated>2010-10-13T09:44:49.024+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">monitor</category><category domain="http://www.blogger.com/atom/ns#">nagios</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>How To Install Nagios on Ubuntu</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://i.dell.com/images/global/licensing/nagios_151x55.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; px=&quot;true&quot; src=&quot;http://i.dell.com/images/global/licensing/nagios_151x55.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;http://www.nagios.org/&quot;&gt;Nagios &lt;/a&gt;is a powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Download, install and Configure Apache&lt;/b&gt;&lt;br /&gt;
first we have to install some necessary compliers and Apache to run Nagios.&lt;br /&gt;
run the next commands:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo apt-get install build-essential&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo apt-get install libgd2-xpm-dev&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo apt-get install apache2&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo apt-get install php5-common php5 libapache2-mod-php5&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Configure Apache to use PHP:&lt;br /&gt;
&lt;br /&gt;
Run in a terminal: &lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo vi /etc/apache2/apache2.conf&lt;/i&gt;&lt;/div&gt;Paste the following into the file:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;DirectoryIndex index.html index.php index.cgi
&lt;/pre&gt;&lt;br /&gt;
and restart the server with the command&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo /etc/init.d/apache2 restart&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Download, install, and configure Nagios&lt;/b&gt;&lt;br /&gt;
Create a user to run the service and a group to run external commands:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo useradd -m nagios&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo passwd nagios&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo groupadd nagcmd&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo usermod -a -G nagcmd nagios&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo usermod -a -G nagcmd www-data&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Download the current version of Nagios and Nagios Plugins from - &lt;a href=&quot;http://www.nagios.org/download/&quot;&gt;http://www.nagios.org/download/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Extract the Nagios tar:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo tar -zxvf nagios-3.1.2.tar.gz&lt;/i&gt;&lt;/div&gt;and change to the nagios-3.1.2 directory&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# cd&amp;nbsp; nagios-3.1.2&lt;/i&gt;&lt;/div&gt;Now install the Nagios use the flowing commands :&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo ./configure --with-command-group=nagcmd&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo make all&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo make install&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo make install-init&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo make install-config&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo make install-commandmode&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo make install-webconf&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Add a user for the Nagios interface:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Extract and compile the Nagios-plugins:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# tar -zxvf nagios-plugins-1.4.14.tar.gz&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# cd nagios-plugins-1.4.14&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo ./configure --with-nagios-user=nagios --with-nagios-group=nagios&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo make&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo make install&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Create a link to start the service:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Verify the config:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Start Nagios:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# sudo /etc/init.d/nagios start&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
You should now be able to log into the Nagios web interface (http://localhost/nagios) using the nagiosadmin user and password.</description><link>http://crzyorc-linux.blogspot.com/2010/06/how-to-install-nagios-on-ubuntu.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-3959318863719887921</guid><pubDate>Wed, 12 May 2010 10:46:00 +0000</pubDate><atom:updated>2010-09-27T16:00:06.012+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MySQL</category><category domain="http://www.blogger.com/atom/ns#">script</category><title>How To, MySQL to CSV - Script</title><description>Hi&lt;br /&gt;
I wanted to share a new script that I was writing,&lt;br /&gt;
This script knows how to take SQL queries, convert them to csv files and send them by eMail.&lt;br /&gt;
&lt;br /&gt;
the script is divided to 2 files:&lt;br /&gt;
the first one contain all the sql queries, and the second do all the amazing job.&lt;br /&gt;
&lt;br /&gt;
The fist file called SQL.reports can be download from &lt;a href=&quot;http://drop.io/hidden/m7rr7ukdzyse2c/asset/c3FsLXJlcG9ydHM%253D&quot;&gt;HERE&lt;/a&gt;, contain the sql queries, the syntax must be like the example:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;ReportName your_report_name
sql your query

ReportName your_second_report_name
sql select * from tableA where [...]
&lt;/pre&gt;&lt;br /&gt;
The script file called MySQL_to_csv.sh can be download from &lt;a href=&quot;http://drop.io/hidden/m7rr7ukdzyse2c/asset/bXlzcWwtdG8tY3N2LXNo&quot;&gt;HERE&lt;/a&gt;,&lt;br /&gt;
the only things you need to do for this to work is to fill the next parameters in the script:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;DBhost=&quot;localhost&quot;
DBname=&quot;your DB name&quot;
DBuser=&quot;your DB user name&quot;
DBpass=&quot;your DB password&quot;
Mail_to=&#39;list of mail with space between them&#39;
&lt;/pre&gt;please do not touch the rest of the script.&lt;br /&gt;
&lt;br /&gt;
After you have been download those 2 file, placed them in the same directory on your server lets say &lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;/opt/reports&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
and make sure you give them a permission&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# chmod +x /opt/reports/*&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
now all left to do is to run the MySQL_to_csv.sh script&lt;br /&gt;
&lt;i style=&quot;color: #b45f06;&quot;&gt;# /opt/reports/MySQL_to_csv.sh&lt;/i&gt;&lt;br /&gt;
and check you mailBox.&lt;br /&gt;
you can also add the script to &lt;i&gt;corntab&lt;/i&gt; to run in your own scheduling&lt;br /&gt;
&lt;br /&gt;
Enjoy.&lt;br /&gt;
And please comment (-;</description><link>http://crzyorc-linux.blogspot.com/2010/05/how-to-mysql-to-csv-script.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-3526796202542766771</guid><pubDate>Wed, 28 Apr 2010 09:23:00 +0000</pubDate><atom:updated>2010-05-23T13:25:11.987+03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">script</category><category domain="http://www.blogger.com/atom/ns#">sort</category><category domain="http://www.blogger.com/atom/ns#">uniq</category><title>How To sort and find duplicate records</title><description>Hi,&lt;br /&gt;
I&#39;m was asked to sort a password file, to show all duplicate users and their UIDs.&lt;br /&gt;
For Example if you have a file like this:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;UID    UserName   Password
----   --------   ----------
1236   john       oe93kf9034j
936    max        fkl03kf032j
9381   keren      fg38uf6124t
8988   john       fj3589gjf01
9834   roma       fgj390jf203
8915   max        gf23j09g305
341    john       mf9244t24t4
9841   david      f02jflp3053
43745  david      23hkfg03g35
4956   ron        04fk054f2e4
69595  max        kvf9035g022
7765   john       mg30gk30gkw
&lt;/pre&gt;&lt;br /&gt;
I want to show all the duplicate users and all their UIDs like this:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;john - 1236 8988 341 7765
max - 936 8915 69595
david - 9841 43745
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;
To find all duplicate users we&#39;ll use the next script:&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;$ cut -f2 &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;yourFile&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt; | sort | uniq -&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;d&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
it&#39;ll display:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;john
max
david
&lt;/pre&gt;&lt;br /&gt;
Now we want to know all the UIDs of those users&lt;br /&gt;
create a new file with &lt;i&gt;vi&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #b45f06;&quot;&gt;$ vi dup_users.sh&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
and copy the folloing lines:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;dup=`cut -f2 &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;yourFile&lt;/span&gt; | sort | uniq -d`

for a in $dup
do
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;echo $a - `cat &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;yourFlie&lt;/span&gt; | grep $a | cut -f1`
done
&lt;/pre&gt;&lt;br /&gt;
It will&amp;nbsp;search&amp;nbsp;for&amp;nbsp;each&amp;nbsp;user all UIDs he has and display them like the example on the top.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;More&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i style=&quot;color: #b45f06;&quot;&gt;$ sort &lt;/i&gt;&lt;/span&gt;&lt;i style=&quot;color: red;&quot;&gt;yourFlie&lt;/i&gt; &lt;span style=&quot;font-size: small;&quot;&gt;&lt;i style=&quot;color: #b45f06;&quot;&gt;| uniq -u  &lt;span style=&quot;color: black;&quot;&gt;# only the unique, non-repeated lines&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;$ sort&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;yourFile&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt; | uniq -d&lt;/span&gt;  # repeated lines&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;$ sort &lt;span style=&quot;color: red;&quot;&gt;yourFile&lt;/span&gt; | uniq -c&lt;/span&gt;  # all lines + count repeated lines&lt;/i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt; &lt;/i&gt;&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;</description><link>http://crzyorc-linux.blogspot.com/2010/04/how-to-sort-and-find-duplicate-lines-in.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-7358740838336897180</guid><pubDate>Mon, 08 Mar 2010 09:31:00 +0000</pubDate><atom:updated>2010-09-27T16:10:20.829+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">wallpaper</category><title>linux/kernel/panic.c Wallpaper</title><description>&lt;div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;A New Wallpaper I found &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;div style=&quot;color: #595653; font-family: Verdana, sans-serif; font-size: 11px; padding-right: 5px; padding-top: 10px; text-align: left;&quot;&gt;&amp;nbsp; Discover Simple, Private Sharing at &lt;a href=&quot;http://drop.io/linuxinside/asset/kernel-panic-jpg&quot;&gt;Drop.io&lt;/a&gt;&amp;nbsp; &lt;/div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://drop.io/linuxinside/asset/kernel-panic-jpg&quot;&gt;&lt;img height=&quot;300&quot; src=&quot;http://drop.io/download/public/avikwilcgvuq3dkl1xsq/205b58a5caca02d07aa98319da4636ca174b9b3b/810cb3d0-0eff-012c-a4ae-f54dea9c590a/000b9170-88e1-012c-a8b1-f865c44a3241/v2/thumbnail_large&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</description><link>http://crzyorc-linux.blogspot.com/2010/03/linuxkernelpanicc-wallpaper.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-1840775903680370744</guid><pubDate>Mon, 08 Mar 2010 09:03:00 +0000</pubDate><atom:updated>2010-10-13T17:19:28.247+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">group</category><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">uid</category><category domain="http://www.blogger.com/atom/ns#">user</category><title>How To change user name and UID</title><description>&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;a href=&quot;http://4.bp.blogspot.com/_XmKe6WzPzf0/S5S80q6fKvI/AAAAAAAAA2I/s7YXymv3zzo/s1600-h/linux-logo.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/_XmKe6WzPzf0/S5S80q6fKvI/AAAAAAAAA2I/s7YXymv3zzo/s320/linux-logo.png&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Hi,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;I was asked to change the ID of the mysql user and gourp on one of my servers.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;this is a very simple to do. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;first type&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i style=&quot;color: #b45f06;&quot;&gt;# id mysql&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;uid=101(mysql) gid=103(mysql) groups=103(mysql)&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;code&gt;&lt;/code&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;to change the user id type:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# usermod -u 25 mysql&lt;/span&gt;&lt;/i&gt;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;to change the group id run the next command under root user:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;# vigr&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;search the mysql group&lt;i&gt; &lt;span style=&quot;color: #b45f06;&quot;&gt;mysql:x:103:&lt;/span&gt;&lt;/i&gt; the change it to 25 &lt;i style=&quot;color: #b45f06;&quot;&gt;mysql:x:25:&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;(save with&lt;i&gt; /wq&lt;/i&gt; like regular &lt;i&gt;vi&lt;/i&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;OR&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# groupmod -g 25 mysql&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;now run again:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# id mysql&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i style=&quot;color: #b45f06;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;uid=25(mysql) gid=25(mysql) groups=25(mysql)&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt; &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;to change user name run:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# usermod -l old_name new_name&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;to change home directory run:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i style=&quot;color: #b45f06;&quot;&gt;# usermod -d /home/user_name user_name&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;to change group name run:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i style=&quot;color: #b45f06;&quot;&gt;# groupmod -n old_name new_name&lt;/i&gt;&lt;/span&gt;</description><link>http://crzyorc-linux.blogspot.com/2010/03/how-to-change-user-name-and-uid.html</link><author>noreply@blogger.com (crzyOrc@)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_XmKe6WzPzf0/S5S80q6fKvI/AAAAAAAAA2I/s7YXymv3zzo/s72-c/linux-logo.png" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-16632639878367408</guid><pubDate>Thu, 04 Feb 2010 12:42:00 +0000</pubDate><atom:updated>2010-10-13T17:19:48.549+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Heartbeat</category><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">MySQL</category><title>How to configure MySQL Cluster with Heartbeat</title><description>In this post we&#39;ll&amp;nbsp;discuss how to set up a MySQL cluster with two serves, storage and Heartbeat.&lt;br /&gt;
I&#39;m using CentOS 5 distribution on both machines, MySQL 5.1 and a mounted directory&amp;nbsp;on both servers&amp;nbsp;to &lt;i&gt;/var/lib/mysql&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Pre-Configuration&lt;/b&gt;&lt;br /&gt;
You need to install MySQL on both machines.&lt;br /&gt;
Assign hostname dbserver01, dbserver02. &lt;br /&gt;
dbserver01 is the primary node with IP address 192.168.1.101 to eth0.&lt;br /&gt;
and dbserver02 is the slave one with ip address 192.168.1.102.&lt;br /&gt;
192.168.1.103 is the virtual IP that will be used for&amp;nbsp;MySQL.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Configuration &lt;/b&gt;(do those steps on both servers)&lt;br /&gt;
install the Heartbeat package:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# yum install heartbeat&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
copy the next configuration files to the&lt;i&gt; /etc/ha.d&lt;/i&gt; directory:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# cp /usr/share/doc/heartbeat-&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;/authkeys /etc/ha.d&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# cp /usr/share/doc/heartbeat-&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;/ha.cf /etc/ha.d&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# cp /usr/share/doc/heartbeat-&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;version&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;/haresources /etc/ha.d&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
First&amp;nbsp;we will edit the &lt;i&gt;authkeys&lt;/i&gt; file,&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# vi /etc/ha.d/authkeys&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
copy from here:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;auth 2
2 sha1 test-HA
&lt;/pre&gt;change the permission of the &lt;i&gt;authkeys&lt;/i&gt; file:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# chmod 600 /etc/ha.d/authkeys&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Now let&#39;s edit the most important file (&lt;i&gt;ha.cf&lt;/i&gt;)&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# vi /etc/ha.d/ha/cf&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
add the following lines into the file:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
initdead 120
bcast eth0
udpport 694
auto_failback on
node &lt;span style=&quot;color: red;&quot;&gt;dbserver01&lt;/span&gt;
node &lt;span style=&quot;color: red;&quot;&gt;dbserver02&lt;/span&gt; 
&lt;/pre&gt;&lt;br /&gt;
The last file we need to edit is &lt;i&gt;haresources:&lt;/i&gt; &lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# vi /etc/ha.d/haresources&lt;/span&gt;&lt;/i&gt; &lt;br /&gt;
add the following line:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;dbserver01 192.168.1.103 netfs mysqld 
&lt;/pre&gt;&lt;br /&gt;
Now all we need to do is to start the &lt;i&gt;hearbeat&lt;/i&gt; service on both machines:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# /etc/init.d/heartbeat start&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
the virtual IP address 192.168.1.103&amp;nbsp;is now on dbserver01 and MySQL is up and running.&lt;br /&gt;
if&amp;nbsp;dbserver01 will crashed from any reason the IP address will jump to dbserver02 the the MySQL service will start automatic.&lt;br /&gt;
&lt;br /&gt;
Enjoy.&lt;br /&gt;
And please comment (-;</description><link>http://crzyorc-linux.blogspot.com/2010/02/how-to-configure-mysql-cluster-with.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-3323284380407090984</guid><pubDate>Thu, 28 Jan 2010 09:10:00 +0000</pubDate><atom:updated>2010-10-13T09:46:21.051+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">rsync</category><title>How to mirror a folder among 2 servers</title><description>Hi, in this post I&#39;ll show you how to mirror ,synchronize a folder from serverA to serverB with &lt;i&gt;rsync&lt;/i&gt; for a backup purpose or what ever you want and need.&lt;br /&gt;
&lt;br /&gt;
First we have to install &lt;i&gt;rsync&lt;/i&gt; on both machines for RedHat/Fedora/CentOS you would use:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# yum install rsync&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
for Debian systems:&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# apt-get install rsync&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
or if you work with SuSE use:&amp;nbsp;&lt;i&gt;yast&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
Now we need to create a user that will be used by &lt;i&gt;rsync &lt;/i&gt;on both servers:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# useradd -d /home/&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;syncuser&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt; -m -s /bin/bash &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;syncuser&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
and give this user a password:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# passwd &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;syncuser&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
The next step is to make sure that serverA can log into serverB without password so we could create a crontab script which do the synchronization automatic without&amp;nbsp;human interaction.&lt;br /&gt;
for this step please go read my post -&amp;nbsp;&lt;a href=&quot;http://crzyorc-linux.blogspot.com/2009/08/how-to-ssh-without-password.html&quot;&gt;how to ssh without password&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
After we test we can &lt;i&gt;ssh&lt;/i&gt; from serverA to serverB without password, we can test the &lt;i&gt;rsync&lt;/i&gt;,&lt;br /&gt;
make sure you have a folder on serverB that you want to backup all your data to and&amp;nbsp;run the next command on serverA:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# rsync -raz --progress --size-only --delete /DirOnServerA/* syncuser@serverB:/DirOnServerB&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
Now go the serverB and check if you data are there.&lt;br /&gt;
&lt;br /&gt;
All you left to do is to to add the &lt;i&gt;rsync&lt;/i&gt; script to &lt;i&gt;crontab&lt;/i&gt; and you can sleep well at&amp;nbsp;night.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.</description><link>http://crzyorc-linux.blogspot.com/2010/01/how-to-mirror-folder-with-2-servers.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-898294210950205880</guid><pubDate>Thu, 24 Dec 2009 15:00:00 +0000</pubDate><atom:updated>2010-10-13T09:46:34.248+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">NFS</category><title>How to mount dir via NFS</title><description>Hi, for mount dir from another server you have to use NFS service&lt;br /&gt;
NFS - Network File System&lt;br /&gt;
First we need to install nfs service on both servers.&lt;br /&gt;
logon to your server with root user, and run:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;background-color: white; color: #b45f06;&quot;&gt;# yum install nfs-utils nfs-utils-lib nfs-utils-lib-devel&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
After installation finished we need to tell&amp;nbsp;the client machine (the one with the existing folder) that we want to share a folder.&lt;br /&gt;
edit /etc/exports like this:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# vi /etc/exports&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
and add the&amp;nbsp;next line:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;/the/folder/you/want *(rw,no_root_squash,async)
&lt;/pre&gt;&lt;br /&gt;
Now you need to be shore the NFS ports are open on your server: 2049/tcp 2049/udp and 111/tcp 111/udp&lt;br /&gt;
&lt;br /&gt;
After everything done you can start the NFS service on both machines by:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;#/etc/init.d/nfs start&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Now you can mount your dir via NFS but first you need to open a folder to the mount one, by:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# mkdir /mnt/DIR&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# mount servername:/the/folder/you/want /nmt/DIR&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
that&#39;s it, you done.&lt;br /&gt;
&lt;br /&gt;
If you want the mount to be permanently (mount automatic when restart), you can do it by edit fstab file&lt;br /&gt;
and add it the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# vi /etc/fstab&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;/servername:/the/folder/you/want /mnt/DIR nfs defaults 0 0
&lt;/pre&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# mount -a&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ENJOY.</description><link>http://crzyorc-linux.blogspot.com/2009/12/how-to-mount-dir-via-nfs.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-943387572480835427</guid><pubDate>Sun, 15 Nov 2009 15:39:00 +0000</pubDate><atom:updated>2009-12-24T17:41:28.597+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">wallpaper</category><title>Peace, Love, Linux</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;A new nice wallpaper I found:&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/_XmKe6WzPzf0/SzOK_YOaZRI/AAAAAAAAAzE/8r7OOCoGwb8/s1600-h/peacelovelinux.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; ps=&quot;true&quot; src=&quot;http://1.bp.blogspot.com/_XmKe6WzPzf0/SzOK_YOaZRI/AAAAAAAAAzE/8r7OOCoGwb8/s400/peacelovelinux.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</description><link>http://crzyorc-linux.blogspot.com/2009/12/peace-love-linux.html</link><author>noreply@blogger.com (crzyOrc@)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_XmKe6WzPzf0/SzOK_YOaZRI/AAAAAAAAAzE/8r7OOCoGwb8/s72-c/peacelovelinux.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-2125735300356016195</guid><pubDate>Mon, 26 Oct 2009 14:23:00 +0000</pubDate><atom:updated>2010-10-13T09:46:49.770+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">swap</category><title>How to add a Swap file</title><description>&lt;span style=&quot;font-size: small;&quot;&gt;                                  &lt;span style=&quot;font-family: verdana,arial,helvetica,sans-serif;&quot;&gt;Sometimes it is necessary to add more swap space after installation. For example, you may upgrade the amount of RAM in your system. It might be advantageous to increase the amount of swap space if you perform memory-intense operations or run applications that require a large amount of memory. &lt;/span&gt;                               &lt;/span&gt;                               &lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;                                  &lt;span style=&quot;font-family: verdana,arial,helvetica,sans-serif;&quot;&gt;You have two options: add a swap partition or add a swap file. It is recommended that you add a swap partition, but sometimes that is not easy if you do not have any free space available.&lt;br /&gt;
&lt;br /&gt;
At a shell prompt as root, type the following command with count being equal to the desired block size:&lt;/span&gt;                               &lt;/span&gt;                               &lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i style=&quot;color: #b45f06;&quot;&gt;                                  &lt;span style=&quot;font-family: verdana,arial,helvetica,sans-serif;&quot;&gt;# dd if=/dev/zero of=/swapfile bs=1024 count=&lt;span style=&quot;color: red;&quot;&gt;1024000&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
in the count type the amount of space you wont for your swap file. For example, 1024000=1GB&lt;br /&gt;
&lt;br /&gt;
Setup the swap file with the command:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# mkswap /swapfile&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
To enable the swap file immediately but not automatically at boot &lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# swapon /swapfile&lt;/i&gt;&lt;/div&gt;Or use &lt;i style=&quot;color: #b45f06;&quot;&gt;# swapoff /swapfile&lt;/i&gt; to disable the mount.&lt;br /&gt;
&lt;br /&gt;
To enable it at boot time, edit /etc/fstab to include:&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# vi /etc/fstab&lt;/i&gt;&lt;/div&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: verdana,arial,helvetica,sans-serif;&quot;&gt;/swapfile               swap                    swap    defaults        0 0&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
The next time the system boots, it will enable the new swap file.&lt;br /&gt;
After adding the new swap file and enabling it, make sure it is enabled by viewing the output of the command&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# cat /proc/swaps&lt;/i&gt;&lt;/div&gt;or&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# free&lt;/i&gt;&lt;/div&gt;</description><link>http://crzyorc-linux.blogspot.com/2009/10/how-to-add-swap-file.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-2462192971065705612</guid><pubDate>Mon, 19 Oct 2009 12:40:00 +0000</pubDate><atom:updated>2010-10-13T09:47:02.736+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">MySQL</category><title>How To Replicate MySQL Database - Step 2</title><description>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;color: #b45f06; font-style: italic;&quot;&gt;&lt;span style=&quot;color: black; font-style: normal;&quot;&gt;Go Back &lt;a href=&quot;http://crzyorc-linux.blogspot.com/2009/10/how-to-replicate-mysql-database-step-1.html&quot;&gt;Step 1&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-style: normal; font-weight: bold;&quot;&gt; &lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06; font-style: italic;&quot;&gt;&lt;span style=&quot;color: black; font-style: normal; font-weight: bold;&quot;&gt;Getting the data to the Slave.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06; font-style: italic;&quot;&gt;&lt;span style=&quot;color: black; font-style: normal; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 15px; font-style: italic; line-height: 17px;&quot;&gt;On the Master Server&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06; font-style: italic;&quot;&gt;&lt;span style=&quot;color: black; font-style: normal; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 15px; font-style: italic; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-style: normal; font-weight: normal; line-height: normal;&quot;&gt;I&#39;m assuming you have a live Master server, and an as yet empty Slave server. This stage depends on whether data is constantly being added to the Master. If so, we will have to prevent all database access on the Master so nothing can be added. This means your server will hang during the next step. If no data is being added to the server, you can skip this step. On the Master server, log into MySQL and do the following:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# mysql -u root -p&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Enter password:&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&amp;nbsp;&amp;nbsp; FLUSH TABLES WITH READ LOCK;&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&amp;nbsp;&amp;nbsp; exit;&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt;&quot;&gt;Now we will use mysqldump to get the data out. So, still on the Master server:&lt;i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# mysqldump &lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;my_database&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt; -u root -p &amp;gt; /tmp/database.sql;&lt;br /&gt;
# gzip /tmp/database.sql;&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt;&quot;&gt;Make sure you change &lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;my_database&lt;/span&gt; to your database name. You will now have a file called &lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;database.sql.gz&lt;/span&gt; in your temp directory. This is a gziped copy of your database.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt;&quot;&gt;&lt;span style=&quot;font-style: italic; font-weight: bold; line-height: 17px;&quot;&gt;On the Slave Server&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt;&quot;&gt;&lt;span style=&quot;font-style: italic; font-weight: bold; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-style: normal; font-weight: normal; line-height: normal;&quot;&gt;Now we need to copy over the gzipped file. On the Slave run the following:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt;&quot;&gt;&lt;span style=&quot;font-style: italic; font-weight: bold; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-style: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# scp root@&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;192.168.1.100&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;:/tmp/database.sql.gz /tmp/&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;Make sure 192.168.1.100 is the IP of the Master. This will copy the file from the Master and put it in your temp directory on the Slave. Now we just need to import into MySQL:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# mysql -u root -p&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Enter password:&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&amp;nbsp;&amp;nbsp; CREATE DATABASE `&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;my_database&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;`;&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&amp;nbsp;&amp;nbsp; exit;&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt; line-height: 115%;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# gunzip /tmp/database.sql.gz&lt;br /&gt;
# mysql -u root -p&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt; line-height: 115%;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;my_database&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt; line-height: 115%;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Finishing&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt; &lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;On the Master Server&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&amp;nbsp;Now we need to find the position the Master is at in the logs. So, log into MySQL and run the following:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# mysql -u root -p&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&amp;nbsp;&amp;nbsp; Enter password:&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&amp;nbsp;&amp;nbsp; SHOW MASTER STATUS;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt; This should give you an output along these lines:&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;+--------------------------+-------------+---------------------------+------------------+
| File                     | Position    | Binlog_Do_DB              | Binlog_Ignore_DB |
+--------------------------+-------------+---------------------------+------------------+
| mysql-bin.000001         | 21197930    | my_database,my_database   |                  |
+--------------------------+-------------+---------------------------+------------------+
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt; line-height: 115%;&quot;&gt;Keep that on-screen.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 17px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; line-height: 115%;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;On the Slave Server&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 17px;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 17px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Log into MySQL and do the following&lt;/span&gt;&lt;span style=&quot;color: red; font-style: italic; line-height: normal;&quot;&gt;&lt;span style=&quot;color: black; font-style: normal; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06; font-style: italic;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;# mysql -u root -p&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; &amp;nbsp;&amp;nbsp; Enter password:&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;&amp;nbsp; slave stop;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; CHANGE MASTER TO MASTER_HOST=&#39;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;192.168.1.100&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&#39;, MASTER_USER=&#39;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;slave_user&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&#39;, &amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;&amp;nbsp; MASTER_PASSWORD=&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&#39;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;your_password&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&#39;, MASTER_LOG_FILE=&#39;mysql-bin.&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;000001&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&#39;, &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;&amp;nbsp; MASTER_LOG_POS=&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;21197930&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;&amp;nbsp; slave start;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; line-height: 115%;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;&amp;nbsp; exit;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The Slave will now be waiting. So all that&#39;s left is to...&lt;br /&gt;
&lt;span style=&quot;line-height: 17px;&quot;&gt;&lt;b&gt;&lt;i&gt; &lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-style: italic; font-weight: bold; line-height: 17px;&quot;&gt;Back to the Master Server&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-style: italic; font-weight: bold; line-height: 17px;&quot;&gt;&lt;span style=&quot;font-style: normal; font-weight: normal; line-height: normal;&quot;&gt;To release the tables from lock, Note you only have to do this if you previously run&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;div dir=&quot;LTR&quot; style=&quot;margin: 0in;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #4f6228; font-family: Calibri,sans-serif; font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;FLUSH TABLES WITH READ LOCK&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt;&quot;&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;LTR&quot; style=&quot;margin: 0in;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;color: #4f6228; font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir=&quot;LTR&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 11pt;&quot;&gt;We shoud already be logged into MySQL, so all you have to do is:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; dir=&quot;LTR&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&amp;nbsp;&amp;nbsp; unlock tables;&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; dir=&quot;LTR&quot; style=&quot;direction: ltr; margin-bottom: 0in; text-align: left; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&amp;nbsp;&amp;nbsp; exit;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: medium;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;</description><link>http://crzyorc-linux.blogspot.com/2009/10/how-to-replicate-mysql-database-step-2.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-6893563260737472153</guid><pubDate>Mon, 19 Oct 2009 12:30:00 +0000</pubDate><atom:updated>2010-10-13T17:20:13.633+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">MySQL</category><title>How To Replicate MySQL Database - Step 1</title><description>&lt;span style=&quot;font-family: Calibri,sans-serif; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;b&gt;Configure the Master Serve&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
First we have to edit /etc/my.cnf, comment out these lines:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;#skip-networking
#bind-address            = 127.0.0.1
&lt;/pre&gt;&lt;br /&gt;
Now we need to tell MySql to write a bin-log (these logs are used by the slave to see what has changed on the master)&lt;br /&gt;
add these lines to /etc/my.cnf in [mysqld] section:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;log-bin = /var/log/mysql/mysql-bin.log
server-id=1&lt;/pre&gt;&lt;br /&gt;
If you want to replicate just one database you may add this line also:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;binlog-do-db=&lt;span style=&quot;color: red;&quot;&gt;my_database&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
Then restart MySql&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;/etc/init.d/mysqld restart&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
Then we log into the MySQL database as root and create a user with replication privileges&lt;br /&gt;
&lt;div style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;# mysql -u root -p&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;Enter password:&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;GRANT REPLICATION SLAVE ON *.* TO &#39;&lt;span style=&quot;color: red;&quot;&gt;slave_user&lt;/span&gt;&#39;@&#39;%&#39; IDENTIFIED BY &#39;&lt;span style=&quot;color: red;&quot;&gt;your_password&lt;/span&gt;&#39;;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;FLUSH PRIVILEGES;&lt;/div&gt;&lt;div style=&quot;color: #b45f06;&quot;&gt;exit;&lt;/div&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;span style=&quot;color: black; font-style: normal; font-weight: bold;&quot;&gt;Configure the Slave Server&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Again, we have to edit /etc/my.cnf file for the salve server,&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
add these lines to /etc/my.cnf in [mysqld] section:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;server-id=2
master-host=&lt;span style=&quot;color: red;&quot;&gt;192.168.1.100&lt;/span&gt;
master-connect-retry=60
master-user=&lt;span style=&quot;color: red;&quot;&gt;slave_user&lt;/span&gt;
master-password=&lt;span style=&quot;color: red;&quot;&gt;your_password&lt;/span&gt;
#replicate-do-db= &lt;span style=&quot;color: red;&quot;&gt;my_database&lt;/span&gt;
relay-log = /var/lib/mysql/slave-relay.log
relay-log-index = /var/lib/mysql/slave-relay-log.index
&lt;/pre&gt;&lt;br /&gt;
Master-host – can be IP or host name of the Master Server&lt;br /&gt;
Replicate-do-db – add this just if you want replicate one database.&lt;br /&gt;
You should also make sure skip-networking has not been enabled.&lt;br /&gt;
&lt;br /&gt;
Then restart MySql:&lt;br /&gt;
&lt;span style=&quot;color: #b45f06; font-style: italic;&quot;&gt;# /etc/init.d/mysqld restart&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06; font-style: italic;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: black; text-align: center;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://crzyorc-linux.blogspot.com/2009/10/how-to-replicate-mysql-database-step-2.html&quot; style=&quot;color: black;&quot;&gt;Continue &lt;/a&gt;&lt;span style=&quot;color: #b45f06; font-style: italic;&quot;&gt;&lt;a href=&quot;http://crzyorc-linux.blogspot.com/2009/10/how-to-replicate-mysql-database-step-2.html&quot; style=&quot;color: blue;&quot;&gt;STEP 2&lt;/a&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</description><link>http://crzyorc-linux.blogspot.com/2009/10/how-to-replicate-mysql-database-step-1.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-4569692951660142417</guid><pubDate>Tue, 22 Sep 2009 06:32:00 +0000</pubDate><atom:updated>2010-10-13T09:47:32.273+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">ssh</category><category domain="http://www.blogger.com/atom/ns#">sudo</category><title>How to block Root access and use sudo permissions</title><description>In my servers Policy I usually block the Root user access via ssh,&lt;br /&gt;
and I create an admin user how I give a sudo permissions to manage the server.&lt;br /&gt;
for disable Root login edit sshd_config file:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# vi /etc/ssh/sshd_config&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
search the line &lt;span style=&quot;color: #b45f06;&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;PermitRootLogin yes&lt;/i&gt;&lt;/span&gt; , remove the # from it and change it to &#39;no&#39;.&lt;br /&gt;
do the same to this line: &lt;span style=&quot;color: #b45f06;&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;StrictModes yes&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
the section in the sshd_config file should look like this:&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); overflow: auto; padding: 5px; width: 95%;&quot;&gt;&lt;span style=&quot;font-family: &#39;Andale Mono&#39;,&#39;Lucida Console&#39;,Monaco,fixed,monospace; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;#LoginGraceTime 2m
PermitRootLogin no
StrictModes no
#MaxAuthTries 6&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
now restart the ssh service:&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;# /etc/init.d/sshd restart&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
OK, now you block the root access, the next step is to create admin user and give him sudo permissions to the commends you like.&lt;br /&gt;
How it work?&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;#useradd admin&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;#passwd admin&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
(Enter any password you want to admin user)&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;#/usr/sbin/visudo&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
now you need to edit this file to your needs&lt;br /&gt;
first create&amp;nbsp;User alias specification&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;User_Alias ADMIN = admin&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
then create&amp;nbsp;Command alias specification&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;Cmnd_Alias CADMIN = /bin/rm, /sbin/service, /bin/chown, /bin/tar, /bin/cp&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
you can add here any command you want the user admin will have.&lt;br /&gt;
and at last you need to create&amp;nbsp;User privilege specification&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;ADMIN &amp;nbsp; ALL=NOPASSWD: CADMIN&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
in the end the file should look something like this:&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: 12px; line-height: 15px; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); overflow: auto; padding: 5px; width: 95%;&quot;&gt;# sudoers file.
# This file MUST be edited with the &#39;visudo&#39; command as root.
# See the sudoers man page for the details on how to write a sudoers file.

# User alias specification
User_Alias ADMIN = admin

# Cmnd alias specification
Cmnd_Alias CADMIN = /bin/rm, /sbin/service, /bin/chown, /bin/tar, /bin/cp

# User privilege specification
root    ALL=(ALL) ALL
ADMIN   ALL=NOPASSWD: CADMIN
&lt;/pre&gt;&lt;br /&gt;
That&#39;s it.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 15px; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/span&gt;</description><link>http://crzyorc-linux.blogspot.com/2009/09/how-to-block-root-access-and-use-sudo.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-8981687131895901617</guid><pubDate>Mon, 14 Sep 2009 09:10:00 +0000</pubDate><atom:updated>2010-10-13T17:20:52.618+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">network</category><title>How to bond Ethernet interfaces</title><description>&lt;span style=&quot;font-size: small;&quot;&gt;Bonding eth-interfaces&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you need to bonding your&amp;nbsp;Ethernet&amp;nbsp;interfaces, Do the following:&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;add following lines to the /etc/modprobe.conf file&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;# vi /etc/ modprobe.conf&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &#39;Andale Mono&#39;,&#39;Lucida Console&#39;,Monaco,fixed,monospace; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;alias bond0 bonding
options bonding mode=1 arp_interval=100 arp_ip_target=192.168.1.1
&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;create the file /etc/sysconfig/network-scripts/ifcfg-bond0 &amp;nbsp;with the normal IP setting:&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;# vi /etc/sysconfig/network-scripts/ifcfg-bond0&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &#39;Andale Mono&#39;,&#39;Lucida Console&#39;,Monaco,fixed,monospace; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.1.40
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Add eth0 and eth1 to the bonding pair by editing the files:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;/etc/sysconfig/network-scripts/ifcfg-eth0 and&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;/etc/sysconfig/network-scripts/ifcfg-eth1&amp;nbsp;to look something like this:&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &#39;Andale Mono&#39;,&#39;Lucida Console&#39;,Monaco,fixed,monospace; line-height: 14px; overflow: auto; padding: 5px; width: 95%;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;DEVICE=eth0
BOOTPROTO=none
HWADDR=00:17:A4:10:D7:32
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes
&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Restart the network service:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: small;&quot;&gt;# /etc/init.d/network restart&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #b45f06;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt;</description><link>http://crzyorc-linux.blogspot.com/2009/09/how-to-bond-ethernet-interfaces.html</link><author>noreply@blogger.com (crzyOrc@)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-2602457153191114487</guid><pubDate>Sat, 05 Sep 2009 07:20:00 +0000</pubDate><atom:updated>2010-10-13T09:48:06.837+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">grub</category><category domain="http://www.blogger.com/atom/ns#">howto</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>How to mount your system with live CD</title><description>&lt;span style=&quot;font-size: 85%;&quot;&gt;more then once I was needed to reconfigure my ubuntu grub or change the root password of a certain machine.&lt;br /&gt;
If you can&#39;t login to the machine or you don&#39;t have your root password,&lt;br /&gt;
the easy way to do so is to mount the system from a live CD.&lt;br /&gt;
I&#39;m using &lt;a href=&quot;http://crzyorc-linux.blogspot.com/2009/09/ubuntu-904-jaunty-jackalope.html&quot;&gt;Ubuntu 9.04 live CD&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
insert the live CD to your cdrom and restart the computer.&lt;br /&gt;
chose the first option of the main menu -&lt;br /&gt;
&quot;Try ubuntu whitout any change to your computer&quot;&lt;br /&gt;
&lt;/span&gt;&lt;a href=&quot;http://2.bp.blogspot.com/_XmKe6WzPzf0/SqIShZqcTcI/AAAAAAAAAvE/G6FW5bFChKk/s1600-h/Install2StartUp.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5377881270067678658&quot; src=&quot;http://2.bp.blogspot.com/_XmKe6WzPzf0/SqIShZqcTcI/AAAAAAAAAvE/G6FW5bFChKk/s200/Install2StartUp.png&quot; style=&quot;cursor: pointer; height: 136px; width: 180px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: 85%;&quot;&gt;when it finish loading, open the terminal console and run the next commands.&lt;br /&gt;
first we need to find your linux partition&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;# sudo fdisk -l&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
than we need to mount into it&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;# sudo mkdir /mnt/root&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;# sudo mount -t ext3 /dev/sda1 /mnt/root&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;# sudo mount -t proc none /mnt/root/proc&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;# sudo mount -o bind /dev /mnt/root/dev&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;# sudo chroot /mnt/root /bin/bash&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
That&#39;s it, Now you login the machine as root user, and you can do what ever you want.&lt;br /&gt;
&lt;br /&gt;
for reinstall grub you can use grub-install:&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;# grub-install /dev/sda1&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
or&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;# grub&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;grub&amp;gt; find /boot/grub/stage1&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;grub&amp;gt; root (hd?,?)&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;grub&amp;gt; setup (hd?)&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;grub&amp;gt; quit&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
or change the root password with passwd:&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc6600; font-size: 85%; font-style: italic;&quot;&gt;# passwd root&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;</description><link>http://crzyorc-linux.blogspot.com/2009/09/how-to-mount-your-system-with-live-cd.html</link><author>noreply@blogger.com (crzyOrc@)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_XmKe6WzPzf0/SqIShZqcTcI/AAAAAAAAAvE/G6FW5bFChKk/s72-c/Install2StartUp.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4280792773714639752.post-1860689608632879254</guid><pubDate>Thu, 03 Sep 2009 10:30:00 +0000</pubDate><atom:updated>2009-09-05T09:12:49.845+03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><title>Ubuntu 9.04 - Jaunty Jackalope</title><description>&lt;div style=&quot;float: right; margin-left: 10px; margin-bottom: 10px;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:100%;&quot;&gt;Every time a new version of my favorite operating system - Ubuntu, comes out,&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:100%;&quot;&gt;I invite the original disk for free.&lt;br /&gt;Although I download it straight and updating my ubuntu at home,&lt;br /&gt;I love that I have the original CD - who does not ??&lt;br /&gt;&lt;br /&gt;Recently a new version of ubuntu 9.04 - Jaunty Jackalope, comes out.&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:100%;&quot;&gt;I ordered the original CD and it just arrived in the mail. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2448/3883151851_2da974deb5_m.jpg&quot; alt=&quot;&quot; style=&quot;border: 2px solid rgb(0, 0, 0);&quot; /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/orcohen/3883151851/&quot;&gt;Ubuntu 9.04 - Jaunty Jackalope&lt;/a&gt;&lt;br /&gt;Originally uploaded by &lt;a href=&quot;http://www.flickr.com/people/orcohen/&quot;&gt;OrCohen&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://crzyorc-linux.blogspot.com/2009/09/ubuntu-904-jaunty-jackalope.html</link><author>noreply@blogger.com (crzyOrc@)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm3.static.flickr.com/2448/3883151851_2da974deb5_t.jpg" height="72" width="72"/><thr:total>0</thr:total></item></channel></rss>