Skip to content

Instantly share code, notes, and snippets.

View giorgiosironi's full-sized avatar

Giorgio Sironi giorgiosironi

View GitHub Profile
2018/05/11 14:52:54 [DEBUG] [aws-sdk-go]
2018/05/11 14:52:54 [INFO] terraform: building graph: GraphTypeInput
2018/05/11 14:52:54 [DEBUG] Attaching resource state to "fastly_service_v1.fastly-cdn": &terraform.ResourceState{Type:"fastly_service_v1", Dependencies:[]string{}, Primary:(*terraform.InstanceState)(0xc4202cecd0), Deposed:[]*terraform.InstanceState{}, Provider:"provider.fastly", mu:sync.Mutex{state:0, sema:0x0}}
2018/05/11 14:52:54 [TRACE] Graph after step *terraform.AttachStateTransformer:
fastly_service_v1.fastly-cdn - *terraform.NodeAbstractResource
2018/05/11 14:52:54 [TRACE] Graph after step *terraform.RootVariableTransformer:
fastly_service_v1.fastly-cdn - *terraform.NodeAbstractResource
2018/05/11 14:52:54 [TRACE] ProviderConfigTransformer: Starting for path: []
@giorgiosironi
giorgiosironi / gist:f421c60cd63c2918e162e27e09d6bb84
Created January 23, 2018 12:00
When your Value Object is so immutable, you remove a field and a non-deterministic value is readded in its place
<?php
require 'vendor/autoload.php';
$response = Symfony\Component\HttpFoundation\Response::create('HelloWorld');
$response->headers->remove('Date');
$response->headers->remove('date'); // just to be sure
var_dump($response->headers->all());
/*
array(2) {
["cache-control"]=>
array(1) {
$ ls /usr/bin/*-* | wc -l
801
$ ls /usr/bin/*_* | wc -l
243
@giorgiosironi
giorgiosironi / init.sls
Created September 26, 2017 07:34
Attempt to reproduce require_in misordering
second:
cmd.run:
- name: echo "second"
first:
cmd.run:
- name: echo "first"
- require_in:
- cmd: second
@giorgiosironi
giorgiosironi / gist:ef4f326d0e959cbd826d9a6cef769b44
Created September 22, 2017 16:09
Sample output from build triggered by shared library update
Started by GitHub push by giorgiosironi
Checking out git [email protected]:elifesciences/profiles.git into /var/lib/jenkins/workspace/test-profiles@script to read Jenkinsfile
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url [email protected]:elifesciences/profiles.git # timeout=10
Fetching upstream changes from [email protected]:elifesciences/profiles.git
> git --version # timeout=10
using GIT_SSH to set credentials SSH private key of the jenkins user
> git fetch --tags --progress [email protected]:elifesciences/profiles.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/develop^{commit} # timeout=10

Export current plot from ggplot

https://stackoverflow.com/a/11304431/91590

As per @naught101's suggestion - for a 5x7 (inch!) pdf file which is a convenient size to be pasted into an A4 Word document, the following works well:

dev.copy2pdf(file="example.pdf", width = 7, height = 5)
@giorgiosironi
giorgiosironi / gist:b98f01c8ff3bbec1edd27750813290b8
Created October 8, 2016 11:08
Installing mit-scheme on my Ubuntu 14.04 removes hhvm
...
The following extra packages will be installed:
libmcrypt4:i386 libpq5:i386
Suggested packages:
libmcrypt-dev:i386 mcrypt:i386 mit-scheme-dbg:i386 mit-scheme-doc:i386
The following packages will be REMOVED
hhvm libmcrypt4 libpq-dev libpq5
The following NEW packages will be installed
libmcrypt4:i386 libpq5:i386 mit-scheme:i386
@giorgiosironi
giorgiosironi / gist:e10b8dc47efa79fb3886be6acf7bdb60
Created September 22, 2016 16:18
The AWS SNS + SQS pair is the first time I see a pub/sub where you send XML and it comes out as JSON
Originally sending "<key>value</key>"
Message received!
{
"Type" : "Notification",
"MessageId" : "9d30ae1f-9180-5049-870a-fe41946fbfd9",
"TopicArn" : "arn:aws:sns:us-east-1:14343913592:bus-articles--end2end",
"Message" : "<key>value</key>",
"Timestamp" : "2016-09-22T16:15:43.378Z",
"SignatureVersion" : "1",
"Signature" : "...",
@giorgiosironi
giorgiosironi / drupal_rest_server_exception_logging.patch
Last active July 26, 2016 09:44
Making Drupal 7 rest_server log exceptions
--- a/servers/rest_server/includes/RESTServer.inc 2016-07-26 09:52:28.709829797 +0100
+++ b/servers/rest_server/includes/RESTServer.inc 2016-07-26 09:52:04.253829191 +0100
@@ -645,6 +645,16 @@
$error_code = $exception->getCode();
$error_message = $exception->getMessage();
$error_data = method_exists($exception, 'getData') ? $exception->getData() : '';
+ error_log(var_export([
+ 'exception' => [
+ 'message' => $error_message,
+ 'code' => $error_code,
@giorgiosironi
giorgiosironi / -
Created May 24, 2016 14:58 — forked from anonymous/-
done.
{'tag:Name': ['elife-lax-develop--test']}
1464101753.950491 - ERROR - MainProcess - buildercore.core - caught an exception attempting to discover more information about this instance. The instance may not exist yet ...
Traceback (most recent call last):
File "/Users/giorgiosironi/elife-builder/src/buildercore/core.py", line 124, in stack_data
inst = find_ec2_instance(stackname)[0]
IndexError: list index out of range
Traceback (most recent call last):
File "/Users/giorgiosironi/elife-builder/venv/lib/python2.7/site-packages/fabric/main.py", line 745, in main