Skip to content

Instantly share code, notes, and snippets.

View baszoetekouw's full-sized avatar

Bas Zoetekouw baszoetekouw

View GitHub Profile
#!/bin/sh
# $Id: ps2pdfwr,v 1.9 2002/02/21 21:49:28 giles Exp $
# Convert PostScript to PDF without specifying CompatibilityLevel.
OPTIONS=""
QUALITY="ebook"
while true
do
#!/bin/sh
# $Id: ps2pdfwr,v 1.9 2002/02/21 21:49:28 giles Exp $
# Convert PostScript to PDF without specifying CompatibilityLevel.
OPTIONS=""
QUALITY="ebook"
while true
do
@baszoetekouw
baszoetekouw / surfdomeinen.css
Created April 7, 2020 08:31
CSS override for SURFdomeinen
/* main layout */
div.main {
display: table;
width: 100%;
}
table.section {
width: auto !important;
}
div.wrapper {
width: 100%;
@baszoetekouw
baszoetekouw / ldifchecksum.py
Last active March 31, 2020 14:07
script to calculate checksum of an ldif (e.g., slapcat output)
#!/usr/bin/env python3
import sys
import ldif
import hashlib
#import json
import numbers
from typing import Collection, Any
"""
2020/02/28 16:43:15 [INFO] Terraform version: 0.12.21
2020/02/28 16:43:15 [INFO] Go runtime version: go1.13.8
2020/02/28 16:43:15 [INFO] CLI args: []string{"/opt/brew/bin/terraform", "apply", "-parallelism=1"}
2020/02/28 16:43:15 [DEBUG] Attempting to open CLI config file: /Users/bas/.terraformrc
2020/02/28 16:43:15 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/02/28 16:43:15 [INFO] TF_CLI_ARGS_apply value: "-parallelism=100"
2020/02/28 16:43:15 [INFO] CLI command args: []string{"apply", "-parallelism=100", "-parallelism=1"}
2020/02/28 16:43:15 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/02/28 16:43:15 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/02/28 16:43:15 [DEBUG] New state was assigned lineage "7ed3e561-a5f3-9de9-2e23-2732a7ffef87"
@baszoetekouw
baszoetekouw / wachtwoordmaker.sh
Last active March 26, 2019 08:14
Create a nicely formatted secret
#!/bin/bash
set -e
# defaults
num=24
grp=5
# ugly hack: arithmetric expansion $(()) will return 0 for non-integer arguments
if [ $(($1)) != 0 ]
then
#include <math.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <unistd.h>
#include <malloc.h>
#include <string.h>
#include <sys/time.h>
int main()
@baszoetekouw
baszoetekouw / remove_bloatware.sh
Last active April 30, 2023 20:24
Bloatware to be removed from Galaxy S8
#!/bin/bash
# dit zijn de paketten die IK van mijn (verder lege) telefoon heb verwijderd.
exit
adb shell pm uninstall -k --user 0 com.android.bio.face.service
adb shell pm uninstall -k --user 0 com.diotek.sec.lookup.dictionary
adb shell pm uninstall -k --user 0 com.enhance.gameservice
adb shell pm uninstall -k --user 0 com.facebook.appmanager
adb shell pm uninstall -k --user 0 com.facebook.katana
adb shell pm uninstall -k --user 0 com.facebook.services
adb shell pm uninstall -k --user 0 com.facebook.system
#!python3
import datetime
import shutil
import os
import subprocess
# source and destiantion trees
src="/data/Backup/src/test-copy/src"
dst1="/data/Backup/src/test-copy/dst1"
@baszoetekouw
baszoetekouw / manip.php
Created July 4, 2017 09:20
OpenConext Attribute manipulation to reconstruct sHO+uid from ePPN
# This attribute manipulation reconstructs a uid and schacHomeOrg
# from an EPPN
$attr_eppn_saml1 = "urn:mace:dir:attribute-def:eduPersonPrincipalName";
$attr_eppn_saml2 = "urn:oid:1.3.6.1.4.1.5923.1.1.1.6";
$attr_uid = "urn:mace:dir:attribute-def:uid";
$attr_sho = "urn:mace:terena.org:attribute-def:schacHomeOrganization";
if ( isset($attributes)
and ($attributes !== FALSE)