Skip to content

Instantly share code, notes, and snippets.

View ManOki's full-sized avatar

ManOki ManOki

View GitHub Profile
@ManOki
ManOki / #update-nextcloud-aio-webroot.sh
Created January 6, 2023 09:25
WEBROOT for nextcloud-aio
#!/bin/bash
WEBROOT=/nextcloud
FILE=/entrypoint.sh
sed -i 's|occ config:system:set overwrite.cli.url --value="https://$NC_DOMAIN/"|occ config:system:set overwrite.cli.url --value="https://${NC_DOMAIN}'${WEBROOT}'"\nphp /var/www/html/occ config:system:set overwritewebroot --value="'${WEBROOT}'"|' "$FILE"
sed -i 's|https://$NC_DOMAIN/"|https://${NC_DOMAIN}'${WEBROOT}'"|' "$FILE"
sed -i 's|https://$NC_DOMAIN/|https://${NC_DOMAIN}'${WEBROOT}'/|' "$FILE"
@ManOki
ManOki / build-pihole-global-adlists.sh
Last active November 20, 2022 10:42
Global adlist.txt for pihole docker
#!/bin/bash
GRAVITY_DB_FILE=/etc/pihole/gravity.db
ADLIST_DIRECTORY=/var/www/html/adlists/
LIST_EXTENSION=.list
HOSTS_EXTENSION=.hosts
GROUP_NAME_SQL="SELECT DISTINCT name FROM 'group' WHERE enabled = 1;"
EXPORT_DOMAIN_SQL="SELECT DISTINCT gravity.domain \
@ManOki
ManOki / rezip.sh
Last active September 27, 2021 13:49
rezip existing zip archives using 7zip
#!/bin/bash
TASKS=1
DIRS=()
for o in "$@" ; do
case $o in
-t|--tasks)
TASKS=$2
shift
@ManOki
ManOki / shrink-lvm-on-luks.sh
Last active September 10, 2021 07:39
shrink an encrypted logical volume including luks container and logical partition
#!/bin/bash
set -e
set -o pipefail
if [ -z "$1" ] ; then echo "no device parameter" && exit 0 ; fi
BLOCK_DEVICE=$1
LOG_FILE=shrink.log
# choose logical partition