This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ElasticSearch | |
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.tar.gz | |
tar -xvf elasticsearch-6.1.1.tar.gz | |
cd elasticsearch-6.1.1/bin | |
./elasticsearch | |
http://localhost:9200 | |
Kibana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backup: | |
docker exec -t -u postgres your-db-container pg_dumpall -c > your_dump.sql | |
Restore: | |
cat your_dump.sql | docker exec -i your-db-container psql -U postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd FOLDER | |
# If Python version returned above is 3.X | |
python -m http.server | |
# If Python version returned above is 2.X | |
python -m SimpleHTTPServer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo su - postgres | |
pg_dump -Fc mydatabase > /tmp/mydatabase.sql | |
sudo su - postgres | |
pg_restore --verbose --clean -d mydatabase /tmp/mydatabase.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from weasyprint import HTML, CSS | |
def get_page_body(boxes): | |
for box in boxes: | |
if box.element_tag == 'body': | |
return box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS=0; | |
UPDATE `core_store` SET store_id = 0 WHERE code='admin'; | |
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default'; | |
UPDATE `core_website` SET website_id = 0 WHERE code='admin'; | |
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN'; | |
SET FOREIGN_KEY_CHECKS=1; |