Display current routing table route -n Discover which interface will be used for a specific IP address ip route get 8.8.8.8 Setting wlan interfaces to be high priority for routing than eth0, if present sudo nano /etc/dhcpcd.conf Add these lines to the end (or add "metric" to the existing interface definitions if you've already specified […]
All posts by
Detect RPi Hardware Version
Get Human Readable Hardware Details cat /proc/cpuinfo Get RPi Version Code Use the command: cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' The returned code can be looked up on the table at http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/ , copied below:
Running a command line tool on a child thread
The following example runs hcidump on a child thread. This happens to be a bluetooth bluez tool which continuously outputs events as it seens them. This code allows this to happen on a child thread with the output passed back to the main application thread using a named pipe. Create the pipe and the child thread process […]
.BlueZ general
BlueZ is the official Linux Bluetooth stack Documentation https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc https://docs.ubuntu.com/core/en/stacks/bluetooth/bluez/docs/index Tutorials http://people.csail.mit.edu/albert/bluez-intro/
USB OTG Port
Using the USB Port in slave device mode RPi boards that don't include a USB hub IC, such as the RPi Model A and RPi Compute Module, can take advantage of the USB OTG feature. https://gist.github.com/gbaman/50b6cca61dd1c3f88f41
.Compute Module 3 Overview
Technical Documentation The Compute Module datasheet is available here. Hardware In simple terms the RPi Compute Module is a Raspberry Pi 3 without PSU etc circuitry, connectors and with a 4GB Flash IC instead of the SD card socket. On the PCB: BCM2837 processor with 1Gbyte of RAM (as used on the Raspberry Pi 3) 4Gbyte eMMC Flash IC, […]
Win10 IoT Core on the Raspberry Pi
We have another mini web site with our resources on Win10 IoT Core for the Raspberry Pi which is at: https://skanky.dev/csharp/category/windows-10-iot-core A lot of our own use of the Raspberry Pi is for commercial projects and Windows IoT Core brings along several advantages in this area for us on some projects: Notable disadvantages of Windows IoT Core We still think Raspbian and […]
SHA256 hash
Generate a hash of a string, file, whatever. Salting your hash Combine your salt with what is being hashed (e.g. typically you do this with a password). SHA256 and other hash generation algorithms don't take salt but if you add the salt to the end of what is being hashed you will get a different result, hence […]
.Installing Openssl C++ Library
Installing the library sudo apt-get install libssl-dev Add the linker option for the library -lcrypto Documentation https://www.openssl.org/docs/manmaster/man3/ The documentation isn't always great and their search doesn't always work, but on the Libraries page search for the function name you want into on and it will be there
Create Random String
Create A Random String //#include <time.h> //************************************************* //************************************************* //********** GENERATE RANDOM CHAR STRING ********** //************************************************* //************************************************* //Length length including terminating null void generate_random_char_string (char *output_char_string, int length) { int count; static const char stringcharacterset[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; unsigned int iseed = (unsigned int)time(NULL); //Seed srand() using time() otherwise it will start from a default value of […]