Skip to content

Instantly share code, notes, and snippets.

View msolters's full-sized avatar
☁️
A sufficiently sophisticated chat bot

Mark Solters msolters

☁️
A sufficiently sophisticated chat bot
View GitHub Profile
@msolters
msolters / .zshrc
Created September 9, 2020 22:49 — forked from dwchiang/.zshrc
gcloud with zsh
# The next line updates PATH for the Google Cloud SDK.
source /Users/dwchiang/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc
package main
import (
"fmt"
"strings"
"strconv"
)
func main() {
grid := generateGrid()
@msolters
msolters / gist:5e4eba39a5fbeacf62f1937dc723a94f
Last active June 8, 2020 04:08
Install Docker for Ubuntu
# Get key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Add PPA
# Note: may need to manually specify "xenial" if zesty not supported
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
@msolters
msolters / adaptivesec merge conflicts
Created April 14, 2017 00:17
Merge conflicts derived from kkrentz adaptivesec -> 6lbr develop
CONFLICT (content): Merge conflict in platform/cc2538dk/contiki-main.c
CONFLICT (modify/delete): core/net/llsec/noncoresec/noncoresec.c deleted in ea1650d721c6c57e32f6235d7ee392e27b44200e and modified in HEAD. Version HEAD of core/net/llsec/noncoresec/noncoresec.c left in tree.
CONFLICT (add/add): Merge conflict in core/net/llsec/adaptivesec/coresec-strategy.c
CONFLICT (add/add): Merge conflict in core/net/llsec/adaptivesec/akes.c
CONFLICT (add/add): Merge conflict in core/net/llsec/adaptivesec/akes-nbr.h
CONFLICT (add/add): Merge conflict in core/net/llsec/adaptivesec/akes-nbr.c
CONFLICT (add/add): Merge conflict in core/net/llsec/adaptivesec/adaptivesec.h
CONFLICT (add/add): Merge conflict in core/net/llsec/adaptivesec/adaptivesec.c
CONFLICT (content): Merge conflict in core/net/ip64/ip64-ipv4-dhcp.c
CONFLICT (add/add): Merge conflict in core/lib/iq-seeder.c
@msolters
msolters / build-rootfs.sh
Last active March 19, 2017 20:17
Builds a basic Debian rootfs for a CHIP Pro using multistrap
#!/bin/bash
# Prerequisites:
# * You are inside the CHIP-SDK directory
# * CHIP-SDK/CHIP-buildroot is compiled and rootfs.tar is uncompressed ->
# CHIP-SDK/CHIP-buildroot/buildroot-rootfs
# Usage:
# sh build-rootfs.sh multistrap.conf
HERE="$PWD"
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2015.08.1-00154-gb52c25c-dirty Configuration
#
BR2_HAVE_DOT_CONFIG=y
BR2_HOSTARCH_NEEDS_IA32_LIBS=y
#
# Target options
#
sudo ip link show wlan0
sudo rfkill unblock wifi
sudo ip link set wlan0 up
echo "network={
ssid=\"2.4GHz Home WiFi\"
#psk="poopoohotpot"
psk=6aa49bf0c3ed3c6c045c761c697eba918c55439ae91e4eb4b215a57df4d6e909
}" > home_wifi.conf
wpa_supplicant -B -D wext -i wlan0 -c home_wifi.conf
sudo dhclient wlan0
1. Clone the CHIP-SDK
1. Build a rootfs using CHIP-buildroot
3. Create NAND image from rootfs
4. Flash NAND image to CHIP Pro
git clone https://github.com/nextthingco/CHIP-SDK
cd ~/CHIP-SDK
./setup_ubuntu_14.04 # get dependencies
sudo apt-get install qemu-user-static live-build
import spidev
import time
spi = spidev.SpiDev()
spi.open(0,1)
spi.max_speed_hz = 5000;
led = False
while True:
if led is True:
@msolters
msolters / enter-chroot-example
Created January 17, 2017 08:36
Chrome OS - Enter Linux from CLI
sudo enter-chroot -n precise