Install the OpenSSL on Debian based systems
sudo apt-get install openssl
/* | |
* weibo intl launch screen ad filter | |
* @author Li Guangming | |
* | |
* add rule: DOMAIN,weibointl.api.weibo.com,DIRECT,script-filter | |
* | |
*/ | |
function scriptFilterExecute(args) { | |
if (args.url.indexOf('get_coopen_ads') > 0) { |
application/pkcs8 .p8 .key | |
application/pkcs10 .p10 .csr | |
application/pkix-cert .cer | |
application/pkix-crl .crl | |
application/pkcs7-mime .p7c | |
application/x-x509-ca-cert .crt .der | |
application/x-x509-user-cert .crt | |
application/x-pkcs7-crl .crl |
import JavaScriptCore | |
extension JSContext { | |
subscript(key: String) -> Any { | |
get { | |
return self.objectForKeyedSubscript(key) | |
} | |
set{ | |
self.setObject(newValue, forKeyedSubscript: key as NSCopying & NSObjectProtocol) | |
} |
1: curl -v -X POST -d 'email=sp3@sspanel.dev&passwd=12345678' http://localhost:8000/api/token
{
"ret": 1,
"msg": "ok",
"data": {
"token": "jG63BhwPKBhBvcB2etJBcfcGQN5hYqQA2QNudTXPHtzs6CNT2dftf9XNWv8ekZ6L",
"user_id": 1
}
}
import Cocoa | |
@objc | |
class SomeTextStorage: NSTextStorage { | |
private var storage: NSMutableAttributedString | |
override init() { | |
storage = NSMutableAttributedString(string: "", attributes: nil) | |
super.init() |
// Similar to defer in Swift | |
#define pspdf_defer_block_name_with_prefix(prefix, suffix) prefix ## suffix | |
#define pspdf_defer_block_name(suffix) pspdf_defer_block_name_with_prefix(pspdf_defer_, suffix) | |
#define pspdf_defer __strong void(^pspdf_defer_block_name(__LINE__))(void) __attribute__((cleanup(pspdf_defer_cleanup_block), unused)) = ^ | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wunused-function" | |
static void pspdf_defer_cleanup_block(__strong void(^*block)(void)) { | |
(*block)(); | |
} | |
#pragma clang diagnostic pop |
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem | |
chmod 700 id_rsa.pem |
#source http://code.activestate.com/recipes/491264/ | |
#edited by Guangming Li | |
import socket | |
class DNSQuery: | |
def __init__(self, data): | |
self.data = data | |
self.dominio = '' |
#!/bin/bash | |
# NOTE: wifi network interface is: en1 | |
wifi_router=192.168.200.1 | |
wifi_address=en1:ec.35.86.4f.00.bc | |
TOADDR=`ifconfig en1 inet | sed -nl 's/\w*inet \([^ ]*\).*/\1/p'` | |
TO=`echo -n ${TOADDR//[[:space:]]}` | |
echo "ADDING ROUTE TO $1 VIA en1 (wi-fi): $TO" | |
route -n add -host $1 $wifi_router -ifp $wifi_address -ifa $TO -static |