Skip to content

Instantly share code, notes, and snippets.

import httpx
import pendulum
import time
# 直播的用户 ID,不是直播间编号,也就是 https://space.bilibili.com/407583712 的地址
bilibili_account_uid = '407583712'
def get_bilibili_live_stats(uid):
# api doc: https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/live/info.md
biliAccInfo = httpx.get('https://api.live.bilibili.com/live_user/v1/Master/info', params={'uid': uid}).json()
@yitong-ovo
yitong-ovo / readme_en.md
Last active September 29, 2021 15:44
add some feature to smokeping web.

SmokePing Web plugin

image

Add feature:

  • JavaScript reload timer (can be turned off)
  • Detailed content filtering (by slave/keyword)

Install:

Recommend SmokePing 2.8.2, the code is written in this version, I don't know if the old version is applicable.

@yitong-ovo
yitong-ovo / archvm.sh
Last active February 5, 2020 10:08 — forked from Phaeilo/archvm.sh
Archlinux VM automated installation script.
#!/bin/bash
# The MIT License (MIT)
#
# Copyright (c) 2015 Philip Huppert
# fork by Yitong
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
@yitong-ovo
yitong-ovo / get_latest_brdc.sh
Last active December 11, 2021 16:47
get latest GPS broadcast ephemeris file (brdc) and uncompress. 获取并解压最新的 brdc 文件。
#!/bin/bash
set -eu
## get Current year
current_year=$(date +%Y)
## get latest version
latest_version=$(wget -qO- "ftp://cddis.gsfc.nasa.gov/gnss/data/daily/$current_year/brdc/" | awk -F'/brdc*/' '/brdc*/{print $2}' | cut -d\" -f1 | grep -v '\index.html' | tail -1)
## download

原文链接: My First 5 Minutes On A Server; Or, Essential Security for Linux Servers

新建服务器的后五分钟

保证一个服务器的安全可以很简单。我的安全理念能够在保持高效率的同时让你免遭最常见的攻击,我相信你也会这么做。

任何经验丰富的系统管理器都会告诉你,随着人员的增长和服务器的增加,用户管理不可避免的会成为一个负担,在快速增长的环境中保证安全的访问是艰难的,你会遇到例如:过期密码,废弃的测试账户等等问题。恕我直言,即使有账户同步工具来帮助减轻这种痛苦,这种方法既浪费时间也对安全不利,保持简单才是安全的核心。

@yitong-ovo
yitong-ovo / moto_xt1085_install_cm141.md
Last active June 18, 2020 17:37
给国行的 Moto X 2014 (XT1085) 刷入 CM 14.1

给国行的 Moto X 2014 (XT1085) 刷入 CM 14.1。

Update: 也可以参考 https://medium.com/@clarkzjw/moto-x-2014-xt1085%E5%88%B7cm%E6%8C%87%E5%8D%97-db8886256ba7

先说下电信的问题,这样刷了(貌似,没有测试)会导致电信网络不可用。 机器需要解锁哈,没解锁的搜下就有方法。

分区问题

国行的 MotoX 和其他地区的分区方案不同,导致国行的设备直接刷了 twrp 再去刷 CM 会报错,Mokee 能用的原因是他们修改了 rom 的分区格式才得以兼容。

@yitong-ovo
yitong-ovo / danci.js
Last active November 2, 2016 13:02
读写文件的分词
var fs = require('fs'); //引入模块
var filename = 'danci.txt'; //指定文件名
var dancilist = ""+fs.readFileSync(filename); //同步方式读取
var list = dancilist.split("\n"); //按照换行方式拆分,存入 list 数组
var exp1 = '['; // 过滤关键字1
var exp2 = ']'; // 过滤关键字2
var exp3 = ' '; // 过滤关键字3