Skip to content

Instantly share code, notes, and snippets.

@ryenus
ryenus / podman_macos.md
Created April 12, 2023 04:05 — forked from kaaquist/podman_macos.md
Podman with docker-compose on MacOS.

Podman with docker-compose on MacOS.

Podman an alternative to Docker Desktop on MacOS

Getting podman installed and started is super easy.
Just use brew to install it.

> brew install podman

Now since podman uses a VM just like the Docker Client on MacOS we need to initialize that and start it.

@ryenus
ryenus / latency.txt
Created June 3, 2022 22:47 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@ryenus
ryenus / docker.disable.kube.md
Last active May 16, 2020 07:12
How to disable kubernetes without Docker UI

How to disable kubernetes without Docker UI

As workaround to disable kubernetes without the UI, you can edit "~/Library/Group Containers/group.com.docker/settings.json" and set the kubernetesEnabled property to false, then quit and relaunch the Docker.

Source: docker/for-mac#2541 (comment)

@ryenus
ryenus / catalina.sh
Last active August 20, 2019 19:50
/usr/local/opt/tomcat/bin/catalina
#!/bin/sh
export CATALINA_HOME="$(brew --prefix tomcat)/libexec"
export CATALINA_BASE="${CATALINA_BASE:-$(brew --prefix)/var/tomcat}"
catalina_init() {
if [ ! -e "$CATALINA_BASE/conf" ]; then
mkdir -p "$CATALINA_BASE"
cp -r "$CATALINA_HOME/conf" "$CATALINA_BASE/"
fi
@ryenus
ryenus / fix-jsvc.sh
Created August 11, 2019 15:50
docker amazoncorretto:11 and jsvc 1.0.3
# In the docker image amazoncorretto:11, with `yum install jsvc` we get jsvc 1.0.3
# But jsvc 1.0.3 does NOT support Java 9+
# Fortunately there's a workaround
sudo ln -s /usr/lib/jvm/java/lib/ /usr/lib/jvm/java/lib/amd64
@ryenus
ryenus / ab_portrange_on_mac.md
Created July 14, 2019 17:45
Increase ephemeral port range on macOS

The default ephemeral port range on macOS/OSX is 49152-65535, which is only 16,383 ports:

$ sysctl -a | grep portrange
net.inet.ip.portrange.lowfirst: 1023
net.inet.ip.portrange.lowlast: 600
net.inet.ip.portrange.first: 49152
net.inet.ip.portrange.last: 65535
net.inet.ip.portrange.hifirst: 49152
net.inet.ip.portrange.hilast: 65535
@ryenus
ryenus / json-helpers.ts
Created July 11, 2019 07:04 — forked from LexVocoder/json-helpers.ts
Helpers for converting JSON to actual TypeScript classes
/***
Inspired by http://choly.ca/post/typescript-json/ , except this is only for parsing (not stringifying).
If you use this, I'd appreciate some credit and some feedback ... but neither are required.
Copyright license (Apache) is at the bottom.
NOTE THIS WILL PROBABLY NOT WORK if your uglifier changes constructor/class names. This is a pretty common thing, and it makes me sad.
The main problem this solves is that JSON.stringify returns plain old JS objects, not TS instances.
@ryenus
ryenus / eclipse-monokai-monoright.epf
Created June 22, 2019 01:06
Eclipse Monokai Theme Monoright
#Sat Jun 22 04:07:24 CST 2019
#based on http://www.eclipsecolorthemes.org/?view=theme&id=44675, with brighter comment
\!/=
/instance/org.eclipse.jdt.ui/org.eclipse.jdt.ui.formatterprofiles.version=16
/instance/org.codehaus.groovy.eclipse.ui/groovy.editor.groovyDoc.keyword.enabled=true
/instance/org.codehaus.groovy.eclipse.ui/groovy.editor.groovyDoc.link.enabled=true
/instance/org.codehaus.groovy.eclipse.ui/groovy.editor.groovyDoc.tag.enabled=true
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionForeground.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.SelectionBackground.SystemDefault=false
/instance/org.eclipse.ui.editors/AbstractTextEditor.Color.Background.SystemDefault=false
@ryenus
ryenus / jv.sh
Last active May 30, 2019 15:00
show, list or set java version for current shell, mac only
# show, list or set java version for current shell
# usage: jv; jv -l; or jv 8
jv() {
local d v="$1"
if [ $# -ge 1 ]; then
[ -z "${v#-[lLV]}" ] && { /usr/libexec/java_home -V; return; }
[ -z "${v##-*}" ] && { /usr/libexec/java_home "$@"; return; }
[ ${#v} -eq 1 -a -z "${v#[0-8]}" ] && v="1.$v"
[ -n "$v" ] && d=$(/usr/libexec/java_home -v "$v") && \
export JAVA_HOME="$d"
@ryenus
ryenus / tmux-cheatsheet.markdown
Created November 20, 2018 20:51 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname