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
# Show current date/time as a UNIX timestamp | |
date +%s | |
# Show the timestamp for an arbitrary date/time | |
date -d '01/12/2013 16:42:13' +%s | |
# Convert a timestamp to a date/time | |
date -d @1357962133 |
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 Get-UserAgent { | |
# Uses PowerShell's prebuilt UA strings. See | |
# http://goo.gl/9IGloI | |
param ( | |
[ValidateSet('Firefox','Chrome','InternetExplorer','Opera','Safari')] | |
[string]$browsertype | |
) | |
if (!$browsertype) { | |
$browsers = @('Firefox','Chrome','InternetExplorer','Opera','Safari') |
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 Get-Screenshot ($url) { | |
$apiKey = 'Your-API-key' | |
$secret = 'Your-Secret' | |
$urlpart = '?apikey=' + $apiKey + '&url=' + $url | |
[Void][Reflection.Assembly]::LoadWithPartialName("System.Web") | |
$token = ([System.Web.Security.FormsAuthentication]::HashPasswordForStoringInConfigFile($urlpart + $secret, 'MD5')).tolower() # Won't work if upper case | |
$requrl = 'http://www.url2picture.com/Picture/Png' + $urlpart + '&token=' + $token | |
Write-Output $requrl |
NewerOlder