This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests,time,socket,json,sys | |
def init_settings(): | |
try: | |
with open("settings.json") as f: | |
settings = json.load(f) | |
return settings | |
except: | |
with open("settings.json", "w") as f: | |
settings = dict(domain="REPLACE_WITH_DOMAIN", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Connect-VM { | |
param( | |
[Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Position=1)] | |
[Microsoft.HyperV.PowerShell.VirtualMachine[]]$VM, | |
[switch] $PassThru | |
) | |
PROCESS { | |
foreach ($VMobject in $VM) { | |
vmconnect localhost ($VMobject.name) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, jsonify, redirect, request, abort | |
import requests, time | |
from bs4 import BeautifulSoup as Soup | |
app = Flask(__name__) | |
f_gh = """<a href="https://gist.github.com/blha303/e8e7568767cea6d12352"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>""" | |
f_base = "<html><head><title>{title}HasNudes</title></head><body>" + f_gh + "<h2>HasNudes</h2>{body}</body></html>" | |
f_result = "<h3>{moviename} has {number} nudes{dotorq}</h3>" | |
f_homepage = "<form><input type=text name=movie><input type=checkbox name=json id=json><label for=json>JSON output</label><input type=submit>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from irc.bot import ServerSpec | |
import irc | |
import sys | |
import json | |
try: | |
with open('smbotconfig.json') as f: | |
conf = json.load(f) | |
except: | |
print "Error in config or no config found, returning to defaults. Please edit smbotconfig.json (http://jsonlint.com/) and restart the bot" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: gethbdownloads.py > filelist.txt | |
# Then: wget --content-disposition --no-check-certificate -c -i filelist.txt | |
# Defaults to returning torrent urls, easily configurable | |
from __future__ import print_function | |
from sys import stderr, exit | |
from getpass import getpass | |
import humblebundle | |
ERRORS = {1: "Login failed, please check details"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example usage: | |
>>> netflix("60024942") | |
(u'Catch Me If You Can', u'2002', u'Thu Jan 09 08:00:00 UTC 2003', u'M', u'140 minutes', u'http://cdn2.nflximg.net/images/0432/12050432.jpg', u'An FBI agent makes it his mission to put cunning con man Frank Abagnale Jr. behind bars. But Frank not only eludes capture, he revels in the pursuit.', {u'director': u'Steven Spielberg', u'genre': u'Dramas', u'language': u'English', u'starring': u'Leonardo DiCaprio, Tom Hanks'}) | |
ID could be obtained through trivial URL parsing using any stdlib library. | |
Here, i'll do an example: | |
from urlparse import urlparse, parse_qs # urllib.parse in python 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ipinfo.py by Steven Smith (blha303), MIT license (as is every script on my gist, by the way, unless otherwise stated) | |
# A local service to get your ip, for if you have a local service running that you want to link to other people but you can't be bothered finding your IP first. | |
# I use it for Plex, with a bookmark pointing to http://localhost:5212/32400/web/index.html | |
from flask import Flask, jsonify, redirect | |
import socket | |
app = Flask(__name__) | |
ip_addrs = None | |
def update(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connection='wireless' | |
Interface=wlp2s0 # or your wireless interface name | |
Security='wpa-configsection' | |
Description='tafe' | |
IP='dhcp' | |
TimeoutWPA=30 | |
WPAConfigSection=( | |
'ssid="PWAStudent"' | |
'key_mgmt=WPA-EAP' | |
'eap=PEAP' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# This file is released as public domain by Steven Smith (blha303) in Apr 2015 | |
# In areas where public domain isn't a thing, I release it under the MIT license. | |
# Although credit would be nice if you use this in something cool. And email me a link too pls. | |
import time,os,requests,json,subprocess | |
from urllib import urlretrieve | |
DTFORMAT = "%a, %b %d %Y %H:%M:%S +0000" # Do not modify, needs to be at top | |
playlisturl = "https://www.youtube.com/playlist?list=UU9CuvdOVfMPvKCiwdGKL3cQ" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
from bs4 import BeautifulSoup as Soup | |
import requests | |
from collections import namedtuple | |
from datetime import datetime, timedelta | |
Song = namedtuple('Song', ['title', 'artist', 'position', 'spotify', 'vevo', 'rdio']) | |
def billboard(date): | |
soup = Soup(requests.get("http://www.billboard.com/charts/hot-100/%s" % date).text) |