代码改变世界

linux、windows系统个性化设置

2018-04-10 22:10  受匕图灵  阅读(1290)  评论(0)    收藏  举报

Gnome(CentOS 7)个性化设置

D、wifi 密码设置与连接

 

linux相关设置脚本

输入法设置:

桌面右上角点击设置-Region & Language - 输入源:汉语(智能拼音)

设置快捷键

设置长度

 

su

 

#gnome环境中将家目录下预设的文件夹由中文名称改为英文名称

#参考:https://blog.csdn.net/marginal/article/details/32314259

cd /home/$USER/

#删除多余目录

rmdir ./*

mkdir Downloads Desktops

#修改语言环境

env |grep LANG

export LANG=en_US

#更新文件夹名称

xdg-user-dirs-gtk-update

rmdir Documents/ Music/ Pictures/ Public/ Templates/ Videos/

#还原语言环境为中文

export LANG=zh_CN.UTF-8e

 

#添加epel源。

#EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一个项目,

#为“红帽系”的操作系统提供额外的软件包,适用于RHEL、CentOS和Scientific Linux.

yum install -y epel-release

 

#安装telnet、gcc命令

yum -y install telnet gcc make git

 

#安装ntfs

#wget -O /etc/yum.repos.d/Centos-8.repo http://mirrors.aliyun.com/repo/Centos-8.repo

#yum install -y ntfsprogs

wget https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgz

tar -xzvf ntfs-3g_ntfsprogs-2017.3.23.tgz

cd ntfs-3g_ntfsprogs-2017.3.23/

./configure

make

make install

rm -rf ntfs-3g_ntfsprogs-2017.3.23*
ln -s /usr/bin/ntfs-3g /usr/bin/ntfs

 

#windows linux 共享盘挂载

mkdir /linuxAndWindows
echo "/dev/sda6 /linuxAndWindows ntfs-3g defaults,uid=1000,gid=1000 0 0">>/etc/fstab
echo "">>/etc/fstab
echo "#----new:----#">>/etc/fstab

mount -a

 

#exfat格式安装

#rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

yum install fuse-exfat exfat-utils

 

#pycharm安装

#官网:https://www.jetbrains.com/pycharm/download/#section=linux

#https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=linux&code=PCC

cd /linuxAndWindows/bigFiles

tar -zvxf pycharm-community-2020.3.3.tar.gz -C /usr/local/

 

#wps下载、安装。

#官网:https://www.wps.cn/product/wpslinuxlog

#https://linux.wps.cn/

yum install -y libGLU

rpm -ivh wps-office-11.1.0.9080-1.x86_64.rpm

 

#安装chrome浏览器

#配置yum源

cat > /etc/yum.repos.d/google-chrome.repo << "eof"

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

eof

#安装chrome

yum install -y google-chrome-stable --nogpgcheck

#找到chrome路径,并做个软连接,方便使用:

ln -s $(which google-chrome-stable) /bin/chrome

#打开chrome,点击右上角设置,搜索引擎改为baidu.com

#主机名设置

#hostnamectl set-hostname study.centos.vbird

 

#设置开机菜单默认等待时间为3秒

#grep GRUB_TIMEOUT /etc/default/grub

sed -i 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=3/g' /etc/default/grub

#find / -name "grub.cfg" 2> /dev/null

#结果:/boot/efi/EFI/centos/grub.cfg

cp /boot/efi/EFI/centos/grub.cfg /boot/efi/EFI/centos/grub.cfg_backup

grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

 

#history命令显示时间记录,设置别名

cat >> /etc/bashrc << "EOF"

HISTFILESIZE=2000
HISTSIZE=2000
HISTTIMEFORMAT="%Y-%m-%d %T "

alias cd_Downloads='cd /home/weis/Downloads/'
alias cd_rhca_442='cd /linuxAndWindows/bigFiles/rhca_videos'
alias cd_k8s='cd /linuxAndWindows/server/Kubernetes/'
source <(kubectl completion bash)
source <(helm completion bash)
export HELM_HOME=/data/helm

EOF

export HISTTIMEFORMAT

 

ssh-keygen

 

 

D、分区命名

gdisk -l /dev/sda

1 windows10 recover

2 EFI System Partition

3 windows10 MSR(Microsoft reserved par

4 windows10 D

5 windows10 C

parted /dev/sda name 6 "/linuxAndWindows"

parted /dev/sda name 7 "centos7_/boot"

parted /dev/sda name 8 "centos7_LVM"

parted /dev/sda name 9 "centos8_EFI_System_Partition"

parted /dev/sda name 10 "centos8_/boot"

parted /dev/sda name 11 "centos8_LVM"

parted /dev/sda print

  Model: ATA TOSHIBA MQ01ABD1 (scsi)
  Disk /dev/sda: 1000GB
  Sector size (logical/physical): 512B/4096B
  Partition Table: gpt
  Disk Flags:

Number Start End Size File system Name 标志
1 1049kB 524MB 523MB ntfs windows10 recover 隐藏分区, diag
2 524MB 629MB 105MB fat32 EFI System Partition windowsAndCent 启动, esp
3 629MB 646MB 16.8MB windows10 MSR(Microsoft reserved pa msftres
4 646MB 83.8GB 83.1GB ntfs windows10 D msftdata
9 83.8GB 83.9GB 105MB fat16 centos8_EFI_System_Partition 启动, esp
10 83.9GB 84.9GB 1074MB ext4 centos8_/boot
5 85.9GB 193GB 107GB ntfs windows10 C msftdata
6 193GB 301GB 107GB ntfs /linuxAndWindows msftdata
7 301GB 302GB 1074MB xfs centos7_/boot msftdata
8 302GB 525GB 223GB centos7_LVM lvm
11 525GB 557GB 32.2GB centos8_LVM lvm

thor台式主机:

parted /dev/nvme0n1 print
parted /dev/nvme0n1 name 7 "centos8_LVM"
parted /dev/nvme0n1 name 6 "centos8_/boot"
parted /dev/nvme0n1 name 5 "centos8_EFI_System_Partition"
parted /dev/nvme0n1 name 4 "Windows10 C"
parted /dev/nvme0n1 name 4 "Windows10_C"

]# parted /dev/nvme0n1 print
Model: NVMe Device (nvme)
Disk /dev/nvme0n1: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  1075MB  1074MB  ntfs         Basic data partition          hidden, diag
 2      1075MB  1347MB  273MB   fat32        EFI system partition          boot, esp
 3      1347MB  1364MB  16.8MB               Microsoft reserved partition  msftres
 4      1364MB  127GB   126GB   ntfs         Windows10_C                   msftdata
 5      127GB   127GB   52.4MB  fat16        centos8_EFI_System_Partition  boot, esp
 6      127GB   127GB   210MB   xfs          centos8_/boot
 7      127GB   173GB   45.1GB               centos8_LVM                   lvm

 

#安装wine依赖:
wget http://www.rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm
rpm -ivh SDL2-2.0.10-1.el7.x86_64.rpm

#安装 wine :
#yum install -y epel-release
yum install -y wine

 

#selinux关闭

setenforce Permissive

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

 

#防火墙

systemctl disable firewalld.service 

systemctl stop firewalld.service 

 

D、终端-自定义

终端-右键-配置文件首选项:

*.常规-取消勾选:默认在新终端中显示菜单栏

*.常规-主题类型:暗色
*.快捷键-新建标签页ctrl+t
*.快捷键-复制ctrl+c
*.快捷键-粘贴ctrl+v

*.配置文件-文本-勾选自定义字体:10

*.配置文件-滚动-都勾选、加个0

 

Dvim的自定义设置添加

#将vimrc文件拷贝为/home/用户/.vimrc

cp /multisystemshare/weishuang/2linux/09_vim/code/vimrc_backups3_set_mouse  /home/$USER/.vimrc

 

D、文件编辑器设置

gedit 打开文件编辑器

删除书签:公共  模板  视频  图片  文档  音乐

添加书签:XXX

 

D、添加当前用户sudo执行root命令权限

]# visudo 

## Allow root to run any commands anywhere

root ALL=(ALL) ALL  #复制此行,且修改root为weis,如:

weis    ALL=(ALL)       ALL

 

D、notepad++个性初始化

 

#安装notepad++

#参考https://blog.csdn.net/longzhutengyue/article/details/84642230 如何在centos7环境下安装notepad++
#下载notepadd++.exe安装包。官网  https://notepad-plus-plus.org/downloads/

mkdir /usr/local/notepad

cd /multisystemshare/1bigfile/

wget https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.4.2/npp.8.4.2.portable.zip

unzip /multisystemshare/1bigfile/npp.8.4.2.portable.zip -d /usr/local/notepad/

#rm -f npp.7.9.2.portable.zip

 

#运行:
wine /usr/local/notepad/notepad++.exe
#第一次需要联网安装插件,插件安装异常,都取消即可

#页面由英文变中文:
Setting-Preferences-General+Localization

#https://bbs.csdn.net/topics/398840629  notepad++ 无法设置中文

vim /usr/local/notepad/localization/chineseSimplified.xml

852行,/Scintillas改为/MarginsBorderEdge

#设置-首选项-
新建-格式:unix,默认语言:shell
语言-勾选“替换为空格”

#设置主题颜色
设置-语言格式设置-Solarized

#取消红色下划线提示
Alt+a

 

#DSublime Text 文本编辑器安装

#https://kate-editor.org/

# http://www.sublimetext.com/docs/3/linux_repositories.html#yum

#Install the GPG key:

#sudo rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg

#Select the channel to use:

#Stable

#sudo yum-config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo

#Dev

#sudo yum-config-manager --add-repo https://download.sublimetext.com/rpm/dev/x86_64/sublime-text.repo

#Update yum and install Sublime Text

#sudo yum install sublime-text

 

D、左上角活动-优化

#安装优化:yum install -y gnome-tweaks

活动-软件

搜索“优化”-安装-启动

字体:“窗口标题”由11改为10,“界面”由11改为10,“文档”由11改为10,“等宽”由11改为9

扩展--打开:

使用:

  • Alternatetab(alt-tab 切换窗口时,不再按应用程序分组,全部展现出来)
  • Applications menu(左上角由“活动”变为“应用程序”,且按应用类别进行分组)
  • Dash to Panel (菜单栏显示,导入优化设置.thor.conf文件)
  • Desktop icons(桌面图标控件)
  • ESC to close overview from applications list(当您在应用程序列表中时,请关闭概述,当搜索框为空时,请按ESC键。默认的gnome shell行为是第一次按ESC键清除搜索框,第二次按ESC键返回活动概述,第三次按ESC键关闭概述。此扩展从应用程序概述中取消了活动概述)
  • No topleft hot corner(禁用左上角的热角)(活动-软件-搜索“No topleft hot corner”-安装-启动)
  • Removable Drive Menu
  • Show Application Instead of Workspaces(概述将在调用时显示应用程序而不是工作区。)
  • system-monitor(在GNOMEShell状态栏中显示系统信息,例如内存使用率、cpu使用率、网络速率…)
  • Workspace Indicator

 

不使用:
AlternatetabAbove(alt-tab 切换窗口时,显示应用程序的名称)
Dash to dock
Dynamic top bar
Horizontal workspaces(工作区由上下改为左右)
Launch new instance 在短划线或应用程序视图中单击时始终启动新实例。
Places status indicator(菜单栏中添加目录菜单)
Dash to panel(菜单栏换到底部)
Window list
Top panel workspace scroll
gnome-shell-extensions
User themes
Window list

 


D、左上角活动收藏夹优化

从收藏夹移除:XXX

加入收藏夹:XXX

 

D、系统设置

region & Language(区域与语言-汉语)-汉语(Intelligent Pinyin)

右上角-首选项-每页显示候选词数:10

Power-节电-空白屏幕:从不

Power-节电-蓝牙-关

设备-keyboard-隐藏所有正常窗口:Super+D

 

D4、自定义linux快捷键

终端中的命令

终端中命令

打开的窗口

备注

Ctrl+Shift+T

 另一个终端

 

 gedit

 文件编辑器

 输入ged后才能Tab出全部

 firefox

 火狐浏览器

 输入firef后才能Tab出全部

google-chrome

谷歌浏览器

 

 nautilus 目录

 指定目录下的文件夹窗口

 

 evince

 pdf文件

 

 eog

 jpg文件

 eog全称:eye of gmone,是linux下内置的图片查看器。

 

 

 

 

 

 

 

 

 

个人自定义的快捷键:

  1. 点击右上角进入设置
  2. 选择"设备"
  3. 选择“Keyboard”
  4. 下拉到最下
  5. 点击“+”号
  6. 输入自定义的名称
  7. 输入命令,为要打开的软件,如终端:/usr/bin/gnome-terminal
  8. 点击“编辑”,按下自定义的快捷键组合
  9. 点击窗口右上角“添加”按钮
  10. 完毕

名称

命令

快捷键

打开文件夹

nautilus /linuxAndWindows/

Super+E

打开终端

/usr/bin/gnome-terminal

Ctrl+1

打开谷歌浏览器

google-chrome

Ctrl+2

打开文本编辑器

gedit

wine /usr/local/notepad/notepad++.exe

subl

Ctrl+3

wps

wps

Ctrl+4

 

 

Ctrl+5

 打开pycharm.sh
/usr/local/pycharm-community-2022.1.3/bin/pycharm.sh

Ctrl+6

 
 

Ctrl+7

 

 

Ctrl+8

打开服务器篇   evince /multisystemshare/weishuang/2linux/服务器架设篇-第3版-鸟哥的Linux私房菜.pdf Ctrl+9
 打开基础篇  evince /multisystemshare/weishuang/2linux/基础学习篇-第4版-鸟哥的Linux私房菜-中文.pdf Ctrl+0

Dchrome浏览器设置

书签,导入

设置-搜索引擎-百度

 

D、WPS设置

文件-选项-编辑-自动更正:(取消勾选)键入时自动进行首字母大写更正

 

windows10 个性化设置

T2pdf阅读器下载

evince:下载地址:https://evince.en.softonic.com/ 不能编辑linux上的注释

福昕阅读器:显示注释,但书签不能一直显示

T3Microsoft Store中下载

NotePad++

UnRar Windows

BreeZip

T4、浏览器下载安装

微信客户端

Chrome

WPS Office

酷狗音乐

 

T5、其他

VMware Workstation Pro
SecureCRT 8.0

XMind

Postman

迅读PDF大师

 

T1、关机而不是深度休眠

https://zhidao.baidu.com/question/2118100971415421427.html

开始-设置-系统-电源和睡眠-其他电源设置-选择电源按钮的功能-更改当前不可用的设置

取消勾选快速启动前的复选框-保存

设置不显示视频、图片、文本等的历史记录,自动清除历史记录

在桌面-右键-个性化,弹窗中左边栏【开始】,关闭最后一项“在开始”菜单或任务栏的跳转列表中以及文件资源管理器的“快速使用”中显示最近打开的项

 

win10无法被别的主机ping通  https://www.cnblogs.com/ahaolee/p/12116451.html 

 

T6、windows linux 共享盘设置

 切割一个磁盘且格式化为NTFS格式

 

 双系统个性化设置

S、Windows10、centos7双系统修改默认启动引导选项

1、查看/boot/efi/EFI/centos/grub.cfg文件。
(此文件由grub2-mkconfig 自动生成的,文件来自/etc/grub.d和来自/etc/default/grub的设置。)
此时我们只需要记住在写入启动菜单中的为windows启动菜单的名字,
也就是在menuentry 'Windows Boot Manager (on /dev/sda2)'所在行

 

2、修改:/boot/efi/EFI/centos/grubenv
原:
# GRUB Environment Block
saved_entry=CentOS Linux (3.10.0-957.10.1.el7.x86_64) 7 (Core)
#####################################################################################################
修改为:
# GRUB Environment Block
saved_entry=Windows Boot Manager (on /dev/sda2)
#####################################################################################################

 

3、重启电脑
开机选择选项就默认停留在windows启动选项了

参考:https://blog.csdn.net/n_s_X14/article/details/88970048