Skip to content

Instantly share code, notes, and snippets.

Avatar

Nik Wolfgramm niwo

View GitHub Profile
@niwo
niwo / 1. page_load_to_librato.sh
Last active Aug 29, 2015
Send page load time to librato
View 1. page_load_to_librato.sh
#!/bin/bash
: ${LIBRATO_EMAIL:?"Need to set LIBRATO_EMAIL"}
: ${LIBRATO_TOKEN:?"Need to set LIBRATO_TOKEN"}
LIBRATO_CREDS="$LIBRATO_EMAIL:$LIBRATO_TOKEN"
LIBRATO_URL="https://metrics-api.librato.com/v1/metrics"
PAGE=$1
SENSOR=${2:-$HOSTNAME}
@niwo
niwo / rbenv.sh
Created Jan 30, 2013
Global rbenv setup: enable for every user per default /etc/profile.d/rbenv.sh
View rbenv.sh
# but this at /etc/profile.d/rbenv.sh
# rbenv setup - only add RBENV PATH variables if no single user install found
if [[ ! -d "${HOME}/.rbenv" ]]; then
export RBENV_ROOT=/opt/rbenv
export PATH="$RBENV_ROOT/bin:$PATH"
eval "$(rbenv init -)"
fi
@niwo
niwo / puma
Last active Nov 12, 2018
puma with rbenv on CentOS 6
View puma
#!/bin/sh
#
# puma - this script starts and stops the puma daemon
#
# chkconfig: - 85 15
# description: Description \
# goes here...
# processname: puma
# config: /etc/puma.conf
# pidfile: /home/stanislaw/apps/micro-apps/puma/puma.pid
@niwo
niwo / rpcm.conf
Created Nov 22, 2011 — forked from mguterl/gist:308216
Unicorn init.d script (chkconfig compatible) /etc/init.d/unicorn with example application configuration scripts
View rpcm.conf
# starts all unicorns listed in /etc/unicorn/*.conf
# lives under /etc/unicorn/rpcm.conf
ENV=production
APP_ROOT=/opt/rpcm
@niwo
niwo / dlspeed.rb
Created Jul 21, 2011
Measure http download speed including partial requests
View dlspeed.rb
#!/usr/bin/env ruby
# dlspeed.rb - niwo 2011
# test speed of http downloads: partial (tail, head) and full download
# Output is csv to stdout
#################################################
require 'optparse'
@niwo
niwo / chromium_updater.rb
Created Jul 18, 2011 — forked from newtonapple/chromium_updater.rb
An automated Ruby script for grabbing the latest Mac Chromium build
View chromium_updater.rb
#!/usr/bin/env ruby
# A simple Ruby script to update Chromium from dev build.
# Currently only works on Mac and Win32.
# If you want progress bar, sudo gem install ruby-progressbar
# Read more about progress bar here: http://github.com/nex3/ruby-progressbar/tree/master
# Usage:
# ruby chromium_updater.rb
require 'fileutils'
@niwo
niwo / svn_autocommit.sh
Created Mar 25, 2011
Bash script for auto-committing from a SVN working copy
View svn_autocommit.sh
#!/bin/bash
### Settings
svn_wk='/srv/tftp/data/'
svn_user='user'
svn_passwd='passwd'
### Variables
date=`date +"%F %T"`
svn='/usr/bin/svn'
You can’t perform that action at this time.