2016年9月

LinuxMint18开机错误:/etc/mdm/Xsession:Beginning session setup... not found

今天去麦德龙购物,回来开机失败:
系统是:Linux Mint 18
之前关机正常,提示错误如下:

/etc/mdm/Xsession:Begining session setup...
/etc/mdm/Xsession:29:/home/duuge/.profile:[[:not found
/etc/mdm/Xsession:173:/etc/mdm/Xsession:grep not found
/etc/mdm/Xsession:Executing cinnamon-session-cinnamon cinnamon failed,will try to run x-terminal-emulator
/etc/mdm/Xsession:205:exec:x-terminal-emulator not found

截图如下2图:
图1:
IMG_20160926_231600.jpg
图2:
IMG_20160926_231609.jpg

解决方法:

1、尝试重启进入kde模式未果(因为设置了简体中文语言,所以命令提示符下都是乱码);
2、用Linux Mint 18的U盘系统安装优盘启动笔记本电脑,然后找到最后我的印象中最后一次对.profile的操作,用#井号禁用里面的配置项,重启电脑,成功解决!

Android Studio之AVD启动错误Cannot launch AVD in emulator的解决方法

环境:Linux Mint 18+Nvidia driver

在Android Studio 2.2中启动AVD报错:

Cannot launch AVD in emulator. 
Output: libGL error: driver pointer missing libGL 
error: failed to load driver: nouveau libGL 
error: unable to load driver: swrast_dri.so libGL 
error: failed to load driver: swrast X 
Error of failed request:  GLXBadContext

http://stackoverflow.com/questions/36189393/android-studio-avd-error-launching找到一个不算解决的解决办法
https://gist.github.com/NickGeek/1e125d7ca6aeff2d4e0e3ac2399bc14c的avd_selection.py文件放到/home/duuge/Android/Sdk/tools目录下(具体按你自己的安卓的sdk目录而定),然后启动命令行并切到这个目录下运行命令python avd_selection.py:

duuge@linuxmint ~/Android/Sdk/tools $ python avd_selection.py

可临时解决。
随文附上avd_selection.py文件的压缩包。

avd_selection.py.tar.gz

tx命令行进行简体中文汉化Dolibarr在transifex笔记记录

参考:https://wiki.dolibarr.org/index.php/Zh_Translator_documentation

基于Linux Mint 18

DolibarrQQ群原创:206239089 (简体中文翻译交流)

1.安装transifex-client:提示没安装但最新版本是0.12的而apt-get install的是0.10这个版本不能用有问题的。于是继续下面步骤。

2.安装python pip:

sudo apt-get install python-pip

3.安装setuptools:

sudo pip install setuptools

4.安装transifex-client:

sudo pip install transifex-client

sudo easy_install install transifex-client

5.执行下面命令:

tx -d pull -l zh_CN

报错,提示:

duuge@Latitude-E6410 ~/github/dolibarr-tx $ tx -d pull -l zh_CNPath to tx is /home/duuge/github/dolibarr-tx.
Config file is /home/duuge/github/dolibarr-tx/.tx/config
.transifexrc file is at /home/duuge/github/dolibarr-tx
.transifexrc file is at /home/duuge
/home/duuge/.transifexrc not found.
Handling resource dolibarr.accountancy
Language mapping is: Flipdict({'sw': 'sw_SW', 'sr@latin': 'sr_RS', 'uz': 'uz_UZ'})
URL data are: {'project': 'dolibarr', 'host': 'https://www.transifex.com', 'resource': 'accountancy'}
No user credentials found for host https://www.transifex.com. Edit ~/.transifexrc and add the appropriate info in there.
Exception: No user credentials found for host https://www.transifex.com. Edit ~/.transifexrc and add the appropriate info in there.

看到:Edit ~/.transifexrc这文件没配置好。好吧用命令tx init初始化一下就解决。

tx init

会提示输入你在transifex网站的账号和密码。
完了之后继续 执行

补全一下.tx文件夹下的config配置文件(有点长)文件在github的dolibarr源代码的.tx文件夹下:
右键另存为千万别直接点击:https://github.com/Dolibarr/dolibarr/blob/develop/.tx/config

[main]
host = https://www.transifex.com
lang_map = uz: uz_UZ, sw: sw_SW, sr@latin: sr_RS
 
[dolibarr.accountancy]
file_filter = htdocs/langs/<lang>/accountancy.lang
source_file = htdocs/langs/en_US/accountancy.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.admin]
file_filter = htdocs/langs/<lang>/admin.lang
source_file = htdocs/langs/en_US/admin.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.agenda]
file_filter = htdocs/langs/<lang>/agenda.lang
source_file = htdocs/langs/en_US/agenda.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.banks]
file_filter = htdocs/langs/<lang>/banks.lang
source_file = htdocs/langs/en_US/banks.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.bills]
file_filter = htdocs/langs/<lang>/bills.lang
source_file = htdocs/langs/en_US/bills.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.bookmarks]
file_filter = htdocs/langs/<lang>/bookmarks.lang
source_file = htdocs/langs/en_US/bookmarks.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.boxes]
file_filter = htdocs/langs/<lang>/boxes.lang
source_file = htdocs/langs/en_US/boxes.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.cashdesk]
file_filter = htdocs/langs/<lang>/cashdesk.lang
source_file = htdocs/langs/en_US/cashdesk.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.categories]
file_filter = htdocs/langs/<lang>/categories.lang
source_file = htdocs/langs/en_US/categories.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.commercial]
file_filter = htdocs/langs/<lang>/commercial.lang
source_file = htdocs/langs/en_US/commercial.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.companies]
file_filter = htdocs/langs/<lang>/companies.lang
source_file = htdocs/langs/en_US/companies.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.compta]
file_filter = htdocs/langs/<lang>/compta.lang
source_file = htdocs/langs/en_US/compta.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.contracts]
file_filter = htdocs/langs/<lang>/contracts.lang
source_file = htdocs/langs/en_US/contracts.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.cron]
file_filter = htdocs/langs/<lang>/cron.lang
source_file = htdocs/langs/en_US/cron.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.deliveries]
file_filter = htdocs/langs/<lang>/deliveries.lang
source_file = htdocs/langs/en_US/deliveries.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.dict]
file_filter = htdocs/langs/<lang>/dict.lang
source_file = htdocs/langs/en_US/dict.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.donations]
file_filter = htdocs/langs/<lang>/donations.lang
source_file = htdocs/langs/en_US/donations.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.ecm]
file_filter = htdocs/langs/<lang>/ecm.lang
source_file = htdocs/langs/en_US/ecm.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.errors]
file_filter = htdocs/langs/<lang>/errors.lang
source_file = htdocs/langs/en_US/errors.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.exports]
file_filter = htdocs/langs/<lang>/exports.lang
source_file = htdocs/langs/en_US/exports.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.externalsite]
file_filter = htdocs/langs/<lang>/externalsite.lang
source_file = htdocs/langs/en_US/externalsite.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.ftp]
file_filter = htdocs/langs/<lang>/ftp.lang
source_file = htdocs/langs/en_US/ftp.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.help]
file_filter = htdocs/langs/<lang>/help.lang
source_file = htdocs/langs/en_US/help.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.holiday]
file_filter = htdocs/langs/<lang>/holiday.lang
source_file = htdocs/langs/en_US/holiday.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.hrm]
file_filter = htdocs/langs/<lang>/hrm.lang
source_file = htdocs/langs/en_US/hrm.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.incoterm]
file_filter = htdocs/langs/<lang>/incoterm.lang
source_file = htdocs/langs/en_US/incoterm.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.install]
file_filter = htdocs/langs/<lang>/install.lang
source_file = htdocs/langs/en_US/install.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.interventions]
file_filter = htdocs/langs/<lang>/interventions.lang
source_file = htdocs/langs/en_US/interventions.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.languages-not-res]
file_filter = htdocs/langs/<lang>/languages.lang
source_file = htdocs/langs/en_US/languages.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.ldap]
file_filter = htdocs/langs/<lang>/ldap.lang
source_file = htdocs/langs/en_US/ldap.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.link]
file_filter = htdocs/langs/<lang>/link.lang
source_file = htdocs/langs/en_US/link.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.loan]
file_filter = htdocs/langs/<lang>/loan.lang
source_file = htdocs/langs/en_US/loan.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.mailmanspip]
file_filter = htdocs/langs/<lang>/mailmanspip.lang
source_file = htdocs/langs/en_US/mailmanspip.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.mails]
file_filter = htdocs/langs/<lang>/mails.lang
source_file = htdocs/langs/en_US/mails.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.main]
file_filter = htdocs/langs/<lang>/main.lang
source_file = htdocs/langs/en_US/main.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.margins]
file_filter = htdocs/langs/<lang>/margins.lang
source_file = htdocs/langs/en_US/margins.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.members]
file_filter = htdocs/langs/<lang>/members.lang
source_file = htdocs/langs/en_US/members.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.oauth]
file_filter = htdocs/langs/<lang>/oauth.lang
source_file = htdocs/langs/en_US/oauth.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.opensurvey]
file_filter = htdocs/langs/<lang>/opensurvey.lang
source_file = htdocs/langs/en_US/opensurvey.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.orders]
file_filter = htdocs/langs/<lang>/orders.lang
source_file = htdocs/langs/en_US/orders.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.other]
file_filter = htdocs/langs/<lang>/other.lang
source_file = htdocs/langs/en_US/other.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.paybox]
file_filter = htdocs/langs/<lang>/paybox.lang
source_file = htdocs/langs/en_US/paybox.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.paypal]
file_filter = htdocs/langs/<lang>/paypal.lang
source_file = htdocs/langs/en_US/paypal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.printing]
file_filter = htdocs/langs/<lang>/printing.lang
source_file = htdocs/langs/en_US/printing.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.productbatch]
file_filter = htdocs/langs/<lang>/productbatch.lang
source_file = htdocs/langs/en_US/productbatch.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.products]
file_filter = htdocs/langs/<lang>/products.lang
source_file = htdocs/langs/en_US/products.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.projects]
file_filter = htdocs/langs/<lang>/projects.lang
source_file = htdocs/langs/en_US/projects.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.propal]
file_filter = htdocs/langs/<lang>/propal.lang
source_file = htdocs/langs/en_US/propal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.receiptprinter]
file_filter = htdocs/langs/<lang>/receiptprinter.lang
source_file = htdocs/langs/en_US/receiptprinter.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.resource]
file_filter = htdocs/langs/<lang>/resource.lang
source_file = htdocs/langs/en_US/resource.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.salaries]
file_filter = htdocs/langs/<lang>/salaries.lang
source_file = htdocs/langs/en_US/salaries.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.sendings]
file_filter = htdocs/langs/<lang>/sendings.lang
source_file = htdocs/langs/en_US/sendings.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.sms]
file_filter = htdocs/langs/<lang>/sms.lang
source_file = htdocs/langs/en_US/sms.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.stocks]
file_filter = htdocs/langs/<lang>/stocks.lang
source_file = htdocs/langs/en_US/stocks.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.suppliers]
file_filter = htdocs/langs/<lang>/suppliers.lang
source_file = htdocs/langs/en_US/suppliers.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.supplier_proposal]
file_filter = htdocs/langs/<lang>/supplier_proposal.lang
source_file = htdocs/langs/en_US/supplier_proposal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.trips]
file_filter = htdocs/langs/<lang>/trips.lang
source_file = htdocs/langs/en_US/trips.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.users]
file_filter = htdocs/langs/<lang>/users.lang
source_file = htdocs/langs/en_US/users.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.withdrawals]
file_filter = htdocs/langs/<lang>/withdrawals.lang
source_file = htdocs/langs/en_US/withdrawals.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.website]
file_filter = htdocs/langs/<lang>/website.lang
source_file = htdocs/langs/en_US/website.lang
source_lang = en_US
type = MOZILLAPROPERTIES
 
