Skip to content

Instantly share code, notes, and snippets.

View saqwed's full-sized avatar

Simon Yang saqwed

View GitHub Profile
@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 / 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 / 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 / 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 / yubikey-windows10.md
Created July 9, 2021 15:48 — forked from andreibosco/yubikey-windows10.md
Setting up Yubikey with SSH and Git on Windows 10 + Powershell
@saqwed
saqwed / ctypes_structs_example.py
Created June 22, 2020 02:19 — forked from JonathonReinhart/ctypes_structs_example.py
Using Python ctypes to manipulate binary data
#!/usr/bin/env python3
from __future__ import print_function
from tempfile import TemporaryFile
from binascii import hexlify
from ctypes import *
class StructHelper(object):
def __get_value_str(self, name, fmt='{}'):
val = getattr(self, name)