Skip to content

Instantly share code, notes, and snippets.

/*
* 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::
#!/bin/bash
# Copyright 2014 Brian Bennett <bahamat@digitalelf.net>
#
# 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 / 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";
@bahamat
bahamat / quine.bash
Last active August 29, 2015 14:19 — forked from bahamas10/quine.bash
#!/usr/bin/env bash
s=(
'#!/usr/bin/env bash'
''
's=('
')'
''
'q=$(printf "\x27")'
'for ((i = 0; i < 3; i++ )); do'
@bahamat
bahamat / quine.js
Last active August 29, 2015 14:19 — forked from bahamas10/quine.js
#!/usr/bin/env node
var util = require("util");
var source = [
'#!/usr/bin/env node',
'',
'var util = require("util");',
'',
'var source = [',
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2015, Brian Bennett <bahamat@digitalelf.net>
cn=$1; shift
action=$1; shift