Linux显示配置xorg.conf文件

1、生成xorg.conf文件

#如果有必要,停止gdm3
service gdm3 stop
#生成空白文件
Xorg -configure
#移动文件
mv ~/xorg.conf.new /etc/X11/xorg.conf
#修改文件,增加需要的分辨率
#如果有必要,开启gdm3
service gdm3 start

2、xorg.conf.new文件

Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "/usr/share/fonts/X11/misc"
	FontPath     "/usr/share/fonts/X11/cyrillic"
	FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
	FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
	FontPath     "/usr/share/fonts/X11/Type1"
	FontPath     "/usr/share/fonts/X11/100dpi"
	FontPath     "/usr/share/fonts/X11/75dpi"
	FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
	FontPath     "built-ins"
EndSection

Section "Module"
	Load  "record"
	Load  "glx"
	Load  "extmod"
	Load  "dbe"
	Load  "dri"
	Load  "dri2"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
	Identifier  "Card0"
	Driver      "vboxvideo"
	VendorName  "InnoTek Systemberatung GmbH"
	BoardName   "VirtualBox Graphics Adapter"
	BusID       "PCI:0:2:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

3、新版xorg.conf文件

Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "/usr/share/fonts/X11/misc"
	FontPath     "/usr/share/fonts/X11/cyrillic"
	FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
	FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
	FontPath     "/usr/share/fonts/X11/Type1"
	FontPath     "/usr/share/fonts/X11/100dpi"
	FontPath     "/usr/share/fonts/X11/75dpi"
	FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
	FontPath     "built-ins"
EndSection

Section "Module"
	Load  "record"
	Load  "glx"
	Load  "extmod"
	Load  "dbe"
	Load  "dri"
	Load  "dri2"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
	Identifier  "Card0"
	Driver      "vboxvideo"
	VendorName  "InnoTek Systemberatung GmbH"
	BoardName   "VirtualBox Graphics Adapter"
	BusID       "PCI:0:2:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
		Modes	"1280x800" "1024x768" "800x600"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
		Modes	"1280x800" "1024x768" "800x600"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
		Modes	"1280x800" "1024x768" "800x600"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
		Modes	"1280x800" "1024x768" "800x600"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
		Modes	"1280x800" "1024x768" "800x600"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
		Modes	"1280x800" "1024x768" "800x600"
	EndSubSection
EndSection

Debian6 Squeeze修改Terminal分辨率

试了不少方法,要么参数不支持,要不设置了没有用。

好吧,简单暴力一些。

编辑/boot/grub/grub.cfg,在启动参数前,增加两行:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
	#第一行>>>>>>set gfxpayload=1024x768x24
	#第二行>>>>>>load_video
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set a600ccdc-3768-464b-9b19-29ec051f93e5
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/boot/vmlinuz-2.6.32-5-amd64 root=UUID=a600ccdc-3768-464b-9b19-29ec051f93e5 ro  quiet text
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.32-5-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	set gfxpayload=1024x768
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set a600ccdc-3768-464b-9b19-29ec051f93e5
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/boot/vmlinuz-2.6.32-5-amd64 root=UUID=a600ccdc-3768-464b-9b19-29ec051f93e5 ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.32-5-amd64
}
### END /etc/grub.d/10_linux ###

修改后为:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
	set gfxpayload=1024x768x24
	load_video
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set a600ccdc-3768-464b-9b19-29ec051f93e5
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/boot/vmlinuz-2.6.32-5-amd64 root=UUID=a600ccdc-3768-464b-9b19-29ec051f93e5 ro  quiet text
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.32-5-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	set gfxpayload=1024x768
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set a600ccdc-3768-464b-9b19-29ec051f93e5
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/boot/vmlinuz-2.6.32-5-amd64 root=UUID=a600ccdc-3768-464b-9b19-29ec051f93e5 ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.32-5-amd64
}
### END /etc/grub.d/10_linux ###

About Unix

三大UNIX为:
IBM AIX, HP UNIX,SUN Solaris

UNIX,BSD,Linux被统称为×nix系统。

BSD与Linux系统的区别:
BSD is what you get when a bunch of UNIX hackers sit down to try to port a UNIX system to the PC.
Linux is what you get when a bunch of PC hackers sit down and try to write a UNIX system for the PC.

Linux及BSD包管理系统

大家都知道,
Linux发行版=Linux内核+包管理系统

当下,Linux的主要包管理系统分为两大阵营,RPM和DEB,
(其主要原因是,子发行版多沿用了父发行版的包管理系统)
但每种有特色的发行版,又都会开发自己独特的包管理系统。
主要Linux发行版的管理统系统计如下:

RPM:
RHEL;Fedora;CentOS;
openSUSE;SUSE Linux Enterprise;
PCLinuxOS;
Mageia;
Fuduntu;
Mandriva Linux;
Scientific Linux;
Oracle Linux;

