Skip to content

Instantly share code, notes, and snippets.

View rpherrera's full-sized avatar

Rafael de Paula Herrera rpherrera

  • Octa6
  • Toronto, ON - Canada
View GitHub Profile
@rpherrera
rpherrera / solved-windows-server-core-docker-build-error-00.log
Created March 3, 2016 20:22
that error message was solved changing the order of instructions... basically something happens after running the "move" procedure that leads to the related error
WORKDIR /workspace
RUN jdk-6u45-windows-x64.exe /s
RUN unzip.exe jboss-5.1.0.GA-jdk6.zip
+RUN unzip.exe -o deploy.zip -d jboss-5.1.0.GA\server\default\deploy
RUN move jboss-5.1.0.GA C:\jboss-5.1.0.GA
-
-#RUN unzip.exe -o deploy.zip -d C:\jboss-5.1.0.GA\server\default\deploy
COPY /oracle-ds.xml \jboss-5.1.0.GA\server\default\deploy
@rpherrera
rpherrera / windows-server-core-docker-build-error-00.log
Created March 3, 2016 13:49
error when uncompressing a zip file (with 0 level of compression - just to storing the files in a single package), basically all the files are uncompressed and this error occurs in every build attempt
hcsshim::ExportLayer - Win32 API call returned error r1=3489660986 err=winapi error #3489660986 layerId=d82614368c00d879f5dc05b61929005c721721753c6a5b686edae12036ad7012 flavour=1 folder=C:\ProgramData\Docker\windowsfilter\d82614368c00d879f5dc05b61929005c721721753c6a5b686edae12036ad7012-16983673
@rpherrera
rpherrera / wipeout-aws-ecr-images.sh
Last active April 6, 2017 11:47
Wipeout all Docker Images found into an AWS account from ECR private registry, parsing results with jq.
#!/bin/bash -ex
# Warning: use with caution! Once ran, this script is going to wipeout all
# images that you own into your AWS ECR.
aws ecr describe-repositories | jq '.repositories[].repositoryName' | sed s/\"//g | while read repository_name; do
batch_delete_string=''
aws ecr list-images --repository-name "${repository_name}" | \
jq '.imageIds[].imageTag' | while read image_tag; do
batch_delete_string="imageTag=${image_tag} "
@rpherrera
rpherrera / get-aws-ecr-repositories-names.sh
Last active August 31, 2023 01:26
get aws ecr repositories names with aws cli, parsing results with jq and stripping double quotes with sed or tr
#!/bin/bash
# stripping double quotes with sed
aws ecr describe-repositories | jq '.repositories[].repositoryName' | sed s/\"//g
# stripping double quotes with tr
aws ecr describe-repositories | jq '.repositories[].repositoryName' | tr -d '"'
@rpherrera
rpherrera / busca-anotacao.sh
Created September 22, 2015 06:58
exercicio anotacoes - secomp ufscar 2015
#!/bin/bash
clear
read -p "Informe alguma palavra a ser buscada nas anotacoes: " busca
echo "Buscando resultados..."
grep -i ${busca} anotacoes.txt
if [ $? -ne 0 ]; then
@rpherrera
rpherrera / cloud8-iam-policy.txt
Created September 18, 2015 18:02
cloud8 iam policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:Describe*",
"ec2:CreateImage",
"ec2:DeregisterImage",
"ec2:DeleteSnapshot",
@rpherrera
rpherrera / nginx.conf
Last active August 29, 2015 14:26 — forked from timmyomahony/nginx.conf
Python, UWSGI, Supervisor & Nginx
upstream uwsgi {
ip_hash;
server 127.0.0.1:40000;
}
server {
listen 80;
server_name www.domain.com;
root /sites/mysite/;
access_log /sites/mysite/log/nginx/access.log;
@rpherrera
rpherrera / docker_clean_containers
Created April 2, 2015 05:54
clean (kill and remove) all docker containers
#!/bin/bash
docker ps -a | awk '{ print $1 }' | grep -v CONTAINER | while read container_id; do docker kill $container_id; docker rm $container_id; done
##
# The MIT License (MIT)
#
# Copyright (c) 2014 Ryan Morrissey
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@rpherrera
rpherrera / selective-merge-directories.sh
Created January 27, 2015 00:50
Selective Merge Directories
#!/bin/bash
BASE_DIR='/home/base'
PRIMARY_DIR='/home/primary'
SECONDARY_DIR='/home/secondary'
mkdir -p ${BASE_DIR}
pushd ${BASE_DIR}
find ${PRIMARY_DIR} -type d | cut -d '/' -f 7- | grep '/' | while read nested_directory; do
mkdir -p ${nested_directory}