Skip to content

Instantly share code, notes, and snippets.

View KernelPryanic's full-sized avatar
🇺🇦

Daniil Trishkin KernelPryanic

🇺🇦
  • JW Player
  • Amsterdam, Netherlands
View GitHub Profile
@chrisnc
chrisnc / rawudp.go
Last active August 9, 2024 17:42
constructing ip/udp packets in go
package main
import (
"bufio"
"bytes"
"encoding/binary"
"flag"
"fmt"
"net"
"os"
@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) {
@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]))"'
@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
# 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
@superjamie
superjamie / install-ubuntu-luks-lvm.md
Last active November 8, 2024 18:28
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).