docker pull mysql:5.5
docker pull ubuntu
mkdir scenes
class StatementTimeout(object): | |
@classmethod | |
def _execute_query(cls, query, db_alias): | |
from django.db import connections | |
cur = connections[db_alias].cursor() | |
try: | |
cur.execute(query) | |
return cls._as_dict(cur) if cur.rowcount > 0 else True |
import csv | |
import os | |
import requests | |
import shutil | |
import urllib | |
""" | |
Docs: http://labelary.com/service.html | |
""" | |
url = 'http://api.labelary.com/v1/printers/8dpmm/labels/3x1.5/0/' |
# Postgre tested | |
@pytest.fixture(autouse=True) | |
def reset_sequence(): | |
cur = connection.cursor() | |
cur.execute('ALTER SEQUENCE table_name RESTART WITH 1;') |
#listar arquivos: | |
find . -type f | |
#listar diferentes do padrão: | |
find . -type f -not -name "*cteproc.xml" | |
#Contar colocando na frente um: | |
find . -type f | wc -l | |
find . -type f -not -name "*cteproc.xml" | wc -l |
# WORKAROUND to use when "scp"/"kubectl cp"/"docker cp" is unvailable | |
# on local machine | |
xxd ~/file_aaa.xlsx > /tmp/bin_file_aaa | |
# md5sum to compare on end | |
md5sum ~/file_aaa.xlsx | |
# open and copy full content file | |
gedit /tmp/bin_file_aaa |
# paste on .bashrc and run source command | |
PS1='\[\033[0;37m\][\t]\[\033[0;32m\][\u]\[\033[31m\][\h]`git branch 2>/dev/null | grep \* | head -1 | sed "s/\* //g" | awk "{ print \"[ \"\\\$1 \" ]\" }"` \[\033[1;33m\]\w\a\[\033[0m\]\n\$ ' |
# List branchs sorted by last commit(from config.user) date | |
git branch --list --sort=-committerdate |