Skip to content

Instantly share code, notes, and snippets.

View JamesMarino's full-sized avatar
👋

James Marino JamesMarino

👋
View GitHub Profile
# DNS Spoofing
dnsspoof -i eth0 -f hosts
# ARP Spoofing (Pass all traffic through the device)
sudo arpspoof -i eth0 -t 10.0.0.138 10.0.0.8
sudo arpspoof -i eth0 -t 10.0.0.8 10.0.0.138
# hosts file is like this
# 10.0.0.28 *.facebook.com
@JamesMarino
JamesMarino / Motion - Cameras.md
Last active October 26, 2016 13:13
Raspberry Pi Setup

Motion - Camera setup

// Install Camera $ apt-get install motion $ nano /etc/motion/motion.conf > stream_localhost off $ nano /etc/default/motion > start_motion_daemon = yes

// Control Camera (Use Below motion command)

@JamesMarino
JamesMarino / Root Certificate.md
Last active May 26, 2017 17:06
Generating Root Certificates

Root Certificate

The Root CA Certificate

  1. This will create a Root Certificate Authority

openssl genrsa -out rootCA.key 2048

  1. This will sign it
@JamesMarino
JamesMarino / VigenereBreaker.js
Created March 18, 2017 03:14
Vigenere Breaker
"use strict";
function getIncidenceOfCoincidence(sequence) {
// Get frequency
let frequencyTable = {};
for (let letter of sequence) {
if (!frequencyTable.hasOwnProperty(letter)) {
frequencyTable[letter] = 1;
@JamesMarino
JamesMarino / TouchBar
Created May 15, 2017 01:53
Disable the TouchBar
#!/bin/bash
function enableTouchBar() {
local presentationModeProperties="<dict><key>app</key><string>fullControlStrip</string><key>appWithControlStrip</key><string>fullControlStrip</string><key>fullControlStrip</key><string>app</string></dict>"
defaults delete com.apple.touchbar.agent PresentationModeGlobal
defaults write com.apple.touchbar.agent PresentationModeFnModes $presentationModeProperties
launchctl load /System/Library/LaunchAgents/com.apple.controlstrip.plist
@JamesMarino
JamesMarino / useful_cognito.md
Created August 31, 2017 06:48
Useful Cognito
@JamesMarino
JamesMarino / api_gateway_custom_authoriser.js
Created October 29, 2017 00:12
Lambda Custom Authoriser API Gateway
exports.handler = (event, context, callback) => {
var token = event.authorizationToken;
switch (token.toLowerCase()) {
case 'allow':
callback(null, generatePolicy('user', 'Allow', event.methodArn));
break;
case 'deny':
callback(null, generatePolicy('user', 'Deny', event.methodArn));
break;
@JamesMarino
JamesMarino / arduino_nano_clone_setup.md
Last active November 10, 2017 16:09
Arduino Nano Clone - Setup - Mac OSX

Arduino Nano Clone - Setup - Mac OSX

Instructions

  1. Install Arduino Studio

  2. Install USB Microcontroller Driver for WCH CH340G

2.2 Go to WCH manufacturer site - http://www.wch.cn/

@JamesMarino
JamesMarino / google_photos_upload_prep.sh
Created April 29, 2018 07:09
Google Photos Upload Prep
# Change to directory with photos
cd /Users/me/photo/upload
# Flatten Current Directory (Forces overwrite)
find . -mindepth 2 -type f -exec mv -f '{}' . ';'
# Delete all folders (Assumes empty)
find . -type d -delete
# Split into 5000 files per folder