Skip to content

Instantly share code, notes, and snippets.

View lordcirth's full-sized avatar
🏠
Working from home

Nathan Fish lordcirth

🏠
Working from home
  • University of Waterloo, CSCF
View GitHub Profile
# Pillar data to be applied to all / most LXC containers
lxc:
# 60GB
disk_warn_limit: '60000000' # Size in bytes
networking:
mgmt_iface: 'eth0'
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
@lordcirth
lordcirth / Reponse headers
Last active May 28, 2019 16:09
Ceph Dashboard
HTTP/1.1 201 Created
Content-Length: 376
Content-Encoding: gzip
Vary: Accept-Encoding
Server: CherryPy/8.9.1
Date: Tue, 28 May 2019 15:42:49 GMT
Content-Type: application/json
Authorization: Bearer: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjZXBoLWRhc2hib2FyZCIsImlhdCI6MTU1OTA1ODE2OSwidXNlcm5hbWUiOiJjc2NmLWFkbSIsImp0aSI6IjlmZmZmMGI1LWZmZmMtNGE2NC1hYmMzLTQ4NDc4YzlmZGY4OSIsImV4cCI6MTU1OTA4Njk2OX0.W2ICRl9Qbg7Vmp8keL03RSWV2yjTvXcC0k3Lmk3Ghx4
auto ens5f0.160
iface ens5f0.160 inet manual
vlan_raw_device ens5f0
mtu 9000
auto br160
iface br160 inet manual
bridge_ports ens5f0.160
bridge_maxwait 0
bridge_stp off
@lordcirth
lordcirth / jinja_density
Created July 22, 2019 17:53
Salt jinja script
#!/bin/bash
DIR=$1
DIR=${DIR:=.}
grep -crIHT '{[{%]' --exclude-dir ".git" $DIR | sort -n -t: -k2
@lordcirth
lordcirth / sls
Created July 26, 2019 20:11
onlyif
#Auth settings
postgres_pg_hba:
file.managed:
# TODO pillar
- name: '/etc/postgresql/12/test3/pg_hba.conf'
- source: 'salt://{{ tpldir }}/pg_hba.conf.jinja'
- mode: 0640
- onlyif:
- 'stat /etc/postgresql/12/test3/'
- template: jinja
@lordcirth
lordcirth / Usage
Last active September 20, 2019 14:52
gnuplot script for OSD utilization
ceph osd df class hdd -f json | jq '.nodes[].utilization' > ~/util
gnuplot util.plot < util
feh histogram.png
@lordcirth
lordcirth / error
Created November 17, 2019 22:14
building NixOS image
[bob@nixos:~]$ nix-build laptop.nix -A config.system.build.laptop --show-trace
error: while evaluating anonymous function at /home/bob/nixpkgs/nixos/lib/make-disk-image.nix:1:1, called from /home/bob/laptop.nix:5:32:
value is a function while a set was expected
@lordcirth
lordcirth / build_instructions.sh
Last active November 21, 2019 15:58
NixOS image build
# Everything is as non-root user
# Install Nix:
# https://nixos.org/nix/
# (Alternatively a NixOS VM using https://nixos.org/nixos/download.html )
sudo apt install libvirt-bin
# Requires new login shell
sudo usermod -a -G kvm $USER
@lordcirth
lordcirth / haproxy_init.sls
Last active February 4, 2020 17:17
certbot onchanges_in problem
include:
- certbot
certbot_haproxy_hook:
file.managed:
- name: '/etc/letsencrypt/renewal-hooks/deploy/haproxy.hook'
- source: 'salt://{{ tpldir }}/haproxy.hook.jinja'
- template: jinja
- makedirs: True
- mode: 0755