Skip to content

Instantly share code, notes, and snippets.

View dantheman213's full-sized avatar
๐Ÿš€

Dan dantheman213

๐Ÿš€
View GitHub Profile
@dantheman213
dantheman213 / encoder.sh
Created February 23, 2017 00:42
Convert all of your video files to x264 for massive space savings
fmpeg -i $file -c:v libx265 -x265-params lossless -c:a copy -c:s copy output.mkv
@dantheman213
dantheman213 / youtube-dl_cheatsheet.md
Last active January 23, 2022 01:40
youtube-dl best way to download video or entire to high quality mp3

youtube-dl cheat sheet

Docs and Binary for youtube-dl are located here:

https://github.com/rg3/youtube-dl/

Install dependencies

apt-get install libav-tools ffmpeg # Linux (either one of either should do) brew install ffmpeg # OSX choco install ffmpeg # Windows

@dantheman213
dantheman213 / win32-api-marshal-reference.md
Last active March 20, 2017 17:55
Marshaling Win32 API Data Types To .NET
#/bin/bash
# Get the Dependencies
# Copy and paste the whole code box for each step. First install the dependencies:
sudo apt-get update
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \
libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev
@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 / count_lines_of_code_git.sh
Created May 27, 2017 19:06
Count how many lines of code are in git repo
git ls-files | xargs wc -l
@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 / 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 / docker_clean.sh
Last active October 6, 2023 09:01
Reset Docker to a clean vanilla state
#!/usr/bin/env bash
# Reset Docker to a clean vanilla state. Will destroy all containers, images, networks, volumes, and cache.
[ $(docker ps | wc -l) -ne 1 ] && echo "Stopping all containers..." && docker stop $(docker ps | sed -n '1d;p' | awk -F" " '{print $1}')
[ $(docker ps -a | wc -l) -ne 1 ] && echo "Deleting all containers..." && docker rm $(docker ps -a | sed -n '1d;p' | awk -F" " '{print $1}')
[ $(docker images | wc -l) -ne 1 ] && echo "Deleting all images..." && docker image rm $(docker images | sed -n '1d;p' | awk -F" " '{print $3}')
echo "Pruning networks, volumes, and cache..." && docker system prune -a -f --volumes
echo "Docker is back to Vanilla... COMPLETE!"
@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: