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
loop do | |
use_synth :tb303 | |
with_fx(:reverb, room: 0.5, mix: 0.3) do | |
play choose(chord(:e3, :minor)), release: 0.2, cutoff: rrand(60, 130) | |
end | |
sleep 0.25 | |
end |
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 | |
DEPLOY_DIR=/apps/myapp | |
SERVICE_NAME=myservice | |
NOW=$(date +"%Y%m%d%H%M%S") | |
mkdir -p $DEPLOY_DIR/releases/hotpush-$NOW && cat | tar -x -C $DEPLOY_DIR/releases/hotpush-$NOW | |
cp $DEPLOY_DIR/current/prod.env $DEPLOY_DIR/releases/hotpush-$NOW | |
(cd $DEPLOY_DIR/releases/hotpush-$NOW && npm install) | |
sudo chown -R node:deploy $DEPLOY_DIR/releases/hotpush-$NOW | |
sudo service $SERVICE_NAME stop | |
rm $DEPLOY_DIR/current |
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
description "Node.JS Service" | |
author "Martin Spier" | |
env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
respawn | |
start on runlevel [23] | |
stop on shutdown | |
respawn limit 20 5 |
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
function ignore(paths, fn) { | |
return function(req, res, next) { | |
if (~paths.indexOf(req.url)) { | |
next(); | |
} else { | |
fn(req, res, next); | |
} | |
} | |
} |
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
// append this to the definitions variable on widgets.js | |
// polling nfs4.client metrics, assuming a cumulative value and reusing the MultipleCumulativeMetricTimeSeriesDataModel data model | |
{ | |
name: 'nfs4.client', | |
title: 'NFS4', | |
directive: 'line-integer-time-series', | |
dataAttrName: 'data', | |
dataModelType: MultipleCumulativeMetricTimeSeriesDataModel, | |
dataModelOptions: { | |
name: 'nfs4.client', |
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
var http = require('http'); | |
var app = require('express')(); | |
app.use('/proxy*', function(req, res, next) { | |
var options = { | |
host: "spiermar.github.io", | |
path: "/contact" + req.params[0] | |
}; |
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 urllib2 | |
import xml.etree.ElementTree as ET | |
from xml.dom import minidom | |
results = ET.Element('results') | |
def get_posts(url): | |
retry = 0 | |
while (retry < 3): | |
try: |
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 | |
ps -A -o pid,rss,command | grep nginx | grep -v grep | awk '{total+=$2}END{printf("nginx=%dMb\n", total/1024)}' | |
ps -A -o pid,rss,command | grep php-fpm | grep -v grep | awk '{total+=$2}END{printf("php-fpm=%dMb\n", total/1024)}' | |
ps -A -o pid,rss,command | grep mysqld | grep -v grep | awk '{total+=$2}END{printf("mysql=%dMb\n", total/1024)}' | |
ps -A -o pid,rss,command | grep transmission-da | grep -v grep | awk '{total+=$2}END{printf("transmission=%dMb\n", total/1024)}' | |
ps -A -o pid,rss,command | grep fail2ban | grep -v grep | awk '{total+=$2}END{printf("fail2ban=%dMb\n", total/1024)}' | |
ps -A -o pid,rss,command | grep sshd | grep -v grep | awk '{total+=$2}END{printf("sshd=%dMb\n", total/1024)}' |
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
jQuery.ajaxSetup({ cache: false }); | |
function updatePlaylist() { | |
jQuery.getJSON("http://playlist-service.appspot.com/v1/playlist/last", function(data) { | |
var display = ''; | |
if(data.song_artist) { display += data.song_artist + ' - '; } | |
display += data.song_name; | |
jQuery('div#playlist').text(display); | |
}); | |
} | |
jQuery(document).ready(function () { |
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/sh | |
# | |
# nginx - this script starts and stops the nginx daemin | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /usr/local/nginx/conf/nginx.conf | |
# pidfile: /usr/local/nginx/logs/nginx.pid |
OlderNewer