Skip to content

Instantly share code, notes, and snippets.

@gullinbursti
gullinbursti / repositories
Last active November 13, 2023 18:14
AlpineLinux APK Repositories
#/media/cdrom/apks
https://dl-cdn.alpinelinux.org/alpine/latest-stable/main
https://dl-cdn.alpinelinux.org/alpine/latest-stable/community
http://dl-cdn.alpinelinux.org/alpine/edge/main
http://dl-cdn.alpinelinux.org/alpine/edge/community
@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing
const express = require('express');
express().use('/api', require('./api')).use(express.static('public')).listen();
[...document.querySelectorAll('div,main,body')].forEach((node)=> {
node.style.position = 'relative';
node.style.height = 'auto';
node.style.overflowY = 'visible';
});
[...document.querySelectorAll('button')].forEach((node)=> {
node.remove();
});
@gullinbursti
gullinbursti / page_csv-maker.js
Last active October 17, 2023 15:15
Factory MOPAR Direct
const parseParts = ()=> {
let products = [];
Array.from(document.querySelectorAll('.catalog-products > .catalog-product')).forEach((el, i)=> {
const prodID = el.querySelector('.catalog-product-id a').text;
const prodName = el.querySelector('.product-title a').text;
const description = (el.querySelector('.product-more-info > .catalog-also-known-as:not(:first-child)')) ? el.querySelector('.product-more-info > .catalog-also-known-as:not(:first-child) > .info-row-content').innerHTML.split('<')[0].replace(/^\s*\b(.+)\b\s*$/, '$1').trim() : null;
const notes = (el.querySelector('.product-more-info > .catalog-product-note')) ? el.querySelector('.product-more-info > .catalog-product-note > .info-row-content').innerHTML.replace(/\<button.*$/, '').replace(/\<\/?[a-z0-9]+\>/g, '').trim() : null;
const url = el.querySelector('.product-image-link').href;
const img = el.querySelector('.product-image-link img').src;
@gullinbursti
gullinbursti / ffprobe-json.sh
Last active August 13, 2023 21:58
ffprobe JSON w/ jq
f=~/Desktop/ama_stac-x3h-1320s_an.mp4
ffprobe -i $f -of json -show_streams 2> /dev/null | jq --color-output \
--arg created_ts "`stat -f '%B' -t '%s' ${f}`" \
--arg modified_ts "`stat -f '%c' -t '%s' ${f}`" \
--arg exif_ts "`exiftool -fast -quiet -ignoreMinorErrors -s3 -forcePrint -dateFormat '%s' -time:all --File:MDItemContentCreationDate_Ranking --File:MDItemContentModificationDate_Ranking --File:MDItemDateAdded_Ranking --File:MDItemInterestingDate_Ranking ${f} | tr '\n' ',' | sed 's/^\(.*\),$/\[\1\]/g'`" \
'.streams[0]? |
.bit_rate = (.bit_rate | tonumber) |
.full_seconds = (.duration | tonumber) |
.exif_ts = (($exif_ts | gsub(",?0000:00:00 00:00:00,?"; "")) | fromjson) |
.tot_frames = (.nb_frames | tonumber) | .file_epoch = ($created_ts | tonumber) | .moddified_epoch = ($modified_ts | tonumber) |
@gullinbursti
gullinbursti / git-retrodate.zsh
Created July 13, 2023 08:38
Set git commit date
export GIT_{AUTHOR,COMMITTER}_DATE="YYYY-MM-DD HH:MM:SS"
git add .
git commit -m ""
unset GIT_{AUTHOR,COMMITTER}_DATE
@gullinbursti
gullinbursti / decreaseITunesVolume.scpt
Created June 14, 2023 12:00 — forked from tanhauhau/decreaseITunesVolume.scpt
Adjust iTunes volume through Applescript
tell application "iTunes"
set vol to sound volume
set vol to vol - 10
if vol is less than 0 then
set vol to 0
end if
set the sound volume to vol
end tell
@gullinbursti
gullinbursti / se-media.sh
Last active May 11, 2023 19:10
Conversion functions to downgrade iPhone SE 2nd Gen media types
#!/bin/bash
function heicSE() {
#-- org heic arch
local bkup_file=~/Pictures/heic.tar
#-- args 1: scale (50%) // 2: type (JPG) // 3: quality (80%)
local dims_per=50
[[ ! -z "$1" ]] && dims_per=$1
SELECT * FROM docs WHERE id <
(SELECT RAND() * m.maximum AS random_id FROM
(SELECT MAX(id) AS maximum FROM docs) AS m)
AND your_conditions
LIMIT 1
@gullinbursti
gullinbursti / exif-times-gps.md
Created March 3, 2023 07:22
exiftool -- Adjust exif / file times from GPS & DateTimeOriginal timestamps

Correct timestamps using exiftool & BSD date:

Required :

  • exiftool : apt install exiftool // brew install exiftool #-- primary tool
  • bc : apt install bc // brew install bc #-- do some math
  • OSX gdate : brew install coreutils #-- extended gnu-date

Optional :