Skip to content

Instantly share code, notes, and snippets.

@kevincolten
kevincolten / app.js
Last active December 9, 2017 20:47
React TODO
import React, { Component } from 'react';
import { connect, Provider } from 'react-redux';
import { createStore, combineReducers } from 'redux';
import ReactDOM from 'react-dom';
import { ListGroup, ListGroupItem, Card, CardTitle, CardBody, CardFooter } from 'reactstrap';
// +----------------+
// | |
// | ACTIONS |
// | |
@kevincolten
kevincolten / ssh.sh
Created September 22, 2017 15:41
Run Command Over SSH with password bypass fingerprint prompt
sudo apt-get update
sudo apt-get install sshpass
sshpass -p your_password ssh -oUserKnownHostsFile=/dev/null user@hostname
@kevincolten
kevincolten / vpn.md
Last active September 4, 2018 03:32
Setting up PIA and OpenVPN on a Raspberry Pi
  1. sudo apt-get update

  2. sudo apt-get upgrade -y

  3. sudo apt-get install openvpn unzip dnsutils geoip-bin -y

  4. (mkdir openvpn && cd openvpn && unzip ../openvpn.zip)

  5. ( echo username; echo password; ) | tee /home/pi/openvpn/pass.txt

  6. ( echo auth-user-pass pass.txt; echo auth-nocache;) | tee --append US\ East.ovpn

  7. sudo nano /etc/init.d/VPNConnection

#! /bin/sh
@kevincolten
kevincolten / GrovePi.md
Last active July 17, 2017 21:58
Motion camera

Receive email if movement

  1. Download Raspbian Jessie Lite
  2. Use Etcher to burn OS image to SD Card
  3. Install motion-mmal
sudo apt-get install -y libjpeg-dev libavformat56 libavformat-dev libavcodec56 libavcodec-dev libavutil54 libavutil-dev libc6-dev zlib1g-dev libmysqlclient18 libmysqlclient-dev libpq5 libpq-dev
wget https://www.dropbox.com/s/6ruqgv1h65zufr6/motion-mmal-lowflyerUK-20151114.tar.gz
tar -zxvf motion-mmal-lowflyerUK-20151114.tar.gz
This file has been truncated, but you can view the full file.
# hpHosts - Ad and Tracking servers only
#
# The following are hosts in the hpHosts database with the ATS classification ONLY.
# This file will NOT protect you against malicious domains
#
127.0.0.1 localhost #IPv4 localhost
::1 localhost #IPv6 localhost
#
# AD SERVERS START HERE
#
@kevincolten
kevincolten / index.html
Created May 30, 2017 00:39
React Example
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Welcome</title>
</head>
<body>
<div id="welcome">
</div>
@kevincolten
kevincolten / failingTerm.sql
Last active April 27, 2017 18:53
Campus Manager Queries
SELECT
weighted.first_name,
weighted.last_name,
weighted.phone,
weighted.username,
weighted.term,
weighted.course,
weighted.city,
ROUND(SUM(weighted.score), 0) as score
FROM (
@kevincolten
kevincolten / styleguide.md
Last active April 8, 2017 15:06
ACA Styleguide

ACA Styleguide - Necessary vs Sugary Syntax

Things we will look for

  • Does it stay consistent across more complex variations
  • Is it visually grep-able for errors
  • Does it translate to other targeted WebDev languages
    • Python
    • PHP
    • Ruby
  • How far is it from the ES5 implementation?
@kevincolten
kevincolten / README.md
Created February 28, 2017 21:11
React in the DOM

In your browser devtools, you can access the React component in the console with window.component

Try typing window.component.setState({ name: 'Kevin' });

@kevincolten
kevincolten / form.html
Created February 23, 2017 02:01
Iframe Post Message
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
</head>