Skip to content

Instantly share code, notes, and snippets.

View eizedev's full-sized avatar
💻
Automating everything - Picture powered by AI with my photo as model.

René eizedev

💻
Automating everything - Picture powered by AI with my photo as model.
  • Germany
  • 18:38 (UTC +02:00)
View GitHub Profile
@eizedev
eizedev / php-pecl-yaml.spec
Last active April 16, 2019 07:41
Spec File: php-pecl-yaml (YAML-1.1 parser and emitter) with support of scl rh-php71
%global pecl_name yaml
%global ini_name 40-%{pecl_name}.ini
# Change default build against scl rh-php71
%{!?scl:%global scl rh-php71}
%{?scl:%scl_package php-pecl-yaml}
%{!?scl:%global pkg_name %{name}}
Name: %{?scl_prefix}php-pecl-yaml
@eizedev
eizedev / Get-LinuxUsers.ps1
Last active May 21, 2019 19:29
Get all users on a linux operating system by parsing the /etc/passwd file
$passwd = (Get-Content /etc/passwd).ForEach({
$userfields = $_ -split ':'
return [pscustomobject]@{
UserName = $UserFields[0]
ShadowFile = $(if ($userfields[1] -eq 'x') { $true }else { $false })
UserId = $UserFields[2]
GroupId = $userfields[3]
FullName = $Userfields[4]
HomeDirectory = $UserFields[5]
ShellAccount = $Userfields[6]
@eizedev
eizedev / gist:222a8c78df7aec24bf1cad78d064511d
Created June 28, 2019 10:00 — forked from davidphay/gist:83dfb54f80e5fe50511ce967caf68a08
Change your own Active Directory password from PowerShell without any special permissions
Set-AdAccountPassword -Identity $env:UserName -OldPassword (Read-Host -asSecureString "Enter the current password") -NewPassword (Read-Host -asSecureString "Enter the new password")
@eizedev
eizedev / gist:038931996db61064b263332ad0d038ab
Created June 28, 2019 10:00 — forked from jstangroome/gist:3087453
Change your own Active Directory password from PowerShell without any special permissions
([adsi]'WinNT://domain/username,user').ChangePassword('oldpassword','newpassword')
@eizedev
eizedev / Update-VMTools.ps1
Created July 19, 2019 09:47
Update VMware Guest OS VMTools on all VMs which need and Upgrade and have a windows guest os
@(Get-VM).Where( {$_.ExtensionData.Guest.ToolsVersionStatus -eq "guestToolsNeedUpgrade" -and $_.PowerState -eq "PoweredOn"}) | Get-VMGuest | Where-Object {$_.GuestFamily -eq "windowsGuest" } | Update-Tools -NoReboot -RunAsync
@eizedev
eizedev / Get-DockerContainer.ps1
Last active January 9, 2020 07:30 — forked from jdhitsolutions/Get-DockerContainer.ps1
A PowerShell function to get docker containers as objects.
#requires -version 5.1
<#
sample usage
get-dockercontainer
get-dockercontainer | select *
get-dockercontainer -all | format-table -view stats
#>
Function Get-DockerContainer
@eizedev
eizedev / mydockercontainer.format.ps1xml
Created January 9, 2020 07:27 — forked from jdhitsolutions/mydockercontainer.format.ps1xml
A PowerShell format file to be used with my Get-DockerContainer function.
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<ViewDefinitions>
<View>
<!--Created 03/27/2019 17:01:10 by BOVINE320\Jeff-->
<Name>default</Name>
<ViewSelectedBy>
<TypeName>Get-DockerContainer.myDockerContainer</TypeName>
</ViewSelectedBy>
<GroupBy>
@eizedev
eizedev / Get-GitConfig.ps1
Created January 9, 2020 07:38 — forked from jdhitsolutions/Get-GitConfig.ps1
A PowerShell function to get your git configuration. See comment based help for usage examples.
#requires -version 5.1
Function Get-GitConfig {
<#
.SYNOPSIS
Get git configuration settings
.DESCRIPTION
Git stores configurations settings in a simple text file format. Fortunately, this file is structured and predictable. This command will process git configuration information into PowerShell friendly output.
.PARAMETER Scope
Function Get-GitSize {
<#
.SYNOPSIS
Get the size of .git folder
.DESCRIPTION
When using git, it creates a hidden folder for change tracking. Because the file is hidden it is easy to overlook how large it might become. Specify the parent folder path. The result displays the size value in bytes but there are additional properties that show the value formatted in KB, MB or GB.
.PARAMETER Path
The path to the parent folder, not the .git folder.
.EXAMPLE
PS C:\scripts\PiedPiperBox> Get-GitSize
@eizedev
eizedev / 1-Get-DockerDiskUsage.ps1
Last active January 9, 2020 07:48 — forked from jdhitsolutions/1-Get-DockerDiskUsage.ps1
A Powershell function that wraps Docker command line output to display disk usage. Save the files without the numeric prefix.
#requires -version 5.1
Function Get-DockerDiskUsage
{
[cmdletbinding()]
[alias("gddu")]
[OutputType("Get-DockerDiskUsage.DockerDiskUsage")]
Param(
[Parameter(Position = 0, HelpMessage = "Get specific usage types. The default is All")]
[ValidateSet("Images", "Containers", "Volumes", "Cache")]