-
Notifications
You must be signed in to change notification settings - Fork 0
/
.functions
49 lines (42 loc) · 1.45 KB
/
.functions
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
# Upload a given path to the 'audio' folder in B2.
function upaudio2b2() {
for file in $1/**/*.(flac|m4a|ape|accurip|cue|pdf|png|jpg|wv|xcf|log|txt|zip); do \
b2 file upload fcs-archive "$file" "audio/${file#./}";
done
}
# Upload a given path to the 'video/downloads' folder in B2.
function upvideo2b2() {
for file in $1/**/*; do \
b2 file upload fcs-archive "$file" "video/downloads/${file#./}";
done
}
# Convert all flac files in the current director to mp3, deleting the intermidiate wav file.
function flac2mp3() {
for file in (*).flac; do \
flac -d "$file"; \
lame -V0 "${file:r}.wav" "${file:r}.mp3";
rm "${file:r}.wav"
done
}
# Open a PR on Github for the current branch and set it to auto-merge.
function pr() {
gh pr create --fill;
gh pr merge --merge --auto --delete-branch;
}
# Convert all wav files in the current director to flac.
function wav2flac() {
for file in (*).wav; do \
flac --best "$file"; \
rm "${file:r}.wav"
done
}
# recusively remove pycache files
function pyclean () {
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
}
# Use wget to download the given url saved to the given path.
function wgfile() {
wget -c --retry-connrefused --retry-on-http-error=509 --tries=0 --timeout=5 $2 -O $1
}
# B2 sync command:
# b2 sync --excludeRegex '(.*\.DS_Store)' --delete --syncThreads 1 --downloadThreads 1 --replaceNewer --compareThreshold 1000 b2://fcs-archive/audio b2/audio