Hacker Public Radio Hacker Public Radio
-
- Technology
Hacker Public Radio is an podcast that releases shows every weekday Monday through Friday. Our shows are produced by the community (you) and can be on any topic that are of interest to hackers and hobbyists.
-
HPR4136: Pi Samba Share
We live in a time where everything is streamed; from our TV, radio,
podcasts everything is fine until the internet goes down. Gone are the
days of simply turning on the TV with a set top aerial. With this in
mind, I set up an old Raspberry Pi 2 and connected it to use as a video
and music server through a Samba share.
To complete this task you will need:
A Raspberry Pi
A micro-SD card
An Ethernet cable
An external hard drive (min 2TB recommended)
Step 1: Update your Pi software in the terminal:
sudo apt update && sudo apt upgrade
Step 2: To allow us to share our files over a network we will install
Samba:
sudo apt install samba
Step 3: To find UUID and the file system of the drive, enter:
sudo blkid
Ignore the line with fat32, this is your Micro-SD
card.
Step 4: We need to mount this drive automatically whenever the
Raspberry Pi is switched on. Firstly, we'll need to create a location to
mount the external hard drive, we can do this by using the command:
sudo mkdir /media/external
Step 5: Now we need to edit the fstab to tell the Raspberry Pi to
automount the external drive every time it is switched on
sudo nano /etc/fstab
Insert the following line at the bottom of the page:
UUID="{the UUID you noted down in step 3}" /media/external {type noted in step 3} auto,user,rw 0 0
The above should all be on one line, pressing the tab key to create a
gap between each piece of information.
Step 6: Now we need to set up which folders are going to be shared.
I'll assume that we are going to make the whole of the external drive
available over the network
sudo nano /etc/samba/smb.conf
At the bottom of the page add the following, note that you can call
this anything you wish, just exchange the word external but you must
include [ ]:
[external]
path = /media/external
available= yes
browsable = yes
public = yes
writable = yes
It's worth noting before we continue that I've set the option
writable = yes, this means that you can add to or remove
the contents of the external drive over the network. If you are not
comfortable having this option then simply change it to
writable = no. Now save and exit (ctrl + X), make sure that
you answer 'yes' to save your changes.
Step 7: We will now set the Raspberry Pi to log in automatically on
startup, if the user Pi isn't logged in then all of things we've just
set up will not work. Type:
sudo nano /etc/inittab
Navigate down to the line:
1:2345:respawn:/sbin/getty --noclear 38400 tty1
and add --autologin pi after getty to make
the line:
1:2345:respawn:/sbin/getty --autologin pi --noclear 38400 tty1
Save and exit (ctrl + X) make sure that you answer 'yes' to save
it.
Step 8: We can try it out our system and auto-login by using the
command
sudo reboot
Assuming that everything goes well, your system should be up and
running. Try and find it on a computer through the file manager. I
personally recommend saving the Pi location on Kodi for an easy to use
solution for browsing your media on a TV. -
HPR4135: Mining the web
I don't have shownotes for this one. Sorry for that.
Please refer to the transcript for more information. -
HPR4134: Goodbye Craig Maloney.
Craig S. Maloney age 52 of Madison Heights formerly of Royal Oak,
passed away on Tuesday, April 2, 2024 at his residence with his family
at his side.
It was with great sadness that I heard of the passing of Craig
Maloney.
We knew him through his podcast https://openmetalcast.com, which is a member of the https://freeculturepodcasts.org/ Creative Commons
podcasts.
Our thoughts go out to his Family and Friends.
https://www.davidrevoy.com/article1021/goodbye-craig-maloney
https://octodon.social/@kattni/112202546947731897 Kattni
@kattni@octodon.social
https://decafbad.net/about/ Blog Craig Maloney More than
you cared to know
https://fosstodon.org/@pyohio/112259341818484139 The
PyOhio community recently lost a good friend
https://www.legacy.com/us/obituaries/name/craig-maloney-obituary?id=54791928
Craig Maloney Obituary -
HPR4133: Mastodon as a way to comment to HPR episodes
Mastodon as a way
to comment to HPR episodes
Prompted by Knightwise
I should be easier for listeners to discuss shows.
There have been several times I have intended to leave a comment on
a show, but I forget by the time I get back to my PC
Mastodon is made for community interaction.
If you are active on mastodon, replying to a mastodon post is
probably easier than the HPR comment form.
HPR Bot
HPR has a mastodon bot that makes a post when a new show is
released
The Bot's post and replies can be used as a comment system for
HPR
https://botsin.space/@hpr
Easy
Methods to including Mastodon on a static page
Each post has an embed link, but it does not include replies.
JavaScript can be used to display the post and replies
Example
https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/
Carl Schwan - KDE developer
Neither of these is ideal
Mastodon API
Mastodon has an API that can be used to pull a list of status
updates.
The comments can be pulled from the API and added to the static
site.
Proof of concept
HPR site using RSS feeds as the data source
https://gitlab.com/norrist/hprfeed2db
Full episode feed
Comments feed.
HPR Episodes 3637 and 3654
https://hpr.norrist.xyz/episodes/HPR3637.html
https://hpr.norrist.xyz/episodes/HPR3654.html
Add a new step to pull in the HPR Bot post replies as comments.
As a demo https://hpr.norrist.xyz will have mastodon comments on
recent episode pages.
get_mastodon_comments.py
load_comments_from_bot()
look for status updates regex
"New Episode: hpr(d+) :: "
get_thread_comments()
builds list of descendants - aka comments
update_db()
loops through list of comments
extracts - author, content, , pubdate, ...
inserts into sqlite database along with data from full episode and
comment feeds.
HTML template displays mastodon comments underneath the comments
from the comment RSS feed.
Mastodon Comment Moderation
I didn't implement any moderation, but there are a few possible ways
to do so
Maintain a list of approved contributors. When an
unapproved commenter posts
notify the admin that there are comments by a new commenter
skip adding any comments to the database until the commenter is
added to the approve list
Maintain a list of approved comments
comments have unique id
Add approved comment ID to a database
Only display approved comments.
Going Forward
Even without including mastodon comments on the HPR Page
Increase awareness of HPR on Mastodon
Follow the HPR bot on mastodon.
Tag yourself when one of your shows is posted by the HPR.
Add your mastodon account to your HPR profile / show notes.
Comment on the HPR bots mastodon post.
Links
My mastodon account - https://noc.social/@norrist
Python to get mastodon comments -
https://gitlab.com/norrist/hprfeed2db/-/blob/main/get_mastdon_comments.py -
HPR4132: Urandom talks about the future of HPR
The Urandom lads talk in
circles for about an hour about HPR. -
HPR4131: HPR Community News for May 2024
table td.shrink {
white-space:nowrap
}
hr.thin {
border: 0;
height: 0;
border-top: 1px solid rgba(0, 0, 0, 0.1);
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
New hosts
Welcome to our new host:
Moss Bliss.
Last Month's Shows
Id
Day
Date
Title
Host
4108
Wed
2024-05-01
What's in my bag
swift110
4109
Thu
2024-05-02
The future of HPR
knightwise
4110
Fri
2024-05-03
Playing Civilization III, Part 2
Ahuka
4111
Mon
2024-05-06
HPR Community News for April 2024
HPR Volunteers
4112
Tue
2024-05-07
JSON and VENDORS and AUTH ohh my!
operat0r
4113
Wed
2024-05-08
Today I Learnt, sed hold/pattern space use.
Some Guy On The Internet
4114
Thu
2024-05-09
Introduction to jq - part 2
Dave Morriss
4115
Fri
2024-05-10
Tagging music with Beets
dnt
4116
Mon
2024-05-13
Response to 4109: Building community without SEO