<?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>Scott Mcintyre</title>
	<atom:link href="http://www.scottmcintyre.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scottmcintyre.net</link>
	<description>System Administrator</description>
	<lastBuildDate>Mon, 28 Nov 2011 15:57:05 +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>Mounting ext2/ext3 partitions on windows</title>
		<link>http://www.scottmcintyre.net/2011/11/28/mounting-ext2ext3-partitions-on-windows/</link>
		<comments>http://www.scottmcintyre.net/2011/11/28/mounting-ext2ext3-partitions-on-windows/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 15:57:05 +0000</pubDate>
		<dc:creator>Scott Mcintyre</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[ext2 windows]]></category>
		<category><![CDATA[ext2/3 partiton windows]]></category>
		<category><![CDATA[ext2/ext3 partition windows]]></category>
		<category><![CDATA[ext3 windows]]></category>
		<category><![CDATA[ext3 windows 7]]></category>
		<category><![CDATA[mount ext2 partition on windows]]></category>
		<category><![CDATA[mount ext2/3 partition on windows]]></category>
		<category><![CDATA[mount ext2/3 windows]]></category>
		<category><![CDATA[mount ext2/ext3 windows]]></category>
		<category><![CDATA[mount ext3 in windows]]></category>
		<category><![CDATA[mount ext3 on windows]]></category>
		<category><![CDATA[mount ext3 partition on windows]]></category>

		<guid isPermaLink="false">http://www.scottmcintyre.net/?p=84</guid>
		<description><![CDATA[Today I needed to mount one of my USB sticks on windows to copy some files over. To get windows to recognise it I altered/etc/mke2fs.conf and done the following. Removed ext_addr from &#8220;base_features&#8221; and commented out the inode_size line. Here is a diff from the default ubuntu e2fsprogs /etc/mke2fs.conf with the necessary changes, --- /etc/mke2fs.orig.conf [...]]]></description>
			<content:encoded><![CDATA[<p>Today I needed to mount one of my USB sticks on windows to copy some files over.   To get windows to recognise it I altered/etc/mke2fs.conf and done the following.</p>
<p>Removed <em>ext_addr</em> from &#8220;base_features&#8221; and commented out the <em>inode_size</em> line.  Here is a diff from the default ubuntu e2fsprogs /etc/mke2fs.conf with the necessary changes,</p>
<p><code></p>
<p>--- /etc/mke2fs.orig.conf	2011-11-28 15:20:07.365231775 +0000<br />
+++ /etc/mke2fs.conf	2011-11-28 15:20:48.165231803 +0000<br />
@@ -1,7 +1,7 @@<br />
 [defaults]<br />
-	base_features = sparse_super,filetype,resize_inode,dir_index,ext_attr<br />
+	base_features = sparse_super,filetype,resize_inode,dir_index<br />
 	blocksize = 4096<br />
-	inode_size = 256<br />
+	#inode_size = 256<br />
 	inode_ratio = 16384</p>
<p> [fs_types]<br />
</code></p>
<p>Then format the partition and this will allow it to be mounted on windows.   </p>
<p>I used DiskInternals Linux Reader on windows to mount the drive and copy the files which can be downloaded for free at <a href="http://www.diskinternals.com/linux-reader/" title="DiskInternals Linux Reader" target="_blank"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottmcintyre.net/2011/11/28/mounting-ext2ext3-partitions-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Auto Wrapping Code</title>
		<link>http://www.scottmcintyre.net/2011/11/24/wordpress-auto-wrapping-code/</link>
		<comments>http://www.scottmcintyre.net/2011/11/24/wordpress-auto-wrapping-code/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 12:35:51 +0000</pubDate>
		<dc:creator>Scott Mcintyre</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[auto wrap wordpress]]></category>
		<category><![CDATA[long code wordpress]]></category>
		<category><![CDATA[wrap text]]></category>
		<category><![CDATA[wrap text wordpress]]></category>

		<guid isPermaLink="false">http://www.scottmcintyre.net/?p=80</guid>
		<description><![CDATA[When posting code it wasn&#8217;t wrapping text properly on my blog due to how narrow it is. Luckily there&#8217;s some easy code that already exists to solve this so reposting it. I found it at height: 120px; overflow: auto; font-family: “Consolas”,monospace; font-size: 9pt; text-align:left; background-color: #FCF7EC; overflow-x: auto; /* Use horizontal scroller if needed; for [...]]]></description>
			<content:encoded><![CDATA[<p>When posting code it wasn&#8217;t wrapping text properly on my blog due to how narrow it is.    Luckily there&#8217;s some easy code that already exists to solve this so reposting it.</p>
<p>I found it at <a href="http://www.longren.org/wrapping-text-inside-pre-tags/" title="http://www.longren.org/wrapping-text-inside-pre-tags/" target="_blank"></a></p>
<p><code><br />
height: 120px;<br />
overflow: auto;<br />
font-family: “Consolas”,monospace;<br />
font-size: 9pt;<br />
text-align:left;<br />
background-color: #FCF7EC;<br />
overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not<br />
white-space: pre-wrap; /* css-3 */<br />
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */<br />
word-wrap: break-word; /* Internet Explorer 5.5+ */<br />
margin: 0px 0px 0px 0px;<br />
padding:5px 5px 3px 5px;<br />
white-space : normal; /* crucial for IE 6, maybe 7? */<br />
</code></p>
<p>Hopefully others find this useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottmcintyre.net/2011/11/24/wordpress-auto-wrapping-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning Python</title>
		<link>http://www.scottmcintyre.net/2011/11/24/learning_python/</link>
		<comments>http://www.scottmcintyre.net/2011/11/24/learning_python/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 12:24:02 +0000</pubDate>
		<dc:creator>Scott Mcintyre</dc:creator>
				<category><![CDATA[Me]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[football scores python]]></category>
		<category><![CDATA[learn python in 2 days]]></category>
		<category><![CDATA[learning python]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[python threading]]></category>
		<category><![CDATA[python youtube]]></category>
		<category><![CDATA[server version scraper]]></category>
		<category><![CDATA[top 100 charts]]></category>
		<category><![CDATA[youtube charts]]></category>

		<guid isPermaLink="false">http://www.scottmcintyre.net/?p=72</guid>
		<description><![CDATA[I had set myself a goal to make around 20 blog posts per year, it&#8217;s now almost December and I still have not bothered. It is safe to say I am not exactly prolific. I decided that I would learn python, surprisingly it&#8217;s been really easy to pick up and I thought I would share [...]]]></description>
			<content:encoded><![CDATA[<p>I had set myself a goal to make around 20 blog posts per year, it&#8217;s now almost December and I still have not bothered. It is safe to say I am not exactly prolific.</p>
<p>I decided that I would learn python, surprisingly it&#8217;s been really easy to pick up and I thought I would share some of the things I made in my first 2 days of python.</p>
<p>The first I written was to phrase the results from yahoo&#8217;s football score page(http://uk.eurosport.yahoo.com/football/premier-league/2011-2012/results/2011_08.html). I was on this page anyway and thought why not!</p>
<pre>#!/usr/bin/python</pre>
<pre>import urllib2
import re
response = urllib2.urlopen('http://uk.eurosport.yahoo.com/football/premier-league/2011-2012/results/2011_08.html')
html = response.read()
re_channel = re.compile("&lt;td class=\"ko\"&gt;&lt;abbr class=\"dtstart\" title=\"\"&gt;([0-9a-zA-z ,:]*)&lt;/abbr&gt;&lt;/td&gt;" +
 "\n &lt;td class=\"match.*?\n" +
 " &lt;a href=.*?\"&gt;" +
  "\n &lt;span class=\"home\"&gt;([a-zA-Z ]*)&lt;/span&gt;.*?" +
  "\n &lt;span class=\"score\"&gt;([0-9 :-]*)&lt;/span&gt;.*?" +
  "\n &lt;span class=\"away\"&gt;([a-zA-Z ]*)&lt;/span&gt;", re.I | re.S | re.M)
find_result = re_channel.findall(html)
print find_result</pre>
<pre></pre>
<p>Sample output</p>
<p>[('13 Aug, 15:00', 'Wigan Athletic', '1 - 1', 'Norwich City'), ('13 Aug, 15:00', 'Fulham', '0 - 0', 'Aston Villa'), ('13 Aug, 15:00', 'Blackburn Rovers', '1 - 2', 'Wolverhampton Wanderers'), ('13 Aug, 15:00', 'Liverpool', '1 - 1', 'Sunderland'), ('13 Aug, 15:00', 'Queens Park Rangers', '0 - 4', 'Bolton Wanderers'), ('13 Aug, 17:30', 'Newcastle United', '0 - 0', 'Arsenal'), ('14 Aug, 13:30', 'Stoke City', '0 - 0', 'Chelsea'), ('14 Aug, 16:00', 'West Bromwich Albion', '1 - 2', 'Manchester United'), ('15 Aug, 20:00', 'Manchester City', '4 - 0', 'Swansea City'), ('20 Aug, 12:00', 'Sunderland', '0 - 1', 'Newcastle United'), ('20 Aug, 12:45', 'Arsenal', '0 - 2', 'Liverpool'), ('20 Aug, 15:00', 'Swansea City', '0 - 0', 'Wigan Athletic'), ('20 Aug, 15:00', 'Aston Villa', '3 - 1', 'Blackburn Rovers'), ('20 Aug, 15:00', 'Everton', '0 - 1', 'Queens Park Rangers'), ('20 Aug, 17:30', 'Chelsea', '2 - 1', 'West Bromwich Albion'), ('21 Aug, 13:30', 'Norwich City', '1 - 1', 'Stoke City'), ('21 Aug, 14:05', 'Wolverhampton Wanderers', '2 - 0', 'Fulham'), ('21 Aug, 16:00', 'Bolton Wanderers', '2 - 3', 'Manchester City'), ('22 Aug, 20:00', 'Manchester United', '3 - 0', 'Tottenham Hotspur'), ('27 Aug, 12:05', 'Aston Villa', '0 - 0', 'Wolverhampton Wanderers'), ('27 Aug, 12:30', 'Wigan Athletic', '2 - 0', 'Queens Park Rangers'), ('27 Aug, 15:00', 'Swansea City', '0 - 0', 'Sunderland'), ('27 Aug, 15:00', 'Chelsea', '3 - 1', 'Norwich City'), ('27 Aug, 15:00', 'Blackburn Rovers', '0 - 1', 'Everton'), ('27 Aug, 17:30', 'Liverpool', '3 - 1', 'Bolton Wanderers'), ('28 Aug, 13:00', 'Newcastle United', '2 - 1', 'Fulham'), ('28 Aug, 13:30', 'Tottenham Hotspur', '1 - 5', 'Manchester City'), ('28 Aug, 15:00', 'West Bromwich Albion', '0 - 1', 'Stoke City'), ('28 Aug, 16:00', 'Manchester United', '8 - 2', 'Arsenal')]</p>
<p>The next was to obtain a list of the uk charts top 100 and find the youtube video for it.</p>
<pre>#!/usr/bin/python
import urllib
import urllib2
import re
import sys
from BeautifulSoup import BeautifulStoneSoup  

def getvideolink(link):
  request = urllib2.Request(link)
  request.add_header('User-Agent', "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Qt/4.7.0 Safari/533.3")
  response = urllib2.urlopen(request)
  text = response.read()
  videos = re.findall("&lt;a href=\"/watch\?v=([\w-]+)", text)
  return "http://www.youtube.com/watch?v=%s" % videos[0]

response = urllib2.urlopen('http://localhost/test')
html = response.read()
re_channel = re.compile("&lt;h3&gt;(.*?)&lt;/h3&gt;" +
 "\r\n.*?&lt;h4&gt;(.*?)&lt;/h4&gt;.*?&lt;h5", re.I | re.S | re.M)
find_result = re_channel.findall(html)
#remove first entry as it's a dup
del find_result[0]
for result in find_result:
 title=unicode(BeautifulStoneSoup(result[0],convertEntities=BeautifulStoneSoup.HTML_ENTITIES ))
 artist=unicode(BeautifulStoneSoup(result[1],convertEntities=BeautifulStoneSoup.HTML_ENTITIES ))
 link="http://www.youtube.com/results?search_query=" + urllib.quote_plus(title);
 print getvideolink(link)</pre>
<pre></pre>
<pre>Sample output</pre>
<pre>RIHANNA FT CALVIN HARRIS - WE FOUND LOVE // http://www.youtube.com/watch?v=tg00YEETFzg
FLO RIDA - GOOD FEELING // http://www.youtube.com/watch?v=3OnnDqH6Wj8
ONE DIRECTION - GOTTA BE YOU // http://www.youtube.com/watch?v=nvfejaHz-o0
LABRINTH FT TINIE TEMPAH - EARTHQUAKE // http://www.youtube.com/watch?v=u0fk6syQ7iY
ED SHEERAN - LEGO HOUSE // http://www.youtube.com/watch?v=c4BLVznuWnU
DAVID GUETTA FT USHER - WITHOUT YOU // http://www.youtube.com/watch?v=jUe8uoKdHao
MAROON 5 FT CHRISTINA AGUILERA - MOVES LIKE JAGGER // http://www.youtube.com/watch?v=iEPTlhBmwRg
JLS - TAKE A CHANCE ON ME // http://www.youtube.com/watch?v=djV11Xbc914
PROFESSOR GREEN FT EMELI SANDE - READ ALL ABOUT IT // http://www.youtube.com/watch?v=-_oLfC5Z_Ys
CHRISTINA PERRI - JAR OF HEARTS // http://www.youtube.com/watch?v=8v_4O44sfjM
LMFAO - SEXY AND I KNOW IT // http://www.youtube.com/watch?v=wyx6JDQCslE
DRAKE FT RIHANNA - TAKE CARE // http://www.youtube.com/watch?v=PaXslpx3MWY
COLDPLAY - PARADISE // http://www.youtube.com/watch?v=1G4isv_Fylg
CHARLENE SORAIA - WHEREVER YOU WILL GO // http://www.youtube.com/watch?v=iAP9AF6DCu4
SATURDAYS - MY HEART TAKES OVER // http://www.youtube.com/watch?v=DgmoYgpMNX8
CHER LLOYD FT MIKE POSNER - WITH UR LOVE // http://www.youtube.com/watch?v=axpO86pGHAM
BRUNO MARS - IT WILL RAIN // http://www.youtube.com/watch?v=W-w3WfgpcGg
LADY GAGA - MARRY THE NIGHT // http://www.youtube.com/watch?v=O4IgYxHEAuk
LANA DEL REY - VIDEO GAMES // http://www.youtube.com/watch?v=HO1OV5B_JDw
PIXIE LOTT FT PUSHA T - WHAT DO YOU TAKE ME FOR // http://www.youtube.com/watch?v=OQCcwNMp830
KELLY CLARKSON - MR KNOW IT ALL // http://www.youtube.com/watch?v=0C_oNMH0GTk
LOICK ESSIEN - ME WITHOUT YOU // http://www.youtube.com/watch?v=lKDmJwoZ4RA
FLORENCE &amp; THE MACHINE - SHAKE IT OUT // http://www.youtube.com/watch?v=WbN0nX61rIs
COLLECTIVE - TEARDROP // http://www.youtube.com/watch?v=u7K72X4eo_s
ONE DIRECTION - WHAT MAKES YOU BEAUTIFUL // http://www.youtube.com/watch?v=QJO3ROT-A4E
ED SHEERAN - THE A TEAM // http://www.youtube.com/watch?v=UAWcs5H-qgQ
WANTED - LIGHTNING // http://www.youtube.com/watch?v=MQyHyfLp5NI
JESSIE J - WHO YOU ARE // http://www.youtube.com/watch?v=j2WWrupMBAE
LUCENZO &amp; QWOTE - DANZA KUDURO // http://www.youtube.com/watch?v=rUFgacK8sZ0
GYM CLASS HEROES/ADAM LEVINE - STEREO HEARTS // http://www.youtube.com/watch?v=T3E9Wjbq44E
MAVERICK SABRE - I NEED // http://www.youtube.com/watch?v=VA770wpLX-Q
WESTLIFE - LIGHTHOUSE // http://www.youtube.com/watch?v=Tivph7mTku4
SEAN PAUL FT ALEXIS JORDAN - GOT 2 LUV U // http://www.youtube.com/watch?v=tDq3fNew1rU
LADY GAGA - THE EDGE OF GLORY // http://www.youtube.com/watch?v=QeWBS0JBNzQ
GLEE CAST - RUMOUR HAS IT/SOMEONE LIKE YOU // http://www.youtube.com/watch?v=qb7zjKkLCoQ
SLOW MOVING MILLIE - PLEASE PLEASE PLEASE LET ME GET WHAT I // http://www.youtube.com/watch?v=DMQbzLrvwlE
KATY PERRY - THE ONE THAT GOT AWAY // http://www.youtube.com/watch?v=Ahha3Cqe_fk
ELBOW - ONE DAY LIKE THIS // http://www.youtube.com/watch?v=0NFV8dHrZYM
CHRISTINA PERRI - A THOUSAND YEARS // http://www.youtube.com/watch?v=z5Q8x1wYN4w
SNOW PATROL - THIS ISN'T EVERYTHING YOU ARE // http://www.youtube.com/watch?v=Q-Gljs8Y3Q8
RIZZLE KICKS - WHEN I WAS A YOUNGSTER // http://www.youtube.com/watch?v=Rc2iUwMpb8Y
GOO GOO DOLLS - IRIS // http://www.youtube.com/watch?v=NdYWuo9OFAw
DAPPY - NO REGRETS // http://www.youtube.com/watch?v=WoImizvsj5w
BRUNO MARS - MARRY YOU // http://www.youtube.com/watch?v=xB40cQD677s
ADELE - SET FIRE TO THE RAIN // http://www.youtube.com/watch?v=ss0HAdW1DnY
NICKELBACK - WHEN WE STAND TOGETHER // http://www.youtube.com/watch?v=76RbWuFll0Y
AFROJACK &amp; STEVE AOKI - NO BEEF // http://www.youtube.com/watch?v=ksocjhxX_DQ
ADELE - SOMEONE LIKE YOU // http://www.youtube.com/watch?v=hLQl3WQQoQ0
PIXIE LOTT - ALL ABOUT TONIGHT // http://www.youtube.com/watch?v=swcULf1ATyU
NICKI MINAJ - SUPER BASS // http://www.youtube.com/watch?v=4JipHEz53sU
CALLING - WHEREVER YOU WILL GO // http://www.youtube.com/watch?v=iAP9AF6DCu4
JAMES MORRISON - I WON'T LET YOU GO // http://www.youtube.com/watch?v=sgRb_lfIZ6A
OLLY MURS FT RIZZLE KICKS - HEART SKIPS A BEAT // http://www.youtube.com/watch?v=j5dFe-WKuPs
EXAMPLE - MIDNIGHT RUN // http://www.youtube.com/watch?v=iwYGi7YG4Js
TINCHY STRYDER/CALVIN HARRIS - OFF THE RECORD // http://www.youtube.com/watch?v=UknZiaIC9y8
SAK NOEL - LOCA PEOPLE // http://www.youtube.com/watch?v=-d6b1yn-YhQ
BRUNO MARS - RUNAWAY BABY // http://www.youtube.com/watch?v=UDG_CrqJV-0
JASON DERULO - FIGHT FOR YOU // http://www.youtube.com/watch?v=2aSOQRih6WY
CHER LLOYD - SWAGGER JAGGER // http://www.youtube.com/watch?v=sdbyG2MrBHk
LADY GAGA - BORN THIS WAY // http://www.youtube.com/watch?v=wV1FrqwZyKw
SNOW PATROL - CALLED OUT IN THE DARK // http://www.youtube.com/watch?v=GwTXwJg6_VE
WANTED - WARZONE // http://www.youtube.com/watch?v=yMR382aefmQ
JLS FT DEV - SHE MAKES ME WANNA // http://www.youtube.com/watch?v=FuwTgZOKcf8
NICOLE SCHERZINGER - TRY WITH ME // http://www.youtube.com/watch?v=R7sYiTyBjTY
COBRA STARSHIP FT SABI - YOU MAKE ME FEEL // http://www.youtube.com/watch?v=HpyZEzrDf4c
JESSIE J - WHO'S LAUGHING NOW // http://www.youtube.com/watch?v=KsxSxF3JKeU
NOEL GALLAGHER'S HIGH FLYING - AKA WHAT A LIFE // http://www.youtube.com/watch?v=lwHpLDgWonM
FOSTER THE PEOPLE - PUMPED UP KICKS // http://www.youtube.com/watch?v=SDTZ7iX4vTQ
WRETCH 32 FT JOSH KUMRA - DON'T GO // http://www.youtube.com/watch?v=bj1BMpUnzT8
BIRDY - SKINNY LOVE // http://www.youtube.com/watch?v=aNzCDt2eidg
WANTED - GLAD YOU CAME // http://www.youtube.com/watch?v=2ggzxInyzVE
BIRDY - PEOPLE HELP THE PEOPLE // http://www.youtube.com/watch?v=OmLNs6zQIHo
NICKI MINAJ FT RIHANNA - FLY // http://www.youtube.com/watch?v=3n71KUiWn1I
SKREAM FT SAM FRANK - ANTICIPATE // http://www.youtube.com/watch?v=O3Z1X4MPsqk
WILL YOUNG - JEALOUSY // http://www.youtube.com/watch?v=9MHtrM-jf9o
ADELE - ROLLING IN THE DEEP // http://www.youtube.com/watch?v=rYEDA3JcQqw
JESSIE J FT BOB - PRICE TAG // http://www.youtube.com/watch?v=qMxX-QOV9tI
LMFAO/LAUREN BENNETT/GOONROCK - PARTY ROCK ANTHEM // http://www.youtube.com/watch?v=KQ6zr6kCPj8
JASON DERULO - IT GIRL // http://www.youtube.com/watch?v=4oGUHRXT-wA
BEYONCE - COUNTDOWN // http://www.youtube.com/watch?v=ACkBTqwxcUI
RIZZLE KICKS - DOWN WITH THE TRUMPETS // http://www.youtube.com/watch?v=-aY92XgykhU
COLDPLAY - EVERY TEARDROP IS A WATERFALL // http://www.youtube.com/watch?v=fyMhvkC3A84
CALVIN HARRIS - FEEL SO CLOSE // http://www.youtube.com/watch?v=dGghkjpNCQ8
ADELE - MAKE YOU FEEL MY LOVE // http://www.youtube.com/watch?v=LLoyNxjhTzc
ONE DIRECTION - ANOTHER WORLD // http://www.youtube.com/watch?v=RyZfNBVX1q0
COLDPLAY - VIVA LA VIDA // http://www.youtube.com/watch?v=dvgZkm1xWPE
BEYONCE - LOVE ON TOP // http://www.youtube.com/watch?v=Ob7vObnFUJc
EAGLE-EYE CHERRY - SAVE TONIGHT // http://www.youtube.com/watch?v=dTa2Bzlbjv0
EN VOGUE - DONT LET GO (LOVE) // http://www.youtube.com/watch?v=QUdAT5Fwnvk
KATY PERRY - FIREWORK // http://www.youtube.com/watch?v=QGJuMBdaqIw
MODESTEP - TO THE STARS // http://www.youtube.com/watch?v=UTKSUlMbp9A
DRAKE - HEADLINES // http://www.youtube.com/watch?v=cimoNqiulUE
ED SHEERAN - YOU NEED ME I DON'T NEED YOU // http://www.youtube.com/watch?v=temYymFGSEc
WOODKID - IRON // http://www.youtube.com/watch?v=vSkb0kDacjs
DELILAH - GO // http://www.youtube.com/watch?v=cxNe9jWNuEU
KATY PERRY FT KANYE WEST - ET // http://www.youtube.com/watch?v=t5Sd5c4o9UM
JAMES VINCENT MCMORROW - HIGHER LOVE // http://www.youtube.com/watch?v=9Z-fE1l9SZ4
BRUNO MARS - JUST THE WAY YOU ARE (AMAZING) // http://www.youtube.com/watch?v=LjhCEhWiKXk
PITBULL/NE-YO/AFROJACK/NAYER - GIVE ME EVERYTHING // http://www.youtube.com/watch?v=EPo5wWmKEaI</pre>
<pre></pre>
<pre>Then I wanted to test threading so I came up with something to check a list of links and obtain the "Server:" header</pre>
<pre>#!/usr/bin/env python
import urllib2
import re
import os
import sys
import time
from multiprocessing import Pool

#Accept file name as input or use default
try:
  filename = sys.argv[1]
except IndexError:
  filename = "links"

#Function to load urls from file
def loadurls(filename):
  try:
    inputdata = file(filename).readlines()
    if len(inputdata) &gt; 0:
      return inputdata
  except:
    print "ERROR - Unable to process url list"
    sys.exit()

#Function to get SERVER header
def getversion(url):
  try:
      request=urllib2.Request(url)
      response=urllib2.urlopen(request)
      version=response.info().getheader('Server')
  except:
      return "ERROR - Unable to fetch %s" % (url)

  if version: print "Url: %s Version: %s" % (url, version)

start = time.time()
urls=loadurls(filename)
p = Pool(15)
data = p.map(getversion,urls)

elapsed = (time.time() - start)
print "Processed %s urls in %0.2f seconds" % (len(urls), elapsed)</pre>
<pre>Sample output</pre>
<pre>scott@scott:~/python$ ./server-header.py list
Url: http://www.bbc.co.uk
 Version: Apache
Url: http://www.google.co.uk
 Version: gws
Url: http://www.scottmcintyre.net
 Version: Apache
Processed 4 urls in 1.07 seconds</pre>
<pre></pre>
<pre>None of these really serve any purpose and were merely tests I thought I would share.   Overall things have been quite easy and feel reasonably confident after just 2 days.</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.scottmcintyre.net/2011/11/24/learning_python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup mySQL replicated slave using r1soft</title>
		<link>http://www.scottmcintyre.net/2011/01/27/setup-mysql-replicated-slave-using-r1soft/</link>
		<comments>http://www.scottmcintyre.net/2011/01/27/setup-mysql-replicated-slave-using-r1soft/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 03:22:08 +0000</pubDate>
		<dc:creator>Scott Mcintyre</dc:creator>
				<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.scottmcintyre.net/?p=63</guid>
		<description><![CDATA[Using r1soft mySQL addon to setup mySQL replication slaves requiring read locks in seconds rather than hours for non transactional tables.]]></description>
			<content:encoded><![CDATA[<p>I have been using r1soft <a href="http://www.r1soft.com/linux-cdp/">Continuous Data Protection</a> for many years now with the <a href="http://www.r1soft.com/linux-cdp/cdp-30-enterprise-edition/mysql/">mySQL Addon</a> and wanted to share a trick I have used several times.</p>
<p>For those of us that don&#8217;t have the luxury of using all transactional based tables such as InnoDB and the the ability to use the likes of <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_single-transaction">&#8211;single-transaction</a> with <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_master-data">&#8211;master-data</a> we do have an option of using r1soft to avoid lengthy downtimes in the event we have to setup/resetup a slave.   You can turn a potential several hour outage in a 30-60 second <em>READ LOCK</em> and perform the rest in the background.   </p>
<p>Firstly a quick explanation of the r1soft mySQL addon,   the mySQL addon works by issuing a global lock and then flushes changes from memory to disk to ensure consistent snapshots.   As it works with the r1soft device driver the process usually takes less than a second making this the perfect method to take backups and have the master position at the time the backup was taken.  At the time of writing r1soft does not support the ability to store the master/slave status data although hopefully in the future it will store and display it to avoid having to use the following trick.</p>
<p>We can however work around this by monitoring the r1soft server-log.txt to determine when it has flushed and unlocked the mySQL instance.   As it happens very early on in the process we can manually issue a global read lock,  get the current position,  monitor the server-log.txt until r1soft has performed the snapshot of mySQL and then release the global lock manually.</p>
<p>I have performed an example of this for this article.   I started by logging into the CDP interface,  browsing to the system in question and getting to the start backup process,  having this all filled in and ready to submit speeds the process up.    Once this was ready I logged into the database system and issued a global read lock then obtained the current master position,</p>
<p><code>mysql> <strong>flush tables with read lock;</strong><br />
Query OK, 0 rows affected (0.10 sec)</p>
<p>mysql> <strong>show master status;</strong><br />
+-----------------+-----------+--------------+------------------+<br />
| File            | Position  | Binlog_Do_DB | Binlog_Ignore_DB |<br />
+-----------------+-----------+--------------+------------------+<br />
| mysql-bin.024272 | 120146094 |              |                  |<br />
+-----------------+-----------+--------------+------------------+<br />
1 row in set (0.00 sec)</code></p>
<p>I then clicked ok under the schedule backup window and started a tail on server-log.txt (usually found in /usr/r1soft/buserver/log) and waited until it reached the mySQL lock, flush and unlock.</p>
<p><code><br />
2011-01-27 02:44:27,743  INFO: (tid:976019) Starting task 'Backup' for host (xx.xx.xx.xx) with host id (xxxxxxxx)<br />
2011-01-27 02:44:27,771  INFO: (tid:976019) Starting Backup Task.<br />
2011-01-27 02:44:27,772  INFO: (tid:976019) Backing up partition tables.<br />
2011-01-27 02:44:27,773  INFO: (tid:976020) Starting task 'Partition Table Backup' for host (xx.xx.xx.xx) with host id (xxxxxxxx)<br />
2011-01-27 02:44:27,790  INFO: (tid:976020) Starting partition table backup for host (xx.xx.xx.xx) device (/dev/sda) Disk Safe (0) recovery point (6025).<br />
2011-01-27 02:44:27,892  INFO: (tid:976020) AGENT: (Righteous Backup Linux Agent) 1.62.0 build 6386<br />
2011-01-27 02:44:28,019  WARN: (tid:976020) AGENT: allowing control from backup server (xx.xx.xx.xx) with valid RSA key<br />
2011-01-27 02:44:28,059  WARN: (tid:976020) AGENT: sending auth challenge for allowed host at (xx.xx.xx.xx) port (41758)<br />
2011-01-27 02:44:28,108  INFO: (tid:976020) AGENT: host (xx.xx.xx.xx) port (41758) authentication successful<br />
2011-01-27 02:44:28,193  INFO: Agent (xx.xx.xx.xx) authenticated successfully<br />
2011-01-27 02:44:28,267  INFO: (tid:976020) AGENT: Partition Backup request accepted.  Starting backup.<br />
2011-01-27 02:44:28,269  INFO: (tid:976020) AGENT: Found 4 partition(s), 1 extended partition(s) and 124 extra sector(s)<br />
2011-01-27 02:44:28,270  INFO: (tid:976020) AGENT: Need to back up 126 sectors<br />
2011-01-27 02:44:28,270  INFO: (tid:976020) Sector size (512) bytes.<br />
2011-01-27 02:44:28,271  INFO: (tid:976020) Number of sectors (126).<br />
--SNIP--<br />
2011-01-27 02:44:32,083  INFO: Sending (1) MySQL instances to agent.<br />
2011-01-27 02:44:32,083  INFO: Sending next MySQL instance to agent.<br />
2011-01-27 02:44:32,117  INFO: (tid:976019) AGENT: Backup request accepted.  Starting backup.<br />
2011-01-27 02:44:39,340  INFO: (tid:976019) AGENT: Flushed 1 MySQL instances.<br />
2011-01-27 02:44:39,353  INFO: (tid:976019) AGENT: Flushed 1 MySQL instances.<br />
2011-01-27 02:44:39,354  INFO: (tid:976019) AGENT: Flushed 1 MySQL instances.<br />
2011-01-27 02:44:39,355  INFO: (tid:976019) AGENT: Locked 1 MySQL instances.<br />
2011-01-27 02:44:39,355  INFO: (tid:976019) AGENT: Unlocked 1 MySQL instances.<br />
2011-01-27 02:44:39,356  INFO: (tid:976019) AGENT: Snapshot completed in 0.059 seconds.<br />
<strong>2011-01-27 02:44:39,357  INFO: (tid:976019) AGENT: Acquired MySQL lock in 0.025 seconds and held lock for 0.085 seconds on 1 instance.</strong><br />
2011-01-27 02:44:39,357  INFO: (tid:976019) Backup pipeline size (256) blocks.<br />
2011-01-27 02:44:39,358  INFO: (tid:976019) Block size (4096).<br />
2011-01-27 02:44:39,358  INFO: (tid:976019) Partition size (34529701) blocks.<br />
2011-01-27 02:44:39,359  INFO: (tid:976019) Mount Point (/).<br />
2011-01-27 02:44:39,803  INFO: (tid:976019) Network Queue Size: 1280 blocks</code></p>
<p>Once it has completed the stage in bold I simply released the read lock,</p>
<p><code>mysql> <strong>unlock tables;</strong><br />
Query OK, 0 rows affected (0.00 sec)</code></p>
<p>I now had a backup in r1soft and had the master position of the time it was taken.  Once the backup completed I simply restored the tables I needed to the slave using the restore to an alternate host and started replication using this data.</p>
<p><code><br />
INFO 01/27/2011 <strong>02:44:27 GMT</strong> (tid:976019) Starting task 'Backup' for host (xx.xx.xx.xx) with host id (xxxxxxxx)<br />
INFO 01/27/2011<strong> 02:51:10 GMT</strong> (tid:976019) Backup Task finished.</code></p>
<p>I restored the backup to the mysql datadir,  as you are backing up the master you can skip all the binlogs.   After this was restored I started mySQL,  changed the master to the details we got from the master status earlier and started the slave.</p>
<p><code><br />
mysql> CHANGE MASTER to MASTER_HOST='192.168.1.3', MASTER_USER='slave', MASTER_PASSWORD='xxxxxx', MASTER_LOG_FILE='mysql-bin.024272', MASTER_LOG_POS=120146094;<br />
Query OK, 0 rows affected (0.01 sec)</p>
<p>mysql> start slave;<br />
Query OK, 0 rows affected (0.00 sec)</p>
<p>mysql> show slave status \G;<br />
<strong>Seconds_Behind_Master: 0</strong><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottmcintyre.net/2011/01/27/setup-mysql-replicated-slave-using-r1soft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2010 Recap</title>
		<link>http://www.scottmcintyre.net/2010/12/30/2010-recap/</link>
		<comments>http://www.scottmcintyre.net/2010/12/30/2010-recap/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 11:56:26 +0000</pubDate>
		<dc:creator>Scott Mcintyre</dc:creator>
				<category><![CDATA[Me]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.scottmcintyre.net/?p=59</guid>
		<description><![CDATA[So another year has passed and I have made 0 entries to the blog. This shall be the 8th post in 6 years. I thought it would be only fitting that I atleast end the year with a blog post and a commitment to blog more in 2011. This blog post will be about what [...]]]></description>
			<content:encoded><![CDATA[<p>So another year has passed and I have made 0 entries to the blog.   This shall be the 8th post in 6 years.  I thought it would be only fitting that I atleast end the year with a blog post and a commitment to blog more in 2011.</p>
<p>This blog post will be about what I have learned in 2010 and some plans for 2011.</p>
<p>So what have I learned,  enjoyed and hated in 2010?</p>
<p>- I love puppet</p>
<p>- Adobe flash is the bane of my life.  Flash on 64bit linux is nothing short of a pain,  it causes the most problems,  the most crashes and should rot in hell.</p>
<p>- I am starting to like chrome but have not made the full switch from firefox yet. </p>
<p>- I am quite a lazy programmer,  more worrying I actually don&#8217;t care.</p>
<p>- I love MongoDB and expect big things from it.</p>
<p>- I am unsure weather to love or hate r1soft.  On one hand I like what it brings on the other hand it&#8217;s very buggy and I don&#8217;t think the release of 3.0 is going to address many of these.   This should be an entire blog post in itself later.</p>
<p>- Started using ksplice uptrack,  already have this running on a few hundred systems and no problems to date.  Only time will tell.</p>
<p>I am looking forward to 2011,  I am hoping to continue on with getting large portions of the &#8220;todo list&#8221; completed.  Some of the ones off the top of my head are,</p>
<p>- Make the switch from cacti to collectd+MongoDB.  Been working on this on and off for awhile.  Primary goals is to make it more flexible,  more automated and easier to maintain.   Since we maintain so many different environments it has to fit some very specific needs.  Hoping to replace the primary cacti install and also some of the other secondary customer-specific ones (such as munin).</p>
<p>- Upgrade to nagios 3.x.  We still are running nagios 2.x so an upgrade is needed.  At the same time need to rebuild and rewrite the automation systems,  templates,  hosts and groups.    Especially to tie better into collectd,  the existing nagios+cacti setup is pretty &#8220;hacky&#8221;.</p>
<p>- Rebuild the client database,  notes and task list systems.    This work is already under-way so should be completed in Q1 2011.   Better encryption,  more functionality,  more flexibility,  easier to manage.</p>
<p>- Build a new ticket system and drop Kayako.   I don&#8217;t particularly like the direction Kayako has taken in their latest release so it&#8217;s time to stop using it (Very hacked up anyway).</p>
<p>- Better documentation.   I, along with many others, really fail in this area and I would love to improve on it.   Still toying with the idea of internal wiki&#8217;s combined with the existing notes systems and to make better use of them.</p>
<p>- Improve the existing yum repo,  make more use of mocks,  include some newer RPM&#8217;s and update all systems to use this.   Replace all custom builds to an RPM from the repo (nginx, memcached, etc).</p>
<p>- Make more use of the nessus systems and plugin feeds.   At the moment this is mostly semi-manual ,  need to work on making it fully automated and easy to maintain.</p>
<p>- Post more blog entries?   Goal of atleast 20 more blog posts (Less than 2 per month).  </p>
<p>- Rewrite the nagios r1soft/buagent check and release it.</p>
<p>- Make the vbulletin static cache into a plugin.   This is just a simple patch we provide to customers who don&#8217;t have enough capacity and are receiving a sudden burst of traffic (IE a thread slashdotted/etc). It simply stores the threads for guests in memory for 2 minutes and then displays the cache for guests (supports online counters, multiple themes,  browsers, mobile, etc).</p>
<p>That&#8217;s my list for the time being.   Lets hope I can stick to it.   Do you have your list ready?  Feel free to share.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottmcintyre.net/2010/12/30/2010-recap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bell&#8217;s palsy</title>
		<link>http://www.scottmcintyre.net/2009/11/01/bells-palsy/</link>
		<comments>http://www.scottmcintyre.net/2009/11/01/bells-palsy/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 04:25:03 +0000</pubDate>
		<dc:creator>Scott Mcintyre</dc:creator>
				<category><![CDATA[Me]]></category>
		<category><![CDATA[bells palsy]]></category>
		<category><![CDATA[facial nerves]]></category>
		<category><![CDATA[NHS]]></category>

		<guid isPermaLink="false">http://www.scottmcintyre.net/?p=37</guid>
		<description><![CDATA[Since this is my blog I may as well write something about me. On Friday the 23rd I found out I had Bell&#8217;s palsy. From about Monday night I had been having a very annoying headache for certain periods at a small spot at the back right side of my head (Just behind the ear) [...]]]></description>
			<content:encoded><![CDATA[<p>Since this is <em>my</em> blog I may as well write something about me.   On Friday the 23rd I found out I had <a href="http://en.wikipedia.org/wiki/Bell%27s_palsy">Bell&#8217;s palsy</a>.  From about Monday night I had been having a very annoying headache for certain periods at a small spot at the back right side of my head (Just behind the ear) which I thought I just banged my head but on Thursday night I noticed some strange reactions on my face but wasn&#8217;t sure what these were.    I continued on as normal assuming it would just go away in a few days and was just a headache,  it didn&#8217;t seem that important, neither was it painful &#8211; it was just annoying.</p>
<p>On Friday I definitely noticed something was not quite right but I was not sure,  as the day progressed I felt that the left side of my face was being odd and my eyes were hurting.   In a conference call I really noticed it as I started to speak and mentioned in IRC that I was having difficulty speaking clearly.</p>
<p>[17:25] &lt;Scott-Mc&gt; something is definitely wrong ,  even struggling to talk with the mic on the left side of my face:|<br />
&#8212;&#8211; then 10 minutes later &#8212;&#8211;<br />
[17:36] &lt;Scott-Mc&gt; god knows what is wrong with me, but I am even struggling to speak</p>
<p>After the conference was finished at about 6PM I started to think about all the things over the past few days and realized something wasn&#8217;t quite right and maybe it just wasn&#8217;t a bump to the head.  So I decided to call the NHS direct 24/7 helpline and after describing my symptoms and answering some questions I got put through to a nurse.   She started asking more specific questions because previously I had been unsure exactly what was wrong or how to describe it but within about 5 minutes she had determined what was wrong,  told me what it was and had arranged for me to visit the doctor at the A&amp;E.  </p>
<p>During the call she asked me to go stand in front of the mirror and smile,  it was then I realized that it wasn&#8217;t the left side of my face at all &#8211; this was perfectly normal,  it was the right side.  It was paralyzed and it was at this moment I freaked out,  especially because she said I should go to the A&#038;E just now. </p>
<p>It was very helpful just to speak to someone as otherwise I would have waited till Monday to go to the doctor if it had not cleared up but speaking to someone made me go immediately.  The symptoms did rapidly get worse between about 2PM-6PM as I never noticed it when I looked in the mirror earlier.</p>
<p>I arrived at the A&amp;E about 20 minutes later and waited 3-4 minutes to see a doctor.    Again I described my symptoms and he told me I had Bell&#8217;s Palsy and explained it alittle.   He prescribed me steroids for 1 week and some eye drops.  When I asked if he knew how long it would take he said and I quote,  &#8220;I wont lie, it can take awhile&#8221;.   I was unsure what to make of this but when I returned home it was straight onto google to read more on it.</p>
<p>As it turns out the vast majority recover from it (85%) and they don&#8217;t know what causes it.  So far it&#8217;s been 8-9 days and I would say that on the fourth day it showed signs of improvement that I definitely noticed (I could smile slightly more) but since then I don&#8217;t think it&#8217;s improved any which is alittle disappointing.  I would really like it to go away ASAP!</p>
<p>At this point I have another appointment with the Doctor on Monday to check the progress,  I am hoping it&#8217;s cleared up fully in about 2-3 weeks.  I hope this is realistic but to be honest it doesn&#8217;t really effect me all that much.  As I work from home I don&#8217;t notice it,  the only thing I notice is my right eye can be alittle painful as I have to manually blink it but this has been improving in the past few days also.  Overall I have a feeling I should treat this a serious thing but I have not been,  still can&#8217;t believe it&#8217;s been over a week with it already (I was going to blog about it the day after).</p>
<p>What is surprising is the number of number of friends and friends of friends have had this,  especially as I had never even heard of it before last week,  the good news is that all of them it cleared up just fine,  the bads news is that one of them took 6 months.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottmcintyre.net/2009/11/01/bells-palsy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Outbound DoS</title>
		<link>http://www.scottmcintyre.net/2009/10/19/outbound-dos/</link>
		<comments>http://www.scottmcintyre.net/2009/10/19/outbound-dos/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 23:14:50 +0000</pubDate>
		<dc:creator>Scott Mcintyre</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[apache status]]></category>
		<category><![CDATA[bandwidth graph]]></category>
		<category><![CDATA[bandwidth network monitor]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[cacti graphs]]></category>
		<category><![CDATA[cacti monitoring]]></category>
		<category><![CDATA[mrtg graphs]]></category>
		<category><![CDATA[outbound dos]]></category>
		<category><![CDATA[outbound firewall]]></category>
		<category><![CDATA[php ddos]]></category>
		<category><![CDATA[php dos]]></category>
		<category><![CDATA[posix acl]]></category>
		<category><![CDATA[server management]]></category>
		<category><![CDATA[traffic graph]]></category>
		<category><![CDATA[udp.pl]]></category>

		<guid isPermaLink="false">http://www.scottmcintyre.net/?p=33</guid>
		<description><![CDATA[Last Sunday I had a new customer sign up to our Linux Server Management company and one of the issues they were receiving was bandwidth overages for continual outbound DoS attacks their system was performing but they were unable to track. So in effort to find the initial cause of this with no real data [...]]]></description>
			<content:encoded><![CDATA[<p>Last Sunday I had a new customer sign up to our <a href="http://www.admingeekz.com">Linux Server Management</a> company and one of the issues they were receiving was bandwidth overages for continual outbound DoS attacks their system was performing but they were unable to track.</p>
<p>So in effort to find the initial cause of this with no real data to work from I had a search around the system for the usual suspects but couldn&#8217;t find any particular culprit.  Manually inspecting nearly 2 million files was not an option so opted to carry on with the usual setup and enforced posix ACL&#8217;s against the apache user and setup some more explicit bandwidth monitoring to obtain data when an attack was occurring.</p>
<p>A few hours later an alert came in that the outbound bandwidth exceeded the threshold so I promptly begin investigating,  The process list doesn&#8217;t seem to show any obvious usual culprits.  After spending a few minutes with iftop and tcpdump I identified the targeted IP and that the traffic was being directed to a DNS server (port 53).   I filtered traffic to this IP while investigating the source, as there was no unusual processes I decided to have alook at the apache status and found the GET request containing the destination IP and port (xxx.php?target=xx.xx.xx.xx&#038;port=53).  </p>
<p>I got the vhosts path from the httpd.conf and reviewed the file and it looks like a simple php script to perform a UDP flood to the target, </p>
<p><code>$sock=socket_create(AF_INET,SOCK_DGRAM,SOL_UDP);</p>
<p>if(!$sock) die("Cant Create Socket!!!");</p>
<p>$data='';<br />
for($i=0;$i&lt;1400;$i++)<br />
{<br />
$data.=chr(rand(0,255));<br />
}</p>
<p>while(true)<br />
{<br />
if(!socket_sendto($sock,$data,strlen($data),0,$target,$port)) die("Error SendTo!!!");<br />
}<br />
</code></p>
<p>That is a snippet of it.  It is very unusual to see these PHP based which is the reason for this blog entry and a definite new addition to the <em>search list</em>.  </p>
<p>For those of you interested the customer already had MRTG installed and below is the last week which shows the attack saturating the uplink (100Mbit) when it was occurring but has since been stopped.</p>
<p><img src="http://www.scottmcintyre.net/wp-content/uploads/2009/10/index-week.png" alt="Outbound DoS Attack" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottmcintyre.net/2009/10/19/outbound-dos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rooting T-Mobile G1</title>
		<link>http://www.scottmcintyre.net/2009/10/11/rooting-t-mobile-g1/</link>
		<comments>http://www.scottmcintyre.net/2009/10/11/rooting-t-mobile-g1/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 18:01:50 +0000</pubDate>
		<dc:creator>Scott Mcintyre</dc:creator>
				<category><![CDATA[Mobiles]]></category>
		<category><![CDATA[g1 root]]></category>
		<category><![CDATA[google g1]]></category>
		<category><![CDATA[how to root g1]]></category>
		<category><![CDATA[jail break android]]></category>
		<category><![CDATA[jail break g1]]></category>
		<category><![CDATA[root google android]]></category>
		<category><![CDATA[root google g1]]></category>
		<category><![CDATA[root my g1]]></category>
		<category><![CDATA[t-mobile g1]]></category>

		<guid isPermaLink="false">http://www.scottmcintyre.net/?p=17</guid>
		<description><![CDATA[Today I finally got around to rooting my UK T-mobile G1,

<a href="http://www.scottmcintyre.net/wp-content/uploads/2009/10/t-mobile-g1-2.jpg"><img src="http://www.scottmcintyre.net/wp-content/uploads/2009/10/t-mobile-g1-2-150x150.jpg" alt="Rooting T-Mobile G1" /></a>

While I work with and "hack" linux all day long modifying my phone was something I have never had the real urge to do.  I very rarely use my phone as I always either have or am close to a computer/laptop and the t-mobile 3g signal is useless.  I decided as I have some free time today that I will give it a go anyway - to my surprise it is actually surprisingly easy,  all of the work is already done for you amongst the very large community of users.

I initially looked at these 2 forums,

<a href="http://forum.xda-developers.com" target="_blank">forum.xda-developers.com</a>
<a href="http://modmygphone.com" target="_blank">modmygphone.com</a>

Which then I simply ended up using

<a href="http://www.ryebrye.com/blog/2009/08/16/android-rooting-in-1-click-in-progress/" target="_blank">http://www.ryebrye.com/blog/2009/08/16/android-rooting-in-1-click-in-progress/</a> but did also read <a href="http://androidandme.com/2009/08/news/how-to-root-a-t-mobile-g1-and-mytouch-3g-android-phone/" target="_blank">http://androidandme.com/2009/08/news/how-to-root-a-t-mobile-g1-and-mytouch-3g-android-phone/</a>]]></description>
			<content:encoded><![CDATA[<p>Today I finally got around to rooting my UK T-mobile G1,</p>
<p><a href="http://www.scottmcintyre.net/wp-content/uploads/2009/10/t-mobile-g1-2.jpg"><img src="http://www.scottmcintyre.net/wp-content/uploads/2009/10/t-mobile-g1-2-150x150.jpg" alt="Rooting T-Mobile G1" /></a></p>
<p>While I work with and &#8220;hack&#8221; linux all day long modifying my phone was something I have never had the real urge to do.  I very rarely use my phone as I always either have or am close to a computer/laptop and the t-mobile 3g signal is useless.  I decided as I have some free time today that I will give it a go anyway &#8211; to my surprise it is actually surprisingly easy,  all of the work is already done for you amongst the very large community of users.</p>
<p>I initially looked at these 2 forums,</p>
<p><a href="http://forum.xda-developers.com" target="_blank">forum.xda-developers.com</a><br />
<a href="http://modmygphone.com" target="_blank">modmygphone.com</a></p>
<p>Which then I simply ended up using</p>
<p><a href="http://www.ryebrye.com/blog/2009/08/16/android-rooting-in-1-click-in-progress/" target="_blank">http://www.ryebrye.com/blog/2009/08/16/android-rooting-in-1-click-in-progress/</a> but did also read <a href="http://androidandme.com/2009/08/news/how-to-root-a-t-mobile-g1-and-mytouch-3g-android-phone/" target="_blank">http://androidandme.com/2009/08/news/how-to-root-a-t-mobile-g1-and-mytouch-3g-android-phone/</a></p>
<p>Overall I am still surprised how much of the work is actually done already.   One thing that worried me was the differences between the US and UK in the phones themselves as I do not pay much attention to phone modding this is something that could potentially be a problem,  I wasn&#8217;t sure if I should be worried about it (Especially with all the disclaimers about being targeted for the US version only) but it seems to have worked fine.  I only ran into 1 issue which had nothing to do with that and I will describe the details below below.</p>
<p>I mostly followed the ryebrye instructions and this is what I did.</p>
<p>-  On my laptop I downloaded <a href="http://g1files.webs.com/Zinx/flashrec-20090815.apk" target="_blank">http://g1files.webs.com/Zinx/flashrec-20090815.apk</a> ,  copied this over to the SD card.<br />
-  Used the market to find a file browser as I couldn&#8217;t see one by default.  The one I downloaded was FileDroid Lite.<br />
-  Installed flashrec,  opened it,  clicked &#8220;Restore Backup Recovery Image&#8221; then  &#8220;Flash Cyanogen Recovery 1.4&#8243;</p>
<p><a href="http://www.scottmcintyre.net/wp-content/uploads/2009/10/recfasher.png"><img src="http://www.scottmcintyre.net/wp-content/uploads/2009/10/recfasher-150x150.png" alt="Rooting G1 Flashrec" /></a></p>
<p>I then rebooted the phone into recovery mode by turning the phone off,  then holding the home button and the power button at the same time.   The recovery system did appear as described,</p>
<p><a href="http://www.scottmcintyre.net/wp-content/uploads/2009/10/recovery.png"><img src="http://www.scottmcintyre.net/wp-content/uploads/2009/10/recovery-150x150.png" alt="" /></a></p>
<p>I selected the &#8220;nandroid backup&#8221; at this stage to backup the phone settings.  At this point I had thought that was it completed but this is actually only to be able to load the images.  So I booted the phone again.    Then on my laptop I downloaded, update-cm-4.1.99-signed.zip from <a href="http://n0rp.chemlab.org/android/experimental/" target="_blank">http://n0rp.chemlab.org/android/experimental/</a> and copied this to the sd card.  I rebooted the phone again back into recovery mode and selected &#8220;wipe data/factory reset&#8221; and then &#8220;apply any zip from sd&#8221; and selected update-cm-4.1.99-signed.zip.   After hitting home and waiting for it to install I rebooted the phone.  It was said to be patient as it takes longer to boot but after 20 minutes I realized something was up as it was still stuck at the t-mobile logo.   I powered it back into recovery mode and instead of selecting &#8220;restore latest backup&#8221; I accidentally selected nandroid backup again which I paniced, aborted (pulled the battery out) but after turning back into recovery mode it was unable to restore the good image as it had already been overwritten.   At this point I had thought that I have bricked my phone as without a card reader I have no way to put an image to the SD card but as it turns out you can mount the SD card from the recovery console.</p>
<p>So I selected &#8220;go to console&#8221; from the menu and plugged the data cable back in to my laptop then executed,</p>
<p><code>echo /dev/block/mmcblk0 &gt; /sys/devices/platform/usb_mass_storage/lun0/file</code></p>
<p>Which done the trick,  I was able to copy new roms to the sdcard and get my phone back and working.  From reading the forums (<a href="http://forum.xda-developers.com/showthread.php?t=567610">This thread</a>) I read the instructions again and noticed signed-dream_devphone_userdebug-ota-14721.zip was required from <a href="http://developer.htc.com/adp.html#s3">http://developer.htc.com/adp.html#s3</a> so I copied this to the SDcard and booted back into recovery mode.</p>
<p>I selected &#8220;apply any zip from sd&#8221; and then signed-dream_devphone_userdebug-ota-14721.zip ,  once this was installed and the phone rebooted (I held home again) I selected &#8220;apply any zip from sd&#8221; again then selected the previous image (update-cm-4.1.99-signed.zip).  Once this finished installing I rebooted the phone and success! it actually booted this time.  After filling in the gmail info everything seems to work fine and all my contacts are there.</p>
<p>The first thing I done was check the console which this rom comes with a nice app &#8220;Terminal Emulator&#8221;,  I executed &#8220;su&#8221; and was prompted to allow the superuser permissions (I assume this is from the &#8220;superuser permissions&#8221; app which seems to be installed and low and behold I was root.</p>
<p>Overall very easy process so a huge thanks to all the people that I linked to during the course of writing this.   Hopefully I will get some time to play around more and write some scripts/apps that will benefit me and others.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottmcintyre.net/2009/10/11/rooting-t-mobile-g1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blogging</title>
		<link>http://www.scottmcintyre.net/2009/10/11/blogging/</link>
		<comments>http://www.scottmcintyre.net/2009/10/11/blogging/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 17:13:30 +0000</pubDate>
		<dc:creator>Scott Mcintyre</dc:creator>
				<category><![CDATA[Me]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[scott mcintyre]]></category>
		<category><![CDATA[scottmcintyre]]></category>
		<category><![CDATA[server management]]></category>
		<category><![CDATA[sysadmin blog]]></category>
		<category><![CDATA[system administrator]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.scottmcintyre.net/?p=13</guid>
		<description><![CDATA[So it has been over 3 years since I created this blog and I have exactly 3 entries to date.   Blogging is something I have always been meaning to do but never actually got round to it.   I wouldn't consider myself a true blogger but I am devoted to giving it a go anyway.

Not knowing what to write about is generally what made me always not bother and then when there is a subject I am actually not that good at being creative.  The truth is though it is actually just lazyness that has stopped be.

So from today onwards I have decided to have an average of 2 blog posts per month and these can be about anything be it useful information,  a rant about a product/service or just a general meaningless post.]]></description>
			<content:encoded><![CDATA[<p>So it has been over 3 years since I created this blog and I have exactly 3 entries to date.   Blogging is something I have always been meaning to do but never actually got round to it.   I wouldn&#8217;t consider myself a true blogger but I am devoted to giving it a go anyway.</p>
<p>Not knowing what to write about is generally what made me always not bother and then when there is a subject I am actually not that good at being creative.  The truth is though it is actually just lazyness that has stopped be.</p>
<p>So from today onwards I have decided to have an average of 2 blog posts per month and these can be about anything be it useful information,  a rant about a product/service or just a general meaningless post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottmcintyre.net/2009/10/11/blogging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up an MFA Server</title>
		<link>http://www.scottmcintyre.net/2007/08/30/setting-up-an-mfa-server/</link>
		<comments>http://www.scottmcintyre.net/2007/08/30/setting-up-an-mfa-server/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 08:20:10 +0000</pubDate>
		<dc:creator>Scott Mcintyre</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[apache automate]]></category>
		<category><![CDATA[auto add domains]]></category>
		<category><![CDATA[auto configure apache]]></category>
		<category><![CDATA[auto configure bind]]></category>
		<category><![CDATA[bind auto configure]]></category>
		<category><![CDATA[bind auto generate]]></category>
		<category><![CDATA[bind automate]]></category>
		<category><![CDATA[centos install apache]]></category>
		<category><![CDATA[centos install mySQL]]></category>
		<category><![CDATA[centos install php]]></category>
		<category><![CDATA[centos install vsftpd]]></category>
		<category><![CDATA[configure apache]]></category>
		<category><![CDATA[configure mysql]]></category>
		<category><![CDATA[configure php]]></category>
		<category><![CDATA[mfa server]]></category>

		<guid isPermaLink="false">http://www.scottmcintyre.net/2007/08/30/setting-up-an-mfa-server/</guid>
		<description><![CDATA[Tired of paying someone to setup your server? Want a quick way to setup thousands of domains? Read on&#8230; I have made a quick guide on how to setup a server specifically for MFA sites from start to finish. The server will consist of, Web server &#8211; Apache Database &#8211; mySQL Scripting Language &#8211; PHP [...]]]></description>
			<content:encoded><![CDATA[<p>Tired of paying someone to setup your server?  Want a quick way to setup thousands of domains?  Read on&#8230;</p>
<p>I have made a quick guide on how to setup a server specifically for MFA sites from start to finish. The server will consist of,</p>
<ul>
<li>Web server &#8211; Apache</li>
<li>Database &#8211; mySQL</li>
<li>Scripting Language &#8211; PHP</li>
<li>FTP Daemon &#8211; vsFTPD</li>
<li>DNS Server &#8211; Bind</li>
</ul>
<p>We are going to assume you are using centOS and have yum available.  This should only be used on a fresh install.  So lets begin,</p>
<p><strong>Installing Services</strong></p>
<p>To make this quick we are just going to use the RPM&#8217;s available from the depositories.  At the shell prompt execute,</p>
<p><code><br />
yum -y install httpd httpd-devel mysql mysql-server mysql-devel vsftpd bind bind-libs bind-utils php php-cli<br />
</code></p>
<p>Once this completes you should see something like this,</p>
<p><a href='http://www.scottmcintyre.net/wp-content/uploads/2007/08/1.png' title='Service Installation via YUM'><img src='http://www.scottmcintyre.net/wp-content/uploads/2007/08/1.thumbnail.png' alt='Service Installation via YUM' /></a></p>
<p>Now that the services are installed it&#8217;s time to configure them.</p>
<p><span id="more-6"></span></p>
<p><strong>Configure Apache</strong></p>
<p>Depending on which centOS version you are using you will either have apache 1.x (centos4) or apache 2.x (centos5) we are going to assume apache 2.x however as the change are only minor config changes they are the same anyway. </p>
<p>Rather than opening and configuring we will just do a quick replacement on the file for the NameVirtualHost and to include a single file in which we will keep all the vhosts.</p>
<p><code><br />
perl -pi -e 's/#NameVirtualHost \*:80/NameVirtualHost \*:80\ninclude conf\/domains.conf/g' /etc/httpd/conf/httpd.conf<br />
</code></p>
<p>This will edit the config for you and if you view the config you should see something like this</p>
<p><a href='http://www.scottmcintyre.net/wp-content/uploads/2007/08/2.png' title='Apache Configuration'><img src='http://www.scottmcintyre.net/wp-content/uploads/2007/08/2.thumbnail.png' alt='Apache Configuration' /></a></p>
<p><strong>Configure DNS</strong></p>
<p>When configuring the DNS we are only going to setup 1 domain which will be the primary nameservers,  we will use masterdomain.com as an example throughout.  There will not be any domains actually setup other than the primary nameserver domain as these will be setup later with the script we build.</p>
<p><i>Setup the standard configuration (recreating as centOS 5 does not provide /etc/named.conf)</i><br />
<code><br />
cat &gt;/etc/named.conf &lt;&lt;EOM<br />
// Default named.conf generated by AdminGeekZ</p>
<p>//Add your machines IP if you wish to use this server as the resolvers<br />
acl &quot;trusted&quot; {127.0.0.1;};<br />
options {<br />
version &quot;Bind&quot;;<br />
allow-recursion { trusted; };<br />
allow-notify { trusted; };<br />
allow-transfer { trusted; };</p>
<p>        directory &quot;/var/named&quot;;<br />
        dump-file &quot;/var/named/data/cache_dump.db&quot;;<br />
        statistics-file &quot;/var/named/data/named_stats.txt&quot;;<br />
};<br />
include &quot;/etc/rndc.key&quot;;</p>
<p>EOM<br />
</code></p>
<p>Now setup the nameservers we will be using the following for our example,</p>
<p>- ns1.masterdomain.com -> 10.1.1.1<br />
- ns2.masterdomain.com -> 10.2.2.2</p>
<p><code><br />
cat &gt;/var/named/masterdomain.com.db &lt;&lt;EOM<br />
$TTL 6200<br />
@       6200   IN      SOA     ns1.masterdomain.com.      server.masterdomain.com.    (<br />
                                        2006070312<br />
                                        6200<br />
                                        7200<br />
                                        1419200<br />
                                        6200<br />
                                        )</p>
<p>masterdomain.com.  6200   IN      NS      ns1.masterdomain.com.<br />
masterdomain.com.  6200   IN      NS      ns2.masterdomain.com.</p>
<p>masterdomain.com.  6200   IN      MX      5       mail.masterdomain.com.</p>
<p>mail    6200   IN      CNAME   masterdomain.com.<br />
www     6200   IN      CNAME   masterdomain.com.</p>
<p>ns1     6200   IN      A       10.1.1.1<br />
ns2     6200   IN      A       10.2.2.2</p>
<p>masterdomain.com.  6200   IN      A       10.1.1.1<br />
EOM</p>
<p>#Now add the domain to the named configuration</p>
<p>cat &gt;&gt;/etc/named.conf &lt;&lt;EOM<br />
zone &quot;masterdomain.com&quot; {<br />
        type master;<br />
        file &quot;/var/named/masterdomain.com.db&quot;;<br />
};<br />
EOM<br />
#Now restart bind</p>
<p>/etc/init.d/named restart<br />
</code></p>
<p>Now we create a dns zone template, this is for our bulk setup script later.</p>
<p><code><br />
cat &gt;/etc/template.named &lt;&lt;EOM<br />
$TTL 6200<br />
@       6200   IN      SOA     ns1.cdomain.com.      server.cdomain.com.    (<br />
                                        2006070312<br />
                                        6200<br />
                                        7200<br />
                                        1419200<br />
                                        6200<br />
                                        )</p>
<p>cdomain.com.  6200   IN      NS      ns1.masterdomain.com.<br />
cdomain.com.  6200   IN      NS      ns2.masterdomain.com.</p>
<p>cdomain.com.  6200   IN      MX      5       mail.cdomain.com.<br />
mail    6200   IN      CNAME   cdomain.com.<br />
www     6200   IN      CNAME   cdomain.com.</p>
<p>cdomain.com.  6200   IN      A       10.1.1.1<br />
EOM<br />
</code></p>
<p>Your /etc/named.conf should look something like this now,</p>
<p><a href='http://www.scottmcintyre.net/wp-content/uploads/2007/08/3.png' title='Named Configuration'><img src='http://www.scottmcintyre.net/wp-content/uploads/2007/08/3.thumbnail.png' alt='Bind Configuration' /></a></p>
<p>That&#8217;s all that is required for this section of bind now.</p>
<p><strong>Setting up FTP/SSH Account</strong></p>
<p>For ease of use we will have all domains managed by one FTP account of the username node which accesses /home/httpd/domains</p>
<p><code><br />
mkdir -p /home/httpd/domains<br />
adduser -d /home/httpd/domains node<br />
echo "my??password12" | passwd node --stdin<br />
</code></p>
<p>You will have to chown and chmod this directory later for extra security.</p>
<p><strong>Creating Setup Script</strong></p>
<p>We will now use a script which can be used to add domains easily,  this will use the base we already setup earlier. </p>
<p><i>The Script</i><br />
<code><br />
cat &gt;/root/setup.sh &lt;&lt;EOF<br />
#!/bin/bash</p>
<p>if [ -z &quot;$1&quot; ]; then<br />
echo -n &quot;Syntax: setup.sh domain.com&quot;<br />
exit 0<br />
fi</p>
<p>if [ ! -d &quot;/home/httpd/domains/\$1&quot; ]<br />
then<br />
mkdir /home/httpd/domains/\$1</p>
<p>cat &gt;&gt;/etc/httpd/conf/domains.conf &lt;&lt;EOM<br />
&lt;VirtualHost *:80&gt;<br />
    ServerAdmin sysadmin@admingeekz.com<br />
    ServerName server.masterdomain.com<br />
    ServerName \$1<br />
    ServerAlias www.\$1<br />
    DocumentRoot /home/httpd/domains/\$1<br />
&lt;/VirtualHost&gt;</p>
<p>EOM</p>
<p>cat &gt;&gt;/etc/named.conf &lt;&lt;EOM<br />
zone &quot;\$1&quot; {<br />
        type master;<br />
        file &quot;/var/named/\$1.db&quot;;<br />
};</p>
<p>EOM</p>
<p>cp -f /etc/template.named /etc/buffernamed<br />
replace &quot;cdomain.com&quot; &quot;\$1&quot; -- /etc/buffernamed<br />
mv /etc/buffernamed /var/named/\$1.db<br />
chown named:named /var/named/\$1.db</p>
<p>chown -R node:node /home/httpd/domains/\$1<br />
/etc/init.d/named reload<br />
/etc/init.d/httpd reload</p>
<p>echo &quot;Added \$1 has been setup&quot;<br />
else<br />
        echo &quot;\$1 is already setup&quot;<br />
	exit 0<br />
fi</p>
<p>EOF<br />
chmod 700 /root/setup.sh<br />
</code></p>
<p>That&#8217;s the script created and to add a domain you simply run</p>
<p><i>/root/setup.sh domain.com</i></p>
<p><strong>Bulk Adding Domains</strong></p>
<p>Now that everything is setup and ready the last part is to bulk add all of your domains.  To do this we are going to have them in a list (without www.) so have a file called domains.txt which should look something like this,</p>
<blockquote><p>
google.com<br />
msn.com<br />
yahoo.com
</p></blockquote>
<p>When you have your list and want to setup the domains first comment out the apache and named reload lines from the /root/setup.sh script to make this go much faster (you can reload once completed) and then loop through the domains by using something like this,</p>
<p><code><br />
for i in `cat domains.txt`;do /root/setup.sh $i;done<br />
</code></p>
<p>Once completed reload named and apache</p>
<p><code><br />
/etc/init.d/named reload<br />
/etc/init.d/apache reload<br />
</code></p>
<p><strong>Final Touches</strong></p>
<p>Now that your server is setup and you can add domains easily the last thing to do is to start all the services and make sure they start on boot.  You may wish to optimize the server aswell as any other misc tweaks (Such as adding index.php to the DirectoryIndex).</p>
<p><code><br />
/etc/init.d/httpd restart<br />
/etc/init.d/mysqld restart<br />
/etc/init.d/vsftpd restart<br />
/etc/init.d/named restart<br />
chkconfig httpd on<br />
chkconfig mysqld on<br />
chkconfig vsftpd on<br />
chkconfig named on<br />
</code></p>
<p><strong>Summary</strong></p>
<p>We setup the following,</p>
<ul>
<li>3 Domains (google.com/msn.com/yahoo.com) for both dns and web</li>
<li>A master FTP account (username: node / password: my??password12)</li>
<li>1 master nameserver (masterdomain.com) which all domains use</li>
</ul>
<li>A domain setup script for adding new domains easily (/root/setup.sh)</li>
<p>If you followed this from start to finish you should now have a fully working server for your MFA sites where you can add new domains easily and manage all the domains from one account.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottmcintyre.net/2007/08/30/setting-up-an-mfa-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

