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 | |
require_once('./app/Mage.php'); | |
umask(0); | |
Mage::app(); | |
try { | |
$user = Mage::getModel('admin/user') | |
->setData(array( | |
'username' => 'developer', | |
'firstname' => 'John', |
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 | |
$transaction = Mage::getModel('core/resource_transaction'); | |
$storeId = Mage::app()->getStore('default')->getId(); | |
$reservedOrderId = Mage::getSingleton('eav/config')->getEntityType('order')->fetchNewIncrementId($storeId); | |
$email = "we.love.website@gmail.com"; | |
$firstname = "web"; | |
$lastname = "dev"; | |
$order = Mage::getModel('sales/order') |
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 | |
# clear screen | |
clear; | |
# Get current directory, assume this script is locate under Magento root directory | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located |
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 bin/magento admin:user:create --admin-user='developer' --admin-password='claLwK88oO7RK' --admin-email='we.love.website@gmail.com' --admin-firstname='Web' --admin-lastname='Developer' |
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 | |
ini_set('display_errors',0); | |
ini_set('memory_limit','1024M'); | |
set_time_limit(0); | |
//echo '<pre>';print_r($_SERVER);exit; | |
function Zip($source, $destination) | |
{ | |
if (!extension_loaded('zip') || !file_exists($source)) { | |
return false; | |
} |
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 | |
//echo '<pre>';print_r($_SERVER);exit; | |
$zip = new ZipArchive; | |
if ($zip->open('magmi_full_0.7.21.zip') === TRUE) { | |
$zip->extractTo('.'); | |
$zip->close(); | |
echo 'ok'; | |
} else { | |
echo 'failed'; | |
} |
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 ImportCSV2Array($filename) | |
{ | |
$row = 0; | |
$col = 0; | |
$handle = @fopen($filename, "r"); | |
if ($handle) | |
{ |
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
curl -u USER:PASS -O ftp://HOST/PATH/FILE.EXT |
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
Secure Copy (scp) | |
Copy the file "foobar.txt" from a remote host to the local host | |
> $ scp your_username@remotehost.edu:foobar.txt /some/local/directory | |
Copy the file "foobar.txt" from the local host to a remote host | |
> $ scp foobar.txt your_username@remotehost.edu:/some/remote/directory | |
Copy the directory "foo" from the local host to a remote host's directory "bar" | |
> $ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar |
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
useradd <user> | |
groupadd <group-name> | |
gpasswd -a <user> <group-name> | |
chgrp -R <group-name> /path/to/dir/ | |
chmod -R g+rw /path/to/dir/ | |
passwd <user> |