Skip to content

Instantly share code, notes, and snippets.

View ahxxm's full-sized avatar
🚘
On The Road

ahxxm ahxxm

🚘
On The Road
View GitHub Profile
@ahxxm
ahxxm / tunnel.yaml
Last active December 25, 2025 05:23
cloudflared + dufs to share files, sends URL to telegram chat
services:
fileserver:
image: sigoden/dufs
command: /srv --allow-search --allow-archive --compress none -p 80
volumes:
# dir to share
- /downloads:/srv:ro
tunnel:
image: alpine:latest
@ahxxm
ahxxm / flash_gen_crc_list.py3
Last active February 18, 2023 13:30
python3 compatible crclist.txt file update script, use after patching boot.img. backup sparsecrc.txt in case failed to flash `super`
#!/usr/bin/env python
# fixes: 2to3 syntax, assertions for int(d1/d2) value
from __future__ import print_function
import getopt, posixpath, signal, struct, sys
import os, copy
import binascii
sparse_file_list = {
"super":"super.img",
"cust":"cust.img",
@ahxxm
ahxxm / 2022-hashcode-one-pizza.ipynb
Last active April 24, 2022 11:54
2022 hashcode practice round one pizza, simply random, 2 5 5 1803 2049
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ahxxm
ahxxm / cloudflare-ddns.go
Last active November 21, 2022 15:07
cloudflare ddns
package main
// env GOOS=linux GOARCH=arm go build -ldflags="-s -w" -v a.go
// upx --best --ultra-brute main
import (
"fmt"
"time"
"github.com/cloudflare/cloudflare-go"
@ahxxm
ahxxm / doubanbook-cralwer.clj
Last active November 21, 2022 13:59
title + <div id="info" /> => local redis
(ns doubanbook-cralwer.core
(:require [clj-http.client :as http]
[clojure.core.async :refer [go-loop chan <! >!! <!!] :as a]
[taoensso.carmine :as car :refer (wcar)])
(:gen-class))
(def ua "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36")
(def redis-opts {:pool {} :spec {:uri "redis://127.0.0.1:6379/0"}})
(defmacro wcar* [& body] `(car/wcar redis-opts ~@body))
(def seen (atom (into #{} (wcar* (car/keys "*")))))
@ahxxm
ahxxm / SimpleHTTPServerWithUpload.py
Created November 14, 2016 12:37 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@ahxxm
ahxxm / tor_vote.py
Created December 9, 2015 09:52
tor_vote.py
import json
import requests
import random
import socket
import socks
import time
from subprocess import call
# Mount Tor proxy into requests
@ahxxm
ahxxm / weibosync.py
Created October 7, 2015 10:11
weibo同步
from weibo import Client
from twitter import *
import json
import re
import requests
import Image
from StringIO import StringIO
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
@ahxxm
ahxxm / ssxy.py
Created October 7, 2015 10:09
世说新语
# ssxy
import random
from twitter import *
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = client.Shishuoxinyu
'''
k = oauth_dance('twitter_username',