When applications are running in production, they become black boxes that need to be traced and monitored. One of the simplest, yet main, ways to do so is logging. Logging allows us - at the time we develop our software - to instruct the program to emit information while the system is running that will be useful for us and our sysadmins.
If you want to use travis_retry
from within your own shell script files then you first have to make the travis_retry
shell function available by sourcing the travis_retry.sh
file, otherwise you just get a "command not found" error. See example.sh
for a full example.
Note that the original function as found in the travis-ci/travis-build repository was slightly modified to allow it to be used in a shell context where set -e
is enabled.
For reference, a tweet by Travis CI saying that you should copy the travis_retry
code as I've done here:
https://twitter.com/plexus/status/499194992632811520
#!/bin/bash -eu | |
die() { echo 1>&2 "ERROR: $*" ; exit 1 ; } | |
info() { echo 1>&2 "INFO: $*" ; } | |
test "${1:-}" || die "Usage: $0 <role-name | role ARN> [<role-name | role ARN> ...]" | |
while test "${1:-}" ; do | |
role="$1" | |
shift |
<?php declare(strict_types=1); | |
require_once "✨.🐘"; | |
✨($_)->strlen("foo")->var_dump($_); |
#python3 | |
def hook(t): | |
def inner(bytes_amount): | |
t.update(bytes_amount) | |
return inner | |
BUCKET_NAME = 'your_s3_bucket_name' | |
FILE_NAME = 'your_s3_file_name' | |
s3 = boto3.resource('s3') |
'Update or create a stack given a name and template + params' | |
from __future__ import division, print_function, unicode_literals | |
from datetime import datetime | |
import logging | |
import json | |
import sys | |
import boto3 | |
import botocore |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "NonResourceBasedReadOnlyPermissions", | |
"Action": [ | |
"ec2:DescribeSubnets", | |
"ec2:DescribeSnapshots", | |
"ec2:DescribeImages", | |
"ec2:DescribeVolumes", |
Creates an alias on the loopback interface (lo0) with the IP 127.0.0.2 on macOS.
- Install the plist to:
/Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
- Set mode:
sudo chmod 0644 /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
- Set owner:
sudo chown root:wheel /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
- Load:
sudo launchctl load /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254
as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254
.
Once your machine has a well known IP address, your PHP container will then be able to connect to it, specifically XDebug can connect to it at the configured xdebug.remote_host
.
Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...
#!/usr/bin/env php | |
<?php | |
declare(strict_types=1); | |
namespace CodeReviewsIo\Worker; | |
use CodeReviewsIo\Domain\Command\TickTime; | |
use Prooph\ServiceBus\CommandBus; | |
use React\EventLoop\Factory; |