Skip to content

Instantly share code, notes, and snippets.

View matiasgarciaisaia's full-sized avatar
🙃
Piensa bonito

Matías García Isaía matiasgarciaisaia

🙃
Piensa bonito
View GitHub Profile
@matiasgarciaisaia
matiasgarciaisaia / README.md
Created September 19, 2024 19:50
Run ncdu over a listing of an S3 bucket

s3-ls-to-ncdu

Run ncdu over a listing of an S3 bucket.

How to

  1. With a working AWS CLI setup, run aws s3 ls s3://example-bucket --recursive | tee bucket-listing.txt to dump the bucket's contents.
  2. Run this script and save its output to another file ruby s3-ls-to-ncdu.rb > bucket-listing.ncdu.json.
  3. Run ncdu -f bucket-listing.ncdu.json to see what's going on in your bucket.
@matiasgarciaisaia
matiasgarciaisaia / README.md
Last active January 16, 2023 20:56
Change Rancher 1.6 host's rancher-agent image

When you add a new host to a Rancher 1.6 environment, Rancher's web UI gives you a sudo docker... command to run in the host. The command looks like this:

sudo docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:
/var/lib/rancher rancher/agent:v1.2.11 https://rancher.example.com/v1/scripts/xxxxxxxxxxxxxxxxxxxx:yyyyyyyyyyyyy:zzzzzzzzzzzzzzzzzzzzzzzzzzz

The rancher/agent:v1.2.11 image can't connect to Rancher Server's whose HTTPS connection uses a Let's Encrypt certificate (yes, that issue). So we have to change it to our custom build: manastech/rancher-v1.6-agent:v1.2.12. But, even if you can change the image in the above command - it won't do any good.

The rancher-agent connects to the server and asks for a bootstrap script located at https://rancher.example.com/v1/scripts/bootstrap, which overrides which im

diff --git a/configure.ac b/configure.ac
index 90ce91b..6ad4317 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2340,6 +2340,7 @@ AC_CHECK_FUNCS(lstat)
AC_CHECK_FUNCS(lutimes)
AC_CHECK_FUNCS(malloc_usable_size)
AC_CHECK_FUNCS(malloc_size)
+AC_CHECK_FUNCS(malloc_trim)
AC_CHECK_FUNCS(mblen)
@matiasgarciaisaia
matiasgarciaisaia / README.md
Last active April 16, 2024 20:36
How To Setup a cloud Surveda Instance

What's this?

This guide is an always-draft script approximately stating how we use to set up new Surveda instances in the InSTEDD Cloud, together with their Guisso, Verboice, Nuntium and other collaborating tools. It is not an official installation guide, but a bunch of notes that helps us set up Surveda instances - and may help you set one up, too.

There probably are implicit requirements and assumptions throughout the doc, and maybe some inaccuracies. Whenever you find any issues with the process, please submit a PR rewritting that step, or at least raise an issue.

⚠️⚠️⚠️ The guide has been moved into Surveda's main repository. Check the current version at https://github.com/instedd/surveda/blob/main/docs/cloud-instance-setup.md

@matiasgarciaisaia
matiasgarciaisaia / README.md
Last active January 23, 2019 22:41
Mati Yo's en búsqueda del commit perdido

(Podés ver una charla basada en esto en Youtube)

Problema: en Github existía un commit e31886ff58fd334a0627bd672983b6e1de83ecb7 que no podíamos fetchear pero lo veíamos (es un repo privado, vas a tener que creerme).

Github mostrando el commit perdido

$ git fetch origin e31886ff58fd334a0627bd672983b6e1de83ecb7
error: Server does not allow request for unadvertised object e31886ff58fd334a0627bd672983b6e1de83ecb7
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGhFCcuQhqmcWpkr6FpT4qHox6SOS/kjl5VNGKWR7YKS [email protected]
@matiasgarciaisaia
matiasgarciaisaia / gist:e612199d8112872a035d0f411821ec28
Created June 29, 2018 13:43
Crystal darwin binaries depend on clock_gettime
$ wget https://github.com/crystal-lang/crystal/releases/download/0.25.1/crystal-0.25.1-1-darwin-x86_64.tar.gz
--2018-06-29 10:41:36-- https://github.com/crystal-lang/crystal/releases/download/0.25.1/crystal-0.25.1-1-darwin-x86_64.tar.gz
Resolving github.com... 192.30.253.113, 192.30.253.112
Connecting to github.com|192.30.253.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/6887813/aca38504-7afd-11e8-87de-4b37674c1349?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180629%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180629T134136Z&X-Amz-Expires=300&X-Amz-Signature=dae047911eb28fb825539a7d027d5ebb455a468a598cfb47aa886215b8407aac&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dcrystal-0.25.1-1-darwin-x86_64.tar.gz&response-content-type=application%2Foctet-stream [following]
--2018-06-29 10:41:36-- https://github-production-release-asset-2e65be
@matiasgarciaisaia
matiasgarciaisaia / kernel-info.log
Created June 6, 2018 14:55
Docker 17.12 won't start on Centos 7.5 without upgrading the kernel
[root@localhost ~]# cat /etc/*-release
CentOS Linux release 7.5.1804 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
@matiasgarciaisaia
matiasgarciaisaia / gist:00a135073b2bfe18a49d9386207aaa3b
Last active January 4, 2018 20:58
ActiveMonitoring Broker error (see comments for more info)
1/4/2018 5:44:45 PMwarning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name
1/4/2018 5:44:45 PM /app/deps/coherence/mix.exs:15
1/4/2018 5:44:45 PM
1/4/2018 5:44:45 PMwarning: variable "package" does not exist and is being expanded to "package()", please use parentheses to remove the ambiguity or change the variable name
1/4/2018 5:44:45 PM /app/deps/coherence/mix.exs:16
1/4/2018 5:44:45 PM
1/4/2018 5:44:45 PM
1/4/2018 5:44:45 PM20:44:45.887 [info] Already up
1/4/2018 5:44:46 PMwarning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name
1/4/2018 5:44:46 PM /app/deps/coherence/mix.exs:15
@matiasgarciaisaia
matiasgarciaisaia / omnibus-output.txt
Created August 17, 2017 19:43
Building Crystal with LLVM 4.0.1 in Debian 7 x64
[Builder: crystal] I | 2017-08-17T17:52:01+00:00 | Environment:
[Builder: crystal] I | 2017-08-17T17:52:01+00:00 | CFLAGS="-I/opt/crystal/embedded/include -O2 -fPIC"
[Builder: crystal] I | 2017-08-17T17:52:01+00:00 | CPPFLAGS="-I/opt/crystal/embedded/include -O2 -fPIC"
[Builder: crystal] I | 2017-08-17T17:52:01+00:00 | CRYSTAL_PATH="/var/cache/omnibus/src/crystal/src"
[Builder: crystal] I | 2017-08-17T17:52:01+00:00 | CXXFLAGS="-I/opt/crystal/embedded/include -O2 -fPIC"
[Builder: crystal] I | 2017-08-17T17:52:01+00:00 | LDFLAGS="-Wl,-rpath,/opt/crystal/embedded/lib -L/opt/crystal/embedded/lib"
[Builder: crystal] I | 2017-08-17T17:52:01+00:00 | LD_RUN_PATH="/opt/crystal/embedded/lib"
[Builder: crystal] I | 2017-08-17T17:52:01+00:00 | LIBRARY_PATH="/opt/crystal/embedded/lib"
[Builder: crystal] I | 2017-08-17T17:52:01+00:00 | PATH="/var/cache/omnibus/src/llvm_bin/llvm-4.0.1-1/bin:/var/cache/omnibus/src/crystal/deps:/opt/crystal/bin:/o