NOTE: 534 stars, 106 forks. I love you all. Please contribute tips and edits back to this cheat sheet -- email's [email protected] and you can treat gists like git repositories and send git diffs.
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
#!/bin/bash | |
dpkg-query --search ssh* | awk '{print $1}' | tr -d ':,' | sort -u | xargs -n 1 apt-cache search | sort -u | |
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
#!/bin/bash | |
PROJECT_DIR=~/httrack/airbnb | |
LISTING_URL='https://www.airbnb.com/rooms/1300067?s=9Xmw' | |
brew install httrack | |
echo "Using httrack to download all images" | |
echo "Update cookies.txt within $PROJECT_DIR if login needed" | |
echo "" |
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
set -e | |
echo "Get homebrew in order..." | |
if [[ -z $(which brew) ]]; then | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
else | |
brew update | |
brew upgrade | |
fi |
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
# reversed and limited to last 100 rows | |
sudo awk '{print $8" "$5}' /mnt/log/nginx/www.extrabux.com.access_log | uniq -w 4 -c | grep -v " [1-5] " | tac | head -n 100 | |
6 /password/reset [14/Nov/2014:01:27:53 | |
6 /password/reset [14/Nov/2014:01:27:16 | |
7 /password/reset [14/Nov/2014:01:27:02 | |
6 /password/reset [14/Nov/2014:01:26:53 |
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
// Requires jQuery | |
// Running from https://www.airbnb.com/rooms/4469705 works | |
// JSFiddle example of installing as a bookmarklet: http://jsfiddle.net/smj10j/sjwko4bp/ | |
var listingId = window.location.pathname.replace('/rooms/',''); | |
var calData = {}; | |
$.getJSON('https://www.airbnb.com/api/v1/listings/'+listingId+'/calendar?key=d306zoyjsyarp7ifhu67rjxn52tv0t20', function(data) { | |
calData = data.calendar; |
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
#!/bin/bash | |
# | |
# Used by and included in https://github.com/smj10j/git_notified_on_trello | |
# | |
echo -n "Press any key to open Trello. Log in if prompted, copy your developer API key, and return to this window." | |
read -e < /dev/tty | |
open https://trello.com/1/appKey/generate |
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
#!/bin/bash | |
# | |
# https://meta.discourse.org/t/create-a-swapfile-for-your-linux-server/13880 | |
# | |
install -o root -g root -m 0600 /dev/null /swapfile | |
dd if=/dev/zero of=/swapfile bs=1k count=2048k | |
mkswap /swapfile | |
swapon /swapfile |
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
# find the first occurrence of each Fatal error | |
grep "Fatal" combined | awk '{FS="(error: )|( in \/mnt)|( - \/mnt)"} {errors[$2]=$0} END {for(i in errors) print errors[i]}' | |
# find the last occurrence of each fatal error | |
grep "Fatal" <(tac combined) | awk '{FS="(error: )|( in \/mnt)|( - \/mnt)"} {errors[$2]=$0} END {for(i in errors) print errors[i]}' | |
# find the first occurence of each fatal error, sorted by date | |
grep "Fatal" combined | awk '{FS="(error: )|( in \/mnt)|( - \/mnt)"} {errors[$2]=$0} END {for(i in errors) print errors[i]}' | sort -k1 | egrep "^2014[^a-z]+ " |
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
#!/bin/bash | |
brew install zsh | |
curl -L http://install.ohmyz.sh | sh |
OlderNewer