Skip to content

Instantly share code, notes, and snippets.

@YihaoPeng
YihaoPeng / add-apt-repository
Created July 14, 2020 00:57
适用于Debian/Deepin/UOS的add-apt-repository命令(添加Ubuntu PPA源)
#!/bin/bash
if [ $# -eq 1 ]; then
ppa_name=`echo "$1" | awk -F ':' '{print $2}'`
app_name=`echo "$ppa_name" | cut -d '/' -f2-`
if [ -z "$ppa_name" ]; then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
@YihaoPeng
YihaoPeng / c_cpp_properties.json
Created December 25, 2018 06:35
IntelliSense and Debug with VSCode and WSL
{
"configurations": [
{
"name": "WSL",
"intelliSenseMode": "gcc-x64",
"compilerPath": "/usr/bin/gcc",
"includePath": [
"${workspaceFolder}/**",
"/usr/include",
"/usr/local/include",
@YihaoPeng
YihaoPeng / orphaned-block-monitor.php
Created September 13, 2018 09:26
orphaned-block-monitor.php
<?php
/**
* 孤块监控
* orphaned-block-monitor.php
* @author SwimmingTiger <hu60.cn@gmail.com>
*/
// 起始区块序号
define('BEGIN_BLOCK_OFFSET', 0);
@YihaoPeng
YihaoPeng / getwork-monitor-eth-parity.sh
Created September 1, 2018 16:58
getwork-monitor-eth-parity.sh
#!/bin/bash
#
# Parity's getwork RPC is often stuck in a block number
# So I wrote a script to monitor and automatically restart it
#
# @copyright btc.com
# @author Yihao Peng <yihao.peng@bitmain.com>
# @since 2018-07
#
# bash /work/script/getwork-monitor-eth-parity.sh >>/work/script/logs/getwork-monitor-eth-parity.log 2>&1
@YihaoPeng
YihaoPeng / Stratum挖矿协议.md
Last active July 26, 2023 14:07
Stratum挖矿协议

Stratum挖矿协议: 该协议是由SlushPool制定的,请参阅其官方文档:https://slushpool.com/help/manual/stratum-protocol

以下所有报文均使用\n做为行结束符。


矿机订阅:

{"id": 1, "method": "mining.subscribe", "params": []}