Skip to content

Instantly share code, notes, and snippets.

View akuryan's full-sized avatar

Anton Kuryan akuryan

View GitHub Profile
@akuryan
akuryan / gist:aa458edd325ff840eb97
Created July 14, 2014 11:50
Small script to start weinre remote debugging server
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="weinre"
function GetAzureSubscription([string]$userName, [string]$password, [string]$subscriptionName)
{
$secpasswd = ConvertTo-SecureString $password -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($userName, $secpasswd)
Add-AzureAccount -Credential $cred
Select-AzureSubscription -SubscriptionName $subscriptionName -Current
}
#Switches slots on azure web app (expects that there is only one deployment slot present)
#Example usage: .\SwitchAzureWebsite.ps1 username password "some subscription name" "some-webappname"
#where
#username - user with co-administrator rights on subscription
#password - password for this user
#some sbuscription name - name of subscrtion
#"some-webappname" - webapp to switch slot for
param(
@akuryan
akuryan / example.cspoj.addition
Last active January 11, 2016 15:34
Modify .csproj to include file content in delivery only once
<PropertyGroup>
<OnBeforePackageUsingManifest>
$(OnBeforePackageUsingManifest);
AddSpecificSkipRule;
</OnBeforePackageUsingManifest>
<AfterAddIisSettingAndFileContentsToSourceManifest>
$(AfterAddIisSettingAndFileContentsToSourceManifest);
AddSpecificSkipRule;
</AfterAddIisSettingAndFileContentsToSourceManifest>
<!-- Due to known error (http://stackoverflow.com/questions/12576662/msdeploy-skip-rules-when-using-msbuild-publishprofile-with-visual-studio-2012)
@akuryan
akuryan / z.CDProd.ScalabilitySettings.config
Created May 18, 2018 06:07
CD Production slot config
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<!-- INSTANCE NAME
Unique name for Sitecore instance.
Default value: (machine name and IIS site name)
-->
<setting name="InstanceName">
<patch:attribute name="value"></patch:attribute>
@akuryan
akuryan / transform.ps1
Last active October 20, 2019 18:28
Gets files in folder to be used as transformation files
param(
[string]$folderWithTransforms,
[string]$webRoot,
[string]$roleName,
[string]$transformationAssemblyPath
)
Write-Output "Starting collecting files for transformations"
if ([string]::IsNullOrWhiteSpace($folderWithTransforms)) {
@akuryan
akuryan / deliverZipArchive.ps1
Created September 15, 2021 11:31
This gist shows how could one use Kudu api/zip in combination with api/vfs to deliver archive outside of web app webroot and overcome hardcoded request timeout
$unicornFilesZip = "c:\temp\unicorn.zip";
$indicatorFileName = "z.z." + "$(buildNumberVar)" + ".txt";
$scmTargetPath = "C:\home\N";
$unicornFolder = Split-Path $scmTargetPath -Leaf;
function Get-HttpBasicAuthHeader
{
Param(
[Parameter(Mandatory=$true)]
[string]$UserName,
###############################################################################
<#
.SYNOPSIS
GetTicketsInBuld
.DESCRIPTION
GetTicketsInBuld collects Jira tickets in build, basing on last successful build in target environment
.PARAMETER authHeaderValue
Added for OutputDebugDetails purpose to allow one to specify Basic auth by passing string like "Basic ..."
@akuryan
akuryan / sonarQubeAnalyzer.ps1
Last active August 13, 2023 21:09
SonarQube Community edition: get quality gate status after analysis and retrieve possible issues with theirs severities; then create bugs, linked to some issues in Jira
# path to sonarscanner for msbuild
$SonarQubeRunner = $(Resolve-Path ".\SonarScanner.MSBuild.exe").Path;
# sonar qube token for auth
$sonarQubeToken = "";
# sonar server hostname
$sonarQubeHostName = "";
$sonarQubeScheme = "https";
$sonarQubeUrl = "$sonarQubeScheme://$sonarQubeHostName";
# sonarqube project name
$sonarQubeProjectName = "";