Skip to content

Instantly share code, notes, and snippets.

View yilmazdurmaz's full-sized avatar
🏠
Working from home

Yılmaz Durmaz yilmazdurmaz

🏠
Working from home
  • Turkey
View GitHub Profile
@yilmazdurmaz
yilmazdurmaz / c99.l
Created February 21, 2023 10:38 — forked from codebrainz/c99.l
C99 Lex/Flex & YACC/Bison Grammars
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
E ([Ee][+-]?{D}+)
P ([Pp][+-]?{D}+)
FS (f|F|l|L)
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U))
%{
#include <stdio.h>
@yilmazdurmaz
yilmazdurmaz / iptables_forward_to_hostname.md
Created November 15, 2022 01:38 — forked from rikka0w0/iptables_forward_to_hostname.md
Add/Update iptable NAT port forward rule based on hostname instead of ip address
#!/bin/bash

HostName=
PortListen=
PortTarget=

IPv4=$(ping -c1 $HostName | grep "bytes of data" | cut -d "(" -f2 | cut -d ")" -f1)
echo $IPv4
// ==UserScript==
// @name BlockAdblock Blocker
// @version 1.0
// @namespace http://tampermonkey.net/
// @description Blocks block-adblock
// @match *://**/*
// @grant none
// @run-at document-start
// ==/UserScript==
@yilmazdurmaz
yilmazdurmaz / servewasm.py
Created May 3, 2022 10:31 — forked from prideout/servewasm.py
Python WASM server
#!/usr/bin/env python3
import http.server
import socketserver
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map.update({
'.wasm': 'application/wasm',
@yilmazdurmaz
yilmazdurmaz / gena.js
Created January 16, 2020 08:10 — forked from livoras/gena.js
Genetic Algorithm in JavaScript
class Gena {
constructor(config) {
this.currentGeneration = 0
this.populations = []
this.fitnesses = []
this.mutateProbability = config.mutateProbability || 0.5 // 0 ~ 1
this.generationsSize = config.generationsSize || 100
this.populationSize = config.populationSize || 100
this.doneFitness = config.doneFitness || 1 // 0 ~ 1
@yilmazdurmaz
yilmazdurmaz / m3u8.md
Created February 15, 2019 10:11 — forked from primaryobjects/m3u8.md
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.