an ongoing blog on the progress of getting to know new and emerging technology such as the pi, arduino, intel galileo, browser technology, multimedia, music, video/audio, streaming technology and the sorts
I am very excited to announce that one of @pinholevienna‘s photographs is going to be featured in this great project brought to life by ƒ/D: The ƒ/D Book of Pinhole featuring 99 pinhole photographs from around the world.
ƒ/D is a website dedicated to promoting the art of pinhole photography and was founded in February, 2015 by Kier & Libby Selinsky. It features technical and aesthetic how-to’s, artist interviews, artist features, and regular sharing of pinhole work to inspire photographers to use pinhole photography to open their creative potential.
The ƒ/D Book of Pinhole is a collection of pinhole photos from 99 photographers which was submitted in response to a Call for Entry in July and August of 2016. The photographs were selected and accepted based on their aesthetic quality, uniqueness of execution, appropriate use of pinhole and, in some cases, demonstration of persevering through the challenges of pinhole. In their entry, photographers also noted their response to the prompt “I saw through a pinhole” - quotes from these will be featured in the book.
In order to support the making of the book, it will be available for backing through January 1st, 2017 via Kickstarter.com: https://www.kickstarter.com/projects/537638366/the-f-d-book-of-pinhole. Be sure to check it out and pledge starting at $1.
It would be really cool if you’d support this awesome project. The book is available starting at $25.
You have a working installation of OpenACS running.
You installed packages such as XoTcl-Core and XoWiki successfully.
Now you’d like to extend on XoWiki with your own OpenACS application.
Here’s a short summary of what to do in order to get started building on XoWiki.
What I cover here:
(1) Creating a new package
(2) Setting up dependencies and provides
(3) The parameter page
(4) Prototype Pages
(5) Templates
All relevant files are also available via github at: https://github.com/michaelfeurstein/xowiki-sample-app.git
Step (1): Create a new package
Go to ACS Site-Wide Administration and it’s Package Manager. At the bottom you can Create a new package
Choose a short readable package key and name. Choose to inherit from templates in order extend on XoWiki. You specifically don’t want to implement subsite semantics (just on a sidenote). Everything else is up to you.
If everything went accordingly, you’ll get a screen listing all the details for your new package.
Next to other packages you will now have a dedicated package in your packages folder of your openacs distribution:
(2) Setup Dependencies and Provides
We want to extend on XoWiki, therefore we need to somehow specify that somewhere. On the summary page of your newly created package scroll down and click Dependencies and Provides
Click “Add a service extended by this package” and select XoWiki.
After setting up the extension you will now be able to build on XoWiki. What does this mean. Basically two things:
Reusability & Extendibility: By extending XoWiki you will benefit from all features already present within the XoWiki package, thus reusing XoWiki technology. On top of that you can extend functionality in order to customize your XoWiki based application or build new features which are not present in XoWiki.
(3) Parameter Page
When looking at the parameter page, you will now be able to use parameters based on the XoWiki application and you can define separate parameters for specifically for your package:
In order to setup custom parameters, go to ACS Site-Wide Administration / Package Manager and click on the name of your package (Xowiki Sample Application). There, you can click on Parameters under the Manage headline:
Simply click “Add new parameter” to specify details for your parameter.
This will result in an entry on the parameter page of XoWiki Sample Application
You can access this parameter via the XoWiki procedure called get_parameter
An example would be
set title [$package_id get_parameter PackageTitle [$package_id instance_name]]
(4) Prototype Pages
Read up on Prototype Pages in the official XoWiki Documentation
Create a prototype directory and index.page file in your XoWiki Sample Application folder (xowiki-sample-app/www/prototypes/index.page). It should contain the following basic setup to get started:
You basically define a starting point for your wiki. A simple index page. If you delete it, it will be created automatically from the prototype defined in your XoWiki Sample Application. The convenience here, is that you can define your own custom index page with your package - this might come in handy when deploying your application and providing a starting point. You can edit this page with your wiki and customize it to your likes.
(5) Templates
Templates are based on ACS-Templating. The documentation can be found here.
To get started simply copy the structure from your xowiki folder over to your xowiki-sample-app. You need a template folder located in resources: /xowiki-sample-app/resources/template. Now copy over view-default.adp from xowiki into your empty templates folder. In order to demonstrate functionality remove the title in the template and name the file view-example.adp
Note that I only changed things around at the adp placeholders. The top stuff concerns xowiki’s menu structure, which you can also customize in this case. For example to include or hide additional links for users.
Now all you need to do is specify that you are using view-example.adp as your template file in the parameter page of your sample application. (Default Setting: view-default)
When refreshing your index page from the sample application the title should be gone. (demonstration wise)
With this setup you can start designing your website based on XoWiki in a separate package (xowiki-sample-app).
If you need a fresh slate to work with you can also issue a pull request from this xowiki-sample-app via github after creating a new OpenACS application.
a short note on handling LaunchDaemons and LaunchAgents on your Mac environment.
What do they do:
It’s a service/program/script running in the background based on specific parameters it may restart automatically, do things on a regular basis or simply start and stop servers, databases and the likes.
Where are they:
/Library/LaunchDaemons
/Library/LaunchAgents
/Systems/Library/LaunchDaemons
/System/Library/LaunchAgents
What’s the difference:
A LaunchDaemon is run by the root user or the user specified in UserName.
A LaunchAgent is run by the currently logged in user.
System Integrity Protection:
With El Capitan, Apple introduced System Integrity Protection, as a security measure to protect files and folders on your Mac - specifically those in the root directory.
This means that when working with LaunchDaemons or LaunchAgents you will need to keep them under /Library/LaunchDaemons or /Library/LaunchAgents
Here’s a working example for a LaunchAgent I use to start NaviServer:
I use BibDesk to manage papers in BibTeX format for use with LaTeX.
Get to know LaTeX here and look into the BibTeX format explained.
What I like about it:
- Integrated browser enabling direct import of bibtex format
- Keyword and folder management
- Link the paper directly to your bibtex source
- Annotation capabilities
- Latex preview functionality
- Copy cite command into your latex document
Overview of your whole library. Including keywords, folders and paper link.
Edit each entry according to defined fields. The predefined formats are very useful. You can add fields, if needed, by right clicking inside the form.
How I currently use the Annote tab to summarise the most important points
Look up the paper and get the link to the direct BibTeX representation. BibDesk supports several formats from scientific websites. Depending on the format BibDesk can also extract bibliographic information from web pages.
With the copied link you can directly import the BibTeX format without manually adding specific fields or even creating the BibTeX entry. This is the most time saving feature.
The preview function.
Unfortunately it’s only available for Mac OS X 10.6 and above.
Michael Feurstein is not only a software developer, new media enthusiast and drum/saxophone player — he's also an avid pinholer! The Viennese multitasker started shooting pinhole when he got an ONDU camera for his 30th birthday and has now begun to rediscover his beautiful city through a pinhole photography project. Get to know more about his project and new-found passion for pinhole photography!
Part 4 - Setting up OpenACS with NaviServer on Mac OS
A Step by Step Guide to install OpenACS on MAC OS with NaviServer and get it up and running with PostgreSQL.
Part 1 - Getting Started: Installing NaviServer on MacOS
Part 2 - Configuring your NaviServer on Mac OS
Part 3 - A simple helloworld database interaction
Part 4 - Setting up OpenACS with NaviServer on MacOS
(0) If you don't have the script from part 1 - go grab it
Check that db_host db_port and db_user are set correctly
set address 0.0.0.0
(6) Start naviserver with the openacs config
As already shown in part 2 of this tutorial writing you will need to customize your openacs-5-8-config.tcl file in order to connect to the correct database. Note that the needed oacs-5-8 database was already created via the install script from above. So no need to create one manually.
You’ll find logs, and process ids in the log directory
(8) In my case I got an error
Error: Error parsing queryfile /var/www/oacs-5-8/packages/acs-tcl/lib/page-error.xql:
invalid command name "dom"
invalid command name "dom"
while executing
"dom parse -simple [lindex $args 1]"
(procedure "xml_parse" line 4)
invoked from within
"xml_parse -persist $stuff_to_parse"
(procedure "db_qd_internal_parse_init" line 4)
invoked from within
"db_qd_internal_parse_init $whole_file $file_tag"
(procedure "db_qd_internal_load_queries" line 15)
invoked from within
"db_qd_internal_load_queries $stream $file_path"
(procedure "db_qd_internal_load_cache" line 9)
invoked from within
"db_qd_internal_load_cache $file_path"
When further inspecting the error log one finds this:
error reading package index file /usr/local/ns/lib/tdom0.8.3/pkgIndex.tcl: expected version number but got "0.8.3"load"
Add a space after 0.8.3 so /usr/local/ns/lib/tdom0.8.3/pkgIndex.tcl looks like this:
Also note that now your error.log will include the following line:
Notice: Bootstrap: Done loading OpenACS
You now have a working installation of OpenACS with NaviServer and PostgreSQL installed.
Continue by installing Developer Support via the install interface from the repository. Start by going the package manager's installation page:
http://localhost:8000/acs-admin/install/
(11) Read up on the official documentation
You will probably want to start out with a simple package installation either as a front end application or a backend service.
The openACS documentation is pretty massive and in depth - so go ahead and dive in!
Introduction to packages in OpenACS: http://openacs.org/doc/packages.html
Package Development Tutorial: http://openacs.org/doc/tutorial-newpackage.html
Getting Started: http://openacs.org/storage/view/tutorial%5C/OpenACS_Tutorial.pdf
Introduction to the concept of ACS Objects: http://openacs.org/doc/objects.html
Enjoy!
Appendix A
You will probably want to have several instances of openacs around to test things or maybe have a development, staging, production workflow. In my case, I like to have a personal playground instance (sandbox?) and a development instance for each project to work on. When installing such an instance the following needs to be kept in mind:
1) Install a new instance via the install-oacs.sh script
sudo bash ./install-oacs.sh build
2) Move/Rename the fresh installation
sudo mv /var/www/openacs-5-9 /var/www/openacs-5-9-myProject
3) Move/Rename the openacs config file
sudo cp /usr/local/ns/conf/openacs-config.tcl /usr/local/ns/conf/openacs-myProject-config.tcl
4) Be sure to have the correct configuration
set port
set server
set db_name
5) Rename the fresh openacs database
ALTER DATABASE "oacs-5-9" RENAME TO "openacs-5-9-myProject-db";
A Step by Step Guide demonstrating basic usage of NaviServer and PostgreSQL in a helloWorld example.
Part 1 - Getting Started: Installing NaviServer on MacOS
Part 2 - Configuring your NaviServer on Mac OS
Part 3 - A simple helloworld database interaction
Part 4 - Setting up OpenACS with NaviServer on MacOS
Goal: Create a webpage, confirming NaviServer functionality and testing the database connection with NaviServer.
==================================================
Step (A) Getting to know adp
==================================================
The basic examples shown here work very well: http://naviserver.sourceforge.net/n/manual/files/adp-overview.html. I extend upon them.
Errata: user-agent needs cases and should read User-Agent in order to work
==================================================
Step (B) Create your own helloWorld.adp
==================================================
(1) Fill your database with dummy data
My database looks like this:
(2) Create your adp's
Create a folder named helloworld in the pages directory of your NaviServer installation:
mkdir /usr/local/ns/pages/helloworld
Create the adp named: db.adp
<html>
<head>
<title>DB Example</title>
</head>
<body>
<p>Select a db table from the default db pool:</p>
<form method="POST" action="db2.adp">
<select name="Table">
<%
set db [ns_db gethandle]
set sql "select * from cities"
set row [ns_db select $db $sql]
while {[ns_db getrow $db $row]} {
set table [ns_set get $row name]
ns_puts "<option value=\"$table\">$table"
}
%>
</select>
<input type="submit" value="Show Data">
</form>
</body>
</html>
Create a second adp named: db2.adp
<html>
<head>
<title>DB Example page 2</title>
</head>
<body>
<h1>DB Example page 2</h1>
<%
set table [ns_set get [ns_conn form] Table]
set db [ns_db gethandle]
%>
Weather data for <%= $table %>:
<table border="1">
<%
set row [ns_db select $db "select * from weather where city='$table'"]
set size [ns_set size $row]
while {[ns_db getrow $db $row]} {
ns_puts "<tr>"
for {set i 0} {$i < $size} {incr i} {
ns_puts "<td>[ns_set value $row $i]</td>"
}
ns_puts "</tr>"
}
%>
</table>
</body>
</html>
If you are having trouble connecting to the database be sure to check on your NaviServer config file and make sure that you have all sections and parameters setup correctly as shown in part 2 of this tutorial writing.
You can closely follow the database interaction in the error.log of your NaviServer installation.
db.adp should look something like this:
producing a valid database selection returning this:
You should now be familiar with the following:
(1) dynamic tcl scripting in an adp page with script <% %> inclusion
(2) form handling with adp form action
(3) simple database handling
All this in a simple naviserver installation and a postgresql database.
A Step by Step Guide to further setup your fresh NaviServer install.
Part 1 - Getting Started: Installing NaviServer on MacOS
Part 2 - Configuring your NaviServer on Mac OS
Part 3 - A simple helloworld database interaction
Part 4 - Setting up OpenACS with NaviServer on MacOS
What I will cover in this part:
(A) Configuring your LaunchDaemons to start and stop NaviServer and PostgreSQL
(B) Setup your new database environment
(C) Configuring NaviServer to work with PostgreSQL
==================================================
Step (A) Conf(ront)(igur)ing your LaunchDaemons
==================================================
Some general concerns on designing integrated high quality linux applications.
One could use daemontools. However I did not get it to work on my Mac environment so I chose to stick with what Apple suggests: LaunchDaemon. If you still prefer daemontools maybe this example writeup will help you get started.
(1) Read up on what a LaunchDaemon is
This tutorial on launchd http://launchd.info/ gives a nice overview. Over at openacs.org some NaviServer related example LaunchDaemons already exist. If you still need more information this post is quite informative. Last but not least you can always consult Apple's mega documentation if in doubt.
Label is the key to identify this LaunchDaemon = org.naviserver.yourname
ProgramArguments contains an array of strings with the actual command to start NaviServer. Note that you need to add each parameter and value separately. Also, pay attention to add the foreground flag in order for launchd to see the process (backgroundinfo: http://superuser.com/a/1112872/311059)
I also define a StandardOutPath and StandardErrorPath feeding into /var/log/naviserver.log in order to keep track of dubious Daemon messages.
(3) Work with launchctl to list, load/unload, start/stop NaviServer
Note the different input paramaters for load/unload and start/stop.
(8) Ensure that the var log is writable for the postgres user
This can be particularly frustrating as the LaunchDaemon will through the following error in /var/log/system.log: Service could not initialize: 15G31
For superuser access login with postgres user (note the hash on the prompt):
psql94 -U postgres testdb
Drop the database if you don’t want it anymore. with drodb.
==================================================
Step (C) Configuring NaviServer to work with PostgreSQL
==================================================
For a successful database connection ensure the following setup for your conf.tcl file:
set db_host localhost
set db_port "5432"
set db_user yourUsername
set db_name testdb
Part 1 - Getting Started: Installing NaviServer on MacOS
A Step by Step Guide for Mac OS X Yosemite
Part 1 - Getting Started: Installing NaviServer on MacOS
Part 2 - Configuring your NaviServer on Mac OS
Part 3 - A simple helloworld database interaction
Part 4 - Setting up OpenACS with NaviServer on MacOS
Ecosystem: this guide has been tested in the following environment
Vanilla Mac mini (Late 2012) upgraded install
Mac OS X 10.10.2 Yosemite
2,6 GHz Intel Core i7
8 GB 1600 MHz DDR3
250 GB Solid State SATA Drive
Using MacPorts for easy management of packages such as wget, postgresql
Note: the pid is written to /usr/local/ns/nsd.pid
Or simply use process status
ps -A | grep nsd
(14) check if the server is running
Navigate to localhost:8080
You should see the default welcome page for NaviServer
==================================================
Step (B) Installing nsstats and nsconf
==================================================
Do so by clicking the links on the index page of your naviserver installation.
You should get a response if the installation was successful.
If a blank page stares at you consult the error.log (/usr/local/ns/logs/)
In my case the error.log reported:
[12/Feb/2015:17:37:55][720.1053de000][-conn:default:1] Error: GET /bitbucket-install.tcl, PeerAddress: 137.208.114.129
couldn't execute "wget": no such file or directory
while executing
"exec wget --quiet --no-check-certificate -O /tmp/nsstats.tar.gz $source"
Hence i updated the bitbucket script with the exact location of wget:
/opt/local/bin/wget
Follow the instructions on setting a password in the nsconf.tcl file.
You now should see this:
==================================================
Step (C) Read up on NaviServer
==================================================
Getting to know Seeedstudio's PN532 NFC Shield
Datasheet
Schematic Sheet
I already ran the getting started tutorial one time. However I was not sure about which pins are really needed. So here you can see the NFC Shield connected with individual jumper wire cables.
The SPI interface / ICSP header is connected
GND GND and 5V
Pins 9 10 11 12 are connected
So how do you read that out of the datasheet:
Let's take a look at pin 12 for example (the orange one):
Arduino's reference states: Pin 12 is for MISO
The Schematic tells us: MISO is on pin 13 (they start to count from 1 thus you need to translate the 13 into 12)
Errata: Pin 13 also should have been connected for SCK. This is not the case in the pictures above.
Getting the Intel Galileo up and running is a bit more work than with the Raspberry Pi or Arduino.
Datasheet, I/O mapping and info on the board
Getting Started Guide (well documented official step by step guide)
Sparkfun Getting Started Guide (very good introduction)
You basically need to do the following depending on what you want to do:
Up and running and under control
(1) First of all: upgrade the firmware
(2) Get a 3,5mm Klinke (audio) to RS232 DB9 cable
(3) Connect it to the 3,5mm port on the Galileo board (this is no audio port it's a serial port) --> See Sparkfuns Serial Terminal Basics for help
(4) Get CoolTerm, select the serial port with baud rate 115200
(5) See what's happening when Galileo boots
(6) Login via serial terminal with user root and take a look at the on board flash-memory linux image...
Arduino IDE
(1) Download the Arduino Galileo IDE
(2) Write sketches and load them on the Galileo (blink etc.)
Install Linux on micro SD card and take off
(1) Get a microSD card not bigger than 32 GB
(2) Grab the official Intel micro SD card image
(3) Copy extracted files to the top level of your SD card
(4) Insert, boot and take a look around the bigger linux image...
Controlling the LED via command line
(1) Read up on Sergey's blog how to programm GPIO from linux
(2) Check the mapping of the pins
(3) Do the following: