Git ignore

I recommend adding this .gitignore file as soon as you create a new Git repository:

Octocat’s .gitignore:┬áSome common .gitignore configurations

As you might know, Git has a pretty complex ignore system, especially if you want to start ignoring files that are already in the repo. Adding this .gitignore file to your repo immediately after you create it might save you some headaches down the line.

Setting up swap space on a Linux server

Recently, I set up an EC2 host. It was a smooth and relatively quick process.

However, the problem with the default image is that it doesn’t come with swap space. You can verify this by running:

swapon -s

I found this tutorial online that walks you through creating a swap file, setting it up, and using it as your swap space:

All About Linux Swap Space

That post doesn’t mention it, so I’ll say it here: you need to use sudo in front of each of those commands. Another┬áthing missing from that tutorial is that as I was setting this up, the shell gave me this warning:

$ sudo swapon /swapfile
swapon: /swapfile: insecure permissions 0644, 0600 suggested.

So, I had to do this:

$ sudo chmod 0600 /swapfile

At the very end, you can check whether you were successful using the swapon -s command:

$ swapon -s
Filename Type Size Used Priority
/swapfile file 1048572 0 -1