Skip to content

Instantly share code, notes, and snippets.

Avatar

Randy Syring rsyring

View GitHub Profile
@rsyring
rsyring / fstab
Last active Dec 26, 2019
zfs on linux notes
View fstab
# <device> <dir> <type> <options> <dump> <fsck>
PARTLABEL=boot /boot ext4 defaults,nodev,relatime 0 1
PARTLABEL=samd-efi /boot/efi vfat defaults,nodev,relatime 0 2
@rsyring
rsyring / recipe.md
Last active Feb 12, 2021
Randy's Italian Sandwich Recipe
View recipe.md

Bread: Ciabatta bread, split in half, or good Italian bread

On both halves of the sandwich:

  • provolone
  • oregano
  • 1-2 slices smoked ham (not sweet)
  • 2 slices salami (or enough to cover the ham, depends on how big and thick the salami is)
  • pepperoni to cover salami (we like smaller pepperoni, like for pizza, because the edges crisp easier)
  • red onion
@rsyring
rsyring / events.py
Last active Jun 8, 2018
Streaming salt-api events using python requests
View events.py
import requests
import arrow
session = requests.Session()
resp = session.post(
'http://172.18.0.3:8765/login',
json={
'username': 'tang-api',
'password': 'notsecure',
'eauth': 'pam',
@rsyring
rsyring / loadit.py
Created Mar 22, 2018
Script for initializing virtualenvs from app's that have wheelhouses
View loadit.py
#!/usr/bin/env python3
#PROJ_PATH=$(git rev-parse --show-toplevel)
#PROJ=${PROJ_PATH##*/}
#rmvirtualenv $PROJ
#vex -m $PROJ pip install "git+https://github.com/level12/wheelhouse#egg=Wheelhouse"
#vex $PROJ wheelhouse install -- -r requirements/dev-env.txt
#vex $PROJ pip install -e .
#vex -r $PROJ
@rsyring
rsyring / example.js
Created Nov 20, 2017
Mithril Contacts
View example.js
function Contacts(vn) {
let contacts = [
{name: 'Fred', email: 'fred@example.com'},
{name: 'Bob', email: 'bob@example.com'},
]
function addContact(contact) {
contacts.push(contact)
}
@rsyring
rsyring / librato-ping.py
Created Sep 24, 2017
A python script that pings a host and uploads metrics to Librato
View librato-ping.py
import re
import librato
from sh import ping, hostname
host = 'google.com'
# How many pings should we do before we process the results
ping_for = '30'
# How many times should we ping, process results, and send to Librato
repeat = 2
liberato_token = '<censored>'
@rsyring
rsyring / gist:2787e484b3c3202c654061bf4e4aaef1
Created Apr 14, 2017
Troubleshooting zfs snapshot size usage
View gist:2787e484b3c3202c654061bf4e4aaef1
$ sudo zfs list -r rpool -o name,used,compression,readonly,mounted
NAME USED COMPRESS RDONLY MOUNTED
...
rpool/insig/tmp/playground 6.91M lz4 off yes
$ ls -lh /tmp/playground/
total 512
-rw-rw-r-- 1 rsyring rsyring 2 Apr 14 14:59 foo
# I think snapshot @5 should have more used space.
@rsyring
rsyring / gist:74654ef6b97386354e7377bb350c635f
Created Apr 5, 2017
installing scudcloud 1.5 with error message "Depends: python3-pyqt5 but it is not going to be installed"
View gist:74654ef6b97386354e7377bb350c635f
# See for more context: https://github.com/raelgc/scudcloud/issues/550
rsyring@loftex:~$ sudo apt-get install scudcloud
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
@rsyring
rsyring / random.py
Created Apr 5, 2017
random string script using Click library
View random.py
#!/usr/bin/env python
from __future__ import print_function
import random
import click
@click.command()
@click.argument('length', type=click.INT)