
Linux
zgl_dm
这个作者很懒,什么都没留下…
展开
-
Linux操作系统下三种配置环境变量的方法
现在使用linux的朋友越来越多了,在linux下做开发首先就是需要配置环境变量,下面以配置java环境变量为例介绍三种配置环境变量的方法。 1.修改/etc/profile文件 如果你的计算机仅仅作为开发使用时推荐使用这种方法,因为所有用户的shell都有权使用这些环境变量,可能会给系统带来安全性问题。 (1)用文本编辑器打开/etc/profile (2)在profile文件末尾加入: JAVA_HOME=/usr/share/jdk1.5.0_05 PATH=$JAVA_HOM转载 2010-11-22 14:55:00 · 550 阅读 · 0 评论 -
ssh登录很慢的问题
登录很慢,登录上去后速度正常,这种情况主要有两种可能的原因: 1. DNS反向解析的问题OpenSSH在用户登录的时候会验证IP,它根据用户的IP使用反向DNS找到主机名,再使用DNS找到IP地址,最后匹配一下登录的IP是否合法。如果客户机的IP没有域名,或者DNS服务器很慢或不通,那么登录就会很花时间。解决办法:只需修改/etc/ssh/sshd_config,设转载 2012-02-06 10:29:00 · 878 阅读 · 0 评论 -
vmware uninstall
sudo vmware-installer -u vmware-workstation原创 2013-02-20 23:55:08 · 1311 阅读 · 0 评论 -
keepalive的简单应用——管理VIP的飘动
VIP的飘动可以为我们解决很多问题,以前我试过使用ifup/ifdown的方式控制网卡的up/down来实现,这种方式有个小问题,就是每次VIP飘动之后都要等上几十秒才能生效,感觉时间比较长,而且还要配合一些逻辑脚本才能很好地工作,有没有更好的方法呢?当然有,这就是本文的主角——keepalived。 安装很简单:tar zxvf keepalived-1.1.20.tar.gz转载 2013-02-17 10:09:01 · 2566 阅读 · 0 评论 -
linux epoll用法
linux下的epoll用法研究:1. 先写一下epoll比select模型的优点: 其实select模型也挺好的,但是select有一个限制,那就是最多能同时检查1024个fd,这linux/posix_types.h中有具体定义如下:#define __FD_SETSIZE 1024表示select最多同时监听1024个fd,当然,可以通过修改这个值再重编译内核转载 2012-11-15 18:16:34 · 707 阅读 · 0 评论 -
select,poll和epoll使用
IO 多路转接当从一个文件描述符读,然后写到另一个文件描述符,可以在下列形式的循环中使用阻塞IO。while((n= read(STDIN_FILENO, buf, BUFSIZ))> 0) if(write(STDOUT_FILENO, buf, n)!= n) err_sys("write error转载 2012-11-15 16:20:16 · 792 阅读 · 0 评论 -
linux rename 用法
Linux 下的 rename 命令有两个版本:C语言版本Perl语言版本其中,C语言版本的命令如下: rename 原字符串 新字符串 文件名 样例1: 目录 test 下存在两个文件: a_01 、a_02,若需要将文件名中的 a 替换为 b, 其他部分原创 2011-07-23 09:59:39 · 31300 阅读 · 0 评论 -
安装 nginx
<br />首先安装 pcre<br />cd pcre-8.10<br />./configure --prefix=/opt<br />make<br />make install<br /> <br />然后安装 nginx<br />cd nginx-1.0.0<原创 2011-04-22 01:16:00 · 820 阅读 · 0 评论 -
net.ipv4.tcp_tw_reuse and nat network
In the past days, we always modify sysctl.conf:net.ipv4.tcp_tw_recycle = 1net.ipv4.tcp_tw_reuse = 1to increase the linux network performance转载 2011-07-08 20:02:41 · 2355 阅读 · 0 评论 -
Linux kernel scaling: Ports and port Cycling
NOTE: The content of this article is subject to change as we are still investigating the issueWhile attempting to benchmark redis a coworker转载 2011-07-08 20:25:00 · 639 阅读 · 0 评论 -
比较目录A和目录B下的文件的不同
<br /><br /> 比较目录A和目录B下的文件的不同,使用下面的命令<br /> <br /> diff -c -a -b -x *.bak A B > AB.diff<br /><br /><br /> 其中<br /> -c 采用content的format输出different<br /> -a 强制使用text的模式<br /> -b 忽略空白的不同<br /> -x 过滤掉所比较目录中一些不想比较的文件类型<br /> <b原创 2011-05-10 09:57:00 · 873 阅读 · 0 评论 -
The tcprstat User's Manual
<br />tcprstat is a free, open-source TCP analysis tool that watches network traffic and computes the delay between requests and responses. From this it derives response-time statistics and prints them out. The output is similar to other Unix -st转载 2011-04-26 15:55:00 · 1463 阅读 · 0 评论 -
Linux Start Restart and Stop The Cron or Crond Service
How do I start, restart and stop the cron service under Linux / UNIX / BSD like operating systems?Cron (crond) daemon or service is use to execute scheduled commands or scripts. cron wakes up every minute, examining all stored crontabs, checking eac转载 2011-04-28 10:46:00 · 2744 阅读 · 0 评论 -
Linux定时执行任务命令概述:at和crontab
本文介绍在Linux下的两种定时执行任务的方法:at命令,以及crontab服务。(1)at命令假如我们只是想要让特定任务运行一次,那么,这时候就要用到at监控程序了。设置at命令很简单,指示定运行的时间,那么就会在哪个时候运行。at类似打印 进程,会把任务放到/var/spool/at目录中,到指定时间运行它 。at命令相当于另一个shell,运行at time命令时,它发送一个个命令,可以输入任意命令或者程序。at now + time命令可以在指示任务。假设处理一个大型数据库,要在别人不用系统转载 2011-03-18 12:26:00 · 1022 阅读 · 0 评论 -
rsync从linux到linux的文件同步备份
一、环境需要备份文件的服务器(服务器端):192.168.1.201 (RHEL 5)接收备份文件的服务器(客户端):192.168.1.202 (CENTOS 5)二、安装配置1.服务器端的配置A、采用系统默认安装的rsync 编辑/etc/rsyncd.conf文件,如果没有则新建一个。vi /etc/rsyncd.conf#[globale]strict modes= yes #check passwd fileport= 873 #default portlog转载 2011-03-14 10:47:00 · 657 阅读 · 0 评论 -
linux 命令入门一
CommandMeaninglslist files and directoriesls -alist all files and directoriesmkdirmake a directorycd directorychange to named directorycdchange to home-directorycd ~change to home-directorycd ..change to parent directorypwddisplay the path of the current d原创 2011-02-18 11:15:00 · 690 阅读 · 0 评论 -
svn local delete, incoming delete upon update 解决办法
svn local delete, incoming delete upon update 解决办法 # 1.In your working directory, recreate that conflicting file: $ touch foo # 2.Revert that file to the state SVN likes (that means deleted): $ sv转载 2013-04-14 17:36:13 · 3903 阅读 · 0 评论