Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
exec < /dev/tty
if [ ! -f ./system.txt ]; then
echo "File not found!"
read -p "Status of the system (local,dev or live)? [n]" -r
echo $REPLY > ./system.txt
fi
dumpname=`cat system.txt`
@DevertNet
DevertNet / Magento Country Codes
Created February 24, 2016 14:08
Magento Country Codes
Country 2 Digit Code 3 Digit Code
Afghanistan AF AFG
Albania AL ALB
Algeria DZ DZA
American Samoa AS ASM
Andorra AD AND
Angola AO AGO
Anguilla AI AIA
Antarctica AQ ATA
Antigua and Barbuda AG ATG
[globalVar = GP:tx_news_pi1|news > 0]
temp.newsTitle = RECORDS
temp.newsTitle {
source = {GP:tx_news_pi1|news}
source.insertData = 1
tables = tx_news_domain_model_news
select.languageField = sys_language_uid
conf {
tx_news_domain_model_news >
tx_news_domain_model_news = TEXT
<?php
$dir = dirname(__FILE__);
chdir($dir);
require $dir.'/app/Mage.php';
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$configSections = Mage::getSingleton('adminhtml/config')->getSections();
// look for node entries in all system.xml that use source_model=adminhtml/system_config_source_email_template
// they are will be templates, what we try find
@DevertNet
DevertNet / Magento Delete Credit Memo in Database
Created March 7, 2017 08:46
Delete credit memo in magento. Tested with 1.7.0.2
DELETE FROM sales_flat_creditmemo WHERE entity_id=123;
UPDATE sales_flat_order_item SET qty_refunded='0.0000', amount_refunded='0.0000', base_amount_refunded='0.0000', hidden_tax_refunded=NULL, base_hidden_tax_refunded=NULL, tax_refunded=NULL, discount_refunded=NULL, base_discount_refunded=NULL WHERE order_id=54255;
UPDATE sales_flat_order SET state='complete', status='complete', base_discount_refunded=NULL, base_shipping_refunded=NULL, base_shipping_tax_refunded=NULL, base_subtotal_refunded=NULL, base_tax_refunded=NULL, base_total_offline_refunded=NULL, base_total_refunded=NULL, discount_refunded=NULL, shipping_refunded=NULL, shipping_tax_refunded=NULL, subtotal_refunded=NULL, tax_refunded=NULL, total_offline_refunded=NULL, total_refunded=NULL, adjustment_negative=NULL, adjustment_positive=NULL, base_adjustment_negative=NULL, base_adjustment_positive=NULL, base_total_due=NULL, total_due=NULL, hidden_tax_refunded=NULL, base_hidden_tax_refunded=NULL WHERE entity_id=54255;
UPDATE sales_flat_order_grid SET st
<?php
//There is a more proper way to do this.
$resource = Mage::getSingleton('core/resource');
$write = $resource->getConnection('core_write');
$table = $resource->getTableName('your/model');
//You can Create:
$write->insert(
$table,
@DevertNet
DevertNet / test.attr.php
Created October 15, 2015 12:41
Magento Adding existing attribute to all attribute sets
<?php
/*
replace show_in_price_search_engine with your attr code
replace General with antoher Tab
*/
$dir = dirname(__FILE__);
chdir($dir);
/*
Important! Change attribute_id ;)
*/
insert into catalog_product_entity_varchar (entity_type_id, attribute_id, store_id, entity_id, value) select entity_type_id, attribute_id, store_id, entity_id, value from catalog_product_entity_int where attribute_id = 165;
DELETE FROM catalog_product_entity_int WHERE attribute_id = 165;
UPDATE eav_attribute SET backend_type='varchar', frontend_input='multiselect', backend_model='eav/entity_attribute_backend_array' WHERE attribute_id = 165;
/*
Bericht für den heutigen Tag exportieren.
Porjekt öffnen, in den Tab "Tickets" wechseln, Datum in Code Ändern und in der Konsole abfeuern...
*/
var today = 0;
var all = '';
jQuery('.issuecalendar').each(function(e) {
if (typeof jQuery(this).attr('data-date') == 'undefined') return;
var date = new Date(parseInt(jQuery(this).attr('data-date')) * 1000);
var day = date.toISOString().split('T')[0].split('-')[2];
1. Im Root-Verzeichnis (/home/root) folgendes ausführen:
git clone https://github.com/letsencrypt/letsencrypt.git
cd letsencrypt
./letsencrypt-auto -h
service nginx stop
./letsencrypt-auto certonly --standalone -d www.beispiel.de -d beispiel.de
service nginx start
2. Keys werden hier abgelegt:
/etc/letsencrypt/live/www.beispiel.de