AzuraCast – Simple, open-source self-hosted web radio

For many years now I have hosted internet radio and internet radio events using a very simple stack of just IceCast + EZStream, tied in with a few very simple scripts and cron jobs. This has always worked incredibly reliably and kept these setups very minimal with less parts in the chain to potentially have an issue or drive up resource usage. The negative of this has always been a lack of flexibility. In the past I had looked into software such as Centova Cast, however this comes at a cost and isn’t an open-source solution – which is what I will generally opt for where possible.

Introducing AzuraCast! I have been experimenting with AzuraCast for the last few months and it certainly shows a lot of promise. Rather than repeating specifics about it myself – here is a copy-paste directly from their GitHub.

AzuraCast is a self-hosted, all-in-one web radio management suite. Using its easy installer and powerful but intuitive web interface, you can start up a fully working web radio station in a few quick minutes.

Features

For Radio Stations

  • Rich Media Management: Upload songs, edit metadata, preview songs and organize music into folders from your browser.
  • Playlists: Add music to standard-rotation playlists (in sequential or shuffled playback order) or schedule a playlist to play at a scheduled time, or once per x songs/minutes/etc.
  • Live DJs: Set up individual DJ/streamer accounts and see who’s currently streaming from your station’s profile page.
  • Web DJ: Broadcast live directly from your browser, with no extra software needed, with AzuraCast’s built-in Web DJ tool.
  • Public Pages: AzuraCast includes embeddable public pages that you can integrate into your existing web page or use as the basis for your own customized player.
  • Listener Requests: Let your listeners request specific songs from your playlists, both via an API and a simple public-facing listener page.
  • Remote Relays: Broadcast your radio signal (including live DJs) to any remote server running Icecast or SHOUTcast.
  • Web Hooks: Integrate your station with Slack, Discord, TuneIn, Twitter and more by setting up web hooks that connect to third-party services.
  • Detailed Analytics and Reports: Keep track of every aspect of your station’s listeners over time. View reports of each song’s impact on your listener count. You can also generate a report that’s compatible with SoundExchange for US web radio royalties.

For Server Administrators

  • Role-based User Management: Assign global and per-station permissions to a role, then add users to those roles to control access.
  • Custom Branding: Modify every aspect of both the internal and public-facing AzuraCast pages by supplying your own custom CSS and JavaScript.
  • Authenticated RESTful API: Individual users in the system can create API keys which have the same permissions they have in the system. The AzuraCast API is a powerful and well-documented tool for interacting with installations.
  • Web Log Viewing: Quickly diagnose problems affecting any part of the AzuraCast system through the system-wide web log viewer.
  • Automatic Radio Proxies: Many users can’t connect directly to radio station ports (i.e. 8000) by default, so AzuraCast includes an automatic nginx proxy that lets listeners connect via the http (80) and https (443) ports. These proxies are also compatible with services like CloudFlare.

AzuraCast is still currently in beta, however the developers seem very active on the project and updates are regular. This is definitely a long awaited alternative to the commercial/paid software solutions for managing internet radio. I’m very excited to watch how this project develops. For more information, check out their website over at – https://www.azuracast.com/

Verbatim 16GB Store N Go USB 3.0 Flash Drive VBPLAT16GB Benchmark

Below are some basic benchmarks of the Verbatim 16GB Store N Go Platinum USB 3.0 Flash Drive – Model – VBPLAT16GB. “Platinum” in this case refers to the colour only. There are also “Gold” versions of these same flash drives with the same specifications. Please note these are purely just for my own interest and for anyone else interested – these tests are not performed for proper review purposes or under strict testing environment settings, so they may not be perfectly accurate, however they should represent ballpark figures of what to expect (unless I’ve made a mistake in my benchmark process!)


CrystalDiskMark benchmark results (formatted)
Read speed benchmark from HD Tune (unformatted)
Minimum – 109.2 MB/s
Maximum – 138.6 MB/s
Average – 126.4 MB/s
Access Time – 0.566 ms
Burst Rate – 74.8 MB/s
Write speed benchmark from HD Tune (unformatted)
Minimum – 6.1 MB/s
Maximum – 25.7 MB/s
Average – 18.6 MB/s
Access Time – 613.9 ms
Burst Rate – 65.7 MB/s

SanDisk 16GB Ultra USB 3.0 Flash Drive SDCZ4816GB Benchmark

Below are some basic benchmarks of the SanDisk 16GB Ultra USB 3.0 Flash Drive – Model – SDCZ4816GB. Please note these are purely just for my own interest and for anyone else interested – these tests are not performed for proper review purposes or under strict testing environment settings, so they may not be perfectly accurate, however they should represent ballpark figures of what to expect (unless I’ve made a mistake in my benchmark process!)


CrystalDiskMark benchmark results (formatted)

Read speed benchmark from HD Tune (unformatted)
Minimum – 94.5 MB/s
Maximum – 117.7 MB/s
Average – 104.5 MB/s
Access Time – 0.683 ms
Burst Rate – 75 MB/s

Write speed benchmark from HD Tune (unformatted)
Minimum – 4.7 MB/s
Maximum – 16.2 MB/s
Average – 11.9 MB/s
Access Time – 4.40 ms
Burst Rate – 75.7 MB/s

Installing Rocket.Chat on Ubuntu Xenial 16.04 via Snap

This is a simple tutorial to get Rocket.Chat running on a Ubuntu Xenial 16.04 server (You’ll likely be perfectly fine to run through the same process on a different Ubuntu version such as 18.04 if you’d prefer) In this case we’re installing this on a fresh server and we’ll be installing Rocket.Chat as a Snap and using Caddy as a reverse proxy. Caddy will also deal with issuing SSL certificates via Let’s Encrypt. With this you’ll be able to get Rocket.Chat up and running within ~10 minutes, from there you can go on and make further server configuration changes for security and so on, as well as configure Rocket.Chat in more depth – which won’t be covered within the scope of this tutorial.


Let’s first start with some updates.

apt-get update
apt-get upgrade


Basic UFW setup

Let’s setup a basic firewall using UFW. First install UFW if it’s not installed –

apt-get install ufw


Setup the default access rules –

ufw default deny incoming
ufw default allow outgoing


Setup the firewall rules that we’ll want –

ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp


Enable the firewall –

ufw enable


You can check the status of ufw with –

ufw status


If you add or remove rules you should reload ufw with –

ufw reload


If you need to disable ufw you can do so with –

ufw disable


Install Fail2Ban

apt-get install fail2ban


Install Rocket.Chat as a Snap

Install Snap if it’s not already installed –

apt-get install snapd


Install Rocket.Chat –

snap install rocketchat-server


At this point the Rocket.Chat service will have automatically started, you can check if it’s running with –

service snap.rocketchat-server.rocketchat-server status


Configure Caddy and SSL

Initial configuration-

snap set rocketchat-server caddy-url=https://<your-domain-name>
snap set rocketchat-server caddy=enable
snap set rocketchat-server https=enable
rocketchat-server.initcaddy


Assuming you didn’t have any errors, restart Rocket.Chat and Caddy –

systemctl restart snap.rocketchat-server.rocketchat-server.service
systemctl restart snap.rocketchat-server.rocketchat-caddy.service


You can check Caddy’s logs with the following command

journalctl -r | grep caddy | less


Redirect HTTP to HTTPS

Redirecting HTTP to HTTPS is handled in the Caddy configuration by ommitting the http or https prefix. For instance you should have something like this inside /var/snap/rocketchat-server/current/Caddyfile –

your-domain-name.com {
  proxy / localhost:3000 {
    websocket
    transparent
  }
}


Restart Caddy once again after saving your changes –

systemctl restart snap.rocketchat-server.rocketchat-caddy


Onto Rocket.Chat itself!

At this point you’ll have a working Rocket.Chat installation running. You can browse to https://yourserver.com and you should be presented with the Setup Wizard screen to create the first user whom will by the Admin by default.

Once logged in, you may get a pop-up stating something along the lines of – The setting Site URL is configured to http://localhost and you are accessing from https://yourserver.com - Do you want to change to https://yourserver.com ? – You’ll want to click YES.

At this stage you’ll want to setup Rocket.Chat itself, so please refer to their documentation here – https://rocket.chat/docs


~Extra~

You can install a Discord style dark theme using this here! https://github.com/0x0049/Rocket.Chat.Dark


Backup and restore or migrate a Snap based installation of Rocket.Chat

This is a simple tutorial to backup and restore, or backup and migrate a Snap based installation of Rocket.Chat.


Stop the Rocket.Chat server

First you’ll need to stop the Rocket.Chat server.

service snap.rocketchat-server.rocketchat-server stop

Note that we’re only stopping the rocketchat-server service, not the MongoDB service, which should still be running. Check with –

service snap.rocketchat-server.rocketchat-mongo status | grep Active
Active: active (running) (…)


