Generated by All in One SEO v4.9.2, this is an llms.txt file, used by LLMs to index the site. # xploit29 Cool code tips. ## Sitemaps - [XML Sitemap](https://xploit29.com/sitemap.xml): Contains all public & indexable URLs for this website. ## Posts - [Setup streaming replication with PostgreSQL 10](https://xploit29.com/2018/11/04/setup-streaming-replication-with-postgresql-10/) - Requirements Ubuntu 16.04 or Ubuntu 18.04PostgreSQL 102 servers (a master and a slave) In case you don't know how to install PostgreSQL you can follow this tutorial from DigitalOcean. Setup It's highly recommended to use two servers that can communicate via on a private interface. Master server: 192.168.123.10Slave server: 192.168.123.11 Master server configuration Create a - [Multiple environments on NewRelic](https://xploit29.com/2018/11/15/multiple-environments-on-newrelic/) - About New Relic it's a powerful tool that handles application monitoring. Configuration It is a good practice setting environment variables to define and configure our NewRelic parameters. newrelic.ini example: [newrelic] # You must specify the license key associated with your New # Relic account. This key binds the Python Agent's data to your # account in - [Seguridad: Las URLS en Facebook y los anuncios](https://xploit29.com/2016/10/16/seguridad-las-urls-en-facebook-y-los-anuncios/) - El día de hoy en Facebook me topé con una publicidad engañosa de unos de los bancos más grandes del mundo. A lo procedí a ingresar a la página para reportarla como falsa tras comprobar que realmente era falsa y observé algo muy extraño, que la URL era: https://www.facebook.com/BBVAContinentaI/ lo que visualmente se ve de la siguiente - [Weight distribution matters.](https://xploit29.com/2016/10/06/weight-distribution-matters/) - Next time, you'll know it. - [Django Rest Framework auto assign current user on creation](https://xploit29.com/2016/09/15/django-rest-framework-auto-assign-current-user-on-creation/) - If you use the ModelViewSet provided by Django Rest Framework you overwrite the perform_create method on the ModelViewSet to auto set the current user to the model before saving. As usual my recommendation is to create "Mixin" like this one: If you think that there is a better way, let us know in the comments bellow. - [Upload files to Django Rest Framework using AngularJS](https://xploit29.com/2016/09/13/upload-files-to-django-rest-framework-using-angularjs/) - Encoding the image to "base64", send it to our DRF endpoint and on our DRF serializers change the ImageField to Base64ImageField was the implementation I used: On the client side, on my angular app: On the server side on my Django app, specifically on the serializers.py file: I found out that this is the cleaner way - [Require activated virtualenv on PIP](https://xploit29.com/2016/09/09/require-activated-virtualenv-on-pip/) - I highly recommended to separate your working environments so every project has their own set of packages. To do this just edit the ~/.bash_profile file. After that, reload the source file with this command source ~/.bash_profile. - [Scaling Django Properly](https://xploit29.com/2016/09/08/scaling-django-properly/) - I'm in love with Django and as a love we should be able to know how to scale Django properly that's why I'm sharing this video with you. So you can make your Django deployment "greater again" (no pun intended). - [WordPress HTTPS Redirection](https://xploit29.com/2016/09/08/wordpress-https-redirection/) - You don't need to install any kind plugin to achieve this. Just go to "Settings" > "General" and them update your "WordPress Address" and the "Site Address". Change the "http" to "https" as the following image. Really, that's it! and you are good to go. ## Pages - [Privacy Policy](https://xploit29.com/privacy-policy/) - Who we are Our website address is: https://xploit29.com. Comments When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection. An anonymized string created from your email address (also called a hash) may be provided - [Contact](https://xploit29.com/contact/) ## Categories - [WordPress](https://xploit29.com/category/wordpress/) - [Django](https://xploit29.com/category/django/) - [Python](https://xploit29.com/category/python/) - [AngularJS](https://xploit29.com/category/angularjs/) - [Offtopic](https://xploit29.com/category/offtopic/) - [Facebook](https://xploit29.com/category/facebook/) - [SysAdmin](https://xploit29.com/category/sysadmin/) ## Tags - [WordPress](https://xploit29.com/tag/wordpress/) - [Tip](https://xploit29.com/tag/tip/) - [SSL](https://xploit29.com/tag/ssl/) - [Django](https://xploit29.com/tag/django/) - [Scaling](https://xploit29.com/tag/scaling/) - [Learn](https://xploit29.com/tag/learn/) - [OS X](https://xploit29.com/tag/os-x/) - [Sublime Text](https://xploit29.com/tag/sublime-text/) - [PIP](https://xploit29.com/tag/pip/) - [Python](https://xploit29.com/tag/python/) - [AngularJS](https://xploit29.com/tag/angularjs/) - [DRF](https://xploit29.com/tag/drf/) - [Django Rest Framework](https://xploit29.com/tag/django-rest-framework/) - [Trailers](https://xploit29.com/tag/trailers/) - [Facebook](https://xploit29.com/tag/facebook/) - [Seguridad](https://xploit29.com/tag/seguridad/) - [Problema](https://xploit29.com/tag/problema/) - [PostgreSQL](https://xploit29.com/tag/postgresql/) - [Servers](https://xploit29.com/tag/servers/) - [Server](https://xploit29.com/tag/server/) - [Replication](https://xploit29.com/tag/replication/) - [DevOPS](https://xploit29.com/tag/devops/) - [NewRelic](https://xploit29.com/tag/newrelic/) - [SysAdmin](https://xploit29.com/tag/sysadmin/) - [Monitoring](https://xploit29.com/tag/monitoring/) - [Postgres](https://xploit29.com/tag/postgres/)