Skip to content

Instantly share code, notes, and snippets.


Dario Garcia dario61081

View GitHub Profile
dario61081 /
Created Dec 2, 2020 — forked from kanru/
Android GPS using libhardware
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
libcutils libhardware
LOCAL_MODULE:= test-gps
dario61081 / Config PyCharm
Created Sep 21, 2020 — forked from Jamp/Config PyCharm
Configure for pycharm auto compile sass
View Config PyCharm
First "gem install sass" on console
Go Menu File > Settings > Tools > File Watch > "+" > "sass"
On New Window > Section Watcher Settings
Program: /<home-directory>/.gem/ruby/2.5.0/bin/sass
Arguments: --no-cache --update --no-cache --update $FileName$:../css/$FileNameWithoutExtension$.css --style compressed
Compile sass file on folder css on file minified
dario61081 /
Created Sep 18, 2020 — forked from styblope/
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://", "unix:///var/run/docker.sock"]}

Installation of bind9

apt install bind9

Create a virtual interface (eth0:1)

Note: i have the IP : by DHCP

edit the network settings file

dario61081 /
Last active Mar 26, 2020 — forked from efrenfuentes/
Numero a letras (Python)
# -*- coding: utf-8 -*-
__author__ = 'efrenfuentes'
MONEDA_PLURAL = 'guaranies'
dario61081 /
Created Jul 16, 2018 — forked from m0rff/
Sending a SMS with Python and pyserial via an USB 3G Modem on pfSense/FreeBSD
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# Sending a SMS with Python and pyserial via an USB 3G Modem on pfSense/FreeBSD
# tested with: Huawei Technologies Co., Ltd. E620 USB Modem
# and a Telekom SIM card
import serial
from curses import ascii
import time
dario61081 /
Created Jul 23, 2017 — forked from jtratner/
Dynamic blueprints flask pseudocode
import os
PATH = path/to/my/blueprints/directory
BLUEPRINT = 'the_blueprint'
def import_file(path, name=None):
""" imports a file with given name and path """
# use the imp module to do actual imports
import imp
name = name or os.path.split(path)[-1].replace(".", "_")
dario61081 /
Created May 31, 2017 — forked from philfreo/
A Flask view that returns HTML or generates a PDF
import mimerender
mimerender.register_mime('pdf', ('application/pdf',))
mimerender = mimerender.FlaskMimeRender(global_charset='UTF-8')
def render_pdf(html):
from xhtml2pdf import pisa
from cStringIO import StringIO
pdf = StringIO()
pisa.CreatePDF(StringIO(html.encode('utf-8')), pdf)
dario61081 /
Created Nov 26, 2016 — forked from miguelgrinberg/
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here:
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
def get_password(username):
if username == 'miguel':