Author Archives: Andrew Wells

About Andrew Wells

I have been developing on the LAMP stack since about 2006. I run Ubuntu XFCE on my desktop and have a history of managing Ubuntu and CentOS servers. I code web applications mostly in PHP but have experience with other languages as well. When I'm not working, I can be found working in my home lab or out snowboarding, hiking, camping, or biking depending on the season.

Sanitize Docker Environment

I have a few docker hosts used for development, and sometimes I need to clean out all images/containers/network groups and start from scratch. These commands do just that. Obviously don’t run these on any machines w/ persistent data. Use with caution!

Linux Hosts (no Docker GUI)

Relatively safe cleanup – these commands remove dangling images/volumes that are likely no longer used and just taking up space.

#[root]$ docker system prune -f
#[root]$ docker rmi $(docker images -f "dangling=true" -q)
#[root]$ docker volume rm $(docker volume ls -q -f dangling=true)

More destructive,

#[root]$ docker kill $(docker ps -a -q)
#[root]$ docker rm $(docker ps -a -q)
#[root]$ docker rmi $(docker images -q) -f

MacOS Hosts (Docker GUI)

I’ve had times where the Docker image completely fills up, and cleaning up images to not free up space. So it’s just easier to delete the Virtualbox image and restart Docker.

Delete the Docker VM disk file:

[user]$ rm -f ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2

Restart Docker using the Docker GUI.

Gitlab EE/CE with Runners and Docker Registry on Ubuntu 16.04

Where do you store your code projects – Github? What about private projects…do you pay for private repos? You can have more control over your projects and even configure automated tests and builds – all using open source software! Fire up your spare hypervisor and read on to learn how to build your own dev project host!

Continue reading

Nagios 4.x Install from Source on Ubuntu 14.04

I am just starting to upgrade / install Ubuntu 14.04 on my servers, so it’s time to create a guide to install Nagios 4 on Ubuntu 14.04. Apparently Nagios Core install scripts wern’t well tested for Debian systems. But in any case, it can be installed with a couple modifications.

This guide is going to be very similar to my other Nagios install guides.

Continue reading

Offline Migration of KVM Guests

It’s time to enter into summer mode with my lab. By that I mean that it’s time to move important KVM guests off of the HP G5 server and shut that space heater down. Here are my notes with moving guests. If you are looking to move guests from a CentOS to Ubuntu hypervisor, I encourage you to read over my findings. You could also reverse-engineer the article if you are going from Ubuntu to CentOS as well.

Continue reading

iftop

Format Correctly in Windows Putty Session

[root]$ NCURSES_NO_UTF8_ACS=1 iftop -i eth0

Config File Examples

Edit the config file on Ubuntu (and probably Debian) boxes:

[user]$ vim ~/.config/htop/htoprc

Edit the file on CentOS (and probably RHEL) boxes:

[user]$ vim ~/.htoprc

Config for 8-Core Boxes

# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=46
sort_direction=1
hide_threads=0
hide_kernel_threads=1
hide_userland_threads=0
shadow_other_users=0
show_thread_names=0
highlight_base_name=0
highlight_megabytes=1
highlight_threads=0
tree_view=0
header_margin=1
detailed_cpu_time=0
cpu_count_from_zero=0
update_process_names=0
color_scheme=0
delay=15
left_meters=CPU AllCPUs2 Memory Swap
left_meter_modes=1 1 1 1
right_meters=Hostname Tasks LoadAverage Uptime Clock Battery
right_meter_modes=2 2 2 2 2 2