Skip to content

Instantly share code, notes, and snippets.

@biaocy
biaocy / 420-dlc.md
Last active December 20, 2023 07:14
brc420 DLC 部署
  1. 将DLC所用资源都上链,并在creator一个个设计好420 html上链
  2. 整合DLC里所有420 资源铭文
    • 格式
    <metaversedlc p="brc-420" name="你的DLC名称">
      <element id="DLC里面的420资源铭文id" />
      <element id="DLC里面的420资源铭文id" />
      ...
    </metaversedlc>
@biaocy
biaocy / twitter-font-beauty.js
Created August 22, 2023 13:22
Replace twitter ugly font in Chinese
// ==UserScript==
// @name Twitter font beauty
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Replace twitter ugly font in Chinese!
// @author Bill Chan
// @match https://twitter.com/*
// @icon
// @grant none
// ==/UserScript==

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@biaocy
biaocy / welcome.sh
Last active May 1, 2022 20:09
Generate random welcome message with cowsay and fortune
function welcome() {
local cowfiles=($(cowsay -l | tail -n+2 | tr '\n' ' '))
local last_idx_cowfiles=$(expr ${#cowfiles[@]} - 1 )
local selected_cowfile=${cowfiles[$(shuf -i 0-$last_idx_cowfiles -n1)]}
fortune | cowsay -f $selected_cowfile | lolcat
}
welcome
@biaocy
biaocy / 快速生成随机数.md
Last active December 31, 2020 15:41
快速生成随机数
  • 利用 /dev/urandom 快速生成随机 hexadecimal
hexdump -v -e '4/1 "%02x" "\t" "%02x" "\n"' /dev/urandom
  • 快速生成10000个随机数字
hexdump -v -e '4/1 "%02x""\n"' /dev/urandom | awk '{ print strtonum("0x" $0) }' | head -n 10000
@biaocy
biaocy / naiveproxy.service
Last active December 23, 2020 08:50
Systemd service for naiveproxy
[Unit]
Description=naiveproxy - Make a fortune quietly
Documentation=https://github.com/klzgrad/naiveproxy/blob/master/USAGE.txt
After=network.target nss-lookup.target
Wants=network-online.target
[Service]
# If the version of systemd is 240 or above, then uncommenting Type=exec and commenting out Type=simple
Type=exec
#Type=simple
@biaocy
biaocy / rime-dependencies.sh
Last active December 21, 2020 13:14
Rime build dependencies
sudo apt install libboost-dev libboost-system-dev libboost-filesystem-dev\
libboost-regex-dev libboost-locale-dev libgtest-dev libgoogle-glog-dev\
libibus-1.0-dev libnotify-dev libleveldb-dev libmarisa-dev libopencc-dev\
libyaml-cpp-dev cmake capnproto

知识点

语言

基础
  • 面向对象特性:封装、继承、多态
  • 集合: List、Set、Map
  • 异常:
    • Checked Exception
    • Unchecked Exception: RuntimeException, Error, and their subclasses
@biaocy
biaocy / restore_last_git_modified_time.sh
Last active November 25, 2020 17:43 — forked from HackingGate/restore_last_git_modified_time.sh
Retrieve and set the last modification date of all files in a git repository. Solution for https://stackoverflow.com/a/55609950/4063462
#!/bin/sh -e
OS=${OS:-`uname`}
if [ "$OS" = 'Darwin' ]; then
get_touch_time() {
date -r ${unixtime} +'%Y%m%d%H%M.%S'
}
else
# default Linux
@biaocy
biaocy / v2ray_swtich.sh
Created November 20, 2020 06:06
Switch v2ray configuration
#!/bin/bash
# fail fast
set -e
# Symbolic file
LINK_CONF="config.json"
if [ ! -h "$LINK_CONF" ]
then
echo "'$LINK_CONF' is not a symbolic file or not exist"