分类 其他 下的文章

环境: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

'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)

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

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、

  sudo apt-get install nginx php5-fpm

然后编辑配置文件。

  sudo gedit /etc/nginx/site-available/default

注意,如果是用gedit而不是用vi编辑,那应该编辑site-available下的default文件,如果是编辑site-enabled下的default,因为gedit保存时默认会生成一个“default~”的备份,这个备份也会被nginx当成启用的配置文件而出错无法启动。保险的做法是,编辑site-available下的文件后仍手动删除备份文件。

找到location ~ .php$的地方,5行取消注释,变成这样:

  location ~ \.php$ {  
  #   fastcgi_split_path_info ^(.+\.php)(/.+)$;  
  #   # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini  
  #  
  #   # With php5-cgi alone:  
  #   fastcgi_pass 127.0.0.1:9000;  
  #   # With php5-fpm:  
      fastcgi_pass unix:/var/run/php5-fpm.sock;  
      fastcgi_index index.php;  
      include fastcgi_params;  
  }  

这就成了!
启动nginx:

  sudo service nginx start

扩展:

  1. default文件中,找到
    index index.html index.htm;

这行,加入成

  index index.html index.htm index.php;

这就可以用php文件做默认主页

2.default文件中,在server{}指示符的 location / {} 指示符内,加入

  autoindex on;

当文件夹内没有index文件,就会自动索引文件。

  1. server{} 指示符的 root 行是文件根目录,自行修改就能把那个文件夹作为网站根目录

参考:http://ubuntuhandbook.org/index.php/2013/10/install-nginx-php5-mysql-lemp-ubuntu-1310/

转载请注明出处:http://blog.csdn.net/hursing

安装MySQL
要安装 MySQL,可以在终端提示符后运行下列命令:

  sudo apt-get install mysql-server mysql-client #中途会让你输入一次root用户密码
  sudo apt-get install php5-mysql  #安装php5-mysql 是将php和mysql连接起来

一旦安装完成,MySQL 服务器应该自动启动。

  sudo start mysql #手动的话这样启动
  sudo stop mysql #手动停止

当你修改了配置文件後,你需要重启 mysqld 才能使这些修改生效。

要想检查 mysqld 进程是否已经开启,可以使用下面的命令:

  pgrep mysqld

如果进程开启,这个命令将会返回该进程的 id。

文件结构
MySQL配置文件:/etc/mysql/my.cnf ,其中指定了数据文件存放路径

  datadir         = /var/lib/mysql

如果你创建了一个名为 test 的数据库,那么这个数据库的数据会存放到 /var/lib/mysql/test 目录下。

进入MySQL

  mysql -uroot -p 

(输入mysql的root密码)

  qii@ubuntu:~$ mysql -u root -p
  Enter password: 
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 37
  Server version: 5.1.41-3ubuntu12.3 (Ubuntu)

  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  mysql> 

修改 MySQL 的管理员密码:

  sudo mysqladmin -u root password newpassword;

简单的操作

显示数据库:

mysql> show databases;
Database
information_schema
mysql

2 rows in set (0.00 sec)

phpmyadmin管理
用随便一个支持PHP的web服务器(如Apache、Nginx、Lighttpd),下载phpmyadmin,装之。

  sudo apt-get install phpmyadmin  #注意这是安装到/usr/share/phpmyadmin

在ubuntu下,运行:

  sudo apt-get install phpmyadmin

过一会后会有一些设置,如选择服务器(选apache别选lighttpd)、密码设定等等内容。安装完成后,访问http://localhost/phpmyadmin会出现404错误,这是因为没有将phpmyadmin目录映射到apache目录下面,运行下面命令即可:

nginx服务器用:

  sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/html

apache服务器用:

  sudo ln -s /usr/share/phpmyadmin /var/www

最后打开:http://localhost/phpmyadmin 成功!