Skip to content

Instantly share code, notes, and snippets.

View BH1SCW's full-sized avatar

F.J Kong BH1SCW

View GitHub Profile

Git-Shadowsocks与git代理配置

# 设置配置

# Windows默认1080端口
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
@jflemer-ndp
jflemer-ndp / git-rpm-changelog.sh
Last active February 3, 2024 02:08
generate a rpm spec compatible changelog from git history
#!/bin/bash
merge_commit() {
git show --no-patch --format='%P' "$@" | head -1 | grep -q ' '
}
commit_meta() {
git show --no-patch --format="* %cd %aN <%ae> - %H" --date=local "$@" | \
head -1 | \
sed -E 's/^(\* [a-z0-9 ]{9,10}) \d{2}:\d{2}:\d{2}/\1/i'
@extremecoders-re
extremecoders-re / qemu-networking.md
Last active April 12, 2025 11:10
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@hempnall
hempnall / Calling_C_From_Rust.md
Created December 7, 2017 20:06
Calling C++ code from Rust

Start off with some Rust source code

hw.rs :

#[link(name = "extern")]
extern {
	fn hello();
}

#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \
@eumel8
eumel8 / 1-usage.txt
Created September 3, 2017 16:27 — forked from xen/1-usage.txt
i18njson translate using Google Translate
$ python i18njson-translate.py --help
Usage: i18njson-translate.py [OPTIONS] INPUTFILE OUTPUT
Process and translate .po or JSON files and generate translated .po file
in result. Can work with exist .po files and if in initial file msgid
dissapear then mark translaed string as obsolete. Try to play nice with
version control systems and follow initial file order format, you will get
predicteable diffs.
Options:
@IskenHuang
IskenHuang / things-to-fantastical.applescript
Created August 12, 2017 15:08
Things3 complete todos create calendar event to fantastical.
(*
## Goal
This script is make new calendar event to fantastical2 from things3 complete todos in 'Logbook' on specified date.
## How to use:
* Default is today
* `$ osascript things-to-fantastical.applescript`
* The specified date
* `$ osascript things-to-fantastical.applescript 2017/08/12`
*)
@tonejito
tonejito / oops-panic.grub.cfg
Last active January 6, 2023 15:04
Linux kernel verbose boot and logging to serial console
# Linux kernel verbose boot and logging to serial console
#
# Check Documentation/kernel-parameters.txt [1] to check all aplicable options for your kernel version
#
# VERSION="v"$(uname -r | sed -e 's/\(\.0\)\?-.*$//')
# [1] https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/Documentation/kernel-parameters.txt?id=refs/tags/$VERSION
linux /vmlinuz root=/dev/sda1 ro consoleblank=0 earlyprintk=ttyS0 console=ttyS0 panic=1 oops=panic panic_on_warn verbose INIT_VERBOSE=yes init=/sbin/init -v
initrd /initrd.gz
boot
@george-hawkins
george-hawkins / arm64.md
Last active December 5, 2024 08:41
Running virtualized x86_64 and emulated arm64 Ubuntu cloud images using QEMU

QEMU arm64 cloud server emulation

This is basically a rehash of an original post on CNXSoft - all credit (particularly for the Virtio device arguments used below) belongs to the author of that piece.

Download the latest uefi1.img image. E.g. ubuntu-16.04-server-cloudimg-arm64-uefi1.img from https://cloud-images.ubuntu.com/releases/16.04/release/

Download the UEFI firmware image QEMU_EFI.fd from https://releases.linaro.org/components/kernel/uefi-linaro/latest/release/qemu64/

Determine your current username and get your current ssh public key: