Skip to content

Instantly share code, notes, and snippets.

@PSingletary
PSingletary / ScanMedia.md
Created December 6, 2020 22:39 — forked from Desani/ScanMedia.md
3.2 - bugfix and New Major Update 3.0 - Massive re-write and new feature introduction with new User Menu Interface

This script utilizes ffmpeg, the same tool Plex uses, to decode the video stream and captures the output for any errors during playback and sends the playback errors to a log file. So essentially it plays the video in the background faster than regular speed. It then checks the error output log file to see if there is anything inside. If ffmpeg was able to cleanly play the file, it counts as a passed file. If there is any error output, an error could be anything from a container issue, a missed frame issue, media corruption or more, it counts the file as failed. So if there would be an issue with playback and a video freezing, it would be caught by this method of checking for errors. Because of the nature of the error log, any errors that show up, even simple ones, will all count as a fail and the output is captured so you can view the error log. Some simple errors are easy to fix so I have included an auto-repair feature which attempts to re-encode the file which is able to correct some issues that would cau

@PSingletary
PSingletary / twittermute.txt
Created January 26, 2020 02:58 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@PSingletary
PSingletary / slideshare-dl.py
Created August 1, 2019 20:04 — forked from julionc/slideshare-dl.py
slideshare-dl is a small command-line program for downloading slides from SlideShare.net
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
slideshare-dl.py
~~~~~~~~~~~~~~~~
slideshare-dl is a small command-line program
for downloading slides from SlideShare.net
$URLs = "https://aka.ms/wsl-ubuntu-1804" ,"https://aka.ms/wsl-ubuntu-1804-arm" ,"https://aka.ms/wsl-ubuntu-1604" ,"https://aka.ms/wsl-debian-gnulinux" ,"https://aka.ms/wsl-kali-linux" ,"https://aka.ms/wsl-opensuse-42" ,"https://aka.ms/wsl-sles-12"
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'Stop'
Foreach($URL in $URLs){
$Filename = "$(Split-Path $URL -Leaf).appx"
Write-Host "Downloading: $Filename" -Foreground Yellow -NoNewline
try{
Invoke-WebRequest -Uri $URL -OutFile $Filename -UseBasicParsing
Add-AppxPackage -Path $Filename
$URL = 'https://aka.ms/wsl-ubuntu-1804'
$Filename = "$(Split-Path $URL -Leaf).appx"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $URL -OutFile $Filename -UseBasicParsing
Invoke-Item $FileName
@PSingletary
PSingletary / mklink.psm1
Created April 3, 2019 14:58 — forked from jpoehls/mklink.psm1
Native PowerShell wrapper for MKLINK.
@PSingletary
PSingletary / Get-Something.ps1
Created February 12, 2019 20:20 — forked from jdhitsolutions/Get-Something.ps1
My PowerShell function template for getting information from remote computers. The file also contains a json entry for a PowerShell snippet in VSCode.
Function Get-Something {
<#
.SYNOPSIS
Get something
.DESCRIPTION
Describe what this does.
Many of the parameters are the same as in Invoke-Command.
@PSingletary
PSingletary / BoxPrompt.ps1
Created January 19, 2019 00:16 — forked from jdhitsolutions/BoxPrompt.ps1
A fancy PowerShell prompt function that should work cross-platform. See script comments for more information.
#requires -version 5.1
<#
Create a lined box with user and location information. The line color will indicate if the user is running elevated.
The prompt will also display the current date and time and a PS prompt with the PowerShell version.
┌─────────────────────────┐
│ [BOVINE320\Jeff] D:\iso │
└─────────────────────────┘
[01/18/2019 09:30:53] PS v6.1.2>
@PSingletary
PSingletary / Script-Template-WithCreds.ps1
Created January 10, 2019 18:42 — forked from davefunkel/Script-Template-WithCreds.ps1
PowerShell Script Template with Saved Creds
<#
.SYNOPSIS
The synopsis goes here. This can be one line, or many.
This version of the template has inbuilt functions to capture credentials and store it securely for reuse
Avoids the need to have plaintext passwords in the script
.DESCRIPTION
The description is usually a longer, more detailed explanation of what the script or function does.
Take as many lines as you need.
@PSingletary
PSingletary / Get-ProcessMemory.ps1
Created December 28, 2018 21:23 — forked from jdhitsolutions/Get-ProcessMemory.ps1
A PowerShell function to display a snapshot of process memory usage based on the workingset value. The file includes a format.ps1xml file.
Function Get-ProcessMemory {
<#
.SYNOPSIS
Get a snapshot of a process' memory usage.
.DESCRIPTION
Get a snapshot of a process' memory usage based on its workingset value. You can get the same information using Get-Process or by querying the Win32_Process WMI class with Get-CimInstance. This command uses Invoke-Command to gather the information remotely. Many of the parameters are from that cmdlet.
Technically you can use wildcards with process names, but because of how the function aggregates data, you might not see the results you expect.
.EXAMPLE
PS C:\> get-processmemory code,powershell,powershell_ise