Skip to content

Instantly share code, notes, and snippets.

@angeloxx
angeloxx / Ansible, VMware and Atlassian Confluence integration
Last active June 4, 2025 17:02
Export to Atlassian Confluence via API the list of vCenter VMs using Ansible
This small playbook:
* get the list of registered VMs and dump in a temporary json file (tag discover)
* create or edit a page on Confluence (tag report)
You can reuse the task confluence-page.yaml to generate automatically pages via Ansible
@mehdichaouch
mehdichaouch / google-dorks
Created March 22, 2020 17:54 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@ScottHutchinson
ScottHutchinson / install-vsix.ps1
Last active April 12, 2025 09:57
PowerShell scripts for batch installing Visual Studio extensions
# Based on http://nuts4.net/post/automated-download-and-installation-of-visual-studio-extensions-via-powershell
param([String] $PackageName)
$ErrorActionPreference = "Stop"
$baseProtocol = "https:"
$baseHostName = "marketplace.visualstudio.com"
$Uri = "$($baseProtocol)//$($baseHostName)/items?itemName=$($PackageName)"
@jdhitsolutions
jdhitsolutions / Register-PSCoreHelpTask.ps1
Created April 15, 2019 14:44
Create a PowerShell Scheduled job to update help monthly on a Windows based platform running PowerShell Core
#requires -module ScheduledTasks
#update PowerShell help via a Scheduled Task
$cred = Get-Credential "$env:USERDOMAIN\$env:USERNAME"
# for Windows PowerShell
# $action = New-ScheduledTaskAction -execute powershell.exe -argument '-noprofile -command "&{Update-Help -force}"'
$actionparams = @{
execute = 'pwsh.exe'
argument = '-nologo -noprofile -noninteractive -command "&{Update-Help -force}"'
@f3l3gy
f3l3gy / download-latest-release.ps1
Last active November 8, 2023 07:12 — forked from MarkTiedemann/download-latest-release.ps1
Download latest GitHub release via Powershell
# Download latest dotnet/codeformatter release from github
$repo = "dotnet/codeformatter"
$file = "CodeFormatter.zip"
$releases = "https://api.github.com/repos/$repo/releases"
Write-Host Determining latest release
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$tag = (Invoke-WebRequest -Uri $releases -UseBasicParsing | ConvertFrom-Json)[0].tag_name
@jaskiratr
jaskiratr / chmod-400.cmd
Created June 29, 2018 01:03
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r
# This Sets up WinRM Remote PowerShell with delegated authentication for an existing trusted SSL cert
########################################################################
################ Do this on the Server
########################################################################
#Enable WinRM on a VM - with on-demand certificate creation
Function RemotePowerShell {
$process = 'cmd.exe'
$arguments = '/c winrm invoke restore winrm/config @{}'
@MarkTiedemann
MarkTiedemann / download-latest-release.ps1
Last active January 5, 2025 10:28
Download latest GitHub release via Powershell
# Download latest dotnet/codeformatter release from github
$repo = "dotnet/codeformatter"
$file = "CodeFormatter.zip"
$releases = "https://api.github.com/repos/$repo/releases"
Write-Host Determining latest release
$tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@Grimthorr
Grimthorr / pending-updates.ps1
Created November 9, 2015 16:03
PowerShell script to list the pending/missing Windows updates.
$UpdateSession = New-Object -ComObject Microsoft.Update.Session
$UpdateSearcher = $UpdateSession.CreateupdateSearcher()
$Updates = @($UpdateSearcher.Search("IsHidden=0 and IsInstalled=0").Updates)
$Updates | Select-Object Title