Skip to content

Instantly share code, notes, and snippets.

View zetxek's full-sized avatar
😎
Time off work - time to play with pet projects (and AI 🤖)

Adrián Moreno Peña zetxek

😎
Time off work - time to play with pet projects (and AI 🤖)
View GitHub Profile
@zetxek
zetxek / ec2-host-from-tag-to-env-vars.sh
Last active February 22, 2020 17:46 — forked from marcellodesales/ec2-host-from-tag-to-env-vars.sh
Create Environment Variables in EC2 Hosts from EC2 Host Tags (including AWS-generated variables)
######
# Author: Adrian Moreno, based on Marcelo de Salles' script: https://gist.github.com/marcellodesales/a890b8ca240403187269
# Description: Create Create Environment Variables in EC2 Hosts from EC2 Host Tags
# Changes from original:
# - removed the need of passing region to the tags command in AWS
# - processing aws generated variables (with ":" on their value of key)
#
### Requirements:
# * Install jq library (sudo apt-get install -y jq)
# * Install the EC2 Instance Metadata Query Tool (http://aws.amazon.com/code/1825)
@zetxek
zetxek / run.sh
Last active January 19, 2017 16:50 — forked from jamesonjlee/run.sh
running AWS Cloudwatch Monitor tool on CentOS6.5 without having EC2 roles in place
yum install -y perl-CPAN nano wget zip unzip perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https gcc gcc-c++ make openssl-devel
export PERL_MM_USE_DEFAULT=1
# setup default config
perl -MCPAN -e shell # make sure to exit
# need to wait here
perl -MCPAN -e 'CPAN::Shell->rematein("notest", "install", "Bundle::CPAN")'
perl -MCPAN -e 'CPAN::Shell->rematein("notest", "install", "CPAN")'
perl -MCPAN -e 'CPAN::Shell->rematein("notest", "install", "Bundle::LWP")'
<?php
/**
* Implements hook_form_alter().
*/
function modulename_form_alter(&$form, &$form_state, $form_id) {
if (strpos($form_id, '_node_form') !== false ) {
// Add a cancel button.
$form['actions']['cancel'] = array(
'#type' => 'submit',