Skip to content

Instantly share code, notes, and snippets.

@skreuzer
skreuzer / skreuzer.gpg
Created May 1, 2015 13:36
GPG Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBFVDgCYBCADPw0GwQHRVcUxvPzy7y4GI4Fzi9TT9GDXouMhScSa5uS1QR6m4
iXvIaLTwjnSSDf+akAKzI3tTxpmshyg7dZZ3A93larXT6dE9FYiI/Q51F+hkl/hX
zzFSGX1XUSTkBpozLEY2kHiH6Dr7XL/FqLTtGOkrF+PUauKKWzAG4Qo52sWwZMwq
bF81vSt0pDTClrjCb9GqUIpbdVtTRCt1ROREVxcBgm+gSJDHlZrSjRP0mCIXS7Fb
oebC83gipnSFQr9Sk1hovuAqOUXKUi0aApZ63/oQUyYbKTwtsWu6xSAd+Ro0UbkZ
is8llwmxxn4X3lptpf0AEUq8oV7fYwZrvzmbABEBAAG0JVN0ZXZlbiBLcmV1emVy
IDxza3JldXplckBmcmVlYnNkLm9yZz6JAT0EEwEIACcCGwMFCwkIBwIGFQgJCgsC
@skreuzer
skreuzer / libxo.c
Created March 22, 2015 16:04
Example code to demonstrate using libxo
#include <sys/utsname.h>
#include <stdio.h>
#include <stdlib.h>
#include <libxo/xo.h>
int main(int argc, char *argv[])
{
argc = xo_parse_args(argc, argv);
if (argc < 0)
exit(1);
@skreuzer
skreuzer / dnsdeplay.pl
Created February 21, 2015 04:19
Measure latency of DNS requests
#!/usr/bin/perl -w
use strict;
use Net::DNS::Resolver;
use Time::HiRes qw(gettimeofday tv_interval);
use Getopt::Long;
my $nameserver;
my $query;
my $duration = 10;
body common control
{
bundlesequence => { "blackout" };
}
body agent control
{
abortclasses => { "abort_cfagent" };
}
bundle agent copy_release
{
vars:
"file" slist => { "foo.py", "bar.py", "baz.py" };
"src_path" string => execresult("$(paths.path[realpath]) /opt", "noshell")
files:
"/usr/local/bin/$(file)"

Voltage Regulators

Type Minimum Input Voltage Output Voltage
7805 7V +5V
7806 8V +6V
7808 10V +8V
7809 11V +9V
7812 15V +12V
7815 18V +15V
@skreuzer
skreuzer / wa.py
Created December 23, 2014 21:28
Query Wolfram Alpha
#!/usr/local/bin/python
#-*- coding: utf-8 -*-
import wolframalpha
import sys
app_id = 'XXXXXXXX-XXXXXXXXXX'
client = wolframalpha.Client(app_id)
res = client.query(' '.join(sys.argv[1:]))
print(next(res.results).text)
@skreuzer
skreuzer / fbsd-sponsors.md
Last active August 29, 2015 14:06
FreeBSD Sponsors
  • The FreeBSD Foundation
  • Mellanox Technologies
  • Defense Advanced Research Projects Agency
  • Air Force Research Laboratory
  • iXsystems, Inc.
  • Nginx, Inc.
  • ScaleEngine, Inc.
  • Spectra Logic
  • Yandex LLC
  • EMC / Isilon Storage Division
@skreuzer
skreuzer / dns_reminder.scpt
Created September 5, 2014 14:30
Set Reminder to Roll out DNS Updates
set remindMe to (date (short date string of ((current date)))) + (17 * 60 * 60)
tell application "Reminders"
set mylist to list "Work"
tell mylist
make new reminder with properties {name:"Roll Out DNS Updates", remind me date:remindMe}
end tell
end tell
@skreuzer
skreuzer / kerncmp.cf
Created September 4, 2014 20:54
CFEngine Kernel Compare
bundle agent kerncmp
{
classes:
"running_required_kernel" expression => strcmp("$(kernel_version_met[1])", "true");
methods:
"any" usebundle => kernel_isgreaterthan("3.14.0"),
useresult => "kernel_version_met";