Skip to content

Instantly share code, notes, and snippets.

View rodtreweek's full-sized avatar

Rod Treweek rodtreweek

  • Portland, OR
View GitHub Profile
@rodtreweek
rodtreweek / sed cheatsheet
Created February 7, 2018 18:25 — forked from ssstonebraker/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@rodtreweek
rodtreweek / ansible-win-10-wsl-config.sh
Created January 30, 2018 01:06 — forked from gregjhogan/ansible-win-10-wsl-config.sh
ansible windows 10 WSL configuration
sudo apt-get -y update
sudo apt-get -y install python
sudo easy_install pip
sudo pip install ansible
sudo pip install "pywinrm>=0.2.2"
# kerberos authentication support
#sudo apt-get install -y python-dev libkrb5-dev krb5-user
#sudo pip install pywinrm[kerberos]
@rodtreweek
rodtreweek / tmux-cheat-sheet.md
Created January 19, 2018 02:13 — forked from michaellihs/tmux-cheat-sheet.md
tmux Cheat Sheet
@rodtreweek
rodtreweek / pedantically_commented_playbook.yml
Created October 27, 2017 19:23 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@rodtreweek
rodtreweek / GitLab-CE on Windows 10
Created October 27, 2017 08:49 — forked from kingbin/GitLab-CE on Windows 10
Using Docker toolbox to create a persistent Gitlab-CE install in Windows 10
$ docker create --name gitlab-data --volume /d/docker/gitlab:/etc/gitlab gitlab/gitlab-ce:latest
# Make sure Bridging is set on the VM in VirtualBox
$ docker run --publish 8080:80 --publish 2222:22 --publish 4443:443 --name gitlab --restart always --volumes-from gitlab-data gitlab/gitlab-ce:latest
Using docker 1.13.1
@rodtreweek
rodtreweek / README.md
Created October 26, 2017 10:44 — forked from seansawyer/README.md
Managing OpenStack instances with Ansible through an SSH bastion host

Managing OpenStack instances with Ansible through an SSH bastion host

I'm be using DreamCompute as my OpenStack provider, but there are dozens to choose from. I assume you already have Ansible and the OpenStack CLI tools installed.

Motivation

With the proliferation of OpenStack public clouds offering free and intro tiers, it's becoming very easy to effectively run a simple application for free or nearly free. Also with the emergence of Ansible, you don't need to learn and deploy complicated tools to do configuration management.

#!/bin/bash
echo "[ build and install vim from source ]"
# Create directories...
sudo mkdir -p ~/fs/dev;
# This script needs "fpm". If you don't have it
# install ruby, etc. with:
sudo apt-get install ruby ruby-dev build-essential;
@rodtreweek
rodtreweek / osx-pdf-from-markdown.markdown
Created July 16, 2017 08:12 — forked from georgiana-gligor/osx-pdf-from-markdown.markdown
Markdown source for the "Create PDF files from Markdown sources in OSX" article

Create PDF files from Markdown sources in OSX

When [Markdown][markdown] appeared more than 10 years ago, it aimed to make it easier to express ideas in an easy-to-write plain text format. It offers a simple syntax that takes the writer focus away from the formatting, thus giving her time to focus on the actual content.

The market abunds of editors to be used for help with markdown. After a few attempts, I settled to Sublime and its browser preview plugin, which work great for me and have a small memory footprint to accomplish that. To pass the results around to other people, less technical, a markdown file and a bunch of images is not the best approach, so converting it to a more robust format like PDF seems like a much better choice.

[Pandoc][pandoc] is the swiss-army knife of converting documents between various formats. While being able to deal with heavy-weight formats like docx and epub, we will need it for the more lightweight markdown. To be able to generate PDF files, we need LaTeX. On OSX, the s

@rodtreweek
rodtreweek / wtf.md
Created July 11, 2017 07:34 — forked from othiym23/wtf.md
An experiment. Subject to change.
@rodtreweek
rodtreweek / amq-mapper.rb
Created June 28, 2017 18:41 — forked from Sharpie/amq-mapper.rb
Transform ActiveMQ config files into a connection diagram for Graphviz
#!/usr/bin/env ruby
# Generate a DOT file showing links between ActiveMQ brokers using
# a list of activemq.xml files passed as ARGV.
require 'rexml/document'
require 'erb'
broker_map = Hash.new