This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup'); | |
if (! $installer->getAttributeId(Mage_Catalog_Model_Product::ENTITY, 'attribute_name')) | |
{ | |
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'attribute_name', [ // TABLE.COLUMN: DESCRIPTION: | |
'label' => 'Label', // eav_attribute.frontend_label admin input label | |
'group' => 'General', // (not a column) tab in product edit screen | |
'sort_order' => 0, // eav_entity_attribute.sort_order sort order in group | |
'backend' => 'module/class_name', // eav_attribute.backend_model backend clas |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE VIEW promotions AS | |
SELECT 'Full Price' AS 'Promotion Name' | |
, COUNT(entity_id) AS '# of Orders' | |
, CONCAT(ROUND( | |
(((SELECT COUNT(b.entity_id) FROM sales_flat_order b WHERE b.applied_rule_ids IS NULL) | |
/ (SELECT COUNT(entity_id) FROM sales_flat_order a)) * 100), 1), '%') AS '% of Orders' | |
, ROUND(AVG(subtotal), 2) AS 'Avg. Total' | |
FROM sales_flat_order |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[virtualbox] | |
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox | |
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch | |
enabled=1 | |
gpgcheck=1 | |
gpgkey=http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update servers, run via parallel | |
# | |
# CPR : Jd Daniel :: Ehime-ken | |
# MOD : 2014-12-12 @ 16:06:39 | |
# VER : 1b | |
# REF : http://www.gnu.org/software/parallel/ | |
# | |
# 5.5 or 6.6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function certwait () | |
{ | |
i=0 | |
while sleep 1; do | |
clear; echo "Ran ${i} loops" | |
echo -e "\nFOUND:" | |
matches=$(puppet cert list 2>/dev/null |awk '{print$1}' |sed -e 's/"//g' |grep "${1}") | |
if [ ! -z "${matches}" ]; then | |
echo $matches |sed -e 's/^//g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Magnet links library for PHP | |
* | |
* @link http://stackoverflow.com/questions/6634059/magnet-links-library-for-php | |
*/ | |
$magnetUri = 'magnet:?xt=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C'; | |
echo 'Magnet URI demo: ', $magnetUri, "\n\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
# Expect login and SU for SSH | |
# Usage ssh_sudo_login.expect <host> <ssh user> <ssh password> <su user> <su password> | |
# CPR : Jd Daniel :: Ehime-ken | |
# MOD : 2015-01-14 @ 14:59:06 | |
# VER : Version 1 | |
set timeout 60 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
DocumentRoot /var/www/sn-query.io/public | |
ServerName www.sn-query.io | |
ServerAlias sn-query.io | |
<Directory "/var/www/sn-query.io/public"> | |
Options Indexes MultiViews | |
AllowOverride All | |
Order allow,deny | |
Allow from all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
#cptag - A script to resample mp3 files with LAME and | |
# copy id3v2 tags from the old file to the new one. | |
# | |
##################### | |
# Read id3 tags and write to file | |
mid3v2 -l "$1" > tag2.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
puppet apply --parser future -e '$ip="192.158.1" $vars={ | |
0 => "${ip}.0", | |
1 => "${ip}.1", | |
2 => "${ip}.2", | |
} each($vars) |$id,$gate| { notice "${id} -> ${gate}" }' | |
## Outputs | |
#Notice: Scope(Class[main]): 0 -> 192.158.1.0 |