This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt install python | |
apt install ndk-sysroot clang # For Pillow and complex packages | |
apt install libcrypt-dev # for psycopg2-binary | |
apt install python-pip | |
-- pip install virtualenv | |
-- pip install django pillow | |
-- pip install psycopg2-binary # optional | |
# para instalar postgresql local | |
apt install postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda create -n myenv python=3.5.5 # Crea entornos | |
conda create --no-default-packages -n myenv python # Crea entornos sin paquetes | |
conda info --envs # Lista entornos | |
conda env list # Lista entornos en MiniConda | |
conda list -n myenv # lista paquetes de un entorno especifico | |
conda list # Lista paquetes del entorno actual | |
conda install -n myenv pip # instalando pip en el entorno |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo " | |
http_code: %{http_code}\n\ | |
http_version: %{http_version}\n\ | |
num_connects: %{num_connects}\n\ | |
remote_ip: %{remote_ip}\n\ | |
size_download: %{size_download}\n\ | |
size_header: %{size_header}\n\ | |
size_request: %{size_request}\n\ | |
speed_download: %{speed_download}\n\ | |
time_namelookup: %{time_namelookup}\n\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compress_async = (e) => { | |
return new Promise((resolve, reject) => { | |
const width = 1080; | |
const height = 1080; | |
const fileName = e.target.files[0].name; | |
const reader = new FileReader(); | |
var file = null; | |
reader.readAsDataURL(e.target.files[0]); | |
const img = new Image(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prmt = lambda x, y: math.factorial(x)/math.factorial(x-y) | |
comb = lambda x, y: prmt(x, y)*(math.factorial(y)**-1) | |
# 6 personas en 4 lugares respetando sus posiciones dan 360 escenarios | |
assert prmt(6, 4) == 360 | |
# 6 personas en 4 lugares sin importar posiciones dan 15 escenarios | |
assert comb(6, 4) == 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from uuid import uuid4 | |
import time | |
def get_bin_str(_bytes): | |
return " ".join( | |
["{0:08b}".format(bit) for bit in _bytes] | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WARNING : This gist in the current form is a collection of command examples. Please exercise caution where mentioned. | |
# Docker | |
sudo apt-get update | |
sudo apt-get remove docker docker-engine docker.io | |
sudo apt install docker.io | |
sudo systemctl start docker | |
sudo systemctl enable docker | |
docker --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
result = subprocess.run(['pip', 'freeze'], stdout=subprocess.PIPE) | |
rq_file = open("requirements.txt", "r") | |
rq_file_versioned = open("requirements_versioned.txt", "w") | |
rq_versioned = list() | |
versioned_lines = result.stdout.decode("utf-8").split("\n")[:-1] | |
rq_lines = rq_file.readlines() | |
rq_file.close() | |
def match(dependency): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+(/home/ubuntu/.pyenv/bin/pyenv:23): enable -f /home/ubuntu/.pyenv/bin/../libexec/pyenv-realpath.dylib realpath | |
+(/home/ubuntu/.pyenv/bin/pyenv:30): '[' -z '' ']' | |
++(/home/ubuntu/.pyenv/bin/pyenv:32): type -P greadlink readlink | |
++(/home/ubuntu/.pyenv/bin/pyenv:32): head -1 | |
+(/home/ubuntu/.pyenv/bin/pyenv:32): READLINK=/usr/bin/readlink | |
+(/home/ubuntu/.pyenv/bin/pyenv:33): '[' -n /usr/bin/readlink ']' | |
+(/home/ubuntu/.pyenv/bin/pyenv:58): '[' -z /home/ubuntu/.pyenv ']' | |
+(/home/ubuntu/.pyenv/bin/pyenv:61): PYENV_ROOT=/home/ubuntu/.pyenv | |
+(/home/ubuntu/.pyenv/bin/pyenv:63): export PYENV_ROOT | |
+(/home/ubuntu/.pyenv/bin/pyenv:65): '[' -z '' ']' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dnf install -y augeas-libs | |
sudo python3 -m venv /opt/certbot/ | |
sudo /opt/certbot/bin/pip install --upgrade pip | |
sudo /opt/certbot/bin/pip install certbot certbot-apache | |
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot | |
sudo certbot -d example.pro --nginx |
OlderNewer