Skip to content

Instantly share code, notes, and snippets.

View n8felton's full-sized avatar
🍎

Nate Felton n8felton

🍎
View GitHub Profile
@n8felton
n8felton / hack.sh
Created March 31, 2012 15:07 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
#!/bin/bash
# This function will echo text centered horizontally within the shell window.
echo_centered () {
# The character to be used as left/right filler.
if [[ -n "$2" ]]; then
FILLER="$2"
else
FILLER="="
#!/bin/bash
# https://github.com/jacobsalmela
# Enables outbound SSH in single-user mode on OS X
# Save this file as /var/root/.profile and boot into single-user mode
# Last tested on 10.9.2
#----------VARIABLES---------
# Manually set ethernet device ID
#!/usr/bin/env bash
# check_freak.sh
# (c) 2015 Martin Seener
# Simple script which checks SSL/TLS services for the FREAK vulnerability (CVE 2015-0204)
# It will output if the checked host is vulnerable and returns the right exit code
# so it can also be used as a nagios check!
PROGNAME=$(basename $0)
@n8felton
n8felton / beamsync.py
Last active August 29, 2015 14:24 — forked from pudquick/beamsync.py
#!/usr/bin/python
import ctypes, ctypes.util
# Import CoreGraphics as a C library, so we can call some private functions
c_CoreGraphics = ctypes.CDLL(ctypes.util.find_library('CoreGraphics'))
def disable_beam_sync(doDisable):
if doDisable:
# Disabling beam sync:
# 1st: Enable Quartz debug
@n8felton
n8felton / bash-snippets.sh
Created June 20, 2016 14:59 — forked from putnamhill/bash-snippets.md
bash snippets - these are mostly just notes for myself; some I've found and some I've made
# bash function to get yes/no feed back from the user (return is considered no here)
agree() {
local question="$1"
while true; do
read -p "$question " answer
case $answer in
[Yy]|[Yy][Ee][Ss]) return 0 ;;
[Nn]|[Nn][Oo]|'') return 1 ;; # empty string is default
*) echo "Please answer yes or no.";;
@n8felton
n8felton / bash-cheatsheet.sh
Created June 20, 2016 14:59 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@n8felton
n8felton / 0_reuse_code.js
Created January 4, 2017 15:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/python
# As written, this requires the following:
# - OS X 10.6+ (tested on 10.12.6 and 10.14.3)
# - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6)
# - pyObjC (as such, recommended to be used with native OS X python install)
# Run with root
import objc, ctypes.util, os.path, collections