LightAffaire Photography

Code

Welcome to my coding/scripts/sysadmin page. Over the years I have developed numerous utilities, scripts, code and sysadmin techniques to make my life easier. Occasionally I release one into the wild. Have fun!

If you have feedback or you require a "bespoke" version of any tool please contact me.


Social . pixelfed-cli - Upload image plus text to pixelfed social network

Features:

- Pixelfed is a free and open-source image sharing social network service.
- A script to upload an image and text (optional) to users feed via API.
- Config file for pixelfed hostname and access token

Examples:

$ pixelfed-cli --config-file ~/.pixelfed-cli --test
$ pixelfed-cli --file image-file.jpg --text "caption text"
$ pixelfed-cli --file just-an-image.jpg
$ pixelfed-cli --delete message-id

Download: pixelfed-cli


Linux . thumbgen - Thumbnail generator

Features:

- Multi-threaded thumbnail generator based on freedesktop.org thumbnail specification.
- Pre-generates various thumbnails (128px 256px 512px and 1024px) of jpeg images.
- Creation, deletion, backup and restore of thumbnails. ImagicMagick must be installed.
- If you have lots of images in directories this script will speedup desktop filemanagers.
- Generates 45K 128px thumbnails in ~15 minutes (i6700 cpu/32GB ram/512GB ssd).
- Config file format (--edit option): # num-threads,thumb-size,thumb-quality,label,path

Examples:

$ thumbgen --dir /path --thumb-size 256 --num-threads 8
$ thumbgen --run-all
$ thumbgen --run single-config
$ thumbgen --thumb-stats
$ thumbgen --backup-all-dirs
$ thumbgen --delete-256-dir --yes
$ thumbgen --restore-256-dir --yes

Download: thumbgen


Cloud . cloud-cli - Nextcloud/Owncloud command line client

Features:

- [Next|Own]cloud command line client to perform basic file, share and user operations.
- File commands to list, search, upload, download, pipe, move, copy and delete files/dirs.
- Share commands to list, create, update and delete shares.
- User commands to list, search, create, update and delete users.
- Config file for basic commands ie. --host, --user, --pass, --admin-user and --admin-pass.

Examples:

$ cloud-cli --host https://your-cloud.com:443 -user your-user --pass your-pass --list /
$ cloud-cli --list path
$ cloud-cli --search cloud-file
$ cloud-cli --upload local-file
$ cloud-cli --download cloud-file
$ cloud-cli --copy cloud-file1 --to cloud-file2
$ cloud-cli --move cloud-file1 --to cloud-file2
$ cloud-cli --pipe cloud-file
$ cloud-cli --delete cloud-file
$ cloud-cli --exists cloud-file
$ cloud-cli --create-dir cloud-dir
$ cloud-cli --delete-dir cloud-dir

$ cloud-cli --list-shares
$ cloud-cli --create-share path --share-type public --share-pass secret
$ cloud-cli --update-share id --share-expire 2022-12-31
$ cloud-cli --delete-share id

$ cloud-cli --list-users
$ cloud-cli --list-user username
$ cloud-cli --create-user username --user-pass password --user-email user@yoursite.com
$ cloud-cli --update-user username --user-lang de --user-quota 5GB
$ cloud-cli --delete-user username

Download: cloud-cli


Security . Web deny access

Features:

- Auto-generated web deny access files (apache and nginx) to deny bots/spiders/clouds/hosters/actors.
- Builds the "deny" IP network rules from a curated list of Autonomous System Numbers (ASN) whose traffic I have carefully observed over time.
- Install in your webservers DocumentRoot/.htaccess (apache) or /etc/nginx/blockips.conf and add 'include /etc/nginx/blockips.conf;' to nginx.conf file (nginx) and check your for HTTP 403 access denied requests in your access and/or log files.
- Using this web deny access file will significantly reduce web attacks to your webserver.
- I only want humans or google/bing search accessing my web infrastructure as only humans buy my products/services.

Goto: Web deny report - web attacks denied to this site

Goto: Web deny access - Apache or Web deny access - Nginx