/home.jpg

iptables的使用

iptables是用来设置、维护和检查Linux内核的IP包过滤规则的。 重置统计数据 注意:这里是重置所有端口的统计数据 重置所有输入端口 iptables -Z INPUT

Ubuntu内核升级与卸载

查看当前使用的内核 uname -a 查看系统中有的内核 dpkg –get-selections | grep linux-image 卸载无用内核 sudo apt-get purge + 内核名称 若卸载之后状态为deinstall,则执行 sudo dpkg -P linux-image-xxx-generic 安装新的内核

Inter汇编和AT&T的不同

The Syntax Register naming: Register names are prefixed with “%”. To reference eax: AT&T: %eax Intel: eax Source/Destination Ordering: In AT&T syntax (which is the UNIX standard, BTW) the source is always on the left, and the destination is always on the right. So let’s load ebx with the value in eax: AT&T: movl %eax, %ebx Intel: mov ebx, eax Constant value/immediate value format: You must prefix all constant/immediate values

zsh及oh-my-zsh安装与配置

zsh安装配置 sudo apt-get update sudo apt-get install zsh sudo chsh -s $(which zsh) $(whoami) //对用户$(whoami)改变默认sh为zsh oh-my-zsh安装配置 安装详情见官网 编辑 ~/.zshrc 中的Z

内存管理

内存管理需要解决的问题 进程在内存中怎么放(或说进程在内存中的布局) 限制进程对另一个进程的内存读写(或说对内存的保护) 内存空间利用率最大化 基本

虚拟内存

要点和概念解释 虚拟内存技术的优点 虚拟内存技术使得一块内存中同时存在的进程数增多,从而使得CPU的利用率和吞吐量增加,而不影响响应时间和周转时

程序运行时间计时

clock() clock: 捕捉从程序开始运行到clock()被调用时所耗费的时间。这个时间单位是tick,即“时钟打点”。 常数CLOCKS_PER_SEC:机器时

时间复杂度

时间复杂度 for循环 复杂度等于循环的次数乘以循环体代码的复杂度 if else 复杂度等于if的条件判断复杂度和两个分期部分的复杂度三者中最大的 注意 当设计

最大连续子列和

O(n)解法 //如果是负数则返回零 int MaxSubsequence(int a[], int n) { int maxSum = 0, thisSum = 0; for (int i = 0; i < n; i++) { thisSum += a[i]; if (thisSum > maxSum) maxSum = thisSum; if (thisSum < 0) thisSum = 0; } return maxSum; } //返回最大的子序