Skip to content

Instantly share code, notes, and snippets.

@evilchili
evilchili / s.bash
Created November 29, 2021 21:15
liquidsoap controller script
#!/bin/bash -e
#
# s -- stream controller
#
# Usage:
#
# s PLAYLIST -- Switch to the specified playlist file. Starts liquidsoap if it isn't running.
# s -- Skip to a random track from the current playlist.
# s stop -- Shutdown liquidsoap
#
@evilchili
evilchili / dnd.liq
Created August 22, 2021 05:24
dnd audio streaming command and control
set("server.telnet",true)
set("request.grace_time", 3.0)
set("init.daemon.pidfile.path", "run/liquidsoap.pid")
# deeebuggin
# set("log.file.path","<script>.log")
# set up the stream
stream = crossfade(normalize(playlist.safe(
@evilchili
evilchili / .vimrc
Created August 24, 2020 17:16
evilchili's .vimrc (2020)
" ======= DEFAULTS ======= "
set nocompatible
set textwidth=120
set nowrap
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
@evilchili
evilchili / logstash-emitter.conf
Created October 18, 2013 19:08
logstash emitter config for jenkins server logs
input {
file {
path => "/var/log/jenkins/*"
type => "jenkins-server"
start_position => "beginning"
}
}
# The first filter munges the logs into discrete events.
filter {
@evilchili
evilchili / postfix_blackhole.sh
Last active October 12, 2018 23:50
blackhole all mail except for one domain using postfix
# define a transport for mail you want to deliver
echo "$VALID_DOMAIN smtp:[$VALID_RELAYHOST]" > /etc/postfix/transport
postconf -e transport_maps = hash:/etc/postfix/transport
# everything else goes to a bogus relayhost, which causes a bounce
postconf -e relayhost = 169.254.0.0
# immediately throw away all bounces
postconf -e maximal_queue_lifetime = 0
postconf -e bounce_queue_lifetime = 0
@evilchili
evilchili / cli.py
Last active August 2, 2018 22:50
CLI with Fire
from fire import Fire as _Fire
import sys
def Fire(target):
"""
Changing Log Levels:
To manage the logging level, you can set the LOGLEVEL environment variable before running the command.
Supported values are DEBUG, CRITICAL, ERROR, WARNING, and INFO (the default). For example:
@evilchili
evilchili / gist:1848087
Created February 16, 2012 21:42
invoke a downstream jenkins job with the current job parameters + additions
import hudson.model.*
// extract the version tag from the console log
def version_pattern = ".*\\[\\s*INFO\\s*\\]\\s+VERSION=(.*)\\s*\$"
def matcher = manager.getLogMatcher( version_pattern )
if ( matcher?.matches() ) {
// add the version string to the job summary
def ver = matcher.group(1)
manager.addInfoBadge( "Version: $ver" )
@evilchili
evilchili / campaign timeline.txt
Created June 25, 2018 06:26
campaign timeline
% python3 reckoning/campaign.py timeline list
3.2805.1.43 W43F Magnus Enters Servitude At The library
3.3132.7.41 S41R Ara Enters The Temple Of Rillifane
3.3204.6.13 W13L Ara Encounters The Skink In Riverbend
3.3204.8.12 M12B Levani Meets Yuna
3.3205.3.36 S36W Levani Leaves The Trajte Ur Flaschz
3.3206.5.05 F5S El Astrum Public Library Destroyed
3.3206.5.08 W8S Black Tack Goblin Tribe Discovers Residium Deposit
3.3206.5.44 T44S Keen Leaves The Spectacular Spectacular
@evilchili
evilchili / gist:2465006bc469cb1b13a3e26627a3cc15
Last active June 25, 2018 03:34
telisaran calendar cli
% python reckoning/calendar.py season
BEAR
Sy Mi Wo Th Fr
01 02 03 04 05
06 07 08 09 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
26 27 28 29 30
31 32 33 34 35
@evilchili
evilchili / pwdhash.sh
Created August 27, 2013 21:58
Trying to extract a PBKDF2-HMAC-SHA1 from user plist on mountain lion; failing. What am I missing?
#!/bin/sh
USER=$1
# get the shadow hash from the user entry
dscl . read /Users/$USER dsAttrTypeNative:ShadowHashData | tail -1 \
# remove everything but hex data and spaces
| tr -dc '0-9a-f ' \