Skip to content

Instantly share code, notes, and snippets.

View ilkermanap's full-sized avatar

Ilker Manap ilkermanap

  • Stockholm / Sweden
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ilkermanap on github.
  • I am ilkermanap (https://keybase.io/ilkermanap) on keybase.
  • I have a public key whose fingerprint is 6787 DA07 035B 1331 0B96 5697 16AD C19D DABA A346

To claim this, I am signing this object:

@ilkermanap
ilkermanap / twolineheaders.py
Last active November 18, 2016 10:27
for parsing headers with two lines.. I need this when parsing the output of iozone tests..
def split_with_location(line, separator=None):
temp = {}
t = line.strip()
finished = False
loc = 0
while len(t) > 0:
if separator is not None:
word = t.split(separator)[0]
else:
@ilkermanap
ilkermanap / download.py
Created December 13, 2016 12:05
Parcali dosya cekimi / Downloading files in chunks.
class Durum:
def __init__(self, app = QtGui.QApplication, widget=None):
self.app = app
self.widget = widget
def guncelle(self, mesaj):
if type(self.widget) is QtGui.QListWidget:
self.widget.addItem(mesaj)
if type(self.widget) is QtGui.QLabel:
self.widget.setText(mesaj)
@ilkermanap
ilkermanap / real_distance.py
Last active January 19, 2019 22:09
Distance between two points with earth curve
def distance(lt1,ln1, lt2,ln2, in_meters = True):
"""
distance between two coordinates in meters
or in
"""
R = 6371000 # earth radius
theta1 = lt1 * PI / 180
theta2 = lt2 * PI / 180
delta_theta = (lt2 -lt1) * PI / 180
delta_fi = (ln2 - ln1) * PI / 180
@ilkermanap
ilkermanap / kontrol.py
Created April 24, 2017 18:14
dns adres kontrolu
from dns.resolver import Resolver
myres = Resolver()
myres.nameservers = ['8.8.8.8', '8.8.4.4']
liste = open("liste.txt", "r").readlines()
for satir in liste:
adr, ipadr = satir.split()
ans = myres.query(adr, 'A')
print adr, ipadr
@ilkermanap
ilkermanap / hash_finder.py
Last active December 6, 2017 13:36
Class for finding hashes without reading the whole file at once
import os
import platform
import hashlib
sistem = platform.system().lower()
if sistem == "linux" or sistem == "linux2" or sistem == "darwin":
SLASH = "/"
elif sistem == "windows":
SLASH = "\\"
@ilkermanap
ilkermanap / tavla.py
Last active September 13, 2017 20:47
istek uzerine..
import random
import sys
class Pul:
def __init__(self, renk, sayi):
self.renk = renk
self.sayi = sayi
class Sepet:
def __init__(self, kapasite = 360):
@ilkermanap
ilkermanap / excel_modify.py
Last active December 14, 2017 09:21
excel file manipulation using openpyxl, simple example / openpyxl ile excel dosya duzenleme basit ornek
from openpyxl import load_workbook
# Kaynak dosyayi oku
dosya = load_workbook('deneme.xlsx')
# icindeki tablo isimlerini yazdir
print(dosya.get_sheet_names())
# ben bos dosya kullandim. icinde Sheet1 vardi
# sayfa degiskeni, artik Sheet1
@ilkermanap
ilkermanap / mayin.py
Last active November 20, 2017 22:46
Mayin tarlasi icin giris / a very simple minesweeper game
from random import randint
class Mayin:
def __init__(self, x,y):
self.x = x
self.y = y
class Tarla:
def __init__(self, x, y, mayin_sayisi):
self.x = x