Skip to content

Instantly share code, notes, and snippets.

View Bueddl's full-sized avatar

Sebastian Büttner Bueddl

View GitHub Profile
#pragma once
template<typename T>
T square(T val) {
return val * val;
}
#define Schleife(...) if(__VA_ARGS__){
#define If loop
#define EndIfSchleife goto loop;}
@Bueddl
Bueddl / adobe-decrypt-serial.c
Created January 7, 2017 16:24
Adobe Serial Number Decrypter
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, const char *argv[])
{
int i, idx;
const char *adobe_cipher[] = {
"0000000001", "5038647192", "1456053789", "2604371895",
"4753896210", "8145962073", "0319728564", "7901235846",
@Bueddl
Bueddl / php.hpp
Last active February 28, 2020 20:53
no.
#include <vector>
#include <iostream>
#define ​ auto
#define array(x...) std::vector{x}
#define as ,
#define rev(a, v) auto v : a
#define foreach(x) for (rev(x))
#define echo std::cout <<
@Bueddl
Bueddl / sort_maps_by_titlepack.sh
Created July 21, 2017 15:29
Sort ManiaPlanet maps into folders by titlepack
find . -type f -iname '*.Gbx' -print0 |
while IFS= read -r -d $'\0' file; do
title=$(grep -aPo 'title="(.*?)"' "$file" | sed -r 's/.*?="(.*)"/\1/g')
titledir="repack/$title"
if [ ! -d $titledir ]; then
mkdir -vp $titledir
fi
filename=$(basename "$file")
cp -v "$file" "$titledir/$filename"
done
#!/bin/bash
author=insen
find . -type f -iname '*.gbx' -print0 |
while IFS= read -r -d $'\0' file; do
if grep -aq 'author="$author"' "$file"; then
echo "Filename: $file";
uid=$(grep -aPo 'uid="(.*?)"' "$file" | sed -r 's/.*?="(.*)"/\1/g')
title=$(grep -aPo 'title="(.*?)"' "$file" | sed -r 's/.*?="(.*)"/\1/g')
@Bueddl
Bueddl / migrate_servers_batch.sh
Last active May 12, 2017 14:10
migrate server in batch
#!/bin/bash
# (C) 2017 by Sebastian 'bueddl' Büttner <tm@bueddl.de>
#
# MP4 & NADEO rocks!
# ---------------------------------------------------------------------
# !!!! ATTENTION !!!!
# You are supposed to change at least the next 2 variables.
@Bueddl
Bueddl / utf8decode.cpp
Created May 12, 2017 07:36
utf8 encoding test
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <cassert>
// (C) 2017 by Sebastian 'bueddl' Büttner
void checkCodepoint(wchar_t codepoint)
{
// Primary requirement for validity of XML
@Bueddl
Bueddl / XmlRpcParsingTest.cpp
Last active May 11, 2017 23:57
Parsingtest for XmlRpc using tinyxml
#include <tinyxml.h>
int main()
{
TiXmlDocument doc("../toffe.xml");
if(!doc.LoadFile())
{
std::cout << "Could not load XML File." << std::endl;
return 1;
@Bueddl
Bueddl / migrate_servers.sh
Last active May 11, 2017 13:50
Import your mp3 gameservers into mp4
#!/bin/bash
# (C) 2017 by Sebastian 'bueddl' Büttner <tm@bueddl.de>
#
# MP4 & NADEO rocks!
# ---------------------------------------------------------------------
# !!!! ATTENTION !!!!
# You are supposed to change at least the next 2 variables.