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

Wednesday, May 19, 2021

Solved: nping - libnsock mksock_bind_addr(): Bind to 2001:db8:1::1:0 failed (IOD #1): Cannot assign requested address (99)

 Problem:

  When using nping (which comes with nmap) we receive the message:

libnsock mksock_bind_addr(): Bind to 2001:db8:1::1:0 failed (IOD #1): Cannot assign requested address (99)


Current situation:
  The issue is that nping can not bind to the IP 2001:db8:1::1


Solution:
  There could be many different solutions, I'm only going to mention one.  What I did was to create a logical interface (tunnel type) with the IPv6 address I was needing (2001:db8:1::1). Here you have the commands.

ip tuntap add mode tun dev tun1
ip -6 addr add 2001:db8:1::1 dev tun1
ifconfig tun1 up


Finally, you could execute something like:

nping -6 -S 2001:db8:1::1 --tcp-connect -c 2 -p 53 <ipv6_dest> --source-mac 00:50:XX:XX:XX:35  --dest-mac 2c:XX:XX:XX:44:20


Hope this is useful

Thursday, September 3, 2020

Solved: Closing connection because of an I/O error in FRR - at least in Ubuntu

 If you are getting this message in FRR:

Closing connection because of an I/O error in FR


The solution is straight forward. You have to compile FRR with this flag:

--enable-systemd


So, it would be something like:

./configure \

    --prefix=/usr \

    --includedir=\${prefix}/include \

    --enable-exampledir=\${prefix}/share/doc/frr/examples \

    --bindir=\${prefix}/bin \

    --sbindir=\${prefix}/lib/frr \

    --libdir=\${prefix}/lib/frr \

    --libexecdir=\${prefix}/lib/frr \

    --localstatedir=/var/run/frr \

    --sysconfdir=/etc/frr \

    --with-moduledir=\${prefix}/lib/frr/modules \

    --with-libyang-pluginsdir=\${prefix}/lib/frr/libyang_plugins \

    --enable-configfile-mask=0640 \

    --enable-logfile-mask=0640 \

    --enable-snmp=agentx \

    --enable-multipath=64 \

    --enable-user=frr \

    --enable-group=frr \

    --enable-vty-group=frrvty \

    --with-pkg-git-version \

    --enable-systemd

    --with-pkg-extra-version=-MyOwnFRRVersion



you can follow those instructions and adding my previous solution:

http://docs.frrouting.org/projects/dev-guide/en/latest/building-frr-for-ubuntu2004.html

Tuesday, September 1, 2020

Tiny script: how to get the RRSIG DNS records with python3

 (I guess there are many other ways to do this, even more elegant)


import dns.resolver
domain='lacnic.net'
domain = dns.name.from_text(domain)
request = dns.message.make_query(domain, dns.rdatatype.ANY)
response = dns.query.tcp(request,'8.8.8.8')
#print(response)

for item in str(response).splitlines( ):
  if 'RRSIG' in item: print (item)


Monday, August 10, 2020

My review about coin.space (in summary, not recommended)

 Hello there,

  I know many of you are looking for good BTC wallets, good cryptocurrency fees and so on.

  Unfortunately I can not tell you which one is the best or the cheapest, but I can tell you a real BAD one: coin.space

  This site (coin.space) starts charging “normal” fees for sending money, however, they start increasing the fee ONLY for certain accounts, not all of them.

  I will tell you a very simple test I performed from the very same computer, at the very same time.

  • I opened two different browsers (Chrome & Firefox)
  • In one browser I tried to send money using an “old coin.space” account
  • In the other browser I tried to send money using a very new coin.space account
  • Trying to send about usd 50, for the “old account” it wanted to charge about usd 12
  • Trying to send about usd 50, for the “new account” it wanted to charge about  use 4


  What do you think?.., sorry coin.space but I had to publish this.


Thanks