Skip to content

Instantly share code, notes, and snippets.

View nilayparikh's full-sized avatar

Nilay Parikh nilayparikh

View GitHub Profile
@nilayparikh
nilayparikh / check_repo_compromise.py
Last active April 28, 2026 21:19
Audit a git repository for compromise indicators after GHES incidents. This script is defensive. It cannot prove a repository or server is clean. It flags suspicious signals in a local clone and optional exported log files.
"""Audit a git repository for compromise indicators after GHES incidents.
This script is defensive. It cannot prove a repository or server is clean.
It flags suspicious signals in a local clone and optional exported log files.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
from __future__ import annotations
import argparse
import datetime as dt
import json
import math
import re
import statistics
from dataclasses import dataclass
from pathlib import Path
prev_df = None
columns_to_check = ["o", "h", "l", "c", "v"]
while True:
result = client.query(
f"SELECT l_sym, rght, strk, exp, first_value(o) as o, max(h) AS h, min(l) AS l, last_value(c) as c, last_value(av) as av, count(*) as trades FROM {ch_table_name} WHERE sym='AAPL' GROUP BY l_sym, strk, exp, rght ORDER BY av DESC;"
)
df = pd.DataFrame(result.result_rows, columns=result.column_names)
@nilayparikh
nilayparikh / rule_base_validation.py
Last active December 16, 2023 15:18
Data Quality by Design: A Comprehensive Approach from Ingestion to Value Generation
import pandas as pd
from datetime import datetime
# Sample market options data
options_data = pd.DataFrame({
"symbol": ["XYZ", "XYZ", "XYZ"],
"expiration": ["2023-01-27", "2023-02-17", "2023-01-20"],
"strike": [35.00, 40.00, 45.00],
"bid": [1.05, 2.15, 0.95],
"ask": [1.15, 2.25, 1.05],
{
"value": [
{
"data": [
{
"timeStamp": "2017-04-25T21:20:00Z",
"average": 92.78
},
{
"timeStamp": "2017-04-25T21:21:00Z",
{
"value": [
{
"data": [
{
"timeStamp": "2017-04-25T20:30:00Z",
"average": 89.28
},
{
"timeStamp": "2017-04-25T20:31:00Z",
@nilayparikh
nilayparikh / deploy.ps1
Last active April 6, 2017 16:38
Guide: A Step-by-Step Guide to Setup Service Fabric Cluster in Azure
<#
.SYNOPSIS
Deploys a template to Azure
.DESCRIPTION
Deploys an Azure Resource Manager template
.PARAMETER subscriptionId
The subscription id where the template will be deployed.
@nilayparikh
nilayparikh / ConfigureVMDiskEncryption.ps1
Created March 11, 2017 19:19 — forked from chelnak/ConfigureVMDiskEncryption.ps1
Encrypt Azure VM Disks with PowerShell
<#
.SYNOPSIS
Enables disk encrption on a VM
.DESCRIPTION
Enables disk encryption on a VM. The script will create a new Key Vault, Azure Active Directory Application and Service principal
.PARAMETER ResourceGroupName
The name of the resource group that contains the key vault and virtual machine
@nilayparikh
nilayparikh / Migrate-AzureVM.ps1
Created March 6, 2017 12:36 — forked from scott-kloud/Migrate-AzureVM.ps1
Migrates a Azure Virtual Machine to another subscription or data centre
<#
.SYNOPSIS
Migrates a Azure Virtual Machine to another subscription or data centre
.DESCRIPTION
Shutsdown the source VM
Exports the VM config to a temporary file
Loops through all Azure disks attached to the source VM
Schedules an async copy of the underlying VHD to the destination storage account
- optionally overwrites existing VHD in destination if it exists
@nilayparikh
nilayparikh / deploy.ps1
Created March 6, 2017 12:36 — forked from srkirkland/deploy.ps1
TeamCity CI Deploy Azure PowerShell Script
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
$subscription = "[Your Subscription Name]"
$service = "[Your Azure Service Name]"
$slot = "staging" #staging or production
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg"
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"
Write-Output "Running Azure Imports"