Skip to content

Instantly share code, notes, and snippets.

@Hiromi-nee
Hiromi-nee / XNU syscalls
Created April 20, 2012 08:05
XNU Syscall location
xnu_quick_test -- performs some tests on xnu
http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/tools/tests/xnu_quick_test/README
XNU Mach syscalls
http://www.opensource.apple.com/source/xnu/xnu-1699.24.23/osfmk/kern/syscall_sw.c
http://www.opensource.apple.com/source/xnu/xnu-1699.24.23/osfmk/kern/syscall_emulation.c
http://www.opensource.apple.com/source/xnu/xnu-1699.24.23/osfmk/kern/syscall_subr.c
XNU BSD syscalls
http://www.opensource.apple.com/source/xnu/xnu-1699.24.23/bsd/kern/syscalls.master
@Hiromi-nee
Hiromi-nee / solve.py
Created November 3, 2014 10:29
tkbctf4 monochrome_bar
#! /usr/bin/python2
from sys import argv
from PIL import Image
im = Image.open(argv[1])
imageW = im.size[0]
imageH = im.size[1]
pixels = im.load()
@Hiromi-nee
Hiromi-nee / Accounts.java
Last active August 29, 2015 14:09
[QIWICTF2014 - MISC100] Stolen prototype - Accounts.java Excerpt
private String d;
private String a()
{
StringBuilder stringbuilder;
DefaultHttpClient defaulthttpclient;
UsernamePasswordCredentials usernamepasswordcredentials;
HttpGet httpget;
Character character = Character.valueOf('n'); //note this
String s = d.substring(0, 1); //note this
@Hiromi-nee
Hiromi-nee / and100.py
Created November 14, 2014 15:28
QIWICTF2014 MISC100 solver
import requests
r = requests.post('https://qiwictf2014.ru:40443', auth=('xxx','nshvtyfnjh'))
print r.status_code
print r.headers
print r.text
print r.json()
import requests
def download_file_from_google_drive(id, destination):
def get_confirm_token(response):
for key, value in response.cookies.items():
if key.startswith('download_warning'):
return value
return None
import requests
def download_file_from_google_drive(id, destination):
URL = "https://docs.google.com/uc?export=download"
session = requests.Session()
response = session.get(URL, params = { 'id' : id }, stream = True)
token = get_confirm_token(response)
@Hiromi-nee
Hiromi-nee / aug.py
Created June 22, 2018 03:47
[Intel AI DevCamp] image aug
#%%bash
#echo "Start resizing to 227x227"
#parallel -j 200 convert {} -resize 227x227 -filter spline -unsharp 0x6+0.5+0 -background black -gravity center -extent 227x227 {} ::: *.jpg
#echo "Resizing done"
#mkdir flop
#echo "Start augmentation 1"
#parallel -j 200 convert {} -flop flop/{.}-flop.jpg ::: *.jpg
#echo "Finish augmetation 1"
# This assumes your model is ready to be called with .predict()
sess = keras.get_session()
graph = sess.graph
graph_dev = graph.as_graph_def()
frozen_graph = tf.graph_util.convert_variables_to_constants(
sess, graph_def, nodes_to_output)
encoded_frozen_graph = frozen_graph.SerializeToString()
@Hiromi-nee
Hiromi-nee / colab code
Last active October 23, 2018 01:30
google colab snippets
# Mount google drive
# https://colab.research.google.com/notebooks/io.ipynb#scrollTo=RWSJpsyKqHjH
from google.colab import drive
drive.mount('/content/gdrive')
@Hiromi-nee
Hiromi-nee / key.md
Created February 28, 2019 01:17
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA