About

mFabrik Blog is about mobile and web software development, open source and Linux. We tell exciting tales where business, technology, web and mobile convergence.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.

Sauna Sprint daily digest #2: Tuesday

Plone is a byproduct of community members' co-operation

These are notes from the Sauna Sprint daily debriefing #2. It was intention we’d done this already yesterday, but unfortunately we had problems with boat and swamp.

The current head count is around 27 living souls, plus or minus few depending on how you define living. We split to different teams, each working on its own topic.

Team tutorial video

This team works to create new Plone video installation and usage tutorials. It will be in the form of screencast with voice over narration.

The team has created the first voice over, screencast and now editing it together.

Team add-ons fail

Plone add-ons come with various quality of instructions. This team is working to make Plone add-on experience more user-friendly: installing, uninstalling, plone.org add-on area, individual add-on instructions.

Around 200 lines of issues collected.

Team blogging

This team collects and publishes a blog posts, participant information, etc. motivational information about the sprint and the sprinters.

Both EESTECers and Plonistans are being covered.

Currently the team has collected the bio of everyone and prepares to put the information out to a wiki page.

Team auto restart

This team is working to make Plone auto-restart perform correctly and timely manner. You just edit .py file and hit the browser refresh button and the changed code is loaded correctly. The team is utilizing the fork trick introduced in this blog post. The resulting work goes under a project name sauna.relaod.

Currently the team has managed to make the file-system monitor using Python WatchDog backend. Already 13 seconds have been shoveled off from Zope restart time of 30 seconds.

Team Logistics

This team feeds the coders with firewood, food and beer.

Yesterday the team prepared went to a shop, prepared a lunch and brought a guitar (for live music).

The day plan for Wednesday is to collect blueberries for pies and mushrooms and later cook them in the big oven of the cabin.

The new beer is on its way, though has temporary taken some steps backwards.

Team Greek

This ad-hoc team prepared the dinner.

It takes four Greeks to create one omelette.

Team collective.table

This is Google Summer of Code team is working on new collective.table add-on for Plone. Yesterday was API talk, but the progress was slow due to lack of caffeine.

Team TinyMCE

This is a Google Summer of Code team and is working on making Plone’s TinyMCE experience better.

Yesterday was spent testing on a JS/CSS compressor to make TinyMCE load faster.

Uncompressed: 19 request / 900 kb. Compressed 50% less requests, 700 kb.

Team hardcore

This team of EESTEC member was formed to introduce hardcode Plone development for newbies.

The team members actually wanted it themselves. They will regret this decision later.

Sometimes you need solo heroes

 

Plone butterfly preparing to hatch

A lonely coder in the forest

Fueling the hungty developers with potatoes

A statue honoring Plone developers

Get developers  Subscribe mFabrik blog in a reader Follow me on Twitter

Copy/move phpBB3 forum from a server to another computer (Ubuntu/Linux)

Here are short instructions what you need to do in order to move / copy phpBB3 forum.

Prerequisites

What you need in order to benefit from these instructions

  • Basic UNIX command-line knowledge
  • SSH access to the server
  • MySQL access to the database
  • LAMP stack ready on the new server

These instructions have been tested on Ubuntu/Debian/Linux but they should work in other environments too.

Write down database access information

Get password from config.php file on the old server:

cd /var/www/phpBB3
cat config.php

Write down database name, username and password.

Copy files

Use rsync to remotely copy forum files to a new computer. On new computer, in /var/www folder

rsync -av --compress-level=9 user@oldserver.com:/var/www/phpBB3 .

Dump and copy database

Execute the following command on the new server. It takes SSH connection to the old server and dumps phpBB3 database to the new server over the SSH connection.

ssh user@oldserver.com -C -o CompressionLevel=9 mysqldump -u databaseuser --password=databasepassword --skip-lock-tables --add-drop-table databasename > phpbb3.sql

Create a new database

Use the old access information from config.php to create a database with identical access information on the new server. You need a MySQL root access to create new databases.

mysql -uroot -p

Create database and grant access to phpBB3 user for it.

