Create a user for the replication:
$ psql postgres
postgres=# CREATE USER replica REPLICATION LOGIN ENCRYPTED PASSWORD 'so-secret';
Change your postgres.conf:
$ brew install python3 | |
$ python3.7 get-pip.py | |
at vscode: | |
Install Python extension | |
Configure flake8 linter | |
Install code command in path | |
Install Spacegray extension | |
set Source Code Pro font at 13px |
gource -1920x1080 --title "Osaki" --logo axiacore-logo-small.png --user-image-dir .git/avatar/ --font-size 18 --seconds-per-day 0.3 --auto-skip-seconds 0.1 --disable-progress --stop-at-end -output-ppm-stream - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 video.mp4
gource -1920x1080 --title "Osaki" --logo axiacore-logo-small.png --user-image-dir .git/avatar/ --auto-skip-seconds 1 --seconds-per-day 0.5 --hide mouse,progress -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.mp4
Editar audio en audacity y exportarlo a mp3 con la misma duración del video (maximo 90 segundos)
uptime # uptime and CPU stress | |
w # or better yet:last |head # who is/has been in | |
netstat -tlpn # find server role | |
df -h # out of disk space? | |
grep kill /var/log/messages # out of memory? |
from django.core.files.base import ContentFile | |
qs = Category.objects.exclude(image='').exclude(image_s3__isnull=False) | |
count = 0 | |
total = qs.count() | |
for obj in qs: | |
new_file = ContentFile(obj.image.file.read()) | |
new_file.name = obj.image.name.split('/')[-1:][0] | |
obj.image_s3 = new_file | |
obj.save() | |
obj.image.file.close() |
pg_lsclusters | |
sudo apt install postgresql-10 -y | |
export LC_CTYPE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 | |
sudo pg_dropcluster 10 main --stop | |
sudo service nginx stop | |
sudo pg_upgradecluster 9.6 main | |
sudo pg_dropcluster 9.6 main | |
sudo service nginx start |
from bs4 import BeautifulSoup | |
def wrap(to_wrap, wrap_in): | |
contents = to_wrap.replace_with(wrap_in) | |
wrap_in.append(contents) | |
for obj in Post.objects.all(): | |
soup = BeautifulSoup(obj.content, 'html.parser') | |
for item in soup.children: | |
if item.name is None: |
virtualenv test --python=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 |
Run this on the shell:
sudo sh -c "echo -n 'sammy:' >> /etc/nginx/.htpasswd"
sudo sh -c "openssl passwd -apr1 >> /etc/nginx/.htpasswd"
Change nginx file to:
location / {
...
npm install | |
bower install | |
gulp compile-sass | |
. ../bin/activate | |
pip install -r requirements.txt | |
python manage.py collectstatic --noinput | |
python manage.py compilemessages |