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
| function ignore(paths, fn) { | |
| return function(req, res, next) { | |
| if (~paths.indexOf(req.url)) { | |
| next(); | |
| } else { | |
| fn(req, res, next); | |
| } | |
| } | |
| } |
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
| 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 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 | |
| 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 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
| 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 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
| \n | |
| time_namelookup: %{time_namelookup}\n | |
| time_connect: %{time_connect}\n | |
| time_appconnect: %{time_appconnect}\n | |
| time_pretransfer: %{time_pretransfer}\n | |
| time_redirect: %{time_redirect}\n | |
| time_starttransfer: %{time_starttransfer}\n | |
| ----------\n | |
| time_total: %{time_total}\n | |
| \n |
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
| package io.overloaded.jmeter; | |
| import org.apache.jmeter.config.Arguments; | |
| import org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient; | |
| import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext; | |
| import org.apache.jmeter.samplers.SampleResult; | |
| import org.apache.log.Logger; | |
| import org.apache.http.client.methods.HttpGet; |
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/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 |
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
| 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 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 | |
| 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 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
| 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: |
NewerOlder