Skip to content

Instantly share code, notes, and snippets.

View yourbuddyconner's full-sized avatar

Conner Swann yourbuddyconner

View GitHub Profile
#include <SPI.h>
#include <Ethernet.h>
// For ethernet shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };// MAC Address
char server[] = "arduinotest.meteor.com"; // Server to connect to
// IP Address in case we don't get one from DCHP
IPAddress ip(192,168,0,177);
EthernetClient client;
@yourbuddyconner
yourbuddyconner / collections.js
Last active August 29, 2015 14:02
Meteor Collections
Projects = new Meteor.Collection("projects");
Sensors = new Meteor.Collection("sensors");
Readings = new Meteor.Collection("readings");
// THE LINE BELOW SHOULD BE COMMENTED OUT!
//SimpleSchema.debug = true;
Schemas = {};
Schemas.project = new SimpleSchema({
@yourbuddyconner
yourbuddyconner / collections.js
Last active August 29, 2015 14:02
problem inserting into meteor collection
Projects = new Meteor.Collection("projects");
Sensors = new Meteor.Collection("sensors");
Readings = new Meteor.Collection("readings");
// THE LINE BELOW SHOULD BE COMMENTED OUT!
//SimpleSchema.debug = true;
Schemas = {};
Schemas.project = new SimpleSchema({
@yourbuddyconner
yourbuddyconner / server.py
Created June 29, 2014 08:53
Python server to listen to a TCP socket and dump traffic to a file, then serve that file via HTTP
# A simple script that creates two TCP sockets, one that listens
# for and handles HTTP traffic on port 9000 and one that
# listens for and handles vanilla TCP traffic on port 9001
# Web Server portion is set up to support Cross Origin Requests, FYI
import sys # for exit()
import BaseHTTPServer # for WebHandler
import SocketServer # for everything
import json # for json parsing
@yourbuddyconner
yourbuddyconner / open_ssh_port_osx.md
Last active August 29, 2015 14:05
Open up more than one SSH port on OSX

###Simply edit this file:

/System/Library/LaunchDaemons/ssh.plist

and add this to it:

  <key>Listeners2</key>
  <dict>
      <key>SockServiceName</key>

22022

@yourbuddyconner
yourbuddyconner / dns_update.sh
Last active April 10, 2017 15:11
NameCheap Dynamic DNS Updater Script
#/bin/bash
Host_Name=host
Domain=example.com
Password="PASS_HASH_FROM_NAMECHEAP"
IP_Address=$(curl -s icanhazip.com)
url="https://dynamicdns.park-your-domain.com/update?host=$Host_Name&domain=$Domain&password=$Password"
result=$(curl -s --globoff $url)
@yourbuddyconner
yourbuddyconner / gen_copy_ssh_keys.sh
Last active August 29, 2015 14:05
Bash Script To Generate and Copy SSH Keys To An External Server
##########################################
# This script relies on the package "ssh-copy-id". It's on all your major package
# managers. This script was written for an OSX environment, but there's no reason
# why it wouldn't work on other unix-ey platforms.
#
# WARNING: Use this at your own risk, I'm not responsible if you break something by running it.
#
# The following happens when this script runs.
# .5. Data is gathered.
# 1. Keys are generated and named based on the short name you supply in ~/.ssh/.
@yourbuddyconner
yourbuddyconner / instructions
Created September 15, 2014 20:10
Patch old iPhone Binaries
sed -i'' 's/\x00\x30\x93\xe4/\x00\x30\x93\xe5/g;s/\x00\x30\xd3\xe4/\x00\x30\xd3\xe5/g;' old_ios_binary
ldid -s old_ios_binary
@yourbuddyconner
yourbuddyconner / getliked.py
Created April 15, 2015 23:07
Get all liked imgur photos from Reddit account
import requests
import requests.auth
import json
import urllib
import os
#setup
if not os.path.exists("liked_images"):
@yourbuddyconner
yourbuddyconner / gifenc.sh
Created July 21, 2016 19:36
Encode video file to gif using ffmpeg
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=15,scale=320:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2