Monthly Archives: June 2013

How to setup a mirror of Qt Project

There is a work from Oswald Buddenhagen, his change, qtrepotools: add mirror script.

Mirror Script

You need to have an account of codereview(gerrit) and set up the ssh keys well, more info in Contribute to Qt.

Here is the qt-codereview-mirror shell script in github.

I set up this mirror script on a Ubuntu 13.04 machine. You need to check following before to run it:

  • Install git and procmail package for git and lockfile:

  • Make sure you have /data/repos directory.

You could have a try run for the above script. If it works well for you, you can add it into your crontab, see also Ubuntu: CronHowto.

Git Daemon

Next is to run a git server on your machine. I use git-daemon for this task.

How to use your mirror?

  • For Qt 4:

If you need to push change to upstream, then you should set up gerrit remote.

  • For Qt 5:

init-repository will help you set up gerrit remote for each repo.

孩子的环境和安全(挪威)

备忘一下吧,Children’s enviroment and safety(英语)/Barns miljø og sikkerhet(挪威语)。

年龄段 英语 挪威语 网页
0-6月 英语 挪威语 Barns miljø og sikkerhet, 0-6 måneder
6月-2岁 英语 挪威语 Barns miljø og sikkerhet, 6 måneder-2 år
2-4岁 英语 挪威语 Barns miljø og sikkerhet, 2-4 år
4-6岁 英语 挪威语 Barns miljø og sikkerhet, 4-6 år
开始上学 英语 挪威语 Barns miljø og sikkerhet, skolestart

在网页中还有阿拉伯语、索马里语和乌尔都语的版本。

参考:

Distributed Compilation the build of Qt

Qt is a huge project, especially like the module, QtWebKit. If you happen to be in a computer farm, it is very useful to use distributed complation to speed up the build of Qt.

Here I suggest to use icecream on Linux and Mac OS X, and IncrediBuild on Windows(at least for Microsoft’s Visual Studio compilers). About IncrediBuild, more details perhaps will be updated in the future. See also qtrepotools: publish ibmake.bat, incredibuild xge wrapper for make/buildconsole.

Today, this blog is more about icecc/icecream.

Preparation

Linux

icecream is maintained by the SUSE people. Then there are less issues in OpenSUSE than in Ubuntu. But Ubuntu is more popular one. I just use Ubuntu as example here.

  • Install your compiler, like gcc and clang.
  • Install icecc and icemon(optional). icemon is the monitor of icecream build, better to check it when you setup the enviroments. It’s an GUI application based on Qt 4.8. Note: you need to install 0.9.8~git2012121601-0ubuntu2 and later version for icecc. More details in “icecc” package in Ubuntu.

  • For clang users, if you want to make icecream compiler package, better to do:
    • 13.04: $ sudo ln -s /usr/include/clang/3.2/include /usr/lib/clang/3.2/
    • 12.04: $ sudo ln -s /usr/include/clang /usr/lib/
  • Create compiler package: please do it. Here is the example for 13.04:

  • Enviroment settings before build:

  • Run icecc-scheduler in one of your Ubuntus:
    • Edit /etc/default/icecc, set START_ICECC_SCHEDULER="true".
  • Start icecc service: sudo /etc/init.d/icecc start, icecc-scheduler service also could be started with this. Not suggest to run multiple icecc-scheduler in same network with default values, you could edit /etc/icecc/icecc.conf with more options.
  • Stop icecc service(optional): sudo /etc/init.d/icecc stop

Mac OS X

  • Create a ‘qt’ user. Open System Preferences -> Users & Groups -> “+” under the list of users (you might need to click the lock icon first and type in your password), add a user “qt” with your standard password.
  • Install HomeBrew

  • Install XCode and command line tools.
  • Install icecc and icemon(optional).
  • Create compiler package: please do it. Here is the example for 10.8:

  • Enviroment settings before build: (Note: looks like it doesn’t work well with a compiler package. 2013-06-19)

  • Copy com.github.iceccd.plist into into /Library/LaunchDaemons .
  • sudo chown root /Library/LaunchDaemons/com.github.iceccd.plist
  • Start icecc service: sudo launchctl load /Library/LaunchDaemons/com.github.iceccd.plist
  • Stop icecc service(optional): sudo launchctl unload /Library/LaunchDaemons/com.github.iceccd.plist

