Unix/Linux相关

SELinux Frequently Asked Questions (FAQ)

1. Overview
1. What is Security-enhanced Linux?

Security-enhanced Linux (SELinux) is a reference implementation of the Flask security architecture for flexible mandatory access control. It was created to demonstrate the value of flexible mandatory access controls and how such controls could be added to an operating system. The Flask architecture has been subsequently mainstreamed into Linux® and ported to several other systems, including the Solaris™ operating system, the FreeBSD® operating system, and the Darwin kernel, spawning a wide range of related work. The Flask architecture provides general support for the enforcement of many kinds of mandatory access control policies, including those based on the concepts of Type Enforcement®, Role-based Access Control, and Multi-level Security.
2. What does Security-enhanced Linux give me that standard Linux can't?

mars - Mon, 2010-08-23 23:37

Ext2 v.s. Ext3 v.s. Ext4 性能比拼

Linux kernel 自 2.6.28 开始正式支持新的文件系统 Ext4。 Ext4 是 Ext3 的改进版,修改了 Ext3 中部分重要的数据结构,而不仅仅像 Ext3 对 Ext2 那样,只是增加了一个日志功能而已。Ext4 可以提供更佳的性能和可靠性,还有更为丰富的功能:

1. 与 Ext3 兼容。执行若干条命令,就能从 Ext3 在线迁移到 Ext4,而无须重新格式化磁盘或重新安装系统。原有 Ext3 数据结构照样保留,Ext4 作用于新数据,当然,整个文件系统因此也就获得了 Ext4 所支持的更大容量。

2. 更大的文件系统和更大的文件。较之 Ext3 目前所支持的最大 16TB 文件系统和最大 2TB 文件,Ext4 分别支持 1EB(1,048,576TB, 1EB=1024PB, 1PB=1024TB)的文件系统,以及 16TB 的文件。

3. 无限数量的子目录。Ext3 目前只支持 32,000 个子目录,而 Ext4 支持无限数量的子目录。

mars - Sat, 2009-02-28 18:59

ubuntu Linux下指点杆中键滚动功能的配置

第一种方法,不但可以上下滚动,还可以左右滚动:
修改/etc/X11/xorg.conf,找到Configured Mouse一段

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "Emulate3Buttons" "true"
Option "Emulate3TimeOut" "50"
Option "EmulateWheel" "on"
Option "EmulateWheelTimeOut" "200"
Option "EmulateWheelButton" "2"
Option "YAxisMapping" "4 5"
Option "XAxisMapping" "6 7"
Option "ZAxisMapping" "4 5"
EndSection

mars - Sat, 2008-05-03 11:30

在Ubuntu 7.10中安装JDK 6u3

下载最新JDK,当前版本为JDK6 Update 3。注意:应下载Linux self-extracting file (jdk-6u3-linux-i586.bin)

准备JDK安装工具:fakeroot和java-package。
sudo apt-get install fakeroot java-package

创建 .deb JDK 包
fakeroot make-jpkg jdk-6u3-linux-i586.bin

安装 .deb文件
sudo dpkg -i sun-j2sdk1.6_1.6.0+update3_i386.deb

如果系统中安装有多个JDK版本,可以使用下面的命令进行切换

sudo update-alternatives --config java

安装完成之后,可以使用如下命令检查Java版本

java -version

mars - Mon, 2007-11-05 09:10

Windows & Unix 文件格式之迷, 空格 与 tab 转换及其相关工具

关键字: DOS, Unix 文件格式, 空格 与 tab 转换工具
fbin win2unix tab2unix

摘要: 本文深入揭露 Windows & Unix 格式差异, 及因此而导至的各种问题.
同时介绍了一些与之相关的查看和操作工具, 并在 Windows, Unix 进行举例.

1. 问题提出:
我们可能会遇到过这样一些困惑:
(1) 如何查看一个文件或数据流的二进制格式(以十六进制格式显示)?
(2) 为什么在 windows下编译的 shell 脚本在 Unix下不能执行?
为什么在 windows下编辑的 C 源文件在有些 gcc 编译器下不能编译?
(3) 为什么我在 vi 等编器下打开一个文本文件会包含 ^M, 如何把它去掉?

mars - Sat, 2007-10-06 10:51

我的Linux常用软件清单

