Create a user for the replication:
$ psql postgres
postgres=# CREATE USER replica REPLICATION LOGIN ENCRYPTED PASSWORD 'so-secret';
RELEASE=$1 | |
mkdir /tmp/iosevka-font/$RELEASE | |
cd /tmp/iosevka-font/$RELEASE | |
wget https://github.com/be5invis/Iosevka/releases/download/v$RELEASE/ttf-iosevka-$RELEASE.zip | |
wget https://github.com/be5invis/Iosevka/releases/download/v$RELEASE/ttf-iosevka-aile-$RELEASE.zip | |
wget https://github.com/be5invis/Iosevka/releases/download/v$RELEASE/ttf-iosevka-etoile-$RELEASE.zip | |
wget https://github.com/be5invis/Iosevka/releases/download/v$RELEASE/ttf-iosevka-fixed-$RELEASE.zip | |
wget https://github.com/be5invis/Iosevka/releases/download/v$RELEASE/ttf-iosevka-fixed-slab-$RELEASE.zip | |
wget https://github.com/be5invis/Iosevka/releases/download/v$RELEASE/ttf-iosevka-slab-$RELEASE.zip |
geo $limited { | |
default 1; | |
xxx.xxx.xxx/xx 0; | |
} | |
map $limited $limit { | |
1 $binary_remote_addr; | |
0 ""; | |
} |
create sequence enrollment_enrollmentcompany_id_seq; | |
select max(id) from enrollment_enrollmentcompany; | |
select setval('enrollment_enrollmentcompany_id_seq', 609, true); | |
alter table enrollment_enrollmentcompany alter column id set default nextval('enrollment_enrollmentcompany_id_seq'); | |
-- Option 2 | |
CREATE sequence enrollment_enrollmentcompany_id_seq owned by enrollment_enrollmentcompany.id; | |
SELECT setval(pg_get_serial_sequence('"enrollment_enrollmentcompany"','id'), coalesce(max("id"), 1), max("id") IS NOT null) FROM "enrollment_enrollmentcompany"; | |
ALTER TABLE "enrollment_enrollmentcompany" ALTER COLUMN "id" SET DEFAULT nextval(pg_get_serial_sequence('"enrollment_enrollmentcompany"','id')); |
rsync -havzP -e "ssh -i /home/deploy/xxxxx.pem" [email protected]:/home/deploy/complete-path/ /home/deploy/complete-path/ |
email_message = EmailMultiAlternatives( | |
subject='subject', | |
body='some text', | |
from_email='[email protected]', | |
to=['example@example'], | |
) | |
email_message.attach_alternative(render_to_string('email.html', context), 'text/html') | |
email_message.mixed_subtype = 'related' | |
# Image |
Create a user for the replication:
$ psql postgres
postgres=# CREATE USER replica REPLICATION LOGIN ENCRYPTED PASSWORD 'so-secret';
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "ListAllBuckets", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListAllMyBuckets", | |
"s3:GetBucketLocation" | |
], |
1. Remove old migrations file | |
sudo find . -path "*/migrations/*.py" -not -name "__init__.py" -not -path "./.venv/*" -delete | |
sudo find . -path "*/migrations/*.pyc" -not -path "./.venv/*" -delete | |
2. Make migrations again | |
python manage.py makemigrations | |
3. Truncate django_migrations table | |
TRUNCATE TABLE django_migrations; |
sudo nano /etc/X11/xorg.conf
Section "ServerFlags"
Option "blank time" "0"
Option "standby time" "0"
Option "suspend time" "0"
Option "off time" "0"
EndSection