Skip to content

Instantly share code, notes, and snippets.

@ryenus
ryenus / colima.md
Created September 13, 2024 10:48 — forked from res0nat0r/colima.md
Set proxy in Colima Docker container

abiosoft/colima#294 (comment)


Note: this assumes Colima v0.4.0 or newer.

SSH into the VM colima ssh

Edit docker init script sudo vi /etc/init.d/docker.

@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 / 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 / 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
@ryenus
ryenus / gist:cd755727bdd53e9b8b80b145b8ac235a
Created December 13, 2017 13:39 — forked from tonymtz/gist:714e73ccb79e21c4fc9c
Uninstall XQuartz.app from OSX Yosemite
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
# Log out and log in
#!/bin/sh
# to run this, use the following:
# curl https://matthewbauer.us/kernel-panic.sh | sh
cfile=$(mktemp).c
cat <<EOF >> $cfile
#include <unistd.h>
#include <sys/syscall.h>
#include <signal.h>
@ryenus
ryenus / bashrc
Created February 15, 2017 02:29 — forked from theBull/bashrc
How to change cursor shape, color, and blinkrate of Linux Console
##############
# pretty prompt and font colors
##############
# alter the default colors to make them a bit prettier
echo -en "\e]P0000000" #black
echo -en "\e]P1D75F5F" #darkred
echo -en "\e]P287AF5F" #darkgreen
echo -en "\e]P3D7AF87" #brown
echo -en "\e]P48787AF" #darkblue
@ryenus
ryenus / RestTemplateConfig.java
Created January 10, 2017 12:50 — forked from jonashackt/RestTemplateConfig.java
Spring RestTemplate with Support for Connecting to https with selfsigned Certificates (ApacheHTTPClient >= 4.4) and ByteArrays in Responses
import java.util.ArrayList;
import java.util.List;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.http.MediaType;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
import org.springframework.web.client.RestTemplate;
@ryenus
ryenus / less-color.sh
Last active September 2, 2016 08:31 — forked from boredzo/colorman.zsh
Color Terminal for bash/zsh etc..
# put into ~/.bashrc, or whereever fit
export LESS_TERMCAP_md=$'\e[1;36m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[1;41m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;32m'