Skip to content

Instantly share code, notes, and snippets.

View geraldurbas's full-sized avatar

Gerald Urbas geraldurbas

View GitHub Profile
@geraldurbas
geraldurbas / gist:c8c8bd44e82fc7a16f74a2ccb216079d
Created January 27, 2024 22:24
Iphone / Safari and Nextcloud: http Header needed usine a Reverse Proxy
in Location:
Apache:
Header unset Upgrade
Nginx:
proxy_hide_header Upgrade;
@geraldurbas
geraldurbas / gist:c4d91ab4beb72b57c8f4d79d3b22badc
Created January 18, 2024 12:58
Delete tar.gz after defined days
find /path-to-folder -name "*.tar.gz" -type f -mtime +45 -exec ls {} \;
@geraldurbas
geraldurbas / map.html
Last active December 26, 2023 11:56
getAMap with Leaflet
from https://jsfiddle.net/crossmediapool/0ydw3ka8/
For TrueNAS SCALE Only
sed -i 's/auth.generate_token",\[300/auth.generate_token",\[14400/g' /usr/share/truenas/webui/*.js
For TrueNAS CORE Only
sed -ie 's/auth.generate_token",\[300/auth.generate_token",\[14400/g' /usr/local/www/webui/*.js
#14400 = 4h
#129600 = 36h
@geraldurbas
geraldurbas / gist:5285c6007fc0e6a35f2491ce9098037d
Created September 29, 2023 01:07
AVI & Mp4 Slideshow with ffmpeg for Hunter Camera Images
for i in $(find /somepath -type f -name "DSCF0001.JPG")
do
path="${i//DSCF0001.JPG/}"
cd $path
if [ ! -f "outputFinal.avi" ]; then
su - www-data -s /bin/bash -c "cd $path; ffmpeg -f image2 -framerate 3 -pattern_type glob -i '*.JPG' -s 3072x1728 outputFinal.avi"
fi
if [ ! -f "outputFinal.mp4" ]; then
su - www-data -s /bin/bash -c "cd $path; ffmpeg -f image2 -framerate 3 -pattern_type glob -i '*.JPG' -s 3072x1728 outputFinal.mp4"
fi
# Proxmox VE Installation on Hetzner Server via Rescue System
Follow these steps to install Proxmox VE on a Hetzner server via the Rescue System. The Rescue System is a Linux-based environment that can be booted into to perform system recovery tasks. We'll be using it to install Proxmox VE.
In order to complete the process, it is indeed necessary to first boot into the Rescue System and then connect to it via SSH. This will allow you to run the commands for installing Proxmox VE. Here are the steps:
### Starting the Rescue System
1. Log into the Hetzner Robot.
2. Under "Main Functions; Server" select the desired server and then open the tab "Rescue".
@geraldurbas
geraldurbas / gist:b3a13f0de668d1cf5bac2137fe76991a
Created November 16, 2022 17:57
Set Screen Resolution for Ubuntu in Hyper V Machines
nano /etc/default/grub
Change:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:3840x2160" ### use practical resolution
GRUB_CMDLINE_LINUX="quiet splash video=hyperv_fb:3840x2160" ### use practical resolution
update-grub
apt install linux-image-extra-virtual
Powershell as Admin
set-vmvideo -vmname ubuntu -horizontalresolution:3840 -verticalresolution:2160 -resolutiontype single
set-vm "Ubuntu" -EnhancedSessionTransportType HVSocket
@geraldurbas
geraldurbas / db_backup.sh
Created July 1, 2022 09:12 — forked from janit/db_backup.sh
Rotating PostgreSQL Backup Script
#!/bin/bash
# for use with cron, eg:
# 0 3 * * * postgres /var/db/db_backup.sh foo_db
if [[ -z "$1" ]]; then
echo "Usage: $0 <db_name> [pg_dump args]"
exit 1
fi
@geraldurbas
geraldurbas / gitea_upgrade_playbook.txt
Created June 10, 2022 04:24
Gitea Upgrade Playbook on Turnkey
#wget latest File:
wget https://dl.gitea.io/gitea/1.16.8/gitea-1.16.8-linux-amd64
#see https://dl.gitea.io/gitea
su - git -c "/home/git/gitea manager flush-queues"
service gitea stop
su - git -c "/home/git/gitea dump"
chmod 755 gitea-1.16.8-linux-amd64
chown git.git gitea-1.16.8-linux-amd64
rm gitea
@geraldurbas
geraldurbas / RunBackup.bat
Created April 26, 2022 00:46
Robocopy Backup
@echo off
REM Ordner per Robocopy kopieren
robocopy C:\Users\Username\AppData\Local\Thunderbird E:\UsernamesBackup\Mails /MIR /XA:H /W:0 /R:1 /REG /v /np /tee /unilog+:C:\Users\Username\UsernamesBackupLog.log
robocopy C:\Users\Username\Documents E:\UsernamesBackup\Dokumente /MIR /XA:H /W:0 /R:1 /REG /v /np /tee /unilog+:C:\Users\Username\UsernamesBackupLog.log
robocopy C:\Users\Username\Google E:\UsernamesBackup\Google /MIR /XA:H /W:0 /R:1 /REG /v /np /tee /unilog+:C:\Users\Username\UsernamesBackupLog.log
REM Zippen des Logfiles
powershell Compress-Archive -LiteralPath 'C:\Users\Username\UsernamesBackupLog.log' -DestinationPath "C:\Users\Username\UsernamesBackupLog.file_%time:~0,2%%time:~3,2%%time:~6,2%_%date:~-10,2%%date:~-7,2%%date:~-4,4%.zip"
powershell Compress-Archive -LiteralPath 'C:\Users\Username\UsernamesBackupLog.log' -DestinationPath "E:\UsernamesBackup\UsernamesBackupLog.file_%time:~0,2%%time:~3,2%%time:~6,2%_%date:~-10,2%%date:~-7,2%%date:~-4,4%.zip"