Compare commits
No commits in common. "48a51ba971f3bd9ca0843dc9b98d3caba8c65d1b" and "64431087e6709ecf8b53da4e3fdbb5f13bc0ef72" have entirely different histories.
48a51ba971
...
64431087e6
44
justfile
44
justfile
@ -8,7 +8,7 @@ id_like := `grep -G "\bID_LIKE\b" /etc/os-release | awk -F= '{print $2}'`
|
|||||||
release := `grep "VERSION_CODENAME" /etc/os-release | awk -F= '{print $2}'`
|
release := `grep "VERSION_CODENAME" /etc/os-release | awk -F= '{print $2}'`
|
||||||
run_user := env_var("USER")
|
run_user := env_var("USER")
|
||||||
|
|
||||||
install-caddy:
|
caddy:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
if [ "$distro" == "debian" ]; then
|
if [ "$distro" == "debian" ]; then
|
||||||
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
|
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
|
||||||
@ -24,7 +24,7 @@ install-caddy:
|
|||||||
sudo pkg install -y caddy
|
sudo pkg install -y caddy
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install-thelounge:
|
thelounge:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
if [ "$distro" == "debian" ]; then
|
if [ "$distro" == "debian" ]; then
|
||||||
curl -s https://api.github.com/repos/thelounge/thelounge-deb/releases/latest | grep "browser_download_url.*deb" | cut -d : -f 2,3 | tr -d '"' | wget -qi -
|
curl -s https://api.github.com/repos/thelounge/thelounge-deb/releases/latest | grep "browser_download_url.*deb" | cut -d : -f 2,3 | tr -d '"' | wget -qi -
|
||||||
@ -34,10 +34,34 @@ install-thelounge:
|
|||||||
echo "This justfile only supports The Lounge on Debian systems."
|
echo "This justfile only supports The Lounge on Debian systems."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install-tailscale:
|
tailscale:
|
||||||
curl -fsSL https://tailscale.com/install.sh | sh
|
curl -fsSL https://tailscale.com/install.sh | sh
|
||||||
sudo tailscale up
|
sudo tailscale up
|
||||||
|
|
||||||
|
scihub:
|
||||||
|
mkdir ~/scihub-torrent-urls
|
||||||
|
lynx -dump -nonumbers -listonly=on https://libgen.rs/repository_torrent/ | grep "\.torrent" | tee ~/scihub-torrent-urls/urls.txt
|
||||||
|
cd ~/scihub-torrent-urls && split -l 60 ~/scihub-torrent-urls/urls.txt torrent-
|
||||||
|
rm -fv ~/scihub-torrent-urls/urls.txt
|
||||||
|
|
||||||
|
docker:
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
if [ "$distro" == "debian" ]; then
|
||||||
|
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt remove $pkg; done
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y ca-certificates curl
|
||||||
|
sudo install -m 0755 -d /etc/apt/keyrings
|
||||||
|
sudo curl -fsSL https://download.docker.com/linux/{{distro}}/gpg -o /etc/apt/keyrings/docker.asc
|
||||||
|
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||||
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/{{distro}} {{release}} stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose docker-compose-plugin
|
||||||
|
sudo systemctl enable --now docker.service
|
||||||
|
sudo usermod -aG docker {{run_user}}
|
||||||
|
else
|
||||||
|
echo "This justfile only supports Docker on Debian systems."
|
||||||
|
fi
|
||||||
|
|
||||||
rustup:
|
rustup:
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
|
|
||||||
@ -76,17 +100,3 @@ install-fzf:
|
|||||||
sudo mv fzf /usr/bin/fzf
|
sudo mv fzf /usr/bin/fzf
|
||||||
fi
|
fi
|
||||||
rm -v fzf*.txt fzf*.tar.gz
|
rm -v fzf*.txt fzf*.tar.gz
|
||||||
|
|
||||||
auto-podman-compose:
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
containers=(AnonymousOverflow docker-breezewiki-quay dumb elk freshrss gothub libremdb lingva-translate privatebin redlib searxng shaarli)
|
|
||||||
COMPOSE_DIR="${HOME}/podman"
|
|
||||||
for ctn in "${containers[@]}"; do
|
|
||||||
cd "${COMPOSE_DIR}/${ctn}"
|
|
||||||
podman-compose down
|
|
||||||
podman-compose pull
|
|
||||||
podman-compose up -d
|
|
||||||
done
|
|
||||||
|
|
||||||
cd "${COMPOSE_DIR}/shaarli"
|
|
||||||
podman cp material shaarli_shaarli_1:/var/www/shaarli/tpl
|
|
||||||
|
36
python/mastodon.py
Executable file
36
python/mastodon.py
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
from pandas import json_normalize
|
||||||
|
import json
|
||||||
|
from html import unescape
|
||||||
|
|
||||||
|
with open("/home/jas/downloads/outbox.json", "r") as jf:
|
||||||
|
json_data = json.load(jf)
|
||||||
|
|
||||||
|
flattened_df = json_normalize(json_data, record_path=["orderedItems"])
|
||||||
|
|
||||||
|
published = []
|
||||||
|
for item in flattened_df["object.published"]:
|
||||||
|
published.append(item)
|
||||||
|
|
||||||
|
content = []
|
||||||
|
for item in flattened_df["object.content"]:
|
||||||
|
content.append(item)
|
||||||
|
|
||||||
|
x = zip(published, content)
|
||||||
|
|
||||||
|
print("#+TITLE: Mastodon posts, 2024-02-16T15:48:46Z - 2024-10-11T20:15:03Z")
|
||||||
|
print("#+SETUPFILE: ../org-templates/page.org")
|
||||||
|
print()
|
||||||
|
for item in x:
|
||||||
|
if type(item[0]) is str:
|
||||||
|
print(f"*** {item[0]}")
|
||||||
|
|
||||||
|
if type(item[1]) is str:
|
||||||
|
print("#+BEGIN_QUOTE")
|
||||||
|
print("#+BEGIN_EXPORT html")
|
||||||
|
print(unescape(item[1]))
|
||||||
|
print("#+END_EXPORT")
|
||||||
|
print("#+END_QUOTE")
|
||||||
|
print()
|
@ -1,27 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
from pandas import json_normalize
|
|
||||||
import json
|
|
||||||
from html import unescape
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
with open("/home/jas/downloads/outbox.json", "r") as jf:
|
|
||||||
json_data = json.load(jf)
|
|
||||||
|
|
||||||
flattened_df = json_normalize(json_data, record_path=["orderedItems"])
|
|
||||||
|
|
||||||
for item in flattened_df.iterrows():
|
|
||||||
print(f"*** {item[1]["object.published"]}")
|
|
||||||
if type(item[1]["object.content"]) is str:
|
|
||||||
print("#+BEGIN_QUOTE")
|
|
||||||
print("#+BEGIN_EXPORT html")
|
|
||||||
print(unescape(item[1]["object.content"]))
|
|
||||||
print("#+END_EXPORT")
|
|
||||||
if item[1]["object.attachment"]:
|
|
||||||
if type(item[1]["object.attachment"]) is list:
|
|
||||||
for i in item[1]["object.attachment"]:
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
@ -54,6 +54,10 @@ if __name__ == "__main__":
|
|||||||
"root@hyperreal.lyrebird-marlin.ts.net:/srv/borgbackup/hyperreal/",
|
"root@hyperreal.lyrebird-marlin.ts.net:/srv/borgbackup/hyperreal/",
|
||||||
"/naspool/borgbackup/hyperreal",
|
"/naspool/borgbackup/hyperreal",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"root@hyperreal.lyrebird-marlin.ts.net:/home/mastodon/live/public/system/",
|
||||||
|
"/naspool/mastodata",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
for remote in remotes:
|
for remote in remotes:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user