Skip to content

Instantly share code, notes, and snippets.

View magefast's full-sized avatar
🥶

Alex S magefast

🥶
View GitHub Profile
@magefast
magefast / private_fork.md
Created May 9, 2025 16:49 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@magefast
magefast / UpdateAttributeOptionStoreLabel.php
Created February 5, 2024 09:20
Magento1: Update Attribute Options Label for Store
<pre>
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('time_limit', 180);
set_time_limit(180);
require_once dirname(__FILE__) . '/app/Mage.php';
$app = Mage::app('admin');
umask(0);
@magefast
magefast / UpdateAttributeStoreLabel.php
Last active February 5, 2024 09:18
Magento1: Update Attribute Label for Store
<pre>
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('time_limit', 180);
set_time_limit(180);
require_once dirname(__FILE__) . '/app/Mage.php';
$app = Mage::app('admin');
umask(0);
@magefast
magefast / tips.sh
Last active February 5, 2025 20:10
tips
#count files
ls -1 | wc -l
#
find . -maxdepth 1 -type d | while read -r dir
do printf "%s:\t" "$dir"; find "$dir" -type f | wc -l; done
# find biggest folders
du -k /home | sort -n | tail -10
@magefast
magefast / images.php
Created October 30, 2023 07:57
#Magento2 Working with product images, mass checking/updating
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once __DIR__ . '/../app/bootstrap.php';
use Magento\Framework\App\Bootstrap;
$bootstrap = Bootstrap::create(BP, $_SERVER);
@magefast
magefast / mass_update_magento2_product_data.php
Created September 14, 2023 12:28
Mass Update Magento2 Product data
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
ini_set('memory_limit', '2048M');
require_once __DIR__ . '/../app/bootstrap.php';
use Magento\Framework\App\Bootstrap;
@magefast
magefast / check-attribute-in-attribute-set.php
Created July 10, 2023 11:16
Magento1. Check Attribute in Attributes Set.
<pre>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once './app/Mage.php';
Mage::app();
$needAttribute = 'xxx';
$attributeSetArray = [];
@magefast
magefast / magento-telephone-number-for-ordered-sku-form-list.php
Last active April 24, 2023 07:40
Magento1: Telephone number for ordered SKU form List
<pre>
<h1>Telephone number for ordered SKU form List</h1>
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
ini_set('time_limit', 180);
set_time_limit(180);
@magefast
magefast / products-from-category-id.php
Created December 13, 2022 10:38
Magento2: get products collection - filter by category ID
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once __DIR__ . '/../app/bootstrap.php';
use Magento\Framework\App\Bootstrap;
$bootstrap = Bootstrap::create(BP, $_SERVER);
@magefast
magefast / export-csv-product-data.php
Created November 29, 2022 10:56
Magento1: Export to CSV file product data
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('max_execution_time', 1000);
require_once dirname(__FILE__) . './../app/Mage.php';
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$productsCollection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('sku')