howtos


Upgrading gitlab to latest stable version

This is based on the gitlab installation described here. cd /home/git/gitlab sudo -u git -H git pull sudo -u git -H git branch -a This should give you a list of available branches. You should probably checkout the latest stable branch: sudo -u git -H git checkout 6-7-stable Install the gems: sudo -i git -H bundle install –deployment –without […]


Grow ext4 or xfs partitions to its maximum size

For EXT4 partitions: resize2fs /dev/xvda1 For XFS: xfs_growfs -d /dev/xvda1 Replace xvda1 with the partition of your choice! I ran into this problem using AWS instances in which I had to increase the size of the root partitions of an EBS volume. Type df -h to show your currently mounted partitions and disk usage.


Installing Gitlab on Debian

First install these packages to resolve all dependancies: apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate python python-docutils Install Ruby 2.0: cd /tmp wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz tar -xvpf ruby-2.0.0-p247.tar.gz cd ruby-2.0.0-p247 ./configure make make install Install Bundler: gem install bundler Create the git […]


Calculating the size of your S3 bucket using Python

For the following script you need to have installed Python >= 2.6 and Boto: apt-get install -y python-boto Next create a file ~/.boto containing the following lines: [Credentials] region = us-east-1 aws_access_key_id = YOUR_ACCESS_KEY_ID aws_secret_access_key = YOUR_SECRET_ACCCESS_KEY Put in the AWS credentials to access your bucket Then create the script, replace NAME_OF_YOU_BUCKET with your actual […]


Using automysqlbackup to create regular backups of your database

This works on Debian and Ubuntu, but also on other distributions. The package can be installed via apt: apt-get install automysqlbackup For yum (Fedora, CentOS, RedHat, etc.) there's usually also a package provided. Next you need to edit the configuration file /etc/default/automysqlbackup. There are other options, the most important ones are: USERNAME=root PASSWORD=…….. DBHOST=localhost DBNAMES=`mysql –defaults-file=/etc/mysql/debian.cnf […]


Backups to S3 using Duplicity

First install Duplicity with its dependancies: apt-get install haveged python-paramiko python-boto python-gobject-2 duplicity Then generate a gpg key: gpg −−gen-key The output might be like this (just confirm everything with return and keep aside the password you'll have to enter): gpg (GnuPG) 1.4.12; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you […]


Configuring Nginx for WordPress

A typical Vhost file (for example /etc/nginx/sites-available/default) would look like this: server {   listen   80;   server_name  YOUR_SERVER_NAME;   access_log  /var/log/nginx/access.log;   root /var/www;   index index.php;   location / {    index index.php;    try_files $uri $uri/ /index.php?q=$uri&$args;   }   location ~ \.php$ {               […]


Use s3ql to mount an S3 storage filesystem locally

s3ql is an alternative to s3fs and s3backer which you can use to mount and s3 bucket into your local filesystem. s3ql will create a block device inside your S3 bucket. Its size is dynamic, so you allocate just as much storage space as you are using. It also encrypts your data using a password […]