Ubuntu


Adding Additional Nameservers to resolv.conf on Linux


Resolv.conf

If you need to add additional nameservers to your resolv.conf because of DNS related issues, you'll want to use a package that manages the file at /etc/resolv.conf. This is because on system restart, the file will be overwritten by other processes and you will lose any previous changes.

Install and Enable Resolvconf Package

sudo apt update
sudo apt install resolvconf

Check if it is running

sudo systemctl status resolvconf
```...

Read Blog Post


Rotating Logs on Ubuntu


Rotating Logs

If your logs ever start becoming too large to manage, a good way to rotate them is by using logrotate on Ubuntu.

Install logrotate:

sudo apt install logrotate

Then create a file named after what your project is:

sudo vim /etc/logrotate.d/portfolio

You can rotate logs based off of file size or time intervals.

/path/to/logs/www/portfolio/shared/log/*.log {
  size=200M
  missingok
  rotate 12
  compress
  delay...

Read Blog Post


Compressing Files


Tar

-c     Create a new archive containing the specified items.
-r     Like -c, but new entries are appended to the archive.  Note that this only works on uncompressed archives stored in regular files.  The -f option is required.
-t     List archive contents to stdout.
-u     Like -r, but new entries are added only if they have a modification date newer than the corresponding entry in the archive.  Note that this only works on uncompressed archives stored in regular files....

Read Blog Post


Ubuntu 18.04 Nginx, Passenger, Puma, Rails


Install RVM

We should install a version manager to keep our ruby versions and gems.

sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.5.1
rvm use 2.5.1 --default
ruby -v

Swap File

You should create a swap f...


Read Blog Post


Installing Pi Hole Ubuntu 16.04


Pi Hole is an ad blocking service that uses your server as a DNS to filter out known ad sites and can even filter out pornographic and malicious sites.

Update System

Let's update and upgrade our packages.

sudo apt-get update && sudo apt-get upgrade -y

Install Git

We will need to install git in order to download the Pi Hole repository.

sudo apt-get install git

Establish an Internal Static IP

Because your internal IP address can ...


Read Blog Post


Ubuntu 16.04 Nginx Rails Phusion Server with RVM


Create Swap File

sudo fallocate -l 3G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
free -h
sudo cp /etc/fstab /etc/fstab.bak;
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo apt-get update

Install RVM

sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2B...

Read Blog Post


Rails Server With Nginx and Puma Ubuntu 14.04 LTS


Part 1 - Setting up Ruby/Rails

Installing rbenv

We will use rbenv to be our Ruby version control. Let's update our app and then get the dependencies we need for our server.

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

Once we have those dependencies, let's install rbenv.

``...


Read Blog Post


How to Setup a Ubuntu AWS Rails Server


AWS can be a very confusing system to work with, if you don't know much about it. I have researched many guides and manuals online, and never found one that had everything you needed, and didn't make you spend hours searching Google for commands and answers that none of these guides had. This is why I wanted to write a guide on this subject. I have put everything you will ever need to setup an AWS Rails Server here. In this guide, I will show you how to set up the following items:

  • Route ...

Read Blog Post