Skip to content

Instantly share code, notes, and snippets.

View drewmoseley's full-sized avatar

Drew Moseley drewmoseley

View GitHub Profile
# ostree CLI
man ostree
ostree --help
# create ostree repo
ostree --repo=repo init
tree -a
# add a file
mkdir -p rootfs && echo Hello > rootfs/hello.txt
@drewmoseley
drewmoseley / yocto-iot-rpi-demo.sh
Created October 4, 2019 16:57
IOT Yocto MQTT Demo
#!/bin/bash
#
repo init -u https://github.com/mendersoftware/meta-mender-community \
-m meta-mender-raspberrypi/scripts/manifest-raspberrypi.xml -b thud
mkdir .repo/local_manifests/
wget -P .repo/local_manifests/ https://raw.githubusercontent.com/drewmoseley/meta-iot-demo/master/templates/manifest-iot-extras.xml
repo sync
. setup-environment raspberrypi
bitbake-layers add-layer $(readlink -f ../sources/meta-iot-demo)
@drewmoseley
drewmoseley / build-yocto-qemu.sh
Last active August 19, 2019 00:57
Yocto + QEMU testing setup
#!/bin/sh
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
xterm
git clone git://git.yoctoproject.org/poky -b yocto-2.7.1
source poky/oe-init-build-env
cat >> conf/local.conf <<'EOF'
SSTATE_MIRRORS = "\
@drewmoseley
drewmoseley / iot-mqtt-bbb-actuator.py
Created October 9, 2018 15:11
Sample mqtt weather app
#!/usr/bin/python
import paho.mqtt.client as mqtt
def onConnect(client, obj, flags, rc):
print("Connected. rc = %s " % rc)
client.subscribe("iot-bbb-example/weather/temperature")
client.subscribe("iot-bbb-example/weather/precipitation")
# Dummy function to act on temperature data
def temperatureActuator(temperature):
@drewmoseley
drewmoseley / build.sh
Last active August 23, 2018 13:38
Toradex/Hosted Mender Yocto setup and build
#!/bin/bash
#
TOPDIR=$(pwd)
if [ ! -x ${TOPDIR}/src/poky/oe-init-build-env ]; then
echo "Unable to locate Poky start script src/poky/oe-init-build-env"
exit 1
fi
@drewmoseley
drewmoseley / yocto-mender-rpi3.sh
Last active June 8, 2022 13:44
Script to build Yocto+Mender for Raspberry Pi 3
#!/bin/bash
#
if [ "$(/bin/ls -1A | wc -l)" -ne "0" ]; then
echo Please run this from an empty directory.
exit 1
fi
BASE=$(pwd -P)
3>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
3> SoccerBot.UWP -> C:\Users\Drew Moseley\Desktop\WinIoTSoccerBot\src\SoccerBot.UWP\bin\Debug\SoccerBot.UWP.dll

Keybase proof

I hereby claim:

  • I am drewmoseley on github.
  • I am drewmoseley (https://keybase.io/drewmoseley) on keybase.
  • I have a public key ASCd-TRdnzefTFMtUsjiRvIqrTYhqGkI3p2CtG2i9qJatQo

To claim this, I am signing this object:

@drewmoseley
drewmoseley / 0_reuse_code.js
Created June 5, 2014 23:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console