老天 发布的文章

需要手动命令行同步下载或上传简体中文语言至odoo官方transefix的步骤如下:

1.安装pip:

sudo apt-get install python-pip

2.安装transifex-client:

sudo pip transifex-client

sudo easy_install install transifex-client

3.初始化tx环境:

tx init

会生成文件夹.tx以及在该文件夹下生成config配置文件用于稍后的动作.

4.以odoo8.0的简体中文语言为例:
复制https://github.com/odoo/odoo/blob/8.0/.tx/config到刚才的tx init生成的config配置文件中保存.

5.输入命令:

tx pull -r "odoo-8.*" -l zh_CN

将zh_CN简体中文语言pull下载回来本地.

6.更多详见odoo官方文档:
https://github.com/odoo/odoo/wiki/Translations

转载:Git常用命令http://www.lenggirl.com/code/git-use.html

Aug 16, 2016 • hunterhug • git

点击...伟大的程序员
一、新建代码库
二、配置
三、增加/删除文件
四、代码提交
五、分支
六、标签
七、查看信息
八、远程同步
九、撤销
十、其他
作者: 阮一峰

日期: 2015年12月 9日

我每天使用 Git ,但是很多命令记不住。

一般来说,日常使用只要记住下图6个命令,就可以了。但是熟练使用,恐怕要记住60~100个命令。

下面是我整理的常用 Git 命令清单。几个专用名词的译名如下。

Workspace:工作区
Index / Stage:暂存区
Repository:仓库区(或本地仓库)
Remote:远程仓库

一、新建代码库

# 在当前目录新建一个Git代码库
$ git init

# 新建一个目录,将其初始化为Git代码库
$ git init [project-name]

# 下载一个项目和它的整个代码历史
$ git clone [url]

二、配置

Git的设置文件为.gitconfig,它可以在用户主目录下(全局配置),也可以在项目目录下(项目配置)。

# 显示当前的Git配置
$ git config --list

# 编辑Git配置文件
$ git config -e [--global]

# 设置提交代码时的用户信息
$ git config [--global] user.name "[name]"
$ git config [--global] user.email "[email address]"

三、增加/删除文件

# 添加指定文件到暂存区
$ git add [file1] [file2] ...

# 添加指定目录到暂存区,包括子目录
$ git add [dir]

# 添加当前目录的所有文件到暂存区
$ git add .

# 添加每个变化前,都会要求确认
# 对于同一个文件的多处变化,可以实现分次提交
$ git add -p

# 删除工作区文件,并且将这次删除放入暂存区
$ git rm [file1] [file2] ...

# 停止追踪指定文件,但该文件会保留在工作区
$ git rm --cached [file]

# 改名文件,并且将这个改名放入暂存区
$ git mv [file-original] [file-renamed]

四、代码提交

# 提交暂存区到仓库区
$ git commit -m [message]

# 提交暂存区的指定文件到仓库区
$ git commit [file1] [file2] ... -m [message]

# 提交工作区自上次commit之后的变化,直接到仓库区
$ git commit -a

# 提交时显示所有diff信息
$ git commit -v

# 使用一次新的commit,替代上一次提交
# 如果代码没有任何新变化,则用来改写上一次commit的提交信息
$ git commit --amend -m [message]

# 重做上一次commit,并包括指定文件的新变化
$ git commit --amend [file1] [file2] ...

五、分支

# 列出所有本地分支
$ git branch

# 列出所有远程分支
$ git branch -r

# 列出所有本地分支和远程分支
$ git branch -a

# 新建一个分支,但依然停留在当前分支
$ git branch [branch-name]

# 新建一个分支,并切换到该分支
$ git checkout -b [branch]

# 新建一个分支,指向指定commit
$ git branch [branch] [commit]

# 新建一个分支,与指定的远程分支建立追踪关系
$ git branch --track [branch] [remote-branch]

# 切换到指定分支,并更新工作区
$ git checkout [branch-name]

# 切换到上一个分支
$ git checkout -

# 建立追踪关系,在现有分支与指定的远程分支之间
$ git branch --set-upstream [branch] [remote-branch]

# 合并指定分支到当前分支
$ git merge [branch]

# 选择一个commit,合并进当前分支
$ git cherry-pick [commit]

# 删除分支
$ git branch -d [branch-name]

# 删除远程分支
$ git push origin --delete [branch-name]
$ git branch -dr [remote/branch]

六、标签

# 列出所有tag
$ git tag

# 新建一个tag在当前commit
$ git tag [tag]

# 新建一个tag在指定commit
$ git tag [tag] [commit]

# 删除本地tag
$ git tag -d [tag]

