<?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>syslog</title>
	<atom:link href="http://syslog.tv/feed/" rel="self" type="application/rss+xml" />
	<link>http://syslog.tv</link>
	<description>ramblings of an administrator</description>
	<lastBuildDate>Tue, 27 Mar 2012 14:21:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mount Amazon S3 bucket locally on Debian 5 &amp; 6/Ubuntu 10.04</title>
		<link>http://syslog.tv/2012/03/03/mount-amazon-s3-bucket-locally/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mount-amazon-s3-bucket-locally</link>
		<comments>http://syslog.tv/2012/03/03/mount-amazon-s3-bucket-locally/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 16:05:20 +0000</pubDate>
		<dc:creator>Kura</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[s3fs]]></category>

		<guid isPermaLink="false">http://syslog.tv/?p=856</guid>
		<description><![CDATA[I've recently been toying with my Raspberry Pi mirror including moving it out on to Amazon's S3. I've written an article on how to back up to S3 here, but that isn't enough when it comes to serving data from S3.
I needed the ability to RSYNC data from the official Raspberry Pi servers on to mine  [...]]]></description>
			<content:encoded><![CDATA[<p>I've recently been toying with my <a href="http://rpi.syslog.tv/" target="_blank">Raspberry Pi mirror</a> including moving it out on to Amazon's S3. I've written an article on how to back up to S3 <a href="https://syslog.tv/2012/02/29/backup-a-linux-server-to-amazon-s3-on-debian-6ubuntu-10-04/" target="_blank">here</a>, but that isn't enough when it comes to serving data from S3.</p>
<p>I needed the ability to RSYNC data from the official Raspberry Pi servers on to mine and then in to S3 and for that I used <a href="http://code.google.com/p/s3fs/" target="_blank">s3fs</a> and <a href="http://fuse.sourceforge.net/" target="_blank">FUSE</a>.</p>
<h2>FUSE</h2>
<p>You can actually do this successfully without requiring FUSE, just by installing the s3fs binary on to your system, but this only allows the user who mounted to access the mounted bucket and also is not possible via /etc/fstab.</p>
<p>FUSE allows you to implement a filesystem within a userspace program, thus allowing us to give other users access and auto-mount using /etc/fstab.</p>
<h2>Installation</h2>
<p><strong>All commands prefixed with a # need to be run as root or a sudo</strong></p>
<h3>Fuse</h3>
<p>Installing FUSE is simple</p>
<blockquote><p># apt-get install fuse-utils</p></blockquote>
<h3>s3fs</h3>
<p>We'll need to get build-essential, pkg-config, libfuse-dev, libcurl4-openssl-dev and libxml2-dev to be able to compile s3fs</p>
<blockquote><p># apt-get install build-essential pkg-config libfuse-dev libcurl4-openssl-dev libxml2-dev</p></blockquote>
<h4>Debian 5 &amp; Ubuntu 10.04</h4>
<p>If installing either Debian 5 or Ubuntu 10.04, you'll need to install a newer version of fuse than is packaged, I found this info on the s3fs issue tracker <a href="http://code.google.com/p/s3fs/issues/detail?id=143#c2" target="_blank">here</a>.</p>
<p>First we need to remove the install fuse-utils and libfuse-dev that we install above.</p>
<blockquote><p># apt-get purge fuse-utils libfuse-dev</p></blockquote>
<p>You'll need to export a variable with your arch, i.e</p>
<blockquote><p>export PLATFORM=amd64</p></blockquote>
<blockquote><p>wget http://ftp.us.debian.org/debian/pool/main/f/fuse/libfuse2_2.8.4-1.1_${PLATFORM}.deb<br />
wget http://ftp.us.debian.org/debian/pool/main/f/fuse/libfuse-dev_2.8.4-1.1_${PLATFORM}.deb<br />
wget http://ftp.us.debian.org/debian/pool/main/f/fuse/fuse-utils_2.8.4-1.1_${PLATFORM}.deb<br />
# dpkg -i libfuse2_2.8.4-1.1_${PLATFORM}.deb libfuse-dev_2.8.4-1.1_${PLATFORM}.deb fuse-utils_2.8.4-1.1_${PLATFORM}.deb</p></blockquote>
<p>Fix missing dependencies</p>
<blockquote><p># apt-get -f install</p></blockquote>
<p>Now run the command below and confirm the output</p>
<blockquote><p>pkg-config --modversion fuse<br />
2.8.4</p></blockquote>
<p>s3fs has to be done manually, first off go download the latest revision archive from <a href="http://code.google.com/p/s3fs/downloads/list" target="_blank">here</a>.</p>
<p>Once download, gunzip and untar it.</p>
<blockquote><p>tar -xvzf s3fs-x.xx.tar.gz</p></blockquote>
<p>Change directory in to your newly extracted archive, and configure.</p>
<blockquote><p>./configure --exec-prefix=/usr/ --prefix=/ --includedir=/usr/include/ --mandir=/usr/share/man/</p></blockquote>
<p>This configure command will install the s3fs binary in to /usr/bin and man pages in to /usr/share/man/ which is Debian and Ubuntu correct locations.</p>
<p>Then you'll need to compile and install.</p>
<blockquote><p>make</p></blockquote>
<blockquote><p># make install</p></blockquote>
<p><em>You'll noticed I only run make install as sudo/root, because the other commands do not require it and you should never compile as root.</em></p>
<h2>Configure s3fs</h2>
<p>The only configuration you need to do for s3fs is store your S3 credential which you can get <a href="https://aws-portal.amazon.com/gp/aws/securityCredentials" target="_blank">here</a>.</p>
<p>Create a file called <strong>/etc/passwd-s3fs</strong> - <strong>MAKE SURE YOU DON'T BREAK /etc/passwd</strong></p>
<p>In it you need to put your access key ID and secret access key, separated with a colon.</p>
<blockquote><p>ACCESS_KEY_ID:SECRET_ACCESS_KEY</p></blockquote>
<p>And for security reasons, change the file permissions</p>
<blockquote><p># chmod 0600 /etc/passwd-s3fs</p></blockquote>
<h2>Mounting</h2>
<h3>Manual</h3>
<p>Once all the above is done you can mount a bucket using the s3fs binary, I'm going to mount directly to /mnt</p>
<blockquote><p># s3fs your-bucket-name /mnt</p></blockquote>
<p>This will mount it and make it usable for your user.</p>
<h3>fstab</h3>
<p>Mounting via fstab requires the above FUSE step to be completed.</p>
<p>Your <strong>/etc/fstab</strong> entry should look like this</p>
<blockquote><p>s3fs#your-bucket-name  /mnt  fuse allow_other,_netdev,nosuid,nodev,url=https://s3.amazonaws.com 0 0</p></blockquote>
<p>A brief description of the mount arguments;</p>
<ul>
<li><strong>allow_other</strong> - allow all users to access the mount point,</li>
<li><strong>_netdev</strong> - The filesystem resides on a device that requires network access,</li>
<li><strong>nosuid</strong> - Do not allow set-user-identifier or set-group-identifier bits to take effect,</li>
<li><strong>nodev</strong> - Do not interpret character or block special devices on the file system and</li>
<li><strong>url</strong> - Use HTTPS instead of HTTP when configure as above</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://syslog.tv/2012/03/03/mount-amazon-s3-bucket-locally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visualised: 24 hours of SSH attacks against a single server</title>
		<link>http://syslog.tv/2012/03/02/visualised-24-hours-of-ssh-attacks-against-a-single-server/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=visualised-24-hours-of-ssh-attacks-against-a-single-server</link>
		<comments>http://syslog.tv/2012/03/02/visualised-24-hours-of-ssh-attacks-against-a-single-server/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 18:36:18 +0000</pubDate>
		<dc:creator>Kura</dc:creator>
				<category><![CDATA[ssh]]></category>
		<category><![CDATA[bruteforce]]></category>

		<guid isPermaLink="false">http://syslog.tv/?p=836</guid>
		<description><![CDATA[24 hours of SSH attacks against a single server, visualised on a world map using Python.
When a country stays lit up for more than 1 tick of the clock in the left hand corner it means that multiple attacks are happening from different IP addresses. An attacker is banned after;

1 failed root  [...]]]></description>
			<content:encoded><![CDATA[<p>24 hours of SSH attacks against a single server, visualised on a world map using Python.</p>
<p>When a country stays lit up for more than 1 tick of the clock in the left hand corner it means that multiple attacks are happening from different IP addresses. An attacker is banned after;</p>
<ul>
<li><span style="line-height: 18px;">1 failed root login,</span></li>
<li><span style="line-height: 18px;">3 failed user logins (including invalid users) and</span></li>
<li><span style="line-height: 18px;">3 failed system logins.</span></li>
</ul>
<p><span id="more-836"></span></p>
<p>&nbsp;</p>
<p><a href="http://syslog.tv/2012/03/02/visualised-24-hours-of-ssh-attacks-against-a-single-server/"><em>Click here to view the embedded video.</em></a></p>
<p>&nbsp;</p>
<h3>Direct links</h3>
<ul>
<li><a href="http://vimeo.com/37818131" target="_blank">Vimeo</a></li>
<li><a href="http://www.youtube.com/watch?v=S_p0G2oLuDU" target="_blank">YouTube</a> - older version of the video with yellow colouring instead of red.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://syslog.tv/2012/03/02/visualised-24-hours-of-ssh-attacks-against-a-single-server/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Backup a Linux server to Amazon S3 on Debian 6/Ubuntu 10.04</title>
		<link>http://syslog.tv/2012/02/29/backup-a-linux-server-to-amazon-s3-on-debian-6ubuntu-10-04/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=backup-a-linux-server-to-amazon-s3-on-debian-6ubuntu-10-04</link>
		<comments>http://syslog.tv/2012/02/29/backup-a-linux-server-to-amazon-s3-on-debian-6ubuntu-10-04/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 20:55:18 +0000</pubDate>
		<dc:creator>Kura</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://syslog.tv/?p=829</guid>
		<description><![CDATA[I have several servers powering syslog including it's Raspberry Pi mirror, load balancer and email servers. All of my servers are hosted using Linode in their London data centre and have Linode's back-up system doing both daily and weekly snapshots.
For the app and database servers I do server-side  [...]]]></description>
			<content:encoded><![CDATA[<p>I have several servers powering syslog including it's <a href="http://rpi.syslog.tv/" target="_blank">Raspberry Pi</a> mirror, load balancer and email servers. All of my servers are hosted using <a href="http://www.linode.com/?r=8d58820f89940a1a68832c0cdd53109727cfa622" target="_blank">Linode</a> in their London data centre and have Linode's back-up system doing both daily and weekly snapshots.</p>
<p>For the app and database servers I do server-side backups storing each website and it's database in it's own folder within /backup in case I require a quick back-up to fix something, rather than the server has died.</p>
<p>This is all well and good but I like having an off-site backup too and for that I use <a href="http://aws.amazon.com/s3/">S3</a>...</p>
<h2>S3</h2>
<p>Amazon's S3 is pretty cheap and very easy to use. Because only data is going in you don't pay a transfer fee and the cost of storage is very affordable, you can see a pricing list <a href="http://aws.amazon.com/s3/#pricing">here</a>.</p>
<p>To do the backup I use a daily cron job which then uploads the data to S3 using <a href="http://s3tools.org/s3cmd">s3cmd</a>.</p>
<h2>Installation</h2>
<p><strong>All commands prefixed with a # need to be run as root or a sudo</strong></p>
<p>Download the S3 tools package list in to apt</p>
<blockquote><p># wget -O- -q http://s3tools.org/repo/deb-all/stable/s3tools.key | sudo apt-key add -<br />
# wget http://s3tools.org/repo/deb-all/stable/s3tools.list -O /etc/apt/sources.list.d/s3tools.list</p></blockquote>
<p>Update your package list and install s3cmd</p>
<blockquote><p># apt-get update &amp;&amp; apt-get install s3cmd</p></blockquote>
<h2>Configuration</h2>
<p>You'll need to configure the tool to work with your AWS account, so run</p>
<blockquote><p># s3cmd --configure</p></blockquote>
<p>When prompted, fill in your access and secret key which you can find <a href="https://aws-portal.amazon.com/gp/aws/securityCredentials" target="_blank">here</a>.</p>
<p>When asked to provide an encryption password, I choose yes but you can say no.</p>
<p>When asking if you want to use HTTPS, I choose yes but again, you can say no, it really depends on how secure you want the data transfer.</p>
<p>I would suggest using an encryption password and enabling HTTPS.</p>
<h2>Using s3cmd</h2>
<p>Now that s3cmd is installed and configured you can use it.</p>
<p>You can create a bucket using the s3cmd command below, but as far as I know you can't select a location so I create my buckets manually <a href="https://console.aws.amazon.com/s3/home" target="_blank">here</a>.</p>
<blockquote><p># s3cmd mb s3://your-bucket-name</p></blockquote>
<p>Once done you can see a list of available buckets with</p>
<blockquote><p># s3cmd ls</p></blockquote>
<p>As shown below</p>
<blockquote><p>$ s3cmd ls</p>
<p>2012-02-29 20:28 s3://kura-linode-test</p></blockquote>
<p>Now that this is done we can put some data in there, create a test file</p>
<blockquote><p>echo "this is a test" &gt; test.file</p></blockquote>
<p>And put it in S3</p>
<blockquote><p># s3cmd put test.file s3://your-bucket-name/</p></blockquote>
<p>You can see it using</p>
<blockquote><p># s3cmd ls s3://your-bucket-name</p></blockquote>
<p>Download it with</p>
<blockquote><p># s3cmd get s3://your-bucket-name/test.file</p></blockquote>
<p>And delete it with</p>
<blockquote><p># s3cmd del s3://your-bucket-name/test.file</p></blockquote>
<p>Once satisfied with this you can create a shell script to automate some backups for you, I'll provide a simple one below that uploads my home directory</p>
<h2>Example</h2>
<blockquote><p>#!/bin/sh</p>
<p>s3cmd sync --recursive --skip-existing /home/kura s3://kura-linode-test/</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://syslog.tv/2012/02/29/backup-a-linux-server-to-amazon-s3-on-debian-6ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic/Unattended updates on Debian 6 (Squeeze)</title>
		<link>http://syslog.tv/2012/01/28/automaticunattended-updates-on-debian-6-squeeze/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automaticunattended-updates-on-debian-6-squeeze</link>
		<comments>http://syslog.tv/2012/01/28/automaticunattended-updates-on-debian-6-squeeze/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 17:41:59 +0000</pubDate>
		<dc:creator>Kura</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[automatic update]]></category>
		<category><![CDATA[unattended-upgrades]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://syslog.tv/?p=809</guid>
		<description><![CDATA[All commands prefixed with a # need to be run as sudo or root
The unattended-upgrades package used on Debian is based on the one from Ubuntu. It is generally pretty safe in my opinion but I only ever enable it for security upgrades.
Installation
# apt-get install unattended-upgrades  [...]]]></description>
			<content:encoded><![CDATA[<p><strong>All commands prefixed with a # need to be run as sudo or root</strong></p>
<p>The unattended-upgrades package used on Debian is based on the one from Ubuntu. It is generally pretty safe in my opinion but I only ever enable it for security upgrades.</p>
<h2>Installation</h2>
<blockquote><p># apt-get install unattended-upgrades apticron</p></blockquote>
<p><em>unattended-upgrades</em> handles the actual updates, <em>apticron</em> is used for emailing you of available updates - it is not required but I like it.</p>
<h2>Configuring unattended-upgrades</h2>
<p>Open up <strong>/etc/apt/apt.conf.d/50unattended-upgrades</strong> and change it to the content below.</p>
<blockquote><p>APT::Periodic::Enable "1";<br />
APT::Periodic::Update-Package-Lists "1";<br />
APT::Periodic::AutocleanInterval "7";<br />
APT::Periodic::Unattended-Upgrade "1";<br />
Unattended-Upgrade::Mail "<strong>YOUR_EMAIL_HERE</strong>";</p>
<p>// Automatically upgrade packages from these (origin, archive) pairs<br />
Unattended-Upgrade::Allowed-Origins {</p>
<p style="padding-left: 30px;">"${distro_id} stable";<br />
"${distro_id} ${distro_codename}-security";</p>
<p>};</p>
<p>// Automatically reboot *WITHOUT CONFIRMATION* if a<br />
// the file /var/run/reboot-required is found after the upgrade<br />
Unattended-Upgrade::Automatic-Reboot "false";</p></blockquote>
<p>So lets explain the above. As you can see we enable periodic updates, enable update package lists (triggers an apt-get update), enable autoclean to clean out the local package repository every 7 days, enable the actual unattended update and finally you can set your email address so that you will get an email when an update has happened.<br />
Next up we configure the origins to update from, as you can see we've only enabled security and as a very final step we make sure we've disabled automatic reboots - you probably don't want your server randomly rebooting to update the running kernel, this means you will have to reboot when convenient after a kernel update.</p>
<p>Your unattended update will happen every day, triggered by <strong>cron.daily</strong>. Next time your cron.daily has triggered, look inside <strong>/var/log/unattended-upgrades/unattended-upgrades.log</strong>, you should see something like this</p>
<blockquote><p>2012-01-28 06:54:04,730 INFO Initial blacklisted packages:<br />
2012-01-28 06:54:04,730 INFO Starting unattended upgrades script<br />
2012-01-28 06:54:04,731 INFO Allowed origins are: ["('Debian', 'squeeze-security')"]<br />
2012-01-28 06:54:05,952 INFO No packages found that can be upgraded unattended</p></blockquote>
<p>If you installed apticron in the above step and want to configure it and use it then continue reading, if not then congratulations everything is done.</p>
<h2>Configuring apticron</h2>
<p>Open up <strong>/etc/apticron/apticron.conf</strong>, all you need to change is the <strong>EMAIL</strong> option.</p>
<blockquote><p>EMAIL="<strong>YOUR_EMAIL_HERE</strong>"</p></blockquote>
<p>Now each day you will receive an email when <strong>cron.daily</strong> runs with all available package updates.</p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.tv/2012/01/28/automaticunattended-updates-on-debian-6-squeeze/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>syslog.tv is now HTTPS enabled</title>
		<link>http://syslog.tv/2011/12/24/syslog-tv-is-now-https-enabled/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=syslog-tv-is-now-https-enabled</link>
		<comments>http://syslog.tv/2011/12/24/syslog-tv-is-now-https-enabled/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 01:01:38 +0000</pubDate>
		<dc:creator>Kura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://syslog.tv/?p=789</guid>
		<description><![CDATA[https://syslog.tv/
&#160;
I finally stopped being lazy and decided to create an HTTPS version of this blog. I know it's not at all required but I decided it could/would be a good thing to do anyway.
For now due to the blog software being crappy it's showing an invalid certificate due to including  [...]]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center;"><a href="https://syslog.tv/">https://syslog.tv/</a></h3>
<p>&nbsp;</p>
<p>I finally stopped being lazy and decided to create an HTTPS version of this blog. I know it's not at all required but I decided it could/would be a good thing to do anyway.</p>
<p>For now due to the blog software being crappy it's showing an invalid certificate due to including resources that are not secured - I'll work on fixing that.</p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.tv/2011/12/24/syslog-tv-is-now-https-enabled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>syslog.tv is now IPv6 enabled</title>
		<link>http://syslog.tv/2011/12/19/syslog-tv-is-now-ipv6-enabled/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=syslog-tv-is-now-ipv6-enabled</link>
		<comments>http://syslog.tv/2011/12/19/syslog-tv-is-now-ipv6-enabled/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 22:35:34 +0000</pubDate>
		<dc:creator>Kura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://syslog.tv/?p=783</guid>
		<description><![CDATA[Wanted to do this back in June for World IPv6 Day but Linode didn't support IPv6 in it's London data centre.
It's IPv6 address is: 2a01:7e00::f03c:91ff:fe93:505a

]]></description>
			<content:encoded><![CDATA[<p>Wanted to do this back in June for World IPv6 Day but Linode didn't support IPv6 in it's London data centre.</p>
<p>It's IPv6 address is: <strong>2a01:7e00::f03c:91ff:fe93:505a</strong></p>
<p><a href="https://syslog.tv/files/2011/12/ipv6.png"><img class="aligncenter size-full wp-image-784" title="IPv6" src="https://syslog.tv/files/2011/12/ipv6.png" alt="IPv6" width="742" height="613" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.tv/2011/12/19/syslog-tv-is-now-ipv6-enabled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running your own PGP keyserver with SKS on Debian 6/Ubuntu 10.04</title>
		<link>http://syslog.tv/2011/12/17/running-your-own-pgp-keyserver-with-sks-on-debian-6ubuntu-10-04/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=running-your-own-pgp-keyserver-with-sks-on-debian-6ubuntu-10-04</link>
		<comments>http://syslog.tv/2011/12/17/running-your-own-pgp-keyserver-with-sks-on-debian-6ubuntu-10-04/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 15:58:59 +0000</pubDate>
		<dc:creator>Kura</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[keyserver]]></category>
		<category><![CDATA[pgp]]></category>
		<category><![CDATA[sks]]></category>

		<guid isPermaLink="false">http://syslog.tv/?p=771</guid>
		<description><![CDATA[Commands prefixed with # need to be run as a sudo or root.
Installation
To install we need to run the following command:
# apt-get install -y sks
Now we build the key database:
# sks build
And change the permissions for the sks user:
# chown -R debian-sks:debian-sks /var/lib/sks/DB
Next we need to  [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Commands prefixed with # need to be run as a sudo or root.</strong></em></p>
<h2>Installation</h2>
<p>To install we need to run the following command:</p>
<blockquote><p># apt-get install -y sks</p></blockquote>
<p>Now we build the key database:</p>
<blockquote><p># sks build</p></blockquote>
<p>And change the permissions for the sks user:</p>
<blockquote><p># chown -R debian-sks:debian-sks /var/lib/sks/DB</p></blockquote>
<p>Next we need to make sks start from init, open up <strong>/etc/default/sks</strong> in your favourite editor and <em><strong>initstart</strong></em> to look like below:</p>
<blockquote><p>initstart=yes</p></blockquote>
<p>Now we can start the service with:</p>
<blockquote><p># /etc/init.d/sks start</p></blockquote>
<p>Your keyserver will now be up and running on port 11371.</p>
<h2>Web interface</h2>
<p>We'll need to create a web folder within sks with the following command:</p>
<blockquote><p># mkdir -p /var/lib/sks/www/</p></blockquote>
<p>Change it's permissions so the sks user can access it.</p>
<blockquote><p># chown -R debian-sks:debian-sks /var/lib/sks/www</p></blockquote>
<p>And finally we need create a single HTML file for the interface, I have provided that too.</p>
<blockquote><p># wget http://syslog.tv/downloads/sks-index.html -O /var/lib/sks/www/index.html</p></blockquote>
<p>Now your PGP server should be accessible from a web browser at <a title="http://YOUR_SERVER:11371/" href="http://YOUR_SERVER:11371/" target="_blank">http://YOUR_SERVER:11371/</a> and it should look like mine <a title="http://syslog.tv:11371/" href="http://syslog.tv:11371/" target="_blank">http://syslog.tv:11371/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.tv/2011/12/17/running-your-own-pgp-keyserver-with-sks-on-debian-6ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Host git repositories with git, gitosis and gitweb on Debian 6/Ubuntu 10.04</title>
		<link>http://syslog.tv/2011/12/17/host-git-repositories-with-git-gitosis-and-gitweb-on-debian-6ubuntu-10-04/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=host-git-repositories-with-git-gitosis-and-gitweb-on-debian-6ubuntu-10-04</link>
		<comments>http://syslog.tv/2011/12/17/host-git-repositories-with-git-gitosis-and-gitweb-on-debian-6ubuntu-10-04/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 15:40:01 +0000</pubDate>
		<dc:creator>Kura</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[gitosis]]></category>
		<category><![CDATA[gitweb]]></category>

		<guid isPermaLink="false">http://syslog.tv/?p=765</guid>
		<description><![CDATA[Installation
First up we'll need to install git and some Python tools to get Gitosis installed.
Where # is used it means you need to either run the command as a superuser with sudo or as root.
# apt-get install -y git-core gitweb python-setuptools
Next we have to clone gitosis from it's git  [...]]]></description>
			<content:encoded><![CDATA[<h2>Installation</h2>
<p>First up we'll need to install git and some Python tools to get Gitosis installed.</p>
<p>Where # is used it means you need to either run the command as a superuser with sudo or as root.</p>
<blockquote><p># apt-get install -y git-core gitweb python-setuptools</p></blockquote>
<p>Next we have to clone gitosis from it's git repository and install it.</p>
<blockquote><p>cd /tmp</p>
<p>git clone git://eagain.net/gitosis.git</p>
<p>cd gitosis</p>
<p># python setup.py install</p></blockquote>
<h2>Adding your git user</h2>
<blockquote><p># adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git</p></blockquote>
<p>The above command creates a new system user with <strong>/bin/sh</strong> as it's shell with <strong>no password</strong> and a homedir of <strong>/home/git/</strong> and also creates a group with the same name.</p>
<h2>Initialising gitosis</h2>
<p>You'll need an SSH key for this, if you have one simply copy the contents of it to your new git server, if you do not have one then you can generate one on your machine using</p>
<blockquote><p>ssh-keygen</p></blockquote>
<p>And then copy the contents to your server.</p>
<p>My file was copied to <strong>/tmp/kura.pub</strong> so to initialise I used</p>
<blockquote><p>sudo -H -u git gitosis-init &lt; /tmp/kura.pub</p></blockquote>
<p><em><strong>This command MUST be run as sudo.</strong></em></p>
<p>You need to do the same but replacing <strong>kura.pub</strong> with your own key, it has to end in .pub</p>
<h3>A note on key format</h3>
<p>One of my users (<a href="https://syslog.tv/2011/12/17/host-git-repositories-with-git-gitosis-and-gitweb-on-debian-6ubuntu-10-04/#comment-374">@gump</a>) had an issue where Gitosis would complain about his username having invalid characters</p>
<blockquote><p>gitosis.init.InsecureSSHKeyUsername: Username contains not allowed characters</p></blockquote>
<p>This is because Gitosis expects your key to have a username and host at the end of the base64 string like below</p>
<blockquote><p>ssh-rsa AAAAB3NzaC1yc2EA ... NOHgpPwEBzpnw== kura@odin</p></blockquote>
<h2>Configuring and controlling gitosis</h2>
<p>Now that git and gitosis are working on your server, from your local machine you now need to clone your gitosis admin and do all your changes locally, pushing them back to the git server where gitosis will automatically pick them up.</p>
<p>So you need to run</p>
<blockquote><p>git clone git@YOUR_SERVER:gitosis-admin.git</p></blockquote>
<p>If everything worked correctly you should have a copy on your local machine now, if you run <strong>ls</strong> you'll see 1 file and a directory.</p>
<ol>
<li><span style="line-height: 18px;">gitosis.conf</span></li>
<li><span style="line-height: 18px;">keydir</span></li>
</ol>
<p>Unsurprisingly gitosis.conf is where gitosis is configured and keydir contains public keys for your users. Each user needs their own public key and it must end in <em>.pub</em>.</p>
<p>So open up <strong>gitosis.conf</strong> in your favourite editor and add the following:</p>
<blockquote><p>[gitosis]<br />
gitweb = yes</p>
<p>[group admins]<br />
writable = gitosis-admin test1<br />
members = kura</p>
<p>[repo gitosis-admin]<br />
description = Gitosis admin repository<br />
gitweb = yes</p></blockquote>
<p>So lets separate that in to parts.</p>
<p><strong>Part 1</strong> - we simply tell gitosis to enable gitweb support.</p>
<p><strong>Part 2</strong> - we configure a group called <em><strong>admins</strong></em>, the admins group has write permissions to 2 repositories; <em><strong>gitosis-admin</strong></em> and <em><strong>test</strong></em>. The test repository will automatically become available once we push this configuration back to gitosis later. We also define a user called <strong>kura</strong> which you should replace with your own username, <strong>each user must have a public key in the keydir with the same name as the user with .pub suffix. E.g. the kura user has a key called kura.pub</strong></p>
<p><strong>Part 3</strong> - We create a repository section which is only really used for gitweb to tell it to display that repository publicly via a browser.</p>
<p><strong>If you do not want your repositories to be public then I advice you skip the parts with gitweb = yes above and also uninstall gitweb and skip the gitweb section below. Or you could lock your gitweb via HTAUTH.</strong></p>
<p>Now the changes have been made you need to commit them to git.</p>
<blockquote><p>git add *</p>
<p>git commit -m "Initial configuration"</p></blockquote>
<p>And push them back to the server</p>
<blockquote><p>git push origin master</p></blockquote>
<p>Now that is done you can test your access to the test repository created earlier.</p>
<blockquote><p>git clone git@YOUR_SERVER:test.git</p>
<p>cd test</p>
<p>echo "Hello world" &gt; hello</p>
<p>git add hello</p>
<p>git commit -m "Test"</p>
<p>git push origin master</p></blockquote>
<p>If the above works then congratulations, everything is good.</p>
<h2>Adding users and repositories</h2>
<h3>Users</h3>
<p>To add a user to gitosis you need to add them to a group and put a public key with username.pub as the naming format in to keydir.</p>
<h3>Repositories</h3>
<p>You simply need to name it in a writable section of a group and it'll instantly be accessible. If you want to make it public in gitweb then you'll need to a [repo] section as shown above.</p>
<h2>Configure gitweb</h2>
<p>Open up <strong>/etc/gitweb.conf</strong> in your favourite editor and change <em><strong>$projectroot</strong></em> to</p>
<blockquote><p>$projectroot = "/home/git/repositories/"</p></blockquote>
<p>You will also need to add the Apache user to the git group</p>
<blockquote><p>usermod -G www-data,git www-data</p></blockquote>
<p>By default Debian and Ubuntu will symlink in an Apache2 config to <strong>/etc/apache2/conf.d/gitweb</strong> which is accessible from a browser on <a title="http://YOUR_SERVER/gitweb" href="http://YOUR_SERVER/gitweb" target="_blank">http://YOUR_SERVER/gitweb</a></p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.tv/2011/12/17/host-git-repositories-with-git-gitosis-and-gitweb-on-debian-6ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Rebooting on OOM</title>
		<link>http://syslog.tv/2011/10/25/rebooting-on-oom/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rebooting-on-oom</link>
		<comments>http://syslog.tv/2011/10/25/rebooting-on-oom/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 10:26:34 +0000</pubDate>
		<dc:creator>Kura</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[kernel panic]]></category>
		<category><![CDATA[oom]]></category>
		<category><![CDATA[reboot]]></category>

		<guid isPermaLink="false">http://syslog.tv/?p=735</guid>
		<description><![CDATA[I would generally not advise using this unless you have skill at debugging why OOM has spawned and also debugging kernel panics after they happen, from logs.
It is possible to configure your kernel to panic when OOM is spawned, which in itself is not useful but, coupled with a kernel option for  [...]]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: underline;"><em><strong>I would generally not advise using this unless you have skill at debugging why OOM has spawned and also debugging kernel panics after they happen, from logs.</strong></em></span></p>
<p>It is possible to configure your kernel to panic when OOM is spawned, which in itself is not useful but, coupled with a kernel option for auto-rebooting a system when the kernel panics it can be a very useful tool.</p>
<p>Think before implementing this and use at your own risk, I take zero responsibility for you using this.</p>
<blockquote><p>sysctl vm.panic_on_oom=1</p></blockquote>
<blockquote><p>sysctl kernel.panic=X # X is the amount of seconds to wait before rebooting</p></blockquote>
<p><span style="text-decoration: underline;"><em><strong>DO NOT FORGET TO CHANGE X</strong></em></span></p>
<p>This will inject the changes in to a system that is currently running but will be forgotten on reboot so use the lines below to save permanently.</p>
<blockquote><p>echo "vm.panic_on_oom=1" >> /etc/sysctl.conf</p></blockquote>
<blockquote><p>echo "kernel.panic=X" >> /etc/sysctl.conf</p></blockquote>
<p><strong><em><span style="text-decoration: underline;">X is the amount of seconds to wait before rebooting. DO NOT FORGET TO CHANGE X</span></em></strong></p>
<h2>Testing</h2>
<p>You can test the changes with a simple C program. <strong>Please note if you run this you do so at your own risk</strong>.</p>
<blockquote><p>#include <stdio.h><br />
#include <stdlib.h><br />
#include <string.h></p>
<p>#define MB 10485760</p>
<p>int main(int argc, char *argv[]) {</p>
<p style="padding-left: 30px;">void *b = NULL;<br />
int c = 0;</p>
<p style="padding-left: 30px;">while(1) {</p>
<p style="padding-left: 60px;">b = (void *) malloc(MB);</p>
<p style="padding-left: 60px;">if (!b) {</p>
<p style="padding-left: 90px;">break;</p>
<p style="padding-left: 60px;">}</p>
<p style="padding-left: 60px;">memset(b, 10, MB);<br />
printf("Allocating %d MB\n", (++c * 10));</p>
<p style="padding-left: 30px;">}</p>
<p style="padding-left: 30px;">exit(0);</p>
<p>}</p></blockquote>
<h2>Compilation</h2>
<p>You can download the source from <a title="oom.c" href="http://syslog.tv/downloads/oom.c" target="_blank">here</a>.</p>
<p>To compile run the command below</p>
<blockquote><p>gcc -O2 oom.c -o oom</p></blockquote>
<p>Or download a pre-compiled version <a title="oom" href="http://syslog.tv/downloads/oom" target="_blank">here</a>.</p>
<h2>Usage</h2>
<p>And simply run it using</p>
<blockquote><p>./oom</p></blockquote>
<p>After a short period of time allocating and using 10MB chunks of memory your system should run out and restart.</p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.tv/2011/10/25/rebooting-on-oom/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nagios3 + MK Livestatus + xinetd on Debian 6/Ubuntu</title>
		<link>http://syslog.tv/2011/10/13/nagios3-mk-livestatus-xinetd/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nagios3-mk-livestatus-xinetd</link>
		<comments>http://syslog.tv/2011/10/13/nagios3-mk-livestatus-xinetd/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 23:17:10 +0000</pubDate>
		<dc:creator>Kura</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mk livestatus]]></category>
		<category><![CDATA[nagios 3]]></category>
		<category><![CDATA[nagios broker]]></category>
		<category><![CDATA[xinetd]]></category>

		<guid isPermaLink="false">http://syslog.tv/?p=711</guid>
		<description><![CDATA[Preparation
First we need to make sure we have all the stuff we need to compile mk livestatus and run it
apt-get install make build-essential xinetd ucspi-unix
MK Livestatus
Grab the mk livestatus source from here, currently it's version 1.1.10p3 but update the commands below to match your  [...]]]></description>
			<content:encoded><![CDATA[<h2>Preparation</h2>
<p>First we need to make sure we have all the stuff we need to compile mk livestatus and run it</p>
<blockquote><p>apt-get install make build-essential xinetd ucspi-unix</p></blockquote>
<h2>MK Livestatus</h2>
<p>Grab the mk livestatus source from <a href="http://mathias-kettner.de/check_mk_download.html" target="_blank">here</a>, currently it's version 1.1.10p3 but update the commands below to match your version.</p>
<blockquote><p>wget http://mathias-kettner.de/download/mk-livestatus-1.1.10p3.tar.gz</p>
<p>tar -xvzf mk-livestatus-1.1.10p3.tar.gz</p>
<p>cd mk-livestatus-1.1.10p3</p>
<p>./configure</p>
<p>make &amp;&amp; make install</p></blockquote>
<h2>Xinetd</h2>
<p>Now that it's compiled we need to write a xinetd config for it, create a new file called <strong>/etc/xinetd.d/livestatus</strong> and put the following in it</p>
<blockquote><p>service livestatus<br />
{</p>
<p style="padding-left: 30px;">type = UNLISTED<br />
port = 6557<br />
socket_type = stream<br />
protocol = tcp<br />
wait = no<br />
cps = 100 3<br />
instances = 500<br />
per_source = 250<br />
flags = NODELAY<br />
user = nagios<br />
server = /usr/bin/unixcat<br />
server_args = /var/lib/nagios3/rw/live<br />
only_from = 127.0.0.1 # modify this to only allow specific hosts to connect, currenly localhost only<br />
disable = no</p>
<p>}</p></blockquote>
<p>Now we restart xinetd using</p>
<blockquote><p>/etc/init.d/xinetd restart</p></blockquote>
<h2>Nagios3</h2>
<p>Now we need to open up <strong>/etc/nagios3/nagios.cfg</strong> and add the following 2 lines</p>
<blockquote><p>event_broker_options=-1<br />
broker_module=/usr/local/lib/mk-livestatus/livestatus.o /var/lib/nagios3/rw/live</p></blockquote>
<p>Now we need to restart Nagios</p>
<blockquote><p>/etc/init.d/nagios3 restart</p></blockquote>
<p>If you take a look in <strong>/var/log/nagios3/nagios.log</strong></p>
<blockquote><p>tail -n 100 /var/log/nagios3/nagios.log</p></blockquote>
<p>you should see something like below</p>
<blockquote><p>[1318547328] livestatus: Livestatus 1.1.10p3 by Mathias Kettner. Socket: '/var/lib/nagios3/rw/live'<br />
[1318547328] livestatus: Please visit us at http://mathias-kettner.de/<br />
[1318547328] livestatus: Hint: please try out OMD - the Open Monitoring Distribution<br />
[1318547328] livestatus: Please visit OMD at http://omdistro.org<br />
[1318547328] Event broker module '/usr/local/lib/mk-livestatus/livestatus.o' initialized successfully.</p></blockquote>
<p>Also, we can ls the newly created socket</p>
<blockquote><p>ls -lah /var/lib/nagios3/rw/live</p></blockquote>
<blockquote><p>srw-rw---- 1 nagios www-data 0 2011-10-14 00:08 /var/lib/nagios3/rw/live</p></blockquote>
<p>We can test is by creating a test file called host_query with the following content</p>
<blockquote><p>GET hosts</p></blockquote>
<p>And run the following command</p>
<blockquote><p>unixcat &lt; host_query /var/lib/nagios3/rw/live</p></blockquote>
<p>If all worked you should see output.</p>
]]></content:encoded>
			<wfw:commentRss>http://syslog.tv/2011/10/13/nagios3-mk-livestatus-xinetd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
