massive update after winter break

thumb
km0 1 year ago
parent e4fe6fb71c
commit 91fd0df062

@ -0,0 +1,81 @@
---
categories:
- Print
- Book
- Press
cover: office.jpg
cover_alt: office is open
date: 14/11/2022
description: Printing good books with nice covers
git: https://git.xpub.nl/kamo/birds-press
slug: birds-press
title: Birds Press
---
Repo for custom books' cover with good looking animals (the more they fly the better).
To add a cover just drop the file in the `covers` folder.
Convention for the filename is:
```
number_title-of-the-book_author-name
```
ex.
```
02_Shaping-Things_Bruce-Sterling.png
```
TODO: pic of printed books. For now here are the covers.
### 01. The Interfact - On Structure and Compatibility in Object Oriented Ontology - Gabriel Yoran
![The interfact cover](https://git.xpub.nl/kamo/birds-press/raw/branch/main/covers/01_The-Interfact_Gabriel-Yoran.png)
This is a book about Object oriented ontology (🙁) and the bird is a Tawny Frogmouth, the same as the Birds Press office plaque. So disappointed about this project. Super good in mimetizing.
### 02. Shaping Things - Bruce Sterling
![A cute octopus in a Piccola Biblioteca Einaudi design](https://git.xpub.nl/kamo/birds-press/raw/branch/main/covers/02_Shaping-Things_Bruce-Sterling.png)
There is this channel on Youtube about deep ocean explorations that is amazing. I found myself often thinking that I could try to apply for a position to develop the kind of software that let you see some animals a in the Mariana trench? But eh.
Btw this is the channel! [EVNautilus](https://www.youtube.com/@EVNautilus)
### 03. Literate Programming - Donald Knuth
![Again the Piccola Biblioteca Einaudi, but with corals this time](https://git.xpub.nl/kamo/birds-press/raw/branch/main/covers/03_Literate-Programming_Donald-Knuth.png)
See 02 for more infooooooo. Living beings are amazing aha!
### 04. Introduction to uxn programming - Sejo vga - Foreword by Devine lu linvega
![A really stretched type + a bunch of paradise birds. I love this cover even though you cannot read anything](https://git.xpub.nl/kamo/birds-press/raw/branch/main/covers/04_Introduction-to-uxn-programming_sejo-vga.jpg)
Birds of Paradise outfit is crazy. Bought this book from the amazing [sejo vga / compudanzas](https://compudanzas.net/) after a month of binge watching every possible content made by the [hundred rabbits collective](https://100r.co).
See this page about [uxn](https://wiki.xxiivv.com/site/uxn.html) for more info!
### 05. Franklin ACE 100 Operator Manual
![A splendid kookaburra, to be printed on transparent paper](https://git.xpub.nl/kamo/birds-press/raw/branch/main/covers/05_Franklin-ACE-100-Operators-reference-manual.jpg)
On monday three things hapened: we lived in this wolves meme where we were the assessor and the assessed at the same time, Jian sent me [this reference](https://ironicsans.substack.com/p/the-strangest-computer-manual-ever), and I found out that I can print on transparent paper in studio.
This is the result! The bird is a kookaburra! It's an amazing bird, with a really distinctive cry that seems a ccreepyy laugh.
### 06. Computer Power and Human Reason - Joseph Weizenbaum
![It's the shoebill on transparent paper, again](https://git.xpub.nl/kamo/birds-press/raw/branch/main/covers/06_Computer-Power-and-Human-Reason_Joseph-Weizenbaum.png)
This is my favourite bill at the moment. Joseph lent me this book that he bought for 2 euros or something like that. I can see why, since the sleeve was totally destroied.
This is a restoration / remake / spinoff with some fake news about the hornitological preferences of Joseph Weizenbaum. ah ah
Marrs
### 07. The Lore Zone - Tiger Dingsun and Libby Marrs
WIP Wip wip this will be a scroll since i found out that there is no limit to the lenght of sheet in the multi-purpose tray of the printer 📜

@ -0,0 +1,28 @@
---
categories:
- CMS
- Docs
- Markup
cover: fire.jpg
cover_alt: computer is burning but is ok
date: 13/12/2022
description: Flat markup documentation framework (hot)
git: https://git.xpub.nl/kamo/bonfire
slug: bonfire
title: bonfire
url: https://hub.xpub.nl/soupboat/bonfire/
---
A small framework to document project on the soupboat using a shared flat markup list as source. Meant to be edited by users of the soupboat to document their things.
It's a single file CMS. The syntax of this file is really minimal, and it works together with the linear nature of the list to organize the contents. There are just a couple of level of hierarchy, hence the idea of flat structure.
```
(title)
[section]
--> Notes
>>comment (TBD)
Normal text
```
Find it live on the [here](https://hub.xpub.nl/soupboat/bonfire/)

@ -0,0 +1,216 @@
---
categories:
- Web
- Prototype
cover: pidgeon.jpg
cover_alt: drawing a pidgeon
date: 22/12/2022
description: Multiplayer drawing via websocket
git: https://git.xpub.nl/kamo/drw
slug: drw
title: drw
url: https://hub.xpub.nl/soupboat/drw/
---
A small app for collecting drawings in real time. Runs on a small express server that connects sources (where to draw) and destinations (where to display) via websockets.
## Setup
Clone the repo , move to the directory and install the dependencies using your favourite package manager ([npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/), etc.).
Note that to run the app you will need to install [Node.js](https://nodejs.org/en/), either on your machine or on a VPS.
For example with npm:
```
git clone https://git.xpub.nl/kamo/drw
cd drw
npm install
```
To start the application run
`node server.js`
or in alternative
`npm start`
Then open your browser to `localhost:3000` and there you can draw.
If you open another tab and navigate to `localhost:3000/destination`, there you will receive the drawings.
This destination page is just an example! The app is meant to be open-end, meaning that the destination of the drawing is up to you! (ah ah! less work for us). Originally it was coupled with [vvvv](https://visualprogramming.net/), but it can be implemented with any platform supporting the websocket protocol (the browser, pure data, max, touch designer, p5js, etc).
## How does it work
![A websocket connection is like ping pong](https://git.xpub.nl/kamo/drw/media/branch/main/img/pingpong.jpg)
This app works like the game of ping pong. Two (or more) atlethic players connect to a server to exchange messages through the fast ball of [Websocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API).
There are four main elements in this app:
**Source**
A source is a client that connects to the application in order to send drawings.
To connect as a source simply connect to the server.
This is what happens when you visit the [drawing page](https://hub.xpub.nl/soupboat/drw/).
For an example, look at the script section in the `views/index.html` file in the folder.
**Destination**
A destination is a client that connects to the application in order to receive drawings.
To connect as a destination, greet the server with an hello message:
`{"type": "hello"}`
This is what happens when you visit the [destination page](https://hub.xpub.nl/soupboat/drw/destination). For an example of the code, look at the script section in the `view/destination.html` section. Right after opening the websocket connection, the script will send a greeting to the server.
**Websocket Messages**
Websockets are a type of connection especially suited to real time application.
Here they are small `JSON` messages of different types. Imagine it as small Javascript objects or Python dictionaries
```
{
"type": "test",
"data": "hello this is a test message!"
}
```
Here they always come with a `type` property, that is used in both server and clients to trigger specific functions depending on it.
At the moment the app logic is built on these messages:
- **hello**
register the client as a destination
_example:_
`{"type": "hello"}`
- **drawings**
message that contains [SVG path](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) of a drawing
_example:_
`{"type": "drawings", "paths": "M 10 10 H 90 V 90 H 10 L 10 10"}`
maybe should be renamed just drawing
- **theme**
message that suggests to the player a theme to draw about
_example:_
`{"type": "theme", "theme": "animals"}`
**Server**
The server is the table that grants to the connected clients to exchange messages. It mainly takes care of keeping track of who is connected, and to send the right message to the right client. For an insight of how does it work look at the comments in the `server.js` file!
## Going online
Eventually you want to put online your drawing app.
To be able to use this app on the [Soupboat](hub.xpub.nl/soupboat) (or other servers connected in the [hub.xpub.nl](hub.xpub.nl) ecosystem) some additional configurations are needed.
Note that the following details are tailored to the particular case of our server. Other instances could require different setups.
This is one possible workflow.
Clone the repo and install the requirements as you would do locally.
```
git clone https://git.xpub.nl/kamo/drw
cd drw
npm install
```
### Environmental variables
There are a couple of environmental variables to set: one refers to the port where to mount the application, the other is related to the prefix to add to the application urls.
```
nano .env
```
Will create a new `.env` file where to add the values for this specific environment.
In the case of the soupboat, for example:
```
PORT=3000
PREFIX=/soupboat/drw/
```
Save and exit.
The port is where Express will mount the application. This is by default set to 3000, but in this case we need to pick a port not already in use.
When deciding which port to use, check your NGINX configurations file (see next section), or simply test if the port you want is already in use.
`sudo lsof -i:3000`
For example, will print the process currently using the port 3000. If nothing is printed out, then the port is available.
Read more about it here: [Check if port is in use Linux](https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/)
The prefix variable is a way to deal with the _hub.xpub.nl_ ecosystem. Here our base url is `hub.xpub.nl`. Notice that is missing the `/soupboat/drw/` part.
The deal of the prefix is to leave out from the code these parts of the address, that otherwise should be repeated in every url and navigation element of the app.
This also make the code a bit more portable, meaning that you can test it locally and online without messing around with the urls in the code.
The app is written in order to provide some default values if an `.env` file is not found, and that's why it works locally even without specifying any environmental variables.
### NGINX Configuration
To make it works behind a reverse-proxy open the NGINX configuration file
```
sudo nano /etc/nginx/sites-available/default
```
and inside the server section add a new location:
```
server {
#note that your configurations may differ!
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html
# ADD FROM HERE
location /drw/ {
proxy_pass http://localhost:3000/soupboat/drw/;
include proxy_params;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# TO HERE
}
```
The lines that you should edit according your configurations are:
- `location /drw/`
The name of the location _/drw/_ is up to you, and it's the address where the app will be served. In this case will be _hub.xpub.nl/soupboat/drw/_.
- `proxy_pass http://localhost:3000/soupboat/drw/;`
The very same name, as well as eventual prefixes, need to be specified in the line of _proxy pass_.
The port, in this example set to _3000_, it's the port where Express is mounting the application. By default is 3000, but you can edit it according to the configurations of the express server.
The three `proxy_set_header` Host, Upgrade and Connection are necessary to make the Websocket connection work.
Once you add these info save and exit.
To check that the NGINX configuration file is ok run
`sudo nginx -t`
If it prints that everything is fine, reload nginx to apply the configurations.
If there are errors instead reopen the configurations file and fix them!
**Watch out**: reloading nginx when the configurations are broken means disaster. Always run the test before reloading!
Then you can start the app as you would do locally.
`node server.js`

@ -0,0 +1,46 @@
---
categories:
- Workshop
- Docs
cover: reasonable-animals.jpg
cover_alt: olifanten and dolphin agree on something
date: 12/02/2023
description: Gardening for code
git: https://git.xpub.nl/kamo/dyc
slug: dyc
title: Documentation sessions
---
_Documentation sessions to take care of code_
## What could it be
Periodical sessions where to document code.
Once a week, a couple of hours, on a regular basis.
Soft facilitation:
- not meant to be frontal moments, but more a shared space
- small zines to share things about documentation practices (readings, frameworks, prompts)
- p2p feedback and help
- coffee snacks music
- stickers with animals that says document your code (wip)
- share progress like brief debrief ?
## For who?
For people that tinker with code. Both novice and navigated ones. For documenting small ongoing prototypes or more structured projects. For xpub2, xpub1, lens based, even bachelor students? Something open.
## How to do
- Decide when and where and communicate it
- Could be useful to have some examples
- Nice also to have some prompts
## Where ? ? ?
- March 23rd at varia
- Could ask v2 if it's somethig they are interested in
- School

@ -0,0 +1,31 @@
---
categories:
- PDF
- Python
cover: zac.jpg
cover_alt: splitting shaping things, by bruce sterling
date: 16/11/2022
description: Split double-paged DPF
git: https://git.xpub.nl/kamo/pdf-zac
slug: pdf-zac
title: PDF ZAC
---
There is this book i want to print (see [Birds press](https://hub.xpub.nl/soupboat/~kamo/projects/birds-press/), but the pages are already coupled 2 by 2 and so the booklet printing doesn't work.
This script uses [pypdf2](https://pypdf2.readthedocs.io/en/latest/user/cropping-and-transforming.html) to crop and transform the a4 horizontal pages of the pdf into 2 a5 vertical ones.
Good way to procrastinate eh
## Usage
First install the requirements (actually just PyPDF2)
`pip install -r requirements.txt`
The script takes a `input.pdf` and gives out a `output.pdf`.
Then run the code.
`python3 zac.py`

@ -0,0 +1,60 @@
---
categories:
- Python
- Sound
cover: seq.jpg
cover_alt: graphic made with spreadsheet
date: 26/12/2022
description: Open ended CSV sequencer
git: https://git.xpub.nl/kamo/seq
slug: seq
title: seq
---
An open ended CSV sequencer. It only takes care of looping through a .csv file, row by row, and send the contents of each one to a client with OSC.
In this way all the command logic is up to the user, and the sequencer can be prototyped on the go.
There is no restriction in the number or lenght of columns.
Tested with a VVVV client with different modes:
- frequency
`440`
enter the frequency for a basic oscillator
- frequency + waveform
`s400`, `t600`, `n700`
first character is the waveform (sine, tri, noise, pulse), the rest is the frequency
- midi
`m064`, `m148`
m stands for midi, first digit is the midi channel, the rest is the note
![](2022-12-26-16-26-40.png)
## Install
To install create a virtual environemnt and then install the requirements from the `requirements.txt` file.
`python3 -m venv venv`
`source venv/bin/activate`
`pip install -r requirements.txt`
## Run
To run the sequencer run
`python seq.py`
It will read the contents of the `seq.csv` file and forward them on a OSC client running on the local ip `127.0.0.1`, on the port `1337`
Note that you can edit live the `seq.csv` file with a software like LibreOffice Calc, or directly as a text file.
ATM the main loop of the sequencer reload the file at every step. Not really efficient! But for small files should not be a problem.
## Next steps
- Use env files to set ports and osc address
- bpm as command line arguments
Loading…
Cancel
Save