Skip to content

Instantly share code, notes, and snippets.

View velmuruganvelayutham's full-sized avatar
🎯
Focusing

Velmurugan Velayutham velmuruganvelayutham

🎯
Focusing
View GitHub Profile
@mlconnor
mlconnor / tomcat_memory.md
Created September 17, 2014 13:57
Memory settings for Java JVM in Amazon Elastic Beanstalk

Elastic Beanstalk Java JVM Settings

Determining the right memory settings (MX & MS) for the JVM is not trivial. If you set memory too low then your machine will trash as it runs out and eventually crash. If you set it too high then other critical processes such as Apache or the OS itself may become memory starved and also cause crashes.

In general, I think it best to set the initial memory setting (MS) to be small, around 200M. The real variable we need to calculate is the limit we will place on JVM memory (MS).

In order to make this determination, we need to calculate a few things such as the memory that Apache and the Linux OS need to operate efficiently.

Apache Memory Needs

@denji
denji / golang-tls.md
Last active July 28, 2024 01:09 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@maxvt
maxvt / infra-secret-management-overview.md
Last active July 5, 2024 13:01
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@premraj10
premraj10 / CGLibProxySample.java
Created May 20, 2016 17:02 — forked from ksauzz/CGLibProxySample.java
Proxy sample code with java.lang.reflect.Proxy and CGLib
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
public class CGLibProxySample {
@SuppressWarnings("unchecked")
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active July 27, 2024 06:18
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@EronWright
EronWright / README.md
Last active June 24, 2024 13:34
Simple Maven repository hosted on Apache httpd web server

Simple Maven Repository

Hosting a shared Maven repository on a remote server may be accomplished with a simple web server such as Apache HTTP server. This works because most of the resolution and publishing logic of Maven is implemented in the client. That said, it works only if you know the groupId and artifactId to be published, since appropriate directories must be created by hand.

Do consider using more sophisticated server software such as Artifactory or Sonatype Nexus. Below is the 'bare minimum' alternative.

Caution: this example exposes a writable directory without any authentication, and thus assumes a trusted network.

@ryan-lane
ryan-lane / gist:b23c4536f1a8eeac69a6050601429f77
Created June 20, 2017 21:25
example confidant config file
default:
url: https://confidant.example.com
auth_key: alias/confidant-production
auth_context:
# from context will be auto-set
to: confidant-production
user_type: user
token_cache_file: '/Users/myhomedir/.confidant_token'
region: us-east-1
@Schachte
Schachte / LongestSubstringKDistinct.java
Last active April 14, 2024 06:39
Sliding Window Maximum Sum Subarray
import java.util.*;
class LongestSubstringKDistinct {
public static int findLength(String str, int k) {
int windowStart = 0, maxLength = 0;
Map<Character, Integer> charFrequencyMap = new HashMap<>();
for (int windowEnd = 0; windowEnd < str.length(); windowEnd++) {
char rightChar = str.charAt(windowEnd);
charFrequencyMap.put(rightChar, charFrequencyMap.getOrDefault(rightChar, 0) + 1);
@ogazitt
ogazitt / auth.go
Created April 14, 2020 05:53
Auth0 PKCE flow for a CLI built in golang
package auth
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"