warden shell
cd /tmp
curl -O https://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz
touch /tmp/wordpress/.htaccess
mkdir /tmp/wordpress/wp-content/upgrade
cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
cp -a /tmp/wordpress/. /var/www/html
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 | |
/** | |
* @author Raj KB <[email protected]> | |
* @website https://www.magepsycho.com | |
* | |
*/ | |
$mageFilename = 'app/Mage.php'; | |
require_once $mageFilename; | |
Mage::setIsDeveloperMode(true); | |
ini_set('display_errors', 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
vcl 4.0; | |
import std; | |
import directors; | |
backend server1 { | |
.host = "127.0.0.1"; # IP or Hostname of backend | |
.port = "8080"; # Port Apache or whatever is listening | |
.max_connections = 800; # That's it | |
.first_byte_timeout = 300s; # How long to wait before we receive a first byte from our backend? |
- OS: Ubuntu 16.04
- SCM: Bitbucket
- Remote Git Repo: [email protected]:magepsycho/magepsycho.git
- Deployment Branch:
master
- Web Root Dir: /var/www/magento2/magepsycho
- Git Repo Dir: /var/www/magento2/magepsycho.git
In remote server
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 | |
# | |
# Script to backup Magento2 Codebase + Database | |
# | |
# @author Raj KB <[email protected]> | |
# @website http://www.magepsycho.com | |
# @version 0.1.0 | |
# UnComment it if bash is lower than 4.x 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
# General web stuff | |
#/.htaccess | |
/robots.txt | |
/sitemap.xml | |
# Dynamic Magento data | |
/var/* | |
/media/catalog/product/cache/* | |
/media/tmp/ | |
/media/js/* |
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
# Start MongoDB
sudo systemctl start mongod
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
-- without using SET variable | |
SELECT t.id, | |
t.count, | |
(@running_total := @running_total + t.count) AS cumulative_sum | |
FROM TABLE t | |
JOIN (SELECT @running_total := 0) r | |
ORDER BY t.id | |
-- with SET variable | |
SET @running_total := 0; |
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
-- @author Raj KB | |
-- @website http://blog.magepsycho.com | |
SET @STORE_ID = 7; | |
SET @CATALOG_FLAT_TABLE = CONCAT('catalog_product_flat_', @STORE_ID); | |
SET @QUERY = CONCAT('SELECT * FROM ', @CATALOG_FLAT_TABLE, ' LIMIT 10'); | |
PREPARE stmt FROM @QUERY; | |
EXECUTE stmt; | |
DEALLOCATE PREPARE stmt; |
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 | |
TIMESTAMP=$(date +"%F") | |
BACKUP_DIR="/home/rajendra" | |
MYSQL=/usr/bin/mysql | |
MYSQL_USER="root" | |
MYSQL_PASSWORD="mys123" | |
MYSQLDUMP=/usr/bin/mysqldump | |
mkdir -p "$BACKUP_DIR/mysql-dump" |
NewerOlder