文章出處

fedora安裝后的一些配置

(mirror)源

換源

默認從fedora官網下載太慢,考慮換用國內的源(鏡像站點),推薦中科大阿里云浙大網易等的源。

比如我用浙大ZJU的源http://mirrors.zju.edu.cn and follow the page's instruction.,可按照配置生成器進行repo文件的生成,并根據提示保存配置,

e.g.

請刪除/etc/yum.repos.d/fedora.repo和/etc/yum.repos.d/fedora-updates.repo,然后在/etc/yum.repos.d目錄中建立fedora.repo文件,并填入下列內容

[fedora]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/releases/$releasever/Everything/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[fedora-debuginfo]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/releases/$releasever/Everything/$basearch/debug/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[fedora-source]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/releases/$releasever/Everything/source/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[updates]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/updates/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[updates-debuginfo]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/updates/$releasever/$basearch/debug/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[updates-source]
name=Fedora $releasever - $basearch
baseurl=http://mirrors.zju.edu.cn/fedora/updates/$releasever/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

rpmfusion 好用的第三方源

To download and install more useful software, use rpmfusion.

rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
rpm -ivh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

(font)字體

infinality字體渲染

The default font is ugly. Copy Microsoft's truetype font is not a good method, it's nasty.
I use infinality. Though the website don't update anymore.
First, download fontconfig-infinality and freetype-infinality:

wget http://www.infinality.net/fedora/linux/20/noarch/fontconfig-infinality-1-20130104_1.noarch.rpm
wget http://www.infinality.net/fedora/linux/20/x86_64/freetype-infinality-2.4.10-1.20120615_01.fc17.x86_64.rpm

then install them using rpm command:

sudo rpm -ivh fontconfig-infinality-1-20130104_1.noarch.rpm freetype-infinality-2.4.10-1.20120615_01.fc17.x86_64.rpm 

(maybe you have to solve the dependencies manually)

then, set the font renderr style using infinality script. I choose osx style. the command is:

sudo /etc/fonts/infinality/infctl.sh setstyle

and choose the number you like.

MONACO字體

我喜歡用MONACO作為等寬字體。

wget http://jsdx.sc.chinaz.com/Files/DownLoad/font2/908.rar   # 下載MONACO字體
sudo yum install unrar         # 下載unrar:
unrar x 908.rar   # 解壓
cd 908
sudo mkdir -p /usr/share/fonts/my_font
sudo mv MONACO.TTF /usr/share/fonts/my_font/
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -fv  # 更新字體緩存

好了,現在可以在終端中選擇MONACO作為顯示的等寬字體了。

build tools

sudo yum install gcc-c++ cmake

opencv

use yum command to list packages related to opencv:

yum list *opencv*

and select proper packages(that is, packages you need) to download:

sudo yum install opencv-core opencv opencv-devel opencv-python

close SELinux

SELinux is useless for common people. Just close it.

sudo vim /etc/selinux/config

and change the content to:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled            # here we modify "enforcing" to "disabled"
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

and we need a reboot to disable SELinux. If don't disable SELinux, apps like Chrome can't be used happily

chrome

First, download chrome. I don't like using a repo for chrome, since every time the system updates, it speed down.

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

then use yum to download depences:

yum install redhat-lsb
yum install libXScrnSaver

now let's install chrome:

sudo rpm -ivh google-chrome-stable_current_x86_64.rpm 

python

這里配置了python、python-devel以及pip

sudo dnf install python python-devel python-pip

然后創建pip的用戶自配置文件,使用阿里云的源來加速訪問,即創建并編輯~/.pip/pip.conf,內容為:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

shadowsocks

Here I use a command line tool for shadowsocks.

# sudo easy install pip
sudo pip install shadowsocks

then download SwitchySharp.crx and drop it to your chrome extension, and config it.
Shadowsocks is a socks5 agent, and the default local port is 1080.

