Skip to content

Instantly share code, notes, and snippets.

Avatar

ABHAY DHAR abhaydhar

  • bengaluru
View GitHub Profile
@abhaydhar
abhaydhar / FileRenameExtensionMethod
Created Mar 5, 2018
Extension Method to Rename a file in a directory
View FileRenameExtensionMethod
public static class ExtensionMethod
{
public static void Rename(this FileInfo fileInfo, string newName)
{
fileInfo.MoveTo(fileInfo.Directory.FullName + "\\" + newName + fileInfo.Extension);
}
}
//Caller
FileInfo file = new FileInfo("Complete_Directory_path_of_file");
file.Rename(fName.Replace('/', '-'));
@abhaydhar
abhaydhar / DeployKudu
Created Oct 7, 2019
Powershell Script to deploy Dotnet and Unicorn Files to Azure App Service using Kudu Rest API
View DeployKudu
# User name from WebDeploy Publish Profile.
$userName = "`$" #Use backtick while assigning variable content
# Password from WebDeploy Publish Profile
$password = "password"
# Encode username and password to base64 string
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $userName, $password)))
$envName = "https://.scm.azurewebsites.net" #Replace from publish settings
View Ajax bind ajax:complete event
$("#myform").bind('ajax:complete', function() {
//Do Something
});
View searchstax collection and zk
Upload Collection -
zkcli.bat -zkhost <YOUR_ZOOKEEPER_URL>.searchstax.com:2181 -cmd upconfig -confdir ../configsets/customindexname_web_index/conf/ -confname customindex_site_search_configs
CREATE -
curl -u 'Username:Password' 'https://<YOUR_SOLR_SEARCHSTAX_URL>/solr/admin/collections?action=CREATE&name=custom_site_master_index&collection.configName=customindex_site_search_configs&numShards=1&replicationFactor=1'
curl -u 'Username:Password' -k 'https://<YOUR_SOLR_SEARCHSTAX_URL>/solr/admin/collections?action=CREATE&name=custom_site_web_index&collection.configName=customindex_site_search_configs&numShards=1&replicationFactor=1&createNodeSet=http://<YOUR_SOLR_URL>:8983/solr'
DELETE -
curl -u 'Username:Password' -k 'https://<YOUR_SOLR_SEARCHSTAX_URL>/solr/admin/collections?action=DELETE&name=custom_site_web_index&wt=xml'
@abhaydhar
abhaydhar / Build.ps1
Created May 23, 2021 — forked from cassidydotdk/Build.ps1
Complete Build and Publish Script. Will deploy all projects to publishing target, no HPP required.
View Build.ps1
param(
[Parameter()]
[switch]$NoBuild,
[Parameter()]
[switch]$NoSync,
[Parameter()]
[string]$CmHost="https://habitatstarterkit.local",
[Parameter()]
[string]$SolutionName="HabitatStarterKit.sln",
[Parameter()]