Skip to content

Instantly share code, notes, and snippets.

@kevincolten
kevincolten / Rainforest.cs
Last active May 23, 2018 01:44
Rainforest OOP
using System;
using System.Collections.Generic;
namespace RainForest {
class Program {
static void Main (string[] args) {
Company rainforest = new Company ("Rainforest, LLC");
string[] cities = new string[] { "Austin", "Houston", "Dallas", "San Antonio" };
string[] items = new string[] { "Banana", "Toothpaste", "Baseball", "Laptop" };
@kevincolten
kevincolten / Mastermind.cs
Last active May 16, 2018 02:05
Mastermind in C#
using System;
using System.Collections.Generic;
namespace Mastermind {
class Program {
static void Main (string[] args) {
Game game = new Game (new string[] { "a", "b", "c", "d" });
for (int turns = 10; turns > 0; turns--) {
Console.WriteLine($"You have {turns} tries left");
Console.WriteLine ("Choose four letters: ");
@kevincolten
kevincolten / unused-images.sh
Created April 21, 2018 22:30
find unused images
find ./_images/* |
awk -F/ '{print $NF}' |
sort -u > ./tmp/images.txt &&
grep -IhFriof ./tmp/images.txt --exclude-dir=".git" . |
awk '{print $0}' | sort -u | comm -23 ./tmp/images.txt -
@kevincolten
kevincolten / wordpress-aws.sh
Created April 11, 2018 15:01
Wordpress AWS Notes
aws s3 sync ~/Documents/uploads/ s3://rcrwireless.com/wp-content/uploads
@kevincolten
kevincolten / my.cnf
Created December 17, 2017 07:08
MAMP max_allowed_packet
# This files lives at /MAMP/conf
[mysqld]
max_allowed_packet = 100M
@kevincolten
kevincolten / colors.scss
Last active December 15, 2017 03:10
Color Tachyons
$blue: #0026FF;
$red: #FF0000;
$yellow: #F2FF00;
$colors: (
blue: $blue,
red: $red,
yellow: $yellow
);
@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