linux下分割压缩rar

May 24th, 2010 System , (9)

1.安装rar和unrar和序

$ sudo aptitude install rar unrar

2.示例,分割压缩temp文件,每个包为1MB

$ rar a -v1024k temp.rar temp

禁用ubuntu 10.04登录窗口中的用户列表

May 24th, 2010 System , (0)

如果处于安全考虑,想禁用登录窗口的用户例表,做以下几步操作

1.打开终端输入

$ cd /usr/share
$ sudo cp applications/gconf-editor.desktop gdm/autostart/LoginWindow

2.注销到登录界面,会看到gconf-editor已运行

3.找到/apps/gdm/simple-greeter,把disable_user_list这一项的值改为true

4.关闭gconf-editor重启系统,再看到gdm登录窗口的时候就没有用户列表了.

判断网页是否在iframe中

May 19th, 2010 Javascript , (0)

网上提供的很多方法都是判断当前窗口与顶部窗口是否相同来实现。代码如下

if(top!=this){
 // 在frame中时处理
}

但这个脚本并没有区分frame和iframe。

  在使用脚本时IE下遇到奇怪的问题:页面只有在iframe有问题frame中是正常的。而且在firefox和chrome中都是正常的。已经不想对IE发表什么意见了,最终自己在MSDN找到了可以判断当前页面是否在iframe中的方法,脚本如下:

if(self.frameElement.tagName=="IFRAME"){
  // 页面在iframe中时处理
}

frameElement属性MSDN页面

把ubuntu的消息通知显示位置改回右上角

April 15th, 2010 System , (2)

1.安装apt-src软件包

$ sudo aptitude install apt-src

2.安装notify-osd的源码

$ mkdir notify
$ cd notify
$ sudo apt-src install notify-osd

Read more…

改变苹果电脑默认截图保存格式的方法

April 9th, 2010 System , (1)

苹果电脑MacOSX系统内截图后的默认照片文件格式是png的,如果你想把苹果电脑默认截图格式改为jpg、GIF或PDF,可以在终端输入以下命令

修改苹果电脑截图默认格式为jpg

defaults write com.apple.screencapture type jpg

修改苹果电脑截图默认格式为GIF

defaults write com.apple.screencapture type gif

Read more…

ThinkPad T410s&Ubuntu 10.04控制风扇转速

April 4th, 2010 System , (0)

T410s本子上的传感器还不能被lm-sensors当前的版本所识别,所以fancontrol进程就没效果,只能手动控制了

1.给thinkpad_acpi模块加参数

$ sudo nano /etc/modprobe.d/thinkpad_acpi.conf

在文件中输入

options thinkpad_acpi fan_control=1

Read more…

解决T410s装ubuntu 10.04的声音问题

April 4th, 2010 System , (1)

也许是因为硬件太新,装上ubuntu 10.04后,声卡没有识别,这里有个临时的解决方法

1.查看一下声卡的pci id号

$ lspci -vvxxx
............................................................
 
00:1b.0 Audio device: Intel Corporation Device 3b57 (rev 06)
        Subsystem: Lenovo Device 215e
        Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <tabort - <MAbort- >SERR- <perr - INTx-
        Interrupt: pin B routed to IRQ 11
        Region 0: Memory at f2520000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
00: 86 80 57 3b 02 01 10 00 06 00 03 04 10 00 00 00
10: 04 00 52 f2 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 aa 17 5e 21
30: 00 00 00 00 50 00 00 00 00 00 00 00 0b 02 00 00
 
............................................................
</perr></tabort>

Read more…

为ubuntu 10.04安装Realtek 8172和8192se无线驱动

April 4th, 2010 System , (0)

刚为新到手的ThinkPad T410s装上了ubuntu 10.04 beta1,兴奋之余发现无线列表中列出的无线网络没有公司的,公司的无线类型为802.11/g,而列表中列出的都是802.11/n类型的,感觉是驱动的问题,于是先看一下芯片类型

$ lspci -vvxxx
........................................
 
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device 8172 (rev 10)
	Subsystem: Realtek Semiconductor Co., Ltd. Device e020
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <tabort - <MAbort- >SERR- <perr - INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 17
	Region 0: I/O ports at 2000 [size=256]
	Region 1: Memory at f2400000 (32-bit, non-prefetchable) [size=16K]
	Capabilities: <access denied>
	Kernel driver in use: rtl819xSE
	Kernel modules: r8192se_pci
00: ec 10 72 81 07 01 10 00 10 00 80 02 10 00 00 00
10: 01 20 00 00 00 00 40 f2 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 ec 10 20 e0
30: 00 00 00 00 40 00 00 00 00 00 00 00 0b 01 00 00
 
........................................
</perr></tabort>

Read more…

IE overflow auto的宽度问题

March 31st, 2010 CSS , (0)

在IE中,当窗口的样式为overflow:auto时,出现滚动条的时候,内部元素的宽度不会自适应

解决方法是在样式中把内部元素的宽度用expression定义

div.parent{
	width:300px;
	height:500px;
	overflow:auto;
}
div.sub{
	width:expression(this.parentNode.offsetHeight > this.parentNode.scrollHeight ? '100%' : parseInt(this.parentNode.clientWidth) + 'px');
	height:800px;
}

10个最酷的Linux单行命令

March 22nd, 2010 Misc , (0)

1. sudo !!
以 root 帐户执行上一条命令。

2. python -m SimpleHTTPServer
利用 Python 搭建一个简单的 Web 服务器,可通过 http://$HOSTNAME:8000 访问。

3. :w !sudo tee %
在 Vim 中无需权限保存编辑的文件。

4. cd -
更改到上一次访问的目录。
Read more…