Skip to content

Instantly share code, notes, and snippets.

<?php
function __redirect($url)
{
header( 'Content-type: text/html; charset=utf-8' );
header("Location: " . $url, true, 307 );
echo "<html></html>";
flush();
ob_flush();
exit;
}
@cvele
cvele / elb_aws_deploy.rb
Last active October 30, 2018 15:46
Capistrano 3 (ruby) snippet to deploy to multiple AWS servers attached to ELB dynamically. Add this to production.rb (or whatever stage) instead of servers definition. AWS ec2 cli required.
require 'rubygems'
require 'json'
LOADBALANCER = 'your-elb-load-balancer-name'
lb_instances = %x( aws elb describe-instance-health --load-balancer-name #{LOADBALANCER} )
lb_instances = JSON.parse(lb_instances)
instances = lb_instances["InstanceStates"]
<?php
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand,
Symfony\Component\Console\Input\InputArgument,
Symfony\Component\Console\Input\InputInterface,
Symfony\Component\Console\Input\StringInput,
Symfony\Component\Console\Output\OutputInterface;
class BeanstalkdManagerCommand extends ContainerAwareCommand
{
@cvele
cvele / log.log
Last active February 24, 2022 14:19
DEBUG: Evaluating config script "/opt/ejabberd-21.12/rebar.config.script"
DEBUG: Consult config file "/opt/ejabberd-21.12/rebar.config"
DEBUG: Rebar location: "/opt/ejabberd-21.12/rebar"
DEBUG: Evaluating config script "/opt/ejabberd-21.12/src/ejabberd.app.src.script"
DEBUG: is_app_available, looking for App base64url with Path "/opt/ejabberd-21.12/deps/base64url"
DEBUG: Consult config file "/opt/ejabberd-21.12/deps/base64url/src/base64url.app.src"
INFO: Looking for base64url-.* ; found base64url-1.0.1 at /opt/ejabberd-21.12/deps/base64url
DEBUG: is_app_available, looking for App cache_tab with Path "/opt/ejabberd-21.12/deps/cache_tab"
DEBUG: Consult config file "/opt/ejabberd-21.12/deps/cache_tab/src/cache_tab.app.src"
blueprint:
name: Room Scene Selector
description:
Automate scene selection and light management in a room using button
presses, motion sensors, and optional hold actions.
domain: automation
input:
turn_off_action:
name: Turn Off Action
description: