Skip to content

Instantly share code, notes, and snippets.

@dantheman213
dantheman213 / ffmpeg.md
Last active April 23, 2024 18:10
ffmpeg cheatsheet

ffmpeg cheatsheet

Extract video at 30 seconds in and the duration with be 5 seconds

ffmpeg -ss 00:00:30 -i orginalfile -t 00:00:05 -vcodec copy -acodec copy newfile

Add a watermark logo to the bottom right of the video offset by 30 x 30 from corner

@dantheman213
dantheman213 / Xbox Controller (GCPad).ini
Last active April 21, 2024 16:03
Dolphin Gamecube/Wii emulator / Xbox One Controller profile
# Dolphin Gamecube/Wii emulator / Xbox One Controller profile
# Gamecube Controller
# Location -> C:\User\<your user>\Documents\Dolphin Emulator\Config\Profiles\GCPad\Xbox Controller (GCPad).ini
[Profile]
Device = XInput/0/Gamepad
Buttons/A = `Button A`
Buttons/B = `Button B`
Buttons/X = `Button X`
Buttons/Y = `Button Y`
@dantheman213
dantheman213 / android-copy-pics-from-phone-to-pc.cmd
Last active April 2, 2024 20:01
Copy pics from Android to PC
:: Faster to copy files using ADB than than using MTP apparently
adb pull sdcard/DCIM/Camera %USERPROFILE%\Desktop\Camera
@dantheman213
dantheman213 / export_db_structure.sh
Last active March 5, 2024 02:55
Batch backup and export your Postgres or PostgreSQL table schemas and stored functions or procedures into individual *.sql files --the easy way!
#!/bin/sh
# AUTHOR
# DANIEL E. GILLESPIE (2016)
# https://github.com/dantheman213
# DESCRIPTION
# Export your app's table schemas and stored functions from a PostgreSQL
# database into individual *.sql files for easy management and source control.
@dantheman213
dantheman213 / setup-game-proxy-server.sh
Last active January 30, 2024 06:48
Create game proxy server to forward traffic to your home network through VPN
#!/usr/bin/env bash
# Create game proxy server to forward traffic to your home network through VPN.
# Great for a cheap Linode, Digital Ocean, etc $5/mo server for modest traffic.
# Keep your home network and IP safe by setting up an isolated VPN to connect your public external proxy to your protected home network
# Keep costs down by using a server you already have at home instead of paying large sums every month just to host some games with your friends.
# Example diagram
# User / Game Client -> Internet -> Your cheap VPS proxy server -> OpenVPN -> Your home network -> Your home server
@dantheman213
dantheman213 / GetPrimaryNetworkAdapters.cs
Last active January 13, 2024 10:15
Get primary network adapter(s) info for C#
using System;
using System.Linq;
using System.Net.NetworkInformation;
using System.Net.Sockets;
namespace GetPrimaryNetworkDeviceInfoExample
{
public class Program
{
public static void Main()
@dantheman213
dantheman213 / install-deepin-arch-manjaro-readme.md
Last active November 19, 2023 01:20
Install Deepin Desktop Environment from a minimum Arch or Manjaro Install Operating System

Install Deepin Desktop Environment In Arch or Manjaro

I recommend doing this as a net/minimum install with Manjaro (no desktop manager attached with the install).

Update sources & packages

pacman -Syu
reboot -h now
@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 / uninstall_docker.md
Created April 25, 2019 23:29
Uninstall Docker

To completely uninstall Docker:

Step 1

dpkg -l | grep -i docker To identify what installed package you have:

Step 2

sudo apt-get purge -y docker-engine docker docker.io docker-ce

@dantheman213
dantheman213 / macos-terminal-config-for-linux-windows.md
Last active March 4, 2023 20:11
MacOS Terminal Settings for Linux or Windows Terminal