Skip to content

Instantly share code, notes, and snippets.

詩月カオリ - [Chasse #01] Chasse
詩月カオリ - [Chasse #02] Change Of Heart
KOTOKO - [daily-daily Dream #01] daily-daily Dream
川田まみ - [Get my way! #02] 青空と太陽
桂ヒナギク starring 伊藤静 - [HiNA #01] Steppin'
桂ヒナギク starring 伊藤静 - [HiNA #02] Power of Flower
桂ヒナギク starring 伊藤静 - [HiNA #05] 100点満点なんかじゃない!
ELISA - [Wonder Wind #01] Wonder Wind
三千院ナギ&綾崎ハヤテ starring 釘宮理恵&白石涼子 - [カラコイ~だから少女は恋をする~ #01] カラコイ~だから少女は恋をする~
三千院ナギ starring 釘宮理恵 - [ハヤテのごとく! キャラクターCD ~カバーズ~ selected by Kenjiro Hata #01] 虹色のSneaker
class QueuedRequest:
def __init__(self):
self.http_client = tornado.web.AsyncHTTPClient()
self.request_queue = Queue()
self.cb = tornado.ioloop.IOLoop.PeriodicCallback(
consume_request,
8 * 60 * 1000,
)
self.cb.start()
@Tydus
Tydus / gist:7962154
Last active December 31, 2015 08:39
ProtoShares Balances as at 32000 1
Piev8TMX2fT5mFtgxx2TXJaqXP37weMPuD 40000
PgsuLoe9ojRKFGJGVpqqk37gAqNJ4ozboD 36003
PvCGhufumKbzmv8BHAG5SeXVRwUW3etVPd 30000
PgBqNfhXY6DAWRFKiao3E5ADsnYiQ83wGt 10999
PmrBYp4PzMYaixdaxQeQLEdXXtCVJsb7HQ 9996.93
PeTDLjj1mvH8dHNDrbpf2JegGhHetMdHqH 9823.26
PvfQUa2kRLKirTFaufseULNYZBZTJbw3QE 9285.14
PhZyybKdAWaLQAvtiGCfoGegNStpjN6URF 8542.93
PqZxGA2dS84zuSVAnTp6Gznhk7LX9ksCXD 8336.02
Pcr9yRyr2WvqZTWTERzmrTNMEQnWJY2pco 7516.25
@Tydus
Tydus / howto-root.md
Last active August 29, 2015 14:00
How to root nexus 7

How to root Nexus 7

What is Rooting

Android has a "jail" that limits user apps to claim its own user and group (one Linux user for one app). The default '/bin/su' program denies the access from these user apps. Thus we need to replace the default su by some 3rd party ones to get root access from apps(as well as adb). That is 'rooting'.

What is unlock

Many manufacturers don't like user to change their system (/, /system, etc.), so they employed a technique called 'BootLoader Lock' which will deny any unauthorized changes to the system partitions. Literally, the "Unlock" procedure will nullify the lock (by some means, be it official or exploiting). As we want to replace the 'su', we first need to unlock the machine.

What is recovery

Recovery is a small, in-memory Linux, which is designed for 'emergency' use (e.g. the main Android system broke down and cannot boot up). Many developers try to make use of the Recovery system, mainly for flashing custom roms, backing up and debugging. Therefore, we ne

@Tydus
Tydus / howto-standalone-toolchain.md
Last active May 4, 2023 13:43
How to install Standalone toolchain for Android

HOWTO Cross compiling on Android

5W1H

What is NDK

NDK (Native Develop Toolkit) is a toolchain from Android official, originally for users who writes native C/C++ code as JNI library. It's not designed for compiling standalone programs (./a.out) and not compatible with automake/cmake etc.

What is Standalone Toolchain

"Standalone" refers to two meanings:

  1. The program is standalone (has nothing connect to NDK, and don't need helper scripts to run it)
  2. The toolchain is made for building standalone programs and libs, and which can used by automake etc.

(Optional) Why NDK is hard to use

By default, NDK uses android flavor directory structure when it's finding headers and libs, which is different from GNU flavor, so the compiler cannot find them. For Example:

@Tydus
Tydus / labyrinth_bind.js
Last active April 21, 2021 14:58
fiddler script for labyrinth bind
import System;
import System.Windows.Forms;
import Fiddler;
// INTRODUCTION
// This is the FiddlerScript Rules file, which creates some of the menu commands and
// other features of Fiddler. You can edit this file to modify or add new commands.
//
// The original version of this file is named SampleRules.js and it is in the
// \Program Files\Fiddler\ folder. When Fiddler first starts, it creates a copy named
@Tydus
Tydus / go
Last active August 29, 2015 14:11
go.py
#!/usr/bin/python2
import sys
import json
import urllib2
import lxml.html
def fetch(url):
ua = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:33.0) Gecko/20100101 Firefox/33.0.2"
return urllib2.urlopen(urllib2.Request(
@Tydus
Tydus / waifu2x.py
Last active May 30, 2022 07:16
waifu2x in 15 lines of Python by @marcan42
import json, sys, numpy as np
from scipy import misc, signal
from PIL import Image
infile, outfile, modelpath = sys.argv[1:]
model = json.load(open(modelpath))
im = Image.open(infile).convert("YCbCr")
im = misc.fromimage(im.resize((2*im.size[0], 2*im.size[1]), resample=Image.NEAREST)).astype("float32")
planes = [np.pad(im[:,:,0], len(model), "edge") / 255.0]
for step in model:
o_planes = [sum([signal.convolve2d(ip, np.float32(kernel), "valid")
@Tydus
Tydus / mnist.py
Last active November 4, 2016 15:38
mnist.py
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
import tensorflow as tf
sess = tf.InteractiveSession()
weight_variable = lambda shape: tf.Variable(tf.truncated_normal(shape, stddev=0.1))
bias_variable = lambda shape: tf.Variable(tf.constant(0.1, shape=shape))
conv2d = lambda x, W: tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
@Tydus
Tydus / config_vwifi.sh
Created December 7, 2016 14:38
config virtual wi-fi APs
#!/bin/sh
#=======================================
# config_vwifi.sh
# Config virtual wi-fi (bridge to vlans)
#=======================================
# show which port you have by `robocfg show'
PORT_LIST="0t 1t 2t 3t 4t 8t"