Skip to content

Instantly share code, notes, and snippets.

View ku1ik's full-sized avatar
👋

Marcin Kulik ku1ik

👋
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ku1ik on github.
  • I am sickill (https://keybase.io/sickill) on keybase.
  • I have a public key ASA6zv4rQRzFiEbKAPOiFfmc4rJOYHKCXOZ9V-3cfwFatgo

To claim this, I am signing this object:

0x00 - NUL - Null character, used as a string terminator in some programming languages
0x01 - SOH - Start of Header, indicates the start of a message in communication protocols
0x02 - STX - Start of Text, marks the end of the transmission header and the beginning of the message
0x03 - ETX - End of Text, signifies the end of a message
0x04 - EOT - End of Transmission, marks the end of a message or series of messages
0x05 - ENQ - Enquiry, requests an acknowledgement from the receiver in communication protocols
0x06 - ACK - Acknowledge, confirms receipt of a message in communication protocols
0x07 - BEL - Bell, triggers an audible bell or alert on a device
0x08 - BS - Backspace, moves the cursor back one space in text processing
0x09 - HT - Horizontal Tab, moves the cursor to the next tab stop in text processing

How to play ASCII-Art Star Wars offline

Following will teach you how to play the "easter-egg" (which actually isn't, but many people describe this as an easter egg) of ASCII-Art Star Wars (or Star Wars in terminal/telnet, whatever), the one you normally starts like this:

$ telnet towel.blinkenlights.nl
  1. Before you start, ensure Node.js is installed.
  2. Navigate to www.asciimation.co.nz, the original home of that ASCII-Art Star Wars.
  3. Press F12 to open developer tools.
@ku1ik
ku1ik / proxmox_resize_pve-root
Created March 20, 2021 18:11
Proxmox - Resize pve-root
# Check disk space before
df -h
# Delete local-lvm storage in gui
lvremove /dev/pve/data
lvresize -l +100%FREE /dev/pve/root
resize2fs /dev/mapper/pve-root
@ku1ik
ku1ik / script-template.sh
Created December 27, 2020 18:29 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@ku1ik
ku1ik / collatz.md
Last active December 14, 2019 16:44

I implemented simple (dumb) algorithm for finding the largest Collatz trajectory (see Collatz conjecture) for all numbers < 100,000,000 in Python, Rust and Elixir.

I benchmarked them with time command, assuming boot time is negligible (Python and Elixir need ~1 sec to boot before the calculation loop starts but their runtime is in hundreds of seconds anyway. Rust program boots in couple of milliseconds.)

@ku1ik
ku1ik / rw_ro_access.sql
Last active October 16, 2018 11:26 — forked from checco/rw_ro_access.sql
How to create a read only user in AWS RDS PostgreSQL and a user with superuser privileges on AWS RDS PostgreSQL
--
-- Read only
--
-- Create a group
CREATE ROLE ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO ro_group;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO ro_group;
@ku1ik
ku1ik / asciicast-transformations.py
Created March 6, 2018 18:16
Experiments with asciicast transformations
import sys
import asciinema.asciicast as asciicast
import asciinema.asciicast.events as ev
# predicates
def _(actual):
return True
import sys
import os
import json
import asciinema.asciicast as asciicast
import asciinema.asciicast.frames as frames
# run me with:
# python3 edit-asciicast.py original.cast edited.cast
@ku1ik
ku1ik / asciinema-upload.sh
Last active January 30, 2024 08:26
Upload local recording to asciinema.org with curl
curl -v -u $USER:$(cat ~/.config/asciinema/install-id) https://asciinema.org/api/asciicasts -F asciicast=@/path/to/demo.cast