Skip to content

Instantly share code, notes, and snippets.

View and2long's full-sized avatar
🏠
Working from home

Lilong Zhang and2long

🏠
Working from home
View GitHub Profile
@and2long
and2long / scrapy_mzitu_detail.py
Created November 25, 2018 11:34
get all the images on the home page of mzitu.
# -*- coding: utf-8 -*-
import os
import time
import re
import scrapy
class DetailSpider(scrapy.Spider):
name = 'detail'
allowed_domains = ['mzitu.com', 'i.meizitu.net']
#!/usr/bin/env python
import os
def uninstall():
os.popen("adb wait-for-device")
print("start uninstall...")
for packages in os.popen("adb shell pm list packages -3").readlines():
packageName = packages.split(":")[-1].splitlines()[0]
os.popen("adb uninstall " + packageName)
@and2long
and2long / youtube-dl.md
Created May 23, 2019 03:44 — forked from ryanlid/youtube-dl.md
youtube-dl 下载设置代理

socks5代理

youtube-dl --proxy socks5://127.0.0.1:1080 https://www.youtube.com/watch?v=6_gLU_OStK0

http代理

youtube-dl --proxy http://127.0.0.1:8118 https://www.youtube.com/watch?v=6_gLU_OStK0
# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, either express or implied. See the License for the specific
"""
Amazon Gift Card
官网网页测试地址:
https://s3.amazonaws.com/AGCOD/htmlSDKv2/htmlSDKv2_NAEUFE/index.html
可对参数进行逐一对照。
官网API文档:
Amazon Gift Card Incentives API:https://developer.amazon.com/zh/docs/incentives-api/incentives-api.html
"""
@and2long
and2long / next_video.py
Last active July 26, 2020 05:01
(安卓)自动滑动视频。
import re, os, sys, time, datetime
class AutoScroll(object):
def __init__(self):
self.devices = []
self.count = 0
def find_devices(self):
data = os.popen("adb devices").readlines()
@and2long
and2long / next_video.sh
Last active July 26, 2020 05:00
(安卓)自动滑动视频。
findDevices() {
string=$(adb devices | egrep ".*device$")
if [ $? -eq 0 ]; then
devices=(${string//device/})
time=$(date "+%Y-%m-%d %H:%M:%S")
echo "$time 检测到${#devices[*]}台设备"
for d in ${devices[@]}; do
echo "$d : $(adb -s $d shell getprop ro.product.model)"
done
return ${#devices[*]}
@and2long
and2long / uninstall_apps.sh
Last active August 19, 2023 01:52
(安卓)一键卸载第三方程序脚本。
string=$(adb devices | egrep ".*device$")
devices=(${string//device/})
echo "检测到${#devices[@]}台设备连接"
for ((i = 0; i < ${#devices[*]}; i++)); do
echo "$(($i + 1)). ${devices[i]} : $(adb -s ${devices[i]} shell getprop ro.product.model)"
done
if [ ${#devices[@]} -gt 0 ]; then
echo "输入要操作的设备编号:"
read num
@and2long
and2long / settings.json
Created July 16, 2020 07:25
yapf格式化配置
{
"python.formatting.provider": "yapf",
"python.formatting.yapfArgs": [
"--style",
"{column_limit: 200}"
],
}
@and2long
and2long / ddb-get-item.py
Last active January 10, 2022 05:00
DDB获取一条数据
import json
import boto3
session = boto3.Session(profile_name="PROFILE NAME")
ddb_client = session.client("dynamodb")
table_name = 'Main-nhdgaeyblfgp3gygkcsjpmxvky-dev'
challenge_id = '0df3b39d-acb6-4fc9-a3cd-eebf29c8b958'
response = ddb_client.get_item(