Skip to content

Instantly share code, notes, and snippets.

View YahuiWong's full-sized avatar
🌈
Focusing

ArthurWang YahuiWong

🌈
Focusing
View GitHub Profile
@YahuiWong
YahuiWong / install-ss-tproxy.sh
Last active September 4, 2018 11:17 — forked from sancome/install-ss-tproxy.sh
Auto install SS-TProxy on CentOS 7.3 Minimal
#!/bin/sh
#
# Script for automatic setup of an SS-TPROXY server on CentOS 7.3 Minimal.
#
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
exiterr() { echo "Error: $1" >&2; exit 1; }
exiterr2() { exiterr "'yum install' failed."; }
bigecho() { echo; echo -e "\033[36m $1 \033[0m"; }
@YahuiWong
YahuiWong / ConsoleHost.cs
Created June 23, 2018 11:47
How to write a linux daemon with .Net Core
public static class ConsoleHost {
/// <summary>
/// Block the calling thread until shutdown is triggered via Ctrl+C or SIGTERM.
/// </summary>
public static void WaitForShutdown() {
WaitForShutdownAsync().GetAwaiter().GetResult();
}
/// <summary>