Skip to content

Instantly share code, notes, and snippets.

Christopher Allen ChristopherA

Block or report user

Report or block ChristopherA

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ChristopherA
ChristopherA / FFmpeg.sh
Created Nov 30, 2019 — forked from AffanIndo/FFmpeg.sh
FFmpeg Cheat Sheet
View FFmpeg.sh
# 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)
@ChristopherA
ChristopherA / mp4to3indir.sh
Created Nov 30, 2019
Convert all mp4 video in current directory to mp3 audio using ffmpeg #audio #video #convert #mp3 #mp4
View mp4to3indir.sh
#!/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
@ChristopherA
ChristopherA / README.md
Last active Nov 30, 2019
example(): bash function to create a nicely formatted example of a shell command and its output #bash #tutorial #document
View README.md

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
View ChristopherA-357405ED.asc
-----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
@ChristopherA
ChristopherA / FixDropboxPermissions.md
Created Nov 26, 2019
Fix Dropbox Permissions Resync Issue
View FixDropboxPermissions.md

Problem

Before 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.

Solution

The problem may be symlinks set by older apps (Dropbox does not support symlinks INSIDE the dropbox folder as of 2019).

@ChristopherA
ChristopherA / gpg-signing.md
Last active Nov 7, 2019 — forked from xavierfoucrier/gpg-signing.md
GPG signing with Git and Github Desktop #gpg #sign #github #githubdesktop
View gpg-signing.md

(forked from https://gist.github.com/xavierfoucrier/c156027fcc6ae23bcee1204199f177da , see also https://gist.github.com/Shinrai/63eb85c7e89715a5d2dc9bee0301a8ac )

Hi Github users,

You can now signed your commits on Github using at least Git 2.18.0 and Github Desktop 1.6.1.

  1. Generate a GPG key and add it to Github: https://help.github.com/articles/generating-a-new-gpg-key (if you don't want to type a passphrase on every commit, you need to press "Enter" when the console will prompt you to type a passphrase)

  2. Configure Git properly by editing the .gitconfig file using the command line git config --global --edit in a terminal, then replace YOUR_GITHUB_EMAIL, YOUR_SIGNING_KEY and GPG_BINARY_PATH with your data

@ChristopherA
ChristopherA / revertgithub.md
Created Nov 6, 2019
How to Revert Github Repos #github #git #revert
View revertgithub.md

To revert a GitHub repo to a previous commit

git revert HEAD

If your last commit was a merge, a little more love is needed:

git revert -m 1 HEAD
View heroku.md
heroku login
heroku git:remote -a HEROKU-APP-NAME
git push heroku master
@ChristopherA
ChristopherA / git_helpers.zsh
Created Aug 12, 2019 — forked from singajeet/git_helpers.zsh
Contains function to work with github repo and gists
View git_helpers.zsh
#! 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"
You can’t perform that action at this time.