Skip to content

Instantly share code, notes, and snippets.

View k4kfh's full-sized avatar

Hampton k4kfh

View GitHub Profile
@k4kfh
k4kfh / GitUp_Git2P_Manual.md
Last active January 13, 2018 00:48
GitUp Git2/Git2P | Unofficial Manual

Unofficial Manual for GitUp Git2/Git2P Action Cameras

I love my Git2P camera, but I am very disappointed in the unprofessional forum-style support available for even basic functions on the cameras. I had to read 3 forum posts to even figure out how to connect it to a wifi network. Unacceptable!

So this Gist aims to be an unofficial manual for the Git2, and it may be applicable to other GitUp cameras.

Accessing the Video Feed via Wi-Fi

The camera serves up a video feed via RTSP whenever it is connected to WiFi (client mode or AP mode). To view the stream, all you need is a video player capable of opening an RTSP stream.

@k4kfh
k4kfh / lowhangingfruit_linux.sh
Last active December 8, 2017 23:15
Script to knock out the low hanging fruit on CyberPatriot Linux
#!/bin/bash
echo "-- UNDERGROUND CYBERNINJAS --"
echo "-- Linux Easy Button Script --"
echo ""
echo "Enabling firewall..."
sudo ufw enable
echo ""
echo "Listing unauthorized users (make sure you've filled in authorized_users.txt)..."
ls /home | grep -vf "./authorized_users.txt"
@k4kfh
k4kfh / binarycounter.py
Created November 20, 2017 17:29
Pi Binary Counter
# Binary counter
import RPi.GPIO as GPIO
import time
redPin = 27
greenPin = 17
bluePin = 22
yellowPin = 19
@k4kfh
k4kfh / friendCipher
Last active November 20, 2017 15:25
Cipher a friend made up
key1 = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
key2 = ['z', 'y', 'x', 'w', 'v', 'u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
import re
def encrypt(string):
#first split it into a list of words
wordList = re.sub("[^\w]", " ", string).split()
useKey = key1
encodedString = "|"
@k4kfh
k4kfh / pyCaesar
Last active November 20, 2017 01:01
Simple Python Caesar cipher decrypting/encrypting library
# Just a simple Caesar cipher library
# Define a list of the alphabet
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
def decryptCharacter(char, rotation):
# Find where in the alphabet our letter is (for example A would be index 0)
indexOriginal = alphabet.index(char)
# Now we take the index of the original letter and add our key, and this will be the index of the new letter
indexNew = indexOriginal - rotation
# This is just in case we're dealing with Z or something else where the index would go over 25. It makes the list basically loop infinitely
This is just a personal note so I remember the parameters.
Re-encode Video: -vf scale=-2:1080,fps=60 -c:v libx264 -crf 17 -acodec copy
Strip album data from audio, leave codec itself: -map_metadata -1
@k4kfh
k4kfh / cyberpatriot-dl.sh
Created October 10, 2017 22:23
Simple automatic download/checksum script for CyberPatriot.
#!/bin/bash
URL="http://example.com/file.img"
MASTER_CHECKSUM="d276d89cf506e3dc66ffb7550eec6223"
FILENAME=$(basename "$URL")
clear
wget $URL -O $FILENAME
@k4kfh
k4kfh / make-directories.py
Created July 27, 2017 20:34
Recursive, random directory creation with Python
import os,sys,uuid
global injectedLegitFile
injectedLegitFile = True
def fillDirectoryWithFiles(path, numFiles, size):
file_names = [(str(uuid.uuid4())[:10] + ".xlsx") for i in range(0,numFiles)]
#print file_names
for name in file_names:
fileObject = open(path+"/"+name,"w+")
fileObject.write(os.urandom(size))
@k4kfh
k4kfh / http-proxy-test.py
Created July 7, 2017 19:13
This script will make HTTP requests on a regular basis and log any errors to a file with a timestamp. Useful for testing proxies.
# PROXY TESTER
# Run this script with an array of URLs and it will make HTTP requests. Whenever it encounters an error it will timestamp it and log it
#import libs
import urllib2
import hashlib
import sys
import time
import datetime
#config
@k4kfh
k4kfh / arduinoWelder.ino
Created February 21, 2017 22:38
Non-blocking Arduino Arc Welder Simulator
unsigned long currentMillis = 0;
unsigned long previousMillisArc = 0;
unsigned long previousMillisFlicker = 0;
int timeArcOff = 3000;
int timeArcOn = 3000;
bool arc = false; //whether there's an arc right now or not
int ledState = LOW;
const int ledPin = 2;
int timeFlickerOn = 50;
int timeFlickerOff = 170;