Skip to content

Instantly share code, notes, and snippets.

View mgarces's full-sized avatar
🎧

Marco Garcês mgarces

🎧
View GitHub Profile
export GOPATH=$HOME/golang/ # or whatever you like export PATH=$PATH:$GOPATH/bin go get -u github.com/aws/aws-sdk-go go get -u github.com/go-ini/ini go get -u github.com/jmespath/go-jmespath go get -u github.com/urfave/cli go build aws_finder.go go install aws_finder
@mgarces
mgarces / IFTT.md
Last active January 14, 2020 11:16
HomeAssistnat - webhook garage door

just add IFTTT Applets

IF

button press

THAT

use webhook

  • URL: https://<your_hassio_url/api/webhook/garage-door
  • Method: POST

On device:

iOS

Keybase proof

I hereby claim:

  • I am mgarces on github.
  • I am mgarces (https://keybase.io/mgarces) on keybase.
  • I have a public key ASANfwWYgEpXlwRnpD2xL74cZN3UZqYUEC5YYYwgKI41swo

To claim this, I am signing this object:

@mgarces
mgarces / docker-cleanup-resources.md
Created May 23, 2018 14:28 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@mgarces
mgarces / nginx-unificontroller.conf
Created March 18, 2018 01:07 — forked from vidia/nginx-unificontroller.conf
Example, working, NGINX config for proxying to Unifi Controller software and using letsencrypt. Includes websocket fix.
# I had a bit of trouble getting my unifi controller (hosted offsite) to use a proxy/letsencrypt. So here are the fruits of my labor.
# The unifi default port is 8443 running on localhost.
# License: CC0 (Public Domain)
server {
# SSL configuration
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
source 'https://rubygems.org'
require 'json'
require 'open-uri'
require 'kramdown'
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
gem 'font-awesome-sass'
gem 'kramdown'
gem 'github-pages', versions['github-pages']
@mgarces
mgarces / nginx_radosgw
Created August 18, 2014 15:53
Tengine RadosGW config file
server {
listen 80;
server_name *.rados.test rados.test;
client_max_body_size 10g;
# This is the important option that tengine has, but nginx does not
fastcgi_request_buffering off;
location / {
@mgarces
mgarces / radosgw-error
Created August 12, 2014 13:36
error message when I access apache - radosgw setup
[Tue Aug 12 12:29:11.888327 2014] [core:error] [pid 6120] [client 10.5.5.222:52943] End of script output before headers: s3gw.fcgi
[Tue Aug 12 12:29:17.037566 2014] [fcgid:warn] [pid 6121] (104)Connection reset by peer: [client 10.5.5.222:52960] mod_fcgid: error reading data from FastCGI server
[Tue Aug 12 12:29:17.037731 2014] [core:error] [pid 6121] [client 10.5.5.222:52960] End of script output before headers: s3gw.fcgi
The last packet successfully received from the server was 7,419,456 milliseconds ago. The last packet sent successfully to the server was 9,448,563 milliseconds ago.
at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1127)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3715)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3604)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4155)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:926)
for n in $(for i in {3..10000} ; do out=$(( $i % 2 )); if [ $out -eq 1 ]; then echo $i ; fi ; done) ; do F=($(factor $n)) ; if [ -z "${F[2]}" ]; then echo $n ; fi ; done