Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Dario Garcia dario61081

🎯
Focusing
View GitHub Profile
@dario61081
dario61081 / Android.mk
Created Dec 2, 2020 — forked from kanru/Android.mk
Android GPS using libhardware
View Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
gps_test.cpp
LOCAL_SHARED_LIBRARIES := \
libcutils libhardware
LOCAL_MODULE:= test-gps
@dario61081
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
dario61081 / docker-api-port.md
Created Sep 18, 2020 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker
View docker-api-port.md

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://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
View pi-hole-setup-methode-with-bind9.md

Installation of bind9

apt install bind9

Create a virtual interface (eth0:1)

Note: i have the IP : 192.168.1.109 by DHCP

edit the network settings file

@dario61081
dario61081 / numero_letras.py
Last active Mar 26, 2020 — forked from efrenfuentes/numero_letras.py
Numero a letras (Python)
View numero_letras.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'efrenfuentes'
MONEDA_SINGULAR = 'guarani'
MONEDA_PLURAL = 'guaranies'
CENTIMOS_SINGULAR = 'centimo'
@dario61081
dario61081 / send_sms.py
Created Jul 16, 2018 — forked from m0rff/send_sms.py
Sending a SMS with Python and pyserial via an USB 3G Modem on pfSense/FreeBSD
View send_sms.py
#!/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
dario61081 / dynamic_blueprints.py
Created Jul 23, 2017 — forked from jtratner/dynamic_blueprints.py
Dynamic blueprints flask pseudocode
View dynamic_blueprints.py
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
dario61081 / html2pdf.py
Created May 31, 2017 — forked from philfreo/html2pdf.py
A Flask view that returns HTML or generates a PDF
View html2pdf.py
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
dario61081 / rest-server.py
Created Nov 26, 2016 — forked from miguelgrinberg/rest-server.py
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
View rest-server.py
#!flask/bin/python
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()
@auth.get_password
def get_password(username):
if username == 'miguel':