From: Gabriel Dunne Date: Sat, 17 Jun 2023 17:56:20 +0000 (-0700) Subject: Update posts X-Git-Url: https://git.quilime.com/?a=commitdiff_plain;h=b36b85f112d498bbf50f7eb49aeb0eace1feaeba;p=quilime.com.git Update posts --- diff --git a/_posts/cmd/2020-12-06-dotfiles.md b/_posts/cmd/2020-12-06-dotfiles.md new file mode 100644 index 0000000..7fb432f --- /dev/null +++ b/_posts/cmd/2020-12-06-dotfiles.md @@ -0,0 +1,9 @@ +--- +title: dotfiles +date: 2020-12-06 +categories: cli +--- + +Dotfiles setup for multi-os setups ('nix, Mac OS) + +[Source on Github](https://github.com/quilime/cfg) diff --git a/_posts/code/2011-06-28-filebrowser.md b/_posts/code/2011-06-28-filebrowser.md index 265c544..c4df469 100644 --- a/_posts/code/2011-06-28-filebrowser.md +++ b/_posts/code/2011-06-28-filebrowser.md @@ -9,6 +9,10 @@ These scripts offer some handy features for browsing files/folders on a webserve [Source](https://github.com/quilime/filebrowser) on GitHub. + + + + ## DirectoryLister A fancy index script for browsing folders. @@ -33,7 +37,7 @@ Options: - Natural sort file tree (ignore case) - File and Folder Excludes - + ## MediaBrowser diff --git a/_posts/code/2014-08-03-mesh-mapping.md b/_posts/code/2014-08-03-mesh-mapping.md new file mode 100644 index 0000000..5f199ac --- /dev/null +++ b/_posts/code/2014-08-03-mesh-mapping.md @@ -0,0 +1,47 @@ +--- +date: 2014-08-03 +title: Simple Projection Mapper +categories: code +--- + +![https://www.flickr.com/photos/quilime/14605757439/](https://farm3.staticflickr.com/2909/14605757439_21366782a6_z.jpg) + +Mapped Geometry IRL + +A simple mesh-based projection-mapping tool with basic vertex editor written with openFrameworks. + +Tested on OSX and Raspbian/Raspberry-Pi. + + + +## Features + +- Single-Vertex Mesh Editor +- Camera Position Editor +- PLY Mesh Object Import +- Save/Load scenes and camera settings + +## Dependencies + +- [openFrameworks](http://www.openframeworks.cc/) +- [ofxAddons](http://ofxaddons.com/) + - [ofxCameraSaveLoad](https://github.com/roymacdonald/ofxCameraSaveLoad) + +## Screenshots and Photos + +![https://www.flickr.com/photos/quilime/14605757439/](https://farm3.staticflickr.com/2909/14605757439_21366782a6_z.jpg) +Mapped Geometry IRL + +![https://www.flickr.com/photos/quilime/14799022016/](https://farm4.staticflickr.com/3864/14799022016_022ede88fc_c.jpg) +Mesh Editor View + +Copyright (c) 2014- Gabriel Dunne, All rights reserved + +- [www](http://gabrieldunne.com) +- [blog](http://quilime.com) +- [github](http://github.com/quilime) +- [twitter](http://twitter.com/quilime) + +# Software License + +See LICENSE file. diff --git a/_posts/code/2016-12-21-organelle-monome.md b/_posts/code/2016-12-21-organelle-monome.md new file mode 100644 index 0000000..f6b472d --- /dev/null +++ b/_posts/code/2016-12-21-organelle-monome.md @@ -0,0 +1,81 @@ +--- +title: Organelle + Monome +date: 2014-04-27 +category: code +--- + +Using Critter + Guitari Organelle as a host for a Monome 128. I built a patch that uses the Organelle's keys to program the arpeggiator tones, and the Monome defines the steps. Includes OSC Installer and all patches needed to build upon this foundation for other patches. + +source on [github](https://github.com/quilime/node-one-time-password-auth) + +and Patchstorage [[1]](https://patchstorage.com/monome-grid-seq/), [[2]](https://patchstorage.com/monome-grid-apps-serialosc-installer/) + +![](http://media.quilime.com/files-bak/img/organelle-monome.png) + + + +In this video, the Moog Minitaur is triggered via MIDI, and its audio is routed through the delay effect on the Organelle in tandem with a simply polyphonic voice in the patch. The sequencer supports 5 note polyphony. However I’ve been using this patch with a Moog Minitaur, which is monophonic. + + + +Triggering a the Moog Minitaur again via MIDI. The sequencer patch is using an audio sample-based clock, I stress-test it towards the end. + + + +## Hardware + + - Critter + Gutari Organelle + - Monome 128 Grid Grayscale (non varibright). Other Monome Grids should work. + + Optional + + - Powered USB Hub + +## Patches + +### SerialOSC-Install + +This patch installs `serialosc` on the Organelle. + +### Monome Basic Poly + +Indiviual Monome Keys illuminate when pressed and trigger the Basic Poly voice patch that shipped with the Organelle. + +### Grid Apps + +Various Grid apps examples ported to PureData from Aleph via https://github.com/boqs/pd-grid, including + + - grid + - kria + - meadowphysics + - step + - whitewhale + +Note: These apps do not make sound. They are intended to be used as an example and starting point for new patches. + +## How to Use + + 1. Copy the example patches to your Organelle's USB drive or SD card. + + 2. Plug in the Monome. Note: In my testing, the Organelle's USB port doesn't supply enough power for a Monome 128 Grid to light all its LED's, so a powered USB hub was required. + +## Installation + +Run *SerialOSC-Installer* first. This patch installs the serialosc binaries and libmonome shared libraries to the Organelle's OS. It also adds serialosc as a daemon that runs at startup. + + 1. Plug in the Monome Grid via USB + 2. Press AUX to start installation + +Upon a successful installation, the display should notify you if it is connected and active and the Grid's light should illuminate. Pressing a key will light it up. + +If you are not compiling the extensions yourself, you only need the compiled extensions and the pd files to run the patches. + + +## Uninstall + +Via the terminal, navigate to the SerialOSC-Installer folder and run + + ./uninstall.sh + +Then, delete all patches from your Organelle. + diff --git a/_posts/code/2020-07-21-node-one-time-pw.md b/_posts/code/2020-07-21-node-one-time-pw.md new file mode 100644 index 0000000..6173af6 --- /dev/null +++ b/_posts/code/2020-07-21-node-one-time-pw.md @@ -0,0 +1,85 @@ +--- +title: NodeJS One-Time Password Auth +date: 2014-04-27 +category: code +--- + +source on [github](https://github.com/quilime/node-one-time-password-auth) + +One-Time (Single Use) Password Authentication Strategy using a JSON Web Token (JWT) and Cookies. + + + +## Using + +- Node +- Express +- JSON Web Tokens (JWTs) +- Sequelize (Mysql or Postgres) +- Passport +- Nodemailer (Using a SMTP Server) + + +## What is this? + +This boilerplate code is a web app auth strategy that generates a one-time-use password that is emailed to a user. Upon login, the password is discarded and all further auth is done with a JSON Web Token (JWT) stored in a cookie on the client. + +Cookies must be enabled by the users browser for this auth scheme to work. The only thing stored in the cookie is a JWT. + +JWT's can be used forever to login, or until it is expired. There is [no simple way to log out](https://medium.com/devgorilla/how-to-log-out-when-using-jwt-a8c7823e8a6) when using a JWT for auth, as they are stateless and stored on the client. One method of "logging out" the user is to clear cookies. You may want to set cookie Max-Age, Domain, and [other settings](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) to your preference. + +See the nodemailer docs on [SMTP Transport](https://nodemailer.com/smtp/) and [Other Transports](https://nodemailer.com/transports/) for more info on mailservers. + +Notion.so uses a similar login-flow that this code is unabashadly inspired by. + + +## Summary of login flow + +1. User visits web app and submits their email via login form at `/register` +1. DB inserts new row using the UNIQUE email in a USER Table. Otherwise, select the user if the email exists. +1. Server generates a password and updates the PASSWORD column of the user row +1. Server adds a JWT to the clients cookie using the user ID and the password as payload +1. Server sends the user an email with the password +1. User enters the password at `/login` +1. Assuming the user didn't clear their cookies since requesting a password, the server uses the password and ID from the JWT to authenticates the user against the password they submitted +1. DB deletes one-time password from USER row +1. If authenticated, a new JWT is created with the user ID, and is replaced in the cookie. +1. User is now authenticated. The JWT from the cookie is used to auth future requests. +1. To log out, server clears the clients cookie. + + +## Endpoints in this demo + +- GET `/` public root +- POST `/register` Post form w/email field +- POST `/login` Post form w/password field +- GET `/login` The default redirect if not authenticated +- POST `/logout` Clear cookies to "log out" +- GET `/protected` A demo of protected route that resolves if user is authenticated + + +### Suggestions and TODO + +- Config cookie Max-Age, Domain, and etc based on your needs + + +## To Use + +1. copy `.env.sample` to `.env` and edit your settings +1. `npm install` +1. If you have nodemon installed, `npm run start`, otherwise `node server.js` + +Additionally, run `node email-test.js` to test sending mail w/your mailserver. + + +## Refs + +- [https://jwt.io/](https://jwt.io/) +- [https://auth0.com/learn/json-web-tokens/](https://auth0.com/learn/json-web-tokens/) +- [https://hasura.io/blog/best-practices-of-using-jwt-with-graphql/](https://hasura.io/blog/best-practices-of-using-jwt-with-graphql/) +- [https://codesquery.com/build-secure-nodejs-rest-api-using-json-web-token/](https://codesquery.com/build-secure-nodejs-rest-api-using-json-web-token/) +- [https://medium.com/@ryanchenkie_40935/react-authentication-how-to-store-jwt-in-a-cookie-346519310e81](https://medium.com/@ryanchenkie_40935/react-authentication-how-to-store-jwt-in-a-cookie-346519310e81) +- [https://medium.com/devgorilla/how-to-log-out-when-using-jwt-a8c7823e8a6](https://medium.com/devgorilla/how-to-log-out-when-using-jwt-a8c7823e8a6) +- [https://medium.com/devc-kano/basics-of-authentication-using-passport-and-jwt-with-sequelize-and-mysql-database-748e09d01bab](https://medium.com/devc-kano/basics-of-authentication-using-passport-and-jwt-with-sequelize-and-mysql-database-748e09d01bab) +- [https://medium.com/@ryanchenkie_40935/react-authentication-how-to-store-jwt-in-a-cookie-346519310e81](https://medium.com/@ryanchenkie_40935/react-authentication-how-to-store-jwt-in-a-cookie-346519310e81) +- [https://medium.com/@piraveenaparalogarajah/sessions-and-cookies-2c0919552f29](https://medium.com/@piraveenaparalogarajah/sessions-and-cookies-2c0919552f29) diff --git a/about.md b/about.md index 766d66e..c9d9da3 100644 --- a/about.md +++ b/about.md @@ -8,4 +8,4 @@ older versions - [2007](http://portfolio.quilime.com/new/port.php) - [2005](http://portfolio.quilime.com/recent.html) -- [2004](http://portfolio.quilime.com/archive/) \ No newline at end of file +- [2004](http://portfolio.quilime.com/archive/) diff --git a/all.html b/all.html deleted file mode 100644 index 37c2e21..0000000 --- a/all.html +++ /dev/null @@ -1,54 +0,0 @@ ---- -layout: index -title: all entires ---- -{% comment %} - - -{% endcomment %} - -
- -

open source

- -
- -{% for post in site.categories.code %} -
-

— {{ post.title }} {{ post.date | date: "%Y-%m-%d" }}

-
-{% endfor %} - -
-
- - -

code snippets

- -
-{% for post in site.categories.snippets %} -
-

— {{ post.title }} {{ post.date | date: "%Y-%m-%d" }}

-
-{% endfor %} - -
-
- -

command line

- -
-{% for post in site.categories.cli %} -
-

— {{ post.title }} {{ post.date | date: "%Y-%m-%d" }}

-
-{% endfor %} - -
-