lizongbo at 618119.com 工作,生活,Android,前端,Linode,Ubuntu,nginx,java,apache,tomcat,Resin,mina,Hessian,XMPP,RPC

2015年07月28日

Mac下Xamarin Studio替换MonoDevelop的步骤。

Filed under: c#,Unity — 标签:, , , — admin @ 13:27

Mac下Xamarin Studio替换MonoDevelop的步骤。

1.需要使用最新的指定版本的Unity3D,注意看帖子里写的版本,老版本会crash:
Unity 4.6+: 4.6.5p2 或更高版本
Unity 5.0: 5.0.2p2 或更高版本
Unity 5.1+: 5.1.0p1 或更高版本

2.下载对应的插件包zip文件
http://files.unity3d.com/lukasz/Unity-Addins-5.9.0.zip

参考:
http://forum.unity3d.com/threads/unity-add-ins-for-monodevelop-xamarin-studio-5-9.329880/
3.下载最新的xamarin studio进行安装
http://download.xamarin.com/MonoFrameworkMDK/Macx86/MonoFramework-MDK-4.0.2.5.macos10.xamarin.x86.pkg

http://download.xamarin.com/studio/Mac/XamarinStudio-5.9.2.4-0.dmg
参考: http://www.monodevelop.com/download/
https://static.xamarin.com/installer_assets/v3/Mac/Universal/InstallationManifest.xml

4.安装之后,左上角Xamarin Studio-> Preferences…,Language 先设置成英文界面(中文菜单不多,反而干扰)。
再找到Version Control->General,把Disable Version Control globally勾选上(不做这个在修改工程设置进行保存时候会提示不能保存)。
5.解压Unity-Addins-5.9.0.zip.
启动Xamarin Studio,主菜单->Tools-> Add-In Manager
OSX: Xamarin Studio ➔ Add-in Manager.
Windows: Tools ➔ Add-in Manager
点 “Install from file” 然后选中Unity-Addins-5.9.0.zip解压得到的四个插件安装文件.
重启Xamarin Studio.
5.打开unity生成的工程,选中 Assembly-Csharp工程,右键->Options->Build->General:
Target framework.选择 Mono/.NET 2.0,用了protobuf-net源代码的,需要在Languages Options把Allow ‘unsafe’ code勾选上。
6.启动Unity,打开工程,此时再在Xamarin Studio里点三角形启动debug,就可以自动监听到Unity的进程进行debug了。

2014年09月15日

在Linode VPS上安装配置Apache James 3.0

Filed under: Java,Linux — 标签:, , — admin @ 14:50

在Linode VPS上安装配置Apache James 3.0,服务器是Linode的VPS,操作系统是Ubuntu 14.04 64位
1.先下载

http://mirrors.ibiblio.org/apache//james/apache-james/3.0beta4/apache-james-3.0-beta4-app.tar.gz

来自:http://james.apache.org/download.cgi#Apache_James_Server

root@618119.com:/usr/local/app# wget http://mirrors.ibiblio.org/apache//james/apache-james/3.0beta4/apache-james-3.0-beta4-app.tar.gz

2.解压:

root@618119.com:/usr/local/app# tar -zxvf ./apache-james-3.0-beta4-app.tar.gz

3.修改配置文件:
进入/usr/local/app/apache-james-3.0-beta4/conf 目录。
先把配置文件模板复制一份成配置文件

root@618119.com:/usr/local/app/apache-james-3.0-beta4/conf# cp ./dnsservice-template.conf ./dnsservice.conf
root@618119.com:/usr/local/app/apache-james-3.0-beta4/conf# cp ./domainlist-template.conf ./domainlist.conf
root@618119.com:/usr/local/app/apache-james-3.0-beta4/conf# cp ./smtpserver-template.conf ./smtpserver.conf

然后分别编辑这三个文件。
dns server 增加
<server>8.8.8.8</server>
<server>114.114.114.114</server>

domainlist.conf修改为:
<!– XML based implementation for DomainList –>
<domainlist class=”org.apache.james.domainlist.xml.XMLDomainList”]] >
<domainnames>
<domainname>mail.lizongbo.com</domainname>
<domainname>lizongbo.com</domainname>
</domainnames>
<autodetect>true</autodetect>
<autodetectIP>true</autodetectIP>
<defaultDomain>mail.lizongbo.com</defaultDomain>
</domainlist>

(实际发现这个没效果,还是通过命令加域名比较靠谱)
smtpserver.conf
增加如下配置:
<authRequired>announce</authRequired>
<verifyIdentity>true</verifyIdentity>

4.由于服务器用的jdk版本较高,会触发一个bug。

因此需要下载 http://jaxb.java.net/2.1.13/JAXB2_20100510.jar 提取jaxb-impl.jar 放到 james 的lib目录下面:
quickli-nb:lib lizongbo$ scp ./jaxb-impl.jar root@lizongbo.com:/usr/local/app/apache-james-3.0-beta4/lib

参考:
http://james.apache.org/server/3/install.html

5.运行测试

启动还是出错
于是下载最新的SNAPSHOT版本:

http://repository.apache.org/content/repositories/snapshots/org/apache/james/james-server-app/3.0.0-beta5-SNAPSHOT/james-server-app-3.0.0-beta5-20140913.003752-643-app.tar.gz

参考:http://stackoverflow.com/questions/16154201/start-apache-james-with-jdk-1-7

root@618119.com:/usr/local/app# wget http://repository.apache.org/content/repositories/snapshots/org/apache/james/james-server-app/3.0.0-beta5-SNAPSHOT/james-server-app-3.0.0-beta5-20140913.003752-643-app.tar.gz

root@618119.com:/usr/local/app# tar -zxvf ./james-server-app-3.0.0-beta5-20140913.003752-643-app.tar.gz

