- 博客(55)
- 资源 (1)
- 收藏
- 关注
原创 鸟哥私房菜实践(6)- NFS
? 主要配置文件:/etc/exports? NFS 文件系统维护指令:/usr/sbin/exportfs? 分享资源的登录档:/var/lib/nfs/*tab? 客户端查询服务器分享资源的指令:/usr/sbin/showmount1、编辑服务端的/etc/exports,添加/home/zz 192.168.122.1(rw)2、查看相关服务service rp
2014-12-04 11:11:22 1160
原创 鸟哥私房菜实践(5)- SELinux
针对控制的『主体』变成了『程序』而不是用户喔! 此外,这个主体程序也不能任意使用系统档案资源,因为每个档案资源也有针对该主体程序设定可取用的权限!targeted:针对网络服务限制较多,针对本机限制较少,是预设的策略;主体(程序) -> 策略检查 -> 安全上下文比对 -> rwx检查 -> 目标文件1、查看目前的 SELinux 状态sestatusgeten
2014-12-04 09:23:46 921
原创 鸟哥私房菜实践(4)- LVM
LVM (Logical Volume Manager)LVM 的重点在于可以弹性的调整 filesystem 的容量!LVM 可以整合多个实体 partition(或 disk),看起来就像一个磁盘一样!而且,未来还可以新增或移除实体 partitionpartition ==(pvcreate,pvscan)==> PVPV ==(vgcreate,vg
2014-12-03 14:19:53 1571
原创 鸟哥私房菜实践(3)- RAID
磁盘阵列全名是Redundant Arrays of Inexpensive Disks, RAIDRAID-0 (等量模式, stripe):效能最佳RAID-1 (映像模式, mirror):完整备份,虽然写入效能不佳,不过读取的效能则还可以啦!RAID 0+1,RAID 1+0RAID 5:效能与数据备份的均衡考虑,至少需要三颗以上的磁盘才能够组成这种类型的磁盘阵列,预设仅能
2014-12-03 14:15:04 797
原创 鸟哥私房菜实践(2)- quota
quota 是针对『整个 filesystem』进行限制的,使用的默认档案为每个文件系统下面的 (aquota.user, aquota.group)限制项目:. 容量限制或档案数量限制 (block 或 inode). 柔性劝导与硬性规定 (soft/hard). 会倒数计时的宽限时间 (grace time)1、准备用户与组groupadd quotagrp
2014-12-03 11:55:13 798
原创 鸟哥私房菜实践(1)- ACL
ACL(Access Control List),要使用 ACL 必须要有文件系统的支持才行。设定对象:使用者 (user):可以针对使用者来设定权限;群组 (group):针对群组为对象来设定其权限;默认属性 (mask):还可以针对在该目录下在建立新档案/目录时,规范新数据的默认权限;1、检查文件系统是否支持# mount# dumpe2fs -h /dev/s
2014-12-03 09:15:05 626
原创 rev命令可以实现文件文本行,或字符串的反序显示
rev命令可以实现文件文本行,或字符串的反序显示示例代码:#!/bin/kshset 1 2 3 4 5 6while [ $# -ne 0 ]do a= for i do a=$a$i done echo $a|rev shiftd
2010-10-20 11:54:00 1175 1
原创 shell脚本中的``导致sed命令解析失败
``导致sed命令解析失败,试验如下试图把单个反斜线替换为两个反斜线,也就是把替换为\$ cat t1.sh#!/bin/sha=`echo 1|sed s/\/\\/g`echo $a$ ./t1.shsed:-e 表达式 #1,字符 8:unterminated `s command$ sh -x ./t3.sh++ echo 1
2010-10-16 11:04:00 8556 2
转载 current shell & subshell & separate invocations
1. "current shell"Commands enclosed in {} are executed in the current shell. There must be whitespace after the opening {, or else you get a syntax error. One more restriction: commands within the {}
2010-09-30 11:46:00 1095 2
转载 pthread_cond_broadcast() and pthread_cond_signal()
The pthread_cond_broadcast() and pthread_cond_signal() functions shall have no effect if there are no threads currently blocked on cond.If no thread is blocked on the condition, the subroutine succe
2010-09-14 17:56:00 1127
原创 为什么进程组的leader不允许调用setsid()?
--调用setsid()的进程将成为一个新的进程组的组长--如果允许一个进程组长调用setsid()的话,那这个人将成为两个组的组长..--再说,进程组长的定义是“其进程ID=进程组ID”,如果某个进程是两个组的组长,那么这两个组的进程组ID是相同的??
2010-09-13 09:53:00 1144
原创 为什么sigsuspend要与sigprocmask配合使用?
apue示例代码:sigemptyset(&new_mask);sigemptyset(&zero_mask); // 清空信号集zero_masksigaddset(&new_mask, SIGQUIT);sigprocmask(SIG_BLOCK, &new_mask, &old_mask); // 阻塞SIGQUITwhile( quitflag == 0
2010-09-13 09:40:00 2411
转载 同步锁--摘自《unix网络编程》第二卷
关于互斥:When a mutex is shared between processes, there is always a chance that the process can terminate (perhaps involuntarily) while holding the mutex lock. There is no way to have the system automati
2010-09-11 16:49:00 609
The Korn Shell: Unix and Linux Programming Manual, Third Edition
2012-04-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人