Skip to content

Instantly share code, notes, and snippets.

View keyan1603's full-sized avatar

Karthikeyan Manickavasagam keyan1603

View GitHub Profile
@keyan1603
keyan1603 / S3upload.ps1
Created December 15, 2025 16:58
Upload file to S3 bucket without AWS CLI module
# ============================================
# 1. Set your values here
# ============================================
$AccessKey = 'AKIAY…..'
$SecretKey = 'xxxx'
$Region = "xxx"
$BucketName = "bucketname"
$Prefix = "packages"
$LocalFile = 'C:\testfile.zip'
@keyan1603
keyan1603 / AWSAzure.csv
Created August 27, 2025 07:17
AWS Azure
Category AWS Service Azure Equivalent Description
Compute EC2 Azure Virtual Machines Scalable virtual servers in the cloud.
Compute Lambda Azure Functions Event-driven, serverless compute that runs code on demand.
Compute Elastic Beanstalk Azure App Service PaaS for deploying and scaling web apps quickly.
Compute ECS Azure Container Apps Container orchestration platform for microservices.
Compute EKS Azure Kubernetes Service (AKS) Managed Kubernetes container orchestration.
Compute Fargate Azure Container Instances Serverless compute engine for containers.
Compute Lightsail Azure App Service Plans Simplified VM + app hosting for small projects.
Storage S3 Azure Blob Storage Object storage for unstructured data, highly scalable.
Storage EBS Azure Managed Disks Persistent block storage for VMs.
@keyan1603
keyan1603 / pwshHistory.ps1
Last active August 9, 2025 07:28
PowerShell command to get the history of all the commands and store it in documents folder
# Create timestamp
$timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
# Set the output path. This will store in Windows User profile's document path. Modify as required.
$outputPath = "$env:USERPROFILE\Documents\Persistent_History_$timestamp.txt"
# Get the history from History file and store in the output path. Here it gets last 1000 commands executed
Get-Content (Get-PSReadLineOption).HistorySavePath | Select-Object -Last 1000 | Out-File $outputPath
[CmdletBinding()]
param(
[Parameter(Mandatory = $false)]
[hashtable]$WatchDirectoryParameters
)
# Set logging and error handling preferences
$ErrorActionPreference = "Stop"
$InformationPreference = "Continue"
$timeFormat = "HH:mm:ss:fff"
@keyan1603
keyan1603 / hostentry.ps1
Created August 9, 2025 07:23
Add host.docker.internal and gateway.docker.internal to hostentries using Entrypoint in Containers in Sitecore
# Path to the system hosts file
$hostsFile = "C:\Windows\System32\drivers\etc\hosts"
try {
# List of Docker special DNS names used to refer to the host
$DnsEntries = @("host.docker.internal", "gateway.docker.internal")
# Attempt to resolve each DNS entry
foreach ($Entry in $DnsEntries) {
Resolve-DnsName -Name $Entry -ErrorAction Stop # Throws error if resolution fails
@keyan1603
keyan1603 / SitecoreDownloadFileFromDB.ps1
Created May 13, 2025 18:01
Get Sitecore blob item and save it as a file
$itemId = '--Your Item id--'
$fieldId = '{40E50ED9-BA07-4702-992E-A912738D32DC}' #blob field id. Please change as per requirement if required.
$outputFile = 'd:\custom.js' #file path to save
# SQL connection
$connectionString = "--your connection string--"
$query = @"
DECLARE @ItemId UNIQUEIDENTIFIER = '$itemId';
DECLARE @BlobFieldId UNIQUEIDENTIFIER = '$fieldId';
DECLARE @BlobId UNIQUEIDENTIFIER;
@keyan1603
keyan1603 / SitecoreSampleUnitTest
Created November 4, 2024 09:58
Sitecore unit test sample
using AutoFixture;
using AutoFixture.AutoNSubstitute;
using AutoFixture.Xunit2;
namespace Foundation.Tests.Extensions
{
internal class AutoDbDataAttribute :AutoDataAttribute
{
public AutoDbDataAttribute()
:base(() => new Fixture()
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone or ContentDelivery or ContentManagement">
<pipelines>
<owin.initialize>
<processor type="Sitecore.Owin.Authentication.IdentityServer.Pipelines.Initialize.LogoutEndpoint, Sitecore.Owin.Authentication.IdentityServer">
<patch:delete />
</processor>
</owin.initialize>
</pipelines>
@keyan1603
keyan1603 / cronautoscaler.yaml
Created June 6, 2024 11:54
Cron job for triggering the autoscaler
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: production
name: cron-runner
rules:
- apiGroups: ["autoscaling"]
resources: ["horizontalpodautoscalers"]
verbs: ["patch", "get"]
@keyan1603
keyan1603 / SitecoreSettingsList.html
Created May 19, 2024 17:29
A list of all Sitecore settings as of May 2024
<!DOCTYPE html>
<html>
<head>
<title>Sitecore Settings List</title>
<style>
#settings {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;