FlipsideReality Once upon a time, in a land far far away…

23Oct/090

For loops in dos batch files.

I was trying to shut down a bunch of servers today, and thought I'd do it with a batch file. It (rather embarrassingly) took me a while to remember how to do this, it's been shuch a long time:

@echo off
for %i in (01,02,03,04,05,06,07,08,09,10,11,12,13,14) do shutdown -s -t 00 -m \\BL%i 

I would have used for /L %i in (1,1,14) do ... but there is no way to tell the loop to make 01, 02, 03 instead of 1,2,3

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
13Oct/090

Lynis, auditing tool for *nix

Lynis is a really cool script for checking your machine for vulns. I use it on every server I deploy. It's not a one stop shop for security, but it does give a little piece of mind that you've not overlooked anything.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)