Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/">
<ClientInitialization>
<UseStartBeforeLogon UserControllable="true">false</UseStartBeforeLogon>
<AutomaticCertSelection UserControllable="true">true</AutomaticCertSelection>
<ShowPreConnectMessage>false</ShowPreConnectMessage>
<CertificateStore>All</CertificateStore>
<CertificateStoreMac>All</CertificateStoreMac>
<CertificateStoreOverride>false</CertificateStoreOverride>
<ProxySettings>Native</ProxySettings>
@Tydus
Tydus / FortuneCookie.js
Last active October 13, 2023 18:33
FortuneCookie.js
Game.Win('Third-party');
if(FortuneCookie === undefined) var FortuneCookie = {};
if(typeof CCSE == 'undefined') Game.LoadMod('https://klattmose.github.io/CookieClicker/' + (0 ? 'Beta/' : '') + 'CCSE.js');
FortuneCookie.name = 'Fortune Cookie';
FortuneCookie.version = '2.17';
FortuneCookie.GameVersion = '2.022';
FortuneCookie.launch = function(){
FortuneCookie.init = function(){
FortuneCookie.isLoaded = 1;
@Tydus
Tydus / CookieMonster.js
Created December 19, 2019 14:16
CookieMonster.js
/**********
* Header *
**********/
CM = {};
CM.Backup = {};
CM.Cache = {};
@Tydus
Tydus / ifrename.sh
Last active October 29, 2017 12:09
Rename ethx and wlanx to persistent names for OpenWrt
#!/bin/sh
# ifrename.sh: rename ethx and wlanx to persistent names
# Dependency: ip ethtool
# See also: https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c
# TODO: currently only support pci-e devices
ip -br l | cut -d' ' -f1 | while read i; do
prefix=$(echo "$i" | cut -c-2)
@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"
@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 / 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 / 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 / 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 / howto-standalone-toolchain.md
Last active January 10, 2025 11:01
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: