Skip to content

Instantly share code, notes, and snippets.

@iolalla
iolalla / rnn-lstm-tensorboard.py
Last active August 18, 2017 06:32
Very simple Recursive Neural Network with Memory (Long Short Term Memory LSTM) using Tensorboard to track training.
#Source code with the blog post at http://monik.in/a-noobs-guide-to-implementing-rnn-lstm-using-tensorflow/
#Original gist: https://gist.github.com/AlmostDan/a5f4b57104532a68bda2c274f8bcf16f
#Tensorboard inspirational: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/4_Utils/tensorboard_basic.py
import numpy as np
#import random
from random import shuffle
import tensorflow as tf
NUM_EXAMPLES = 10000
@iolalla
iolalla / rnn-lstm.py
Last active August 18, 2017 06:33 — forked from monikkinom/rnn-lstm.py
Tensorflow RNN-LSTM implementation to count number of set bits in a binary string
#Source code with the blog post at http://monik.in/a-noobs-guide-to-implementing-rnn-lstm-using-tensorflow/
#Original gist: https://gist.github.com/AlmostDan/a5f4b57104532a68bda2c274f8bcf16f
#Tensorboard inspirational: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/4_Utils/tensorboard_basic.py
import numpy as np
#import random
from random import shuffle
import tensorflow as tf
NUM_EXAMPLES = 10000
@iolalla
iolalla / dnsLoad.go
Last active September 14, 2017 15:12
This is a go, as go from GoLang, program to automate the load of dns export files from infoblox into Google Cloud DNS.
package main
// BEFORE RUNNING:
// ---------------
// 1. If not already done, enable the Google Cloud DNS API
// and check the quota for your project at
// https://console.developers.google.com/apis/api/dns
// 2. This sample uses Application Default Credentials for authentication.
// If not already done, install the gcloud CLI from
// https://cloud.google.com/sdk/ and run
// `gcloud beta auth application-default login`.
@iolalla
iolalla / ms.go
Created December 17, 2018 17:01
Minimal go server with logging and all the headers visible.
package main
/**
* Minimal go server with logging and all the headers visible.
*
* To build it simply
* '$go build ms.go'
*
* # To lear how to use it simply:
* $ ms --help
@iolalla
iolalla / GKE + Istio to access Google APIS
Created January 17, 2019 15:08
If you have a GKE cluster on GCP and want to access the google APIs or any resource outside the cluster you need to have a service entry in the egress proxy
##########################################################################################################################
# External Services Istio
#########################################################################################################################
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: external-svc-https
spec:
hosts:
- www.googleapis.com #bigquery
@iolalla
iolalla / external-svc.yaml
Last active February 11, 2019 17:17
GKE + Istio to access Google APIS
#########################################################################################################################
# External Services Istio
#########################################################################################################################
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: external-svc-https
spec:
hosts:
- www.googleapis.com #bigquery

The objective of this doc is to share how to debug the game 0ad with VSCode

1st you have to compile it with debug objects, to do so you need to:

cd 0ad/build/workspaces ./update-workspaces.sh -j3
cd gcc
make config=debug

Then you can execute the debug version

binaries/system/pyrogenesis_dbg

and then you can configure your VSCode adding this, to your launch.json:

{

@iolalla
iolalla / certs.sh
Last active June 17, 2020 09:58
Simple use case : You need if a transparent https proxy, but you neeed to see the URLS and headers, Why? To configure proxies or firewalls. Based in this article: https://medium.com/@mlowicki/http-s-proxy-in-golang-in-less-than-100-lines-of-code-6a51c2f2c38c This code only adds logging controls.
#!/usr/bin/env bash
case `uname -s` in
Linux*) sslConfig=/etc/ssl/openssl.cnf;;
Darwin*) sslConfig=/System/Library/OpenSSL/openssl.cnf;;
esac
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout server.key \
@iolalla
iolalla / env.go
Created September 29, 2020 14:20
I needed to view env variables in Appengine Standard. Why? Because I needed to know so I thought I could add an environment variable and I could track the value of this env variable and I could track what other env vars the code was receiving.
package main
/**
* I needed to view env variables in Appengine Standard. Why? Because I needed to know
* so I thought I could add an environment variable and I could track the value of this env variable and I could track
* what other env vars the code was receiving.
*
* So I decided to make a simple function that gets all the env vars and send them as HTML as a a response to the URL
* call
* Author: iolalla@gmail.com
How to create a Python 2 Colab.
bit.ly/colabpy2
colab.to/py2
https://colab.research.google.com/notebook#create=true&language=python2