Utility bin scripts
Last active
April 5, 2024 00:43
-
-
Save mesquka/87804ca3c1d6276796547d4f8554fdf4 to your computer and use it in GitHub Desktop.
Utility scripts for bin folder :)
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/sh | |
# VSCode for VISUAL and EDITOR uses (git, crontab, etc.) | |
if [[ "$TERM_PROGRAM" = "vscode" ]] | |
then | |
code --reuse-window --wait "$@" | |
else | |
code --new-window --wait "$@" | |
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
#!/bin/sh | |
# Disables sleep on macbook lid close | |
sudo pmset -a disablesleep 1 |
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/sh | |
# Enables sleep on macbook lid close | |
sudo pmset -a disablesleep 0 |
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/sh | |
# Kills all adobe processes (prevents battery drain) | |
sudo pkill -f -i adobe |
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/sh | |
# Immediately start screensaver from CLI | |
open -b com.apple.ScreenSaver.Engine |
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/sh | |
# Use exiftool to organize photos | |
# Renames file name to time of capture (DateTimeOriginal) for file name based sorters | |
# Sets FileModifyDate to date captured (DateTimeOriginal) for file metadata based sorters | |
exiftool '-filename<DateTimeOriginal' -d %Y%m%d_%H%M%S%%-c.%%le * | |
exiftool "-FileModifyDate<DateTimeOriginal" * |
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/sh | |
# Resets launchpad layout | |
defaults write com.apple.dock ResetLaunchPad -bool true; 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
#!/bin/bash | |
# Uses screen to start and resume long running sessions over SSH | |
ssh $1 -t "screen -R" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment