Skip to content

Instantly share code, notes, and snippets.

View joninvski's full-sized avatar

Joao Trindade joninvski

View GitHub Profile
@joninvski
joninvski / gist:7ccf6694a34c6107a7d5
Last active August 29, 2015 14:26
Interview questions

Interview planning

Time schedule:

  1. 10m - candidate CV
  2. 5m - Organization technologies and dev workflow
  3. 20m - overall computer OS/network questions
  4. 5m - linux/git
  5. 10m - scalability
@joninvski
joninvski / boto_aws_vpc_example.py
Last active August 29, 2015 14:18
aws_boto_example
import boto.ec2
import boto.vpc
import boto.rds2
###### Configurations ######
PROJECT = "Testing" # This is the tag name for all resources
ACCESS_KEY = "SECRET"
SECRET_KEY = "SECRET"
REGION_NAME = 'us-west-2'
@joninvski
joninvski / gist:c2c1a9bdad351c8b2caf
Created March 9, 2015 11:07
Store variable server flask
import json
import sys
from flask import Flask
from flask import request
from flask import Response
app = Flask(__name__)
clicked_push=False
@joninvski
joninvski / openVpnOnDigitalCloud.md
Last active August 29, 2015 14:16
Easilly setup a OpenVpn container

On cloud instance:

OVPN_DATA="ovpn-data"
docker run --name $OVPN_DATA -v /etc/openvpn busybox
docker run --volumes-from $OVPN_DATA --rm kylemanna/openvpn ovpn_genconfig -u udp://jenkins.joaoptrindade.com:1194
docker run --volumes-from $OVPN_DATA --rm -it kylemanna/openvpn ovpn_initpki
docker run --volumes-from ovpn-data --rm -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn

CLIENT_NAME="OSCAR"

docker run --volumes-from $OVPN_DATA --rm -it kylemanna/openvpn easyrsa build-client-full ${CLIENT_NAME} nopass

@joninvski
joninvski / Android_dev_in_vim.md
Last active June 2, 2016 14:22
Android development in vim

First put a the following init.d gradle script in ${HOME}/.gradle/init.d/ (currently in build.gradle but not working in init):

 allprojects {
      tasks.withType(Compile) { // Use JavaCompile for gradle > 2.0
          options.compilerArgs << "-Xlint:deprecation"
      }
      task printDependencies << {task -> println "Subproject -> $task.project.name" }
 }

subprojects {

// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
tasks.withType(Compile) {
options.compilerArgs << "-Xlint:deprecation"
}
task printDependencies << {task -> println "Subproject -> $task.project.name" }
}
subprojects {
printDependencies {
# To easilly transfer the generated data between the ARM and the PC do the following:
#
# In your pc:
# nc -l -p 2999 > received.json
#
# In the arm
# tail -f /tmp/data/miavita.json | nc 192.168.0.1 2999
import numpy as np
import matplotlib.pyplot as plt
# Write on
mount -o remount,rw -t ext4 /dev/block/platform/msm_sdcc.1/by-name/system /system
# Take a screenshot
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
# verbose logging in sqlite
adb shell setprop log.tag.SQLiteLog V
adb shell setprop log.tag.SQLiteStatements V
adb shell stop
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp