Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Shine ShineSmile

I may be slow to respond.
View GitHub Profile
ShineSmile / config.json
Created October 23, 2020 02:43
windows-terminal configuration
View config.json
// This file was initially generated by Windows Terminal 1.1.2233.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see:
"$schema": "",
"defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
// You can add more global application settings here.
ShineSmile /
Created September 16, 2020 07:50 — forked from nicktoumpelis/
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
ShineSmile /
Last active June 24, 2019 01:41
interview questions
  1. 求下述代码片段的输出,并且解释原因
    static void Main()
        var i = 5;
        var s = new Student() { Age = 10 };
ShineSmile / GLobal.asax
Last active February 22, 2019 06:44
ASP.NET Controller register
View GLobal.asax
One thing I ran into was having my configurations registered in the wrong order in my GLobal.asax file for instance:
Right Order:
Wrong Order:
ShineSmile / tmux-cheatsheet.markdown
Created November 26, 2018 07:45 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表
View tmux-cheatsheet.markdown

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表


tmux [new -s 会话名 -n 窗口名]



Azure Redis Patching Explained

Occationally customers will experience connection related errors in their client applications talking to Redis. Most often these errors are caused by one of the following:

  1. Redis was patched or a master/slave failover occurred.
  2. A client-side network configuration change was made. See below for details

In this article we will quickly discuss how patching works in Azure Redis and how this impacts clients. While this article talks mostly about patching, the experience is more or less the same when a failover occurs.

Redis Patching and Failover Details


Best Practices for Azure Redis

Below are a set of best practices that I recommend for most customers. This information is based on my experience helping hundreds of Azure Redis customers investigate various issues.

Configuration and Concepts

  1. Use Standard or Premium Tier for Production systems. The Basic Tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are really meant for simple dev/test scenarios since they have a shared CPU core, very little memory, are prone to "noisy neighbor", etc.
  2. Remember that Redis is an In-Memory data store. Read this article so that you are aware of scenarios where data loss can occur.
  3. Configure your client library to use a "connect timeout" of at least 10 to 15 seconds, giving the system time to connect even under higher CPU conditions. If your client or server tend to be under high load