Skip to content

Instantly share code, notes, and snippets.

@dantheman213
dantheman213 / win32-api-marshal-reference.md
Last active March 20, 2017 17:55
Marshaling Win32 API Data Types To .NET
@dantheman213
dantheman213 / transcode_media_ffmpeg.sh
Last active March 25, 2017 01:00
Batch transcode mp4 files from a directory, set bitrate, and output to another directory.
#!/bin/sh
#
# Batch transcode mp4 files from a directory,
# set bitrate, and output to another directory.
# User-defined parameters
INPUT_DIR="/home/user/Videos/pre"
OUTPUT_DIR="/home/user/Videos/post"
MEDIA_EXTENSION="mp4"
TARGET_BITRATE_VIDEO="8M"
@dantheman213
dantheman213 / main.go
Created September 26, 2017 22:38
Simple Go Rest App
package main
import (
"fmt"
"encoding/json"
"github.com/gorilla/mux"
"log"
"net/http"
)
@dantheman213
dantheman213 / encrypt_openssl.md
Created January 8, 2018 02:25 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@dantheman213
dantheman213 / Dockerfile
Created April 29, 2018 21:07
Node JS Bootstrap Run Environment w/ run script that can inject secret env vars locally or into Docker or Kubernetes
# NodeJS v6 official image
FROM node:boron
EXPOSE 8080
EXPOSE 9229
WORKDIR /opt/app
RUN npm install -g node-sass grunt grunt-cli grunt-sass
@dantheman213
dantheman213 / main.cpp
Last active April 29, 2018 21:11
LeagueHelperUrf - League of Legends Urf Mode Assist. Spam the QWER keys as fast as possible using C++.
#include <iostream>
#include <thread>
#include <windows.h>
#include <conio.h>
const WORD keyCodes[4] = {
0x51, // Q
0x57, // W
0x45, // E
@dantheman213
dantheman213 / cloudsql-proxy.service
Created May 12, 2018 00:57
Systemd start-up script for Google Cloud SQL Proxy for Postgres
[Install]
WantedBy=multi-user.target
[Unit]
Description=Google Cloud Compute Engine SQL Proxy
Requires=network.target
After=network.target
[Service]
Type=simple
@dantheman213
dantheman213 / README.md
Last active May 12, 2018 17:41
Youtube Download Cheatsheet

Youtube Download Cheatsheet

Download and install binary here: https://github.com/rg3/youtube-dl

Get Best Video and Audio

youtube-dl.exe -f "best[ext=mp4]" --no-check-certificate <VIDEO URL>

Get worst video no audio

youtube-dl.exe -f "worstvideo[ext=mp4]" --no-check-certificate

@dantheman213
dantheman213 / execute_nodejs_project.sh
Last active June 17, 2018 14:41
Allows NodeJS projects with long path dependancies to run inside Windows vagrant VMs
#!/bin/bash
#
# Summary:
# Exeucute Node.JS projects with 'long path' npm dependancies
# while using Vagrant on Windows
#
# Description:
# Vagrant with a Windows host and a Linux guest has issues with
# very long paths between shared folders. The goal of this script
# is to solve the problem by copying, syncing, and updating dependancies
@dantheman213
dantheman213 / main.sh
Created July 17, 2018 03:56
Read every line of an environment variable file for Docker in as a standard bash script.
while read fileLine; do echo "Exporting ${fileLine}...\n"; export ${fileLine}; done < secrets.env
// EX: secrets.env
// MY_VAR=123
// MY_API_KEY=ASDFKJDSFJL234545