Skip to content

Instantly share code, notes, and snippets.

View slachiewicz's full-sized avatar

Sylwester Lachiewicz slachiewicz

View GitHub Profile
public class TimestampValidationService {
public boolean validate(String hash, String encodedTimestampToken) {
try {
byte[] tokenBytes = Base64.getDecoder().decode(encodedTimestampToken);
CMSSignedData signedData = new CMSSignedData(tokenBytes);
TimeStampToken token = new TimeStampToken(signedData);
Optional<X509CertificateHolder> certHolder = getCertificateHolder(signedData);
BcRSASignerInfoVerifierBuilder verifierBuilder = new BcRSASignerInfoVerifierBuilder(
new DefaultCMSSignatureAlgorithmNameGenerator(),
@slachiewicz
slachiewicz / alior-bank-kantor.user.js
Created May 13, 2018 18:01 — forked from glorpen/alior-bank-kantor.user.js
Adds password input field for LastPass on AliorBank Kantor page
// ==UserScript==
// @name AliorBank Kantor
// @namespace glorpen
// @include https://kantor.aliorbank.pl/login/password
// @version 1
// @grant none
// ==/UserScript==
var oldInput = document.getElementById("masked-password");
var input = document.createElement("input");
@slachiewicz
slachiewicz / xhtml-to-markdown.xsl
Created March 4, 2018 15:59 — forked from ijy/xhtml-to-markdown.xsl
XHTML to Markdown converter.
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- XHTML-to-Markdown converter by Andrew Green, Article Seven, http://www.article7.co.uk/ -->
<!-- This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. -->
<xsl:stylesheet version='1.0' xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='text' encoding='utf-8'/>
#!/bin/bash
fw_installed maven && return 0
MAVEN_VERSION=3.5.2
TEMP_DIRECTORY="$(mktemp -d)"
# Ask Apache about the preferred mirror for our connection using JSON response. Source: https://stackoverflow.com/a/39670213
MAVEN_MIRROR="$(wget -qO - http://www.apache.org/dyn/closer.lua?as_json=1 | grep -P '"preferred": "' | cut -d \" -f4)"
MAVEN_FILENAME=apache-maven-${MAVEN_VERSION}-bin
@slachiewicz
slachiewicz / gist:97e666d15ce65e5f1c043c23a46e5439
Created February 11, 2018 16:12 — forked from jvanzyl/gist:16da25976f8ad27293fa
Validate a Maven Core Pull Request
#!/bin/sh
#
# PR validator: This script will checkout Maven, apply a PR, build the Maven distribution and
# run the Maven integration tests against the just-built distribution. If you
# successfully get to the end of this script then your PR is ready to be reviewed.
# Assumptions:
# 1) You have a functioning version of Maven installed (script tested with 3.2.1)
# 2) You have a decent connection. This script checks out everything from scratch and downloads
# everything into a clean local repository. Not terribly efficient but makes sure there is no
@slachiewicz
slachiewicz / breachcompilation.txt
Created December 19, 2017 20:37
1.4 billion password breach compilation wordlist
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size:
www.energa.pl
24.energa.pl
www.24.energa.pl
annualreport.energa.pl
autodiscover.energa.pl
av.energa.pl
bip.energa.pl
www.bip.energa.pl
celestis.energa.pl
e-bok.energa.pl
@slachiewicz
slachiewicz / TestnetEthereumNetwork.md
Created October 25, 2017 09:31
Setup testnet Ethereum network with Docker

Setup testnet Ethereum network with Docker

Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third party interference.

This is step-by-step guide, how to setup testnet Ethereum network.

We'll setup ethereum testnet node in the docker container and write ruby json-rpc client. The difference between ethereum(Frontier) and testnet ethereum(Ropsten) networks is that the testnet used for development. The genesis block on the testnet was set with a very low difficulty so anyone can do minning. The coins mained in the testnet have no values. You can request some coins on the facuet or trying to mine it.

@slachiewicz
slachiewicz / docker-compose.yml
Created October 5, 2017 09:17 — forked from huksley/docker-compose.yml
Launches fully configured Graylog 2.3.1 instance
#
# Launches configured Graylog 2.3.1 instance
#
# - Docker-compose 1.16 required
# - Please configure following according to your network:
# * gelf-address URL (for each container)
# * GRAYLOG_WEB_ENDPOINT_URI
# - After launch define GELF tcp and GELF udp inputs in graylog web ui
# - Containers send logging to the graylog itself
# - By default tuned to 30 days retention
@slachiewicz
slachiewicz / meraki_strongswan_notes.md
Created August 22, 2017 19:24 — forked from psanford/meraki_strongswan_notes.md
connect to meraki client vpn from strongswan (ubuntu 16.04 edition)

These are my notes for connecting to a meraki client vpn from ubuntu 16.04. This configuration assumes you are using a psk for the ipsec auth.

Install the following packages:

apt-get install -y strongswan xl2tpd

Configure strong swan