0%

ubuntu

Ubuntu is an open source software platform that runs everywhere from the smartphone, the tablet and the PC to the server and the cloud.

ubuntu 设置

初用配置

Flatabulous主题

简介

This is a Flat theme for Ubuntu and other debian based Linux Systems. This is based on the Ultra-Flat theme. Special thanks to @steftrikia and Satyajit Sahoo for the original work.

安装

  1. 先安装主题调整工具
    1
    sudo apt-get install unity-tweak-tool
  2. 在安装主题
    1
    2
    3
    sudo add-apt-repository ppa:noobslab/themes
    sudo apt-get update
    sudo apt-get install flatabulous-theme
  3. 安装图标
    1
    2
    3
    sudo add-apt-repository ppa:noobslab/icons
    sudo apt-get update
    sudo apt-get install ultra-flat-icons //默认图标
  4. 后续
    以上步骤操作完成之后使用第一步安装的工具来选择使用主题与图标
    更多的错误调整以及图标选择查看该主题的github

任务栏位置

任务栏放置底部

1
gsettings set com.canonical.Unity.Launcher launcher-position Bottom

任务栏放置左边

1
gsettings set com.canonical.Unity.Launcher launcher-position Left

网络

ubuntu 重新获取IP

1
2
sudo dhclient -r //释放IP
sudo dhclient //重新获取IP

收自我的搜狐

shadowsoks 配置

Ubuntu 安装 shadowsocks

1
2
3
# 方式一
apt install python-pip
pip install shadowsocks
1
2
# 方式二
apt install shadowsocks

启动ss客户端

1
2
# 方式一
sslocal -s server_ip -p server_port -l 1080 -k password -t 600 -m aes-256-cfb
1
2
# 方式二  //需预先在 etc/shadowsocks/config.json 中写入ip 密码 端口 加密方式
sslocal -c /etc/shadowsocks/config.json

ss的config文件配置

1
2
3
4
5
6
7
8
9
10
11
12
# 例子
{
"server":"192.xxx.xxx.xx",
"server_port":4xxx,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"xxxxxxxxx",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false,
"workers": 1
}

编码

Rhythmbox 播放中文乱码解决

进入音乐文件夹下执行
`` mid3iconv -e GBK *.mp3 ``
若是有相应的依赖没有安装可以按照提示安装,
```
# 一般会提示安装的依赖
sudo apt-get install python-mutagen
```
收自111cn

swap

swap的开关

1
2
3
# swap的人工干预
$ sudo swapoff -a
$ sudo swapon -a

重置

重置系统键盘快捷键

在终端执行以下命令

1
2
3
4
gsettings reset-recursively org.gnome.settings-daemon.plugins.media-keys
gsettings reset-recursively org.compiz.integrated
gsettings reset-recursively org.gnome.desktop.wm.keybindings
gsettings reset-recursively org.gnome.shell.keybindings   // 此条有可能提示没有找到相应的方案,不过无所谓

然后重启即可

节能省电

intel CPU在linux下的节能模式

(暂无)

减小硬盘发热量

输入sudo hdparm -B /dev/sda,可以获得APM_level的数值。
一般来说,系统默认为254,表示硬盘性能最大化。此时发热量也很大。APM_level的全称为Advanced power Mangement leve(高级电源管理级别)。

1
2
3
4
5
6
7
APM的取值为1~255,值越大硬盘性能越高。
255代表,关闭硬盘的电源管理。
254代表,开启硬盘电源管理下的最高性能。
128~254,禁止spin-down
1~227,允许spin-down
spin-down 指闲置时挂起硬盘
spin-up 指启动硬盘

设置APM的值sudo hdparm -B 128 /dev/sda,为了在开机的时候也生效,可以在/etc/rc.local中加入设置指令;若是还不生效还可以在/etc/hdparm.conf中加入

1
2
3
4
5
6
/dev/sda{
apm=192
apm_battery=192
}

# apm表示在交流电供电模式下,apm_battery表示在电池供电模式下

另外。需要注意,当采用APM后,需要查看Load_Cycle_Count的值。

1
sudo smartctl -a /dev/sda | grep Load_Cycle_Count 

若是显示的值的大小,每分钟都有增加,就应该还原数值为254,并立刻重启。因为,磁头频繁的Load/Unload同样会影响硬盘寿命,一般硬盘设计能承受的加载循环计数Load_Cycle_Count最多为600000次.

本方案参考自my.oschina.net,经试验在Ubuntu

Ubuntu 常用指令

通过终端执行复制、删除

1
2
3
4
# 复制
cp -rf 目标文件夹名称 需要复制到的路径
# 删除
rm 目标文件名称

特定软件的安装、卸载及其它问题

chrome 的完全卸载

卸载chrome 主程序

1
2
sudo apt-get remove google-chrome-stable
sudo apt-get autoremove google-chrome-stable

卸载 chrome的配置信息

1
2
3
# 依次到下列文件夹中 删除相关配置信息
cd ~/.config
cd ~/.cache

清理残留快捷方式

1
2
3
# 依次到下列文件夹中清理相应的残留信息
cd ~/.config/menus/applications-merged
cd ~/.local/share/applications