Skip to content

Instantly share code, notes, and snippets.

View chicks-net's full-sized avatar
🏠
Working from home

Christopher Hicks chicks-net

🏠
Working from home
View GitHub Profile
@chicks-net
chicks-net / check_pipenv.py
Created May 20, 2019 20:52
Verify that a pipenv works
#!/usr/bin/env python3
"""
Verify that a pipenv works with all of the top-level packages defined in it.
Invocation: python3 check_pipenv.py DIRNAME
It will go to DIRNAME, look for a Pipfile and a .venv and proceed to test
all of the non-development dependancies.
"""
@chicks-net
chicks-net / Makefile
Created April 19, 2019 22:16
Makefile for pipenv requirements.txt generation
requirements.txt: Pipfile
pipenv lock -r > requirements.txt
@chicks-net
chicks-net / netbox_step3.md
Last active November 30, 2018 06:08
dealing with netbox installation step 3 on centos 7
#!/usr/bin/env ruby
# define hash
hash = {
"k1" => "v1",
"k2" => ["v2","v3","v4"],
"k3" => ["v5"],
}
puts hash
@chicks-net
chicks-net / health_check_best_practices.md
Last active January 11, 2018 17:27
Health Check Best Practices

Health Check Best Practices

This is assumed to be in a webapp/SaaS context where there is plenty of http/https traffic already.

  • Do as little work in your health check as possible. It is like a CPU interrupt in that way.

  • Respond with an http status of 200 if all is well. Respond with 500 if there is a failure.

  • Optionally also include JSON in your response.

      {
    

"status": "green",

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by gnuplot configure 5.0.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --with-lua=yes
## --------- ##
## Platform. ##
@chicks-net
chicks-net / aws_net_download.md
Last active August 29, 2015 14:16
AWS networking goodness

AWS Networking: Downloads

Ubuntu 14LTS, Linux 3.13

  • Linux serv01 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  • Linux serv03 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
instance size scenario in bw in pps out bw out pps hostname Average Queue Size Disk Read kBps Disk Write kBps
c3.4xlarge 2 centos downloads 35917 KBps 24530 225 KBps 3837 serv01 43207 11 33282
@chicks-net
chicks-net / ansible_happy.txt
Created February 15, 2015 05:45
happy output
chicks@silver 21:35:18 fini-ansible !693 $ ansible-playbook home-chicks.yml -i hosts -e servername=c64.chicks.net
PLAY [c64.chicks.net] *********************************************************
GATHERING FACTS ***************************************************************
ok: [c64.chicks.net]
TASK: [homes | install deb's needed by users] *********************************
skipping: [c64.chicks.net]
my $telnet = Net::Telnet::Cisco->new($Host =>$ip)
my $cmd = "show tech-support";
my $matchop = qr/(?mx:^% Unknown VPN
|^%IP routing table VRF.* does not exist. Create first$
|^%No CEF interface information
|^%No matching route to delete$
|^%Not all config may be removed and may reappear after reactivating
|^% ?This CLI is deprecated
)/;
function vim {
if [[ $# -eq 0 ]]; then
/usr/bin/vim -u $HOME/.vimrc_noargs
else
/usr/bin/vim "$@"
fi
}