Skip to content

Instantly share code, notes, and snippets.

View TotalLag's full-sized avatar

Chris Phan TotalLag

View GitHub Profile
@TotalLag
TotalLag / create_collage.sh
Last active February 2, 2024 17:56
This script is designed to create a selective and impactful collage, utilizing a 3x5 tile layout to present a selection of moments from the video. By extracting 15 frames at optimized intervals and sizes, and outputting as a high-quality JPEG, the script aims to produce a visually engaging summary of the video content.
#!/bin/bash
# Check for the correct number of arguments
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <video_filename>"
exit 1
fi
VIDEO_FILE="$1"
DURATION=$(ffmpeg -i "$VIDEO_FILE" 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F: '{print $1*3600+$2*60+$3}')
@TotalLag
TotalLag / tw-card.html
Created October 3, 2022 23:55
simple business card
<!--
https://play.tailwindcss.com/7Lezp1m7gx
-->
<div class="relative flex min-h-screen flex-col justify-center overflow-hidden bg-gray-50 px-6 py-6 font-serif antialiased sm:py-12">
<img src="/img/beams.jpg" alt="" class="absolute top-1/2 left-1/2 max-w-none -translate-x-1/2 -translate-y-1/2" width="1308" />
<div class="absolute inset-0 bg-[url(/img/grid.svg)] bg-center [mask-image:linear-gradient(180deg,white,rgba(255,255,255,0))]"></div>
<div class="relative flex min-w-full bg-white shadow-xl ring-1 ring-gray-900/5 sm:mx-auto sm:max-w-lg sm:rounded-lg">
<div class="mx-auto grid w-full grid-cols-2">
<div class="flex flex-col justify-center gap-6 lg:gap-24">
<h1 class="mx-auto text-5xl font-bold lg:text-8xl">[Your Name]</h1>
@TotalLag
TotalLag / ffmpeg.txt
Created August 14, 2022 18:35
Record 10seconds chunks of streams, combine then, remux.
ffmpeg -i "url.m3u8" -c copy -map 0 -reset_timestamps 1 -f segment -segment_time 10 -strftime 1 "%Y-%m-%d__%H:%M:%S.ts"
cat *.ts > all.ts
ffmpeg -i all.ts -c copy all.mp4
@TotalLag
TotalLag / config.boot
Last active August 8, 2022 19:56
My config commands on a UBNT EdgeRouter 5 PoE
firewall {
all-ping enable
broadcast-ping disable
group {
address-group Chromecast {
address 239.255.255.250
description "Use /32"
}
address-group Private-RFC-Ranges {
address 10.0.0.0/8
@TotalLag
TotalLag / ascii
Last active April 3, 2022 03:08
Valorant Crosshair
==========================================================================================================================================================================================================
==========================================================================================================================================================================================================
==========================================================================================================================================================================================================
======================:::::::::===========================================================================================================================================================================
==========================================================================================================================================================================================================
=========
@TotalLag
TotalLag / ascii
Created April 2, 2022 21:23
Valorant Crosshair
================================================================================
================================================================================
================================================================================
================================================================================
================================================================================
=================================------------:==================================
==============================---:==========:---================================
==============================---:===:--:===:---================================
==============================---:====--====:---================================
==============================----==========:---================================
@TotalLag
TotalLag / sandboxie.ini
Created February 15, 2022 03:43
Sandboxie config for Steam
[GlobalSettings]
FileRootPath=\??\%SystemDrive%\Sandbox\%USER%\%SANDBOX%
SeparateUserFolders=y
KeyRootPath=\REGISTRY\USER\Sandbox_%USER%_%SANDBOX%
IpcRootPath=\Sandbox\%USER%\%SANDBOX%\Session_%SESSION%
NetworkEnableWFP=n
EditAdminOnly=y
ForceDisableAdminOnly=n
ForgetPassword=n
Template=WindowsRasMan
@TotalLag
TotalLag / crawl.sh
Last active September 3, 2021 11:30
modified to warm up cloudflare cache
#!/bin/bash
# warmly.sh
# A wget based, easy, poor man`s cache warmer script
# https://gist.github.com/thomasfr/7926314
# The MIT License (MIT)
#
# Copyright (c) 2013,2014 Thomas Fritz <fritztho@gmail.com> (http://fritzthomas.com)
#
@TotalLag
TotalLag / EdgeMax advanced-queue QoS
Last active August 5, 2020 03:57
An upgrade from traffic-policy shaper
set traffic-control advanced-queue root queue 1 bandwidth 50mbit
set traffic-control advanced-queue root queue 1 attach-to global
set traffic-control advanced-queue queue-type sfq SFQ_DOWN
set traffic-control advanced-queue queue-type fq-codel FQCODEL_UP ecn disable
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN target 5ms
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN quantum 1514
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN limit 1001
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN interval 50ms
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN flows 1024
set traffic-control advanced-queue queue-type fq-codel FQCODEL_DOWN ecn enable
@TotalLag
TotalLag / win-runas.py
Created July 15, 2020 02:29
Re-run the program with admin rights in Python
import sys
import ctypes
def is_admin():
try:
return ctypes.windll.shell32.IsUserAnAdmin()
except:
return False
if is_admin():