Skip to content

Instantly share code, notes, and snippets.

View Kahn's full-sized avatar

Sam Wilson Kahn

View GitHub Profile
@Kahn
Kahn / gist:6435303
Last active December 22, 2015 06:59
Ansible MySQL database setup
# config
/etc/ansible/host_vars/dbserver
---
dbs_inst: ['testdb1', 'testdb2']
dbs:
- { name: 'testdb1', password: 'password1', priv: 'testdb1.*:ALL' }
- { name: 'testdb2', password: 'password2', priv: 'testdb2.*:SELECT' }
/etc/ansible/roles/mysql/tasks/main.yml
/etc/ansible/host_vars/192.168.0.1
---
site: testsite
realm: testrealm
/etc/ansible/roles/rancid/tasks/main.yml
...
- name: Update rancid monitored device config
template: src=${site}-${realm}-{{ item + ".db.j2"}} dest=/var/rancid/${site}-${realm}-{{ item }}/router.db
with_items:
@Kahn
Kahn / hostvars
Last active October 18, 2017 14:19
Working jinja template using Ansible hostvars
{% for host in groups['switches'] %}
define host {
use generic-switch
host_name {{ host }}
alias {{ hostvars[host]['label'] }}
address {{ host }}
hostgroups SWITCHES
contact_groups networkadmins
}
@Kahn
Kahn / create_dev_server
Created March 24, 2014 01:42
ansible-vsphere_guest playbook
# Note: vcenter_username and vcenter_password are contained in a ansible-vault file create_dev_server-vault.yml
- hosts: 127.0.0.1
connection: local
user: username
sudo: false
gather_facts: false
serial: 1
vars_files:
vyos@au02:~$ whois example.fr
%% _ _
%% This is the AFNIC Whois server. _ | |___ ____ _(_)___
%% | || / -_) (_-< || | (_-<
%% complete date format : DD/MM/YYYY \__/\___| /__/\_,_|_/__/
%% short date format : DD/MM ___ _ _ ___ ___ _ _ ___
%% version : FRNIC-2.5 | _| | | . | . \| | | | __|
%% | |_| | | /| |_| | _|
%% Rights restricted by copyright. |___|_|_|_|_|_\_\|___|_|___|
%% See http://www.afnic.fr/afnic/web/mentions-legales-whois_en

Keybase proof

I hereby claim:

  • I am kahn on github.
  • I am swilson (https://keybase.io/swilson) on keybase.
  • I have a public key ASDP4Gt6-YBtDziH10mzgnMbrKbx7nQOYVYGZYDD3aapygo

To claim this, I am signing this object:

# This file was auto-generated by /opt/vyatta/sbin/dhcpv6-pd-client.pl
# configuration sub-system. Do not edit it.
interface pppoe0 {
#send ia-na 0;
request domain-name-servers, domain-name;
send ia-pd 0;
script "/opt/vyatta/sbin/ubnt-dhcp6c-script";
};
STCA, MTCA, MSAW, DAIW, RAM, CLAM, SAR, MPR, ETO
STCA: Short Term Conflict Alert
It is displayed when a minimum separation distance between a pair of surveillance tracks is, or is predicted to be
violated within a short look ahead time typically 2 minutes.
MTCA: Medium Term Conflict Alert
It is displayed when a potential conflict between AC exists within a 20 minute look-ahead time period, based on
@Kahn
Kahn / gist:b98ddf722d82d5e91b9388df660a1657
Created September 29, 2021 09:06
VATPAC oceanic reporter
<!--
=========================================================
* Now UI Design System PRO - v2.1.0
=========================================================
* Product Page: https://www.creative-tim.com/product/now-ui-design-system-pro
* Copyright 2021 Creative Tim (https://www.creative-tim.com)
Coded by www.creative-tim.com
@Kahn
Kahn / gist:01dfa3ea73a4362481768975a09a5987
Created August 1, 2024 13:44
Quick number system parser to block Symbio networks
Following on from the nice work at https://gist.github.com/wtfiwtz/317a075c6a4d60ef62944245557c79ad using Number Shield app on iOS
I'm super tired and I am sure there is a regex way to make this work but in the meantime here is the dumb way with python
Run `./python.exe file.py` after downloading the full ZIP from https://www.thenumberingsystem.com.au/#!/number-register/search
---
import csv
import re