Skip to content

Instantly share code, notes, and snippets.

View DustinAlandzes's full-sized avatar

Dustin Alandzes DustinAlandzes

View GitHub Profile
ifconfig
sudo reboot
ifconfig
ping k.ro
ifconfig
ping k.ro
exit
sudo reboot
ifconfig
ping k.ro
# from: http://blog.ibmjstart.net/2015/12/15/spark-wifi/
# The amount of time permitted between concatenate pings at a location before a
# ping is bucketed into a distinct dwell session (prevents long gaps in dwell sessions).
# Value in seconds. For example: 25 minutes would be 25 * 60
MAXIMUM_DWELL_INACTIVITY = 25*60
# The amount of inactivity required at one location before being registered as
# visiting a different locaiton (prevents phantom movement),
# Value in seconds. For example: 5 minutes would be 5*60
MINIMUM_DWELL_INACTIVITY = 5*60
127.0.0.1 - - [22/May/2017 14:46:14] "GET /count HTTP/1.1" 200 -
Total Probes: 1186870
--- 26.035404205322266 seconds ---
Total Probes (within -60dBm): 325116
--- 4.782991170883179 seconds ---
uniques (everything): 138385
--- 1501.291000843048 seconds ---
uniques (>= 60 dBm): 15569
--- 13.264475107192993 seconds ---
log4net: XmlHierarchyConfigurator: Hierarchy Threshold []
mono-sgen: ../../../../src/cairo-xlib-surface-shm.c:619: _cairo_xlib_shm_pool_create: Assertion `*ptr != ((void *)0)' failed.
Stacktrace:
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Drawing.GDIPlus.GdipDrawImageRectI (intptr,intptr,int,int,int,int) <0x00053>
at System.Drawing.Graphics.DrawImage (System.Drawing.Image,int,int,int,int) <0x000eb>
at (wrapper remoting-invoke-with-check) System.Drawing.Graphics.DrawImage (System.Drawing.Image,int,int,int,int) <0x000fb>
at System.Windows.Forms.ThemeWin32Classic.DrawPictureBox (System.Drawing.Graphics,System.Drawing.Rectangle,System.Windows.Forms.PictureBox) <0x0026f>
at System.Windows.Forms.PictureBox.OnPaint (System.Windows.Forms.PaintEventArgs) <0x00087>
<!-- Kill /usr/bin/mono and omxplayer-->
<keybind key="C-S-k">
<action name="Execute">
<command>pkill -f omxplayer</command>
</action>
<action name="Execute">
<command>pkill -f mono</command>
</action>
</keybind>
<!-- Pull up NCompass Manager -->
def build_dwell_times(pings, max_dwell, min_dwell):
"""
Builds a collection of dwell times from a collection of discrete pings.
@param pings: array of dicts with these attributes: {"mac":, "signal_strength:, "first_seen":, "last_seen":, "count":}
@param max_dwell: max time between pings before a new dwell time is added
@param min_dwell: min time between pings before they're considered sessions
@return an array of dwell times
"""
dwell_times = []
postgres_db = {'drivername': 'postgres',
'username': 'postgres',
'password': 'postgres',
'host': '192.168.99.100',
'port': 5432}
db_uri = URL(**postgres_db)
engine = create_engine(db_uri)
import datetime
from flask import Flask, jsonify, request
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.exc import IntegrityError
from marshmallow import Schema, fields, ValidationError, pre_load
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = 'postgresql://username:password@url:5439/database'
db = SQLAlchemy(app)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#fresh ubuntu 16.04 digital ocean server
apt-get install unzip emacs wget curl python-pip
pip install -U 'ipython[notebook]'
jupyter notebook --generate-config
nohup jupyter notebook