Skip to content

Instantly share code, notes, and snippets.

View talayhan's full-sized avatar
💤
Sleeping

Samet Talayhan talayhan

💤
Sleeping
View GitHub Profile
@talayhan
talayhan / os_project_1b.md
Created March 24, 2015 20:16
Operating System Project 1B Turkish Explanation

Pintos Project 1-B

Bu ödevde lottery scheduling algoritmasını implement etmeniz bekleniyor.

Lottery scheduling algoritması söyle çalışır : Sisteme yeni bir thread katıldığında işletim sistemi elindeki biletlerden bir kısmını (en az bir tane en fazla k tane olacak şekilde) yeni gelen thread’e verir. İşletim sistemi thread switch yapacağı zaman dağıttığı biletlerden bir tanesini random olarak seçer ve o bilet hangi threadde ise o threadi çalıştırır.

Bu durumda bir threadin prioritisi o threadde bulunan bilet sayısı ile doğru orantılı olacaktır.

>Bir örnek verecek olursak : Sistemde A , B ve C threadleri bulunsun ve bunların ellerindeki bilet sayıları sırasıyla 5,3 ve 2 olsun. Bu durumda B’nin seçilme ihtimali %30 ‘dur. Sistemde B ve C olsaydı sadece B’nin seçilme ihtimali %60 olacaktı.

@talayhan
talayhan / SaaS_berkeley_ozet.md
Created March 25, 2015 08:54
Engineering SaaS An Agile Approach (04.25.15) - Berkeley Slide Summary

Engineering SaaS An Agile Approach (04.25.15) - Berkeley Slide

Waterfall vs Agile

  • Agile developlemnt da developer her iterasyonda customer feedback ile ürünü geliştirir.
  • Agile süreç hatanın daha az olması için Test-Driven Development'ı önerir.

Spiral

@talayhan
talayhan / alias.sh
Last active August 29, 2015 14:18
How to use and when alias command in Linux.
The alias command allows you to create command shortcuts within your shell. Below shows you how,
move to your home directory,
[root@localhost ~]# cd ~
add the alias
[root@localhost ~]# cat >> .bash_profile
[root@localhost ~]# alias fucking='su -'
@talayhan
talayhan / hw2Mac.r
Last active August 29, 2015 14:19
R
# -------------------------------
# Homework 2 - Machine Learning
# Samet Sait Talayhan
# -------------------------------
# o / \ //\
# o |\___/| / \// \\
# /0 0 \__ / // | \ \
# / / \/_/ // | \ \
# @_^_@'/ \/_ // | \ \
# //_^_/ \/_ // | \ \
@talayhan
talayhan / androidTricks_01.java
Last active August 30, 2017 21:16
Android Thread Tips and Tricks
/* You can run thread as specifically time 1 minute, 1 second, 1 hour etc. Whenever you want. */
ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(5);
scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
// do something here.
sendThread();
}
}, 0, 1, TimeUnit.SECONDS);
@talayhan
talayhan / 0_reuse_code.js
Created December 6, 2015 12:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@talayhan
talayhan / cve_2016_0728.c
Created January 20, 2016 08:05 — forked from PerceptionPointTeam/cve_2016_0728.c
cve_2016_0728 exploit
/* $ gcc cve_2016_0728.c -o cve_2016_0728 -lkeyutils -Wall */
/* $ ./cve_2016_072 PP_KEY */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <keyutils.h>
#include <unistd.h>
#include <time.h>
@talayhan
talayhan / install-gradle-centos.sh
Last active March 22, 2016 19:48 — forked from parzonka/install-gradle-centos.sh
Install gradle on redhat/centos linux
# installs to /opt/gradle
# existing versions are not overwritten/deleted
# seamless upgrades/downgrades
# $GRADLE_HOME points to latest *installed* (not released)
gradle_version=2.12
wget -N https://services.gradle.org/distributions/gradle-${gradle_version}-all.zip
sudo unzip -foq gradle-${gradle_version}-all.zip -d /opt/gradle
sudo ln -sfn gradle-${gradle_version} /opt/gradle/latest
sudo su
printf "export GRADLE_HOME=/opt/gradle/latest\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /etc/profile.d/gradle.sh
#!/bin/sh
apt-get update
apt-get upgrade -y --show-upgraded
apt-get install -y sudo apt-get install libxft-dev libxinerama-dev libpango1.0-dev
wget -c https://github.com/DaveDavenport/rofi/releases/download/0.15.4/rofi-0.15.4.tar.gz
tar -xzvf rofi-0.15.4.tar.gz
cd rofi-0.15.4
@talayhan
talayhan / latency.markdown
Created May 4, 2016 15:27 — forked from prayagupa/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs