Skip to content

Instantly share code, notes, and snippets.

View karlvr's full-sized avatar

Karl von Randow karlvr

View GitHub Profile
@karlvr
karlvr / 00README.md
Last active November 26, 2023 14:21
Roadwarrior configuration for macOS 10.12, iOS 10 and Windows 10 using strongSwan and user certificates

strongSwan setup for Road Warriors on macOS 10.12, iOS 10 and Windows 10

This setup is for remote users to connect into an office/home LAN using a VPN (ipsec). This is based on (but not the same as) the strongSwan documentation and this guide: https://raymii.org/s/tutorials/IPSEC_vpn_with_Ubuntu_16.04.html

I used strongSwan 5.5.1.

apt-get install -y strongswan strongswan-pki
@karlvr
karlvr / 00README.md
Last active April 2, 2017 20:53
init.d startup script for spotify-connect-web
apt-get install -y avahi-utils
--
-- GEOIP IN POSTGRESQL
--
-- We use two approaches. First using PostgreSQL inet and cidr types and indexing (PostgreSQL 9.4 and later),
-- and then using ip4r (https://github.com/RhodiumToad/ip4r).
-- The performance of ip4r indexes is significantly better than PostgreSQL's own index.
-- An operation that took 42s using ip4r took 47 minutes using PostgreSQL's cidr index.
--
diff -r bb795f69be65 src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java
--- a/src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java Sun May 29 14:03:11 2016 +1200
+++ b/src/share/classes/com/sun/crypto/provider/DHKeyPairGenerator.java Sun May 29 16:09:37 2016 +1200
@@ -71,6 +71,17 @@
initialize(1024, null);
}
+ private static void checkKeySize(int keysize)
+ throws InvalidParameterException {
+
#!/bin/bash
# This script automatically sets the version and short version string of
# an Xcode project from the Git repository containing the project.
#
# To use this script in Xcode, add the script's path to a "Run Script" build
# phase for your application target.
set -o errexit
set -o nounset
@karlvr
karlvr / jstack-grep
Last active December 20, 2015 13:18
A pattern matching tool for jstack output. Can search for a pattern in the stacktraces, then show details of just the matching threads, either showing all of the stacktrace or just lines matching the search pattern, or matching any other patterns.
#!/usr/bin/perl
#
# A pattern matching tool for jstack output. Can search for a pattern in the stacktraces,
# then show details of just the matching threads, either showing all of the stacktrace or
# just lines matching the search pattern, or matching any other patterns.
#
# For example, to see which threads are currently accessing the database and show the
# stacktrace lines containing your own classes:
# jstack-grep postgres <pid> -i com.xk72
#
@karlvr
karlvr / apologies.text
Last active December 17, 2015 00:49 — forked from NZKoz/apologies.text
Dear [First Name],
We're really sorry but our systems were compromised and the attackers
managed to take a copy of your passwords.
The passwords were stored as:
[ ] Bcrypt hashes with a cost factor of X
[ ] PBKDF2 hashes with an iteration count of X
[ ] scrypt because I am Colin Percival