My work frequently involves using remote, ephemeral, containers to run scripts/code/whatever for DevOps type automation. Typically these containers are running some flavor of Linux. My work also frequently involves designing these automations for Azure and using Terraform for IaC. On occasion though, I find the need to drop out of “declarative” mode and utilize scripted […]
This lovely item came across my feed today and I realized there is so much that I do poorly when it comes to shell scripting it is absurd 🙁 https://dev.to/thiht/shell-scripts-matter Anyhow I am extremely thankful for this long and detailed post and wanted to pass it along to my readership. I also wanted to crowd-source […]
A lot of my bash scripting experience has been, in one sense, relatively simple. I have several scripts that span several hundred lines and do fairly complex things across multiple systems. From that perspective they aren’t necessarily simple. However it wasn’t until recently that I had to really starting thinking about managing when scripts run […]
I am working on a project where I need to generate a random value and assign it to a variable… Initially I was doing this: var=$(date +%s | sha512sum | base64 | head -c 12 ; echo) Which was okay until I started executing my script more than once in a short period of time. […]
If you run a custom theme for your Owncloud distribution, one of the things you know is that whenever you run an update of your Owncloud server it will automatically disable your theme as part of the update process. This is to keep things from blowing up in the event you have made a modification […]
I came across a real life-saver today… All of my backup scripts are based on using RSYNC. This is because I am used to working between linux systems on which I always have root/sudo access and also have SSH. However I was recently tasked with a “fun” project that involved me needing to script the […]
One of the things I wanted to get from my OpenVPN Access Server was a usage report that would be emailed to me regularly. OpenVPN Access Server writes such logs to a file in /var/log on Ubuntu and Debian based systems. However it also writes a lot of other things. So I first started by […]
I wrote a new script today to keep me up-to-date on how full the boot partition is on my Ubuntu servers. I actually administer quite a few of them and it can become a real issue if the boot drive hits 100% full, which it commonly does. The reason for this is that the boot […]
This is the final article (I think…) on MySQL database backup. In my previous article I discussed how to craft a very efficient script for automated LOCAL backup of your MySQL databases. But that isn’t the whole story. What happens if your server burns to the ground… or more likely the hard drive gives up […]
You have two servers that both run linux. An origin server and a target server. You want to open up an SSH connection as the root user from the origin server to the root user account on the target server. Furthermore, you do not want to be prompted for a password but you still want […]
Earlier this year I wrote an article about creating scripts for backing up your MySQL databases. A week ago I wrote another article about automated and secure root user login to your root MySQL database account. I have also been learning Python on and off and learning quite a bit about variables and loops. While […]
Do you work with MySQL? I do… quite a bit. Do you often script stuff on your server to make your life easier? I do that as well… quite a bit… Are you including your database user account and password (or worse… your mysql instance root user account and password!) in plain-text in your script… […]
I have setup a few servers with Ubuntu Server and one of the common security tools I use is Fail2Ban. One of the common requirements that comes with Fail2Ban is the need to provide other administrative personnel with a place they can quickly check which IP’s have been banned. Using a cool program called incron […]
As I am now hosting about 8 different sites I was wanting to make restoring from backups a bit easier and less manual. The ultimate goal is to login to my second server and have it up and running with as few key-strokes as possible. Scripting was the answer. It took me several hours of […]
If you aren’t familiar with Owncloud, it is a very cool open-source software package that runs on Linux Apache (or Nginx) that provides “dropbox like” functionality that you can host yourself. This is a big deal for the tech-savvy average-Joe that is worried about keeping private data private (i.e. he doesn’t want all of his […]