Author: Naveen Nayak

MSSQL: Session and Request info, Blocking sessions

Naveen Nayak September 17, 2018 No Comments MSSQL, Tips and Tricks

Here is a list of queries that can be helpful if you are trying to troubleshoot locks and blocking sessions on SQL server. — to get session and connections on the server SELECT * FROM sys.dm_exec_sessions AS sess JOIN sys.dm_exec_connections AS conn ON ( sess.session_id = conn.session_id ); — another command to see details EXEC […]

SQL substring replacement

Naveen Nayak May 14, 2018 No Comments MySQL, Tips and Tricks

There are times when you need to replace only a part of the string in the database column. You can use the stuff() function in MSSQL or insert() function in MySQL MSSQL Definition: STUFF ( string , start , length , replaceWith ) Example: select stuff(‘My Original String’, 4, 8, ‘Replaced’); Output: My Replaced String […]

Centos7 cleaning boot partition

Naveen Nayak March 20, 2018 No Comments Linux

Boot partition might be full as it stores old kernels etc. To clean it up and store only the latest 2 kernels do the below Take a backup of your /boot partition somewhere first edit /etc/yum.conf and set installonly_limit=2  # install yum utilities  yum install yum-utils # cleanup old kernels  package-cleanup –oldkernels –count=2

Rsync and details on what has changed

Naveen Nayak January 13, 2017 No Comments Linux

Setup  # create a directoy and a couple of files  mkdir /tmp/mydir1; mkdir /tmp/mydir1/data; echo “hello” > /tmp/mydir1/hello.txt; echo “name is john” > /tmp/mydir1/name.txt; mkdir -p /tmp/mydir1/dir1/dir2/dir3/dir4/dir5; # copy the directory with all permissions etc to a new directory  # -a : copy exactly with owner, group, permissions etc # -r : recursive cp -ar /tmp/mydir1 […]

PHP Remote CLI Script Debugging with PHPStorm

Naveen Nayak February 9, 2016 No Comments LAMP, Tips and Tricks , , ,

PHPStorm is one of the best IDE’s to develop in PHP. I recently came across tons complex php cli scripts and needed a way to debug them. Follow this PHPStorm Docs post first to set up php storm and the server. Most important things to configure are Set up xdebug correctly on the remote server. Dont use […]

Installing VirtualBox Guest Addition on CentOS 7 server – no GUI

Naveen Nayak January 19, 2016 3 Comments Linux , ,

I am doing this on VirtualBox 5.0.12 Windows 8.1 64 bit Host CentOS 7 server 64 bit guest up to date Steps Start CentOS 7 guest From the Devices Menu,go to Optical Drives and remove previous CD/DVD using the Remove Disk from VirtualDrive Then click on Devices and select Insert Guest AdditionsCD Image. This will […]

Page 1 of 13