This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
a python script to set a static IPv4 address to a network interface but first checks if its unique | |
by doing an ARP probe. | |
''' | |
from scapy.all import * | |
import socket, fcntl | |
import os | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; a 64-bit ELF file from scratch using FASM that prints a hello world | |
use64 | |
ELFCLASS64 = 0x2 | |
ELFDATA2LSB = 0x1 | |
EV_CURRENT = 0x1 | |
ELF_ABI_SYSV = 0x1 | |
ET_EXEC = 0x2 | |
EM_X86_64 = 0x3e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// high performant concurrent fibonacci numbers generator | |
package main | |
import ( | |
"fmt" | |
"math/big" | |
) | |
func fib() chan string { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bintree | |
import "fmt" | |
type Node[T any] struct { | |
key int | |
value T | |
right *Node[T] | |
left *Node[T] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"log" | |
) | |
const R = 256 | |
type TrieNode[T any] struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// custom channels in go | |
// I learned how go-channels can be implemented in C++ and decided to make it in go haha wtf | |
// I saw this https://st.xorian.net/blog/2012/08/go-style-channel-in-c/ great article | |
package main | |
import ( | |
"log" | |
"sync" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sends fake keyboard events to uinput this example print 'a' to the terminal | |
package main | |
// #cgo CFLAGS: -g -Wall | |
// #include <linux/uinput.h> | |
import "C" | |
import ( | |
"encoding/binary" | |
"io" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
const CharsNum = 256 | |
type TrieNode struct { | |
children [CharsNum] *TrieNode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple example on using win32 api from golang | |
package main | |
import ( | |
"errors" | |
"fmt" | |
"log" | |
"unsafe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"syscall" | |
"time" | |
) |
NewerOlder