Author: Josh
-
MySQL – Restore a single table from a mysqldump file.
A frequent task when working with MySQL is to restore a single table from a backup. This is typically an exercise where the admin must restore a full database to another MySQL instance and then export only the table in question. This is a great way to do it most of the time. Another option…
-
Running Apache 2 under Ubuntu 16.04 on Docker
I recently wanted to setup a new Ubuntu 16.04 host running Apache under Docker for some AWS ECS/Fargate testing I was doing and encountered the following error: docker run -p 8085:80 aws-ecr-hello-world:v0.5 [Thu Mar 15 00:11:31.074011 2018] [core:warn] [pid 1] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined [Thu Mar 15 00:11:31.074576 2018] [core:warn] [pid 1]…
-
AWS RDS – Aurora Grant Corruption
When making changes to users or grants and the changes don’t appear to take effect, be sure to check any warnings that result from these changes. mysql> flush privileges; Query OK, 0 rows affected, 4 warnings (0.24 sec) mysql> show warnings; +———+——+————————————-+ | Level | Code | Message | +———+——+————————————-+ | Warning | 1292 |…
-
The Phoenix Project
I recently stumbled upon a novel that talks about managing IT Operations. “The Phoenix Project”, by Gene Kim, Kevin Behr, and George Spafford. Wow, what a great read. This book accurately describes many of my experiences in IT with many different companies. This book has some exceptional concepts around optimizing interaction between Development, IT Operations,…
-
Powershell to ElasticSearch to find ElastAlert
I recently worked on an interesting project where I needed to use a powershell script to query ElasticSearch to find a document that was inserted via ElastAlert. The purpose of this exercise was to determine whether or not a service had been marked down recently, which would determine whether an operation ran that might take…
-
ruby aws-sdk strikes again…
When using ruby to upload files to S3 and trying to use multipart upload, beware the following ArgumentError: …param_validator.rb:32:in `validate!’: unexpected value at params[:server_side_encryption] (ArgumentError) … from /var/lib/jenkins/.gem/ruby/gems/aws-sdk-core-3.6.0/lib/seahorse/client/request.rb:70:in `send_request’ from /var/lib/jenkins/.gem/ruby/gems/aws-sdk-s3-1.4.0/lib/aws-sdk-s3/client.rb:3980:in `list_parts’ … The options passed to list_parts must not include “server_side_encryption”. I always forget to remove this parameter. A good way that I have…
-
Logging haproxy via rsyslog…
Simple haproxy logging setup: # /etc/rsyslog.d/haproxy.conf $ModLoad imudp $UDPServerRun 514 $template Haproxy,”%msg%\n” local2.=info -/var/log/haproxy.log;Haproxy local2.notice -/var/log/haproxy-status.log;Haproxy ### keep logs in localhost ## local2.* ~ Don’t forget to rotate the logs: # /etc/logrotate.d/haproxy /var/log/haproxy.log /var/log/haproxy-status.log { daily rotate 10 missingok notifempty compress sharedscripts postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true /bin/kill -HUP…
-
Puppet deprecation in stdlib module…
As part of the long upgrade to become fully compatible with puppet 4 and drop puppet 3 support — version 4.13+ of the stdlib module introduced some breaking changes for other modules that I use. I recently upgrade some individual modules using the ‘puppet module upgrade’ method. Upon upgrading, I received the following message: Error:…
-
Jenkins Script Console: List installed plugins…
The Jenkins script console can be used to list all installed plugins and their versions fairly easily: Jenkins.instance.pluginManager.plugins.each{ plugin -> println (“${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()}”) } This can then be used to provision a new node or migrate to a new environment and have the destination Jenkins instance ready to go.
-
docker run docs confusing – which port?
I was reviewing the docker docs today in an attempt to get things working on OSX and ran into a conflict when starting a new container running nginx. The docs say to run the following command: > docker run -d -p 80:80 –name webserver nginx That seems pretty straight forward, so I ran the command:…