Skip to content

Instantly share code, notes, and snippets.

View meirkl's full-sized avatar
🍺
Working

Meir Keller meirkl

🍺
Working
  • Israel
View GitHub Profile
@sibelius
sibelius / usePrompt.tsx
Last active October 27, 2022 19:05
Prompt user before leaving route or reload
import { useEffect, useRef } from 'react';
import { useHistory } from 'react-router-dom';
export const usePrompt = (when: boolean, message: string = 'Are you sure you want to quit without saving your changes?') => {
const history = useHistory();
const self = useRef(null);
const onWindowOrTabClose = event => {
if (!when) {
@bradtraversy
bradtraversy / docker-help.md
Last active September 23, 2024 03:01
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@dizzythinks
dizzythinks / managePom.py
Created November 10, 2017 10:48
Read a pom.xml and get version or update it in Python
def managePom(update=False):
from xml.etree import ElementTree as et
ns = "http://maven.apache.org/POM/4.0.0"
et.register_namespace('', ns)
tree = et.ElementTree()
tree.parse('pom.xml')
p = tree.getroot().find("{%s}version" % ns)
if update:
p.text = update
tree.write('pom.xml')
@ygotthilf
ygotthilf / jwtRS256.sh
Last active September 23, 2024 08:13
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@nisrulz
nisrulz / create_maven_repo.sh
Last active June 18, 2020 12:10
Creating a maven repository
### Create Maven Repository
#Create a directory named mavenrepo
mkdir mavenrepo
#Move into the dir
cd mavenrepo
#Initialise with git
git init
@denji
denji / nginx-tuning.md
Last active September 21, 2024 10:58
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.