-
Wemos D1 R2 (ESP8266)
I am try to build a sensor with low power consumption, low enough for be battery operated. This sensor will acquire temperature and humidity readings and transmit them to my Raspberry Pi controller via HTTP requests. The Raspberry Pi will utilize a webpy service running on port 8080 to collect data from various sensors deployed…
-
Dynamic data with Chart.js
The joy of using charts on you web site! I use chart.js and I have to say after getting MySql to extract the right data I wanted to change data dynamically without a post back to the page. I have to say that I did find some examples online on how to do that with chart.js…
-
Temperature report site revamp!
Finally I did it! Still struggling with PHP. I was thinking of using django but I thought the learning curve was too much to tackle for a side project. Absolutely loving Bootstrap and Chart.js both so easy to use and very good looking. Have a look at the final result here. Soon I might post…
-
Webmin on Raspberry Pi
This is the only way i can install webmin on Pi: mkdir webmin cd webmin wget http://prdownloads.sourceforge.net/webadmin/webmin-1.580.tar.gz gunzip webmin-1.580.tar.gz tar xf webmin-1.580.tar cd webmin-1.580 sudo ./setup.sh /usr/local/webmin
-
WP backup strategy
This is my WP backup strategy: The strategy involves backing up both the MySQL database and the WordPress file system. I have successfully migrated my site to different machines and restored from various failures, and this approach has proven reliable. To back up the MySQL database, I installed automysqlbackup. This user-friendly tool simplifies the setup…
-
IPaddress change alert script
My old ISP use to change my external IP address all the time and to keep my DNS name on track I wrote this script: #!/usr/bin/python import smtplib import urllib2 import time import sys def send_email(): try: server = smtplib.SMTP(‘smtp’, 587)#smtp address and port number server.starttls() #Next, log in to the server server.login(“smtp username”, “password”)#username…
-
Sieve Of Eratosthenes (Still on Prime)
I could not make my code any better so I decided that I new approach needed to be found… Boom Eratosthenes came to the rescue. I found those two great web sites: Sieve Of Eratosthenes explained and Sieve Of Eratosthenes code. In the second link I found a bit of code that run 10^7 in…
-
Multi Threading and still looking for Primes
Added some Multi Threading to my code to get full advantage of the dual core on my laptop: import threading import time import inspect import sqlite3 import math class Thread(threading.Thread): def __init__(self, t, *args): threading.Thread.__init__(self, target=t, args=args) self.start() # global variables count = 0 lock = threading.Lock() primeList = [] dbname=’/home/roberto/primelist.db’ table_name = ‘primes’ #…
-
Prime number 2. The sqlite strikes back!
Finally got some code working with saving the Primes on a DB. I started by saving as I find the prime and realised that the constant IO activity was slowing the all process down. Next step was multi treading: this is still not 100%. Here is the code so far: # Python program to calculate…
-
How to find BIG prime numbers
If my calculations are right the best way to find a BIG prime number is to iterate through all the prime numbers before it, why? Because the quickest way to check a prime is to see if it is divisible by all the previous primes, I am not going to waste any processing power on…