Messier 42
Still getting the camera setting wrong.
Brockham bonfire fireworks
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 process and allows for flexible scheduling of daily, monthly, and yearly backups. It also offers additional features to enhance the backup process. For the file…
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 and password for smtp #def emailSend(ipaddress): to_addr=”your email address” subject=”IPaddress is changed” message=”this is from your webserver:” + html from_addr=”you@gmail.com” header = ‘From: %s\n’ %…
New Arduino Project
I am trying to get my Arduino to connect over WiFi to start my little IoT project. Still getting my head around some of the electronics.
Venus & Jupirer
Massive Venus and a lovely evening sky. Should have taken this picture with a proper camera.
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 few seconds, with my old code to get a 10^8 with multi treading took few days! Shocked is the word I will used! Below is…
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’ # name of the table to be created new_field = ‘prime’ # name of the column field_type = ‘INTEGER’ # column data type def createDB(): #…
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 prime numbers import math import threading import sqlite3 count = 0 primeList = [] dbname=’/home/roberto/primelist.db’ table_name = ‘primes’ # name of the table to be…