Skip to content

Instantly share code, notes, and snippets.

@lechup
lechup / generate-ads.sh
Created October 19, 2022 08:28
SetupAD Generate Ads.txt
#!/usr/bin/env bash
PWD=`pwd`
SCRIPT_DIR=`dirname -- "$0"`
cd $SCRIPT_DIR
wget https://wb.setupad.com/api/getAdsTXT/1793/download -q -O ads-new.txt
if [ `cat ads-new.txt | wc -l` -gt 0 ]; then
echo "setupad.com, 1793, DIRECT" >> ads-new.txt
@lechup
lechup / backup.ps1
Last active November 30, 2022 14:09
Scripts to manage backup on Windows 10 machines
# Set-ExecutionPolicy Bypass -Scope Process -Force; or use run.bat
$cred = Import-Clixml .\backup.cred
iex "wbadmin start backup -allCritical -backupTarget:\\backup-server.lan\backup\komputery\ -user:$($cred.UserName) -password:$($cred.GetNetworkCredential().password) -quiet > .\backup.log"
@lechup
lechup / config-site.php
Last active January 23, 2023 14:43
Piler mailpiler.org - adding aliases on the fly
<?
// based on:
// https://www.mailpiler.org/wiki/current:custom-authentication
$config['CUSTOM_EMAIL_QUERY_FUNCTION'] = 'set_email_aliases';
function set_email_aliases($username = '') {
$session = Registry::get('session');
$data = $session->get("auth_data");