Skip to content

Instantly share code, notes, and snippets.

View guilhermef's full-sized avatar

Guilherme Souza guilhermef

View GitHub Profile
@guilhermef
guilhermef / Jenkinsfile
Last active May 21, 2020 11:40
Jenkinsfile using ECR cross account agent
pipeline {
agent {
docker {
image '<other-account-id>.dkr.ecr.eu-west-1.amazonaws.com/image/my-image:v1'
args '--entrypoint= '
registryCredentialsId "ecr:eu-west-1:aws-instance-role"
registryUrl "https://<other-account-id>.dkr.ecr.eu-west-1.amazonaws.com"
}
}
stages {
@guilhermef
guilhermef / role-assume-itself.js
Created May 21, 2020 10:47
Role policy to assume itself
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:GetRepositoryPolicy",
@guilhermef
guilhermef / policy.js
Last active May 21, 2020 10:47
Read only ECR policy for organization
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "ECR Read Only",
"Effect": "Allow",
"Principal": {
"type": "*",
"identifiers": ["*"]
},
@guilhermef
guilhermef / chew-on-my-ram-spotify.sh
Created November 3, 2016 19:28
Stop spotify from destroying your SSD
#!/bin/bash
echo 'Creating Ram Disk'
diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nomount ram://102400`
echo 'Removing old spotify Cache'
rm -rf ~/Library/Application\ Support/Spotify/PersistentCache
echo 'Giving spotify something to chew on'
ln -s /Volumes/RAM\ Disk ~/Library/Application\ Support/Spotify/PersistentCache
echo 'Done!'
#!/bin/bash
registryhost="tsuru-registry-01.eduk.vpc"
registryport="5000"
dockerhost="127.0.0.1"
dockerport="2375"
version=$(docker version 2>/dev/null | grep " Version" | cut -c16-)
if [[ $version != "" ]]; then
echo "Skipping docker installation, version installed: $version"
else
@guilhermef
guilhermef / gist:297680f457f82fb27b3d
Last active May 8, 2020 15:15 — forked from okor/gist:79c38cfb03b153bd4eb2
Install Thumbor on Ubuntu 15.04
# sudo su and run the following
sudo aptitude update
# install all dependencies
sudo aptitude -y install \
python-pip \
python2.7-dev \
libssl-dev \
libcurl4-openssl-dev \
@guilhermef
guilhermef / dabblet.css
Created January 31, 2014 19:11
iMessage-style loader
/**
* iMessage-style loader
*/
@keyframes fade {
to { background: rgba(0,0,0,.1); }
}
.progress,
.progress:before,
@guilhermef
guilhermef / robot.js
Created December 1, 2012 18:07 — forked from fellipetenorio/robot.js
MyRoboto
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@guilhermef
guilhermef / robot.js
Created November 30, 2012 17:37 — forked from heynemann/robot.js
Chaser
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
robot.clone();
robot.turn(45);
this.offset = 1;
};
Robot.prototype.onIdle = function(ev) {
@guilhermef
guilhermef / robot.js
Created November 30, 2012 03:09
asdasd
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);