Skip to content

Instantly share code, notes, and snippets.

View paulbjensen's full-sized avatar

Paul Jensen paulbjensen

View GitHub Profile
@staringispolite
staringispolite / asciiputsonglasses
Last active March 22, 2024 06:39
Ascii art sunglasses meme
Puts on glasses:
(•_•)
( •_•)>⌐■-■
(⌐■_■)
Takes off glasses ("mother of god..."):
(⌐■_■)
( •_•)>⌐■-■
@bmeck
bmeck / Readme.md
Created April 3, 2012 15:02
Simple Vertical Load Balancing for TCP in Node.js

About

This is the most basic example of vertical scaling by transferring connections to workers, rather than sharing server sockets. It was presented at JSConf US 2012. With this you can create some interesting balancing algorithms that cluster would defer to internal/OS logic.

Exercises

A good first project when working with this is to implement sticky sessions based upon connection.remoteAddress and/or connection.remotePort.

A good advanced project is to change from a TCP based balancer to a HTTP(S) one and balance based upon not just connection.remoteAddress etc. but also on the protocol and/or Host header.

@gasi
gasi / akamai.js
Created February 17, 2012 17:31
Purge Akamai CDN using Node.js
var request = require('request');
var settings = {
AKAMAI_USER: 'test',
AKAMAI_PASSWORD: '...',
AKAMAI_NOTIFICATION_EMAIL: ''
};
var akamai = exports;
var SOAP_URL = 'https://ccuapi.akamai.com:443/soap/servlet/soap/purge';
@mbbx6spp
mbbx6spp / README.md
Created December 4, 2011 04:24
Best UNIX shell-based tools I can't live without with example usages

Best UNIX Shell tools

These are a list of usages of shell commands I can't live without on UNIX-based systems.

Install

Mac OS X

Using Homebrew (yes, I am opinionated) you can install the following tools with the following packages:

@felixge
felixge / command.sh
Created October 29, 2011 13:43
Bash stuff for fighting a weak DOS attack
# Here a few bash one-liners that helped me analyze / fight a weak DOS attack against debuggable.com. Mostly for future reference.
# The attacker was opening lots of tcp connections without sending data, I believe it's called a SYN flood, see: http://tools.ietf.org/html/rfc4987#section-3.2
# Step 0: Check what is going on at port 80
$ netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c
# Step 1: Increase the number of available fds
$ ulimit -n 32000
# Step 2: Restart your webserver, for me:
@netzpirat
netzpirat / 0_README.md
Created November 12, 2010 10:42
Continuous CoffeeScript testing with Guard and Jasmine

Continuous CoffeeScript testing with Guard and Jasmine

This Gist shows how to set up a Rails project to practice BDD with CoffeeScript, Guard and Jasmine. You can see this setup in action on Vimeo

  • Install Gems with Bundler with bundle install
  • Define your guards with mate Guardfile
  • Initialize Jasmine with bundle exec jasmine init
  • Configure Jasmine with mate spec/support/yasmine.ym
  • Start Guard with bundle exec guard
Apple Developer
Technologies
Resources
Programs
Support
Member Center
Search Developer