Skip to content

Instantly share code, notes, and snippets.

View BH1SCW's full-sized avatar

F.J Kong BH1SCW

View GitHub Profile
@jrblevin
jrblevin / fantastical-capture.el
Created August 17, 2015 00:16
Sending Events to Fantastical 2 from Emacs <http://jblevins.org/log/emacs-fantastical>
;; To send events from Emacs to Fantastical using Control-C Control-F,
;; drop this script in your Emacs load path and add lines like these to
;; your .emacs:
;;
;; (autoload 'send-region-to-fantastical "fantastical-capture" "Send region to Fantastical" t)
;; (global-set-key (kbd "C-c C-f") 'send-region-to-fantastical)
;;
;; See http://jblevins.org/log/emacs-fantastical for details.
(defun applescript-quote-string (argument)
@snixon
snixon / mosh-agent-forwarding-ng.rb
Created October 16, 2015 19:23
Homebrew Formula: mosh with agent forwarding
require "formula"
class MobileShell < Formula
desc "Remote terminal application"
homepage "https://mosh.mit.edu/"
url "https://mosh.mit.edu/mosh-1.2.5.tar.gz"
sha256 "1af809e5d747c333a852fbf7acdbf4d354dc4bbc2839e3afe5cf798190074be3"
bottle do
sha256 "046b0c48cd1c573d57500e683122e3152a00556ad960938c6caa962b0c2ef460" => :el_capitan
@george-hawkins
george-hawkins / arm64.md
Last active May 27, 2025 15:47
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:

@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
@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`
*)
@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:
#!/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} \
@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();
}

@extremecoders-re
extremecoders-re / qemu-networking.md
Last active September 3, 2025 00: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