Skip to content

Instantly share code, notes, and snippets.

View ronoaldo's full-sized avatar
🏠
Working from home

Ronoaldo Pereira ronoaldo

🏠
Working from home
View GitHub Profile
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
@ronoaldo
ronoaldo / RSS.gs
Last active November 29, 2022 18:01
Google Apps Script RSS Feed Generator
// O título do Feed
var FEED_TITLE = 'Meu Feed RSS';
// Descrição do Feed
var FEED_DESC = 'Esse é o meu Feed RSS';
// URL do Feed - O padrão aqui é usar a URL do próprio script
var FEED_URL = ScriptApp.getService().getUrl();
// O ID da planilha que vai alimentar o FEED
var SHEET_ID = 'ID DA PLANILHA AQUI';
function doGet(e) {
@ronoaldo
ronoaldo / gist:0d1c66b7ebe5baa339ba
Created August 31, 2015 21:32
Install Go 1.5 oneliner shell
curl -Ss https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz | tar -C /usr/local -xzf-
@ronoaldo
ronoaldo / facedetect.go
Last active December 23, 2016 12:35
Go + SWIG + Open CV 2.4
package facedetect
// #cgo CXXFLAGS: -std=c++11
// #cgo pkg-config: opencv
import "C"
diff --git a/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go b/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go
index 48610e3..214fbaf 100644
--- a/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go
+++ b/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build go1.5
+// +build !appengine
@ronoaldo
ronoaldo / clouddns-update
Last active June 7, 2017 16:25
Cloud DNS record set configuration during instance startup.
#!/bin/bash
#
# Helper script to auto-configure a Cloud DNS record during
# compute engine instance startup.
#
# Setup:
# 1. Download and install the script in the instance:
# curl -L https://gist.github.com/ronoaldo/6d6f97bc20a5a40c4aac5e4fa6c09dd5/raw/ > /etc/init.d/clouddns-update
# 2. Give this script permissions and setup as startup daemon
@ronoaldo
ronoaldo / datamine2html.go
Created October 1, 2016 03:04
datamine2html.go
package main
import (
"fmt"
"bufio"
"os"
"strings"
"regexp"
)
@ronoaldo
ronoaldo / data_access_query_billing_report.sql
Created June 6, 2017 21:28
Big Query audit report supporting query - fixes for the updated Cloud Audit schema.
SELECT
timestamp as Date,
resource.labels.project_id as ProjectId,
protopayload_auditlog.serviceName as ServiceName,
protopayload_auditlog.methodName as MethodName,
protopayload_auditlog.status.code as StatusCode,
protopayload_auditlog.status.message as StatusMessage,
protopayload_auditlog.authenticationInfo.principalEmail as UserId,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobName.jobId as JobId,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobConfiguration.query.query as Query,
@ronoaldo
ronoaldo / swf2mp4.sh
Created August 8, 2017 20:28
Converte SWF para MP4
#!/bin/bash
echo "swf2mp4.sh - flash player to mp4 conversion script"
echo " * Requires gnash, mplayer2 and ffmpeg CLI tools"
echo " * Source https://stackoverflow.com/a/39304421 (Aleksey Kontsevich)"
SWFFILE=$1
MP4FILE=${SWFFILE%.*}.mp4
TMPFILE=$(cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 32 | head -n 1).bin