Skip to content

Instantly share code, notes, and snippets.

View k-groshev's full-sized avatar

Konstantin Groshev k-groshev

View GitHub Profile

Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea

@blakethepatton
blakethepatton / upgrade-script.md
Last active April 13, 2023 13:18
Upgrading ubuntu 15.04 to 15.10 and to 16.04
sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo apt-get update && sudo apt-get dist-upgrade

mkdir wily && cd wily
wget http://old-releases.ubuntu.com/ubuntu/dists/wily-updates/main/dist-upgrader-all/current/wily.tar.gz
tar -xzf wily.tar.gz

sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' Ubuntu.info
sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' Ubuntu.mirrors
@chapati23
chapati23 / create-kubernetes-cluster-on-aws.sh
Last active October 23, 2021 12:34
Setup script to create a fresh kubernetes cluster on AWS with kops incl. all required AWS resources (S3 buckets, IAM etc.)
#!/bin/bash
# Prerequisites (macOS):
# - aws cli => to create AWS resources
# => pip install --upgrade --user awscli
# => aws configure
# - jq => to parse JSON results returned by the AWS CLI
# => brew install jq
import (
"database/sql"
"github.com/lib/pq"
)
dbb, _ := sql.Open("postgres", "postgres://Amogh:amogh@localhost:6431/dblog?sslmode=disable")
dbb.SetMaxIdleConns(10)
dbb.SetMaxOpenConns(10)
dbb.SetConnMaxLifetime(0)
a := time.Now()
txn, err := dbb.Begin()
@pobsuwan
pobsuwan / rabbitmq-cluster.md
Last active November 14, 2024 22:45
How to config rabbitmq server cluster [3 nodes]

How to config rabbitmq server cluster [3 nodes]

Edit /etc/hosts

vi /etc/hosts
192.168.10.157  rabbitmq-1
192.168.10.159  rabbitmq-2
192.168.10.161  rabbitmq-3
@jasonkhanlar
jasonkhanlar / fontawesome.sty
Last active March 18, 2024 06:42 — forked from sway/fontawesome.sty
FontAwesome mapping for XeLaTeX
% FontAwesome (http://fortawesome.github.com/Font-Awesome/) bindings for (Xe)LaTeX
% Author: Honza Ustohal <[email protected]>
% Updated to match FontAwesome v4.5.0 by Jason Khanlar <[email protected]>
%
% Translation of FontAwesome's private range characters into XeTeX symbols. All icons are camel-cased and prefixed with 'fa', i.e. what was .icon-align-center the CSS version of FontAwesome becomes \faAlignCenter
% This might be reworked into a full blown package in the near future
%
% Prerequisite:
% XeLaTeX, FontAwesome installed as a system font accessible by XeLaTeX
%
@samiraguiar
samiraguiar / MC Cheat Sheet
Last active March 6, 2025 19:16 — forked from maciakl/MC Cheat Sheet
Midnight Commander Cheat Sheet / Shortcuts
Note for newcomers:
In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention
used in the Midnight Commander documentation and was kept here.
You can also use "ESC" instead of "ALT", which is useful on Macbooks.
Main View
---------------------------------------------------------------
- File/directory operations
@iharsuvorau
iharsuvorau / .fetchmailrc
Created December 22, 2015 14:16
fetchmail + proc + msmtp + mutt configuration samples
# set chmod 0600 to the file
set daemon 60
poll imap.gmail.com
with proto IMAP
user "[email protected]"
there with password "pass"
is "localuser" here
mda "/usr/bin/procmail -d %T"
@mbbx6spp
mbbx6spp / ALTERNATIVES.adoc
Last active January 7, 2025 16:25
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
@bnagy
bnagy / gpgmutt.md
Last active August 10, 2024 22:44
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service