Common
常用使用软件,默认安装的软件在/opt/
目录下
中文输入法
如LanguageSupport内的Keyboard input method system中没有fcitx,在Terminal中执行
sudo apt install fcitx
Google Pinyin
推荐使用Google拼音,操作如下
- SystemSetting-->LanguageSupport-->install/RemoveLanguages-->Chinese(simplified)勾选之后需要重启系统
- 安装
sudo apt-get install fcitx-googlepinyin
- SystemSetting-->TextEntry添加GooglePinyin(Fcitx)
Sogou
官网下载后,双击下载的deb文件,系统设置-->文本输入-->添加Sogou Pinyin
Chrom浏览器
下载google-chrome-stable_current_amd64.deb
后在软件中心中安装,点击install后无反应,无法安装。
失败原因:依赖软件包未安装
解决方法:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get -f install
sudo dpkg -i google-chrome-stable_current_amd64.deb
升级LibreOffice
# 添加源
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
# 升级
sudo apt-get dist-upgrade
图片压缩
# 类似无损
sudo apt-get install imagemagick
for img in`find ./ -name "*.JPG"`; do convert -quality 70 $img ${img/JPG/jpg}; done
# 有损
sudo apt-get install jpegoptim
jpegoptim --size=100k IMG_20170716_155154.jpg
将ubuntu的中文文件夹修改为英文
- 修改环境成英文
export LANG=en_US
- 更新文件夹
xdg-user-dirs-gtk-update
- 修改回来。
export LANG=zh_CN
设置快捷方式
在/usr/share/applications
目录下创建xxx.desktop
文件
[Desktop Entry]
Name = Studio
comment= android studio
Exec=/opt/android-studio/bin/studio.sh
Icon=/opt/android-studio/bin/studio.png
Terminal=true
Type=Application
Develop
Vim
vim是世界上最好的文本编辑器之一(不要打脸)
sudo apt-get install vim
Git
安装Git
sudo apt-get install git
生成SSH-KEY
ssh-keygen -t rsa -C "xxx@xx.com"
JDK
版本查看:java -version
版本切换:sudo update-alternatives --config java
配置JAVA_HOME:sudo vim /etc/profile
# 如果使用oracle java
export JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre/bin"
# 如果使用openjdk
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin"
使用命令一键安装(无需配置环境变量),安装命令替换如下
sudo apt-get install oracle-java8-set-default
OpenJDK
# 更新软件包列表
sudo apt-get update
# 安装
sudo apt-get install openjdk-8-jdk
OracleJDK
# 安装依赖包(可不执行)
sudo apt-get install python-software-properties
# 添加仓库源
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
# 安装
sudo apt-get install oracle-java8-installer
AndroidStudio
安装前确保JDK安装配置正确,官网下载,安装相关依赖,解压即可使用
安装报错:unable to run mksdcard sdk tool
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
配置Android环境变量(~/.profile)
ANDROID_HOME=$HOME/Android/Sdk
ANDROID_TOOLS="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools"
ADB工具
- adb不能使用
xxx no permission
adb kill-server
adb start-server
- adb push失败
Read-only file system
重新挂载Android/system
路径
adb shell mount -o remount rw /system
MarkDown文本编辑器
Cmd MarkDown
解压tar -zxvf cmd_markdown_linux64.tar.gz
进入解压目录执行可执行文件
Typora
安装
# optional, but recommended
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
# add Typora's repository
sudo add-apt-repository 'deb https://typora.io ./linux/'
sudo apt-get update
# install typora
sudo apt-get install typora
升级
# upgrade all packages include Typora
sudo apt-get upgrade
统一建模工具UML
安装
StarUML依赖于libgcrypt11
下载需要的文件后执行
sudo dpkg -i libgcrypt11_1.5.3-2ubuntu4.4_amd64.deb
sudo apkg -i StarUML-v2.8.0-64-bit.deb
破解
Linux安装完成后,在/opt/staruml/www/license/node路径下有他一个LicenseManagerDomain.js文件,使用sodu权限打开,替换文件内容后,保存退出
/*
* Copyright (c) 2013-2014 Minkyu Lee. All rights reserved.
*
* NOTICE: All information contained herein is, and remains the
* property of Minkyu Lee. The intellectual and technical concepts
* contained herein are proprietary to Minkyu Lee and may be covered
* by Republic of Korea and Foreign Patents, patents in process,
* and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Minkyu Lee (niklaus.lee@gmail.com).
*
*/
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50, node: true */
/*global */
(function () {
"use strict";
var NodeRSA = require('node-rsa');
function validate(PK, name, product, licenseKey) {
var pk, decrypted;
// edit by yourName
return {
name: "ziv",
product: "StarUML",
licenseType: "vip",
quantity: "ziv-android.github.io",
licenseKey: ""
};
try {
pk = new NodeRSA(PK);
decrypted = pk.decrypt(licenseKey, 'utf8');
} catch (err) {
return false;
}
var terms = decrypted.trim().split("\n");
if (terms[0] === name && terms[1] === product) {
return {
name: name,
product: product,
licenseType: terms[2],
quantity: terms[3],
licenseKey: licenseKey
};
} else {
return false;
}
}
/**
* Initializes the domain with several commands.
* @param {DomainManager} domainManager The DomainManager for the server
*/
function init(domainManager) {
if (!domainManager.hasDomain("LicenseManager")) {
domainManager.registerDomain("LicenseManager", {major: 0, minor: 1});
}
domainManager.registerCommand(
"LicenseManager", // domain name
"validate", // command name
validate, // command handler function
false, // this command is synchronous in Node ("false" means synchronous")
"Validate License",
[
{
name: "PK",
type: "string",
description: "PK"
},
{
name: "name",
type: "string",
description: "name of license owner"
},
{
name: "product",
type: "string",
description: "product name"
},
{
name: "licenseKey",
type: "string",
description: "license key"
}
],
[
{
name: "result", // return values
type: "object",
description: "result"
}
]
);
}
exports.init = init;
}());
在starUML软件中Help–>Enter License输入yourName回车即可完成破解注册
Genymotion
- 安装VirtualBox
sudo apt-get update
sudo apt-get install virtualbox
安装完成后如果在安装Genymotion依旧提示无法找到VirtualBox
apt-get install virtualbox-source module-assistantm-a preparem-a a-i virtualbox-source/etc/init.d/virtualbox start
- 安装Genymotion
下载前需要先注册帐号,官网下载,完成后执行
sudo chmod +x genymotion-2.11.0-linux_x64.bin
./genymotion-2.11.0-linux_x64.bin
解决Genymotion无法安装apk
错误信息:
An error occured while deploying the file. This probably means that the app contains ARM native code and your Genymotion device cannot run ARM instructions. You should either build your native code to x86 or install an ARM translation tool in your device.
解决方法:
- 下载Genymotion-ARM-Translation-Librarities工具转换包
- 将下载好的工具包直接拖拽到Genymotion中,然后提示重启模拟器
轻量级本地服务器搭建
nginx服务器
# 安装
sudo apt-get install nginx
# 查看被监听端口
sudo lsof -i:80
服务器相关配置文件路径:/etc/nginx/sites-enable/default
服务器访问文件所在路径:/var/www/html
修改文件权限组
ls -l
sudo chown username html/ -R
查看文件MD5值
md5sum 'filePath'