Skip to content

Instantly share code, notes, and snippets.

View codeliger's full-sized avatar

Ben codeliger

  • Canada
View GitHub Profile
package main

import "fmt"

func Normal(s string) string {
    fmt.Println(&s)
    return s
}
@codeliger
codeliger / grub.sh
Last active December 31, 2021 03:41
#ensure you are booted into UEFI mode through the motherboards boot menu
# test if efi mode in bash:
# [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
# list devices
lsblk -f
# decrypt the encrypted disk/volume
sudo cryptsetup luksOpen /dev/nvme0n1p2 archliger
@codeliger
codeliger / restore_grub_manjaro.txt
Created December 8, 2019 08:33 — forked from greginvm/restore_grub_manjaro.txt
Restore GRUB in UEFI + LVM + LUKS setup (Manjaro)
Setup: UEFI, LVM + LUKS encrypted drive
Bootloader: Grub
Links:
- https://wiki.manjaro.org/index.php/Restore_the_GRUB_Bootloader
-
Restore GRUB (boot into live env):
# get the encrypted partition (crypto_LUKS)
lsblk -f
@codeliger
codeliger / tricks.sh
Created September 6, 2019 01:40
Notes
git config --global core.editor "code --wait"
@codeliger
codeliger / go.json
Last active August 23, 2019 19:13
go user snippets
{
"For Loop": {
"prefix": "for",
"body": [
"for ${1:i} := ${2:0}; ${1:i} ${3:<} ${4:INTEGER}; ${1:i}${5:++} {",
"\t$0",
"}"
],
"description": "Create a standard for loop"
},
Tab: history-search-backward
set completion-ignore-case On
"\e[A": history-search-backward
"\e[B": history-search-forward
@codeliger
codeliger / upgrade.py
Created March 17, 2019 02:33
pip upgrade all packages
'''
Upgrades all pip packages to the latest version
'''
from subprocess import check_output, call
import json
PYTHON_VERSION = '3.7'
CMD_OUTDATED_PACKAGES = f'python -m pip list --format json -o'
'''
Upgrades all pip packages to the latest version
'''
from subprocess import check_output, call
import json
VERSION = '3.7'
CMD_OUTDATED_PACKAGES = f'python -m pip list --format json -o'
items = range(0,10001)
def iter_group(iterable, batch_size:int):
iterable_type = type(iterable)
length = len(iterable)
start = batch_size*-1
end = 0
while(end < length):
start += batch_size
end += batch_size
seconds_verb = (
(29030400,'year'),
(2419200,'month'),
(604800,'week'),
(86400,'day'),
(3600,'hour'),
(60,'minute'),
(1,'second')
)