Building Qt

Normally just do source ~/.icecc_rc, configure and make.

  • For clang build(both Linux and Mac OS X), please keep in mind to use -no-pch when configure.
  • For Qt4 build, the -arch argument that Qt 4 passes to the compiler confuses icecream. So for now, if you use Qt4, you need to patch your mkspec to not add that (if you build for your local architecture only), eg. in mkspecs/common/gcc-base-macx.conf.(Note: looks like it’s only on Mac OS X, I haven’t tried it yet.)

Known Issues

  • Using icecream currently screws up debug information for all object files that we compiled remotely!(Mac OS X only)

Thanks

Setup your own CommaFeed on OpenShift as Google Reader replacement

Yes, Google Reader will be dead soon, Google Blog: A second spring of cleaning.

I just read a few blogs which talked about the alternatives. Then just a few days ago, one of my friend told me there are inoreader and CommaFeed. And found this article, jasonwryan.com: Replacing Google Reader.

CommaFeed is an opensource solution(Note: it’s in maintenance when I started to write this blog), source code is on github.

Steps

Signup on OpenShift

Go to OpenShift, signup

Add JBoss 6.0 application

Go to OpenShift: Get Started, then click “WEB”, a bit down, clike “Open the Console and Create an Application”, in “Mangement Console” page, click “Create Application”, find “JBoss Enterprise Application Platform 6.0”, and install it, you need to set the “Public URL”, for example: http://mygooglereader-enjoylife.rhcloud.com , click “Create Application”.

You can add a public ssh key in next page.

(Note: I am not sure how much I will pay for that service based on “JBoss Enterprise Application Platform 6.0 is based on a premium cartridge. It costs an additional $0.03 per gear hour after the first 3 gears.”)

Install mysql 5.1

Back to OpenShift: Get Started, click “COMMAND LINE”, follow the steps in “Install the client tools on:”, for me, it’s “Mac OS X”. Then “Setup your enviroment”, command is “rhc setup”, there it will help you to create a ssh key and set up it. “rhc add-cartridge mysql-5.1 –app mygooglereader” will help you install mysql into the application. Please remember to keep the secret information like root username, password and etc.

Deploy CommaFeed to OpenShift

In OpenShift: My Applications/Mygooglereader, found the url of your git repo:

You need to make a local clone of CommaFeed and merge it with your openshift application, then push it:

If you find sth like following, then it works fine:

You can goto Your Own Google Reader, use the default user “admin” and password “admin” to login, change the password and create your own account.

Apply Goolge client ID and etc

Go to Google Code: API Console, create project, and click “API Access”, click “Create an OAuth 2.0 client ID…”. In the popup, input “Product name: mygooglereader”, “Home Page URL: http://mygooglereader-enjoylife.rhcloud.com”, click “Next” button, Then “Create client ID” button.

Then “Edit settings…”, in “Edit client settings” popup, “Authorized Redirect URIs” is “http://mygooglereader-enjoylife.rhcloud.com/google/import/callback”, “Authorized JavaScript Origins” is “http://mygooglereader-enjoylife.rhcloud.com”, click “Update” button. And found “Client ID” and “Client secret”.

Application settings in CommdFeed

Go to Your Own Google Reader, use “admin” to login. Then go to Settings page, set “Public URL” to “http://mygooglereader-enjoylife.rhcloud.com”, and also “Google client ID”, “Client secret”. Click “Save”.

Import your subscriptions from Google Reader

Go to Your Own Google Reader, use your own account, click the arrow button near the “Subscribe”, select “Import”. In “Import” popup, click “Google Reader”, then log in your google account, and wait about several minutes. All will be fine.

TODO

  • Update CommaFeed from upstream.
  • Backup mysql database.

Reference