# 删除远程tag
$ git push origin :refs/tags/[tagName]

# 查看tag信息
$ git show [tag]

# 提交指定tag
$ git push [remote] [tag]

# 提交所有tag
$ git push [remote] --tags

# 新建一个分支,指向某个tag
$ git checkout -b [branch] [tag]

七、查看信息

# 显示有变更的文件
$ git status

# 显示当前分支的版本历史
$ git log

# 显示commit历史,以及每次commit发生变更的文件
$ git log --stat

$ git log -S [keyword]

# 显示某个commit之后的所有变动,每个commit占据一行
$ git log [tag] HEAD --pretty=format:%s

# 显示某个commit之后的所有变动,其"提交说明"必须符合搜索条件
$ git log [tag] HEAD --grep feature

# 显示某个文件的版本历史,包括文件改名
$ git log --follow [file]
$ git whatchanged [file]

# 显示指定文件相关的每一次diff
$ git log -p [file]

# 显示过去5次提交
$ git log -5 --pretty --oneline

# 显示所有提交过的用户,按提交次数排序
$ git shortlog -sn

# 显示指定文件是什么人在什么时间修改过
$ git blame [file]

# 显示暂存区和工作区的差异
$ git diff

# 显示暂存区和上一个commit的差异
$ git diff --cached [file]

# 显示工作区与当前分支最新commit之间的差异
$ git diff HEAD

# 显示两次提交之间的差异
$ git diff [first-branch]...[second-branch]

# 显示今天你写了多少行代码
$ git diff --shortstat "@{0 day ago}"

# 显示某次提交的元数据和内容变化
$ git show [commit]

# 显示某次提交发生变化的文件
$ git show --name-only [commit]

# 显示某次提交时,某个文件的内容
$ git show [commit]:[filename]

# 显示当前分支的最近几次提交
$ git reflog

八、远程同步

# 下载远程仓库的所有变动
$ git fetch [remote]

# 显示所有远程仓库
$ git remote -v

# 显示某个远程仓库的信息
$ git remote show [remote]

# 增加一个新的远程仓库,并命名
$ git remote add [shortname] [url]

# 取回远程仓库的变化,并与本地分支合并
$ git pull [remote] [branch]

# 上传本地指定分支到远程仓库
$ git push [remote] [branch]

# 强行推送当前分支到远程仓库,即使有冲突
$ git push [remote] --force

# 推送所有分支到远程仓库
$ git push [remote] --all

九、撤销

# 恢复暂存三区的指定文件到工作区
$ git checkout [file]

# 恢复某个commit的指定文件到暂存区和工作区
$ git checkout [commit] [file]

# 恢复暂存区的所有文件到工作区
$ git checkout .

# 重置暂存区的指定文件,与上一次commit保持一致,但工作区不变
$ git reset [file]

# 重置暂存区与工作区,与上一次commit保持一致
$ git reset --hard

# 重置当前分支的指针为指定commit,同时重置暂存区,但工作区不变
$ git reset [commit]

# 重置当前分支的HEAD为指定commit,同时重置暂存区和工作区,与指定commit一致
$ git reset --hard [commit]

# 重置当前HEAD为指定commit,但保持暂存区和工作区不变
$ git reset --keep [commit]

# 新建一个commit,用来撤销指定commit
# 后者的所有变化都将被前者抵消,并且应用到当前分支
$ git revert [commit]

# 暂时将未提交的变化移除,稍后再移入
$ git stash
$ git stash pop

十、其他

# 生成一个可供发布的压缩包
$ git archive

Configuring Android Studio: IDE & VM Options, JDK, etc
https://developer.android.com/studio/workflow.html
You should not edit any files in the IDE installation directory. Instead, you can customize the attributes by creating your own .properties or .vmoptions files in the following directories. (This has been possible on some platforms before, but it required you to copy and change the entire contents of the files. With the latest changes these properties are now additive instead such that you can set just the attributes you care about, and the rest will use the defaults from the IDE installation).

Note: As of Android Studio 2.0, you can create/edit this file by accessing the "Edit Custom VM Options" file from the Help menu.
请输入图片描述

Note: The folder name depends on the version of Android Studio. The documentation below applies to the release version (1.1.x), but if you are on a different version of Android Studio, see the table below for the correct folder name for your version.
The following table shows the configuration folder name to use for each studio version. This folder is referenced below as {FOLDER_NAME}

