Skip to content

Instantly share code, notes, and snippets.

View mirzmaster's full-sized avatar

Sohail Mirza mirzmaster

View GitHub Profile
@mirzmaster
mirzmaster / fix_hdr_format.md
Last active September 19, 2025 16:08
Using mkvmerge to fix incompatible HDR metadata for the Sony Bravia 7 by remuxing content.

Fixing incompatible HDR metadata for the Sony Bravia 7 Plex app

The problem

Some HDR DoVi (Dolby Vision) content is incompatible with the Sony Bravia 7. This has to do with specific DoVi format levels not being well supported, especially with Plex on the Bravia 7.

Getting the relevant metadata of the incompatible file:

mediainfo --Output=JSON not_working.mkv | jq '.media.track[] | select(."@type" == "Video") | with_entries(select(.key | startswith("Format") or startswith("HDR_Format")))'

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@mirzmaster
mirzmaster / wipe_jenkins_workspaces.groovy
Created May 6, 2019 18:32
Jenkins Groovy script to wipe all workspaces from disk
import com.cloudbees.hudson.plugins.folder.*
import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject
import org.jenkinsci.plugins.workflow.job.WorkflowJob
for (item in Hudson.instance.items) {
wipeWorkspace(item)
}
def wipeWorkspace(item) {
println("--> found " + item.getClass().getCanonicalName())
@mirzmaster
mirzmaster / cidr_notation_cheatsheet.txt
Created April 23, 2019 17:45
CIDR Notation Cheatsheet
CIDR Total number Network Description:
Notation: of addresses: Mask:
--------------------------------------------------------------
/0 4,294,967,296 0.0.0.0 Every Address
/1 2,147,483,648 128.0.0.0 128 /8 nets
/2 1,073,741,824 192.0.0.0 64 /8 nets
/3 536,870,912 224.0.0.0 32 /8 nets
/4 268,435,456 240.0.0.0 16 /8 nets
/5 134,217,728 248.0.0.0 8 /8 nets
/6 67,108,864 252.0.0.0 4 /8 nets
@mirzmaster
mirzmaster / portainer-docker-compose.yml
Created November 6, 2018 12:24
Compose stack for Portainer
version: '2'
services:
portainer:
image: portainer/portainer
ports:
- 9123:9000
restart: always
command: -H unix:///var/run/docker.sock
volumes:
@mirzmaster
mirzmaster / ssh-d4m
Created March 23, 2018 18:52
SSH into Docker for Mac xhyve VM
1. screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
2. when done use CTRL-A CTRL-\ and then y (for yes) to exit
Alternative method:
1. docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
@mirzmaster
mirzmaster / git-reword.sh
Created February 20, 2018 03:35
Bash script that can be used as a git alias to reword the commit message of an arbitrary commit on the current branch.
reword() {
if [ -z "$1" ];
then
echo "No SHA provided. Usage: \"git reword <SHA>\"";
exit 1;
fi;
if [ $(git rev-parse $1) == $(git rev-parse HEAD) ];
then
echo "$1 is the current commit on this branch. Use \"git commit --amend\" to reword the current commit.";
exit 1;
@mirzmaster
mirzmaster / learning.txt
Created August 25, 2017 21:34
Learning How To Learn
Learning How To Learn
Module 1 - What is Learning
Focused/Diffuse Modes Thinking
- Obviously ‘focused’ is when you’re concentrating. Direct approach to solving familiar problems.
- Focused: thoughts move through nicely-paved road of familiar notions (neural pattern looks very tight and directed).
- encompasses rational, sequential, analytical approaches to thinking
- Diffuse: More of a search function neural pattern. Thoughts move widely. More of a broad/big-picture perspective trying to connect ideas from different places.
- We’re always either in focused or diffuse mode of thinking.

Keybase proof

I hereby claim:

  • I am mirzmaster on github.
  • I am mirzmaster (https://keybase.io/mirzmaster) on keybase.
  • I have a public key ASCeLfVRHP6eweW9klmg3hypuWpglWPNoCHlrby4M0dtPAo

To claim this, I am signing this object:

@mirzmaster
mirzmaster / letsencrypt_2016.md
Last active March 20, 2017 13:53 — forked from mazz/letsencrypt_2016.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two modes when you don't want Certbot to edit your configuration:

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.

In the following, we're setting up mydomain.com to be served from /var/www/mydomain, and challenges will be served from /var/www/letsencrypt.