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
#!/bin/bash | |
INSTANCE_PLACEMENT=$(aws ec2 describe-instances --instance-id ${1} | jq -r ".Reservations[] .Instances[].Placement.AvailabilityZone") | |
AZ=$(echo ${INSTANCE_PLACEMENT} | awk '{ print substr($1, length($1)) }') | |
REGION=$(echo ${INSTANCE_PLACEMENT} | awk '{ print substr($1, 0, length($1)-1) }') | |
aws ec2-instance-connect send-ssh-public-key --instance-id ${1} --availability-zone ${REGION}${AZ} --instance-os-user ec2-user --ssh-public-key file:///Users/your_user/.ssh/id_rsa.pub | |
aws ssm start-session --target ${1} --document-name AWS-StartSSHSession --parameters portNumber=${2} |
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
# Until further upgrades V3 pearson will not use host name classification and instead will apply common modules and stringently implement passed roles. | |
node default { | |
# apply our pmc_common module | |
class{'profile::common': } | |
# switch on $::pmc_role custom FACT | |
# do not fail if no role is specifically applied. | |
# given that we have only a few roles, a declarative switch statement like this is preferred. | |
case $::pmc_role { |
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
{ | |
"orders": [ | |
{ | |
"OrderID": "17157", | |
"OrderStatus": "3", | |
"OrderStatusCode": "dispatched", | |
"CustomerAccount": "PIERI001", | |
"CustomerVATNumber": "CY00870822R", | |
"GrossValue": "426.09", | |
"DeliveryCompanyName": "STIHL MIXALIS PIERI", |
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
# Hello Candidate! | |
# Welcome to the EE Python Test. | |
# As I will have mentioned in the interview we are not overly interested | |
# in the absolute quality of your code, just your ability to approach problems. | |
# All code solutions should be tar/zip'd up and sent to the recruiter to pass | |
# back to us. Thanks. | |
# Task 1 | |
# |
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
exec{'buildhybris': | |
cwd => 'hybris_install_dir', | |
cmd => './build.sh', | |
unless => "/usr/bin/test -f /tmp/hybris_build_done", | |
timeout => 600, | |
before => File['/tmp/hybris_build_done'] | |
} | |
file{'/tmp/hybris_build_done': | |
ensure => present |
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 Base: | |
templates = {} | |
def register(self, register): | |
self.templates.update(register) | |
def do_something(): | |
for tpl in self.templates.values(): | |
print "Perhaps access the object here? I.e" | |
# I don't really like this, which led me to question it. | |
instance = self.templates[tpl]() |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"AppendItemToListFunction": { | |
"Properties": { | |
"Code": { | |
"ZipFile": { | |
"Fn::Join": [ | |
"", | |
[ |
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
dave:~/sites/bin $ ./phpmig status | |
PHP Fatal error: Call to a member function schema() on boolean in /Users/davidheward/sites/vendor/davedevelopment/phpmig/src/Phpmig/Adapter/Illuminate/Database.php on line 89 | |
Fatal error: Call to a member function schema() on boolean in /Users/davidheward/sites/vendor/davedevelopment/phpmig/src/Phpmig/Adapter/Illuminate/Database.php on line 89 |
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
from fabric.api import * | |
import boto | |
from boto import regioninfo | |
from boto import ec2 | |
from boto.ec2.elb import ELBConnection | |
import app | |
# Some default environment settings | |
env.user = 'ec2-user' |
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 DevodoCredit_AddCredits extends Backend_Controller | |
{ | |
public $implement = 'Db_ListBehavior, Db_FormBehavior'; | |
public function __construct(){ | |
parent::__construct(); | |
} |
NewerOlder