Skip to content

Instantly share code, notes, and snippets.

@wbs75
wbs75 / SkipAppleSetup
Last active October 11, 2015 23:28
Skip Apple Setup & Log-in as "Root"
#!/bin/bash
mount -uw /
touch /Volumes/Macintosh\ HD/private/var/db/.AppleSetupDone
launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
sudo -s
@wbs75
wbs75 / SSDTweaks.sh
Last active September 30, 2022 22:19
My OSX SSD Tweaks
#!/bin/bash
sudo -v
# Disable Hibernation
sudo pmset -a hibernatemode 0
# Disable Wake from Lid Open
sudo pmset lidwake 0
@wbs75
wbs75 / MtnLionDefaults.sh
Last active January 12, 2017 06:29
OSX 10.8 defaults
#!/bin/bash
# ~/.osx — https://github.com/wbs75/dotfiles/edit/master/.osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
#!/bin/bash
$ rbenv install 1.9.3-p194
$ rbenv global 1.9.3-p194
$ gem install bundler
$ gem install berkshelf
@wbs75
wbs75 / myCleanupRepair.sh
Created June 8, 2013 17:28
OSX Mtn Lion script to cleanup and repair permissions on Boot Drive.
#!/bin/bash
echo "asl cleanup..."
find . -name '*.DS_Store' -type f -ls -delete >/dev/null
echo "deleting Flash Cache..."
dscacheutil -flushcache >/dev/null
echo 'Cleaning ASL files...\c';sudo -S find -d /var/log/asl -name "AUX*" -exec rm -fr {} \;;sudo -S find -d /var/log/asl -name "*\.asl" -exec rm -fr {} \;;sudo -S find /var/log/DiagnosticMessages/ -name "*\.asl";sudo -S ls -@ailO /var/log/asl /var/log/DiagnosticMessages;echo;echo done.
@wbs75
wbs75 / .aliases
Last active February 7, 2019 01:29
aliases
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# Shortcuts
alias d="cd ~/Documents/Dropbox"
@wbs75
wbs75 / dmg-pkg-luggage
Created August 22, 2013 09:52
Barebones Script that downloads .dmg then builds .pkg from .app using luggage
USE_PKGBUILD=1
include /usr/local/share/luggage/luggage.make
TITLE=Foo
REVERSE_DOMAIN=com.foo
PACKAGE_VERSION=#.#
PAYLOAD=\
pack-foo \
FooURL="http://foo.server.com/foo-${PACKAGE_VERSION}.dmg"
@wbs75
wbs75 / Apache-Setup
Last active December 22, 2015 00:00
Apache-Setup OS X non-server
$ cd /etc/apache2/users
$ sudo nano username.conf
<Directory "/Users/username/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
@wbs75
wbs75 / Common.SSH.Commands.md
Last active August 29, 2015 14:01
Common SSH Commands - Linux Shell Commands

Navigating in UNIX

pwd	Shows the full path of the current directory
ls	Lists all the files in the current directory
ls -al	Lists all files and information
ls –alR	Lists all files and information in all subdirectories
ls -alR | more	Same as ls –alR, pausing when screen becomes full
ls -alR > filename.txt	Same as ls –alR, outputs the results to a file
ls *.html	Lists all files ending with .html

cd [directory name] Changes to a new directory

@wbs75
wbs75 / *.bash_profile
Last active August 29, 2015 14:02
"bash_profile" for boxen
# Load ~/.bash_prompt, ~/.exports, ~/.aliases, ~/.functions and ~/.extra
# ~/.extra can be used for settings you don’t want to commit
# Add `~/bin` to the `$PATH`
export PATH="$HOME/bin:$PATH"
for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; do
[ -r "$file" ] && source "$file"
done
if [ -f /opt/boxen/homebrew/etc/bash_completion ]; then