Setting your branch to exactly match the remote branch can be done in two steps:
git fetch origin
git reset --hard origin/master
If you want to save your current branch's state before doing this (just in case), you can do:
| # curl -L https://gist.githubusercontent.com/ChristopherA/a598762c3967a1f77e9ecb96b902b5db/raw/macupdatecli.sh | bash | |
| sudo -v | |
| sudo /usr/sbin/softwareupdate -l | |
| touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress | |
| sudo /usr/sbin/softwareupdate -ia | |
| rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| git -C "$(brew --repo homebrew/core)" fetch --unshallow |
Setting your branch to exactly match the remote branch can be done in two steps:
git fetch origin
git reset --hard origin/master
If you want to save your current branch's state before doing this (just in case), you can do:
| #! env zsh | |
| ######################################## | |
| # git_helper.zsh | |
| # Author: Ajeet Singh | |
| # provides functions as commands for git | |
| ######################################## | |
| #variables | |
| export GIST_UPLOAD_URL="https://api.github.com/gists" | |
| export GIST_DOWNLOAD_URL="https://gist.github.com" |
heroku login
heroku git:remote -a HEROKU-APP-NAME
git push heroku master
To revert a GitHub repo to a previous commit
git revert HEADIf your last commit was a merge, a little more love is needed:
git revert -m 1 HEADBefore a reboot, my Dropbox is fully synced.
After I reboot, I get a message saying that Dropbox needs to set permissions on my Dropbox folder, and then it does a full resync check of my very large Dropbox folder, which can take hours or overnight on a slow connection.
The problem may be symlinks set by older apps (Dropbox does not support symlinks INSIDE the dropbox folder as of 2019).
| -----BEGIN PGP PUBLIC KEY BLOCK----- | |
| mQINBFUvF/kBEADBDybeTPzanyukrpU0RSmowvw5jVKNVQWaJ90ClL02d2CsUIWV | |
| gyropXvO+QA78aa5GWKtHbUNIVQejP+BaRYk+LA91659RD4DB+YoqWO3pA3CzZVC | |
| Q/4uLoVH/GTnt9LUOBl0Gacrt4t/ZYoCDyEysHxbb5bYeT43o+Hrpenb77v5aA+d | |
| GPty6bimxGKHWUC6k6iogbdak+Jfu6B13P3D4tJDWUDqGmc3UhpjDR9rBCp2MrR8 | |
| vkdq/JWAnWZTv/HByBTHUVl4wvZ0CEffLSHgp0/3CCVfCwKr31xnJKVHOhaRL4XC | |
| MwFY9aS04WKPSPHa2anyFC8jP/zMcuXySLtD/QVMnP+QK3lLBpQLOZ7BmgmlaNrG | |
| WVoa0d6riynn1wHVIsIzjQMLWWslSs8s7CtB6O0rF9K/WAYDYDJsaahWqXRyuE80 | |
| vViRoGSM9HannBPEWSGhIegp8QX8rPEZKikXRaqV6czJeGsx+hW0P26wVRiK5DdN |
example(): bash function to create a nicely formatted example of a shell command and its output.
example() { echo "EXAMPLE:"; echo; echo " $@"; echo; echo "OUTPUT:"; echo ; eval "$@" | sed 's/^/ /'; }Sample Output:
EXAMPLE:
example ls -l
| #!/bin/sh | |
| # Convert all mp4 video in current directory to mp3 audio using ffmpeg | |
| for f in *.mp4; do ffmpeg -i "$f" -acodec libmp3lame -ab 192k "${f%.mp4}".mp3; done |
| # batch convert | |
| for i in *.mp4; do ffmpeg -i "$i" "${i%.mp4}.webm"; done | |
| # convert from one format to another | |
| ffmpeg -i input.mp3 output.wav | |
| # convert from one video format to another ("-qscale" value are 0-10, 0 is the best) | |
| ffmpeg -i input.mp4 -qscale 0 output.webm | |
| # convert video to audio (sometimes this one is better than the custom one below) |