Skip to content

Instantly share code, notes, and snippets.

View jstangroome's full-sized avatar

Jason Stangroome jstangroome

View GitHub Profile
@drawveloper
drawveloper / nodejs-ubuntu-bind-port-80.md
Last active September 19, 2024 01:07
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:

@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
@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

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'
@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);
@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)"])
@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 }}";
}
@jpoehls
jpoehls / example.ps1
Created April 28, 2015 14:45
Symlink support in PowerShell V5 *-Item cmdlets
### SYMBOLIC LINK FILES
# Create a new symbolic link file named MySymLinkFile.txt in C:\Temp which links to $pshome\profile.ps1
cd C:\Temp
New-Item -ItemType SymbolicLink -Name MySymLinkFile.txt -Target $pshome\profile.ps1 # File
# Target is an alias to the Value parameter
# Equivalent to above
New-Item -ItemType SymbolicLink -Path C:\Temp -Name MySymLinkFile.txt -Value $pshome\profile.ps1
# Equivalent to above
@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active May 28, 2025 06:56
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@Kovrinic
Kovrinic / .gitconfig
Last active May 13, 2025 07:15
git global url insteadOf setup
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "[email protected]:"]
insteadOf = git://github