Aug 12 2008

Is there du in Windows?

Published by Lord TCT under Powershell

Answer: Yes there is! Prodigy Mark Russinovich wrote the Windows counterpart of UNIX’s indispensable du command called, uhm, du: http://technet.microsoft.com/en-us/sysinternals/bb896651.aspx

Copy du.exe to %Windir%/System32. (The /usr/bin equivalent of Windows).

To obtain the size of top level subdirectories in a directory, with the largest on first in Bash@Linux, we type:

du –max-depth=1 | sort -r

The equivalent for Powershell@Windows would be:

du -q -l 1 | sort -descending

What I would really like to see is Mark’s du.exe be able to return directory sizes in well, “human readable formats”: KiB, MiB, GiB, TiB etc etc. In UNIX’s du, the argument -h does the job.

Aug 11 2008

Grep-ing in Powershell

Published by Lord TCT under Powershell

UNIX users who are so used to grep would ask “how do I grep in Powershell?”. Here’s how:

In Bash we write:

ls | grep “.aspx”

The equivalent in Powershell would be:

ls | where {$_ -match “.aspx”}

Bash@Linux output:

[root@gw-1 easilogin]# ls -all | grep ".aspx"
-rwxrwSrwt 1 root root   682 Jul 29 20:38 AccountBanned.aspx
-rwxrwSrwt 1 root root    77 Jul 29 20:38 AccountBanned.aspx.vb
-rwxrwSrwt 1 root root  2320 Jul 29 20:38 CodeAuthentication.aspx
-rwxrwSrwt 1 root root  1623 Jul 29 20:38 CodeAuthentication.aspx.vb
-rwxrwSrwt 1 root root  1459 Aug  1 14:25 ForgetPassword.aspx
-rwxrwSrwt 1 root root  3563 Aug  1 14:25 ForgetPassword.aspx.vb
-rwxrwSrwt 1 root root  2888 Jul 29 20:38 login.aspx
-rwxrwSrwt 1 root root  8298 Jul 29 20:38 login.aspx.vb
-rwxrwSrwt 1 root root    98 Jun 23 12:54 logout.aspx
-rwxrwSrwt 1 root root  2864 Aug  3 21:12 My_Account.aspx
-rwxrwSrwt 1 root root  1704 Aug  3 21:12 My_Account.aspx.vb
-rwxrwSrwt 1 root root   475 Jul 29 20:38 NotAuthenticated.aspx
-rwxrwSrwt 1 root root    78 Jul 29 20:38 NotAuthenticated.aspx.vb

Powershell@Windows2008 output:

PS Microsoft.PowerShell.Core\FileSystem::\\192.168.1.11\inetpub\wwwroot\easilogin> ls | where {$_ -match ".aspx"}

Directory: Microsoft.PowerShell.Core\FileSystem::\\192.168.1.11\inetpub\wwwroot\easilogin

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---         7/29/2008   8:38 PM        682 AccountBanned.aspx
-a---         7/29/2008   8:38 PM         77 AccountBanned.aspx.vb
-a---         7/29/2008   8:38 PM       2320 CodeAuthentication.aspx
-a---         7/29/2008   8:38 PM       1623 CodeAuthentication.aspx.vb
-a---          8/1/2008   2:25 PM       1459 ForgetPassword.aspx
-a---          8/1/2008   2:25 PM       3563 ForgetPassword.aspx.vb
-a---         7/29/2008   8:38 PM       2888 login.aspx
-a---         7/29/2008   8:38 PM       8298 login.aspx.vb
-a---         6/23/2008  12:54 PM         98 logout.aspx
-a---          8/3/2008   9:12 PM       2864 My_Account.aspx
-a---          8/3/2008   9:12 PM       1704 My_Account.aspx.vb
-a---         7/29/2008   8:38 PM        475 NotAuthenticated.aspx
-a---         7/29/2008   8:38 PM         78 NotAuthenticated.aspx.vb

Jun 29 2008

Case of USB 2.0 vs. IEEE 1394

Published by Lord TCT under General

The case:With newer hardware and better implementations, USB 2.0 challenges IEEE 1394 (aka Firewire) once again in the ultimate test of speed….who will prevail in the end?
Continue Reading »

Jun 29 2008

Case of the RM150 DVD Player

Published by Lord TCT under General

For just RM150/£24/US$47, you could get this “ultimate” all in one DVD player that sports “Dolby AC3 and dts decoding” and ”High definition video output” using “Japanese imported microcomputer controller” from a company in Shen Zhen, China, known as Maike (迈科).

But does this DVD player lives up to its claims?

Continue Reading »

Jun 17 2008

Firefox 3 Released

Published by Lord TCT under Internet

Open source foundation Mozilla.org has released the highly anticipated 3rd major update to its popular free browser, Firefox.

The new Firefox 3.0 sports over 10,000 fixes and enhancements that will improve the security, performance and usability of this open source browser…at least according to its creators.

In addition, Mozilla.org has also pledged fans worldwide to download Firefox 3.0 from its official sites in order  claim “Most downloaded Internet software in 24 hours” title in the Guiness Book of Records.

Download Day - English

Continue Reading »

Next »