mysql> create database databasename;
mysql> GRANT ALL ON databasename.* TO 'databaseuser'@'localhost' identified by 'databasepassword';

Load the database on the new server from the dump file:

mysql> connect databasename;
mysql> source phpbb3.sql

Configure Apache virtualhost for the new server

The last step is to set-up Apache virtual host on the new server, so you can access the phpBB3 using a domain name. Note that this doesn’t need to be a real domain name, but you can spoof the domain name using /etc/hosts file on your local workstation.

Add file /etc/apache2/sites-enabled/phpbb3.conf (or pick a filename based on forum name if you host multiple forums)

<VirtualHost *>
 ServerName yourdomainname.com

 DocumentRoot /var/www/phpBB3
 <Directory />
   Options FollowSymLinks
   AllowOverride None
 </Directory>

</VirtualHost>

Note that <virtualhost *> may change depending on how Apache has been set up to listen IP addresses and ports. Also if you are using a shared hosting package or VPS you might need to use the server control panel (cPanel) to do this step.

Then check if your new config file is ok and restart Apache:

apache2ctl configtest
apache2ctl graceful

Hosts spoofing trick

If you are not having a DNS server of your own which you can use for the copy you can always use /etc/hosts file trick to spoof domain names. This way you can make Apache to serve the forum from the server even if the forum is not connected to any real domain name yet.

 

 

 

 

 

Get developers  Subscribe mFabrik blog in a reader Follow me on Twitter

Apple push notifications (APN) with Python

We have created a middleware service which inputs RSS feeds and outputs Apple Push Notification. This allows integrate push notification support for your existing content management system easily. This blog post should give you some ideas if you are planning to create similar services.

To have the über-experience of customer engagement with mobile push notifications you need

  • A mobile application (iOS, Android 2.2)
  • RSS feed to notifications middleware server (our solution)
  • RSS feeds themselves
  • Windows/UNIX server running the middleware

How it is put together

Tornado web server is used to handle incoming HTTP requests in scalable manner.

feedparser library fetches RSS feeds and processes them to client notifications.

BitReader (post, source) library is used to create messages to interact with Apple push notification service (APNs). The protocol is bit based protocol running directly over TCP/IP. Apple service has been designed to handle high volumes of traffic – it does not use anything like stateless HTTP to waste bandwidth.

Django models are used to store the state of each individual subscriber. Django’s ORM abstraction allows us to use the same middleware for small distributions (< 1000 clients, SQLite database) or big ones (millions of clients, MySQL database). The stored state information includes the subscriber id and the current badge number – the red circle on the app icon showing the count unread posts. When the application is launched, it can decrease its badge number by doing a HTTP call to the server.

Django settings are used to put together required certificates and whether the application is run in sandbox mode.

Walkthrough

There is a core IO loop, running in a separate process, called stream observer. This loops updates fetches RSS feeds’ status and passes updates to Tornado server over HTTP.  With this arrangement, any HTTP capable client can send push notifications.

Tornado handles incoming updates, updates the related subscribe status – how many unread notifications, etc. through exposed Django views. The notification is formatted according to the variables available on the subscriber mobile platform. In Apple’s case, the notification message gets title, badge, sound and a launch image. Payload is checked against hard 256 byte limit.

Then the payload is pushed to Apple servers over TCP/IP protocol. SSL certificaties needed.

A subscriber is registered  when the mobile application is launched. The application asks a subscriber id from Apple servers. Then, this subscriber id is delivered to our middleware over normal HTTP call.

The middleware also handles feedback service which gives you list of devices which have unsubscribed from your service. This way you can cut off notifications from unsubscribed clients. This is also done using BitReader and TCP/IP.

Future

The architecture is built so that different push backends can be included in the service. Android support is on the roadmap and we probably will have Blackberry and Meego support (when/if Nokia announces such a service).

We have currently tested this solution with RSS streams from WordPress and Plone.

We may release source code when it’s ready.

More info

Get developers  Subscribe mFabrik blog in a reader Follow me on Twitter