Upload files to "/"

This commit is contained in:
2025-08-18 15:45:46 +02:00
parent 0702b84907
commit 8e7ca0a1bc
2 changed files with 133 additions and 0 deletions

92
ffproxy.sh Normal file
View File

@@ -0,0 +1,92 @@
#!/bin/bash
function istruzioni() {
echo "[Utility per tunnel SOCKS5 su Chromium]"
echo
echo "utilizzo: ffproxy <SOCKS5 PORT[1025-65535]> [-i] [-p]"
echo
echo "esempio:"
echo "Su una finestra del terminale: ssh user@server.mio -D 1234"
echo "Su un'altra finestra del terminale: ffproxy 1234"
echo "Argomenti"
echo "-i attiva incognito mode"
echo "-p uBlock Origin preinstallato"
}
function ublock() {
VERS=$(curl -s "https://api.github.com/repos/gorhill/uBlock/releases/latest" | jq -r .tag_name | sed 's/..$//')
if [ ! -d "/home/$USER/.mozilla/firefox/ffproxy/socks5-$PORT/extensions" ]; then
mkdir -p /home/$USER/.mozilla/firefox/ffproxy/socks5-$PORT/extensions
cd /home/$USER/.mozilla/firefox/ffproxy/socks5-$PORT/extensions
wget -q https://github.com/gorhill/uBlock/releases/download/$VERS.1b7/uBlock0_$VERS.1b7.firefox.signed.xpi
cat <<EOL > ~/.mozilla/firefox/ffproxy/socks5-$PORT/extensions/manifest.json
{
"manifest_version": 2,
"name": "uBlock Origin",
"version": "$VERS.1b7",
"applications": {
"gecko": {
"id": "uBlock0@raymondhill.net"
}
}
}
EOL
fi
}
if [ "$1" = "-h" -o "$1" = "--help" ]
then
istruzioni
exit 3
fi
# Variabili
PORT=$1
PROFILE_DIR="$HOME/.mozilla/firefox/ffproxy/socks5-$PORT"
VERS=""
incognito_option=""
plugin_option=""
# # Crea un nuovo profilo Firefox se non esiste
mkdir -p "$PROFILE_DIR"
firefox -no-remote -CreateProfile "socks5-$PORT" "$PROFILE_DIR"
# Modifica prefs.js con configurazione proxy
PREFS_FILE="$PROFILE_DIR/prefs.js"
echo 'user_pref("network.proxy.type", 1);' >> "$PREFS_FILE"
echo 'user_pref("network.proxy.socks", "127.0.0.1");' >> "$PREFS_FILE"
echo "user_pref(\"network.proxy.socks_port\", $PORT);" >> "$PREFS_FILE"
echo 'user_pref("network.proxy.socks_remote_dns", true);' >> "$PREFS_FILE"
# Check argomenti
for arg in "$@"; do
case $arg in
-i)
incognito_option="--private-window"
;;
-p)
ublock
;;
-ip)
incognito_option="--private-window"
ublock
;;
-pi)
ublock
incognito_option="--private-window"
;;
esac
done
# Mostra comando da avviare
echo -e '\nfirefox '$incognito_option $plugin_option' -no-remote -P "socks5-'$PORT'"\n'
# Avvia Firefox con quel profilo
firefox $incognito_option -no-remote -P "socks5-$PORT" > /dev/null 2>&1 &

41
firetunn.sh Normal file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
# Lo script:
# - prende in input una porta <1025-65535>
# - crea un nuovo profilo Firefox (se non esiste) dedicato alla porta
# - imposta proxy SOCKS5 su 127.0.0.1:<porta>
# - lancia Firefox con quel profilo in background
if [ "$1" = "-h" -o "$1" = "--help" ]
then
echo "Utility per tunnel SOCKS5 su Firefox, prende in input una porta <1025-65535>"
exit 3
fi
if [ $# -ne 1 ]
then
echo "ERR - Expected: ffproxy <1025-65535>"
exit 2
fi
PORT=$1
PROFILE_DIR="$HOME/.mozilla/firefox/ffproxy/socks5-$PORT"
# Crea un nuovo profilo Firefox se non esiste
if [ ! -d "$PROFILE_DIR" ]; then
mkdir -p "$PROFILE_DIR"
firefox -no-remote -CreateProfile "socks5-$PORT" "$PROFILE_DIR"
# Modifica prefs.js con configurazione proxy
PREFS_FILE="$PROFILE_DIR/prefs.js"
echo 'user_pref("network.proxy.type", 1);' >> "$PREFS_FILE"
echo 'user_pref("network.proxy.socks", "127.0.0.1");' >> "$PREFS_FILE"
echo "user_pref(\"network.proxy.socks_port\", $PORT);" >> "$PREFS_FILE"
echo 'user_pref("network.proxy.socks_remote_dns", true);' >> "$PREFS_FILE"
fi
echo -e '\nfirefox -no-remote -P "socks5-'$PORT'"\n'
# Avvia Firefox con quel profilo
firefox -no-remote -P "socks5-$PORT" > /dev/null 2>&1 &