Skip to content

Instantly share code, notes, and snippets.

View BrentonPoke's full-sized avatar

Brenton Poke BrentonPoke

  • Lansing, MI
View GitHub Profile
{
// '11b65a88-7c94-4a97-8a20-a00488040a0a[1], 128x64px
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
@BrentonPoke
BrentonPoke / main.cpp
Created September 30, 2022 16:44
Old MamaDuck Exemple - Commented-out battery stuff
#include <string>
#include <arduino-timer.h>
#include <MamaDuck.h>
#include <Arduino.h>
#include <unishox2.h>
#include <ctime>
#ifdef SERIAL_PORT_USBVIRTUAL
#define Serial SERIAL_PORT_USBVIRTUAL
#endif
@BrentonPoke
BrentonPoke / coords.cpp
Created August 16, 2022 20:52
Generating GPS coords within radius
#include <iostream>
#include <string>
#include <random>
#include <cmath>
void getLocation(double x0, double y0, int radius) {
std::random_device rd;
std::uniform_int_distribution<int> dist(0,49);
// Convert radius from meters to degrees
double radiusInDegrees = radius / 111000.0;
#include <BLEAdvertisedDevice.h>
#include <BLEDevice.h>
#include <BLEScan.h>
const int PIN = 2;
const int CUTOFF = -60;
void setup() {
pinMode(PIN, OUTPUT);
BLEDevice::init("");
@BrentonPoke
BrentonPoke / nbaiot.py
Created January 1, 2022 22:39
Python script that trains on IoT intrusions
# %% [markdown]
# # IoT Intrusion Detection
#
# The N-BaIoT Dataset contains traffic data for 9 IoT devices. The data comprise of both benign traffic and of a variety of malicious attacks. Here we run three deep neural networks to identify cyberattacks on a Provision PT-737E Security Camera.
# %% [code] {"jupyter":{"outputs_hidden":false}}
import datetime
import numpy as np
import pandas as pd
@BrentonPoke
BrentonPoke / Dockerfile
Last active October 2, 2020 19:52
This work well enough for me now and I will likely update it with better scripts and conventions
FROM openjdk:8-jdk-alpine
WORKDIR /backend/neo4j
EXPOSE 8080
ARG JAR_FILE=target/backend-2.0.0.RELEASE.jar
COPY ${JAR_FILE} app.jar
COPY target/dependency/* dependency
ENTRYPOINT ["java","-jar","app.jar"]
@BrentonPoke
BrentonPoke / ServiceGenerator.java
Created August 18, 2020 14:36
Retrofit service generator example
public class WeatherServiceGenerator {
private static final String BASE_URL = "https://api.weather.gov";
static ObjectMapper mapper = new ObjectMapper();
private static Retrofit.Builder builder
= new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(JacksonConverterFactory.create(mapper));
@BrentonPoke
BrentonPoke / bitwarden-update.sh
Created August 7, 2020 01:49
updates Bitwarden. Doesn't create desktop file.
wget -O Bitwarden-x86-64.AppImage 'https://vault.bitwarden.com/download/?app=desktop&platform=linux'
mv Bitwarden-x86-64.AppImage /usr/local/bin/
chmod +x /usr/local/bin/Bitwarden-x86-64.AppImage

Keybase proof

I hereby claim:

  • I am brentonpoke on github.
  • I am brentonpoke (https://keybase.io/brentonpoke) on keybase.
  • I have a public key ASDMbfsxJjpnCeb-4OVltSyeLedxizy7PYhu-PXZIpkq5wo

To claim this, I am signing this object:

if (response.code() != 200) {
Converter<ResponseBody, WeatherServiceException> errorConverter =
TestWeatherServiceGenerator.retrofit.responseBodyConverter(
WeatherServiceException.class, new Annotation[0]);
// Convert the error body into our Error type.
WeatherServiceException error = errorConverter.convert(response.errorBody());
}