DEB:
Debian;
Ubuntu;Kubuntu;Xubuntu;Ubuntu Studio;
Lubuntu;
Linux Mint;
Ultimate Edition;
Bodhi Linux;
Pinguy OS;
Zorin OS;
MEPIS Linux;
KNOPPIX;
BackTrack;

Pacman:
Arch Linux;
Chakra GNU/Linux;

Portage:
Gentoo

PET:
Puppy

TCE:
Tiny Core Linux

Entropy:
Sabayon Linux

TXZ:
Slackware Linux

TBZ:
FreeBSD;
DragonFly BSD;

TGZ:
OpenBSD

PBI/TGZ:
PC-BSD

IPS, pkgadm:
Oracle Solaris

pkgin:
MINIX

Windows下以兼容模式启动EXE

有两种常用的方式,可以让Windows可以以兼容模式启动EXE程序。

方法1、修改注册表,永久模式(右键-》属性-》兼容模式,也是通过修改注册表达到兼容模式启动EXE的)
A、以WINXPSP3兼容模式,注册表命令行

reg.exe Add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "PATH_TO_EXE" /d "WINXPSP3"

B、以WINXPSP3兼容模式,注册表文件

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"PATH_TO_EXE"="WINXPSP3"

方法2、设置环境变量,单次运行

#注意:__COMPAT_LAYER前面是两个下划线
#两个LayerName之间用空格隔开
#!表示不可以使用该兼容模式
set __COMPAT_LAYER=[!]LayerName1 [LayerName2 ...]

#用WinXPsp3兼容模式启动程序
set __COMPAT_LAYER=WINXPSP3

#用WinXPsp3兼容模式启动程序,并禁用主题
set __COMPAT_LAYER=WINXPSP3 DISABLETHEMES

#以管理员身份、用WinXPsp3兼容模式启动程序,并禁用主题
set __COMPAT_LAYER=WINXPSP3 DISABLETHEMES RUNASADMIN

#禁用兼容模式
set __COMPAT_LAYER=

可用的设置选项有:

LayerName 含义
兼容模式(Compatibility Modes)
WIN95 Windows 95
WIN98 Windows 98
WIN4SP5 Windows NT 4.0 SP5
WIN2000 Windows 2000
WINXPSP2 Windows XP SP2
WINXPSP3 Windows XP SP3
VISTARTM Vista
VISTASP1 Vista SP1
VISTASP2 Vista SP2
WIN7RTM Windows 7
WINSRV03SP1 Windows Server 2003 SP1
WINSRV08SP1 Windows Server 2008 SP1
显示设置(Display Settings)
DISABLETHEMES 禁用主题
640X480 以640×480分辨率进行
HIGHDPIAWARE 高DPI设置时,禁用显示缩放
256COLOR 以256色运行
DISABLEDWM 禁用桌面组合
权限设置(Privilege Level)
RUNASADMIN 管理员权限运行EXE
RUNASINVOKER 以调用者权限运行EXE
RUNASHIGHEST 以用户最高权限运行EXE
Win8
ELEVATECREATEPROCESS 子进程将获取一个UAC提升权限对话框
PINDLL DLL内存常驻
DISABLEUSERCALLBACKEXCEPTION 禁用用户回调异常
VIRTUALIZEDELETE 该模式拦截受保护文件上的删除操作,防止应用由于未处理删除操作中的异常而失败
WRPMITIGATION 当应用尝试写入、修改或删除Windows受保护文件或注册表项时,该模式返回成功(实际上没有完成该操作)
DXMAXIMIZEDWINDOWEDMODE 该模式标识进入全屏模式的应用并指将这些应用重定向到最大化Window模式

修复Windows系统

我们在平时操作电脑的过程中可能会因为某个误操作而丢失了一些重要的系统文件,系统因此变得非常不稳定,总是出现错误提示
,如果是为此而重新安装系统的话,那必将浪费你好长的时间,其实使用SFC文件检测器命令就可以轻松地帮你检测并修复受损的系统文
件。
  
  具体方法:插入系统安装光盘,然后在命令提示符窗口中输入“sfc /scannow”命令并回车,这时sfc文件检测器将立即扫描所有受
保护的系统文件。在大约几分钟的时间里,SFC会检测并修复好受保护的系统文件。
  
  小提示:如果身边没有Windows XP安装盘,但以前在硬盘上备份了安装盘文件的话,可以通过下面的小小设置即可让文件检测器从硬
盘上的安装文件中来恢复系统文件。

展开“HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Setup”子键,然后在右侧窗口中修改Installation

Sources、ServicePackSourcePath和SourcePath三个键值为硬盘上的系统安装程序路径,例如Windows XP的安装原文件存放在E盘/CDXP

文件夹中,那么修改以上三个键的键值为“E:/CDXP”。这样再使用SFC命令时,则可以直接使用硬盘上的安装文件来恢复系统而不需要
插入安装光盘。