Skip to content

Instantly share code, notes, and snippets.

@supercheetah
supercheetah / Uninstall-Universal.ps1
Created January 12, 2016 00:07
Look for all programs containing a search string, and uninstall it.
<#
.SYNOPSIS
Looks for installed applications with a search string to be found in either its
name or the publisher name and uninstalls them.
.DESCRIPTION
It takes a search string (-SearchString) that it uses to look through the names
and publishers for the search string, and uninstalls them.
@supercheetah
supercheetah / Get-SwitchMACInfo.ps1
Last active February 7, 2023 18:06
A PowerShell script to get the MAC address tables from Cisco routers/switches
<#
.SYNOPSIS
This script gets MAC address tables from Cisco routers/switches running IOS using the SSH protocol.
.DESCRIPTION
There's a newer version of this here: https://github.com/supercheetah/winsysadmintools
The script uses the Plink (command line version of PuTTY, http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
to get the output of the command "show mac address-table" and put into a object array (i.e. table) that is outputted to
Out-GridView, and can optionally be saved to a CSV file.
@supercheetah
supercheetah / instposhsshdev
Last active November 25, 2015 14:58 — forked from darkoperator/instposhsshdev
Install Posh-SSH Dev
# this installs it system wide into Program Files
$webclient = New-Object System.Net.WebClient
$url = "https://github.com/darkoperator/Posh-SSH/archive/master.zip"
Write-Host "Downloading latest version of Posh-SSH from $url" -ForegroundColor Cyan
$file = "$($env:TEMP)\Posh-SSH.zip"
$webclient.DownloadFile($url,$file)
Write-Host "File saved to $file" -ForegroundColor Green
$targetondisk = "$($env:ProgramFiles)\WindowsPowerShell\Modules"
New-Item -ItemType Directory -Force -Path $targetondisk | out-null
$shell_app=new-object -com shell.application
@supercheetah
supercheetah / Browse-AD.ps1
Last active July 3, 2022 15:53
Active Directory (AD) PowerShell picker/GUI
function Browse-AD()
{
# original inspiration: https://itmicah.wordpress.com/2013/10/29/active-directory-ou-picker-in-powershell/
# author: Rene Horn the.rhorn@gmail.com
<#
Copyright (c) 2015, Rene Horn
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@supercheetah
supercheetah / Get-CDPInfo.ps1
Created October 30, 2015 20:34
Gets the CDP information from a Windows computer with PowerShell.
<#
.SYNOPSIS
Gets the CDP information from a computer.
.DESCRIPTION
Attempts to get the CDP information from a computer. It automatically downloads tcpdump.exe if it's not already on a computer.
.PARAMETER DeviceNumber
Alias: dn
@supercheetah
supercheetah / line_separator.html
Created May 24, 2013 06:38
A useful little tool for taking a bunch of lines, and changing the new line character to something else in just HTML/JavaScript.
<!DOCTYPE html>
<html>
<head>
<title>Break up lines</title>
<script>
function replace_lines()
{
var raw_input = document.getElementById("inputted_lines").value.split('\n');
var sep = document.getElementById("separator").value;
@supercheetah
supercheetah / possible_kivy_logging_bug.py
Created November 27, 2012 21:37
Using native Python logging seems to cause Kivy to go into an infinite loop
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
import logging
class MyPaintWidget(FloatLayout):
def on_touch_down(self, touch):
# if this is called, this will not exit on close, but instead