This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// | |
/////////////////////////////////////////////////////////////////////// | |
// bitly_MakeShortLink() | |
// | |
// - Description: | |
// Use the bit.ly api to generate short URL | |
// | |
// - Usage: | |
// $ShortURL = bitly_MakeShortLink($url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
iso8601_date () { | |
date +%Y-%m-%dT%H:%M:%S%z | |
} | |
turn_on () { | |
echo 'on 0' | cec-client -s -d 1 RPI | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/** | |
* This script subscribes all global moderators to all forums. | |
* Put this in your phpBB3 directory and do "chmod 0700 auto_subscribe_moderators.php" | |
* You can use crontab to run this script so your moderators stay subscribed! | |
*/ | |
// Path to the phpBB3 Config Script | |
require dirname(__FILE__).'/config.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Converts all phpBB 3.1 remote avatars to uploaded avatars. | |
* | |
* To use this script: | |
* | |
* 1. Copy this file into the root of your phpBB installation. | |
* 2. Run the script from the command line: php convert-avatars.php | |
* | |
* Any avatar will be skipped if any errors come up, like these: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* @package phpBB3 | |
* @author GerB https://github.com/GerB | |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License | |
* | |
*/ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phpbb user pruning tool fails to actually work at > 100 users to prune | |
even though it happily displays a form with about 30000 checkboxes and | |
usernames to choose. | |
Slightly modified - this script wants user_ids_to_delete.txt near it, | |
with numerical user ids, one id per line. | |
Bulk delete all users with 0 posts in prevoius revision | |
This needs a *lot* of memory (or swapfile) if you have a lot of users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# send informations about new ssh logins to pushover api | |
who="$(whoami)" | |
last="$(last -n 5)" | |
curl -s \ | |
--form-string "token=" \ | |
--form-string "user=" \ | |
--form-string "title=SSH Login: $who" \ | |
--form-string "message=$last" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
let notify=75 | |
let criticalnotify=91 | |
let doAct=0 | |
DevMon="/dev/md0" | |
let percval=`df -h | grep -i $DevMon | awk '{ print +$5 }'` | |
echo percval = $percval | |
echo notify = $notify | |
sSev="INFO" | |
##check for critical warning -- can be disabled by making $criticalnotify a crazy number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit # Exit on most errors | |
set -o nounset # Dissallow expansion of unset variables | |
DISK=/media/backup | |
export BORG_PASSPHRASE="$(pass borg)" | |
BORG_REPOSITORY="$DISK/borg" | |
# DESC: notify the user that backups are done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PUSHOVER_API_URL="https://api.pushover.net/1/messages.json" | |
PUSHOVER_APPTOKEN="<YOUR_APP_TOKEN>" | |
PUSHOVER_USERKEY="<YOUR_USER_KEY>" | |
if [ "$PAM_TYPE" != "close_session" ]; then | |
MESSAGE="User '$PAM_USER' logged into '`hostname`' from IP address '$PAM_RHOST'" | |
curl -s -F "user=$PUSHOVER_USERKEY" -F "token=$PUSHOVER_APPTOKEN" -F "message=$MESSAGE" $PUSHOVER_API_URL |
OlderNewer