Skip to content

Instantly share code, notes, and snippets.

[root@recover images]# gdisk /dev/sdc
GPT fdisk (gdisk) version 0.8.6
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
@TuvianNavy
TuvianNavy / uefi_chronology.md
Last active July 18, 2020 11:20
UEFI Chronology
  • 1981 IBM PC 5150 (MBR and INT13H as BIOS specifications)
  • 1992 PCI 1.0
  • 1996 USB1.0, ACPI 1.2 (first public version, 1.0 and 1.1 kept internally)
  • 2000 EFI 1.02, Windows 2000 (diskpart.exe replaces fdisk.exe)
  • 2001 efibootmgr started, Windows 2000 ASLE (supports GPT and EFI boot, IA-64 only)
  • 2002 EFI 1.10, Windows XP 64-bit Edition (supports GPT and EFI boot, IA-64 only)
  • 2003 HP rx2600 (Widely sold commercial EFI products, Itanium2), ELILO started
  • 2005 Unified EFI Forum started, Windows XP x64 Edition (first GPT-aware consumer Windows, x64 only)
  • 2006 UEFI 2.0, Core Duo, Core 2 Duo, Intel Mac (first EFI personal computers, supports x64 on Late 2006), Boot Camp
  • 2008 Windows Server 2008/Vista SP1 (uses bootmgr, supports EFI boot on IA-32/x64)
@TuvianNavy
TuvianNavy / ipv4_best_suballoc.txt
Last active January 24, 2019 12:00
IPv4 class-C compact suballocation best practice
IPv4 class-C compact suballocation best practice
0 network
1-19 for external service endpoints or dhcp for human-handled terminals
20-39 for server mgmt
40-53 for network appliance mgmt (ex. routers or firewalls)
60-99 for various use (do not place physical servers or appliances)
100-119 dhcp or some floating IPs
use lspci -nnD first
@TuvianNavy
TuvianNavy / minimal_git_for_alone.md
Last active March 12, 2019 10:58
minimal git for alone

MINIMAL git FOR ALONE.

prepare ~/.gitconfig (do first before git init)

me@workhost:~$ cat > ~/.gitconfig
[user]
        email = me@example.com
        name = My Name
[core]
#!/bin/sh
# DEC graphics
dec_lua=$(printf '\e(0\152\e(B') # lua, left-to-up angle
dec_lda=$(printf '\e(0\153\e(B') # lda
dec_rda=$(printf '\e(0\154\e(B') # rda
dec_rua=$(printf '\e(0\155\e(B') # rua
dec_x=$(printf '\e(0\156\e(B') # x, cross
dec_h=$(printf '\e(0\161\e(B') # h, horizontal
dec_btr=$(printf '\e(0\164\e(B') # btr, branch-to-right
dec_btl=$(printf '\e(0\165\e(B') # btl
@TuvianNavy
TuvianNavy / xlsx-sample
Last active May 30, 2020 04:01
JavaScript XLSX (requires SheetJS)
var min_col = 1; // 0-indexed colnum (it means "B")
var min_row = 11; // 0-indexed rownum (it means "12")
var max_col; // 0-indexed colnum
var max_row; // 0-indexed rownum
XLSX = require('xlsx');
Book = XLSX.readFile(Sample_XLSX_Path);
Sheet1 = Book.Sheets[Sample_Sheet];
var range = XLSX.utils.decode_range(Sheet1['!ref']);
max_col = range.e.c;
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ /home/ubuntu/go/bin/gojq -v
gojq 0.11.0 (rev: HEAD/go1.14.4)
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ /home/ubuntu/go/bin/gojq --yaml-input . /etc/netplan/01-network-manager-all.yaml
{
"network": {
"ethernets": {
"enp2s0": {
"addresses": [
"192.168.179.99/24"
],
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ lscpu --json | /home/ubuntu/go/bin/gojq -c .lscpu[12]
{"data":"Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz","field":"Model name:"}
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ free -h
total used free shared buff/cache available
Mem: 31G 648M 25G 526M 5.3G 29G
Swap: 2.0G 1.2M 2.0G
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ yq --version
yq 2.10.1
ubuntu@livazplus:~/Desktop/parse-json-benchmark$ gojq -v
gojq 0.11.0 (rev: HEAD/go1.14.4)
ubuntu@livazplus:~/Desktop/edk2/AppPkg/Applications/Duktape/src$ vi duk_config.h
ubuntu@livazplus:~/Desktop/edk2/AppPkg/Applications/Duktape/src$ rm -rf ../../../../Build/AppPkg/DEBUG_GCC5/X64/AppPkg/Applications/Duktape/ ; build -p AppPkg/AppPkg.dsc -m AppPkg/Applications/Duktape/Duktape.inf
Build environment: Linux-5.3.0-62-generic-x86_64-with-Ubuntu-18.04-bionic
Build start time: 01:21:39, Aug.05 2020
WORKSPACE = /home/ubuntu/Desktop/edk2
EDK_TOOLS_PATH = /home/ubuntu/Desktop/edk2/BaseTools
CONF_PATH = /home/ubuntu/Desktop/edk2/Conf
PYTHON_COMMAND = /usr/bin/python3.6