Skip to content

Instantly share code, notes, and snippets.

@PatPeter
PatPeter / ark-daily-backup.sh
Last active May 20, 2016 04:29
Daily backup for ARK: Survival Evolved servers
#!/bin/bash
ROOT=/servers/steam/ark/ShooterGame/Saved
DATE=`date +%Y-%m-%d`
EURODATE=`date +%d.%m.%Y`
BACKUP=$ROOT/SavedArks/$DATE
MAP=${1:-TheIsland}
# sudo apt-get install lrzip
if [ -e /usr/bin/lrzip ]; then
@PatPeter
PatPeter / AmazonS3FastDownloads.php
Last active March 7, 2021 23:53
Script for uploading files to an AWS S3 bucket and using it as a fast download server
<?php
require('aws.phar');
use Aws\S3\S3Client;
const BUCKET_NAME = '<BUCKET_NAME>';
// Requires the ListBucket, GetObject, GetObjectAcl, PutObject, PutIpConfiguration, PutInventoryConfiguration, DeleteObject, and PutObjectAcl IAM permissions
$s3 = S3Client::factory(array(
@PatPeter
PatPeter / ark-server
Created December 25, 2015 08:50
/etc/init.d/ark-server (ARK server startscript)
#! /bin/sh
### BEGIN INIT INFO
# Provides: ark-server
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@PatPeter
PatPeter / archive-damagelogs-monthly.sh
Created December 13, 2015 00:00
Garry's Mod monthly damagelogs archiver
#!/bin/bash
PWD=`pwd`
if [[ -z "$1" || ! -d "$1" ]]; then
echo "No damagelog directory provided or damagelog directory does not exist."
exit
fi
LAST_MONTH=$((`date +%m` - 1))
@PatPeter
PatPeter / archive-logs-monthly.sh
Last active December 13, 2015 00:28
Source Engine monthly logs archiver
#!/bin/bash
PWD=`pwd`
if [[ -z "$1" || ! -d "$1" ]]; then
echo "No logs directory provided or logs directory does not exist."
exit
fi
LAST_MONTH=$((`date +%m` - 1))
@PatPeter
PatPeter / GameTrackerProtocolConverter.php
Last active December 4, 2016 08:16
GameTracker HTTP to HTTPS banner converter
<?php
const DEBUG = false;
const BANNER_PATH = '/gametracker';
function convert_banner($url) {
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, $url);