Skip to content

Instantly share code, notes, and snippets.

View suryadana's full-sized avatar

I Komang Suryadana suryadana

View GitHub Profile
@suryadana
suryadana / template_systemd.service
Created May 26, 2018 03:55
Run your script with systemd on linux
# Copy to /etc/systemd/system/ this script and change ExecStart value.
After=syslog.target network.target
[Service]
ExecStart=/usr/bin/python /path/of/script/main.py
Restart=on-abort
[Install]
WantedBy=multi-user.target
/*
* cve-2009-1185.c
*
* udev < 141 Local Privilege Escalation Exploit
* Jon Oberheide <[email protected]>
* http://jon.oberheide.org
*
* Information:
*
* http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1185
@suryadana
suryadana / attribute value detect.js
Created May 23, 2018 09:47
Script for detect attribute value you can custome with callback function inside on mutation observer
$(document).ready(function(){
let list = document.querySelectorAll('.card-header');
let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
let observer = new MutationObserver(function(mutations) {
let mutation = mutations[0]
let element = $(mutation.target)
if (element.attr('aria-expanded') === 'true'){
element.removeClass('bg-white').css('background-color', '#f58508')
}else{
element.addClass('bg-white')
#!/bin/sh
# CVE-2016-1531 exim <= 4.84-3 local root exploit
# ===============================================
# you can write files as root or force a perl module to
# load by manipulating the perl environment and running
# exim with the "perl_startup" arguement -ps.
#
# e.g.
# [fantastic@localhost tmp]$ ./cve-2016-1531.sh
# [ CVE-2016-1531 local root exploit
@suryadana
suryadana / decorator_check_func.py
Last active May 17, 2018 08:43
Check function speed Python
from datetime import datetime
def check_func(method):
def wrapper(*args, **kwargs):
t0 = datetime.now()
result = method(*args, **kwargs)
t1 = datetime.now()
print('Run with {:.16f} seccond'.format((t1-t0).total_seconds()))
return result
return wrapper
@suryadana
suryadana / decorator_coroutine_asyncio.py
Last active May 17, 2018 05:19
I have stupid decorator for running your function with coroutine asyncio. Don't expect for the script, because it is script kiddie.
import asyncio
def static_async(method):
def wrapper(*args, **kwargs):
event = asyncio.new_event_loop()
asyncio.set_event_loop(event)
event.run_until_complete(method(*args, **kwargs))
event.close()
return wrapper
@suryadana
suryadana / .tmux.conf
Created May 3, 2018 09:14
My tmux configure
# change key binding from C-b to Emacs style C-x
unbind C-b
set -g prefix C-x
bind C-x send-prefix
# interface
#------------
# pane
#------------
set -g pane-border-fg black

gdb ch14 -batch -ex 'disass main'

from subprocess import Popen, PIPE
from time import sleep
import struct
proc = Popen(['gdb', 'ch16'], bufsize=1, stdin=PIPE)
def sendline(param):
proc.stdin.write(param+'\n')
sleep(2)
@suryadana
suryadana / keybase.md
Last active May 21, 2019 17:14
Profile for keybase

Keybase proof

I hereby claim:

  • I am suryadana on github.
  • I am suryadana (https://keybase.io/suryadana) on keybase.
  • I have a public key whose fingerprint is 9754 A0AD 0D08 B168 04CB EE41 6C3B 53F6 59ED 6BF1

To claim this, I am signing this object: