Skip to content

Instantly share code, notes, and snippets.

View dublado's full-sized avatar
📭
Send me a Telegram

Thiago Machado dublado

📭
Send me a Telegram
View GitHub Profile
@dublado
dublado / gist:8863118
Created February 7, 2014 14:03
mongo export json to csv
mongoexport --port _PORT_ --csv --username oppa --password _PASSWORD_ --collection _COLLECTION_ --db _DB_ --fields create_at,email,subject,body,order --forceTableScan --out /tmp/emails.csv
@dublado
dublado / gist:9255438
Created February 27, 2014 18:03
query delete orders magento
select @order_id:=entity_id from sales_flat_order where increment_id='100000001'; delete from sales_flat_order_grid where entity_id=@order_id;
@dublado
dublado / gist:9456274
Last active August 29, 2015 13:57
Reset Password to Admin Magento
UPDATE admin_user SET password=CONCAT(MD5('qXpassword'), ':qX') WHERE username='admin';
/*
keep qX or another else, if you change qX set in all parameters, only qX
you can use user_id too */
@dublado
dublado / zipfiles
Created March 19, 2014 16:25
Create zip one per file with password - input this at automator
tell application "Finder"
set theItems to selection
repeat with _a from 1 to (count of theItems)
set theItem to (item _a of theItems) as alias
set itemPath to quoted form of (POSIX path of theItem)
set fileName to name of theItem
set theFolder to POSIX path of (container of theItem as alias)
set zipFile to quoted form of (theFolder & fileName & ".zip")
do shell script "zip -rj --password YOURPASSWORD " & zipFile & " " & itemPath
end repeat
@dublado
dublado / gist:3dbfe6c7461c6944267e
Created June 26, 2014 19:23
Get magento url_key inside url
.*[\/]URL_KEY[\/|\?|]?[^A-Za-z^|^\-|^0-9^]
example:
.*[\/]cadeira-vermelha-damasco[\/|\?|]?[^A-Za-z^|^\-|^0-9^]
@dublado
dublado / gist:ee34575ab3e9582fb6c5
Created July 2, 2014 14:26
magento - Qty for Item's Status to become Out of Stock
#user_config_min_qty - checkbox enable/disable
update cataloginventory_stock_item set min_qty = QTY,use_config_min_qty = 0 where item_id = PRODUCT_ID;
@dublado
dublado / gist:193b10eeadf5de120fa0
Created July 7, 2014 20:42
screenshot fullsize fullscreen screen capture
import sys
import time
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
class Screenshot(QWebView):
def __init__(self):
self.app = QApplication(sys.argv)
QWebView.__init__(self)
@dublado
dublado / gist:5b6067bc98669475faee
Created July 10, 2014 12:40
install meld git diff
Script para a instalação do Meld e configuração do git diff
#!/bin/bash
echo "Installing meld..."
apt-get install meld -y -qq
echo "Meld [OK]"
echo "Creating meld custom script..."
rm ~/.config/git_meld_diff.sh
@dublado
dublado / gist:9309673aae5cf0fa5305
Created July 16, 2014 21:09
Vagrantfile. Set memory and CPU
To set virtual machine memory size use:
config.vm.customize ["modifyvm", :id, "--memory", 2048]
To set virtual machine CPU's count use:
config.vm.customize ["modifyvm", :id, "--cpus", 2]
or to set half of available CPU's count:
config.vm.customize ["modifyvm", :id, "--cpus", `awk "/^processor/ {++n} END {print n}" /proc/cpuinfo 2> /dev/null || sh -c 'sysctl hw.logicalcpu 2> /dev/null || echo ": 2"' | awk \'{print \$2}\' `.chomp ]
@dublado
dublado / gist:308d94333f3b6333376e
Created September 16, 2014 13:46
magento cache clean
<?php
//date_default_timezone_set("Europe/Madrid");
echo "Start Cleaning all caches at ... " . date("Y-m-d H:i:s") . "\n\n";
ini_set("display_errors", 1);
require '../app/Mage.php';
Mage::app('admin')->setUseSessionInUrl(false);
Mage::getConfig()->init();
$types = Mage::app()->getCacheInstance()->getTypes();