Category: “Linux”

How to Build an App Part 1 of 3: Setting up the Development Server with Vagrant, Ubuntu and Salt (Mac OS X Version)

Using Windows? Click here to view the Windows version of this walk-through.

After my previous post, Android Development for Beginners: 6 Steps to Building Your First App, I received some requests asking me to explain in more detail how to build an app, step-by-step. If you have any experience buildings apps you will know that it can be a complicated process and there are a number of different components that need to work together to have a fully functioning app. This includes creating a database, a REST API and the app front end.

Continue reading this article…

How to Build an App Part 1 of 3: Setting up the Development Server with Vagrant, Ubuntu and Salt

Using a Mac? Click here to view the Mac OS X version of this walk-through.

After my previous post, Android Development for Beginners: 6 Steps to Building Your First App, I received some requests asking me to explain in more detail how to build an app, step-by-step. If you have any experience buildings apps you will know that it can be a complicated process and there are a number of different components that need to work together to have a fully functioning app. This includes creating a database, a REST API and the app front end.

Continue reading this article…

How to completely uninstall MariaDB from a Debian 7 server

There are many guides about how to install and configure popular applications on Linux servers, but not much on how to remove them.

I found this out when I needed to install a MariaDB Galera cluster on a server which already had a stand-alone MariaDB server installed. Having the older version of MariaDB installed (and the older repository in the source list) meant all of the guides I was following didn’t work due to conflicting packages.

This guide will explain how to completely remove MariaDB from your system (including any databases). Continue reading this article…

Low cost backup solution for linux using Dropbox and a shell script

In this guide I will explain how to create a backup solution for your Linux server using a basic shell script and Dropbox. It’s good for text files but not so good for bigger media files such as audio and video.

It works as follows:

  • We install Dropbox on our server
  • Then we create a shell script that will copy all the directories you want to backup to a temp directory
  • An finally we compress that temp directory into our Dropbox folder and remove the temp files

I use this method to backup all my Git repositories, MySQL databases, project source code and my server configuration files. A free Dropbox account gives you 2GB of storage, which should be enough for some compressed text files as well as a couple of databases.

Continue reading this article…

How to change the hostname of a Linux server

This post describes how to change a hostname on a Debian 7 Linux server, however it will work on most other Linux distributions too.

Switch to root

sudo -i

Change the /etc/hostname file

echo 'new.host.name' > /etc/hostname

Restart the hostname service

/etc/init.d/hostname.sh start

That’s it. The host name is now updated.

How to add an SSH public key to your Linux user account

Click here for the quick copy-paste option

Hi there, this is something that helps me out frequently so I wanted to share it with the community.

If you are at all security conscious, you will want to use public/private key authentication, instead of regular passwords, when authenticating to your servers.

This short guide will explain, quite simply, how to add your SSH private key to your server, so you can authenticate with your public key. This guide assumes you already have your public key to hand. I am using Debian 7, however it will work with many other popular distributions of Linux such as CentOS and Ubuntu.

1. Login to your server, and change to your home directory.


cd ~

2. Create a new folder called .ssh.


mkdir .ssh

3. Set the permissions on .ssh to 700.


chmod 700 .ssh

4. Change into that directory.


cd .ssh

5. Create a new file called authorized_keys.


touch authorized_keys

6. Set the permissions to 600 (many applications including OpenSSH will reject your key by default, if it’s accessible by other users).


chmod 600 authorized_keys

7. Open the file with a text editor (I use vi), and paste your keys in.


vi authorized_keys

That’s it. Now disable password authentication in SSH to improve the security of your box.

Thanks for reading.

Here are all the commands together in-case you are want a quick copy and paste job:


cd ~
mkdir .ssh
chmod 700 .ssh
cd .ssh
touch authorized_keys
chmod 600 authorized_keys
vi authorized_keys