Skip to content

Instantly share code, notes, and snippets.

@Fachher
Fachher / README.md
Created May 15, 2023 10:25 — forked from elalemanyo/README.md
Debug zsh startup time

Debug zsh startup time

  1. Inject profiling code

    At the beginning of your .zshrc add following: zmodload zsh/zprof

    and at the end add: zprof

    This will load zprof mod and display what your shell was doing durung your initialization.

@Fachher
Fachher / jwtRS256.sh
Created September 7, 2022 07:24 — forked from ygotthilf/jwtRS256.sh
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
await new Promise(function (resolve) {
setTimeout(function () {
resolve();
}, 1000);
});
// ... Can be shortened to:
await new Promise(function (resolve) {
setTimeout(resolve, 1000);
@Fachher
Fachher / VIN.java
Created March 26, 2020 16:08 — forked from ubergesundheit/VIN.java
VIN validator/decoder
public class VIN {
//from http://introcs.cs.princeton.edu/java/31datatype/VIN.java.html
public static boolean isVinValid(String vin) {
int[] values = { 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 0, 7, 0, 9,
2, 3, 4, 5, 6, 7, 8, 9 };
int[] weights = { 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 };
@Fachher
Fachher / gist:ed170f66842ca642719bab78ed5781c2
Created February 17, 2020 18:23 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@Fachher
Fachher / osx-defaults.sh
Created December 24, 2019 21:21 — forked from gregorynicholas/osx-defaults.sh
FUCK APPLE.
#!/usr/bin/env bash
#
# see: https://gist.github.com/gregorynicholas/2160046ec6946a2ce0fa
# src: https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# updated: 2015-06-06
#
# ask for the administrator password upfront
sudo -v
@Fachher
Fachher / artifact-version-yaml.groovy
Created October 10, 2019 11:50 — forked from nblair/artifact-version-yaml.groovy
Groovy script to help Jenkins identify the version of the artifact it just built.
/**
* Reads the version of the artifact from the Spring Boot application.yml.
* Depends on the following in build.gradle:
<pre>
processResources {
filesMatching('application.yml') {
expand(project.properties)
}
}
</pre>
@Fachher
Fachher / docker-for-mac.md
Created September 28, 2019 12:41 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker for Mac Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Moby VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1