Create a backup.

snap run rocketchat-server.backupdb

You should see output similar to this –

[+] A backup of your data can be found at /var/snap/rocketchat-server/common/backup/rocketchat_backup_<timestamp>.tar.gz

Download that backup file over SFTP for instance, or transfer it to the server you’re migrating your Rocket.Chat installation to.

Your Rocket.Chat server will still be stopped at this point, so if you just wanted to create a backup for your existing installation, you can start the server back up with –

service snap.rocketchat-server.rocketchat-server start


Migrate (or restore) from backup

Now if we’re going to migrate our Rocket.Chat installation, on the server we’re migrating the installation to, you’ll want to have already installed Rocket.Chat as a Snap. Once done upload the *.tar.gz backup file from earlier to /var/snap/rocketchat-server/common/ on the destination server.

Once again, stop the rocketchat-server service, but not the MongoDB service –

service snap.rocketchat-server.rocketchat-server stop

service snap.rocketchat-server.rocketchat-mongo status | grep Active
Active: active (running) (…)

Restore using the *.tar.gz backup that we created –

snap run rocketchat-server.restoredb /var/snap/rocketchat-server/common/rocketchat_backup.tgz

*** ATTENTION ***
* Your current database WILL BE DROPPED prior to the restore!
* Would you like to make a backup of the current database before proceeding?
* (y/n/Q)>

Y

[*] Extracting backup file...
[*] Restoring data...
[*] Preparing database...
[+] Restore completed! Please restart the snap.rocketchat services to verify.

Start the Rocket.Chat server at this point, and your installation will now be running based on the Rocket.Chat Snap backup that was performed!

service snap.rocketchat-server.rocketchat-server start

Installing Rocket.Chat on Ubuntu Xenial 16.04 via Snap with an NGINX reverse proxy

Please note that Rocket.Chat Snaps now come with Caddy to deal with the reverse proxy and free SSL certificate’s via Let’s Encrypt – so you may wish to refer to my newer post here. NGINX won’t have websockets configured if you use this guide – which are required if you intend to use the mobile Rocket.Chat apps.

This is a simple tutorial to get Rocket.Chat running on a Ubuntu Xenial 16.04 server (You’ll likely be perfectly fine to run through the same process on a different Ubuntu version such as 18.04 if you’d prefer) In this case we’re installing this on a fresh server and we’ll be installing Rocket.Chat as a Snap and using NGINX as a reverse proxy, as well as setting up an SSL certificate via Let’s Encrypt. With this you’ll be able to get Rocket.Chat up and running within ~10 minutes, from there you can go on and make further server configuration changes for security and so on, as well as configure Rocket.Chat in more depth – which won’t be covered within the scope of this tutorial.


Let’s first start with some updates.

apt-get update
apt-get upgrade


Basic UFW setup

Let’s setup a basic firewall using UFW. First install UFW if it’s not installed –

apt-get install ufw


Setup the default access rules –

ufw default deny incoming
ufw default allow outgoing


Setup the firewall rules that we’ll want –

ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp


Enable the firewall –

ufw enable


You can check the status of ufw with –

ufw status


If you add or remove rules you should reload ufw with –

ufw reload


If you need to disable ufw you can do so with –

ufw disable


Install Fail2Ban

apt-get install fail2ban


Install Rocket.Chat as a Snap

Install Snap if it’s not already installed –

apt-get install snapd


Install Rocket.Chat –

snap install rocketchat-server


At this point the Rocket.Chat service will have automatically started, you can check if it’s running with –

service snap.rocketchat-server.rocketchat-server status


Install and configure NGINX to use as a reverse proxy + SSL setup

Install NGINX –

apt install nginx
systemctl start nginx
systemctl enable nginx


Remove the default NGINX site –

rm /etc/nginx/sites-enabled/default


Create the NGINX config for Rocket.Chat

vim /etc/nginx/sites-available/rocketchat.conf


Once inside vim, you should have the following (edit “yourserver.com” to be your actual domain that you’re going to use for this server) –

server {
     listen 80;
 
     server_name yourserver.com; 

     location / {
     proxy_pass http://localhost:3000/; 
     }
 }


Enable the new configuration by creating a link to it from /etc/nginx/sites-available/ –

ln -s /etc/nginx/sites-available/rocketchat.conf /etc/nginx/sites-enabled/


Test the configuration –

nginx -t


Assuming no errors are reported, reload the NGINX config with –

nginx -s reload


SSL Setup using Let’s Encrypt + Certbot

