Skip to content

Instantly share code, notes, and snippets.

@colby
colby / nfsn.api.sh
Created April 17, 2020 03:10 — forked from nmschulte/nfsn.api.sh
NearlyFreeSpeech.NET API request "library", in pure shell (requires sha1sum and curl)
#!/usr/bin/env sh
# Copyright (c) 2015 Nathan Schulte
# set LOGIN and API_KEY below --
# see bottom for example use, in this case, checking and updating the default DNS A RR for a domain
# 0: request URI, e.g. '/dns/example.com/listRRs'
# 1..n: parameters
make_request () {
LOGIN=''
@colby
colby / prometheus-rules.yml
Created March 28, 2020 06:37 — forked from mjf/prometheus-rules.yml
Prometheus Recoding and Alert Rules Collection
# Prometheus Recoding and Alert Rules Collection
# Copyright (C) 2017 Matous Jan Fialka, <http://mjf.cz/>
# Released under the terms of The MIT License
groups:
- name: node_common
interval: 30s
rules:
@colby
colby / 12pomodoro.md
Last active August 1, 2019 16:59
The 12 Pomodoro Workday

The 12 Pomodoro Workday

Or the 25 hour work week. Heavily borrowed from cblgh.

The Planning

The structure is simple:

  • 1 pomodoro planning the work day
  • 8 pomodoros of work
  • 3 pomodoros of break

1+8+3=12 pomodoros,

@colby
colby / -
Created August 9, 2017 22:35
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem
#!/usr/bin/env sh
vagrant=$(which vagrant)
awk=$(which awk)
printf "Gathering a list of machines. "
machines=$(vagrant global-status --prune 2>/dev/null | vagrant global-status | $awk '/running/ {print $5}')
if [ ! -z "${machines[@]}" ]
then
@colby
colby / bump
Created January 16, 2017 19:18
#!/bin/bash
set -e
platform=$(uname)
if [ "$platform" == 'Darwin' ]
then
sed=$(which gsed || errcho "install gnu-sed")
else
sed=$(which sed)
wget https://gist.githubusercontent.com/colby/20fb4fc48f5ebf9a062da5fdf1f59f88/raw/c154e38fb44f9aaf1e6d8329cc5546bef41b57ea/dank-tags.csv
function dank() {
local tags=~/Desktop/dank-tags.csv
if [[ $# -gt 0 ]]
then
grep "$@" $tags | gsort --random-sort | head -n 1 | say
else
gsort --random-sort $tags | head -n 1 | say
fi
@colby
colby / -
Created December 6, 2016 02:17
[vagrant@web ~]$ cat httpd_copious.te
module httpd_copious 1.0;
require {
type httpd_t;
type default_t;
type hugetlbfs_t;
class file { write getattr };
class capability2 block_suspend;
@colby
colby / -
Created December 6, 2016 01:59
[vagrant@web ~]$ # sudo yum install policycoreutils-python
[vagrant@web ~]$ # sudo audit2allow -a -M httpd_copious
[vagrant@web ~]$ # sudo semodule -i httpd_copious.pp
@colby
colby / sandman.sh
Created November 17, 2016 05:49
Put all of your Vagrant VMs to sleep.
#!/usr/bin/env sh
vagrant=$(which vagrant)
awk=$(which awk)
printf "Gathering a list of machines. "
machines=$(vagrant global-status --prune 2>/dev/null | $awk '/running/ {print $5}')
if [ ! -z "${machines[@]}" ]
then