Pages - Menu

標籤

AWS (1) bash (1) Boost (2) C (2) CMake (2) Concurrency_Programming (3) CPP (37) Database (2) DNS (1) Docker (4) Docker-Compose (1) ELK (1) emacs (4) gcp (1) gdrive (1) git (1) gitbash (2) gitlab (1) kvm (4) Linux (5) MT4 (4) MT5 (4) Multicast (2) MySQL (2) Nijatrader8 (1) OpenCV (1) Python (4) QT5 (1) R (1) rdp (3) screenshot (1) ssh (3) Tabnine (1) TCP (1) TensorFlow (1) Tools (12) Ubuntu_1904 (11) Ubuntu_20_04 (5) UDP (1) VS2010 (1) VS2015 (1) VS2019 (1) WebServer (1) Win10 (1) winmerge (1) WSL (1) xrdp (1)

搜尋此網誌

2021年12月25日星期六

Multiple Git User

This example is using gitbash on Windows.

Config file locations:

  • C:\Users\<name>\.gitconfig
  • C:\Users\<name>\path_to_github_project\.git\config

# Set up global user
$ git config --global user.name "Your_Name_001"
$ git config --global user.email "Your_Email_001"

# Set up local user and ssh key
$ cd /path_to_your_project
$ git config user.name "Your_Name_002"
$ git config user.email "Your_Email_002"
$ git config --local --add core.sshCommand 'ssh -i ~/.ssh/Your_SSH_Private_Key_002'

Done

2021年12月6日星期一

Install spacemacs on windows

Steps for spacemacs installation

  1. Download and install emacs on windows
    1. https://www.gnu.org/software/emacs/download.html
  2. Install the spacemacs config to appdata
    1.  %USERPROFILE%\appdata\roaming\.emacs.d
    2. https://www.spacemacs.org/#
  git clone https://github.com/syl20bnr/spacemacs C:\%USERPROFILE%\appdata\roaming\.emacs.d  

Steps for gtags and cscope

  1. Get the binaries from web or
    1. from one drive
  2. Put those binaries to a folder in the windows environment path
  3. Use it with the scrip: 
    1. https://github.com/SulfredLee/DailyProblem/blob/master/devTools/prepareSpacemacsTags.bat

2021年12月5日星期日

Cheat sheet compilation

 Bash


# Get space usage
du -chs ./* | sort -rh
du -kh --max-depth=1 | sort -rh

# find files
find [path] -name "lost+found" -prune -o -name "abc*.log.gz" -print0

 Cpp


# cpp debugs
## cpp heap memory checking
sudo cat /proc/18594/maps |grep heap # cat the process memory

55da5171a000-55da5178a000 rw-p 00000000 00:00 0 [heap]
55da5178a000-55db1c7c3000 rw-p 00000000 00:00 0 [heap]

55db1c7c3000-55da5178a000= 3,406,008,320 around 3G mem.

## Then dump the heap memory to a file(example from UAT):
dd if=/proc/29619/mem bs=1 skip=$((0x55db1c7c3000)) count=$((0x55db1c7c3000-0x55da5178a000)) status=none | strings > /tmp/heap_log.txt

 Docker Compose


# up and run in background
docker-compose up -d

# stop --- will keep the data
docker-compose stop

# shutdown --- will remove the data
docker-compose down -v

# check service environment variables
docker-compose run web env

# check config --- this can print the real value of the variable
docker-compose config