Skip to content

Instantly share code, notes, and snippets.

View saqwed's full-sized avatar

Simon Yang saqwed

View GitHub Profile
@saqwed
saqwed / How_to_permanently_delete_file_in_a_git_repository.md
Created April 27, 2022 02:00
How to permanently delete file in a git repository
@saqwed
saqwed / README.md
Created April 19, 2022 14:38 — forked from JarekParal/README.md
Pyinstaller - update version during CI build / automatic update of version file
python CI/updateVersion.py %NEW_VERSION%
pyinstaller testApp.py --version-file "CI/version.py"
@saqwed
saqwed / ubuntu_pixz.md
Last active April 8, 2022 01:40
Install pixz
sudo apt-get update
sudo apt-get install -y autoconf asciidoc libarchive-dev liblzma-dev
git clone https://github.com/vasi/pixz.git
cd pixz
./autogen.sh
./configure
@saqwed
saqwed / another_patcher.py
Created December 29, 2021 05:12 — forked from aviafelix/another_patcher.py
Patching binary files with Python
#/usr/bin/env python3
"""
Yet another simple binary patcher
"""
patches = [
{
# 1 Windows x64, version 3, build 1234
'file': 'file_1.bin',
'offset': 0x0BA950,
'original': b'\x00',
@saqwed
saqwed / minicom_timestamp.md
Last active December 19, 2023 08:41
Enable timestamp as default in minicom

minicom

Enable minicom output with timestamp

Ctrl + a, and then press N

minicom still there is no any method to enable timestamp as default, but related code change already merged

  • current the latest version in apt repository is 2.7, and 2.8 still not include the change, which means we need to use dev version and build by ourself.
@saqwed
saqwed / gist:f4dbc507878bb2145c8e5b34dda69a8a
Created October 15, 2021 05:13 — forked from SimonSun1988/gist:2ef7db45e46b889783647d941ec15e4d
解決 Ubuntu "can’t set the locale; make sure $LC_* and $LANG are correct" 的錯誤
## 安裝語系檔
`$ sudo locale-gen "en_US.UTF-8"`
## 重新設定語系檔
`$ sudo dpkg-reconfigure locales`
## 設定檔
@saqwed
saqwed / WSL2_NTP.md
Last active October 13, 2021 15:55
Sync WSL2 date/time via NTP
sudo apt install ntpdate
sudo ntpdate -sb time.nist.gov
@saqwed
saqwed / vim_NERDTree
Created July 13, 2021 05:30 — forked from ifels/vim_NERDTree
vim NERDTree 快捷键
ctrl + w + h 光标 focus 左侧树形目录
ctrl + w + l 光标 focus 右侧文件显示窗口
ctrl + w + w 光标自动在左右侧窗口切换
ctrl + w + r 移动当前窗口的布局位置
o 在已有窗口中打开文件、目录或书签,并跳到该窗口
go 在已有窗口 中打开文件、目录或书签,但不跳到该窗口
t 在新 Tab 中打开选中文件/书签,并跳到新 Tab
T 在新 Tab 中打开选中文件/书签,但不跳到新 Tab
i split 一个新窗口打开选中文件,并跳到该窗口
gi split 一个新窗口打开选中文件,但不跳到该窗口
@saqwed
saqwed / auto_attach_tmux.md
Last active July 12, 2021 07:14
Auto attach tmux

if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then tmux -u attach-session -t ssh_tmux || tmux -u new-session -s ssh_tmux fi

@saqwed
saqwed / Add_SSH_PUBKEY.md
Created July 10, 2021 04:21
Add all of your public keys into ~/.ssh/authorized_keys easily

Add all of your public keys into ~/.ssh/authorized_keys easily

mkdir -p ~/.ssh
chmod 700 ~/.ssh
curl https://github.com/saqwed.keys | tee -a ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

Ref Link