This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Checks for and connects to RDP on a given server. | |
.Description | |
This script tests for an open port 3389 (standard Windows RDP), and if it finds it, passes the IP to mstsc.exe. Otherwise it retries indefinitely. Ctrl+C will halt the script. | |
.Parameter ip | |
IP or FQDN of a Windows machine to test. Only takes one argument. | |
.Parameter wait | |
Will assume that the machine is still up, wait until it stops responding (even once), and then try to connect. | |
Good for machines that are about to reboot. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Deck { | |
param([int]$decks=1) | |
$return = Invoke-WebRequest -Uri "http://deckofcardsapi.com/api/deck/new/shuffle/?deck_count=$decks" | |
if ($return.StatusCode -eq 200) {return $return.Content | ConvertFrom-Json} | |
else {break $return.StatusCode} | |
} | |
function Get-Cards { | |
param( | |
[Parameter(ValueFromPipelineByPropertyName,Mandatory)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-StarCitizenManifest { | |
[CmdletBinding(SupportsShouldProcess)] | |
param() | |
$return = Invoke-WebRequest -Uri 'http://manifest.robertsspaceindustries.com/Launcher/_LauncherInfo' -OutFile $env:temp/launcherInfo | |
Get-Content -Path $env:temp/launcherInfo | ConvertFrom-StringData | |
} | |
function Get-StarCitizenFiles { | |
[CmdletBinding(SupportsShouldProcess)] | |
param( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name BetterHangar | |
// @namespace http:\\justpowerdown.com | |
// @version 0.3 | |
// @updateURL https://gist.githubusercontent.com/JPRuskin/4c052f42efb3acd691ad/raw/betterhangar.js | |
// @downloadURL https://gist.githubusercontent.com/JPRuskin/4c052f42efb3acd691ad/raw/betterhangar.js | |
// @description Adds some additional functionality to the Pledges (Hangar) page on RSI | |
// @author @JPRuskin | |
// @match https://robertsspaceindustries.com/account/pledges* | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-SysInternalsTools { | |
[CmdletBinding(DefaultParameterSetName='Update')] | |
param( | |
[Parameter(Mandatory)] | |
$localDirectory, | |
[Parameter(ParameterSetName='Download')] | |
[Switch]$DownloadAll | |
) | |
begin { | |
$localTools = Get-ChildItem $localDirectory -Filter *.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
CURRENT=$(df / | grep / | awk '{ print $5 }' | sed 's/%//g') | |
THRESHOLD=90 | |
LOGFILE=~/Scripts/DiskReport.log | |
echo "Last Run: $(date "+%d%m%Y %T") : $CURRENT% Used." > $LOGFILE | |
if [ "$CURRENT" -gt "$THRESHOLD" ] ; then | |
ssmtp -s 'Disk Space Alert' [email protected] << EOF | |
Root partition remaining free space is critically low. Used: $CURRENT% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Begins an Azure DirSync. | |
.Description | |
Contains a function that will connect to a server (defaulting to ADFS01), load the Azure DirSync profile, and kick off a sync. | |
Prompts for creds regardless of account, but can be given credentials to use. | |
.Parameter server | |
The server to connect to. Defaults to ADFS01. | |
.Parameter Credential | |
Credentials to try connecting to the server with. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, re | |
from datetime import datetime | |
if sys.argv[1].lower().endswith(".qif"): | |
redate = re.compile("D\d{2}\/\D{3}\/\d{4}") | |
with open(sys.argv[1], "r") as infile: | |
print("Now reading "+infile.name+"...") | |
with open(sys.argv[1][:-4]+"_converted.qif", 'w') as outfile: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Export-HashTable { | |
param( | |
[Parameter(Mandatory, ValueFromPipeline)] | |
[Alias('InputObject')] | |
[PSObject]$HashTable, | |
[String]$Path, | |
[String]$Name | |
) | |
process { | |
$divWidth = ($HashTable.Keys.Length | Measure-Object -Maximum).Maximum + 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-ScriptFunctions { | |
<# | |
.SYNOPSIS | |
Lists all functions within a script or scriptblock. | |
.DESCRIPTION | |
Uses AST to retrieve all functions from a valid script file or | |
scriptblock, then outputs them all. Useful for dot-sourcing | |
functions from a file that also contains running code. |
OlderNewer