<?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>Hendra Kharisma &#187; Linux</title>
	<atom:link href="http://www.hendra-k.net/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hendra-k.net</link>
	<description>I Read, I Feel, I Share</description>
	<lastBuildDate>Wed, 26 Oct 2011 13:31:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Create network drive using ssh to window env.</title>
		<link>http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html</link>
		<comments>http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#comments</comments>
		<pubDate>Tue, 13 May 2008 12:05:47 +0000</pubDate>
		<dc:creator>hendra</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.hendra-k.net/?p=395</guid>
		<description><![CDATA[OK. Before I start on this one, I’m stating for the record that I’m posting this as much so I don’t have to find it again as anything. However, given the number of places online that I found this question asked, but not answered, I hope it proves useful to the folks who’ve been looking [...]]]></description>
			<content:encoded><![CDATA[<p>OK. Before I start on this one, I’m stating for the record that I’m  posting this as much so I don’t have to find it again as anything.  However, given the number of places online that I found this question  asked, but not answered, I hope it proves useful to the folks who’ve  been looking for it.<span id="more-395"></span><span id="more-395"> </span></p>
<p>Enough babbling, on with the geeking.</p>
<p>Here’s the basic problem/challenge. While in an ideal situation, <a href="http://www.sftpdrive.com/">SFTP Drive</a> looks nice, in reality, I’ve had problems with it during my 6 week  trial that left me waiting till they work out some of the kinks. Most  notably were the errors in connecting to this site after some sort of  timeout. In those cases, I was entirely unable to connect to the site  (even with disconnecting and reconnecting the SFTP Drive) without  rebooting. Sorry, but that doesn’t fly.</p>
<p>However, I still would really like easy access to my remote  machines’ files and preferably via SSH. So, since I had seen evidence  of sshfs on <a id="KonaLink0" href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#" target="_top">Linux</a> working at least on that end, I messed with that for a couple of days and finally got one of my virtual Ubuntu <a id="KonaLink1" href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#" target="_top">VMWare</a> appliances to connect to Wynia.org via sshfs.</p>
<p>Then, yesterday morning a though occurred to me. What if I connected to the remote machines via sshfs on one of the <a id="KonaLink2" href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#" target="_top">Ubuntu</a> machines and then shared the mounted directories via Samba. That way,  I’d be able to map drives to these remote servers on my Windows <a id="KonaLink3" href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#" target="_top">workstations</a>. I’d have *mapped drives to SFTP locations* by just going through a virtual Linux machine.</p>
<p>I went digging before work and got most of it working and finished  the rest (though I do have a wishlist at the end for missing features)  last night. It works. What follows is what needs to happen to make it  work.</p>
<p>I started with an Ubuntu Server installation on VMWare Server,  logged in as my one regular user. The virtual machine in question is <a id="KonaLink4" href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#" target="_top">my web</a> development machine (mostly LAMP setup). SSH was already installed and working.</p>
<p>To install the sshfs package on the <a id="KonaLink5" href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#" target="_top">virtual machine</a>:</p>
<p>sudo apt-get install sshfs</p>
<p>In order to be able to use the mounted directory as a regular user,  you need to be added to the “fuse” group, which the package created:</p>
<p>sudo adduser your-username fuse</p>
<p>Note that the permissions change doesn’t actually work until you log  off and back on. However, since a reboot is needed shortly, don’t worry  about it.</p>
<p>Then, you need to create a directory for the remote mounted machine:</p>
<p>sudo mkdir /mnt/wyniaorg</p>
<p>sudo chown your-username /mnt/wyniaorg</p>
<p>Now, here’s the part that wasn’t in most of the tutorials, but necessary to make Samba work later on.</p>
<p>Create a file at /etc/fuse.conf</p>
<p>touch /etc/fuse.conf</p>
<p>Put the following line in /etc/fuse.conf:</p>
<p>user_allow_other</p>
<p>REBOOT</p>
<p>To mount the remote directory, here’s the command that I use for Wynia.org:</p>
<p>sshfs wynia@wynia.org@84.40.22.116:/var/www/html /mnt/wyniaorg -o allow_other</p>
<p>Note that I actually need to use a full email address to log in to this <a id="KonaLink6" href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#" target="_top">server</a>,  so the first “@” is part of the username and the second is the  delimiter for the host. The “/var/www/html is the remote directory and  “/mnt/wyniaorg” is the local directory on the virtual machine.</p>
<p>It’ll ask you for your password. For the moment, I’m going to have  to type that in every time I mount the remote drive. There’s a  potential solution out there, but it doesn’t work for the server this  site sits on.</p>
<p>To avoid having to retype that beast of a commandline repeatedly, I saved the command as</p>
<p>~/scripts/sshfs_wyniaOrg.sh</p>
<p>Then make it executable:</p>
<p>chmod +x ~/scripts/sshfs_wyniaOrg.sh</p>
<p>To run that script:</p>
<p>cd ~/scripts</p>
<p>./sshfs_wyniaOrg.sh</p>
<p>I also created a script to unmount the directory:</p>
<p>fusermount -u /mnt/wyniaorg</p>
<p>and put it as “un_sshfs_wyniaOrg.sh”, also making it executable.</p>
<p>To install Samba:</p>
<p>sudo apt-get install samba smbfs</p>
<p>To share the mounted drive, you need to edit the Samba config file:</p>
<p>sudo pico /etc/samba/smb.conf</p>
<p>I wanted to not have to enter a password to access the shared drive, so in /etc/samba/smb.conf, I set the security to</p>
<p>security = share</p>
<p>and then added a section at the end of the file for my new share.</p>
<p>[wyniaorg]</p>
<p>comment = wyniaOrg</p>
<p>path = /mnt/wyniaorg/</p>
<p>public = yes</p>
<p>writable = yes</p>
<p>create mask = 0777</p>
<p>directory mask = 0777</p>
<p>force user = nobody</p>
<p>force group = nogroup</p>
<p>I also added a section to share the /var/www directory of the virtual appliance itself:</p>
<p>[public]</p>
<p>comment = <a id="KonaLink7" href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#" target="_top">PHP</a> Dev Server WWW</p>
<p>path = /var/www/</p>
<p>public = yes</p>
<p>writable = yes</p>
<p>create mask = 0777</p>
<p>directory mask = 0777</p>
<p>force user = nobody</p>
<p>force group = nogrou</p>
<p>Then, to open the files, I’ve already got the <a id="KonaLink8" href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#" target="_top">IP address</a> in my hosts file (C:\WINDOWS\system32\drivers\etc\hosts):</p>
<p>192.168.252.171 php</p>
<p>So, in Windows Explorer, I can just:</p>
<p>\\php\</p>
<p>and I see my remote directory and the public share right there in Windows.</p>
<p>If the remote directory isn’t mounted, you just get an empty  directory. This is good because, as long as the Linux/Samba portion is  up and running, Windows will map to the directory without complaining:  there just won’t be anything in there. This is good fallback behavior  and beats the heck out of what Windows does when it can’t find the <a id="KonaLink9" href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html#" target="_top">network</a> share at all. All that freaking out with warning dialog after warning dialog drives me nuts.</p>
<p>If you want to make the mapping of the drive semi-automatic, you can  create a Powershell (more on this amazing addition to Windows in a  couple of days) script called something like “map_wyniaorg.ps1″  containing this code:</p>
<p>cls</p>
<p>$Drive = &#8220;J:&#8221;</p>
<p>$UNC = &#8220;\\php\wyniaorg&#8221;</p>
<p># Create the Com object with New-Object -com</p>
<p>$net = New-Object -com WScript.Network;</p>
<p># $net.removenetworkdrive($Drive)</p>
<p>$net.mapnetworkdrive($Drive,$Unc)</p>
<p># Launches the Explorer</p>
<p>$shell = new-object -comObject Shell.Application</p>
<p>$Shell.open($Drive)</p>
<p>While I’ve gotten ssh without a password to work *between* the  Ubuntu VMWare servers I’ve set up (using the instructions all over the  web), I haven’t gotten it to work with the wynia.org ssh setup. So, for  now, I just deal with the password thing.</p>
<p>If the lazy web wants to grant my wishes, what I still want is the easy way to:</p>
<p>1. Do the sshfs mounting automatically.</p>
<p>2. Without passwords.</p>
<p>3. Without logging on to the machine.</p>
<p>4. At bootup.</p>
<p>5. And to make sure that cleanup is done properly at shutdown.</p>
<p>Oh, and I probably missed something, which will become clear the  next time I want to do this on a machine and come back to this article.  However, if you have a problem, let me know and I’ll update.</p>
<p>thanks to: <a href="http://www.wynia.org/wordpress/2007/02/08/sshfs-on-windows-via-samba-shares-on-ubuntu-vmware/" target="_blank">wynia.org</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/disable-unneeded-startup-services.html" rel="bookmark" title="February 15, 2008">Disable Unneeded Startup Services</a> [0 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/install-xp-from-dos.html" rel="bookmark" title="February 15, 2008">Install XP from DOS</a> [0 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/increase-your-cable-modem-or-dsl-speed-in-xp.html" rel="bookmark" title="February 15, 2008">Increase your cable modem or DSL speed in XP</a> [0 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/how-to-setup-a-wi-fi-hotspot.html" rel="bookmark" title="May 23, 2006">How To Setup a Wi-Fi Hotspot</a> [14 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/how-to-install-remote-desktop-using-nx-from-nomachine.html" rel="bookmark" title="November 16, 2008">how to install remote desktop using nx from nomachine</a> [5 Comment(s)]
</li>
</ul>
<p><!-- Similar Posts took 6.881 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to extract multi-part zip files</title>
		<link>http://www.hendra-k.net/how-to-extract-multi-part-zip-files.html</link>
		<comments>http://www.hendra-k.net/how-to-extract-multi-part-zip-files.html#comments</comments>
		<pubDate>Sat, 26 Jan 2008 02:06:38 +0000</pubDate>
		<dc:creator>hendra</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://hendra-k.net/how-to-extract-multi-part-zip-files.html</guid>
		<description><![CDATA[Have you ever seen these file ? zipfiles.zip zipfiles.z01 zipfiles.z02 zipfiles.z03 &#8230;&#8230; zipfiles.z10 These are the multi-part of zipped files, which mean  one big file are to big to make archive so it should split  into several files. These files were created by winzip. Probably for many people (included me) it such a weird file, [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever seen these file ?</p>
<blockquote>
<ul>
<li>zipfiles.zip</li>
<li>zipfiles.z01</li>
<li>zipfiles.z02</li>
<li>zipfiles.z03</li>
<li>&#8230;&#8230;</li>
<li>zipfiles.z10</li>
</ul>
</blockquote>
<p>These are the multi-part of zipped files, which mean  one big file are to big to make archive so it should split  into several files. These files were created by <a title="The convertion utility for window" href="http://www.winzip.com/" target="_blank">winzip</a>. Probably for many people (included me) it such a weird file, and they don&#8217;t know how to extract the file archives.</p>
<p>After my research in whole google how to extract it, here i want to share to you how to extract it.</p>
<blockquote><p><strong>For window platform</strong><br />
There are so many software has support for these extension such as winzip, winrar, 7-zip, and many other, put those file in one folder, and then just click with your supported software above, and whala&#8230;. the file  extracted.</p></blockquote>
<blockquote><p><strong>For linux platform </strong><br />
The problem for newbie user in linux is they don&#8217;t now how to combine the command within. I got the problem too with these platform, but that&#8217;s why i like most with this platform, it challenged me to know. Alright then here the command for solve this problem.</p>
<blockquote><p>hendra-k@server $ cat zipfiles.* &gt; zipfiles-full.zip<br />
hendra-k@server $ zip -F zipfiles-full.zip<br />
hendra-k@server $ unzip zipfiles-full.zip</p></blockquote>
<p>here the description for these command above :</p>
<blockquote><p>hendra-k@server $ cat zipfiles.* &gt; zipfiles-full.zip<br />
= merging those file into one full zipped file</p></blockquote>
<blockquote><p>hendra-k@server $ zip -F zipfiles-full.zip<br />
= Fixing the archive of the overall zipped files</p></blockquote>
<blockquote><p>hendra-k@server $ unzip zipfiles-full.zip<br />
= Extract the full zipped fil</p></blockquote>
</blockquote>
<p>Hope this tutorial is usefull for you<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/how-to-fix-winrar-corrupted-files.html" rel="bookmark" title="March 14, 2008">How to fix Winrar corrupted files</a> [20 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/how-to-install-remote-desktop-using-nx-from-nomachine.html" rel="bookmark" title="November 16, 2008">how to install remote desktop using nx from nomachine</a> [5 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/winrar-product-descriptions.html" rel="bookmark" title="April 15, 2008">WinRAR product descriptions</a> [2 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html" rel="bookmark" title="May 13, 2008">Create network drive using ssh to window env.</a> [1 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/windows-xp-shortcuts-and-tutorial.html" rel="bookmark" title="February 15, 2008">Windows Xp Shortcuts and Tutorial</a> [1 Comment(s)]
</li>
</ul>
<p><!-- Similar Posts took 5.757 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hendra-k.net/how-to-extract-multi-part-zip-files.html/feed</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>How do I add jobs to cron under Linux or UNIX oses?</title>
		<link>http://www.hendra-k.net/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses.html</link>
		<comments>http://www.hendra-k.net/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses.html#comments</comments>
		<pubDate>Sun, 30 Sep 2007 15:54:36 +0000</pubDate>
		<dc:creator>hendra</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://hendra-k.net/?p=104</guid>
		<description><![CDATA[Cron job are used to schedule commands to be executed periodically i.e. to setup commands which will repeatedly run at a set time, you can use the cron jobs. crontab is the command used to install, deinstall or list the tables used to drive the cron daemon in Vixie Cron. Each user can have their [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Cron">Cron</a> job are used to schedule commands to be executed periodically i.e. to setup commands which will repeatedly run at a set time, you can use the cron jobs.</p>
<p>crontab is the command used to install, deinstall or list the tables used to drive the cron daemon in Vixie Cron. Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly. You need to use crontab command for editing or setting up your own cron jobs.<span id="more-84"></span></p>
<p>To edit your crontab file, type the following command:<br />
<code>$ crontab -e</code></p>
<h3>Syntax of crontab</h3>
<p>Your cron job looks like as follows:<br />
<strong>1 2 3 4 5 /path/to/command arg1 arg2</strong></p>
<p>Where,</p>
<ul>
<li>1: Minute (0-59)</li>
<li>2: Hours (0-23)</li>
<li>3: Day (0-31)</li>
<li>4: Month (0-12 [12 == December])</li>
<li>5: Day of the week(0-7 [7 or 0 == sunday])</li>
<li>/path/to/command &#8211; Script or command name to schedule</li>
</ul>
<p>Same above five fields structure can be easily remembered with following diagram:</p>
<pre>* * * * * command to be executed - - - - - | | | | | | | | | ----- Day of week (0 - 7) (Sunday=0 or 7) | | | ------- Month (1 - 12) | | --------- Day of month (1 - 31) | ----------- Hour (0 - 23) ------------- Minute (0 - 59)</pre>
<p>Example(s)<br />
If you wished to have a script named /root/backup.sh run every day at 3am, my crontab entry would look like as follows:<br />
(a) Install your cronjob:<code># crontab -e</code>(b)Append following entry:<code>0 3 * * * /root/backup.sh</code>Run five minutes after midnight, every day:<code>5 0 * * * /path/to/command</code>Run at 2:15pm on the first of every month:<code>15 14 1 * * /path/to/command</code>Run at 10 pm on weekdays:<code> 0 22 * * 1-5 /path/to/command </code>Run 23 minutes after midnigbt, 2am, 4am …, everyday:<code>23 0-23/2 * * * /path/to/command</code>Run at 5 after 4 every sunday:<code>5 4 * * sun /path/to/command</code></p>
<h3>Use of operators</h3>
<p>An operator allows you to specifying multiple values in a field. There are three operators:</p>
<ol>
<li>The asterisk <img src='http://www.hendra-k.net/smilies/yahoo_star.gif' alt='&#40;&#42;&#41;' class='wp-smiley' width='18' height='18' title='&#40;&#42;&#41;' /> : This operator specifies all possible values for a field. For example, an asterisk in the hour time field would be equivalent to every hour or an asterisk in the month field would be equivalent to every month.</li>
<li>The comma (,) : This operator specifies a list of values, for example: “1,5,10,15,20, 25?.</li>
<li>The dash (-) : This operator specifies a range of values, for example: “5-15? days , which is equivalent to typing “5,6,7,8,9,Ã¢â‚¬Â¦,13,14,15? using the comma operator.</li>
</ol>
<h3>How do I disabling Email output?</h3>
<p>By default the output of a command or a script (if any produced), will be email to your local email account. To stop receiving email output from crontab you need to append &gt;/dev/null 2&gt;&amp;1. For example:<code>0 3 * * * /root/backup.sh &gt;/dev/null 2&gt;&amp;1</code>To mail output to particluer email account let us say vivek@nixcraft.in you need to define MAILTO variable to your cron job:<code>MAILTO="vivek@nixcraft.in"<br />
0 3 * * * /root/backup.sh &gt;/dev/null 2&gt;&amp;1</code></p>
<h3>Task:To list your crontab jobs use the command</h3>
<p>Type the following command:<code># crontab -l</code> To remove or erase all crontab jobs use the command:<code># crontab -e</code></p>
<h3>Example Command</h3>
<p>For example: To run a command at 5 past the hour every second hour, every day except Sunday:<code>5 */2 * * 1-6 &lt;command&gt;</code>Crontrab every 5 minutes <code>*/5 * * * * /some/script</code><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/convert-fat32-to-ntfs.html" rel="bookmark" title="February 15, 2008">Convert FAT32 To NTFS</a> [0 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/how-to-setup-a-wi-fi-hotspot.html" rel="bookmark" title="May 23, 2006">How To Setup a Wi-Fi Hotspot</a> [14 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/windows-xp-shortcuts-and-tutorial.html" rel="bookmark" title="February 15, 2008">Windows Xp Shortcuts and Tutorial</a> [1 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/the-easy-money-earner-using-ebay.html" rel="bookmark" title="October 12, 2007">The Easy Money Earner Using eBay</a> [0 Comment(s)]
</li>
<li style="overflow:hidden">
<a href="http://www.hendra-k.net/create-network-drive-using-ssh-to-window-env.html" rel="bookmark" title="May 13, 2008">Create network drive using ssh to window env.</a> [1 Comment(s)]
</li>
</ul>
<p><!-- Similar Posts took 5.932 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hendra-k.net/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

