方舟笔记

方舟笔记

CentOS6.x\Red Hat\Fedora\Linux 安装Wine 1.7.48 桌面运行环境教程

Open Source Software for running Windows applications on other operating systems
Wine (“Wine Is Not an Emulator” 的首字母缩写)是一个能够在多种 POSIX-compliant 操作系统(诸如 Linux,Mac OSX 及 BSD 等)上运行 Windows 应用的兼容层。 Wine 不是像虚拟机或者模拟器一样模仿内部的 Windows 逻辑,而是將 Windows API 调用翻译成为动态的 POSIX 调用,免除了性能和其他一些行为的内存占用,让你能够干净地集合 Windows 应用到你的桌面。
CentOS6.x\Red Hat\Fedora\Linux 安装Wine 1.7.48 桌面运行环境教程
主要分为两种安装方式:
1:yum 安装
2:源码编译安装(32和64位系统分别安装)

事先安装图形界面GNOME

Red Hat / CentOS / Fedora yum 安装

#yum -y install epel-release
#yum clean all //清空YUM缓存
#yum makecache //生成YUM缓存
yum repolist //确认EPEL状态
#yum -y install wine //安装wine
#yum upgrade wine //升级wine

Red Hat / CentOS / Fedora 源码编译 安装
CwntOS 32位系统安装

#yum -y install wget gcc make vim screen bzip2-devel epel-release zlib-devel libxcb-devel
#yum groupinstall "Development tools" -y
#yum clean all //清空YUM缓存
#yum makecache //生成YUM缓存
#yum repolist //确认EPEL状态
#yum -y update
#reboot
#wget http://nchc.dl.sourceforge.net/project/wine/Source/wine-1.7.48.tar.bz2 //下载wine
#tar -jxvf wine-1.7.48.tar.bz2 //解压
#cd wine-1.7.48
#./configure

configure: error: X development files not found. Wine will be built
#yum -y install libX11-devel freetype-devel
#./configure //配置
#make //编译
#make install //安装
#wine xxx.exe //运行32位软件

CentOS 64位系统安装

#yum groupinstall "Development tools" -y
#yum -y install wget gcc make vim screen bzip2-devel epel-release zlib-devel libxcb-devel
#yum -y update
#reboot
#wget http://nchc.dl.sourceforge.net/project/wine/Source/wine-1.7.48.tar.bz2 //下载wine
#tar -jxvf wine-1.7.48.tar.bz2 //解压
#cd wine-1.7.48
#./configure

configure: error: Cannot build a 32-bit program, you need to install 32-bit development libraries.

#./configure --enable-win64 //配置
configure: Finished. Do 'make' to compile Wine.

configure: error: X development files not found. Wine will be built

#yum -y install libX11-devel
#./configure --enable-win64

configure: error: FreeType development files not found. Fonts will not be built.
Use the --without-freetype option if you really want this.
#yum -y install freetype-devel
#./configure --enable-win64
configure: Finished. Do 'make' to compile Wine.
#make //编译
Wine build complete.
#make install //安装
#wine64 xxx.exe //运行64位软件
完成

linux的NetworkManager服务

linux (CentOS)配置IP地址信息,重启后网络配置失效。
经多次查找发现这种是NetworkManager的问题,NetworkManager试图将DHCP中获取的DNS信息写入/etc/resolv.conf,导致原文件被覆盖,
打开/etc/resolv.conf文件 会发现 Crate by networkmanager。

1:在配置文件添加 PEERDNS=no 这个选项可令/etc/resolv.conf 在系统重启后不会被重写,
重新启动后仍任被NetworkManager 重新创建了/etc/resolv.conf,该方法无效。

2:在文件属性中设置i参数避免文件被修改
#chattr +i /etc/resolv.conf

#chattr -i /etc/resolv.conf //如果你要修改此文件,移除i参数
重新启动后仍任被NetworkManager 重新创建了/etc/resolv.conf,该方法无效。

3:关闭该服务。
service NetworkManager stop 临时关闭:
chkconfig NetworkManager off 永久关闭:

关闭后正常

网络管理器最初由 Redhat 公司开发,现在由 GNOME 管理。

为CentOS 6.x安装图形界面GNOME

VMware Workstation Kernel Headers for version 2.6.32-504.30.3.el6.x86_64 were not found

VMware Workstation Kernel Headers for version 2.6.32-504.30.3.el6.x86_64 were not found
当VMware Workstation出现这个提示的时候将无法继续向下进行工作,这时候必须要解决这个问题。

解决办法:
yum -y update
yum -y install automake gcc kernel-devel
reboot
wget https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-11.1.2-2780323.x86_64.bundle
chmod 777 VMware-Workstation-Full-11.1.2-2780323.x86_64.bundle
bash VMware-Workstation-Full-11.1.2-2780323.x86_64.bundle //Linux 安装VMware Workstation

Kernel Headers

为CentOS 6.x安装图形界面GNOME、火狐浏览器并用TigerVNC 远程连接

为CentOS 6.6安装图形界面GNOME、火狐浏览器并用TigerVNC 远程连接
GNOME
易用性——设计和创建为所有人所用的桌面和应用程序
国际化——保证桌面和应用程序可以用于很多语言
火狐浏览器
Firefox 全球第三大流行的网页浏览器
VNC
VNC(Virtual Network Computing),为一种使用RFB协议的屏幕画面分享及远程操作软件


准备阶段:
#yum -y install wget gcc make vim screen epel-release
#yum clean all //清空YUM缓存
#yum makecache //生成YUM缓存
#yum repolist //确认EPEL状态
#yum -y update
#reboot

开始安装GNOME:
yum groupinstall "Development tools" -y
yum groupinstall "X Window System" "Desktop" "Chinese Support" "Fonts" -y

groupinstall "Desktop" #CentOS 6.x版本安装GNOME包
groupinstall "GNOME Desktop Environment" #CentOS 5.x版本安装GNOME包

开始安装配置TigerVNC Server:
yum -y install tigervnc-server

接下来设定VNC使用者进入后的环境,vim /etc/sysconfig/vncservers
下面是默认值,修改这里的用户和登入设定,他的值是 "索引号1:用户账号1 索引号2:用户账号2 索引号3:使用者账号3 ...."

索引值就是未来联机用的port号(5900+索引值),例如索引值2 (5900 + 2),所以到时连接 VNC Server 就使用 :5902
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

多用户举例

VNCSERVERS="2:root 3:axer"
VNCSERVERARGS[2]="-geometry 1280x1024 -nolisten tcp -localhost"
VNCSERVERARGS[3]="-geometry 1280x1024"

单用户举例
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1360x768" //分辨率可以根据实际情况设置

用户必须是存在的

设定VNC的使用者密码
vnc的用户帐密和系统不同,需独立设定,使用指令 vncpasswd,切换到该用户下指令即可:

#vncpasswd
Password:
Verify:
你可能会忘记vnc的密码,只要把自己家目录中的 .vnc/passwd 档删掉然后重新执行 vncpasswd 即可。
#rm ~/.vnc/passwd

多用户务必设定后面中已指定的用户密码,否则在启动vnc会出现这样的错误:
3:axer
VNC password for user axer is not configured
[失败]
启动vnc/停止vnc
#service vncserver start | stop | restart

设定开机启动
#chkconfig --level 35 vncserver on

iptables防火墙
iptables -I INPUT -p tcp --dport 5901 -j ACCEPT
service iptables save
service iptables restart

其他

1. 如果启动时出现错误
正在启动 VNC 服务器:0:root A VNC server is already running as :0
这代表 /etc/sysconfig/vncservers 中有设定 "0"索引值,索引值得从1开始 VNCSERVERS="0:root 1:axer"

2. 查看正在开启的vnc server window
#vncserver -list

TigerVNC server sessions:

X DISPLAY # PROCESS ID
:1 6376
:2 6418

3. 强制关闭其中的显示,例如第2个
#vncserver -kill :2

vim /etc/inittab
id:3:initdefault //将3改为5,id:5:initdefault
系统启动,默认进入文字界面(默认为3);我们要让系统自动进入图形界面(数字5),所以把3改为5。

安装完毕后需要重新启动服务器

CentOS 7.x
#yum -y install wget gcc make vim screen epel-release
#yum clean all //清空YUM缓存
#yum makecache //生成YUM缓存
#yum repolist //确认EPEL状态
#yum -y update
#reboot

yum groupinstall "Development tools" -y
yum groupinstall "GNOME Desktop" -y

开始安装火狐浏览器:
yum -y install wget gcc make epel-release //更新yum源
yum -y install firefox //安装火狐浏览器

安装完毕后需要重新启动计算机或服务器

在CentOS6.x或CentOS7.x上安装EPEL Repo,Extra Packages for Enterprise Linux (EPEL)

免费全能虚拟机VirtualBox


甲骨文公司出品的免费全能虚拟机工具VirtualBox 4.3.28稳定版正式发布。

特别注意:
VirtualBox 是含简体中文语言包的,不过安装的时候要特别注意,如果您登录Windows 的用户名是中文名,会导致软件无法正确安装。

VirtualBox,提供用户在32位或64位的Windows、Solaris及Linux 操作系统上虚拟其它的操作系统。
用户可以在VirtualBox上安装并且运行Solaris、Windows、DOS、Linux、OS/2 Warp、OpenBSD及FreeBSD等系统作为客户端操作系统。
VirtualBox支持Intel VT-x与AMD AMD-V硬件虚拟化技术。
特色:
支持64位客户端操作系统,即使主机使用32位CPU
支持SATA硬盘NCQ技术
虚拟硬盘快照
无缝视窗模式(须安装客户端驱动)
能够在主机端与客户端共享剪贴板(须安装客户端驱动)
在主机端与客户端间创建共享文件夹(须安装客户端驱动)
内置远程桌面服务器
支持VMware VMDK磁盘文件及Virtual PC VHD磁盘文件格式
3D虚拟化技术支持OpenGL(2.1版后支持)、Direct3D(3.0版后支持)、WDDM(4.1版后支持)
最多虚拟32颗CPU(3.0版后支持)
支持VT-x与AMD-V硬件虚拟化技术
iSCSI支持
USB与USB2.0支持

VirtualBox 4.3.28中文版下载
VirtualBox 4.3.28 Oracle VM VirtualBox Extension Pack
VirtualBox 5.0.0中文版下载

CentOS6.x 安装升级Python2.7.x Python3.4.x

CentOS release 6.6 (Final) 安装升级Python2.7.7 Python2.7.9 Python3.4.3

1、查看当前系统中的python版本
#python --version 或 python -V
Python 2.6.6

2、检查CentOS版本
#cat /etc/redhat-release

3、安装所有的开发工具包
#yum groupinstall "Development tools" -y

4、安装其它的必需包
#yum install zlib-devel bzip2-devel openssl-devel ncurses-devel -y

5、下载、编译和安装Python2.7.7
cd /opt
wget https://www.python.org/ftp/python/2.7.7/Python-2.7.7.tgz
tar zxvf Python-2.7.7.tgz
cd Python-2.7.7
./configure
make install

5、下载、编译和安装Python3.4.3
cd /opt
wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz
tar zxvf Python-3.4.3.tgz
cd Python-3.4.3
./configure
make install

6、查看Python版本。
用以下命令查看Python2.7是否已安装

#python2.7 --version
Python 2.7.7

用以下命令查看Python3.4是否已安装
#python3.4 --version
Python 3.4.3

7、更新系统默认Python和python-config版本(可选)
没必要的话最好不进行这项操作(可能会产生关联错误),建议使用python2 或者python3 代替。
先查找python的位置
#whereis python
python: /usr/bin/python2.6-config /usr/bin/python /usr/bin/python2.6 /usr/lib/python2.6 /usr/lib64/python2.6 /usr/local/bin/python3.4m
/usr/local/bin/python3.4-config /usr/local/bin/python3.4 /usr/local/bin/python3.4m-config /usr/local/lib/python3.4 /usr/include/python2.6
/usr/share/man/man1/python.1.gz

cd /usr/bin
rm python
rm python-config
ln -s /usr/local/bin/python3.4 /usr/bin/python //创建一个软连接
ln -s /usr/local/bin/python3.4m-config /usr/bin/python-config //创建一个软连接

#python --version
Python 3.4.3
reboot

8、安装和配置发行包(可选)
cd /opt
wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz
tar xf distribute-0.6.27.tar.gz
cd distribute-0.6.27
python2.7 setup.py install

完成

GPU-Z 0.8.3

GPU-Z是一个轻量级的显卡测试软件,便携易用,界面直观,打开即可显示GPU核心、以及运行频率、带宽等数据。同CPU-Z一样,是硬件检测必备工具。
新版本主要增加了对即将发布的NVIDIA、AMD两款高端显卡的支持。

GPU-Z v0.8.3

GPU-Z 0.8.3

CPU-Z

CPU-Z是检测CPU使用程度最高的一款软件。它支持的CPU种类相当全面,软件的启动速度及检测速度都很快。另外,它还能检测主板和内存的相关信息,其中就有我们常用的内存双通道检测功能。
使用CPU-Z可以查看CPU名称、厂商、内核进程、内部和外部时钟、局部时钟监测等参数。选购之前或者购买CPU后,如果我们要准确地判断其超频性能,就可以通过它来测量CPU实际设计的FSB频率和倍频。

CPU-Z 1.74

中文版:EXE||ZIP (包含32和64位版)
英文版:EXE||ZIP (包含32和64位版)
CPU-Z (1)

CPU-Z (2)
20151210