LIST

nextcloud add postgres db

minimal docker compose https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/insecure/postgres/apache/docker-compose.yml # docker-compose.yml version: '3' services: db: image: postgres:alpine restart: always volumes: - db:/var/lib/postgresql/data:Z env_file: - db.env redis: image: redis:alpine restart: always app: image: nextcloud:apache restart: always ports: - 127.0.0.1:8080:80 volumes: - nextcloud:/var/www/html:z environment: - POSTGRES_HOST=db - REDIS_HOST=redis env_file: - db.env depends_on: - db - redis cron: image: nextcloud:apache restart: always volumes: - nextcloud:/var/www/html:z entrypoint: /cron.sh depends_on: - db - redis volumes: db: nextcloud: # db.env POSTGRES_PASSWORD= POSTGRES_DB=nextcloud POSTGRES_USER=nextcloud sqlite -> postgres official guide https://muetsch....

September 5, 2024

plex migrate database from sqlite to postgres

create manual backup shutdown kgp | grep plex kubectl exec --stdin --tty plex-7c7678c96d-btc28 -- /bin/bash ps aufx output: root@plex-7c7678c96d-btc28:/# ps aufx USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 6305 0.0 0.0 7740 4224 pts/0 Ss 10:42 0:00 /bin/bash root 6345 0.0 0.0 10888 4224 pts/0 R+ 10:59 0:00 \_ ps aufx root 1 0.0 0.0 440 0 ? Ss Aug31 0:00 /package/admin/s6/command/s6-svscan -d4 root 16 0....

September 5, 2024

plex repair database 'database disk image is malformed'

