Linux configuration memo

· Read in about 3 min · (429 Words)

以下是我的Fedora KDE 安装后的配置备忘录,也适用于Ubuntu。

last update 2016-05-21

Network

static ip

sudo vim /etc/sysconfig/network-scripts/ifcfg-enp1s6

NAME=etho0
BOOTPROTO=static
IPADDR=192.168.1.200
NETMASK=255.255.255.0
NETWORK=192.168.1.1
ONBOOT=yes

ssh 连接延迟

修改/etc/ssh/sshd_config,把UseDNS yes改为UseDNS no

编辑/etc/nsswitch.conf 找到hosts那行,将其改成下面这样:

hosts: files dns [NOTFOUND=return]

重启ssh

sudo /etc/init.d/ssh restart

Proxy

ALL

ALL_PROXY=socks5://127.0.0.1:8888 git clone https://github.com/some/one.git

user

vim ~/.bashrc
export http_proxy=http://192.168.1.101:808
export ftp_proxy=http://192.168.1.101:2121

apt-get

vim /etc/apt/apt.conf.d/00aptitude
Acquire::http::proxy “http://192.168.1.101:808”;
Acquire::ftp::proxy “ftp://192.168.1.101:2121”;

yum

sudo vim /etc/yum.conf
proxy=http://192.168.1.101:808

cpan

cpan
o conf init /proxy/

R

Sys.setenv(http_proxy="http://192.168.1.100:808")
Sys.getenv("http_proxy")

Terminal

颜色问题和编码

ssh客户端类型xterm,使用anci颜色,字符编码选utf-8 修改/etc/profile文件,添加. ~/.bashrc

if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
. ~/.bashrc
fi

Development environment

sudo yum install gcc gcc-c++ autoconf automake make libtool autoconf  ncurses-devel
yum groupinstall "Development tools"

Software center

  • muon

System Monitor

  • htop - an interactive process viewer for Linux,下载后编译安装
  • 传感器 sudo yum install lm_sensors hddtemp , run sudo sensors-detect , and run sensors 
  • Glances - a cross-platform curses-based monitoring tool written in Python. sudo yum install glances python-pip ,sudo pip install pysensors ,glances 。参考
  • sysstat utilities are a collection of performance monitoring tools for Linux. 使用mpstat监控CPU的使用情况.
  • 安装rootkit hunter来检测自己是否被肉鸡了
  • 记一次Linux服务器上查杀木马经历
  • klamav.x86_64 : Clam Anti-Virus on the KDE Desktop
  • Fishing for Hackers: Analysis of a Linux Server Attack 1 2

Cluster

 SSH::Batch - Cluster operations based on parallel SSH, set and interval arithmetic

Network tools

Office

Printers

  1. install samba by sudo dnf install samba* -y
  2. run smbclient -L 10.10.188.66 get the printer name
  3. add printer with samba protocol: smb://10.10.188.66/CanonLBP2900

Fedora

Utilites

  • ranger -  file manager
  • The ultimate Vim configuration: vimrc
  • 虚拟机,Virtual box,安windows 7比XP顺利。
  • trash-cli -  Command line interface to the freedesktop.org trashcan. 避免rm -rf / 的悲剧,参考中文介绍
  • autojump -  自动补完不算什么,一键直达目录才是终极神器! apt-get/yum即可安装
  • [Bashmarks][6] is a shell script that allows you to save and jump to commonly used directories
  • dirsize -  Summarize size of directories and files in directories。我自己写的
  • brename -  Recursively batch rename files and directories by regular expression。我自己写的
  • peco -  Simplistic interactive filtering tool
  • httpie -  HTTPie is a command line HTTP client, a user-friendly cURL replacement
  • datamash -  GNU datamash is a command-line program which performs basic numeric,textual and statistical operations on input textual data files.
  • distribution -  Short, simple, direct scripts for creating ASCII graphical histograms in the terminal.
  • fdupes -  FDUPES is a program for identifying or deleting duplicate files residing within specified directories.
  • FSlint -  FSlint is a utility to find and clean various forms of lint on a filesystem.
  • pigz - A parallel implementation of gzip for modern multi-processor, multi-core machines
  • install font to support emoji : gdouros-symbola-fonts

Misc

解决开机时候硬盘狂转。是updatedb运行造成的,停用或者改为每月一次即可。

sudo mv /etc/cron.daily/mlocate /etc/cron.daily/cron.monthly/

Fedora 23中文显示优化,超美

Optimization for an SSD?