<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>experimental &#187; Nix Basics</title>
	<atom:link href="http://www.tajidyakub.com/category/nix-basics/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tajidyakub.com</link>
	<description>Experience the Experiment</description>
	<lastBuildDate>Sat, 10 Oct 2009 19:32:38 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Reinstall Yum Package Manager &#8211; in CentOS</title>
		<link>http://www.tajidyakub.com/nix-basics/reinstall-yum-package-manager-in-centos-2009-10-11.html</link>
		<comments>http://www.tajidyakub.com/nix-basics/reinstall-yum-package-manager-in-centos-2009-10-11.html#comments</comments>
		<pubDate>Sat, 10 Oct 2009 19:32:38 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Nix Basics]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Reinstall]]></category>
		<category><![CDATA[RPM]]></category>
		<category><![CDATA[Yum]]></category>

		<guid isPermaLink="false">http://www.tajidyakub.com/?p=39</guid>
		<description><![CDATA[Somehow in an unlucky moment(s) you'll find that your yum command stop working, I have experienced it a couple of time, never find out how it happen.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tajidyakub.com/wp-content/uploads/2009/10/yum-package-reinstall-centos.jpg"><img class="aligncenter size-full wp-image-40" title="yum-package-reinstall-centos" src="http://www.tajidyakub.com/wp-content/uploads/2009/10/yum-package-reinstall-centos.jpg" alt="yum-package-reinstall-centos" width="540" height="80" /></a></p>
<p>Somehow in an unlucky moment(s) you&#8217;ll find that your yum command stop working, I have experienced it a couple of time, never find out how it happen.</p>
<p><span id="more-39"></span>It is quite simple to re install yum in an rpm base linux distros, specifically CentOS in my case. What you need to do first is to download the source file (rpm) from CentOS repo.</p>
<p>Check your current kernel, make sure you download the correct package later;</p>
<pre class="brush: bash">uname -a
Linux xxx.yyy.com 2.6.18-128.7.1.el5 #1 SMP Mon Aug 24 08:21:56 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux</pre>
<p>Go to the correct repo url, and search for yum rpm link url. For x86_64 Kernel, go to http://mirror.centos.org/centos-5/5.3/os/x86_64/CentOS/ (assuming that you are using the latest version of CentOS), copy the link of yum package, and download them into your server, you must at this point have wget installed.</p>
<pre class="brush: bash">cd /usr/local/src/
wget http://mirror.centos.org/centos-5/5.3/os/x86_64/CentOS/yum-3.2.19-18.el5.centos.noarch.rpm</pre>
<p>Check yor current version of installed yum</p>
<pre class="brush: bash">rpm -qa | grep yum
yum-metadata-parser-1.1.2-2.el5
yum-updatesd-0.9-2.el5
yum-utils-1.1.16-13.el5.centos
yum-3.2.19-18.el5.centos
yum-fastestmirror-1.1.16-13.el5.centos</pre>
<p>The result confirmed that you have yum-3.2.19-18, erase it using rpm and no dependencies check option.</p>
<pre class="brush: bash">rpm -e --nodeps yum-3.2.19-18.el5.centos</pre>
<p>Reinstall with rpm from yum rpm you just downloaded;</p>
<pre class="brush: bash">rpm -ivh yum-3.2.19-18.el5.centos.noarch.rpm</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/nix-basics/reinstall-yum-package-manager-in-centos-2009-10-11.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Connection Shortcut</title>
		<link>http://www.tajidyakub.com/nix-basics/ssh-connection-shortcut-2009-09-28.html</link>
		<comments>http://www.tajidyakub.com/nix-basics/ssh-connection-shortcut-2009-09-28.html#comments</comments>
		<pubDate>Sun, 27 Sep 2009 19:43:56 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Nix Basics]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.tajidyakub.com/?p=30</guid>
		<description><![CDATA[
Occasionally I have to leave my XP workstation and use Linux or Mac Desktop, both don&#8217;t have putty like in XP, most probably because they have built in SSH client installed :).
But I need somehow make it easier to connect from those desktop to servers with Key Authentication, instead of running this from the terminal;
ssh [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tajidyakub.com/wp-content/uploads/2009/09/openssh-mac.jpg"><img class="size-full wp-image-31 alignnone" title="openssh-mac" src="http://www.tajidyakub.com/wp-content/uploads/2009/09/openssh-mac.jpg" alt="openssh-mac" width="540" height="80" /></a></p>
<p>Occasionally I have to leave my XP workstation and use Linux or Mac Desktop, both don&#8217;t have putty like in XP, most probably because they have built in SSH client installed :).</p>
<p><span id="more-30"></span>But I need somehow make it easier to connect from those desktop to servers with Key Authentication, instead of running this from the terminal;</p>
<pre class="brush: bash">ssh -p xxxx -l root 117.103.xx.xx -i ~/ssh-keys/me\@tajidyakub.net.ppk</pre>
<p>While in Putty, I could simply use Connection Sessions preferences load a particular private key for specific connection and utilize Putty PageAnt to Authorize the pass phrase automatically. It is as simple as it gets since I only have to double click, and logged in instantly.</p>
<p>But turns out I can do the task event simpler in Linux or Mac. I create a folder in My Desktop to store my connection;</p>
<pre class="brush: bash">mkdir ~/Desktop/SSH/</pre>
<p>And create a file with .sh extension. doesn&#8217;t have to be .sh extension, just wanted to name it that way :).</p>
<pre class="brush: bash">cd ~/Desktop/SSH/
vi myserver.sh</pre>
<p>And insert the content;</p>
<pre>ssh -p xxxx -l root 117.103.xx.xx -i ~/path/to/yourprivatekey.ppk</pre>
<p>yourprivatekey.ppk is a private key, in my case, I exported it using Putty Gen from my XP machine so it is going to look like this;</p>
<pre>tjdykb$ cat me\@tajidyakub.net.ppk
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,...
nYMNS/d7RJSx1qswncyw2cd7NiCXfwZkQ6m+OMzcCtXMj8vCBDhTSyhkwxQ0lByY
tgp0zA3HkKKYI5ACl5+Q7MEZwwi+Dpz8wHY2E5adjqAbWm5M/Li9e1EBJgWM15EQ
.......
8OfpeNjO85IGBPpNYct56Z1VFCpadkph0WPE1vdrLmjhQOBu2ftamY8hJ9kFaNRH
At/j4dC4HI3kwmuM7onZIb2vZIfxmW2sUceY2NhBLEbT+kOd3Tu2/EYkKNlfmW43
3gfOqCOzUqnGON7hopzQbMK/PfvOvT+bPIE14RZG8IFhiNUu10yrd+FkF6HFlNIi
ljJTuFKDgCm/3OezeV/bzWcVMkBqoaMwxN/hI7OHe1HYb0QpZbIU/ePwt6cVGYSh
zfkIFTJl61WWTvB81oRhS5JZ6nf3OUkuFxCjJ4PseFw=
-----END RSA PRIVATE KEY-----</pre>
<p>And to load the connection from a terminal, simply execute the file (don&#8217;t forget to chmod so it becomes executable &#8211; like 755);</p>
<pre class="brush: bash">./yourserver.sh</pre>
<p>In a desktop environment, a pop up will appear asking for the pass phrases, you could add the pass phrase to your key chain or saved password avoid this the next time you load the connection.</p>
<p><a href="http://www.tajidyakub.com/wp-content/uploads/2009/09/keychain.jpg"><img class="alignnone size-full wp-image-33" title="keychain" src="http://www.tajidyakub.com/wp-content/uploads/2009/09/keychain.jpg" alt="keychain" width="540" height="260" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/nix-basics/ssh-connection-shortcut-2009-09-28.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding SWAP Space On-The-Fly</title>
		<link>http://www.tajidyakub.com/nix-basics/adding-swap-space-on-the-fly-2008-06-27.html</link>
		<comments>http://www.tajidyakub.com/nix-basics/adding-swap-space-on-the-fly-2008-06-27.html#comments</comments>
		<pubDate>Thu, 26 Jun 2008 18:24:41 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Nix Basics]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=10</guid>
		<description><![CDATA[If somehow you need to add SWAP space in your Linux Box without having to reboot your Box, you could follow these steps. Basically create an Image in your HDD, format it to swap file system, and add it to your swap space, optionally you could add it to your fstab, so it still there [...]]]></description>
			<content:encoded><![CDATA[<p>If somehow you need to add SWAP space in your Linux Box without having to reboot your Box, you could follow these steps. Basically create an Image in your HDD, format it to swap file system, and add it to your swap space, optionally you could add it to your fstab, so it still there during a reboot.</p>
<p><strong>Build the Image</strong></p>
<p>Build the image using dd command, give the size according to your needs. This example shows a 512MB image file.</p>
<pre class="brush: bash">dd if=/dev/zero of=/path/to/directory/swap.image oflag=direct bs=1M count=512</pre>
<p><strong>Format the Image</strong></p>
<p>Format the image to SWAP file type.</p>
<pre class="brush: bash">mkswap  /direktori/swap.image</pre>
<p><strong>Activate Your Newly Created SWAP Image</strong></p>
<pre class="brush: bash">mkswap  /path/to/directory/swap.image</pre>
<p><strong>Configure fstab</strong></p>
<p>If you want the SWAP survive reboot.</p>
<pre class="brush: bash">vi /etc/fstab

### add the line similar to

/path/to/directory/swap.image swap                    swap    defaults        0 0</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/nix-basics/adding-swap-space-on-the-fly-2008-06-27.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Basic Network Configuration in CentOS</title>
		<link>http://www.tajidyakub.com/networking/basic-network-configuration-in-centos-2008-06-27.html</link>
		<comments>http://www.tajidyakub.com/networking/basic-network-configuration-in-centos-2008-06-27.html#comments</comments>
		<pubDate>Thu, 26 Jun 2008 18:15:20 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Nix Basics]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[IP Address]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=9</guid>
		<description><![CDATA[The file you have to keep an eye on CentOS for your box basic networking configuration is /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-eth0 or /etc/sysconfig/network-scripts/ifcfg-eth0:x for the alias network Interface. Below are the example of output in My CentOS box, /24 IP Block assumed.

cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
BROADCAST=xxx.xxx.xxx.255
IPADDR=xxx.xxx.xxx.12
NETMASK=255.255.255.0
NETWORK=xxx.xxx.xxx.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes

cat /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=xxx.magnet-id.com
GATEWAY=xxx.xxx.xxx.1
Put the resolver DNS IP Address on your /etc/resolv.conf (get them from your [...]]]></description>
			<content:encoded><![CDATA[<p>The file you have to keep an eye on CentOS for your box basic networking configuration is /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-eth0 or /etc/sysconfig/network-scripts/ifcfg-eth0:x for the alias network Interface. Below are the example of output in My CentOS box, /24 IP Block assumed.</p>
<p><span id="more-9"></span></p>
<pre class="brush: bash">cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
BROADCAST=xxx.xxx.xxx.255
IPADDR=xxx.xxx.xxx.12
NETMASK=255.255.255.0
NETWORK=xxx.xxx.xxx.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes

cat /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=xxx.magnet-id.com
GATEWAY=xxx.xxx.xxx.1</pre>
<p>Put the resolver DNS IP Address on your /etc/resolv.conf (get them from your ISP or Data Center)</p>
<pre class="brush: bash">cat /etc/resolv.conf

nameserver 117.103.57.4
nameserver 117.103.56.5</pre>
<p>If you want to make an alias IP Address, do this step;</p>
<p>Copy the ifcfg startup script</p>
<pre class="brush: bash">cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0</pre>
<p>Edit the newly created ifcfg script, customize to your other IP Address (aliased to the same network interface). Change the Device and IP Address Informations.<br />
Restart Network Service</p>
<pre class="brush: bash">service network restart</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/networking/basic-network-configuration-in-centos-2008-06-27.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change Your Time Zone</title>
		<link>http://www.tajidyakub.com/nix-basics/change-your-time-zone-2008-06-26.html</link>
		<comments>http://www.tajidyakub.com/nix-basics/change-your-time-zone-2008-06-26.html#comments</comments>
		<pubDate>Thu, 26 Jun 2008 16:42:26 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Nix Basics]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=3</guid>
		<description><![CDATA[From somewhere else, this is the easiest way I found to change your Box&#8217;s Time Zone
cp /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
That is if your box ran CentOS and you want the Time Zone in WIT (GMT+7)
]]></description>
			<content:encoded><![CDATA[<p>From somewhere else, this is the easiest way I found to change your Box&#8217;s Time Zone</p>
<pre class="brush: bash">cp /usr/share/zoneinfo/Asia/Jakarta /etc/localtime</pre>
<p>That is if your box ran CentOS and you want the Time Zone in WIT (GMT+7)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/nix-basics/change-your-time-zone-2008-06-26.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
