我的linux常用shell脚本

CentOS安装Ranger

yum install python3 python3-devel -y
pip3 install ranger-fm -i https://mirrors.aliyun.com/pypi/simple/

https://blog.csdn.net/lxyoucan/article/details/115699624

Ranger退出保存路径

环境变量中增加别名

alias nav='ranger --choosedir=$HOME/.rangerdir; LASTDIR=`cat $HOME/.rangerdir`; cd "$LASTDIR"'

https://blog.csdn.net/lxyoucan/article/details/115671189

CentOS网络同步时间

#设置时区为上海
timedatectl set-timezone Asia/Shanghai
yum install ntp -y
#网络同步时间
ntpdate pool.ntp.org

https://blog.csdn.net/lxyoucan/article/details/116021148

CentOS 安装nodejs14

curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
sudo yum install nodejs -y

https://blog.csdn.net/lxyoucan/article/details/115178081

CentOS配置vnc+openbox

#图形界面必备`X Window System`
yum -y groupinstall "X Window System"
#安装epel源
yum -y install epel-release
#安装VNC+图形需要的软件
yum -y install tigervnc-server openbox xfce4-terminal tint2 cjkuni-ukai-fonts network-manager-applet
#自动修改/etc/xdg/openbox/autostart配置文件
echo 'if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then' > /etc/xdg/openbox/autostart
echo '       eval `dbus-launch --sh-syntax --exit-with-session`' >> /etc/xdg/openbox/autostart
echo 'fi' >> /etc/xdg/openbox/autostart
echo 'tint2 &' >> /etc/xdg/openbox/autostart
echo 'nm-applet  &' >> /etc/xdg/openbox/autostart
echo 'xfce4-terminal &' >> /etc/xdg/openbox/autostart
echo ' ' >> /etc/xdg/openbox/autostart
#防火墙放行VNC端口
firewall-cmd --add-port=5901/tcp
firewall-cmd --add-port=5901/tcp --permanent

https://blog.csdn.net/lxyoucan/article/details/113547596

重启vncserver :1

# 停止服务
vncserver -kill :1
#重新开启vnc服务
vncserver :1 -geometry 1024x768

CentOS一键安装oh my zsh

todo 从码云下载。

CentOS 查系统版本

cat /etc/redhat-release

CenOS7安装htop

#安装epel源
yum -y install epel-release
yum -y install htop

CenOS7安装ncdu

#安装epel源
yum -y install epel-release
yum -y install ncdu

视频格式转换

#step1 : 转换成 mp4 格式
ffmpeg -i source.mov -vcodec copy -acodec copy temp.mp4
#step2 : 降低帧率至20帧
ffmpeg -i temp.mp4 -r 20 des.mp4

创建expo项目

#首次创建安装expo
npm install --global expo-cli
#创建一个名为my-project的项目
expo init my-project

创建用户

useradd apex

CentOS7 安装ag

ag是一个搜索文件的工具,我在使用nvim中需要用到。

yum install epel-release
yum install the_silver_searcher

node 使用淘宝源

# 使用nrm工具切换淘宝源
npx nrm use taobao

# 如果之后需要切换回官方源可使用
npx nrm use npm

终端代理

export http_proxy=http://127.0.0.1:1087;export https_proxy=http://127.0.0.1:1087;

或者直接全部代理

export ALL_PROXY=socks5://127.0.0.1:1080

命令行搜索文件

find / -name spring-zs-1.0.jar

重启vncserver

systemctl restart vncserver@:1

国内源安装oh my zsh

sh -c "$(curl -fsSL https://gitee.com/lxyoucan/tools/raw/master/common/ohmyzshinstall.sh)"

安装 Yarn

Yarn是 Facebook 提供的替代 npm 的工具,可以加速 node 模块的下载。

npm install -g yarn

CentOS7开放防火墙端口

# 防火墙放行19000端口
firewall-cmd --add-port=19000/tcp
firewall-cmd --add-port=19000/tcp --permanent

创建react 项目

yarn create react-app typescript-react-example --template typescript

查端口的进程

lsof -i:8520
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值