Install Certbot and run it –

apt-get install software-properties-common
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install python-certbot-nginx
certbot --nginx


Follow the prompts on screen and you should be issued a valid Let’s Encrypt SSL certificate. Make sure you do choose to force a HTTPS redirect when prompted.

Certbot will automatically deal with SSL certificate renewal, a cron will automatically be created under /etc/cron.d/certbot. You can test the renewal process as a dry run via –

certbot renew --dry-run


Certbot will have updated the NGINX configuration, test that the config is valid with –

certbot renew --dry-run


Assuming no errors are reported, reload the NGINX config with –

nginx -s reload


Onto Rocket.Chat itself!

At this point you’ll have a working Rocket.Chat installation running. You can browse to https://yourserver.com and you should be presented with the Setup Wizard screen to create the first user whom will by the Admin by default.

Once logged in, you should get a pop-up stating something along the lines of – The setting Site URL is configured to http://localhost and you are accessing from https://yourserver.com - Do you want to change to https://yourserver.com ? – You’ll want to click YES.

At this stage you’ll want to setup Rocket.Chat itself, so please refer to their documentation here – https://rocket.chat/docs


~Extra~

You can install a Discord style dark theme using this here! https://github.com/0x0049/Rocket.Chat.Dark


Updating Slack status to reflect Zoiper5 call state using Slack API.

Github page – https://github.com/james-reed/zoiper-slack-status

I wanted a simple way of having my Slack status automatically update when I take a phone call using Zoiper. The majority of VoIP handsets or softphones support the opening of a URL during a certain event such as picking up or ending a call – which can be leveraged for various uses as you can imagine. Zoiper supports this method, but also has ability to execute files/applications on such events. In this particular project, when a phone call is answered Zoiper will launch set-status-in-call.pyw and pass the incoming caller ID using {number} which is one of a few supported Zoiper variables.

Full list of Zoiper variables here

If an incoming call from 0212345678 is answered, then the Slack status will change to Currently in a call with 0212345678 with the telephone_reciever emoji set.

Once the call is hung up, Zoiper will launch set-status-clear.pyw on that particular event which then clears the Slack status out.

The use of the .pyw extension will make the code execute in the background instead of popping up a command window or similar – as you’ll see if running this on Windows.

Setup

  1. You’ll want to install Python on your device. This has been tested using Python v3.6.x but should be fine with ~v2 if you’re using that.
  2. You will need the Python “requests” module which can be installed with pip install requests
  3. You will need your Slack API token. At the time of writing it’s possible to grab this by logging into the Slack via your web browser and then using the developer tools in your web browser to perform inspections when making a change such as updating your status. You should be able to comb through and grab your API token – further information on doing this is outside of the scope of this documentation. Once you have your API token, replace the YOUR_SLACK_TOKEN_GOES_HERE variable with your actual token.
  4. Setup your Zoiper client as per the following screenshots. In Zoiper5 you can add Event Rules under Settings > Features > Automation > Edit Open URL Rule

Create a rule for when the call state changes to Answered and point it to set-status-in-call.pyw {number}

Create a rule for when the call state changes to Hang Up and point it to set-status-clear.pyw {number}

Set Slack status phone BLF with Zoiper5 – without API access.

I’m sharing in this post an older and not really ideal at all method to automatically change your Slack status when taking a call using Zoiper5. The ideal way to achieve this is to have some integration between your PBX and Slack so that user statuses can be changed based on the extension BLF status. The other ideal way would be to use the Slack API. If you find yourself in a situation where you don’t have permissions to work in either of these realms – this is a janky but working solution!

In this guide we’re using a Windows OS environment, and AutoHotKey.

For this I’m just placing these files on the desktop but you can put them anywhere you’d like, just make sure inside the “slack-set*” scripts you update the Include path for “TrayIcon.ahk” to the location you’ve placed that file.

Download “TrayIcon.ahk”

Download “slack-set-in-call.ahk”

Download “slack-set-call-finished.ahk”

Inside Zoiper5 (you will need a licensed copy to do this)

Create two rules as below –

Go to Settings > Automation > Event Rules > Add Rule

OnCall status change
Call State changes toAnswered
And call direction isBoth Incoming and Outgoing
Do action Open/Execute Application
Open URL/RUNC:\Users\james\Desktop\slack-set-in-call.ahk

On – Call status change
Call State changes toHangup
And call direction isBoth Incoming and Outgoing
Do actionOpen/Execute Application
Open URL/RUNC:\Users\james\Desktop\slack-set-in-call.ahk

