Skip to content

Instantly share code, notes, and snippets.

View aliorhun's full-sized avatar
🎯
Focusing

Ali Orhun Akkirman aliorhun

🎯
Focusing
View GitHub Profile
@aliorhun
aliorhun / kuantum_inceyapi.py
Last active December 16, 2015 23:29
Kuantum Mekaniği: Enerji seviyeleri, ince yapı katkılı hesaplama.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Hazırlayan : Ali Orhun Akkirman (ali@alorak.com)
# Lisans : GPL v.3
# Sürüm : 0.73
# Python version : 2.x
from __future__ import division
import math
C
C NUMERICAL MATHEMATICS AND COMPUTING, CHENEY/KINCAID, (c) 1985
C
C FILE: test_random.f
C
C EXAMPLE TO COMPUTE, STORE, AND PRINT RANDOM NUMBERS (RANDOM)
C
DIMENSION X(10)
DATA L/256/
DO 2 I = 1,10
function tb_dos_plot(dim,m,n,d)
%plots the density of states D(e) with a mesh of step size 1/m in e
%using n lattice points and width d in the delta function
for e=1:(dim*m+1)
tb_dos(e)=tb_dos_sum(dim,(e-1)/m,n,d);
end
plot((0:1/m:dim),tb_dos,'.')
grid on
title(sprintf('tight-binding density of states in %dd',dim),'FontSize',18)
ylabel('D(\epsilon)','FontSize',18)
#f(x)
def f(x):
return (x*x - 4);
#x?
def searchroots(a,b):
e = 0.00001
i = 0
m = 0
if (f(a) * f(b)) > 0:
@aliorhun
aliorhun / Doğrusal eşleşik üreteçler
Last active November 6, 2016 18:45
LinearCongruentialGenerators.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
# Doğrusal eşleşik üreteçler
@aliorhun
aliorhun / xwindowslist.py
Last active August 23, 2019 05:24
x windows list
#!/usr/bin/env python
# x window list
# author: ali orhun (ali@orhun.net)
def main(args):
data=idofwindows()
nofw=len(data)
for i in data:
names=nameofid(i)
print(names)
@aliorhun
aliorhun / pythonldaptest.py
Created September 16, 2019 16:39
python ldap
import ldap
l = ldap.initialize("ldap://10.154.25.160")
try:
l.protocol_version = ldap.VERSION3
l.set_option(ldap.OPT_REFERRALS, 0)
l.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
bind = l.simple_bind_s("administrator@winali.lab", "Parola")
@aliorhun
aliorhun / binustuarama.php
Created September 16, 2019 17:53
binustuarama.php
<?php
$adServer = "ldap://10.10.25.160";
$ldap = ldap_connect($adServer);
$username = "administrator@mertwin.lab";
$password = "Paroladeneme01";
$ldaprdn = $username;
@aliorhun
aliorhun / ldapsecurity.php
Last active April 20, 2020 11:11
ldapsecurity.php
<?php
$user = 'administrator@win19ali.lab';
$pass = 'Password123';
$server = '192.168.1.45';
$ldap = ldap_connect($server);
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
@aliorhun
aliorhun / aghizolcum.py
Created November 22, 2019 13:10
aghizolcum.py
import time
def transmissionrate(dev, direction, timestep):
"""Return the transmisson rate of a interface under linux
dev: devicename
direction: rx (received) or tx (sended)
timestep: time to measure in seconds
"""
path = "/sys/class/net/{}/statistics/{}_bytes".format(dev, direction)
f = open(path, "r")