Skip to content

Instantly share code, notes, and snippets.

View iamcryptoki's full-sized avatar

Gael Gentil iamcryptoki

View GitHub Profile
@iamcryptoki
iamcryptoki / keybase.md
Last active November 2, 2020 16:06
Keybase proof

Keybase proof

I hereby claim:

  • I am iamcryptoki on github.
  • I am cryptoki (https://keybase.io/cryptoki) on keybase.
  • I have a public key ASBIMoe475AgBX5AuLGPQPYE9NyyYKTQY6H8OlbXi4FlBgo

To claim this, I am signing this object:

@iamcryptoki
iamcryptoki / k8s-livenessprobe-exception.php
Last active January 23, 2020 15:03
Prevent Wordpress from redirecting Kubernetes liveness/readiness probes when it runs in a non-root container and exposes a port above 1024.
<?php
/**
* Plugin Name: Kubernetes Liveness Probe Exception
*/
add_filter('redirect_canonical', function($redirect_url, $requested_url) {
$K8S_POD_IP = getenv('K8S_POD_IP');
$LIVENESS_URL = "http://" . $K8S_POD_IP . ":8080/index.php";
if ($requested_url == $LIVENESS_URL) {
@iamcryptoki
iamcryptoki / add_label_workers.txt
Created January 14, 2020 12:50
Add "worker" as node role label to your Kubernetes workers.
$ kubectl label node <NODE_NAME> node-role.kubernetes.io/worker=worker
@iamcryptoki
iamcryptoki / kubernetes_copy_secret_namespace.txt
Last active January 15, 2020 08:10
Kubernetes: Copy secret data between namespaces.
$ kubectl get secret <SECRET_NAME> --namespace=<NAMESPACE> --export -o yaml | \
kubectl apply --namespace=<NEW_NAMESPACE> -f -
@iamcryptoki
iamcryptoki / docker_delete_all_images.txt
Created January 25, 2020 14:53
Delete all your Docker images.
$ docker rmi $(docker images -q) -f
@iamcryptoki
iamcryptoki / install_kubectx_kubens_linux.txt
Created March 2, 2020 14:32
Install kubectx and kubens on Linux.
sudo git clone https://github.com/ahmetb/kubectx /opt/kubectx
sudo ln -s /opt/kubectx/kubectx /usr/local/bin/kubectx
sudo ln -s /opt/kubectx/kubens /usr/local/bin/kubens
echo "source /opt/kubectx/completion/kubectx.bash" >> ~/.bashrc
echo "source /opt/kubectx/completion/kubens.bash" >> ~/.bashrc
@iamcryptoki
iamcryptoki / latency.txt
Created April 30, 2020 07:30 — 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
@iamcryptoki
iamcryptoki / docker_remove_exited_containers.txt
Created May 5, 2020 07:10
Remove all Exited Docker containers
sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
@iamcryptoki
iamcryptoki / dell-xps-9380.md
Created June 20, 2020 08:52 — forked from netsensei/dell-xps-9380.md
Installing Fedora 30/31 on Dell XPS 13 9380

Installing Fedora 30/31 on a Dell XPS 13 9380 series in dual boot mode

This guide describes how to install Fedora 30/31 next to Windows 10 on a Dell XPS 13 9380 series in dual boot.

  • Keep the stock Windows 10 installation that came with the laptop.
  • Install Fedora 30 alongside Windows on the hard disk.
  • Install GRUB as the bootloader allowing you to choose which OS to boot from.

Authored: September 2019

@iamcryptoki
iamcryptoki / docker_k8s_command_args.txt
Created June 21, 2020 08:54
Command and Arguments field name for Docker and Kubernetes.
-------------------------------------------------------------------------------------
| Description | Docker field name | Kubernetes field name |
-------------------------------------------------------------------------------------
| The command run by the container | Entrypoint | command |
| The arguments passed to the command | Cmd | args |
-------------------------------------------------------------------------------------