Posts by Kura
Mount Amazon S3 bucket locally on Debian 5 & 6/Ubuntu 10.04
0I'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 and then in to S3 and for that I used s3fs and FUSE.
FUSEYou 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.
FUSE allows you More >
Visualised: 24 hours of SSH attacks against a single server
1724 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 login,
- 3 failed user logins (including invalid users) and
- 3 failed system logins.
Backup a Linux server to Amazon S3 on Debian 6/Ubuntu 10.04
0I 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 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.
This is all well and good but I like having an off-site backup too and for that I use S3...
S3Amazon's S3 is pretty cheap and very More >
Automatic/Unattended updates on Debian 6 (Squeeze)
2All 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 apticron
unattended-upgrades handles the actual updates, apticron is used for emailing you of available updates - it is not required but I like it.
Configuring unattended-upgradesOpen up /etc/apt/apt.conf.d/50unattended-upgrades and change it to the content below.
APT::Periodic::Enable More >
syslog.tv is now HTTPS enabled
0
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 resources that are not secured - I'll work on fixing that.
Running your own PGP keyserver with SKS on Debian 6/Ubuntu 10.04
0Commands prefixed with # need to be run as a sudo or root.
InstallationTo 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 make sks start from init, open up /etc/default/sks in your favourite editor and initstart to look like below:
initstart=yes
Now we can start the service with:
# /etc/init.d/sks start
Your keyserver will now be up and running on port 11371.
Web interfaceWe'll need to create a web folder within sks More >
Host git repositories with git, gitosis and gitweb on Debian 6/Ubuntu 10.04
5First 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 repository and install it.
Adding your git usercd /tmp
git clone git://eagain.net/gitosis.git
cd gitosis
# python setup.py install
# adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
The above command creates a new system user with /bin/sh as More >
Rebooting on OOM
2I 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 auto-rebooting a system when the kernel panics it can be a very useful tool.
Think before implementing this and use at your own risk, I take zero responsibility for you using this.
sysctl vm.panic_on_oom=1
sysctl kernel.panic=X # X is the amount of seconds to wait before rebooting
DO NOT FORGET TO More >
Nagios3 + MK Livestatus + xinetd on Debian 6/Ubuntu
0First we need to make sure we have all the stuff we need to compile mk livestatus and run it
MK Livestatusapt-get install make build-essential xinetd ucspi-unix
Grab the mk livestatus source from here, currently it's version 1.1.10p3 but update the commands below to match your version.
Xinetdwget http://mathias-kettner.de/download/mk-livestatus-1.1.10p3.tar.gz
tar -xvzf mk-livestatus-1.1.10p3.tar.gz
cd mk-livestatus-1.1.10p3
./configure
make && make install
Now that it's compiled we need to write a xinetd config for it, create a new file called /etc/xinetd.d/livestatus and put More >

