Skip to content

Instantly share code, notes, and snippets.

@lordnynex
lordnynex / jdk-deb-build.sh
Created October 15, 2016 20:46 — forked from iwinux/jdk-deb-build.sh
build Oracle JDK deb package with fpm
#!/bin/bash
PACKAGE=oracle-jdk-7
PACKAGE_VIRTUAL=oracle-jdk
VERSION_MAJOR=7
VERSION_MINOR=60
VERSION="${VERSION_MAJOR}u${VERSION_MINOR}"
BUILD=b19
PKG_BASENAME="jdk-$VERSION-linux-x64.tar.gz"
@lordnynex
lordnynex / find_it.sh
Created November 1, 2016 18:28 — forked from bitops/find_it.sh
GUID regex
#!/bin/bash
grep -r -E '[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}' *
### autoscale.tf
data "template_file" "userdata" {
template = "${file("templates/userdata.tpl")}"
vars {
region = "${var.region}"
file_system_id = "${aws_efs_file_system.prod-efs.id}"
}
}
resource "aws_launch_configuration" "mig5-prod-lc" {
@lordnynex
lordnynex / pearson-hashing.c
Created December 30, 2016 02:26 — forked from darccio/pearson-hashing.c
Pearson hashing (just for fun). Includes Ruby and Golang versions for RFC 3074 and original variants.
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
/*
* Pearson hashing (from Wikipedia)
*
* Pearson hashing is a hash function designed for fast execution on processors with 8-bit registers.
* Given an input consisting of any number of bytes, it produces as output a single byte that is strongly
* dependent on every byte of the input. Its implementation requires only a few instructions, plus a
@lordnynex
lordnynex / elasticsearch.md
Created February 10, 2017 02:24 — forked from kkc/elasticsearch.md
Elasticsearch performance tuning

##TUNING##

Configuration

System: set file descriptors to 32K or 64K

vim /etc/security/limit.conf

@lordnynex
lordnynex / ssh_client.go
Created February 12, 2017 22:49 — forked from iamralch/ssh_client.go
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@lordnynex
lordnynex / tar-gz-reader.go
Created May 11, 2017 01:27 — forked from indraniel/tar-gz-reader.go
Reading through a tar.gz file in Go / golang
package main
import (
"archive/tar"
"compress/gzip"
"flag"
"fmt"
"io"
"os"
)
@lordnynex
lordnynex / API.md
Created February 3, 2018 22:19 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@lordnynex
lordnynex / GORILLA.BAS
Created May 25, 2018 20:56 — forked from caffo/GORILLA.BAS
QBasic Gorillas
' Q B a s i c G o r i l l a s
'
' Copyright (C) IBM Corporation 1991
'
' Your mission is to hit your opponent with the exploding banana
@lordnynex
lordnynex / gist:1445d0917558ee897632dfda64652788
Created July 23, 2018 22:31 — forked from lxneng/gist:741932
install PostgreSQL 9 in Mac OSX via Homebrew
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql