Skip to content

Instantly share code, notes, and snippets.

View aussielunix's full-sized avatar
🤠
G`Day

Mick Pollard aussielunix

🤠
G`Day
View GitHub Profile
@aussielunix
aussielunix / rbenv_reinstall_all.sh
Last active August 29, 2015 13:56
reinstall all the rubies
#!/bin/bash
# CVE-2013-6393
# See: https://groups.google.com/forum/#!msg/rubysec-announce/3sx25iR7yHQ/gZOBulw_TeYJ
#
echo "Assumes you use rbenv and assumes your ruby-build is at ~/.rbenv/plugins/ruby-build"
echo "This will uninstall all your rbenv managed rubies and install them again."
echo "Pulling down the latest ruby-build"
cd ~/.rbenv/plugins/ruby-build && git pull && cd -
mkdir /tmp/rbenvupgrade
for RUBY in ~/.rbenv/versions/*

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

For a moment, I'm going to throw away my automation and configuration management hat. I'll let you know when I put it back on. Also, let's ignore that we're talking about Riak specifically for a moment. Also also, let's ignore any (for a brief moment) the proper role of a package manager.

What's your target market?

If you're writing server software, you have two target markets. The system administrator/operations team and the developer.

Why do you want autostart?

The main reason you want autostart is to get people up and running quickly. To do this, you need to ship safe and sane defaults. This means something like a default configuration that listens only on localhost.

#!/usr/bin/ruby
require 'rubygems'
require 'gruff'
# Let's hack almost everything
g = Gruff::Bar.new('800x700') # Define a custom size
g.sort = false # Do NOT sort data based on values
g.maximum_value = 40 # Declare a max value for the Y axis
@aussielunix
aussielunix / ansible_locale.yml
Last active August 29, 2015 14:21
Ansible play for fixing locale on Ubuntu
---
- name: locale | fixup Ubuntu's broken locale
hosts: all
sudo: yes
gather_facts: True
vars:
locale: en_AU.UTF-8
tasks:
- name: locale | run localegen
@aussielunix
aussielunix / ansible-awscli.yml
Created May 28, 2015 09:31
extending ansible aws with awscli
---
- hosts: localhost
connection: local
gather_facts: no
vars:
region: ap-southeast-2
name: test-vpc
tasks:
sudo cryptsetup luksOpen /dev/sda5 luks_container
@aussielunix
aussielunix / README.md
Last active August 29, 2015 14:28
This would be a nice to have for ansible.

Ansible Readme Driven Development (wish)

It would be great to be able to write out a play that contains nothing but name: ... lines as a planning tool.
You can then replace each line one at a time untill you have a working play/role.

virt-install --accelerate -n guppy -r 512 --vcpus=1 \
--disk pool=lvm,bus=virtio,size=35 --vnc --os-type linux --os-variant=rhel5 \
--network=network:default -l http://192.168.122.1/os/CentOS/5.5/os/x86_64/ -x "ks=http://192.168.122.1/ks/ks.cfg"