把改好的配置同步过去

root@618119.com:/usr/local/app# cp /usr/local/app/apache-james-3.0-beta4/conf/dnsservice.conf  /usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/conf
root@618119.com:/usr/local/app# cp /usr/local/app/apache-james-3.0-beta4/conf/domainlist.conf /usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/conf
root@618119.com:/usr/local/app# cp /usr/local/app/apache-james-3.0-beta4/conf/smtpserver.conf /usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/conf

此时不需要更新jaxb也能正常启动了。

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./james start
Starting Apache James :: Server :: App…
./james: 1: eval: /usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin/./wrapper-linux-x86-32: not found
root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# sudo apt-get install libc6 libc6-dev

6.通过命令来加东西

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./james-cli.sh  -h 127.0.0.1 -p 9999 adddomain email.lizongbo.com
adddomain command executed sucessfully in 262 ms.

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./james-cli.sh  -h 127.0.0.1 -p 9999 listdomains
email.lizongbo.com
localhost.
96.126.96.170
127.0.0.1

listdomains command executed sucessfully in 3571 ms.

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./james-cli.sh  -h 127.0.0.1 -p 9999 adddomain mail.lizongbo.com
adddomain command executed sucessfully in 253 ms.

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./james-cli.sh  -h 127.0.0.1 -p 9999 listdomains
email.lizongbo.com
mail.lizongbo.com
localhost.
96.126.96.170
127.0.0.1

listdomains command executed sucessfully in 165 ms.

7.先添加域名,再添加测试账号

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./james-cli.sh  -h 127.0.0.1 -p 9999 adduser postmaster 618119
Error while execute command:
Given Username needs to contain a @domainpart
root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./james-cli.sh  -h 127.0.0.1 -p 9999 adduser postmaster@mail.lizongbo.com 618119
adduser command executed sucessfully in 171 ms.

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./james-cli.sh  -h 127.0.0.1 -p 9999 adduser admin@mail.lizongbo.com lizongbo
adduser command executed sucessfully in 164 ms.

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./james-cli.sh  -h 127.0.0.1 -p 9999 listusers
admin@mail.lizongbo.com
postmaster@mail.lizongbo.com

8.配置wrapper.conf,替换 wrapper-linux-x86-32。

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# vi ../conf/wrapper.conf
(指定了java 启动命令来源:)
wrapper.java.command=/usr/local/app/jdk/bin/java

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# cp ./wrapper-linux-x86-64  ./wrapper-linux-x86-32
root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./wrapper-linux-x86-32

不替换的话,启动会报错,因为服务器是64位的:

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin# ./james start
Starting Apache James :: Server :: App…
./james: 1: eval: /usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin/./wrapper-linux-x86-32: not found

9.然后再安装成系统服务:

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT# ln -s /usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin/james /etc/init.d/james
root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT# ls /etc/init.d/james  -alh
lrwxrwxrwx 1 root root 62 Sep 14 04:38 /etc/init.d/james -> /usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT/bin/james
root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT# service james start

root@618119.com:/usr/local/app/james-server-app-3.0.0-beta5-SNAPSHOT# service james restart
Stopping Apache James :: Server :: App…
Stopped Apache James :: Server :: App.
Starting Apache James :: Server :: App…

这样就成了系统服务了。

10.再在name.com  添加mx记录,将mail.lizongbo.com 的域名指向运行Apache James的服务器,就可以了。

2014年08月18日

Linode VPS从 Ubuntu 12.04 升级到 Ubuntu 14.04

Filed under: Linux — 标签:, , — admin @ 10:40

Linode VPS从 Ubuntu 12.04 升级到 Ubuntu 14.04

linode官网现在还是只有升级到Ubuntu 12.04的步骤
参考:
https://www.linode.com/docs/security/upgrading/how-to-upgrade-to-ubuntu-12-04-precise
升级到Ubuntu 14.04的步骤是一样的,但是升级过程中出现个错误信息,出错信息如下:

Error in sys.excepthook:
Traceback (most recent call last):
File “/tmp/update-manager-Ik4Dhk/DistUpgrade/DistUpgradeViewText.py”, line 108, in _handleException
“\n”.join(lines))
File “/tmp/update-manager-Ik4Dhk/DistUpgrade/DistUpgradeViewText.py”, line 142, in error
print(twrap(summary))
UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-5: ordinal not in range(128)

Original exception was:
Traceback (most recent call last):
File “/tmp/update-manager-Ik4Dhk/trusty”, line 10, in <module>
sys.exit(main())
File “/tmp/update-manager-Ik4Dhk/DistUpgrade/DistUpgradeMain.py”, line 230, in main
app = DistUpgradeController(view, options, datadir=options.datadir)
File “/tmp/update-manager-Ik4Dhk/DistUpgrade/DistUpgradeController.py”, line 126, in __init__
self._view.updateStatus(_(“Reading cache”))
File “/tmp/update-manager-Ik4Dhk/DistUpgrade/DistUpgradeViewText.py”, line 122, in updateStatus
print(msg)
UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-5: ordinal not in range(128)
=== Command detached from window (Fri Aug 15 11:42:55 2014) ===
=== Command terminated with exit status 1 (Fri Aug 15 11:42:55 2014) ===

在网上找资料看了说是没设置LC_ALL导致的。
参考:
http://blueecho.info/wp/?p=78

修改/root/.bashrc文件

命令 vi /root/.bashrc

按A,然后在文件末尾添加

export LC_ALL=C

按Esc,再按冒号和W和Q,

再运行  source /root/.bashrc 使修改后的文件生效。

然后再运行screen命令,再运行 sudo do-release-upgrade。

 

 

Older Posts »

Powered by WordPress