Skip to content

Instantly share code, notes, and snippets.

View Aldaviva's full-sized avatar
🆒
This user is COOL

Ben Hutchison Aldaviva

🆒
This user is COOL
View GitHub Profile
@Aldaviva
Aldaviva / delete-mkv-tags.sh
Last active December 28, 2017 17:22
Delete Matroska tags
# requires mkvmerge (https://mkvtoolnix.download)
mkdir notags
find . -depth 1 -name "*.mkv" -exec mkvmerge --title "" -o "notags/{}" --no-track-tags --no-global-tags {} \;
mv notags/* .
rm -r notags
@Aldaviva
Aldaviva / pull-requests.md
Created August 5, 2017 12:23
How to modify and merge GitHub pull requests
  1. Clone your repo.
  2. curl -L https://github.com/Aldaviva/webscale/pull/3.patch | git am -3
  3. If there are merge conflicts, fix them, then git am --continue.
  4. Make any local changes you want.
  5. git add -A
  6. Commit your changes with Closes #3 at the end of the commit message.
    • git commit --amend (to modify the pull request commit)
    • git commit (to add a new commit of you own).
  7. If you want to squash multiple WIP commits into one, use git rebase -i origin/master.
  8. Push.
@Aldaviva
Aldaviva / youtube-playlist-length.js
Created August 5, 2017 11:40
YouTube playlist length calculator
Array.prototype.map.call(document.querySelectorAll(".timestamp span"), function(span){ var minSecStrings = span.firstChild.nodeValue.split(":"); return parseInt(minSecStrings[0], 10)*60+parseInt(minSecStrings[1], 10); }).reduce(function(prev, curr){ return prev + curr; }, 0);
@Aldaviva
Aldaviva / comodo.md
Last active August 5, 2017 12:33
Fix Comodo intermediate certificate in Windows certificate store

There is a bad interaction between the Comodo intermediate CA certificates that are distributed in the Windows Trusted Root CA list and generated X.509 certificates from Comodo. This fix has to be applied repeatedly, whenever Windows autoupdates its Trusted Root CA list.

See CertPathValidatorException with Windows server and Android client for the symptoms and causes.

Disable the invalid intermediate certificate

manually

  1. start > run > mmc
  2. file > add/remove snap in
  3. certificates
@Aldaviva
Aldaviva / playlist-diff.md
Last active May 3, 2017 09:04
Diff a Google Play Music playlist with a Winamp playlist

Playlist Diff

See what's different between a playlist in Google Play Music and in Winamp.

  1. Go to your playlist in Google Play Music.
  2. Zoom your browser all the way out to avoid paginating the table.
  3. Open the Developer Tools.
  4. Go to the Console tab.
  5. Paste and run the following JavaScript.
@Aldaviva
Aldaviva / isMeetingActive.md
Created April 19, 2017 04:17
Has anyone joined a specific BlueJeans meeting?

Is Meeting Active

You can use a generic HTTP client to send a JSON POST request to the BlueJeans API in order to find out if any participants are connected to the given meeting.

Inputs

Name Example Notes
meetingNumericId 10990 The meeting ID of the BlueJeans meeting to check.
meetingPasscode 0000 If the meeting has a participant passcode, you must pass either the participant or moderator passcode, otherwise, you can pass null.
@Aldaviva
Aldaviva / Video encoding with FFmpeg.md
Last active May 24, 2023 01:46
Video encoding with FFmpeg, a great tool with the shittiest user interface you can imagine: lots of confusing, unmemorable, unintuitive, undiscoverable command-line flags

Remux without transcoding

ffmpeg -i input.ts -c copy output.mp4

x264, AAC

ffmpeg -i input.avi -c:v libx264 -preset slow -crf 23 -pix_fmt yuvj420p -c:a aac -b:a 160k output.mp4
@Aldaviva
Aldaviva / smart-ln.md
Last active October 25, 2016 01:09
Make symbolic linking easier.

smart-ln.sh

This is an alias script for ln -s that takes arguments in either order and creates your symlink based on which files exist.

Who can ever remember the order of arguments to ln -s? It doesn't even matter because the user's intention is always unambiguous. Also the argument order is reversed in junction.exe on Windows, which makes it even harder to remember if you use both.

For example, GNU ln works fine with ln -s /tmp mytmp, but if you forget the argument order, can't figure out the useless manpage, and use the wrong order ln -s mytmp /tmp, then it not only won't return an error, it will make a broken symlink called /tmp/mytmp that points to the nonexistent mytmp. This is stupid. It's clear that the user wants a symlink called mytmp that points to /tmp, because /tmp exists and mytmp doesn't.

Installation

@Aldaviva
Aldaviva / Fix context menus.reg
Created September 29, 2016 05:38
Un-pollute Windows Explorer context menus
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\{90AA3A4E-1CBA-4233-B8BB-535773D48449}]
[-HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\{a2a9545d-a0c2-42b4-9708-a0b2badd77c8}]
[-HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Open With]
[-HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Sharing]
@Aldaviva
Aldaviva / 1.md
Last active July 9, 2016 00:50
Get the Title of a Blue Jeans Meeting

Get the Title of a Blue Jeans Meeting

Inputs

  • (required) Blue Jeans numeric Meeting ID, e.g. 494435558
  • (required for meetings with a passcode) Blue Jeans meeting passcode, can be either the participant passcode or the moderator passcode, e.g. 3691

Outputs

  • Title of the meeting (as set by the owner), e.g. Ben's Meeting