Skip to content

Instantly share code, notes, and snippets.

View jstangroome's full-sized avatar

Jason Stangroome jstangroome

View GitHub Profile
@hummer2k
hummer2k / magento2-varnish-4.0.vcl
Last active August 8, 2019 09:06
Magento 2 vcl for varnish 4
vcl 4.0;
import std;
# The minimal Varnish version is 4.0
backend default {
.host = "{{ host }}";
.port = "{{ port }}";
}
@mfournier
mfournier / varnish4.diff
Created October 21, 2014 14:43
initial patch adding varnish4 support to collectd
diff --git configure.ac configure.ac
index 9dd30c7..26c342a 100644
--- configure.ac
+++ configure.ac
@@ -4591,7 +4591,7 @@ if test "x$with_libvarnish" = "xyes"
then
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $with_libvarnish_cflags"
- AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
+ #AC_CHECK_HEADERS(varnish/varnishapi.h, [], [with_libvarnish="no (varnish/varnishapi.h not found)"])
@aaronpowell
aaronpowell / jq.js
Created August 14, 2014 23:40
jq - a simple cli for JSON querying
process.stdin.setEncoding('utf8');
var what = process.argv[2] || '';
process.stdin.on('readable', function () {
var chunk = process.stdin.read();
if (chunk) {
var obj = JSON.parse(chunk);
Plugin is finished {:plugin=><LogStash::Inputs::S3 bucket=>"bucket_name", credentials=>["access_key", "secret_key"], region_endpoint=>"us-east-1", type=>"elb-access", sincedb_path=>"/dev/null">, :level=>:info, :file=>"logstash/plugin.rb", :line=>"59"}
A plugin had an unrecoverable error. Will restart this plugin.
Plugin: <LogStash::Inputs::S3 bucket=>"bucket_name", credentials=>["access_name", "secret_key"], region_endpoint=>"us-east-1", type=>"elb-access", sincedb_path=>"/dev/null">
Error: no time information in ""
Exception: ArgumentError
Stack: file:/path/logstash-1.4.1/vendor/jar/jruby-complete-1.7.11.jar!/META-INF/jruby.home/lib/ruby/1.9/time.rb:267:in `parse'
/path/logstash-1.4.1/lib/logstash/inputs/s3.rb:261:in `sincedb_read'
/path/logstash-1.4.1/lib/logstash/inputs/s3.rb:147:in `process_new'
/path/logstash-1.4.1/lib/logstash/inputs/s3.rb:137:in `run'
org/jruby/RubyKernel.java:1521:in `loop'
@jssjr
jssjr / README.md
Created October 25, 2013 18:27
Graphite is great, but unfortunately the web UI itself isn't instrumented. (Yo dawg, I heard you like graphite.) Enable the directives to log render and cache performance, then monitor this with collect's tail plugin so you can visualize graphite performance.

render-performance

@rjeczalik
rjeczalik / building-static-nginx.txt
Created October 19, 2013 15:37
Notes on building nginx as a static binary.
# Building static nginx for teh lulz
#
# basic dependencies
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev
# download nginx and openssl
wget http://nginx.org/download/nginx-1.5.6.tar.gz
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6
@guifromrio
guifromrio / nodejs-ubuntu-bind-port-80.md
Last active January 10, 2024 22:47
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@jjmaestro
jjmaestro / whisper-calculator.py
Last active November 26, 2019 07:13
whisper-calculator.py: Calculates the size of the whisper storage for the given retention (in frequency:history format)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def archive_to_bytes(archive):
def to_seconds(s):
SECONDS_IN_A = {
's': 1,
'm': 1 * 60,
'h': 1 * 60 * 60,
@robwierzbowski
robwierzbowski / gitcreate.sh
Last active August 8, 2023 07:31
A simple litte script. Create and push to a new github repo from the command line.
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
@relekang
relekang / wsgi.py
Created February 12, 2013 22:18
django wsgi.py with new relic intialize
# -*- coding: utf-8 -*-
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
import newrelic.agent
newrelic.agent.initialize(os.path.join(os.path.dirname(os.path.dirname(__file__), 'newrelic.ini')
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()