Skip to content

Instantly share code, notes, and snippets.

  1. Download latest Miniconda for Python 2.7
https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh
  1. Open terminal

  2. Change to download folder location

@jbott
jbott / acc_to_angles.ino
Last active July 7, 2016 20:29
Set of scripts to do get angles from the 9dof sensor stick
#include <Wire.h>
#include <I2Cdev.h>
#include <ADXL345.h>
ADXL345 acc;
void setup() {
Serial.begin(9600);
Wire.begin();
acc.initialize();
<source>
@type http
port 9880
</source>
<filter **>
@type stdout
</filter>
<match **>
/*
Basic MQTT example
This sketch demonstrates the basic capabilities of the library.
It connects to an MQTT server then:
- publishes "hello world" to the topic "outTopic"
- subscribes to the topic "inTopic", printing out any messages
it receives. NB - it assumes the received payloads are strings not binary
It will reconnect to the server if the connection is lost using a blocking
void setup() {
// put your setup code here, to run once:
for (int i = 2; i < 11; i++) {
pinMode(i,OUTPUT);
digitalWrite(i, HIGH);
}
}
void loop() {
// put your main code here, to run repeatedly:
group: H01
emp = {
id:number, salary:number
12345, 100
99999, 200
}
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
@jbott
jbott / ubnt_pkt_deconstruct.py
Last active June 12, 2022 19:07
De/construct ubnt discovery packets. Useful for spoofing ubnt discovery packets when on a VPN because this AmpliFi Wifi app is dumb and doesn't let you specify an IP address to connect to.
"""
De/construct ubnt discovery packets
references:
- https://github.com/nitefood/python-ubnt-discovery
- https://gist.github.com/trhura/5998584
"""
from base64 import b64decode, b64encode
from enum import IntEnum