Linux系统配置

系统配置,包括软件安装,各种问题解决。

LibreOffice汉化

$ sudo apt-get install libreoffice-l10n-zh-cn

Ubuntu系统卡死

当系统卡死时,键盘和鼠标都没办法操作了以后。可以尝试ctrl +alt+F2(F2~F6)试试,看看能不能进tty界面。能进的话,进入以后htop查看问题。
当上述操作无效时,按住ctrl+all,然后一次按下r,e,i,s,u,b。每个按键按下间隔1s,最后系统重启。SysRq为系统请求,按住SysRq以后,输入的一切都会由Linux内核来处理,可以进行很多低级操作。
r:unRaw 将键盘控制从X Server抢过来。
e:tErminate给所有进程发送SIGTERM信号,让他们自己解决善后。
i:kill 所有进程发送SIGKILL信号,强制关闭所有进程。
s:Sync 将所有数据同步至磁盘。
u:unmount 将所有分区挂载为只读模式
b: reBoot 重启。

zip压缩包解压文件名乱码
$ sudo apt install unzip
$ sudo apt install unar 
$ unzip -O CP936 xx.zip
$ unar xx.zip 
开机脚本设置

river_startup.sh

#!/bin/bash 

/usr/local/bin/mirror.sh & \
echo "123123" | sudo -S sysctl -w net.ipv6.conf.all.disable_ipv6=1 & \
echo "123123" | sudo -S sysctl -w net.ipv6.conf.default.disable_ipv6=1 & \
echo "123123" | sudo -S sysctl -w net.ipv6.conf.lo.disable_ipv6=1 & \
echo "123123" | sudo -S mount -o rw,dir_mode=0777,file_mode=0777 /dev/sda3 /media/river/Study & \
echo "123123" | sudo -S mount -o rw,dir_mode=0777,file_mode=0777 /dev/sda4 /media/river/DOWNLOAD & \
echo "123123" | sudo -S mount -o rw,dir_mode=0777,file_mode=0777 /dev/sda5 /media/river/WorkSpace & \
/usr/local/bin/app_startup.sh

app_startup.sh

/opt/deepinwine/apps/Deepin-TIM/run.sh & \
dingtalk & \
thunderbird & \
goldendict & \
qv2ray & \
/opt/deepinwine/apps/Deepin-WeChat/run.sh

mirror.sh,4K显示器开机布局设置

#!/bin/bash

HDMI=$(xrandr |grep -e "HDMI"| grep -e " connected" |awk '{print$1}')
DP0=$(xrandr |grep -e "DP-0"| grep -e " connected" |awk '{print$1}')

if [ "$HDMI"x == "HDMI-0"x ]; then
	xrandr --output eDP-1-1 --mode 1920x1080 --pos 2560x192 --rotate normal --output HDMI-0 --primary --mode 2560x1440 --pos 0x0 --rotate normal --output DP-3 --off --output DP-2 --off --output DP-1 --off --output DP-0 --off
elif [ "$DP0"x == "DP-0"x ]; then
	xrandr --output eDP-1-1 --mode 1920x1080 --pos 2560x192 --rotate normal --output HDMI-0 --off --output DP-3 --off --output DP-2 --off --output DP-1 --off --output DP-0 --primary --mode 2560x1440 --pos 0x0 --rotate normal
else
	echo "mirror.sh error"
fi

命令别名

PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

alias proxyyay='ALL_PROXY=socks://localhost:7890 yay'
alias findc="find . -name \"*.c\" | xargs grep -Rns --color"
alias findh="find . -name \"*.h\" | xargs grep -Rns --color"
alias finda="find . -name \"*\" | xargs grep -Rns --color"
alias findf="find . -name"

function finds() {
    if [ $# -lt 1 ]; then
        echo "Find condition is null."
        return 1
    fi
    condition=$1
    file="*"
    path="."

    if [ $# -eq 1 ]; then
        condition=$1
    elif [ $# -eq 2 ]; then
        file=$1
        condition=$2
    elif [ $# -eq 3 ]; then
        path=$1
        file=$2
        condition=$3
    fi

    find $path -name "$file" | xargs grep -ns --color "$condition"
}

root 下添加到 ~/.bashrc

PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] '

应用程序启动脚本

经常性重启,所以不把所有的常用应用都添加到开机自启动。开机后,根据需要启动应用。

#!/bin/bash

# 启动qq
/opt/apps/com.qq.im.deepin/files/run.sh -u %u

# start wechat
/opt/apps/com.qq.weixin.deepin/files/run.sh -u %u

# start dingtalk
/opt/apps/deepin.com.dingtalk.com/files/run.sh -u %u

# start mail app
/usr/lib/thunderbird/thunderbird

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值