Skip to content

Instantly share code, notes, and snippets.

@jordansissel
jordansissel / 1-output.txt
Last active November 10, 2021 14:28
Convert curl|bash to an rpm with Docker and FPM
% docker build -t rust .
...
# Export the image to tarball, which itself contains tarballs and a manifest.json
% docker save -o rust.tar rust
# Extract the last layer
# tar's -O flag extracts a single entry from the tarball.
# The file we want is the last "Layer" in the manifest.json
% tar -xf rust.tar -O $(tar -xf rust.tar -O manifest.json | jq -r '.[].Layers[-1]') > curlbash.tar
@jordansissel
jordansissel / sincos.elm
Created January 16, 2018 08:43
Playing with Elm and SVG.
import Svg exposing (..)
import Svg.Attributes exposing (..)
import List
cycles = 2
yScale = 50
lineThickness = 20
i = List.range 0 (cycles * 360)
public class Main {
public static void main(String[] args) {
X x = new X();
Long value = 500L;
if (args.length != 1) {
System.out.println("Usage: Main <iterations>");
System.exit(1);
}
@jordansissel
jordansissel / keyboardcapture.go
Created September 26, 2017 05:08 — forked from obonyojimmy/keyboardcapture.go
go lang keyboard capture
package main
import (
"fmt"
"syscall"
//~ "time"
"unsafe"
"golang.org/x/sys/windows"
)
public class Foo {
private static final int ITERATIONS = 10000000;
public static void main(String[] args) {
Foo foo = new Foo();
int i = Integer.parseInt(args[0]);
System.out.println(i);
if (args[1].equals("a")) {
System.out.println("a");
# encoding: utf-8
require "benchmark/ips"
require "logstash/codecs/base"
require "logstash/filters/date"
require "logstash/filter_delegator"
require "logstash/filters/date-old"
# `gradlew build` makes this
require "build/libs/logstash-filter-date.jar"
import java.io.FileReader;
import java.io.File;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.FileNotFoundException;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.Queue;
public class Foo {
public static void main(String args[]) throws FileNotFoundException {
@jordansissel
jordansissel / 00-Sample run.txt
Last active August 4, 2016 18:09 — forked from reyjrar/logstash-config-broken.conf - Starting Point
Massive Parse Tree Failure in Logstash 5.0.0-alpha3
# Example packet:
% echo -n '<123>Aug 4 07:54:35 foo bar: { "hello": "world" }' | nc -vu 127.0.0.1 9514
% bin/logstash --version
logstash 5.0.0-alpha4
% bin/logstash -f logstash-config-broken.conf
Pipeline main started
{
PS C:\Users\jls.FRIENDSHIP> get-vm | where notes -eq origin
Name State CPUUsage(%) MemoryAssigned(M) Uptime Status Version
---- ----- ----------- ----------------- ------ ------ -------
CentOS 6.7 Off 0 0 00:00:00 Operating normally 7.0
CentOS 7 Off 0 0 00:00:00 Operating normally 7.0
Debian 8.4 Off 0 0 00:00:00 Operating normally 7.0
Fedora 23 Off 0 0 00:00:00 Operating normally 7.0
FreeBSD 10.3 Off 0 0 00:00:00 Operating normally 7.0
openSUSE 42.1 Off 0 0 00:00:00 Operating normally 7.0