Skip to content

yanghui1228/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

title style numbering
UBUNTU DOTFILE configuration
github.css
false

@toc

🔳 ubuntu 更换国内源 (optional)

backup /etc/apt/sources.list

cp /etc/apt/sources.list /etc/apt/sources.list.bak

/etc/apt/sources.list文件前面添加如下条目

#添加阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

🔳 Remove snap

snap list
sudo snap remove <package>
sudo umount /snap/core/xxxx
sudo umount /var/snap
sudo apt purge snapd

rm -rf ~/snap
sudo rm -rf /snap
sudo rm -rf /var/snap
sudo rm -rf /var/lib/snapd

📔 FSTAB

sudo -e /etc/fstab

and add below lines

# HDD
UUID=415efeb5-ecae-4c53-90c6-4e5701578b46 /home/yanghui/HDD1   ext4    noatime           0       0

🔗 Downloads/Videos/Music Folder soft link

cd ~
rmdir Downloads
ln -s /home/yanghui/HDD1/Downloads Downloads
rmdir Videos
ln -s /home/yanghui/HDD1/Videos Videos
rmdir Music
ln -s /home/yanghui/HDD1/Music Music

🔁 swap

# 禁用swap
sudo swapoff /swapfile
# 修改swap 空间
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
# 设置文件为“swap file”类型
sudo mkswap /swapfile
# 启用swapfile
sudo swapon /swapfile

🔯 Software installation

Microsoft Edge

# Download & install the GPG Key
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -

# Add the stable repository
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main"

# refresh cache and install
sudo apt update
sudo apt install microsoft-edge-stable

🗜 Gnome file roller 乱码问题

# install unrar
sudo apt install unrar
# 在 /etc/environment 中加入以下两行:
UNZIP="-O CP936"
ZIPINFO="-O CP936"
``` sudo apt-get remove p7zip-full p7zip ```

Gnome extension

install user theme

# themelib - 
~/.local/share/.themes

🔧 Gnome tweaks

sudo apt install gnome-tweaks

VMware Horizon Client for linux

sudo sh ./VMware-Horizon-Client-5.2.0-14604769.x64.bundle

🎵 music player

🎮 Linux gaming

sudo apt install Steam

🎬 Video player

ubuntu 20.04可直接安装Celluloid,不需要安装mpv和配置,方便不少。

sudo apt install Celluloid
# mpv config file
~/.config/mpv/mpv.conf

📬 email

geary (with outlook account)

imap:outlook.office365.com

smtp:smtp.office365.com startTLS

# set default keyring
services.gnome3.gnome-keyring.enable = true;
security.pam.services.sddm.enableGnomeKeyring = true;

or check below wiki for more details

📃 VIM

# Vim Configuration Files
sudo apt install vim
vi ~/.vim/vimrc

📜 Gedit

sudo apt install gedit-plugins
wget https://raw.githubusercontent.com/maateen/gedit-material-theme/master/material-theme.xml -O ~/.local/share/gedit/styles/material-theme.xml

Vim can be configured system wide (globally) via the /etc/vim/vimrc.local file on Ubuntu/Debian based operating systems.

📥 Download manager

install and config aria2

setup startup application with /bin/aria2c --conf-path=/home/yanghui/.aria2/aria2.conf -D

🔃 NFS/samba

Install samba

sudo apt-get install samba smbclient
sudo vim /etc/samba/smb.conf 
sudo service smbd restart

🖼 viewnior

sudo apt purge eog
sudo apt install viewnior

🖥 VMware player

cd 'C:\Program Files\VMware\VMware Tools'
.\VMwareToolboxCmd disk shrink C:\
sudo vi /usr/share/applications/vmware-player.desktop
Exec=/usr/bin/vmplayer '/home/yanghui/vmware/Windows 10 x64/Windows 10 x64.vmx'

🗃 WPS office 2019

🔳 zsh

# install oh my zsh
sudo apt install zsh
git clone https://github.com/robbyrussell/oh-my-zsh ~/.oh-my-zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# set zsh as default
sudo -s
chsh -s /bin/zsh root
chsh -s /bin/zsh username
# recover ~/.zshrc from backup

安装oh my zsh插件

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

📰 epub reader

Foliate

🅫 markdown editor

  • Install
sudo add-apt-repository ppa:apandada1/marker
sudo apt update
sudo apt install marker
  • Marker style_sheet is in /usr/share/com.github.fabiocolacio.marker/styles

  • Replace mermaid.min.js for diagrams rendering

    1. download the latest mermaid.min.js
    2. replace the local version in /usr/share/com.github.fabiocolacio.marker/scripts/mermaid/mermaid.min.js
/usr/share/gtksourceview-3.0/language-specs
- Upgrade highlight.js 1. download the latest from [highlight.js](https://github.com/highlightjs/cdn-release) 2. replace the local version in `/usr/share/com.github.fabiocolacio.marker/scripts/highlight/highlight.pack.js`

🐴 amule (optional)

https://www.wendangwang.com/doc/44244f4230c7557b781be223

https://blog.csdn.net/unixboy_xujf/article/details/83288619

sudo apt-get install amule-daemon
vi /etc/default/amule-daemon
change below:
AMULED_USER=”yanghui”
AMULED_HOME=”/home/yanghui”

vi ~/.aMule/amule.conf
Password= #这行,需要填入用户设置的password的MD5值
AcceptExternalConnections=1
ECPassword= #这行,需要填入用户设置的password的MD5值

echo -n yourpasswordhere | md5sum
/etc/init.d/amule-daemon start
or 
amuled -f

stop service - 
/etc/init.d/amule-daemon stop

manage the downloads - 
amulecmd
## Chinese input method - RIME (no need for ubuntu 20.04)
sudo apt-get install ibus-rime
vi ~/.config/ibus/rime/default.yaml
schema_list:   
  - schema: luna_pinyin_simp #simp是简体,第一位是默认输入法 
menu:
  page_size: 9 #每页候选词个数
ascii_composer:
  switch_key:
    Shift_L: commit_code #左shift提交字母
## 🎮 Cocos creator (optional) Run on vmware on windows 10

🔠 Fonts

fonts libs

/usr/share/fonts
/usr/local/share/fonts
~/.local/share/fonts

refresh the fonts cache

sudo fc-cache -f -v
  • UI - SF Pro Display Regular

  • Hiragino Sans GB (default for SanSerif font)

  • Noto Serif CJK (default for Serif font)

sudo cp ~/HDD1/Linux/Fonts/NotoSansCJKsc-hinted/NotoSansCJK-* to /usr/share/fonts/opentype/noto
sudo chmod 644 NotoSansCJK-*
sudo fc-cache -fv
  • Document - SF Pro Text Regular (default for document)

  • Source Code Pro (default for mono font)

  • Ping Fang

    PingFang Fonts

  • Noto Sans CJK 配置

    Note: On ubuntu english version, the noto fonts are placed JP language first which caused some chinese fonts not displayed correctly. So need to replace with language specific noto fonts. Google Noto CJK Chinese Characters for ubuntu on Zhihu.com

  • 中文顺序修复

    sudo vim /etc/fonts/conf.d/30-cjk-aliases.conf
    sudo vim /etc/fonts/conf.d/64-language-selector-prefer.conf
    sudo vim /etc/fonts/conf.d/60-latin.conf
    
  • 方正细金陵简体 (optional)

  • 方正屏显雅宋 (optional)

  • Monaco font in gnome terminal (optional)

    issue on Monaco font need to copy font into /usr/share/fonts/truetype/custom

Icon & Theme

Icon - WhiteSur

cd /home/yanghui/.local/share/icons/WhiteSur/apps/scalable
sudo cp /home/yanghui/HDD1/ubuntu/Citrus-icon-theme/src/scalable/apps/baidunetdisk.svg /usr/share/icons/Numix-Circle/48/apps

appliation icons:
/usr/share/applications
~/.local/share/applications

刷新图标缓存

update-icon-caches /home/yanghui/.local/share/icons/* 

Theme

WhiteSur-gtk-theme-master

🔳 固定 IP

setup IP with 192.168.1.100 and DNS name as 192.169.1.1

🐍 Python configuration

pip3 国内源

mkdir ~/.pip
vim ~/.pip/pip.conf

然后将下面这两行复制进去就好了

[global]
index-url = https://mirrors.aliyun.com/pypi/simple

TA-lib install

TA-lib instruction

pip packages to install

sudo apt install python3-pip
pip3 install TA-Lib html5lib future baostock pandas matplotlib pandas lxml bs4 aiohttp statsmodels jinja2 colorlog
# setup mailmerge utils
sudo pip3 install mailmerge

git

  • install git
sudo apt install git
  • setup git credentials for $HOME/.gitconfig or setup as below
git config --global credential.helper store
git config --global user.email "stevenyanghui@qq.com"
git config --global user.name "yanghui"

crontab (no sudo)

  • crontab setup for user [yanghui]

    Crontab -e
    Crontab -l
    Crontab -r
    MAILTO=''
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
    SHELL=/bin/zsh
    # tushare download service   
    30 14 * * 1,2,3,4,5 python3 $HOME/Documents/quantest/tushare/hindenburgOmenV1.py
    00 16 * * 1,2,3,4,5 python3 $HOME/Documents/quantest/tushare/tushare_auto_downloader_v4.py
    # baostock download service
    30 17 * * 1,2,3,4,5 python3 $HOME/Documents/quantest/baoStock/baostockAutoDownloaderV14.py
    # 东方财富国家队新近股票追踪
    30 08 * * 1,2,3,4,5,6 python3 $HOME/Documents/quantest/eastmoney.com/state_capital_v1.py
    # 东方财富每日行业涨幅排名
    15 20 * * 1,2,3,4,5 python3 $HOME/Documents/quantest/eastmoney.com/industry_turn_around_v1.py
    # gaoqing.la
    00 18 * * 0,1,2,3,4,5,6 python3 $HOME/Documents/quantest/Other/gaoQing/gaoQing/spiders/gaoQing2.py
  • check crontab mail (optional)

sudo apt install postfix
sudo tail /var/mail/username

🔳 Misc

Check and Kill process

ps aux
kill {PID} 

list zombie process and kill it

ps axo stat,ppid,pid,comm | grep -w defunct
sudo kill -9 {PID}

🔳 Disable recent files (optional)

sudo chattr +i ~/.local/share/recently-used.xbel

ubuntu 20.04 nvidia driver issue

xrandr --screen 0

  1. Edit /etc/config/grub to remove 'splash' from GRUB_CMDLINE_LINUX_DEFAULT

  2. Regenerate /boot/grub/grub.cfg with sudo update-grub

  3. Regenerate the initrd.img files by using sudo apt-get --reinstall install to reinstall the currently installed kernel packages.

fix the login monitor issue

sudo cp ~/.config/monitors.xml ~gdm/.config/
## nvidia setting (not required after ubuntu 20.04.3)

/etc/X11/xorg.conf

can't rotate monitor on

截屏

  • PrtSc – 获取整个屏幕的截图并保存到 Pictures 目录。
  • Shift + PrtSc – 获取屏幕的某个区域截图并保存到 Pictures 目录。
  • Alt + PrtSc –获取当前窗口的截图并保存到 Pictures 目录。
  • Ctrl + PrtSc – 获取整个屏幕的截图并存放到剪贴板。
  • Shift + Ctrl + PrtSc – 获取屏幕的某个区域截图并存放到剪贴板。
  • Ctrl + Alt + PrtSc – 获取当前窗口的 截图并存放到剪贴板。

蓝牙自动连接

bluetoothctl connect EC:FA:5C:43:6C:28 

How to change the date display to international format

  • restore /usr/share/i18n/locales/en_CN
  • restore /var/lib/locales/supported.d/local
  • sudo dpkg-reconfigure locales
  • restore /etc/environment
  • Reboot/relogin, Now you should have dates displayed like this: 2007-01-18.

Firefox about:config

  • mousewheel.system_scroll_override.vertical.factor = 400
  • gfx.webrender.all = true
  • extensions.pocket.enabled = false
  • webgl.force-enabled = true
  • webgl.msaa-force = true

Hide mounted driver from docker

gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false

force fsck when boot

  1. Edit the /etc/default/grub file on Debian/Ubuntu

  2. Find line that read as GRUB_CMDLINE_LINUX_DEFAULT and append the fsck.mode=force. You may have other config options. Just add it between the quote marks. For example:

GRUB_CMDLINE_LINUX_DEFAULT="quiet fsck.mode=force"
  1. To force all auto repair option including that may cause damage add the fsck.repair=yes option too.

  2. Then run an sudo update-grub

  3. Reboot the Linux system by tying the sudo reboot

  4. After that system will boot. The system will run fsck on ext4 file systems.

fix for dota2 not launching problem

~/.steam/debian-installation/ubuntu12_64/steam-runtime-heavy/run.sh '/home/yanghui/.steam/debian-installation/steamapps/common/dota 2 beta/game/dota.sh' 

Nautilus Performance Finetuning

set 'Thumbnails' and 'File Count' to Never in preference.

About

my dotfiles for my linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages