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 / gist:bb2cabd4868f010fc370f29a476083fb
Created December 3, 2019 13:10
sync error: collectChain failed
2019-12-03T20:56:33.719+0800 INFO build build/paramfetch.go:124 Parameter file /var/tmp/filecoin-proof-parameters/v19-proof-of-spacetime-election-09ae025de08399327e14f0cb6b4c907b6fe1e8b77046e31de8921bde588de900.vk is ok
2019-12-03T20:56:33.719+0800 INFO build build/paramfetch.go:124 Parameter file /var/tmp/filecoin-proof-parameters/v19-stacked-proof-of-replication-6ae8ae8998ef393ffd171487bc5141fa3642e9fd39e3a7dbada4f6e7bacffb9b.vk is ok
2019-12-03T20:56:33.719+0800 INFO build build/paramfetch.go:124 Parameter file /var/tmp/filecoin-proof-parameters/v19-stacked-proof-of-replication-f7b95455d6b7a5e967388a97c2ddc01807eff4c1736e84be4554853bf7783105.vk is ok
2019-12-03T20:56:33.719+0800 INFO build build/paramfetch.go:124 Parameter file /var/tmp/filecoin-proof-parameters/v19-proof-of-spacetime-election-512f5e6dc00a37fa13c8b0e468188f85957b7bf1ab36d17fb9fe9ed49ae8d657.vk is ok
2019-12-03T20:56:33.719+0800 INFO build build/paramfetch.go:124 Parameter file /var/tmp/filecoin-
@yhio
yhio / unsafe_use.go
Created June 26, 2019 15:35
unsafe use
package main
import (
"fmt"
"unsafe"
)
type person struct {
age int
name string
@yhio
yhio / underlying_type.go
Last active May 26, 2019 06:38
查看golang底层类型
package main
import (
"fmt"
"reflect"
)
type (
T1 string
T2 T1