Saturday, February 17, 2024

Audio Noise Removal


Many times in record clips we end up with unwanted background noise. Recently faced with the situation, I needed to clean up some audio and as usual I went to Google looking for tools.

These are what I found and my thoughts

Free

Paid with Free Trials

  • Adobe Enhance - https://podcast.adobe.com/enhance
    Good with Limitations
  • Media AI - Noise Reducer - https://noisereducer.media.io

  • MyEdit Audio Tools - https://myedit.online/en/audio-editor
    Has some interesting tools.

Results 

Overall, I found Audio Denoise to be the best overall and in the free category. In the paid category Adobe 

Friday, February 03, 2023

MYSQL Error: Lock wait timeout exceeded; try restarting transaction

I have not seen this error in a while with MySQL replication, " Lock wait timeout exceeded; try restarting transaction"

Check the slave status

 show slave status \G; and noticed the following.

Slave_IO_Running: Yes

  Slave_SQL_Running: No 

 Slave_IO_Running: Yes

  Slave_SQL_Running: No

   Last_SQL_Errno: 1205

   Last_SQL_Error: Lock wait timeout exceeded; try restarting transaction


Solution

Stopped the Slave

stop slave;

Restarted the Slave

start slave;

Check the status and all is well

Monday, January 21, 2019

MYSQL and New IP for Master in Replication

There comes a time you might need to change the IP of a Master in a MySQL Replication setup. The steps are fairly simple.

You will need to know the IP of the Master.

Important!
When you’re using CHANGE MASTER TO to set start position for the slave you’re specifying the position for SQL thread and so you should use Relay_Master_Log_File:Exec_Master_Log_Pos. 
Otherwise, you’re going to ruin your replication.

SSH into the MYSQL SLAVE and run SHOW SLAVE STATUS
Slave_IO_State: Reconnecting after a failed master event read
Master_Host: 10.0.0.1
Master_User: replicate
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: binlog.002933
Read_Master_Log_Pos: 832187423
Relay_Log_File: mysql-relay-bin.000230
Relay_Log_Pos: 832187707
Relay_Master_Log_File: binlog.002933
Slave_IO_Running: Connecting
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 832187423
Relay_Log_Space: 832188044
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 2003
Last_IO_Error: error reconnecting to master 'replicate@10.0.0.1:3306' - retry-time: 60  maximum-retries: 86400  message: Can't connect to MySQL server on '10.0.0.1' (110 "Connection timed out")
Last_SQL_Errno: 0
 Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_SSL_Crl:
Master_SSL_Crlpath:
Using_Gtid: No
Gtid_IO_Pos:
Look for the values

  • Read_Master_Log_Pos:
  • Exec_Master_Log_Pos:
These should be the same, note them and note Relay_Master_Log_File

  • Exec_Master_Log_Pos: 832187423
  • Relay_Master_Log_File: binlog.002933
SSH into SLAVE and run SHOW SLAVE STATUS
STOP SLAVE
CHANGE MASTER TO MASTER_HOST='xxx.xxx.xxx.xxx', MASTER_LOG_FILE='binlog.002933', MASTER_LOG_POS=832187423;
START SLAVE
SHOW SLAVE STATUS
Reference

Thursday, April 19, 2018

Paypal




  1.  Log in to your PayPal account at https://www.paypal.com. The My Account Overview page appears. 
  2. Click the Profile subtab. 
  3. The Profile Summary page appears. Click the My Selling Tools link in the left column. 
  4. Under the Selling Online section, click the Update link in the row for Website Preferences. The Website Payment Preferences page appears 
  5. Under Auto Return for Website Payments, click the On radio button to enable Auto Return. 
  6. In the Return URL field, enter the URL to which you want your payers redirected after they complete their payments. 


NOTE: PayPal checks the Return URL that you enter.
 If the URL is not properly formatted or cannot be validated, PayPal will not activate Auto Return.

Scroll to the bottom of the page, and click the Save button.

References



Friday, June 16, 2017

Sleeping MySQL threads

Saw this interesting script on how to deal with sleeping MySQL connections. From the beginning I would say this should only be used as a temporary solution until you can fix the real issue.

I have modified the original script somewhat.

$link = @ mysql_connect('localhost', 'xxxx', 'xxxxxxxx');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully'."\n";

