Skip to content

Instantly share code, notes, and snippets.

@pbabics
pbabics / gitlab-gc.sh
Created November 11, 2016 13:13
Manual garbage collector for gitlab registry, it removes old revisions that are not referenced by any tag
#!/bin/bash
BASE_PATH=/var/opt/gitlab/gitlab-rails/shared/registry/docker/registry/v2/repositories
DRY_RUN=0
KEEP_LAST_IMAGES=10
RUN_GARBAGE_COLLECTOR=0
GITLAB_CTL_COMMAND=`which gitlab-ctl`
@pbabics
pbabics / fs_encrypt_decrypt.sh
Created September 9, 2015 12:04
Fallout Shelter save file Decrypt/Encrypt
# Encrypt:
cat Vault.json | openssl aes-256-cbc -iv '7475383967656a693334307438397532' -K 'A7CA9F3366D892C2F0BEF417341CA971B69AE9F7BACCCFFCF43C62D1D7D021F9' | base64
# Decrypt:
cat Vault1.sav | base64 -d | openssl aes-256-cbc -d -iv '7475383967656a693334307438397532' -K 'A7CA9F3366D892C2F0BEF417341CA971B69AE9F7BACCCFFCF43C62D1D7D021F9' | python -m json.tool
@pbabics
pbabics / UDPBroadcaster
Created March 26, 2012 17:42
UDP broadcasting class used to locate application within network
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <time.h>
#include <string.h>
#include <stdio.h>
#include <cassert>
#include <unistd.h>