Skip to content

Instantly share code, notes, and snippets.

View PSingletary's full-sized avatar
🔍
Search

PSingletary PSingletary

🔍
Search
View GitHub Profile
@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 / PSTemplate.ps1
Created January 11, 2020 19:30
Writitng a Powershell Script? Need a Template? Start Here
#Requires -version 2
#Requires -RunAsAdministrator
<#
.SYNOPSIS
<A brief description of the function or script. This keyword can be used only once in each topic.>
.DESCRIPTION
<A detailed description of the function or script. This keyword can be used only once in each topic.>
.PARAMETER <Parameter-Name>
(77,101,114,114,121,32,67,104,114,105,115,116,109,97,115,32,97,110,100,32,97,32,72,97,112,112,121,32,78,101,119,32,89,101,97,114 | ForEach-Object {[char][byte]$psitem}) -join ''
@PSingletary
PSingletary / Create-ByteArray.ps1
Created December 27, 2019 16:20
How to convert a string to a byte array and convert a byte array to a string - source: http://www.geekswithblogs.net/TimH/archive/2005/06/27/44849.aspx
System.Text.Encoding enc = System.Text.Encoding.ASCII;
byte[] myByteArray = enc.GetBytes("a text string");
string myString = enc.GetString(myByteArray );
@PSingletary
PSingletary / Holiday-Cheer.ps1
Created December 6, 2019 20:56
2014-12-23 a quick script to make a windows speak then play random music
Add-Type -AssemblyName presentationCore
Add-Type -AssemblyName System.speech
$mediaPlayer = New-Object system.windows.media.mediaplayer
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
$files = Get-ChildItem -path $path -include *.mp3 -recurse
#$speak.Rate = -10 # -10 to 10; -10 is slowest, 10 is fastest`
$speak.Speak("Ho Ho Ho")
$mediaPlayer.open([uri]"$(Get-Random -InputObject $files)")
$mediaPlayer.Play()
#Start-Sleep -Seconds 30
@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
function Invoke-Ping {
<#
.SYNOPSIS
Ping or test connectivity to systems in parallel
.DESCRIPTION
Ping or test connectivity to systems in parallel
Default action will run a ping against systems
$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
Add-ADGroupMember -Identity 'New Group' -Members (Get-ADGroupMember -Identity 'Old Group' -Recursive)