Skip to content

Instantly share code, notes, and snippets.

@eflynn
eflynn / server.sh
Created June 5, 2017 00:18
Sample monitor script
#!/bin/bash
set -euo pipefail
function cleanup {
if [[ ! -z "${pid-}" ]]; then
echo "Stopping php-fpm (${pid})"
kill -3 "${pid}"
wait "${pid}"
fi
MyWordCountView = require './my-word-count-view'
{CompositeDisposable} = require 'atom'
module.exports = MyWordCount =
myWordCountView: null
modalPanel: null
subscriptions: null
activate: (state) ->
@myWordCountView = new MyWordCountView(state.myWordCountViewState)
#cloud-config
hostname: standalone
coreos:
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
- name: download-kubernetes.service
{
"id": "mysql",
"kind": "Service",
"apiVersion": "v1beta1",
"port": 10000,
"selector": {
"name": "mysql"
}
}
{
"id": "mysql-1",
"kind": "Pod",
"apiVersion": "v1beta1",
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "mysql-1",
"containers": [{
"name": "master",
#!/bin/sh
USAGE="Usage: glance-image-create <file> <glance options>"
input=$1
shift
tempdir=$(mktemp -d /tmp/convert-image.XXXXXXXX)
@eflynn
eflynn / trace.txt
Created July 7, 2014 18:04
Strace of "docker pull dockerfile/chrome"
This file has been truncated, but you can view the full file.
4889 execve("/usr/local/bin/docker", ["/usr/local/bin/docker", "-d", "-D", "-g", "/var/lib/docker", "-H", "unix://", "-H", "tcp://0.0.0.0:2375"], [/* 16 vars */]) = 0
4889 uname({sys="Linux", node="boot2docker", ...}) = 0
4889 brk(0) = 0x14d9000
4889 brk(0x14da1c0) = 0x14da1c0
4889 arch_prctl(ARCH_SET_FS, 0x14d9880) = 0
4889 set_tid_address(0x14d9b50) = 4889
4889 set_robust_list(0x14d9b60, 24) = 0
4889 futex(0x7fff61bc6cc0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 14d9880) = -1 EAGAIN (Resource temporarily unavailable)
4889 rt_sigaction(SIGRTMIN, {0x7da4a0, [], SA_RESTORER|SA_SIGINFO, 0x7dab60}, NULL, 8) = 0
4889 rt_sigaction(SIGRT_1, {0x7da530, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7dab60}, NULL, 8) = 0
docker@boot2docker:~$ docker version
Client version: 1.1.0
Client API version: 1.13
Go version (client): go1.2.1
Git commit (client): 79812e3
Server version: 1.1.0
Server API version: 1.13
Go version (server): go1.2.1
Git commit (server): 79812000
@eflynn
eflynn / gist:e7d9ce2c85066aa82613
Created May 4, 2014 15:54
proxy xml through yql
var root = 'http://query.yahooapis.com/v1/public/yql?q=';
var q = 'select * from xml where url="http://womm.radioactivity.fm/feeds/last25.xml"';
var url = root + encodeURIComponent(q) + '&format=json&diagnostics=false';
var jqxhr = $.get( url, function() {
alert( "success" );
})
.fail(function(xhr, msg) {
alert( "error " + msg.toString());
});
@eflynn
eflynn / nginx
Created January 27, 2014 19:16
BHW Nginx configuration
server {
listen 8080;
root /var/www/bigheavyworld/public;
error_page 404 /index.php?error=404;
location = /favicon.ico {
log_not_found off;
access_log off;
}