move bin to .local/bin
This commit is contained in:
2
dot_local/bin/executable_android-bt-snoop
Normal file
2
dot_local/bin/executable_android-bt-snoop
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
adb shell nc -s 127.0.0.1 -p 8872 -L system/bin/tail -f -c +0 data/misc/bluetooth/logs/btsnoop_hci.log
|
3
dot_local/bin/executable_ffmpeg.bars
Normal file
3
dot_local/bin/executable_ffmpeg.bars
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
output_file="$(echo "$1" | sed 's,.mp4,.bars.mp4,')"
|
||||
ffmpeg -i "$1" -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1" -c:a copy "$output_file"
|
3
dot_local/bin/executable_ffmpeg.lossy_trim
Normal file
3
dot_local/bin/executable_ffmpeg.lossy_trim
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
output_file="$(echo "$1" | sed 's,\(.*\)\.\(.*\)$,\1.sermon.\2,')"
|
||||
ffmpeg -i "$1" -ss "$2" -to "$3" "$output_file"
|
14
dot_local/bin/executable_find-acoustid-dups
Normal file
14
dot_local/bin/executable_find-acoustid-dups
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
for i in $(seq 1 60); do
|
||||
if [ "$(find . -name "$i *" | wc -l)" = 2 ]; then
|
||||
first_track="$(find . -name "$i *" | head -n1)"
|
||||
last_track="$(find . -name "$i *" | tail -n1)"
|
||||
first_acoustid="$(exiftool "$first_track" | rg Acoustid)"
|
||||
last_acoustid="$(exiftool "$last_track" | rg Acoustid)"
|
||||
if [ "$first_acoustid" = "$last_acoustid" ]; then
|
||||
if [ "$first_track" != "$last_track" ]; then
|
||||
rm "$first_track"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
5
dot_local/bin/executable_jq-compress
Normal file
5
dot_local/bin/executable_jq-compress
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# I made this script to clean up duplicate messages in the Android SMS/MMS
|
||||
# database as exported by https://github.com/tmo1/sms-ie (v2.0.0).
|
||||
jq -c '.__recipient_addresses |= unique_by(.address)' messages.ndjson > messages.uniqued.ndjson
|
14
dot_local/bin/executable_kde-rofi-rbw-autotype
Normal file
14
dot_local/bin/executable_kde-rofi-rbw-autotype
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
current_layout=$(dbus-send --print-reply=literal --dest=org.kde.keyboard \
|
||||
/Layouts org.kde.KeyboardLayouts.getLayout | xargs | tr " " ":")
|
||||
|
||||
trap reset_layout 1 2 3 6 15
|
||||
reset_layout() {
|
||||
dbus-send --type=method_call --dest=org.kde.keyboard /Layouts org.kde.KeyboardLayouts.setLayout "$current_layout"
|
||||
}
|
||||
|
||||
dbus-send --type=method_call --dest=org.kde.keyboard /Layouts org.kde.KeyboardLayouts.setLayout uint32:0
|
||||
|
||||
rofi-rbw --typer=dotool
|
||||
|
||||
reset_layout
|
14
dot_local/bin/executable_kde-rofi-rbw-totp
Normal file
14
dot_local/bin/executable_kde-rofi-rbw-totp
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
current_layout=$(dbus-send --print-reply=literal --dest=org.kde.keyboard \
|
||||
/Layouts org.kde.KeyboardLayouts.getLayout | xargs | tr " " ":")
|
||||
|
||||
trap reset_layout 1 2 3 6 15
|
||||
reset_layout() {
|
||||
dbus-send --type=method_call --dest=org.kde.keyboard /Layouts org.kde.KeyboardLayouts.setLayout "$current_layout"
|
||||
}
|
||||
|
||||
dbus-send --type=method_call --dest=org.kde.keyboard /Layouts org.kde.KeyboardLayouts.setLayout uint32:0
|
||||
|
||||
rofi-rbw --typer=dotool --target=totp
|
||||
|
||||
reset_layout
|
18
dot_local/bin/executable_ssh-check-host-fingerprint
Normal file
18
dot_local/bin/executable_ssh-check-host-fingerprint
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
tmpdir=${TMPDIR:-/tmp}
|
||||
tmpfile=$(mktemp "$tmpdir"/ssh-check-host-fingerprints.tmp.XXXXXX)
|
||||
ssh-keyscan -p "$2" "$1" 2>/dev/null > "$tmpfile"
|
||||
if [ -s "$tmpfile" ]; then
|
||||
fingerprints=$(ssh-keygen -lf "$tmpfile" 2>/dev/null | awk '{print $2}')
|
||||
for fingerprint in $fingerprints
|
||||
do
|
||||
if [ "$fingerprint" = "$3" ];
|
||||
then
|
||||
rm "$tmpfile"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
else
|
||||
rm "$tmpfile"
|
||||
exit 1
|
||||
fi
|
10
dot_local/bin/executable_xxbranch
Normal file
10
dot_local/bin/executable_xxbranch
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
if [ $# -eq 1 ]; then
|
||||
branch=$1
|
||||
git fetch upstream master
|
||||
git checkout upstream/master
|
||||
git checkout -b "$branch"
|
||||
else
|
||||
echo "Please specify new branch."
|
||||
fi
|
||||
|
67
dot_local/bin/executable_xxbranchupdates
Normal file
67
dot_local/bin/executable_xxbranchupdates
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/bin/sh
|
||||
|
||||
# always capture the current branch so we can go back to it :)
|
||||
current_branch="$(git branch --show-current)"
|
||||
|
||||
_default() {
|
||||
if [ -n "$1" ]; then
|
||||
git checkout -q "$1"
|
||||
fi
|
||||
branch_name="$(git branch --show-current)"
|
||||
update_list=""
|
||||
for p in $(common/travis/changed_templates.sh 2>&1 >/dev/null); do
|
||||
if [ -z "$update_list" ]; then
|
||||
update_list=$("${XBPS_DISTDIR}"/xbps-src update-check "$p" 2>&1)
|
||||
else
|
||||
appendee=$("${XBPS_DISTDIR}"/xbps-src update-check "$p")
|
||||
if [ -n "$appendee" ]; then
|
||||
# yay explicit newline :(
|
||||
update_list="${update_list}
|
||||
${appendee}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [ -n "$update_list" ]; then
|
||||
printf "branch: %s\n%s\n\n" "$branch_name" "$update_list"
|
||||
fi
|
||||
}
|
||||
|
||||
_maint() {
|
||||
git checkout -q master
|
||||
for b in $(git branch --list 'maint*'); do
|
||||
_default "$b"
|
||||
done
|
||||
}
|
||||
|
||||
_update() {
|
||||
git checkout -q master
|
||||
for b in $(git branch --list 'update*'); do
|
||||
_default "$b"
|
||||
done
|
||||
}
|
||||
|
||||
_organized() {
|
||||
git checkout -q master
|
||||
for b in $(git branch --list '*/*'); do
|
||||
_default "$b"
|
||||
done
|
||||
}
|
||||
|
||||
if [ $# = 0 ]; then
|
||||
_default
|
||||
else
|
||||
while test $# != 0
|
||||
do
|
||||
case "$1" in
|
||||
-m|--maint) _maint;;
|
||||
-u|--update) _update;;
|
||||
-o|--organized) _organized;;
|
||||
--) shift; break;;
|
||||
*) _default;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
fi
|
||||
|
||||
# return to branch we were on before running script
|
||||
git checkout "$current_branch" >/dev/null 2>&1
|
29
dot_local/bin/executable_xxdeps
Normal file
29
dot_local/bin/executable_xxdeps
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
_check() {
|
||||
for p in $(xbps-query -Rx "$1" | cut -d '>' -f1); do
|
||||
num_child_deps=$(xbps-query -Rx "$p" | wc -l)
|
||||
update_check_result=$("${XBPS_DISTDIR}"/xbps-src update-check "$p")
|
||||
if [ "$num_child_deps" -lt 3 ]; then
|
||||
|
||||
if [ -n "$update_check_result" ]; then
|
||||
printf '%s' "$update_check_result" |
|
||||
while IFS= read -r line; do
|
||||
for _i in $(seq "$2"); do
|
||||
printf ' '
|
||||
done
|
||||
printf '%s\n' "$line"
|
||||
done
|
||||
else
|
||||
for _i in $(seq "$2"); do
|
||||
printf ' '
|
||||
done
|
||||
printf '%s (latest version)\n' "$p"
|
||||
fi
|
||||
|
||||
_check "$p" "$(($2+1))"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
_check "$1" 0
|
17
dot_local/bin/executable_xxdist
Normal file
17
dot_local/bin/executable_xxdist
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
branch_name="$(git branch --show-current)"
|
||||
|
||||
if [ $# = 0 ]; then
|
||||
rsync -P -r "${XBPS_DISTDIR}/hostdir/binpkgs/${branch_name}" daybreak:
|
||||
rsync -P -r "${XBPS_DISTDIR}/hostdir/binpkgs/${branch_name}" epoch:
|
||||
elif [ "$1" = "repo" ]; then
|
||||
cd "${XBPS_DISTDIR}/hostdir/binpkgs/${branch_name}"
|
||||
for p in *.xbps; do
|
||||
rsync -P $p daybreak:/srv/repo
|
||||
ssh daybreak "xbps-rindex --add /srv/repo/$p;
|
||||
xbps-rindex --privkey /srv/repo/private.pem --sign-pkg /srv/repo/*.xbps"
|
||||
done
|
||||
else
|
||||
rsync -P -r "${XBPS_DISTDIR}/hostdir/binpkgs/${branch_name}" "$1":
|
||||
fi
|
15
dot_local/bin/executable_xxtip
Normal file
15
dot_local/bin/executable_xxtip
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
current_branch="$(git branch --show-current)"
|
||||
|
||||
trap back_to_current_branch 1 2 3 6 15
|
||||
back_to_current_branch() {
|
||||
git checkout "$current_branch"
|
||||
exit 1
|
||||
}
|
||||
|
||||
git checkout master
|
||||
git pull --rebase upstream master
|
||||
git push -f
|
||||
git checkout "$current_branch"
|
||||
git rebase master
|
59
dot_local/bin/executable_xxtreecrawl
Normal file
59
dot_local/bin/executable_xxtreecrawl
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
|
||||
# always capture the current branch so we can go back to it :)
|
||||
current_branch="$(git branch --show-current)"
|
||||
|
||||
_default() {
|
||||
if [ -n "$1" ]; then
|
||||
git checkout -q "$1"
|
||||
fi
|
||||
branch_name="$(git branch --show-current)"
|
||||
update_list=""
|
||||
for p in $(common/travis/changed_templates.sh 2>&1 >/dev/null); do
|
||||
if [ -z "$update_list" ]; then
|
||||
update_list="$p"
|
||||
else
|
||||
appendee="$p"
|
||||
if [ -n "$appendee" ]; then
|
||||
# yay explicit newline :(
|
||||
update_list="${update_list}
|
||||
${appendee}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [ -n "$update_list" ]; then
|
||||
printf "branch: %s\n%s\n\n" "$branch_name" "$update_list"
|
||||
fi
|
||||
}
|
||||
|
||||
_maint() {
|
||||
git checkout -q master
|
||||
for b in $(git branch --list 'maint*'); do
|
||||
_default "$b"
|
||||
done
|
||||
}
|
||||
|
||||
_update() {
|
||||
git checkout -q master
|
||||
for b in $(git branch --list 'update*'); do
|
||||
_default "$b"
|
||||
done
|
||||
}
|
||||
|
||||
if [ $# = 0 ]; then
|
||||
_default
|
||||
else
|
||||
while test $# != 0
|
||||
do
|
||||
case "$1" in
|
||||
-m|--maint) _maint;;
|
||||
-u|--update) _update;;
|
||||
--) shift; break;;
|
||||
*) _default;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
fi
|
||||
|
||||
# return to branch we were on before running script
|
||||
git checkout "$current_branch" >/dev/null 2>&1
|
1
dot_local/bin/symlink_ffmpeg.trim
Normal file
1
dot_local/bin/symlink_ffmpeg.trim
Normal file
@@ -0,0 +1 @@
|
||||
ffmpeg.lossy_trim
|
Reference in New Issue
Block a user