Skip to content

Instantly share code, notes, and snippets.

View goyalmohit's full-sized avatar

mohit goyal goyalmohit

  • Pune, India
View GitHub Profile
@goyalmohit
goyalmohit / liquibase.properties
Created August 14, 2019 01:53
Liquibase configuration file for PostgreSQL database
driver: org.postgresql.Driver
classpath: ./lib/postgresql-42.2.5.jar
url: jdbc:postgresql://localhost:5432/sampledb
username: adminUsername
password: adminUserPassword
changeLogFile: src/main/resources/db.changelog.xml
stages:
- stage: Build
jobs:
- job: Build
pool:
vmImage: 'Ubuntu-16.04'
continueOnError: true
steps:
- script: echo "hello to my first Build"
- stage: dev_deploy
@goyalmohit
goyalmohit / configure-ssl-for-jenkins-on-centos.sh
Last active February 29, 2024 22:36
Configure SSL for Jenkins on CentOS
#This gist is related to blog post https://mohitgoyal.co/2017/02/08/securing-your-jenkins-environment-and-configure-for-auditing/
# Generate certificate csr
openssl req -new > new.ssl.csr
# Create a key file for generating certificate
openssl rsa -in privkey.pem -out new.cert.key
# Create a csr file using the key file for 635 days
openssl x509 -in new.ssl.csr -out new.cert.cert -req -signkey new.cert.key -days 365
@goyalmohit
goyalmohit / Update-AssemblyInfoVersionFile.ps1
Last active February 20, 2024 19:25
Assembly versioning using PowerShell
function Update-AssemblyInfoVersionFile
{
Param
(
[Parameter(Mandatory=$true)]
[string]$productVersion
)
$buildNumber = $env:BUILD_BUILDNUMBER
if ($buildNumber -eq $null)
@goyalmohit
goyalmohit / post-commit.py
Created April 14, 2019 11:46
Python script for git post-commit hook
#!/usr/bin/env python
import smtplib
from email.mime.text import MIMEText
from subprocess import check_output
# Get the git log --stat entry of the new commit
log = check_output(['git', 'log', '-1', '--stat', 'HEAD'])
# Create a plaintext email message
msg = MIMEText("Look, I'm actually doing some work:\n\n%s" % log)
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
@goyalmohit
goyalmohit / install-powershell-core-on-centos-7.sh
Last active November 11, 2023 04:06
Install PowerShell Core on CentOS 7
# Enter superuser mode
sudo su
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/microsoft.repo
# Exit superuser mode
exit
# Install PowerShell
@goyalmohit
goyalmohit / export-data-using-liquibase
Last active November 7, 2023 22:10
Export data from existing database using Liquibase
liquibase
--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
--classpath="C:\\Program Files\\Microsoft JDBC Driver 6.0 for SQL Server\\sqljdbc_6.0\\enu\\jre8"
--url="jdbc:sqlserver://localhost:1433;databaseName=AdventureWorks2017;integratedSecurity=false;"
--changeLogFile="D:\Source\generateChangeLog--PersonSchema.xml"
--username=liquibase
--password=liquibase@123
--logLevel=info
--defaultSchemaName=dbo
--diffTypes=data
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appServiceName": {
"type": "string",
"minLength": 1,
"maxLength": 10
},
"appServicePlanName": {
stages:
- stage: Build_Source_Code # Build Source Code for Dotnet Core Web App
jobs:
- job: Build
pool: 'Hosted VS2017'
variables:
buildConfiguration: 'Release'
continueOnError: false
steps:
- task: DotNetCoreCLI@2