Install the OpenSSL on Debian based systems
sudo apt-get install openssl
Application.put_env(:elixir, :ansi_enabled, true) | |
# IEx shell customization for color | |
# - Added as a comment: https://thinkingelixir.com/course/code-flow/module-1/pipe-operator/ | |
# - Original source: https://samuelmullen.com/articles/customizing_elixirs_iex/ | |
# - Can add to a specific project or can put in the User home folder as a global config. | |
# Updates from: | |
# - https://github.com/am-kantox/finitomata/blob/48e1b41b21f878e9720e6562ca34f1ce7238d810/examples/ecto_intergation/.iex.exs | |
timestamp = fn -> | |
{_date, {hour, minute, _second}} = :calendar.local_time |
sudo apt update && sudo apt upgrade -y | |
sudo apt install apache2 -y | |
sudo apt install easy-rsa -y | |
cd /usr/share/easy-rsa | |
sudo ./easyrsa init-pki | |
yes "" | sudo ./easyrsa build-ca nopass |
#!/usr/bin/env python2 | |
import SimpleHTTPServer | |
import SocketServer | |
import logging | |
PORT = 8000 | |
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): |
#!/usr/bin/env bash | |
DATABASE_URL="postgres://MyPostgresUser:MyPostgresPassword@192.168.0.1:5432/MyPostgresDB" | |
# `cut` is used to cut out the separators (:, @, /) that come matched with the groups. | |
DATABASE_USER=$(echo $DATABASE_URL | grep -oP "postgres://\K(.+?):" | cut -d: -f1) | |
DATABASE_PASSWORD=$(echo $DATABASE_URL | grep -oP "postgres://.*:\K(.+?)@" | cut -d@ -f1) | |
DATABASE_HOST=$(echo $DATABASE_URL | grep -oP "postgres://.*@\K(.+?):" | cut -d: -f1) | |
DATABASE_PORT=$(echo $DATABASE_URL | grep -oP "postgres://.*@.*:\K(\d+)/" | cut -d/ -f1) |
Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts and experience preferred (super rare at this point).
[MASTER] | |
profile=no | |
persistent=yes | |
ignore=tests.py, urls.py, migrations | |
cache-size=500 | |
[MESSAGES CONTROL] | |
# C0111 Missing docstring | |
# I0011 Warning locally suppressed using disable-msg | |
# I0012 Warning locally suppressed using disable-msg |
# -*- coding: utf-8 -*- | |
# code is in the public domain | |
# (c) 2012 Thomas Güttler http://www.thomas-guettler.de/ | |
# | |
# http://djangosnippets.org/snippets/2691/ | |
# myapp/management/commands/update_primary_key.py | |
u''' | |
Management command to update a primary key and update all child-tables with a foreign key to this table. |