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)
#[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.
I use phpMyAdmin a lot for LAMP development. The default login timeout is something like 30 minutes. Here is how to increase that.
XFCE has been my desktop of choice for some time now, but I still use some Gnome apps, like gedit. It seems to have developed some quarks though when installed in an XFCE environment. The terminal color scheme is one of them. Here is how to fix it.
I recently purchased a Lenovo Y510p for a mobile KVM lab, and regrettably, did not check the device’s Linux support first. I had CentOS 6 running on a T420s without a problem, so I figured it wouldn’t be an issue. Shame on me for assuming. Anyways, I was able to create a working desktop, but missing a few critical functions to make it a daily working machine.
Ubuntu likes to cut space on my
/boot partitions awfully close when using their auto-partition method at install time. I had an apt update fail once because of a full
/boot partition and have been keeping an eye on them since. They frequently fill past 80%, so I clean out the old kernels when this happens. There is probably more of an automated way to do it, but this works for now.
This bash one-liner will let you watch the tail end of a log file in real time.
I find myself keeping an eye on the Apache log when testing Linux deployments. This helps me see what the clients are requesting, whether the preseed file was fetched, etc. After writing this tip, I had this epiphany that this could be used for any log file. Just swap out
/var/log/apache2/access.log with your file of choice.
Ubuntu names the volume group according to the hostname of the computer, but sometimes I want to change it after the fact, and doing so is pretty easy.
Since writing this procedure, I did run into a reason why unique volume groups could be useful. I had a system crash, which required me to take the HDD and connect it into a working system. Both machines used the VG name of “system”, so this caused a conflict with mounting both VGs. In this case, I had to rename one of them to perform my data recovery.
When moving existing WordPress installs around, you may find that the site becomes inaccessible because the site URL is contained in the database table,
wp_options to be exact. In order to make this site accessible, the site URL option needs to be changed. Where can that be changed? From the admin center. On the website. Yeah, it’s a catch 22. But, there are several alternative ways to change this option, even if your blog is not accessible.