Skip to content

Instantly share code, notes, and snippets.

View nodesocket's full-sized avatar

Justin Keller nodesocket

View GitHub Profile
@nodesocket
nodesocket / kibana
Created July 7, 2013 01:49
Kibana init.d service script.
#!/bin/bash
### BEGIN INIT INFO
# Provides: kibana
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Make sense of a mountain of logs.
### END INIT INFO
@nodesocket
nodesocket / gist:1536941
Created December 30, 2011 00:37
Supervisord Configuration
[supervisord]
logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=25MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=5 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
MacBook-Pro ➜ ~ ping -i .5 35.184.130.5
PING 35.184.130.5 (35.184.130.5): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
BASE_PATH="/srv/www"
REPO_PATH="/srv/www/repo"
GIT_URL="https://github.com/username/repo.git"
if [ -d "$REPO_PATH" ]; then
cd $REPO_PATH || exit 3
git pull --quiet
echo "git pull successfully ran ($(git rev-parse --short HEAD))";
else
cd $BASE_PATH || exit 3
/*!
* jQuery JavaScript Library v1.12.3 -css,-css/addGetHookIf,-css/adjustCSS,-css/curCSS,-css/defaultDisplay,-css/hiddenVisibleSelectors,-css/showHide,-css/support,-css/var/cssExpand,-css/var/isHidden,-css/var/rmargin,-css/var/rnumnonpx,-css/var/swap,-effects,-effects/Tween,-effects/animatedSelector,-effects/support,-dimensions,-offset,-deprecated,-event,-event/ajax,-event/alias,-event/support,-event/focusin,-event/trigger,-wrap,-core/ready,-exports/amd
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
wget https://git.io/vpnsetup -O vpnsetup.sh && sudo \
VPN_IPSEC_PSK='your_ipsec_pre_shared_key' \
VPN_USER='your_vpn_username' \
VPN_PASSWORD='your_vpn_password' sh vpnsetup.sh
@nodesocket
nodesocket / example.sh
Created July 18, 2017 04:13
Get e-mail provider for a domain
# get mx records for a domain
iMac ➜ ~ host -t MX elasticbyte.net
elasticbyte.net mail is handled by 1 aspmx.l.google.com.
elasticbyte.net mail is handled by 10 aspmx2.googlemail.com.
elasticbyte.net mail is handled by 10 aspmx3.googlemail.com.
elasticbyte.net mail is handled by 5 alt1.aspmx.l.google.com.
elasticbyte.net mail is handled by 5 alt2.aspmx.l.google.com.
# lookup ip of the first mx record
iMac ➜ ~ dig +short aspmx.l.google.com
@nodesocket
nodesocket / main.tf
Created June 14, 2017 03:15 — forked from artburkart/main.tf
aws_security_group test thing
provider "aws" {
region = "us-east-1"
}
variable "cidr" {
# default = "0.0.0.0/0"
default = ""
}
resource "aws_security_group" "dummy" {
@nodesocket
nodesocket / go-install.md
Last active February 10, 2016 18:58
Install go on OSX

What is my shell?

echo "$SHELL"
```

**If your shell is ZSH**

````shell
brew install go --cross-compile-common
OPBEAT_APP_IDS=('e56ec269d6' '29bb1bb075' '5e6e36c7ef' '374e78ad7a')
for i in "${OPBEAT_APP_IDS[@]}"
do
curl https://opbeat.com/api/v1/organizations/OUR-ORG-ID-HERE/apps/"$i"/releases/ \
-H "Authorization: Bearer OUR-SECRET-TOKEN-HERE" \
-d rev=`git log -n 1 --pretty=format:%H` \
-d branch=`git rev-parse --abbrev-ref HEAD` \
-d machine=`hostname`
-d status=machine-completed