This file contains hidden or 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 | |
/* | |
VikingBot NickServ Plugin | |
To install, put this file in your /plugins directory. | |
Then append the following to your vikingbot config.php | |
replacing the nickname and password with your actual | |
nickserv details. Then restart the bot. | |
This file contains hidden or 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 | |
// This script receives DDNS updates via HTTP | |
// example: http://server/ddns-api.php?name=home = updates home.domain.com to IP of requester | |
define('DDNS_DATA_FILE', '/home/ddns/ddns.json'); | |
define('DDNS_DOMAIN', 'example.com'); | |
header("Content-type: text/plain"); |
This file contains hidden or 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 | |
define('HETZNER_KEY_PATH', '/root/.hetzner_robot_key'); | |
if (!file_exists(HETZNER_KEY_PATH)) die('Key file at '.HETZNER_KEY_PATH.' not found'.PHP_EOL); | |
$hetzner_key = file_get_contents(HETZNER_KEY_PATH); | |
if (!strpos($hetzner_key, ':')) die('Key file must be of format "username:password"'.PHP_EOL); | |
$process = curl_init('https://robot-ws.your-server.de/server'); | |
curl_setopt($process, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); |
This file contains hidden or 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 | |
$input = file_get_contents('php://input'); | |
$input = (empty($input) ? 'No content' : $input); | |
$http_method = $_SERVER['REQUEST_METHOD']; | |
$http_url = $_SERVER['REQUEST_URI']; | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$datetime = date('r'); | |
$headers = ''; |
This file contains hidden or 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/python | |
# Installation: | |
# - Install `boto`: pip install -U boto | |
# - Configure EC2 credentials: see http://boto.cloudhackers.com/en/latest/getting_started.html#configuring-boto-credentials | |
# - Configure username or SSH args below | |
# These things are configurable | |
region = 'eu-central-1' | |
ssh_username = 'simonfredsted' |
This file contains hidden or 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 | |
# This script deletes old files when the disk is getting full. | |
# It will always delete the oldest file or directory. Can be run | |
# in a cronjob every few minutes. | |
# Configurables | |
STORAGEDIR=/var/backups |
This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1493803477000", | |
"Effect": "Allow", | |
"Action": [ | |
"ec2:DescribeAvailabilityZones", | |
"ec2:DescribeInstances", | |
"ec2:DescribeRegions", |
This file contains hidden or 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 | |
$pdo = new PDO( | |
sprintf( | |
'mysql:host=%s;dbname=%s', | |
getenv('DB_HOST'), | |
getenv('DB_DATABASE') | |
), | |
getenv('DB_USERNAME'), | |
getenv('DB_PASSWORD') | |
); |
This file contains hidden or 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
{ | |
"openapi": "3.0.0", | |
"info": { | |
"version": "1.0.0", | |
"title": "Swagger Petstore", | |
"license": { | |
"name": "MIT" | |
} | |
}, | |
"paths": { |