Skip to content

Instantly share code, notes, and snippets.

View chenhengqi's full-sized avatar
🐝
Healing CloudNative with BPF

Hengqi Chen chenhengqi

🐝
Healing CloudNative with BPF
View GitHub Profile
@chenhengqi
chenhengqi / README.md
Last active August 29, 2015 14:11 — forked from larrycai/README.md

Introduction

Learn REST API with Python script, slides : http://www.slideshare.net/larrycai/learn-rest-apiwithpython

REST/JSON is perfect match to fetch web data, and python requests module

@chenhengqi
chenhengqi / nightly-rust.md
Last active June 1, 2020 12:31
Rust: xxx syntax is experimental

When rustc complains that xxx syntax is experimental, switch to nightly build

$ rustup toolchain install nightly
$ rustup default nightly

If some feature has to be activated, the compiler usually say which one.

@chenhengqi
chenhengqi / terminal-prompts-disabled.md
Created June 4, 2020 12:39
terminal prompts disabled

When go get complains about terminal prompts disabled, set environment variable GIT_TERMINAL_PROMPT to 1 to enable it.

# export GIT_TERMINAL_PROMPT=1
$ GIT_TERMINAL_PROMPT=1 go get xxx
@chenhengqi
chenhengqi / macos-sudo.md
Created August 28, 2020 07:02
execute sudo command on macOS

To execute sudo command on macOS, use:

$ sudo -s

enter your password and enjoy

@chenhengqi
chenhengqi / keep-git-fork-up-to-date.md
Created November 4, 2020 08:38
keep Git Fork up to date

Add upstream

$ git remote add upstream https://github.com/TarsCloud/TarsGo.git

add upstream, use git remote -v to verify

Keep upstream updated

@chenhengqi
chenhengqi / programming-jargon.md
Last active December 22, 2020 13:36
Programming Jargon

Programming Jargon

Yoda conditions

see wiki

if (0 == x) {
    ...
}
@chenhengqi
chenhengqi / upgrade-ubuntu.md
Created December 14, 2020 11:54
Upgrade Ubuntu

Keep Ubuntu Up to date

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
$ sudo do-release-upgrade
@chenhengqi
chenhengqi / ubuntu-update-linux-kernel.md
Last active December 14, 2020 12:30
Install Linux Kernel in Ubuntu

Install Linux Kernel in Ubuntu

Check current installed version

$ uname -r

Download new Linux kernel

@chenhengqi
chenhengqi / dive-into-c++.md
Last active December 23, 2020 11:43
Dive into C++

Code Snippet

#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <thread>


auto compute_e(int r) {
@chenhengqi
chenhengqi / dive-into-go.md
Last active December 24, 2020 09:30
Dive into Go

Code Snippet

package main

import (
        "fmt"
        "math/rand"
        "time"
)