From 8310df89ae63b8dec006b7dc3d5fbdf666a5a93b Mon Sep 17 00:00:00 2001 From: Josh Clements Date: Sat, 13 Oct 2018 17:19:11 -0400 Subject: [PATCH 1/2] Create iPhoneVideoRotate.sh This script rotates video files that were created on an iPhone, but being edited on Linux. Requires the CLI version of HandBrake. It took me a while to figure out a good way to do this, so I'm passing on to you! --- scripts/iPhoneVideoRotate.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/iPhoneVideoRotate.sh diff --git a/scripts/iPhoneVideoRotate.sh b/scripts/iPhoneVideoRotate.sh new file mode 100644 index 0000000..30fcb6f --- /dev/null +++ b/scripts/iPhoneVideoRotate.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# This script rotates video files that were created on an iPhone, +# but being edited on Linux. Requires the CLI version of HandBrake. + +# This script takes two arguments: +# First argument is the input file +# Second argument is the output file + +HandBrakeCLI --rotate=4 --preset "High Profile" -O -i $1 -o $2 From f3a9220d81ed0420c9ba4276b1ef2f592270de7b Mon Sep 17 00:00:00 2001 From: Josh Clements Date: Sat, 13 Oct 2018 17:42:44 -0400 Subject: [PATCH 2/2] Create virtualenv-auto-activate.sh I don't remember where I got this script or I would provide credit. Useful if you use virtualenv. --- virtualenv-auto-activate.sh | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 virtualenv-auto-activate.sh diff --git a/virtualenv-auto-activate.sh b/virtualenv-auto-activate.sh new file mode 100644 index 0000000..fbf4959 --- /dev/null +++ b/virtualenv-auto-activate.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# virtualenv-auto-activate.sh +# +# Installation: +# Add this line to your .bashrc or .bash-profile: +# +# source /path/to/virtualenv-auto-activate.sh +# +# Go to your project folder, run "virtualenv .venv", so your project folder +# has a .venv folder at the top level, next to your version control directory. +# For example: +# . +# ├── .git +# │ ├── HEAD +# │ ├── config +# │ ├── description +# │ ├── hooks +# │ ├── info +# │ ├── objects +# │ └── refs +# └── .venv +# ├── bin +# ├── include +# └── lib +# +# The virtualenv will be activated automatically when you enter the directory. +_virtualenv_auto_activate() { + if [ -e ".venv" ]; then + # Check to see if already activated to avoid redundant activating + if [ "$VIRTUAL_ENV" != "$(pwd -P)/.venv" ]; then + _VENV_NAME=$(basename `pwd`) + echo Activating virtualenv \"$_VENV_NAME\"... + VIRTUAL_ENV_DISABLE_PROMPT=1 + source .venv/bin/activate + _OLD_VIRTUAL_PS1="$PS1" + PS1="($_VENV_NAME)$PS1" + export PS1 + fi + fi +} + +export PROMPT_COMMAND=_virtualenv_auto_activate +