Skip to content

Instantly share code, notes, and snippets.

[Service]
Type=simple
NonBlocking=true
ExecStart=/usr/bin/firewall-log.sh
@halit
halit / elf.c
Created February 16, 2015 20:57
Toy elf reader
#include <stdio.h>
#include <stdlib.h>
#include "elf.h"
void print_identifer(unsigned char e_ident[EI_NIDENT]){
printf("%-20s %x | %c%c%c\n", "Magic Header:", e_ident[EI_MAG0], e_ident[EI_MAG1], e_ident[EI_MAG2], e_ident[EI_MAG3]);
if(e_ident[EI_CLASS] == ELFCLASSNONE){
printf("%-20s %s", "Class type:", "Gecersiz sinif.");
}else if(e_ident[EI_CLASS] == ELFCLASS32){
@halit
halit / elf.h
Created February 16, 2015 20:57
Toy elf header file
#ifndef __ELF_H__
#define __ELF_H__
#include <stdint.h>
typedef uint16_t Elf32_Half;
typedef uint32_t Elf32_Off;
typedef uint32_t Elf32_Addr;
typedef uint32_t Elf32_Word;
typedef int32_t Elf32_Sword;
@halit
halit / ortalamayibilenvarmi.py
Last active August 29, 2015 14:13
Feed the troll!
#--coding:utf-8--
import requests
import json
import colorama
import sys
DETECT_WORDS = (u"açıklandı", u"aciklandi", u"açiklandi", u"açiklandı", u"sistemde", u"sistem de")
COMMENT = u"Ortalamayi bilen var mi?"
@halit
halit / numbers.py
Created December 7, 2014 20:08
# SECCON 2014 : Choose the number
#!/usr/bin/python
import socket
p = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
p.connect(("number.quals.seccon.jp", 31337))
while True:
result = p.recv(2048)
if "?" not in result:
@halit
halit / obfscv.py
Created August 25, 2014 18:44
My obfuscated cv
############################-*- coding: rot13 -*-\
vzcbeg FgevatVB;_=FgevatVB.FgevatVB();_.jevgr(".f\
f\a61c\a'zbp.avxrgcyngvynu@bsav'F\a51c\a'yvnzr'Ff\
\a41c\a'zbp.avxrgcyngvynu.jjj//:cggu'F\a31c\a'orj\
'F\a21cq(\a11c\a'gpngabp'Fff\a01c\a'gvynu'F\a9c\a\
'rzna'Ff\a8c\a'avxrgcyn'F\a7c\a'rznaehf'Ff\a6c\a'\
12'F\a5c\a'rtn'Ff\a4c\a'lrxehg'F\a3c\a'zbes'F\a2c\
q(\a1c\a'ynabferc'F\a0cq(");vzcbeg ccevag,cvpxyr;\
__= cvpxyr.ybnqf(_.trginyhr()[::-1].ercynpr(' ','\
'));[ccevag.ccevag({____:__[____]}) sbe ____ va \
@halit
halit / quicksort.c
Created May 31, 2014 17:15
Simple implementation of quick sort
void quicksort(int* a, int n){
int i, last;
if(n <= 1) return;
swap(a, 0, rand()%n);
last = 0;
for(i=1;i<n;i++) if(a[i] < a[0]) swap(a, ++last, i);
swap(a, 0, last);
quicksort(a, last);
quicksort(a+last+1, n-last-1);
}
@halit
halit / guakeremover.sh
Created May 5, 2014 18:45
If you take the error when re-install guake, you can use this code
sudo rm -rf {/usr/share/applications/guake-prefs.desktop,/usr/share/applications/guake.desktop,/usr/share/dbus-1/services/org.guake.Guake.service,/usr/share/gconf/schemas/guake.schemas,/usr/share/icons/hicolor/16x16/apps/guake-prefs.png,/usr/share/icons/hicolor/16x16/apps/guake.png,/usr/share/icons/hicolor/22x22/apps/guake-prefs.png,/usr/share/icons/hicolor/22x22/apps/guake.png,/usr/share/icons/hicolor/24x24/apps/guake-prefs.png,/usr/share/icons/hicolor/24x24/apps/guake.png,/usr/share/icons/hicolor/256x256/apps/guake-prefs.png,/usr/share/icons/hicolor/256x256/apps/guake.png,/usr/share/icons/hicolor/32x32/apps/guake-prefs.png,/usr/share/icons/hicolor/32x32/apps/guake.png,/usr/share/icons/hicolor/48x48/apps/guake-prefs.png,/usr/share/icons/hicolor/48x48/apps/guake.png,/usr/share/locale/de/LC_MESSAGES/guake.mo,/usr/share/locale/el/LC_MESSAGES/guake.mo,/usr/share/locale/es/LC_MESSAGES/guake.mo,/usr/share/locale/fa/LC_MESSAGES/guake.mo,/usr/share/locale/fr/LC_MESSAGES/guake.mo,/usr/share/locale/hu/LC_MESSAGES/guak
@halit
halit / graphi.c
Created April 16, 2014 17:19
toy coordinate system
// =====================================================================================
//
// Filename: graphic.c
//
// Description:
//
// Version: 1.0
// Created: 04/16/2014 07:30:08 PM
// Revision: none
// Compiler: gcc
@halit
halit / xorlinkedlist.c
Created April 13, 2014 19:12
xored linked list
// =====================================================================================
//
// Filename: xorlinked.c
//
// Description:
//
// Version: 1.0
// Created: 04/13/2014 09:51:25 PM
// Revision: none
// Compiler: gcc