This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Spotlight indexing sometimes runs away with CPU. Processes are md*, e.g. mdworker, mds_stores | |
# turn off indexing | |
sudo mdutil -a -i off | |
# and back on | |
sudo mdutil -a -i on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
killall Dock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo killall coreaudiod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% is the current file relative to cwd | |
%:p is the full path of said file | |
%:h is the directory relative to cwd | |
%:p:h is the full path of the directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ foo=1:2:3:4:5 | |
$ echo ${foo##*:} | |
5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.inputrc | |
set editing-mode vi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Grab a list of 10 random males from bamboohr (for random stuff from the random committee) | |
To use go here: https://websummit.bamboohr.co.uk/employees/directory.php | |
Then run the script below in the console, modifying the filter and the for loop to control | |
the initial selection and the total number | |
*/ | |
// shuffle yoinked from stack overflow | |
function shuffle(array) { | |
var currentIndex = array.length, temporaryValue, randomIndex ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pick a random number between 0-127 | |
# NB not cryptographically sound | |
$ echo $(( $RANDOM % 128 )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#relies on AWS CLI & jq for JSON processing | |
for name in `aws iam list-users | jq -r .Users[].UserName`; do aws iam list-access-keys --user-name $name | jq ' .AccessKeyMetadata[] | .UserName + " " + .AccessKeyId'; done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# send two test emails to jd@cilabs.com | |
for i in {1..2}; do echo $i | mail -s "ping $i" jd@cilabs.com; done |
NewerOlder