then remember to create a shadowsocks-config file, writing your config as following(you can just copy them from the file you http://downloaded from portal.shadowsocks.com):

{
    "server": "jp01-19.ssv4.net",
    "server_port": "12345",
    "local_port": 1080,
    "password": "JabcdefghijX",
    "timeout": 600,
    "method": "aes-256-cfb"
}

and use the following command to start shadowsocks:

sslocal -c shadowsocks.cfg 

git

git配置ssh

ssh-keygen -t rsa -C "zchrissirhcz"//注意。zchrissirhcz為用戶名
//然后三次回車
cat /home/forwhat.cn/.ssh/id_rsa.pub
//復制cat出來的內容

然后到github上個人賬戶設置中配置SSH Keys:把cat出來的內容貼上去

vim

I use vundle to manage my vim plugins.

sudo yum install vim
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
mkdir -p workspace/gitwhat
cd workspace/gitwhat
git clone https://github.com/zchrissirhcz/dotfiles
mkdir -p ~/.vim/colors
cp molokai.vim ~/.vim/colors

then open vim and do bundle install:

:BundleInstall

fcitx輸入法

不必卸載默認的ibus。

sudo yum install fcitx-pinyin
sudo yum install fcitx-configtool
sudo yum install im-chooser
gsettings set org.gnome.settings-daemon.plugins.keyboard active false
im-chooser

彈出的對話框中選擇fcitx。重啟后可以使用。
配置: 使用 fcitx-configtool 進行配置。
在全局配置的快件鍵->顯示高級選項中,我把切換激活/非激活輸入法設定為左shift,輸入法切換鍵設定為Ctrl+Space。

如果ctrl+空格無法設定,結果顯示是LCtrl,也就是左Control鍵。這種情況是你的Ctrl+Space被別的程序捕獲了,比如我在系統設置->全部設置->鍵盤->快捷鍵->打字->切換至下個輸入源,這里設定為了Ctrl+Space,這里改掉,fcitx那里就可以設定Ctrl+Space來激活輸入法了。

快捷鍵

配置開啟終端快捷鍵

設置->鍵盤->快捷鍵->自定義快捷鍵->添加:

name:terminal
command:/usr/bin/gnome-terminal
#按鍵設定為Ctrl+Alt+T

配置截屏快捷鍵

mkdir ~/bin
cd ~/bin
vim screenshot

添加如下內容:

#!/bin/bash
gnome-screenshot -ai

添加軟鏈接并添加可執行權限:

sudo ln -sf /home/chris/bin/screenshot /usr/bin/screenshot
chmod +x ~/bin/screenshot

最后到:設置->鍵盤->快捷鍵->自定義快捷鍵->添加:

name:screenshot
command:screenshot
#按鍵設定為Ctrl+Alt+Q

PS1變量

在.bash_rc中添加:

export PS1="$(tput setaf 1)\w\n\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h\[$(tput setaf 5)\]\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$\[$(tput sgr0)\] "

美化終端顯示

cd ~
wget --no-check-certificate https://github.com/seebi/dircolors-solarized/raw/master/dircolors.ansi-universal
#or
#wget http://download.bbkanba.com/dircolors

mv dircolors.ansi-universal  ~/.dir_colors
eval `dircolors ~/.dir_colors`
cat >>  ~/.bashrc <<ALLEND
########################################
if [ -x /usr/bin/dircolors ]; then
    alias ls='ls --color=auto'
    alias dir='dir --color=auto'
    alias vdir='vdir --color=auto'
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
    alias tree='tree -C'
fi
########################################
ALLEND
source ~/.bashrc
ls

取消終端下光標閃爍

gsettings set org.gnome.desktop.interface cursor-blink false

virtualbox虛擬電腦目錄的移動

比如原來放在$HOME下,現在空間不夠了,但是/opt是有空間的。怎樣移動過去呢?

先用命令移動整個目錄到目標位置
再設置全局的虛擬電腦目錄(管理-》全局設定-》默認虛擬電腦位置)
(可能要修改/etc下的一個vbox配置文件)
然后發現原來的vbox都報錯了打不開 刷新也沒用
在vbox主界面中刪除原有的vbox
在vbox主界面 控制-》注冊-》選擇新位置的vdi文件

vdi文件擴容

VBoxManage modifyhd         <uuid>|<filename>     [--resize <megabytes>|--resizebyte <bytes>]

比如:

vboxmanage modifyhd fedora22.vdi --resize 20480

然后進入系統(你當然是要在關閉它時候才修改vdi文件大小的。。),發現還是原來容量,但是有了一塊‵空閑區域`。
fdisk命令已經不太會用了。不過gparted很好用:

sudo yum install gparted

zsh

sudo yum install zsh
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
chsh

在終端中打開文件夾,以及在文件夾中打開終端

sudo dnf install nautilus-terminal nautilus-open-terminal

文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()