Skip to content

Instantly share code, notes, and snippets.

View mehiel's full-sized avatar
💭
Plugged 🔌

Aggelos Karalias mehiel

💭
Plugged 🔌
View GitHub Profile
@borama
borama / autoarchive-tables.sh
Created February 7, 2020 14:57
Shell script to automate MySQL tables time-based archival
#!/bin/bash
set -e
database="MY_DATABASE"
altered_tables=0
function fatal {
echo "FATAL: $1" >&2
echo "Exiting now." >&2
@borama
borama / export-partition.sh
Last active June 9, 2023 08:06
Shell script to export data from the given table partition and delete it aferwards
#!/bin/bash
# "panic button" when run in a for loop:
# exit
database="MY_DATABASE"
export_dir="/mnt/backups/my-archive"
set -e
@borama
borama / run_ghost.sh
Created February 6, 2020 15:30
Helper shell script for running the gh-ost tool
#!/bin/bash
function usage {
echo "Use ./run_ghost.sh table_name 'alter_command' [other_ghost_args]"
exit 1
}
database="MY_DATABASE_NAME"
table=$1
import React from "react";
import {
useRouter,
Link
} from "@reach/router/unstable-hooks";
function Accounts() {
let route = useRouter({
".": () => <div>boring Accounts</div>,
dope: () => <div>Dope Accounts</div>
@jboner
jboner / latency.txt
Last active May 1, 2024 14:21
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