Skip to content

Instantly share code, notes, and snippets.

View Xeus's full-sized avatar

Ben Turner Xeus

View GitHub Profile
@plentz
plentz / nginx.conf
Last active May 28, 2026 05:18
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@stevenharman
stevenharman / postgres_open_connections.sql
Last active April 3, 2018 17:23
View open connections to a PostgreSQL 9.2+ database. Quite useful when you're seeing ActiveRecord::ConnectionTimeoutError on Heroku.
-- On Heroku:
-- $ heroku pg:psql
-- An explaination of the columns on the pg_stat_activity table:
-- http://www.postgresql.org/docs/9.2/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
select
pid, application_name, query, waiting, state, state_change
from pg_stat_activity
where usename = current_user
order by state_change desc;
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 18, 2026 17:53
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@ebidel
ebidel / Web Components Resources.md
Last active March 23, 2026 03:02
List of resources related to Web Components
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active May 30, 2026 13:44
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@dustinfarris
dustinfarris / Sharing Django Users and Sessions Across Projects
Created July 26, 2013 00:38
This is a dated document and may be improved on.
# Sharing Django Users and Sessions Across Projects
By Dustin Farris on 22 Feb 2012
This document describes how to share users created using Django's auth system with other
Django projects. It is not a hack; it simply makes use of the database router and
middleware system that Django comes with out of the box.
## Introduction
@willurd
willurd / web-servers.md
Last active July 5, 2026 17:25
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
const int buttonPin = 2; // microswitch analog pin #
const int ledPin = 11; // LED digital pin #
const int pwPin = 10; // pulse width mod pin for sonic rangefinder
int buttonState = 0; // is switch HIGH or LOW?
int sonicRangeFinderDistance = 50; // see end of loop()
// quantity of values to find the median (sample size). Needs to be an odd number
int arraysize = 9;
@diorahman
diorahman / upload.js
Created March 20, 2013 09:06
upload image to twitter using request.js
var request = require('request')
var fs = require('fs')
var path = require('path')
var oauth = {
consumer_key: "consumer_key",
consumer_secret: "consumer_secret",
token: "token",
token_secret: "token_secret"
}
@Xeus
Xeus / values.md
Created December 25, 2012 06:01
Galapag.us Tribal Values

The Galapag.us Tribe

Our tribal values:

  • We believe that a primary goal of life is to maximize eudaimonia and to help others do the same.
  • We individuals own our own data, and can control its availability.
  • We believe in sharing and strength through interconnectedness.
  • We believe in transparency and accountability.
  • Our data is a powerful form of expression of our own identities, and we should be allowed to fully show and present that data identity and reputation in a free society.
  • We are each members of many tribes and have many identities and faces, and only through all layers combined can we be understood in context.