Skip to content

Instantly share code, notes, and snippets.

View nathiss's full-sized avatar

Kamil Rusin nathiss

View GitHub Profile
@nathiss
nathiss / .zshrc
Last active March 29, 2023 18:58
Setting up gpg-agent for Yubikey
# [...]
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpg-connect-agent /bye > /dev/null
@nathiss
nathiss / df
Created November 8, 2020 18:54
#!/usr/bin/python3
a = """Filesystem Size Used Avail Use% Mounted on
udev 1,9G 0 1,9G 0% /dev
tmpfs 394M 1,4M 393M 1% /run
/dev/sda5 15G 7,2G 6,7G 52% /
tmpfs 2,0G 0 2,0G 0% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 2,0G 0 2,0G 0% /sys/fs/cgroup
/dev/loop2 56M 56M 0 100% /snap/core18/1932
@nathiss
nathiss / magic.js
Last active July 7, 2019 12:04
This one line is a cure for the cancer that is reading articles in our modern world. No more cookies popouts, notification dialogs, Subscribe! boxes, etc.
(function(){ window.location = 'https://outline.com/' + window.location.href; })();
-- @d:\data.sql
-- @D:\RusinKamil_01.sql
-- @/d
-- @/d.sql
-- (^ symlimk) --> @/home/r/r/nathiss/data.sql
set LINESIZE 32000;
set serveroutput on size 30000;
ALTER SESSION SET nls_date_format = 'DD-MON-YYYY HH24:MI';

Keybase proof

I hereby claim:

  • I am nathiss on github.
  • I am krusin (https://keybase.io/krusin) on keybase.
  • I have a public key ASAJRaEdIsLINOcnqR7rzL6Egv88iHuO4Ck86R7QyrIfXQo

To claim this, I am signing this object:

@nathiss
nathiss / executor.c
Created April 18, 2018 20:45
Simple shellcode executor for Linux(-like) systems.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
void* alloc_mem(size_t size) {
void *ptr = mmap(0, size, PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANONYMOUS, -1 ,0);
if(ptr == MAP_FAILED)
return NULL;
@nathiss
nathiss / snake.asm
Created January 22, 2018 20:34 — forked from PraveshKoirala/snake.asm
8086 Snake game MASM compatible
;*******************************************************************************************************************
; Snake Game By *
; HERO-DAI *
;*******************************************************************************************************************
;code is not well-commented, sorry about that, I'll try to comment it nice and well, but can't make any
;promises, Also, this code writes directly into the video memory instead of int 21H (21H is slow) except
;at some certain points (like displaying scores and the intro)
;and next time someone tells you to not use goto, ask them to code in assembly without goto... :P
@nathiss
nathiss / same.h
Created January 7, 2018 19:19
Template for checking if two types are the same (C++).
#ifndef _SAME_H
#define _SAME_H
template <bool C>
struct bool_type {
static constexpr bool value = C;
};
using true_type = bool_type<true>;
@nathiss
nathiss / Makefile
Last active December 12, 2017 15:01
General Makefile for C++ apps.
CXX=g++
LD=g++
CFLAGS=
LDFLAGS=
EXEC=out
SOURCES=$(wildcard *.cc)
OBJECTS=$(SOURCES:.cc=.o)
.PHONY: clean all run
@nathiss
nathiss / settings_bag.cc
Last active November 3, 2017 10:48
Associative array in C++17 for storing any data.
#include "settings_bag.h"
std::shared_ptr<SettingsBag> SettingsBag::instance = nullptr;
SettingsBag::SettingsBag() {
}
std::shared_ptr<SettingsBag> SettingsBag::Instance() {
if(instance == nullptr)
instance.reset(new SettingsBag());