Skip to content

Instantly share code, notes, and snippets.

@east
east / ramdisk.c
Created March 30, 2023 21:47
Simple ramdisk block device kernel module for linux kernel 6
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/time.h>
#include <linux/timer.h>
#include <linux/fs.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <linux/buffer_head.h>
#include <linux/vmalloc.h>
writeFile = open("testdatei2.txt", "w");
with open("testdatei.txt", "r") as ins:
for line in ins:
newLine = "echo " + line;
writeFile.write(newLine);
writeFile.close();
@east
east / plugin.nim
Created July 10, 2015 12:22
plugin system in nim
# A plugin interface might look like this
type PluginInterface = ref object of RootObj
discard # here might be some vars
# virtual methods (not implemented)
# on irc message
method onMsg(this: PluginInterface, msg: string) =
discard
@east
east / interface.nim
Created July 10, 2015 12:11
interfaces in nim
# Interface
type InterfaceType = ref object of RootObj
baseVar: int # optional var
# Virtual method of `InterfaceType`
method doSomething(this: InterfaceType) =
discard # empty method
# Implementation
type ImplementType = ref object of InterfaceType
@east
east / std_srvconnect.log
Created June 22, 2015 07:24
standard client connect
add new client: 127.0.0.1:61281
-> sys msg: Info
<- sys msg: MapChange
<- sys msg: MapData
-> sys msg: Ready
<- gam msg: SvMotd
<- sys msg: ConReady
-> gam msg: ClStartInfo
-> sys msg: RconCmd
<- gam msg: SvVoteClearOptions
test