Skip to content

Instantly share code, notes, and snippets.

View frosit's full-sized avatar

Fabio Ros frosit

View GitHub Profile
@frosit
frosit / magento-testing-scenarios.md
Last active September 11, 2015 14:46 — forked from peterjaap/magento-testing-scenarios.md
Magento testing scenarios

Magento testing scenarios

For use after an upgrade to verify the correct working of Magento

SHIP IT

Frontend

General

  • Activate all logs on the server (PHP, MySQL, Magento, mail, etc)
  • Check meta tags in HTML
@frosit
frosit / CheatSheat.md
Created February 25, 2016 23:27
Magento CheatSheet

#Magento Cheat Sheet Code snippets for use in Magento.

##Base Methods

	// Get Base URL
    Mage::getBaseUrl();
    // Get Base Directory
    Mage::getBaseDir();
<?php
/**
* Categories Children count fix script.
*
* This scripts looks through all categories, compares the current children_count in database with the children_count as calculated in this script.
* If these values are different, the calculated values will be saved.
*
* Author: Fabio Ros - FROSIT
* Client: Seasight-Media
*
@frosit
frosit / infectedFiles.md
Created May 5, 2016 22:40
Some commands for finding and clearing infected PHP files

Finding infected files with following bash commands

** Command to list all infected files:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
  • grep -lr --include=*.php "eval" .
  • grep -lr --include=*.php "base64" .

Command to remove malicious code:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'
@frosit
frosit / snippet.xml
Created May 17, 2016 19:50
XML file question
<?xml version="1.0"?>
<layout>
<default>
<action method="removeItem">
<type>skin_js</type>
<name>js/slideshow.js</name>
</action>
<action method="addStylesheet">
<type>skin_css</type>
<name>css/custom.css</name>
@frosit
frosit / backup-databases.sh
Last active February 4, 2017 01:36
Backup all databases in seperate archives
#!/bin/bash
# Backup all databases
USER="XXX"
PASSWORD="XXX"
HOST="XXX"
now="$(date +'%d-%m-%Y')"
DATABASES=`mysql -u ${USER} -p${PASSWORD} -h ${HOST} -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`
for db in ${DATABASES}; do
@frosit
frosit / quick-reference.md
Created October 3, 2016 13:28
Quick reference for rewritetoolset

Commands for hypernode

Quick note on command options

Due to the earlier analysis phase of this set. There are some option embedded which are redundant to some commands. These options will show available, but won't do anything at some newer commands. They are mostly available to analysis and benchmark commands.

Sometimes redundant options

  • --save (sometimes generates a HTML report)
@frosit
frosit / Locks.php
Created November 23, 2016 12:53
Magelock shows your indexes and lock files via a semi-secure one-page easy-to-use and discard way
<?php
/**
* == MageLock ==
*
* ~ Shows your Magento indexes' lock status.
*
* @description This file shows your index statuses and was meant to show when lock's became active or inactive.
* @warning DO NOT LEAVE THIS FILE ON PRODUCTION
* @note it requires the user to be logged in the backend for output to show, however this is not sufficient for proper security
*
@frosit
frosit / .gitignore
Last active September 3, 2017 15:00
Magento 1 Universal Ignore - optimised for security in various environments
# Magento 1 Universal ignore V:1 ~ FROSIT.nl
# Project: ...
# IDE&OS files
.DS_*
*.swp
*.lock
__MACOSX
.idea
/nbproject/*
@frosit
frosit / phash
Created February 23, 2017 17:36
A small PHP hash script
#!/usr/bin/env php
<?php
/**
* Hash Tool
* =========
*
* Small helper script to PHP's hash functions.
*
* @author Fabio Ros
*