# The default swappiness in Ubuntu 60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.
# Checkout swappiness value
cat /proc/sys/vm/swappiness
# Switch swap off
sudo swapoff -a
<?php | |
$serverName = "MOHANA-LAPTOP\SQLEXPRESS"; | |
$connectionInfo = array("Database" => "test", "UID" => "sa", "PWD"=>"123456"); | |
$conn = sqlsrv_connect($serverName, $connectionInfo); | |
if($conn) { | |
echo "Connection established .. :)"; | |
} else { | |
echo "Connection could not be established :("; | |
dir(print_r(sqlsrv_errors(), true)); |
TRUNCATE dataflow_batch_export; | |
TRUNCATE dataflow_batch_import; | |
TRUNCATE log_customer; | |
TRUNCATE log_quote; | |
TRUNCATE log_summary; | |
TRUNCATE log_summary_type; | |
TRUNCATE log_url; | |
TRUNCATE log_url_info; | |
TRUNCATE log_visitor; | |
TRUNCATE log_visitor_info; |
#!/bin/bash | |
# This file reindex all Magento indexes without any lock table | |
# This is the right order to reindexall via script | |
# I update every 3 sec any Magento product via API. | |
# Before this script I noticed this error | |
# SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction | |
echo "Reindexall via script" | |
php /mage/magento/shell/indexer.php --reindex cataloginventory_stock | |
php /mage/magento/shell/indexer.php --reindex catalog_product_attribute |
1 - install GPG tools : https://gpgtools.org/
2 - Create new key for your github email
3 - Add key to git on your local machine: git config --global user.signingkey YOURKEY
4 - configure git to sign all commits: git config --global commit.gpgsign true
5 - add to the bottom of ~/.gnupg/gpg.conf
: (create the file if it not exists)
php bin/magento setup:backup --db | |
gzip var/backups/*.sql | |
git pull | |
php bin/magento maintenance:enable | |
php bin/magento cache:enable | |
rm -fr var/di var/generation var/cache | |
php bin/magento setup:di:compile | |
php bin/magento deploy:mode:set production --skip-compilation | |
php bin/magento maintenance:enable | |
php bin/magento setup:upgrade |
Composer and M2: http://devdocs.magento.com/guides/v2.0/extension-dev-guide/build/composer-integration.html
Dependency Injection (and di.xml details): http://devdocs.magento.com/guides/v2.1/extension-dev-guide/depend-inj.html
Object Manager:
NetworkManager supports WiFi powersaving but the function is rather undocumented.
From the source code: wifi.powersave can have the following value:
- NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
- NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
- NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
SET FOREIGN_KEY_CHECKS = 0; | |
-- Truncate order tables | |
TRUNCATE TABLE `gift_message`; | |
TRUNCATE TABLE `quote`; | |
TRUNCATE TABLE `quote_address`; | |
TRUNCATE TABLE `quote_address_item`; | |
TRUNCATE TABLE `quote_id_mask`; | |
TRUNCATE TABLE `quote_item`; |
When setting these options consider the following:
- How long is your average request?
- What is the maximum number of simultaneous visitors the site(s) get?
- How much memory on average does each child process consume?
sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log