Skip to content

Instantly share code, notes, and snippets.

View hongchaodeng's full-sized avatar
👋
Anyscale is hiring! Send your resume to hongchao.deng@anyscale.com

Hongchao Deng hongchaodeng

👋
Anyscale is hiring! Send your resume to hongchao.deng@anyscale.com
View GitHub Profile
@hongchaodeng
hongchaodeng / c_cpp_properties.json
Created March 5, 2024 23:35
VSCode cpp include path
{
"env": {
"myIncludePath": [
"${workspaceFolder}/src",
"${workspaceFolder}/cpp/include",
"${workspaceFolder}/cpp/example/thirdparty/include",
// "${workspaceFolder}/bazel-out/darwin_arm64-opt/bin/external/com_github_gflags_gflags/_virtual_includes/gflags",
]
},
"configurations": [
Below is the code for SM4 Encryption tool:
```
<template>
<h-text-transform
ref="cryptRef"
enableFile
:fileOutputAlert="t('enc')"
:sampleData="sample"
:transform="encrypt"
:fileOutputName="fileName">
@hongchaodeng
hongchaodeng / main.go
Created April 27, 2022 06:26
port forward
package main
import (
"io"
"net/http"
"net/url"
"os"
"os/signal"
"syscall"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
# Path to your oh-my-zsh installation.
export ZSH="/Users/hongchaodeng/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
#!/usr/bin/env bash
path=$1
# sync dir append '/' at the end, e.g. my-code/
rsync -avzhe ssh --progress \
--exclude ".git" \
$path user@remote:$path
@hongchaodeng
hongchaodeng / command.cue
Last active November 8, 2022 13:17
dagger read/write
package main
import (
"dagger.io/dagger"
"universe.dagger.io/alpine"
"universe.dagger.io/bash"
"universe.dagger.io/docker"
)
dagger.#Plan & {
@hongchaodeng
hongchaodeng / app.yaml
Last active May 6, 2021 13:49
CD 跟 CI 为啥不用一套?
kind: Application
spec:
componnets:
- ... # 微服务组件
# policies are applied first and only once unless changed
policies:
- type: security
properties:
rbac: ...
@hongchaodeng
hongchaodeng / ack.go
Last active April 23, 2020 18:27
使用 alibaba-cloud-sdk-go 创建 ROS 资源
package main
import (
"fmt"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
)
var (
templateBody = ```

Assumption:

  • namespace "default"

Go to directory of etcd-operator/example/tls/certs/: https://github.com/coreos/etcd-operator/tree/master/example/tls/certs

create secret:

kubectl create secret generic etcd-peer-tls --from-file=peer-ca.crt --from-file=peer.crt --from-file=peer.key
kubectl create secret generic etcd-client-tls --from-file=etcd-client-ca.crt --from-file=etcd-client.crt --from-file=etcd-client.key
# HELP vault_barrier_get Metric autogenerated by statsd_exporter.
# TYPE vault_barrier_get summary
vault_barrier_get{quantile="0.5"} 1.169558
vault_barrier_get{quantile="0.9"} 1.648282
vault_barrier_get{quantile="0.99"} 2.089528
vault_barrier_get_sum 34.97571799999999
vault_barrier_get_count 29
# HELP vault_barrier_list Metric autogenerated by statsd_exporter.
# TYPE vault_barrier_list summary
vault_barrier_list{quantile="0.5"} 1.135013