Skip to content

Instantly share code, notes, and snippets.

View SimonLeeGit's full-sized avatar

SimonLee SimonLeeGit

View GitHub Profile
@SimonLeeGit
SimonLeeGit / check_system_info.py
Created May 8, 2021 06:07
check linux system info when necessary
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os, sys
import json
import logging
import traceback
import psutil
import time
import preprocess_error
@SimonLeeGit
SimonLeeGit / vim_replace.txt
Created May 12, 2021 03:42
VIM 常用命令 —— 替换
语法为
:[addr]s/源字符串/目的字符串/[option]
全局替换命令为:
:%s/源字符串/目的字符串/g
[addr] 表示检索范围,省略时表示当前行。
“1,20” :表示从第1行到20行;
“%” :表示整个文件,同“1,$”;
“. ,$” :从当前行到文件尾;
@SimonLeeGit
SimonLeeGit / get_latest_release.sh
Created May 16, 2021 03:53
get github release info by api
curl --silent "https://api.github.com/repos/$1/releases/latest"
# Usage
# $ bash get_latest_release.sh "carla-simulator/carla"
@SimonLeeGit
SimonLeeGit / python_config.sh
Last active September 3, 2021 14:19
How to config different python version and switch them
# 切换python的版本
sudo update-alternatives --config python
# 配置使用的python各个版本的链接
# python2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.4 5
# python3
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 5
@SimonLeeGit
SimonLeeGit / disk_checker.sh
Created June 25, 2021 06:51
disk check commands
# list the size for all files and folders.
du -h --max-depth=1
# list all disk and usage.
df -lh
@SimonLeeGit
SimonLeeGit / read_file_lines.sh
Created September 3, 2021 06:18
How to read file line by line in Bash script
$ while read line; do echo $line; done < company.txt
@SimonLeeGit
SimonLeeGit / top_threads.sh
Created September 11, 2021 08:11
use top to show threads cpu usage
top -H -p [pid]
@SimonLeeGit
SimonLeeGit / update_download_pub_key.md
Last active June 11, 2024 07:57
由于没有公钥,无法验证下列签名

由于没有公钥,无法验证下列签名

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 46B5721DBBD2996A
@SimonLeeGit
SimonLeeGit / run_unreal_project.sh
Created October 20, 2021 11:28
run unreal editor with project in linux
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_NAME="AgentSim"
ENGINE_PATH="${DIR}/../UnrealEngine"
PLATFORM_NAME="Linux"
SCRIPT_DIR="${ENGINE_PATH}/Engine/Build/BatchFiles"
if [ "$(uname)" = "Darwin" ]; then
@SimonLeeGit
SimonLeeGit / run_unreal_project.bat
Created October 20, 2021 11:29
run unreal editor with project in windows
set DIR=%~dp0
set PROJECT_NAME=AgentSim
set PLATFORM_NAME=Win64
set ENGINE_PATH=%DIR%\..\UnrealEngine
set RUN_CMD="%ENGINE_PATH%\Engine\Binaries\%PLATFORM_NAME%\UE4Editor.exe"
set PROJECT_FILE="%DIR%\%PROJECT_NAME%.uproject"
::start "Client" %RUN_CMD% %PROJECT_FILE% ?RosIP=192.168.1.5?RosPort=15000? -game -log -windowed