Create Secure FTP Jails with OpenSSH on Debian/Ubuntu

If you don't have already OpenSSH-Server on your machine and you're connected probably via SSH, then we need to install it: apt-get update apt-get install openssh-server Next we modify the file /etc/ssh/sshd_config: Comment out the following line by prepending a #: Subsystem sftp /usr/lib/openssh/sftp-server And in the same file add this block right at the end: […]


Creating a Glusterfs volume replicated across 2 hosts

This worked perfectly on Ubuntu 14.04, but should work just the same on other Ubuntu or Debian-based distributions.  First of all, install glusterfs on both hosts: apt-get install glusterfs-server I suggest, for simplicity to but the 2 hostnames in /etc/hosts on each server, for example: 192.168.18.11 srv01 192.168.18.12 srv02 I'm going to use those hostnames in […]


Installing RatticWeb on Ubuntu 14.04

First a few prerequesites: apt-get update apt-get install git libxslt-dev libxml2-dev libldap2-dev libsasl2-dev libmysqlclient-dev python-dev python-virtualenv   Create a virtual environment and run the actual installation: mkdir ~/venv/RatticWeb mkdir -p ~/venv/RatticWeb virtualenv ~/venv/RatticWeb source ~/venv/RatticWeb/bin/activate git clone https://github.com/tildaslash/RatticWeb.git cd RatticWeb/ pip install -r requirements-mysql.txt -r requirements-dev.txt cat > conf/local.cfg <<EOF [ratticweb] secretkey = [ENTER SOMETHING […]


Mount Google Drive on your server using ocamlfuse

Add the repository:  add-apt-repository ppa:alessandro-strada/ppa Install google-drive-ocamlfuse: apt-get update apt-get install google-drive-ocamlfuse Next go to https://console.developers.google.com/project and create a new project for your access to Google Drive. Then go into your project, to APIs and Authentication, then APIs and activate Drive API. Finally create an OAuth ClientID (web application). You will need the Client-ID and secret for the next step: […]


Install Haproxy 1.5 as transparent loadbalancer for http and https on Ubuntu Trusty

I've been searching and testing this quite a while until I had a working setup. There are a lot of articles out there, but here is a solution that has worked for me. First install haproxy 1.5: apt-add-repository ppa:vbernat/haproxy-1.5 apt-get update apt-get install haproxy It is important that you use at least version 1.5 of […]


Unattended upgrades on Debian

There's a simple way of having unattended upgrades, having the possiblity to backlist packages or limit upgrades for example to security patches etc. apt-get install unattended-upgrades apt-listchanges dpkg-reconfigure -plow unattended-upgrades Edit /etc/apt/apt.conf.d/50unattended-upgrades with this content: // Automatically upgrade packages from these origin patterns // In this case we install only security updates Unattended-Upgrade::Origins-Pattern { //   […]


Why you cannot delete your own files on MacOS

Did it occur to you on MacOS that you could not delete a file in your home folder that obviously belongs to you? This is simply because of some flags. You can show them like this: ls -lO test.txt -rw-r–r– 1 christian staff uchg 7 Feb 2 10:11 test.txt When you try to delete it […]


Shipping your Nginx logs to Elasticsearch using Logstash

First of all create a new log format in /etc/nginx/nginx.conf and add/replace an access log directive: log_format logstash ‘$http_host ‘ ‘$remote_addr [$time_local] ‘ ‘”$request” $status $body_bytes_sent ‘ ‘”$http_referer” “$http_user_agent” ‘ ‘$request_time ‘ ‘$upstream_response_time'; access_log /var/log/nginx/access.log logstash; Install Elasticsearch like described here. Install Logstash like described here. Add the following pattern to logstash in /opt/logstash/paggerns/nginx: NGUSERNAME […]


Setting up Logstash on Debian/Ubuntu

Install Logstash: cd /tmp wget https://download.elasticsearch.org/logstash/logstash/logstash-1.4.2.tar.gz tar -xvpf logstash-1.4.2.tar.gz mv logstash-1.4.2 /opt/logstash Create an init script /etc/init.d/logstash (this one worked fine for me on Ubuntu 14.04): #! /bin/sh ### BEGIN INIT INFO # Provides: logstash # Required-Start: $network $remote_fs $named $elasticsearch # Required-Stop: $network $remote_fs $named $elasticsearch # Default-Start: 2 3 4 5 # Default-Stop: […]


Install Elasticsearch 1.4 on Debian/Ubuntu

Install Java: apt-get install openjdk-7-jre openjdk-7-jre-headless Add the repository and install Elasticsearch: wget -qO – https://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add – add-apt-repository "deb http://packages.elasticsearch.org/elasticsearch/1.4/debian stable main" apt-get update apt-get install elasticsearch Edit /etc/default/elasticsearch and change ES_HEAP_SIZE to limit memory usage depending on your machine. Start Elasticsearch: /etc/init.d/elasticsearch start Configure Elasticsearch to automatically start during bootup : […]