Wednesday, June 30, 2021

Super easy script - Python3 & optimizing every table of a mysql db

 #!/usr/bin/python3.3

#The objetive of this script is to find all tables in a MYSQL DB and opmitize all of them

import dbconnect

import time

from datetime import datetime



## // VARIABLE DECLARATION ##//

startTime = datetime.now()

conn = dbconnect.dbconnect()

conn.autocommit(True)

cur = conn.cursor()


print ("Starting time: ", startTime)


SQLQUERY=("SHOW TABLES") #Find every table in the DB

cur.execute(SQLQUERY)

tables = cur.fetchall()



if len(tables)>0: #Prevent there are not tables in the list

  for table in tables:  #For every table in the DB

    try:

      SQLQUERY="OPTIMIZE TABLE "+ table[0]  #Construct the SQL QUERY

      print ("   Optimizing", table[0])

      cur.execute(SQLQUERY)

    except:

      pass


print ("Script execution time:",datetime.now()-startTime)

print ("Ending time: ", datetime.now())

print ("******** ****** ")

Friday, June 25, 2021

IPv6 Deployment - LACNIC region

The video below shows the IPv6 deployment for the LACNIC region using a Bar Chart Race format




Made with https://flourish.studio/

Tuesday, June 1, 2021

Solved: Finder on MAC does not find any files in its searches

Problem:

   Finder can't find files when searching.


Solution:

   I know there are many solutions, many with spotlight in system preferences, but the one that worked for me was to open a terminal window and run/execute:


  #sudo mdutil -E /




    I hope this is useful