Skip to content

Instantly share code, notes, and snippets.

View thwarted's full-sized avatar
🥓
increasingly at large

Andy Bakun thwarted

🥓
increasingly at large
View GitHub Profile
@thwarted
thwarted / syslog-ng.statsd.conf
Last active August 29, 2015 14:05
increment graphite metrics via statsd from matched syslog lines using syslog-ng
# vim:ft=syslog-ng:ai:si:ts=4:sw=4:et:expandtab
# assumes RFC5424 format and a SD-ELEMENT "x-service" in the SD-ID "origin"
# customize to taste
@define statdprefix "service.${.SDATA.origin.x-service}."
# send your log data to port 8888
source s_logdata {
udp(port(8888) flags(syslog-protocol) tags("logdata"));
@thwarted
thwarted / keybase.md
Created August 13, 2014 21:59
keybase.md

Keybase proof

I hereby claim:

  • I am thwarted on github.
  • I am thwarted (https://keybase.io/thwarted) on keybase.
  • I have a public key whose fingerprint is 8CC0 42B3 3D0A CE55 5BA8 7623 0317 C210 0A72 3223

To claim this, I am signing this object:

@thwarted
thwarted / resize-java-iKVM-viewer
Last active September 15, 2022 08:59
resize-java-iKVM-viewer: find all supermicro Java iKVM Viewer windows and resize them to display all the content
#!/bin/bash
# find all supermicro Java iKVM Viewer windows and resize
# them to display all the content
#
# for reasons that are beyond sanity, this shitty closed source program
# sets the min and max window sizes to the same values, making it unresizable
# through dragging.
# this wouldn't be so bad if it actually resized the window to display all
# the content. it constantly resizes based on the resolution of the
@thwarted
thwarted / build-the-gems-i-need
Last active August 29, 2015 14:01
/usr/lib64/ruby/gems/2.1.0/gems/gem2rpm-0.10.1/templates/fedora.spec.erb that works better with ruby-2.1
#!/bin/bash
set -x
cd ~/rpmbuild/SOURCES
function doit() {
local gemname="$1"
gem2rpm --fetch $gemname --output ../SPECS/rubygem-$gemname.spec
@thwarted
thwarted / pause
Created May 13, 2014 05:59
pause
#include <unistd.h>
void main() { pause(); }
@thwarted
thwarted / notify-agent-use
Last active August 29, 2015 14:00
notify on ssh-agent use
#!/bin/bash
countfile=/tmp/agentcount.${USER}.$( date +%Y%m%d )
c=$( cat "$countfile" 2>/dev/null )
c=$(( c + 1 ))
echo $c > "$countfile"
msg="${*/Allow use of/Using}"
msg="$( echo "${msg/\?/}" | fold -w 34 )"
@thwarted
thwarted / Vagrantfile.aws
Created April 1, 2014 05:28
a simplisitic Vagrantfile for use with vagrant-aws; vagrant up --provider=aws
if not ENV['AWS_ACCESS_KEY_ID'] or not ENV['AWS_SECRET_ACCESS_KEY']
puts "Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in the environment"
exit
end
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.vm.provider :aws do |aws, override|
#aws.region = "us-west-2"
@thwarted
thwarted / python-softlayer.spec
Last active March 14, 2016 03:59
the bare-boniest spec file used to build the softlayer python module; generated with "rpmdev-newspec -t python python-softlayer.spec"
# sitelib for noarch packages, sitearch for others (remove the unneeded one)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Name: python-softlayer
Version: 773ab17
Release: 1%{?dist}
Summary: softlayer python interface
License: Softlayer
@thwarted
thwarted / ldd.out
Created March 19, 2014 20:22
mysql and postgres ODBC setup for SSL, notes on iodbc and unixODBC
# this uses iodbc, compile postgresql-odbc with --with-iodbc
$ ldd /usr/lib64/psqlodbcw-iodbc.so | grep odbc
libiodbc.so.2 => /lib64/libiodbc.so.2 (0x00007f686e30a000)
libiodbcinst.so.2 => /lib64/libiodbcinst.so.2 (0x00007f686e0f7000)
# this uses unixODBC, compile postgresql-odbc with --with-unixodbc
$ ldd /usr/lib64/psqlodbcw-unixodbc.so | grep odbc
@thwarted
thwarted / auto.nfs4
Last active November 21, 2017 14:59
pure nfsv4 autofs dynamic map (doesn't rely on nfsv3 mountd)
#!/bin/bash
# name this script /etc/auto.nfs4 and make it executable
PATH=/bin
tryconnect() {
local host="$1"
# if you don't have nmap-ncat, but your bash does support pseudo-redirection