Skip to content

Instantly share code, notes, and snippets.

View hongqn's full-sized avatar
🏠
Working from home

Qiangning Hong hongqn

🏠
Working from home
View GitHub Profile
#!/usr/bin/env zsh
autoload colors; colors
run() {
local cmd="$1"
echo "🏃 $fg[green]$cmd$reset_color"
eval "$1"
}
"""Mirror https://haoel.blog.csdn.net/ to local directory."""
import time
from itertools import count
from subprocess import run
from typing import Iterator
import requests

$ cat ./productB.py

import os

os.environ["PRODUCT"] = "B"

import feature

print(feature.COST)
diff --git a/.p10k.zsh b/.p10k.zsh
index 71ef1ce..ccaf60d 100644
--- a/.p10k.zsh
+++ b/.p10k.zsh
@@ -1110,7 +1110,7 @@
#############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
# Show kubecontext only when the the command you are typing invokes one of these tools.
# Tip: Remove the next line to always show kubecontext.
- typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito'
+ typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|lain'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <unistd.h>
#include <stdio.h>
#define LOAD 16384
int main() {
int i;
char s[256];
for (i=0; i<LOAD; i++) {
@hongqn
hongqn / distribute_ssh_key.yml
Created July 27, 2015 02:30
Ansible playbook to distribute ssh public key to hosts
---
- hosts: all
gather_facts: no
tasks:
- local_action: command grep '{{ ansible_ssh_host }} ' /root/.ssh/known_hosts
register: exists
ignore_errors: True
changed_when: False
- local_action: shell ssh-keyscan -p {{ ansible_ssh_port|default(22) }} {{ ansible_ssh_host }}
register: result
@hongqn
hongqn / lain.toml
Created March 4, 2015 06:07
comparison of YAML and TOML
appname = "hello"
[build]
base = "go"
script = [ "go build" ]
[test]
script = [ "go test" ]
[web]
proxyon() {
export http_proxy="http://127.0.0.1:8123"
export https_proxy="http://127.0.0.1:8123"
}
proxyoff() {
unset http_proxy
unset https_proxy
}
wd400G-16k-128.fio: read : io=421681MB, bw=719661KB/s, iops=44978, runt=600006msec
wd400G-16k-128.fio: write: io=47604MB, bw=81243KB/s, iops=5077, runt=600006msec
wd400G-16k-144.fio: read : io=422265MB, bw=720659KB/s, iops=45041, runt=600005msec
wd400G-16k-144.fio: write: io=47876MB, bw=81708KB/s, iops=5106, runt=600005msec
wd400G-16k-16.fio: read : io=309162MB, bw=527635KB/s, iops=32977, runt=600002msec
wd400G-16k-16.fio: write: io=34574MB, bw=59007KB/s, iops=3687, runt=600002msec
wd400G-16k-32.fio: read : io=390990MB, bw=667286KB/s, iops=41705, runt=600004msec
wd400G-16k-32.fio: write: io=43801MB, bw=74753KB/s, iops=4672, runt=600004msec
wd400G-16k-64.fio: read : io=409735MB, bw=699277KB/s, iops=43704, runt=600004msec
wd400G-16k-64.fio: write: io=45938MB, bw=78400KB/s, iops=4900, runt=600004msec