网络浏览::firefox
办公软件:OpenOffice, Lotus Notes for Linux
文档阅读:Adobe Reader,Evince
编程:Eclipse,Gcc
比较工具:Meld
翻译工具:StarDict
编辑器:Vim,gedit
数据库:Oracle 10g Express,Derby
Ftp工具:FileZilla,lftp
下载工具:wget,MultiGet
BT下载工具:Deluge
电驴工具:aMule
IM工具:Pidgin,Eva
音频播放:Banshee
视频播放:Mplayer,SMplayer
图片编辑:GIMP
图片浏览:gThumb
远程工具:rdesktop,Vnc
虚拟机:VirtualBox

linux客户端访问samba服务器的指令

  linux客户端要连接samba/windows文件服务器时,需使用smbmount或mount指令:
  smbmount //sambaserver/d /mnt/d -o username=aaa,password=bbb
  smbmount //sambaserver/d /mnt/d -o username=aaa%bbb
  mount -t smbfs -o username=aaa,password=bbb //sambaserver/d /mnt/d
  mount -t smbfs -o username=aaa%bbb //sambaserver/d /mnt/d
  smbclient //sambaserver/d -U username%password
  注意:
  1. 指定uid或者gid参数,也可以指定用户的身份(uid=后面可接uid号或者用户名),如:
  smbmount //test/d /mnt/d -o uid=grind
  2. smbmount也可以写作mount.smbfs,这是一个符号链接;
  3. smbmount的参数必须写在最后,而mount的参数位置可以变化;
  4. 由于//sambaserver/d格式可以表明是要mount上smbfs,所以mount的-t smbfs参数可以省掉;
  5. 如果命令行中不加入密码,下一行中系统会提示你输入;
  6. smbclient成功后,会出现ftp类似的界面,请仿照ftp进行。

我的一条实例:

sudo mount -t smbfs //10.44.37.169/dev /mnt/smb -o username=zhuhaitaocc,password=12345,workgroup=gclear,
rw,iocharset=utf8,codepage=cp936,uid=htzhu,gid=htzhu
mars - Tue, 2007-07-17 00:44

Thinkpad T60 Ubuntu 7.04 安装手记 (持续更新中......)

Ubuntu7.04的下载http://releases.ubuntu.com/feisty/
如果没有特殊的需要:请选择ubuntu-7.04-alternate-i386.iso这个版本是可以直接硬盘安装的。
ubuntu-7.04-desktop-i386.iso是需要光盘刻录的,这个是live-cd,也可以用于安装到硬盘。

注意:最好是拔掉网线安装,否则进度到85%时会很慢,假死,MBR失败

硬盘安装所需要的引导文件
boot.img.gzinitrd.gzvmlinuz


安装完毕后,增加中文支持

sudo apt-get install language-support-zh

Linux下VirturalBox的使用

VirturalBox是Linux下一个非常好虚拟机,性能非常好,并且开源

官方网站http://www.virtualbox.org

适合Ubuntu7.04的版本VirtualBox_1.3.8_Ubuntu_feisty_i386.deb
安装非常简单,不再罗嗦。
安装完guest端后,需要安装InnoTek VirtualBox Guest Additions,以支持屏幕自由缩放等

主要说下怎样在host和guest间创立共享文件夹。
1.host端操作:
$mkdir /doc/share
$VBoxManage sharedfolder add "xp1" -name "share" -hostpath "/doc/share"
其中xp1是我创建的虚拟机的名称
2.guest端操作:
net use s: \\vboxsvr\share
其中s:是我要在guest建立的虚拟盘符号,在不冲突的情况下可以任意
share是我在host端操作时使用-name设置的共享名

mars - Sun, 2007-05-13 15:36

rsync 同步使用详解

rsync 是很强大的同步工具 本地远程皆宜
不少project都提供 http ftp rsync 等mirror方式
rsync官方主页是 http://samba.anu.edu.au/rsync/

rsync(d)服务端启动两种方式
1.daemon 2.xinetd inetd
启动后绑在 TCP/873 端口

% cat /etc/xinetd.d/rsync
# default: off
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}

配置 注意设置读写权限属主
% cat /etc/rsyncd.conf

motd file = /var/log/rsync/welcome.msg

mars - Wed, 2007-04-25 16:45