I have an old laptop that downloads my torrents and serves as my Plex server. It, sadly, is dying, so I need a
replacement.
These days we have access to an unprecendented amount of low-power processing ability. There are any number of
small, low-power boards you can buy that will run full distributions of Linux and give you access to everything
you ever wanted in terms of services. The workhorse of this category is the Raspberry Pi.
The latest version of the Pi is the Raspberry Pi 4. It has a 1.5GHz Quad-core ARM processor and options for RAM
ranging from I think 1GB to 8GB.
You can get a full loadout of everything you need for $120, and this board ( the size, roughly, of a credit card)
can be a basic Linux server for you, but also a much more advanced one if the need arises. It has power if you need
it, and with Linux behind it, there’s almost nothing you can’t do.
This guide will discuss how to set up a Raspberry Pi with an eye towards a few different applications/uses.
Uses
While my laptop handled torrents and a Plex server, the Raspberry Pi is a Linux machine that can offer a lot
more services to me. Here’s a list of the things I hope to use it for:
Torrenting
Plex Server
General File Sharing
Jenkins CI Server
Redmine Server
Subversion Server
IFTTT Executor
Wiki
Scanned document storage
More information/goals on some of these are below.
General File Sharing
I hope to identify some sort of file sharing that will allow me to take my 750GB laptop drive that now holds all of
my old files, attach it to the Raspberry Pi, and mount the drive seamlessly on Windows machines - so that it looks
and acts as if it is a local drive.
IFTTT Executor
I’m just getting in to IFTTT for home automation. Currently, I have a Nest, remote-controlled blinds, and a whole
house fan that I hope to automate in some way.
My ultimate goal is that this system will automatically manage our home temperature - primarly through the whole
house fan. By turning on the whole house fan when the outside temperature is less than the inside temperature, you
can cheaply cool off a house. There are numerous aspects of this that must be integrated, however:
Monitoring the inside and outside temperatures
Monitoring whether there are any windows open
Turning the whole house fan on and off
There are numerous sensors that can be integrated with IFTTT - I know of one in particular that has 8 temperature
sensors with humidity as well (which is always nice). Similarly, there are window sensors that can be integrated
with IFTTT as well. The only major difficulty is controlling the whole house fan, but luckily there’s a potential
way that can be done.
My whole house fan has an RF controller. It should be somewhat easy to identify what frequency it uses, buy
a transceiver, and then duplicate the RF signals it produces to turn the fan on and off. If I roll this into my own
custom PCB, I should be able to either:
Create a wifi-enabled board that can control the fan direclty, or
Create a board that plugs into USB on the Raspberry Pi that, when paired with a Python script, will control the
fan (and the Raspberry Pi can handle the network I/O)
I will probably go with approach number 2 due to simplicity. I have the skills to write a Python script that will
have a REST-style web interface that will communicate with the board via USB to serial to control whatever is
attached to my custom board - it needn’t be just one thing at this point.
I will try to cover this approach fully in another blog post, so this is just a teaser.
Scanned Document Storage
Right now, I scan documents directly to my PC one at a time, rename them, and then store them in an encrypted volume.
There are utilities out there that will handle many of the difficult aspects of this process. One of them I know is
PaperMerge. With PaperMerge, I imagine I can just scan a bunch of pages,
sort them into individual documents, OCR them, align them, etc, and store them in a document management system.
Unboxing
I bought a kit that has all of the stuff you’d need to get a Raspberry Pi 4 up and running:
Raspberry Pi 4
Power adapter
Heat sinks
Case
SD card
Power Switch
HDMI Cable
The power supply, I will note, is a beast. It’s a 5V/3A adapter that will trigger the Turbo Charge on my phone. It’s
pretty worth getting a few of them for general use if you have a phone that has a USB-C charging port.
I will say something about the heatsinks: I have not experienced this, but I have been told that the heatsinks
are not optional. It’s true, you may get by without them, but they will ceratinly add to the overall stability
of the board. And, for a board that supposed to sit in a corner, be powerful and not make waves, stability is
paramount - especially if you need the power this board offers. Bottom line: USE THE HEATSINKS.
I am unsure right now of the power switch - it’s an on/off that goes inline withe the USB-C connection. It might
very well be useful - we’ll see.
The HDMI cable, it should be noted, is a mini (or is it micro?) HDMI to regular HDMI. Very useful.
The case just makes everything neat. Highly recommended.
So, if you’re unboxing, all of the stuff removed from the box looks like this:
Photo missing :(
The first thing I’m going to do is to put the heatsinks on. These heatsinks are great because they are just
stick-ons: peel off the backing and then attach to the appropriate chip. The question is: which chip is the
appropriate one?
These are the heat sinks:
Photo missing :(
There’s three of them, all different sizes, so this should be straightforward, right?
The biggest one goes on the processor: the metal-topped largest chip on the board.
This is a pic of the largest heatsink attached:
Photo missing :(
The second-largest one goes on the SDRAM chip, as seen below:
Photo missing :(
And the final, smallest one, goes on the USB 3.0 controller, as seen below:
Photo missing :(
The other cooling aspect is the fan that came with my kit. You can connect it to 5V for fast operation, or 3.3V for
slower (quieter) operation. Given that I think, after the heatsinks, the fan is kinda overkill, I’ll leave it on 3.3V
That configuration looks like this:
Photo missing :(
And then, the fan gets shoved into the case - but how? There’s two ways: label up or label down. Label up, I think,
will pull air through the case and blow it out the top. The other way will push it out.
At this forum post they discuss how to do it. I put it
with the label facing up in the top cover of the case:
Photo missing :(
Then, to get the case on, I kinda slid the end with the HDMI connector under the tabs on that end of the base. The
next step should be to put the top piece (not cover) on, but I had to disconnect the fan wires and then route them
through the top piece:
Photo missing :(
Then, I put the top cover on:
Photo missing :(
And now it is a single unit - ready for power.
So, I then plug in the power adapter and hope to see a light. I do, in fact, see a light:
Photo missing :(
So, now I have a nearly fully assembled board.
Nearly.
SD Card Image Generation
The next step in this process is to generate an SD card image that can boot the
Raspberry Pi to Linux.
Now, technically, the Canakit comes with a pre-imaged SD card that already has Linux
on it. You could just use that, but I’d like to generate one from scratch so that I
know I’m getting the newest software and that I can reproduce the image if needs be.
I’m going to use a variant of Linux called Raspbian Lite because I’ve used it before.
I will generally be following the steps found here.
On that page is a download button which I can’t get the URL of, but I clicked it and
downloaded the installer.
I doubled clicked it to start and did the following:
On the first balenaEtcher setup screen, agreed to the license by clicking ‘I agree’.
It installed. That was pretty much it. The program starts.
It already identified the SD card attached via the USB stick, so all I need now is
the image to burn to it.
Raspbian Lite
The latest Raspbian Lite image can be found here. It will download a zip file
of the latest image.
Inside of the zip is the .img file.
Burning the Image to the SD Card
These are the steps I followed:
In balenaEtcher, select the ‘Flash from File’ option
I found the file that I took out of the .zip file and selected it.
I clicked the Flash! button.
A UAC warning came up and I allowed the operation
For a 32GB card, it took a minute or so.
Using the SD Card
To start using the card, insert it into the micro-SD card slot on the
Raspberry Pi and power it.
I did so, and the first thing I noticed is that a screen came up that said it resized the root partition, then it rebooted.
It booted up and then presented a login screen. This is the default
login:
Username: pi
Password: raspberry
Now you’re in!
The first thing to do is to get it on a network. I’m going to start with
my wireless network for simplicity.
Initial Setup
I have in my previous notes a few things that I did previously.
Run the following commands:
Within the ‘key’ file change the XKBLAYOUT option to “us” and save the file.
Raspi-Config
Raspi-Config is the top-level configuration utility for the Raspberry Pi.
You access it by typing:
It presents several options. The first option is to change the password
for the ‘pi’ user to something other than the default. This is, of
course, good security policy, so go ahead and do it.
Option 2 is to set network options. Beneath it, option 2 is for wireless
networks, which I then set up.
The first step is to select the country you’re using it in - United
States for me.
Then, you have to type the SSID in manually. Maybe a search box would
have come up if I had put nothing into the text box, but I typed it in
manually, then typed in the passphrase.
Next, under Interface Options, we can turn on the SSH server.
Under Interface Options, the SSH server is option P2. Then, I selected
to enable the SSH server. THen, it told me it was enabled and that was it.
At this point, the image is pretty much ready for use. I’m going to save it on my PC so I can just revert back to a clean install whenever I
need.
One good thing to set up now is an SSH key that allows automatic SSH
login to the Raspberry Pi.
Saving the SD Card Image to a File
I found a guide to create an image from an SD card here.
The relevant program to use here is Win32DiskImager, which can be
downloaded here.
I followed these steps to install Win32DiskImager:
On the License Agreement page I accept the agreement and click ‘Next’.
On the installation path page, I accept the default and click ‘Next’.
I accepted the default Start Menu folder and clicked ‘Next’
I opted not to add a Desktop shortcut and clicked ‘Next’
I reviewed everything and clicked ‘Install’
The program installed and on the last page I unchecked to read the
README and allowed starting the program. Then I clicked ‘Finish’
After installing, I used the program thusly:
Under ‘Image File’ I used the file dialog to identify the path I
wanted to save the image file to
I set ‘Device’ to the USB stick that had my SD card in it.
I clicked the ‘Read’ button and it read the SD card into the image
file I specified. It took about a half hour for a 32GB SD card.
Shrinking the SD Card Image
I’m still trying to work out how to do that on Windows.
Connecting to Your RasPi via SSH
You can get a full Bash terminal via SSH by following these instructions.
Finding Your RasPi IP Address
First, you’ll need to find your RasPi’s IP address. On the RasPi
terminal, type the following:
This will give you the network interface status. If you used wireless
to connect to the network, you’ll be looking for the IP address of the
‘wlan’ adapter. If you’re using the wired, look for ‘eth0’. The IP
address is the IP address following the ‘inet’ (or ‘inet6’ if you’re using
IPv6) value. Note it so you can connect to it.
Mine was 192.168.50.44.
Connecting with PuTTY
The PuTTY client allows you to get a terminal on the RasPi via SSH.
Here’s how to use it:
Open PuTTY - the PuTTY Configuration window shows up
Enter the IP address of the RasPi under ‘Host Name’
SSH is the default connection type - if not, switch to it (Port 22)
Under ‘Saved Sessions’, type a name for the session and click the
‘Save’ button
Click ‘Open’ to initiate the connection
The first time you connect to the RasPi, you’ll get a PUTTY Security
Alert that the server’s keys are not cached, etc. etc. Click ‘Yes’
A login screen is presented. Login with the credentials you set
previously.
Setting Up an Auto-Login
An auto-login means you don’t need to put in your username or password
when you SSH into the RasPi. It makes it easier to work with your Pi, and
when it comes to ease of use, every little bit helps.
Look at it this way: if you use your Pi to its fullest extent, you’re going
to be SSH’ing into it a lot. Thousands of times. You can save two seconds
when you connect to it by doing this. That’s hours of time saved. Well worth
it. Also, by lowering the barriers to working with the Pi, you have fewer
excuses to avoid working with it.
To set up auto-login, we’ll be generating an SSH key on the Pi and then
importing it into PuTTY.
Here’s what I did to generate the key
This generates a key in /home/pi/.ssh. We then copy the key to the
authorized_keys folder. The next step is to save the key to the PC with
PuTTY on it. Here’s how we do that:
I copied everything after the ‘cat id_rsa’ and saved it as a text file on my
desktop: ‘RasPi_Personal_Auto-Login_9_9_2020.txt’.
I need to import this key using a program on my PC called ‘PuTTYGen’.
I just type that in at the Start Menu (I have Windows 10).
It comes up. To import my key I follow these steps:
Click ‘Load’ next to ‘Load an existing private key file’
I navigage to the Desktop where I saved my file, and switch the file type
on the dialog to ‘All files’ so I can see my text file. It’s worth noting at
this point that my file had blank lines before the BEGIN and after the END
and this prevented PuTTY from understanding the file the first time, until I
deleted them.
A dialog box pops up and tells me know that the import was successful but
that I will have to save the key before it can be used with PuTTY. I click ‘OK’.
Under ‘Save the generated key’ I click ‘Save Private Key’
It wants me to verify that I don’t want to save this with a passphrase. I
don’t. So I click ‘Yes’.
I once again save it on the desktop with the same file name, but this time
a ‘.ppk’ extension. At this point you can close PuTTYGen.
Open PuTTY.
Start the process of generating a new connection for the RasPi by putting in
the IP address in the ‘Host Name (or IP address)’ box. The connection type
should already be SSH, so you’re set there.
On the left-hand side of the window, find the ‘Connection/Auth/SSH’ menu and
enter it
Near ‘Private Key File for Authentication’ click the ‘Browse’ button
Select the .ppk file you created earlier and click ‘OK’
Now, on the left-hand side of the window find the ‘Connection/Data’ menu
In this menu, change the auto-login username to ‘pi’
Now, on the left-hadn side of the screen, go back to the ‘Session’ menu
(all the way at the top)
Save this connection as something readily understandable like
‘RasPi_Auto-Login’
The new connection will show up in the list. Double click it and
enjoy SSH’ing into your RasPi without a password!
Installing Docker
From this site, Docker can
be installed in one command, like this:
I pasted that into PuTTY and a whole bunch of stuff started happening,
but it ended up with this:
I did, indeed need to do an update on apt-get considering I had never
done one before. So, I typed:
I let it run to completion (which took a bit of time).
Once it finished, I returned to the original command and ran it.
It also took a while. Then it ended with this error:
It gave me a warning about already having Docker installed, but I
just let it do its thing anyway. Nonetheless, it seems to have
worked just fine.
Then, I followed it up with this:
This successfully ran the Docker hello-world. This is, by the way, a
feature every piece of software should have.
Removing Docker Containers for a Fresh Re-Install
More than once here I’ve had to completely wipe away and re-download a fresh Docker container. I figured I might as well document the steps so I know how to
do it when I need to again.
Setting up a Plex Server via Docker
Apparently this should be somewhat straightforward.
First, I need a USB drive for some external storage. I’ve found an old
8GB stick that seems rediculously slow. I hope it doesn’t hurt anything.
Mounting a USB Drive
I plugged my drive in - it should be recognized. I can figure that out
by listing the hard drives on the RasPi. I did this twice - once with
the drive plugged in, and then again without it:
Seems pretty safe to bet that’s the USB stick. I can mount it like
this:
Oops. I have to make that directory first:
Then it mounts fine.
Adding exFAT Support
One of my external drives is exFAT-formatted. My RasPi can’t mount
that.
I’m starting at the ‘Setting up automatic mounting’ section.
I start off by doing this:
This gives me both the filesystem type and the PARTUUID which I need for the next step. I’m looking at the /dev/sda1
drive for my information.
For reference, that information is:
Filesystem Type: vfat
PARTUUID: ed9bf8d7-01
I copy PARTUUID to the clipboard.
I use this command line to edit the /etc/fstab file:
And at the end I add this line:
Theoretically, that’s it. I’m testing it by doing a reboot, like this:
And, lo and behold, it’s fairly non-responsive. The website did suggest that the modifications I made to /etc/fstab would
cause the startup to take an additional 90 seconds.
I suppose that’s accurate.
But, after it’s all started up, I run this command and see this result, and it tells me that all is as it should be:
Yes, the MOUNTPOINT for the /dev/sda1 device is as it should be.
Muy. Bueno.
Formatting a New Drive
I’ve recently bought a new external drive since my media server drive is
getting full. So I need to get it ready to work with Plex on the
Raspberry Pi. It came formatted as NTFS but I don’t really want that.
I need to figure out what filesystem I should use and how to forma tit.
Several people on this thread are suggesting XFS. They say it’s good for large files.
Okay, this site
suggests that all I need to do is to is this:
Let’s try it.
Well it does not have mkfs.xfs. Here’s what I think I have to install
to get that:
USB Drive Mounting Configuration
Here’s the fstab I’m using to mount both of my drives at once:
Installing Plex via Docker
Now, I have a Docker command-line to run:
Well, that first error is because I forgot to use sudo since I didn’t
reboot before I did all this. It ran fine after using sudo.
Then, I go to http://192.168.50.44:32400/manage to manage it…
And it works.
Wow. That was straightforward.
Running Plex With External HD
Okay, so I’ve got my media drive connected to the RasPi now. How do I re-run Plex with the new configuration?
Okay.. that wasn’t correct…
Okay! That worked!
Except that I can’t access the server from my laptop. Is it running?
It’s running. Is the port forwarding working correctly? Why don’t I try adding the port forwarding explicitly to the command line?
THAT worked.
Except…
There must be more. I can’t make a proper connection to the Plex server. I can go to http://192.168.50.44:32400/manage and it loads, but it also claims it can’t contact my Raspberry Pi. I’m missing something else here.
What if I remove that container and reinstall it?
Mmmm, no dice. It’s the same behavior.
Maybe I didn’t delete it correctly. I’m trying this:
Okay, I need to remove all of the containers associated with jaymoulin/plex.
Then I re-run the command:
And I go to 192.168.50.44:32400/manage….
And it’s the initial setup again!
Transferring Metadata From Windows to Linux
I have a Plex server on Windows already. I will be transferring all of the media files by attaching the external hard drive to the RasPi, but
I need also to transfer all of the metadata such as whether or not a file has been viewed already.
Ok, the first thing I need to do is identify where on the plex container I need to copy these files.
I can get a shell on the plex container with this command:
Okie dokie….
It’s late. TIme to stop for tonight.
I found them. Not where anyone said they’d be, but here:
On the topic of gathering the files from my current Plex server, I’ve hit something
that’s not a snag, but a difficulty.
You’re supposed to zip up the whole Plex directory - maybe without the Cache folder.
My problem is that the Updates folder is liek 6GB. Huge. It will take 20 hours to zip that so I can send it to the hard drive. Some people (in the Reddit thread) say
that you don’t even need all of those folders, you can get by with one.
Sooo…. maybe I don’t have to copy the Updates folder.
It’s worth a shot.
Heck, my Linux Plex server doesn’t even have an Updates folder.
So, how do I stop the Plex server on the Docker?
I listed the processes on a hunch:
So, I’ll kill those.
Here’s how I’m going to do this:
Zip the Plex config directories on my current server into a zip
Put the zip on the external hard drive
Attach the external hard drive to the RasPi
Reboot the RasPi
SSH into the RasPi
Get a shell on the Plex Docker
Kill Plex on the Docker
Unzip the files from the external hard drive to the Plex config directory
Restart the RasPi or at least the Plex docker container
Verify that I can see the new Plex server on all of my TVs and that the watched status looks the same as on my previous server.
Then, I just have to get torrents working from RSS and I can get rid of that old computer.
I… cannot kill Plex on the Docker with ps alone.
I will have to find another way.
Every time that I try to kill the Plex process, ALL of my shell sessions on the Docker are ended.
Okay… how is it started at startup?
Nothing in init.d.
This is my /etc/inittab:
Nothing Plex in there…
Here’s something:
This looks like the important line:
That’s the executable. It must start the others. It’s definitely the one to kill.
Maybe I can just comment out that line in the script and then restart the docker and then copy everything.
Well, I did the edit and now the container is stuck in a restart loop.
Sigh Time to wipe it out and start over.
Okay, I’m wiping it out and starting over with a twist: I’m going to map the configuration directory in the Plex Docker to a local folder where I unzipped the zip file of my
old Plex server’s configuration.
I started it with this line:
And I’m going through initial setup again. Fingers crossed.
And it doesn’t look like it took. I’m going to stop the Docker and unzip the zip file back where I mapped the paths, then start it again.
Tried that. No dice.
I went on to the Docker and couldn’t even find the configuration library where I left it last time.
It’s late. I have to put this to bed.
9/30/20
Okay, I’ve realized something: I cannot work with the entire Plex metadata directory. It’s just too damn large, even without some of the suspicious folders in there. It takes forever to zip, unzip, transfer, etc.
I just can’t do it. It won’t work.
All I need is the watched status. Plugins? I probably chose the wrong ones last time. I’ll get new ones. Logs? No. Settings? Probably not.
The steps claim I probably won’t have to do anything - it should be set up
already.
I do this command line to verify that NTP is installed and working:
Hmmmm, that’s not comforting.
Looking around on the internet, I find a thread that may help here.
I run this command as suggested:
And when I do that, it installs - it involves a lot of scrolling but there’s no
errors. When I try the verification step again, I get this:
That looks right.
Installing OpenVPN
This is how I attempt to install OpenVPN via apt-get:
So it looks like that worked.
Downloading the PIA OpenVPN Profiles
Next, i follow the steps to download and uncompress the PIA OpenVPN profiles:
Then, I copy the certificates and profiles:
Setting Up a Password File
Here’s what I did:
And, of course, in the login file I put my username on the first name, and my
password on the second line. The second command changed the permissions on the
file so only the root user can read it.
Next, I need to configure the VPN to use that file.
I need to edit the ‘/etc/openvpn/US\ Denver.conf’ file. I changed this line:
to this:
This configured OpenVPN to use that password file.
Testing the VPN
Here’s the command line I used to test the VPN as well as the result:
This is a successful result. Ctrl+C exits this.
Setting up a Torrent Client on RasPi
This seems to be
a great Docker-ish way to get a torrent client.
First, I created folders on my USB drive for torrentFiles and for torrent downlodads.
Then, I ran this:
That seems to have worked splendidly. Let’s see what we have to do to verify
the installation.
Ah, I made a mistake. I didn’t configure the paths correctly. But I had to
remove the transmssion Docker and then re-download it again, with these commands:
Now, at this point I should be able to go to 192.168.50.44:9091 with a web
browser and you should see the Transmission web interface.
It says I should install it with this command line:
What would I need to change that to for my setup?
I’m also looking at the list of environment variables from here.
I’m particularly interested in the LOCAL_NETWORK option. I want the value to
encompass everything in the 192.168.50.xxx which is my local LAN.
I’m using this site
to calculate the proper value. Turns out that it’s “192.168.50.0/24”.
So, I ran the above, and got this result:
But I still don’t get a web interface.
So I try this:
What does that even mean?
It might mean that Docker container isn’t meant for this architecture.
So I’ll use this command to pull the correct Docker container:
Now a docker ps shows its running. Is the web interface running?
Yes, in fact, it is.
Success!
However, I had no idea whether it is connected to the internet via VPN or not.
And I see no mention of an RSS option.
Testing the Torrent Client to Make Sure It’s Using VPN
I’m going to try downloading a slackware ISO torrent first for a few reasons:
It’s legal so I won’t get into any trouble if the VPN isn’t working
It will show if Bittorrent is working at all
I will hopefully be able to see where the data is being routed (hopefully the
VPN)
Sadly, once I start trying to download something, everything slows to a crawl.
I can’t even get the web interface to come back up.
I think it’s my USB drive. I think it’s so slow that it sucks.
I think I need to try another USB drive.
Oh look I waited a bit and it is in fact working.
So, to get a terminal inside the Docker container running Transmission, I do
this:
And then, since my torrent is running, I will use netstat to show me the traffic
into and out of the Docker container:
So, the 10.x.x.x activity is all over the VPN (as we can see from the ifconfig
showing that the tun0 address is 10.15.11.6). The other IPV6 activity is
the web interface for Transmission (you can see it’s on the 9091 port).
With my configuration, the .torrent file I uploaded via the web interface is
placed into ‘/mnt/usbdrive/torrents/transmission-home/torrents’. The actual
file is downloaded (temporarily) to ‘/mnt/usbdrive/torrents/transmission-home/resume’
and will be copied when it’s finished to…?
Getting the Torrent Docker Container to Start Automatically
Turns out my docker container is not starting automatically. Let’s figure out how
to do that.
Okay, from that page I want to do the Docker setup, but I have a sneaking suspicion that will create a whole new Docker container that will
include Transmission as well. I just want to download RSS feeds into the directory that my existing Transmission-VPN.
Maybe I can use one of the other set of steps.
Okay, I will need ruby within the transmission docker
so I do this:
Okay, that’s fun.
Regardless, I have some work to do with my /etc/ folder.
I need to create a configuration file with the proper RSS feed URLs in it.
It will look like this:
and this file will be called….
/etc/transmission-rss.conf
Okie. Let’s do it.
And thank God this Docker has nano.
One of the questions is… where are the paths that map to my drive supposed to be?
So, I check this file: /data/transmission-home/transmission-log
And I see this:
This tells me that, perhaps, my directoreis are not properly configured for mapping.
Indeed, poking around the Docker, I do not see a damn thing in the folders that should contain my TV shows do not… contain any shows.
So, I’ve done something wrong…..
Okay, I’ve updated my command line for running docker to this:
And.. it seems to work. I see the file where they’re supposed to be. And I see where the watch files are supposed to be.
But sadly, it doesn’t recognize any of those packages.
So I’m stuck.
Wait, I had to do another apt-get update
Then, it recognized ruby-dev
And it installed. What next?
We try the gem install transmission-rss again - and watch it fail again like this:
Oof. Da.
I have been working for 2.5 hours now. How usually effective is my time In 2.5 hours I can break apart a logjam that has afflicated a 100 million dollar project. Or I can fail to correct something that costs $0.
Well, those $100 million folks are just plain wrong about the valuation of their project.
Mine is much more important.
And more expensive.
Am I going to have fun at any point here?
Anyway, the log file they want me to look at (mkmf.log) looks like this:
At least one link says to install gcc
So I do
apt-get install gcc
It’s always something, now this:
so what now?
Supposedly, I should install ruby-dev, then maybe make.
So I do this:
And… I got nothing here.
I’m just rebooting.
Nope. Same thing. It just won’t install.
okay, i’m installing build-essential
then i’m trying to install the gem again.
it DOESN’T IMMEDIATELY FAIL.
And it doesn’t fail at all.
Do I just need that configuration file now?
It will look like this:
and this file will be called….
/etc/transmission-rss.conf
But… I have no clue whether this is working or not.
Time to put this HD babck on the other laptop.
I have utterly failed to get this working again.
Setting up a Subversion Server on a RasPi
TBD
Setting up a Jekyll Server on a RasPi
TBD
Setting up a Jenkins Server on a RasPi
TBD
Setting up a Redmine Server on a RasPi
TBD
Setting up a NAS on a RasPi
I’ve got an old hard drive that I’d like access to from my network. At this point, I sadly think Samba sharing may be the best option for file sharing with
Windows 10. I wonder if I’m right?
SSH Sharing - This looks to be pretty command-line oriented. Not really what I’m looking for.
Samba - This is what I’m assuming I’ll have to use
Shared Folders - This… looks like Samba again to me…
So, it’s Samba for me.
I’m using this site
for instructions on installing Samba.
Installing Samba
Here’s what I do:
It’s worth noting that in the middle of this, a screen came up offering to change
my configuration to allow my DHCP server to populate the WINS server address for
my network.
I’m fairly sure that I don’t have one of those, but I allowed it.
The next step from that website is to create the directory that I will share things
from and to set its permissions to ‘1777’. That would allow everyone full access.
I don’t think I want that, and anyway, my directory already exists, so I’m somewhat
unsure of just what to do in this situation. What I will do is ignore this part
of the instructions, try to share my hard drive and then see if I have permissions
issues regarding it later.
Configuring Samba
There’s a text file that holds the settings for Samba and will allow us to define
a new share. Here’s the command I used to edit the file:
Then, I add the following lines at the end of the file:
Next, apparently I have to create a user and start Samba.
Creating a User and Starting Samba
I start off by doing the same thing that they do on the website:
Hmm, that last bit is interesting. Do I need a reboot?
Let’s try!
Hmm, no, that didn’t help either.
Let’s see if we can access the share….
Yes, in fact I can. I log in with my pi username.
The share is at \192.168.50.44\share
And I can transfer at about 2MB/s.
I’ve seen worse.
Okay…. I don’t really want to be logging in to the share with the admin password for my RasPi. I’ll need to create another user and give it access to the
share.
Also, I need to change the name from [share].
Hmm, in other bad news, I detect a slowdown in the terminal while I’m transferring
this file. Interesting….
Here’s how I added the user:
I used a password of ‘guest’ since I couldn’t do blank.
And… I’m not sure that I want to go much further here. I’m not sure I want to make the share writeable at all.
I think for now I can hold off on this.
Setting up a Scans Folder
Make a folder on the NAS called ‘Scans’
Change the permissions of the directory to allow the smbuser to write to it
It’s possible we can’t do this with an exFAT formatted hard drive.
Let’s just try adding a new share that is writeable for the smbuser.
I added this to /etc/samba/smb.conf:
Then I reboot the RasPi.
But sadly, I can’t create a file from Windows when I log in as smbuser.
Step 3 is what I’m on considering that I already have Docker installed and Docker-Compose installed.
So, luckily in the paperless folder there are the two basic files that I need to create and customize.
So I follow its advice.
I’m to modify docker-compose.yml to my liking. My likings are:
Modified restart to always: restart: always
Left the web server port as was: 8000
The healthcheck stuff looks interesting, but I’ll leave it as is
Now, we get into something actionable: volumes.
There’s a data and media folder and a consume folder. What do they do?
The website says that the only thing I need to change is the consume directory - I’ll set it to /mnt/nas/Scans
Apparently I had to do this in two places: under webserver and consumer.
So I did that. Then I saved the file as docker-compose.yml.
Next, on to Docker-compose.env
I didn’t change anything there.
Now, I do this:
And, ha! I don’t have docker-compose installed. I guess I was wrong.
So I did this:
Yeah… that didn’t work. The download specifically.
Turns out the Raspberyy Pi doesn’t have a ready-made version of Compose on the official site.
So I try this here
So I try:
And it does stuff for a while…
Okay, doesn’t look like it failed anywhere.
Time to try the Docker command again.
And it works!
Working for a while….
Okay, what’s the next step?
It makes me put in a password, so I do.
Now I can log into the web interface on port 8000 @ http://192.168.50.44:8000
Well, what do I do with this?
It doesn’t specify what formats it can ingest. My scanner can do JPEG.
Okay, I have a JPEG there, I had to do some messing to get the consume directory - my source and dest were switched. Once I fixed my docker-compose file and restarted I was able to get a shell on the paperless consumer docker and cd to ‘./consume’ and see the files I expected.
I even saw unpaper running via top
But I dont’ see any documents.
I look in /usr/src/paperless/media/documents/originals and I see a PDF. You’d think that was it.
But it’s not even unskewed or anything. Doesn’t look complete by any means.
I’m wondering if my files are crashing the script?
It might be the JPEG. I removed everything except it and I still get kicked out of the consumer docker shell.
tesseract is always the last thing to run.
It looks like it finished. There’s a new .jpg in the originals folder. But no, it’s not fixed. And somehow the old pdf showed up again.