Skip to content

Instantly share code, notes, and snippets.

{
"vulnerabilities": [
{
"title": "Out-of-bounds Write",
"credit": [
""
],
"packageName": "bzip2",
"language": "linux",
"packageManager": "alpine:3.9",
@pierre-ernst
pierre-ernst / fp-assign.kts
Last active April 13, 2020 19:37
Mass-assignment of the "false positive" label to GitHub issues found by searching for a specific keyword in the issue title
// $ kotlinc -cp github-api-1.110.jar:jackson-databind-2.10.3.jar:jackson-core-2.10.3.jar:jackson-annotations-2.10.3.jar:commons-lang3-3.10.jar:commons-io-2.6.jar -script fp-assign.kts
import java.io.File
import org.kohsuke.github.GitHubBuilder
if (args.size != 4) {
System.err.println("Usage: fp-assign <org> <repo> <keyword> <comment-file.md>")
System.exit(1)
}
@pierre-ernst
pierre-ernst / JarsLock2mvn.java
Last active January 29, 2020 19:20
Generates a maven pom.xml file from a Jars.lock file (see https://github.com/mkristian/jar-dependencies)
package com.github.pierre_ernst;
import java.io.File;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Generates a maven pom.xml file from a Jars.lock file
* @see https://github.com/mkristian/jar-dependencies
@pierre-ernst
pierre-ernst / tcx2csv.xslt
Last active December 26, 2019 23:36
Garmin FoodPod sensor (FPS) calibration tool. Generates CSV data allowing to compare GPS/FPS distance measurements. Based on original idea from https://fellrnr.com/wiki/Garmin_Foot_Pod_Calibration
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tcdb="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2"
xmlns:ext="http://www.garmin.com/xmlschemas/ActivityExtension/v2"
version="1.0"
>
<!--
Garmin FoodPod sensor (FPS) calibration tool.
Generates CSV data allowing to compare GPS/FPS distance measurements
Input = TCX file from Garmin running activity
@pierre-ernst
pierre-ernst / YarnLock2Dot.java
Created October 31, 2019 15:28
Builds a DOT-notation dependency graph from a yarn.lock file. Can be used to produce SVG or PNG images. $ sfdp -Gsize=50! -Goverlap=prism -Tsvg tree.dot > tree.svg
package com.github.pierre_ernst;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.*;
@pierre-ernst
pierre-ernst / Odc2mvn.java
Last active October 16, 2019 18:08
Converts an OWASP DependencyCheck XML output to a Maven pom.xml
package com.github.pierre_ernst;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathFactory;
import java.io.File;
@pierre-ernst
pierre-ernst / FinalizeTester.java
Created April 7, 2016 18:45
Testing if the finalize() method is called for objects created by deserialization
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.net.URL;
import java.net.HttpURLConnection;