2013/06/04

AskBot Configuration

Check Ubuntu Postgresql Manual first, which needs more care. For example, who and where (listen_addresses) can access the database.

marr@thrust:~$ sudo apt-get install postgresql-9.1 postgresql-server-dev-9.1 postgresql-client-9.1
marr@thrust:~$ sudo -u postgres createuser -D -A -P myuser
Enter password for new role:
Enter it again:
Shall the new role be allowed to create more new roles? (y/n)
marr@thrust:~$ sudo -u postgres createdb -O myuser mydb
marr@thrust:~$ sudo vi /etc/postgresql/9.1/main/pg_hba.conf

marr@thrust:~/$ sugo apt-get install python-virtualenv
marr@thrust:~/$ virtualenv myenv
marr@thrust:~/$ cd myenv
marr@thrust:~/myenv$ source bin/activate
(myenv)marr@thrust:~/myenv$ git clone git://github.com/ASKBOT/askbot-devel.git
(myenv)marr@thrust:~/myenv$ cd askbot-devel
(myenv)marr@thrust:~/myenv/askbot-devel$ python setup.py develop
(myenv)marr@thrust:~/myenv$ pip install psycopg2

$ askbot-setup

Deploying Askbot - Django Q&A forum application
Problems installing? -> please email admin@askbot.org

To CANCEL - hit Ctr-C at any time

Enter directory path (absolute or relative) to deploy
askbot. To choose current directory - enter "."
> /home/marr/askbot

Adding new directories:
/home/marr <-/askbot
Accept? (type yes/no)
> yes
Please do not name your entire Django project 'askbot',
because this name is already used by the askbot app itself

Please select database engine:
1 - for postgresql, 2 - for sqlite, 3 - for mysql, 4 - oracle (type 1/2/3/4)
Please enter database name (required)
Please enter database user (required)
Please enter database password (required)

Copying files:
* __init__.py
* manage.py
* urls.py
* django.wsgi
Creating settings file
settings file created

copying directories:  * doc
* cron
* upfiles

Done. Please find further instructions at http://askbot.org/doc/

$ python manage.py syncdb
WARNING!!! You are using a 'locmem' (local memory) caching backend,
which is OK for a low volume site running on a single-process server.
For a multi-process configuration it is neccessary to have a production
cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently
see outdated content on your site.

Please run command

    python manage.py collectstatic
current transaction is aborted, commands ignored until end of transaction block

Syncing...
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table south_migrationhistory
Creating table livesettings_setting
Creating table livesettings_longsetting
Creating table djkombu_queue
Creating table djkombu_message
Creating table followit_followuser

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no):

$ python manage.py syncdb
$ python manage.py migrate askbot
WARNING!!! You are using a 'locmem' (local memory) caching backend,
which is OK for a low volume site running on a single-process server.
For a multi-process configuration it is neccessary to have a production
cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently
see outdated content on your site.

Please run command

    python manage.py collectstatic

Map Warper Configuration

The challenge is from bringing together old Ubuntu 10.10 and Rails with Geo libraries, especially GDAL, mapscript and mapserver.

update /etc/apt/sources.list source URL to old-releases.ubuntu.com and add deb http://ppa.launchpad.net/ubuntugis/ppa/ubuntu maverick main deb-src http://ppa.launchpad.net/ubuntugis/ppa/ubuntu maverick main

At http://code.mapwarper.net/wiki/DevServerConfig you will see instructions to install postgresql-8.3-postgis, but at http://code.mapwarper.net/wiki/InstallationOne says to install postgresql-8.4

My installation is postgresql-8.4

What is /var/lib/maps for? It is easy to run `sudo chgrp -R maps /var/lib/maps`, but I don't know why `mkdir /var/lib/maps` needed.

for Apache, don't know if Passenger and XSendFile are essential.

for PostGIS, it says postgis user, that I think it is typo for postgres user.

Make sure ruby1.8-dev is installed, or you will run into error "mkmf Not Found".

svnadmin init /var/local/svn --> sudo svnadmin create /var/local/svn

added sderle to group svn. --> sudo usermod -aG svn gis

imported r30 from http://svn2.geothings.net/warper/ to /warper --> not yet and don't know how

For Postgresql 8.4, lwpostgis.sql and spatial_ref_sys.sql files are changing their paths.

psql -f ... lwpostgis.sql --> psql -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql template_gis

psql -f ... spatial_ref_sys.sql --> psql -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql template_gis

At InstallationOne, it says template_gis, but at InstallationTwo, it says template_postgis.

Refer to Ubuntu Postgresql Manual, createuser sderle --> createuser -D -A -P gis

sudo apt-get install libgdal1-dev --> this helps to solve gdal-config not found issue.

ERROR: permission denied for relation geometry_columns

Diazo: Bridging Designers and Programmers

很高興能在 PyConTW 2013 介紹 Diazo 工具,可惜準備時間不夠,沒辦法把 Diazo 多樣應用的可能性呈現出來,只能先簡介它的機制和概念。我在投影片裡整理的範例,主要是參考 David Bain文件,這也是既有文件中最詳實的內容。

有聽眾問到 Diazo 是否有支援 HTML5,網路上確實有範例,這些進階技巧,期待有機會試出來跟大家分享。

附上投稿時的文字:

