Skip to content

Instantly share code, notes, and snippets.

@gkbrk
gkbrk / Program.cs
Created December 26, 2023 08:35
RBU time signal demodulator
// Leo's RBU time signal demodulator (2023-12-25)
// Copyright (C) 2023 Gokberk Yaltirakli (gkbrk.com)
// - https://en.wikipedia.org/wiki/RBU_(radio_station)
// - https://www.sigidwiki.com/wiki/RBU
// Tune to 66.0 kHz
// http://websdr.ewi.utwente.nl:8901/?tune=66.0
// To compile, just `dotnet build -c Release`. To run, `dotnet run -c Release`.
@gkbrk
gkbrk / main.c
Last active January 15, 2022 00:02
Thanos-snap half of your files out of existence
#define _XOPEN_SOURCE 500
#include <assert.h>
#include <dirent.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
@gkbrk
gkbrk / server.c
Created June 25, 2021 22:31
Chat server using the poll() API
#include <arpa/inet.h>
#include <poll.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
@gkbrk
gkbrk / encode-json.py
Created December 3, 2019 03:08
JSON Encoder - unbird example
def check_encode(value):
import json
return json.loads(encode(value)) == value
def encode(value):
if isinstance(value, bool):
if value:
return "true"
else:
@gkbrk
gkbrk / titan-conquest-bot.py
Created August 1, 2019 00:17
Game bot for Titan Conquest
#!/usr/bin/env python3
import requests
import re
from bs4 import BeautifulSoup
UA = "Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0"
USERNAME = "usernameHere"
PASSWORD = "passwordHere"
ROOT = "https://titanconquest.com/"
WORKER = f"{ROOT}worker.php"
@gkbrk
gkbrk / lobsters-mastodon.lisp
Last active January 20, 2023 06:20
Common lisp Mastodon bot
(ql:quickload :drakma)
(ql:quickload :cl-json)
(ql:quickload :plump)
(ql:quickload :babel)
(ql:quickload :tooter)
(ql:quickload :split-sequence)
(defvar *feed-path* "https://lobste.rs/rss")
(setf drakma:*drakma-default-external-format* :UTF-8)
@gkbrk
gkbrk / server.py
Created January 21, 2018 20:36
A SOCKS-over-HTTP tunnel for evading censorship/network filters
#!/usr/bin/env python3
import socket
import threading
import random
import time
class EvadereSocket:
def __init__(self):
self.conn = None
self.last_activity = time.time()
@gkbrk
gkbrk / todograph.py
Last active December 30, 2023 18:11
Todo.txt to graph
#!/usr/bin/python3
import matplotlib.pyplot as plt
import datetime
def get_stats(filename):
data = {}
with open(filename) as todofile:
for line in todofile:
date = line.split()[1]
if date in data:
@gkbrk
gkbrk / referrerparse.go
Created August 17, 2016 12:22
Referer log parser
package main
import(
"bufio"
"fmt"
"os"
"log"
"strings"
"net/url"
)
@gkbrk
gkbrk / Cargo.toml
Last active March 4, 2019 05:37
Asynchronous server example in Rust
[package]
name = "rust-async-qotd"
version = "0.1.0"
authors = ["Gökberk Yaltıraklı <[email protected]>"]
[dependencies]
tokio = { git = "https://github.com/tokio-rs/tokio" }
rand = "0.3"