Skip to content

Instantly share code, notes, and snippets.

View yhio's full-sized avatar
🎯
Focusing

Jack yhio

🎯
Focusing
View GitHub Profile
@yhio
yhio / mvcc.rs
Created November 15, 2022 06:23 — forked from xutianyi1999/mvcc.rs
use std::ops::Deref;
use std::sync::{Arc, RwLock};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Duration;
struct ConcurrentCache<V> {
version: AtomicUsize,
inner: RwLock<V>,
}
@yhio
yhio / devnet-clean.fish
Created April 6, 2022 03:40 — forked from ZenGround0/devnet-boost.fish
Fish scripts for an easy local devnet (mostly plagiarized and adapted from scripts of @jennijuju)
function devnet-clean
rm -rf ~/.lotus
rm -rf ~/.lotusminer
rm -rf ~/.genesis-sectors
end
@yhio
yhio / fix_parallels_tools_install.md
Created April 3, 2022 09:54 — forked from xiaozhuai/fix_parallels_tools_install.md
fix parallels tools install issue

install log

cd prl_fs/SharedFolders/Guest/Linux/prl_fs && make CC=cc
make[1]: Entering directory '/usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs'
make -C /lib/modules/5.0.0-25-generic/build M=/usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs CC=cc
make[2]: Entering directory '/usr/src/linux-headers-5.0.0-25-generic'
  CC [M]  /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.o
/usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c: In function 'prlfs_remount':
/usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c:119:21: error: 'MS_RDONLY' undeclared (first use in this function); did you mean 'IS_RDONLY'?
  if ( (!((*flags) & MS_RDONLY) && PRLFS_SB(sb)->readonly) ||
@yhio
yhio / README.md
Created August 24, 2021 10:31 — forked from mahemoff/README.md
Vim Terminal Mode - A short introduction

Vim has a Terminal Mode!

Since v8.1 (May 2018), Vim has shipped with a built-in terminal. See https://vimhelp.org/terminal.txt.html or type :help terminal for more info.

Why use this? Mainly because it saves you jumping to a separate terminal window. You can also use Vim commands to manipulate a shell session and easily transfer clipboard content between the terminal and files you're working on.

Key Bindings

@yhio
yhio / tmux-cheatsheet.markdown
Created April 30, 2020 01:57 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@yhio
yhio / test-storage-and-retrieval-local-dev-net.sh
Created April 10, 2020 02:07 — forked from laser/filecoin-storage-retrieval-cluster-test.sh
run lotus storage and retrieval flows on a local dev network
#!/usr/bin/env bash
# USAGE:
#
# Option 1: Build and run tests using specific lotus Git SHA:
#
# > ./test-storage-and-retrieval-local-dev-net.sh --lotus-git-sha=15b3e57634458af983082dcbb736140bba2abfdb
#
# Option 2: Build and run using binaries you've built previously (much faster)
#
@yhio
yhio / serve.go
Created January 4, 2020 14:42 — forked from paulmach/serve.go
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
@yhio
yhio / rsa_util.go
Created May 15, 2019 09:10 — forked from miguelmota/rsa_util.go
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
@yhio
yhio / Install_gcc7_ubuntu_16.04.md
Created March 12, 2019 05:07 — forked from jlblancoc/Install_gcc7_ubuntu_16.04.md
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

@yhio
yhio / tmux-cheatsheet.markdown
Created March 11, 2019 09:31 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话: