方舟笔记

方舟笔记

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

Internet Protocol Version 6 (IPv6)地址计算

Internet Protocol Version 6 (IPv6)地址块计算
IPv6 地址块:2602:ffea:1002:12::/64

在很多场合,IPv6地址由两个逻辑部分组成:一个64位的网络前缀和一个64位的主机地址
IPv6 addresses consist of two parts. The most-significant 64 bits are the subnet prefix to which the host is connected, and the least-significant 64 bits are the identifier of the host interface on the subnet.

Autoconfigured address format
part Subnet prefix Interface identifier
bits 64 64

IPv6 地址块:2602:ffea:1002:12::/64 计算
IP Information
IP Type IPv6
CIDR 2602:ffea:1002:12::/64
Uncompressed CIDR 2602:ffea:1002:0012:0000:0000:0000:0000/64
Network Bits 64
Minimum IP 2602:ffea:1002:12::
Gateway 2602:ffea:1002:12::1
Primary IP 2602:ffea:1002:12::2
Last Usable IP 2602:ffea:1002:12:ffff:ffff:ffff:fffe
Maximum IP 2602:ffea:1002:12:ffff:ffff:ffff:ffff
Uncompressed Minimum IP 2602:ffea:1002:0012:0000:0000:0000:0000
Uncompressed Gateway 2602:ffea:1002:0012:0000:0000:0000:0001
Uncompressed Primary IP 2602:ffea:1002:0012:0000:0000:0000:0002
Uncompressed Last Usable IP 2602:ffea:1002:0012:ffff:ffff:ffff:fffe
Uncompressed Maximum IP 2602:ffea:1002:0012:ffff:ffff:ffff:ffff
Number of Usable IPs 18446744073709551615
除了做Gateway的地址,其他地址都可以使用,IPv6地址中主机地址段全为0或者全为都1是合法的。
Configurable Address Range: 2400:6180:0:d0::47f:1000 - 2400:6180:0:d0::47f:100f

Internet Protocol Version 6 配置
IPv6 calculate (1)

IPv6 calculate (2)

IPv6 calculate (4)

IPv6 calculate (3)
use IPv6

在CentOS 6.x或7.x上安装RepoForge Repo


在CentOS 6.x或7.x上安装RepoForge Repo
RepoForge is the new RPMforge.
The RepoForge project maintains RPM packages for: * Red Hat Enterprise Linux (RHEL) * CentOS * Scientific Linux

$ cat /etc/issue
$ uname -a
$ yum install yum* //为了安装yum-config-manager

Import Repoforge GPG key
Next, import the Repoforge RPM repository's official GPG key. That way, you will be able to validate all the RPM packages from the

repository using the key.
$ sudo rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt //导入GPG key

After running the above command, verify that the key has been imported successfully with:
$ yum-config-manager rpmforge | grep gpgkey
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag //检查GPG key

Without importing the key in this step, you will see the following warning when you attempt to install a Repoforge RPM file later.
warning: /var/tmp/rpm-tmp.rHqPLd: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY //不导入GPG key会提示这样的错误信息

CentOS 6.x
32位
sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
64位
sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

CentOS 7.x
64位
sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

Verify Repoforge Repository Status
Once Repoforge is installed on your system, you can verify its status by running:
$ yum repolist //确认Repoforge Repository状态
0 packages excluded due to repository protections
repo id repo name status
base CentOS-6 - Base 6518
epel Extra Packages for Enterprise Linux 6 - x86_64 11365
extras CentOS-6 - Extras 37
rpmforge RHEL 6 - RPMforge.net - dag 4718
updates CentOS-6 - Updates 946
repolist: 23584

In general, it is not a good idea to keep Repoforge enabled as it could potentially cause conflicts with other third-party packages such as EPEL

$ sudo yum-config-manager --disable rpmforge //禁用Repoforge Repository
If successful, the subsequent output should display "enabled=0".

sudo yum-config-manager --enable rpmforge //启用Repoforge Repository
If successful, the subsequent output should display "enabled=1".

Now if you want to install any package from Repoforge repository, use the following command.
$ sudo yum --enablerepo=rpmforge install [package-name] //或者只安装指定包
完成