Skip to content

Instantly share code, notes, and snippets.

View joninvski's full-sized avatar

Joao Trindade joninvski

View GitHub Profile
import re
main_tex = "report.tex"
current_level = 0
def extract(line):
found = re.search('{.+}', line)
if found:
return found.group(0)[1:-1]
return None
# 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
# 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
# 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
// 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 {
@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 / 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: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
module Central
module Interactors
module ListWaitingQueue
extend self
def call()
puts "Hello"
end
private
@joninvski
joninvski / netcat transfer.sh
Last active October 10, 2015 06:08
Using netcat to transfer files
xuartctl -p 0 -o 8o1 -s 9600 -d
# Client:
nc -v -w 30 -p 5600 -l > uart_gps_test
# Server:
nc -v -w 2 192.168.2.43 5600 < uart_gps_test