bash_scripts

Bash scripts
Log | Files | Refs

commit 55d14e4eaad4a85b73c047a58c4afaf65b5cdd0c
Author: Alex <alex@caloyannis.xyz>
Date:   Thu, 12 Mar 2026 22:14:09 +0100

First commit

Diffstat:
Adownload_m3u8.sh | 16++++++++++++++++
Aopen-ssh-tunnel.sh | 14++++++++++++++
Astrong-encrypt.sh | 6++++++
3 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/download_m3u8.sh b/download_m3u8.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +read -p "name=" NAME +read -p "master.m3u8=" MASTER +curl "$MASTER" -o master.m3u8 -s +[ "$?" -ne "0" ] && echo "Error downloading master.m3u8" && exit 1 +INDEX="$(printf "$MASTER" | cut -d/ -f1-3)$(tail -n 1 master.m3u8)" +echo "index.m3u8=$INDEX" +curl "$INDEX" -O -s +[ "$?" -ne "0" ] && echo "Error downloading index.m3u8" && exit 1 +URLS=$(grep http index.m3u8) +rm master.m3u8 index.m3u8 +rm $NAME &> /dev/null +for URL in $URLS ; do + curl "$URL" -o - -s >> $NAME.ts +done & +# ffmpeg -i $NAME.ts -c copy $NAME.mp4 && rm $NAME.ts diff --git a/open-ssh-tunnel.sh b/open-ssh-tunnel.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +PORTS="9051 4444 4447 1080" + +# 9051 = TOR Control Port +# 4444 = HTTP Proxy +# 4447 = SOCKS5 Proxy +# 1080 = other local service + +# -L [bind_address:]port:host:hostport +# connections to the given TCP port or Unix socket on the local (client) host are to be forwarded to the given host and port, or Unix socket, on the remote side. + +ssh -i ~/.ssh/private_key -v -N $(for P in $PORTS ; do printf " -L 127.0.0.1:$P:127.0.0.1:$P " ; done) user@host + diff --git a/strong-encrypt.sh b/strong-encrypt.sh @@ -0,0 +1,6 @@ +#!/bin/bash +if [ $# -ge 3 ] ; then + openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter $1 -in $2 -out $3 $4 +else + echo -e "Usage: $0 [# of iterations] [in] [out] [-d to decrypt]" +fi