Skip to content

Instantly share code, notes, and snippets.

View emilefraser's full-sized avatar

Emile Fraser emilefraser

View GitHub Profile
@emilefraser
emilefraser / mac-based-bash-scripts.sh
Last active June 12, 2017 02:11
[Bash Scripts for Mac] #shell #bash #run
#How do I loop through only directories in bash?
for d in */ ; do
echo "$d"
done
# copy
cp -source -destination
# create file
touch .bash_profile
@emilefraser
emilefraser / dev-configs.bash
Last active June 17, 2017 16:04
[Mac Additional Configs] #mac #configure #run
# additional dev configs to set
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder ShowStatusBar -bool true
defaults write NSGlobalDomain KeyRepeat -int 0.02
defaults write NSGlobalDomain InitialKeyRepeat -int 12
chflags nohidden ~/Library
@emilefraser
emilefraser / homebrew-install.sh
Last active June 12, 2017 01:49
[Homebrew Setup] #installer #homebrew #install
# install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install wget
# Homebrew installs packages to their own directory and then symlinks their files into /usr/local.
$ cd /usr/local
$ find Cellar
Cellar/wget/1.16.1
Cellar/wget/1.16.1/bin/wget
Cellar/wget/1.16.1/share/man/man1/wget.1
@emilefraser
emilefraser / bash-application-management.sh
Last active July 6, 2022 18:42
[Bash Basics] #shell #bash #howto
# find all files linked to application
mdfind -name "bitbar"
# remove fully an application
sudo rm -rif ~/Directory/Component/Removeme.pane
sudo rm -rif /TheLibrary/LaunchDaemons/sketchyd
sudo rm -rif /usr/sbin/crudrunner
sudo rm -rif ~/Download/sketchydaemon-installer.tgz
mdfind -name [application name]
@emilefraser
emilefraser / git-cient-configure.sh
Last active June 12, 2017 02:39
[Git Client - Configuring] #github #git #configure
# IF VIA SSH
# ***********
# If use of ssh key
# ssh-keygen -t rsa -C "user@domain.com"
# Copy ssh key to github.com
# subl ~/.ssh/id_rsa.pub
# Test connection
# ssh -T git@github.com
@emilefraser
emilefraser / mac-setup-script.sh
Last active July 2, 2024 02:57
[Mac Setup Script] #mac #install #configure
# Complete macOS Setup
# From clean install to fully configured.
# Step 1: Init Environment
#Temporarily Disable sudo Password Timeout
#The sudo password timeout is re-enabled at the end of this script. ##+BEGIN_SRC sh sudo tee /etc/sudoers.d/timeout > /dev/null <<-EOF Defaults timestamp_timeout=-1 EOF ##+END_SRC
##+BEGIN_SRC sh sudo tee /etc/sudoers.d/installer > /dev/null <<-EOF %admin ALL=(ALL) NOPASSWD:SETENV: /usr/sbin/installer EOF ##+END_SRC
@emilefraser
emilefraser / mac-housekeeping-snippets.sh
Created June 12, 2017 02:14
[Mac Housekeeping Scripts] #mac #maintain #monitor
# Shutdown Your Mac, With or Without a Delay
sudo shutdown -h now # shutdown
sudo shutdown -r now # restart
sudo shutdown -r +60 # 60 min
# uptime of mac
uptime
# Install OS X Software Updates
sudo softwareupdate -l
@emilefraser
emilefraser / mac-exe-one-liners.bash
Last active June 12, 2017 02:35
[Mac Executable Commands] #mac #run
# Remove Duplicate “Open With…” Entries
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
# Open Files In Any Application
open -a /Applications/AppName.app /path/to/file.txt
@emilefraser
emilefraser / homebrew_formulas.sh
Created June 12, 2017 02:33
[Homebrew Commands] #installer #homebrew #run
###############################################################################
# Install Applications #
###############################################################################
# Install Homebrew
echo "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
clear
@emilefraser
emilefraser / npm_scripts.sh
Last active June 12, 2017 02:39
[NPM Scripts] #installer #npm #run
#Installing Nodejs
echo "Installing Nodejs"
nvm install node
nvm use node
npm install -g coffee-script
npm install -g grunt-cli
npm install -g gulp
npm install -g bower