dict={'cat'=>'abc','dog'=>'def'}puts dict.sizedict.keys返回所有的key,values返回所有的value。删除:dict.delete('cat')有条件地删除x={'a'=>100,'b'=>20}x.delete_if{|key,value...
分类:
其他好文 时间:
2014-07-19 20:30:46
阅读次数:
238
How to Housekeep logs without restarting process1) Go to the log folder2) run the command:mv access_log access_log.oldkill -1 `cat httpd.pid`
分类:
其他好文 时间:
2014-07-19 20:10:20
阅读次数:
244
学习记录一下:具体看实际操作。使用cygwin 或者 git 进入shell脚本模式,进入你的项目文件夹:大概是在:D:\quick-cocos2d-x\bin\yourProject执行命令:../compile_scripts.sh -i scripts -m files -o my_scrip...
分类:
其他好文 时间:
2014-07-19 19:19:18
阅读次数:
337
[root@luozhonghua mysql-5.5.21]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc
-- Check size of pthread_t
-- Check size of pthread_t - done
-- Perf...
分类:
数据库 时间:
2014-07-18 23:04:23
阅读次数:
287
Linux应用层想要操作kernel层的API,比如想操作相关GPIO或寄存器,可以通过写一个字符设备驱动来实现。
1、先在rootfs中的 /dev/ 下生成一个字符设备。注意主设备号 和 从设备号。可用如下shell脚本生成:
if [ ! -e audioIN ];then
sudo mknod audioIN c 240 0
fi
生成的设备为 /d...
分类:
系统相关 时间:
2014-07-18 22:36:04
阅读次数:
349
Linux C/C++编程Shell命令大杂烩...
分类:
编程语言 时间:
2014-07-18 22:06:17
阅读次数:
268
#!/bin/bash#forsecurityofosforipin`catip.txt`doecho-e"\033[31m##################$ip#####################\033[0m"RedhatVersion=`ssh$ip-C"cat/etc/issue"|awkNR==1‘{print$7}‘`if[${RedhatVersion}=‘5.6’]thenssh$ip-C"chattr-i/etc/login.defs&&authconfig--..
分类:
其他好文 时间:
2014-07-17 09:41:28
阅读次数:
257
题目描述:猜密码:远程连接,如果猜错密码超过五次,就拒绝访问实现描述:通过查看日志,找到相应ip地址的失败记录,累加次数超过五次的将这个ip地址丢到/etc/hosts.deny文件中,写法是:sshd:ip#!/bin/bashforipin$(cat/var/log/secure|grep"Failedpassword"|awk‘{print$11}..
分类:
其他好文 时间:
2014-07-17 08:54:09
阅读次数:
278
#!/bin/bashecho-n"现有的虚拟用户:"vuser=$(cat/etc/vsftpd/vuser.list|sed‘2~2d‘)echo$vuservvuser(){whiletruedoread-p"请输入新建虚拟用户的名称:"vvuserif[[$vvuser==""]]thenecho"用户名不能为空,重新输入"echo$vvuser>>/etc/vsftpd/vuser.listelifgrep$vvuser/et..
分类:
其他好文 时间:
2014-07-17 08:29:34
阅读次数:
531
#!/bin/bash ver=`cat gate.rc | grep FILEVERSION`ver=`echo $ver | awk '{print $2;}'`ver=`echo $ver |sed 's/\([0-9]*\),\([0-9]*\),\([0-9]*\),\([0-9]*\)/...
分类:
系统相关 时间:
2014-07-17 00:54:24
阅读次数:
363