Skip to content

Instantly share code, notes, and snippets.

View rkoshy's full-sized avatar

Renny Koshy rkoshy

View GitHub Profile
@drm317
drm317 / gist:3e2a9ce4ba1288c4fbaab1e534d71133
Last active December 4, 2023 21:42
OpenJDK 11+ on MacOS X

OpenJDK 11+ on MacOS X

Manually downloading, extracting and configuring the installation of OpenJDK 11+ is a high-maintenance exercise. Particularly if you need to install and switch between multiple versions of the JDK.

The following options for installing OpenJDK 11+ and switching between versions make the job easier..

Install with Jabba

Jabba is a Java version manager inspired by nvm (Node.js) written in Go.

@devinodaniel
devinodaniel / gist:8f9b8a4f31573f428f29ec0e884e6673
Created November 21, 2017 20:18
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"
@krisnod
krisnod / gist:56ff894f400cce7c742fb11fb2fde9cf
Last active April 6, 2022 18:46
RancherOS on Hetzner using software RAID (RAID 1)
Install:
----------
* Activate Hetzner Rescue System (Debian)
* Connect to Hetzner Rescue System using SSH and live boot RancherOS
(thanks goes to William Fleurant for showing how this can be done: https://github.com/wfleurant/boot-rancheros-hetzner/)
* apt-get update
* apt-get install kexec-tools aria2
@dutchiechris
dutchiechris / ifcfg-vlan-bridge-example
Last active November 11, 2020 11:12
CentOS 7 ifcfg syntax for VLAN tagged interface + bridge for KVM (referenced from http://www.beginswithdata.com/2016/12/30/centos7-kvm-coreos/)
[root@server02 network-scripts]# cat ifcfg-enp14s0
DEVICE=enp14s0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no
[root@server02 network-scripts]# cat ifcfg-enp14s0.35
DEVICE=enp14s0.35
TYPE=Ethernet
//exception handling excluded to avoid verbosity
RsaJsonWebKey rsaJsonWebKey = RsaKeyProducer.produce();
JwtClaims claims = new JwtClaims();
claims.setSubject("user1");
JsonWebSignature jws = new JsonWebSignature();
jws.setPayload(claims.toJson());
jws.setKey(rsaJsonWebKey.getPrivateKey());
@diyan
diyan / pci_dss.md
Last active February 9, 2024 17:58
PCI DSS. Useful resources
@Drusy
Drusy / pool.hpp
Last active January 23, 2022 08:19
Generic C++ Pool implementation
#ifndef POOL_H
#define POOL_H
#include <list>
#include <iostream>
using namespace std;
template<typename T>
class Pool
@jpgreenwald
jpgreenwald / InjectionServlet.java
Created July 6, 2013 17:20
It seems to be impossible to use CDI within a JAX-RS 2.0 ContainerRequestFilter, but it is possible to first use a WebFilter to obtain the service and then pass it along via attributes.
package com.swsandbox.resource;
import com.swsandbox.service.UserService;
import javax.inject.Inject;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
@WebFilter(urlPatterns = "/*")
@nboubakr
nboubakr / subnet.py
Created December 20, 2012 11:23
A simple python script converts a Classless Inter-Domain Routing (CIDR)-formatted IP address into an IP range and netmask.
#!/usr/bin/env python
# python subnet.py 200.100.33.65/26
import sys
# Get address string and CIDR string from command line
(addrString, cidrString) = sys.argv[1].split('/')
# Split address into octets and turn CIDR into int
addr = addrString.split('.')