php bin/magento config:set admin/security/session_lifetime 31536000
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
#!/bin/bash | |
# | |
# summarize daily performance data | |
cd /var/log/sa | |
# ------------ | |
# memory usage | |
# ------------ | |
echo |
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 | |
$ch = curl_init('https://www.howsmyssl.com/a/check'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
$json = json_decode($data); | |
echo $json->tls_version; |
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 | |
function display_usage() { | |
echo <<< EOF | |
Usage : create_patch.php [-f|--from] [-t|--to] | |
-f : From Magento version (e.g. ce_1.9.0.1) | |
-t : To Magento version (e.g. ee_1.14.1.0) | |
--from : alias of -f | |
--to : alias of -t |
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 | |
// Parse error log file | |
echo '------------------------------- exception.log -------------------------------'; | |
$lines = file('exception.log'); | |
$error = ''; | |
$errors = array(); | |
$errors_count = array(); | |
foreach ($lines as $line_num => $line) { | |
$line = trim($line); |
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 apt install intltool libtool network-manager-dev libnm-util-dev libnm-glib-dev libnm-glib-vpn-dev libnm-gtk-dev libnm-dev libnma-dev ppp-dev libdbus-glib-1-dev libsecret-1-dev libgtk-3-dev libglib2.0-dev xl2tpd strongswan | |
git clone https://github.com/nm-l2tp/network-manager-l2tp.git | |
cd network-manager-l2tp | |
autoreconf -fi | |
intltoolize | |
./configure --disable-static --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/NetworkManager --localstatedir=/var --with-pppd-plugin-dir=/usr/lib/pppd/2.4.7 | |
make |
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
# Find all the session files older then 3 days then display the number of files. | |
find /path/to/your/website/root/var/session -name 'sess_*' -type f -mtime +3 | wc -l | |
# Same as above, but display them in "less", browse with PageUP / PageDown. | |
find /path/to/your/website/root/var/session -name 'sess_*' -type f -mtime +3 | less | |
# Delete all the files older then 3 days. | |
find /path/to/your/website/root/var/session -name 'sess_*' -type f -mtime +3 -exec rm {} \; |
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
-- Replace "DATABASE" with the database you want information on | |
SELECT | |
table_name AS 'Tables', | |
round(((data_length + index_length) / 1024 / 1024), | |
2) 'Size in MB' | |
FROM | |
information_schema.TABLES | |
WHERE | |
table_schema = 'DATABASE' |
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 | |
for ($i = 0; $i < 10; $i++) { | |
switch($i) { | |
case 4 : | |
case 5 : | |
echo 'HIT PRE CONTINUE'.PHP_EOL; | |
if ($i == 5) { | |
continue; // Expected this to skip the for loop, skips to the break instead. | |
} | |
echo 'HIT POST CONTINUE'.PHP_EOL; |
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
diff -rupN TBT3/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php TBT2/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php | |
--- TBT3/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php 2013-04-16 19:20:50.000000000 +0100 | |
+++ TBT2/app/code/community/TBT/Rewards/Model/Observer/Catalog/Product/Flat/Update/Product.php 2013-06-03 13:30:13.783568896 +0100 | |
@@ -97,11 +97,13 @@ class TBT_Rewards_Model_Observer_Catalog | |
$product = $event->getProduct(); | |
} | |
- if ( $product ) { | |
+ if ( is_numeric($product) ) { | |
+ $target_product_id = $product; |