Skip to main content

Raspberry Pi Download Machine Part 3

Sometimes I Leave the House

I go to work, to friends and sometimes just wonder around London. So what happens when a new post r/opendirectories appears, and I gotta grab me the new Marvel bullshit so I can take the piss out of it? For this to work we need external access.

Port Forwarding

Before I head into the world of port forwarding I'd just like to say that I am not a fan at all. Anything open is a way into you system and network, that being said here is how you do it.

All of your devices are on a Local Area Network, that then goes out onto the internet to get stuff like dank memes and bring them back. Your router does the job of looking at who requested something and therefore whom to deliver to. Also your LAN appears on the internet as a single external IP address. So this leads to 2 questions:
  1. If sending to an external IP how does it know what internally it needs to send to? It doesn't
  2. But what about sending information in without a prior request? Well big nope for that one
Port Forwarding takes care of both of these. You will first of all tell it what service is to be made available for outside requests. Each service on a system has an individual port so that is what we use. Next we need to tell it what internally we need to reach, so now we use the IP address of the Pi. Sometime you can do a port redirection, this is where the port externally is changed to port internally. An entry into a router may look something like this:

Best thing to do is just Google you router model number and 'port forward'.

Dynamic DNS

So another issue that can arise is that your external IP address can constantly change. Here in the UK BT Broadband can change nearly every day! So the best thing to do to Set up a dynamic address that you can update. Basic you subscribe to a service and pick a URL, the you have something internally update your IP to the service whenever the IP changes.

So every service differs so sign up, choose a domain and setup the updater on your router or pi.

Changing the Profile 

Now in the Aria2App for Android, select Edit or delete profile and select the profile you use. Change the address to your host from Dynamic DNS and port number to the external set up in the forwarding. And hoorah you now have external access!!


Popular posts from this blog

Adventures in Pillow Part 2

From my last post where I made a slideshow promo video, I realised how powerful Pillow is. I still have a fair bit of automation to do, so another thing I do a lot of is motivational quotes for Twitter (I am aware they are fucking stupid, but they share well)

The breakdown of the components are a background with a filter, the quote, who said it and our logo.
Background and Filter To start off I am going to create a folder called quote and add in an image and just name it background.jpg (sourced from Pixabay). Next I import PIL and open the file.
from PIL import Image import os, errno cwd = os.getcwd() image_dir = os.path.join(cwd, 'quote') def filterImage(imageFile): im = filterImage(os.path.join(image_dir, 'background.jpg'))

Next I need to crop the image. I am going to take the centre portion out of the image to make square. Like so:
So I start off with getting the dimensions of the image with:
I get a tuple of (1920, 1…

Adventures with Pillow Part 1

I am in the middle of building an app and need to put together several promo videos for Twitter and Instagram, and man it is boring. So I thought 'how can I automate this process?', so welcome to this post.

What I am going for is a selection of images, greyscaled flipping through with our logo on the front. So my approach was to use python, pillow and ffmpeg to build something. This could be disastrous.

To start a few pre-flight checks, a variable for the test image and to check for/create a processed folder for the final images to go.

import os, errnofrom PIL import Image, ImageFont, ImageDraw testImage = 'test.png'cwd = os.getcwd()image_dir = os.path.join(cwd, 'images')default_dir = os.path.join(cwd, 'processed')try: os.makedirs(default_dir)except OSError as e: if e.errno != errno.EEXIST: raise
I am going to build a function that will do all of the processing, but first going to run on one image before looping through all of the …

Raspberry Pi Download Machine Part 1

Yet Another Raspberry Pi Project Kodi builds, weird fucking robots and classic gaming always seems to be the theme of RPi projects. But a stat I would like to know is how many are just sat in a drawer somewhere. Anyway I am part of that number, until now. I manage to find a 4TB drive and managed to blag a caddy, so with this triangle of 'crap hanging around' I thought I'd build a downloader.

Open Directories So I first had the idea from the sub-reddit open directories, here storage devices are opened up to the internet without a morsel of authentication. Google comes along and indexes them and you can go and find them. Decent ones find themselves on this sub of which I assume stays up until the user realises that there broadband is getting absolutely raped.
So I wanted to be able to get a URL from a server and just throw it in a WebUI and get it to auto download and ping me when all is finished. 

First Steps So to start off I downloaded Raspbian Jessie Lite from 2017-07-0…