腾讯云轻量服务流量超出限制自动关机

Overview

LightHouse_Automatic_Shutdown

腾讯云轻量服务流量超出限制自动关机

使用方法

2021年03月30日更新

新增GitHub Action 实用性大大提升

只需要添加Secrets即可使用,添加方法

先fork本项目至自己的GitHub账号

项目 Setting--Secrets--New repository secert

SecretId #腾讯云api密钥ID 

SecretKey #腾讯云api密钥key 

region #轻量服务器所在地域

tgBotUrl #TG酱url

tgToken #TG酱token

获取地址

SecretId、SecretKey :https://console.cloud.tencent.com/cam/capi

region:官方文档

tgBotUrl:为tg酱网址,可以考虑自建或者使用现成的TG酱 tg_token: 可以向TG酱发送/mytoken 获取

默认设置为流量达到95%自动关机,并向用户发出TG通知,可在LH.py文件中修改 percent 参数,数值0-1之间

默认每小时运行一次 想要修改频率可以修改 .github/workflows/LH.yml中schedule的cron参数,具体使用方法可以前往 crontab使用方法查看

服务器运行

安装腾讯云Python SDK 3.0

pip3 install tencentcloud-sdk-python #python3

参数

    SecretId=""
    SecretKey=""
    region=""
    percent= 0.95
    tgBotUrl="https://dianbao.vercel.app/send/"
    tgToken=""

SecretId,SecretKey 请前往腾讯云访问管理控制台获取:https://console.cloud.tencent.com/cam/capi

region 为服务器所在地域具体参照下表

华北地区(北京) ap-beijing
西南地区(成都) ap-chengdu
华南地区(广州) ap-guangzhou
港澳台地区(中国香港) ap-hongkong
华东地区(南京) ap-nanjing
华东地区(上海) ap-shanghai
亚太东南(新加坡) ap-singapore
亚太东北(东京) ap-tokyo
欧洲地区(莫斯科) eu-moscow
美国西部(硅谷) na-siliconvalley

官方文档

percent为 套餐内已使用流量占比 默认设置为 0.95,超出后自动关机 tgBotUrl 为tg酱网址,可以考虑自建或者使用现成的TG酱 默认使用TG酱网址 tg_token 可以向TG酱发送/mytoken 获取

建议搭配crontab使用

如设置每个小时15分运行一次程序

crontab -e
15 * * * * /usr/bin/python3 /root/LightHouse_Automatic_Shutdown/LH.py >> /root/LightHouse_Automatic_Shutdown/LH.log 2>&1

输出

TG酱

更多功能

  • GitHub Actions版
  • 腾讯云函数版
  • server酱推送
  • TG推送

博客地址:https://2demo.top/222.html

Standard implementations of FedLab and its provided benchmarks.

FedLab-benchmarks This repo contains standard implementations of FedLab and its provided benchmarks. Currently, following algorithms or benchrmarks ar

SMILELab-FL 104 Dec 05, 2022
✨ Un bot Twitter totalement fait en Python par moi, et en français.

Twitter Bot ❗ Un bot Twitter totalement fait en Python par moi, et en français. Il faut remplacer auth = tweepy.OAuthHandler(consumer_key, consumer_se

MrGabin 3 Jun 06, 2021
A pythonic dependency injection library.

Pinject Pinject is a dependency injection library for python. The primary goal of Pinject is to help you assemble objects into graphs in an easy, main

Google 1.3k Dec 30, 2022
Helpful functions for use alongside the rich Python library.

🔧 Rich Tools A python package with helpful functions for use alongside with the rich python library. 󠀠󠀠 The current features are: Convert a Pandas

Avi Perl 14 Oct 14, 2022
Parse URLs for DOIs, PubMed identifiers, PMC identifiers, arXiv identifiers, etc.

citation-url Parse URLs for DOIs, PubMed identifiers, PMC identifiers, arXiv identifiers, etc. This module has a single parse() function that takes in

Charles Tapley Hoyt 2 Feb 12, 2022
ULID implementation for Python

What is this? This is a port of the original JavaScript ULID implementation to Python. A ULID is a universally unique lexicographically sortable ident

Martin Domke 158 Jan 04, 2023
Find unused resource keys in properties files in a Salesforce Commerce Cloud project and get rid of them.

Find Unused Resource Keys Find unused resource keys in properties files in a Salesforce Commerce Cloud project and get rid of them. It looks through a

Noël 5 Jan 08, 2022
A simple package for handling variables in string.

A simple package for handling string variables. Welcome! This is a simple package for handling variables in string, You can add or remove variables wi

1 Dec 31, 2021
More routines for operating on iterables, beyond itertools

More Itertools Python's itertools library is a gem - you can compose elegant solutions for a variety of problems with the functions it provides. In mo

2.9k Jan 06, 2023
Software to help automate collecting crowdsourced annotations using Mechanical Turk.

Video Crowdsourcing Software to help automate collecting crowdsourced annotations using Mechanical Turk. The goal of this project is to enable crowdso

Mike Peven 1 Oct 25, 2021
Modeling Category-Selective Cortical Regions with Topographic Variational Autoencoders

Modeling Category-Selective Cortical Regions with Topographic Variational Autoencoders Getting Started Install requirements with Anaconda: conda env c

T. Andy Keller 4 Aug 22, 2022
A script to parse and display buy_tag and sell_reason for freqtrade backtesting trades

freqtrade-buyreasons A script to parse and display buy_tag and sell_reason for freqtrade backtesting trades Usage Copy the buy_reasons.py script into

Robert Davey 31 Jan 01, 2023
Search, generate & deliver Msfvenom payloads in an quick and easy way

Goal Search, generate & deliver payloads in an quick and easy way Be as simple as possible BUT with all msfvenom payloads. Ever lost time searching th

2 Mar 03, 2022
Kanye West Lyrics Generator

aikanye Kanye West Lyrics Generator Python script for generating Kanye West lyrics Put kanye.txt in the same folder as the python script and run "pyth

4 Jan 21, 2022
A simple gpsd client and python library.

gpsdclient A small and simple gpsd client and library Installation Needs Python 3 (no other dependencies). If you want to use the library, use pip: pi

Thomas Feldmann 33 Nov 24, 2022
A quick random name generator

Random Profile Generator USAGE & CREDITS Any public or priavte demonstrative usage of this project is strictly prohibited, UNLESS WhineyMonkey10 (http

2 May 05, 2022
Skywater 130nm Klayout Device Generators PDK

Skywaters 130nm Technology for KLayout Device Generators Mabrains is excited to share with you our Device Generator Library for Skywater 130nm PDK. It

Mabrains 18 Dec 14, 2022
python-codicefiscale: a tiny library for encode/decode Italian fiscal code - codifica/decodifica del Codice Fiscale.

python-codicefiscale python-codicefiscale is a tiny library for encode/decode Italian fiscal code - codifica/decodifica del Codice Fiscale. Features T

Fabio Caccamo 53 Dec 14, 2022
✨ Un DNS Resolver totalement fait en Python par moi, et en français

DNS Resolver ❗ Un DNS Resolver totalement fait en Python par moi, et en français. 🔮 Grâce a une adresse (url) vous pourrez avoir l'ip ainsi que le DN

MrGabin 3 Jun 06, 2021
Find version automatically based on git tags and commit messages.

GIT-CONVENTIONAL-VERSION Find version automatically based on git tags and commit messages. The tool is very specific in its function, so it is very fl

0 Nov 07, 2021