Skip to content

Instantly share code, notes, and snippets.

View 2called-chaos's full-sized avatar
😐
perpetually bored

Sven Pachnit 2called-chaos

😐
perpetually bored
View GitHub Profile
@2called-chaos
2called-chaos / setup-autossh-tunnel.sh
Last active April 30, 2018 15:38
Adds a start script which will setup a port forwarding over SSH (via autossh) for database traffic tunneling. You can use this script for every port actually. I might called it different but I only need it for MySQL ;-)
#!/bin/bash
# Install:
# curl -O https://gist.githubusercontent.com/2called-chaos/4285767/raw/setup-autossh-tunnel.sh
# chmod u+x setup-autossh-tunnel.sh
# ./setup-autossh-tunnel.sh
SSH_USER="mysql_tunnel"
SSH_SERVER="db.example.net"
SSH_PORT="22"
@2called-chaos
2called-chaos / install_nginx_ppa.sh
Last active July 9, 2019 12:51
Install nginx from nginx.org PPA sources
# add source
cat >> /etc/apt/sources.list <<EOF
# Nginx
deb http://nginx.org/packages/ubuntu/ disco nginx
deb-src http://nginx.org/packages/ubuntu/ disco nginx
EOF
# add signing key
curl http://nginx.org/packages/keys/nginx_signing.key | sudo apt-key add -
@2called-chaos
2called-chaos / each_with_position.rb
Created October 2, 2012 22:56
Ruby Enumerable each_with_position (provides #first? #last? #prev #next ...)
##################################
### SCROLL DOWN FOR AN EXAMPLE ###
##################################
module Enumerable
# your each_with_position method
def each_pos &block
EachWithPosition.each(self, &block)
end
end
@skylock
skylock / ReadMe.md
Last active September 11, 2023 13:51 — forked from devinrhode2/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

To check the current limits on your Mac OS X system, run in terminal:

launchctl limit maxfiles
ulimit -a

Steps