-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases
74 lines (55 loc) · 1.84 KB
/
aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
function purge {
sync && echo 3 > /proc/sys/vm/drop_caches
}
function showpatch {
cat $1 | colordiff | less -RS
}
function deletefiles {
find . -type f -name "$1" -delete
}
function getwav {
youtube-dl -x --audio-format wav $1
}
function npm-do { (PATH=$(npm bin):$PATH; eval $@;) }
grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,node_modules,vendor,app_bundles} --exclude={*.orig,*.swp}'
prettyjson() {
python -m json.tool | pygmentize -l json
}
tsarea() {
gnome-screenshot -a
}
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
alias pbtesseract='sleep 2; gnome-screenshot -ac; xclip -selection clipboard -t image/png -o > /tmp/_pbcopy_tesseract.png ; sleep 1; tesseract /tmp/_pbcopy_tesseract.png /tmp/_pbcopy_tesseract.txt -l eng+por > /dev/null; sleep 2; cat /tmp/_pbcopy_tesseract.txt | pbcopy'
alias dcu="docker-compose up"
alias dcr="docker-compose run"
alias dce="docker-compose exec"
loopsoundimage() {
ffmpeg -loop 1 -i $1 -i $2 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest $3
}
convert_davinci() {
CODEC_ORIGINAL="*.mp4"
CODEC_DAVINCI=".mov"
OUTPUT="output"
PRESET_FFMPEG="-codec:v mpeg4 -q:v 0 -codec:a pcm_s16le"
mkdir $DESTINO
for f in $CODEC_ORIGINAL; do ffmpeg -i "$f" $PRESET_FFMPEG "$OUTPUT/${f%.mp4}$CODEC_DAVINCI"; done
}
identify_images() {
find . -type f -name $1 | xargs identify | cut -d ' ' -f 1-3
}
svg_to_png() {
# Expected commands:
# svg_to_png ./coin-dollar.svg 20 20 ./coin-dollar.png
INPUT_FILE=$1
WIDTH=$2
HEIGHT=$3
OUTPUT=$4
inkscape -w $WIDTH -h $HEIGHT $INPUT_FILE --export-filename $OUTPUT
}
function webm2gif() {
ffmpeg -y -i "$1" -vf palettegen _tmp_palette.png
ffmpeg -y -i "$1" -i _tmp_palette.png -filter_complex paletteuse -r 10 "${1%.webm}.gif"
rm _tmp_palette.png
}