Skip to content

Instantly share code, notes, and snippets.

View jzhou77's full-sized avatar
🏠
Working from home

Jingyu Zhou jzhou77

🏠
Working from home
  • Apple
  • Cupertino
  • 13:33 (UTC -12:00)
View GitHub Profile

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@jzhou77
jzhou77 / gist:c1116f82197693aa3fe69a53950cd72b
Created March 17, 2021 21:00
"Assertion newState.tLogs[0].tLogWriteAntiQuorum == self->configuration.tLogWriteAntiQuorum && newState.tLogs[0].tLogReplicationFactor == self->configuration.tLogReplicationFactor failed @ /root/src/foundationdb/fdbserver/masterserver.actor.cpp 1419:"
Issuing configuration change: memory-radixtree-beta
Issuing configuration change: memory-1
Issuing configuration change: backup_worker_enabled:=1
Issuing configuration change: log_version:=4
Issuing configuration change: double usable_regions=1 regions=[{"datacenters":[{"id":"0","priority":1}]},{"datacenters":[{"id":"1","priority":-1}]}] logs=-1
(gdb) p *(newState.tLogs._M_impl._M_start)
$5 = {tLogs = {<std::_Vector_base<UID, std::allocator<UID> >> = {
_M_impl = {<std::allocator<UID>> = {<__gnu_cxx::new_allocator<UID>> = {<No data fields>}, <No data fields>}, _M_start = 0x7ffff67ffa00,
_M_finish = 0x7ffff67ffa30, _M_end_of_storage = 0x7ffff67ffa40}}, <No data fields>}, tLogWriteAntiQuorum = 0,
'recovery-duration.txt' file content:
Duration
0.127489
0.134138
0.151415
0.180696
0.196397
0.212269
0.243426
@jzhou77
jzhou77 / Resize Linux Partitions.txt
Last active February 16, 2020 04:19
Resize Linux Partitions
You cannot resize a mounted disk in Linux. Probably the easiest way to do this is to download the gparted live CD .iso file and tell your Ubuntu VM to boot from that image as the CD Drive. Then you should be able to resize your existing hard drive partition. When gparted is finished shut down your VM and reset your VM boot order to boot from the Hard Drive again.
Here is an article that explains the process for VMWare:
http://data.agaric.com/increase-main-partition-size-ubuntu-within-vmware-fusion
Steps 1,3 and 6 are only things that should be different.
Step 1 - you have already done.
Step 3 - Use Configure... | Hardware | Boot Order to change the Boot Order and Hardware | CD/DVD 1 to point your CD to the downloaded .iso (also ensure that the Connected checkbox is checked, otherwise Parallels will ignore the CD drive during boot)
@jzhou77
jzhou77 / FDB Notes.md
Last active May 13, 2022 16:26
FDB Random Notes
# compile bindings
m bindings|fdb_c|fdb_python|fdb_flow|fdb_flow_tester
fdbserver -p 127.0.0.1:4504 -C fdb/test.cluster
# install new C binding library, or use packages
sudo cp /media/psf/Home/fdb/foundationdb/lib/libfdb_c.so /usr/lib/libfdb_c.so
sudo dpkg -i /media/psf/Home/fdb/foundationdb/packages/foundationdb-clients_6.2.0-0INTERNAL_amd64.deb
sudo dpkg -i /media/psf/Home/fdb/foundationdb/packages/foundationdb-server_6.2.0-0INTERNAL_amd64.deb
@jzhou77
jzhou77 / gist:718253fc73ad62ae2bac45cbc7b7efce
Created June 30, 2019 01:38 — forked from johanmeiring/gist:3002458
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
Use open source QPDF:
$ qpdf --decrypt input.pdf output.pdf
And the restrictions were removed. Note that the original PDF was not password protected.
Another way of using ghostscript:
$ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=OUTPUT.pdf -f INPUT.pdf
https://www.interviewbit.com 这里有design题目和一些解答,有公司tag看一个公司问的题目,烙印网站
https://leetcode.com/ 题目很多,国人网站
System Design Interview
- https://github.com/checkcheckzz/system-design-interview
- https://www.careercup.com/page?pid=system-design-interview-questions
- http://www.hiredintech.com/system-design
- https://www.quora.com/How-do-I-prepare-to-answer-design-questions-in-a-technical-interview
- https://www.palantir.com/2011/10/how-to-ace-a-systems-design-interview/
@jzhou77
jzhou77 / gist:9f9fea259a40047da59b347d79ee4366
Last active August 3, 2018 11:51
百度云批量下载
这两天儿子要听舒克和贝塔,恰好只有百度盘上面有。Mac版的百度盘客户端做的很差,好像只能支持全部文件同步,所以早就删掉了。怎么办?
研究了一下,从http://codespaper.com/2015/07/19/baiduyun-fastdown/看到一个方法,只要装一个Chrome的插件和另外一个命令行的工具。这太适合我了——最喜欢用命令行搞定东西了。
##软件安装
Chrome插件在这里:https://github.com/acgotaku/BaiduExporter
另外一个软件叫Aria2(https://sourceforge.net/projects/aria2/),MacPort上直接有,一个命令搞定:
port install aria2