[ sed简单介绍:]sed是一个非常好的文件处理工具, 它本身是一个管道命令, 以行为单位进行处理, 能够用于对数据行进行新增、选取、替换、删除等操作。sed命令行格式:sed [-nefri] 'range command' file如: sed '2d' aaa.txt ...
分类:
系统相关 时间:
2014-10-12 16:20:30
阅读次数:
263
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行并从/etc/profile.d目录的配置文件中搜集shell的设置./etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.~/.bash_...
分类:
其他好文 时间:
2014-10-12 14:10:57
阅读次数:
163
在google官网下载google chrome deb包,有32位和64位之分:怎么判断系统是32位还是64位的,可以用以下代码:int a = 3;int *p = &a;printf("%d\n, sizeof(p));直接使用终端安装:1.按 Ctrl+Alt+T 打开终端: 切换到ch.....
分类:
系统相关 时间:
2014-10-12 13:33:18
阅读次数:
194
可以将squid理解为前端缓存,memcache则为后端缓存。squid介于webserver和客户端之间。memcache则介于webserver和database之间。squid主要是缓存整个页面文件。而memcache用来缓存数据。现在可以申请第三方缓存解决方案,也就是CDN,他们做的其实就是...
分类:
系统相关 时间:
2014-10-12 11:37:37
阅读次数:
215
需求:输入用户名和密码,认证成功后显示欢迎信息,输错三次后锁定shell:#!/bin/bash
#Authuserlogin
user="hlf"
pass="123456"
lock_file=login.lock
[-f${lock_file}]||touch${lock_file}
foriin`seq3`
do
read-p"username:"username
read-p"password:"password
if[-z"$u..
分类:
其他好文 时间:
2014-10-12 11:07:18
阅读次数:
168
最近写了一个小程序,需要用到时间,遍历作为目录的一部分
#!/bin/bash
for i in {1..30}
do
date=`date +%Y/%m/%d -d " $i days ago " `
echo $date
done
for循环,取最近n天的日期。
核心就是date=`date +%Y/%m/%d -d " $i days ago " `...
分类:
系统相关 时间:
2014-10-12 02:22:57
阅读次数:
313
#include #include int main(void){ int *p1; int * *pp1; const int * *pp2; const int n = 13; printf("起初const int n = %d\n", n); pp1 = &p1; pp2 = ...
分类:
其他好文 时间:
2014-10-12 00:54:06
阅读次数:
248
4、数据类型介绍 数据:文本数据、音频、视频、图像、数字 C语言中有5大数据类型:基本类型、构造类型、空类型、指针类型、自定义类型 基本数据类型: 整型 长整型long int 整型int(4) 端整型short int 实型 单精度float(4) 双精度 doubl...
分类:
编程语言 时间:
2014-10-11 23:43:56
阅读次数:
233
#!/bin/sh
my_ip=`/sbin/ifconfig eth1 | grep 'inet addr' | awk '{print substr($2, index($2, ":")+1)}'`
recv=""
msg="not_existing, restart ..."
MONITOR_LOG="monitor.log"
#monitor procname scriptname...
分类:
系统相关 时间:
2014-10-11 23:25:07
阅读次数:
329