Diazo is a smart approach to theming a website. Diazo does its magic by building on top of XSLT and provides a set of basic rules. Even better is that an easy-to-use in-browser rich editor is coming for designers. Most modern webservers supporting for XSLT transformations also ease the deployment. In this talk, we will learn and demo how Diazo is working.
In general, designers work with static HTML while programmers work on codes and frameworks. Often, they hardly collaborate without bumping into each other.
Diazo eases the process of theming a website, by isolating users from having to understand how developers build websites with frameworks. Diazo does its magic by building on top of XSLT. Raw XSLT is too complex for everyday use, so Diazo provides a simple and user-friendly set of basic rules that get compiled into XSLT behind the scenes. Even better is that an easy-to-use in-browser rich editor is coming for designers to create themes without needing filesystem access or knowledge of Python. Most modern webservers already support for XSLT transformations, so deploying Diazo via WSGI, Ngnix, Varnish or Apache is simple and straightforward.

2013/06/01

PyLadies Reviewed

PyLadies 是怎樣的團體呢? 透過學習和互助,像是提供專業能力和職涯成長的活動,它致力協助更多女生成為 Python 社群的一份子。Python 社群本身有個多樣化原則鼓勵各式各樣使用者,依照自己最感興趣、最適合的方式,成為 Python 社群的一份子。

在三月間,PyCon 2013 舉辦義賣活動獲得一萬美金的資助,用來協助更多女生進入 IT 圈,或是參與 open source 活動,初期的想法是贊助女生去參加 DjangoCon。

PyLadies 的成員散佈全球,目前已成立十餘個 chapter,有個 starting kit 說明成立 chapter 的注意事項:

Nashville PyLadies
NYC PyLadies
PyLadies Austin
PyLadies DC
PyLadiesLA
PyladiesIndia
PyLadies Montréal
PyLadies PDX
PyLadies SF
PyLadies Stockholm
PyLadies Vienna

參考 Plone 基金會的範本,PyLadies 也公佈自己的 Code of Conduct 公約,要求社群朋友共同維護平等友善的交流環境

已經舉辦過的活動,包括 hackathon, ladies' night, workshop 等,網路上找得到許多影片記錄,包括 Selena Deckelmann 在 OSDC 的演講

男生可以參加 PyLadies 活動嗎? 這點由活動主辦人決定,常見的方式是以女生優先為主,已參加的女生可帶一個男生到場。如果 PyLadies 活動和 User Group 合辦,就更容易達到性別中立的效果。不管男生是否能夠到場,早點明確宣佈原則,對大家都有好處。

2013/05/30

Python For 3D Artists

你對 3D 動畫及程式開發感興趣嗎?CodeAcademy 原本就有許多 Python 課程,現在多了 3D 動畫研究群組,讓學員利用 Python 工具來進行設計創作。

首先,要在 CodeAcademy 完成註冊,或是使用 gmail 之類的帳號登入,沒多久,應該會看到 CodeAcademy 寄信來提示如何進行下一步,並提醒你可以去做習題。

如果你想找 3D 動畫研究群組,要從 Edit Account Settings 的 Settings 點選 Become a Beta Tester 後,再直接到 http://www.codecademy.com/groups/python-for-3d-artists 這個網址。

2013/05/28

PyLadies Taiwan Bootstrapping

So many awesome things happen in the PyCon Taiwan 2013. One of my favorites is the discussion to build a PyLadies chapter. On Apr 29, I talk to imacat about Selena Deckelmann's OSDC speech, and ask if anyone is interested to make PyLadies Taiwan real. Finally we decide in the PyCon lightning talk session, announcing a PyLadies BoF, to call for participation. Things go well and there are 10+ ladies sign up for further discussion.

Photos by toomore

There's already a dedicated group for female engineers in Taiwan -- WoFOSS. Surely the PyLadies core team needs to figure out their vision and goals. With confidence, I see the picture becoming clear.

The following is the quote from the initial email:

對於 PyLadies,我至少有兩個初衷,一是女生朋友在資訊領域,本來就該有一半的發言權或影響力,二是 Python 能有效促成前面命題的落實。 軟體資訊包含了數理、心理、藝術等不同領域面向,理應適合女生朋友投入發展,但不平衡的現況,代表有些社會因素,壓抑了這個發展。 Python 鼓勵 diversity,拿掉不必要的門檻,是個值得長期投入的培力工具和環境。
我是男生,只會協助起個頭,不會限制 PyLadies 在台灣的發展方式,但,總期待有人願意來主導 PyLadies 的成長。

2013/05/27

Quotes of The Day

  • 一杯清水因滴入一滴污水而變污濁,一杯污水卻不會因一滴清水的存在而變清澈。
  • 這世上有三樣東西是別人搶不走的:一是吃進胃裡的食物,二是藏在心中的夢想,三是讀進大腦的書。
  • 馬在鬆軟的土地上易失蹄,人在甜言蜜語中易摔跤。
  • 世界沒有悲劇和喜劇之分,如果你能從悲劇中走出來,那就是喜劇,如果你沉緬於喜劇之中,那它就是悲劇。
  • 如果不讀書,行萬里路也不過是個郵差。
  • 當你的鄰居在深夜兩點彈鋼琴時你別氣惱,你可以在四點鐘時叫醒他,並告訴他你很欣賞他的演奏。
  • 如果你只是等待,發生的事情只會是你變老了。
  • 真正的朋友不是在一起有聊不完的話,而是即使不說一句話也不覺得尷尬。
  • 時間是治療心靈創傷的大師,但絕不是解決問題的高手。
  • 寧願做過了後悔,也不要錯過了後悔。