Skip to content

Instantly share code, notes, and snippets.

View KernelPryanic's full-sized avatar
🇺🇦
Julian Assange is not a spy

Daniil Trishkin KernelPryanic

🇺🇦
Julian Assange is not a spy
  • JW Player
  • Amsterdam, Netherlands
View GitHub Profile
@superjamie
superjamie / install-ubuntu-luks-lvm.md
Last active April 21, 2024 15:07
How to install Ubuntu with LUKS Encryption on LVM

How to install Ubuntu with LUKS Encryption on LVM

My work requires us to have full-disk encryption, so these are the steps I use.

The basic idea is to create a LUKS-encrypted partition which is used as an LVM Physical Volume.

The GRUB boot partition isn't encrypted, but everything else is.

These steps tested and working on 22.04 (jammy) and 20.04 (focal).

# Use Google Cloud Platform stackdriver with python structlog
from google.cloud.logging import Client
from google.cloud.logging import _helpers
from google.cloud.logging.handlers import CloudLoggingHandler
from google.cloud.logging.handlers.transports.background_thread import _Worker
# pip install python-json-logger
from pythonjsonlogger import jsonlogger
@sluger
sluger / Backtick_Behaviour.md
Created September 27, 2018 13:47 — forked from keckelt/Backtick Behaviour.md
Avoid typing backticks twice (on Linux)

The backtick is called grave If the backtick is not typed on your first keyboard button press, but on the second it is a dead grave.

So, find the backtick button keycode for your layout:

xmodmap -pke | grep "grave"

which returns (for my german keyboard layout):

keycode 21 = dead_acute dead_grave dead_acute dead_grave
@rm--
rm-- / url_encode_decode.py
Created March 1, 2018 15:41
url encode and decode in python (alias)
urlencode='python3 -c "import sys, urllib.parse as ul; print(ul.quote_plus(sys.argv[1]))"'
urldecode='python3 -c "import sys, urllib.parse as ul; print(ul.unquote_plus(sys.argv[1]))"'
@kotakanbe
kotakanbe / ipcalc.go
Created September 17, 2015 02:59
get all IP address from CIDR in golang
package main
import (
"net"
"os/exec"
"github.com/k0kubun/pp"
)
func Hosts(cidr string) ([]string, error) {
@chrisnc
chrisnc / rawudp.go
Last active February 9, 2024 15:29
constructing ip/udp packets in go
package main
import (
"bufio"
"bytes"
"encoding/binary"
"flag"
"fmt"
"net"
"os"