Skip to content

Instantly share code, notes, and snippets.

View s5unty's full-sized avatar

Sun Wuan s5unty

View GitHub Profile
@edsiper
edsiper / kubernetes_commands.md
Last active April 4, 2024 03:27
Kubernetes Useful Commands
@reachlin
reachlin / prometheus.yml
Created April 19, 2017 07:06
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
@dlants
dlants / denite.md
Last active March 5, 2021 06:13
denite setup with interactive ag pattern-search of project contents

Files

First things first, I want to use ag to search through my project files. Coming from fzf, I like to have two bindings for this -- one that respects my projects .gitignore and one that does not. The latter is helpful if I want to examine a built file or look at a node_module dependency while working on my js project.

I use an alias for file_rec source to toggle the -u flag on ag. Now, <C-P> searches in my git files, and <C-O> searches everything.

" denite file search (c-p uses gitignore, c-o looks at everything)
map <C-P> :DeniteProjectDir -buffer-name=git -direction=top file_rec/git<CR>
map  :DeniteProjectDir -buffer-name=files -direction=top file_rec
@nickcarenza
nickcarenza / mycnf.go
Created January 30, 2017 22:31
Golang read connection details from my.cnf
package db
// stdlib
import (
"fmt"
"os"
)
// external
import (
@sanhuang
sanhuang / README.md
Created November 29, 2016 07:25
繁簡體中文日文韓文的Unicode字元範圍

** 匹配Unicode字符的正則表達式

這裡是幾個主要非英文語系字符範圍(google上找到的):

  • 2E80~33FFh:中日韓符號區。收容康熙字典部首、中日韓輔助部首、注音符號、日本假名、韓文音符,中日韓的符號、標點、帶圈或帶括符文數字、月份,以及日本的假名組合、單位、年號、月份、日期、時間等。
  • 3400~4DFFh:中日韓認同表意文字擴充A區,總計收容6,582個中日韓漢字。
  • 4E00~9FFFh:中日韓認同表意文字區,總計收容20,902個中日韓漢字。
  • A000~A4FFh:彝族文字區,收容中國南方彝族文字和字根。
  • AC00~D7FFh:韓文拼音組合字區,收容以韓文音符拼成的文字。
  • F900~FAFFh:中日韓兼容表意文字區,總計收容302個中日韓漢字。
  • FB00~FFFDh:文字表現形式區,收容組合拉丁文字、希伯來文、阿拉伯文、中日韓直式標點、小符號、半角符號、全角符號等。
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
@tanyuan
tanyuan / smart-caps-lock.md
Last active May 3, 2024 08:19
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@josevalim
josevalim / phoenix showdown rackspace onmetal io.md
Last active October 31, 2022 13:59 — forked from omnibs/phoenix showdown rackspace onmetal io.md
Phoenix Showdown Comparative Benchmarks @ Rackspace

Comparative Benchmark Numbers @ Rackspace

I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.

Results

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)
@mazgi
mazgi / console.log.md
Last active March 18, 2024 17:18
LDAP Auth for SSSD, SSH, SUDO
# uname -a
Linux base 4.0.5-gentoo #1 SMP Wed Jul 1 02:23:16 JST 2015 x86_64 Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz GenuineIntel GNU/Linux

Packages

# emerge -pvq openldap openssh sssd sudo
[ebuild R ] net-nds/openldap-2.4.38-r2 USE="berkdb crypt gnutls ipv6 minimal sasl ssl syslog tcpd -cxx -debug -experimental -icu -iodbc -kerberos -odbc -overlays -perl -samba (-selinux) -slp -smbkrb5passwd" ABI_X86="(64) -32 (-x32)" 
@rhuss
rhuss / execute_groovy_jenkins_sample.groovy
Last active August 12, 2020 19:09
How to execute some shell scripting on Groovy with environment variables and redirection
def exec(cmd) {
println cmd
def process = new ProcessBuilder([ "sh", "-c", cmd])
.directory(new File("/tmp"))
.redirectErrorStream(true)
.start()
process.outputStream.close()
process.inputStream.eachLine {println it}
process.waitFor();
return process.exitValue()