加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Linux Wiki

发布时间:2020-12-14 02:03:07 所属栏目:Linux 来源:网络整理
导读:Linux Wiki General OS Shell Keymap Ctrl Wifi Connect of XIAOMI CentOS 7 Hostname New User Authorization EPEL How to Install Nodejs How to install Python3.x How to Install Git How to Install Emacs26 Manjaro Chinese Input Way Software Source
  • Linux Wiki
    • General OS
      • Shell
      • Keymap Ctrl
      • Wifi Connect of XIAOMI
    • CentOS 7
      • Hostname
      • New User & Authorization
      • EPEL
      • How to Install Nodejs
      • How to install Python3.x
      • How to Install Git
      • How to Install Emacs26
    • Manjaro
      • Chinese Input Way
      • Software Source Mirrors
      • Chinese Inputing of Emacs
      • Resize of Org Inline Image
    • Ubuntu
      • Reset Font-family of Mint

Linux Wiki

General OS

Shell

How to install and swtich to shell?

# print current shell
echo $SHELL

# print installed shells
cat /etc/shells

# switch to specific shell,such as zsh
sudo yum install -y zsh
chsh -s /bin/zsh

How to install oh-my-zsh?

# Via curl
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

# Via wget
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Keymap Ctrl

# swap Caps and Ctrl
sudo nano /etc/profile
setxkbmap -option ctrl:swapcaps

# or just map Caps to Ctrl (Recommended)
sudo nano /etc/default/keyboard
# update
XKBOPTIONS="ctrl:nocaps"

Wifi Connect of XIAOMI

sudo nano /etc/modprobe.d/blacklist.conf

Append blacklist acer-wmi to the file,save,exit and reboot your PC.

CentOS 7

Hostname

In CentOS,there are three type of hostnames:

  • static hostname,which is readed from /etc/hostname;
  • transient hostname,which is a temporary hostname via DHCP or mDNS;
  • pretty hostname.

In centOS 7,it offers a hostnamectl command here,by which you can query and update the hostname configuaration.

# set hostname as 'jk'
hostnamectl -set-hostname jk

# more about hostnamectl
hostnamectl -h

How to update /etc/hosts manually???

New User & Authorization

How to add a new user?

# new user 'jack'
adduser jack
# set passwd
passwd jack

How to add authorization?

Note that,the new user don‘t have the permission of sudo,and you must add an authorization by editing /etc/sudoers/.

## Allow root to run any commands anywhere
root    ALL=(ALL)        ALL
jack    ALL=(ALL)        ALL    # authorize 'jack'

EPEL

EPEL,i.e. Extra Packages for Enterprise Linux,is maintained by Fedora and having no conllisions of Offical Package.

# RHEL/CentOS7 install EPEL
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

# Query & Update
ll /etc/yum.repos.d/
yum clean all && yum makecache

How to Install Nodejs

Source Codes Compile

# install gcc , gcc-c++
yum -y install gcc gcc-c++

# download the corresponding source code
wget https://nodejs.org/dist/v10.15.1/node-v10.15.1.tar.gz

# extract it to current folder
tar -zxvf node-v10.15.1.tar.gz

# cd 'node-v10.15.1'
cd node-v10.15.1

# make & install
./configure --prefix=/usr/local/node
make && make install

# set PATH
export PATH=$PATH:/usr/local/node/bin

Archive Installation

# download the newest archive package
wget https://nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.xz

# extract
xz -d node-v10.15.1-linux-x64.tar.xz
tar -xvf node-v10.15.1-linux-x64.tar

# move it to a specific folder,like '/opt'
mv node-v10.15.1 /opt/node

# set PATH
export PATH=$PATH:/opt/node/bin

Taobao Mirror

# temporary
npm --registry https://registry.npm.taobal.org install xxx

# permanent
npm config set registry https://registry.npm.taobao.org

Via npm config get registry to check weather it successful.

How to install Python3.x

# install commpile tools,such as 'gcc' 'g++'
yum -y install gcc gcc-c++
# necessary libs
yum -y install zlib zlib-devel
yum -y install libffi-devel

Source Code Installation

# download source code package
wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz

# extract
tar -zxvf python-3.7.2

# make & install
cd python-3.7.2
./configure --prefix=/usr/local/python3
make && make install

# set PATH
export PATH=$PATH:/usr/local/python3/bin

How to Install Git

# install a compile tool
yum install perl-devel

# download & extract source code
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.xz
xz -d git-2.9.5.tar.xz
tar -xvf git-2.9.5.tar

# make & install
cd git-2.9.5
make && make install

# set PATH
export PATH=$PATH:/usr/local/git/bin

How to Install Emacs26

# download source code package
wget http://mirrors.ustc.edu.cn/gnu/emacs/emacs-26.1.tar.xz

# ready for compiling
# . not found: gnutls
yum install gnutls gnutls-devel
# . tputs was not found
yum install ncurses-devel

# extract & make & install
xz -d emacs-26.1.tar.xz
tar -xvf emacs-26.1.tar

./configure --prefix=/usr/local/emacs26
make && make install

# set PATH
export PATH=$PATH:/usr/local/emacs26/bin

Manjaro

Chinese Input Way

# Install fcitx modules
# fcitx-im includes all 'Gtk+/Qt' modules
# fcitx-configtool is a GUI configtool
pacman -S fcitx-im fcitx-configtool

Fcitx has a built-in ‘Pingyin‘,and if you want to install ‘sogoupinyin‘:

# install sogoupinyin
pacman -S fcitx-sogoupinyin
# and
nano ~/.xprofile

Append the following contents to .xprofile:

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export [email?protected]=fcitx

Software Source Mirrors

Software Source,a remote software archives repo,like:

  • TUNA (Tsinghua Open Software Source)
  • USTC (University of Science and Technology Mirrors)

Sort the mirrorlist

nano /etc/pacman.d/mirrorlist

Move tuna and ustc ahead of the mirrorlist.

Add archlinuxcn Repo

nano /etc/pacman.conf
# append the following contents to 'pacman.conf'

# TUNA (ipv4,ipv6,http,https)
[archlinuxcn]
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
# Save & Exit,and exec
sudo pacman -Syy

# Install GPG keys of archlinuxcn
sudo pacman -S archlinuxcn-keyring

# Update & Upgrade
sudo pacman -Syyu

Chinese Inputing of Emacs

# edit .bashrc or .zshrc
sudo nano ~/.bashrc
# set an alias to start Emacs
alias myemacs ='LC_CTYPE="zh_CN.utf8" emacs'
# make it effective
source ~/.bashrc

How to make it effective with Emacs GUI?

sudo nano /etc/profile

# append the following contents
export LC_CTYPE="zh_CN.UTF-8"

Restart you PC,and it will be okay.

Resize of Org Inline Image

Refer Link

In Org Mode,it offers a org-toggle-inline-images command,which can show the inline-image.

You can adjust the size of the image via org-image-actural-width variable,like:

  • t,(setq org-image-actual-width t),stands for its origin size;
  • number,(setq org-image-actual-width 300),stands for 300;
  • number list,(setq org-image-actual-width ‘(300)),if without #+ATTR.* of .org file;
  • nil,(setq org-image-actual-width nil),just #+ATTR.* can make it effective,the other ways will be origin size.

Ubuntu

Reset Font-family of Mint

You need to remove two installed packages,like:

sudo apt remove fonts-arphic-ukai fonts-arphic-uming

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读