Skip to content

Instantly share code, notes, and snippets.

View nordineb's full-sized avatar

Nordine Ben Bachir nordineb

View GitHub Profile
@nordineb
nordineb / README.md
Created October 30, 2023 19:46
Insert billions of records

Insert billions of records

CREATE TABLE bigtable (
    column1 varchar(MAX),
    column2 varchar(MAX),
    column3 varchar(MAX),
 	column4 varchar(MAX),
 	column5 varchar(MAX),
 	column6 varchar(MAX),
@nordineb
nordineb / README.md
Created October 30, 2023 19:41
ubuntu setup

WIP

Locales

sudo dpkg-reconfigure locales

Fish

@nordineb
nordineb / README.md
Last active October 30, 2023 19:35
SHA512 digest

sha512 digest

Bash

echo -n 12345678900 | openssl dgst -binary -sha512 | base64

Go

package main
@nordineb
nordineb / AuthyToOtherAuthenticator.md
Created September 21, 2023 14:16 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

@nordineb
nordineb / README.MD
Created May 3, 2023 19:15
buildah & podman / ubuntu 20.04
sudo apt-get install -y wget ca-certificates gnupg2
VERSION_ID=$(lsb_release -r | cut -f2)
echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel-kubic-libcontainers-stable.list
curl -Ls https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_$VERSION_ID/Release.key | sudo apt-key add -
sudo apt-get update
@nordineb
nordineb / jwks.json
Created May 2, 2023 12:17
example jwks
{
"p": "2x_gfou2y_Zhf94aTHMiic4_7Q52x14SNfVyBs01rYQmmyFqUe1pFi0B2lA3-chtkLCsfKypL1LFJ_WH9u3w37ON_WbrRcpnD4SdaEGFUPgEZ0MS_g7kJ_RlRwimcNEu0BuKWOGiA9jnNImS8dwrjBQWsKqi2g5MKQpmrePXLD0",
"kty": "RSA",
"q": "nd4CuMnRg-a22rJ1LQSyR985cKPHk2GImePkC3J6Ka8LKcuoQR2o527dHTtrJcgtCRFmFQT12Z-JEWgXMNMOwrugQVfr3UTFuI30ZS3PyhFrskb-2dJdhP5NpJZ4sQVcDg0V08BRE_2m7gQMmNPUToisk3X21DtLyBbIbg2Zuzs",
"d": "XUxvltMRUik9SRLFogTj4F08L0cj4Pn4vF7gm-HSPFlN-BkS8GMFiAUdnq8kjct7KE06Tm8jJUknLhe_Gh9n8wHlKWMyaD8zJCLz9rskHWwouioboRh_jCkgj_6rCBhl9wNlIWjYqQqb-6adZEIezU8cUJYvAYwglddYFeJx8nIPcEAYguj1WB6Sr39WjuvL4QMMd_fbElN_uvQ3pZRyJ4W4GbEha9e5Y2PnHfM7yD1nz9q-j1s0s2yt6rQo66ExM3nhpC_pLuNUWeLzDhKjkLeDbNSkESMfmFog3HpLrRCLTN-Ci3qMII2b2n5VKEMMBMu9t-rNpsxBcs5uQSJlMQ",
"e": "AQAB",
"use": "sig",
"kid": "oauth2-mock-server-signkey",
"qi": "UABYhl9__-wGY7yX7th7VIS2c3t0WCiyg17EKK4sQwwyq81gJsM8cFD5jU-FogJsrL4eaCMPNlnbXXRaECceTnT0Wldd62cr_e5DLJ_BKccYSHO5xIuhSLrDgib3UwQZ2jhAz0DmeUw84nwoIHEVwFdb7SVKVGiYmqua5pdc8oE",
"dp": "DFj-gIME-PdYRSlR2A8A2j0aExS
@nordineb
nordineb / emptysparkpy.py
Last active March 31, 2023 07:52
emptysparkpy.py
import os
from pyspark.sql import SparkSession
# Create a SparkSession object
spark = SparkSession.builder.appName("SparkSQL Example").getOrCreate()
# do something to prove it works
rdd = sc.parallelize(range(100000))
x=rdd.sumApprox(3)
print(x)
@nordineb
nordineb / README.md
Last active January 26, 2023 10:28
Istio on a local k3d cluster

Istio on a local k3d cluster

Sometimes it's more practical to have a local cluster for testing Istio stuff.

Guide

Install k3d. Tested on k3d 5.4.4, but it should work on the latest too:

curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=v5.4.4 bash
@nordineb
nordineb / app.yaml
Created December 14, 2022 14:46
app.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: store-v1
namespace: store-ns
spec:
replicas: 2
selector:
matchLabels:
app: store
@nordineb
nordineb / README.md
Created September 13, 2022 14:46
cURL custom DNS resolution
curl https://gist.github.com --resolve 'gist.github.com:443:127.0.0.1