Skip to content

Instantly share code, notes, and snippets.

View Equim-chan's full-sized avatar

Equim Equim-chan

View GitHub Profile
@Equim-chan
Equim-chan / onekey-bak.sh
Last active February 20, 2017 13:23
Personal script for backup/sync
#!/bin/sh
echo "******************************"
echo "* Equim's onekey-backup tool *"
echo "******************************"
read -p "接下来要对全盘进行物理备份,是否继续? [y\N] "
if [ "$REPLY"x == "yx" ]; then
TODAY=$(date +%y%m%d)
UPLOADER="/home/Equim/tools/bpcs_uploader/bpcs_uploader.php"

Keybase proof

I hereby claim:

  • I am Equim-chan on github.
  • I am ekyu (https://keybase.io/ekyu) on keybase.
  • I have a public key whose fingerprint is B994 2CBB E0A4 CAE1 3F04 73C0 0534 B6F8 97D2 68E7

To claim this, I am signing this object:

@Equim-chan
Equim-chan / duckduckgo-post-search.adoc
Last active May 17, 2018 09:36
Chrome hack: use DuckDuckGo search engine with POST instead of GET.

POST version of DuckDuckGo in Chrome search

We can now drop the GET version of DuckDuckGo, such as

https://duckduckgo.com/?q=%s

and adopt the POST version below.

@Equim-chan
Equim-chan / dst.sh
Created July 7, 2017 07:24
饥荒服务器启动与 mod 配置的简易脚本
#!/bin/bash
# 饥荒简易启动脚本,附关闭与状态查询
# by Equim
# on 17-07-01
# 饥荒的安装路径
INSTALLED_PATH="$HOME/Steam/steamapps/DST"
# Cluster 所在目录
CLUSTER_PATH="$HOME/.klei/DoNotStarveTogether"
# 保存 PID 的目录
@Equim-chan
Equim-chan / loss-calc.py
Created October 16, 2019 16:09
Calculate loss rate under Reed-Solomon error correction, input loss rate can be either pre-FEC or post-FEC.
#!/usr/bin/env python
from operator import add, mul
from functools import reduce
def ncr(n, r):
'''
From https://stackoverflow.com/a/4941932
'''
r = min(r, n-r)
@Equim-chan
Equim-chan / score_lut.txt
Last active March 3, 2021 16:04
Riichi Mahjong score lookup table in ASCII. Keep it simple and minimal.
30 fu 30 fu
------------------------- ----------------------
10 (3,5|11) [14,16|20] 15 (5) [20|30]
20 (5,10) [25,30|40] 29 (10|30) [40|58]
39 (10,20|40) [50,60|78] 58 (20|60) [80|116]
77 (20,39|79) [99,118|154] 116 (39|117) [156|232]
80 (20,40) [100,120|160] 120 (40) [160|240]
120 (30,60) [150,180|240] 180 (60) [240|360]
.. ..
160 (40,80) [200,240|320] 240 (80) [320|480]
@Equim-chan
Equim-chan / main.go
Last active July 8, 2021 09:25
Golang net/http X-Response-Time header middleware
package main
import (
"fmt"
"log"
"net/http"
"time"
"httptimer"
)
@Equim-chan
Equim-chan / dynmotd
Last active October 11, 2023 15:55 — forked from knotman90/Fedora Dynamic Message of the day - motd
Dynamic motd for CentOS7
#!/bin/bash
# Installation:
#
# 1. vim /etc/ssh/sshd_config
# PrintMotd no
#
# 2. vim /etc/pam.d/login
# # session optional pam_motd.so
#
@Equim-chan
Equim-chan / README.adoc
Last active March 17, 2024 11:16
(obsolete) Equim's SOP for Archiving YouTube Livestream

Equim’s SOP for Archiving YouTube Livestream

This document describes an SOP for archiving a YouTube livestream, either public or private.

The demonstrations below are operated under Arch Linux, but it should work on other systems as well, including Windows MSYS2.

This SOP was originally written for archiving Gawr Gura’s unarchived streams.

Overview