Resetting your WordPress password through MySQL/MariaDB Command Line

  1. Login to you database server.
    mysql -u root -p
  2. Select your WordPress database
    USE <name of WordPress database>;
    USE wordpress;
  3. Show the tables and look for the table where it ends with “users”.
  4. List the contents of the users table or find the username you want to reset. Take note of the users’ current password hash.
    SELECT user_login, user_pass FROM <users table>;
    SELECT user_login, user_pass FROM wp_users;
    SELECT user_login, user_pass FROM <users table> WHERE user_login LIKE '%<search string>%';
    SELECT user_login, user_pass FROM wp_users WHERE user_login LIKE '%admin%';
  5. Update the password of the user you like to reset.
    UPDATE <users table> SET user_pass=MD5('<new password>') WHERE user_login = '<user login>';
    UPDATE wp_users SET user_pass=MD5('mysecurepassword') WHERE user_login = 'admin';
  6. You will receive a confirmation message if the change was successful.
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1  Changed: 1  Warnings: 0
  7. Confirm if the password has changed based on the new hash generated.
    SELECT user_login, user_pass FROM <users table> WHERE user_login = '<user login>';
    SELECT user_login, user_pass FROM wp_users WHERE user_login = 'admin';
  8. You may now login using the new password set.

Resetting a VPN connection on CISCO ASA-5505

A had this challenge on how to reset or reconnect the VPN service in the office whenever I am mobile and do not have access to the Cisco ASDM-IDM. I do however have access to the device via SSH, so here is how you can reset or reconnect the VPN session using CLI.

  1. Connect and login to the device via SSH (granting you have already enabled the service on your device).

    iOS: Terminus 3.6.3
    Android: Terminus 3.0.5
    or any of your preferred SSH client.

  2. Enable config mode.
    Type help or '?' for a list of available commands.
    CISCO> enable
    Password: ********
  3. Get a list of the site-to-site VPN tunnels that are up. Issue the following command:
    CISCO# show vpn-sessiondb l2l
    Output example:
    Session Type: LAN-to-LAN
    Connection   :
    Index        : 4                      IP Addr      :
    Protocol     : IKEv1 IPsec IPsecOverNatT
    Encryption   : IKEv1: (1)3DES  IPsec: (1)3DES  IPsecOverNatT: (1)3DES
    Hashing      : IKEv1: (1)SHA1  IPsec: (1)SHA1  IPsecOverNatT: (1)SHA1
    Bytes Tx     : 8022844                Bytes Rx     : 389894534
    Login Time   : 09:56:20 PHST Wed Aug 1 2018
    Duration     : 1h:31m:11s
  4. You can now logoff or disconnect the VPN session using the “Index” number.
    CISCO# vpn-sessiondb logoff index 4
  5. Confirm the session has been restarted, issue the following command and check the “Login Time” and “Duration”.
    CISCO# show vpn-sessiondb l2l