Compile locally and run on raspberry pi via Clion

Background

Compiling C/C++ code on the raspberry pi is very slow, I have some code I am writing that compiles in less than 5 seconds on the laptop but can take 30 minutes on the raspberry pi. This is pretty annoying and slows down testing of code tweaks.

I have found a way of automating this quite successfully via Clion (Commerical software from Jetbrains).

Raspberry pi tools

Firstly we need to get the raspberry pi compile toolchain.

https://github.com/raspberrypi/tools

Git clone this somewhere on your local filesystem.

Read more…

Please share πŸ™‚
error

CherryTree custom codeblock background

A ramble of why…..

…..i want to change the background colour of CherryTree’s codeblocks.

I use Linux as my OS of choice and have for many years. One thing that has been missing is a really good all round note application. I have always wanted something like Onenote but for the past few years I have discovered how powerful markdown is. The use of the ‘`’ (back tick) to insert command line or code in the middle of a document is extremely useful, I find it so much easier to read because it breaks down the text into a consumable form.

These days there are a lot of Electron markdown note taking apps popping up, this isn’t necessarily a bad thing but I find electron apps don’t look very good at all in Linux. I use typora at work on my Mac and it looks native. The same application just looks pretty bad under Ubuntu. Yes it does look worse because it is a Snap but even under fedora it isn’t great.

Read more…

Please share πŸ™‚
error

LVM Transaction ID mismatch and metadata resize error

I nearly lost my LVM thin pool on my laptop recently due to the metadata nearly filling up (99.4%). I first noticed this when trying to install something and the root filesystem was read only. Rebooting the machine re-mounted the root partition as RW. Trying to get this pool into a healthy shape gave me all sorts of transaction id and meta errors so hopefully this post will assist someone.

My LVM Layout

I use LVM on my Fedora 27 system along with encryption; it is probably useful to share the layout so the rest of the blog makes sense.

Using the LVS command:

Read more…

Please share πŸ™‚
error

Raspberry Pi 20×4 LCD i2c C++ Driver

Introduction

I have written a C++ driver for the common 20×4 LCD using i2c on the Raspberry Pi. These LCDs are based onΒ HD47780. Most examples I found are using the pins directly and not through i2c. I2c uses a lot less pins than directly connecting the LCD. I originally wrote this in C and then decided to convert to C++, as I am re-learning C++!

Breadboard Layout

Read more…

Please share πŸ™‚
error

FreeNAS Failed to create mountpoint

Problem

I have two FreeNAS servers running version 9.10 on a HP MicroServer Gen 8. The main server has 16 GB RAM with a Intel(R) Xeon(R) CPU E3-1220L V2 @ 2.30GHz while the secondary has 8 GB RAM and a Intel(R) Celeron(R) CPU G1610T @ 2.30GHz. These two replicate data in both directions for off site backup. I recently upgraded them both to FreeNAS 11 U2 while also taking the opportunity to migrate backups from ISCSI ZVOL to Datasets. This meant replicating the new datasets.

Read more…

Please share πŸ™‚
error

FreeNAS 9.10 Replication can not mount

Problem

Replication has been working fine using a dedicated user until I decided to move my backups from ISCSI shares to NFS shares, thus having to replicate from scratch. The replication seems to work as the dataset is transferred and the data is readable on the remote side. However on the push side it is marked as “Failed”, then after a short while it is marked as “Up to date” but no snapshot is listed in the column “Latest snapshot sent to remote side”.

In the logs (tail -f /var/log/debug.log) I kept noticing this:

AugΒ  8 19:19:29 nas autorepl.py: [tools.autorepl:157] Replication result: cannot mount ‘RBS-POOL/Backup/Backups’: Insufficient privileges

Read more…

Please share πŸ™‚
error