Skip to content

Instantly share code, notes, and snippets.

@gkbrk
gkbrk / dict_server.rs
Created August 25, 2015 19:01
Dictionary server in Rust.
use std::io::prelude::*;
use std::net::{TcpListener, TcpStream};
use std::io::BufReader;
use std::thread;
use std::fs::File;
fn get_definitions(word: String) -> Vec<String>{
let mut dict = File::open("dict.txt").unwrap();
let mut reader = BufReader::new(dict);
let mut matches: Vec<String> = Vec::new();
@gkbrk
gkbrk / list.json
Created February 23, 2015 20:25
DontBeLazy Block List
[
"http://9gag.com",
"https://www.facebook.com",
"http://www.facebook.com",
"https://www.reddit.com",
"http://www.reddit.com"
]
@gkbrk
gkbrk / AsteroidsGame.cpp
Last active August 29, 2015 14:25
C++ Game
#include <vector>
#include <iostream>
#include <SDL2/SDL.h>
#include "GameState.h"
class AsteroidsGame: public GameState{
public:
void Draw(){
@gkbrk
gkbrk / terminalplayer.c
Created February 28, 2016 21:54
Terminal radio player
#include <ncurses.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
typedef struct station {
char name[256];
char url[256];
} station;
@gkbrk
gkbrk / series.pl
Created April 11, 2016 20:03
Serie tracker
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Tiny;
sub http_get {
my $http = HTTP::Tiny->new;
return $http->get($_[0])->{content};
}
@gkbrk
gkbrk / referrerparse.go
Created August 17, 2016 12:22
Referer log parser
package main
import(
"bufio"
"fmt"
"os"
"log"
"strings"
"net/url"
)
[package]
name = "urlshortener"
version = "0.1.0"
authors = ["Gökberk Yaltıraklı <webdosusb@gmail.com>"]
[dependencies]
nickel = "*"
hyper = "*"
rand = "0.3.11"
@gkbrk
gkbrk / scanner.py
Created March 10, 2015 21:11
Simple port scanner in Python.
import socket
import sys
import threading
import queue
import time
common_ports = {
"21": "FTP",
"22": "SSH",
"23": "Telnet",
@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 / gklang.py
Created April 10, 2015 21:34
Language
import io
import string
import sys
class gkexpr(list):
def a(self):
pass
def lex(stream):
while True: