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
<?php | |
if (session_status() == PHP_SESSION_NONE) { | |
// Prevents javascript XSS attacks aimed to steal the session ID | |
ini_set('session.cookie_httponly', '1'); | |
// ** PREVENTING SESSION FIXATION ** | |
// Session ID cannot be passed through URLs | |
ini_set('session.use_only_cookies', '1'); |
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
version: "3.9" | |
services: | |
db: | |
platform: linux/x86_64 | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: |
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
### | |
Usage: python3 ./price_conversion.py <DATA-FILE> > <EXPORT>.sql | |
### | |
import csv, math, re, sys | |
id_field_name = "ID" | |
regular_price_field_name = "Price tax excluded or Price tax included" | |
approved_customer_price_field_name = "Specific Price" | |
def generate_values(id_product, discount_price): |
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
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
.clamp { | |
-webkit-line-clamp: 2; | |
display: -webkit-box; | |
-webkit-box-orient: vertical; | |
overflow: hidden; | |
word-break: keep-all; |
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
- hosts: webservers-test | |
gather_facts: no | |
remote_user: root | |
pre_tasks: | |
- name: Update apt cache. | |
apt: update_cache=true cache_valid_time=600 | |
tasks: | |
- name: Install opendkim |
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
# All these tables have an id_product primary key | |
TRUNCATE TABLE ps_product; | |
TRUNCATE TABLE ps_product_attachment; | |
TRUNCATE TABLE ps_product_country_tax; | |
TRUNCATE TABLE ps_product_group_reduction_cache; | |
TRUNCATE TABLE ps_product_lang; | |
TRUNCATE TABLE ps_product_sale; | |
TRUNCATE TABLE ps_product_tag; | |
TRUNCATE TABLE ps_category_product; | |
TRUNCATE TABLE ps_feature_product; |
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
SELECT CEILING(Total_InnoDB_Bytes*1.6/POWER(1024,3)) RIBPS FROM | |
(SELECT SUM(data_length+index_length) Total_InnoDB_Bytes | |
FROM information_schema.tables WHERE engine='InnoDB') A; |
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
mysqladmin -uroot -proot ext -ri1 | grep Innodb_buffer_pool_reads |
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 @DB_NAME = 'your_database'; | |
SELECT CONCAT('ALTER TABLE `', | |
table_name, '` ENGINE=InnoDB;') AS sql_statements | |
FROM information_schema.tables AS tb | |
WHERE table_schema = @DB_NAME | |
AND ENGINE = 'MyISAM' | |
AND TABLE_TYPE = 'BASE TABLE' | |
ORDER BY table_name DESC; |
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
SELECT | |
concat(table_schema, '.', table_name) tbl, | |
engine, | |
concat(round(table_rows/ | |
1000000,2),'M') rows, | |
concat(round(data_length/ | |
(1024*1024*1024),2),'G') DATA, | |
concat(round(index_length/ | |
(1024*1024*1024),2),'G') idx, | |
concat(round((data_length+index_length)/ |
NewerOlder