Posts

Showing posts from 2019

Solution: More Posts & Posts Links not working with Adsense Anchor ads on Touch screen mobiles in blogger

Image
Problem Statement: Whenever anchor ads are loading in mobile More Posts link is becoming dead and also other links such as Title of posts in feed along with the Keep Reading link is becoming unresponsive to touch and thus users are unable to browse site properly.

So coming straight to solution: I have seen this happening only when something is having z-index more than the other elements on the page in this case when anchor ads were loading it seems like the z-index for the anchor ads was overriding the z-index of page elements itself leaving them unresponsive to touch though they are working completely fine on clicks over computer system ,so to fix this I added a small piece of CSS style="z-index:1000!important;" to the element or More Posts link so that in the page DOM layer it comes just at place where both Anchor ads and More Posts remains clickable without clashing with each other.

Please find the screenshots below for your reference to find where the changes has to be ma…

Fixed: Wordpress Visual Post editor not working issue

Image
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…

Script to delete the files older then 2 days from All Available Drives On Servers:\AnyDirectory

Image
Script below can be used to delete the files which are older then 2 days from All Available Drives On Servers:\AnyDirectory.If you want to filter files with some particular extension please add the following handle to the script :/m (searchmask) Searches files according to the specified search mask. The default search mask is *.\*.More information about parameters and variables available can be found here @ECHO off Rem=================================================================================================================== Rem AUTHOR: SHIVAM KUMAR | https://www.linkedin.com/in/shivamkumars Rem VERSION: 1.0 Rem DESCRIPTION: Script to delete the files which are older then 2 days from "All_Available_Drives_On_Servers:\AnyDirectory" directory Rem How to use: Select the servers from hpsa and right click and run script,no user input is required. Rem Disclaimer: The script has to be run on proper timings after the backup or what ever patching activity else you might loose d…

Adding a new table to Replication in MSSQL Server without reinitializing the Snapshot

Image
There are some prerequisites for Tables to be a part of replication:
It should have a PRIMARY KEYIt should have IDENTITY NOT FOR REPLICATION NOT NULL: If prerequisites are not met for Primary key you will see the following error:
Msg 14088, Level 16, State 1, Procedure sp_MSrepl_addarticle, Line 1539 [Batch Start Line 0] The table '[dbo].[T_YourTableNameHere]' must have a primary key to be published using the transaction-based method. Though NOT FOR REPLICATION FOR IDENTITY will not throw any error during the time you are adding the table to replication but it will start throwing errors once you will start inserting rows or data into the table and I am guessing you must have heard this earlier "prevention is better than cure".

Alright once prerequisites has been taken care of  this tasks can be accomplished using the following steps :
Create table in Publisher Node.Create table in all Subscriber Nodes.Use sp_addarticle to add and publish the new table in your public…

Get new posts by email: