MP3 waveform using ffmpeg sample script

A quick and dirty script that can generate wavforms, from a folder containing mp3 files, using ffmpeg



#!/bin/bash
echo "*******************************"
echo "Begin render wavform";
echo "*******************************"

cd /home/user/path/to/mp3/

for i in *.mp3; do
 ffmpeg -y -i "$i" -filter_complex "compand,showwavespic=s=1200x120:colors=b2b2b2ff:" -frames:v 1  "${i%.mp3}.wavform.png";
 sleep 1;
done


echo "end"

exit

Wordpress Themes and wpcli wp cache flush

Ran into a Wordpress issue. Took a moment to resolve.

Came pretty close to nuking that Wordpress site, as restoring backup data did not change things.

The culprit however was caching.

Always flush that cache kids. See post below:

Wordpress themes and caching. from r/Wordpress

PM2 Imonit [screenshot]

Screenshot of the PM2 imonit legacy application.



Not much documentation available.

2 Wire 2701-B firmware upgrade. A sort of success ramble.

Pulled out an old 2 Wire 2701-B gateway modem to use as a replacement for a dead Linksys switch.

The modem original firmware version was 5.29.109.5

Problems:
  • Devices could not connect to the 2 Wire WIFI in WPA or WPA2 mode. Didn't bother with WEP
  • LAN performance was abysmal. Network connections would drop. 
  • Local RDP experience was at dialup level.  

A horrible solution for a replacement switch..

Remember giving AT&T customer service a hard time about this device back in the day. I now remember why.

This is abandoned hardware. No support available. Locating firmware proved challenging. No DD WRT or Tomato support.

(Direct links to Google docs listed firmware downloads were ignored. Links that were a part of a discussion thread were explored).

Stumbled on an old site which led to a maybe compatible solution. A firmware for a much later model from a different provider.

2700-2701--QT04-6.1.5.48.2sp

Firmware incompatibility can and will permanently damage a device. Consider this before attempting.

The plunge:

The firmware successfully loaded then rebooted into a spiffy new interface.

...status section of the interface
...status section of the interface


The Bad:

Downgrading is no longer an option with this firmware.

DHCP Settings ip values not cleared when DHCP is disabled. Interferes with adjusting the LAN or WAN settings.

Trick: assign DHCP IP range to something other than the desired LAN / WAN ip.  Save with DHCP enabled. Then save with DHCP disabled.

WPA2 connection work but only with DHCP enabled. A less than desirable option.

Noise. Device attempts to connect DSL resulting in an annoying click on each failed attempt. Eventually times out.

Lights. Good lord the blinking lights. Fixed that up with some black tape.

The Good:

Ethernet performance improved dramatically. This was unexpected. Making it a more than adequate replacement.

Interface appears faster than the original. Not particularly useful, just interesting.

Port scan reveals 80, 443, 2869 (icslap) open.



Anyway:

Got lucky here, thought I'd share. Some poor soul with a similar device may find this blurb useful.





MYSQL REGEXP / NOT REGEXP multiple JSON fields


Futzing around with personal projects. Trying to stay relevant. This particular project makes use of JSON support on mysql.

I know right? I did it anyways.

The following clause was used as filter:

Select
.… 
AND
(
LOWER( json_unquote(cd.data->'$.title') ) REGEXP ? OR
LOWER( json_unquote(cd.data->'$.title.$t') ) REGEXP ? OR
...
)
AND
(
LOWER( json_unquote(cd.data->'$.title') ) NOT REGEXP ? OR
LOWER( json_unquote(cd.data->'$.title.$t') ) NOT REGEXP ? OR 
...
)

But that was not not performing as expected. After some trial and error. The following solution seems to work best. concat_ws the fields into a string.

Select
....
AND
CONCAT_WS(' ',
    LOWER( cd.data->'$.text' ),
    LOWER( cd.data->'$.text.$t' )
) REGEXP ?
AND
CONCAT_WS(' ',
    LOWER( cd.data->'$.text' ),
    LOWER( cd.data->'$.text.$t' )
) NOT REGEXP ?

Can’t speak for efficiency but is working as expected so far.
Hope you find useful.

Syslog spam: xdg-document-portal - unique: , opcode: STATFS

Noticed a lot of the following popping up in the syslog.

xdg-document-portal[19996]: unique: 457, opcode: STATFS (17),....
xdg-document-portal[19996]:    unique: 457, success, outsize: ....

Really tried to ignore it. Much fail.

Did some reading. Found this.

Naturally the suggested fix did not work ( or I just did it wrong ).

Learned that this is a flatpak thing. Probably leftover from the previous Gnome installation.

Ran the following

flatpak list

Apparantly not using any flatpak applications.

sudo apt remove flatpak

reboot, check syslog.

On to next adventure. 👊


Mysql Reminder - A Delete Duplicates that works fast.

Note to self. Deleting dupes

This takes forever:

SET SQL_SAFE_UPDATES=0;
DELETE a 
FROM 
 tbl1.tbl_data as a, 
    tbl1.tbl_data as b
where 
 json_unquote(a.data->'$.text') = json_unquote(b.data->'$.text')  
AND 
 a.updated < b.updated;    
SET SQL_SAFE_UPDATES=1;



This Gem Works well.

SET SQL_SAFE_UPDATES=0;
 DELETE tbl_data from tbl_data
  inner join (
     select max(updated) as lastupdated, data->'$.text' as text
       from tbl_data
      group by text
     having count(*) > 1) duplic on duplic.text = data->'$.text'
  where updated < duplic.lastupdated;
SET SQL_SAFE_UPDATES=1;

goBloggerCrawler Blogger Web Crawler in Go

Go-based web crawler used to efficiently extract structured data (titles, video URLs, and tags) from Google Blogger sites using concurrent p...