Skip to content

Instantly share code, notes, and snippets.

View utek's full-sized avatar
🏠
Working from home ;)

Łukasz Bołdys (Lukasz Boldys) utek

🏠
Working from home ;)
View GitHub Profile
(test) utek@grendel:~$ pip install -U --force --no-cache-dir enum
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting enum
Downloading https://files.pythonhosted.org/packages/02/a0/32e1d5a21b703f600183e205aafc6773577e16429af5ad3c3f9b956b07ca/enum-0.4.7.tar.gz
Collecting setuptools (from enum)
Downloading https://files.pythonhosted.org/packages/37/06/754589caf971b0d2d48f151c2586f62902d93dc908e2fd9b9b9f6aa3c9dd/setuptools-40.6.3-py2.py3-none-any.whl (573kB)
100% |████████████████████████████████| 573kB 27.8MB/s
Exception:
Traceback (most recent call last):
File "/home/utek/test/local/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 176, in main
@utek
utek / wildcard-ssl-certificate.md
Created August 31, 2018 06:25 — forked from talyguryn/wildcard-ssl-certificate.md
How to get a wildcard ssl certificate and set up Nginx.

Request a new certificate

Get certbot

Go to any directory and clone repo with sources.

cd ~
git clone https://github.com/certbot/certbot
@utek
utek / __init__.py
Last active August 29, 2015 14:18
Getting info from .py files without eval
# coding=utf-8
from .ddd import (
DDD
)
__version__ = "0.5.1"
__author__ = "Łukasz Bołdys"
@utek
utek / setup.py
Created March 10, 2015 10:04
Modifing requires in develop
#!/usr/bin/env python
# coding=utf-8
from setuptools import setup, find_packages
from setuptools.command.develop import develop
requires = [
'requests'
]
C:\Users\utek
λ pyc
Python27
Python34
pypy
C:\Users\utek
λ python --version
Python 2.7.8

Keybase proof

I hereby claim:

  • I am utek on github.
  • I am utek (https://keybase.io/utek) on keybase.
  • I have a public key whose fingerprint is B327 F6DF 94B9 9B8F 09DC C67A B5A5 7965 A4F3 5912

To claim this, I am signing this object:

@utek
utek / gist:6752902
Created September 29, 2013 14:17
Sqlalchemy usermodel with password checking
class User(Base):
__tablename__ = 'users'
id = sa.Column(sa.Integer, primary_key=True)
username = sa.Column(sa.Unicode(255),
unique=True,
nullable=False,
index=True)
_password = sa.Column(sa.Unicode(255), nullable=False)
last_logged = sa.Column(sa.DateTime, default=datetime.datetime.utcnow)
@utek
utek / gist:6352412
Created August 27, 2013 11:30
Recaptcha helper.
def check_recaptcha(challenge, response, ip, private_key):
import requests
url = "http://www.google.com/recaptcha/api/verify"
data = {
'privatekey': private_key,
'remoteip': ip,
'challenge': challenge,
'response': response,
}
res = requests.post(url, data=data)
@utek
utek / Exclude_tables.md
Last active October 13, 2023 16:07
Define ignored tables in alembic.ini

Add this in your ini file:

[alembic:exclude]
tables = spatial_ref_sys

In env.py:

    import re 
    
@utek
utek / gist:6129509
Last active December 20, 2015 12:18
class Root(object):
__acl__ = [
(Allow, Authenticated, 'create_user'),
(Allow, Authenticated, 'view_user_links'),
]
def __init__(self, request):
self.request = request
# main() z __init__.py