Your Slack status will now automatically change when you take a call and when you hangup that call. This all happens very quickly but obviously due to how this method works, if you focus onto a different app the moment this script runs then it’ll mess up. All this method does is bring the Slack window into focus and slam in a “/status” command. I always have my Slack window open on one of my monitors and haven’t had any issues myself using this crude method.

Magedok 11.6 inch 1080P FHD IPS USB-C capacitive touch portable monitor (T116C)

I’d been searching for a portable external monitor and was mostly seeing AOC’s offerings and the Asus Zenscreen, then eventually I’d been turned onto the brand “Magedok”. Magedok have some incredibly good value offerings however there isn’t a whole ton of information available online as far as reviews go. This isn’t a proper review as it were, but I’ll note my experience with the Magedok monitor that I ended up purchasing – Magedok 11.6 inch 1080P FHD IPS USB-C capacitive touch portable monitor (T116C)

The monitor’s packaging – very well packed and protected, no worries there.

Included along with the monitor is a stand which is actually fairly reasonable, a mini HDMI to HDMI cable, a USB-C to USB-A cable, two Magedok velcro cable ties, an instruction manual and screws for VESA mounting.

Unfortunately I don’t have a great camera (or cameraman skills) to show off the monitor’s panel, however in person it looks amazing with deep blacks and great viewing angles as you’d expect from an IPS panel.

Note that this monitor doesn’t come with a USB-C to USB-C cable, so you’ll need to source one separately. I’ve currently got this plugged in using both the USB-C port and mini HDMI port – I did try using a USB-C to USB-C cable directly to my motherboard which is an Asus x99-Deluxe II – however this didn’t give me any video signal, only power. I’ll need to look further into how this element of the monitor is supposed to work. I’d imagine if you’re plugging this directly into something like a newer laptop with USB-C it should just work fine with the single cable as indicated in the manual. The panel quality far exceeded my expectations and looks amazing. It’s certainly portable as it’s rather light and thin but still solid feeling – no complaints at all about the build quality. The rear has a nice rubberized feel which is soft and grippy enough, and the menu buttons on the back + OSD are good enough. If you have decent vision then I think you could probably get away with using the monitor at full 1080p without changing the scaling settings – otherwise 125% scaling is fine. This shipped out from HK to Australia within ~3 business days from purchase to arrival which is awesome. At a later stage I’d like to test two of these with a laptop to see how viable they are for extending a laptop to have 2x additional monitors using only USB-C cables.

So in summary – Fast shipping with decent packaging, great 1080p IPS touchscreen panel, solid build quality and certainly light enough to be portable – $159 USD shipped at my date of purchase. Highly recommended!

Unlimited prepaid 4G data sim for Taiwan – Chunghwa Telecom

Are you traveling to Taiwan sometime soon and would like a data sim for internet access? I can recommend Chunghwa Telecom’s offerings – this was the provider I ended up choosing during my travels. You can purchase a card with unlimited data on a time basis anywhere from 3 days to 30 days. You’ll get some voice credit included for making calls too, it’s a pretty good deal and certainly better than the options I’d come across nearby in Japan and Korea. For a 30 day SIM it’s ~1000NTD or roughly $45 AUD at the current moment. Another great inclusion is that Chunghwa operate WiFi hotspots in various locations so you can connect to these using your SIM card and unlike other providers you might have run into you don’t need to enter in login details each time you connect. The SIM card provides authentication so you can seamlessly jump between hotspots and 4G.

Current pricing directly through Chunghwa

You can purchase a SIM either directly through Chunghwa here.

Or via one of their resellers such as kkday here.

Both options offer airport pickup – simply choose the date you intend to arrive and then you can pickup the SIM at the airport. You will need to book your SIM ~3 or more days before the date you intend to pick it up. Personally I bought my SIM through kkday as at the time they allowed a shorter period of time between the booking and pickup date. Instructions on where to pickup the SIM are shown on the website and it was easy enough to find on the day. You will need two forms of ID – a passport and some other kind of photo ID such as a driver’s license.

The speeds were very good and there wasn’t any limiting or speed throttling that I noticed. I performed a large backup to Google Drive >200GB without any issues. This is a “true” unlimited service. I had no issues getting decent signal and speeds outside of Taipei either, the SIM worked great in Hualien for instance.

138mbps download / 37mbps upload – 4G speedtest in Taipei

~93mbps download / ~28mbps upload over WiFi in Taipei