<?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>Techthrob.com &#187; How-Tos</title>
	<atom:link href="http://techthrob.com/category/howtos/feed/" rel="self" type="application/rss+xml" />
	<link>http://techthrob.com</link>
	<description>Words of Wisdom for Technologists</description>
	<lastBuildDate>Sun, 26 Jun 2011 06:18:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Problems with Secure File Deletion</title>
		<link>http://techthrob.com/2010/10/06/problems-with-secure-file-deletion/</link>
		<comments>http://techthrob.com/2010/10/06/problems-with-secure-file-deletion/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 02:29:03 +0000</pubDate>
		<dc:creator>Jonathan DePrizio</dc:creator>
				<category><![CDATA[How-Tos]]></category>

		<guid isPermaLink="false">http://techthrob.com/?p=757</guid>
		<description><![CDATA[I&#8217;ve written extensively about how to delete files securely on Windows and Linux, including a tutorial on how to integrate secure-deletion tools into Nautilus, and an answer to the question of whether journaled filesystems disrupt secure deletion tools. Now I&#8217;d like to cover one last topic, which is the various items you need to take [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written extensively about <a href="/2010/03/25/howto-delete-files-permanently-and-securely-in-windows/">how to delete files securely on Windows</a> and <a herf="/2009/03/02/howto-delete-files-permanently-and-securely-in-linux/">Linux</a>, including a tutorial on how to <a href="/2010/07/07/adding-a-secure-delete-option-to-nautilus-file-manager-in-linux/">integrate secure-deletion tools into Nautilus</a>, and an answer to the question of whether <a href="/2010/10/04/do-secure-delete-tools-work-with-journaled-filesystems/">journaled filesystems disrupt secure deletion tools</a>.  Now I&#8217;d like to cover one last topic, which is the various items you need to take into consideration when you want to securely delete information.  Some things to consider are:</p>
<ul>
<li class="subSectionHeader">A file that moved around on the hard disk</li>
<p>If a file that you want to securely delete now resides on a certain set of sectors on disk, but previously existed on another part of the disk, it&#8217;s possible that the old &#8216;ghost&#8217; copy of the file could still be recovered assuming it hasn&#8217;t already been overwritten by other data.  The safest way to avoid this is to use a tool to clean all free space on the filesystem (details are in <a href="/2009/03/02/howto-delete-files-permanently-and-securely-in-linux/">my secure deletion article</a>).  If you&#8217;re concerned about multiple overwrites, then you&#8217;ll have to erase the entire disk &#8212; there&#8217;s no way of determining the previous location of the file.</p>
<li class="subSectionHeader">Backups and archives</li>
<p>If a piece of data is important enough that you want to thoroughly delete it, it&#8217;s likely that it was important enough to backup at some point.  You&#8217;ll need to identify any <a href="/2010/08/17/3-types-of-backup-you-need-for-complete-data-protection/">backup or archived copies</a> and make sure to destroy those, too.  If they reside on tape or <a href="http://en.wikipedia.org/wiki/Write_Once_Read_Many">WORM storage</a>, actually going forward with this task might be difficult.  If you backup to the cloud, it might be impossible.</p>
<li class="subSectionHeader">Cache &#8211; Disk and Other</li>
<p>There are many layers of cache that have the potential to store data you wish to shred.  Web browsers cache to the hard disk in order to improve performance, while word processors (and other office applications) often cache to the hard disk to prevent data loss in a crash or sudden power failure.  Additionally, file systems typically have write cache that store data in memory before writing it out to disk, and disks themselves (as well as RAID controllers) are almost always equipped with cache as a method of improving performance.  Every one of these cache locations is a potential storage spot for your private data, and if you want to make sure that your secure deletion is truly secure, you&#8217;ll have to take them into consideration.
</ul>
<p>The lesson is that, when you aim to make sure make sure you delete a file such that it can never be recovered, you need to take more into consideration than simply running &#8216;shred&#8217; against that file.  I hope these tips provide some insight into the other things you&#8217;ll need to do in order to keep your personal data safe.</p>
]]></content:encoded>
			<wfw:commentRss>http://techthrob.com/2010/10/06/problems-with-secure-file-deletion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get a Dynamic Interplanetary Background with Xplanet</title>
		<link>http://techthrob.com/2010/08/04/get-a-dynamic-interplanetary-background-with-xplanet/</link>
		<comments>http://techthrob.com/2010/08/04/get-a-dynamic-interplanetary-background-with-xplanet/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 03:00:30 +0000</pubDate>
		<dc:creator>Jonathan DePrizio</dc:creator>
				<category><![CDATA[How-Tos]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[end-user]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://techthrob.com/?p=518</guid>
		<description><![CDATA[This tutorial will show you how to setup a cool, dynamic wallpaper for your computer based upon XPlanet. The image to left is the final result of this how-to; notice the cloud map and the daylight, which are both periodically updated to match real-time cloud data and sunlight. You can chose to do the same [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://techthrob.com/wp-content/uploads/2010/07/xplanet_as_bg.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/xplanet_as_bg-300x169.png" alt="" title="Xplanet as Background" width="300" height="169" class="alignleft size-medium wp-image-522" style="margin-right: 1.5em; float:left; " /></a>This tutorial will show you how to setup a cool, dynamic wallpaper for your computer based upon XPlanet.  The image to left is the final result of this how-to; notice the cloud map and the daylight, which are both periodically updated to match real-time cloud data and sunlight.  You can chose to do the same thing with your background, or to customize the settings to your individual taste. This article will show you how to configure xplanet to be your desktop background in Gnome, so it will work in either Ubuntu or Fedora.  With a little tweaking to this desktop modification, you should be able to get it to work under most environments and distributions.</p>
<ol>
<li class="sectionHeader">Installing xplanet</li>
<p>	The first thing you’ll need to do is install <code>xplanet</code>.  This can be done quickly and easily from the command line:</p>
<p><span class="distroInstallName">Ubuntu:</span> <span class="distroInstallCommand">sudo apt-get install xplanet</span><br />
<span class="distroInstallName">Fedora:</span> <span class="distroInstallCommand">sudo yum install xplanet</span></p>
<li class="sectionHeader">Running from the command line</li>
<p>Xplanet has lots of options, which you can see in its man page if you run ‘<code>man xplanet</code>’.  I did find that the manual isn’t entirely up to date, however &#8211; it doesn’t list all the map types that xplanet actually supports with the -projections flag.  Nevertheless, the manual is still a good place to start if you’re looking to explore xplanet’s featureset.</p>
<p>You can run xplanet from the command line to get an idea of what kind of map you want to generate, how large it should be, and what options you want to use.  For example, you&#8217;ll probably want to generate an image that fits your screen resolution.  Use the <code>-geometry</code> option to specify the size you want, in pixels.  You can use the <code>-window</code> option while you experiment, until you get the map exactly how you want it:</p>
<div class="linuxCommand">xplanet -projection rectangular -geometry 1360&#215;768 -window</div>
<p>The above are the options that I use, but of course you should play with it until you find something you like.  One thing you&#8217;ll probably want to tweak is the <code>-projection</code> option, which determines what kind of map you want to generate.  Also check out the <code>-latitude</code> and <code>-longitude</code> options to tell xplanet where to center the map; you can set it so your location is at the center of the image, if you want.  Check out the man page for all the details (there are many!).  To help get you started, here are a couple of fun projections and the commands to generate them:</p>
<p>A zoomed-out globe with New York at its center:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/08/ny_center_stars.png"><img src="http://techthrob.com/wp-content/uploads/2010/08/ny_center_stars-300x169.png" alt="" title="Xplanet NY Centric with Stars" width="300" height="169" class="aligncenter size-medium wp-image-595" /></a></p>
<div class="linuxCommand">xplanet  -radius 30 -num_times 1 -latitude 40 -longitude -73  -projection orthographic</div>
<p>You can view more than just the Earth; here&#8217;s a spectacular view of Saturn!<br />
<a href="http://techthrob.com/wp-content/uploads/2010/08/saturn.png"><img src="http://techthrob.com/wp-content/uploads/2010/08/saturn-300x169.png" alt="" title="Saturn in Xplanet" width="300" height="169" class="aligncenter size-medium wp-image-545" /></a></p>
<div class="linuxCommand">xplanet -body saturn -latitude 25</div>
<li class="sectionHeader">Setting the background</li>
<p>Once you’ve picked out the options you want to use for your background, you need to tell xplanet to save it to a file so you can select it as your wallpaper.  Simply use the <code>-output</code> and the <code>-num_times 1 </code> options on the command line and xplanet will run, save the generated image to the file specified by <code>-output</code>, and exit.  Be sure to set the <code>-num_times 1</code> option, or xplanet won&#8217;t close after generating the image.</p>
<p>Next, you’ll want to set your wallpaper to be the saved image.  Do this just like you would normally set your wallpaper; you can go to the System menu in either Ubuntu or Fedora, and under Preferences select Appearance.</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/08/Screenshot-Appearance-Preferences.png"><img src="http://techthrob.com/wp-content/uploads/2010/08/Screenshot-Appearance-Preferences-300x265.png" alt="" title="Setting the Background in Gnome" width="300" height="265" class="aligncenter size-medium wp-image-547" /></a></p>
<p>Or, you can right-click on the desktop and select Change Desktop Background.  Either way, click the “Add” button and add the image you saved with Xplanet.  Now that will be your background.  </p>
<p>But, there’s more to do!</p>
<li class="sectionHeader">Getting the clouds</li>
<p>One of the coolest features of xplanet is that it has the ability to overlay a “cloud map” showing the current cloud coverage on Earth.  If you’ll notice in the screenshot at the beginning of this article, my desktop includes a cloud map overlay.  There are two choices for setting up the cloud map:</p>
<ul class="subUList">
<li>Download a static cloud map</li>
<p>If you don&#8217;t care about having the cloud coverage update itself periodically, you can download a single image and use it whenever xplanet renders the Earth.  Simply save <a href="/everything_else/clouds_2048.jpg">this file</a> somewhere, and proceed to the next section about &#8220;Creating the configuration.&#8221;  Or, for more fun&#8230;</p>
<li>Periodically download an updated cloud map automatically</li>
<p>The other option is to setup a script to periodically download an updated cloud map, so that your wallpaper matches the current cloud coverage of the planet.  It&#8217;s a little tweak, but it&#8217;s definitely fun.  If you decide it&#8217;s worth the effort, here&#8217;s what you need to do:</p>
<ol class="subOList">
<li style="margin-left: 50px;">Setup the script to download the cloudmap automatically</li>
<p>Download <a href="http://xplanet.sourceforge.net//Extras/download_clouds.py">this script</a> and decompress it. This script was written by Michal Pasternak and is in the public domain.  It is useful because it checks if a new cloud map is available before actually downloading it, which saves a lot of bandwidth.</p>
<li style="margin-left: 50px;">Run the script once to generate the cloudmap</li>
<p>Once you&#8217;ve downloaded the script, make it executable by running the following command in its directory:</p>
<div class="linuxCommand">chmod +x download_clouds.py</div>
<p>Next, run the script so it will download the initial cloud map:</p>
<div class="linuxCommand">./download_clouds.py</div>
<p>By default, the script saves the map with a filename of <code>clouds_2048.jpg</code>.
	</ol>
<p>Now continue to the next section, which will show you how to setup the configuration file in order to use the cloud map.  Keep reading to the &#8220;putting it all together&#8221; section to create an automated cron job so the cloud map will update itself periodically. </p>
</ul>
<li class="sectionHeader">Creating the configuration</li>
<p>If you&#8217;re satisfied with the image you generated previously, that&#8217;s fine; you can skip this step.  But if you want to add clouds or lights, you&#8217;ll need to modify the xplanet configuration file to let it know where to find these added goodies.  It&#8217;s done in a text editor, but it&#8217;s pretty simple.  </p>
<p>The easiest way to proceed is to modify the default configuration file, by opening it in either vim or your favorite graphical text editor.  On both Ubuntu and Fedora, the default configuration file is located at <code>/usr/share/xplanet/config/default</code>.  You&#8217;ll need to be root to edit it (optionally, you can copy it to your home directory and then edit it, if you don&#8217;t want to make system-wide changes).</p>
<p>Inside <code>/usr/share/xplanet/config/default</code>, search for the line <code>[earth]</code>, which specifies the options to use when drawing a picture of Earth.  Here&#8217;s my [earth] section of the configuration file:</p>
<div class="linuxCommand">
[earth]<br />
&#8220;Earth&#8221;<br />
color={28, 82, 110}<br />
cloud_map=/home/jdeprizi/bin/xplanet/clouds.jpg<br />
night_map=/home/jdeprizi/bin/xplanet/night_xplanet1.jpg<br />
#marker_file=earth<br />
min_radius_for_label=0<br />
#satellite_file=iss
</div>
<p>While you should certainly check out what happens if you uncomment <code>satellite_file</code> or <code>marker_file</code>, the two things I want to mention are <code>cloud_map</code> and <code>night_map</code>.  The <code>cloud_map</code> option should be set to the image you specified in the section above, &#8220;Getting the clouds.&#8221;  This tells xplanet to overlay the cloud map onto the generated image, and yields a result similar to the screenshot at the beginning of this page. </p>
<p>When you specify the <code>night_map</code> option, xplanet will draw city lights in the part of the Earth where there is no sunlight, like so:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/08/nighttime_lights.jpg"><img src="http://techthrob.com/wp-content/uploads/2010/08/nighttime_lights-300x169.jpg" alt="" title="Xplanet with night_map specified" width="300" height="169" class="aligncenter size-medium wp-image-552" /></a></p>
<p>Your night map should be located in <code>/usr/share/xplanet/images</code> with a file name <code>night.jpg</code>.  In the above example, I copied it into my home directory.</p>
<li class="sectionHeader">Putting it all together &#8211; cronjob and login trigger</li>
<p>Now that you have your background looking just the way you want, you’ll need to configure a scheduled job to make sure that it updates the daylight and the cloudmap automatically.  The easiest way to do this is by <a href="/2010/08/02/how-to-schedule-tasks-with-gnome-scheduler/">scheduling a job using cron and gnome-schedule</a>.  Use the command you came up with above, and schedule a job to run as often as you want &#8212; I generate a new image every 30 minutes.  I also download the cloud map every 12 hours:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/08/gen_clouds_job1.png"><img src="http://techthrob.com/wp-content/uploads/2010/08/gen_clouds_job1-300x262.png" alt="" title="Get Clouds Every 12 Hours" width="300" height="262" class="aligncenter size-medium wp-image-591" /></a></p>
<p>You&#8217;ll also need to have the map generate when you login, especially if your computer is off for long periods of time.  If you don&#8217;t do this, the map won&#8217;t regenerate until the next cronjob kicks off, and you could be looking at a very outdated image for up to an hour.  To have the wallpaper refresh when you first login, simply go to the Startup Applications item under System and then Preferences.  Add a new item with the same command as you used above, to generate your background:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/08/gen_on_startup.png"><img src="http://techthrob.com/wp-content/uploads/2010/08/gen_on_startup-300x156.png" alt="" title="Generate Xplanet on Startup" width="300" height="156" class="aligncenter size-medium wp-image-590" /></a></p>
<p>Now your wallpaper will automatically refresh whenever you login.</p>
<li class="sectionHeader">Now let everyone see!</li>
<p>If you&#8217;ve followed through to this point, you should have a fully-functional xplanet wallpaper that will automatically refresh itself, following the interval you specified.  Awesome!  Show off your work by posting a screenshot to the <a href="http://www.facebook.com/pages/TechThrob/119222218122496#!/pages/TechThrob/119222218122496?v=photos">TechThrob Facebook gallery</a>.  Also, <a href="#commentbox">leave a comment</a> with the options you use to generate your background, so others can see what kind of cool tweaks you&#8217;re using!</p>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://techthrob.com/2010/08/04/get-a-dynamic-interplanetary-background-with-xplanet/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to Schedule Tasks with Gnome-Scheduler</title>
		<link>http://techthrob.com/2010/08/02/how-to-schedule-tasks-with-gnome-scheduler/</link>
		<comments>http://techthrob.com/2010/08/02/how-to-schedule-tasks-with-gnome-scheduler/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 02:41:27 +0000</pubDate>
		<dc:creator>Jonathan DePrizio</dc:creator>
				<category><![CDATA[How-Tos]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://techthrob.com/?p=565</guid>
		<description><![CDATA[If you’ve used Linux for a while you’ve probably learned about cron, which is the system service responsible for executing scheduled tasks. Cron runs in the background, and helps keep your computer running. At scheduled times, it launches programs to rotate log files, check for software updates, and perform other housekeeping jobs. You can also [...]]]></description>
			<content:encoded><![CDATA[<p>If you’ve used Linux for a while you’ve probably learned about <code>cron</code>, which is the system service responsible for executing scheduled tasks.  <code>Cron</code> runs in the background, and helps keep your computer running. At scheduled times, it launches programs to rotate log files, check for software updates, and perform other housekeeping jobs.  You can also use <code>cron</code> to your own advantage and to schedule your own tasks; for example, a routine backup of your home directory, or to check if you have new mail.  The easiest way to schedule tasks in Ubuntu or Fedora is to use the gnome-schedule application. This tutorial will show you how to schedule tasks using the Gnome Scheduler, a graphical front-end for cron.</p>
<div class="sectionHeader">Installation</div>
<p>First, install the gnome-schedule application.  As usual, this is a quick one-liner in most popular distributions:</p>
<p><span class="distroInstallName">Ubuntu:</span><span class="distroInstallCommand">sudo apt-get install gnome-schedule</span><br />
<span class="distroInstallName">Fedora:</span><span class="distroInstallCommand">sudo yum install gnome-schedule</span></p>
<p>Once it’s installed, you should see a new “Scheduled Tasks” application in the System Tools menu.</p>
<div class="sectionHeader">New and existing tasks</div>
<p>The task scheduler gives you three options for creating a new task.  You can chose a recurring task, which is the primary use of gnome-schedule as a frontend for cron.  It also allows you to create a task that runs only once; this actually uses the <code>at</code> service.  </p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/08/Add-a-task.png"><img src="http://techthrob.com/wp-content/uploads/2010/08/Add-a-task-300x263.png" alt="Task Type Selection in Gnome Scheduler" title="Task Type Selection in Gnome Scheduler" width="198" height="173" class="aligncenter size-medium wp-image-568" /></a></p>
<p>Additionally, you can create custom schedule templates; for example, if you want to run tasks on certain holidays, you can create a template for that so you don’t have to re-create the cron rules each time.  Most users won’t need this feature, but it’s nice to have.  </p>
<p>The main window shows you the currently-scheduled tasks:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/08/Screenshot-Configure-Scheduled-Tasks.png"><img src="http://techthrob.com/wp-content/uploads/2010/08/Screenshot-Configure-Scheduled-Tasks-300x107.png" alt="Showing Scheduled Tasts" title="Showing Scheduled Tasts" width="300" height="107" class="aligncenter size-medium wp-image-569" /></a></p>
<p>It&#8217;s a bit spartan, and there&#8217;s definitely no eye candy, but if you&#8217;re at all familiar with cron you&#8217;ll be very comfortable with the output.</p>
<div class="sectionHeader">Scheduling a task</div>
<p>The primary use of gnome-schedule is to setup cronjobs, and it does it very well.  The single-window configuration allows you to specify a name for the job as well as the command to run.  The date and time wizard accepts standard cron syntax, but a major feature is a GUI tool that sets up the schedule for you. </p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/08/scheduling_a_task.png"><img src="http://techthrob.com/wp-content/uploads/2010/08/scheduling_a_task-300x272.png" alt="Configuring a Scheduled Task" title="Configuring a Scheduled Task" width="300" height="272" class="aligncenter size-medium wp-image-577" /></a></p>
<p>For example, by choosing whether you want to run a task every day, every X number of days, or in a range of specific days, you are able to set a schedule with a very high level of precision.  This is the precision that <code>cron</code> is known for, and using gnome-schedule you are able to take this power and implement it via a convenient graphical interface.</p>
<div class="sectionHeader">Creating a one-time-only task</div>
<p>Gnome-schedule can create one-time jobs, in addition to recurring tasks.  Creating a single-instance job actually uses the <code>at</code> daemon rather than cron (advanced users should be familiar with the difference, but from our current perspective it doesn’t matter). When you create a one-time job, you get a simple window to give the job a title and a time to launch, and to say what commands you want to run at the scheduled time.</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/08/schedule-task-editor.png"><img src="http://techthrob.com/wp-content/uploads/2010/08/schedule-task-editor-300x206.png" alt="Editing a one-time task" title="Editing a one-time task" width="300" height="206" class="aligncenter size-medium wp-image-574" /></a></p>
<p>In the above screenshot, I am creating a scheduled task to pop up a reminder window (using Zenity) at 11:55 to tell me that I need to post something to TechThrob (although I assure you, I don&#8217;t need any reminders for that).  Of course, you can use this for anything &#8212; you might want to schedule an alarm to wake you up in the morning, or a reminder to pick something up on the way home.</p>
<p>I find that the single-instance scheduler is actually incredibly useful, perhaps even more useful that the repeating schedule.  I never really used <code>at</code> when it was just a command line utility; I knew it was there, but I didn&#8217;t see a need for it.  Once I started using gnome-schedule, though, I found that scheduling reminders and automated jobs was very easy and incredibly useful.</p>
<div class="sectionHeader">Very useful help</div>
<p>The scheduler is incredibly well documented, and you can read the help by clicking the gnome help icon in the main window.  I ran into a small problem trying to get graphical applications to launch (zenity, in the above example), but I quickly found the answer in the help (you have to specify the DISPLAY variable).  If you&#8217;re curious as to how something works, or you&#8217;re having some problem, I suggest giving the documentation a look before you get frustrated or <a href="http://techthrob.com/2009/03/02/8-ways-to-get-help-with-ubuntu-linu/">ask for help</a>.</p>
<div class="sectionHeader">What do you schedule?</div>
<p>Have you ever used cron before?  What kind of tasks do you have automated with cronjobs?  I&#8217;m also curious to know if others find the cron syntax as confusing as I do &#8211; I&#8217;ve always had to lookup cron syntax when I need to do something more complicated than setting a task to run at a specified minute or hour (hence why I love gnome-schedule&#8217;s GUI so much!).  Leave your thoughts in the comments below!</p>
]]></content:encoded>
			<wfw:commentRss>http://techthrob.com/2010/08/02/how-to-schedule-tasks-with-gnome-scheduler/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>How to Monitor Network Traffic in Linux</title>
		<link>http://techthrob.com/2010/07/26/how-to-monitor-network-traffic-in-linux/</link>
		<comments>http://techthrob.com/2010/07/26/how-to-monitor-network-traffic-in-linux/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 02:50:17 +0000</pubDate>
		<dc:creator>Jonathan DePrizio</dc:creator>
				<category><![CDATA[How-Tos]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://techthrob.com/?p=489</guid>
		<description><![CDATA[I recently covered three utilities you can use to monitor your system resources in Linux. One of those programs, iftop gives you information about the network traffic of your machine. In this article I’ll show the in-depth usage of iftop, as well as another program called nethogs that was recommended by a reader. With these [...]]]></description>
			<content:encoded><![CDATA[<p>I recently covered <a href="http://techthrob.com/2010/07/21/three-apps-for-monitoring-performance-in-linux/">three utilities you can use to monitor your system resources in Linux</a>.  One of those programs, <code>iftop</code> gives you information about the network traffic of your machine.  In this article I’ll show the in-depth usage of iftop, as well as another program called <code>nethogs</code> that was recommended by a reader.  With these two programs you’ll learn how to monitor network usage in Linux, in both Ubuntu and Fedora as well as many other distributions.</p>
<p><em>Note: You&#8217;ll need to be root to run most, if not all, of these commands.</em></p>
<div class="sectionHeader">iftop</div>
<p>I’ve used <code>iftop</code> for a long time, because it’s a very powerful tool that gives you lots of details about your network connections.  Here’s what you need to know about <code>iftop</code> to get started:</p>
<ol>
<li class="sectionHeader">Basic Usage</li>
<p><code>iftop</code> is easy to use if you just want to see your current network connections and how much bandwidth is being used by each remote host.  Simply launch it from the command line, passing the <code>-i</code> option with the interface you want to monitor, and optionally the <code>-B</code> option to display values in bytes (the default is to display in bits).  So for example, to monitor the wlan0 device in bytes, you would run:</p>
<div class="linuxCommand">iftop -i wlan0 -B</div>
<p>There’s a lot of information displayed on the screen, but it is formatted intelligently and quickly becomes easy to digest.  Here is what the basic screen is showing you, when you first launch <code>iftop</code>:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/07/iftop_labeled.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/iftop_labeled-300x191.png" alt="" title="Labeled iftop Output" width="300" height="191" class="aligncenter size-medium wp-image-508" /></a></p>
<p>As you can see, the display is packed full of useful information (click on the image above for a larger version).  Don&#8217;t worry if it&#8217;s a little overwhelming at first; it won&#8217;t take long to get used to reading the display, and you&#8217;ll appreciate having all this information available so quickly.</p>
<p>Now let’s move on to some of the more powerful features that <code>iftop</code> provides.</p>
<li class="sectionHeader">Filtering networks, hosts, and ports</li>
<p>While it’s nice to see all the hosts your computer is talking to, it’s often the case that you’re only interested in a certain segment of the network.  <code>iftop</code> allows you to filter connections by network, host, and port, which gives you complete control over which connections are displayed.</p>
<p><code>iftop</code> accepts <a href="http://www.manpagez.com/man/7/pcap-filter/">pcap-filter formatted filters</a> on the commandline with the <code>-f</code> flag.  Below is a table of some of the filers you might want to use with iftop:</p>
<table class="borderedTable monospaced" style="margin-bottom: 1em;">
<tr >
<td>dst host <em>host</em>		</td>
<td>src host <em>host</em></td>
</tr>
<tr>
<td>dst net <em>net</em>			</td>
<td>src net <em>net</em></td>
</tr>
<tr>
<td>dst port <em>port</em>			</td>
<td>src port <em>port</em></td>
</tr>
<tr>
<td>dst portrange <em>start-end</em>		</td>
<td>src portrange <em>start-end</em></td>
</tr>
<tr>
<td>gateway <em>gateway</em></td>
</tr>
<tr>
<td>ip proto <em>protocol</em></td>
</tr>
</table>
<p>For example, to view only traffic going from your local machine to google.com over eth0, you could run:</p>
<div class="linuxCommand">iftop -i eth0 -f &#8220;dst host google.com&#8221;</div>
<p>Or to see only ssh traffic over wlan0:</p>
<div class="linuxCommand">iftop -i wlan0 -f &#8220;dst port 22&#8243;</div>
<p>Additionally, <code>iftop</code> allows you to set arbitrary filters based upon regular expressions.  It’s important to note that when you specify a filter with a regular expression, you are only filtering the on-screen output, whereas using a pcap filter (above) will filter what iftop actually listens to.  As a result, the totals displayed at the bottom of the screen won&#8217;t be affected by regex filters.  You can press the <code>l</code> key to enter regular expression filters while iftop is running.</p>
<li class="sectionHeader">Controlling the interface and the online help</li>
<p>Once you&#8217;ve got the information you want on the screen, you&#8217;ll need to be able to move around and tweak the exact output.  There are many options, and the easiest thing to do is just hit the <code>h</code> or <code>?</code> key to see the on-screen help:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/07/iftop_help.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/iftop_help-300x208.png" alt="" title="Online Help for iftop" width="300" height="208" class="aligncenter size-medium wp-image-503" /></a></p>
<p>Notice that you can toggle things like hostname and port resolution, port display, and whether iftop sorts by destination or source.  Showing connections by port is useful for monitoring throughput on programs that create many connections, while turning DNS resolution on might make it easier to read the display if you are watching things like web traffic.</p>
</ol>
<div class="sectionHeader">nethogs</div>
<p>Now I’ll show you how to use <code>nethogs</code>, which is a great little program that was mentioned by one of TechThrob’s readers (thanks, dasen!).  Whereas <code>iftop</code> displays network usage by destination IP address and port number, <code>nethogs</code> takes a process-oriented approach and shows you usage based on the program that is accessing the network.</p>
<p><code>nethogs</code> is much simpler than iftop and doesn’t have as many options.  You can specify the interface to listen on when you launch it:</p>
<div class="linuxCommand">nethogs eth1</div>
<p>Which will give you a screen similar to the following, showing the processes that are sending or receiving traffic on that interface.</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/07/nethogs.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/nethogs-300x208.png" alt="" title="Nethogs Output" width="300" height="208" class="aligncenter size-medium wp-image-504" /></a></p>
<p>While it’s running, you can use the <code>m</code> key to toggle between units (megabytes, kilobytes, and bytes) and to change whether you are viewing instantaneous throughput or the total throughput since nethogs was started.</p>
<p>Being so simple is the greatest advantage of nethogs, since it makes it much more user-friendly than iftop and lets you see in an instant what applications are using your network, and how much bandwidth they are using.  If you think your network is being hammered and you want to know who to hold responsible, <code>nethogs</code> is probably the command you want.</p>
<div class="sectionHeader">Don&#8217;t be evil</div>
<p>With great power comes great responsibility.  If you have root on a machine that is routing a lot of traffic, tools like this will let you see what people are doing on the network; don&#8217;t be evil.  Use these tools to monitor your own traffic, and to troubleshoot problems, but don&#8217;t spy on other people.  </p>
]]></content:encoded>
			<wfw:commentRss>http://techthrob.com/2010/07/26/how-to-monitor-network-traffic-in-linux/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Three Apps For Monitoring Performance In Linux</title>
		<link>http://techthrob.com/2010/07/21/three-apps-for-monitoring-performance-in-linux/</link>
		<comments>http://techthrob.com/2010/07/21/three-apps-for-monitoring-performance-in-linux/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 11:20:16 +0000</pubDate>
		<dc:creator>Jonathan DePrizio</dc:creator>
				<category><![CDATA[How-Tos]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://techthrob.com/?p=435</guid>
		<description><![CDATA[Most Linux users are familiar with the top command. Top shows you a list of processes on your system and provides a ton of useful information such as their CPU usage and owner. Unfortunately, this isn’t always enough data and many people don’t know where to turn next. This article covers three performance monitoring applications [...]]]></description>
			<content:encoded><![CDATA[<p>Most Linux users are familiar with the <code>top</code> command.  <code>Top</code> shows you a list of processes on your system and provides a ton of useful information such as their CPU usage and owner.  Unfortunately, this isn’t always enough data and many people don’t know where to turn next.  This article covers three performance monitoring applications that show information <code>top</code> doesn’t tell you, and can greatly help in troubleshooting bottlenecks or just finding out more about your system.  These utilities are <code>iftop</code>, <code>iotop</code>, and <code>pv</code>.</p>
<ol>
<li class="sectionHeader">iftop</li>
<p>As you might be able to deduce from the name, <code>iftop</code> is a top-like application for network interfaces.  You need to be root to run it, and it can be installed using the command:</p>
<p><span class="distroInstallName">Ubuntu:</span> <span class="distroInstallCommand">sudo apt-get install iftop</span><br />
<span class="distroInstallName">Fedora:</span> <span class="distroInstallCommand">sudo yum install iftop</span></p>
<p>Run it in a terminal by specificying the interface you want to use, and optionally a -B (make sure you use a capital B) to display values in bytes rather than bits:</p>
<div class="linuxCommand">
# iftop -i eth3 -B
</div>
<p>The result is a screen showing you all the current connections on that port, as well as the throughput for each connection.  Like <code>top</code>, iftop is full of features; press the <code>h</code> key to get an online help showing the options.</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/07/iftop.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/iftop-300x208.png" alt="" title="iftop displaying bandwidth usage" width="300" height="208" class="aligncenter size-medium wp-image-447" /></a></p>
<p>Here you can see my network throughput as I run a speed test on dslreports.com.  You&#8217;ll notice that there are separate indicators for incoming and outgoing traffic, and that three values are given on the right-hand side; these are the 2, 10, and 40 second averages.</p>
<p>If you find iftop useful, you might want to read more about <a href="http://techthrob.com/2010/07/26/how-to-monitor-network-traffic-in-linux/">monitoring network traffic</a>.</p>
<li class="sectionHeader">iotop</li>
<p>While <code>iftop</code> is great for monitoring network throughput, <code>iotop</code> is the utility you want if you need to measure disk access.  It&#8217;s easily installable from the commandline:</p>
<p><span class="distroInstallName">Ubuntu:</span> <span class="distroInstallCommand">sudo apt-get install iotop</span><br />
<span class="distroInstallName">Fedora:</span> <span class="distroInstallCommand">sudo yum install iotop</span></p>
<p>And you can run it with a simple <code>sudo iotop</code> command.  What you&#8217;ll get is a listing of processes, like in top, but with their disk access information:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/07/iotop.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/iotop-300x208.png" alt="" title="IOTop showing disk access" width="300" height="208" class="aligncenter size-medium wp-image-451" /></a></p>
<p>In the above screenshot, I&#8217;m running a simple <code>dd</code> test to write to my local hard disk, which you can see as the first item in the window.  </p>
<p><code>iotop</code> will tell you how much data each process is reading and writing, as well as if a process is using swap (which can be really helpful if you need to determine which process is thrashing your disk).</p>
<li class="sectionHeader">pv</li>
<p>The <code>pv</code> command isn’t a top-like application at all, but I’ve found it incredibly useful and I wanted to share it with you here.  The <code>pv</code> utility is used between pipes on a command line and measures the speed of data throwing through that pipe. For example, here I am using <code>pv</code> to measure how quickly data is flowing between two <code>dd</code> commands:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/07/pv.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/pv-300x78.png" alt="" title="pv" width="300" height="78" class="aligncenter size-medium wp-image-462" /></a></p>
<p>Installing <code>pv</code> is a simple one-liner:</p>
<p><span class="distroInstallName">Ubuntu:</span> <span class="distroInstallCommand">sudo apt-get install pv</span><br />
<span class="distroInstallName">Fedora:</span> <span class="distroInstallCommand">sudo yum install pv</span></p>
<p>This is a great way to see how quickly one command is passing data to another command, when neither command is giving any output to report on its progress.  If you&#8217;ve ever setup a pipe on the command line and wondered if it was actually doing anything, <code>pv</code> is the command you&#8217;ve been looking for.  You can use it not only when you need to know the speed of data moving through a pipe, but whether there is any data moving <em>at all</em>.</p>
<li class="sectionHeader">latencytop</li>
<p>I wanted to give a quick mention to <code>latencytop</code> since I&#8217;m sure someone will ask about it if I don&#8217;t mention it.  <code>latencytop</code> is a tool that shows you what resources a given process (or processes) are <em>waiting</em> for on your system.  For example, it can tell you that a program is waiting on disk I/O or waiting to get a file lock.  <code>latencytop</code> is a great tool, but on the whole it&#8217;s more useful for developers than end-users.  If you&#8217;re interested, this is what it looks like:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/07/latencytop.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/latencytop-300x205.png" alt="" title="latencytop" width="300" height="205" class="aligncenter size-medium wp-image-459" /></a></p>
<p>And this is how to install it:</p>
<p><span class="distroInstallName">Ubuntu:</span> <span class="distroInstallCommand">sudo apt-get install latencytop</span><br />
<span class="distroInstallName">Fedora:</span> <span class="distroInstallCommand">sudo yum install latencytop</span></p>
</ol>
<div class="sectionHeader">Sound off: what are your tools?</div>
<p>Did I miss your favorite tool?  What are your go-to commands when your system performance isn&#8217;t what it should be?  Leave your helpful tips in the comment section below!</p>
]]></content:encoded>
			<wfw:commentRss>http://techthrob.com/2010/07/21/three-apps-for-monitoring-performance-in-linux/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Adding a Secure Delete Option to Nautilus File Manager in Linux</title>
		<link>http://techthrob.com/2010/07/07/adding-a-secure-delete-option-to-nautilus-file-manager-in-linux/</link>
		<comments>http://techthrob.com/2010/07/07/adding-a-secure-delete-option-to-nautilus-file-manager-in-linux/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 12:18:28 +0000</pubDate>
		<dc:creator>Jonathan DePrizio</dc:creator>
				<category><![CDATA[How-Tos]]></category>
		<category><![CDATA[end-user]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://techthrob.com/?p=363</guid>
		<description><![CDATA[I&#8217;ve previously written about how to securely and permanently delete files in Linux and Windows. The programs I mentioned in those tutorials were all command-line baed, but this tutorial will show you how to add a secure-delete option to the contextual menu in Ubuntu and Fedora Linux. Install the Nautilus Actions Configuration utility First, install [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve previously written about how to securely and <a href="/2009/03/02/howto-delete-files-permanently-and-securely-in-linux/">permanently delete files in Linux</a> and <a href="/2010/03/25/howto-delete-files-permanently-and-securely-in-windows/">Windows</a>.  The programs I mentioned in those tutorials were all command-line baed, but this tutorial will show you how to add a secure-delete option to the contextual menu in Ubuntu and Fedora Linux. </p>
<ol>
<li class="sectionHeader">Install the Nautilus Actions Configuration utility</li>
<p>First, install the nautilus-actions package, which provides a graphical utility for editing the Nautilus right-click menu.  We’ll use this utility to add the secure delete option.  You can install the nautilus-actions package by using the following command:</p>
<table border=1>
<tr>
<td>Fedora</td>
<td>Ubuntu</td>
</tr>
<tr>
<td>sudo yum install nautilus-actions</td>
<td>sudo apt-get install nautilus-actions</td>
</tr>
</table>
<p>Once installed, you can configure the new menu option.</p>
<li class="sectionHeader">Configure the new menu option</li>
<p>Now you should have an option in the Preferences menu called “Nautilus Actions Configuration.”  This will allow you to specify the new option for securely deleting files from the file manager.  Click the “define new action” button (or select it from the file menu).  Specify the information as shown below (feel free to use whatever text you want as the label and tooltip; this is up to you!):</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/07/shred_config_1.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/shred_config_1-300x216.png" alt="" title="Configure Action" width="300" height="216" class="aligncenter size-medium wp-image-366" /></a></p>
<p>Next, click the “Command” tab.  This is where you’ll specify what the new menu item will actually do when it’s clicked.  As you see below, I am using the shred program as my secure-delete method, which is located at /usr/bin/shred.  For the paramters, I need to specify -u in order to have shred delete the file once it’s been overwritten.  </p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/07/shred_config_2.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/shred_config_2-300x216.png" alt="" title="Configure Command" width="300" height="216" class="aligncenter size-medium wp-image-367" /></a></p>
<p>Clicking the “legend” button shows that the option to pass a list of files to the commandline is %M.  So my full paramters string becomes “-u %M”.  You should feel free to customize the command however you like, by reading the manpage for the command you are using, and by referencing the legend to figure out which substitution strings to use.  For example, you might want to use the “-z” option for shred, which will use a final pass of zeros, to “hide” that the file has been shredded, or the “-n” option to specify the number of passes to use.</p>
<p>Finally, you’ll want to set the conditions under which the menu item appears.  In the “Conditions” tab, I’ve selected for the secure delete option to appear only when files are selected, and to allow it to be used on multiple files at once.  Here is how my Conditions tab looks:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/07/shred_config_3.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/shred_config_3-300x216.png" alt="" title="Configure Conditions" width="300" height="216" class="aligncenter size-medium wp-image-368" /></a></p>
<p>With that, double-check that you’ve entered everything correctly, and click “Save” in the file menu.</p>
<li class="sectionHeader">Test it out</li>
<p>That’s all you need to do &#8212; the only thing left is to test that it works.  Find some files you want to shred, or create a few dummy files (obviously don’t use this on data you need to keep!).  I used a <a href="/2010/03/22/the-basics-of-the-bash-for-loop/">bash &#8220;for&#8221; loop</a> to create a few test files, and then opened Nautilus to the directory where I put them.</p>
<div style="text-align: center;">
<a href="http://techthrob.com/wp-content/uploads/2010/07/deleting_multiple_files.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/deleting_multiple_files-300x214.png" alt="" title="Secure Delete in Nautilus" width="180" height="126" style="padding-right: 5px;" /></a> <a href="http://techthrob.com/wp-content/uploads/2010/07/shred_in_top.png"><img src="http://techthrob.com/wp-content/uploads/2010/07/shred_in_top-300x208.png" alt="" title="Showing Shred in Top" width="180" height="126" style="padding-left: 5px;" /></a>
</div>
<p>Selecting them all and right-clicking, I see the secure deletion option.  Clicking it and watching in “top” shows that it is working correctly.  Those files are gone!</p>
<li class="sectionHeader">You can use this for anything!</li>
<p>The nautilus-actions utility can be used for more than just adding secure-deletion options to the file manager; you can use it to execute any command-line operation you want.  What are some things that you might add to the Nautilus menu?  What other file manager hacks do you find useful?  Leave your ideas in the comments below!</p>
<p>8SQHVUP4GCZ8</p>
]]></content:encoded>
			<wfw:commentRss>http://techthrob.com/2010/07/07/adding-a-secure-delete-option-to-nautilus-file-manager-in-linux/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Find Which Package owns a File in Linux</title>
		<link>http://techthrob.com/2010/06/26/find-which-package-owns-a-file-in-linux/</link>
		<comments>http://techthrob.com/2010/06/26/find-which-package-owns-a-file-in-linux/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 16:39:09 +0000</pubDate>
		<dc:creator>Jonathan DePrizio</dc:creator>
				<category><![CDATA[How-Tos]]></category>
		<category><![CDATA[end-user]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://techthrob.com/?p=280</guid>
		<description><![CDATA[Sometimes it is necessary to find out which package is responsible for a particular file on a Linux machine. This article explains how to identify the package that owns a file on Ubuntu or Fedora Linux (it applies to any distribution using deb or RPM, so it will also work in Debian, RedHat, etc&#8230;) Deb-based [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is necessary to find out which package is responsible for a particular file on a Linux machine.  This article explains how to identify the package that owns a file on Ubuntu or Fedora Linux (it applies to any distribution using deb or RPM, so it will also work in Debian, RedHat, etc&#8230;)</p>
<div class="sectionHeader">Deb-based Distributions: Debian, Ubuntu, etc..</div>
<p>To identify the package that owns a file in Ubuntu or other deb-based distributions, you want to use the dpkg-query command with the -S option, in the form: <code>dpkg-query -S /path/to/file</code></p>
<p>So, for example, if you wanted to find the owner of /usr/bin/gst-feedback-0.10, your terminal should appear as:</p>
<div class="linuxBox">
jdeprizi@orion:~$ dpkg-query -S /usr/bin/gst-feedback-0.10 <br />
gstreamer0.10-tools: /usr/bin/gst-feedback-0.10<br />
jdeprizi@orion:~$
</div>
<div class="sectionHeader">RPM-based Distributions: Fedora, RedHat, etc..</div>
<p>Similarly, you can find the RPM that owns or installed a file in Fedora or RedHat with the <code>rpm -qf</code> command.  Here is an example:</p>
<div class="linuxBox">
[jdeprizi@pioneer ~]$ rpm -qf /usr/bin/gst-feedback-0.10 <br />
gstreamer-0.10.29-1.fc13.i686<br />
[jdeprizi@pioneer ~]$
</div>
<div class="sectionHeader">A quick caveat</div>
<p>For either of these commands to work, the package owning the file must be installed.  This is necessary because the ownership needs to be registered with the package manager.</p>
]]></content:encoded>
			<wfw:commentRss>http://techthrob.com/2010/06/26/find-which-package-owns-a-file-in-linux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Identifying and Resolving IP Address Conflicts with Linux</title>
		<link>http://techthrob.com/2010/06/10/identifying-and-resolving-ip-address-conflicts-with-linux/</link>
		<comments>http://techthrob.com/2010/06/10/identifying-and-resolving-ip-address-conflicts-with-linux/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 12:25:41 +0000</pubDate>
		<dc:creator>Jonathan DePrizio</dc:creator>
				<category><![CDATA[How-Tos]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://techthrob.com/?p=297</guid>
		<description><![CDATA[One of the most frustrating problems a network administrator can come across is an IP address conflict, when two or more machines on a network try to use the same IP. The result is typically that some packets on the network go to one machine, and some packets go to the other – leading to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.techthrob.com/"><img src="http://techthrob.com/wp-content/uploads/2010/06/3054488331_4cc712f620_b-300x201.jpg" alt="How I feel when I have an IP conflict on my network; attribution http://www.flickr.com/photos/couragextoxlive/3054488331/" title="3054488331_4cc712f620_b" width="214" height="144" class="alignright size-medium wp-image-305" /></a>One of the most frustrating problems a network administrator can come across is an IP address conflict, when two or more machines on a network try to use the same IP.  The result is typically that some packets on the network go to one machine, and some packets go to the other – leading to intermittent packet loss and dropped connections.  </p>
<p>Luckily, however, resolving IP address conflicts is easy if you know the right tools.  This how to will teach you to find and resolve IP address conflicts on your network.</p>
<div class="sectionHeader">Tools</div>
<p>In order to identify the IP address conflict, you are going to need a Linux machine on the subnet that has the conflict, and a copy of arp-scan.  You can install arp-scan on Fedora/RedHat or Ubuntu by using the following commands:</p>
<table border="1">
<tbody>
<tr>
<td>Fedora/RedHat</td>
<td>Ubuntu</td>
</tr>
<tr>
<td>sudo yum install arp-scan</td>
<td>sudo apt-get install arp-scan</td>
</tr>
</tbody>
</table>
<p>Once arp-scan is installed, you&#8217;re just one step away from identifying (and punishing) the perpetrators!</p>
<div class="sectionHeader">Finding the IP Conflict</div>
<p>Finding an IP conflict is as simple as a single command, “arp-scan -l”.  You may also wish to specify the -I option, which will allow you to pick an interface.  Below, I have identified an IP address that is being claimed by two machines:</p>
<div class="linuxBox">[root@pioneer jdeprizi]# arp-scan  -I eth0 -l<br />
Interface: eth0, datalink type: EN10MB (Ethernet)<br />
Starting arp-scan 1.7 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)<br />
192.168.0.1	00:0f:b5:0f:f5:7e	NETGEAR Inc<br />
192.168.0.4	00:1d:09:29:77:7f	Dell Inc<br />
192.168.0.5	c4:17:fe:8c:5f:de	(Unknown)<br />
192.168.0.9	00:21:85:c2:30:6b	MICRO-STAR INT&#8217;L CO.,LTD.<br />
192.168.0.9	00:20:6b:c6:12:04	Intel Corporate (DUP: 2)<br />
192.168.0.11	00:0d:4b:45:db:b7	Roku, LLC<br />
192.168.0.100	00:14:d1:c5:91:00	TRENDware International, Inc.</p>
<p>7 packets received by filter, 0 packets dropped by kernel<br />
Ending arp-scan 1.7: 256 hosts scanned in 1.737 seconds (147.38 hosts/sec).  7 responded</p>
</div>
<p>Notice that 192.168.0.9 is being claimed by two machines, and that the second machine is marked as a duplicate.  I can tell that one of the machines has a Network Interface Card manufactured by MICRO-STAR and one of the machines has a NIC made by Intel.  Using this information, it becomes much easier to track down and fix the IP conflict on my network.</p>
<div class="sectionHeader">Conclusion</div>
<p>Arp-scan is a very powerful tool, and I would definitely encourage network administrators to learn about its many options.  Identifying machines that have an IP address conflict is just one use of the arp-scan tool, but it makes it one of my favorite programs in my toolbox.</p>
<p>What about you?  What are the networking tools that you couldn&#8217;t live without?<br />
<small>Image attribution http://www.flickr.com/photos/couragextoxlive/3054488331/</small></p>
]]></content:encoded>
			<wfw:commentRss>http://techthrob.com/2010/06/10/identifying-and-resolving-ip-address-conflicts-with-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sharing a Keyboard and Mouse Between Systems with Synergy</title>
		<link>http://techthrob.com/2010/06/06/sharing-a-keyboard-and-mouse-between-systems-with-synergy/</link>
		<comments>http://techthrob.com/2010/06/06/sharing-a-keyboard-and-mouse-between-systems-with-synergy/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 03:15:46 +0000</pubDate>
		<dc:creator>Jonathan DePrizio</dc:creator>
				<category><![CDATA[How-Tos]]></category>
		<category><![CDATA[end-user]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://techthrob.com/?p=246</guid>
		<description><![CDATA[Many power users have multiple computers setup in their office or on their desks, which typically results in either multiple keyboards, mice, and monitors, or the use of a KVM switch to change between each machine individually. There are downsides to both of these solutions; multiple keyboards take up lots of space and can be [...]]]></description>
			<content:encoded><![CDATA[<p>Many power users have multiple computers setup in their office or on their desks, which typically results in either multiple keyboards, mice, and monitors, or the use of a KVM switch to change between each machine individually.  There are downsides to both of these solutions; multiple keyboards take up lots of space and can be uncomfortable to use, while KVM only lets you manipulate a single machine at a time.</p>
<p>A solution to this problem is to use a program called Synergy, which allows you to use a single keyboard and mouse between multiple computers, even across different operating systems.  This article will explain how to  share a keyboard and mouse between systems in three painless steps.  (Note that Synergy only lets you share input devices; each machine will still require its own monitor.  That&#8217;s the whole idea!)</p>
<div class="sectionHeader">Getting the Software</div>
<p>Synergy is a free, open source utility that you can download from <a href="http://synergy2.sourceforge.net">http://synergy2.sourceforge.net</a>.  It has support for all the major platforms, including Windows, Mac OS X, and UNIX-like systems (for example, a Linux system running X-Windows).  For this particular tutorial, I&#8217;ll be installing Synergy on Windows by downloading the Synergy Installer for Windows, and on Fedora Linux I am installing QuickSynergy via YUM.  For Ubuntu or Fedora, you can install QuickSynergy with the appropriate command:</p>
<table style="border: 1px solid black; text-align: center; width: 70%; margin-bottom: 1em;">
<tbody>
<tr style="background-color: lightgrey; border: 1px solid black; padding: 1em;">
<td>Fedora Linux</td>
<td>Ubuntu Linux</td>
</tr>
<tr>
<td>sudo yum install quicksynergy</td>
<td>sudo apt-get install quicksynergy</td>
</tr>
</tbody>
</table>
<div class="sectionHeader">Setting it all up</div>
<p>Once you&#8217;ve installed Synergy, setting it up is pretty straight-forward. Synergy uses as client/server configuration, where the client connects to the server and uses the server&#8217;s keyboard and mouse for control.   So, the first thing you need to decide is which keyboard and mouse set you are going to use.</p>
<p>In my setup, I am using the Linux system&#8217;s keyboard and mouse; this means that the Linux system will act as the server, and the Windows machine will act as a cilent.  There is no restriction here; you can use the Windows system as the server and the Linux machine as the client if you prefer.  The only thing to know is that the computer whose input devices you want to use is the server, and the rest are clients.</p>
<div class="sectionHeader">Step One: Configuring the Server</div>
<p>As stated above, the server is the machine whose keyboard/mouse you are going to use and you should configure the server side first.  In my case this is the Linux system, so I am going to launch QuickSynergy (which installed itself into the Gnome menu under &#8220;Applications&#8221; and &#8220;Internet&#8221;) and select the &#8220;Share&#8221; tab.  Here, simply enter the hostname of the clients you want to share the keyboard/mouse with; in my case, the hostname of my Windows machine is &#8220;spirit&#8221; and it is to the right side of my Linux box, so my configuration looks as follows:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/06/Linux-QuickSynergy.png"><img src="http://techthrob.com/wp-content/uploads/2010/06/Linux-QuickSynergy.png" alt="Sharing Keyboard in Linux via QuickSynergy" title="Sharing Keyboard in Linux via QuickSynergy" width="334" height="386" class="aligncenter size-full wp-image-272" /></a></p>
<p>Once you&#8217;ve done this, it is as simple as clicking on &#8220;Execute&#8221; to launch the Synergy server.  Now the Synergy program will sit in the background and wait for a client to connect.  If you wanted to use the Linux machine as a client rather than a server, you would just click the &#8220;Use&#8221; tab instead, and input the IP address or hostname of the machine whose keyboard and mouse you want to use.  </p>
<div class="sectionHeader">Step Two: Configuring the Clients</div>
<p>Once the server has been configured, you can setup the clients to connect to it.  These are the machines that will use the keyboard and mouse of the server.  In my setup, I have a single Windows 7-based client, although you can configure up to 4 clients (one for each direction; top, bottom, left, and right) to share a single server&#8217;s input controls.</p>
<p>I&#8217;ve already installed the synergy package on the Windows client (see above for instructions), so all I have to do is configure it to connect to my Linux server.  The configuration here is very simple &#8212; just enter the IP address (or host name, if it is resolvable on your network) of the Synergy server, and press Start:</p>
<p><a href="http://techthrob.com/wp-content/uploads/2010/06/windows_client.png"><img src="http://techthrob.com/wp-content/uploads/2010/06/windows_client.png" alt="Windows Synergy Client" title="Windows Synergy Client" width="457" height="351" class="aligncenter size-full wp-image-273" /></a></p>
<p>Now you should be able to your system&#8217;s mouse freely between the two desktops!  Your keyboard input will be directed to the system on which the mouse is located at that moment.  Synergy even supports copying clipboard data between the machines, which is awesome (although I&#8217;ve had some problems copying images in the clipboard).</p>
<div class="sectionHeader">A note about firewalls</div>
<p>It&#8217;s important to point out that, as is the case with running any server, you have to make sure that your firewall settings allow clients to connect on the specified port.  Synergy server runs on port 24800, so make sure that your local firewall allows connections on this port.  If you want to be really secure, you can limit the firewall to only accept connections from the client&#8217;s IP, making sure that no one but the approved client is able to use your keyboard and mouse &#8212; probably not a bad idea if you are on a public network. </p>
<div class="sectionHeader">Conclusion</div>
<p>That&#8217;s it!  Now you can put away that second keyboard and mouse (or, if your machine is a laptop, you can now avoid twisting your wrists to type on multiple keyboards) and control all your computers with just one set of input devices.</p>
]]></content:encoded>
			<wfw:commentRss>http://techthrob.com/2010/06/06/sharing-a-keyboard-and-mouse-between-systems-with-synergy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to disable command-not-found in Ubuntu</title>
		<link>http://techthrob.com/2010/06/04/how-to-disable-command-not-found-in-ubuntu/</link>
		<comments>http://techthrob.com/2010/06/04/how-to-disable-command-not-found-in-ubuntu/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 02:01:12 +0000</pubDate>
		<dc:creator>Jonathan DePrizio</dc:creator>
				<category><![CDATA[How-Tos]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://techthrob.com/?p=263</guid>
		<description><![CDATA[If you make a typo on the command line in Ubuntu, or if you type the name of a command that doesn&#8217;t exist, the system will automatically provide you with a list of commands that are similar to what you entered; or, if the command exists but the package it belongs to is not installed, [...]]]></description>
			<content:encoded><![CDATA[<p>If you make a typo on the command line in Ubuntu, or if you type the name of a command that doesn&#8217;t exist, the system will automatically provide you with a list of commands that are similar to what you entered; or, if the command exists but the package it belongs to is not installed, it will provide you with the name of the package that you need to install to get that command.  However, this feature does slow down the shell, and if you use the command line often, it does get to be annoying.  This article will show you how to disable the command suggestion feature in Ubuntu.</p>
<p>8SQHVUP4GCZ8 </p>
<div class="sectionHeader">Example Output of the Command Suggestion Feature</div>
<p>Just so we&#8217;re all on the same page, this is the feature I am going to disable:</p>
<p>This is what happens if you make a typo typing a command; it will try to give you a &#8220;command spell check&#8221;:</p>
<div class="linuxBox">
root@spirit:/usr/share# picco<br />
No command &#8216;picco&#8217; found, did you mean:<br />
Command &#8216;pico&#8217; from package &#8216;nano&#8217; (main)<br />
Command &#8216;pico&#8217; from package &#8216;alpine-pico&#8217; (universe)<br />
picco: command not found
</div>
<p>Or, if you type a command that does exist, but is not installed:</p>
<div class="linuxBox">
root@spirit:/usr/share# vim<br />
The program &#8216;vim&#8217; can be found in the following packages:<br />
 * vim<br />
 * vim-gnome<br />
 * vim-tiny<br />
 * vim-gtk<br />
 * vim-nox<br />
Try: apt-get install &lt;selected package&gt;
</div>
<div>
<div class="sectionHeader">Disabling the Command Suggestion Feature in Ubuntu</div>
<p>There are two things you need to do to disable this feature.  The first is to remove the package that provides the feature, and the second is to do a quick workaround to bypass a <a href="https://bugs.launchpad.net/ubuntu/+source/bash/+bug/561046">bug</a> which makes the package removal only partially complete.</p>
<p><strong>Step one: Remove the command-not-found package.</strong></p>
<div class="linuxBox">sudo apt-get remove command-not-found</div>
<p>If you try executing a non-existent command now, you&#8217;ll see that you&#8217;ll get a Python error, as shown below.  This is because of the bug referenced above.</p>
<div class="linuxBox">
root@spirit:/usr/share# picco<br />
/usr/bin/python: can&#8217;t find &#8216;__main__.py&#8217; in &#8216;/usr/share/command-not-found&#8217;
</div>
<p><strong>Step Two: To work around this bug, we simply need to run the following command:</strong></p>
<div class="linuxBox">sudo mv /usr/share/command-not-found /usr/share/command-not-found.bak</div>
<p>You need to restart your shell for the change to take affect, but once you open a new terminal you&#8217;ll see the classic &#8220;command not found&#8221; bash error:</p>
<div class="linuxBox">
root@spirit:/home/jdeprizi# picco<br />
bash: picco: command not found
</div>
<div class="sectionHeader">Re-Enabling the Command Suggestion Feature</div>
<p>If, in the future, you decide that you want to re-enable the command suggestion, here is how:</p>
<div class="linuxBox">
sudo apt-get install command-not-found<br />
sudo mv /usr/share/command-not-found.bak /usr/share/command-not-found
</div>
<p>That&#8217;s all it takes &#8212; just close your terminal and open it again, and you will have the command suggestion available again.</p>
]]></content:encoded>
			<wfw:commentRss>http://techthrob.com/2010/06/04/how-to-disable-command-not-found-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

