This function combines each element of an array with everyone, even itself.

You can limit the columns to the count of elements in the initial array or specify the columns of the result.

If you have arrays in your array, then you have to do something else. This is meant for array containing single elements!

 

Code:

Function Combine-Array([System.Collections.ArrayList]$arrInitialInput,[System.Collections.ArrayList]$arrInternalInput,[int]$iteration=0,[Boolean]$Unique=$true,[int]$MaxColumns=0){
<#
.SYNOPSIS
This function combines each element of a given array to the same length as the count of the input array.
 
.DESCRIPTION
This function combines each element of a given array and outputs into a multi-dimensional array.
The amount of columns is the same as the count of the input Array.
Example:
$arrInput = @("Compute-S","Compute-M","Compute-L")
$output = Combine-Array -arrInitialInput $arrInput -Unique $true -MaxColumns 5
 
.NOTES
Only Arrays with single elements are valid. It is not intended to run with multi-dimensional array.

.COMPONENT
Nothing special here, i guess.

.LINK
Useful Link to ressources or others.

.Parameter arrInitialInput
A valid array containing single elements.
 
.Parameter arrInternalInput
Leave this blank. This parameter will be set by the recursive behavior of this script.

.Parameter iteration
Leave this blank. This parameter counts the iterations, that occured.

.Parameter Unique
Default value is $true. This parameter filters out double combinations after combining values and reordering those per row.
Example: (a,a),(a,b),(b,a),(b,b) -> (a,a),(a,b),(a,b),(b,b) -> (a,a),(a,b),(b,b)
.Parameter MaxColumns
If this value is bigger than 1 the result will be a maximal combination of each element with the columns specified by this parameter.

#>
 
#Initialization as an Arraylist to dynamically add elements.
[System.Collections.ArrayList]$arrOutput = @()
If($iteration -eq 0){
#For the first run we need to set the $arrInternalInput to the initialInput.
$arrInternalInput = $arrInitialInput
}
ForEach($row in $arrInternalInput){
ForEach($col in $arrInitialInput){
#If the element is not an array, we have to create one first. Powershell kills one element arrays to their specific value.
If ($iteration -eq 0){
[System.Collections.ArrayList]$temprow = [System.Collections.ArrayList]($row,$col)
}
Else{
#We do not want to change the original row, because otherwise we get a longer array, than the input array. the count would get bigger. So a temporary object is needed.
$tempRow = $row
#Add an element to the actual row.
$tempRow += $col
}
If ($Unique -eq $true){
#Sorting of the arrays, which are the rows in out multidimenstional Array. Later we can sort again to filter for unique elements
$tempRow = $tempRow | Sort-Object
}
#Insert the array as an element in an array
$arrOutput+= (,$tempRow)
}
}
#Filter double elements out in-between to speed up the process and spare out unnecessary combinations.
If ($Unique -eq $true){
$arrOutput = $arrOutput | Sort-Object -Unique
}
$iteration++
#We need as much runs as elements -1 are in the initial array or specified by MaxColums if greater than 1. The -1 is necessary, because we already had one run.
If ($MaxColumns -le 1){
$MaxColumns = $arrInitialInput.count
}
If ($iteration -lt $MaxColumns-1)
{
#the actual output is the input for the next run, to make every combination possible.
$arrOutput = Combine-Array -arrInitialInput $arrInitialInput -arrInternalInput $arrOutput -iteration $iteration -Unique $Unique -MaxColumns $MaxColumns
}
return $arrOutput
}
[System.Collections.ArrayList]$arrInput = @("Compute-S","Compute-M","Compute-L")
$output =$null
Measure-Command {$output = Combine-Array -arrInitialInput $arrInput -Unique $true -MaxColumns 10}
Add a comment

Hi,

 

as i tried to establish a reasonable way to write my own eventlogs i stumbled across eventlog rotation.

There was a script that established a way of copying the evtx-files from $env:systemdrive\windows\system32\winevt\logs\* to somewhere else for each logfile and then cleared every eventlog.

But it has several drawbacks and in this case powershell has no built-in solution, but read next:

 

I found three ways to rotate the EventLogs:

1. Copy away the .evtx file of the corresponding eventlog and then do a clear -> Copy-Eventlog

2. Use wevtutil cl $logname /bu:$Path -> wevtutil

3. Use .NET [System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ExportLogAndMessages("$Logname",'LogName','*',"$Path")

[System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog("$Logname") -> .NET

 

In the first scenario i recognized the biggest gap between exporting and clearing the log -> EventLogGap

 

Randomly i had no events in the exported file, if i start with a fresh eventlog and also generate some events before i export and delete them. It seems that events are not written directly into the evtx-file but somewhere in a buffer -> EventLogNirvana

 

So we have two objectives to cover:

- EventLogGap gets bigger, as the file grows or the content in the file is, which is more likely to be when using the way of "Copy-Eventlog"

- EventLogNirvana seems also just to happen, when copying the underlying .evtx file, which has not been written completely

Conclusion would be to use wevtutil as this seems to be the only reliable method. The .NET-Method produced some unneccessary additional entries for each eventlog entry.

 Followed is a script is use to rotate eventlogs:

 

Add a comment

Wieder auf der Suche nach einem gescheiten Connection Manager habe ich den mRemoteNG wiederentdeckt. Er wird endlich wieder weiterentwickelt:

https://mremoteng.org/

mRemoteNG supports the following protocols:

  • RDP (Remote Desktop/Terminal Server)
  • VNC (Virtual Network Computing)
  • ICA (Citrix Independent Computing Architecture)
  • SSH (Secure Shell)
  • Telnet (TELecommunication NETwork)
  • HTTP/HTTPS (Hypertext Transfer Protocol)
  • rlogin
  • Raw Socket Connections

 

Zur Anpassung der SSH Terminalfarben kann ich folgenden Link empfehlen:

https://github.com/AlexAkulov/putty-color-themes

Meine Konfiguration ist diese:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings]
"Colour0"="222,222,222"
"Colour1"="255,94,125"
"Colour2"="0,0,0"
"Colour3"="0,0,0"
"Colour4"="187,187,187"
"Colour5"="0,255,0"
"Colour6"="0,0,0"
"Colour7"="85,85,85"
"Colour8"="255,85,85"
"Colour9"="255,85,85"
"Colour10"="85,255,85"
"Colour11"="85,255,85"
"Colour12"="255,255,85"
"Colour13"="255,255,85"
"Colour14"="85,85,255"
"Colour15"="85,85,255"
"Colour16"="255,85,255"
"Colour17"="255,85,255"
"Colour18"="85,255,255"
"Colour19"="85,255,255"
"Colour20"="187,187,187"
"Colour21"="255,255,255"

Add a comment

Before someone else is googling his/hers ass off.

Cinder is able to create multi-attach able disks but nova has the feature not implemented yet. It seems to be targeted for version 14.

I recognized this behavior as i tried to connect OpenShift to OpenStack and dynamically provision storage.

 

Links are:

https://bugzilla.redhat.com/show_bug.cgi?id=1033185

https://bugzilla.redhat.com/show_bug.cgi?id=1033180

https://access.redhat.com/solutions/2429871

https://access.redhat.com/solutions/2529261

 

 

Add a comment

[Copyright liegt bei irgendwem, habe das nur mal wieder ausgegraben. Ist einfach nur genial]

Also man braucht...

einen, der die Glühbirne auswechselt und im off-topic postet, dass sie ausgewechselt wurde

14 die ähnliche Erfahrungen gemacht haben und vorschlagen, wie man die Birne anders hätte wechseln können

7 die auf Gefahren beim Wechseln hinweisen

3 die fragen, wozu der Threadstarter überhaupt eine Glühbirne braucht

5 die der Regierung die Schuld daran geben, dass die Glühbirne durchgebrannt ist

3 die finden, dass es die Opposition auch nicht besser gemacht hätte

1 Irrer der behauptet, den Typ gekannt zu haben der die Glühbirne erfunden hat

8 die auf Tipp- und Grammatikfehler in den vorherigen Beiträgen hinweisen

Add a comment

Um beispielsweise einer besonderen Storagekonfiguration gerecht zu werden, dass man eben zwei Storages betreibt, die nicht miteinander interagieren bzw. nicht jeweils aus dem anderen DC erreicht werden können, werden zwei getrennte Cinder Nodes notwendig.

Ab OpenStack 10 können neben den etablierten 5 Rollen weitere Rollen definiert werden.

Quellen:

https://access.redhat.com/documentation/en/red-hat-openstack-platform/10/paged/advanced-overcloud-customization/chapter-6-composable-services-and-custom-roles Ab Kapitel 6.5

http://tripleo-docs.readthedocs.io/en/latest/tht_walkthrough/tht_walkthrough.html

http://hardysteven.blogspot.de/2016/10/tripleo-composablecustom-roles.html

Add a comment

In this case i tried to delete a stack and on deletion disks got stuck, while all instances have been cleared.

For analysis i use the openstack client tools installed in Installation OpenStack Python client unter Windows

+--------------------------------------+------------------+-----------+------+---------------------------------------------------------------+
| ID                                   | Display Name     | Status    | Size | Attached to                                                   |
+--------------------------------------+------------------+-----------+------+---------------------------------------------------------------+
| 4abd0cc4-2c39-fooo-93c3-01f8bad02498 | Disk-Server4 | in-use    |   50 | Attached to a010fa48-ff6f-46b8-bda8-d0c7fe7304b5 on /dev/vdb  |
| fc7f63fa-c95b-fooo-b571-efa73aa49e69 | Disk-Server2 | available |   50 |                                                               |
| 5e239dbc-de6b-fooo-be6f-535d7556c8e0 | Disk-Server3 | deleting  |   50 |                                                               |
| 8a5c867e-dc19-fooo-8bf7-533a5dff5557 | Disk-Server1 | deleting  |   50 |                                                               |
| 7136ac76-f14f-fooo-90d6-cebe40f82451 | Disk-Server5 | available |   50 |                                                               |
+--------------------------------------+------------------+-----------+------+---------------------------------------------------------------+

As you can see we have two disks pending in deleting state and one disk attached to an instance which does not exist anymore.

 

Add a comment

If you want to install docker on Cent OS 7, don't use the binaries out of the extras repo from centos.

What you get is a different named docker daemon binary, with /usr/bin/dockerd-current instead of /usr/bin/dockerd and also /usr/bin/docker-proxy is missing.

Follow the instructions on: https://docs.docker.com/engine/installation/linux/centos/

In short what i did was:

Add a comment

Ein paar nützliche Links für kostenlose Whitepaper Downloads.

Ich weiß nicht wie lange das gültig sein wird:

https://www.idera.com/resourcecentral/whitepapers/powershell-ebook/thankyou

 

Add a comment

Um per CLI auf die OpenStack Installation zugreifen zu können muss folgendes durchgeführt werden:

Quelle: http://docs.openstack.org/user-guide/common/cli-install-openstack-command-line-clients.html

Installation:

Im Zuge einer automatisierten Installation von RedHat OpenShift auf OpenStack wollte ich das natürlich möglichst automatisiert ausführen.

Dazu bringt OpenStack die Komponente Heat mit, mit der es möglich ist einen ganzen Stack auf einmal automatisiert auszurollen, zu ändern, zu skalieren und zu löschen.

Heat kann mittels Template, das wiederum HOT(=Heat Orchestration Template) heißt, gefüttert werden.

Die Notationssprache in diesem Template ist YAML(=YAML Ain’t Markup Language).

 

Das Regelwerk für YAML ist grundsätzlich wie folgt aufgebaut:

Add a comment