Skip to content

Instantly share code, notes, and snippets.

View joaoqalves's full-sized avatar

João Alves joaoqalves

View GitHub Profile
@joaoqalves
joaoqalves / myrcom.sh
Created October 24, 2011 18:43
Expect script to connect to I321 computers (Serial Port over IP)
#!/usr/bin/expect -f
set timeout 500
set pass 0
if { $argc < 2 } {
puts "Usage:\r"
puts "myrcom <eiXXXXX> <pc> (eg: 70,80,20,50) |password|\r"
exit
@joaoqalves
joaoqalves / bluetooth_test.py
Created June 6, 2013 15:19
Python Bluetooh
#!/usr/bin/python
from bluetooth import *
from threading import Thread
import time
import random
def communication( skt, info ):
skt.settimeout(3)
@joaoqalves
joaoqalves / Build.scala
Created October 23, 2014 20:31
SBT example
import sbt._
import Keys._
object Build extends Build {
import BuildSettings._
import Dependencies._
lazy val root = Project("kioo-mobile-app-backend", file("."))
.settings(basicSettings: _*)
.settings(libraryDependencies ++=

Keybase proof

I hereby claim:

  • I am joaoqalves on github.
  • I am joaoqalves (https://keybase.io/joaoqalves) on keybase.
  • I have a public key whose fingerprint is 2524 8CFB 6DE6 0609 35F3 CEF4 BF52 78FC 85E6 095B

To claim this, I am signing this object:

@joaoqalves
joaoqalves / inception.sh
Created July 2, 2015 16:57
Salt Stack inception
#!/bin/bash
apt-get -y update
apt-get -y install curl
apt-get -y install build-essential
apt-get -y install python-dev
apt-get -y install python-setuptools
curl -L https://bootstrap.saltstack.com -o install_salt.sh
sh install_salt.sh -P stable
@joaoqalves
joaoqalves / get_info.py
Last active September 23, 2016 16:45
LFM API
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import requests
import sys
__BASE_URL = "https://api-game.laligafantasymarca.com/api/1"
__TOKEN = "xxxx" # get it after logging in to the website
__AUTH_HEADER = "Bearer {0}".format(__TOKEN)
I may be a bit outdated about GCP but if I am I guess you’ll correct me :) I’m no infrastructure expert though. My knowledge comes from a small comparison that we did in my previous company [biased ‘cause we had a AWS certified guy :)]:
Feature-wise, AWS has a fine-grained user management that may be important for large companies. Same for network topologies [again, big companies]. More flexibility when choosing an instance in AWS (~30 vs ~20 instance types). AWS is more powerful when it comes to handle hybrid cloud solutions. AWS' ElastiCache has no equivalent in GCP, I think. RDS is years ahead of Google SQL engine.
About tooling: a lot of open-source _CLI_s and open-source tools that leverage AWS. A certification program, etc etc… all of this increases AWS value for a client. And that’s why they can charge more and that’s why comparing only prices is not fair. Even comparing services would be “risky” [from a business perspective], due to the stability and proven success of AWS over the last 10 years. I
@joaoqalves
joaoqalves / curry.py
Created November 22, 2017 16:32
Currying functions in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from functools import partial
def curried(n):
def curry(fn):
def _inner(*args):
if len(args) < n:
@joaoqalves
joaoqalves / genesis_public_key
Created February 24, 2018 19:22
genesis_public_key
0499012070ecc4497830b7608b3f3c56f7a197cb532000309f9a1fdda91218dca6609ec7b6d4fe4fd5530e4656f7b2128afcd4f22cf0086afcb7a5826a79443edf
@joaoqalves
joaoqalves / InMemoryBatchConfigurer.java
Created August 30, 2018 10:33
In Memory Batch Configurer
import javax.sql.DataSource;
import org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer;
public class InMemoryBatchConfigurer extends DefaultBatchConfigurer {
public void setDataSource(DataSource dataSource) {
// This is intentionally left blank
}
}