Skip to content

Instantly share code, notes, and snippets.

View risdenk's full-sized avatar

Kevin Risden risdenk

View GitHub Profile
@nicoulaj
nicoulaj / SecurityProvidersAndAlgorithms.java
Created August 17, 2010 20:06
List all Java Security providers and algorithms available in the environment.
import java.security.Provider;
import java.security.Security;
import java.util.Enumeration;
public class SecurityProvidersAndAlgorithms {
public static void main(String[] args) throws Exception {
try {
Provider p[] = Security.getProviders();
for (int i = 0; i < p.length; i++) {
System.out.println(p[i]);
#! /usr/bin/env python
import fileinput
import argparse
from operator import itemgetter
parser = argparse.ArgumentParser()
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int)
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+')
args = parser.parse_args()
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@willurd
willurd / web-servers.md
Last active June 21, 2024 13:36
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mrflip
mrflip / tuning_storm_trident.asciidoc
Last active May 27, 2022 23:59
Notes on Storm+Trident tuning

Tuning Storm+Trident

Tuning a dataflow system is easy:

The First Rule of Dataflow Tuning:
* Ensure each stage is always ready to accept records, and
* Deliver each processed record promptly to its destination
@jankronquist
jankronquist / client-certificate-authentication.md
Last active January 24, 2021 13:49
Java certificate authentication for both server and client using shared trusted CA.

Certificates

CA and trust keystore

keytool -genkeypair -keyalg RSA -keysize 2048 -validity 365 -alias ca -dname "CN=ca,O=HMS,S=SE" -keystore ca.jks -storepass password
keytool -exportcert -rfc -alias ca -keystore ca.jks -storepass password > ca.pem
cat ca.pem | keytool -importcert -alias ca -noprompt -keystore trust.jks -storepass password

server cert

@markrmiller
markrmiller / beast.sh
Last active June 14, 2020 19:02
The best Lucene / Solr beasting script in the world. TM.
#!/usr/bin/env bash
#set -x #echo on
#echo "args:$@"
# The best Lucene / Solr beasting script in the world. TM. 4.3.0
#
# This script will fire off N independent test runs for a class, X of them in parallel.
#
# A results.log file is written to the {results-dir}. A non zero exit status indicates a failed run.
@byrnedo
byrnedo / check_docker_newer_tag.sh
Created April 7, 2016 07:08
Check if newer docker image available.
#!/bin/bash
# ensure running bash
if ! [ -n "$BASH_VERSION" ];then
echo "this is not bash, calling self with bash....";
SCRIPT=$(readlink -f "$0")
/bin/bash $SCRIPT
exit;
fi
/**
* MIT License
*
* Copyright (c) 2018 Chris Passarello <www.insecurity.co>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@DaveyDevOps
DaveyDevOps / heap_dump_analysis.md
Last active July 22, 2022 09:58
Large Java Heap Dump Analysis

Just wanted to document the steps taken in a specific scenario. There are plenty of references covering the different parts (feel free to Google if you don't believe me).

Scenario:
Problematic Java application running on a Linux server with a large heap (~16 GB).
My devices, Windows Laptop/Desktop with a limited number of RAM.

Goal:
Take a heap dump and analyze with Eclipse Memory Analyzer.

Heap Dump