Skip to content

Instantly share code, notes, and snippets.

View henrybear327's full-sized avatar

Chun-Hung Tseng henrybear327

View GitHub Profile
@henrybear327
henrybear327 / Makefile
Created June 13, 2024 16:24 — forked from APTy/Makefile
Run a makefile command with cleanup
# This file includes example usage and tests for the 'run-with-cleanup' call-able function.
.PHONY: test test-success test-failure main cleanup
-include cleanup.mk
test:
test.sh
main:
@henrybear327
henrybear327 / ARMonQEMUforDebianUbuntu.md
Created June 3, 2024 20:25 — forked from luk6xff/ARMonQEMUforDebianUbuntu.md
Emulating ARM with QEMU on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead

@henrybear327
henrybear327 / phoronix-cmd.md
Created August 30, 2021 00:16 — forked from anshula/phoronix-cmd.md
Phoronix Test Suite Cheat Sheet
@henrybear327
henrybear327 / delete_git_submodule.md
Created February 9, 2021 12:14 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@henrybear327
henrybear327 / latency.txt
Created June 10, 2019 11:47 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@henrybear327
henrybear327 / bibtex.png
Created March 4, 2019 13:57 — forked from max-mapper/bibtex.png
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@henrybear327
henrybear327 / vpn.md
Created June 10, 2018 11:14 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

(A Russian translation of this article can be found here, contributed by Timur Demin.)

Why not?

@henrybear327
henrybear327 / Google IO 2012.md
Created April 30, 2018 06:40 — forked from jdh747/Google IO 2012.md
Go Concurrency Patterns: Google IO 2012

Concurrency Patterns in Go

Notes taken from Rob Pike's presentation 'Google I/O 2012 - Go Concurrency Patterns'.

1. Generator: function that returns a channel

The code is as follows:

c := boring("boring!")  // function returning a channel

for i := 0; i < 5; i++ {
@henrybear327
henrybear327 / chinese.md
Last active October 18, 2017 14:56 — forked from BeMg/chinese.md
Statement of purpose

進修計劃書

在大學期間的選修課程選擇,令我廣泛的接觸了多個不同的資訊研究領域。在這其中,我對於電腦視覺與圖形識別的發展特別有興趣,接下來也打算朝著這個方面進行探索,期許自己可以在進入研究所前,有更明確的研究方向。

短程- 進入研究所前

在取得入學許可之後,會盡速與相關實驗室進行聯絡,尋求意見與協助,以利未來入學做準備。並且複習電腦科學的基本課程,重新溫習一些重要的概念,不忘記基本的準則,為此後的研究進行準備。準備複習的內容為下表:

  • 線性代數
  • 離散數學
@henrybear327
henrybear327 / README.md
Created April 24, 2017 23:53 — forked from magnetikonline/README.md
Bookmarklet to pretty print Gist pages without the usual page chrome, just content. Handy for Markdown document printing.

Pretty print bookmarklet helper for Gist pages

Create a new bookmark somewhere handy in your browser with the following URL:

javascript:var el=document.createElement('style');el.media='print';el.innerHTML='#header,.pagehead.repohead,.gist-description.container,.file-box .meta,#comments,.js-comment-form,#footer{display:none;}.file-box{border:0!important;}';document.getElementsByTagName('head')[0].appendChild(el);alert('Please consider the environment before printing :)');
  • Navigate to your Gist of choice
  • Hit the bookmarklet
  • Now print