Skip to content

Instantly share code, notes, and snippets.

View nwithan8's full-sized avatar
💭
ABC - Always Be Coding

Nate Harris nwithan8

💭
ABC - Always Be Coding
View GitHub Profile
@nwithan8
nwithan8 / channel_to_playlist.py
Created September 1, 2020 04:27
Add items from a dizqueTV channel to a Plex playlist
# RUN THIS FIRST:
# pip install plexapi dizqueTV
from typing import List
import plexapi
from dizqueTV import API
from plexapi.server import PlexServer
# COMPLETE THESE SETTINGS
DIZQUETV_URL = "http://localhost:8000"
#EXTINF:-1 tvg-id="2" tvg-name="" tvg-logo="https://upload.wikimedia.org/wikipedia/commons/8/86/CBS_2.png" group-title="Local",CBS2 Los Angeles (KCBS)
https://api.locastnet.org/api/watch/stream/1075/34/-118/?token=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhbmRyZXdxbGVAZ21haWwuY29tIiwicm9sZSI6MSwiZXhwIjoxNjAwNDUzMzgzfQ.J5ozsTgSPk5uAjjJk7vdKaPy4PDprVdtmWw9RMNSC_I
#EXTINF:-1 tvg-id="4" tvg-name="" tvg-logo="https://s3.us-east-2.amazonaws.com/static.locastnet.org/logo/LA/KNBCDT.png" group-title="Local",NBC4 Los Angeles (KNBC)
https://api.locastnet.org/api/watch/stream/1077/34/-118/?token=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhbmRyZXdxbGVAZ21haWwuY29tIiwicm9sZSI6MSwiZXhwIjoxNjAwNDUzMzgzfQ.J5ozsTgSPk5uAjjJk7vdKaPy4PDprVdtmWw9RMNSC_I
#EXTINF:-1 tvg-id="5" tvg-name="" tvg-logo="https://i.imgur.com/VZvPNSR.png" group-title="Local",KTLA 5 (CW)
https://api.locastnet.org/api/watch/stream/1079/34/-118/?token=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhbmRyZXdxbGVAZ21haWwuY29tIiwicm9sZSI6MSwiZXhwIjoxNjAwNDUzMzgzfQ.J5ozsTgSPk5uAjjJk7vdKaPy4PDprVdtmWw
#!/usr/bin/python3
from bs4 import BeautifulSoup
import requests
import os
links = []
base = "http://www.511ga.org/mobile"
start = 'http://www.511ga.org/mobile/?action=view_events&idents=cctv_5201%2Ccctv_5212%2Ccctv_5229%2Ccctv_15317%2Ccctv_5220%2Ccctv_5211%2Ccctv_46425%2Ccctv_5188%2Ccctv_5190%2Ccctv_5209%2Ccctv_5219%2Ccctv_5244%2Ccctv_5187%2Ccctv_5210&template=cameras&trail=main_menu__view_list_cameras&title_suffix=%20on%20SR%20166'
@nwithan8
nwithan8 / chained_hashing.py
Last active June 11, 2020 20:15
Chained-forward UUID5 (SHA-1) hashing in Python. The next hash is based on the previous hash and the current epoch, making it nearly impossible to edit.
#!/usr/bin/python3
import uuid
import time
def makeUUID(text, start=False):
if start:
return uuid.uuid4() # random uuid to begin with
timestamp = time.time()
#!/usr/bin/env python3
# RUN THIS COMMAND TO INSTALL DEPENDENCIES
# pip3 install requests argparse cryptography yourls
import requests
import argparse
import random
import string
import socket
@nwithan8
nwithan8 / tweepy_boilerplate.py
Created March 2, 2020 20:39
Tweepy (Twitter + Python) boilerplate
import tweepy
from tweepy.streaming import StreamListener
from tweepy import Stream
# Twitter API Credentials
consumer_key = "xxxx"
consumer_secret = "xxxx"
access_token = "xxxx"
access_secret = "xxxx"
@nwithan8
nwithan8 / service_test.sh
Last active February 11, 2020 01:49
Quickly ping multiple ports internally and externally to check if applications and/or services are up
IP="" # Internal IP address
EXTERNAL_ADDR="" # IP or URL (no http(s))
# Seperate items in list by spaces, not commas
# One service -> One port
SERVICES=(Service1 Service2 Service3)
PORTS=(80 443 32400)
# Example of different ways external address can be listed. Must be surrounded by quotes
# Port number should be included after a /.
@nwithan8
nwithan8 / creds_checker.py
Last active February 4, 2020 11:19
Check files in a directory for potential keys, token, secrets or other sensitive values
#!/usr/bin/env python3
# TO RUN: python3 creds_checker.py PATH/TO/DIRECTORY/TO/CHECK
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('directory', help="Directory to check")
args = parser.parse_args()
@nwithan8
nwithan8 / create_jf_user.py
Last active January 16, 2023 15:04
Create a new Jellyfin user from CLI (option to upload credentials to PrivateBin and shorten link)
#!/usr/bin/env python3
import os
import requests
import argparse
import random
import string
import socket
import json
import base64
@nwithan8
nwithan8 / random_plex_item.py
Created January 29, 2020 16:49
Play a random Plex Server media item on a connected device (can specify library, musical artist, or TV series)
#!/usr/bin/python3
# RUN THIS COMMAND TO INSTALL DEPENDENCIES
# pip3 install plexapi argparse
import plexapi
from plexapi.server import PlexServer
import argparse
import sys
import random