06/21/2018
While getting ready for my big move to Facebook, I came across way too many old laptops. One in particular had a solid 128GB of disk space that I couldn’t bring myself to throw into the electronics recycling bin. After looking around online for some good potential use cases, I finally decided that I’d try my hand at setting up a simple Linux-based local media server.
For this project, I wanted to run my server constantly in my room, allowing me to upload photos, videos, and documents from any device on the network to the server safely and securely. It turns out, the process is actually quite simple, consisting of the following steps:
The following section details how to set up the “server” part of the media server. Before beginning, be sure to have a user account named media
.
This section will describe how to start an SSH server on your server machine.
First, install openssh
:
sudo pacman -S openssh
Then start the sshd service:
# systemctl start sshd.service
your SSH server should now be started. You should be able to run the following from your server and successfully SSH into the server itself:
media@myhostname ~]$ ssh media@localhost
Let’s now confirm that we can successfully SSH into the server. Find your server’s local IP address:
ip addr | grep "inet"
This number will have the form X.X.X.X
Then, from a different device on the same network, you should be able to SSH into the server:
ssh media@X.X.X.X
If the above works, you should now be able to upload files to the media server using scp
. To upload a folder, use the -r
flag. Otherwise, order the arguments to be source file to destination:
scp -r ./local_dir media@X.X.X.X:/path/to/destination
You can even do the same process from your Android phone. Termux is a terminal app designed for mobile phones. Simply install Termux, download the openssh
package, and perform a secure copy of your mobile device’s files. To get access to Android’s photos, you may need to run the following in Termux:
termux-setup-storage
This gives you permissions to the media folders on your device and populates the home folder with a storage subdirectory.
Here is how to turn your server machine into a minimalist media-viewing device using the Chromium web browser.
We’ll give our media
user media-viewing capabilities by running Chromium full-screen when startx
is called. Within the browser, you should be able to open PDFs, movie files, and images, making it a great all-in-one media-viewing application.
First, run the following installation:
sudo pacman -S xorg xorg-xinit chromium
After the install is complete, edit your .xinitrc
file to include the chromium
command. This file is executed when startx
is run:
echo chromium >> ~/.xinitrc
Personally, I had some issues with the display not fully filling the screen when I ran startx
. To fix this, I changed the Chromium config file at ~/.config/chromium/Default/Preferences
to have the window_placement
object fill the entire screen’s coordinates. See this stackoverflow link for more information.
And with that, you should be able to reuse any old laptops for file storage and file previewing!
08/22/2018
Toward the Light: Behind the Scenes
07/01/2018
Arch Linux: Chromebook C720 Webcam Microphone Disappeared
06/21/2018
SSH: How to Set Up a Simple Local Media Server
02/28/2018
Pacman: File Conflicts
01/17/2018
Making an Arch Linux USB Flash Install Medium
01/17/2018
Arch Linux: Post-Install Notes
01/15/2018
Binary Classification Metrics
01/14/2018
Probabilitistic Classification
01/09/2018
Classification and Perceptron
01/08/2018
Linear Regression: Bayesian Approach, Normal Conjugacy
01/08/2018
Nonlinearity: Basis Functions
01/04/2018
Linear Regression: A Probabilistic Approach
12/30/2017
Linear Regression: A Mathematical Approach
12/20/2017
2017 Reflections: A Year of Curating
12/19/2017
Introduction to Regression: K-Nearest Neighbors
12/18/2017
Welcome to my Miscellaneous Blog!
12/18/2017
A Definitive Arch Linux Install Guide for the Chromebook C720
10/01/2017
C4D: Volume Effector
09/18/2017
Algorithms: Maximum Sliding Window
09/10/2017
Introduction to Inference: Coins and Discrete Probability
09/05/2017
C4D: Unreliable Booles
08/30/2017
Welcome to my Tech Blog!
08/30/2017
Welcome to my Problem Solving Blog!
Previous: Pacman: File Conflicts | Next: Arch Linux: Chromebook C720 Webcam Microphone Disappeared