Skip to content

Instantly share code, notes, and snippets.

41tair / gist:524b5a49c6cb66580c66399db45523d3
Last active August 2, 2023 10:35
get pod hostname by pid
xargs -0 -L1 -a /proc/PID/environ | grep HOSTNAME
(global-hl-line-mode t)
(require 'cc-mode)
(global-linum-mode t) ;; enable line numbers globally
(column-number-mode 1)
(setq inhibit-startup-message t) ;; hide the startup message
(display-time-mode t)
eval-buffer 加载当前的文件
(setq debug-on-error t) 打开调试模式
打开行号 (global-linum-mode t)
加载util util
配置 elpa
41tair /
Created October 30, 2019 20:22
stupid algorithm
t1 = ["123",["ddd", "ccc","344", ["lll"], ['zzz']],"333"]
def a(l):
c = []
z = []
if any([isinstance(x, list) for x in l]):
for i in l:
if len(i) == 1:
if not isinstance(i, list):
41tair / GPG and git on
Created September 25, 2019 10:37 — forked from danieleggert/GPG and git on
How to set up git to use the GPG Suite

GPG and git on macOS


No need for homebrew or anything like that. Works with and the command line.

  1. Install -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
41tair / init.el
Last active September 9, 2019 10:19
emacs on linux minimal config
(require 'package)
(add-to-list 'package-archives '("melpa" . "") t)
(ivy-mode 1)
(add-hook 'after-init-hook 'global-company-mode)
(global-linum-mode t)
(global-set-key [f3] 'execute-extended-command)
(global-set-key [f4] 'ag-project)
(global-set-key [f5] 'kmacro-start-macro)
(global-set-key [f6] 'kmacro-end-and-call-macro)
dd if=/dev/zero of=a.bin bs=4096 count=524288 conv=fdatasync
dd if=a.bin of=/dev/null bs=4096 count=524288 iflag=direct
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
41tair / gist:c076f1ad313598238cf4d635986f22b0
Created January 22, 2019 10:43
install axel in centos/rhel
rpm -ivh
server {
listen 80;
server_name _;
if ($http_x_forwarded_proto = 'http'){
return 301 https://$host$request_uri;