Skip to content

Instantly share code, notes, and snippets.

View moolen's full-sized avatar
🦝

Moritz Johner moolen

🦝
View GitHub Profile
@moolen
moolen / run.php
Created August 25, 2016 15:40
Advanced Custom Fields: clean orphaned values in wp_postmeta table
<?php
// this file requires a export.json in the same directory
// also define the database parameters below
// the `TARGET` has to be a flexible-content field
define('HOST', 'localhost');
define('USER', 'root');
define('PASS', '1234');
define('DATABASE', 'my_database');
define('TABLE', 'wp_postmeta');
// displays a small box which shows the pressed key
// copy the content of this gist into your browser console and see it in action
//
// requires global jquery
// the keycode table is copied from http://keycode.info/
$('body').append($('<div id="kp"></div>'))
$('#kp').css('width', '100px')
$('#kp').css('height', '50px')
$('#kp').css('position', 'fixed')
@moolen
moolen / find.php
Last active March 7, 2017 16:44
brute-force seed for fizzbuzz
<?php
for($i = PHP_INT_MIN; $i <= PHP_INT_MAX; $i++){
echo "$i".PHP_EOL;
srand($i);
if( magic() ){
echo "lucky number is #$i";
exit;
}
}
echo "no luck. yer' dead";
@moolen
moolen / remast-eriso.sh
Last active April 13, 2018 07:14
remaster archlinux ISO
#!/bin/bash
set -x
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
MNT=/mnt/archiso
ISO=${ISO:-/path/to/my/archlinux-2017.10.01-x86_64.iso}
TMP_DIR=/mnt/customiso
rm -rf $TMP_DIR
@moolen
moolen / installer.sh
Created April 13, 2018 07:15
archlinux installer
#!/bin/bash
set -ex
DIR=$(dirname $0)
echo "starting installer.."
DEVICE=${DEVICE:-/dev/sda}
DEVICE_CRYPT_PASS=${DEVICE_CRYPT_PASS:-1234}
TIMEZONE=${TIMEZONE:-Europe/Berlin}
HOSTNAME=${HOSTNAME:-archbox}
@moolen
moolen / Dockerfile
Last active November 10, 2024 02:12
cfssl: multiple CA w/ nginx mutual tls
FROM ubuntu:14.04
# install nginx
RUN apt-get update && \
apt-get install software-properties-common -y && \
add-apt-repository ppa:nginx/stable -y && \
apt-get update && \
apt-get install -y nginx=1.12.2-0+trusty0
RUN rm -rf /etc/nginx/sites-enabled/default
package controller
import (
"bytes"
"fmt"
"io/ioutil"
"os/exec"
"strconv"
"strings"
"sync"
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBF6ZudEBCADK8fD4Yc83tLeXwK5DA1ZDFqd9ppcAkt8T3vIAkOddFPvxtNzm
gjHpufvNl+c16O5B+jc0nm9eMYlBDSG6CZPuctrhj1Hid1qDyclgPU5iPwE4n0aV
0WmF9qlxPj9OTxcy+49kUMzvXxpDBVpz/bhABaP+krvir8WF2Qy6h5aV2sdz7ZYZ
M8FshemIoQCLn20C7p1f2JRQMwPnQCDGeRwfESKfX3KwagFdJlYHfSEUsXyxjDr2
3Ai83stxDeITTXXEPaCqgfrxUw7ulFMGYeM7nmfyG3Sd/OmB/HWzFGNci16ct25p
x494Tq2oaSPkiY7GiuiY21BhJ4BBLTFe9OCRABEBAAG0H01vcml0eiBKb2huZXIg
PGZvb0BleGFtcGxlLmNvbT6JAVQEEwEIAD4WIQThXYHzD5i4naSfV6aDKFkeQCJ7
WwUCXpm50QIbAwUJA8JnAAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRCDKFke
20/07/02 15:59:08 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
20/07/02 15:59:09 INFO ElasticsearchDependenciesJob: Running Dependencies job for 2020-07-02T00:00Z, reading from jaeger-span-2020-07-02 index, result storing to jaeger-dependencies-2020-07-02
20/07/02 15:59:11 ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0)
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
at java.util.Arrays.asList(Arrays.java:3800)
at io.jaegertracing.spark.dependencies.elastic.json.SpanDeserializer.deserializeReferences(SpanDeserializer.java:100)
at io.jaegertracing.spark.dependencies.elastic.json.SpanDeserializer.deserialize(SpanDeserializer.java:69)
at io.jaegertracing.spark.dependencies.elastic.json.SpanDeserializer.deserialize(SpanDeserializer.java:37)
@moolen
moolen / CMakeLists.txt
Created October 8, 2020 11:16
bpftrace arm64
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a143efa..ba2c0eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -160,7 +160,7 @@ add_subdirectory(src/arch)
add_subdirectory(src/ast)
add_subdirectory(src)
if (BUILD_TESTING)
- add_subdirectory(tests)
+ #add_subdirectory(tests)