Skip to content

Instantly share code, notes, and snippets.

@byronmejia
Created February 8, 2018 06:56
Show Gist options
  • Save byronmejia/7246ab0f9ef033dac9b290018d0bd006 to your computer and use it in GitHub Desktop.
Save byronmejia/7246ab0f9ef033dac9b290018d0bd006 to your computer and use it in GitHub Desktop.
fix_screen() {
xrandr --output DisplayPort-0 --auto --output HDMI-A-0 --auto --panning 2880x1620+3840+0 --scale 1.5x1.5 --right-of DisplayPort-0
}
headphone_reboot() {
sudo rmmod btusb && sudo modprobe btusb
}
make_gif() {
FILE="$1"
FILE_EXTENSIONLESS="${FILE%%.*}"
FILE_OUTPUT="$FILE_EXTENSIONLESS.gif"
PALETTE="$FILE_EXTENSIONLESS.palette.png"
FILTER="fps=15,scale=640:-1:flags=lanczos"
ffmpeg -v warning -i $FILE -vf "$FILTER,palettegen" -y $PALETTE
ffmpeg -v warning -i $FILE -i $PALETTE -lavfi "$FILTER [x]; [x][1:v] paletteuse" -y $FILE_OUTPUT
rm $PALETTE
}
function gifThis {
ffmpeg -y -i $1 -vf palettegen palette.png
ffmpeg -y -i $1 -i palette.png -filter_complex paletteuse -r 10 -fs 9000000 $2
rm palette.png
}
function rmd {
pandoc $1 | lynx -stdin
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment