Let's setup a fun and surprisingly easy home stereo system with a raspberry pi. Why use docker you might ask? Because you can.
1. Setup The Raspberry pi
Here's a guide for the uninformed on how to setup a raspberry pi.
I recommend using the Raspberry pi OS Lite without the desktop for better performance.
2. Update Settings
Run this command in the terminal
Go into System options > Wireless Lan to setup wifi
Go into System options > Audio and select your audio output
3. Setup Docker
Follow this guide to setup docker on pi.
NOTE: On step 2 "Download the Convenience Script and Install Docker on Raspberry Pi" I had to restart the pi after running the script and then running it again.
4. Setup Spotify Connect & Airplay Audio
Run Spotify Connect
Run Airplay Audio
With Automator you can make a shortcut to convert an image to any type you want.
1. Open Automator
2. Select Quick Action
3. Change workflow receives to "image files"
4. Find Change Type of Images and drag it into the workflow. Remember to change the "To Type" field.
5. Command + s to Save and name it whatever you want.
6. Now you have the shortcut!
You might need to compress an image for a web application without a server. I've built an example of a web side image compressor here that works in Angular.
Install compressorjs into your web app
Add a Compress Function
The problem: I have an Audio Technica AT-LP60-USB that only has an output of a USB or RCA cables. I have studio monitors (JBL 305P MkII) that needs the sound amplified.
The solution: Using Raspberry Pi as a router.
This article was helpful in having a command that routes the audio, however I needed the command to always run and check if the record player was plugged in. Lets get started setting up our pi.
Go into the terminal window on the raspberry pi and type
Take note of your record player name and your audio interface name.
Create a script file to keep the audio streaming by running
Paste the following into the recordplayer.sh file being sure to replace after -C and -P with the values saved from earlier.
Save the script by control X, y and hitting enter.
Run this command to create a service that will run this script on boot
Paste the following
Save by control X, y and hitting enter.
Finally Run these commands to start the service
Check that the service is running
Now your record player should stream audio to your speakers! Let me know if you have any problems in the comments and I'll try to update this post as necessary.
When writing UI tests its often useful to reset the browser to a clean state.
Cypress has commands for clearing cookies cy.clearCookies(), and also resetting local storage, cy.clearLocalStorage().
However there isn't a command for clearing session storage. Add a custom cypress command more info.
Add to cypress/support/commands.js (or .ts if typescript)
Then in cypress/support/index.js (or .ts if typescript)
Then our final finished function is