Skip to content

Instantly share code, notes, and snippets.

@nhtzr
nhtzr / elasticsearch.yml
Created April 7, 2017 00:02 — forked from reyjrar/elasticsearch.yml
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@nhtzr
nhtzr / Makefile
Last active May 20, 2019 16:16 — forked from xenogenesi/Makefile
create self signed certificates
DOMAIN ?= localhost
DAYS ?= 500
SAN_DOMAINS ?=
COUNTRY := IT
STATE := IT
COMPANY := Evil Corp.
# credits to: https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309
@nhtzr
nhtzr / gist:66b39596950f8ecc94630a902fa860f9
Created June 6, 2019 01:16 — forked from dsmiley/gist:2583730
jconsole via socks proxy
function jc_remote {
jmx_host=$1
jmx_port=${2:-5000}
proxy_port=${3:-8123}
echo "Connecting jconsole to $jmx_host:$jmx_port via SOCKS proxy using local port $proxy_port"
ssh -ND $proxy_port $jmx_host &
jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort=${proxy_port} \
service:jmx:rmi:///jndi/rmi://localhost:${jmx_port}/jmxrmi
kill %1
#!/bin/bash
cat <<EOF > /etc/cni/net.d/100-crio-flannel.conf
{
"cniVersion": "0.3.0",
"name": "mynet",
"type": "flannel"
}
EOF
cat <<EOF > /etc/cni/net.d/200-loopback.conf
/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
public class LongestPalindrome {
public String longestPalindrome(String s) {
if(s.length() <= 1) return s;
int top = s.length() - 1;
char[] input = s.toCharArray();
String palindrome = String.valueOf(s.charAt(0));