Skip to content

Instantly share code, notes, and snippets.

View bahamat's full-sized avatar
☁️

Brianna Bennett bahamat

☁️
View GitHub Profile
/*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
@bahamat
bahamat / keybase.md
Created June 17, 2014 22:21
Keybase Proof

Keybase proof

I hereby claim:

  • I am bahamat on github.
  • I am bahamat (https://keybase.io/bahamat) on keybase.
  • I have a public key whose fingerprint is A383 6091 90D8 6943 6461 DC5E 4446 1DC0 B5CA 6B92

To claim this, I am signing this object:

@bahamat
bahamat / dnssd-register.sh
Last active August 29, 2015 14:05
SMF Manifest and shell script for SmartOS to register common, active DNS-SD services.
#!/bin/bash
# dnssd-register.sh -- Register common services for SmartOS
#
# This is really only useful for people who run SmartOS on a LAN segment
# with workstations. E.g., your house.
#
# This script scans for common locally listening services and registers
# them with mDNS/DNS-SD/Bonjour.
#
@bahamat
bahamat / dpkgup.cf
Last active August 29, 2015 14:06
A cfengine bundle to upgrade all or a list of packages on a Debian system.
bundle agent dpkgup(p_list) {
vars:
done_with_classes.package_list_provided::
"pkg_list" string => join(" ", p_list), policy => "free";
done_with_classes.!package_list_provided::
"pkg_list" string => "", policy => "free";
done_with_classes::
@bahamat
bahamat / gist:7c4abade72d674e34281
Last active December 20, 2020 01:05
Magical quoting with printf %q
$ echo quote what? ; read quoteme ; printf %q "$quoteme" ; echo
quote what?
The horse said "$)#*@(!!%" when he stubbed his hoof.
The\ horse\ said\ \"\$\)#\*@\(\!\!%\"\ when\ he\ stubbed\ his\ hoof.
$
#!/bin/bash
# Copyright 2014 Brian Bennett <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@bahamat
bahamat / gist:851c24b6d1a0de0e4f10
Last active August 29, 2015 14:10
CFEngine health check example
classes:
named_is_running::
"zone_data_is_healthy" expression => returnszero("/usr/bin/host -t soa digitalelf.net 127.0.0.1","noshell");
reports:
debian.named_is_running.zone_data_is_healthy::
"Zone data is healthy";
@bahamat
bahamat / gist:c154b59ea1c5710e141c
Last active December 20, 2020 01:06 — forked from bdha/gist:c456cf6e5484ea5ad256
haskell ghc on smartos
@bahamat
bahamat / dl.cf
Last active August 29, 2015 14:17
Cfengine bundle to download a file.
body common control {
bundlesequence => { "dl" };
}
bundle agent dl
{
vars:
"file" string => "cfengine-3.6.5.tar.gz";
This file has been truncated, but you can view the full file.
PCRE version 8.36 2014-09-26
/([^\s]+)\-([0-9][^\s;]+).*[\s;]/
0verkill-0.16nb1;0verkill is bloody 2D action deathmatch-like game in ASCII-ART
0: 0verkill-0.16nb1;0verkill is bloody 2D action deathmatch-like game in
1: 0verkill
2: 0.16nb1
2vcard-0.5nb3;Convert an addressbook to the popular VCARD file format
0: 2vcard-0.5nb3;Convert an addressbook to the popular VCARD file
1: 2vcard