View Info.plist
<key>CFBundleIdentifier</key> | |
<string>com.apple.AppleScript.SafariURLHelper</string> | |
<key>CFBundleURLTypes</key> | |
<array> | |
<dict> | |
<key>CFBundleURLName</key> | |
<string>SafariURLHelper</string> | |
<key>CFBundleURLSchemes</key> | |
<array> | |
<string>http</string> |
View brewlist.sh
brewlist () { | |
if tput setaf 1 &> /dev/null | |
then | |
reset=$(tput sgr0) | |
blue=$(tput setaf 33) | |
else | |
reset="\e[0m" | |
blue="\e[1;34m" | |
fi | |
brew leaves | while read bfile |
View run.sh
#!/bin/bash | |
# tested on Ubuntu 16.04 | |
apt-get install -y \ | |
gstreamer1.0-libav \ | |
gstreamer1.0-plugins-bad \ | |
gstreamer1.0-plugins-base \ | |
gstreamer1.0-plugins-good \ | |
gstreamer1.0-tools |
View fix-chrome-player.css
video::-webkit-media-controls-overlay-play-button { | |
display: none; | |
} | |
video::-webkit-media-controls-play-button { | |
display: flex !important; | |
} |
View remove_oldest_to_free_space.sh
#!/bin/bash | |
DIRECTORY="/path/to/your/directory" | |
CAPACITY=95 | |
while [[ $(df $DIRECTORY | awk 'NR==2 && gsub("%","") {print$5}') -ge $CAPACITY ]];do | |
rm -rf $(find $DIRECTORY -mindepth 1 -printf '%T+ %p\n' | sort | awk 'NR==1 {print$2}') | |
done |
View rsync-diff.sh
rsync -rcnC --out-format="\"%f\"" folder1/ folder2/ | xargs cp --parents -rfvt folder3/ |
View homebrew-list-deps-tree.sh
brew list | while read cask; do echo -n $fg[blue] $cask $fg[white]; brew deps $cask | awk '{printf(" %s ", $0)}'; echo ""; done |
View setup-key-over-ssh.sh
# local | |
cat ~/.ssh/id_rsa.pub | ssh user@ip "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" | |
# remote | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/authorized_keys | |
# both | |
cat ~/.ssh/id_rsa.pub | ssh user@ip "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys" |
View brew-repo-changes.sh
cd $(brew --repository) | |
git reset --hard FETCH_HEAD |
View ssh-tmux-iterm2.sh
ssh login@hostname -t 'tmux -CC' |
NewerOlder