Skip to content

Instantly share code, notes, and snippets.

View dstroot's full-sized avatar
:octocat:
Slingin' Code

Dan Stroot dstroot

:octocat:
Slingin' Code
View GitHub Profile
@dstroot
dstroot / performance.txt
Created May 25, 2012 01:27
Performance Tuning your TCP Stack
#!/bin/bash
echo "*****************************************"
echo " Based on information from Google"
echo " http://dev.chromium.org/spdy/spdy-best-practices"
echo "*****************************************"
sudo su
yum –y update
echo "*****************************************"
echo " Changing initcwnd and initrwnd"
echo " Step 1: check route settings."
@dstroot
dstroot / install_postgresql.sh
Created June 13, 2012 00:26
Install PostgreSQL on Amazon AMI
#!/bin/bash
###############################################
# To use:
# https://raw.github.com/gist/2776351/???
# chmod 777 install_postgresql.sh
# ./install_postgresql.sh
###############################################
echo "*****************************************"
echo " Installing PostgreSQL"
echo "*****************************************"
@dstroot
dstroot / raspberry_sendmail.sh
Created November 18, 2012 16:10
Setup email routing (Sendmail) on Asterisk Raspberry Pi
# Set "Smart" Relay Host
sudo sed -i.bak -e 's/DS$/DSsmtp.west.cox.net/' /etc/mail/sendmail.cf
# Restart Sendmail
/etc/init.d/sendmail restart
@dstroot
dstroot / github-ubuntu.sh
Last active September 20, 2022 08:23
Setting up github on Ubuntu
#!/bin/bash
###############################################
# To use:
# wget https://raw.github.com/gist/4411254
# chmod 777 github-ubuntu.sh
# ./github-ubuntu.sh
###############################################
echo "*****************************************"
echo " Step 1: Check your keys"
echo "*****************************************"
@dstroot
dstroot / setup_nginx.sh
Last active August 29, 2015 13:56
Setup NGINX on Ubuntu
#!/bin/bash
###############################################
# To use:
# wget https://raw.github.com/gist/4411254
# chmod 777 setup_nginx.sh
# ./setup_nginx.sh
###############################################
echo "*****************************************"
echo " Step 1: Install nngix"
echo "*****************************************"
@dstroot
dstroot / nginx_config_1.txt
Last active August 29, 2015 13:56
Configuration for nginx in front of node
# Example 1
# -------------------------------------------------
# nginx config file for nodejs
#
# you can put nginx in front of node for two good reasons:
# 1) To take some of the load off nodejs for serving
# anything static.
# 2) To run multiple nodjs sites on one server
# domain1:80 -|->nginx-|-> nodejs:3000
# domain2:80 -| |-> nodejs:4000
// This is for SEO: We *only* want to serve from
// either www.domain.com or just domain.com but *not* both.
// So we need to choose and then do a 301 redirect to get
// traffic where we want it.
//
// NOTE: Don't hardcode the http:// or https:// in the redirect
// URI; this makes life suck when switching between dev and prod
// environments - use req.protocol instead as we do below.
//
// Also note that in order to use req.protocol reliably behind a
@dstroot
dstroot / gist:48adce48ab2857ae9c0a
Created June 22, 2014 19:26
conservatory Error (403): Forbidden
❯ jitsu deploy
info: Welcome to Nodejitsu dstroot
info: jitsu v0.13.16, node v0.10.28
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in node app.js
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically
warn: About to write /Users/Dan/Code/skeleton/package.json
data:
@dstroot
dstroot / .jscsrc
Last active August 29, 2015 14:03
issue with gulp-jscs
{
"disallowTrailingComma": true,
"requireSpaceAfterLineComment": true,
"requireSpacesInConditionalExpression": true
}
@dstroot
dstroot / app.js
Created July 13, 2014 16:29
Gulp, BrowserSync, Node, and Nodemon all working in harmony. ;)
/**
* World's simplest express server
* - used to serve index.html from /public
*/
var express = require('express');
var serveStatic = require('serve-static');
var app = express();
app.use(serveStatic(__dirname + '/public'));