Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View NeverBehave's full-sized avatar
😾
Meowing

Xinhao Luo NeverBehave

😾
Meowing
View GitHub Profile
@NeverBehave
NeverBehave / README.md
Created December 11, 2023 08:32
Cloud-init invalid choice "schema"

If you encounter error like cloud-init devel: error: argument subcommand: invalid choice: 'schema' (choose from 'hotplug-hook', 'net-convert', 'render', 'make-mime')

Simply remove devel your command: it is a command by itself right now.

cloud-init devel schema --config-file user-data -> cloud-init schema --config-file user-data

@NeverBehave
NeverBehave / port-forwarding.py
Last active February 26, 2024 15:39 — forked from WangYihang/port-forwarding.py
Access devices with IPv6 Link-local address --- port forwarding via python socket
#!/usr/bin/env python3
# Tcp Port Forwarding (Reverse Proxy)
#
# For link-local IPv6 address, such as router emergency recovery, etc.
# Workaround for https://stackoverflow.com/questions/45299648/how-to-access-devices-with-ipv6-link-local-address-from-browserlike-ie-firefox
#
# Usage: python3 forward.py --listen-host 127.0.0.1 --listen-port 8443 --connect-host 'fe80::abcd:abcd:beef:beef%enp0s0' --connect-port 443
import socket
import threading
@NeverBehave
NeverBehave / canon.ppd
Created December 28, 2021 07:50
mf641c mf641cw PPD file
*PPD-Adobe: "4.3"
*FormatVersion: "4.3"
*FileVersion: "2.3"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PSVersion: "(3010.000) 0"
*LanguageLevel: "3"
*FileSystem: False
*PCFileName: "ippeve.ppd"
*Manufacturer: "CNMF641C"
@NeverBehave
NeverBehave / common.sh
Last active December 3, 2021 05:36
Lenovo IX2 DL
###
# Search for and execute (if found) preimage script.
###
run_preimage_script()
{
preimage_script=/usb_drive/emctools/"$ENV_MODEL"_images/preimage.sh
echo -n "Checking for pre-image script... "
if [ -x $preimage_script ]
@NeverBehave
NeverBehave / transcript.txt
Created April 25, 2021 07:40
http://tingshen.court.gov.cn/live/18743120 ffmpeg抓流然后喂给讯飞听见的转录结果
out2.mp3
说话人1 00:00
好,今天上午审理的案件案号是2020月0192民初24388号案,现在核对当事人原告深圳市腾讯计算机系统有限公司是否在线,那些那些人员姓名、身份、代理权限。
说话人2 00:22
王忠鹏。
说话人3 00:24
广东信达律师事务所律师,代理权限是特别授权。
说话人4 00:29
原告代理人林兰占系公司员工,授权范围是特别授权。
说话人1 00:36
@NeverBehave
NeverBehave / data.json
Last active June 11, 2023 21:01
Twitter Like Data
{
"since_id": [
"1452646580205469702",
"1452616357879549953",
"1452486539603111941",
"1452486283062702084",
"1452485722670174211",
"1452483224425295881",
"1452482755241988102",
"1452480718475431938",
#!/usr/bin/env bash
set -e
# Purpose: Update Server certificates
# find certificates that might need an update
# cd / && find . -name "*.pem"
declare -a CERT_DIRS
CERT_DIRS=(\ '/usr/syno/etc/certificate/AppPortal/VideoStation/' \ '/usr/syno/etc/certificate/AppPortal/AudioStation/' \ '/usr/syno/etc/certificate/AppPortal/FileStation/' \ '/usr/syno/etc/certificate/AppPortal/DownloadStation/' \ '/usr/local/etc/certificate/DirectoryServer/slapd/' \ '/usr/local/etc/certificate/LogCenter/pkg-LogCenter/' \ '/usr/local/etc/certificate/WebStation/vhost_225bb9ca-d884-44dd-a0f9-83ff557b95d6/' \ '/usr/local/etc/certificate/CloudStation/CloudStationServer/' \ '/usr/syno/etc/certificate/smbftpd/ftpd/' \ '/usr/syno/etc/certificate/system/FQDN/' \ '/usr/syno/etc/certificate/system/default/' )
urlbase='https://cert.example.com/'
filebase='synology'
base="${urlbase}${filebase}"
@NeverBehave
NeverBehave / snippe.js
Created July 27, 2020 05:27
扫描全能王网页版批量下载, 解除文件夹下载限制
const list = [] // 可用于协同检查本地文件列表
const hasChild = (title) => list.includes(title) ? true : list.push(title) && false
const text = (e) => e.parentElement.parentElement.children[1].children[0].children[0].textContent
inn = 0
document.querySelectorAll('.doc_more_opt').forEach((e) => {
setTimeout(() => {
const title = text(e)
if (!hasChild(title)) {
console.log(title)
@NeverBehave
NeverBehave / mergeLine.js
Created June 9, 2020 17:32
[srt] merge line with same time code
const subtitle = require("subtitle")
const fs = require("fs")
const path = require("path")
function merge(parsed) {
let i = 0, currentStart = parsed[i].start, currentEnd = parsed[i].end, text = parsed[i].text, pushed = true
const result = []
i++
for (;i < parsed.length; i++) {
if (currentStart !== parsed[i].start && currentEnd !== parsed[i].end) {
@NeverBehave
NeverBehave / README.md
Last active November 6, 2020 06:43
OWL token 2020 (does not applied for Mainland China)

Assume Anything sent to youtube does not share with Blizzard

then the only xhr to record watching behavior should be:

https://sentinel.majorleaguegaming.com/api/v1/viewers/owl

It have been proved working on my own account; script can be found here: https://runkit.com/neverbehave/5eca0400df5906001a118075