Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
正在追求

Tater Li nickfox-taterli

😀
正在追求
View GitHub Profile
@nickfox-taterli
nickfox-taterli / adc.c
Created Jul 3, 2020
i.MX RT ADC 例子
View adc.c
/* Kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "timers.h"
#include "semphr.h"
/* Freescale includes. */
#include "fsl_device_registers.h"
#include "board.h"
@nickfox-taterli
nickfox-taterli / imxrt_lpuart.c
Created Jun 28, 2020
IMX RT LPUART 中断+FIFO
View imxrt_lpuart.c
#include "board.h"
#include "fsl_lpuart.h"
#include "pin_mux.h"
#include "clock_config.h"
uint8_t txData[] = "Hello,World!";
uint8_t rxData[512];
typedef struct
@nickfox-taterli
nickfox-taterli / cf_speed.py
Created Jun 22, 2020
用下载方法查找CF最快下载速度的IP
View cf_speed.py
import requests
import threadpool
from datetime import datetime
g_cnt = 0
def requests_test(ip):
global g_cnt
g_cnt = g_cnt + 1
g_cnt_str = '[' + str(g_cnt) + ']'
View Dockerfile.shadowsocks-libev
FROM alpine
MAINTAINER TaterLi <admin@lijingquan.net>
RUN set -ex && \
apk add --no-cache udns && \
apk add --no-cache --virtual .build-deps \
git autoconf automake make build-base \
curl libev-dev c-ares-dev libtool linux-headers \
libsodium-dev mbedtls-dev pcre-dev tar udns-dev && \
cd /tmp/ && \
@nickfox-taterli
nickfox-taterli / Dockerfile.selenium
Created Jun 20, 2020
selenium Dockerfile 基础模板
View Dockerfile.selenium
FROM debian:buster
RUN apt update && \
apt upgrade -y && \
apt install --no-install-recommends --no-install-suggests -y wget unzip python3 python3-pip && \
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
dpkg -i google-chrome-stable_current_amd64.deb ; \
apt-get -f -y --no-install-recommends --no-install-suggests install && \
dpkg -i google-chrome-stable_current_amd64.deb && \
rm google-chrome-stable_current_amd64.deb && \
@nickfox-taterli
nickfox-taterli / O365.py
Created Jun 20, 2020
Office 365 教育版注册
View O365.py
import time
from faker import Faker
from selenium import webdriver
f = Faker()
with open("accounts.txt") as fh:
line = fh.readline()
while line:
email = line.strip()
line = fh.readline()
View html_dom_test.py
# 导入 etree类
from lxml import etree
# 作为示例的 html文本
f = open("test.html",encoding='utf-8')
html = f.read()
dom = etree.HTML(html)
for b in range(len(dom.xpath('/html/body/table/tbody/tr/td[2]/text()'))):
View find_cf_ip.py
import requests
import threadpool
from IPy import IP
def IP_Test(ip):
try:
r = requests.get('http://' + ip + '/', timeout=3)
if 'Direct IP access not allowed' in r.text:
print('可用:' + ip, flush=True)
else:
@nickfox-taterli
nickfox-taterli / pt_auto.py
Created Jun 20, 2020
PT自动刷+GD上传
View pt_auto.py
import json
import time
from datetime import datetime
import feedparser
import pymongo
import qbittorrentapi
import requests
# 需求:
@nickfox-taterli
nickfox-taterli / cf_speed.py
Created Jun 20, 2020
从Cloudflare下载速度测试
View cf_speed.py
import io
import csv
import time
import requests
from urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
with open('cf_ips.txt') as fo:
with open('speedtest_result.csv','w')as fc:
You can’t perform that action at this time.