Skip to content

Instantly share code, notes, and snippets.


Gokberk Yaltirakli gkbrk

View GitHub Profile
gkbrk / main.c
Last active Jan 15, 2022
Thanos-snap half of your files out of existence
View main.c
#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 / server.c
Created Jun 25, 2021
Chat server using the poll() API
View server.c
#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 /
Created Dec 3, 2019
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"
gkbrk /
Created Aug 1, 2019
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 = ""
WORKER = f"{ROOT}worker.php"
gkbrk / lobsters-mastodon.lisp
Last active Feb 29, 2020
Common lisp Mastodon bot
View lobsters-mastodon.lisp
(ql:quickload :drakma)
(ql:quickload :cl-json)
(ql:quickload :plump)
(ql:quickload :babel)
(ql:quickload :tooter)
(ql:quickload :split-sequence)
(defvar *feed-path* "")
(setf drakma:*drakma-default-external-format* :UTF-8)
gkbrk /
Created Jan 21, 2018
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 /
Last active Apr 18, 2017
Todo.txt to graph
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 / referrerparse.go
Created Aug 17, 2016
Referer log parser
View referrerparse.go
package main
gkbrk / Cargo.toml
Last active Mar 4, 2019
Asynchronous server example in Rust
View Cargo.toml
name = "rust-async-qotd"
version = "0.1.0"
authors = ["Gökberk Yaltıraklı <>"]
tokio = { git = "" }
rand = "0.3"
gkbrk / lolcat.asm
Created Jul 27, 2016
Lolcat clone in x64 assembly
View lolcat.asm
section .data
char_buffer db 0
section .text
global _start
mov r12, 0
call read_char