jmbrinkman

Movies As Code

In Powershell, Proxy on March 12, 2012 at 21:12

A friend showed me this wonderfully geeky site: http://moviesascode.net/

The whole idea is to describe movies or movie titles using runnable code! And I’m glad to say that I contributed the first Movie as Powershell : The Sum of All Fears!

I generously stole the basics from Wayne and used powershell to sum up the number of times the string “fear” appears in the King James Bible, times the number of characters in the word “fear”.

The proxy stuff is quite interesting because I had been searching for a code snippet that allowed me to authenticate to ISA/TMG for a while but I guess I needed a touch of silliness to come up with the right search terms. Here’s my adaption of Wayne’s code:

$proxy= Read-Host “Proxy? Yes/No?”

if ($proxy -eq “yes”)
{
$user= $env:USERNAME
$webproxy = Read-Host “Proxy address? (like http://your.proxy.server:8080)”
$pwd = Read-Host “Password?” -AsSecureString
$proxy = New-Object system.Net.WebProxy
$proxy.Address = $webproxy
$account = new-object System.Net.NetworkCredential($user,[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($pwd)), “”)
$proxy.credentials = $account
}

It’ll ask you if you want to use a proxy and if you do then it’ll ask you for a password (it uses the currently logged on user).

Some more code:

Idioms

99 Bottles of Beer

Poetry

This blog has been moved to: http://multiplechoicesystemsengineer.nl/Lists/Posts/Post.aspx?ID=2

Advertisements
  1. […] Movies As Code (multiplechoicesystemengineer.wordpress.com) […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: