Skip to content

Instantly share code, notes, and snippets.

@AnatomicJC
AnatomicJC / prevent-desktop-lock.md
Created August 9, 2023 14:07
Prevent desktop lock or screensaver with PowerShell
Add-Type -AssemblyName System.Windows.Forms

$sleep = 240

$i = 0
while ($true) {
  $Pos = [System.Windows.Forms.Cursor]::Position
  if (($i % 2) -eq 0) {
 [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((($Pos.X) + 1) , $Pos.Y)
@AnatomicJC
AnatomicJC / protect_data.md
Last active September 1, 2023 19:05
Ansible callback plugin to hide sensitive data such as passwords from screen output

With the below settings, each variable content containing vault, pwd or pass will be obfuscated.

In ansible.cfg:

# Enable plugin
[defaults]
stdout_callback = protect_data

[callback_protect_data]