Tuesday, August 23, 2022

Fix laravel SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock


Cause:

his happens when two processes or more are trying to write to the same database table at the exact same time. Solutions can be complicated. Deadlocks are usually an application problem most of the time can either be solved by:
1. changing the logic of your code (e.g. use transactions) or
2. retrying the operation

      php artisan route:list
      php artisan view:clear
      php artisan cache:clear

Thursday, August 18, 2022

How to add SSH Public key to an existing Droplet or VM?

First copy your Public key using the following command: 

cat ~/.ssh/id_rsa.pub

or 

pbcopy ~/.ssh/id_rsa.pub

Now login into your Droplet or VM and open the following file then paste your public key into authorized_keys file.

nano ~/.ssh/authorized_keys


Save the file and try to login from your local terminal.

Monday, August 15, 2022

Fix Adding new SSL virtual website .. .. certificate authority file is not valid : Data does not start with line -----BEGIN CERTIFICATE-- in virtualmin


Open the file at /etc/webmin/virtual-server/domains/13694005276497

Delete including 4 lines pointing to the 4 certificate files: ssl.cert, ssl.combined, ssl.everything & ssl.key

Then re-add the ssl.

Friday, August 12, 2022

How to generate SSH keys in Windows PowerShell

 Open your PowerShell and follow the steps:

ssh

ssh-keygen -b 4096


C:\Users\WINUSER/.ssh/id_rsa.pub


notepad C:\Users\WINUSER/.ssh/id_rsa.pub

Wednesday, August 10, 2022

How to check TCP, UDP Domain Socket using NetCat

 Install the netcat Using the fllowing command:

$ yum install nc      [On CentOS/RHEL]

$ dnf install nc      [On Fedora 22+ and RHEL 8]

$ sudo apt-get install Netcat      [On Debian/Ubuntu]


NetCat commands:

$ nc -v -w 2 z 192.168.56.1 22     #scan a single port

OR

$ nc -v -w 2 z 192.168.56.1 22 80  #scan multiple ports

OR

$ nc -v -w 2 z 192.168.56.1 20-25  #scan range of ports

Saturday, August 6, 2022

How to hide IP in header from Postal MTA

Remove  text where need using the following file in postalMTA.

For SMTP Server:

lib/postal/smtp_server/client.rb

@receiving_headers = true
received_header_content = "from #{@helo_name} (#{@hostname} [#{@ip_address}]) by #{Postal.config.dns.smtp_server_hostname} with SMTP;

For HTTP:

app/models/outgoing_message_prototype.rb

mail.header['Received'] = "from #{@source_type} (#{self.resolved_hostname} [#{@ip}]) by Postal with HTTP; #{Time.now.utc.rfc2822.to_s}"
mail.message_id = "<#{@message_id}>"

How to view saved password in Outlook 2003, 2007, 2010, 2013, 2016, 2019


Use Unmask Password Tool to reveal hidden behind the asterisk icon.

Windows:

Download from Google Drive

Download from CNET



Mac:


To see if the password is available, first open the “Keychain Access” program on your Mac (click the Go menu in the Finder and choose Applications, then open Utilities and Keychain Access).

How to get Ranking of the Students in Excel using RANK Function

=RANK(number,ref,[order]) To rank in descending order, we will use the formula =RANK(B2,($C$5:$C$10),0) If we want unique ranks, we can use...