Android Studio Version
Preferences Folder Name
1.0.x and 1.1.x AndroidStudio
1.2.0 EAP/Preview AndroidStudioPreview1.2
1.2.0, 1.2.1, 1.2.2 AndroidStudio1.2
1.3 Preview AndroidStudioPreview1.3
1.3.0, 1.3.1, 1.3.2 AndroidStudio1.3
1.4.0 Preview AndroidStudioPreview1.4
1.4.0 AndroidStudio1.4
1.5.0, 1.5.1 AndroidStudio1.5
2.0 Preview, Beta AndroidStudioPreview2.0
2.0 AndroidStudio2.0
2.1 Preview AndroidStudioPreview2.1
2.1 AndroidStudio2.1
2.2 Preview (Future) AndroidStudioPreview2.2

Windows:
%USERPROFILE%.{FOLDER_NAME}\studio.exe.vmoptions and/or %USERPROFILE%.{FOLDER_NAME}\studio64.exe.vmoptions
%USERPROFILE%.{FOLDER_NAME}\idea.properties
Mac:
~/Library/Preferences/{FOLDER_NAME}/studio.vmoptions
~/Library/Preferences/{FOLDER_NAME}/idea.properties
Linux:
~/.{FOLDER_NAME}/studio.vmoptions and/or ~/.{FOLDER_NAME}/studio64.vmoptions
~/.{FOLDER_NAME}/idea.properties
You can also place use environment variables to point to specific override files elsewhere:
STUDIO_VM_OPTIONS, which vmoptions file to use
STUDIO_PROPERTIES, which property file to use
STUDIO_JDK, which JDK to run studio with
Note that this last variable allows you to for example run Android Studio with Java 7 on OSX (which normally picks Java 6 from the version specified in Info.plist):
$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk
$ open /Applications/Android\ Studio.app
(For Mac in particular, see this document on the topic of JDK selection.)

Increasing IDE Memory

By default, the IDE is assigned a maximum of 750 MB. If you have a large project, or if you have a lot of RAM on your system, the IDE will run better if you increase the amount of memory it is allowed to use. To do that, create your own studio.vmoptions override (in the location explained above) and add a line like this:

-Xmx2048m
The full set of default JVM arguments are the following, in case you want to override any of the others (such as the start heap size of the MaxPermSize) :defaults in the IDE right

-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCompressedOops
Setting a Property

If you want to override an IDE property, create a new idea.properties file in your local config directory, where you specify just the override properties. This file will be merged with the default properties in the IDE. See the below list for various properties you can change.

For example, Android Studio 2.0 ships with experimental improved bidirectional text support (issue 182739). To enable this support, create a file named idea.properties with just this content:
editor.new.rendering=true

On a Mac, for Android Studio 2.0 Preview, copy this file to ~/Library/Preferences/AndroidStudioPreview2.0/idea.properties.
On Windows, the path would be %USERPROFILE%.AndroidStudioPreview2.0\idea.properties
On Linux, the path would be ~/.AndroidStudioPreview2.0/idea.properties

Help, I Already Edited the IDE Installation Files
If you've already edited the files by hand, here are the files from 1.0 such that you can restore them:

idea.properties (Windows)
studio.exe.vmoptions (Windows)
studio64.exe.vmoptions (Windows)
studio.vmoptions (Mac, Linux)
idea.properties (Mac, Linux)
Android Studio is Ignoring My idea.vmoptions File

Around 1.0 we switched from storing VM options in a file called idea.vmoptions to one called studio.vmoptions, to avoid clashing with IntelliJ installations. If you had created a file named idea.vmoptions for Studio, it will be ignored now. Put your edits in studio.vmoptions instead.
Properties

Here are properties you can customize in your own idea.properties file:

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to user installed plugins folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.plugins.path=${idea.config.path}/plugins

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=2500

#---------------------------------------------------------------------
# This option controls console cyclic buffer: keeps the console output size not higher than the specified buffer size (Kb).
# Older lines are deleted. In order to disable cycle buffer use idea.cycle.buffer.size=disabled
#---------------------------------------------------------------------
idea.cycle.buffer.size=1024

#---------------------------------------------------------------------
# Configure if a special launcher should be used when running processes from within IDE.
# Using Launcher enables "soft exit" and "thread dump" features
#---------------------------------------------------------------------
idea.no.launcher=false

#---------------------------------------------------------------------
# To avoid too long classpath
#---------------------------------------------------------------------
idea.dynamic.classpath=false

#---------------------------------------------------------------------
# There are two possible values of idea.popup.weight property: "heavy" and "medium".
# If you have WM configured as "Focus follows mouse with Auto Raise" then you have to
# set this property to "medium". It prevents problems with popup menus on some
# configurations.
#---------------------------------------------------------------------
idea.popup.weight=heavy

#---------------------------------------------------------------------
# Use default anti-aliasing in system, i.e. override value of "Settings|Editor|Appearance|Use anti-aliased font"
# option. May be useful when using Windows Remote Desktop Connection for instance.
#---------------------------------------------------------------------
idea.use.default.antialiasing.in.editor=false

#---------------------------------------------------------------------
# Disabling this property may lead to visual glitches like blinking and fail to repaint
# on certain display adapter cards.
#---------------------------------------------------------------------
sun.java2d.noddraw=true

#---------------------------------------------------------------------
# Removing this property may lead to editor performance degradation under Windows.
#---------------------------------------------------------------------
sun.java2d.d3d=false

#---------------------------------------------------------------------
# Workaround for slow scrolling in JDK6
#---------------------------------------------------------------------
swing.bufferPerWindow=false

#---------------------------------------------------------------------
# Removing this property may lead to editor performance degradation under X Window.
#---------------------------------------------------------------------
sun.java2d.pmoffscreen=false

#---------------------------------------------------------------------
# Workaround to avoid long hangs while accessing clipboard under Mac OS X.
#---------------------------------------------------------------------
#ide.mac.useNativeClipboard=True

#---------------------------------------------------------------------
# Maximum size (kilobytes) IDEA will load for showing past file contents -
# in Show Diff or when calculating Digest Diff
#---------------------------------------------------------------------
#idea.max.vcs.loaded.size.kb=20480

#---------------------------------------------------------------------
# High Density (aka Retina aka HiDPI) Display support:
#
# The two options below allow overriding the built-in HiDPI display detection
# algorithm to provide a custom system DPI.
# The options are not supported on Mac, as Retina support is built-in.
#
# hidpi.system.dpi.override=<dpi_value>
# where <dpi_value> can range from 96 (100% zoom), to 288 (300%) zoom. 
#
# hidpi=true is a legacy option that is equivalent to setting
# hidpi.system.dpi.override=192 (200% zoom)
#---------------------------------------------------------------------
#hidpi.system.dpi.override=192
#hidpi=true

Subpages (1): Mac OSX JDK Selection
Č
ċ
idea.properties (7k)Tor Norbye, Dec 10, 2014, 11:26 AM
v.1ď
ċ
mac-idea.properties (1k)Tor Norbye, Dec 10, 2014, 11:26 AM
v.1ď
ċ
studio.exe.vmoptions (0k)Tor Norbye, Dec 10, 2014, 11:24 AM
v.1ď
ċ
studio.vmoptions (0k)Tor Norbye, Dec 10, 2014, 11:25 AM
v.1ď
ċ
studio64.exe.vmoptions (0k)Tor Norbye, Dec 10, 2014, 11:24 AM
v.1

1、下载:得到android-studio-ide-143.3101438-linux.zip

https://developer.android.com/studio/index.html

2、安装:

sudo gedit /usr/share/applications/android-studio.desktop

输入:

[Desktop Entry]
Name=WebStorm
Comment=webstorm
Exec=/home/duuge/app/android-studio/bin/studio.sh
Icon=/home/duuge/app/android-studio/bin/studio.icon
Terminal=false
Type=Application

最后一步,进入文件管理器进入目录/usr/share/applications/,找到刚上面创建的android-studio的快捷方式(就是上logo那个icon图标,很好找的鸟图),复制,放桌面里,开机就看到它了。

运行报错:

No JDK found. Please validate either STUDIO_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.
解决办法:到http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
下载JDK得到jdk-8u101-linux-x64.tar.gz,解压

tar xzvf jdk-8u101-linux-x64.tar.gz

解压为jdk文件夹,然后

mv jdk /usr/lib/jvm

(如果还没有jvm文件夹则mkdir /usr/lib/jvm/创建一个文件夹解决)。

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk/bin/java 1
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk/bin/javac 1
update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk/bin/javaws 1
update-alternatives --config java
update-alternatives --config javaws

OK完成了,测试一下看看java是否安装成功:查java版本号出来是java8的就行:

java -version

可能会需要安装以下:

apt-get install lib32ncurses5 ia32-libs

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6

Search for install instructions for your particular linux configuration (Android KVM linux Installation) that KVM is enabled for faster Android emulator performance.

最后,双击运行桌面的Android-Studio图标。
The end.

1、备份localhost本机中的demo数据库到/mnt/database_bak目录下文件名为demo无后缀:

pg_dump --host localhost --port 5432 --username "postgres" --format custom --blobs --verbose --file "/mnt/database_bak/demo" "demo"

2、还原localhost本机中的demo数据库到/mnt/database_bak目录下文件名为demo无后缀:

pg_restore --host localhost --port 5432 --username "postgres" --dbname "demo" --verbose "/mnt/database_bak/demo"