Skip to content

Instantly share code, notes, and snippets.

View wey-gu's full-sized avatar
🥑
Believe in OpenSource and build in public w/ magic to help others do the same.

Wey Gu wey-gu

🥑
Believe in OpenSource and build in public w/ magic to help others do the same.
View GitHub Profile
@wey-gu
wey-gu / vim_tmux_cheatsheet.md
Last active October 14, 2017 22:38
Vim, tmux cheatsheet

vim

c i w
c i [
c i <

tmux

@wey-gu
wey-gu / osx_keyboardspeed.sh
Created August 15, 2019 15:47 — forked from karolyi/osx_keyboardspeed.sh
Mac OS X super fast keyboard speed
#!/usr/bin/env bash
# http://papers.ch/speeding-up-your-mac-osx-terminal-input/
#echo "Disable press-and-hold for keys in favor of key repeat"
#defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
echo "Set a blazingly fast keyboard repeat rate"
defaults write NSGlobalDomain KeyRepeat -int 2
@wey-gu
wey-gu / iSH-App-Timezone-Configuration.md
Last active February 28, 2021 14:02
Time zone Configuration for iSH App
apk add tzdata

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

echo "Asia/Shanghai" > /etc/timezone

date -R # Verify that it's working properly
@wey-gu
wey-gu / 2050-website-graph-design.md
Last active June 22, 2021 14:24
2050-website-graph-design

2050 website design, graph part

By 古思为

设计需求 via 庄表伟

简单介绍一下我的思路。在2050,最重要的就是人与人之间产生的各种关系,我是被谁“interface”来的,我又“interface”了哪些人。我发起了一个,有哪些因此被吸引而来(有些人是来帮忙,有些人只是来参加活动),我在2050的聚会中,与谁聊得特别开心,后来就follow了TA,进一步关注TA的一举一动,等等。

在一个人的个人页面上,我们会在右侧,先简单展示他的“上下游”关系,点击更多,可以把各种关系都展示出来,越是与他有N种关系的人,就会离他越近

  • Get the nebula cluster's metaD ports
$ docker port nebula-docker-compose_metad0_1 | grep ^9559
9559/tcp -> 0.0.0.0:49189
$ docker port nebula-docker-compose_metad1_1 | grep ^9559
9559/tcp -> 0.0.0.0:49190
$ docker port nebula-docker-compose_metad2_1 | grep ^9559
9559/tcp -> 0.0.0.0:49188
@wey-gu
wey-gu / nebula-graph-dev-pitfalls-to-avoid.md
Created November 30, 2021 09:33
nebula graph contribution pitfalls to avoid
@wey-gu
wey-gu / ldb-debug-nebula.md
Last active January 17, 2022 01:52
Debug nebula graph with ldb
# install dependencies like gflag,lz4, etc... referring to ref:2.
# e.g. ubuntu
sudo apt-get install libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev

git clone [email protected]:facebook/rocksdb.git
git checkout 6.15.fb # as in nebula 2.6.0 , check on /opt/vesoft/third-party/3.0/include/rocksdb/version.h
cd rocksdb
cmake -DWITH_LZ4=ON -DWITH_ZLIB=ON -DWITH_SNAPPY=ON
make ldb -j 64 # specify your thread number here
@wey-gu
wey-gu / hot-build-nebula-algo.md
Created February 8, 2022 09:13
Build a nebula-algo jar package with a local nebula-java jar package

How I built this nebula-algorithm-2.6.1-patched-domain-name.jar ./*:

  • Checkout vesoft-inc/nebula-java#437 and build nebula-java client: mvn -B package -Dmaven.test.skip
  • Download nebula-algo 2.6.1 jar package
  • cd temp_algo;jar -xvf nebula-algorithm-2.6.1.jar
  • cd ../temp_client;jar -xvf client-2.6.1.jar
  • cd ../temp_algo;cp -r ../temp_client/com/vesoft/nebula/* com/vesoft/nebula;rm nebula-algorithm-2.6.1.jar
  • jar -cfM0 nebula-algorithm-2.6.1-patched-domain-name.jar ./*
@wey-gu
wey-gu / nebula-algo-louvain.md
Created March 1, 2022 07:13
run Louvain in nebula-algorithm

Here is an example that I performed a Louvain algorithm, it's basically what I had done in this post: https://siwei.io/nebula-livejournal/

Nebula Console:

CREATE SPACE louvain (partition_num=15, replica_factor=1, vid_type=FIXED_STRING(256)) comment="louvain test";

create tag user() comment = 'user';

create edge relation(weight int)  COMMENT = 'user relation';