Skip to content

Instantly share code, notes, and snippets.

View brunomartinspro's full-sized avatar
🚀

Bruno Martins brunomartinspro

🚀
View GitHub Profile
kubectl get nodes
#View nodes that have scheduling disabled
kubectl uncordon <node-name>
#restart server
########################################################################################################################
# Create a Service account and link it to the default namespace. #
# For example, we configure azure devops to use a Kubernetes Service Connection with a secret (yaml file) #
########################################################################################################################
# Create service account
kubectl create serviceaccount <service-account-name>
# Get secrets from the created service account
kubectl get serviceaccounts <service-account-name> -o yaml
@brunomartinspro
brunomartinspro / Dockerfile
Created November 20, 2019 14:14
Windows Dockerfile: Installing git in silent mode
run mkdir git
COPY Dependencies\\Git-2.24.0.2-64-bit.exe git
RUN powershell . C:\\git\\Git-2.24.0.2-64-bit.exe /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS="icons,ext\reg\shellhere,assoc,assoc_sh"
@brunomartinspro
brunomartinspro / UpdateallGitRepositoriesInFolder.ps1
Created November 7, 2019 16:00
Update all Git Repositories in a Folder
$currentLocation = get-location
Write-Host("Current Location: $currentLocation")
$directories = Get-Childitem -Path $currentLocation -Directory
foreach($directory in $directories)
{
Write-Host("-------------- Starting $directory --------------")
@brunomartinspro
brunomartinspro / modify_net_core_nuget_package_version_using_powershell.ps1
Last active August 14, 2019 17:49
Modify .Net Core Nuget Package Version using Powershell
$filePath = "$(Build.SourcesDirectory)"
$projectNameFilter = "MYBASEPROJECTNAME.*"
Write-Output ("package version: $(NugetVersion)")
Get-ChildItem "$filePath" -Filter "$projectNameFilter.csproj" -recurse | Foreach-Object {
Write-Output ("----------------- CSPROJ FILTER: " + $_.FullName + "----------------------")
try {
$regex = '(?<=<Version>)[^<]*'
@brunomartinspro
brunomartinspro / development.reg
Last active August 7, 2019 10:55
Add development files to New section of Windows Context Menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.ps1\ShellNew]
"NullFile"=""
[HKEY_CLASSES_ROOT\.psm1\ShellNew]
"NullFile"=""
[HKEY_CLASSES_ROOT\.cs\ShellNew]
"NullFile"=""
@brunomartinspro
brunomartinspro / npm-gui.bat
Last active December 12, 2018 11:08
NPM Package Manager Graphic User Interface
npm install -g npm-gui
cd c:\your-prject-folder
npm-gui localhost:9000
@brunomartinspro
brunomartinspro / sqlserverlargecommand
Last active September 6, 2018 17:19
run large sql server sql queries
sqlcmd -S <server> -i C:\<your file here>.sql
#
Sqlcmd [-U login id] [-P password]
[-S server] [-H hostname] [-E trusted connection]
[-d use database name] [-l login timeout] [-t query timeout]
[-h headers] [-s colseparator] [-w screen width]
[-a packetsize] [-e echo input] [-I Enable Quoted Identifiers]
[-c cmdend] [-L[c] list servers[clean output]]
[-q "cmdline query"] [-Q "cmdline query" and exit]
@brunomartinspro
brunomartinspro / ClearGitCredentials.bat
Created August 30, 2018 15:23
Clear git credentials
git config --global credential.helper wincred
@brunomartinspro
brunomartinspro / IISPoolViewer.bat
Last active August 22, 2018 20:25
View process id of IIS Application Pools
cd %windir%\system32\inetsrv\
appcmd list wp