ubuntu 笔记

0.0 查看显存占用的进程

fuser -v /dev/nvidia*

0.设置网络优先级

查看网关
ip route show
default via 192.168.2.1 dev enx00e04c689947  proto static  metric 100 
default via 10.159.0.1 dev wlp2s0  proto static  metric 600 
10.159.0.0/23 dev wlp2s0  proto kernel  scope link  src 10.159.0.177  metric 600 
10.201.109.45 via 10.159.0.1 dev wlp2s0  proto dhcp  metric 600 
169.254.0.0/16 dev wlp2s0  scope link  metric 1000 
192.168.2.0/24 dev enx00e04c689947  proto kernel  scope link  src 192.168.2.22  metric 100 
查看ip
ifconfig

enx00e04c689947 Link encap:以太网  硬件地址 00:e0:4c:68:99:47  
          inet 地址:192.168.2.22  广播:192.168.2.255  掩码:255.255.255.0
          inet6 地址: fe80::bc99:4cd0:c5af:138c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  跃点数:1
          接收数据包:15 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:57 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:1000 
          接收字节:1725 (1.7 KB)  发送字节:7967 (7.9 KB)
 
lo        Link encap:本地环回  
          inet 地址:127.0.0.1  掩码:255.0.0.0
          inet6 地址: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  跃点数:1
          接收数据包:170360 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:170360 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:1000 
          接收字节:21814219 (21.8 MB)  发送字节:21814219 (21.8 MB)
 
wlp2s0    Link encap:以太网  硬件地址 a0:c5:89:c7:86:6b  
          inet 地址:10.159.0.177  广播:10.159.1.255  掩码:255.255.254.0
          inet6 地址: 2400:a980:fe:49f:9fbe:949c:9cc5:e43e/64 Scope:Global
          inet6 地址: fe80::c952:cb8b:ed44:a75e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  跃点数:1
          接收数据包:2803233 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:1749640 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:1000 
          接收字节:2230862258 (2.2 GB)  发送字节:594909272 (594.9 MB)

删除默认的有线网关(不是ip)

sudo route del default gw 192.168.2.1

添加Wifi ip为默认地址(ip,不是网关地址)

sudo route add default gw 10.159.0.177

1.ubuntu中在Launcher上添加Android Studio的运行图标

运行命令创建desktop文件:

sudo gedit /usr/share/applications/android_studio.desktop

打开窗口后输入以下内容,注意Exec和Icon要修改成自己系统下Android Studio的路径。

[Desktop Entry]
Type=Application
Name=Android Studio
Exec="/opt/android-studio/bin/studio.sh" %f
Icon=/opt/android-studio/bin/studio.png
Categories=development;IDE;
Terminal=false
StartupNotify=true
StartupWMClass=jetbrains-android-studio

保存关闭文件,运行以下命令添加执行权限:

sudo chmod +x /usr/share/applications/android_studio.desktop

使用命令打开applications文件夹:

sudo nautilus /usr/share/applications

找到android_studio.desktop文件,把文件拖动到Launcher条上

2.终端多窗口分屏Terminator

安装

sudo apt-get install terminator

快捷键

Ctrl+Shift+E    垂直分割窗口
Ctrl+Shift+O    水平分割窗口
    F11         全屏
Ctrl+Shift+C    复制
Ctrl+Shift+V    粘贴
Ctrl+Shift+N    或者 Ctrl+Tab 在分割的各窗口之间切换
Ctrl+Shift+X    将分割的某一个窗口放大至全屏使用
Ctrl+Shift+Z    从放大至全屏的某一窗口回到多窗格界面

优化配置

sudo vim ~/.config/terminator/config
[global_config]
  geometry_hinting = False
  handle_size = 1
  inactive_color_offset = 1.0
  title_font = mry_KacstQurn Bold 11
  title_hide_sizetext = True
[keybindings]
[layouts]
  [[default]]
    [[[child1]]]
      parent = window0
      profile = default
      type = Terminal
    [[[window0]]]
      parent = ""
      type = Window
[plugins]
[profiles]
  [[default]]
    background_darkness = 0.76
    background_image = None
    background_type = transparent
    cursor_color = "#3036ec"
    custom_command = tmux
    font = Ubuntu Mono 13
    foreground_color = "#ffffff"
    login_shell = True
    show_titlebar = False
    use_system_font = False

3. 更改git commit提交的用户名和邮箱

#!/bin/sh

git filter-branch --env-filter '

OLD_EMAIL="xxx@xx.com"
CORRECT_NAME="koibiki"
CORRECT_EMAIL="orient2008.cl@hotmail.com"

if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
    export GIT_COMMITTER_NAME="$CORRECT_NAME"
    export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
    export GIT_AUTHOR_NAME="$CORRECT_NAME"
    export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags

4. 多线程下载工具

sudo apt-get install axel
axel -n 100 http://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-15.0.2-10952284.x86_64.bundle

5.判断磁盘io瓶颈

iostat -d -x -k 1 10
avg-cpu:  %user   %nice %system %iowait  %steal   %idle 
           0.04    0.00    0.04    4.99    0.00   94.92 

Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util 
sda               0.00    81.00 104.00  4.00 13760.00   680.00   133.70     2.08   19.29   9.25  99.90 
sda1              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00 
sda2              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00 
sda3              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00 
sda4              0.00     0.00  0.00  0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00 
sda5              0.00    81.00 104.00  4.00 13760.00   680.00   133.70     2.08   19.29   9.25  99.90 

utils : Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100%.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值