This file contains 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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"aRecord": { | |
"Properties": { | |
"HostedZoneId": { | |
"Ref": "hostedZone" | |
}, | |
"Name": "test.mmbtest.com", | |
"ResourceRecords": [ |
This file contains 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
# graphite/statsd/grafana setup on new Amazon Linux instance | |
# add http://graphite/ to grafana as a data source | |
sudo su | |
yum update --assumeyes | |
yum install --assumeyes docker | |
service docker start | |
docker \ | |
run \ |
This file contains 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
watch -d 'curl -s http://router:router@10.244.0.22:8080/routes \ | |
| jq -r "to_entries[] | .key+\" \"+.value[].address+\" \"+.value[].route_service_url" | \ | |
column -t' |
This file contains 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 | |
set -e | |
COPY_PATH=$(mktemp -t add_key) | |
MOUNT_PATH=/Volumes/mmb | |
KEY_EXPIRES_AT=$(date -v18H -v0M -v0S +%s) | |
NOW=$(date +%s) | |
KEY_LIFETIME=$(($KEY_EXPIRES_AT - $NOW)) | |
if [ "$KEY_LIFETIME" -lt "1" ]; then |
This file contains 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
import sys | |
import weechat | |
if weechat.register('test', 'test', 'test', 'test', 'test', 'shutdown', ''): | |
weechat.prnt('', str(sys.version)) | |
weechat.prnt('', str(sys.path)) |
This file contains 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 | |
set -e | |
COPY_PATH=/tmp/mount_mmb.sh | |
MOUNT_PATH=/Volumes/mmb | |
cat > $COPY_PATH << EOF | |
#!/bin/bash | |
set -e |
This file contains 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
require 'rmagick' | |
img_list = Magick::ImageList.new('http://i.imgur.com/Txjn52a.gif') | |
p img_list.size | |
img_list = Magick::ImageList.new('http://i.imgur.com/UthfKGQ.jpg') | |
p img_list.size |
This file contains 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
def create | |
@src_image = SrcImage.new(src_image_params) | |
@src_image.user = current_user | |
read_image_data @src_image | |
respond_to do |format| | |
if @src_image.save | |
create_success(format) | |
else |
This file contains 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
<!DOCTYPE html> | |
<p>hello</p> |
This file contains 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 ruby | |
# When USB drives are mounted, check them for a script called plz_verify.sh | |
# and run it if found. | |
# | |
# symlink all USB volumes you want to check into ~/usb | |
# ln -s /Volumes/mmb ~/usb/mmb | |
require 'logger' | |
require 'set' |