我的机器是双系统,Win7加Fedora17,且按要求装有PGP加密工具对C盘进行过加密,昨晚为追新将Fedora升级到19,结果PGP窗口就看不见了(猜测原因可能是因为我在安装过程中删除了一个比较小的分区且改过根分区的卷标,这样MBR后第446字节开始的分区信息变化了,从而导致PGP无法解密变化后的MBR),这下麻烦大了。
正在郁闷之际居然意外发现早在一年前安装这个双系统时我就对MBR进行了备份(dd if=/dev/sda of=/bak/mbr.img bs=512 count=1),看来平时习惯一定要好哦,关键时候能帮大忙,进Fedora19系统恢复MBR后(dd of=/dev/sda if=mbr.img bs=512 count=1),久违的PGP窗口出现了,但是Win7菜单还是看不见,再进Fedora19系统编辑/etc/grub2.cfg文件为win7添加下列Grub信息,双系统得以顺利抢救成功。
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
下面是我对Fedora19系统的一些初始化设置,免得下次再找一遍浪费时间,记下来:
1, Fedora19默认的源受伟大的长城防火墙的原因特别的慢且容易断,故安装yum-plugin-fastestmirror来自动选择速度较快的源,且使用163的国内源和rpmforge源(redhat将有版权限制的一些rpm包放在这里,比较丰富且更新及时),最后安装axel多线程下载工具代替yum自身的单线程以及yum-presto下载加速工具。
yum install yum-plugin-fastestmirror
yum install wget && cd /etc/yum.repos.d/ && rm -rf /etc/yum.repos.d/* wget http://mirrors.163.com/.help/fedora-163.repo
yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-19.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-19.noarch.rpm
yum clean all && yum update
yum install axel yum-presto
2, 安装五笔输入法,安装海峰五笔包之后重启机器(不知道为什么)然后再在设置->区域&语言菜单中设置使用它。
并在 setting -> keybord -> Shortucts -> Typing菜单中将切换输入法的快捷键改回我们熟悉的Left Ctrl + Space
yum install ibus-table-chinese-wubi-haifeng
3, 启用最大化,最小化及关闭按钮,安装gnome-tweak-tool工具之后按ALT+F2输入gnome-tweak-tool之后在里面设置(Tweak Tool -> Shell -> Arrangement of buttons on the titlebar改成ALL)。
yum install gnome-tweak-tool
4,安装任务栏,在gnome-tweak-tool的Tweak Tool -> Shell Extensions菜单中访问https://extensions.gnome.org/安装Gnome Shell的插件Taskbar (by zpydr)。
注意,可能访问纯技术网站https://extensions.gnome.org/需要先翻墙。或安装所有安装主题扩展: yum install gnome-shell-theme* gnome-shell-extension*
5,安装Flash Player
cd /tmp && wget http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_linux_111710.tar.gz
tar xzvf flashplayer10_2_p3_64bit_linux_111710.tar.gz
mv /tmp/libflashplayer.so /usr/lib64/mozilla/plugins/
6, 安装chrome及zenmate插件,https://www.google.com/intl/en/chrome/browser/
7, 安装字体infinality补丁,并使用微软雅黑字体
rpm -Uvh http://www.infinality.net/fedora/linux/infinality-repo-1.0-1.noarch.rpm
yum install freetype-infinality fontconfig-infinality
8, 给Firefox设置JRE插件:
sudo ln -s /bak/java/jdk1.7.0_25/jre/lib/amd64/libnpjp2.so /usr/lib64/mozilla/plugins/
cat ~/.bashrc
export JAVA_HOME=/bak/java/jdk1.7.0_25
export M2_HOME=/bak/java/apache-maven-3.0.5
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH
9,配置NFS
sudo systemctl enable nfs-server.service
sudo systemctl start nfs-server.service
# 关闭防火墙, 否则会出现(mount: RPC: Unable to receive; errno = No route to host)
sudo systemctl status firewalld.service
sudo systemctl stop firewalld.service
sudo systemctl disable firewalld.service
下面是一个简单配置示例:
vi /etc/exports
/home/nfsroot *(rw,sync,no_subtree_check)
10, VPN, 直接在Setting -> Network里设置即可,经测试,对PPTP支持不大好,但L2TP好使。
首先要关闭SELinux,可在/var/log/message里看失败日志。
可添加一脚本文件/etc/ppp/ip-up.local用于添加国外路由白名单
#!/bin/bash
# Setting route after the ppp0 has been created. by quqi99
white_ip_list=`cat << EOF
74.125.235.68 # google.com
74.125.128.91 # google.com
76.74.254.123 # fanqianghou.com
192.30.252.129 # github.com
198.101.231.251 # review.openstack.org
199.59.150.39 # twitter.com
103.245.222.184 # pypi.python.org
185.31.17.185 # pypi.python.org
EOF
`
#service xl2tpd restart
#echo 'c quqi99' >/var/run/xl2tpd/l2tp-control
DEVICE=ppp0
PUBLIC_GW=$(ip -4 addr show |grep 'scope global' | awk {'print $2'} |head -1 |awk -F '.' {'print $1"."$2"."$3"."1'})
route add default gw $PUBLIC_GW
echo "$white_ip_list" | while read line; do
white_net=$(echo $line |awk {'print $1'} |awk -F '.' {'print $1"."$2"."$3"."0'} |uniq)
route add -net ${white_net}/24 dev $DEVICE
done
route del -net 0.0.0.0 gw 0.0.0.0 dev $DEVICE
10, 安装QQ
1)下载http://www.longene.org/download/WineQQ2013-20131120-Longene.deb
2)解压,并将解压出来的opt文件下的longene文件夹放入/opt下,并把usr文件夹下的两个文件放入对应的根目录下(即/usr/bin和/usr/share/applications下)。
cp -r /bak/tmp/qq/opt/longene /opt/
cp -r /bak/tmp/qq/usr/bin/* /usr/bin/
cp -r /bak/tmp/qq/usr/share/applications/qq-test.desktop /usr/share/applications/
3) 运行/opt/longene/wineapp/qq2012/qq2012.sh会无法启动,需安装插件,代码:
yum install alsa-lib-devel.i686 alsa-lib-devel audiofile-devel.i686 audiofile-devel cups-devel.i686 cups-devel dbus-devel.i686 dbus-devel fontconfig-devel.i686 fontconfig-devel freetype.i686 freetype-devel.i686 freetype-devel giflib-devel.i686 giflib-devel lcms-devel.i686 lcms-devel libICE-devel.i686 libICE-devel libjpeg-turbo-devel.i686 libjpeg-turbo-devel libpng-devel.i686 libpng-devel libSM-devel.i686 libSM-devel libusb-devel.i686 libusb-devel libX11-devel.i686 libX11-devel libXau-devel.i686 libXau-devel libXcomposite-devel.i686 libXcomposite-devel libXcursor-devel.i686 libXcursor-devel libXext-devel.i686 libXext-devel libXi-devel.i686 libXi-devel libXinerama-devel.i686 libXinerama-devel libxml2-devel.i686 libxml2-devel libXrandr-devel.i686 libXrandr-devel libXrender-devel.i686 libXrender-devel libxslt-devel.i686 libxslt-devel libXt-devel.i686 libXt-devel libXv-devel.i686 libXv-devel libXxf86vm-devel.i686 libXxf86vm-devel mesa-libGL-devel.i686 mesa-libGL-devel mesa-libGLU-devel.i686 mesa-libGLU-devel ncurses-devel.i686 ncurses-devel openldap-devel.i686 openldap-devel openssl-devel.i686 openssl-devel zlib-devel.i686 pkgconfig sane-backends-devel.i686 sane-backends-devel xorg-x11-proto-devel glibc-devel.i686 prelink fontforge flex bison libstdc++-devel.i686 pulseaudio-libs-devel.i686 gnutls-devel.i686 libgphoto2-devel.i686 openal-soft-devel openal-soft-devel.i686 isdn4k-utils-devel.i686 gsm-devel.i686 samba-winbind libv4l-devel.i686 cups-devel.i686 libtiff-devel.i686 gstreamer-devel.i686 gstreamer-plugins-base-devel.i686 gettext-devel.i686 libmpg123-devel.i686
4) 在终端中输入:qq2013可以启动了,如密码无法输入,只能用软键盘输入。
或者用下列方法使用qq (pidgin的webqq插件):
$ sudo yum install gcc gcc-c++ make cmake pkgconfig glib-devel libcurl-devel libpurple-devel sqlite-devel libev-devel zlib-devel git pidgin
$ git clone -b dev https://github.com/xiehuc/pidgin-lwqq.git
$ cd pidgin-lwqq
$ git submodule init
$ git submodule update
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
注意:要把pidgin重启一次才行,如果之前你添加过账号,请先删除,然后重新添加选择WEBQQ,然后输入账号密码就行了
11, 安装另他一些常用工具和软件:
yum install nautilus-open-terminal p7zip p7zip-plugins shutter stardict filezilla unrar gcc gcc-c++ qemu-kvm libvirt virt-manager
12, Fedora 19安装OpenStack前的准备工作:
1),关闭selinux,修改/etc/selinux/config。设置SELINUX=disabled
sed 's/^SELINUX=.*$/\1permissive/' -i /etc/selinux/config
setenforce 0
2),关于firewalld与iptables,firewalld是动态防火墙,可以实现规则的动态添加和删除,而iptables是静态防火墙,在添加或删除规则后只能通过重启防火墙使规则生效
iptables默认没有任何规则,而firewalld默认有一些规则,在用命令iptables -nL --line-number显示防火墙规则时,iptables把firewalld中的规则也一块显示了出来,因此在用iptables时要用systemctl stop firewalld停止firewalld。
yum -y install iptables-services
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl enable iptables
双系统如何删除Linux,恢复Windows从MBR引导启动?:http://www.linuxdiyf.com/linux/13443.html
Linux MBR扇区故障排查修复:http://www.linuxdiyf.com/linux/10925.html
双系统下MBR的备份方法:http://www.linuxdiyf.com/linux/509.html