<?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>Yoooder.com &#187; Tips</title>
	<atom:link href="http://yoooder.com/wordpress/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://yoooder.com/wordpress</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 08 Jul 2011 14:13:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SQL &#8211; Joining two tables without related data &#8211; joining without an on clause</title>
		<link>http://yoooder.com/wordpress/2011/07/sql-joining-two-tables-without-related-data-joining-without-an-on-clause/</link>
		<comments>http://yoooder.com/wordpress/2011/07/sql-joining-two-tables-without-related-data-joining-without-an-on-clause/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 14:12:40 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://yoooder.com/wordpress/?p=70</guid>
		<description><![CDATA[I'm loading test data, and have a situation where I have a list of ID's I need to generate test-data for, and a list of sample data I'd like to populate for each test ID.  Something like this: TestIDs---------123 TestData--------AB What I want is a join that produces: Result--------1 A1 B2 A2 B3 A3 B [...]]]></description>
			<content:encoded><![CDATA[<p>I'm loading test data, and have a situation where I have a list of ID's I need to generate test-data for, and a list of sample data I'd like to populate for <em>each</em> test ID.  Something like this:</p>
<blockquote><p>TestIDs<br />---------<br />1<br />2<br />3</p>
<p>TestData<br />--------<br />A<br />B</p>
</blockquote>
<p>What I want is a join that produces:</p>
<blockquote><p>Result<br />--------<br />1 A<br />1 B<br />2 A<br />2 B<br />3 A<br />3 B</p>
</blockquote>
<p>This is essentially a join without an "on" clause, however the trick in SQL is that the "join" keyword isn't needed either.  The select statement is simply:</p>
<blockquote><p>select * from TestIDs, TestData</p>
</blockquote>
<p>Notice that there is a comma seperating the tables to select from, and no join keyword anywhere.  Handy!</p>
]]></content:encoded>
			<wfw:commentRss>http://yoooder.com/wordpress/2011/07/sql-joining-two-tables-without-related-data-joining-without-an-on-clause/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VB.NET (and C# 4.0) Optional Features &#8211; Great for Unit-testing structures and DTO&#8217;s!</title>
		<link>http://yoooder.com/wordpress/2009/07/vb-net-and-c-4-0-optional-features-great-for-unit-testing-structures-and-dtos/</link>
		<comments>http://yoooder.com/wordpress/2009/07/vb-net-and-c-4-0-optional-features-great-for-unit-testing-structures-and-dtos/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 20:28:58 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Unit-Testing]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://yoooder.com/wordpress/?p=62</guid>
		<description><![CDATA[Here's a great use-case for Optional parameters in VB.NET (and to be introduced in C# 4.0), it's saved me lots of code and kept my unit tests small. Some data structures (DTO's to some folk, and classes as well) have a large number of properties with the same return type, such as: public struct MyData [...]]]></description>
			<content:encoded><![CDATA[<p>Here's a great use-case for Optional parameters in VB.NET (and to be introduced in C# 4.0), it's saved me lots of code and kept my unit tests small.</p>
<p>Some data structures (DTO's to some folk, and classes as well) have a large number of properties with the same return type, such as:</p>
<blockquote><p>public struct MyData<br />
{<br />
public MyData(string firstName, string middleName, string lastName, string surName, string formerName)<br />
{ // set the properties }<br />
public string FirstName { get; set; }<br />
public string MiddleName { get; set; }<br />
public string LastName { get; set; }<br />
public string SurName { get; set; }<br />
public string FormerName { get; set; }<br />
// ...and so on...<br />
}</p></blockquote>
<p>Imagine that this strucuture is implemented with field-backed properties (instead of automatically-implemented properties) and we wanted unit tests to ensure that setting SurName didn't change the backing field for FormerName.  Each unit test would need to instantiate an instance of MyData by passing a laundry-list of parameters.  Here's a sample of a unit test (and accompanying BuiltTarget() method) showcasing how ugly this can be (<em>notice that BuildTarget() is an ungainly mess</em>; and that there would normally be one or more tests for each parameter).</p>
<blockquote><p>Public Function BuildTarget(ByVal firstName As String, _<br />
ByVal middleName As String, _<br />
ByVal lastName As String, _<br />
ByVal surName As String, _<br />
ByVal formerName As String) As MyData<br />
Return New MyData(firstName, middleName, lastName, surName, formerName)<br />
End Function</p>
<p>&lt;TestMethod()&gt; _<br />
Public Sub New_WhenFirstNameProvided_KeepsValue()<br />
Dim firstName = "Steve"<br />
Dim target = BuildTarget(firstName, _<br />
Nothing, _<br />
Nothing, _<br />
Nothing, _<br />
Nothing)</p>
<p>Dim expected = firstName<br />
Dim actual = target.FirstName</p>
<p>Assert.AreEqual(expected, actual)</p>
<p>End Sub</p></blockquote>
<p>To work around this my tests contain a single "BuildTarget()" factory which declares each parameter as optional, and provides a default value.  Then when I need to set just a single parameter I can do so by name and let the default values provide the remaing parameters.  The above sample cleans up to look like:</p>
<blockquote><p>Public Function BuildTarget(Optional ByVal firstName As String = Nothing, _<br />
Optional ByVal middleName As String = Nothing, _<br />
Optional ByVal lastName As String = Nothing, _<br />
Optional ByVal surName As String = Nothing, _<br />
Optional ByVal formerName As String = Nothing) As MyData<br />
Return New MyData(firstName, middleName, lastName, surName, formerName)<br />
End Function</p>
<p>&lt;TestMethod()&gt; _<br />
Public Sub New_WhenFirstNameProvided_KeepsValue()<br />
Dim firstName = "Steve"<br />
Dim target = BuildTarget(firstName:=firstName)</p>
<p>Dim expected = firstName<br />
Dim actual = target.FirstName</p>
<p>Assert.AreEqual(expected, actual)</p>
<p>End Sub</p></blockquote>
<p>As you can imaging, the small amount of extra code in the BuildTarget() method is insignificant compareed to the savings in each TestMethod.</p>
]]></content:encoded>
			<wfw:commentRss>http://yoooder.com/wordpress/2009/07/vb-net-and-c-4-0-optional-features-great-for-unit-testing-structures-and-dtos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET: Referencing a 2.0 DLL from a 1.1 DLL</title>
		<link>http://yoooder.com/wordpress/2008/03/net-referencing-a-20-dll-from-a-11-dll/</link>
		<comments>http://yoooder.com/wordpress/2008/03/net-referencing-a-20-dll-from-a-11-dll/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 21:29:32 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://yoooder.com/wordpress/?p=29</guid>
		<description><![CDATA[*NOTE* This only works if your executable is running under the 2.0 Framework! At work we are writing a .NET 2.0 application that has its roots back in 1.1.  Some ancillary applications were also written in 1.1, and shared some common libraries; so when it came time for this application to be upgraded to 2.0 [...]]]></description>
			<content:encoded><![CDATA[<p>*NOTE* This only works if your executable is running under the 2.0 Framework!</p>
<p>At work we are writing a .NET 2.0 application that has its roots back in 1.1.  Some ancillary applications were also written in 1.1, and shared some common libraries; so when it came time for this application to be upgraded to 2.0 some libraries had to be left behind for compatibility reasons.</p>
<p>One such library has the task of loading data from databases, and was designed to read from MS Access, SQL Server, or MSDE; however in the ongoing development of our application we are scraping the MS Access use in favor of SQL Compact Edition.  For those familiar with SQL CE, you'll know it's not compatible with the 1.1 framework--so we were faced with the issue of either duplicating the functionality of the 1.1 DLL in a 2.0 DLL, so that old applications could be left alone, or with doing massive work to overhaul the old applications and try to bring them all up to 2.0...  neither option was terribly appealing (although the first option was obviously preferable).</p>
<p>Our project architect put the task to me, and had a plan of attack that he figured would let us make the 1.1 DLL talk to the SQL CE database via a 2.0 DLL proxy--however you'll know that 1.1 projects cannot reference 2.0 projects.  Here's where a little trickery comes in...</p>
<p>For a quick recap we have: A Framework 2.0 application, which calls a 1.1 Library to retrieve data.  We need: A Framework 2.0 application to call the 1.1 Library to call a 2.0 Library to retrieve the data from SQL CE.</p>
<p>To achieve this we added an interface to the 1.1 Library, and implemented that interface in the new 2.0 library which uses the interface to fetch the needed data from the database.  The 1.1 library uses reflection to late-load the 2.0 library and instantiates it by its interface.</p>
<p>So the workflow is:</p>
<ul>
<li>2.0 Application makes a call to the 1.1 Library
<ul>
<li> 1.1 Library uses an Assembly.Load() call to late-load the new 2.0 Library and casts it to the 1.1's interface definition.</li>
<li>1.1 Library then can call the Interface member, which...
<ul>
<li>Talk through the 2.0 framework to our SQL CE database.</li>
</ul>
</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://yoooder.com/wordpress/2008/03/net-referencing-a-20-dll-from-a-11-dll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovery from a dead FAT32 Windows drive</title>
		<link>http://yoooder.com/wordpress/2007/10/recovery-from-a-dead-fat32-windows-drive/</link>
		<comments>http://yoooder.com/wordpress/2007/10/recovery-from-a-dead-fat32-windows-drive/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 17:51:14 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Data Recovery]]></category>
		<category><![CDATA[Great Utilities]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://yoooder.com/wordpress/?p=18</guid>
		<description><![CDATA[My landlord's old PC has suffered several failures over the years, including several fans and power supplies and at least one hard drive. When I moved in a year ago they called me over to replace yet another PSU for them, and a few months later to figure out why the machine would not even [...]]]></description>
			<content:encoded><![CDATA[<p>My landlord's old PC has suffered several failures over the years, including several fans and power supplies and at least one hard drive.  When I moved in a year ago they called me over to replace yet another PSU for them, and a few months later to figure out why the machine would not even begin to boot.</p>
<p>The suspect was immediately either the IDE controller or both of its drive.  After transplanting the drives to a seperate machine and failing to find their partitions, and after trying a new drive in the machine it was looking as though possibly all were fried.</p>
<p>A couple months have passed and my landlord has had me build him a new computer and the day has come to try to recover his data...  Below is the process I've used to diagnose and recover his files.<span id="more-18"></span></p>
<p>1) Attempt to image the entirety of the drive</p>
<p>With the physical stability of the drives in question, the first order of business was to mitigate the amount of work done against the failed drives themselves. Windows claimed the drives were unformatted, and linux would not let me mount them (although their partition tables were visible).</p>
<p>The weapon of choice was dd, a data-copy utility that works at a low level and with a little bit of knowledge can be an invaluable tool. dd can be extremely dangerous if you aren't careful with it!!! dd is basically a data-copy tool which takes a couple arguments; "if" (input file) and "of" (output file). The device/file you set "if" to will be copied to the "of" device/file. You can add more parameters to control the amount of data copied, and the blocksize that the harddrive's partition uses.</p>
<p>Example: Backing up a drive's partition table</p>
<p>The drive partition table is stored in the first kilobyte (not certain this is always true, it may depend on the block size) of the partition. To make a backup:</p>
<p>dd if=/dev/[drive] of=$HOME/[drive]_part.bak bs=1k count=1</p>
<p>This will copy the first kilobyte (bs=1k count=1) from /dev/[drive] to a file called [drive]_part.img in the executing user's home directory.</p>
<p>Back to data recovery with dd... to make an image of the entire drive I used the following command, note that this creates a file equal to the physical size of the disk, so be sure you have enough room. i.e. if you have a 1GB partition on a 100GB drive (and 99GB unpartitioned) the resulting image will be 100GB.</p>
<p>dd if=/dev/[drive] of=$HOME/backups/[drive].dmg bs=512 (NOTE: bs varies depending on the filesystem settings, common sizes are 512, 1024, and 4096, although many others are possible. One way to determine the block size is to try copying one 512b block, one 1k block, and one 4k block (so on so forth). Wrong block sizes should result in an error, ruling out the selection.</p>
<p>dd does not work through errors by default, so if it finds bad sectors or other obstacles it will error out--providing evidence of the type of failure on your hands. I lucked out, and dd ran through the full 20GB drive without error which told me that the drive failure was likely with the partition or filesystem and not a hardware failure. If dd fails due to drive errors such as bad sectors you can use ddrescue or gddrescue, both of which use dd and will replace errors with null (nothing) values in the image, resulting in a backup image of as much data as possible. One other very cool feature is if you use these tools to copy from a device that is inconsistently reading it's contents then you can run the tool multiple times, and if a 2nd (or 3rd, 4th...) pass is able to successfully read what a previous pass failed at it will fill in the void left by the earlier passes due to the error. This proves wonderfully useful on scratched CDs, among other things.</p>
<p>Now for the real fun: With the disk image in place I shutdown and remove the physical drive from the machine (so that if it is a hardware issue, any further damage will be prevented. My landlord was considering having the drive professionally recovered if we were unsuccessful, so we wanted to make sure we did no further harm to it). Upon booting back up I set the drive image to a loopback device, which lets you mount a disk image like it were a regular drive (iso's work great with this)</p>
<p>2) Attempt to mount the image</p>
<p>After unplugging and removing the dead drive I tried to mount the image I'd just made:</p>
<p>mount /home/steve/[drive].dmg -o loop -t vfat /mnt/recovery</p>
<p>But it failed, barking about a bad superblock. This was starting to look more like a bad partition table than a fried drive--so back in went the drive.</p>
<p>3) A great utility</p>
<p>After some Googling I found multiple references to a utility called testdisk which is a free drive recovery tool. My only beef was that it only seems to work on physical drives, not loopback images (like what I made above). So with the drive back in I ran testdisk, and after selecting the appropriate drive and type from it's menus it immediately told me I had a bad partition table.</p>
<p>Using the restore and scan options of testdisk brought the drive totally back to life! I was very impressed by it, as it seems to have a lot of power under the hood but not a lot of difficulty in it's user-interface.</p>
<p>The drive lived! I saved it's updated partition tables back to the drive, rebooted as it recommened and was able to successfully mount the partition.</p>
<p>4) Get everything off the drive</p>
<p>There was no sense running the risk of letting the drive cause more problems, especially as there was over a Terabyte of free space on the new machine. So I rsync'd everything off of it immediately:</p>
<p>rsync -av /mnt/[mountpoint] /var/storage/recovered/</p>
<p>5) Shred the drive</p>
<p>The old 20GB drive was recovered, and my landlord wanted to recycle it (give it away). So first we wanted to shred any remnants of it's contents. There is a GNU utility aptly named "shred" that does specifically this.</p>
<p>shred /dev/[drive]</p>
<p>And many hours later (shred defaults to 25 passes, which is extreme but can be changed) the drive was wiped clean.</p>
]]></content:encoded>
			<wfw:commentRss>http://yoooder.com/wordpress/2007/10/recovery-from-a-dead-fat32-windows-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Determining / Recovering a Partition&#8217;s UUID (Univeral Unique Identifier)</title>
		<link>http://yoooder.com/wordpress/2007/10/determining-recovering-a-partitions-uuid-univeral-unique-identifier/</link>
		<comments>http://yoooder.com/wordpress/2007/10/determining-recovering-a-partitions-uuid-univeral-unique-identifier/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 17:39:39 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Data Recovery]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://yoooder.com/wordpress/?p=17</guid>
		<description><![CDATA[I made a boo-boo after reinstalling my base Ubuntu system, and accidently copied over the entirety of the fresh installation's /etc/fstab file with my old /etc/fstab. The UUIDs of my new installation were lost, so after a little Googling I found that there's a helpful little utility called "vol_id" specifically for determining this type of [...]]]></description>
			<content:encoded><![CDATA[<p>I made a boo-boo after reinstalling my base Ubuntu system, and accidently copied over the entirety of the fresh installation's /etc/fstab file with my old /etc/fstab.</p>
<p>The UUIDs of my new installation were lost, so after a little Googling I found that there's a helpful little utility called "vol_id" specifically for determining this type of info...</p>
<p>vol_id [partition]</p>
<p>and voila, I've got my fstab back in fine shape <img src='http://yoooder.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://yoooder.com/wordpress/2007/10/determining-recovering-a-partitions-uuid-univeral-unique-identifier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Penetration testing my apartment</title>
		<link>http://yoooder.com/wordpress/2007/09/penetration-testing-my-apartment/</link>
		<comments>http://yoooder.com/wordpress/2007/09/penetration-testing-my-apartment/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 06:10:19 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Life Hacks]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Toy Helicopters Fuck with me so bad!]]></category>

		<guid isPermaLink="false">http://yoooder.com/wordpress/?p=12</guid>
		<description><![CDATA[Problem: It's 1:00am, in a town where you don't really know anyone, you're locked out of your apartment, and the only things you have on you are a cell phone and a toy RC helicopter (it has LED's that blink, I thought it would be cool to fly in the dark). Objective: Gain entry to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> It's 1:00am, in a town where you don't really know anyone, you're locked out of your apartment, and the only things you have on you are a cell phone and a toy RC helicopter (it has LED's that blink, I thought it would be cool to fly in the dark).</p>
<p><strong>Objective:</strong> Gain entry to your dwelling without having to a) wake up the neighbor or b) explain to a cop that your ID is just behind the door you're trying to jimmy.<span id="more-12"></span></p>
<p><strong>*My* Solution (your mileage may vary):</strong> Perform a preliminary port-scan before proceeding to more intensive penetration testing.  Start with all the doors...  my main door is around back, and it leads to the three apartments in the house I live in.  It happens to be unlatched (rare, as it has a hydraulic ram to close it and automatically locks) however the inner door to my apartment is locked tight.  I've no credit card handy to attempt to pop the lock, however it would be futile--I've tried before.</p>
<p>On to the front door; it's a shaky old thing that lacks a locking knob, has two cheap-o mini-deadbolts and a sliding chain lock to hold it tight.  At first try it's shut and locked, no luck here.  The two windows to the apartment are also unhelpful, one is locked and the other has an AC unit bolted in.</p>
<p>Back to the front door.  I shouldered it pretty firmly and was surprised when it gave!  Turns out the wood has swollen with the humidity to where only 1 of the 2 little deadbolts catch, and only by a small amount.  So I'm left with a sliding chain lock between me and bed.  The chain lock is installed correctly though, and the door must be closed for it to be locked or unlocked.  fuck</p>
<p><strong>Final solution:</strong> Scavenge, fortunately there's a construction site in the back yard (they're building a new garage) and I manage to find some twine.  I cut off about 6' (with a utility knife I found) and tie one end around the end of the chain, on the little knob piece that slides in the rail and actually locks the door.  Then I run the twine up the inside of the door (inside the apartment, same side as the lock), over the top, and down the front.  Pull the door to where it almost latches and start tugging on the twine.  Amazingly it only took about 10 seconds of fiddling to pop the chain out of it's rail, and voila!</p>
<p>Maybe later I'll post about a string-&amp;-baseball injection attack on a large leaf-server (ie: Tree) which holds (another) toy helicopter problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://yoooder.com/wordpress/2007/09/penetration-testing-my-apartment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an encrypted volume</title>
		<link>http://yoooder.com/wordpress/2007/03/backlog-03192007-2/</link>
		<comments>http://yoooder.com/wordpress/2007/03/backlog-03192007-2/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 03:40:22 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://yoooder.com/wordpress/?p=11</guid>
		<description><![CDATA[I needed to meet my company's required security policy for taking source code offsite: 256bit AES encryption. Since the source code I had on my laptop was within a Virtual Machine, I thought it would be a good solution to make an encrypted filesystem big enough for the VM, and only mount it when I [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to meet my company's required security policy for taking source code offsite: 256bit AES encryption.</p>
<p>Since the source code I had on my laptop was within a Virtual Machine, I thought it would be a good solution to make an encrypted filesystem big enough for the VM, and only mount it when I wanted to work.</p>
<p>Here's my requirements:<br />
- Encrypted FS that is (un)mountable whenever need be<br />
- Passphrase to mount the filesystem<br />
- 30GB of storage within the filesystem, to accomodate the 30GB VM disk.<span id="more-11"></span></p>
<p>First, we create a file that will become the filesystem.  Using dd we make it the size we want:<br />
dd if=/dev/zero bs=1G count=30 of=/home/steve/devel_image</p>
<p>Here's what the attributes mean:<br />
if is the input file since we're making an empty file we'll set if to /dev/zero, which will give us an empty file of zeros<br />
of is the output file, or the file you want to create.  Here I'm telling it to make a file called devel_image in my /home/steve folder<br />
bs is the bytes, but I like to call it the bucket size, since the way it is used is to declare your unit size.  Here 1G means we wants 1GB chunks, or buckets.  You can give it different units, 1M, 5G, whatever.<br />
count is the number of buckets you wish to use.  Since we want a 30GB file, and are using 1G buckets, we'll need 30 of them to make 30GB.</p>
<p>This makes a 30GB file called devel_image in my home directory, and takes some time to complete (30 gigs is kinda big, y'know?)</p>
<p>Next we setup a loopback device (which will make the system see the file as a drive).  using losetup you can create the device, and you can even add encryption at this point--however it's becomming deprecated, and better to handle the encryption on it's own (as cryptoloop support will be removed from the kernel at some point</p>
]]></content:encoded>
			<wfw:commentRss>http://yoooder.com/wordpress/2007/03/backlog-03192007-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wiping a hard drive</title>
		<link>http://yoooder.com/wordpress/2007/03/backlog-03192007/</link>
		<comments>http://yoooder.com/wordpress/2007/03/backlog-03192007/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 22:40:05 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://yoooder.com/wordpress/?p=10</guid>
		<description><![CDATA[Wiping a HardDrive is a common task at the workplace or whenever you're getting ready to sell a PC. There is a utility to do just such a thing in almost all Linux Bootdisks called shred. Shred can be used to wipe files, or whole drives. To wipe a drive, the following parameters are good [...]]]></description>
			<content:encoded><![CDATA[<p>Wiping a HardDrive is a common task at the workplace or whenever you're getting ready to sell a PC.  There is a utility to do just such a thing in almost all Linux Bootdisks called shred.</p>
<p>Shred can be used to wipe files, or whole drives.  To wipe a drive, the following parameters are good to know<br />
-z     After shredding, one more pass will be made to write all zeros to the drive, not necessary, but it hides the fact that the disk has been shredded<br />
-v     Display messages about progress, which is handy since shredding a drive takes a fair deal of time<br />
-n x    x is the number of passes you wish to make.  3 is a good number, and if you use the -z option it will be 3 shredding passes followed by a 4th pass to zero out all the data</p>
<p>Put it together and pass it a drive to wipe:<br />
shred -zvn 3 /dev/sda</p>
<p>And voila, all your private data goes bye-bye</p>
]]></content:encoded>
			<wfw:commentRss>http://yoooder.com/wordpress/2007/03/backlog-03192007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restoring a lost RAID array</title>
		<link>http://yoooder.com/wordpress/2007/03/backlog-03182007/</link>
		<comments>http://yoooder.com/wordpress/2007/03/backlog-03182007/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 02:39:05 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://yoooder.com/wordpress/?p=9</guid>
		<description><![CDATA[After an upgrade from Edgy to Feisty my RAID array disappeared (aka, I shit my pants). Doing a 'cat /proc/mdstat' produced: Personalities : [raid6] [raid5] [raid4] &#60;none&#62; Thankfully I had backups of my mdadm.conf and lvm.conf files so I knew that as long as I didn't alter the data on the drives I could always [...]]]></description>
			<content:encoded><![CDATA[<p>After an upgrade from Edgy to Feisty my RAID array disappeared (aka, I shit my pants).</p>
<p>Doing a 'cat /proc/mdstat' produced:<br />
Personalities : [raid6] [raid5] [raid4]<br />
&lt;none&gt;</p>
<p>Thankfully I had backups of my mdadm.conf and lvm.conf files so I knew that as long as I didn't alter the data on the drives I could always fall back to Edgy and still have my files.</p>
<p>After trying a few things with mdadm, all unsuccessfully, I decided to uninstall it entirely.  So I made a (second) backup of my mdadm.conf and lvm.conf files, and did a:<br />
apt-get --purge remove mdadm lvm2</p>
<p>This uninstalls the packages and also removes the config files (that's what the --purge option is there for).</p>
<p>After uninstalling them I verified the configs were gone and reinstalled the packages through Synaptic inside of GNOME.  During the install it prompted which arrays were required to boot.  On my failed upgrade I had configured it with "all" but I really didn't need my array at boot time, my root partition is on a standalone IDE drive, so this time I told it "none".</p>
<p>I expected to have more tinkering to do, but after the install I again did a "cat /proc/mdstat" and to my surprise my array was back! *yay*</p>
<p>Now I just had to get my lvm partitions back.  I've found the Gentoo LVM2 installation guide very usefull, and a good resource for LVM, so I turned to it to see how to recover volumes.  The commands to restore my volumes were:<br />
vgscan<br />
vgchange -a y</p>
<p>And voila, my array and it's partitions were good as new.  A quick "mount -a" brought them all up without a glitch!</p>
]]></content:encoded>
			<wfw:commentRss>http://yoooder.com/wordpress/2007/03/backlog-03182007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Edgy to Feisty Upgrade</title>
		<link>http://yoooder.com/wordpress/2007/03/backlog-03182007-2/</link>
		<comments>http://yoooder.com/wordpress/2007/03/backlog-03182007-2/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 00:38:36 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://yoooder.com/wordpress/?p=8</guid>
		<description><![CDATA[I've been running Edgy as a deskop/mythTV box for several months, and have tried Feisty on a spare laptop at work. Feisty includes a large number of multimedia-integration improvements, so I thought I'd try it on my myth-machine. The process is easy-as-pie. Just run "update-manager -c -d" and it's a simple walk-through process. Obligatory Warning: [...]]]></description>
			<content:encoded><![CDATA[<p>I've been running Edgy as a deskop/mythTV box for several months, and have tried Feisty on a spare laptop at work.  Feisty includes a large number of multimedia-integration improvements, so I thought I'd try it on my myth-machine.</p>
<p>The process is easy-as-pie.  Just run "update-manager -c -d" and it's a simple walk-through process.</p>
<p>Obligatory Warning:  Feisty won't be officially released until April, and it's still labeled an Alpha release, so be warned it has lots of bugs and is not stable--personally I see my gnome-panel crash quite often, as well as a number of other oddities.  You've been warned</p>
]]></content:encoded>
			<wfw:commentRss>http://yoooder.com/wordpress/2007/03/backlog-03182007-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

