Skip to content

Instantly share code, notes, and snippets.

View LongJohnCoder's full-sized avatar

LongJohnCoder

View GitHub Profile
@LongJohnCoder
LongJohnCoder / complex.rs
Created December 6, 2020 23:13 — forked from fanf2/complex.rs
complex numbers with vanishing zeroes
use std::ops::{Add, Mul, Neg, Sub};
pub type Num = f64;
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Zero;
impl From<Zero> for Num {
fn from(_: Zero) -> Num {
0.0
# /usr/bin/env python
#
# Author: Red5d
#
# Description: Extract and run OCR on subtitles from a PGS-format .sup file.
#
# Example Usage: python sup2srt.py bd_subtitles.sup bd_subtitles.srt
#
# Dependencies:
# - pytesseract
@LongJohnCoder
LongJohnCoder / amazon.md
Created October 9, 2020 14:49 — forked from terabyte/amazon.md
Amazon's Build System

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

; https://web.archive.org/web/20190701203222/https://www.pcengines.ch/tp3.htm
; The disassembler was applied to a copy of TP 3.01A downloaded from WinWorld.
; I postprocessed the disassembly with a script to clean up spacing and column alignment.
; *** TURBO PASCAL version 3.01 A source code
; ***
; *** commented by Pascal Dornier
; *** all rights reserved
; "***
cseg $100 ; "COM file...

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@LongJohnCoder
LongJohnCoder / _README.md
Created June 15, 2020 06:25 — forked from ligaz/_README.md
WASM Interpreter
// Created by Guillermo Enriquez on 09/10/2012.
// Copyright 2012 nacho4d. All rights reserved.
int main(int argc, char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, @"Application", @"AppDelegate");
[pool drain];
return retVal;
}
@LongJohnCoder
LongJohnCoder / yify.md
Created May 14, 2020 20:39 — forked from kuntau/yify.md
YIFY's Quality Encoding

For those that want to keep the YTS going (No, IDGAF about people that don't care for YTS quality) get HandbrakeCLI https://handbrake.fr/downloads... and use the following settings:

user@user:~$HandBrakeCLI -i /file/input.mp4 -o /file/out.mp4 -E fdk_faac -B 96k -6 stereo -R 44.1 -e x264 -q 27 -x cabac=1:ref=5:analyse=0x133:me=umh:subme=9:chroma-me=1:deadzone-inter=21:deadzone-intra=11:b-adapt=2:rc-lookahead=60:vbv-maxrate=10000:vbv-bufsize=10000:qpmax=69:bframes=5:b-adapt=2:direct=auto:crf-max=51:weightp=2:merange=24:chroma-qp-offset=-1:sync-lookahead=2:psy-rd=1.00,0.15:trellis=2:min-keyint=23:partitions=all

Reason to use CLI over GTK has to do with lack of support for advanced settings for Handbrake GTK

** Don't Re-encode already shitty encodes...get good source!**

@LongJohnCoder
LongJohnCoder / ipxe_with_dhcp.txt
Created April 10, 2020 18:15 — forked from tuxfight3r/ipxe_with_dhcp.txt
ipxe kickstart over http - dhcp and static configuration
#clone the repo
git clone http://git.ipxe.org/ipxe.git
cd ipxe/src
cat >ubuntu-amd64-installer.ipxe <<EOF
#!ipxe
dhcp
echo Starting Ubuntu x64 installer for ${hostname}
set base-url http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${base-url}/linux
@LongJohnCoder
LongJohnCoder / ..runasTI.bat
Created March 15, 2020 21:06 — forked from AveYo/..runasTI.bat
Lean and Mean runas TrustedInstaller / System compact snippet to easily integrate in your batch scripts
@echo off & title AveYo`s :runasTI snippet usage showcase (final)
:: First handle command line parameters (for example via Send to) to run as TrustedInstaller AllPrivileges
if /i "%~dp0" equ "%APPDATA%\Microsoft\Windows\SendTo\" call :runasTI 1 %* &exit/b
echo(
echo Fully portable, compact, plain-text runas TrustedInstaller or SYSTEM snippet v20191010
echo ========================================================================================
echo - now also supports short common programs names such as cmd, regedit, powershell..
echo - now sets console buffer so that the scrollbars are visible!