[dolibarr.workflow]
file_filter = htdocs/langs/<lang>/workflow.lang
source_file = htdocs/langs/en_US/workflow.lang
source_lang = en_US
type = MOZILLAPROPERTIES

6.执行下面命令:

tx -d pull -l zh_CN

成功!

duuge@Latitude-E6410 ~/github/dolibarr-tx $ tx -d pull -l zh_CN
Path to tx is /home/duuge/github/dolibarr-tx.
Config file is /home/duuge/github/dolibarr-tx/.tx/config
.transifexrc file is at /home/duuge/github/dolibarr-tx
.transifexrc file is at /home/duuge
Handling resource dolibarr.accountancy
Language mapping is: Flipdict({'sw': 'sw_SW', 'sr@latin': 'sr_RS', 'uz': 'uz_UZ'})
URL data are: {'project': 'dolibarr', 'host': 'https://www.transifex.com', 'resource': 'accountancy'}
Statistics response is {
    "ar_SA": {
        "reviewed_percentage": "70%", 
        "completed": "70%", 
        "untranslated_words": 229, 
        "last_commiter": "eldy", 
        "reviewed": 97, 
        "translated_entities": 97, 
        "translated_words": 503, 
        "last_update": "2016-08-30 23:05:18", 
        "untranslated_entities": 40
    }, 
    "en": {
        "reviewed_percentage": "0%", 
        "completed": "100%", 
        "untranslated_words": 0, 
        "last_commiter": "eldy", 
        "reviewed": 0, 
        "translated_entities": 137, 
        "translated_words": 732, 
        "last_update": "2016-08-30 23:05:19", 
        "untranslated_entities": 0
    }, 

......
......
......

Adding to new translations: set([])
Pulling languages for: set(['zh_CN'])
Pulling translations for resource dolibarr.workflow (source: htdocs/langs/en_US/workflow.lang)
Using file htdocs/langs/zh_CN/workflow.lang
Remote time is 1473712800.0 and local 1473713460.0
Local is newer than remote for lang zh_CN
Skipping 'zh_CN' translation (file: htdocs/langs/zh_CN/workflow.lang).
Done.
duuge@duuge-Latitude-E6410 ~/github/dolibarr-tx $ 

AndroidStudio报错:'tools.jar' seems to be not in studio classpath的解决办法

'tools.jar' seems to be not in studio classpath.
please ensure JAVA_HOME points to JDK rether than JRE.

解决办法:

解决办法:到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文件夹,然后

sudo mv jdk /usr/lib/jvm

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

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

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

java -version

返回:

java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Transefix pull odoo po命令行下载odoo官方简体中文语言包

需要手动命令行同步下载或上传简体中文语言至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