Skip to content

Instantly share code, notes, and snippets.

View lethalbit's full-sized avatar
😼
ニャー

Aki lethalbit

😼
ニャー
View GitHub Profile
@AzureKitsune
AzureKitsune / NimEE.nim
Created July 23, 2011 18:33
NimEE (inspired by PyEE) and my functional nimrod file.
#
#
# Nimrod's Runtime Library
# (c) Copyright 2010 Amrykid
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
#
##
import sequtils
obj-m += rootkit.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@pavel-odintsov
pavel-odintsov / af_packet_rx_ring.c
Last active March 4, 2024 11:04
af_packet_rx_ring_habrahabr.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <unistd.h>
#include <boost/thread.hpp>
#include <sys/mman.h>
#include <poll.h>
#include <arpa/inet.h>
@marcan
marcan / brainfuck.sh
Created April 22, 2016 01:27
Brainfuck interpreter in POSIX sh
#!/bin/sh
# Brainfuck interpreter implemented in pure POSIX sh builtins only (except I/O)
# Tested in bash and busybox ash (getchar uses a bash-specific read)
# === I/O ===
getchar() {
# bashism
IFS= read -rN 1 a
if [ -z "$a" ]; then
echo $th
@dragonmux
dragonmux / pipe.hxx
Last active August 31, 2017 21:37
Pipe type
#ifndef PIPE__HXX
#define PIPE__HXX
#include <unistd.h>
#include <fcntl.h>
#include "fd.hxx"
bool cloexec(fd_t fd) noexcept
{
if (!fd.valid())
@georgexsh
georgexsh / goto.py
Created September 18, 2017 07:47
python goto with system trace function
import sys
def j(lineno):
frame = sys._getframe().f_back
called_from = frame
def hook(frame, event, arg):
if event == 'line' and frame == called_from:
try:
frame.f_lineno = lineno
@ErikAugust
ErikAugust / spectre.c
Last active May 22, 2024 23:07
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
// ==UserScript==
// @name Animal Crossing Twitter Rating
// @description Display the rating of tweets using the Animal Crossing letter rating system
// @version 1
// @grant none
// @include https://twitter.com/*
// ==/UserScript==
// Notes via https://twitter.com/jamchamb_/status/1025977659522789376
@rrika
rrika / test.py
Last active May 8, 2019 11:38
Trying to write a borrow checker
class Expr: pass
class Type: pass
class Stmt: pass
class RefMut(Type):
def __init__(self, lt, ty):
self.lt = lt
self.ty = ty
def __repr__(self):
return "&'{} {!r}".format(self.lt, self.ty)