Posts

Fixed: Wordpress Visual Post editor not working issue

Hi everyone as always I will cut the crap and come straight to point.

I got the task to fix a site and for that I created a new user from backend using phpmyadmin using the following command as the owner of site had forgotten the password for wp-admin:
INSERT INTO `wpdatabasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('2', 'Shivam', MD5('demopass'), 'Shivam', 'test@yourdomain.com', 'http://www.test.com/', '2019-05-16 00:00:00', '', '0', 'Shivam'); INSERT INTO `wpdatabasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '2', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); INSERT INTO `wpdatabasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '2', &…

Powershell script to automatically send HTML emails using gmail smtp

Image
Hi please find the script/code below which can be used (as a example  use case) for sending automated reminders for filling time-sheets  to all employees on every Friday(can be any day depending on when you schedule it to run using windows task scheduler as per your requirements) using gmail gsuite or any other email providers:

Things Required:
SMTP outgoing port(587) allowed through firewallsNo-reply email which will be used for sending emailsApplication password (as gmail blocks sending emails from scripts if direct credentials(username & normal password) are used and sends warning alerts and notifications to owner and eventually blocks the account if not rectified thus application password needs to be created and used to prevent that from happening,steps for creating same are given below)Server which runs 24x7 where we will place and schedule our scripts to run at specific time.(You can use your local PC systems and execute script manually by double clicking if required)Steps:
To…

Part 2: List of Questions I have been asked in Interviews

Image
This post is in continuation of Part 1
How will you minimize downtime during a migration will least human effort ? (Mirroring)What is listener?How does listener comes to know which is secondary and which is primary ?(IP SUBNETS)Can we take backups in Always on Secondaries ?What all types of backups can you take in always on secondaries ?(COPY ONLY else it breaks log chain)Why replication when logshipping is available?(Load balancing vs disaster recovery respectively)How many server instances are required for setting up mirroring?(2 without witness (manual failover),3 with witness (automatic failover)Can we set up automatic failover in mirroring without witness server instance?Can you please explain steps for installing mirroring ?Can you please explain steps for installing logshipping?Why do people upgrade and update sql server instances when they have to pay more money for licensing cost even if they are not using new features that are made available?(bug fixes,performance improvemen…

Things DBA's get asked during a day on Job

Image
Things people ask to DBA's during a day on his\her Job:
Why this query is running slow?Why this query is running slow from app but not from ssms?Why this query is not picking up \using the right indexes?Why this query is using right indexes when running from ssms and not when executed from app?Why this query is running fast as SQL statement but running slow when same query is wrapped as a stored procedure?Why query is timing out and in result application is throwing 50* errors?Do we have proper indexes?Can we create index on this column of that table?How much time will it take to defragment the index?Are index fragmented?Can we rebuild the index now without downtime ?Can we reorganize indexes without downtime ? How much time will it take ?Why server is slow ?(When Backup and Update stats are running)Can you make query use right index but not make use of option(recompile) or any other query hint at the same time?Why people are unable to login ?Why people are not able to change passw…