This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
double a(int n) | |
{ | |
return (n * (pow(n, 2) - 25.5)) / (2 * n + 1.5); | |
} | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get deployments -n app-team -o json ` | |
| ConvertFrom-Json ` | |
| % { $_.items } ` | |
| ? { ($_.status.conditions | ? { $_.type -eq "Available" }).Status -eq "False" } | |
| % { $_.metadata.name } | |
| % { kubectl rollout restart deployments/$_ -n app-team } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$rootDir = "C:\Users\pawel\dev\blabla" | |
$majorVersion = "42" | |
Get-ChildItem $rootDir -File -Recurse ` | |
| Where-Object { $_.Name -match ".(csproj|cs|nuspec|config)$" } ` | |
#| % { write $_.FullName } | |
| ForEach-Object { | |
$content = Get-Content -Encoding utf8 $_.FullName | |
$content = $content.Replace("Namespace.VX", "Namespace.V$($majorVersion)") | |
Set-Content -Encoding utf8 $_.FullName $content | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Set-KubeCluster { | |
$i = 1 | |
$contexts = kubectl config get-contexts --no-headers -o name | |
$contexts ` | |
| ForEach-Object { | |
Write-Output "$(($i++)): $_" | |
} | |
[int]$answer = Read-Host -Prompt "Which context do you choose?" | |
$choosen = $contexts[($answer-1)] # Counting starts from 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
////////////////////////// | |
// Zad. 1 | |
//////////////////////////1 | |
double wiszenko; | |
printf("Wpisz wartosc dla nazwisko studenta:\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var endpoint = new OctopusServerEndpoint(octopusURL, octopusAPIKey); | |
var repository = new OctopusRepository(endpoint); | |
var client = new OctopusClient(endpoint); | |
var space = repository.Spaces.FindByName(spaceName); | |
var repositoryForSpace = client.ForSpace(space); | |
var projects = repositoryForSpace.Projects.GetAll().Where(x => !x.IsDisabled); | |
var envs = repositoryForSpace.Environments.GetAll(); | |
foreach (var project in projects) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async Task Main() | |
{ | |
var sw = new Stopwatch(); | |
sw.Start(); | |
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(3)); | |
await Foo(cts.Token); | |
sw.Stop(); | |
Console.WriteLine("Elapsed " + sw.ElapsedMilliseconds); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################### | |
# Params | |
################################################### | |
$p = "" # eg "bc.cqrs" | |
$v = "" # eg "3.1.0.48-featureupdatefluentv" | |
$pat = "" | |
$org = "" | |
$project = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run as Administrator | |
$openSshStatus = Get-WindowsCapability -Online | ? Name -like 'OpenSSH.Server*' | |
if($openSshStatus[0].State -eq "NotPresent"){ | |
Write-Output "OpenSSH server not detected. Processing to installation..." | |
$installResult = Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | |
if($installResult.Online -eq $true){ | |
Write-Output "Installation succeeded." | |
} | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
var server = "https://octopusdeploy....org/"; | |
var apiKey = "API-....VYOR68S"; | |
var endpoint = new OctopusServerEndpoint(server, apiKey); | |
var repository = new OctopusRepository(endpoint); | |
var azSpace = repository.Spaces.FindByName("Azure"); | |
var azRepo = repository.ForSpace(azSpace); | |
var createVmProject = azRepo.Projects.FindByName("Create VM"); | |
var defaultChannel = azRepo.Channels.FindByName(createVmProject, "Default"); |
NewerOlder