Skip to content

Instantly share code, notes, and snippets.

View pauricthelodger's full-sized avatar

Padraic Harley pauricthelodger

View GitHub Profile
# https://regex101.com/r/W4RKMx/1
SENTINEL_1_ZIP_PATTERN = (
r"(?P<mission_id>S1[AB])"
"_"
r"(?P<mode_beam>IW|EW|WV|S[0-6])"
"_"
r"(?P<product_type>RAW|SLC|GRD|OCN)"
r"(?P<resolution>[FHM_])"
"_"
r"(?P<processing_level>[0-2])"
@pauricthelodger
pauricthelodger / xps13.md
Created July 29, 2018 22:05 — forked from Samffy/xps13.md
Dell XPS 13 9360 : Ubuntu Wifi disconnection

I encounter wifi disonnection problem on a Dell XPS 13 9360. Here is the solution I used to fix this bad behavior.

Which wifi card version is installed ?

lspci | grep -i net

3a:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)

class SomeMixin(object):
def func(self):
print("In Mixin")
print(self)
print(self.__class__)
super(SomeMixin, self).func()
class SomeOtherBaseClass(object):
def func(self):
@pauricthelodger
pauricthelodger / mc_insync_gdoc_opener
Last active April 13, 2020 11:36
This might be useful if you are using Midnight Commander (mc) (http://www.midnight-commander.org) and Insync (http://insynchq.com) or possible some other Google Drive syncthing. Will open at least some Google file types in your default browser after parsing the url from the json in the placeholder file.
# ~/.config/mc/mc.ext
# This might be useful if you are using Midnight Commander (mc) (http://www.midnight-commander.org)
# and Insync (http://insynchq.com) or possible some other Google Drive syncthing.
# Will open at least some Google file types in your default browser after parsing the url
# from the json in the placeholder file. The mc extension file can usually be found
# at ~/.config/mc/mc.ext or edited via mc itself (F9 » Command » Edit extension file).
# I add the below to the Document section (### Documents ###).
# Google Online File Formats
@pauricthelodger
pauricthelodger / get_product_and_serial_details.sh
Created July 27, 2015 15:12
Gets the Product Name and Serial Number of your device.
#!/bin/sh
# Print out the Product Name and Serial Number of your device
sudo dmidecode | grep -e "System Information" -A 5 | sed 's/^\t//' | awk '{ if (NR == 3 || NR == 5) { print }}'
# Run this like fab -R www deploy
from fabric.api import *
REPO_URL = 'git@github.com:username/repo.git'
PROJECT_DIR = '$HOME/projects/projectname'
PROJECT_NAME = 'projectname'
SERVER_NAME = 'projectname.servername' # I use gunicorn, so i have projectname.gunicorn
env.roledefs['www'] = ['www1.example.com']
APP_ROOT = os.path.abspath(os.path.dirname(__file__))
DATABASE = "sqlite:///%s" % os.path.join(APP_ROOT, 'wiki.sqlite')
class ConfigRuleset(dict):
defaults = {
'name': 'no name',
}
required = [
'name',
]
def __init__(self):
@pauricthelodger
pauricthelodger / valisync.py
Last active December 16, 2015 20:10
From https://github.com/pauricthelodger/spaceapi-server/blob/master/spaceapis.py If validate passes: 'sync' dictionary with dict.update
def validate(self, current_data, new_data):
if isinstance(new_data, dict):
return self.validate_dict(current_data, new_data)
elif isinstance(new_data, list):
return self.validate_list(current_data, new_data)
else:
return True
def sync(self, current_data, new_data):
if isinstance(new_data, dict):
"feeds": [
{
"url": "http://cam.example.com",
"type": "image/jpeg",
"name": "cam"
},
{
"url": "http://cam.example.com",
"type": "video/ogg",
"name": "stream"