Skip to content

Instantly share code, notes, and snippets.

View uolot's full-sized avatar

Tomasz Walotek uolot

View GitHub Profile
@uolot
uolot / s3gzip.py
Created January 7, 2019 17:36 — forked from veselosky/s3gzip.py
How to store and retrieve gzip-compressed objects in AWS S3
# vim: set fileencoding=utf-8 :
#
# How to store and retrieve gzip-compressed objects in AWS S3
###########################################################################
#
# Copyright 2015 Vince Veselosky and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@uolot
uolot / chattr.md
Created January 7, 2019 15:47
Protect resolv.conf
@uolot
uolot / docker-cross-device-link.md
Created November 26, 2018 16:58 — forked from Francesco149/docker-cross-device-link.md
docker error creating new backup file '/var/lib/dpkg/status-old': Invalid cross-device link
@uolot
uolot / README.md
Last active September 17, 2018 10:52
Bash completion for pip install

Bash completion for pip install

Provides packages names completion in bash for pip install, pip download and pip search

Examples

$ pip install mat<TAB>
Display all 188 possibilities? (y or n)
@uolot
uolot / setup.py
Created January 18, 2017 12:07 — forked from anonymous/setup.py
setup.py template
#!/usr/bin/env python
# coding=utf-8
"""
python distribute file
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals, with_statement)
@uolot
uolot / instance.py
Created June 19, 2016 17:17
Create dynamic python object instance, instantly
from functools import partial
def instance(**kwargs):
class instobj(object):
pass
o = instobj()
for k, v in kwargs.iteritems():
if callable(v):
v = partial(v, o)
@uolot
uolot / pip-deps.sh
Last active March 18, 2016 16:26
Check python package dependencies
echo "Creating virtual env..."
echo
virtualenv test --no-site-packages
source test/bin/activate
echo
echo "Installing package $1..."
echo
pip install $1
@uolot
uolot / app.py
Last active December 25, 2015 07:09
Poczta Polska - śledzenie wielu przesyłek naraz
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import requests
from lxml import etree
import codecs
def get_tracking_numbers():
with open('input.txt') as f:
var foobar = function($x) {
var tb = $x('//body//table/tbody')[3]
var trs = $x('./tr', tb)
var scoreboard = [];
for (i = 0; i < trs.length; i += 6) {
var lang = $x('.//font/text()', trs[i])[0].textContent.replace(' - Like', '');
var getpoints = function(tr) { return $x('.//span[@id]/text()', tr)[0].textContent.replace(' points', '') }
var upvotes = getpoints(trs[i+1]);
var downvotes = getpoints(trs[i+4]);
@uolot
uolot / gist:6566557
Created September 14, 2013 23:15
Add SSH key to Bitbucket account from shell
curl --user <USER>:<PASSWORD> -X POST https://bitbucket.org/api/1.0/users/<USER>/ssh-keys --data-urlencode "key=<PUBLIC_KEY>" --data-urlencode "label=<LABEL>"