Skip to content

Instantly share code, notes, and snippets.

View kondor6c's full-sized avatar

Kevin Faulkner kondor6c

View GitHub Profile
@kondor6c
kondor6c / gist:950f614242be026d8bdecaf317dca102
Created September 22, 2017 13:04
This would be for friday
{
"SpotPrice": "0.0589",
"TargetCapacity": 20,
"IamFleetRole": "
"LaunchSpecifications": [
{
"ImageId": "ami-61272c1a",
"SecurityGroups": [
{
"GroupId": "sg-d5d1cfbf"
@kondor6c
kondor6c / .screen.rc
Last active September 30, 2017 16:03
# Screen/Tmux commands:
# | default | Function | Tmux |
# |----------|:------------------------------------:| -----------------------:|
# | ^A " | window list, where am I | ^b s |
# | ^A A | Rename | ^b , |
# | ^A c | create | ^b n |
# | ^A k | kill | ^b & |
# | ^A d | detach | ^b D |
# | ^A space | next window | ^b n |
# | ^A p | previous window | ^b p |
@kondor6c
kondor6c / terra-py.py
Created April 6, 2018 12:58 — forked from garyellis/terra-py.py
POC of basic python terraform wrapper scripting
#!/usr/bin/env python
import sh
from sh import terraform, Command
go_getter = Command("go-getter")
from sh import ErrorReturnCode
import yaml
import logging
import re
import os
@kondor6c
kondor6c / secrets_env.py
Created April 12, 2018 22:16 — forked from garyellis/secrets_env.py
POC decrypting gpg files into a temporary shell environment context
#!/usr/bin/env python
import gnupg
# from dotenv import dotenv_values
import sh
import shlex
import os
from pprint import pprint
@kondor6c
kondor6c / ugly
Created May 16, 2018 02:28
don't judge, just showing over-use of arg parse
#!/usr/bin/env python3
# TODO: add OSType() features
# influenced by: /usr/share/doc/libvirt-python/examples/domipaddrs.py
# http://muzso.hu/2010/10/29/python-script-to-list-libvirt-domains-with-their-descriptions
# {'vnet1': {'hwaddr': '52:54:00:01:7f:3f', 'addrs': [{'prefix': 24, 'type': 0, 'addr': '192.168.122.168'}]}}
# name, value {'hwaddr': '52:54:00:01:7f:3f', 'addrs': [{'prefix': 24, 'type': 0, 'addr': '192.168.122.168'}]}
#
import libvirt
import argparse
import json
@kondor6c
kondor6c / ipv4_ipv6
Last active May 29, 2018 00:22
need to add ipv6
Netmask Netmask (binary) CIDR Notes
_____________________________________________________________________________
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single addr)
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
255.255.255.240 11111111.11111111.11111111.11110000 /28 14 useable
255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable
255.255.255.192 11111111.11111111.11111111.11000000 /26 62 useable
255.255.255.128 11111111.11111111.11111111.10000000 /25 126 useable
-----BEGIN CERTIFICATE-----
MIICXjCCAgSgAwIBAgIJAK/1fDyA5yWzMAoGCCqGSM49BAMCMIGJMQswCQYDVQQG
EwJVUzELMAkGA1UECAwCTkMxDTALBgNVBAcMBE5vbmUxETAPBgNVBAoMCExhenlU
cmVlMRAwDgYDVQQLDAdIb21lTGFiMRQwEgYDVQQDDAtsYXp5dHJlZS51czEjMCEG
CSqGSIb3DQEJARYUa29uZG9yNmNAbGF6eXRyZWUudXMwHhcNMTgwNDA5MDQzODM3
WhcNMjQwNDA4MDQzODM3WjCBiTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5DMQ0w
CwYDVQQHDAROb25lMREwDwYDVQQKDAhMYXp5VHJlZTEQMA4GA1UECwwHSG9tZUxh
YjEUMBIGA1UEAwwLbGF6eXRyZWUudXMxIzAhBgkqhkiG9w0BCQEWFGtvbmRvcjZj
QGxhenl0cmVlLnVzMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXcuj9TBmjieO
cYqzCuv/ub88YE+AK4cmDOsIVFDL+lPsx2t0HEC1Q8+VoRB3BnvC5vsN2nTVeG7Q
# TMUX
# | default | Function | Tmux |
# |----------|:------------------------------------:| -----------------------:|
# | ^A " | window list, where am I | ^b s |
# | ^A A | Rename | ^b , |
# | ^A c | create | ^b n |
# | ^A k | kill | ^b & |
# | ^A d | detach | ^b D |
# | ^A space | next window | ^b n |
# | ^A p | previous window | ^b p |
@kondor6c
kondor6c / bashrc-2018-06-04
Created June 4, 2018 15:17
I tried to create a function "helpy" which holds a table of frequently accessed information in the top 26 lines of a file, I really haven't used that idea much I think it could work/help though.
# ~/.bashrc: executed by bash(1) for non-login shells.
# | order | file | Note |
# |---------|:-------------------:|-------------------------------------------|
# | && | AND upon successful exit (0) will execute next command |
# | || | OR upon failure exit (non-zero) will execute next command |
# | for loop| for x in {1..9}; do echo "$(cat ${x})" ; done |
# | while | while : ; do ls -l ./file/to/watch ; done |
# | if | if [[ $(grep "ok") =~ $(curl web/status) ]]; then print ok ; fi |
# | elif | if [[ $? == '0' ]] then ; elif [[ $? >= '1' ]] ; else ; fi |
# | IFS | internal field seperator: IFS=, grep 'value' -B2 /tmp/file.csv |
[user]
name = Kevin Faulkner
email = [email protected]
signingkey = C5D5F4BED24A4A02
[gpg]
program = gpg2
[color]
diff = auto
status = auto
branch = auto