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 / .Renviron
Last active August 29, 2015 14:17
R stuff
R_LIBS_USER="~/R"
@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

PART 1

[STEP 2] Adding a dedicated hadoop system user

check groups

$ compgen -g
@talayhan
talayhan / gist:a3610a8a7bc5e72f1816d50890680229
Created May 15, 2016 16:58 — forked from rygorous/gist:e0f055bfb74e3d5f0af20690759de5a7
A bit of background on compilers exploiting signed overflow
Why do compilers even bother with exploiting undefinedness signed overflow? And what are those
mysterious cases where it helps?
A lot of people (myself included) are against transforms that aggressively exploit undefined behavior, but
I think it's useful to know what compiler writers are accomplishing by this.
TL;DR: C doesn't work very well if int!=register width, but (for backwards compat) int is 32-bit on all
major 64-bit targets, and this causes quite hairy problems for code generation and optimization in some
fairly common cases. The signed overflow UB exploitation is an attempt to work around this.
#!/usr/bin/env bash
# add repository for g++-5
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# add repository for clang-3.7
sudo add-apt-repository -y "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main"
wget --quiet -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
@talayhan
talayhan / gist:d5ac446319e33febb31cff3f51bf32cd
Created January 4, 2018 14:58 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream