Skip to content

Instantly share code, notes, and snippets.

View trixpan's full-sized avatar
🎯
Focusing

Andre F de Miranda trixpan

🎯
Focusing
View GitHub Profile
@thomasdarimont
thomasdarimont / jlink-jdk11-with-jcmd-tools.md
Last active May 4, 2024 07:08
PoC for building a custom OpenJDK 12 JDK (47MB) with JLink that can run Keycloak 6.0.1
@chaddotson
chaddotson / ttl_cache_example.py
Created May 25, 2016 03:35
Example of TTLCache from cachetools
from cachetools import TTLCache
from sched import scheduler
cache = TTLCache(maxsize=128, ttl=5)
runner = scheduler()
cache["abc"] = 42
def display_cached_value(cache_key):
@mpurzynski
mpurzynski / build_bro.sh
Created January 20, 2016 19:03
Build a clean Bro package with Myricom. Uses fpm.
TMP_ROOT=~/tmp/dest
rm -rf ~/bro 2>&1 > /dev/null
rm -rf "${TMP_ROOT}" 2>&1 > /dev/null
mkdir -p "${TMP_ROOT}" 2>&1 > /dev/null
git clone --recursive https://github.com/bro/bro.git ~/bro
git checkout remotes/origin/topic/seth/remove-flarecd ~/bro && ./configure --prefix=/opt/bro --disable-broker --with-pcap=/opt/snf || exit 1
make install DESTDIR=~/tmp/dest || exit 1
cd ~/
@kixorz
kixorz / ec2hostname.rb
Last active June 3, 2022 11:27
EC2 Instance Route53 Hostname registration init.d script. Instance needs to have the attached IAM instance role policy applied.
#!/usr/bin/ruby
# chkconfig: 35 99 01
# description: EC2 DNS registration
# processname: ec2hostname
require 'aws-sdk'
require 'net/http'
`touch /var/lock/subsys/ec2hostname`
@raymyers
raymyers / ShellSplitter.java
Last active April 7, 2024 19:11
Simple Java program to tokenize string as a shell would - similar to shlex in Python. Not checked for POSIX compliance yet - feel free to comment with edge cases that could be fixed. This is my original work, free to reuse. Created for Stack Overflow question: https://stackoverflow.com/questions/1082953/shlex-alternative-for-java/20725050:
package com.cadrlife;
import java.util.ArrayList;
import java.util.List;
public class ShellSplitter {
public List<String> shellSplit(CharSequence string) {
List<String> tokens = new ArrayList<String>();
boolean escaping = false;
char quoteChar = ' ';