In order to enable debugging for your Django app running in a Docker container, follow these steps using Visual Studio (Code):
- Install ptvsd:
pip install ptvsd
- To your launch.json, add this:
import subprocess | |
from threading import Timer | |
# main, but I'm lazy | |
with subprocess.Popen(['bash', 'eternal.sh'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf8') as proc: | |
try: | |
timer = Timer(5, proc.kill) | |
timer.start() | |
for line in proc.stdout: | |
print(f'>> {line.strip()}') |
#!/usr/bin/env bash | |
# pdfoptim.sh | |
# | |
# Optimize a PDF with Ghostscript | |
# | |
# Usage | |
# ----- | |
# | |
# bash pdfoptim.sh input.pdf output.pdf | |
# |
class MinhaClasseBonita: | |
#... | |
@classmethod | |
async def get_one(cls, oracle_pool, **kargs ): | |
retval = {} | |
async with oracle_pool.acquire() as connection: | |
async with connection.cursor() as cursor: | |
# retorna dicts | |
sql_stmt = cls.get_sql() |
# ref.: https://unix.stackexchange.com/questions/98948/ascii-to-binary-and-binary-to-ascii-conversion-tools | |
#decode | |
echo "$@" | base64 -d | zcat | perl -lape '$_=pack"(B8)*",@F' |
#!/bin/bash | |
############################################################ | |
# Limpa 'docker registry' (últimas 2 imagens ficam) | |
############################################################ | |
# esse carinha depende do https://github.com/dominictarr/JSON.sh | |
REGISTRY_URL=${1:-http://localhost:8082} | |
REGISTRY_DATA_VOLUME=${2:-/var/www/docker-registry-data} |
Pré-história: | |
Unix: | |
1970 - Bell Labs., por Ken Thompson, Dennis Ritchie (os mesmos da linguagem C :) | |
1983 - UNIX System V (pronounced: "System Five") is one of the first commercial versions of the Unix operating system. It was originally developed by AT&T. | |
Microsoft: | |
1975, April 4 - Bill Gates & Paul Allen | |
1976 - Open Letter to Hobbyists (Bill Gates): (Why is this? As the majority of hobbyists must be aware, most of you steal your software. Hardware must be paid for, but software is something to share. Who cares if the people who worked on it get paid?) http://www.lettersofnote.com/2009/10/most-of-you-steal-your-software.html | |
BASIC interpreters for the Altair 8800 | |
Licensed MS-DOS 1.10/1.14 to IBM, who, in August 1981, offered it as PC DOS 1.0 as one of three operating systems[13] for the IBM 5150, or the IBM PC |
#!/bin/sh | |
mkdir ~/down/ | |
cd ~/down/ | |
sudo apt-get install build-essential | |
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz | |
tar -xzf Python-2.7.2.tgz | |
cd Python-2.7.2 | |
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev | |
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev | |
sudo apt-get install libssl-dev libdb-dev |
[url "https://github.com/"] | |
insteadOf = git@github.com/ | |
[url "https://github.com/"] | |
insteadOf = git://github.com/ |
Install Termux and SSHDroid ;) |