Skip to content

Instantly share code, notes, and snippets.

View nullx5's full-sized avatar
:octocat:
🎯 Keep Calm and Code in Python! 🐍

Blessed nullx5

:octocat:
🎯 Keep Calm and Code in Python! 🐍
View GitHub Profile

Compilar php manualmente y agregarlo a una instalacion de apache por repositorio APT


sudo apt update
sudo apt install -y build-essential autoconf bison re2c libxml2-dev \
  libsqlite3-dev libssl-dev libcurl4-openssl-dev libjpeg-dev libpng-dev \
  libwebp-dev libxpm-dev libzip-dev libonig-dev libreadline-dev \
  libtidy-dev libxslt1-dev libffi-dev pkg-config git perl apache2-dev

Redirigir automaticamente de HTTP a HTTPS en apache

sudo nvim 000-default.conf
ServerName localhost
Redirect permanent / https://localhost/


sudo nvim default-ssl.conf
sudo a2ensite default-ssl.conf

entrar y salir modo tty solo texto

reinicar servidor grafico xorg y reiniciar display manager sddm gdm

init --help

# entrar a una tty solo texto
sudo init 2 3 4

#revisar si SSDM esta corriendo o GDM

Comandos para apagar y reiniciar mi Linux

| Acción               | Comando                               | Descripción                                        |
|----------------------|---------------------------------------|----------------------------------------------------|
| Apagar inmediato     | `sudo poweroff`                       | Apaga el sistema de inmediato.                     |
| Apagar               | `sudo shutdown now`                   | Apaga el sistema de forma segura.                  |
| Apagar a una hora    | `sudo shutdown 22:00`                 | Programa apagado a las 22:00 horas.                 |
| Reiniciar inmediato  | `sudo reboot`                         | Reinicia el sistema inmediatamente.                |
| Reiniciar | `sudo shutdown -r now` | Reinicia el sistema de forma segura. |

Deploy Django en produccion Apache + Gnicorn con Socket Unix | HAY ERRORES INVESTIGAR MÁS

sudo mkdir /srv/myproject; cd /srv/myproject


sudo python3 -m venv env

source env/bin/activate

Python empaquetado - sdist (Source Distribution) vs bdist (Built Distribution) y crear .deb desde codigo fuente python.

sudo apt install setuptools dh_make devscripts dpkg-dev
pip install setuptool

sdist (Source Distribution)

Apache certificados HTTPS diferentes formatos.

nvim /etc/apache2/sites-available/default-ssl.conf

SSLCertificateFile /home/blessed/[crt, cer, pem, pfx]

SSLCertificateFileKeyFile /home/blessed/[key, cer, pem]

Let's Encrypt usa *.pem