Skip to content

Instantly share code, notes, and snippets.

View jinie's full-sized avatar

Jimmy Selgen Nielsen jinie

View GitHub Profile
import re
import sys
ex = re.compile("\"(url|referer)\"\:\"(.*)\"")
with open(sys.argv[1]) as f:
for line in iter(f.readline,""):
m = ex.search(line)
print(m.group(2))
#!/usr/bin/env python
import re
import sys
from functools import partial
remainder = ""
bufsize=4096
ex = re.compile('"(?:url|referer)"\:"([^"]*)"')
with open(sys.argv[1]) as f:
@jinie
jinie / gist:6074531
Last active December 20, 2015 04:59
#!/usr/bin/python
import socket
from threading import Thread
from Queue import Queue, Empty
class ClientSender(Thread):
def __init__(self, sock, queue):
super(ClientSender, self).__init__()
self.socket = sock
self.queue = queue
@jinie
jinie / iTC Downloader.py
Last active December 21, 2015 06:19 — forked from omz/iTC Downloader.py
# -*- coding: utf-8 -*-
# iTC Sales Report Downloader
# When you run this for the first time, you'll need to enter your
# iTunes Connect login and vendor ID. You can find the vendor ID
# on the iTunes Connect website by navigating to "Sales and Trends";
# it's the number next to your name (top-left).
CURRENCY = 'EUR'
RESET_LOGIN = False # Set to True to remove login from keychain
@jinie
jinie / apns.py
Created September 9, 2013 13:35 — forked from fermion/apns.py
import socket, ssl, json, struct
import binascii
# device token returned when the iPhone application
# registers to receive alerts
deviceToken = '39cac56f 986a0e66 3c4fd4f4 68df5598 024d2ca3 8b9f307c 741c180e 9fc30c62'
thePayLoad = {
'aps': {
'alert':'Oh no! Server\'s Down!',
@jinie
jinie / curse_update.py
Last active December 25, 2015 20:19
Script to update WoW packages installed by Curse Client. usage : "curse_update.py Warcraft/Interface/Addons"
#!/usr/bin/env python
import os
import re
import logging
import fnmatch
try:
# For Python 3.0 and later
from urllib.request import urlopen
except ImportError:
# Fall back to Python 2's urllib2
@jinie
jinie / pushover.py
Created January 24, 2014 08:24
Login monitoring with Pushover
#!/usr/bin/env python
import re
import os
import urllib
import httplib
import logging
import pyinotify
from threading import Thread, Event
from socket import gethostname
#from logging.handlers import SysLogHandler
#!/usr/bin/env python3
import json
import sys
import datetime
import os.path
with open(sys.argv[1]) as f:
data = json.load(f)
@jinie
jinie / read.pl
Created July 5, 2011 17:59
Read binary file in perl and print hex output
#!/usr/bin/perl -w
use strict;
my $BLOCK_SIZE=1024;
my $fname = $ARGV[0];
open(F,"<$fname") or die("Unable to open file $fname, $!");
binmode(F);
my $buf;
Updating, please wait.
+++++++++++++++++++++++++++++++
Now updating OctoPrint to 1.3.2
+++++++++++++++++++++++++++++++
/home/pi/oprint/bin/python "/home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.1-py2.7.egg/octoprint/plugins/softwareupdate/scripts/update-octoprint.py" --branch= --force=false "/home/pi/OctoPrint" 1.3.2
'build/scripts-2.7' does not exist -- can't clean it
Python executable: '/home/pi/oprint/bin/python'
>>> Running: git diff --shortstat
> git diff --shortstat