Skip to content

Instantly share code, notes, and snippets.

auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
@devster31
devster31 / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@devster31
devster31 / links
Last active August 29, 2015 14:20
Shell redirection cheatsheet
@devster31
devster31 / serf
Last active August 29, 2015 14:21
serf init script
#!/bin/sh
### BEGIN INIT INFO
# Provides: serf
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the serf agent
# Description: starts serf agent using start-stop-daemon
@devster31
devster31 / hhvminfo.php
Last active August 29, 2015 14:22 — forked from ck-on/hhvminfo.php
hhvminfo
<?php
/*
HHVMinfo - phpinfo page for HHVM HipHop Virtual Machine
Author: _ck_
License: WTFPL, free for any kind of use or modification, I am not responsible for anything, please share your improvements
Version: 0.0.6
* revision history
0.0.6 2014-08-02 display fix for empty vs zero
0.0.5 2014-07-31 try to determine config file from process command line (may not always work), style improvements
@devster31
devster31 / apache_access.json
Created June 23, 2015 00:43
elasticsearch apache_access template
{
"order": 0,
"template": "*_apache_access",
"settings": {},
"mappings": {
"apache_logs": {
"properties": {
"country": {
"type": "string"
},
@devster31
devster31 / VVV-box.sh
Last active September 17, 2015 13:43
Varying Vagrant Vagrants base provisioning
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
# Force Locale
echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale
locale-gen en_US.UTF-8
# Install Some PPAs
echo '>>> Add Nginx development ppa'
apt-add-repository -y ppa:nginx/development 2>/dev/null
@devster31
devster31 / etc-apt-apt.conf.d-02nocache
Last active October 9, 2015 22:19 — forked from anonymous/etc-apt-apt.conf.d-02nocache
Customization for rpi minimal images
Dir::Cache {
srcpkgcache "";
pkgcache "";
}
@devster31
devster31 / down_list.txt
Last active November 18, 2015 14:38
requires html5lib, beautifulsoup4 and requests, only works with userscloud.com
https://userscloud.com/svmwe8593ehb/100th_Anniversary_Special_-_Guardians_of_the_Galaxy_01_(2014)_(digital)_(Minutemen-Faessla).cbz
https://userscloud.com/lb7fh14rhb08/Guardians_of_the_Galaxy_(FCBD_2014)_(digital)_(Minutemen-Spaztastic).cbr
https://userscloud.com/x3qo53t7kc8a/Guardians_of_the_Galaxy_-_Galaxy's_Most_Wanted_001_(2014)_(Digital)_(Zone-Empire).cbr
https://userscloud.com/0mjhxiqs2581/Guardians_of_the_Galaxy_000.1_(2013)_(digital)_(Minutemen-PhD).cbr
https://userscloud.com/x5zaf6r3jl1j/Guardians_of_the_Galaxy_001_(2013)_(21_Covers)_(Tarutaru-Novus-HD).cbr
https://userscloud.com/4crnaof2xs2z/Guardians_of_the_Galaxy_001_(2013)_(digital)_(Minutemen-PhD).cbr
https://userscloud.com/uqv1f5ck7f0m/Guardians_of_the_Galaxy_002_(2013)_(digital)_(Minutemen-PhD).cbr
https://userscloud.com/8v0giwb7viz1/Guardians_of_the_Galaxy_003_(2013)_(digital)_(Minutemen-PhD).cbr
https://userscloud.com/sp46pfmmey9i/Guardians_of_the_Galaxy_004_(2013)_(digital)_(Minutemen-PhD).cbr
https://userscloud.com/502nh7yuldeo/Guardians_o
@devster31
devster31 / day1.rb
Last active December 25, 2015 17:15
Advent of Code challenges - http://adventofcode.com
string = "<example string>"
string.count('(') - string.count(')')
count = 0
string.split('').each_with_index { |char, index|
if char == '(' then
count += 1
elsif char == ')' then