Skip to content

Instantly share code, notes, and snippets.

View NorikDavtian's full-sized avatar
🚢
Shipping

Norik Davtian NorikDavtian

🚢
Shipping
View GitHub Profile
/ # echo $0
/bin/sh
/ # exit
@NorikDavtian
NorikDavtian / envify.sh
Last active September 9, 2022 23:08
load variables from the .env file to the terminal environment.
#!/bin/sh
# example: ./scripts/envify.sh .env.dev
envify() {
ENV_FILE="$(pwd)/.env"
if [ -n "$1" ]; then
echo "FILE: $1"
ENV_FILE="$(pwd)/${1}"
fi
if [ -f "$ENV_FILE" ]; then
package main
import (
"fmt"
"log"
"net/http"
"os"
)
func handler(w http.ResponseWriter, r *http.Request) {
kubectl get all -A
kubectl delete all --all --all-namespaces

UID generation from EPOCH

SELECT UNIX_TIMESTAMP() * 1e3 + 1;
+--------------------------+
|UNIX_TIMESTAMP() * 1e3 + 1|
+--------------------------+
DELIMITER $$
CREATE PROCEDURE LOADGEN(SIZE INT)
DETERMINISTIC
READS SQL DATA
BEGIN
DECLARE i INT unsigned DEFAULT 1;
WHILE (i <= SIZE)
DO
INSERT INTO ping(name) VALUES ('ping');
INSERT INTO ping(name) VALUES ('pong');
kubectl config set-context dev-342

➜ /etc mysql --help | grep "Default options" -A 1

Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf

@NorikDavtian
NorikDavtian / learn-go-lang-expedited.md
Last active August 7, 2020 05:48
My take on learning Go Language. https://git.io/fhLYE

Learn Go Lang: Expedited

This is my take on learning go and experimenting with it, again.
Learning a new language is often times a lot of back and forth between I got it and hmm what's next?
It is easy to get started but what is past the hello-word.go?
Is it a web server or is it a cli tool?
This is the never ending loop of being stuck on more hello world examples and more CRUD using different frameworks that I dont intend to use.
Sometimes it is difficult to do paradigm switching, but a working playground environment will make it easy to get it going and not get stuck. I hit my own share of roadblocks trying to learn go, hopefully this list will make it easy for someone else.

Let's not get stuck and get it going :)

@NorikDavtian
NorikDavtian / .gitignore
Created July 24, 2020 08:21 — forked from pdxjohnny/.gitignore
Setting Up k3s for Serverless (knative) on a $5 DigitalOcean Droplet Using k3d
.terraform/
*.pem
*.tf
*.tfstate
*.yaml
*.backup
istio-*/
cert-manager-*/
*.swp
env