Skip to content

Instantly share code, notes, and snippets.

@Xeckt
Xeckt / PrintSpoolFixer.ps1
Last active November 21, 2022 13:39
Clear that pesky printer spool when the queue is just too large!
#Requires -Version 7.3
$global:UserInput = $null
$global:PrintPipelineProcess = "printfilterpipelinesvc"
$global:PrintPipelineExe = "C:\Windows\System32\printfilterpipelinesvc.exe"
$global:SpoolerService = "spooler"
$global:SpoolDirectory = "C:\Windows\System32\spool\PRINTERS"
$global:CurrentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
function GetItemsInQueue() {
@suntong
suntong / go_io-read_packages.md
Last active July 20, 2022 09:32
[go-nuts] Differences between os, io, ioutils, bufio, bytes (with Buffer type) packages for file reading

http://grokbase.com/t/gg/golang-nuts/142spmv4fe/go-nuts-differences-between-os-io-ioutils-bufio-bytes-with-buffer-type-packages-for-file-reading

I'm quite confused as there seems to be multiple redundant ways to solve my problem (read a file, parse the content, serve it via http). Most people on stackoverflow would use bufio, but I just can't get the differences between this package and the Buffer type of bytes and just reading a file with the os methods. Also I don't know when and why I should choose those ways to do it, when I have the simple, but non-versatile, ioutils.ReadFile.