Skip to content

Instantly share code, notes, and snippets.

@mgerhardy
mgerhardy / gitlab-delete-old-pipelines.sh
Last active December 12, 2023 12:23
This script allows to delete old gitlab pipelines that still use disk space for the artifacts, build logs and so on
#!/bin/bash
#
# This script allows to delete old gitlab pipelines that still use disk space for the artifacts, build logs and so on.
# It will keep the last 100 pipelines. Make sure to modify your PRIVATE_TOKEN, your PROJECT_ID and your GITLAB_URL.
#
# If you want to run the script in dry mode - set _dryrun to 1 - it won't delete anything in that case, but just you the
# pipeline ids it would delete
#
# Used in combination with https://github.com/K-MailOrder/gitlab-migration to reduce the size of a gitlab instance
@mgerhardy
mgerhardy / gist:01b46f9485685b58050ee234bed31c0b
Created June 16, 2021 17:46
valgrind scummvm eventrecorder twine
==3124361== Invalid write of size 8
==3124361== at 0x483F7F3: memmove (vg_replace_strmem.c:1270)
==3124361== by 0x4DBF61: SurfaceSdlGraphicsManager::grabOverlay(void*, int) const (surfacesdl-graphics.cpp:1753)
==3124361== by 0x482051: ModularGraphicsBackend::grabOverlay(void*, int) (modular-backend.cpp:215)
==3124361== by 0x434EE1: GUI::ThemeEngine::clearAll() (ThemeEngine.cpp:376)
==3124361== by 0x40128E: GUI::EventRecorder::preDrawOverlayGui() (EventRecorder.cpp:558)
==3124361== by 0x481DB2: ModularGraphicsBackend::updateScreen() (modular-backend.cpp:173)
==3124361== by 0x559967: Graphics::Screen::updateScreen() (screen.cpp:62)
==3124361== by 0x55991C: Graphics::Screen::update() (screen.cpp:56)
==3124361== by 0x38AFC7: TwinE::TwineScreen::update() (twine.cpp:126)
@mgerhardy
mgerhardy / box2d.inl
Created March 21, 2021 12:43
box 2d world dump with revolute joint problem
b2Vec2 g(0, 9.81000042);
m_world->SetGravity(g);
b2Body** bodies = (b2Body**)b2Alloc(101 * sizeof(b2Body*));
b2Joint** joints = (b2Joint**)b2Alloc(1 * sizeof(b2Joint*));
{
b2BodyDef bd;
bd.type = b2BodyType(2);
bd.position.Set(6.46999979, 3.2349999);
bd.angle = 0;
bd.linearVelocity.Set(0, 0);
@mgerhardy
mgerhardy / achievements.h
Last active March 14, 2021 14:06
AGS: script to generate steam achievements
{
"adateinthepark",
Common::STEAM_ACHIEVEMENTS,
"468530",
{
ACHIEVEMENT_SIMPLE_ENTRY("NEW_ACHIEVEMENT_1_0_PHOTO", "Eye of the Beholder", "Remnants of an enchanting evening..."),
ACHIEVEMENT_SIMPLE_ENTRY("NEW_ACHIEVEMENT_1_1_", "A Friend in Need", "Sometimes we all need some help."),
ACHIEVEMENT_SIMPLE_ENTRY("NEW_ACHIEVEMENT_1_2", "Explorer", "You know this place like the back of your hand!"),
ACHIEVEMENT_SIMPLE_ENTRY("NEW_ACHIEVEMENT_1_3", "An Old Head", "A strange discovery... A?"),
@mgerhardy
mgerhardy / agptek.sh
Created December 29, 2020 15:01
APGTEK mp3 player copy bash script - that handles the sorting of files properly (sort by name and by time)
#!/bin/bash
set -e
SOURCE_DIR=$1
TARGET_DIR=$2
DEBUG=${DBG:-0}
function info() {
echo -e "\e[92m$@\e[0m"
@mgerhardy
mgerhardy / nextcloud-deployment.yaml.j2
Last active August 26, 2020 19:45
nextcloud-deployment.yaml.j2
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: nextcloud-credentials
stringData:
NEXTCLOUD_ADMIN_USER: {{ nextcloud_admin_user }}
NEXTCLOUD_ADMIN_PASSWORD: {{ nextcloud_admin_password }}
---
apiVersion: apps/v1
@mgerhardy
mgerhardy / svo.hpp
Created June 7, 2020 20:51 — forked from Eisenwave/svo.hpp
C++ implementation of a sparse voxel octree
#ifndef SVO_HPP
#define SVO_HPP
#include "common_types.hpp"
#include "vec.hpp"
#include "vec_math.hpp"
#include "util_bits.hpp"
#include "util_common.hpp"
#include <algorithm>
make[1]: Verzeichnis „/home/mgerhardy/dev/mxe“ wird betreten
uname -a
Linux t460s 4.19.0-1-amd64 #1 SMP Debian 4.19.12-1 (2018-12-22) x86_64 GNU/Linux
git log --pretty=tformat:"%H - %s [%ar] [%d]" -1
744f553022aabe5c9946828235b6a5dd9416a6d0 - Update packages.json & build-matrix.html [vor 4 Tagen] [ (HEAD -> master, origin/master, origin/HEAD)]
lsb_release -a 2>/dev/null || sw_vers 2>/dev/null || true
Distributor ID: Debian
Description: Debian GNU/Linux buster/sid
Release: testing
Codename: buster
@mgerhardy
mgerhardy / NoiseShader.cpp
Created August 18, 2017 14:31
Generated c++ code from opencl parser/code generator
/**
* @file
*/
#pragma once
#include "compute/Shader.h"
#include "core/Singleton.h"
#include "core/Assert.h"
#include <glm/gtc/vec1.hpp>
/**
* @file
*/
#pragma once
#include "compute/Shader.h"
#include "core/Singleton.h"