Skip to content

Instantly share code, notes, and snippets.

View kolayne's full-sized avatar
🦉
I may be slow to respond.

Nikolay Nechaev kolayne

🦉
I may be slow to respond.
View GitHub Profile
@kolayne
kolayne / hackerize_xs_decryptor.py
Last active May 4, 2024 18:31
Hackerize XS decoder
#!/usr/bin/python3
def decode(s):
alphabet = 'abcdefghijklmnopqrstuvwxyz'
hackerized = 'Λß↻Ð☰∲ç╫¡¿├↑ღ∏☐þ¶┏§⊥üƴ₪✕¥ᶾ'
ans = ''
for c in s:
try:
ans += alphabet[hackerized.index(c)]
except ValueError:
@kolayne
kolayne / analyze_swap_usage.sh
Last active March 31, 2024 20:06
Analyze swap usage per process
#!/bin/bash -i
# Get current swap usage for all running processes
# Originally written by Erik Ljungstrom 27/05/2011
# Modified by Nikolay Nechaev aka @kolayne
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d | grep -E "^/proc/[0-9]"` ; do
@kolayne
kolayne / Maybe.cpp
Last active June 25, 2024 22:11
My attempts to implement a class similar to `std::optional`
#include <stdexcept>
template<class T>
class Maybe {
private:
struct _EmptyByte {};
union _ {
_EmptyByte empty;
T payload;