Skip to content

Instantly share code, notes, and snippets.

View flxxyz's full-sized avatar
🙏
happening

一个不知名の睡觉高手 flxxyz

🙏
happening
View GitHub Profile
@zombie110year
zombie110year / mapnames.toml
Last active June 2, 2025 14:41
Lookup table for Left 4 Dead 2 maps (official and a part of unofficial).
# Unofficial
[[mapnames]]
name_zh = "2019 II:Metal Gear Blart"
name = "2019 II:合金装备"
maps = [
"2019ii_fourth_plaza",
"2019ii_fourth_streets",
"2019ii_blart_battle",
"2019ii_fourth_outside",
"2019ii_fourth_getup",
@chowder
chowder / README.md
Last active September 1, 2025 08:57
Exporting Microsoft Authenticator TOTP secrets

Background

Workplaces may enforce TOTP 2FA to be enabled Office 365 accounts, which require the Microsoft Authenticator app to be installed.

Regular TOTP applications (such as Aegis, Authy, or LastPass) cannot be used as Microsoft uses a proprietary scheme called phonefactor. Furthermore, the application requires Google Services Framework (GSF) to be installed (likely to provide device notifications), and will refuse to work when it is not present on the device.

Forunately, after the registration is complete, the underlying mechanism the app uses to generate TOTP codes is regular otpauth, and its secrets can be exported with a little bit of effort.

Extracting the keys

@LanfordCai
LanfordCai / solsender.js
Last active August 5, 2025 01:30
Solana Batch Transfer
'use strict'
const web3 = require('@solana/web3.js')
const splToken = require('@solana/spl-token')
const bs = require('bs58')
const connection = new web3.Connection(
web3.clusterApiUrl('devnet'),
'confirmed',
)
@nandorojo
nandorojo / private-npm-in-gh-actions.md
Created August 3, 2021 23:52
Use private NPM packages in your GitHub actions

1 NPM_TOKEN

Add an NPM_TOKEN secret on GitHub. Get your secret key from the NPM dashboard.

2 Add a step to your action

- name: Authenticate with private NPM package
  run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
@ChaseIngebritson
ChaseIngebritson / webpToJimp.js
Last active September 17, 2025 12:28
Convert a .webp image to be readable by Jimp
// This is a temporary fix until Jimp implements support for webp
// https://github.com/oliver-moran/jimp/issues/144
// const img = await webpToJimp('https://test.com/img.webp', './tmp')
import fs from 'fs'
import axios from 'axios'
import jimp from 'jimp'
import webp from 'webp-converter'
@plembo
plembo / crontab-perm-denied.md
Last active February 7, 2025 06:16
crontab says fopen: permission denied

When crontab gives fopen: permission denied error

While trying to open my user's crontab on Ubuntu, the system barked back:

$ crontab -l
crontabs/myuser/: fopen: Permission denied

This is due to improper permissions on crontab executable.

@ihipop
ihipop / frp systemd.md
Last active November 5, 2024 02:15
FRP systemd 启动脚本 FRP systemd init config
@ipedrazas
ipedrazas / dump
Created April 22, 2017 04:10
Mongo dump/restore with docker
# Backup DB
docker run \
--rm \
--link running_mongo:mongo \
-v /data/mongo/backup:/backup \
mongo \
bash -c ‘mongodump --out /backup --host $MONGO_PORT_27017_TCP_ADDR’
# Download the dump
scp -r USER@REMOTE:/data/mongo/backup ./backup
@WesleyBlancoYuan
WesleyBlancoYuan / vhdx2vhd.txt
Created September 6, 2016 07:33
Hyper-V .vhdx 格式磁盘镜像转换为VirtualBox可用的.vhd格式
Hyper-V 默认创建 **.vhdx** 格式的虚拟磁盘。
根据SuperUser上的这个问题:
http://superuser.com/questions/723381/how-to-open-vhdx-files-in-virtualbox
尽管第三个答案指出,
> VirtualBox since 4.2 changelog says support added for VHDX "Storage: added readonly support for VHDX images".
但这种格式在VirtualBox中是不支持的,要使用它建立新的镜像,会出现错误。具体信息为:

video subtitle

ffmpeg -i *.mp4 -vf subtitles=*.srt output.mp4

element stream to ts

  • ffmpeg -i audio.aac -i ch2.h264 -acodec copy -vcodec copy -f mpegts out.ts

rtsp 2 rtmp

  • ffmpeg -rtsp_transport tcp -i rtsp://fuck.com/fuck/fuck -c copy -f flv rtmp://shit.com/shit/shit

截图片