<?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>Our-files.com - Nathans&#039; Rants</title>
	<atom:link href="http://blog.our-files.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.our-files.com</link>
	<description>Rants and Randomness, Mishaps and Misconceptions, and other wierd things</description>
	<lastBuildDate>Fri, 03 Feb 2012 09:26:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Encrypted FlatFile Volume</title>
		<link>http://blog.our-files.com/2011/10/encrypted-flatfile-volume/</link>
		<comments>http://blog.our-files.com/2011/10/encrypted-flatfile-volume/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 05:22:35 +0000</pubDate>
		<dc:creator>Internat</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.our-files.com/?p=19</guid>
		<description><![CDATA[I used to have an encrypted volume on my file server, for storing sensitive things, but after an upgrade to the newest version of Debian, that stopped working. So after some mucking around and getting the old module for cryptoloop put back into my current kernel, I figured i might as well migrate over to [...]]]></description>
			<content:encoded><![CDATA[<p>I used to have an encrypted volume on my file server, for storing sensitive things, but after an upgrade to the newest version of Debian, that stopped working. So after some mucking around and getting the old module for cryptoloop put back into my current kernel, I figured i might as well migrate over to the newer version, which uses cryptsetup, losetup, and luks.</p>
<p>Ive shamelessly stolen these commands (although ive changed some of them)from <a href="http://wiki.centos.org/HowTos/EncryptedFilesystem">elsewhere</a>.. </p>
<p>Create the file system and restricted access.<br />
<code><br />
dd of=/path/to/secretfs bs=1G count=0 seek=8<br />
chmod 600 /path/to/secretfs<br />
</code></p>
<p>Create a loopback device for the file<br />
<code>losetup /dev/loop0 /path/to/secretfs</code><br />
Creates the volume, asks you for the key, and then creatss the DM mapping<br />
<code>cryptsetup -y luksFormat /dev/loop0<br />
cryptsetup luksOpen /dev/loop0 secretfs</code></p>
<p>Pad the file so it generates its random data<br />
<code>dd if=/dev/zero of=/dev/mapper/secretfs</code></p>
<p>Create the filesystem<br />
<code>mkfs.ext3 dev/mapper/secretfs<br />
</code></p>
<p># Mount the new filesystem in a convenient location<br />
<code>mkdir /mnt/cryptofs/secretfs<br />
mount /dev/mapper/secretfs /mnt/cryptofs/secretfs</code></p>
<p>And an encrypted volume is setup.</p>
<p>Now how to unmount:<br />
<code><br />
umount /mnt/cryptofs/secretfs<br />
cryptsetup luksClose secretfs<br />
losetup -d /dev/loop0</code></p>
<p>Remount:<br />
<code><br />
losetup /dev/loop0 /path/to/secretfs<br />
cryptsetup luksOpen /dev/loop0 secretfs<br />
(enter password when prompted)<br />
mount /dev/mapper/secretfs /mnt/cryptofs/secretfs</code></p>
<p>Now stuff that i can never remember how to do is grow the volume.</p>
<p>Make sure the volume is closed, unmounted etc.<br />
<code>umount /mnt/cryptofs/secretfs<br />
cryptsetup luksClose secretfs<br />
losetup -d /dev/loop0<br />
</code></p>
<p>Add 20gig to the file<br />
<code>dd if=/dev/zero bs=1G count=20 >> /dev/mapper/secretfs<br />
</code></p>
<p>Remount and reopen part of it</p>
<p><code>losetup /dev/loop0 /path/to/secretfs<br />
cryptsetup lucksOpen /dev/loop5 EncryptedFS<br />
</code></p>
<p>check the FS first<br />
<code>e2fsck -f /dev/mapper/EncryptedFS<br />
</code><br />
once thats done grow it<br />
<code>resize2fs /dev/mapper/EncryptedFS</code><br />
and your done. You can now open the volume for use</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.our-files.com/2011/10/encrypted-flatfile-volume/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reattaching database and fixing users</title>
		<link>http://blog.our-files.com/2010/06/reattaching-database-and-fixing-users/</link>
		<comments>http://blog.our-files.com/2010/06/reattaching-database-and-fixing-users/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 02:24:37 +0000</pubDate>
		<dc:creator>Internat</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://blog.our-files.com/?p=17</guid>
		<description><![CDATA[Backed up and restored a database the other day, but of course the network users arent setup properly cause there actually stored in the master database.. So i recreate the user on the instance which is fine , and then try and regrant it permissions on the database but it fails because its already there&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Backed up and restored a database the other day, but of course the network users arent setup properly cause there actually stored in the master database..</p>
<p>So i recreate the user on the instance which is fine , and then try and regrant it permissions on the database but it fails because its already there&#8230;</p>
<p>To fix&#8230;</p>
<pre name="code" class="sql">
User DATABASE
EXEC sp_change_users_login 'update_one', 'usernamehere', 'usernamehere''
</pre>
<p><a href="http://msdn.microsoft.com/en-us/library/ms174378.aspx">http://msdn.microsoft.com/en-us/library/ms174378.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.our-files.com/2010/06/reattaching-database-and-fixing-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pulling iphone backups apart</title>
		<link>http://blog.our-files.com/2010/04/pulling-iphone-backups-apart/</link>
		<comments>http://blog.our-files.com/2010/04/pulling-iphone-backups-apart/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 10:49:05 +0000</pubDate>
		<dc:creator>Internat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.our-files.com/?p=15</guid>
		<description><![CDATA[I wanted to pull my iphone backups apart because i accidentally deleted some stuff but didn&#8217;t want to restore it all and play with it that way. So heres the tools and what i needed to do it: Backups are stored at: ~/Library/Application Support/MobileSync/Backup) or on a PC (c:\Documents and Settings\Application Data\Apple Computer\MobileSync\Backup). Iphone backup [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to pull my iphone backups apart because i accidentally deleted some stuff but didn&#8217;t want to restore it all and play with it that way.</p>
<p>So heres the tools and what i needed to do it:<br />
Backups are stored at: ~/Library/Application Support/MobileSync/Backup) or on a PC (c:\Documents and Settings\<username>Application Data\Apple Computer\MobileSync\Backup).</p>
<p><a href="http://www.supercrazyawesome.com/">Iphone backup extractor for OSX</a><br />
<a href="http://menoob.com/2008/12/04/how-to-save-and-read-your-iphone-text-messages-on-your-computer/">how-to-save-and-read-your-iphone-text-messages-on-your-computer</a><br />
<a href="http://menoob.com/2008/12/02/how-to-recover-your-iphone-files-photos-contacts-notes-sms-call-history-etc/">how-to-recover-your-iphone-files-photos-contacts-notes-sms-call-history-etc</a></p>
<p>Couldnt work out how to pull up previous backups though.. only the latest one.. which is a pain.. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.our-files.com/2010/04/pulling-iphone-backups-apart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manage your email better.</title>
		<link>http://blog.our-files.com/2010/03/manage-your-email-better/</link>
		<comments>http://blog.our-files.com/2010/03/manage-your-email-better/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 09:31:43 +0000</pubDate>
		<dc:creator>Internat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.our-files.com/2010/03/manage-your-email-better/</guid>
		<description><![CDATA[Shorter emails are better.. apparently]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://howtogetfocused.com/wp-content/uploads/2010/03/Email-Flowchart.png" title="Manage email better" class="alignnone" width="645" height="1099" /></p>
<p><a href="http://www.jonathanfields.com/blog/short-replies/?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed%3A+JonathanFields+%28Jonathan+Fields+|+Awake+At+The+Wheel%29&#038;utm_content=Twitter">Shorter emails are better.. apparently</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.our-files.com/2010/03/manage-your-email-better/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Date functions in Oracle</title>
		<link>http://blog.our-files.com/2010/03/random-date-functions-in-oracle/</link>
		<comments>http://blog.our-files.com/2010/03/random-date-functions-in-oracle/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 03:58:30 +0000</pubDate>
		<dc:creator>Internat</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://blog.our-files.com/?p=13</guid>
		<description><![CDATA[Rounds Timefieldhere to the nearest 5 minutes.. trunc(timefieldhere,'dd') + round(to_char(timefieldhere,'sssss') / 300) / 288)]]></description>
			<content:encoded><![CDATA[<p>Rounds Timefieldhere to the nearest 5 minutes..</p>
<pre name="code" class="sql">
trunc(timefieldhere,'dd') + round(to_char(timefieldhere,'sssss') / 300) / 288)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.our-files.com/2010/03/random-date-functions-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sed makes my head hurt</title>
		<link>http://blog.our-files.com/2010/03/sed-makes-my-head-hurt/</link>
		<comments>http://blog.our-files.com/2010/03/sed-makes-my-head-hurt/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 10:24:28 +0000</pubDate>
		<dc:creator>Internat</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.our-files.com/?p=12</guid>
		<description><![CDATA[Trying to use sed in some stuff and i never want to have to write this kinda crap again so.. grep '^D' Filename &#124; sed -e 's/\(^.\{43\}\)0\(.*\)/\1M\2/g' That looks for any line in &#8220;Filename&#8221; that starts with D&#8230; then if the 44th character is 0, replace it with an M. kgo. grep "^D" Filename &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Trying to use sed in some stuff and i never want to have to write this kinda crap again so..</p>
<pre>
grep '^D' Filename  | sed -e 's/\(^.\{43\}\)0\(.*\)/\1M\2/g'
</pre>
<p>That looks for any line in &#8220;Filename&#8221; that starts with D&#8230; then if the 44th character is 0, replace it with an M.<br />
kgo.</p>
<pre>
grep "^D" Filename | sed -e 's/.*/&#038;XX/'
</pre>
<p>That looks for anything in Filename and adds &#8220;XX&#8221; to the end of the line..<br />
<a href="http://www.thegeekstuff.com/2009/09/unix-sed-tutorial-replace-text-inside-a-file-using-substitute-command/">Another Useful link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.our-files.com/2010/03/sed-makes-my-head-hurt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remap printers using wscript</title>
		<link>http://blog.our-files.com/2010/03/remap-printers-using-wscript/</link>
		<comments>http://blog.our-files.com/2010/03/remap-printers-using-wscript/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 10:26:37 +0000</pubDate>
		<dc:creator>Internat</dc:creator>
				<category><![CDATA[VBS/WSCRIPT]]></category>

		<guid isPermaLink="false">http://blog.our-files.com/?p=11</guid>
		<description><![CDATA[For work i had to come up with a way to remap printers since our current print server is on the way out.. I was pondering at home about the best way to do this with minimal work for the service desk or for me, and this is what i came up with.. Easy way [...]]]></description>
			<content:encoded><![CDATA[<p>For work i had to come up with a way to remap printers since our current print server is on the way out.. I was pondering at home about the best way to do this with minimal work for the service desk or for me, and this is what i came up with.. Easy way to map any old printers to new ones.. Just have to update the findnewPrinter function with the old vs new printers..</p>
<pre name="code" class="vb">
'Script to map and remove printers from old print server to new one
'Needs an entry in findNewPrinter function for each mapping
'nfrankish;2010-03-21

Set objNetwork = CreateObject("Wscript.Network")
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" &#038; strComputer &#038; "\root\cimv2")

Function findNewPrinter(Printername)
                select case PrinterName
                case "\\OldPrintServer\OldPrinterQueue"
                                findNewPrinter = "\\newprintserver\newprintqueue"
                case else
                                wscript.echo  "Printer: " &#038; Printername &#038; " not found"
                                findNewPrinter = ""
                end select
end function

Set colPrinters = objWMIService.ExecQuery _
    ("Select * From Win32_Printer Where Local = FALSE")

For Each objPrinter in colPrinters
                wscript.echo "Printer: " &#038; objprinter.Name &#038; " Default: " &#038; objprinter.default
                strNewPrinter = findNewPrinter(objprinter.name)
                if not (strNewPrinter = "") then
                                objNetwork.AddWindowsPRinterConnection strNewPrinter
                                if (objPrinter.default) then
                                                objNetwork.SetDefaultPrinter strNewPrinter
                                end if
                                objNetwork.RemovePrinterConnection objprinter.name, true, true
               end if
Next
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.our-files.com/2010/03/remap-printers-using-wscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linode.com VPS (Virtual Private Server) Hosting</title>
		<link>http://blog.our-files.com/2007/12/linodecom-vps-virtual-private-server-hosting/</link>
		<comments>http://blog.our-files.com/2007/12/linodecom-vps-virtual-private-server-hosting/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 11:59:40 +0000</pubDate>
		<dc:creator>Internat</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.our-files.com/?p=9</guid>
		<description><![CDATA[So I&#8217;ve been with Linode.com now for coming up on either 3 or 4 years, I&#8217;ve lost track now. I was looking for a remote server that i could play with and run a few services such as mail and maybe a web page or two. So a friend and I bought a linode. Back [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been with Linode.com now for coming up on either 3 or 4 years, I&#8217;ve lost track now. I was looking for a remote server that i could play with and run a few services such as mail and maybe a web page or two. So a friend and I bought a linode. Back then the lowest linode you could get was a 32mb linode (32mb of ram), and i think it hat 4gig of HDD space. Not a lot but it was reasonable at 19.95$ a month.  </p>
<p>Low and behold 3-4 years later, for the same price linode now offers the Linode 360, with 10Gig of storage off the bat. Every 6 months or so, so far, the team at Linode have managed to excite us all, by giving us free upgrades, the last one 20% ram increase for xmas. Ive been through countless free RAM upgrades, as well as storage, and transfer, and not once has there been a cost associated with it. </p>
<p>The only reason i can say that my uptime is not massively large, is that they keep giving out these upgrades that require us to reboot to take advantage of them. Otherwise i havnt had a much of a problem or downtime, that i havn&#8217;t caused myself, or was outside of Linode&#8217;s reachs (Datacentre issues).</p>
<p>Thats not to mention the friendliness and helpfulness of the 3 admins, Caker, Tasaro, and Mikegrb who are always available via the ticketing system, and atleast one is generally lurking in the irc channel (#linode on irc.oftc.net). On top of the help from the staff,  there are always people arround in the chat channel that are more then willing to help out on just about any linux topic, linode related, or not. That and the <a href="http://www.linode.com/forums">forums </a>are always bristling with activity, be it howto guides, customer feedback, announcements or community help requests with specific platform/software packages. </p>
<p>These days i have 3 linodes, 2x 360mb, and a 540mb one, ive never looked back&#8230;</p>
<p>With servers in 3 different data centres, full root access, friendly staff and a great community behind them, if your looking for a VPS, you can stop looking. Linode is the place to be. </p>
<p><a href="http://www.linode.com/?r=06166b3e8f5fb777b195dba42555e2aac7c435a8">www.linode.com</a> Got root?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.our-files.com/2007/12/linodecom-vps-virtual-private-server-hosting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>LVM2 Guide</title>
		<link>http://blog.our-files.com/2007/12/lvm2-guide/</link>
		<comments>http://blog.our-files.com/2007/12/lvm2-guide/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 10:19:11 +0000</pubDate>
		<dc:creator>Internat</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.our-files.com/?p=8</guid>
		<description><![CDATA[Well i got a few more drives today for my file server, and one of the things i couldnt remember was how to add to the LVM device that exists that stores all my loot. First off there is pvdisplay which shows you which physical drives are alocated to what volume group lvdisplay which gives [...]]]></description>
			<content:encoded><![CDATA[<p>Well i got a few more drives today for my file server, and one of the things i couldnt remember was how to add to the LVM device that exists that stores all my loot.</p>
<p>First off there is<br />
<code>pvdisplay</code> which shows you which physical drives are alocated to what volume group<br />
<code>lvdisplay</code> which gives you details about the actually logical volume, such as its status etc.</p>
<p>Now the part that initially tripped me up was forgetting to create the partition to LVM type on the raid<br />
<code>pvcreate /path/to/device</code><br />
It&#8217;ll show up something like this</p>
<blockquote><p>
pvcreate /dev/md3<br />
  Physical volume &#8220;/dev/md3&#8243; successfully created
</p></blockquote>
<p>Next step is to add it to the existing group<br />
<code>vgextend /path/to/device</code></p>
<blockquote><p>
channel:/etc/lvm# vgextend vg00 /dev/md3<br />
  Volume group &#8220;vg00&#8243; successfully extended
 </p></blockquote>
<p>Now that its in the volume group and its extended that group to incorporate all the devices, you need to extend the logical volume.<br />
<code>lvextend -l +536551 /dev/vg00/lv_space</code><br />
Where 536551 is the extents listed as free as shwon by <code>pvdisplay</code></p>
<p>Now that that is done, its just a matter of extending the file system..</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.our-files.com/2007/12/lvm2-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rebuilding Suexec with Different defaults</title>
		<link>http://blog.our-files.com/2007/07/rebuilding-suexec-with-different-defaults/</link>
		<comments>http://blog.our-files.com/2007/07/rebuilding-suexec-with-different-defaults/#comments</comments>
		<pubDate>Sun, 01 Jul 2007 02:28:03 +0000</pubDate>
		<dc:creator>Internat</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.our-files.com/?p=6</guid>
		<description><![CDATA[So after gearing up to do some changing to my security stuff, i was looking in on suexec. Suexec is great, it runs all processes launched from apache as the person that actually owns them and does a lot of checking to make sure things are what they are meant to be. The only down [...]]]></description>
			<content:encoded><![CDATA[<p>So after gearing up to do some changing to my security stuff, i was looking in on suexec. Suexec is great, it runs all processes launched from apache as the person that actually owns them and does a lot of checking to make sure things are what they are meant to be.</p>
<p>The only down side is, its default options are compiled in and cannot be changed. So on Debian this obviously presents a challenge. Never fear! We can rebuild it!!.<br />
Starting off,<br />
<code><br />
cd /usr/src<br />
apt-get build-dep apache2.2-common<br />
apt-get source apache2.2-common<br />
</code><br />
Wait patiently for stuff to download and unzip and then head into the directory it just created. Should be something like this<br />
<code><br />
cd apache2-2.2.3/<br />
</code><br />
Now you want to edit the debian build rules so that it changes the suexec stuff<br />
<code><br />
vi debian/rules<br />
</code><br />
Just near the top there is<br />
<code>AP2_COMMON_CONFARGS<br />
</code><br />
And you will notice that it has a lot of references to suexec.<br />
Just change the options to what you want. In my case i want to change the docroot to be /home/hosting<br />
so mine looks like<br />
<code>--with-suexec-docroot=/home/hosting \<br />
</code></p>
<p>Now to stop apache getting overwritten with the same version next time you update, we need to increment the build number.<br />
<code>dch -i</code><br />
(Note: if you don&#8217;t have this command you need to install devscripts )<br />
edit the build notes at the top to say what you changed, and then exit.</p>
<p>then simply build the package<br />
<code>dpkg-buildpackage</code><br />
if you now goto the /usr/src directory you will have all the .deb files that you need to install<br />
dpkg -i the ones you need such as apache2.2-common etc, and then run apt-get -f install to install any extra dependencies and your done.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.our-files.com/2007/07/rebuilding-suexec-with-different-defaults/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

