Author Topic: What have you learned today?  (Read 1242 times)

Afasoas

What have you learned today?
« on: 24 October, 2014, 03:33:47 pm »
A thread for your recently acquired valuable snippets of IT related knowledge.

Today I've learned that Windoze PowerShell* scripts/functions can handle switches as well as parameters.

Code: [Select]
Param(
    [switch]$R
    )

if($R) {
    write-host "I need to re-write this to do something when -R is specified"
}

Code: [Select]
PS C:\Users\$myUser> D:\code\Common\Powershell\myScript.ps1 -R
I need to re-write this to do something when -R is specified
PS C:\Users\$myUser>

*necessary evil

Re: What have you learned today?
« Reply #1 on: 24 October, 2014, 03:51:13 pm »
dd if=/dev/urandom of=/dev/sdX

will take until the sun cools down to complete on a hard drive of modern capacity. Unless you are going to be carrying military grade secrets around on your hard drive its just not worth it.
I think you'll find it's a bit more complicated than that.

tiermat

  • According to Jane, I'm a Unisex SpaceAdmin
Re: What have you learned today?
« Reply #2 on: 24 October, 2014, 06:38:15 pm »
dd if=/dev/urandom of=/dev/sdX

will take until the sun cools down to complete on a hard drive of modern capacity. Unless you are going to be carrying military grade secrets around on your hard drive its just not worth it.

Use bs=1024
I feel like Captain Kirk, on a brand new planet every day, a little like King Kong on top of the Empire State

Afasoas

Re: What have you learned today?
« Reply #3 on: 03 November, 2014, 04:25:21 pm »

Re: What have you learned today?
« Reply #4 on: 18 April, 2015, 02:23:59 pm »
There is an ISO for brewing tea!

https://en.wikipedia.org/wiki/ISO_3103
Get a bicycle. You will never regret it, if you live- Mark Twain

Zipperhead

  • The cyclist formerly known as Big Helga
Re: What have you learned today?
« Reply #5 on: 18 April, 2015, 06:15:04 pm »
dd if=/dev/urandom of=/dev/sdX

will take until the sun cools down to complete on a hard drive of modern capacity. Unless you are going to be carrying military grade secrets around on your hard drive its just not worth it.

Use bs=1024

bs=1024m
Won't somebody think of the hamsters!

tiermat

  • According to Jane, I'm a Unisex SpaceAdmin
Re: What have you learned today?
« Reply #6 on: 18 April, 2015, 07:01:02 pm »
dd if=/dev/urandom of=/dev/sdX

will take until the sun cools down to complete on a hard drive of modern capacity. Unless you are going to be carrying military grade secrets around on your hard drive its just not worth it.

Use bs=1024

If you have more than a gig of free memory, yes. The idea is that, if you don't specify block size did will try to fill the disk in one fell swoop, using swap space to hold the contents of /dev/urandom. Obviously, if the disk is big it will lead to lots of disk thrashing.

bs=1024m
I feel like Captain Kirk, on a brand new planet every day, a little like King Kong on top of the Empire State

Re: What have you learned today?
« Reply #7 on: 18 April, 2015, 08:57:03 pm »
There is a god mode for win 7 (and 8 apparently).
Get a bicycle. You will never regret it, if you live- Mark Twain