<?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>DavidCraddock.net</title>
	<atom:link href="http://www.davidcraddock.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidcraddock.net</link>
	<description>My Technology Site</description>
	<lastBuildDate>Fri, 16 Jul 2010 00:59:37 +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>Insights into a modern Indie Music label</title>
		<link>http://www.davidcraddock.net/2010/07/16/insights-into-a-modern-indie-music-label/</link>
		<comments>http://www.davidcraddock.net/2010/07/16/insights-into-a-modern-indie-music-label/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 00:52:05 +0000</pubDate>
		<dc:creator>David Craddock</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[indie label]]></category>
		<category><![CDATA[music business]]></category>
		<category><![CDATA[music pricing]]></category>

		<guid isPermaLink="false">http://www.davidcraddock.net/?p=788</guid>
		<description><![CDATA[I read this remarkable post on a public mailing list I subscribe to. I thought it was such a great insight into running a music label, that I just had to post it here. It discusses issues facing modern music, such as DRM, DMCA, and other ways of making (or losing) money. Fascinating. Here it [...]]]></description>
			<content:encoded><![CDATA[<p>I read this remarkable post on a public mailing list I subscribe to. I thought it was such a great insight into running a music label, that I just had to post it here. It discusses issues facing modern music, such as DRM, DMCA, and other ways of making (or losing) money.  Fascinating.</p>
<p>Here it is:</p>
<p>I work for a (fairly small) indie label &#8211; from witnessing this model in action I feel I have to stick up for the label given that I see the model working (or sometimes not so well) on a daily basis! Where we&#8217;ve done deals with artists in the past, they&#8217;ve almost always been a 50/50 arrangement &#8211; the artist receives 50% of net royalties. Where a label fronts recording costs, these can easily become £6-10,000 for an album session. Even an EP session can be upwards of £1,500 although these figures are a little pessimistic (though not unrealistic). (We actually designed, built and owned studios for ten years until 2001 but the project haemorrhaged money.)</p>
<p>With regards to CD pressing, a 1,000 run will cost around £800 including full colour print in a basic jewel case. The AP1/AP2a MCPS licence costs another amount on top. When getting your CDs pressed, add in other things (Super Jewel cases, slip / O-cards, digipaks or gatefolds with high quality card / fancy posters) and you can easily top the 1k mark, not even counting the artwork design costs. Of course, discount comes with with bulk, but almost nobody except the Big Four do >1k discs in a pressing. (To put things in perspective: when SyCo have done the X Factor Finalists CDs, they press up >10,000 of EACH finalist&#8217;s recording of the song &#8211; and shred the losers&#8217; copies when the winner is announced!)</p>
<p>To put stuff into distro with someone like Universal, you have your line costs simply to have the title listed on their system &#8211; monthly recurring, per title &#8211; then handling costs, despatch costs, &#8220;salesforce&#8221; costs (even though really the only people they sell into are HMV now, and from last year they&#8217;ve stopped guaranteeing racking in all but the top 6 or so stores in the UK, it&#8217;s a joke). You can&#8217;t sell your discs through at full retail, you have your wholesale (Dealer) price. We&#8217;ve sold albums through at £6.65 and I&#8217;ve later seen them in a London HMV for £12.99. Oh, and did I mention that supermarkets and stores like HMV *DEMAND* what they call a &#8220;file discount&#8221; of up to 40% just to take stock? (which is on a non-negotiable sale or return basis with up to a six month returns period.)</p>
<p>If you end up in a position where you don&#8217;t sell stock through into shops, it usually costs less for your distro to SHRED your discs than it does to send it back to you! Ridiculous. The costs are stacked against the labels at all points &#8211; incredibly frustrating. And that&#8217;s even before you begin to contemplate any plugging, promo, advertising, miscellaneous online, merch, booking agent / gig costs&#8230; Or even an advance for the artist! But it gets better&#8230;</p>
<p>So, this figure of 63% which the old techdirt article might quote as truth where valid for major labels (who might also own distribution, management, publishing and studios under the same roof), the model quickly falls apart as soon as focus on a smaller label. I used to think the whole model was bullshit and the artists got shafted, but if anything it&#8217;s level pegging &#8211; smaller labels have just as tough a time as artists as the risk to them to fund any new release is proportionally WAY larger. Also, the techdirt article works on the basis of the artist receiving a 20% royalty &#8211; this is dismal, and the artist should be smacked for agreeing to such a pitiful rate like the chumps they probably (hypothetically) are.</p>
<p>Take one of our real world iTunes scenarios &#8211; from a 79p purchase, iTunes immediately keeps about 32p. For UK and most worldwide sales, this also includes the royalties which the label&#8217;s obliged to pay (in the UK, to the MCPS-PRS Alliance). However, the USA requires the selling party to pay the mechanical on each sale (an arse-about-tit form which has arisen from the disconnected Collection Agencies &#8211; Harry Fox Agency being the incumbent on Mechanicals and ASCAP, BMI and SESAC on the Performance royalties &#8211; which adds yet another level of complication.</p>
<p>From what&#8217;s left (47p), you halve the resulting amount on a 50/50 deal. Neither the label nor the artist gets much for their work. On some artists whom we&#8217;ve purely done digital distribution for (on a rolling licence agreement), we give the artist 80% of net. As you can imagine, we get virtually nothing &#8211; and our income&#8217;s directly tied to their success, so we have an interest in seeing them do well. It&#8217;s a tough environment to be in.</p>
<p>For receiving US/Canadian/Mexico/European/Australasian payments, we first have to receive the currency and have the bank convert it to GBP. Of course, we can&#8217;t get the Interbank rates, nobody but the banks get those &#8211; so more money&#8217;s immediately lost in conversion. The larger labels will have sweetheart deals with their banks (or almost certainly have accounts in each relevant territory) so this isn&#8217;t so much of a big deal, but the amount of administration just scales inordinately. If you deal with managing your artists&#8217; Publishing rights, you can quickly become LITERALLY swamped in paperwork. The amount of time sucked up by adminning the release of music is extraordinary.</p>
<p>So please nobody think all music labels have it easy&#8230; I have no doubt that the Big Four have royally shafted artists in the past but they can largely lumber along based on a few artists doing exceptionally well for the rest of their current roster (with their back catalogue from very famous artists helping too). The problem they&#8217;re going to have is that almost none of the artists whose catalogue&#8217;s been released in the past two decades *really* has the staying power of the classic artists &#8211; Dire Straits, Genesis, Pink Floyd, The Who or Fleetwood Mac, just to name five off the top of my head. Don&#8217;t even get me started on the epic fail that is streaming revenues from Spotify, mFlow, We7 etc.</p>
<p>Now even with all of this, I still regard sites like YouTube as a promotional tool. Some of our most famous catalogue I&#8217;ve held off on issuing DMCA takedowns for, because it&#8217;s a genuinely beneficial promotional tool &#8211; it&#8217;s the pragmatic response. Where do people go first if they want to quickly listen to a track? YouTube! What happens if they only ever wanted to hear it once and never again? You&#8217;ve not lost that sale because it almost certainly would never have happened. What happens if they still want to have a copy of that track? They&#8217;ll go buy it from one of the easily accessible venues, it&#8217;s not expensive to do. The label&#8217;s job is to make the catalogue ubiquitous on all of the major (and some of the trendier niche stores) where at all possible. The digital distribution costs are another thing the label has to absorb &#8211; monthly, per track, per store usually, if not on an aggregation deal where it&#8217;s a percentage on each sale but the label usually ends up worse off. It&#8217;s a tough position because the label almost always feels the need to protect their &#8216;content&#8217; (shudder &#8211; hate that word) but issuing takedowns for every instance of a track is more often than not a kneejerk reaction which harms longterm sales. I&#8217;m personally torn between leaving them, taking them down or even putting up better mashup/promo mix versions on the label&#8217;s official account!</p>
<p>Treat your customers like adults and I think you earn their respect a bit more. This applies to all forms of digital media, including tellybox shows. (thesis: DRM = genuinely unhelpful towards nurturing that unique supportive viewer-provider relationship. Trust your customers, they&#8217;ll not disrespect you.) In music, nobody wants to buy a track if they can never audition it, and 30sec samples aren&#8217;t really a good enough.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidcraddock.net/2010/07/16/insights-into-a-modern-indie-music-label/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restoring Ubuntu 10.4&#8242;s Bootloader, after a Windows 7 Install</title>
		<link>http://www.davidcraddock.net/2010/07/13/restoring-ubuntu-10-4s-bootloader-after-a-windows-7-install/</link>
		<comments>http://www.davidcraddock.net/2010/07/13/restoring-ubuntu-10-4s-bootloader-after-a-windows-7-install/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 13:02:51 +0000</pubDate>
		<dc:creator>David Craddock</dc:creator>
				<category><![CDATA[Solutions to a Specific Problem]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[master boot record]]></category>
		<category><![CDATA[repair mbr]]></category>
		<category><![CDATA[ubuntu 10.4]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://www.davidcraddock.net/?p=781</guid>
		<description><![CDATA[I installed Windows 7 after I had installed Ubuntu 10.4. Windows 7 overwrote the Linux bootloader &#8220;grub&#8221; on my master boot record. Therefore I had to restore it. I used the Ubuntu 10.4 LiveCD to start up a live version of Ubuntu. While under the LiveCD, I then restored the Grub bootloader by chrooting into [...]]]></description>
			<content:encoded><![CDATA[<p>I installed Windows 7 after I had installed Ubuntu 10.4. Windows 7 overwrote the Linux bootloader &#8220;grub&#8221; on my master boot record. Therefore I had to restore it.</p>
<p>I used the Ubuntu 10.4 LiveCD to start up a live version of Ubuntu. While under the LiveCD, I then restored the Grub bootloader by chrooting into my old install, using the linux command line. This is a fairly complex thing to do, and so I recommend you use this approach only if you&#8217;re are confident with the linux command line:</p>
<pre>
(as root under Ubuntu's LiveCD)

# prepare chroot directory

mkdir /chroot
d=/chroot

# mount my linux partition

mount /dev/sda1 $d   # my linux partition was installed on my first SATA hard disk, on the first parition (hence sdA1).

# mount system systems inside the new chroot directory

mount -o bind /dev $d/dev
mount -o bind /sys $d/sys
mount -o bind /dev/shm $d/dev/shm
mount -o bind /proc $d/proc

# accomplish the chroot

chroot $d

# proceed to update the grub config file to include the option to boot into my new windows 7 install

update-grub

# install grub with the new configuration options from the config file, to the master boot record on my first hard disk

grub-install /dev/sda

# close down the liveCD instance of linux, and boot from the newly restored grub bootloader

reboot
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.davidcraddock.net/2010/07/13/restoring-ubuntu-10-4s-bootloader-after-a-windows-7-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 Gaming on my Macbook</title>
		<link>http://www.davidcraddock.net/2010/07/01/running-windows-7-on-my-macbook/</link>
		<comments>http://www.davidcraddock.net/2010/07/01/running-windows-7-on-my-macbook/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 22:50:25 +0000</pubDate>
		<dc:creator>David Craddock</dc:creator>
				<category><![CDATA[Solutions to a Specific Problem]]></category>
		<category><![CDATA[bootcamp]]></category>
		<category><![CDATA[dual boot]]></category>
		<category><![CDATA[macbook white]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://www.davidcraddock.net/?p=769</guid>
		<description><![CDATA[I have a 2006/2007 Core 2 Duo 2.6ghz white macbook, that I use regularly for internet, music, watching films, itunes and integration with my iPhone. I wanted to turn my desktop PC into a &#8216;work only&#8217; Ubuntu Linux machine, so that I don&#8217;t get distracted when I&#8217;m supposed to be doing something else. But I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.davidcraddock.net/wp-content/uploads/2010/07/bootcamp.jpg"><img src="http://www.davidcraddock.net/wp-content/uploads/2010/07/bootcamp-300x191.jpg" alt="" title="bootcamp" width="300" height="191" style="border: none;" class="aligncenter size-medium wp-image-770" /></a></p>
<p>I have a 2006/2007 Core 2 Duo 2.6ghz white macbook, that I use regularly for internet, music, watching films, itunes and integration with my iPhone.</p>
<p>I wanted to turn my desktop PC into a &#8216;work only&#8217; Ubuntu Linux machine, so that I don&#8217;t get distracted when I&#8217;m supposed to be doing something else.</p>
<p>But I still have a lot of PC games that I wanted to play on the Macbook, so I decided to try and setup a windows environment to play games on using Bootcamp 2.0 to create a dual-boot OSX/Windows 7 configuration.</p>
<p>It turns out it works really well. The Macbook runs Windows 7 64-bit edition fine, and although the integrated graphics card isn&#8217;t designed to run modern games very well, you can get a good gaming experience from small indie games and the older type of PC RPGs that I tend to play. My macbook got a 3.5 rating on the windows experience index for graphics, which is sufficient for many PC games.</p>
<p>First you need to partition your macbook&#8217;s HD using the Bootcamp assistant, in the OSX utilities section. Make sure you have your first OSX installation DVD to hand, the one that came with your Macbook. I chose to split the hard drive into two equally sized partitions. Then just place your W7 DVD in the drive, and Bootcamp takes care of the rest.</p>
<p>Once W7 is installed, you can access the Bootcamp menu on startup by holding down the option key. This brings up a menu where you can select to boot into OSX or Windows.</p>
<p>When you start W7 for the first time, you can install the windows driver set for your Macbook that Bootcamp provides you. Insert your OSX installation DVD 1, and run the setup.exe that is located in the Bootcamp folder. This will install native windows drivers for your Macbook hardware.</p>
<p>The only change I needed to make for my macbook, was to install the latest 64bit Realtek drivers for Vista/Windows 7, which are located <a href="http://www.realtek.com/downloads/downloadsCheck.aspx?Langid=1&#038;PNid=24&#038;PFid=24&#038;Level=4&#038;Conn=3&#038;DownTypeID=3&#038;GetDown=false">on the Realtek website</a>.  This will fix any sound problems you might have while playing games.</p>
<p>Now don&#8217;t expect to run the latest 3D games, but if you&#8217;re happy enough with slightly older, classic, indie or retro games, you can get a good gaming experience on Windows 7 from your macbook. It does well with plenty of the indie games available on Value&#8217;s Steam distribution network.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidcraddock.net/2010/07/01/running-windows-7-on-my-macbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ripping Movies onto the iPhone</title>
		<link>http://www.davidcraddock.net/2010/05/17/ripping-movies-onto-the-iphone/</link>
		<comments>http://www.davidcraddock.net/2010/05/17/ripping-movies-onto-the-iphone/#comments</comments>
		<pubDate>Mon, 17 May 2010 03:15:00 +0000</pubDate>
		<dc:creator>David Craddock</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[handbrake]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ripit]]></category>

		<guid isPermaLink="false">http://www.davidcraddock.net/?p=762</guid>
		<description><![CDATA[I&#8217;m currently watching Persepolis, the 2008 animated film about a tomboy anarchist growing up in Iran. I&#8217;m watching this on my new iPhone 3GS, and the picture and audio quality is very good. Here&#8217;s what I used to convert my newly bought Persepolis DVD, for watching on the iPhone. 1x Macbook (but you can use [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently watching Persepolis, the 2008 animated film about a tomboy anarchist growing up in Iran. I&#8217;m watching this on my new iPhone 3GS, and the picture and audio quality is very good.</p>
<p>Here&#8217;s what I used to convert my newly bought Persepolis DVD, for watching on the iPhone.</p>
<p>1x Macbook (but you can use any intel mac)<br />
1x iTunes<br />
1x RipIt &#8211; Commercial Mac DVD Ripper (rips up to 10 DVDs on the free trial, $20 after)<br />
1x Handbrake 32 &#8211; Freely available transcoder<br />
1x VLC 32 &#8211; Freely available media player<br />
1x DVD</p>
<p>* Ripit &#8211; rips the video and audio from the DVD, onto your computer<br />
* Handbrake 32 &#8211; &#8216;transcodes&#8217; the ripped video and audio, meaning &#8211; it converts it into an iPhone compatible video file.<br />
* VLC 32 &#8211; is used by Handbrake 32 to get past any problems with converting the media.</p>
<p>Go to the following sites to fetch the software:</p>
<p>1. Ripit &#8211; http://thelittleappfactory.com/ripit/<br />
2. Handbrake 32 &#8211; http://handbrake.fr/downloads.php (get the 32 bit version)<br />
3. VLC 32 &#8211; http://www.videolan.org/vlc/download-macosx.html (be sure to get the 32 bit version)</p>
<p>There&#8217;s currently a difficulty in getting the VLC 64 bit software for the Mac, and so although the 64 bit version is  faster to use, you&#8217;re probably better off with 32 bit versions of both for now.</p>
<p>The Process</p>
<p>1) Rip the DVD. </p>
<p>Start RipIt. It will ask for a DVD, insert the DVD.. and point the resultant save location to the desktop. The ripping process takes about 40 minutes on my Macbook, you can check the progress by looking at the icon in the dock &#8211; it will be updated with the percentage of progress until completion. You can do other things on your mac while it&#8217;s ripping, even though the DVD drive will be occupied. Wait until it&#8217;s completed before continuing.</p>
<p>2) Transcode (convert) the ripped video file for use on the iPhone.</p>
<p>Start Handbrake. There are a bunch of transcoding settings called presets &#8211; those tell Handbrake what type of media player you want the converted video to work on.  In handbrake on the right section of the window, select the iPhone preset. Then go to the file menu, select &#8216;Open&#8217;, and then select the video file that RipIt saved onto your desktop. Then select the destination for the converted video file. Then select the Start (green) button on Handbrake window, and it will start. You can now minimise handbrake and do other things. The transcoding process depends on the film, but takes about an hour on my Macbook. You can check on progress by maximizing the Handbrake window, and checking on the progress bar.</p>
<p>3) Move the converted video file onto your iPhone.</p>
<p>Once that&#8217;s done, you will have another media file on your desktop &#8211; this is the end result, a video file that will play on your iPhone. Simply connect your iPhone to your Mac, start up iTunes, and drag that file from your desktop into the iPhone icon on your iTunes window. It will take a couple of minutes to transfer, then eject the iPhone as normal</p>
<p>Now you can watch this new movie on your iPhone by going to the &#8216;Videos&#8217; tab of your iPod app.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidcraddock.net/2010/05/17/ripping-movies-onto-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decent Graphics for Flash Games</title>
		<link>http://www.davidcraddock.net/2010/05/17/art-for-flash-games/</link>
		<comments>http://www.davidcraddock.net/2010/05/17/art-for-flash-games/#comments</comments>
		<pubDate>Mon, 17 May 2010 02:29:54 +0000</pubDate>
		<dc:creator>David Craddock</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.davidcraddock.net/?p=749</guid>
		<description><![CDATA[Lately I&#8217;ve been thinking about making a Flash game or application. Although I haven&#8217;t made one yet, my current understanding is that most projects of this type require a lot of artwork. I found this article, and was impressed at the quality and the resources mentioned: http://freelanceflashgames.com/news/2009/03/25/the-big-guide-to-hiring-an-artist/]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been thinking about making a Flash game or application. Although I haven&#8217;t made one yet, my current understanding is that most projects of this type require a lot of artwork.</p>
<p>I found this article, and was impressed at the quality and the resources mentioned: <a href="http://freelanceflashgames.com/news/2009/03/25/the-big-guide-to-hiring-an-artist/">http://freelanceflashgames.com/news/2009/03/25/the-big-guide-to-hiring-an-artist/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidcraddock.net/2010/05/17/art-for-flash-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress HTML edit mode inserts BR tags sometimes when you add a carriage return..</title>
		<link>http://www.davidcraddock.net/2010/04/28/wordpress-html-edit-mode-inserts-br-tags-sometimes-when-you-add-a-carriage-return/</link>
		<comments>http://www.davidcraddock.net/2010/04/28/wordpress-html-edit-mode-inserts-br-tags-sometimes-when-you-add-a-carriage-return/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 20:44:39 +0000</pubDate>
		<dc:creator>David Craddock</dc:creator>
				<category><![CDATA[Solutions to a Specific Problem]]></category>
		<category><![CDATA[br]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[html edit]]></category>
		<category><![CDATA[wordpress 2.9.2]]></category>

		<guid isPermaLink="false">http://www.davidcraddock.net/?p=741</guid>
		<description><![CDATA[This is something that was quite annoying today, as I was struggling to use WordPress 2.9.2 to align some pictures in the HTML mode of editing a page, on a client&#8217;s website. It turns out that WordPress was adding BR tags sometimes when I hit return.. and sometimes not. The annoying thing was, although the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.davidcraddock.net/wp-content/uploads/2010/04/carriagereturn.jpg"><img src="http://www.davidcraddock.net/wp-content/uploads/2010/04/carriagereturn-300x225.jpg" alt="" title="carriagereturn" width="300" height="225" class="aligncenter size-medium wp-image-743" /></a></p>
<p>This is something that was quite annoying today, as I was struggling to use WordPress 2.9.2 to align some pictures in the HTML mode of editing a page, on a client&#8217;s website.</p>
<p>It turns out that WordPress was adding BR tags sometimes when I hit return.. and sometimes not. The annoying thing was, although the BRs were outputted in the resultant WordPress site, the BRs were not visible in the WordPress HTML edit mode itself.. meaning they were invisible and undetectable until I viewed the resultant website source and finally figured it out.</p>
<p>WordPress does insert some formatting tags now and then, it seems, but I would have thought it would tell you about the tags that would change the page layout! Apparently not. Anyway, something to be aware of for WordPress gurus..</p>
<p>Edit:</p>
<p>I don&#8217;t have time to report this as a bug, but this is the stack I&#8217;m using for anyone interested:</p>
<p>Browser: Google Chrome for Mac (5.0.342.9 beta)<br />
TinyMCE Advanced Editor Plugin for WP (3.2.7)<br />
WordPress 2.9.2</p>
<p>The beta of Google Chrome is a bit unstable, although it may not be the source of the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidcraddock.net/2010/04/28/wordpress-html-edit-mode-inserts-br-tags-sometimes-when-you-add-a-carriage-return/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forkbombs and How to Prevent Them</title>
		<link>http://www.davidcraddock.net/2010/04/02/forkbombs-and-how-to-prevent-them/</link>
		<comments>http://www.davidcraddock.net/2010/04/02/forkbombs-and-how-to-prevent-them/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 03:50:37 +0000</pubDate>
		<dc:creator>David Craddock</dc:creator>
				<category><![CDATA[Solutions to a Specific Problem]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[denial of service]]></category>
		<category><![CDATA[forkbomb]]></category>
		<category><![CDATA[ubuntu 9.10]]></category>

		<guid isPermaLink="false">http://www.davidcraddock.net/?p=730</guid>
		<description><![CDATA[A forkbomb is a program or script that continually creates new copies of itself, that create new copies of themselves. It&#8217;s usually a function that calls itself, and each time that function is called, it creates a new process to run the same function. You end up with thousands of processes, all creating processes themselves, [...]]]></description>
			<content:encoded><![CDATA[<p>A forkbomb is a program or script that continually creates new copies of itself, that create new copies of themselves. It&#8217;s usually a function that calls itself, and each time that function is called, it creates a new process to run the same function. </p>
<p>You end up with thousands of processes, all creating processes themselves, with an exponential growth. Soon it takes up all the resources of your server, and prevents anything else running on it.</p>
<p>Forkbombs are an example of a denial of service attack, because it completely locks up the server it&#8217;s run on.</p>
<p>More worryingly, on a lot of Linux distributions, you can run a forkbomb as any user that has an account on that server. So for example, if you give your friend an account on your server, he can crash it/lock it up whenever he wants to, with the following shell script forkbomb:</p>
<p><code>:(){ :|:&#038; };:<br />
</code></p>
<p>Bad, huh?</p>
<p>Ubuntu server 9.10 is vulnerable to this shell script forkbomb. Run it on your linux server as any user, and it will lock it up. </p>
<p>This is something I wanted to fix right away on all my linux servers. Linux is meant to be multiuser, and it has a secure and structured permissions system allowing dozens of users to log in and do their work, at the same time. However when any one user can lock up the entire server, this is not good for a multiuser environment.</p>
<p>Fortunately, fixing this on ubuntu server 9.10 is quite simple. You limit the maximum number of running processes that any user can create. So the fork bomb runs, but hits this ceiling, and eventually stops without the administrator having to do anything.</p>
<p>As root, edit this file, and add the following line:</p>
<p>/etc/security/limits.conf</p>
<pre>
...
...
*               soft    nproc   35
</pre>
<p>This sets the maximum process cap for all users, to be 35. The root user isn&#8217;t affected by this limit. This limit of 35 should be fine for remote servers that are not offering users gnome, kde, or any other graphical X interface. If you are expecting your users to be able to run applications like that, you may want to increase the limit to 50, and although this will increase the time forkbombs will take to exit, they should still exit without locking up your server.</p>
<p>Alternatively, you can setup an &#8216;untrusted&#8217; and &#8216;trusted&#8217; user groups, and assign that 35 limit to the untrusted users, giving trusted users access to the trusted group, which does not have that limit. Use these lines:</p>
<p>/etc/security/limits.conf</p>
<pre>
...
...
@untrusted               soft    nproc   35
@trusted               soft    nproc   50
</pre>
<p>I&#8217;ve tested these nproc limits on 8.10 and 9.10 ubuntu-server installs, but you should really test your own servers install, if possible, by forkbombing it yourself as a standard user, using the bash forkbomb above, once you&#8217;ve applied the fix. The fix is effective as soon as you&#8217;ve edited that file, but please note that you have to logout, and log back in again as a standard user before the new process cap is applied to your user account.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidcraddock.net/2010/04/02/forkbombs-and-how-to-prevent-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove nano, vim and other editors&#8217; backup files out of a directory tree</title>
		<link>http://www.davidcraddock.net/2010/03/22/how-to-remove-nano-vim-and-other-editors-backup-files-out-of-a-directory-tree/</link>
		<comments>http://www.davidcraddock.net/2010/03/22/how-to-remove-nano-vim-and-other-editors-backup-files-out-of-a-directory-tree/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 20:49:20 +0000</pubDate>
		<dc:creator>David Craddock</dc:creator>
				<category><![CDATA[Solutions to a Specific Problem]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nano backup files]]></category>
		<category><![CDATA[vim backup files]]></category>
		<category><![CDATA[~ backup]]></category>

		<guid isPermaLink="false">http://www.davidcraddock.net/?p=710</guid>
		<description><![CDATA[Linux command-line editors such as nano and vim often, by default, create backup files with the prefix of &#8220;~&#8221;. I.e, if I created a file called /home/david/myfile, then nano would create a backup in /home/david/myfile~. Sometimes it doesn&#8217;t delete them either, so you&#8217;re left with a bunch of backup files all over the place, especially [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.davidcraddock.net/wp-content/uploads/2010/03/cuttingtree.jpg"><img src="http://www.davidcraddock.net/wp-content/uploads/2010/03/cuttingtree-207x300.jpg" style="border: none" alt="gardening for science.." title="gardening for science.." width="207" height="300" class="aligncenter size-medium wp-image-722" /></a></p>
<p>Linux command-line editors such as nano and vim often, by default, create backup files with the prefix of &#8220;~&#8221;. I.e, if I created a file called /home/david/myfile, then nano would create a backup in /home/david/myfile~. Sometimes it doesn&#8217;t delete them either, so you&#8217;re left with a bunch of backup files all over the place, especially if you&#8217;re editing a lot on a directory tree full of source code. </p>
<p>Those stray backup files make directory listings confusing, and also add unnecessary weight to the commits on source control systems such as svn, cvs, git.. etc. If you&#8217;re working on a programming team with other people, then it causes further problems and confusion, because person A&#8217;s editor can accidentally load person B&#8217;s backup file.. etc etc. Nightmare.</p>
<p>So instruct your editor, or the programming team you&#8217;re working with, not to drop these backup files. You can configure most editors to change the place where the editor drops its backup files, so you could store all your backup files in a subdirectory of your home directory, for example, if needed. However I always set my editors not to leave backup files about.</p>
<p>Once you know that new backup files will not be created, view the current list of backup files, along with the user that created them.. so you know who&#8217;s been creating the backup files and when, etc:</p>
<pre>find . -name '*~' -type f -exec ls -al {}  \;
</pre>
<p>Then archive the stray backup files, with this command:</p>
<pre>find . -name '*~' -type f -exec mv -i {} ./archived-backups \;
</pre>
<p>That will find all backup files in the current directory and below, and move them all to a subdirectory in the current directory called &#8216;archived-backups&#8217;. This is a fairly safe find/exec command, because with the -i switch, mv will not &#8216;clobber&#8217;. This means If you have two backup files, one in /opt/code/index~ and one in /opt/code/bla/bla/index~, they will not &#8216;clobber&#8217;, or overwrite each other automatically when moved into the new directory. You will be informed of any conflicts present so you can resolve them yourself.</p>
<p>However in practice I usually omit the &#8216;-i&#8217; switch and let them clobber each other, because I usually end up deleting the ./archived-backups/ directory very quickly after that anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidcraddock.net/2010/03/22/how-to-remove-nano-vim-and-other-editors-backup-files-out-of-a-directory-tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip for watching the completion of a large file copy</title>
		<link>http://www.davidcraddock.net/2010/03/20/tip-for-watching-the-completion-of-a-large-file-copy/</link>
		<comments>http://www.davidcraddock.net/2010/03/20/tip-for-watching-the-completion-of-a-large-file-copy/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 22:44:06 +0000</pubDate>
		<dc:creator>David Craddock</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[cp]]></category>
		<category><![CDATA[du -m]]></category>
		<category><![CDATA[monitoring cp]]></category>
		<category><![CDATA[watch]]></category>
		<category><![CDATA[watch du]]></category>

		<guid isPermaLink="false">http://www.davidcraddock.net/?p=695</guid>
		<description><![CDATA[Forget the wonderful windows progress bar, and imagine I&#8217;m in the world of command-line Linux, and I want to copy a 484MB file, called VMware-server-2.0.2-203138.i386.tar.gz, from my home directory to a remote server. But I want to figure out how long it&#8217;s going to take. 1. First I can run a &#8220;du -m&#8221; command to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.davidcraddock.net/wp-content/uploads/2010/03/windows-copy.gif"><img src="http://www.davidcraddock.net/wp-content/uploads/2010/03/windows-copy.gif" alt="" title="windows copy" width="382" height="163" class="aligncenter size-full wp-image-697" /></a></p>
<p>Forget the wonderful windows progress bar, and imagine I&#8217;m in the world of command-line Linux, and I want to copy a 484MB file, called VMware-server-2.0.2-203138.i386.tar.gz, from my home directory to a remote server. But I want to figure out how long it&#8217;s going to take.</p>
<p>1. First I can run a &#8220;du -m&#8221; command to get the total MB size of the original file:</p>
<pre>du -m /home/david/VMware-server-2.0.2-203138.i386.tar.gz</pre>
<p>I.e:<br />
<code><br />
david@believe:~$ du -m VMware-server-2.0.2-203138.i386.tar.gz<br />
484     VMware-server-2.0.2-203138.i386.tar.gz<br />
</code></p>
<p>Now I know it is approximately 484MB.</p>
<p>2. Then I run the copy. I&#8217;m copying the file from /home/david/ to /opt/remote/myserver, which is a remotely mounted directory on a server somewhere in Canada.</p>
<p><code><br />
david@believe:~$ cp ./VMware-server-2.0.2-203138.i386.tar.gz /opt/remote/myserver/<br />
</code></p>
<p>At this point cp will just hang until it&#8217;s finished. There is normally no progress indicator or anything. But I want to figure out how much of the file has been copied, so I can figure out how much is left to copy, and get a rough idea of the progress.</p>
<p>3. So I SSH into the remote server in Canada, and run this command</p>
<p><code><br />
david@myserver:~$ watch du -m ./VMware-server-2.0.2-203138.i386.tar.gz<br />
</code></p>
<p>the copy command by default seems to be incremental, ie: piece by piece, not all at once. Therefore with the &#8220;Watch&#8221; command, you can watch the size, in MB, of the new file as it accumulates. The watch command will refresh every 2 seconds, so you&#8217;ll be updated as the copy goes on. </p>
<p>You can probably invoke a progress meter with the cp command, or use rsync. Rsync is much better for large file copies, and remote file copies. But the advantage of the method above is that you can watch file copies already executed without any special arguments, which I sometimes find very useful when I remember that that file I already started copying isn&#8217;t 200MB.. it&#8217;s actually 2.5GB.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidcraddock.net/2010/03/20/tip-for-watching-the-completion-of-a-large-file-copy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Linux Root Directory, Explained</title>
		<link>http://www.davidcraddock.net/2010/03/20/the-linux-file-structure/</link>
		<comments>http://www.davidcraddock.net/2010/03/20/the-linux-file-structure/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 15:19:46 +0000</pubDate>
		<dc:creator>David Craddock</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[/dev]]></category>
		<category><![CDATA[/etc]]></category>
		<category><![CDATA[/home]]></category>
		<category><![CDATA[/proc]]></category>
		<category><![CDATA[/root]]></category>
		<category><![CDATA[/sys]]></category>
		<category><![CDATA[explained]]></category>
		<category><![CDATA[linux root directory]]></category>
		<category><![CDATA[root directory tutorial]]></category>

		<guid isPermaLink="false">http://www.davidcraddock.net/?p=572</guid>
		<description><![CDATA[It&#8217;s helpful to know the basic filesystem on a Linux machine, to better understand where everything is supposed to go, and where you should start looking if you want to find a certain file. Everything in Linux is stored in the &#8220;root directory&#8221;. On a windows machine, that would be equivalent to C:\. C:\ is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.davidcraddock.net/wp-content/uploads/2010/03/got-root.jpg"><img src="http://www.davidcraddock.net/wp-content/uploads/2010/03/got-root.jpg" alt="" title="got root" width="225" height="225" class="aligncenter size-full wp-image-671" /></a>It&#8217;s helpful to know the basic filesystem on a Linux machine, to better understand where everything is supposed to go, and where you should start looking if you want to find a certain file.</p>
<p>Everything in Linux is stored in the &#8220;root directory&#8221;. On a windows machine, that would be equivalent to C:\. C:\ is the main folder where everything is stored. On Linux we call this the &#8220;root directory&#8221;, or simply &#8220;/&#8221;. To go up to this root directory, type:</p>
<pre>cd /</pre>
<p>To list all the folders and files in the root directory, type this:</p>
<pre>ls /</pre>
<p>Alternatively, if you want to see the folders and files exactly the way I see them below for easy comparison, type this:</p>
<pre>ls -lhaFtr --color /</pre>
<p>Once you&#8217;ve typed in one of the &#8216;ls&#8217; commands above, you&#8217;ll see some information similar to that on the screenshot below.. (please scroll down)..</p>
<p><br/><br />
<br/><br />
<br/><br />
<br/><br />
<br/></p>
<p><strong>Ubuntu Linux<br />
</strong></p>
<p><a href="http://www.davidcraddock.net/wp-content/uploads/2010/03/1348573631.png"><img src="http://www.davidcraddock.net/wp-content/uploads/2010/03/1348573631.png" alt="" title="Linux Filesystem" width="827" height="518" class="aligncenter size-full wp-image-584" /></a></p>
<p>Above you can see the files and folders in the root directory of my ubuntu linux server, after I&#8217;ve typed &#8216;ls /&#8217;. Ignore everything but the coloured names on the right, those coloured names are the names of the files and folders in this directory. Don&#8217;t worry about the shades of different colours either. It&#8217;s not really important to explain how they are coloured right now, just to explain the purpose behind each file or folder shown.</p>
<p>So let me explain the purpose behind each of these, in turn. I&#8217;ll include the same screenshot multiple times, so you can reference the explanations against it as you scroll down.</p>
<pre>selinux/</pre>
<p> &#8211; Directory for linux security features, rarely visited by normal users like you or me.</p>
<pre>mnt/</pre>
<p> &#8211; Traditional directory for the files from removable media, ie USB keys, external hard drives. Not used anymore, it only exists for historical purposes.</p>
<pre>lost+found/</pre>
<p> &#8211; Directory where files and directories end up when they&#8217;ve been recovered from a hard disc repair.</p>
<pre> cdrom -> media/cdrom/</pre>
<p> &#8211; Link the files currently in your CDROM or DVDROM drive.</p>
<pre>media/</pre>
<p> &#8211; New style directory for the files from removable media such as USB keys, external hard drives, etc. This is the new convention, and so you should always use media/ instead of mnt/, above.</p>
<pre>vmlinuz.old -> boot/vmlinuz-2.6.31-17-generic</pre>
<p> &#8211; A backup of your most recent old Linux operating system kernel, ie: your operating system. Don&#8217;t delete this =)</p>
<pre>initrd.img.old -> boot/initrd.img-2.6.31-17-generic</pre>
<p> &#8211; Another part of the backup for your most recent old Linux kernel.<br />
<br/><a href="http://www.davidcraddock.net/wp-content/uploads/2010/03/1348573631.png"><img src="http://www.davidcraddock.net/wp-content/uploads/2010/03/1348573631.png" alt="" title="Linux Filesystem" width="827" height="518" class="aligncenter size-full wp-image-584" /></a></br></p>
<pre>opt/</pre>
<p> &#8211; An empty directory reserved for you to put third-party programs and software in.</p>
<pre>lib/</pre>
<p> &#8211; Operating system drivers and kernel modules live here. Also contains all system libraries, so when you compile a new program from the source code, it will use the existing code libraries stored here.</p>
<pre>bin/</pre>
<p> &#8211; Basic commands that everyone uses, like &#8220;ls&#8221; and &#8220;cd&#8221;, live here.</p>
<pre>usr/</pre>
<p> &#8211; This is where all user-supplied software should go; ie: software that you install that doesn&#8217;t normally come with the operating system. Put all programs here.</p>
<pre>sbin/</pre>
<p> &#8211; Basic but essential system administration commands that the admin user only uses, ie: reboot, poweroff, etc.<br />
<br/><a href="http://www.davidcraddock.net/wp-content/uploads/2010/03/1348573631.png"><img src="http://www.davidcraddock.net/wp-content/uploads/2010/03/1348573631.png" alt="" title="Linux Filesystem" width="827" height="518" class="aligncenter size-full wp-image-584" /></a></br></p>
<pre>vmlinuz -> boot/vmlinuz-2.6.31-20-generic</pre>
<p> &#8211; Your actual operating system kernel, ie: the one that is running right now. Don&#8217;t delete this.</p>
<pre>initrd.img -> boot/initrd.img-2.6.31-20-generic</pre>
<p> &#8211; Another part of the kernel that is running right now.</p>
<pre>boot/</pre>
<p> &#8211; Reserved for Linux kernel files, and other things that need to be loaded on bootup. Don&#8217;t touch these.</p>
<pre>proc/</pre>
<p> &#8211; Proc is a handy way of accessing critical operating system information, through a bunch of files. Ie: try typing &#8216;cat /proc/cpuinfo&#8217;. That queries the current kernel for the information on your processors (CPUs), and returns the info for you in a text file.</p>
<pre>sys/</pre>
<p> &#8211; Like proc/, this is another bunch of files that aren&#8217;t files at all, but &#8216;fake&#8217; files. When you access them, the operating system goes away and finds out information, and offers that information up as a text file to you.</p>
<pre>dev/</pre>
<p> &#8211; Device files. In here live the device files for your hard drives, your CD/DVD drives, your soundcard, your network card.. in fact anything you have installed that Linux uses, it has a counterpart in here that is automatically added and removed by the OS. Don&#8217;t ever delete, move or rename any of the files here.</p>
<pre>home/</pre>
<p> &#8211; The directory that you&#8217;ll use the most. Every user on your Linux machine, except the system administrator, has a folder here. This is where each user is meant to store all their documents. Think of it as the Linux &#8216;My Documents&#8217; folder.<br />
<br/><a href="http://www.davidcraddock.net/wp-content/uploads/2010/03/1348573631.png"><img src="http://www.davidcraddock.net/wp-content/uploads/2010/03/1348573631.png" alt="" title="Linux Filesystem" width="827" height="518" class="aligncenter size-full wp-image-584" /></a></br></p>
<pre>var/</pre>
<p> &#8211; This is a catch-all directory for &#8216;variables&#8217;, ie things that the OS has to write to, and vary, as part of its operation. Examples include: email inboxes for all users, cache files, the lock files that are generated and removed as part of normal program execution, and also the /var/www directory. /var/www is a directory you will probably see and use a lot, as it is where all the websites are stored that your linux machine serves when operating as a web server. /var/log is also a very important directory, and contains &#8216;log&#8217; files which is a kind of &#8220;diary&#8221; that the linux OS uses to explain exactly what it&#8217;s done, as it happens, so you can easily find out what&#8217;s been going on by viewing the right log file. </p>
<pre>tmp/</pre>
<p> &#8211; The space for any and all temporary files. Store files here that you want to throw away quite quickly. Depending on your configuration, all files and folders in the /tmp directory may be deleted on system reboot, or more frequently, perhaps every day.</p>
<pre>root/</pre>
<p> &#8211; This is the system administrators &#8216;my documents&#8217; folder. Anything that the sysadmin stores, for example: programs that he downloads, are put here. Not accessible to anyone else but the system administrator.</p>
<pre>etc/</pre>
<p> &#8211; Configuration files. Any and all program configuration files or information belong here. Think of it like the windows registry, except every registry entry is a text file that you can open up and edit, and also copy, move around, and save. You will typically have to create configuration files yourself sometimes, and put them in this directory. They are almost always simple text files.</p>
<p><a href="http://www.davidcraddock.net/wp-content/uploads/2010/03/1348573631.png"><img src="http://www.davidcraddock.net/wp-content/uploads/2010/03/1348573631.png" alt="" title="Linux Filesystem" width="827" height="518" class="aligncenter size-full wp-image-584" /></a></br></p>
<p>And that&#8217;s a basic overview of the files and folders in the root directory of your linux machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidcraddock.net/2010/03/20/the-linux-file-structure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
