Skip to content

Instantly share code, notes, and snippets.

View lpicanco's full-sized avatar
🤖
Machine Learning

Luiz Picanço lpicanco

🤖
Machine Learning
View GitHub Profile
# file system recovering
sudo mkfs.ext4 -S /dev/sda1
@lpicanco
lpicanco / install-as-service.sh
Created August 18, 2015 13:40
Install app as system app in Android via adb
adb start-server
adb remount
adb push app.apk /system/priv-app/app.apk
adb shell chmod 644 /system/app-priv/app.apk
adb reboot
@lpicanco
lpicanco / pythonServer.sh
Last active December 16, 2019 12:58
Simple Python HTTP Server
#!/usr/bin/python
"""
Save this file as server.py
>>> python server.py 0.0.0.0 8001
serving on 0.0.0.0:8001
or simply
>>> python server.py
public static MultivaluedMap<String, String> parseForm(InputStream entityStream)
throws IOException
{
char[] buffer = new char[100];
StringBuffer buf = new StringBuffer();
BufferedReader reader = new BufferedReader(new InputStreamReader(entityStream));
int wasRead = 0;
do
{
@lpicanco
lpicanco / Dockerfile
Last active April 5, 2016 17:58
jenkins-devops
FROM simonqbs/jenkins-dind
MAINTAINER Luiz Picanço "lpicanco@gmail.com"
ENV PACKER_VERSION 0.8.6
RUN apt-get update && apt-get install -y \
python-pip python-dev curl sshpass && \
pip install ansible==2.0 && \
pip install docker-py==1.4.0 && \
https://github.com/quankiquanki/skytrax-reviews-dataset/tree/master/data
from ubidots import ApiClient
import RPi.GPIO as GPIO
import time
import wiringpi2 as wiringpi
def bin2dec(string_num):
return str(int(string_num, 2))
def finish():
wiringpi.digitalWrite(0, 0)
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="rastro" targetNamespace="http://resource.webservice.correios.com.br/" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tns="http://resource.webservice.correios.com.br/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<!-- <types>
<xsd:schema>
<xsd:import namespace="http://resource.webservice.correios.com.br/" schemaLocation="Rastro_schema1.xsd"/>
</xsd:schema>
</types> -->
<message name="RastroJson">
<part name="parameters" element="tns:RastroJson">
@lpicanco
lpicanco / export_to_json.py
Created May 3, 2019 03:06
export image to json - keras
import cv2 as cv
import argparse
import numpy as np
import json
def predict(image_file):
faces = process_image(image_file)
doc = json.dumps(faces.tolist())
print(doc)