Andrew Latham

When using Linux and maybe some other systems there are reserved key combinations and other interfaces that let you interact with the kernel directly. Read more at https://en.wikipedia.org/wiki/Magic_SysRq_key

Examples

Reboot

ALT + SysRq + b

Shutdown

ALT + SysRq + o

Forcing Reboot

echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger

Force Shutdown

echo 1 > /proc/sys/kernel/sysrq
echo o > /proc/sysrq-trigger
Andrew Latham

Devops without the extra parts

You want to deploy code onto a server into a certain directory. You have SSH to the server and it has Git installed. Your desired destination is /home/user/public_html/production/

Python Testing

Testing is not hard, don't make it hard.

Andrew Latham

Working on https://github.com/lathama/Adynaton I have setup some testing that runs every time and I want to talk about it. I have worked on software in industries that could benefit from testing, coverage and style checks but the organizational impact causes testing to be a pretty harsh hurdle. Some amazing work has gone into bypassing testing in many industries. Here in this post I am discussing some testing, coverage and style checks that lower the bar and make it easy to use. The testing does not stop the operation or development. The code coverage report is useful. The style check is more of an indicator than anything else. This is a discussion and a process. Enable everyone from support to operations with that warm fuzzy feeling that testing is the new norm. Show the developers that testing is not a blocker.

Andrew Latham

I often reach back to http://camendesign.com/web-dev/website_optimisation_measures when discussing issues people have in their personal or business website. Too often I see local businesses like a restaurant with no information at all or hidden away as text on an image.

A restaurant should have at minimum the following information as text on the web page.

  • Name of the restaurant
  • Address including the City, State, Country
  • Hours of Operation aka when they are normally open and normally closed. We all know holidays and or emergencies happen.
  • Description of food style
  • Phone number or contact form to seek more information.

Optionally maybe:

  • Menu as text
  • Photo of storefront
  • Parking information
Andrew Latham
  1. Name servers have glue records setup via the registrar
  2. Base domain (@) and www point to the same IP(s)
  3. mail.example.com, nameservers.example.com return all the mail and name servers respectively
  4. SOA email address works and is read by a human daily
  5. Name servers are on more than one subnet
  6. SOA serial is not date based
  7. Wildcard and or Generated answers for undefined PTR records
  8. Registrar offers API to update glue records for mitigating DDOS
  9. Documentation is easy to find
  10. Disaster recovery is tested on a schedule
Andrew Latham

Example from a local ansible source tree without using any install to run adhoc commands

Assume key works

./bin/ansible all -i 192.168.15.11, -a "uname -a"
192.168.15.11 | SUCCESS | rc=0 >>
Linux nodeone 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux

Set key

 ./bin/ansible all -i 192.168.15.11, -a "uname -a" --private-key=~/.ssh/id_rsa
192.168.15.11 | SUCCESS | rc=0 >>
Linux nodeone 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux

whoami

./bin/ansible all -i 192.168.15.11, -a "whoami" --private-key=~/.ssh/id_rsa
192.168.15.11 | SUCCESS | rc=0 >>
lathama

become root via su

./bin/ansible all -i 192.168.15.11, --private-key=~/.ssh/id_rsa -b --become-method=su -K -a "whoami"
SU password: 
192.168.15.11 | SUCCESS | rc=0 >>
root