mail_outline SMS online sending tool

screen capture of the app:






whoever it may be interested to use it, it can consider to hash the password and save it in a database, at the moment i build it really doesnt insterested me to do the hasshing, for the web app yes i did!

#The MIT License (MIT)

#Copyright (c) 2018 Mario Vasquez

#Permission is hereby granted, free of charge, to any person obtaining a copy of
#this software and associated documentation files (the "Software"), to deal in
#the Software without restriction, including without limitation the rights to
#use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
#the Software, and to permit persons to whom the Software is furnished to do so,
#subject to the following conditions:

#The above copyright notice and this permission notice shall be included in all
#copies or substantial portions of the Software.

#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
#FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
#COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
#IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
#CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

import gtk
from twilio.rest import TwilioRestClient
import mysql.connector

class SMS(gtk.Window):

    def __init__(self):
    
        super(SMS, self).__init__()
        
        self.set_title("Send SMS 1.0")  # Declarar titulo de la ventana

        self.set_default_size(320, 320)  # Declarar tamano ventana

        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)  # Declarar posicion de la ventan dentro de la pantalla
        
        # crear entrada para usuario MySql
        self.usuariosql = gtk.Entry(12)

        self.usuariosql.set_text("pei")

        self.uslabel = gtk.Label(str="Usuario")

        self.pwd = gtk.Entry(9)

        trent = self.usuariosql.get_text()
        
        lock=self.is_active()

        print lock

        while lock in [False]:

            if self.usuariosql.get_text() in "pei":

                print "1"
            #detalle uso de string python

                self.pwd.set_text("amica01")

                lock =True

            else:

                self.pwd.set_text("ama")

                print "2"

        self.pwd.set_visibility(visible=0)

        self.pwdlabel = gtk.Label(str="Pass")

        # crear entrada para enviar SMS

        self.tarea = gtk.Entry(300)

        self.tareal = gtk.Label("SMS")

        self.button = gtk.Button("Enviar")

        self.button.connect("clicked", self.smssend)

        self.cerrar = gtk.Button("Cerrar")

        self.cerrar.connect("clicked", self.cierra)

        # crear objeto lista con nombre de ususarios a reg.

        self.tlflist = gtk.combo_box_entry_new_text()  # Declarar combo box entry usando funcion de ComboBoxEntry

        self.tlflist.append_text('Maxxx')

        self.tlflist.append_text('Maxxxx')

        self.tlflist.append_text('Berxxxxx')

        global lista

        #list telephone number elegible to send SMS, replace the x with the number(mobile code or region code+telehopne number)

        lista = {'Caller 1': '+49xxxxxxxxxxxx', 'Caller2': '+49xxxxxxxxxxx', 'Caller3': '+58xxxxxxxxx'}

        global tlf

        global usuario

        usuario = self.tlflist.child

        self.tlflist.set_active(0)

        self.tlflistl = gtk.Label("Tlf.")

        fixed = gtk.Fixed()

        # fixing items for mysql

        fixed.put(self.usuariosql, 10, 220)

        fixed.put(self.uslabel, 200, 225)

        fixed.put(self.pwd, 10, 250)

        fixed.put(self.pwdlabel, 200, 250)

        # fixing items for sms sending app

        fixed.put(self.tarea, 10, 80)

        fixed.put(self.tareal, 200, 85)

        fixed.put(self.tlflistl, 200, 15)

        fixed.put(self.button, 240, 10)

        fixed.put(self.cerrar, 240, 50)

        fixed.put(self.tlflist, 10, 10)

        self.add(fixed)

        self.show_all()

    def smssend(self, widget):

        # obtener parametros de entrada login MySql

        global probe

        u = self.usuariosql.get_text()

        p = self.pwd.get_text()

        # Declarar variables globales en la funcion

        global tlf

        global usuario

        global lista

        mes = self.tarea.get_text()

        usuario = usuario.get_text()

        for key in lista:

            if key == usuario:

                tlf = lista[key]

        print usuario

        print tlf

        # put your own credentials here

        ACCOUNT_SID = 'ACf2791032469ad58ba541e164'

        AUTH_TOKEN = '04059c181a9df7161ac16008c22'

        client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)

        client.messages.create(

            to=tlf,

            from_="+49xxxxxxxxxxx",

            body=mes,

        )

        # crear conexion a base de datos MySql e insrtear data

        cnx = mysql.connector.connect(user=u, password=p, database='followup')

        cursor = cnx.cursor()

        # cargar data en tabla MySql

        cursor.execute("INSERT INTO smshist(enviado_a, mensaje) VALUES(%s,%s)", [usuario, mes])

        cnx.commit()

        cursor.close()

        cnx.close()

        print 'SMS send'

        print u

        print p

        Dialogo = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_CLOSE)

        Dialogo.set_markup(str="Message send sucesfully to ")

        Dialogo.run()

        Dialogo.destroy()

    def cierra(self, widget):

        gtk.main_quit()

SMS()

gtk.main()

						

mail_outline Online SMS tool web application

The app endure 3 sections, one to register operators, one to register new receivers, and the last to send the sms.

there are at the time two Login possible accounts, admin(i reserve these one) it have full operations privilege, and guest(password guest) that can only send sms.

note the app is heroku free hosted, then it make take a minute to wake up and work properly

twilo account it is setup, now you can send sms to my phone number at will

for app control i will save the sms you send into a SQL database

please login as user:guest, password:guest


after some test the i noticed that the app stop sending sms, mainly because after debug the actual number assigned by the provider does not allow to send SMS anymore! below can beseen the detail, i assume is associeted to the fact that my accounts are trial ones:





after some change i'll share the code.

landscape GEOIP it does generate a placemark *.kml file for google maps extracting the data from pcap data capture

the program take the pcap file and extract the origin and destination IP address and colocate in a *. csv file, and build a .*kml file that can be loaded in google maps to mark the location of each connection according to Geo databases from MaxMind(free version)

the app is heroku free hosted, then it make take a minute to wake up and work properly

at the time the app is limited only to ipv4 packets capture, can use for that the command: tcpdump -nni eth0 ip -w filename.pcap, try to use files not bigger than 2 mbnote the app does not support at the momment *.pcap files captured with wireshark or tshark

UPDATE:now the app allow googlemaps markers, the markers show the IP address as a tooltip when for a short time the user do a "mouseover" the given marker, still the *kml and the *csv files are available to download UPDATE:put the app in a old version, only the *kml and the *csv files are available to download, to view in map, i sugest to load directly the *.kml in google maps or the old google earth, unfortunally heroku and the google API does not work well togueter at first glance, the only way i found is to host the app with the google maps togueter using in a dedicated server instead of heroku

build IoT section in bearbeitung build

what to expect in here:

IoT Devices interconection

Real Time data presentation over app

Extract Own IoT server configrution

links of interest




markunread_mailboxContact Formmarkunread_mailboxsorry this part i made it also with heroku(Free hosting), please patience, ill move it soon to a better solution

i updated at 22031028 the contact part of the website, still on Heroku, but a improved version of the code, so far it is OK ;-).








































-------------------------------------vasquezio blog it is a work in'd progress-------------------------------------------------------=:-)