Skip to content

Instantly share code, notes, and snippets.

View NickWoodhams's full-sized avatar

Nick Woodhams NickWoodhams

View GitHub Profile
@NickWoodhams
NickWoodhams / .zshrc
Created August 27, 2015 03:47
Dotfile for command line. Jump and go are pretty awesome.
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="pure"
# Aliases
alias pyc='find . -name "*.pyc" -exec rm -rf {} \;'
alias v="source venv/bin/activate"
alias extra="sudo sh /Users/nick/Dropbox/Automation/copy-extra-settings-manually.sh"
alias a="sudo apachectl graceful"
alias n="sudo nginx -s stop && sudo nginx;"
@NickWoodhams
NickWoodhams / pwd.py
Created August 27, 2015 03:50
Copies current directory to clipboard. If you have a filename arg after, it will include this filename. If it's got /static in the path it will copy the relative url (useful when coding in Flask)
#!/usr/local/bin/python
import os
import sys
import subprocess
from pprint import pprint
if len(sys.argv) > 1:
path = os.getcwd() + "/" + sys.argv[1]
else:
@NickWoodhams
NickWoodhams / pwd.py
Created June 24, 2014 20:22
A better implementation of the built in /bin/pwd function that lists the current working directory. Add a command line argument to give the full file path. Also copies the path to the clipboard automatically on Mac.
#!/usr/bin/python
import os
import sys
from pprint import pprint
if len(sys.argv) > 1:
path = os.getcwd() + "/" + sys.argv[1]
else:
@NickWoodhams
NickWoodhams / addhost
Last active August 29, 2015 14:06
Script to quickly add hosts to your ~/.ssh/config file
#!/bin/sh
echo "==========Add Host to SSH Config============="
echo "What NICKNAME will you call the host? "
read host_name
echo "What USER will be logging in? "
read user_name
echo "What IP ADDRESS is the host? "
read ip_address
echo "What SSH PORT is the host using? "
@NickWoodhams
NickWoodhams / enapp
Created October 1, 2014 13:20
Quickly create matching Nginx and UWSGI app configs
#!/bin/sh
#creates nginx and uwsgi files and enables sites
echo "------------------Add-App------------------"
echo "What is the ABSOLUTE PATH of your WSGI file? "
read wsgi_path
app_home=$(dirname "$wsgi_path")
echo "Using $app_home for your App Directory."
echo "Using $app_home/venv for your Virtualenv."
@NickWoodhams
NickWoodhams / close_deleted_file.py
Last active August 29, 2015 14:12
A SublimeText3 Plugin to close a file's tab if that file is deleted. Saves you from having 3 prompts every time you delete a file. Place in the Packages/User folder.
import sublime_plugin
import sublime
import os
class MyEvents(sublime_plugin.EventListener):
def on_modified_async(self, view):
s = view.file_name()
if s:
if not os.path.exists(s):
@NickWoodhams
NickWoodhams / create_efi_raid.sh
Created February 12, 2015 15:49
Write Clover EFI folder to a HDD or SSD EFI partition when running Mac OS X.
sudo newfs_msdos -v EFI -F 32 /dev/rdisk1s1
sudo mkdir /Volumes/EFI
sudo mount -t msdos /dev/disk1s1 /Volumes/EFI
sudo rm -rf /Volumes/EFI/EFI
sudo cp -R /EFI /Volumes/EFI
sudo diskutil unmount /Volumes/EFI
sudo newfs_msdos -v EFI -F 32 /dev/rdisk2s1
sudo mkdir /Volumes/EFI
sudo mount -t msdos /dev/disk2s1 /Volumes/EFI
@NickWoodhams
NickWoodhams / memmap-bad-config.txt
Created March 9, 2015 07:36
X99-UD5 Clover Memmap debugs - With and without additional PCIe SSD
Type Start End # Pages Attributes
BS_Code 0000000000000000-0000000000007FFF 0000000000000008 000000000000000F
Available 0000000000008000-000000000003EFFF 0000000000000037 000000000000000F
BS_Data 000000000003F000-000000000003FFFF 0000000000000001 000000000000000F
BS_Code 0000000000040000-000000000009FFFF 0000000000000060 000000000000000F
Available 0000000000100000-000000000C985FFF 000000000000C886 000000000000000F
LoaderCode 000000000C986000-000000000CAF4FFF 000000000000016F 000000000000000F
BS_Data 000000000CAF5000-000000000FFFFFFF 000000000000350B 000000000000000F
BS_Code 0000000010000000-000000001000AFFF 000000000000000B 000000000000000F
BS_Data 000000001000B000-0000000022988FFF 000000000001297E 000000000000000F
@NickWoodhams
NickWoodhams / osxaptio-error-when-booting-from-usb.txt
Created March 11, 2015 10:42
Failed Memmap on X99-UD5 due amount of PCIe devices, memmap is ghosting so when USB drives are removed it is still failing.
Type Start End # Pages Attributes
BS_Code 0000000000000000-0000000000007FFF 0000000000000008 000000000000000F
Available 0000000000008000-000000000003EFFF 0000000000000037 000000000000000F
BS_Data 000000000003F000-000000000003FFFF 0000000000000001 000000000000000F
BS_Code 0000000000040000-000000000009FFFF 0000000000000060 000000000000000F
Available 0000000000100000-000000000181BFFF 000000000000171C 000000000000000F
LoaderCode 000000000181C000-00000000018EFFFF 00000000000000D4 000000000000000F
ACPI_Recl 00000000018F0000-0000000001927FFF 0000000000000038 000000000000000F
Available 0000000001928000-00000000019B7FFF 0000000000000090 000000000000000F
LoaderCode 00000000019B8000-0000000001A52FFF 000000000000009B 000000000000000F
@NickWoodhams
NickWoodhams / drivers64UEFI-contents.txt
Created March 27, 2015 18:17
Clover memory debugging files
Directory of: FS10:\EFI\CLOVER\drivers64UEFI\
13:29:40 27/03/2015 <DIR> 1,024 .
13:29:38 27/03/2015 <DIR> 1,536 ..
13:29:40 27/03/2015 31,104 EmuVariableUefi-64.efi
13:29:40 27/03/2015 18,880 FSInject-64.efi
13:29:40 27/03/2015 24,900 HFSPlus.efi
13:29:40 27/03/2015 21,824 OsxAptioFixDrv-64.efi
13:29:40 27/03/2015 2,912 OsxFatBinaryDrv-64.efi
17:48:46 27/03/2015 2 drivers64UEFI-contents.txt
6 File(s) 99,622 bytes