<?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 &#8211; Scott Mcintyre</title>
	<atom:link href="https://scott.cm/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>https://scott.cm</link>
	<description>Web Operations Engineer,  Linux Systems Administrator,  mySQL DBA,  MongoDB DBA,  Python+PHP Developer,  Performance Engineer</description>
	<lastBuildDate>Tue, 18 Jul 2017 08:57:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.4</generator>
	<item>
		<title>Install libmcrypt el6</title>
		<link>https://scott.cm/install-libmcrypt-el6/</link>
					<comments>https://scott.cm/install-libmcrypt-el6/#respond</comments>
		
		<dc:creator><![CDATA[Scott Mcintyre]]></dc:creator>
		<pubDate>Wed, 29 May 2013 23:35:27 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[epel libmcrypt]]></category>
		<category><![CDATA[install libmcrypt]]></category>
		<category><![CDATA[install libmcrypt centos]]></category>
		<category><![CDATA[install libmcrypt el6]]></category>
		<category><![CDATA[install php libmcrypt]]></category>
		<category><![CDATA[php mcrypt]]></category>
		<category><![CDATA[php mcrypt centos 6]]></category>
		<guid isPermaLink="false">https://scott.cm/?p=244</guid>

					<description><![CDATA[When trying to compile PHP I noticed the libmcrypt package is no longer provided with EL6 / CentOS 6, checking whether to enable multibyte string support&#8230; no checking whether to enable multibyte regex support&#8230; yes checking whether to check multibyte regex backtrack&#8230; yes checking for external libmbfl&#8230; no checking for]]></description>
										<content:encoded><![CDATA[<p>When trying to compile PHP I noticed the libmcrypt package is no longer provided with EL6 / CentOS 6,</p>
<blockquote><p>
checking whether to enable multibyte string support&#8230; no<br />
checking whether to enable multibyte regex support&#8230; yes<br />
checking whether to check multibyte regex backtrack&#8230; yes<br />
checking for external libmbfl&#8230; no<br />
checking for mcrypt support&#8230; yes<br />
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
</p></blockquote>
<p>Checking if the package exists in the default repos shows it doesn&#8217;t,</p>
<blockquote><p>
# <strong>yum search libmcrypt</strong><br />
Loaded plugins: fastestmirror, security<br />
Loading mirror speeds from cached hostfile<br />
 * base: mirrors.versaweb.com<br />
 * extras: mirrors.usc.edu<br />
 * updates: mirrors.easynews.com<br />
Warning: No matches found for: libmcrypt<br />
No Matches found
</p></blockquote>
<p>You need to obtain this from the epel repos now at http://dl.fedoraproject.org/pub/epel/6/x86_64/ ,  at the time of writing the version is 2.5.8-9 so you can install this with,</p>
<blockquote><p>
mcryptver=2.5.8-9<br />
arch=x86_64<br />
rpm -Uhv http://dl.fedoraproject.org/pub/epel/6/x86_64/libmcrypt-$mcryptver.el6.$arch.rpm<br />
rpm -Uhv http://dl.fedoraproject.org/pub/epel/6/x86_64/libmcrypt-devel-$mcryptver.el6.$arch.rpm
</p></blockquote>
<p>An example,</p>
<blockquote><p>
# <strong>mcryptver=2.5.8-9</strong><br />
# <strong>arch=x86_64</strong><br />
# <strong>rpm -Uhv http://dl.fedoraproject.org/pub/epel/6/x86_64/libmcrypt-$mcryptver.el6.$arch.rpm</strong><br />
Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/libmcrypt-2.5.8-9.el6.x86_64.rpm<br />
warning: /var/tmp/rpm-tmp.BoLykl: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY<br />
Preparing&#8230;                ########################################### [100%]<br />
   1:libmcrypt              ########################################### [100%]<br />
# <strong>rpm -Uhv http://dl.fedoraproject.org/pub/epel/6/x86_64/libmcrypt-devel-$mcryptver.el6.$arch.rpm</strong><br />
Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/libmcrypt-devel-2.5.8-9.el6.x86_64.rpm<br />
warning: /var/tmp/rpm-tmp.6SW2Vh: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY<br />
Preparing&#8230;                ########################################### [100%]<br />
   1:libmcrypt-devel        ########################################### [100%]
</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://scott.cm/install-libmcrypt-el6/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Create new panel on second monitor</title>
		<link>https://scott.cm/create-new-panel-on-second-monitor/</link>
					<comments>https://scott.cm/create-new-panel-on-second-monitor/#comments</comments>
		
		<dc:creator><![CDATA[Scott Mcintyre]]></dc:creator>
		<pubDate>Wed, 30 Jan 2013 16:06:06 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Mint]]></category>
		<category><![CDATA[add panel to second monitor]]></category>
		<category><![CDATA[mate task bar second monitor]]></category>
		<category><![CDATA[multiple monitors task list]]></category>
		<category><![CDATA[multiple monitors taskbar]]></category>
		<category><![CDATA[multiple monitors tasklist]]></category>
		<category><![CDATA[new panel multiple monitors]]></category>
		<category><![CDATA[task list second monitor]]></category>
		<category><![CDATA[ubuntu task list second monitor]]></category>
		<guid isPermaLink="false">https://scott.cm/?p=239</guid>

					<description><![CDATA[If you need to add a second panel/task window on your second (or more in my case) monitors using ubuntu/debian/mint linux here are two ways to achieve it. First you should right click on the current panel and click &#8220;New panel&#8221; then all you have to do is move the]]></description>
										<content:encoded><![CDATA[<p>If you need to add a second panel/task window on your second (or more in my case) monitors using ubuntu/debian/mint linux here are two ways to achieve it.</p>
<p>First you should right click on the current panel and click &#8220;New panel&#8221; then all you have to do is move the panel to the other monitor of which there are a few ways,  the easiest two are</p>
<p>&#8211; Hold <strong>ALT</strong> and drag the panel to the new window.<br />
or<br />
&#8211; Right click the panel and go to properties<br />
&#8211; Uncheck &#8220;Expand&#8221;<br />
&#8211; Now drag the smaller panel to the monitor you want it on<br />
&#8211; Right click and re-check expand and also select where you want it (top/bottom/left/right)</p>
<p>Then simply add what items you want on the panel.  In my case I added the Window List item.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://scott.cm/create-new-panel-on-second-monitor/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Resizing ext4 partition centos 5</title>
		<link>https://scott.cm/resizing-ext4-partition-centos-5/</link>
					<comments>https://scott.cm/resizing-ext4-partition-centos-5/#respond</comments>
		
		<dc:creator><![CDATA[Scott Mcintyre]]></dc:creator>
		<pubDate>Sat, 19 Jan 2013 07:58:09 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[/sbin/resize4fs]]></category>
		<category><![CDATA[centos resize ext4 partition]]></category>
		<category><![CDATA[e4fsprogs]]></category>
		<category><![CDATA[increase lvm partition]]></category>
		<category><![CDATA[increase lvm size]]></category>
		<category><![CDATA[increase lvm volume]]></category>
		<category><![CDATA[increase lvm volume size]]></category>
		<category><![CDATA[resize ext4 lvm partition]]></category>
		<category><![CDATA[resize ext4 partition]]></category>
		<category><![CDATA[resize ext4 partition centos]]></category>
		<category><![CDATA[resize lvm centos]]></category>
		<category><![CDATA[resize lvm partition]]></category>
		<category><![CDATA[resize lvm partition ext4]]></category>
		<guid isPermaLink="false">https://scott.cm/?p=233</guid>

					<description><![CDATA[On CentOS 5 the e4fsprogs RPM provides a separate binary (/sbin/resize4fs) for resizing ext4 partitions. # rpm -qf /sbin/resize2fs e2fsprogs-1.39-23.el5_5.1 # rpm -qf /sbin/resize4fs e4fsprogs-1.41.9-3.el5 As I found out today when resizing an LVM partition on one of our mongodb snapshot systems. # lvextend -L+50G /dev/mapper/mongo Extending logical volume mongo]]></description>
										<content:encoded><![CDATA[<p>On CentOS 5 the e4fsprogs RPM provides a separate binary (/sbin/resize4fs) for resizing ext4 partitions.</p>
<blockquote><p>
# <strong>rpm -qf /sbin/resize2fs</strong><br />
e2fsprogs-1.39-23.el5_5.1<br />
# <strong>rpm -qf /sbin/resize4fs</strong><br />
e4fsprogs-1.41.9-3.el5
</p></blockquote>
<p>As I found out today when resizing an LVM partition on one of our mongodb snapshot systems.</p>
<blockquote><p>
# <strong>lvextend -L+50G /dev/mapper/mongo</strong><br />
  Extending logical volume mongo to 150.00 GB<br />
  Logical volume mongo successfully resized<br />
# <strong>resize2fs /dev/mapper/mongo</strong><br />
resize2fs 1.39 (29-May-2006)<br />
resize2fs: Filesystem has unsupported feature(s) while trying to open /dev/mapper/mongo<br />
Couldn&#8217;t find valid filesystem superblock.
</p></blockquote>
<p>Having alook around I noticed the resize4fs binary which resized it successfully.</p>
<blockquote><p>
# <strong>resize4fs /dev/mapper/mongo</strong><br />
resize4fs 1.41.9 (22-Aug-2009)<br />
Filesystem at /dev/mapper/mongo is mounted on /var/lib/mongodb; on-line resizing required<br />
old desc_blocks = 7, new_desc_blocks = 10<br />
Performing an on-line resize of /dev/mapper/mongo to 39321600 (4k) blocks.
</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://scott.cm/resizing-ext4-partition-centos-5/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>nginx rewrite PHP with no extension</title>
		<link>https://scott.cm/nginx-rewrite-php-with-no-extension/</link>
					<comments>https://scott.cm/nginx-rewrite-php-with-no-extension/#respond</comments>
		
		<dc:creator><![CDATA[Scott Mcintyre]]></dc:creator>
		<pubDate>Thu, 17 Jan 2013 06:14:26 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[nginx access denied]]></category>
		<category><![CDATA[nginx rewrite no extension]]></category>
		<category><![CDATA[php no extension]]></category>
		<category><![CDATA[php-fpm limit_extensions]]></category>
		<category><![CDATA[php-fpm no extension]]></category>
		<category><![CDATA[security.limit_extensions]]></category>
		<category><![CDATA[security.limit_extensions = false]]></category>
		<guid isPermaLink="false">https://scott.cm/?p=214</guid>

					<description><![CDATA[I recently had to troubleshoot an issue while migrating from cherokee to nginx. This was a PHP application which had a shared set of common scripts , these where accessed by domain/common/file which in turn was translated into /vhosts/shared/common and this then included the necessary files. After doing the rewrite]]></description>
										<content:encoded><![CDATA[<p>I recently had to troubleshoot an issue while migrating from cherokee to nginx.    This was a PHP application which had a shared set of common scripts ,  these where accessed by domain/common/file which in turn was translated into /vhosts/shared/common and this then included the necessary files.</p>
<p>After doing the rewrite for nginx,</p>
<blockquote><p>
                location ^~ /common/ {<br />
                fastcgi_split_path_info ^(/common)(/?.+)$;<br />
                fastcgi_param SCRIPT_FILENAME /vhosts/shared/common$fastcgi_script_name;<br />
                fastcgi_param PATH_INFO $fastcgi_path_info;<br />
                fastcgi_pass   127.0.0.1:9000;<br />
                include        fastcgi_params;<br />
        }
</p></blockquote>
<p>nginx was simply returning access denied.</p>
<blockquote><p>
# curl http://localhost/common/file<br />
Access denied.
</p></blockquote>
<p>Which is because the new file has no extension and PHP-FPM now defaults to only allow .php.  This can be altered by editing security.limit_extensions in the php-fpm.conf (in this case /etc/php-fpm.d/daemon.conf) to allow the extensions you need.  In this case we needed it to support files without extensions so setting security.limit_extensions to FALSE done the job,</p>
<blockquote><p>
security.limit_extensions = FALSE
</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://scott.cm/nginx-rewrite-php-with-no-extension/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Error: unsupported locale setting</title>
		<link>https://scott.cm/error-unsupported-locale-setting/</link>
					<comments>https://scott.cm/error-unsupported-locale-setting/#respond</comments>
		
		<dc:creator><![CDATA[Scott Mcintyre]]></dc:creator>
		<pubDate>Wed, 16 Jan 2013 07:44:14 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[dpkg-reconfigure locales]]></category>
		<category><![CDATA[Error: unsupported locale setting]]></category>
		<category><![CDATA[locale en_gb.UTF8]]></category>
		<category><![CDATA[locale-gen]]></category>
		<category><![CDATA[python trac]]></category>
		<category><![CDATA[trac locale error]]></category>
		<category><![CDATA[trac wont start]]></category>
		<guid isPermaLink="false">https://scott.cm/?p=206</guid>

					<description><![CDATA[While installing and configuring trac on my development VM it wouldn&#8217;t load over HTTP (500 error). Stracing the process returned the issue, Error: unsupported locale setting So it looks like it doesn&#8217;t have the locale installed (In my case EN_GB) this is easily fixed by running, sudo dpkg-reconfigure locales Then]]></description>
										<content:encoded><![CDATA[<p>While installing and configuring trac on my development VM it wouldn&#8217;t load over HTTP (500 error).   Stracing the process returned the issue,</p>
<blockquote><p><strong>Error: unsupported locale setting</strong></p></blockquote>
<p>So it looks like it doesn&#8217;t have the locale installed (In my case EN_GB) this is easily fixed by running,</p>
<blockquote><p>sudo dpkg-reconfigure locales</p></blockquote>
<p>Then selecting the necessary locale,  you&#8217;ll most likely want to default to UTF8.</p>
<p><a href="https://scott.cm/wp-content/uploads/2013/01/locale.png" title="Screenshot reconfigure locales"><img decoding="async" src="https://scott.cm/wp-content/uploads/2013/01/locale-thumb.png" alt="reconfigure locale to en_gb.UTF8"/></a></p>
<p>You should then be able to run trac and have it accessible,  in my case</p>
<blockquote><p>
sudo -u trac tracd -s -p 8000 &#8211;pidfile ~trac/dev/tracd.pid -d &#8211;basic-auth=&#8221;*,/home/trac/dev/htpasswd,dev&#8221; ~trac/dev<br />
curl -I localhost:8000<br />
<em>HTTP/1.0 200 OK<br />
Server: tracd/0.11.7 Python/2.6.6<br />
Date: Wed, 16 Jan 2013 07:38:32 GMT<br />
Cache-Control: must-revalidate<br />
Content-Type: text/html;charset=utf-8<br />
Content-Length: 6184<br />
Set-Cookie: trac_form_token=a83b66948209b4197936bd1a; Path=/<br />
Set-Cookie: trac_session=d2dad341a8e80e6fd2f76551; expires=Tue, 16-Apr-2013 07:38:32 GMT; Path=/</em>
</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://scott.cm/error-unsupported-locale-setting/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>python load betfair data to mysql</title>
		<link>https://scott.cm/python-load-betfair-data-to-mysql/</link>
					<comments>https://scott.cm/python-load-betfair-data-to-mysql/#comments</comments>
		
		<dc:creator><![CDATA[Scott Mcintyre]]></dc:creator>
		<pubDate>Tue, 15 Jan 2013 03:32:27 +0000</pubDate>
				<category><![CDATA[betting]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://scott.cm/?p=200</guid>

					<description><![CDATA[The script below will import the betfair data from data.betfair.com into a mySQL table.  First create the table, CREATE TABLE history ( sports_id int(11) DEFAULT NULL, event_id int(11) DEFAULT NULL, country varchar(10) DEFAULT NULL, scheduled_off varchar(30) DEFAULT NULL, actual_off varchar(30) DEFAULT NULL, full_description varchar(150) DEFAULT NULL, odds double DEFAULT NULL,]]></description>
										<content:encoded><![CDATA[<p>The script below will import the betfair data from data.betfair.com into a mySQL table.  First create the table,</p>
<blockquote><p>CREATE TABLE <code>history</code> (<br />
<code>sports_id</code> int(11) DEFAULT NULL,<br />
<code>event_id</code> int(11) DEFAULT NULL,<br />
<code>country</code> varchar(10) DEFAULT NULL,<br />
<code>scheduled_off</code> varchar(30) DEFAULT NULL,<br />
<code>actual_off</code> varchar(30) DEFAULT NULL,<br />
<code>full_description</code> varchar(150) DEFAULT NULL,<br />
<code>odds</code> double DEFAULT NULL,<br />
<code>settled_date</code> varchar(30) DEFAULT NULL,<br />
<code>first_taken</code> varchar(30) DEFAULT NULL,<br />
<code>latest_taken</code> varchar(30) DEFAULT NULL,<br />
<code>course</code> varchar(150) DEFAULT NULL,<br />
<code>volume_matched</code> double DEFAULT NULL,<br />
<code>number_bets</code> double DEFAULT NULL,<br />
<code>event</code> varchar(50) DEFAULT NULL,<br />
<code>in_play</code> varchar(2) DEFAULT NULL,<br />
<code>selection</code> varchar(50) DEFAULT NULL,<br />
<code>selection_id</code> int(11) DEFAULT NULL,<br />
<code>win_flag</code> varchar(1) DEFAULT NULL,<br />
KEY <code>sports_id</code> (<code>sports_id</code>),<br />
KEY <code>event_id</code> (<code>event_id</code>),<br />
KEY <code>odds</code> (<code>odds</code>),<br />
KEY <code>win_flag</code> (<code>win_flag</code>),<br />
KEY <code>descr</code> (<code>full_description</code>)<br />
) ENGINE=InnoDB DEFAULT</p></blockquote>
<p>Then use the following script,</p>
<blockquote><p>#!/usr/bin/python<br />
import csv<br />
import MySQLdb<br />
import re<br />
import os</p>
<p>path=&#8221;/path/to/files&#8221;</p>
<p>db = MySQLdb.connect(host=&#8217;localhost&#8217;,<br />
    user=&#8217;user&#8217;,<br />
    passwd=&#8217;pass&#8217;,<br />
    db=&#8217;betfair&#8217;)</p>
<p>cursor = db.cursor()<br />
files = os.listdir(path)</p>
<p>for filename in files:<br />
 csv_data = csv.reader(file(path+&#8221;/&#8221;+filename))<br />
 for row in csv_data:<br />
  cursor.execute(&#8220;INSERT into history(sports_id, event_id, settled_date, country, full_description, course, scheduled_off, event, actual_off, selection_id, selection, odds, number_bets, volume_matched, latest_taken, first_taken, win_flag, in_play) values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)&#8221;, row)</p>
<p>db.commit()<br />
cursor.close()</p></blockquote>
<p>Adjust the path at the to to the location of the raw csv(uncompressed) files that you would like loaded into mySQL.<br />
Edit the database information<br />
Run the script</p>
<p>You can also add filters,  for example when processing horse racing data I wanted only the following,</p>
<p>&#8211; UK races<br />
&#8211; Bets placed before the event (IE not in running)<br />
&#8211; Exclude hurdles</p>
<p>This is what I used</p>
<blockquote><p> for row in csv_data:<br />
  if row[1] != &#8220;EVENT_ID&#8221; and row[3] == &#8220;GB&#8221; and row[17] == &#8220;PE&#8221; and &#8220;PLACED&#8221; not in row[7] and &#8220;Hrd&#8221; not in row[7]:<br />
   if re.search(&#8216;[0-9]f&#8217;, row[7]):<br />
    cursor.execute(&#8220;INSERT into history(sports_id, event_id, settled_date, country, full_description, course, scheduled_off, event, actual_off, selection_id, selection, odds, number_bets, volume_matched, latest_taken, first_taken, win_flag, in_play) values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)&#8221;, row)</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://scott.cm/python-load-betfair-data-to-mysql/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>python attheraces.com data scraping</title>
		<link>https://scott.cm/python-attheraces-com-data-scraping/</link>
					<comments>https://scott.cm/python-attheraces-com-data-scraping/#respond</comments>
		
		<dc:creator><![CDATA[Scott Mcintyre]]></dc:creator>
		<pubDate>Tue, 15 Jan 2013 03:24:51 +0000</pubDate>
				<category><![CDATA[betting]]></category>
		<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://scott.cm/?p=194</guid>

					<description><![CDATA[I have been working on scraping the data from attheraces.com for a project I am working on which combines this and betfair data for some statistical analysis. In case this is useful to anyone here is the regex I have written, meetings = re.findall(&#8220;&#60;h5 id=\&#8221;fastfixhead(\d+)\&#8221;.*\&#8221;&#62;(\w+)&#60;\/a&#62;&#60;\/h5&#62;&#8221;, info) for meeting in meetings:]]></description>
										<content:encoded><![CDATA[<p>I have been working on scraping the data from attheraces.com for a project I am working on which combines this and betfair data for some statistical analysis.</p>
<p>In case this is useful to anyone here is the regex I have written,</p>
<blockquote><p>
meetings = re.findall(&#8220;&lt;h5 id=\&#8221;fastfixhead(\d+)\&#8221;.*\&#8221;&gt;(\w+)&lt;\/a&gt;&lt;\/h5&gt;&#8221;, info)<br />
for meeting in meetings:<br />
times = re.findall(&#8220;&lt;li class=\&#8221; \&#8221;&gt;&lt;a href=\&#8221;/card.aspx\?raceid=(\d+)&amp;amp;meetingid=(&#8220;+meeting[0]+&#8221;)&amp;amp;date=([0-9]{4}-[0-9]{2}-[0-9]{2})&amp;amp.*&lt;strong&gt;([0-9]{2}:[0-9]{2})&lt;\/strong&gt; &#8211; ([0-9+][f|m].*)\((\d+) run&#8221;, info)
</p></blockquote>
<p>This gathers the course name, raceid, meetingid, date, race time, distance and number of runners. It only gathers UK data (by only matching alphanumeric and underscores it strips non UK codes) so replace &#8220;\w+&#8221; with &#8220;.*&#8221; for the meetings match to include other countries.</p>
<p>Sample output,</p>
<blockquote><p>
Wolverhampton</p>
<p>RaceID: 741858<br />
Date: 57674,<br />
Race Time: 2013-01-14<br />
Distance: 13:50,<br />
Number of runners: 7f 32y<br />
RaceID: 741859<br />
Date: 57674,<br />
Race Time: 2013-01-14<br />
Distance: 14:20,<br />
Number of runners: 5f 216y<br />
RaceID: 741860<br />
Date: 57674,<br />
Race Time: 2013-01-14<br />
Distance: 14:50,<br />
Number of runners: 1m 4f 50y<br />
RaceID: 741861<br />
Date: 57674,<br />
Race Time: 2013-01-14<br />
Distance: 15:20,<br />
Number of runners: 1m 141y<br />
RaceID: 741862<br />
Date: 57674,<br />
Race Time: 2013-01-14<br />
Distance: 15:50,<br />
Number of runners: 1m 141y<br />
RaceID: 741863<br />
Date: 57674,<br />
Race Time: 2013-01-14<br />
Distance: 16:20,<br />
Number of runners: 1m 1f 103y<br />
RaceID: 741864<br />
Date: 57674,<br />
Race Time: 2013-01-14<br />
Distance: 16:50,<br />
Number of runners: 1m 1f 103y
</p></blockquote>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://scott.cm/python-attheraces-com-data-scraping/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Dell Studio 15555 Windows Key</title>
		<link>https://scott.cm/dell-studio-15555-windows-key/</link>
					<comments>https://scott.cm/dell-studio-15555-windows-key/#comments</comments>
		
		<dc:creator><![CDATA[Scott Mcintyre]]></dc:creator>
		<pubDate>Fri, 11 Jan 2013 03:56:30 +0000</pubDate>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[dell laptop activation key]]></category>
		<category><![CDATA[dell laptop product key]]></category>
		<category><![CDATA[dell laptop windows license]]></category>
		<category><![CDATA[dell product key]]></category>
		<category><![CDATA[dell studio 1555 activation key]]></category>
		<category><![CDATA[dell studio 1555 windows key]]></category>
		<category><![CDATA[dell studio 1555 windows license]]></category>
		<category><![CDATA[dell studio activation key]]></category>
		<category><![CDATA[dell studio windows key]]></category>
		<category><![CDATA[dell studio windows product key]]></category>
		<category><![CDATA[dell windows 7 activation key]]></category>
		<category><![CDATA[dell windows 7 product key]]></category>
		<category><![CDATA[dell windows activation key]]></category>
		<category><![CDATA[under battery]]></category>
		<category><![CDATA[windows 7 key]]></category>
		<guid isPermaLink="false">https://scott.cm/?p=192</guid>

					<description><![CDATA[While trying to reinstall one of my windows laptops (A Dell 1555 Studio) to Windows 7 I had alittle trouble locating the windows activation/product key. After alittle fiddling I managed to locate this well hidden under the battery. So if you are looking for this on your dell laptop try]]></description>
										<content:encoded><![CDATA[<p>While trying to reinstall one of my windows laptops (A Dell 1555 Studio) to Windows 7 I had alittle trouble locating the windows activation/product key.  After alittle fiddling I managed to locate this well hidden under the battery.</p>
<p>So if you are looking for this on your dell laptop try taking the battery out and see if the sticker is under there.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://scott.cm/dell-studio-15555-windows-key/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Max processes 1024 limits.conf</title>
		<link>https://scott.cm/max-processes-1024-limits-conf/</link>
					<comments>https://scott.cm/max-processes-1024-limits-conf/#comments</comments>
		
		<dc:creator><![CDATA[Scott Mcintyre]]></dc:creator>
		<pubDate>Thu, 22 Nov 2012 06:44:24 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[centos ulimit]]></category>
		<category><![CDATA[linux max user processes]]></category>
		<category><![CDATA[mongodb replica sets]]></category>
		<category><![CDATA[mongodb soft limit]]></category>
		<category><![CDATA[mongodb ulimit]]></category>
		<category><![CDATA[red hat ulimit]]></category>
		<category><![CDATA[ulimit -u soft limit]]></category>
		<category><![CDATA[ulimit /etc/security/limits.d/90-nproc.conf]]></category>
		<category><![CDATA[ulimit 1024]]></category>
		<category><![CDATA[ulimit max processes]]></category>
		<category><![CDATA[ulimit max user processes]]></category>
		<category><![CDATA[ulimit pam]]></category>
		<category><![CDATA[ulimit soft limit]]></category>
		<guid isPermaLink="false">https://scott.cm/?p=186</guid>

					<description><![CDATA[We where having an issue with replica sets on our MongoDB databases changing primaries. The logs shows it was hitting resource limits creating new processes. [initandlisten] pthread_create failed: errno:11 Resource temporarily unavailable [initandlisten] can&#8217;t create new thread, closing connection There is a bug fix in the init.d available per https://jira.mongodb.org/browse/SERVER-6443]]></description>
										<content:encoded><![CDATA[<p>We where having an issue with replica sets on our MongoDB databases changing primaries.  The logs shows it was hitting resource limits creating new processes.</p>
<blockquote><p>
[initandlisten] pthread_create failed: errno:11 Resource temporarily unavailable<br />
[initandlisten] can&#8217;t create new thread, closing connection
</p></blockquote>
<p>There is a bug fix in the init.d available per https://jira.mongodb.org/browse/SERVER-6443 to increase the ulimit -u however while working through increasing the available max processes on RHEL I was noting the soft limit would not increase past 1024 when checking /proc/pid/limits even when being increased in the startup script.</p>
<blockquote><p>
Limit                     Soft Limit           Hard Limit           Units<br />
Max cpu time              unlimited            unlimited            seconds<br />
Max file size             unlimited            unlimited            bytes<br />
Max data size             unlimited            unlimited            bytes<br />
Max stack size            10485760             unlimited            bytes<br />
Max core file size        0                    unlimited            bytes<br />
Max resident set          unlimited            unlimited            bytes<br />
Max processes             <strong>1024</strong>                 256662               processes<br />
Max open files            8192                 8192                 files<br />
Max locked memory         65536                65536                bytes<br />
Max address space         unlimited            unlimited            bytes<br />
Max file locks            unlimited            unlimited            locks<br />
Max pending signals       256662               256662               signals<br />
Max msgqueue size         819200               819200               bytes<br />
Max nice priority         0                    0<br />
Max realtime priority     0                    0<br />
Max realtime timeout      unlimited            unlimited            us
</p></blockquote>
<p>It turns out the pam package provides a file /etc/security/limits.d/90-nproc.conf which explicitly overrides the settings in security.conf for the number of processes,</p>
<blockquote><p>
# Default limit for number of user&#8217;s processes to prevent<br />
# accidental fork bombs.<br />
# See rhbz #432903 for reasoning.</p>
<p>*          soft    nproc     1024
</p></blockquote>
<p>Changing this allowed the number of processes to be increased.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://scott.cm/max-processes-1024-limits-conf/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Linux convert AIFF to mp3</title>
		<link>https://scott.cm/linux-convert-aiff-to-mp3/</link>
					<comments>https://scott.cm/linux-convert-aiff-to-mp3/#respond</comments>
		
		<dc:creator><![CDATA[Scott Mcintyre]]></dc:creator>
		<pubDate>Sun, 10 Jun 2012 11:42:56 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Mint]]></category>
		<category><![CDATA[convert aif to mp3]]></category>
		<category><![CDATA[convert aif to mp3 linux]]></category>
		<category><![CDATA[convert aiff on linux]]></category>
		<category><![CDATA[convert aiff to mp3]]></category>
		<category><![CDATA[linux convert aif]]></category>
		<category><![CDATA[mint convert aif]]></category>
		<category><![CDATA[mint convert aiff]]></category>
		<category><![CDATA[ubuntu convert aif]]></category>
		<category><![CDATA[ubuntu convert aif to mp3]]></category>
		<category><![CDATA[ubuntu convert aiff to mp3]]></category>
		<guid isPermaLink="false">https://scott.cm/?p=182</guid>

					<description><![CDATA[You can convert AIFF files to MP3 using ffmpeg on linux. This works with many other inputs and not just AIFF but in the instance I was testing I needed to convert AIFF. First you need ffmpeg and libmp3lame which on Ubuntu and Linux Mint can be done with sudo]]></description>
										<content:encoded><![CDATA[<p>You can convert AIFF files to MP3 using ffmpeg on linux.   This works with many other inputs and not just AIFF but in the instance I was testing I needed to convert AIFF.</p>
<p>First you need ffmpeg and libmp3lame which on Ubuntu and Linux Mint can be done with</p>
<blockquote><p>
sudo apt-get install libavcodec-extra-53 ffmpeg
</p></blockquote>
<p>Then use ffmpeg to do the conversion replacing INPUT.aiff and OUTPUT.mp3</p>
<blockquote><p>
ffmpeg -i <strong>INPUT.aiff</strong> -f mp3 -acodec libmp3lame -ab 192000 -ar 44100 <strong>OUTPUT.mp3</strong>
</p></blockquote>
<p>Sample,</p>
<blockquote>
<p>scott@scott:~/Music$ ffmpeg -i INPUT.mp3 -f mp3 -acodec libmp3lame -ab 192000 -ar 44100 OUTPUT.mp3<br />
ffmpeg version 0.7.3-4:0.7.3-0ubuntu0.11.10.1, Copyright (c) 2000-2011 the Libav developers<br />
  built on Jan  4 2012 16:08:51 with gcc 4.6.1<br />
  configuration: &#8211;extra-version=&#8217;4:0.7.3-0ubuntu0.11.10.1&#8242; &#8211;arch=amd64 &#8211;prefix=/usr &#8211;enable-vdpau &#8211;enable-bzlib &#8211;enable-libgsm &#8211;enable-libschroedinger &#8211;enable-libspeex &#8211;enable-libtheora &#8211;enable-libvorbis &#8211;enable-pthreads &#8211;enable-zlib &#8211;enable-libvpx &#8211;enable-runtime-cpudetect &#8211;enable-vaapi &#8211;enable-gpl &#8211;enable-postproc &#8211;enable-swscale &#8211;enable-x11grab &#8211;enable-libdc1394 &#8211;enable-shared &#8211;disable-static<br />
  WARNING: library configuration mismatch<br />
  avutil      configuration: &#8211;extra-version=&#8217;4:0.7.3ubuntu0.11.10.1+medibuntu1&#8242; &#8211;arch=amd64 &#8211;prefix=/usr &#8211;enable-vdpau &#8211;enable-bzlib &#8211;enable-libgsm &#8211;enable-libschroedinger &#8211;enable-libspeex &#8211;enable-libtheora &#8211;enable-libvorbis &#8211;enable-pthreads &#8211;enable-zlib &#8211;enable-libvpx &#8211;enable-runtime-cpudetect &#8211;enable-libopencore-amrnb &#8211;enable-libopencore-amrwb &#8211;enable-version3 &#8211;enable-vaapi &#8211;enable-libopenjpeg &#8211;enable-libfaac &#8211;enable-nonfree &#8211;enable-gpl &#8211;enable-postproc &#8211;enable-swscale &#8211;enable-x11grab &#8211;enable-libdirac &#8211;enable-libmp3lame &#8211;enable-librtmp &#8211;enable-libx264 &#8211;enable-libxvid &#8211;enable-libopencore-amrnb &#8211;enable-version3 &#8211;enable-libopencore-amrwb &#8211;enable-version3 &#8211;enable-libvo-aacenc &#8211;enable-version3 &#8211;enable-libvo-amrwbenc &#8211;enable-version3 &#8211;enable-libdc1394 &#8211;enable-shared &#8211;disable-static<br />
  avcodec     configuration: &#8211;extra-version=&#8217;4:0.7.3ubuntu0.11.10.1+medibuntu1&#8242; &#8211;arch=amd64 &#8211;prefix=/usr &#8211;enable-vdpau &#8211;enable-bzlib &#8211;enable-libgsm &#8211;enable-libschroedinger &#8211;enable-libspeex &#8211;enable-libtheora &#8211;enable-libvorbis &#8211;enable-pthreads &#8211;enable-zlib &#8211;enable-libvpx &#8211;enable-runtime-cpudetect &#8211;enable-libopencore-amrnb &#8211;enable-libopencore-amrwb &#8211;enable-version3 &#8211;enable-vaapi &#8211;enable-libopenjpeg &#8211;enable-libfaac &#8211;enable-nonfree &#8211;enable-gpl &#8211;enable-postproc &#8211;enable-swscale &#8211;enable-x11grab &#8211;enable-libdirac &#8211;enable-libmp3lame &#8211;enable-librtmp &#8211;enable-libx264 &#8211;enable-libxvid &#8211;enable-libopencore-amrnb &#8211;enable-version3 &#8211;enable-libopencore-amrwb &#8211;enable-version3 &#8211;enable-libvo-aacenc &#8211;enable-version3 &#8211;enable-libvo-amrwbenc &#8211;enable-version3 &#8211;enable-libdc1394 &#8211;enable-shared &#8211;disable-static<br />
  libavutil    51.  7. 0 / 51.  7. 0<br />
  libavcodec   53.  6. 0 / 53.  6. 0<br />
  libavformat  53.  3. 0 / 53.  3. 0<br />
  libavdevice  53.  0. 0 / 53.  0. 0<br />
  libavfilter   2.  4. 0 /  2.  4. 0<br />
  libswscale    2.  0. 0 /  2.  0. 0<br />
  libpostproc  52.  0. 0 / 52.  0. 0<br />
[aiff @ 0x100d560] max_analyze_duration reached<br />
Input #0, aiff, from &#8216;INPUT.aiff&#8217;:<br />
  Duration: 00:53:17.08, start: 0.000000, bitrate: 1411 kb/s<br />
    Stream #0.0: Audio: pcm_s16be, 44100 Hz, 2 channels, s16, 1411 kb/s<br />
Output #0, mp3, to &#8216;OUTPUT.mp3&#8217;:<br />
  Metadata:<br />
    TSSE            : Lavf53.3.0<br />
    Stream #0.0: Audio: libmp3lame, 44100 Hz, 2 channels, s16, 192 kb/s<br />
Stream mapping:<br />
  Stream #0.0 -> #0.0<br />
Press ctrl-c to stop encoding<br />
size=   74933kB time=3197.13 bitrate= 192.0kbits/s<br />
video:0kB audio:74933kB global headers:0kB muxing overhead 0.000042%
</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://scott.cm/linux-convert-aiff-to-mp3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
