Skip to content

Instantly share code, notes, and snippets.

View kolayne's full-sized avatar

Nikolay Nechaev kolayne

View GitHub Profile
@kolayne
kolayne / hackerize_xs_decryptor.py
Last active April 26, 2024 12:14
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 April 9, 2022 09:43
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;