Skip to content

Instantly share code, notes, and snippets.

sdorra /
Created Jun 6, 2021
ecdsa: sign in go, verify in node
openssl ecparam -name prime256v1 -genkey -noout -out private.pem
openssl ec -in private.pem -pubout -out public.pem
sdorra /
Created Jul 22, 2020
Sign and verify commits with JGit
import org.bouncycastle.bcpg.ArmoredInputStream;
import org.bouncycastle.bcpg.ArmoredOutputStream;
import org.bouncycastle.bcpg.BCPGOutputStream;
import org.bouncycastle.bcpg.HashAlgorithmTags;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPKeyPair;
import org.bouncycastle.openpgp.PGPObjectFactory;
import org.bouncycastle.openpgp.PGPPrivateKey;
import org.bouncycastle.openpgp.PGPPublicKey;
sdorra / Vagrantfile
Created Jun 19, 2020
SCM-Manager on FreeBSD
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config| = "freebsd/FreeBSD-12.0-STABLE"
# forward SCM-Manager port to host "forwarded_port", guest: 8080, host: 8080
# add some more memory
View CorruptingProxy.groovy
@Grab(group='org.eclipse.jetty', module='jetty-server', version='9.1.6.v20160112')
@Grab(group='org.eclipse.jetty', module='jetty-servlet', version='9.1.6.v20160112')
@Grab(group='org.eclipse.jetty', module='jetty-proxy', version='9.1.6.v20160112')
@Grab(group='', module='guava', version='29.0-jre')
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.util.BytesContentProvider;
import org.eclipse.jetty.proxy.ProxyServlet;
import org.eclipse.jetty.server.Server;
sdorra /
Created Sep 14, 2019
Keybase Verification

Keybase proof

I hereby claim:

  • I am sdorra on github.
  • I am sdorra ( on keybase.
  • I have a public key ASAqzQv8znLxEcLWEJWrQUhXib91ha5mwDspYuZST9C6Xwo

To claim this, I am signing this object:

sdorra / Jenkinsfile
Created Oct 23, 2016
Docker jenkins pipeline example
View Jenkinsfile
node('docker') {
stage 'start database'
docker.image('redis:3.0.7-alpine').withRun { c ->
def ip = hostIp(c)
stage 'client set'
docker.image('redis:3.0.7-alpine').inside {
sh "redis-cli -h ${ip} set test 123"
sdorra / cert.go
Created Jul 3, 2016
Certificate generation in Go
View cert.go
package main
import (
sdorra /
Created Jun 15, 2016
Jackson sample with deep field filter
public class App {
public static void main(String[] args) {
Type type = new Type("hg", "Mercurial");
Repository repository = new Repository("42", "scm", type, "SCM-Manager", "SCM-Manager Repository Hosting");
System.out.println(JSON.asString(repository, "id", "desc"));
System.out.println(JSON.asString(repository, "id", "name", "type", "", "displayName"));
sdorra / keys.go
Created Apr 17, 2016
Golang RSA Key Generation
View keys.go
* Genarate rsa keys.
package main
import (
sdorra / app.go
Created Apr 6, 2016
SSEvents with golang
View app.go
package main
import (