Skip to content

Instantly share code, notes, and snippets.

View Fastidious's full-sized avatar
🐵
Just another one.

Fastidious Fastidious

🐵
Just another one.
View GitHub Profile
@Fastidious
Fastidious / tunnel.sh
Last active June 3, 2016 18:04 — forked from m3nt0r/proxy-toggle.sh
Starts/Stops an SSH Tunnel and SOCKS Proxy on OS X.
#!/bin/sh
SSH_HOST=user@host # Change this accordingly.
SSH_PORT=22 # If SSH server is listening on different port, change this.
PROXY_INTERFACE="Ethernet" # Change this to Wi-Fi, if you are on wireless, or to whatever your NIC is.
PROXY_HOST=localhost # This doesn't change.
PROXY_PORT=8080 # Pick a different port if you like.
if [[ $1 == "start" ]]; then
ssh -D $PROXY_PORT -f -C -q -N $SSH_HOST -p$SSH_PORT
@Fastidious
Fastidious / show-all-256-colors.py
Last active August 29, 2015 14:10 — forked from mgedmin/show-all-256-colors.py
Print a swatch using all 256 colors of 256-color-capable terminals.
#!/usr/bin/python
"""Print a swatch using all 256 colors of 256-color-capable terminals."""
__author__ = "Marius Gedminas <marius@gedmin.as>"
__url__ = "https://gist.github.com/mgedmin/2762225"
__version__ = '2.0'
def hrun(start, width, padding=0):
# -p get all images, etc. needed to display HTML page.
# --mirror turns on recursion and time-stamping, sets infinite
# recursion depth and keeps FTP directory listings
# --html-extension save HTML docs with .html extensions
# --convert-links make links in downloaded HTML point to local files.
wget --mirror -p --html-extension --convert-links www.example.com
@Fastidious
Fastidious / s3.sh
Last active August 29, 2015 14:20 — forked from chrismdp/s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
file=$2
@Fastidious
Fastidious / nginx_image_filter.conf
Last active August 26, 2015 18:37 — forked from tsertkov/nginx_image_filter.conf
On the fly image resizing with image_filter
# On the fly resizing of images inside /images/*/
# based on query string "width" and "height" parameters
location ~ /images/(.+)/ {
set $width -;
set $height -;
set $entity $1;
if ($arg_width) {
set $width $arg_width;
@Fastidious
Fastidious / gist:e159e684b4cc13b6187c
Last active September 9, 2015 17:41 — forked from jellea/gist:6510897
Node.js Forever rcng script for FreeBSD
#!/bin/sh
# PROVIDE: forever
# REQUIRE: NETWORKING SERVERS DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Taken from http://habrahabr.ru/post/137857/
. /etc/rc.subr
@Fastidious
Fastidious / Word and Character Count.scpt
Created October 5, 2015 14:23
Word and Character Count service for Mac OS X
-- Word and Character Count service for Mac OS X
-- Adds a Word and Character Count option to the text selection context menu
-- Use Automator to create a new service, then select the Run AppleScript action. Make
-- sure the service is set to receive "text", at the top of the window. Paste in this code
-- and save as "Word and Character Count". Now switch to a new app, select some text,
-- right-click, go to Services, and find the new option.
-- Copyright 2015, Noah Slater <nslater@apache.org>
@Fastidious
Fastidious / appify
Created June 8, 2016 13:57 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@Fastidious
Fastidious / colorman.zsh
Created August 16, 2016 11:56 — forked from boredzo/colorman.zsh
Color Terminal for bash/zsh etc..
man() {
env \
LESS_TERMCAP_md=$'\e[1;36m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[1;40;92m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[1;32m' \
man "$@"
}
@Fastidious
Fastidious / linux.md
Last active March 8, 2018 12:26 — forked from boredzo/linux.txt
The Linux Cheatsheet I published 12 and a half years ago (and almost 15 years after the original Linux Cheatsheet).

About the Linux Cheatsheet

maintained by Mac-arena the Bored Zo, [email address that no longer works] copyright 2003 Mac-arena the Bored Zo available from [URL no longer works] HTML/PHP version at [URL works but no longer has a mirror] MIRRORS WELCOME! please email me if you want to mirror. some commands submitted by Steve Leopardi [email address deleted], frost, and rajnchaos Linux Cheatsheet IS NOT PUBLISHED BY IDG BOOKS and anyone who says it is is