Compare commits
10 Commits
fcc558aa01
...
d0624539a7
| Author | SHA1 | Date | |
|---|---|---|---|
| d0624539a7 | |||
| d355c1fc3b | |||
| ad7e323d02 | |||
| 2344ac0f8c | |||
| 437007ebd2 | |||
| d8d4b83492 | |||
| a8139fd987 | |||
| 06f74c4068 | |||
| 4c08434cab | |||
| 4e493c757c |
13
dot-services/sunshine-tweaks.service
Normal file
13
dot-services/sunshine-tweaks.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Script Daemon For Sunshine Tweaks
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
#User=
|
||||
#Group=
|
||||
ExecStart=/usr/local/bin/sunshine-tweaks.sh
|
||||
Restart=on-failure
|
||||
StandardOutput=file:%h/sunshine_tweaks.log
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -1,6 +1,6 @@
|
||||
# https://jwstanly.com/blog/article/Port+Forwarding+WSL+2+to+Your+LAN/
|
||||
|
||||
$ports = @(80, 443, 25565);
|
||||
$ports = @(8080, 25565);
|
||||
|
||||
$wslAddress = bash.exe -c "ifconfig eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'"
|
||||
|
||||
@@ -20,9 +20,9 @@ foreach ($port in $ports) {
|
||||
Invoke-Expression "netsh interface portproxy add v4tov4 listenport=$port listenaddress=$listenAddress connectport=$port connectaddress=$wslAddress";
|
||||
}
|
||||
|
||||
# $fireWallDisplayName = 'WSL Port Forwarding';
|
||||
# $portsStr = $ports -join ",";
|
||||
$fireWallDisplayName = 'WSL Port Forwarding';
|
||||
$portsStr = $ports -join ",";
|
||||
|
||||
# Invoke-Expression "Remove-NetFireWallRule -DisplayName $fireWallDisplayName";
|
||||
# Invoke-Expression "New-NetFireWallRule -DisplayName $fireWallDisplayName -Direction Outbound -LocalPort $portsStr -Action Allow -Protocol TCP";
|
||||
# Invoke-Expression "New-NetFireWallRule -DisplayName $fireWallDisplayName -Direction Inbound -LocalPort $portsStr -Action Allow -Protocol TCP";
|
||||
Invoke-Expression "Remove-NetFireWallRule -DisplayName '$fireWallDisplayName'";
|
||||
Invoke-Expression "New-NetFireWallRule -DisplayName '$fireWallDisplayName' -Direction Outbound -LocalPort $portsStr -Action Allow -Protocol TCP";
|
||||
Invoke-Expression "New-NetFireWallRule -DisplayName '$fireWallDisplayName' -Direction Inbound -LocalPort $portsStr -Action Allow -Protocol TCP";
|
||||
|
||||
3
scripts/shell/adjust-urls-txt-files.sh
Executable file
3
scripts/shell/adjust-urls-txt-files.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
fd -g "urls.txt" -X sed -i 's/vxtwitter\|fxtwitter\|twitter\|fixupx/x/g'
|
||||
9
scripts/shell/discover-remote-device-ports.sh
Executable file
9
scripts/shell/discover-remote-device-ports.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
remote_ip="banana"
|
||||
|
||||
mapfile -t ports_list < <(nmap "${remote_ip}" -p 37000-44000 -oG - | grep -oP '\d+(?=\/open\/tcp)')
|
||||
|
||||
for port in "${ports_list[@]}"; do
|
||||
echo "./adb.exe connect ${remote_ip}:${port}"
|
||||
done
|
||||
5
scripts/shell/dot-desktop-search.sh
Normal file
5
scripts/shell/dot-desktop-search.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
DESKTOP_PATHS=(
|
||||
/usr/share/applications/
|
||||
/usr/local/share/applications/
|
||||
~/.local/share/applications/
|
||||
)
|
||||
67
scripts/shell/ffmpeg-join-videos.sh
Executable file
67
scripts/shell/ffmpeg-join-videos.sh
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Usage example:
|
||||
# ./ffmpeg-join-videos.sh -i vid1.mp4 vid2.mp4 vid3.mp4 -o output_name
|
||||
|
||||
# Exit on error
|
||||
set -e
|
||||
|
||||
# Parse arguments
|
||||
videos=()
|
||||
output_filename=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-i | --input-list)
|
||||
shift
|
||||
# Collect all filenames until another option appears or args end
|
||||
while [[ $# -gt 0 && "$1" != -* ]]; do
|
||||
videos+=("$1")
|
||||
shift
|
||||
done
|
||||
;;
|
||||
-o | --output-filename)
|
||||
output_filename="$2"
|
||||
shift 2
|
||||
;;
|
||||
-h | --help)
|
||||
echo "Usage: $0 -i file1 file2 [file3 ...] -o output_name"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Validate args
|
||||
if [[ ${#videos[@]} -lt 2 ]]; then
|
||||
echo "Error: You must provide at least two input files with -i"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "$output_filename" ]]; then
|
||||
echo "Error: You must provide an output filename with -o"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Number of videos
|
||||
n=${#videos[@]}
|
||||
|
||||
# Build input args for ffmpeg
|
||||
inputs=()
|
||||
for vid in "${videos[@]}"; do
|
||||
inputs+=("-i" "$vid")
|
||||
done
|
||||
|
||||
# Build the concat filter
|
||||
filter=""
|
||||
for i in "${!videos[@]}"; do
|
||||
filter+="[$i:v] [$i:a] "
|
||||
done
|
||||
|
||||
filter_complex="${filter}concat=n=$n:v=1:a=1 [v] [a]"
|
||||
|
||||
# Run ffmpeg
|
||||
ffmpeg "${inputs[@]}" -filter_complex "$filter_complex" -map "[v]" -map "[a]" "${output_filename}.mp4"
|
||||
3
scripts/shell/find-big-files.sh
Executable file
3
scripts/shell/find-big-files.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/env bash
|
||||
|
||||
fd . --size +10M --exec-batch exa --long --all --sort size --color=always --icons=always --ignore-glob desktop.ini | less --raw-control-chars
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
show_help() {
|
||||
# echo "Usage: `basename $0` [--no-abort-on-found] [--parallel] [--custom-grep-search|-c <string>]"
|
||||
echo "Usage: $(basename $0) [--help|-h] [--filter-mode|-f]"
|
||||
echo "Usage: $(basename "${0}") [--help|-h] [--filter-mode|-f]"
|
||||
echo "Options:"
|
||||
echo " --help | -h (optional) Display script's help text"
|
||||
echo " --filter-mode | -f (optional) The script iterate over the files of a selected folder and store the ones that should be deleted"
|
||||
@@ -12,7 +12,6 @@ show_help() {
|
||||
|
||||
filter_mode=false
|
||||
urls_list_arg=""
|
||||
interactive_mode=false
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
@@ -28,10 +27,6 @@ while [ "$#" -gt 0 ]; do
|
||||
urls_list_arg="$2"
|
||||
shift
|
||||
;;
|
||||
-i)
|
||||
interactive_mode=true
|
||||
shift 2
|
||||
;;
|
||||
*) shift ;;
|
||||
esac
|
||||
done
|
||||
@@ -39,7 +34,7 @@ done
|
||||
commands_to_check=(gallery-dl gdl.sh feh xdotool)
|
||||
|
||||
commands_not_found=()
|
||||
for command in ${commands_to_check[@]}; do
|
||||
for command in "${commands_to_check[@]}"; do
|
||||
if ! command -v "$command" &>/dev/null; then
|
||||
commands_not_found+=("$command")
|
||||
fi
|
||||
@@ -48,18 +43,17 @@ done
|
||||
if [ ${#commands_not_found[@]} -ne 0 ]; then
|
||||
echo 'The following commands are necessary in order to run the script, but were not found:'
|
||||
|
||||
for command in ${commands_not_found[@]}; do
|
||||
for command in "${commands_not_found[@]}"; do
|
||||
echo " \"$command\""
|
||||
done
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
furry_commission_ideas_path=/mnt/e/clouds/nextcloud/furry-downloads
|
||||
# furry_commission_ideas_path=/mnt/e/home/documents-unsorted/data-hoarding/furry-downloads
|
||||
# furry_commission_ideas_path=/mnt/e/home/downloads/furry-downloads
|
||||
furry_commission_ideas_path='/media/hd/clouds/nextcloud-strawberry/data-hoarding/furry-downloads'
|
||||
# furry_commission_ideas_path='/mnt/e/clouds/nextcloud-strawberry/data-hoarding/furry-downloads'
|
||||
furry_commission_ideas_urls_filename="urls.txt"
|
||||
scripts_path=/home/cloud/repos/personal-devboot/scripts/shell
|
||||
scripts_path=/home/cloud/git/personal-devboot/scripts/shell
|
||||
|
||||
if [ ! -d $furry_commission_ideas_path ]; then
|
||||
echo "[ERROR] The images folder was not found (\"$furry_commission_ideas_path\")"
|
||||
@@ -231,10 +225,10 @@ existing_folders=()
|
||||
|
||||
fill_existing_folders_array() {
|
||||
ignore_paths=("artists" "kinks" "ideas")
|
||||
ignore_paths_depth_2=("artists" "favorites")
|
||||
ignore_paths_depth_2=("artists")
|
||||
ignore_paths_depth_last=("no-source" ".bsky.social" "old" "mine")
|
||||
|
||||
find_command="find * -type d"
|
||||
find_command="find * -maxdepth 1 -type d"
|
||||
|
||||
for path in "${ignore_paths[@]}"; do
|
||||
find_command+=" -not -path $path"
|
||||
|
||||
43
scripts/shell/modrinth-get-versions.sh
Executable file
43
scripts/shell/modrinth-get-versions.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/env bash
|
||||
|
||||
project_ids=(
|
||||
51shyZVL
|
||||
9s6osm5g
|
||||
JYQhtZtO
|
||||
KuNKN7d2
|
||||
LQ3K71Q1
|
||||
NNAgCjsB
|
||||
P7dR8mSH
|
||||
VSNURh3q
|
||||
c7m1mi73
|
||||
eXts2L7r
|
||||
fQEb0iXm
|
||||
g96Z4WVZ
|
||||
gvQqBUqZ
|
||||
mOgUt4GM
|
||||
uXXizFIs
|
||||
wnEe9KBa
|
||||
veinminer
|
||||
veinminer-client
|
||||
)
|
||||
|
||||
# api_ids_query="%5B"
|
||||
api_ids_query="["
|
||||
|
||||
for project_id in "${project_ids[@]}"; do
|
||||
api_ids_query+="\\\"$project_id\\\""
|
||||
done
|
||||
|
||||
# api_ids_query="${api_ids_query%",%20"}"
|
||||
|
||||
# api_ids_query+="%5D"
|
||||
api_ids_query+="]"
|
||||
|
||||
api_command="wget -O- 'https://api.modrinth.com/v2/projects?ids=$api_ids_query'"
|
||||
|
||||
api_response=$("$api_command")
|
||||
|
||||
echo "$api_command"
|
||||
echo "$api_response"
|
||||
|
||||
exit 0
|
||||
7
scripts/shell/print-files-not-in-urls-txt.sh
Executable file
7
scripts/shell/print-files-not-in-urls-txt.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
find * -maxdepth 0 -type f -not -name 'urls.txt' -exec sh -c '
|
||||
for file; do
|
||||
if ! grep -q "$file" urls.txt; then
|
||||
echo "$file"
|
||||
fi
|
||||
done
|
||||
' sh {} +
|
||||
31
scripts/shell/proj-llc-to-ffmpeg-helper.sh
Executable file
31
scripts/shell/proj-llc-to-ffmpeg-helper.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/env bash
|
||||
|
||||
ffmpeg_commands_list=()
|
||||
files_count=1
|
||||
|
||||
for file in ./*-proj.llc; do
|
||||
llc_filename_new="${file}.json"
|
||||
|
||||
node -p "JSON.stringify(eval('(' + require('fs').readFileSync('${file}','utf8') + ')'), null, 2)" >"${llc_filename_new}"
|
||||
|
||||
media_filename=$(cat "${llc_filename_new}" | jq -r '.mediaFileName')
|
||||
|
||||
segments_qty=$(cat "${llc_filename_new}" | jq -r '.cutSegments | length')
|
||||
|
||||
for seq in $((segments_qty - 1)); do
|
||||
seq_start=$(cat "${llc_filename_new}" | jq -r ".cutSegments[${seq}].start")
|
||||
seq_end=$(cat "${llc_filename_new}" | jq -r ".cutSegments[${seq}].end")
|
||||
|
||||
ffmpeg_commands_list+=("ffmpeg-helper.sh -i \"${media_filename}\" --trim-start ${seq_start} --trim-end ${seq_end} --scale 1280x720 --crf 30 -o roadhog_${files_count}.mp4")
|
||||
files_count=$((files_count + 1))
|
||||
done
|
||||
done
|
||||
|
||||
# rm ./*-proj.llc
|
||||
# rm ./*-proj.llc.json
|
||||
|
||||
echo 'Results'
|
||||
|
||||
for cmd in "${ffmpeg_commands_list[@]}"; do
|
||||
echo " ${cmd}"
|
||||
done
|
||||
@@ -9,8 +9,11 @@ cat $urls_filename | while read line; do
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$filename" == "." ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "$filename does not exist"
|
||||
|
||||
sed -i "/$filename/d" $urls_filename
|
||||
sed -i "/$filename/d" "$urls_filename"
|
||||
done
|
||||
|
||||
|
||||
@@ -1,10 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
mapfile -t files < <(find . -maxdepth 1 -type f)
|
||||
if [ "$(pwd)" == "$HOME" ]; then
|
||||
echo "Current directory should not be HOME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for filename in "${files[@]}"; do
|
||||
filename_m5sum=$(md5sum "$filename" | awk '{print $1}')
|
||||
mapfile -t files < <(find . -type f -not -name 'urls.txt' -not -name 'desktop.ini')
|
||||
|
||||
for filepath in "${files[@]}"; do
|
||||
filename=$(basename "$filepath")
|
||||
filename_dir=$(dirname "$filepath")
|
||||
|
||||
filename_md5sum=$(md5sum "$filepath" | awk '{print $1}')
|
||||
filename_extension="${filename##*.}"
|
||||
|
||||
mv "$filename" "$filename_m5sum.$filename_extension"
|
||||
new_filename="$filename_md5sum.$filename_extension"
|
||||
|
||||
if [ "$filename" == "$new_filename" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
mv "$filepath" "$filename_dir/$new_filename"
|
||||
done
|
||||
|
||||
50
scripts/shell/sunshine-tweaks.sh
Executable file
50
scripts/shell/sunshine-tweaks.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
# @Author: iago
|
||||
|
||||
state=waiting_for_sunshine
|
||||
sleep_time=1
|
||||
|
||||
default_device="alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo"
|
||||
default_device_fl=":monitor_FL"
|
||||
default_device_fr=":monitor_FR"
|
||||
obs_device="OBS: audioOutput_Discordless"
|
||||
obs_device_fl=":monitor_FL"
|
||||
obs_device_fr=":monitor_FR"
|
||||
sunshine_device="sunshine"
|
||||
sunshine_device_fl=":input_FL"
|
||||
sunshine_device_fr=":input_FR"
|
||||
|
||||
is_sunshine_transmitting() {
|
||||
pw-link -l | grep sunshine >/dev/null
|
||||
}
|
||||
|
||||
do_device_setup() {
|
||||
# trocar dispositivo padrão
|
||||
pactl set-default-sink "$default_device"
|
||||
sleep 3
|
||||
# conectar dispositivo virtual do OBS
|
||||
pw-link "$obs_device$obs_device_fl" "$sunshine_device$sunshine_device_fl"
|
||||
pw-link "$obs_device$obs_device_fr" "$sunshine_device$sunshine_device_fr"
|
||||
# talvez desconectar a saída do seu fone do sunshine?
|
||||
sleep 5
|
||||
pw-link -d "$default_device$default_device_fl" "$sunshine_device$sunshine_device_fl"
|
||||
pw-link -d "$default_device$default_device_fr" "$sunshine_device$sunshine_device_fr"
|
||||
}
|
||||
|
||||
while true; do
|
||||
if [ "$state" = "waiting_for_sunshine" ]; then
|
||||
if is_sunshine_transmitting; then
|
||||
state=do_sunshine_setup
|
||||
fi
|
||||
elif [ "$state" = "do_sunshine_setup" ]; then
|
||||
do_device_setup
|
||||
state=sunshine_running
|
||||
elif [ "$state" = "sunshine_running" ]; then
|
||||
if ! is_sunshine_transmitting; then
|
||||
state=sunshine_not_transmitting
|
||||
fi
|
||||
elif [ "$state" = "sunshine_not_transmitting" ]; then
|
||||
state=waiting_for_sunshine
|
||||
fi
|
||||
sleep "$sleep_time"
|
||||
done
|
||||
19
snippets/arrays-intersections.js
Executable file
19
snippets/arrays-intersections.js
Executable file
@@ -0,0 +1,19 @@
|
||||
const versionsMatr = [
|
||||
]
|
||||
|
||||
const loadersMatr = [
|
||||
]
|
||||
|
||||
function intersectArrays(arrays) {
|
||||
if (!arrays.length) return [];
|
||||
|
||||
return arrays.reduce((acc, curr) =>
|
||||
acc.filter(item => curr.includes(item))
|
||||
);
|
||||
}
|
||||
|
||||
const versionsIntersection = intersectArrays(versionsMatr);
|
||||
console.log(versionsIntersection);
|
||||
|
||||
const loadersIntersection = intersectArrays(loadersMatr);
|
||||
console.log(loadersIntersection);
|
||||
1
snippets/click-every-button-by-class.js
Executable file
1
snippets/click-every-button-by-class.js
Executable file
@@ -0,0 +1 @@
|
||||
document.querySelectorAll('button.MuiButtonGroup-lastButton').forEach(btn => btn.click());
|
||||
Reference in New Issue
Block a user