Skip to content

Instantly share code, notes, and snippets.

View aphex3k's full-sized avatar
🇺🇦
Слава Україні!

Michael Henke aphex3k

🇺🇦
Слава Україні!
  • Dexcom
  • San Diego, CA
  • 21:58 (UTC -08:00)
View GitHub Profile
@aphex3k
aphex3k / tesseract PDF
Created November 21, 2016 17:12
How to OCR a PDF file using tesseract and imagemagick
convert -density 300 {input.pdf} -depth 8 {output.tiff}
tesseract {output.tiff} {basePath} -l {language}
@aphex3k
aphex3k / custom_settings.json
Last active February 9, 2017 04:31
Tiko 3D printer advanced custom settings
{
"infillPercent": 25.0,
"layerThickness": 0.2,
"temperature": 199.0,
"manualLevelEnabled": 0,
"autolevelOffset": 0,
"flowPercentage": 1,
"minLayerTime": 0,
"coastLength": 2.5,
"shells": 3,
@aphex3k
aphex3k / unload_pla.gcode
Last active April 7, 2017 06:06
A 3D printer gcode file that helps unloading your current PLA filament
; Author: Michael Henke <gcode-at-codingmerc-dot-com>
; 4/7/2017
;
; Store this gcode on your printers SD-card or remote management to have it
; handy whenever you plan to change filament
M104 S200 ; Set nozzle temp, no wait.
M117 Autohome...
G28 ; 1st things 1st: Home all axis
G90 ; set absolute position to move the effector a set distance from 0
M117 Relax Bowden...
@aphex3k
aphex3k / storj
Created October 21, 2017 18:31
Storj ERC20 Token Contract Address
Addr: 0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac
Token Symbol: STORJ
Decimals: 8
@aphex3k
aphex3k / ytmp3.sh
Created May 30, 2018 22:08
Convert Youtube video to mp3
youtube-dl -k -x --embed-thumbnail --embed-subs --audio-format mp3 "https://www.youtube.com/watch?v=3JZ4pnNtyxQ"
[
{
"UTC": -7,
"CityName": "Los Angeles",
"Storm": {},
"Searchable": false,
"DeviceName": "Donna Sky",
"RegisterTime": 1433814467,
"DST": 1,
"BoundedPoint": "",
@aphex3k
aphex3k / pi-compose
Created November 13, 2018 19:11
compose image to fullscreen wallpaper for raspberry pi touchscreen display
#!/bin/bash
t_width=800
t_height=480
if [ -f "${1}" ]
then
convert "${1}" -auto-orient oriented.bmp
convert oriented.bmp -resize ${t_width}x${t_height} foreground.bmp
convert oriented.bmp -resize ${t_width}x${t_height}^ -gaussian-blur 5x5 -crop ${t_width}x${t_height}+0+0 -modulate 120,10 background.bmp
@aphex3k
aphex3k / practical examples.md
Created November 28, 2018 05:45
FFMPEG transcoding using NVENC

ffmpeg -y -hwaccel cuvid -c:v mpeg2_cuvid -i input.ts -c:v h264_nvenc -preset slow -profile:v high -level 4.2 -vf format=yuv420p -rc vbr_hq -qmin 23 -qmax 32 -maxrate 5M -bufsize 10M -c:a copy -map 0:0 -map 0:1 output.mp4

@aphex3k
aphex3k / ffmpeg_cuda.md
Last active November 5, 2025 05:41
Transcoding MPEG2 TS to H.264 MP4

Transcoding MPEG2 TS to H.264 MP4

The goal is to transcode a DVR recording containing one video source in mpeg2 format, any number (typically 2-3) of audio sources in ac-3 format and maybe a subtitle source all together in a transport stream container. In addition the video stream might be interlaced.

The target is a video file playable natively on modern iOS and Android devices using their platforms native and hardware supported playback capabilities.

Target file container and formats

The target file container and supported stream formats are listed below to ensure very good playback compatibility on modern devices and platforms.

  • MP4/M4V container format
@aphex3k
aphex3k / External Compression.md
Last active July 7, 2020 22:43
EAC Additional command-line options

MP3

Audio-Book, mono, good quality, small files

-V0 -B 48 -Y -q 0 -m m -p -c --resample 22.05

AAC

Audio-Book, good quality, small files