This file contains hidden or 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
# SSH Agent Functions | |
# Mark Embling (http://www.markembling.info/) | |
# | |
# How to use: | |
# - Place this file into %USERPROFILE%\Documents\WindowsPowershell (or location of choice) | |
# - Import into your profile.ps1: | |
# e.g. ". (Resolve-Path ~/Documents/WindowsPowershell/ssh-agent-utils.ps1)" [without quotes] | |
# - Enjoy | |
# | |
# Note: ensure you have ssh and ssh-agent available on your path, from Git's Unix tools or Cygwin. |
This file contains hidden or 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
# Loosely based on http://www.vistax64.com/powershell/202216-display-image-powershell.html | |
[void][reflection.assembly]::LoadWithPartialName("System.Windows.Forms") | |
$file = (get-item 'C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg') | |
#$file = (get-item "c:\image.jpg") | |
$img = [System.Drawing.Image]::Fromfile($file); | |
# This tip from http://stackoverflow.com/questions/3358372/windows-forms-look-different-in-powershell-and-powershell-ise-why/3359274#3359274 |
This file contains hidden or 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
################################################################################################################################ | |
# | |
# Script Name : SmoDb | |
# Version : 1.0 | |
# Author : Vince Panuccio | |
# Purpose : | |
# This script generates one SQL script per database object including Stored Procedures,Tables,Views, | |
# User Defined Functions and User Defined Table Types. Useful for versionining a databsae in a CVS. | |
# | |
# Usage : |
This file contains hidden or 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 HiSuckyDevs() { | |
[string]$private:Finger = @" | |
DQoJICAgICAgICAgLyJcDQoJICAgICAgICB8XC4vfA0KCSAgICAgICAgfCAgIHwNCgkgICAgICAgIHwgICB8DQoJ | |
ICAgICAgICB8Pn48fA0KCSAgICAgICAgfCAgIHwNCgkgICAgIC8nXHwgICB8LydcLi4NCgkgL35cfCAgIHwgICB8 | |
ICAgfCBcDQoJfCAgID1bQF09ICAgfCAgIHwgIFwNCgl8ICAgfCAgIHwgICB8ICAgfCAgIFwNCgl8IH4gICB+ICAg | |
fiAgIH4gfGAgICApDQoJfCAgICAgICAgICAgICAgICAgICAvDQoJIFwgICAgICAgICAgICAgICAgIC8NCgkgIFwg | |
ICAgICAgICAgICAgICAvDQoJICAgXCAgICBfX19fXyAgICAvDQoJICAgIHwtLS8vJydgXC0tfA0KCSAgICB8ICgo | |
ICs9PSkpIHwNCgkgICAgfC0tXF98Xy8vLS18DQo= | |
"@ | |
return [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($Finger)) ; |
This file contains hidden or 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
New-Object System.Collections.ObjectModel.Collection["string"] | |
# from msdn | |
#[SerializableAttribute] | |
#[ComVisibleAttribute(false)] | |
#public class Collection<T> : IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable | |
# | |
This file contains hidden or 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
<?php | |
/********************** | |
*@file - path to zip file | |
*@destination - destination directory for unzipped files | |
*/ | |
function unzip_file($file, $destination){ | |
// create object | |
$zip = new ZipArchive() ; | |
// open archive | |
if ($zip->open($file) !== TRUE) { |
This file contains hidden or 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
# This is a super **SIMPLE** example of how to create a very basic powershell webserver | |
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity. | |
# Http Server | |
$http = [System.Net.HttpListener]::new() | |
# Hostname and port to listen on | |
$http.Prefixes.Add("http://localhost:8080/") | |
# Start the Http Server |
This file contains hidden or 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
<# | |
$Metadata = @{ | |
Title = "" | |
Filename = "" | |
Description = "" | |
Tags = "" | |
Project = "" | |
Author = "Janik von Rotz" | |
AuthorContact = "http://janikvonrotz.ch" | |
CreateDate = "yyyyy-mm-dd hh:mm" |
This file contains hidden or 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
#To add more commands, hack them into the $commands array: | |
$commands = @( | |
@{"cmd" = "D:\Documents\Powershell\battwo.bat"; "args" = "yo"}, | |
@{"cmd" = "D:\Documents\Powershell\batone.bat"; "args" = "yo2"} | |
); | |
$jobs = @(); | |
foreach($cmd in $commands) { | |
$startinfo = new-object System.Diagnostics.ProcessStartInfo | |
$startinfo.FileName = $cmd.cmd; |
This file contains hidden or 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
if application "Google Chrome" is running then | |
tell application "Google Chrome" to make new window with properties {mode:"incognito"} | |
else | |
do shell script "open -a /Applications/Google\\ Chrome.app --args --incognito" | |
end if | |
tell application "Google Chrome" to activate |
OlderNewer