Skip to content

Instantly share code, notes, and snippets.

View Hellowlol's full-sized avatar

Steffen Fredriksen Hellowlol

  • Kristiansand, Norway
View GitHub Profile
@Hellowlol
Hellowlol / telenorsms.py
Created April 7, 2014 21:15
telenor sms api python
#--coding: utf-8--
import urllib2
import urllib
from sys import argv
'''
Used for sending texts via telenor norway smapi
Send passord to 1999 to get your password
You will be billed by telenor for the usage even if sms is included in your subscription
'''
msg = argv[1]
import os, sys
import xbmc, xbmcaddon
import json
def log(msg):
xbmc.log('GETADDONS TEST: ' + str(msg), level=xbmc.LOGDEBUG)
if ( __name__ == "__main__" ):
installedAddons = []
installedJson = xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "id": 1, "method": "Addons.GetAddons", "params": { "type": "xbmc.gameclient", "enabled": "all" } }')
@Hellowlol
Hellowlol / Poormans curl..
Created July 11, 2014 00:39
jsonrcp xmbc.
import json
import urllib2
import base64
def jsonrcp():
username = 'u'
password = 'p'
ip = '192.168.1.122'
@Hellowlol
Hellowlol / whatthefork
Last active November 21, 2022 07:55
Check all forked branches if they are ahead of master/self open in browser
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Dirty script to check if any forks in ahead of master and open that branch commitlist
Warning: Uses alot of api calls
"""
import requests
from requests.auth import HTTPBasicAuth
@Hellowlol
Hellowlol / whatthefork2
Last active August 29, 2015 14:07
Whatthefork2
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from requests.auth import HTTPBasicAuth
import json
import webbrowser
from math import ceil
import time
@Hellowlol
Hellowlol / humanfilesize
Created June 19, 2015 12:29
bytes to filesize javascript
function humanFileSize(bytes, pre, si) {
// Set default args
si = typeof si === 'undefined' ? true:false;
pre = typeof pre === 'undefined' ? 0:pre;
var thresh = si ? 1000 : 1024;
if(Math.abs(bytes) < thresh) {
return bytes.toFixed(pre) + ' B';
}
var units = si
@Hellowlol
Hellowlol / nrkdownload.py
Last active November 18, 2015 21:23
Search and download from nrk.no
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import subprocess
import sys
import time
from functools import wraps
@Hellowlol
Hellowlol / login.html
Created January 3, 2016 01:01
PlexPy Login Page
<%
import plexpy
from plexpy import version
%>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
@Hellowlol
Hellowlol / throttle_nzbclient.py
Last active January 3, 2020 02:48
Simple script to throttle sabnsbd and nzbget
from __future__ import print_function
import argparse
import requests # pip install requests
import sys
from jsonrpclib import jsonrpc # pip install jsonrpclib-pelix
"""
Simple script to throttle nzb clients for plexpy
@Hellowlol
Hellowlol / kill_a_stream.py
Last active January 18, 2021 14:37
Plexpy script, kill a plex stream
"""
This is a simple script showing how you can used plexpys notifications system to kill a stream
Possible plexpyargs: -tk {transcode_key} -u {username} -td {transcode_decision} -t 20:20 -ln Secret_tash
Instructions:
1. Save the script somewhere on your computer as kill_a_stream.py.