Skip to content

Commit

Permalink
Fix for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
diepfote committed Nov 22, 2024
1 parent d473d1c commit 35f1807
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gistfile1.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@

for link in links:
filename = unquote(link['href'])
if filename.endswith('.mp4'):
if filename.endswith('.mp4') or \
filename.endswith('.pdf'):
continue
# Set the download link as the result.
item_url = f'{base_url.rstrip("/")}/{link["href"]}'
Expand Down
Empty file modified run-file-server-extract.sh
100755 → 100644
Empty file.
17 changes: 15 additions & 2 deletions run-file-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ cleanup () {
if [ "$kernel" = Linux ]; then
set -x
sudo systemctl stop tailscaled
sudo killport 80
sudo systemctl stop sshd
sudo pkill ssh
# @TODO delete rule instead of restarting?
# [root@frame ~]# nft add rule ip filter TCP tcp dport 80 accept
# [root@frame ~]# nft -a list chain ip filter TCP
Expand Down Expand Up @@ -51,9 +51,22 @@ elif [ "$kernel" = Linux ]; then
set -x
sudo systemctl start tailscaled
sudo systemctl start sshd
sudo ssh -NT -f -i ~/.ssh/podman-remote -L frame:80:localhost:10080 "$USER"@localhost
sudo nft add rule ip filter TCP tcp dport 80 accept

# ---------------------------------
# this step could not be automated:
# we need to run `sudo killport 80` & run this after this script starts the container
set +x
source ~/Documents/scripts/source-me/colors.sh || true
echo -e "${RED}Please run this after the container starts$NC:"
echo -n "$YELLOW"
echo 'sudo killport 80'
echo 'sudo /usr/bin/ssh -NT -f -i ~/.ssh/podman-remote -L frame:80:localhost:10080 "$USER"@localhost'
echo -n "$NC"
sleep 5
set -x
# ---------------------------------

else
exit 1
fi
Expand Down

0 comments on commit 35f1807

Please sign in to comment.