Skip to content

Instantly share code, notes, and snippets.

@kulmam92
kulmam92 / script_out_snowflake_database_objects.py
Created October 5, 2019 04:56
Generate DDL including permission of objects in a given Snowflake database into separate files
import os
import shutil
import subprocess
import time
from datetime import datetime
import snowflake.connector
import logging
# Information for Snowflake
SNOWSQL_ACCOUNT = "XXXXXXXXX.east-us-2.azure"
@kulmam92
kulmam92 / Dockerfile.msbuild
Created July 6, 2018 18:42 — forked from alexellis/Dockerfile.msbuild
Dockerfile for MSBuild / ASP.NET
# Customize / optimize as necessary.
# This could probably change to plain Windows Server Core as a base-image.
FROM microsoft/iis:10.0.14393.206
SHELL ["powershell"]
RUN Invoke-WebRequest "https://download.microsoft.com/download/9/B/B/9BB1309E-1A8F-4A47-A6C5-ECF76672A3B3/BuildTools_Full.exe" -OutFile "$env:TEMP\net.exe" -UseBasicParsing
RUN & "$env:TEMP\net.exe" /Silent /Full
RUN Install-WindowsFeature NET-Framework-45-ASPNET ; \
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WorkingDirectory>$(WORKSPACE)</WorkingDirectory>
<EnvironmentName>$(Environment)</EnvironmentName>
<devEnvTool Condition="'$(devEnvTool)'==''">C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe</devEnvTool>
</PropertyGroup>
<!--Build using Devenv.exe-->
<!--MSBuild Batching: Target batching (Outputs)-->
@kulmam92
kulmam92 / GetLastChangeLogfromGroovyPostBuild.groovy
Last active May 13, 2016 16:49
Get top n bytes from the last change log using Groovy PostBuild
import hudson.FilePath;
// Size(in byte) of log that you want to display.
def logLength = 400
def myBuildStatus = manager.build.result.toString()
//manager.listener.logger.println("$myBuildStatus");
//manager.logContains("^Build FAILED.")
if(myBuildStatus == "SUCCESS") {
@kulmam92
kulmam92 / GetLastNlinesfromLogFile.groovy
Last active May 9, 2016 18:37
Display last changed log file in the workspace of Jenkins build - parameter : workSpace -> $workspace
def myWorkdSpace = "$workSpace"
def files = buildFileList(myWorkdSpace)
def buildFileList(dirname) {
def files = [:]
def dir = new File(dirname)
if( dir.directory ) {
dir.listFiles().each {
def path = it.absolutePath
if( it.directory ) {
#install SqlServer and TFS
cinst VisualStudioTeamFoundationServerExpress2013
cinst MsSqlServer2012ExpressWithReporting
#Configure SQL Reporting Services
$rsConfig = (Get-WmiObject `
-namespace "root\Microsoft\SqlServer\ReportServer\RS_MSSQLSERVER\v11\admin" `
-class "MSReportServer_ConfigurationSetting")
#Configuring Reporting Server Virtual Directories
@kulmam92
kulmam92 / Install-ISPackage.ps1
Created April 8, 2015 01:20
Installs an SSIS package to a SQL Server store - archiving from http://sev17.com/2012/11/06/scripting-ssis-package-deployments/
#######################
<#
.SYNOPSIS
Installs an SSIS package to a SQL Server store.
.DESCRIPTION
The Install-ISPackage script installs an Dtsx file to a SQL Server store using the command-line utility dtutil.
Works for 2005 and higher
.EXAMPLE
./install-ispackage.ps1 -DtsxFullName "C:\Users\Public\bin\SSIS\sqlpsx1.dtsx" -ServerInstance "Z001\SQL1" -PackageFullName "SQLPSX\sqlpsx1"
This command install the sqlpsx1.dtsx package to SQL Server instance Z001\SQL1 under the SQLPSX folder as sqlpsx1. If SQLPSX folder does not exist it will be created.
CREATE PROC [dbo].[Job_FailaureMonitoring]
@HourInterval int = 24
,@recipients varchar(4000)
,@profile_name nvarchar(128)
,@debug bit = 0
AS
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
BEGIN TRY
declare @body varchar(max)
@kulmam92
kulmam92 / EmailLastFailedStep_SendErrorMessage.sql
Last active August 29, 2015 14:03
How to get detailed error message of last step when job failed.
USE [msdb]
GO
CREATE PROC [dbo].[EmailLastFailedStep_SendErrorMessage]
@JobName nvarchar(128)
,@recipients varchar(4000)
,@profile_name nvarchar(128)
,@debug bit = 0
AS
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
@kulmam92
kulmam92 / DB.Schema.SVNCheckin.bat
Created September 23, 2013 13:35
Check in DB schema to SVN using SQLCompare.
SVN add --username MyUser --password MyUserP@ss --force * --auto-props --parents --depth infinity
SVN commit --username MyUser --password MyUserP@ss -m "Daily Checkin"