Skip to content

Instantly share code, notes, and snippets.

View deyuhua's full-sized avatar

华德禹 deyuhua

View GitHub Profile
@deyuhua
deyuhua / install-fonts.txt
Created September 11, 2021 09:03 — forked from matthewhartman/install-fonts.txt
Install TTF Fonts in Debian
cd fonts
mv *.ttf /usr/share/fonts/truetype
cd /usr/share/fonts/truetype
mkfontscale
mkfontdir
fc-cache
xset fp rehash
@deyuhua
deyuhua / struct_to_bytes.go
Created February 9, 2021 02:16 — forked from SteveBate/struct_to_bytes.go
Example of converting a struct to a byte slice, compressing with gzip, and saving to file followed by the reverse process back to a struct
package main
import (
"bytes"
"compress/gzip"
"encoding/gob"
"fmt"
"io/ioutil"
"log"
"os"
@deyuhua
deyuhua / codesign_gdb.md
Created September 29, 2020 16:37 — forked from hlissner/codesign_gdb.md
Codesign gdb on OSX
@deyuhua
deyuhua / gccemacs_osx.md
Created August 17, 2020 14:09 — forked from mikroskeem/gccemacs_osx.md
gccemacs on OSX

gccemacs on OS X

Read this first: http://akrl.sdf.org/gccemacs.html

Prerequisites

1) GCC with libgccjit enabled

For that you need to compile gcc (duh). I edited Homebrew's gcc formula:

Download CMake from: https://cmake.org/download/

wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz

Compile from source and install

tar zxvf cmake-3.*
@deyuhua
deyuhua / BUILD
Last active April 13, 2020 11:37 — forked from bsilver8192/BUILD
Basics of generating a compile_commands.json file with Bazel
py_binary(
name = 'generate_compile_command',
srcs = [
'generate_compile_command.py',
],
deps = [
'//third_party/bazel:extra_actions_proto_py',
],
)
@deyuhua
deyuhua / debugging_kernel.txt
Created March 14, 2020 14:30 — forked from hngouveia01/debugging_kernel.txt
Debugging kernel code line by line with Qemu and GDB
We are going to use buildroot to download, configure and compile the kernel.
First, download and uncompress buildroot: https://buildroot.org/download.html
Go to the directory and:
make qemu_x86_defconfig
make menuconfig
@deyuhua
deyuhua / bplustree.py
Created February 11, 2020 03:21 — forked from savarin/bplustree.py
Python implementation of a B+ tree
class Node(object):
'''
Base node object.
Each node stores keys and values. Keys are not unique to each value, and
as such values are stored as a list under each key.
Attributes:
order (int): The maximum number of keys each node can hold.
'''
git config --global alias.lola "log --graph --decorate --pretty=oneline --abbrev-commit --all"
@deyuhua
deyuhua / simple_args_parsing.sh
Created March 22, 2019 12:58 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"