Skip to content

Instantly share code, notes, and snippets.

@dkw72n
dkw72n / LICENSE
Created August 14, 2014 10:25 — forked from jdp/LICENSE
Copyright (C) 2012 Justin Poliey <justin.d.poliey@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WIT
@dkw72n
dkw72n / xhcatv.py
Last active August 29, 2015 14:08
新会有线视讯宽带拨号脚本
#!/usr/bin/python
#coding: utf8
import socket
import time
gateway = ('10.192.4.29',5018) #change if necessary
conf = {
'mac': 'YOUR-MAC-ADDRESS-IN-UPPER-CASE',
'user': 'your_username',
'psw': 'your_password'
@dkw72n
dkw72n / pyftpd
Created November 13, 2014 06:51
A Temporary FTP Server in Python (Anonymous FULL Access!)
#/usr/bin/python
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
authorizer = DummyAuthorizer()
authorizer.add_anonymous(".", perm="elradfmw")
handler = FTPHandler
handler.authorizer = authorizer
server = FTPServer(("0.0.0.0", 21), handler)
server.serve_forever()
" run this command first:
" git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
{
"version": 1,
"list": [
["com.miui.permcenter.install.AdbInstallActivity", "继续安装", "miui_chinese"],
["com.miui.permcenter.install.AdbInstallActivity", "Install", "miui_english"],
["OppoPackageInstallerActivity", "安装", "oppo_chinese"],
["PackageInstallerActivity", "安装", "huawei_chinese"]
]
}
@dkw72n
dkw72n / event.py
Created June 27, 2017 17:12
python event
import collections, weakref
# combining
# https://stackoverflow.com/questions/7828444/indexable-weak-ordered-set-in-python
# and
# https://stackoverflow.com/questions/1092531/event-system-in-python/1094423#1094423
# make the event handler weakref-ed, so that we dont need to clean up manually.
@dkw72n
dkw72n / fuxkrtx.py
Last active November 28, 2017 10:04
自动关闭 RTX 弹窗
import win32api, win32con, win32gui, win32process, win32com.client
import time
import sys
import traceback
CLOSE_WINDOW_INTERVAL = 0.1
wmi = win32com.client.GetObject('winmgmts:')
def query_process_name_by_id(pid):
@dkw72n
dkw72n / psd
Created March 26, 2016 14:32
an auxiliary android shell script that keeps your Apps "staying" on your SD card after an update
#!/system/bin/sh
# What is this?
# PSD (Pin to the SD card), is an auxiliary script that keeps your Apps "staying" on your SD card.
# "staying" is quoted because what it actually do is moving your app back to the SD card again after an update.
# Why?
# a. Since Android Lollipop, the apps you moved to the SD card will back to internal storage after an update.
# b. My phone has a small internal storage and running Android Lollipop.
# c. I am not going to buy another phone or downgrade to Kitkat.
@dkw72n
dkw72n / hyxd_config_viewer.py
Created May 17, 2018 02:40
hyxd config viewer
import zlib
import cPickle
from pprint import pprint
def encryptString(data):
datalen = len(data)
headlen = min(datalen, 128 - datalen % 41)
tail = str(datalen)
tail = '0' * (8 - len(tail)) + tail
tail = map(lambda x: chr(ord(x) ^ 137), tail)