Skip to content

Instantly share code, notes, and snippets.

View exorcistas's full-sized avatar
🐺
if I sleep... who will bring me the moon?

exorcistas

🐺
if I sleep... who will bring me the moon?
View GitHub Profile
@exorcistas
exorcistas / fix-linux-laptop-touchpad-grub.txt
Created April 7, 2023 19:27
Fix Linux laptop touchpad issue
# edit /etc/default/grub
# run update-grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet i8042.nomux i8024.noloop"
@exorcistas
exorcistas / install-ad-module.ps1
Created April 23, 2022 19:51
Powershell script to install AD module
#requires -RunAsAdministrator
<#-----------------------------------------------------------------------------
Ashley McGlone, Microsoft Premier Field Engineer
http://aka.ms/goateepfe
February 2016
Install-ADModule
For Windows 10 performs the following tasks:
- Downloads and installs Windows 10 RSAT for the appropriate system architecture
- Enables the RSAT AD PowerShell feature
@exorcistas
exorcistas / capture-screenshot.ps1
Created April 23, 2022 19:50
Powershell script to capture screenshot
Add-Type -AssemblyName System.Windows.Forms,System.Drawing
$screens = [Windows.Forms.Screen]::AllScreens
$top = ($screens.Bounds.Top | Measure-Object -Minimum).Minimum
$left = ($screens.Bounds.Left | Measure-Object -Minimum).Minimum
$width = ($screens.Bounds.Right | Measure-Object -Maximum).Maximum
$height = ($screens.Bounds.Bottom | Measure-Object -Maximum).Maximum
$bounds = [Drawing.Rectangle]::FromLTRB($left, $top, $width, $height)
$bmp = New-Object System.Drawing.Bitmap ([int]$bounds.width), ([int]$bounds.height)
$graphics = [Drawing.Graphics]::FromImage($bmp)
@exorcistas
exorcistas / SciTEUser.properties
Created April 23, 2022 19:49
My Dracula theme settings for SciTE editor
font.base=font:Courier New,size:11,$(font.override)
font.monospace=font:Consolas,size:12
selection.fore=#E6E4FA
selection.back=#9488C8
selection.alpha=50
style.*.32=style.*.32=$(font.base),back:#F0F4F9
caret.line.back=#FDF268
caret.line.back.alpha=21
style.au3.34=fore:#DC78BB,back:#282A36
style.au3.35=fore:#4F72A4,back:#282A36
@exorcistas
exorcistas / list-window-controls.au3
Created April 23, 2022 19:48
AutoIt script to print active window controls
#include <Array.au3>
#include <WinAPI.au3>
ConsoleWrite("Make your window active!" & @CRLF)
Sleep(5000)
GetAllWindowsControls(WinGetHandle("[ACTIVE]"))
Func GetAllWindowsControls($hCallersWindow, $bOnlyVisible=Default, $sStringIncludes=Default, $sClass=Default)
If Not IsHWnd($hCallersWindow) Then
@exorcistas
exorcistas / get-hash.ps1
Created April 23, 2022 19:47
Powershell function to get file hash
<#
.SYNOPSIS
Gets the hash value of a file or string
.DESCRIPTION
Gets the hash value of a file or string
It uses System.Security.Cryptography.HashAlgorithm (http://msdn.microsoft.com/en-us/library/system.security.cryptography.hashalgorithm.aspx)
and FileStream Class (http://msdn.microsoft.com/en-us/library/system.io.filestream.aspx)
Based on: http://blog.brianhartsock.com/2008/12/13/using-powershell-for-md5-checksums/ and some ideas on Microsoft Online Help
@exorcistas
exorcistas / get-com-obj-attributes.ps1
Created April 23, 2022 19:46
Powershell function to get selected COM object attributes
function Get-ComObject {
param(
[Parameter(Mandatory=$true,
ParameterSetName='FilterByName')]
[string]$Filter,
[Parameter(Mandatory=$true,
ParameterSetName='ListAllComObjects')]
[switch]$ListAll
@exorcistas
exorcistas / com-object-list.ps1
Created April 23, 2022 19:45
Powershell script to fetch registered COM objects
Get-ChildItem HKLM:\Software\Classes -ErrorAction SilentlyContinue | Where-Object {
$_.PSChildName -match '^\w+\.\w+$' -and (Test-Path -Path "$($_.PSPath)\CLSID")
} | Select-Object -ExpandProperty PSChildName | Out-GridView
@exorcistas
exorcistas / autoit-cmd.au3
Created April 23, 2022 19:44
AutoIt function for simple command line I/O
Func RunCommand($_sCommand)
ConsoleWrite(@CRLF & ">> RunCommand: " & $_sCommand & @CRLF)
Local $processId = Run(@ComSpec & " /c " & $_sCommand, "", @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
ProcessWaitClose($processId)
Local $_stdout = StdoutRead($processId)
ConsoleWrite(">> STDOUT: " & $_stdout & @CRLF)
Return $_stdout
EndFunc