Skip to content

Instantly share code, notes, and snippets.

View TheRockStarDBA's full-sized avatar
🏠
Working from home

Kin Shah TheRockStarDBA

🏠
Working from home
View GitHub Profile
@TheRockStarDBA
TheRockStarDBA / Shrink_DB_In_Chunks.sql
Last active March 25, 2024 06:23
Shrink database in chunks - tsql
/*
This script is used to shrink a database file in
increments until it reaches a target free space limit.
Run this script in the database with the file to be shrunk.
1. Set @DBFileName to the name of database file to shrink.
2. Set @TargetFreeMB to the desired file free space in MB after shrink.
3. Set @ShrinkIncrementMB to the increment to shrink file by in MB
4. Run the script
{"_id":1,"_type":1,"_typename":"JOBGROUP","_name":"WEEKLY_DASHBOARD","_parentid":100,"_parentname":"\\DASHBOARD","_active":"Y","_effectivecalendarid":10,"_ownerid":1,"_ownername":"DASHBOARD-USER","_timewindowfromtime":null,"_timewindowfromtimeasstring":null,"_timewindowuntiltime":null,"_timewindowuntiltimeasstring":null,"_childrencount":5,"_agentid":null,"_effectiveagentid":10,"_extendedinfo":null,"_agentname":null,"_agenttype":null,"_agentostype":null,"_agentlistname":null,"_agentlistfullname":null,"_allowunscheduled":"Y","_inheritcalendar":"N","_inheritagent":"Y","_inherittimewindow":"Y","_parentactive":"Y","_command":null,"_allowrerun":"Y","_concurrency":1,"_concurrencytype":1,"_fullpath":"\\DASHBOARD\\WEEKLY_DASHBOARD","_parameters":null,"dependencies":{"totaldependencies":0,"dependencies":[]},"successors":{"totalsuccessors":0,"successors":[]}}
{"_id":2,"_type":2,"_typename":"JOB","_name":"DAILY_PROCESS","_parentid":101,"_parentname":"\\DASHBOARD\\WEEKLY_PROCESS","_active":"Y","_effectivecalendarid":11,"_
{
"meta": {
"theme": "elegant"
},
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Kin shah",
"label": "Senior Software Developer / Engineer at Bloomberg LP",
"image": "",
"email": "kin.msdba@gmail.com",
@TheRockStarDBA
TheRockStarDBA / disk read write latency for data and log files.sql
Created June 16, 2015 18:35
Find disk read write latency for data and log files
/************************************************************************************************************************************************************************************************************************************
************************************************************************************************************************************************************************************************************************************
Author : Kin Shah
Purpose : Gives you the disk latency for READ / WRITE operations on DATA and LOG files.
if Data read/write > 20 ms and Log Read / write > 15 ms then its something to look out for.
This script generates recommendations as well ..
This is part of my project that I am working for SQL Server health checker .....
@TheRockStarDBA
TheRockStarDBA / fix.md
Created October 14, 2023 23:44
airflow installation of apache-airflow-providers-mysql fails on Katacoda oreilly
pip install apache-airflow-providers-mysql
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      /bin/sh: 1: pkg-config: not found
      /bin/sh: 1: pkg-config: not found
@TheRockStarDBA
TheRockStarDBA / zillowScraper.js
Created September 15, 2023 00:30 — forked from adrianhorning08/zillowScraper.js
Zillow Scraper
async function scrollDown() {
const wrapper = document.querySelector("#search-page-list-container");
await new Promise((resolve, reject) => {
var totalHeight = 0;
var distance = 600;
var timer = setInterval(async () => {
var scrollHeightBefore = wrapper.scrollHeight;
wrapper.scrollBy(0, distance);
totalHeight += distance;
@TheRockStarDBA
TheRockStarDBA / stackexchange.sql
Created July 9, 2023 20:28
https://dba.stackexchange.com/q/329095/8783 Same Variable Changing its Min/Max Values within the Same Group?
WITH ntiles AS (
SELECT
id,
height,
weight,
gender,
country,
favorite_color,
disease,
NTILE(5) OVER (PARTITION BY gender, country, favorite_color ORDER BY height) as height_ntile
@TheRockStarDBA
TheRockStarDBA / falsehoods-programming-time-list.md
Created March 2, 2023 19:20 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@TheRockStarDBA
TheRockStarDBA / Invoke-FastPing
Created February 20, 2019 16:31 — forked from austoonz/Invoke-FastPing
A PowerShell Function that uses asynchronous ping commands to quickly ping a fleet of target machines.
<#
.SYNOPSIS
Performs a series of asynchronous pings against the target hosts.
.PARAMETER HostName
A string array of target hosts to ping.
.PARAMETER PingCount
The number of pings to send against each host.
#>
@TheRockStarDBA
TheRockStarDBA / python.md
Created October 18, 2022 14:43 — forked from eyeseast/python.md
How to set up Python in 2022

Python

This is my recommended Python setup, as of Fall 2022. The Python landscape can be a confusing mess of overlapping tools that sometimes don't work well together. This is an effort to standardize our approach and environments.

Tools and helpful links: