#systemProgramming
environment variable中最关键的一个:
$PATH variable stores all path on your machine that your shell will use to search for programs
#systemProgramming
其实这个不算是system programming,google chrome左右切换tab的键盘快捷方式:command+option+左箭头/右箭头
#systemProgramming
"cd -"会把你带到你之前所在的directory里去。用这个指令,你可以来回浏览两个不同的directory。
#systemProgramming
其实这个不算是system programming,google chrome左右切换tab的键盘快捷方式:command+option+左箭头/右箭头
#systemProgramming
c++ stl里的multimap的key是按照binary search tree的结构存储的。(这也跟system没有关系吧)
#systemProgramming 如何用shell command创建带有空格的文件名:
方法一:mkdir my\ photo
方法二:mkdir "my photo"
这个问题困扰了我好久,macos上我可视化界面创建的带空格文件名的文件,常常cd不进去。现在知道该怎么做了。
#systemProgramming
原来c++ 也支持lambda的编程方法啊,简单的例子就是在图二function的parameter里inline一个function。和javascript很像。
#SystemProgramming
Container和Hypervisor的区别:
https://en.wikipedia.org/wiki/Hypervisor
https://en.wikipedia.org/wiki/OS-level_virtualization
type 1 hypervisor和type 2 hypervisor的区别如图。
=====================
ps:我以前的错误概念是,我以为的container实际上是container和type 2 hypervisor
我以为的hypervisor实际上是type 1 hypervisor。
#systemProgramming
但其实是大家都知道的把vector变成heap的STL。
https://www.cplusplus.com/reference/algorithm/make_heap/
#SystemProgramming
另一个新学到的security相关词汇是zero-day exploit vulnerability. 定义如下:
https://en.wikipedia.org/wiki/Zero-day_(computing)
不是搞security的所以稍微记住一点点。
#SystemProgramming 再给需要在server上做实验(尤其是跑并行计算项目)的同学推荐一个实用的工具——tmux。这个工具可以帮你在terminal里创建session。当你在server端创建了这个session并跑起来实验之后,你可以随时退出server端,断网,带着笔记本电脑去上课。回来再连上server,进入之前的tmux session,你就能看到实验结果了。
#SystemProgramming
虽然是个system phd但是我其实不知道sandbox是啥。于是把概念摘下来大家一起学习一下(已经知道的人就不用看了)
https://en.wikipedia.org/wiki/Sandbox_(computer_security)
#SystemProgramming 再给需要在server上做实验(尤其是跑并行计算项目)的同学推荐一个实用的工具——tmux。这个工具可以帮你在terminal里创建session。当你在server端创建了这个session并跑起来实验之后,你可以随时退出server端,断网,带着笔记本电脑去上课。回来再连上server,进入之前的tmux session,你就能看到实验结果了。
#SystemProgramming
小trick 1: makefile编译的时候LDFLAG最好放在-o之后。比如要写成
g++ -I/usr/local/include $^ -o $@ -L/usr/local/lib -lunwind
而不要写成:
g++ -I/usr/local/include -L/usr/local/lib -lunwind $^ -o $@
小trick 2: LD_PRELOAD={full_path of the target shared object file}
在说一个大家都知道但我还不知道的事情,在x86架构里,e开头的寄存器(例如$eip)是intel 32位处理器的寄存器,r开头的寄存器(例如$rip)是intel 64位处理器的寄存器。#SystemProgramming
#SystemProgramming linux 有一个command叫watch,watch -b ./executable的话,该程序以非exit(0)的状态退出,你的terminal就会发出beep的声音。适合我这种一边码字一边跑实验的人orz
继续#SystemProgramming , patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 <binary> ,可以用来修复一个程序的interpreter。
the interpreter is the program that “launches” the executable file. For a regular binary it’s the loader, i.e., /lib64/ld-linux-x86-64.so.2. For a script it would be the script interpreter (bash, python, etc). #systemProgramming
Kateです。アメリカのペン大でコンピューターシステムを研究している大学院生です。日本語を勉強しているから少し話せます。ビデオゲームが大好きです。
FC:SW-8149-0004-0143
PSN:kate0115