This file contains 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
#/usb/bin/php | |
<?php | |
//author rgranadino aug 22 2012 | |
//tested on a D-Link DIR-615 B2 v2.25 firmware. | |
//this is a php translation of: | |
// http://www.shulerent.com/2009/08/21/cracking-the-d-link-settings-file/ | |
$file = $argv[1]; | |
if (!is_readable($file)) { | |
echo "Cannot read file: $file\n"; |
This file contains 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
resource "aws_appautoscaling_policy" "scale_out" { | |
name = "scale-up" | |
policy_type = "TargetTrackingScaling" | |
resource_id = "service/${data.terraform_remote_state.ecs_cluster.ecs_cluster_name}/${var.service_name}" | |
scalable_dimension = "ecs:service:DesiredCount" | |
service_namespace = "ecs" | |
target_tracking_scaling_policy_configuration { | |
target_value = "${var.scaling_target_value}" | |
scale_in_cooldown = "${var.scale_in_cooldown}" |
This file contains 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/ruby | |
require 'json' | |
$sshUser = 'ec2user' | |
#NOTE all of our ecs clusters are prefixed with "ecs-" | |
#which we assume here to save the time & trouble of having to type that out | |
#all of our tasks are also suffixed with the "environment" name | |
def sshToEcsInstance(clusterName) | |
cmd = "aws ecs list-container-instances --cluster ecs-"+ clusterName | |
instances = JSON.parse(`#{cmd}`)["containerInstanceArns"] | |
ec2InstanceHostname = getInstanceInfo(clusterName, instances.sample) |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am rgranadino on github. | |
* I am beeplogic (https://keybase.io/beeplogic) on keybase. | |
* I have a public key ASAbXks9Scgwvunw_13NMBXnVYDNLdWqCEZRRNKFZGzP7go | |
To claim this, I am signing this object: |
This file contains 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
log4j.rootLogger = ALL, Console | |
log4j.appender.Console=org.apache.log4j.ConsoleAppender | |
log4j.appender.Console.layout=org.apache.log4j.PatternLayout | |
log4j.appender.Console.layout.conversionPattern=%m%n |
This file contains 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 | |
class Email { | |
//... | |
public function setAttachments(array $files) { | |
$this->attachment_list = array(); | |
foreach($files as $filename => $file) { | |
if (is_str($filename)) { | |
$this->addAttachment($file, $filename); | |
} else { |
This file contains 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
public function syncConfigProductAttributes(Mage_Catalog_Model_Product $product) | |
{ | |
if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) { | |
/* @var $productType Mage_Catalog_Model_Product_Type_Configurable */ | |
$productType = $product->getTypeInstance(true); | |
$syncAttributes = array('short_description', 'description'); | |
foreach ($productType->getUsedProductCollection($product) as $childProduct) { | |
//$childProduct->load($childProduct->getId()); | |
/* @var $childProduct Mage_Catalog_Model_Product */ | |
foreach ($syncAttributes as $attributeCode) { |
This file contains 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/env php | |
<?php | |
require 'app/Mage.php'; | |
if (!Mage::isInstalled()) { | |
echo "Application is not installed yet, please complete install wizard first."; | |
exit(1); | |
} | |
$baseDir = getcwd(); | |
//not sure if this is necessary, ported over from cron.php script | |
$_SERVER['SCRIPT_NAME'] = $baseDir.'/index.php'; |
This file contains 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
class Foo { | |
public $x = null; | |
} | |
$a = new Foo(); | |
$b = new Foo(); | |
$c = new Foo(); | |
$d = new Foo(); | |
$a->x = $c; |
This file contains 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
.buildpath | |
.htaccess | |
.htaccess.sample | |
.settings | |
.project | |
app/etc/local.xml | |
app/code/community/Find/ | |
app/code/community/Phoenix/ | |
app/code/core/ | |
app/design/adminhtml/default/default/ |
NewerOlder