Skip to content

Instantly share code, notes, and snippets.

View TurnOffNOD's full-sized avatar

Thomas Copper TurnOffNOD

  • University of Chinese Academy of Sciences
  • HangZhou
View GitHub Profile
#!/usr/bin/python3
from pathlib import Path
from threading import Timer
cpu_temp_file = "/sys/class/thermal/thermal_zone0/temp"
duty_cycle_file = "/sys/class/pwm/pwmchip0/pwm0/duty_cycle"
temp_wall = 65000
lowest_fan_speed = 3000
def read_cpu_temp():
@mengzhuo
mengzhuo / ntp_offset_test.go
Last active April 15, 2018 05:41
Test NTP offset from NIST
package main
import (
"fmt"
"io"
"log"
"os"
"github.com/beevik/ntp"
)
@undirectlookable
undirectlookable / qqvideo-html5.user.js
Created November 22, 2016 02:32
在 Windows 系统中使用 HTML5 版的腾讯视频播放器 (userscript)
// ==UserScript==
// @name QQVideo HTML5
// @namespace http://v.qq.com/
// @version 1.0
// @description 在 Windows 系统中使用 HTML5 版的腾讯视频播放器
// @author Anonymous
// @match *://v.qq.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
@ficapy
ficapy / README.md
Last active February 1, 2022 20:42
代理设置

现在比较主流的方案可能就是SSR+kcptun了,基本上都能流畅看1080P的youtube了。下面讲述如何快速搭建服务端和客户端(主要针对osx和unix,win上有成熟的GUI方案)

服务端

SSR一键安装包(引用自https://www.91yun.org/archives/2079)

wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/shadowsocks_install/master/shadowsocksR.sh && bash shadowsocksR.sh

https://github.com/xtaci/kcptun/releases下载适合自己系统的最新版本tar -xf解压得到server_linux_amd64.执行服务端.摘录文档如下

@AlephAlpha
AlephAlpha / greek.dict.yaml
Last active December 5, 2022 08:19
Rime 的希腊字母输入方案,也支持一些常用的数学符号。如果需要在其他输入方案中直接输入希腊字母,请参考:https://gist.github.com/lotem/3705586
# Rime dictionary
# encoding: utf-8
---
name: greek
version: "0.1"
sort: original
...
# 小写希腊字母
<a class="question_link" target="_blank" href="/question/30746665/answer/49332475">会写 Parser、Tokenizer 是什么水平?</a><br/><br/>大多数编译原理书前100页的内容,说明大学听了一半左右的编译原理课,通俗地说,写了这个只能证明你不是个棒槌。<br><br><br>所以其实你更应该关心不会tokenizer和parser是什么水平。
<span class="answer-date-link-wrap">
<a class="answer-date-link last_updated meta-item" data-tip="s$t$发布于 2015-05-29" target="_blank" href="/question/30746665/answer/49332475">编辑于 2015-05-29</a>
</span>
<hr/><a class="question_link" target="_blank" href="/question/30703519/answer/49150834">王垠到底对 winter 做了什么?</a><br/><br/>你可以理解为是路边看到一坨**,忍不住想去一脚踩爆它的心态。(虽然我知道这么做无聊而且会沾一脚)<br><br>想了想,可能还有一点觉得他的粉丝很可怜的,想让他们停止吃**的心态吧,虽然我知道"然而没卵用"。<br><br>回到题主的问题,要问做了什么,那就是“他是**,还碰巧被我看到了”,这样的事情,简直无法被饶恕。
@slok
slok / run_docker_x11.sh
Created February 22, 2015 11:11
x11 with docker archlinux
KEY=$(xauth list |grep $(hostname) | awk '{ print $3 }' | head -n 1)
DCK_HOST=docker-skype
xauth add $DCK_HOST/unix:0 . $KEY
docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/.Xauthority:/tmp/.Xauthority \
-v /dev/snd:/dev/snd \
-e DISPLAY=unix$DISPLAY \
-e XAUTHORITY=/tmp/.Xauthority \
-h $DCK_HOST \
@cbsmith
cbsmith / idempotent_path_add.sh
Last active October 16, 2017 12:31
An example on how to do idempotent PATH manipulation.
#!/usr/local/bin/bash
#How to manipulate the path in an intelligent fashion with bash. Note: this doesn't work with Bourne shell.
function idempotent_path_add {
DIR="$1"
PREPEND=$2
if [[ ! "$PATH" =~ (^|:)"$DIR"(:|$) ]]
then
if [ $PREPEND ]
then
@iamnewton
iamnewton / bash-colors.md
Last active July 10, 2024 19:49
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple