linux
iteye_15479
这个作者很懒,什么都没留下…
展开
-
Makefile tutorial
Old but good.[url]http://www.codeproject.com/Articles/31488/Makefiles-in-Linux-An-Overview[/url]You should also notice the use of special characters (- and @) preceding the commands. As expl...原创 2013-01-07 14:30:58 · 121 阅读 · 0 评论 -
how to explain free buffers and cached memory usage
free -m total used free shared buffers cachedMem: 48269 2424 45845 0 139 1120-/+ buffers/cache: 1164 47105...原创 2011-07-18 11:57:38 · 141 阅读 · 0 评论 -
Pro Git Tips
1. git init Create a new repo with exsiting project. 2. git diffThis command compares what's in your working directory with what's in your staging area. The result tells what changes have not...2011-07-14 17:53:20 · 114 阅读 · 0 评论 -
shell中计算
a=10b=2c=$[ $a + $b ]echo $c2009-10-15 14:56:35 · 94 阅读 · 0 评论 -
ZFS文件系统的特点以及调优
Record SizeRecord Size 也就是通常所说的文件系统的block size。ZFS采用的是动态的Record Size,也就是说ZFS会根据文件大小选择*适合*的512字节的整数倍作为存储的块大小,最大的RecordSize为128KB。通常没有必要手工设置Record Size。如果手工把Record Size调小,将不会得到空间的节省,并且常常会影响性能。ZFS的Block是...原创 2009-10-14 10:45:49 · 2552 阅读 · 0 评论 -
Copy-On-Write Strategy in ZFS
http://blogs.sun.com/bjoyes/entry/zfs Zfs is a transaction-based filesystem, as ZFS makes copy-on-write operations when there are modifications of files from filesystems, by transactions. This me...原创 2009-10-14 10:35:17 · 304 阅读 · 0 评论 -
sudo: sorry, you must have a tty to run sudo
I was recently working on a Perl script that would SSH to another server and run a sudo command on the remote server that was failing. The error that was received is below.Error: sudo: sorry, you ...原创 2009-10-12 13:56:48 · 183 阅读 · 0 评论 -
从此sudo不再输密码
#sudo visudo最后一次输入密码。 在最后一行加入:xxx ALL=NOPASSWD: ALL xxx即为你当前使用的用户名,Ctrl+X,保存退出。 从此告别每次都要输密码的时代。...原创 2009-10-10 15:15:43 · 97 阅读 · 0 评论 -
怎么清除linux的内存和cache
http://hi.baidu.com/icej/blog/item/c362c33f88093bc57c1e71ea.html /proc是一个虚拟文件系统,我们可以通过对它的读写操作做为与kernel实体间进行通信的一种手段.也就是说可以通过修改/proc中的文件,来对当前kernel的行为做出调整.那么我们可以通过调整/proc/sys/vm /drop_caches来释放内存.操作...原创 2009-09-27 14:50:54 · 147 阅读 · 0 评论 -
linux下进程间通信的几种主要手段简介
SemaphoreFileSignalPipeSocketMessage QueueShared Memory原创 2009-09-20 21:48:00 · 91 阅读 · 0 评论 -
Boost socket performance on Linux
Boost socket performance on LinuxFour ways to speed up your network applicationsLevel: IntermediateM. Tim Jones (mailto:mtj@mtjones.com?subject=Boost socket performance ...原创 2009-09-17 14:15:51 · 151 阅读 · 0 评论 -
find: paths must precede expression
< In Linux bashyou may face an error while using wildcard * to search files. For e.g.trying to search all jar files with following command:find . -name *.jar...原创 2009-09-14 11:33:49 · 152 阅读 · 0 评论 -
shell获取ip地址
ip=$(grep $(hostname) /etc/hosts| awk '{print $1}')原创 2009-08-25 21:28:20 · 204 阅读 · 0 评论 -
正则表达式 sed 用法
1. Sed简介sed 是一种在线编辑器,它一次处理一行内容。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(patternspace),接着用sed命令处理缓冲区中的内容,处理完成后,把缓冲区的内容送往屏幕。接着处理下一行,这样不断重复,直到文件末尾。文件内容并没有改变,除非你使用重定向存储输出。Sed主要用来自动编辑一个或多个文件;简化对文件的反复操作;编写转换程序等。...原创 2009-08-25 13:30:26 · 207 阅读 · 0 评论 -
awk code
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'原创 2010-10-26 17:53:46 · 93 阅读 · 0 评论 -
Ten Amazing Linux Commands
sudo !!以 root 帐户执行上一条命令。python -m SimpleHTTPServer利用 Python 搭建一个简单的 Web 服务器,可通过 http://$HOSTNAME:8000 访问。 :w !sudo tee %在 Vim 中无需权限保存编辑的文件。cd -更改到上一次访问的目录。^foo^bar...原创 2010-11-08 22:42:42 · 104 阅读 · 0 评论 -
set cpu performance mode
A cheap/dirty little hack to increase idle CPU frequency and increase performance in general (don't blame me when your battery runs dry in about 3 hours):(must have root first!)cat /proc/cpuinfo (use ...原创 2010-11-15 14:38:48 · 1542 阅读 · 0 评论 -
crontab定期执行命令详解,以及实例
使用时可以参考这个博客:[url]http://blog.51yip.com/linux/1046.html[/url]原创 2012-12-18 17:29:07 · 114 阅读 · 0 评论 -
cvs不能更新文件的权限
一个project用到了古老的cvs管理源代码。一个文件我commit之后发现没有执行权限,于是在自己的working copy改变了文件的mode重新commit,但是发现无法更改cvs repository里面的文件执行权限。处理办法。。。要么去cvs里面改,要么去除这个文件,重新添加?...原创 2012-06-28 13:07:18 · 197 阅读 · 0 评论 -
一个命令创建多个目录
可能我太土了,才发现下面这个命令!mkdir -p src/{test,main}/{java,resources}原创 2013-06-13 12:36:40 · 313 阅读 · 0 评论 -
use "--links" option of rsync
Today I used rsync to copy some files but I found for symbolic links it will ignore them if you just use simple command line:rsync SRC DESTWith google, I finally figure out I need to add the "...原创 2013-05-23 10:45:25 · 129 阅读 · 0 评论 -
GNU Make Variables: simple and recursive
今天有时间看了一下teammate写的makefile,学习了一下,其中发现定义变量的时候用的是=,有的是:=,查了一下发现真的有学问在里面。这是一篇讲得很清楚的文章:[url]http://www.electric-cloud.com/blog/2009/03/23/makefile-performance-shell/[/url]...原创 2012-04-19 14:17:46 · 84 阅读 · 0 评论 -
How do I find the largest top 10 files in linux?
http://www.cyberciti.biz/faq/how-do-i-find-the-largest-filesdirectories-on-a-linuxunixbsd-filesystem/To find out largest file only use command ls as follows in current directory:ls -lSh . | head...原创 2012-04-06 15:24:43 · 156 阅读 · 0 评论 -
xargs usage with multi arguments
http://offbytwo.com/2011/06/26/things-you-didnt-know-about-xargs.html I saw this article when I was wondering how to move a lot of files listed in a file to another place. I found xargs is very ...原创 2011-11-30 12:24:44 · 112 阅读 · 0 评论 -
vim tips
I read some articles about vim tips. Now I write down the ones I have tried successfully here.1. 在insert模式下,C-R (register) 插入register里的内容,一个有趣的reg是"=".假设你想输入123K的具体字节数,不用打开计算器,试试这个“=1024*123”,...原创 2012-07-04 13:59:38 · 122 阅读 · 0 评论 -
Queue sysfs files
Based on kernel version 2.6.34. Page generated on 2010-05-31 16:02 EST.1 Queue sysfs files2 =================3 4 This text file will detail the queue files that are located in the sysfs tree...原创 2010-07-28 13:50:31 · 121 阅读 · 0 评论 -
Install blktrace
I use libaio-0.3.106.tar.gz and blktrace-1.0.1.tar.gz to install blktrace on my linux server. 1. Install libaio make prefix=/usr install 2. Install blktrace make intall See the blk...原创 2010-07-27 13:15:23 · 103 阅读 · 0 评论 -
"error in locking authority file .Xauthority
今天在windows上vncviewer连linux机器的时候,报这个错误。 解决方案: 删除所有~/.Xauthority文件。原创 2011-01-11 11:34:08 · 6188 阅读 · 1 评论 -
raid 0 vs. raid1
RAID 0 (block-level striping without parity or mirroring) provides improved performance and additional storage but no redundancy or fault tolerance (making it not true RAID, according to the acrony...原创 2010-12-30 10:20:38 · 130 阅读 · 0 评论 -
hwo to configure linux vncserver
http://bobpeers.com/linux/vnc原创 2010-12-24 14:10:54 · 125 阅读 · 0 评论 -
Linux System and Performance Monitoring(CPU篇)
Linux System and Performance Monitoring(CPU篇)Date: 2009.07.21Author: Darren Hoch译: Tonnyom[AT]hotmail.com 2009.08.10前言: 网上其实有很多关于这方面的文章,那为什么还会有此篇呢,有这么几个原因,是我翻译的动力,第一,概念和内容虽然老套,但都讲得很透彻,而且还很全面.第二,理论结合实...原创 2009-08-22 00:06:04 · 131 阅读 · 0 评论 -
Linux System and Performance Monitoring(I/O篇)
6.0 I/O 监控介绍磁盘I/O 子系统是Linux 系统中最慢的部分.这个主要是归于CPU到物理操作磁盘之间距离(译注:盘片旋转以及寻道).如果拿读取磁盘和内存的时间作比较就是分钟级到秒级,这就像 7天和7分钟的区别.因此本质上,Linux 内核就是要最低程度的降低I/O 数.本章将诉述内核在磁盘和内存之间处理数据的这个过程中,哪些地方会产生I/O.6.1 读和写数据 - 内存页Linux 内...原创 2009-08-22 00:04:37 · 96 阅读 · 0 评论 -
Linux NFS mount: failed, reason given by server: Permission denied
I met this problem last week and it frustrated me for days...Now I found the solution after I spent hours on google, and amazing it works!!!Linux NFS mount: failed, reason given by server: Permissio...原创 2009-07-20 22:50:52 · 240 阅读 · 0 评论 -
awk使用实例
awk使用实例(转载)2009-08-25 16:41简介awk是一种编程语言,非常适合处理文本,使用简单,功能却很强大。awk扫描文件中的每一行,查找与命令行中所给定内容相匹配的模式。如果发现匹配内容,则进行下一个编程步骤。如果找不到匹配内容,则继续处理下一行示例基本使用输出文件的第一列awk '{print $1}' access_log...原创 2010-02-09 15:47:13 · 143 阅读 · 0 评论 -
vim的一个问题
E575: viminfo: Illegal starting char in line: <ca><fe><ba><be>E575: viminfo: Illegal starting char in line: Exceptions^GE575: viminfo: Illegal starting char in line: Source...原创 2010-01-12 11:08:55 · 483 阅读 · 0 评论 -
shell scripting
1. How do you find out what抯 your shell?Operating System/Shell Scriptingecho $SHELL2. How do you fire a process in the background?Operating System/Shell Scripting...原创 2010-01-06 14:59:39 · 161 阅读 · 0 评论 -
内核态和用户态的区别
当一个任务(进程)执行系统调用而陷入内核代码中执行时,我们就称进程处于内核运行态(或简称为内核态)。此时处理器处于特权级最高的(0级)内核代码中执行。当进程处于内核态时,执行的内核代码会使用当前进程的内核栈。每个进程都有自己的内核栈。当进程在执行用户自己的代码时,则称其处于用户运行态(用户态)。即此时处理器在特权级最低的(3级)用户代码中运行。当正在执行用户程序而突然被中断程序中断时,此时用户程序...原创 2010-01-04 11:43:21 · 131 阅读 · 0 评论 -
TCP-tuning
http://fasterdata.es.net/TCP-tuning/linux.html TCP Performancehttp://www.cisco.com/web/about/ac123/ac147/ac174/ac196/about_cisco_ipj_archive_article09186a00800c8417.html UNIX 网络性能分析 http...原创 2009-12-08 10:38:47 · 163 阅读 · 0 评论 -
SHELL数组学习
SHELL数组学习总结(一)1、数组声明:MACHINE=(172.16.69.1 172.16.69.2 172.16.69.3 172.16.69.4 172.16.69.5 172.16.69.1)2、删除数组变量(但不知道怎么把这个变量从数组内彻底删除掉):unset MACHINE[0]3、print数组变量:print第一个变量的值:echo ${MACHINE[0]}print数组内...原创 2009-11-09 16:31:36 · 102 阅读 · 0 评论 -
shell 按行读取并保存成数组
从ip.txt里读取IP.然后把IP地址赋值到一个数组里.IP文件如下:Address: 220.181.26.163Address: 220.181.26.174Address: 220.181.26.175Address: 220.181.26.176Address: 220.181.19.228Address: 220.181.19.229Address: 220.181.26...原创 2009-11-06 09:41:26 · 868 阅读 · 0 评论