Skip to content

Instantly share code, notes, and snippets.

@PatPeter
PatPeter / ServerStatistics.sh
Last active August 25, 2018 20:46
Scans SCP:SL files for Steam IDs and aggregates on a per-day and per-day/SteamID basis
#!/bin/bash
scpsl=.
for dir in $scpsl/servers/*
do
if [ ! -d $dir ]
then
continue
fi
@PatPeter
PatPeter / MergeConfigs.sh
Last active August 12, 2019 08:00
Script that merges SCP:SL configuration files with keys in-place
#!/bin/bash
scpsl=.
if [ -n "$1" ]
then
server=$1
else
server="*"
fi
@PatPeter
PatPeter / CleanLogs.sh
Last active September 22, 2018 22:35
Removes extraneous lines from SCP: Secret Laboratory logs to prevent gigabytes of log accumulation
#!/bin/bash
# Copyright (c) 2018, Nicholas Solin
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
@PatPeter
PatPeter / TeamSpeak3GameStatistics.php
Created May 1, 2017 04:19
Scans TeamSpeak 3 logs for "Last played" chat messages and prints out two CSVs
<?php
$prefix = 'D:\\Users\\Nicholas\\AppData\\Roaming\\TS3Client\\chats\\M1dQMnhKRVE3RHBjd3luMTdCcG8xOVBpMUZ3PQ==';
$years = array('2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017');
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
$filename = 'channel_';
$extension = '.txt';
$games = array();
@PatPeter
PatPeter / TeamSpeak3ChatLogSplitter.php
Last active April 13, 2017 00:53
Divides channel.html/txt and server.html/txt files into folders by year and files by month
<?php
$directories = array('M1dQMnhKRVE3RHBjd3luMTdCcG8xOVBpMUZ3PQ==_2012-03-18', 'M1dQMnhKRVE3RHBjd3luMTdCcG8xOVBpMUZ3PQ==_2012-11-05/M1dQMnhKRVE3RHBjd3luMTdCcG8xOVBpMUZ3PQ==', 'M1dQMnhKRVE3RHBjd3luMTdCcG8xOVBpMUZ3PQ==_2013-11-10/M1dQMnhKRVE3RHBjd3luMTdCcG8xOVBpMUZ3PQ==', 'M1dQMnhKRVE3RHBjd3luMTdCcG8xOVBpMUZ3PQ==');
$filenames = array('channel', 'server');
$extensions = array('.html', '.txt');
foreach ($directories as $directory) {
foreach ($filenames as $filename) {
foreach ($extensions as $extension) {
$sourceFile = fopen($directory . '/' . $filename . $extension, 'r');
@PatPeter
PatPeter / SymbolicLinkCSVSync.bat
Last active March 20, 2020 16:52
Batch script that creates symbolic links from Documents to Saved Games, to reduce clutter
@echo off
setlocal enabledelayedexpansion
set Folders=Test1,Test2
set Documents=D:\Users\Nicholas\OneDrive\Documents
set SavedGames=D:\Users\Nicholas\Saved Games
call :parse "%Folders%"
goto :eos
@PatPeter
PatPeter / Microsoft Works Classes.reg
Created May 29, 2016 21:16
Windows registry entries for the Microsoft Works viewer https://support.microsoft.com/en-us/kb/315757
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.wps]
@="Works.Office.wps"
[HKEY_CLASSES_ROOT\.xlr]
@="Works.Office.xlr"
[HKEY_CLASSES_ROOT\Works.Office.wps]
@="Microsoft Works Document"
@PatPeter
PatPeter / CustomClasses.reg
Last active September 18, 2016 23:35
Collection of Windows registry keys for game files
Windows Registry Editor Version 5.00
; <<< acffile
[HKEY_CLASSES_ROOT\.acf]
@="acffile"
"Content Type"="text/plain"
"PerceivedType"="text"
[HKEY_CLASSES_ROOT\acffile]
@="App Cache File"
@PatPeter
PatPeter / UpdateMultiverse.sh
Created March 6, 2016 01:15
Updates all Multiverse plugins for Bukkit servers
#!/bin/bash
plugins=( Core Inventories Portals NetherPortals SignPortals )
maximum_errors=20
for p in ${plugins[@]}; do
echo "Processing Multiverse-$p"
version=0
if [ -e Multiverse-$p-2.5-#*.txt ]; then
@PatPeter
PatPeter / GTAVLocalFix.bat
Created January 23, 2016 21:47
Fixes the Local剜捯獫慴⁲慇敭屳呇⁁屖湥楴汴浥湥⹴湩潦 file created by GTAV
chcp 65001
move "%USERPROFILE%\AppData\Local剜捯獫慴⁲慇敭屳呇⁁屖湥楴汴浥湥⹴湩潦" "%USERPROFILE%\AppData\Local\Rockstar Games\GTA V\entitlement.info"
mklink "%USERPROFILE%\AppData\Local剜捯獫慴⁲慇敭屳呇⁁屖湥楴汴浥湥⹴湩潦" "%USERPROFILE%\AppData\Local\Rockstar Games\GTA V\entitlement.info"
attrib +h +s "%USERPROFILE%\AppData\Local剜捯獫慴⁲慇敭屳呇⁁屖湥楴汴浥湥⹴湩潦" /l