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 | |
// Insert this file on server and go to the path from browser. | |
set_time_limit(0); //Unlimited max execution time | |
$path = 'newfile.zip'; // Name of the file to be saved on server | |
$url = 'http://your_old_domain.com/file.zip'; //File URL to be moved | |
$newfname = $path; | |
echo 'Starting Download!<br>'; | |
$file = fopen ($url, "rb"); | |
if($file) { | |
$newf = fopen ($newfname, "wb"); |
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 | |
//Place this file in source server and go to the path | |
set_time_limit(0); //Unlimited max execution time | |
$remote_file = '/var/www/file.zip'; //File to be saved in remote server with path | |
/* FTP Account */ | |
$ftp_host = 'ftp-host.com'; /* host */ | |
$ftp_user_name = '[email protected]'; /* username */ | |
$ftp_user_pass = 'ftppassword'; /* password */ |
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 | |
// Insert this file on server and go to the path from browser. | |
set_time_limit(0); //Unlimited max execution time | |
/* Source File URL */ | |
$remote_file_url = 'http://origin-server-url/files.zip'; | |
/* New file name and path for this file */ | |
$local_file = 'files.zip'; |
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 | |
//Put this file on the installation folder and run script via browser. This script will change all folders permission as 755 & all file's permission as 644. | |
//Function to set file permissions to 0644 and folder permissions to 0755 | |
function AllDirChmod( $dir = "./", $dirModes = 0755, $fileModes = 0644 ){ | |
$d = new RecursiveDirectoryIterator( $dir ); | |
foreach( new RecursiveIteratorIterator( $d, 1 ) as $path ){ | |
if( $path->isDir() ) chmod( $path, $dirModes ); | |
else if( is_file( $path ) ) chmod( $path, $fileModes ); | |
} |
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
// configure jshint to validate all js files ----------------------------------- | |
jshint: { | |
options: { | |
reporter: require('jshint-stylish') // use jshint-stylish to make our errors look and read good | |
}, | |
// when this task is run, lint the Gruntfile and all js files in src | |
build: ['src/js/*.js'] | |
} |
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
## Diflate compression :- Compress HTML, CSS, JavaScript, Text, XML and fonts ## | |
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject | |
AddOutputFilterByType DEFLATE application/x-font | |
AddOutputFilterByType DEFLATE application/x-font-opentype | |
AddOutputFilterByType DEFLATE application/x-font-otf | |
AddOutputFilterByType DEFLATE application/x-font-truetype | |
AddOutputFilterByType DEFLATE application/x-font-ttf |
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 | |
// assuming file.zip is in the same directory as the executing script. | |
$file = 'mrkothari.zip'; | |
// get the absolute path to $file | |
$path = pathinfo(realpath($file), PATHINFO_DIRNAME); | |
$zip = new ZipArchive; | |
$res = $zip->open($file); | |
if ($res === TRUE) { |
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 FOREIGN_KEY_CHECKS=0; | |
############################## | |
# SALES RELATED TABLES | |
############################## | |
TRUNCATE `sales_flat_creditmemo`; | |
TRUNCATE `sales_flat_creditmemo_comment`; | |
TRUNCATE `sales_flat_creditmemo_grid`; | |
TRUNCATE `sales_flat_creditmemo_item`; | |
TRUNCATE `sales_flat_invoice`; |
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 | |
//Add Database details | |
$database_host = "localhost";// DB Host | |
$database_user = "dbuser"; // DB User Name | |
$database_password = "dbpassword"; // DB Password | |
$magento_database = "dbname"; //DB Name | |
$table_prefix = "dbprefix_"; // DB Prefix | |
//Do the action | |
$db = mysql_connect($database_host, $database_user, $database_password); |
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
import os, fnmatch | |
def findReplace(directory, filePattern): | |
for path, dirs, files in os.walk(os.path.abspath(directory)): | |
for filename in fnmatch.filter(files, filePattern): | |
filepath = os.path.join(path, filename) | |
with open(filepath) as f: | |
s = f.read().splitlines(True) | |
with open(filepath, "w") as f: | |
f.write("<?php") | |
f.writelines(s[1:]) |
OlderNewer