Welcome to 2bytes.

This is a place to share my projects. It’s a technical blog, where you’ll find the things I find interesting and worth sharing. It might be a project of mine, some code or configuration, an electronics project, or just my findings on a certain subject.

SSH 2-Factor’s First Factor

In my previous post “SSH 2-Factor on Linux (RPi)” we enabled OTP as a second factor. That’s a nice step in securing your SSH sessions however it’s not the only step, and in fact is usually not the first.

In this post I’m going to explain a little more about the first factor of two factor authentication for SSH and give a tutorial on using cryptographic key pairs for your first factor instead of using a plain old password.

As always, I try to be as beginner-friendly as possible so if any of the following is obvious, please skip ahead to the tutorial.

read on →

SSH 2-Factor on Linux (RPi)

In this post I will show how simple it is to enable 2-Factor authentication using a Raspberry Pi, and your smartphone, but this can also be done for other Linux devices and servers too.

read on →

IoT Danger Zone - Part 3 - Firmware

Note: I’m going to put a few links in this post to definitions, Wikis and/or articles, feel free to detour there and read more depth about anything of interest that I don’t cover in details here. Most modern devices that connect to the internet require some form of software to run. In home electronic devices such as routers, security cameras and even smart phones this software is also known as firmware.
read on →

IoT Danger Zone - Part 2 - IP Cameras, baby monitors, and smart kettles

There are a growing number of devices in the home that connect to the internet, some of the most prolific in terms of remote attack are those designed to give the user access remotely, perhaps from their mobile when they are away from home. Devices such as DVRs (Digital Video Recorders) and security cameras that allow you to check on your home while you’re away, do so by opening a connection out to the internet that you can connect to remotely.
read on →

IoT Danger Zone - Part 1 - DDoS

Introduction to DDoS “The Internet of Things” is a popular phrase these days, and whether people know it or not, they probably have devices in their home that would he considered one of these “Things” Recently, a huge number of these devices were exploited globally and used to cripple huge swathes of the internet by way of a DDoS (Distributed Denial of Service) attack. What is DDoS? First let me state what a DDoS is not.
read on →

[Linux] Backup Git repos when USB device is inserted

One thing I have always struggled with is finding the time to make backups. You don’t always want to automate this over the internet for various reasons and might want to backup to an external drive that you can stash away safely. Recently I decided that my home git server should be backed up and stored elsewhere, off-site. Making sure to do that regularly can be an effort, particularly so, when you run a headless server.
read on →

Pushover BASH script - Bashover

Recently, I had an issue with my web server, the one hosting this site, where MySQL died. It wasn’t until several (16) hours later, when my Android Email app notified my of failed logins, that I realised there was a problem. For the entirety of this time, anything hosted on this box had been without a database connection, which obviously meant this blog was also down. The first thing that struck me, when wading through the logs to find out what went wrong, was that I had known absolutely nothing about the problem for so long.
read on →

Serial Commander - Arduino UART Command Library

Sadly, this post won’t be as image heavy as I like to make them. On it’s own, there is little to show, but the thing that’s really exciting abut this simple library is that it allows me to update Pixel Commander to a point I consider ready to continue the project I’ve spent a long time procrastinating over. Serial commander is intended to be an easy to use, serial command library for controlling your Arduino projects.
read on →

Raspberry Pi B vs B+ Power

With the recent release of the Raspberry Pi B+, I was lucky enough to be working right next to Westminster bridge where the very kind Element 14 were giving out free Raspberry Pi B+ and Ice Cream, both of which I managed to get my hands on, thanks guys! One of the key factors that interested me with the new Pi was its move to more efficient switching regulators instead of the old linear (read: inefficient) ones it had before.
read on →

Open Logic Sniffer Case

So this story beings quite recently, when, being the ‘noob’ that I am, I reversed the polarity while setting up the Linksprite UART camera ready for another post. Sadly, I had my bench supply set to unlimited current. Well, long story short, the camera is dead. Sad times, because beyond the first post I made about it, I haven’t even had a change to use it yet. Well, having destroyed my latest toy, I thought I’d buy a new one to make up for it.
read on →

Pixel Commander - Arduino UART RGB L.E.D. Controller

UPDATE 2016: This project is not dead, but, technology has improved since I started the project and there are now several alternatives; First of all, the APA102 RGB L.E.D is much easier to work with (SPI, so it’ll work on the Raspberry Pi’s non-realtime OS) and also, FastLED is a much better way of managing L.E.Ds Pixel Commander is part of a much larger project I’m currently working on. Its purpose is to allow me to remotely control one of the LED boards shown in the image (the board design will also be open sourced when it is complete).
read on →

Linksprite JPEG UART Camera + Arduino

UPDATE 2016: Sadly this camera died shortly after this first post, so further development was not carried out. Unfortunately, due to the price, and relative capability compared to more modern options (a la Raspberry Pi Camera) I do not intend to replace the camera. Although it was educational while it lasted, it will never be anything more than just that, educational. Here is a small piece of code I threw together with help from the original source from Linksprite allowing me to interface with the Colour UART Camera from an Arduino board, over SoftwareSerial.
read on →

Bits & Niggles - Dialogs

UPDATE 2016: I really had to bring this post across to the new site because it amazes me that to this day there are popular apps that still haven’t figured this out. After we have spent years getting used to and developing applications that fit this paradigm of positive-on-the-right, I still have apps I rely on installed on my Nougat (Android 7.0) toting Nexus 6 that not only look hideous on its 1440x2560, 492dpi screen, their dialogs still have positive-selection buttons on the left.
read on →

Tips n Tricks - Surface Mount Soldering

Surface mount soldering if somewhat of an art. Maybe not a fine art, but one that I can appreciate none the less. I have been soldering for the while now, over 10 years (wow that makes me feel old). I’m not sure how much longer than that, because I was only child back then. Surface mount soldering, however, is an entirely new game I have decided to play. How I got there is a long story, perhaps for another time, but needless to say, I realised, I wanted needed, to give it a go.
read on →