<?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>Bits n Bobs</title>
	<atom:link href="http://www.alwayssunny.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.alwayssunny.com/blog</link>
	<description>Probably of no interest to anyone other than me</description>
	<lastBuildDate>Tue, 25 May 2010 13:11:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Actionscript 2 with UTF8 and BOM</title>
		<link>http://www.alwayssunny.com/blog/?p=201</link>
		<comments>http://www.alwayssunny.com/blog/?p=201#comments</comments>
		<pubDate>Tue, 25 May 2010 13:11:30 +0000</pubDate>
		<dc:creator>maxmil</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.alwayssunny.com/blog/?p=201</guid>
		<description><![CDATA[This none has had me baffled for a while&#8230;.
My AS2 source code files are all UTF-8. However in one of these i have extended characters (its a function that strips accents and the like from a text string).
With MTASC compiler this was working just fine but with the MMC compiler String.indexOf does not work.
After some [...]]]></description>
			<content:encoded><![CDATA[<p>This none has had me baffled for a while&#8230;.</p>
<p>My AS2 source code files are all UTF-8. However in one of these i have extended characters (its a function that strips accents and the like from a text string).</p>
<p>With MTASC compiler this was working just fine but with the MMC compiler String.indexOf does not work.</p>
<p>After some poking i have found the problem. In order for flash to compile the files correctly it need the Byte Order Mark (BOM) to be included in all Unicode files.</p>
<p>No idea if this is still the case with AS3.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alwayssunny.com/blog/?feed=rss2&amp;p=201</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Right click on HP Mini with Ubuntu UNR</title>
		<link>http://www.alwayssunny.com/blog/?p=195</link>
		<comments>http://www.alwayssunny.com/blog/?p=195#comments</comments>
		<pubDate>Sat, 27 Feb 2010 09:09:46 +0000</pubDate>
		<dc:creator>maxmil</dc:creator>
				<category><![CDATA[HP Mini]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Mouse]]></category>
		<category><![CDATA[UNR]]></category>

		<guid isPermaLink="false">http://www.alwayssunny.com/blog/?p=195</guid>
		<description><![CDATA[Just bought a notebook: HP Mini 210-1015es. 
Installing Ubuntu Network Remix was a doddle however it has the mouse buttons integrated into the touch pad and they don&#8217;t get recognized.
This is not a problem for the left click since you can just tap the pad however there was no right click.
You can activate the right [...]]]></description>
			<content:encoded><![CDATA[<p>Just bought a notebook: HP Mini 210-1015es. </p>
<p>Installing Ubuntu Network Remix was a doddle however it has the mouse buttons integrated into the touch pad and they don&#8217;t get recognized.</p>
<p>This is not a problem for the left click since you can just tap the pad however there was no right click.</p>
<p>You can activate the right click by telling the psmouse that you have an exps mouse. You just create  /etc/modprobe.d/psmouse.modprobe and add the following line:</p>
<p><code>psmouse proto=exps</code></p>
<p>However this means that you loose the touch pad functionality like the scroll as you move down the pad. Grrrrrr.  Can&#8217;t i have the best of both worlds?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alwayssunny.com/blog/?feed=rss2&amp;p=195</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up developer permissions on apache</title>
		<link>http://www.alwayssunny.com/blog/?p=190</link>
		<comments>http://www.alwayssunny.com/blog/?p=190#comments</comments>
		<pubDate>Fri, 26 Feb 2010 15:06:31 +0000</pubDate>
		<dc:creator>maxmil</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[pam]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.alwayssunny.com/blog/?p=190</guid>
		<description><![CDATA[I&#8217;m administrating a small server that hosts various web sites on an apache. Each web site has a group of developers who update their sites via ssh or sftp.
I needed to set up their permissions so that only the developers of each site and the apache user (www-data) could modify their sites files.
Each site is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m administrating a small server that hosts various web sites on an apache. Each web site has a group of developers who update their sites via ssh or sftp.</p>
<p>I needed to set up their permissions so that only the developers of each site and the apache user (www-data) could modify their sites files.</p>
<p>Each site is in a different sub directory of /var/www.</p>
<p>Initially, for each site, i created a group, put the developers of the site and the apache user in this group and gave the owner and group read and write permission on all the files.</p>
<p>This worked fine until a developer added files to the site since the new files were created with the developers principal group which meant the other developers could not edit the file.</p>
<p>Since each developer can be working on more than one site i could not just change the developers group.</p>
<p>However chmod g+s came to my rescue. This forces the all files created in each site to have the same group as the top level directory of the site.</p>
<p>Great.</p>
<p>However i still had a problem. The default umask for the developers that connected to the server was 022 which meant that even though the new files they created had the correct group the group only had read access to the files <img src='http://www.alwayssunny.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>With ssh connections changing the default umask was easy. I could do it in /etc/profile for the whole system or in ~/.profile for each user.</p>
<p>However when they connected via sftp this had no effect.</p>
<p>I think that the correct way to set up the default umask is using pam but after trying all sorts of configurations i couldn&#8217;t get it to work.</p>
<p>In the end the solution was to modify the line in /etc/ssh/sshd_config that started the stfp server.</p>
<p><code>#Subsystem sftp /usr/lib/openssh/sftp-server<br />
Subsystem sftp /opt/sftp-server-wrapper.sh</code></p>
<p>and create a wrapper script /opt/sftp-server-wrapper.sh</p>
<p><code>umask 0002<br />
exec /usr/lib/openssh/sftp-server</code></p>
<p>Don&#8217;t forget to add execution permissions to the wrapper script, otherwise sftp just fails silently!</p>
<p>This works but if anyone out there has a cleaner solution i would be very happy to hear it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alwayssunny.com/blog/?feed=rss2&amp;p=190</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian Java Socket Problems and IPV6</title>
		<link>http://www.alwayssunny.com/blog/?p=188</link>
		<comments>http://www.alwayssunny.com/blog/?p=188#comments</comments>
		<pubDate>Thu, 07 Jan 2010 15:56:29 +0000</pubDate>
		<dc:creator>maxmil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alwayssunny.com/blog/?p=188</guid>
		<description><![CDATA[After my last system update all java code that attempted to connect to remote sockets started failing. Having tried everything, including pulling my hair out, i finally found the solution here
There are two solutions
1) Set bindv6only to 0
sudo sysctl net.ipv6.bindv6only=0
2) Everywhere you start a virtual machine (tomcat, eclipse, maven etc) pass a vm parameter
-Djava.net.preferIPv4Stack=true
]]></description>
			<content:encoded><![CDATA[<p>After my last system update all java code that attempted to connect to remote sockets started failing. Having tried everything, including pulling my hair out, i finally found the solution <a href="http://pvaneynd.livejournal.com/132635.html">here</a></p>
<p>There are two solutions</p>
<p>1) Set bindv6only to 0<br />
<code>sudo sysctl net.ipv6.bindv6only=0</code><br />
2) Everywhere you start a virtual machine (tomcat, eclipse, maven etc) pass a vm parameter<br />
<code>-Djava.net.preferIPv4Stack=true</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alwayssunny.com/blog/?feed=rss2&amp;p=188</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using limit in mysql join</title>
		<link>http://www.alwayssunny.com/blog/?p=186</link>
		<comments>http://www.alwayssunny.com/blog/?p=186#comments</comments>
		<pubDate>Fri, 18 Dec 2009 13:17:06 +0000</pubDate>
		<dc:creator>maxmil</dc:creator>
				<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.alwayssunny.com/blog/?p=186</guid>
		<description><![CDATA[Just found myself in the scenario of needing to join two tables which have a 1 &#8211; n relationship. In the second table i only wanted to return the first two results.
This is one way to do it.

SELECT
    f1.col1,
    f1.col2
FROM foo f1
LEFT JOIN foo f2 ON f2.col2 = f1.col2 [...]]]></description>
			<content:encoded><![CDATA[<p>Just found myself in the scenario of needing to join two tables which have a 1 &#8211; n relationship. In the second table i only wanted to return the first two results.</p>
<p>This is one way to do it.</p>
<p><code><br />
SELECT<br />
    f1.col1,<br />
    f1.col2<br />
FROM foo f1<br />
LEFT JOIN foo f2 ON f2.col2 = f1.col2 AND f2.col1 < f1.col1<br />
GROUP BY f1.col1, f1.col2<br />
HAVING COUNT(f2.col1) <= 1<br />
ORDER BY f1.col2, f1.col2;<br />
</code></p>
<p>What you are doing here is joining the second table with itself. This will give you exactly one result with the first row in the second table, two for the second row, three for the third... etc.</p>
<p>You then group them and use the HAVING clause to get the row that you want.</p>
<p>This is not very efficient, but if your dataset is small or it's a one off query it does the job.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alwayssunny.com/blog/?feed=rss2&amp;p=186</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import Git to Subversion</title>
		<link>http://www.alwayssunny.com/blog/?p=185</link>
		<comments>http://www.alwayssunny.com/blog/?p=185#comments</comments>
		<pubDate>Tue, 06 Oct 2009 09:29:28 +0000</pubDate>
		<dc:creator>maxmil</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.alwayssunny.com/blog/?p=185</guid>
		<description><![CDATA[There are lots of docs out there for how to use git-svn starting with a subversion repository that already exists, however not so many if you are starting with a git repository that you want to import into subversion.
I still consider myself a beginner with git but here is how i managed it.
1) Create and [...]]]></description>
			<content:encoded><![CDATA[<p>There are lots of docs out there for how to use git-svn starting with a subversion repository that already exists, however not so many if you are starting with a git repository that you want to import into subversion.</p>
<p>I still consider myself a beginner with git but here is how i managed it.</p>
<p>1) Create and import an empty subversion repository.<code>mkdir tmp<br />
mkdir tmp/my-project<br />
mkdir /my-project/trunk<br />
mkdir /my-project/tags<br />
mkdir /my-project/branches<br />
svn import tmp http://some/svn/repo -m "Initial import"</code><br />
2) Clone a git repository from the subversion one you just imported<code>git svn clone -s http://some/svn/repo/my-project</code>(The -s tells git svn that you are using a standard layout for branches, tags and trunk).</p>
<p>3) Enter your new svn enabled git repository<code>cd my-project</code><br />
4) Add your working git repository as a remote repository.<code>git remote add dev /path/to/working/git/repository</code><br />
5) Pull all the commits from your working git repository into the master branch of the new repostory.<code>git pull dev master</code><br />
6) Rebase these commits ontop of the initial svn commit.<code>git svn rebase</code><br />
7) Commit changes to svn.<code>git svn dcommit</code> (Note that you can use the -n option to check first the commits that are about to be committed).</p>
<p>&#8212;</p>
<p>And that should do it, you can now remove the remote repository dev from your new svn enabled repository and carry on working using git svn dcommit to push local changes to the subversion repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alwayssunny.com/blog/?feed=rss2&amp;p=185</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GIT: Setting up new remote repo</title>
		<link>http://www.alwayssunny.com/blog/?p=184</link>
		<comments>http://www.alwayssunny.com/blog/?p=184#comments</comments>
		<pubDate>Fri, 28 Aug 2009 09:21:12 +0000</pubDate>
		<dc:creator>maxmil</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.alwayssunny.com/blog/?p=184</guid>
		<description><![CDATA[This is quick reminder for me of an excellent article from Toolman Tim.
Set up the new bare repo on the server:
$ ssh myserver.com
Welcome to myserver.com!
$ mkdir /var/git/myapp.git &#038;&#038; cd /var/git/myapp.git
$ git --bare init
Initialized empty Git repository in /var/git/myapp.git
$ exit
Bye!

Add the remote repository to your existing local git repo and push:
$ cd ~/Sites/myapp
$ git remote add [...]]]></description>
			<content:encoded><![CDATA[<p>This is quick reminder for me of an excellent article from <a href="http://toolmantim.com/articles/setting_up_a_new_remote_git_repository">Toolman Tim</a>.</p>
<p>Set up the new bare repo on the server:<br />
<code>$ ssh myserver.com<br />
Welcome to myserver.com!<br />
$ mkdir /var/git/myapp.git &#038;&#038; cd /var/git/myapp.git<br />
$ git --bare init<br />
Initialized empty Git repository in /var/git/myapp.git<br />
$ exit<br />
Bye!<br />
</code></p>
<p>Add the remote repository to your existing local git repo and push:<br />
<code>$ cd ~/Sites/myapp<br />
$ git remote add origin ssh://myserver.com/var/git/myapp.git<br />
$ git push origin master<br />
</code></p>
<p>Set the local master branch to track the remote branch. Copy the following into ./git/config</p>
<p><code>[branch "master"]<br />
  remote = origin<br />
  merge = refs/heads/master<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alwayssunny.com/blog/?feed=rss2&amp;p=184</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using spaces in fstab</title>
		<link>http://www.alwayssunny.com/blog/?p=182</link>
		<comments>http://www.alwayssunny.com/blog/?p=182#comments</comments>
		<pubDate>Thu, 06 Aug 2009 11:18:35 +0000</pubDate>
		<dc:creator>maxmil</dc:creator>
				<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.alwayssunny.com/blog/?p=182</guid>
		<description><![CDATA[I frequently have to mount windows file systems that have spaces in their names.
If you put something like//path/to/windows/file system /local/mount/pointin ftstab it complains with
line XX in /etc/fstab is bad
The solution is to use the escape code \040 instead of the space//path/to/windows/file\040system /local/mount/point
]]></description>
			<content:encoded><![CDATA[<p>I frequently have to mount windows file systems that have spaces in their names.</p>
<p>If you put something like<code>//path/to/windows/file system /local/mount/point</code>in ftstab it complains with</p>
<p>line XX in /etc/fstab is bad</p>
<p>The solution is to use the escape code \040 instead of the space<code>//path/to/windows/file\040system /local/mount/point</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alwayssunny.com/blog/?feed=rss2&amp;p=182</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Allowing remote access to MySQL server on Debian</title>
		<link>http://www.alwayssunny.com/blog/?p=183</link>
		<comments>http://www.alwayssunny.com/blog/?p=183#comments</comments>
		<pubDate>Wed, 15 Jul 2009 07:52:42 +0000</pubDate>
		<dc:creator>maxmil</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.alwayssunny.com/blog/?p=183</guid>
		<description><![CDATA[By default MySQL on Debian is configured to only allow local access. If you try to access from another machine you will get the following error:
Can&#8217;t connect to MySQL on  (10061)
In order to allow remote access you must edit /etc/init.d/my.cnf and change the bind address from 127.0.0.1 to your local ip address.
]]></description>
			<content:encoded><![CDATA[<p>By default MySQL on Debian is configured to only allow local access. If you try to access from another machine you will get the following error:</p>
<p>Can&#8217;t connect to MySQL on <host> (10061)</p>
<p>In order to allow remote access you must edit /etc/init.d/my.cnf and change the bind address from 127.0.0.1 to your local ip address.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alwayssunny.com/blog/?feed=rss2&amp;p=183</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List all files in directory tree by modification date</title>
		<link>http://www.alwayssunny.com/blog/?p=181</link>
		<comments>http://www.alwayssunny.com/blog/?p=181#comments</comments>
		<pubDate>Wed, 01 Apr 2009 09:42:11 +0000</pubDate>
		<dc:creator>maxmil</dc:creator>
				<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.alwayssunny.com/blog/?p=181</guid>
		<description><![CDATA[ find app -type f -printf "%T@\t%t\t%p\n" &#124; sort -r -n
]]></description>
			<content:encoded><![CDATA[<p><code> find app -type f -printf "%T@\t%t\t%p\n" | sort -r -n</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alwayssunny.com/blog/?feed=rss2&amp;p=181</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
