Skip to content

Instantly share code, notes, and snippets.

View bixu's full-sized avatar
🦎

Blake Irvin bixu

🦎
  • Berlin
  • 12:24 (UTC +02:00)
View GitHub Profile
@bixu
bixu / omnibus-chef_wrapper
Last active August 29, 2015 14:01
Wrapper script for building omnibus-chef for ubuntu LTS 12.0.4 with ruby 2.1.1
#!/bin/bash
set -e
chef_version="11.12.8"
if [ $(uname -a | grep -c Ubuntu) -eq 1 ]; then
packager="apt-get"
packages="build-essential git ruby1.9.1 ruby-bundler ruby1.9.1-dev"
else
@bixu
bixu / get_broker_ids
Created July 9, 2014 13:34
How to get your circonus broker ID if you are using public circonus brokers
# this assumes that you have the latest node.js
sudo npm install -g json
curl -s \
-H 'X-Circonus-App-Name: nad' \
-H 'X-Circonus-Auth-Token: <your_auth_token>' \
-H 'Accept: application/json' 'https://api.circonus.com/broker' \
| json \
| grep "cid\|name"
@bixu
bixu / smartos_vagrant
Last active August 29, 2015 14:07
SmartOS in Vagrant!
monolith:~ blake$ vagrant plugin install vagrant-smartos-zones
monolith:~ blake$ mkdir smartos && cd smartos
monolith:smartos blake$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'livinginthepast/smartos'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'livinginthepast/smartos' is up to date...
==> default: Setting the name of the VM: smartos_default_1412188127370_65947
@bixu
bixu / public_ssh_scan.sh
Last active August 29, 2015 14:09
scan for open public ssh ports on your hosts
#!/bin/bash
ip_list=$(knife joyent server list | awk '{print $7}' | cut -d"," -f 1 | grep -v "10.*\|192.168.*\|172.16.*")
for ip in $ip_list
do nmap -A -T4 -F $ip
done | grep "Nmap scan report\|ssh"
@bixu
bixu / pkgsrc_bootstrap.sh
Last active August 29, 2015 14:14
Bootstrap pkgsrc in a SmartOS global zone
#!/bin/bash
# you can test by doing
# curl -sL https://gist.github.com/bixu/e2620a2b0fcb6ed1830c/raw/pkgsrc_bootstrap.sh | bash -sx
BOOTSTRAP_TARBALL=$(curl -sLk http://pkgsrc.joyent.com/packages/SmartOS/bootstrap/ | grep href= | cut -d\" -f2 | tail -n1)
cd /
curl -k http://pkgsrc.joyent.com/packages/SmartOS/bootstrap/$BOOTSTRAP_TARBALL | gzcat | tar -xf -
@bixu
bixu / gist:3411df6a2b7ff99095b9
Created April 1, 2015 09:07
.kitchen.yml for Test Kitchen with the kitchen-joyent driver
---
driver_plugin: joyent
driver_config:
joyent_username: <%= ENV['MANTA_USER'] %>
joyent_keyfile: "<%= ENV['HOME'] %>/.ssh/id_rsa"
joyent_keyname: <%= ENV['MANTA_KEY_ID'] %>
joyent_url: <%= ENV['JOYENT_API_URL'] %>
platforms:
- name: smartos_base64_1430
@bixu
bixu / triton_docker.sh
Created August 6, 2015 14:30
Shell functions to switch between local Docker environments and Joyent's Triton Docker hosting service
#!/bin/bash
# triton/docker
export DOCKER_TLS_VERIFY=1
function dockerlocal {
export DOCKER_HOST=tcp://192.168.59.103:2376
export DOCKER_CERT_PATH=$HOME/.boot2docker/certs/boot2docker-vm
}
@bixu
bixu / mantorrent.sh
Created August 7, 2015 13:01
Store your torrent downloads (for example, the latest Slackware Linux ISO) directly in Manta from within an `mjob` or `mlogin` session.
#!/bin/bash
# "An elegant weapon, from a more civilized age."
MAGNET_URL=$1
transmission-daemon
sleep 3
#!/bin/sh
until [ "`zpool list rpool`" ];
do
:
done
pfexec zfs set compression=on rpool
# For some reason, the rpool/ROOT dataset (which is the root filesystem
#!/usr/bin/python
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.