Mounting shared folders between OSX and the docker container is tricky due to
the intermediate boot2docker VM. You can't use the usual docker -v option as
the docker server knows nothing about the OSX filesystem - it can only mount
folders from the boot2docker filesystem. Fortunately, you can work around this
using SSHFS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DEVICE=/dev/$(lsblk -n | awk '$NF != "/" {print $1}') | |
| FS_TYPE=$(file -s $DEVICE | awk '{print $2}') | |
| MOUNT_POINT=/data | |
| # If no FS, then this output contains "data" | |
| if [ "$FS_TYPE" = "data" ] | |
| then | |
| echo "Creating file system on $DEVICE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Bootstrap script for setting up a new OSX machine | |
| # | |
| # This should be idempotent so it can be run multiple times. | |
| # | |
| # Some apps don't have a cask and so still need to be installed by hand. These | |
| # include: | |
| # | |
| # - Twitter (app store) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Pretty printing function for Bash output | |
| # | |
| # Example usage: | |
| # | |
| # $ notify "hello world" | |
| # | |
| # +-------------+ | |
| # | hello world | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Get the value of a tag for a running EC2 instance. | |
| # | |
| # This can be useful within bootstrapping scripts ("user-data"). | |
| # | |
| # Note the EC3 instance needs to have an IAM role that lets it read tags. The policy | |
| # JSON for this looks like: | |
| # | |
| # { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [alias] | |
| # Open the Github page for the... | |
| # ...repo homepage (included for consistency) | |
| open = !hub browse -- | |
| # ...repo commits | |
| opencommits = !hub browse -- commits | |
| # ...commit page for HEAD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add these functions to your ~/.bashrc in order to be able to query private | |
| # Docker registries from the commandline. You'll need the JQ library | |
| # (http://stedolan.github.io/jq/) to be installed. Alternatively, you can just | |
| # pipe to " python -mjson.tool" to get pretty JSON formatting | |
| # TODO Enter the correct details here | |
| DOCKER_REGISTRY_HOST=docker.yourcompany.com | |
| DOCKER_REGISTRY_AUTH=someuser:somepassword | |
| function _docker_fetch() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| BUCKET=tangent-boilerplate | |
| # Install AWS CLI | |
| apt-get update | |
| apt-get install -y python-pip | |
| pip install awscli | |
| # Fetch and run bootstrap file. For this to work, the EC2 instance needs to have an IAM role |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " ================================================== | |
| " VIMRC file for David Winterbottom (@codeinthehole) | |
| " ================================================== | |
| " Inspiration {{{ | |
| " ----------- | |
| " See http://www.youtube.com/watch?v=aHm36-na4-4 | |
| " | |
| " Good articles: | |
| " - http://alexpounds.com/blog/2014/06/06/the-vimrc-antiques-roadshow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| Extract metrics from a uWSGI log file | |
| This should be saved as /etc/zabbix/pluginx/uwsgi_stats and called from | |
| /etc/zabbix/zabbix_agentd.conf.d/uwsgi.conf, which should have contents: | |
| UserParameter=uwsgi.stats[*],/etc/zabbix/plugins/uwsgi_stats $1 $2 | |
| To gather these metrics in Zabbix, create a new item which calls this plugin and |