$result = mysql_query("SHOW processlist");
while ($myrow = mysql_fetch_assoc($result)) {
if ($myrow['Command'] == "Sleep" && $myrow['Time']>0 && $myrow['User']!="root") {
//if ($myrow['Command'] == "Sleep" && $myrow['Time']>0) {
//mysql_query("KILL {$myrow['Id']}");
echo  $myrow['User']." ".$myrow['Command']." ".$myrow['Time']." ".$myrow['State']."\n";
if($myrow['Time']>20){
//mysql_query("KILL {$myrow['Id']}");
echo "Killed process id: ". $myrow['Id']."\n";
}
}
}
mysql_close($link);
?>
For starters you can see all the sleeping MySQL processes by running the command
show processlist
You will need to look out for all the threads with state being 'sleep. MySQL 5.1.7 allows filtering  For e.g. you can find  sleeping processes running over 5 seconds using the command below.
SELECT user, time, state, info FROM information_schema.processlist WHERE command = 'Sleep' AND time >5 ORDER BY time DESC, id;

What causes

Most sleeping MySQL connections are caused by queries initiated client side that not be properly closed on the clients side. Most times these are cleaned up by wait_timeout variable. Sometimes depending on the query a sleeping connection can lock up a table (MyISAM) or row(InnoDB) and lead to problems especially to the timeouts are high and the number of connections waiting on the locked resource,

References



Monday, August 29, 2016

Varnish Statistics One-liners

Varnish Command Line
 
Here are some useful examples of varnishtop and varnishlog at work.

Displays a continuously updated list of the most frequently requested URLs:
varnishtop -i RxURL
varnishlog -c | grep 'RxURL'

Top requests to your backend. This shows only the "TxURL", the URL being retrieved from your backend.
varnishtop -i TxURL
varnishlog -b | grep 'TxURL'

#See what cookies values are the most commonly sent to varnish.
varnishtop -i RxHeader -I Cookie
varnishlog -c | grep 'Cookie: '

#Which host is being requested the most. Only really useful when you're serving multiple hosts in Varnish.
varnishtop -i RxHeader -I '^Host:'
varnishlog -i RxHeader | grep 'Host: '

#Accept-Encoding will show the most popular Accept-Encoding header the client are sending you.
varnishtop -i RxHeader -I

See what useragents are the most common from the clients
varnishtop -i RxHeader -C -I ^User-Agent

See what user agents are commonly accessing the backend servers, compare to the previous one to find clients that are commonly causing misses.
varnishtop -i TxHeader -C -I ^User-Agent

See what accept-charsets are used by clients
varnishtop -i RxHeader -I '^Accept-Charset

Listing all details about requests resulting in a 500/404 status:
varnishlog -b -m "RxStatus:500"
varnishlog -b -m "RxStatus:404"







References
  • http://book.varnish-software.com/3.0/Getting_started.html
  • https://www.varnish-cache.org/docs/3.0/reference/varnishlog.html
  • https://www.varnish-cache.org/docs/3.0/reference/varnishtop.html
  • https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html
  • https://www.varnish-cache.org/docs/3.0/tutorial/logging.html#tutorial-logging
  • https://ma.ttias.be/useful-varnish-3-0-commands-one-liners-with-varnishtop-and-varnishlog/
  • http://stackoverflow.com/questions/13247707/how-to-read-output-of-varnishtop
  • http://www.eldefors.com/varnish-command-line-tools/
  • https://www.varnish-cache.org/trac/wiki/

Wednesday, August 24, 2016

Request Entity Too Large Solution

Stumbled across this issue of request entity too large when trying a script on server is trying to upload large files.  This referrers to  Apache/NGINX/IIS servers running PHP.


The solution seems to lie in the change the following variables.

memory_limit =128M
post_max_size = 96M
upload_max_filesize = 64M

Test and increase the above variables slowly by 16/32M increments to ensure your web hosting can handled

If you are on NGINX you will need to adjust client_max_body_size in the http block of the config file

The error,  '413 Request Entity Too Large'.

http {
    #...
        client_max_body_size 128m;
    #...
}


Note 'post_max_size integer' sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than 'upload_max_filesize'. Generally speaking, 'memory_limit' should be larger than 'post_max_size'.

You might also want to increase the max-execution-time. Note however you server configurations, i.e. timeouts, might interrupt executions.

Audio Noise Removal

Many times in record clips we end up with unwanted background noise. Recently faced with the situation, I  needed to clean up some audio and...