Skip to content

Instantly share code, notes, and snippets.

View ulidtko's full-sized avatar
🤔
What it feels like, to live in a collapsing civilization?

Maxim Ivanov ulidtko

🤔
What it feels like, to live in a collapsing civilization?
View GitHub Profile
# Oh come on! It's 2020! Stop freezing on OOM, you *clumsy penguin* !
kernel.sysrq = 244
# = 128+64+32+16 +4
# 256+128+64+32+16+8+4+2+1
# ^ ^ ^ ^ ^ ^ ^ ^ ^
# | | | | | | | | |
# | | | | | | | | | 0 - disable every SysRq function.
# | | | | | | | | `- 1 - enable every SysRq function.
# | | | | | | | `--- 2 - enable control of console logging level
@ulidtko
ulidtko / Cargo.toml
Last active December 23, 2020 18:59
[package]
name = "foobar"
version = "0.1.0"
authors = ["max ulidtko <ulidtko@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rand = "0.8.*"

Keybase proof

I hereby claim:

  • I am ulidtko on github.
  • I am ulidtko (https://keybase.io/ulidtko) on keybase.
  • I have a public key ASAr8VkzXINuO7wo76vlXNnbteMe5ZwB9xq-bH4KOtigVQo

To claim this, I am signing this object:

@ulidtko
ulidtko / README.md
Last active August 14, 2020 10:16
Java TLS echo server

Dummy echo server with TLS in Java.

Usage

git clone https://gist.github.com/ulidtko/f44360b0ac15dd7d42e21de6b964ace5 java-tls-echoserv
cd java-tls-echoserv
javac TlsEchoServer.java
java TlsEchoServer 9011 ./java-pleasure.jks 123456 123456

#-- or, with verbose debug dump of the handshake:

@ulidtko
ulidtko / 20ms-GCidle-annotated-1kRPS.png
Last active July 2, 2020 16:02
GHC waiting on DB during GC
20ms-GCidle-annotated-1kRPS.png
#!/usr/bin/env python3
import argparse
import socket
import struct
from time import sleep
FRAG1 = b"""HTTP/1.0 200 OK\r
Server: netcat\r
Content-Type: text/plain\r
# Linux udev rule file for Logitech F710 gamepads.
# Written by: Max <ulidtko@gmail.com> in year 2020.
# SPDX-License-Identifier: MIT
#
# ================================================================================
# On the gamepad, put the D ↔ X switch into the right, X position ("XInput Mode")!
# ================================================================================
#
# You can test the gamepad using jstest or jstest-gtk.
# You can test force-feedback (rumble, vibration) using fftest.
@ulidtko
ulidtko / tls_playground.py
Created March 5, 2020 14:14
TLS1.2 RSA-AES key exchange decryption example
#/usr/bin/env python3
"""
An exploration of TLS_RSA_WITH_AES_256_CBC_SHA key exchange in TLS v1.2
-- using https://cryptography.io/
[1]: https://lowleveldesign.org/2016/03/09/manually-decrypting-https-request/
[2]: https://www.acunetix.com/blog/articles/establishing-tls-ssl-connection-part-5/
[RFC5246]: https://tools.ietf.org/html/rfc5246
"""
# -*- coding: utf-8 -*-
import urwid
from urwid import MainLoop, ExitMainLoop
from urwid import Text, Edit, Button
from urwid import Frame, Pile, Padding, Filler, LineBox, Columns, Divider
from urwid import SolidFill, BoxAdapter
LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
def on_keypress(key):
@ulidtko
ulidtko / kmod-fridge-cleanup.conf
Created June 30, 2019 12:24
Keep Arch Linux fully functional after kernel updates
# /etc/tmpfiles.d/kmod-fridge-cleanup.conf
#Type Path Mode User Group Age Argument
D! /lib/modules/fridge 0755 root root -
#-- Inspired by #archlinux IRC & this thread:
# https://www.reddit.com/r/archlinux/comments/4zrsc3/keep_your_system_fully_functional_after_a_kernel/
#
#-- ulidtko, June 2019 [File 3/3]