Skip to content

Instantly share code, notes, and snippets.

@mpalet
mpalet / 0_reuse_code.js
Created Dec 8, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mpalet
mpalet / androidconfiggen.sh
Last active May 15, 2019 — forked from andrewlkho/debian-strongswan.md
Setting up a secure VPN with strongSwan on debian
View androidconfiggen.sh
#!/bin/zsh
CLIENT="client"
SERVER="server.org"
FQDN="server.org"
CA="ca"
cat << EOF
{
View setup-shadowsocks-on-debian.sh
#!/bin/bash
########## Install Shadowsocks ##########
# https://github.com/shadowsocks/shadowsocks-libev#debian--ubuntu
sh -c 'printf "deb http://httpredir.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list'
apt update
apt -t jessie-backports install shadowsocks-libev
@mpalet
mpalet / classlife-down-calendar.md
Last active Jan 23, 2018
Classlife download calendar
View classlife-down-calendar.md

Classlife download calendari

Instruccions

  1. Crea un nou "preferit" (click-dret a la barra de preferits i click "Afegir Pàgina...")
  • Posa-li un nom
  • Copia el codi a sota, enganxa'l a la secció "URL".
javascript: (function() {
@mpalet
mpalet / setup-sshpushnotifications.sh
Last active Feb 1, 2018
Setup ssh login push notifications with telegram bot
View setup-sshpushnotifications.sh
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
#create ssh wrapper to execute pushmessage
SSH_WRAPPER_PATH=/usr/local/sbin/ssh-wrapper
cat - > $SSH_WRAPPER_PATH <<'EOF'
View gist:854c5faf70474f431ca6c7876784e4ab
shopt -s globstar
for f in **/*.ptx; do for i in **/*.ptx; do if ! [[ $f -ef $i ]]; then cmp -s "$f" "$i" && echo "Files $f and $i are identical"; fi; done; done
View gist:2ae30d6b284f91248284bcb58ca020bd
ffmpeg -i "$f" -i "$f1" -filter_complex "[0:v]setpts=PTS-STARTPTS, yadif, pad=iw*2:ih[bg]; \
[1:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=w" -f matroska - | ffplay -
ffmpeg -i "$f" -i "$f1" -filter_complex "[0:v]setpts=PTS-STARTPTS[bg]; \
[1:v]setpts=PTS-STARTPTS[fg]; [bg][fg]blend=all_mode=difference" -f matroska - | ffplay -
ffmpeg -i "$f" -vcodec libx265 -crf 20 -x265-params "sao=0" -x265-params "aq-mode=3" -f matroska - | ffmpeg -i - -i "$f" -filter_complex "[0:v]setpts=PTS-STARTPTS[bg]; \
[1:v]setpts=PTS-STARTPTS[fg]; [bg][fg]blend=all_mode=difference" -f matroska - | ffplay -
@mpalet
mpalet / gist:652127934cf2424689c8473cee71f76d
Created May 15, 2019
get integrated loudness EBU R128 from file
View gist:652127934cf2424689c8473cee71f76d
#!/bin/bash
function intloudness {
ffmpeg -nostats -i $1 -filter_complex ebur128 -f null - 2>&1 | awk '/I:/' | tail -n1
}
@mpalet
mpalet / timelapse.sh
Created May 31, 2019
create timelapse ffmpeg
View timelapse.sh
#framerate 12 crop to 4k 16:9 from left top
ffmpeg -r 12 -f concat -safe 0 -i <(for f in DSCF*.JPG; do printf 'file '%q/%q'\n' "$PWD" "$f"; done;) -filter:v "crop=iw:iw*9/16:0:0,scale=3840:-2" -vcodec libx264 -crf 18 -preset slow timelapse.mp4
@mpalet
mpalet / exiftool cheatsheet.md
Last active Jun 18, 2019
exiftool cheatsheet
View exiftool cheatsheet.md

EXIFTOOL CHEATSHEET

shift date

exiftool "-AllDates+=YY:MM:DD hh:mm:ss" -overwrite_original_in_place DIR

update file date to match exif date

exiftool "-DateTimeOriginal>FileModifyDate" -overwrite_original_in_place DIR
You can’t perform that action at this time.