Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am zmike808 on github.
* I am zmike808 (https://keybase.io/zmike808) on keybase.
* I have a public key ASC-w5Cf6t7MiqKtsMZ509s4m7ga49Utc6vK_jXD8DHv3wo
To claim this, I am signing this object:
#!/usr/bin/env sh
set -ex
cd /root/
installRequirements() {
apt-get update
apt-get install \
software-properties-common \
@zmike808
zmike808 / dynamically-generated-alt-text-with-azure-s-computer-vision-api.markdown
Created April 27, 2019 19:30
Dynamically Generated Alt Text with Azure's Computer Vision API

Dynamically Generated Alt Text with Azure's Computer Vision API

I kept hearing about machine learning being used for evil and wanted to use it for something good. Social media posts typically don't have a way to enter alt text and the only users I see that reliably remember to add descriptions to the post are accessibility experts or blind people. Hopefully this allows good alt text to be a bit more ubiquitous. You can find more information on how Azure's Computer Vision API works, as well as how to use it in your own projects here: https://aka.ms/Uzrshc

A Pen by Michael Zemsky on CodePen.

License.

@zmike808
zmike808 / plexDownload.php
Created February 2, 2018 04:29 — forked from kmark/plexDownload.php
The Plex Universal Transcoder Downloader mimics the actions of the Plex/Web media flash player to download transcoded media. The differences begin when the downloader saves the streamed data and pieces it together. First a start.m3u8 playlist file is requested from the server with a query string that defines the transcoding options. Inside the …
<?php
/*******************************************************************************
* Plex Universal Transcoder Downloader v1.3 *
* See --help or --usage for more info *
*******************************************************************************
* Copyright 2013 Kevin Mark *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
@zmike808
zmike808 / exec_command_no_sessions.py
Created December 19, 2017 22:48 — forked from JonnyWong16/exec_command_no_sessions.py
Execute a command when no Plex sessions are active.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Execute a command when no Plex sessions are active.
# Author: /u/SwiftPanda16
# Requires: plexapi
import shlex
import subprocess
from plexapi.server import PlexServer
@zmike808
zmike808 / notify_user_favorites.py
Created March 1, 2017 21:10 — forked from blacktwin/notify_user_favorites.py
Notify users of recently added episode to show that they have watched at least LIMIT times via email.
"""
Notify users of recently added episode to show that they have watched at least LIMIT times via email.
Block users with IGNORE_LST.
Arguments passed from PlexPy
-sn {show_name} -ena {episode_name} -ssn {season_num00} -enu {episode_num00} -srv {server_name} -med {media_type}
-pos {poster_url} -tt {title} -sum {summary} -lbn {library_name} -grk {grandparent_rating_key}
You can add more arguments if you want more details in the email body
Adding to PlexPy
2016-02-11 15:04:05 ERROR SEARCHQUEUE-BACKLOG-300835 :: [NyaaTorrents] :: Unknown exception while searching NyaaTorrents. Error: 'Old quality does not match new: 720p BluRay != 720p HDTV : [PuyaSubs!].Majin.Bone.-.05.[720p][147E63BD].mkv' [4f3207f]
2016-02-11 15:04:05 DEBUG SEARCHQUEUE-BACKLOG-300835 :: [NyaaTorrents] :: Found result: [Underwater-µtw] Ajin - Demi-Human - 04 [205D16E2].mkv with 346 seeders and 70 leechers
2016-02-11 15:04:04 DEBUG SEARCHQUEUE-BACKLOG-300835 :: [NyaaTorrents] :: Search URL: http://www.nyaa.se/?sort=2&term=Ajin+-+Demi-Human+05&cats=1_0&page=rss&order=1
2016-02-11 15:04:04 DEBUG SEARCHQUEUE-BACKLOG-300835 :: [NyaaTorrents] :: Search string: Ajin - Demi-Human 05
2016-02-11 15:04:04 DEBUG SEARCHQUEUE-BACKLOG-300835 :: [NyaaTorrents] :: Found result [Freelance-Raws] Majin Tantei Nougami Neuro - 05 (D-NTV DivX6.6 1280x720).[YS2YSUOe1cLtf].avi but that doesn't seem like a verified result so I'm ignoring it
2016-02-11 15:04:04 DEBUG SEARCHQUEUE-BACKLOG-300835 :: [Nyaa
2016-02-11 15:04:10 ERROR SEARCHQUEUE-BACKLOG-300835 :: [HD4Free] :: Unknown exception while searching HD4Free. Error: 'No JSON object could be decoded' [4f3207f]
2016-02-11 15:04:10 DEBUG FINDPROPERS :: [KickAssTorrents] :: Search URL: https://kat.cr/usearch/?q=The+Flash+%282014%29+S02E13+PROPER%7CREPACK%7CREAL&field=seeders&rss=1&category=tv&sorder=desc
2016-02-11 15:04:10 DEBUG FINDPROPERS :: [KickAssTorrents] :: Search string: The Flash (2014) S02E13 PROPER|REPACK|REAL
2016-02-11 15:04:10 DEBUG FINDPROPERS :: [KickAssTorrents] :: Search Mode: Episode
2016-02-11 15:04:10 DEBUG FINDPROPERS :: [KickAssTorrents] :: URL did not return data, maybe try a custom url, or a different one
2016-02-11 15:04:10 DEBUG FINDPROPERS :: [KickAssTorrents] :: Requested getURL https://kat.cr/usearch/?q=Limitless+S01E14+PROPER%7CREPACK%7CREAL&field=seeders&rss=1&category=tv&sorder=desc returned status code is 404: Not Found
2016-02-11 15:04:10 DEBUG SEARCHQUEUE-BACKLOG-300835 :: [HD4Free] :: Search URL: htt
2016-02-11 15:04:31 ERROR SEARCHQUEUE-BACKLOG-102261 :: [NyaaTorrents] :: Unknown exception while searching NyaaTorrents. Error: 'Old quality does not match new: 720p BluRay != 720p HDTV : [DeadFish].Mahou.Shoujo.Madoka\xe2\x98\x85Magica.Movie.3:.Hangyaku.no.Monogatari.v2.[BD][720p][AAC].mp4' [4f3207f]
2016-02-11 15:04:31 DEBUG SEARCHQUEUE-BACKLOG-102261 :: [NyaaTorrents] :: Found result [gg-xiph] Bakemonogatari 3 (720p Theora Vorbis Kate) [39aa93fd].ogv but that doesn't seem like a verified result so I'm ignoring it
2016-02-11 15:04:31 DEBUG SEARCHQUEUE-BACKLOG-102261 :: [NyaaTorrents] :: Found result Bakemonogatari OP 3 - The Road Home (Mayoi Snail) but that doesn't seem like a verified result so I'm ignoring it
2016-02-11 15:04:31 DEBUG SEARCHQUEUE-BACKLOG-102261 :: [NyaaTorrents] :: Found result [Zero-Raws] Bakemonogatari - Vol.3 (BD 1920x1080 H.264 AAC) but that doesn't seem like a verified result so I'm ignoring it
2016-02-11 15:04:31 DEBUG SEARCHQUEUE-BACKLOG-102261 :: [NyaaTorrents] ::
2016-02-11 15:05:07 ERROR SEARCHQUEUE-BACKLOG-102261 :: [TokyoToshokan] :: Unknown exception while searching TokyoToshokan. Error: 'Old quality does not match new: 1080p BluRay != 1080p HDTV : [UTW]_Nisemonogatari_-_03_[BD][h264-1080p_FLAC][06DD841B].mkv' [4f3207f]
2016-02-11 15:05:07 DEBUG SEARCHQUEUE-BACKLOG-102261 :: [TokyoToshokan] :: Data returned from provider does not contain any torrents
2016-02-11 15:05:05 DEBUG SEARCHQUEUE-BACKLOG-102261 :: [TokyoToshokan] :: Search URL: http://tokyotosho.info/search.php?type=1&terms=Bakemonogatari+15
2016-02-11 15:05:05 DEBUG SEARCHQUEUE-BACKLOG-102261 :: [TokyoToshokan] :: Search string: Bakemonogatari 15
2016-02-11 15:05:05 DEBUG SEARCHQUEUE-BACKLOG-102261 :: [TokyoToshokan] :: Discarding torrent because it doesn't meet the minimum seeders or leechers: [Hatsuyuki-Hadena]_Showa_Monogatari_-_01_[704x400][69D1159E].avi (S:0 L:0)
2016-02-11 15:05:05 DEBUG SEARCHQUEUE-BACKLOG-102261 :: [TokyoToshokan] :: Discarding torrent because it doesn't meet the