Skip to content

Instantly share code, notes, and snippets.

View ihidchaos's full-sized avatar

GuoYuchao ihidchaos

  • HooRii Technology Co., Ltd
  • China
  • 00:07 (UTC +08:00)
View GitHub Profile
@ihidchaos
ihidchaos / xterm-color
Last active September 19, 2022 02:31
xterm-color
echo "export TERM=xterm-color" | sudo tee -a /etc/profile
source /etc/profile
logout
@ihidchaos
ihidchaos / ps_history_clear
Created July 14, 2020 00:34
ps_history_clear
Remove-Item (Get-PSReadlineOption).HistorySavePath
@ihidchaos
ihidchaos / cjson_cross_compile
Created July 3, 2020 09:10
cjson_cross_compile
git clone https://github.com/DaveGamble/cJSON.git
cd cJSON
make CC=mips-openwrt-linux-gcc
@ihidchaos
ihidchaos / mosquitto_cross_compile.sh
Last active June 30, 2020 01:12
mosquitto_cross_compile.sh
git clone https://github.com/eclipse/mosquitto.git
cd mosquitto
make CC=mips-openwrt-linux-gcc CXX=mips-openwrt-linux-g++ WITH_STATIC_LIBRARIES=yes WITH_TLS=no -j8
@ihidchaos
ihidchaos / find_grep
Last active October 24, 2020 14:22
find_grep
find . -type f | xargs grep "some string" -il
@ihidchaos
ihidchaos / portainer_influxd_chronograf_mysql
Last active May 3, 2020 13:50
portainer_influxd_chronograf_mysql
docker run -d -p 9000:9000 \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
--name portainer \
docker.io/portainer/portainer
docker network create influxdb
docker run -d -p 8086:8086 --name=influxdb --net=influxdb --restart=always influxdb
@ihidchaos
ihidchaos / ubuntu_docker_mirror
Last active October 14, 2020 15:04
ubuntu_docker_mirror
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i 's/security.ubuntu/mirrors.aliyun/g' /etc/apt/sources.list
sudo sed -i 's/us.archive.ubuntu/mirrors.aliyun/g' /etc/apt/sources.list
sudo apt update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get -y update
sudo apt-get -y install docker-ce
sudo bash -c 'cat << EOF > /etc/docker/daemon.json
@ihidchaos
ihidchaos / format.go
Created March 6, 2020 08:56
datatype transformer
package drivers
import (
"encoding/binary"
"encoding/hex"
"github.com/shopspring/decimal"
"math"
"strings"
)
@ihidchaos
ihidchaos / py2pyc.py
Created November 7, 2019 17:25
py2pyc
import compileall
import os
import shutil
import tarfile
from pathlib import Path
keyword = '.cpython-37'
temp = 'publish'
app = 'app'
sudo apt install -y cmake gcc clang gdb valgrind build-essential