Instantly share code, notes, and snippets.
👋
Software engineer, consultant, specializing in Elixir and Rust. Creator of@asciinema.
ku1ik /keybase.md
CreatedAugust 12, 2023 08:41
ku1ik /ascii-special-codes.txt
Last activeMay 21, 2023 14:45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
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 |
ku1ik /How to play ASCII-Art Star Wars offline.md
CreatedMarch 10, 2023 20:24 — forked fromJLChnToZ/How to play ASCII-Art Star Wars offline.md
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
- Before you start, ensureNode.js is installed.
- Navigate towww.asciimation.co.nz, the original home of that ASCII-Art Star Wars.
- Press F12 to open developer tools.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
# 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 /script-template.sh
CreatedDecember 27, 2020 18:29 — forked fromm-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description:https://betterdev.blog/minimal-safe-bash-script-template/ This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
#!/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 /collatz.md
Last activeDecember 14, 2019 16:44
I implemented simple (dumb) algorithm for finding the largest Collatz trajectory(seeCollatz conjecture)for all numbers < 100,000,000 in Python, Rust and Elixir.
I benchmarked them withtime
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 /rw_ro_access.sql
Last activeOctober 16, 2018 11:26 — forked fromchecco/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 This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
-- | |
-- Read only | |
-- | |
-- Create a group | |
CREATE ROLE ro_group; | |
-- Grant access to existing tables | |
GRANT USAGEON SCHEMA public TO ro_group; | |
GRANTSELECTON ALL TABLESIN SCHEMA public TO ro_group; |
ku1ik /asciicast-transformations.py
CreatedMarch 6, 2018 18:16
Experiments with asciicast transformations This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
importsys | |
importasciinema.asciicastasasciicast | |
importasciinema.asciicast.eventsasev | |
# predicates | |
def_(actual): | |
returnTrue |
ku1ik /edit-asciicast.py
Last activeFebruary 26, 2018 22:13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
importsys | |
importos | |
importjson | |
importasciinema.asciicastasasciicast | |
importasciinema.asciicast.framesasframes | |
# run me with: | |
# python3 edit-asciicast.py original.cast edited.cast |
ku1ik /asciinema-upload.sh
Last activeJanuary 30, 2024 08:26
Upload local recording to asciinema.org with curl This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
curl -v -u$USER:$(cat~/.config/asciinema/install-id) https://asciinema.org/api/asciicasts -F asciicast=@/path/to/demo.cast |
NewerOlder