Skip to content

Instantly share code, notes, and snippets.

View henrjk's full-sized avatar

Henrich Krämer henrjk

View GitHub Profile
@henrjk
henrjk / idempotent-cp-tree-test-1.sh
Created February 18, 2022 08:14
Copy directory tree with cp
#!/bin/bash
set -eu
# this script is meant to be run on macos with gnu cp avalable via gcp (brew install coreutils)
# and macs own cp as cp
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
@henrjk
henrjk / run-build-task.sh
Last active January 20, 2022 08:25
Test ods-pipeline typescript task locally
#!/usr/bin/env bash
set -e
usage_and_exit() {
cat << USAGE >&2
Usage: run-build-task.sh <ods.yaml> task
USAGE
exit 1
}
@henrjk
henrjk / unsigned-jwt.md
Last active August 24, 2020 13:53
unsigned jwt

Unsigned jwt consists of header { "alg" : "none" } and empty signature

One decode just the payload using of a jwt by using the header which encodes to eyJhbGciOiJub25lIn0.<payload>.

Sometimes one has to add = signs to the payload if it was not padded.

The JWT Analyzer & Inspector Chrome extension will needs some dummy signature to accept the input.

@henrjk
henrjk / centos-install-kernel-debuginfo.sh
Created January 30, 2018 16:56 — forked from jarek-przygodzki/centos-install-kernel-debuginfo.sh
CentOS 7 - How to install kernel-debuginfo
yum --enablerepo=base-debuginfo install -y kernel-debuginfo-$(uname -r)
@henrjk
henrjk / jenkins-api.md
Created December 14, 2017 18:38 — forked from justlaputa/jenkins-api.md
Jenkins Json API

jobs

jenkins_url + /api/json?tree=jobs[name,color]

builds

jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]

last build

@henrjk
henrjk / java8errs.md
Created August 22, 2016 11:37
Eclipse errors using Java 7 and Java 6 settings for samples of Core Java for the Impatient (Covers Java8) 2015

Chapter 1: Fundamental Data Structures

Some errors with Java 7 setting

Description	Resource	Path	Location
The method isFinite(double) is undefined for the type Double	NumberDemo.java	ch01/sec02	line 33	
The method toUnsignedInt(byte) is undefined for the type Byte	NumberDemo.java	ch01/sec02	line 15	
The method floorMod(int, int) is undefined for the type Math	ArithmeticDemo.java	ch01/sec04	line 13	
The import java.time cannot be resolved	StringDemo.java	ch01/sec05	line 3	
The method codePoints() is undefined for the type String	StringDemo.java	ch01/sec05	line 63	
The method join(String, String, String, String) is undefined for the type String	StringDemo.java	ch01/sec05	line 18	
@henrjk
henrjk / jspm.travis.setup.md
Created April 1, 2016 13:08 — forked from topheman/jspm.travis.setup.md
Travis setup of Github token for jspm
#!/bin/bash
set -e
NODE_ENV=test ./node_modules/.bin/istanbul cover node_modules/.bin/_mocha --dir ./coverage/integration -- --timeout 0 --compilers coffee:coffee-script/register test/integration/
NODE_ENV=test ./node_modules/.bin/istanbul cover node_modules/.bin/_mocha --dir ./coverage/unit -- --timeout 0 --compilers coffee:coffee-script/register test/unit/
./node_modules/.bin/istanbul report --root coverage/ --dir coverage/
#!/usr/sbin/dtrace -C -s
#pragma D option quiet
proc::posix_spawn:exec-success,proc::__mac_execve:exec-success
{
this->isx64=(curproc->p_flag & P_LP64)!=0;
#define SELECT_64_86(x64, x86) (this->isx64 ? (x64) : (x86))
#define GET_POINTER(base, offset) (user_addr_t)SELECT_64_86(*(uint64_t*)((base)+sizeof(uint64_t)*(offset)), *(uint32_t*)((base)+sizeof(uint32_t)*(offset)))
@henrjk
henrjk / gist:4d566ecc3e0a22f05c83
Created January 9, 2015 21:04
flynn vagrant box warning I saw after fresh install:
igelmac:flynn dev$ vagrant ssh
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-43-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Fri Jan 9 20:22:50 UTC 2015
System load: 1.67 Processes: 133
Usage of /: 6.9% of 39.34GB Users logged in: 0
Memory usage: 7% IP address for eth0: 10.0.2.15