Skip to content

Instantly share code, notes, and snippets.

View Kr3m's full-sized avatar

Kevin Remisoski Kr3m

View GitHub Profile
@Kr3m
Kr3m / ardour-deps.sh
Created April 13, 2023 10:49
Ardour Dependency install script. Depends on nala.
#!/bin/bash
sudo nala install libboost-all-dev -y
sudo nala install libasound2-dev -y
sudo nala install libglib2.0-dev -y
sudo nala install glibmm-2.4-dev -y
sudo nala install libsndfile1-dev -y
sudo nala install libcurl4-gnutls-dev -y
sudo nala install liblo-dev -y
sudo nala install libtag1-dev -y
@Kr3m
Kr3m / assetfinder.sh
Created January 26, 2023 18:37
find assets in pk3 files in Quake 3.
#!/bin/bash
for file in *.pk3; do
if ( zipinfo -l "$file" | grep -q "$1"); then
echo "$file"
fi
done
@Kr3m
Kr3m / pretty git history
Created January 25, 2023 10:18 — forked from ecasilla/pretty git history
git-hist
##
# Creates an alias called "git hist" that outputs a nicely formatted git log.
# Usage is just like "git log"
# Examples:
# git hist
# git hist -5
# git hist <branch_name>
# git hist <tag_name> -10
##
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short"
@Kr3m
Kr3m / read_pk3s.sh
Created January 19, 2023 11:29
Output map names in pk3 files.
#!/bin/bash
find /home/qlserver/serverfiles/steamapps/workshop/content/282440 -name '*.pk3' -exec zipinfo -1 {} \; | grep '.bsp' | sed 's/^\(maps\/\)*//' | sed -e 's/\(.bsp\)*$//g'
@Kr3m
Kr3m / playercount.sh
Created October 3, 2021 14:15
Retrieve total number of Steam players currently playing a game.
#Usage: ./playercount.sh "Warfork"
#!/bin/bash
appid=$(curl -s https://api.steampowered.com/ISteamApps/GetAppList/v0002/ | jq ".applist.apps[] | select(.name==\"$1\")" | jq '.appid')
curl -s https://api.steampowered.com/ISteamUserStats/GetNumberOfCurrentPlayers/v1/?appid="$appid" | jq '.response.player_count'
@Kr3m
Kr3m / addons.bat
Created September 26, 2021 06:02
Join Left 4 Dead 2 custom campaigns from console or website link without having to wait for workshop addons to load.
:: Store in addons folder and run from an elevated command prompt.
@ECHO OFF
for /f "delims==" %%k in ('dir ".\workshop\*" /s /b') do (mklink ".\%%~nxk" "%%~k")
@Kr3m
Kr3m / check.sh
Last active March 26, 2023 20:36
Restart LinuxGSM based Left 4 Dead 2 server that is both empty and not running the default map.
#!/bin/bash
#depends on gamedig being installed globally
#place in /home/l4d2server (can probably work with other LGSM servers with minor modifications).
gameserver="l4d2server"
game="left4dead2"
config_path="./lgsm/config-lgsm/$gameserver/"
server="1.1.1.1" #change to server ip
for i in $(find . -maxdepth 1 -name "$gameserver*" | sed 's|^./||'); do
defaultmap=$(grep -P '^(?=[\s]*+[^#])[^#]*(defaultmap)' $config_path$i.cfg | awk -F\" '{print $2}')
port=$(grep -P '^(?=[\s]*+[^#])[^#]*(port)' $config_path$i.cfg | grep -v 'client' | awk -F\" '{print $2}')
@Kr3m
Kr3m / TestDialogue.cs
Created July 5, 2019 01:09
Testing Dialogue from XML
private static void TestDialogue()
{
var dialogue = GameDialogue.DialogueList;
for (var i = 0; i < dialogue.Count; i++)
{
var current = dialogue[i];
var ouputs = current.OutputIds;
var currentOutputCount = current.OutputIds.Count;
@Kr3m
Kr3m / rssToJson
Created June 25, 2019 01:27 — forked from BilalBudhani/rssToJson
PHP function to convert simple RSS to JSON
public function Parse ($url) {
$fileContents= file_get_contents($url);
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
$json = json_encode($simpleXml);
return $json;
}
@Kr3m
Kr3m / class.envato-api-basic.php
Created May 14, 2019 23:19 — forked from dtbaker/class.envato-api-basic.php
Simple PHP class for interacting with the Envato API within a WordPress plugin
<?php
/**
* Exception handling class.
*/
class EnvatoException extends Exception {
}