kgp kubectl exec --stdin --tty plex-7c7678c96d-btc28 -- /bin/bash cd '/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases' ls /usr/lib/plexmediaserver/ '/usr/lib/plexmediaserver/Plex SQLite' com.plexapp.plugins.library.db (src: https://support.plex.tv/articles/repair-a-corrupted-database/) yeah, keep getting error database disk image is malformed src: https://www.reddit.com/r/PleX/comments/15uhckv/database_disk_image_is_malformed_how_to_repair/ -> https://github.com/ChuckPa/PlexDBRepair/blob/master/DBRepair.sh no vi / vim on docker image so doing it the cat way cat > DBRepair.sh <paste code> <ctrl-d> chmod +x DBRepair.sh ./DBRepair.sh I chose automatic afterwards, the integrity check was ok '/usr/lib/plexmediaserver/Plex SQLite' com.plexapp.plugins.library.db SQLite version 3....

September 5, 2024

merge google photos metadata with exiftool

setup brew install exiftool https://exiftool.org/ exiftool -r -d %s -tagsfromfile "%d/%F.json" "-GPSAltitude<GeoDataAltitude" "-GPSLatitude<GeoDataLatitude" "-GPSLatitudeRef<GeoDataLatitude" "-GPSLongitude<GeoDataLongitude" "-GPSLongitudeRef<GeoDataLongitude" "-Keywords<Tags" "-Subject<Tags" "-Caption-Abstract<Description" "-ImageDescription<Description" "-DateTimeOriginal<PhotoTakenTimeTimestamp" -ext "*" -overwrite_original -progress --ext json . https://stackoverflow.com/questions/65210140/how-to-merge-json-and-google-takeout-photos-to-get-the-right-dates-back exiftool -r -d %s -tagsfromfile "%d/%F.json" "-GPSAltitude<GeoDataAltitude" "-GPSLatitude<GeoDataLatitude" "-GPSLatitudeRef<GeoDataLatitude" "-GPSLongitude<GeoDataLongitude" "-GPSLongitudeRef<GeoDataLongitude" "-Keywords<Tags" "-Subject<Tags" "-Caption-Abstract<Description" "-ImageDescription<Description" "-DateTimeOriginal<PhotoTakenTimeTimestamp" -ext "*" -overwrite_original -progress --ext json . 2>&1 | tee log.log prep: copy json file for -edited files find . -type f -name "*-edited.*" | sed 's/^\(....

September 3, 2024

reload blog v2

rm -r static/resources content/blog content/filing* public cp -pr ~/Downloads/yarle-run/output8/notes/evernote.toc.titled/all/blog ./content/ cp -pr ~/Downloads/yarle-run/output8/notes/evernote.toc/filing/filing-* ./content/ mv content/blog/resources static rm -r content/filing-learning-notes/resources rm -r content/filing-web/resources fix title with quotes breaking frontmatter fix title with quotes breaking frontmatter blog sed tag published to draft blog sed tag published to draft blog sed fix missing tags blog sed fix missing tags blog sed fix hashtag in frontmatter tags blog sed fix hashtag in frontmatter tags...

September 3, 2024

homeserver ssl install certbot on homeserver

https://ultimatehomeserver.com/docs/getting-started/ssl install certbot + route53 changed /opt/certbot/ to /opt/certbotfoo/ sudo apt update sudo apt install python3 python3-venv libaugeas0 sudo python3 -m venv /opt/certbotfoo/ sudo /opt/certbotfoo/bin/pip install --upgrade pip sudo /opt/certbotfoo/bin/pip install certbot sudo ln -s /opt/certbotfoo/bin/certbot /usr/bin/certbot sudo rm /usr/bin/certbot sudo ln -s /opt/certbotfoo/bin/certbot /usr/bin/certbot ls ~/.secrets/certbot # set credentials for aws route53 sudo vi /root/.aws/config sudo /opt/certbotfoo/bin/certbot certonly \ --dns-route53 \ --dns-route53-propagation-seconds 60 \ -d hs.tjenwellens.eu \ -d "*.hs.tjenwellens.eu" add cron...

August 27, 2024

blog sed fix hashtag in frontmatter tags

content-fix-frontmatter-hashtag.sed /^tags: .*"#".*$/s/"#","#"/"starred"/g /^tags: .*"#".*$/s/"#"/"starred"/g /^tags: .*#.*$/s/#//g Speedrun find content/blog -type f -name '*.md' -exec sed -i "" -f content-fix-frontmatter-hashtag.sed {} \;

August 19, 2024

blog sed fix missing tags

which files grep -LR '^tags: ' content/everblog | grep ".md$" single file fix sed '/^---$/,/^---$/s/^$/tags: []\ndraft: true/' content/everblog/opinion-stop-wasting-a-perfectly-good-bug.md merge echo 'content/everblog/insight-heroes-journey-why.md' | xargs -I {} sed '/^---$/,/^---$/s/^$/tags: []\ndraft: true/' {} Speedrun grep -LR '^tags: ' content/blog | grep ".md$" | xargs -I {} sed -i "" '/^---$/,/^---$/s/^$/tags: []\ndraft: true/' {}

August 19, 2024

blog sed tag published to draft

sed -e '/---/,/---/s/^\(tags: .*"#published".*\)$/\1\ndraft: false/' -e t -e '/---/,/---/s/^\(tags: .*\)$/\1\ndraft: true/' -e t -e '2n; /---/i\ draft: true' content/blog/article-on-the-diverse-and-fantastical-shapes-of-testing-martin-fowler.md | head content-parse-draft-from-published-tag.sed /^---$/,/^---$/s/^\(tags: .*"#published".*\)$/\1\ndraft: false/ t /^---$/,/^---$/s/^\(tags: .*\)$/\1\ndraft: true/ Speedrun find content/blog -type f -name '*.md' -exec sed -i "" -f content-parse-draft-from-published-tag.sed {} \;

August 19, 2024

reload blog

rm -r static/resources rm -r content/everblog rm -r public cp -r ~/Downloads/yarle-run/output4/notes/Blog content/everblog mv content/everblog/resources static fix title with quotes breaking frontmatter grep -R 'title: ".*".*"$' ./content/everblog | sed 's/:.*//' | sed 's!^\(.*\)!sed -i "" -e '"'"'/^title: ".*".*"$/s/"//g'"'"' -e '"'"'/^title: [^"]*$/s/title: \\(.*\\)/title: "\\1"/'"'"' "\1"! ' | zsh parse draft/no-draft blog sed tag published to draft find content/everblog -type f -name '*.md' -exec sed -i "" -f content-parse-draft-from-published-tag.sed {} \; #todo: fix title with _ should be :...

August 6, 2024