<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="/css/rss-browser.css" ?>
<rss version="2.0">
	<channel>
		<title>Perturb.org - Scott's Geek Stuff</title>
		<link>http://www.perturb.org/</link>
		<description>Just Geek Stuff</description>

		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1125/</guid>
			<title>Fedora/RedHat persistent multicast route</title>
			<link>http://www.perturb.org/display/entry/1125/</link>
			<description>&lt;p&gt;I needed to add a persistent (after a reboot) route for multicast. I created a file called &lt;strong&gt;/etc/sysconfig/network-scripts/route-eth0&lt;/strong&gt; and put this in it:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;224.0.0.0/4 dev eth0
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;This says route the entire multicast section of IPV4 through eth0. This ensures that your IGMP requests go out the appropriate port.&lt;/p&gt;
		</description>
			<pubDate>Fri, 03 May 2013 11:18:00 -0700</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1124/</guid>
			<title>Remove files created more than 30 days ago</title>
			<link>http://www.perturb.org/display/entry/1124/</link>
			<description>&lt;p&gt;I wanted to find all the files in a certain directory that were created more than 30 days ago. I started with:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;find /path/to/dir -ctime +30
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;This was finding directories also, so I added &lt;strong&gt;-type&lt;/strong&gt;&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;find /path/to/dir -ctime +30 -type f
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;This listed all the files I wanted, so I just passed &lt;strong&gt;-exec&lt;/strong&gt;&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;find /path/to/dir -ctime +30 -type f -exec rm {} +
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;The {} in the &lt;strong&gt;-exec&lt;/strong&gt; is replaced with the file names found, so all the files are removed.&lt;/p&gt;
		</description>
			<pubDate>Thu, 11 Apr 2013 14:26:02 -0700</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1123/</guid>
			<title>Perl: Increment a number in a text file</title>
			<link>http://www.perturb.org/display/entry/1123/</link>
			<description>&lt;p&gt;I have a manifest file that contains a build_version=XX number field (among a lot of others) that I want to automatically increment. I found a simple Perl one liner that searches a file and does a search and replace that can perform some math.&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;perl -pi -e 's/(build_version)=(\d+)/&quot;build_version=&quot; . ($2 + 1)/e' manifest
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;In this example the /e in the regexp says that the replace value is an &lt;a href=&quot;http://perldoc.perl.org/perlop.html&quot;&gt;expression&lt;/a&gt;. In this case the replace value is some math that add adds one to the current value.&lt;/p&gt;
		</description>
			<pubDate>Tue, 09 Apr 2013 13:03:00 -0700</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1122/</guid>
			<title>Vim: Launch Vim with a predefined search string</title>
			<link>http://www.perturb.org/display/entry/1122/</link>
			<description>&lt;p&gt;I wanted to launch Vim with a search string already set. That way I could load my file, and just hit N to jump to that location.&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;vim myfile.txt +/search_text
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;Whatever you set search_text to, will pre-fill the search buffer.&lt;/p&gt;
		</description>
			<pubDate>Tue, 09 Apr 2013 08:56:30 -0700</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1121/</guid>
			<title>Setting and reading file xattrs</title>
			<link>http://www.perturb.org/display/entry/1121/</link>
			<description>&lt;p&gt;If your filesystem supports xattrs you can set metadata to be saved with your files:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;touch foo
		setfattr -n user.fave_food -v hotdogs foo
		getfattr -n user.fave_food foo
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;You must save everything in the &lt;strong&gt;user.&lt;/strong&gt; namespace though.&lt;/p&gt;
		</description>
			<pubDate>Thu, 14 Feb 2013 16:25:00 -0800</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1120/</guid>
			<title>Using rsync to backup files as a non-root user</title>
			<link>http://www.perturb.org/display/entry/1120/</link>
			<description>&lt;p&gt;I'm using rsync over SSH to do backups between two systems. When you run your backup as non-root user, you cannot save the files owner or group (uid/gid) because only root is allowed to change ownership. You can however tell rsync to store the owner/group in the file's xattrs. This requires that you mount your filesystems with &lt;strong&gt;user_xattr&lt;/strong&gt;:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;/dev/sdb1 /backup ext4    defaults,user_xattr        1 2
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;Then you tell the &lt;strong&gt;writing&lt;/strong&gt; rsync to use --fake-super&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;rsync -avP --rsync-path='/usr/bin/rsync --fake-super' /src/dir backup-user@domain.com:/dst/dir
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;This example is a push backup, if it were a pull you'd put --fake-super on the local side. Then to do a restore you'd do the same thing in reverse with the reading side (where the xattrs are stored) getting --fake-user:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;rsync -avP --rsync-path='/usr/bin/rsync --fake-super' backup-user@domain.com:/src/dir /dst/dir
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;You can see the attributes for a given file with getfattr:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;getfattr -d *
		
		# file: dovecot.index
		user.rsync.%stat=&quot;100600 0,0 89:89&quot;
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;If you don't get any output, there are no xattrs for that file.&lt;/p&gt;
		</description>
			<pubDate>Thu, 14 Feb 2013 16:11:00 -0800</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1119/</guid>
			<title>MySQL Complicated subquery joins</title>
			<link>http://www.perturb.org/display/entry/1119/</link>
			<description>&lt;p&gt;We needed to do two complicated (group by/having) queries, and find the common CustIDs between them. Easy way is to create a temporary table with the CustIDs from the first table, and then do an INNER JOIN against that temporary table on the select for the second table.&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;DROP TABLE IF EXISTS CustID;
		CREATE TEMPORARY TABLE CustID (CustID Integer);
		
		INSERT INTO CustID (CustID)
		   SELECT CustID
		   FROM ViewCircuitServices
		   WHERE SvcID = 3 AND CircuitType = 'dsl'
		   GROUP BY CustID
		   HAVING count(SvcID) &amp;gt;= 2;
		
		SELECT CustID, SvcID
		FROM ViewCircuitServices
		INNER JOIN CustID USING (CustID)
		WHERE SvcID IN (2,9,25) AND CircuitType = 'dsl'
		GROUP BY CustID;
		&lt;/code&gt;&lt;/pre&gt;
		</description>
			<pubDate>Mon, 28 Jan 2013 09:41:26 -0800</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1118/</guid>
			<title>Enable background consistency check with arcconf</title>
			<link>http://www.perturb.org/display/entry/1118/</link>
			<description>&lt;p&gt;To enable the (&lt;a href=&quot;http://download.adaptec.com/pdfs/miscellaneous_support/Adaptec_RAID_Maintenance_Best_Practices_v2b.pdf&quot;&gt;recommended&lt;/a&gt;) background consistency check on an Adaptec card run:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;arcconf datascrub 1 period 30
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;Where 30 is the amount of days you want the adapter to scan the entire driveset.&lt;/p&gt;
		</description>
			<pubDate>Wed, 23 Jan 2013 11:08:00 -0800</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1117/</guid>
			<title>Interfacing with Oracle on the command line</title>
			<link>http://www.perturb.org/display/entry/1117/</link>
			<description>&lt;p&gt;I wanted a command line client to access an Oracle server. sqlplus64 is the stock Oracle client. Connect to your server with the following command:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;sqlplus64 username/password@//1.2.3.4/database_name
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;If you want to see all the tables in the current DB:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;select table_name from user_tables;
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;If you want to see the field names/types of a given table&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;desc tablename
		&lt;/code&gt;&lt;/pre&gt;
		</description>
			<pubDate>Wed, 16 Jan 2013 11:45:19 -0800</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1116/</guid>
			<title>Linux: Determine the type of memory in your machine</title>
			<link>http://www.perturb.org/display/entry/1116/</link>
			<description>&lt;p&gt;I needed to find out what type of memory I had in a server, without shutting it down and opening the case.&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;dmidecode --type memory
		&lt;/code&gt;&lt;/pre&gt;
		</description>
			<pubDate>Mon, 14 Jan 2013 09:13:00 -0800</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1115/</guid>
			<title>Books of 2013</title>
			<link>http://www.perturb.org/display/entry/1115/</link>
			<description>Also see the list of &lt;a href=&quot;https://www.perturb.org/display/1083_Books_of_2012.html&quot;&gt;2012&lt;/a&gt;. The date indicated denotes the date I started reading the book.&lt;br /&gt;
		&lt;br /&gt;
		2013-01-04 - &lt;a href=&quot;http://books.google.com/books?q=isbn:1886778205&quot;&gt;Shards of Honor&lt;/a&gt; - 239 pages&lt;br /&gt;
		2013-01-12 - &lt;a href=&quot;http://books.google.com/books?q=isbn:9781401220822&quot;&gt;Saga of the Swamp Thing&lt;/a&gt; - 208 pages&lt;br /&gt;
		2013-01-14 - &lt;a href=&quot;http://books.google.com/books?q=isbn:0963660993&quot;&gt;Bone Volume 1&lt;/a&gt; - 142 pages&lt;br /&gt;
		2013-01-16 - &lt;a href=&quot;http://books.google.com/books?q=isbn:0345350804&quot;&gt;The Best of H.P. Lovecraft&lt;/a&gt; - 432 pages&lt;br /&gt;
		2013-02-19 - &lt;a href=&quot;http://books.google.com/books?q=isbn:9781563897870&quot;&gt;Batman, officer down&lt;/a&gt; - 160 pages&lt;br /&gt;
		2013-03-01 - &lt;a href=&quot;http://books.google.com/books?q=isbn:9781594745768&quot;&gt;The Last Policeman&lt;/a&gt; - 288 pages&lt;br /&gt;
		2013-03-05 - &lt;a href=&quot;http://books.google.com/books?q=isbn:0785157964&quot;&gt;Fear Itself: Uncanny X-Force/The Deep&lt;/a&gt; - 152 pages&lt;br /&gt;
		2013-03-18 - &lt;a href=&quot;http://books.google.com/books?q=isbn:0670868361&quot;&gt;Desperation&lt;/a&gt; - 690 pages&lt;br /&gt;
		2013-04-01 - &lt;a href=&quot;http://books.google.com/books?q=isbn:0842329110&quot;&gt;Left behind&lt;/a&gt; - 468 pages&lt;br /&gt;
		2013-04-16 - &lt;a href=&quot;http://books.google.com/books?q=isbn:123456&quot;&gt;Brief Encounter: An Erotic Short&lt;/a&gt; - 41 pages&lt;br /&gt;
		2013-04-18 - &lt;a href=&quot;http://books.google.com/books?q=isbn:9780141182674&quot;&gt;On the Road&lt;/a&gt; - 320 pages&lt;br /&gt;
		&lt;br /&gt;
		2013-05-09 - &lt;a href=&quot;http://books.google.com/books?q=isbn:9780525941903&quot;&gt;The Regulators&lt;/a&gt; - 466 pages&lt;br /&gt;
		
		</description>
			<pubDate>Thu, 10 Jan 2013 17:45:00 -0800</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1114/</guid>
			<title>Vim encryption</title>
			<link>http://www.perturb.org/display/entry/1114/</link>
			<description>&lt;p&gt;Vim has some simple built in &lt;a href=&quot;http://vim.wikia.com/wiki/Encryption&quot;&gt;encryption&lt;/a&gt;. If you have a text file you want to encrypt you can run the command:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;:X
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;Vmi will prompt you for a password (twice). The next time you save the file it will encrypt the file before saving it. When you open the file it will prompt you for the password. If you enter the wrong password you'll see a bunch of gibberish.&lt;/p&gt;
		</description>
			<pubDate>Tue, 08 Jan 2013 15:24:00 -0800</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1113/</guid>
			<title>Ignore SSH host key checking</title>
			<link>http://www.perturb.org/display/entry/1113/</link>
			<description>&lt;p&gt;I have a range of IPs that I use for testing various Linux installations. This causes grief as each install gets its own SSH key. To tell SSH to ignore the key for a given IP address change your &lt;strong&gt;~/.ssh/config&lt;/strong&gt;&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;Host 192.168.0.*
		    StrictHostKeyChecking no
		    UserKnownHostsFile=/dev/null
		&lt;/code&gt;&lt;/pre&gt;
		
		&lt;p&gt;Or if you just want to change it on a per connection basis at the command line:&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;ssh -o UserKnownHostsFile=/dev/null,StrictHostKeyChecking=no user@domain.com
		&lt;/code&gt;&lt;/pre&gt;
		</description>
			<pubDate>Fri, 21 Dec 2012 14:15:00 -0800</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1112/</guid>
			<title>Override the text selection (highlight) color with CSS</title>
			<link>http://www.perturb.org/display/entry/1112/</link>
			<description>&lt;p&gt;If you want to override the default text selection or highlight color you can. Simple apply the ::selection selector in your CSS and change the color, font, or whatever you want.  &lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;::selection {
		    background: #ffb7b7; /* Safari */
		}
		
		::-moz-selection {
		    background: #ffb7b7; /* Firefox */
		}
		&lt;/code&gt;&lt;/pre&gt;
		</description>
			<pubDate>Thu, 13 Dec 2012 11:44:00 -0800</pubDate>
		</item>
		
		<item>
			<guid isPermaLink="true">http://www.perturb.org/display/entry/1111/</guid>
			<title>ffmpeg libx264 subtitle codec</title>
			<link>http://www.perturb.org/display/entry/1111/</link>
			<description>&lt;p&gt;I tried to convert a &lt;strong&gt;mkv&lt;/strong&gt; into a &lt;strong&gt;mp4&lt;/strong&gt; and while keeping the subtitles in tact. &lt;strong&gt;mp4&lt;/strong&gt; files require a different format of subtitles called mov_text.&lt;/p&gt;
		
		&lt;pre&gt;&lt;code&gt;ffmpeg -y -i input.mkv -c:v copy -c:a copy -c:s mov_text /tmp/output.mp4
		&lt;/code&gt;&lt;/pre&gt;
		</description>
			<pubDate>Mon, 10 Dec 2012 16:16:52 -0800</pubDate>
		</item>
		
	</channel>
</rss>
