Skip to content

Instantly share code, notes, and snippets.

View YahuiWong's full-sized avatar
🌈
Focusing

ArthurWang YahuiWong

🌈
Focusing
View GitHub Profile
@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>
@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"; }
for file in `ls ./`
do
if [ -d $file ]
then
pushd $file
git add --all
git commit -m "修改配置"
git push --all origin
popd
fi

/***

  • ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐
  • │Esc│ │ F1│ F2│ F3│ F4│ │ F5│ F6│ F7│ F8│ │ F9│F10│F11│F12│ │P/S│S L│P/B│ ┌┐ ┌┐ ┌┐
  • └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └┘ └┘ └┘
  • ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐
  • │~ `│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ BacSp │ │Ins│Hom│PUp│ │N L│ / │ * │ - │
  • ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤
  • │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│ | \ │ │Del│End│PDn│ │ 7 │ 8 │ 9 │ │
  • ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ ├───┼───┼───┤ + │
  • │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter │ │ 4 │ 5 │ 6 │ │
@YahuiWong
YahuiWong / install_ffmpeg.sh
Created December 28, 2019 07:07 — forked from spookyuser/install_ffmpeg.sh
Installs FFmpeg on aws\whatever
# Taken from https://forums.aws.amazon.com/thread.jspa?messageID=332091
# And https://gist.github.com/rainabba/07425c3bc14a0bb51632f12e913d9081
#
# Usage: `sudo bash ./install_ffmpeg.sh`
# Config Variables
static_host=https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz
filename=ffmpeg-git-64bit-static.tar.xz
@YahuiWong
YahuiWong / Windows Terminal.json
Last active May 28, 2022 07:41
Windows Terminal Preview setting.json
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"copyFormatting": "none",
"copyOnSelect": true,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
"keybindings": [
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
gradle.projectsLoaded {
rootProject.allprojects {
buildscript {
repositories {
def JCENTER_URL = 'https://maven.aliyun.com/repository/jcenter'
def GOOGLE_URL = 'https://maven.aliyun.com/repository/google'
def NEXUS_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
all { ArtifactRepository repo ->
if (repo instanceof MavenArtifactRepository) {
def url = repo.url.toString()
@YahuiWong
YahuiWong / install.ps1
Last active June 2, 2022 15:19
oh-my-posh
scoop install oh-my-posh
# 1. 安装 PSReadline 包,该插件可以让命令行很好用,类似 zsh
Install-Module -Name PSReadLine -Scope CurrentUser
# 2. 安装 posh-git 包,让你的 git 更好用
Install-Module posh-git -Scope CurrentUser
# # 3. 安装 oh-my-posh 包,让你的命令行更酷炫、优雅
# Install-Module oh-my-posh -Scope CurrentUser
@YahuiWong
YahuiWong / nuget.config
Created May 29, 2022 05:26
dotnet.nuget
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.cdn.azure.cn" value="https://nuget.cdn.azure.cn/v3/index.json" />
</packageSources>
<config>
<add key="globalPackagesFolder" value="D:\.nuget\packages" />
</config>
</configuration>
@YahuiWong
YahuiWong / Microsoft.PowerShell_profile.ps1
Last active June 2, 2022 15:17
Microsoft.PowerShell_profile.ps1
# 引入 posh-git
Import-Module posh-git
# # 引入 oh-my-posh
# Import-Module oh-my-posh
# 引入 ps-read-line
Import-Module PSReadLine
# 设置 PowerShell 主题