Saturday, December 13, 2008

Remove selected items from listview in C#

I killed some time figuring this out myself though the solution was there on the first link given out by google..

thanx to the guy who posted this one..

list is a listview here...

while (list.SelectedItems.Count > 0)
{
list.Items.Remove(list.SelectedItems[0]);
}

vaibhav

Monday, December 8, 2008

How to find file system disk space in linux

My linux VM started showing me that it ran outof space... So I tried to figure out what is the space left over... so I found this on the man page of df command...

df - report file system disk space usage

Show information about the file system on which each FILE resides, or all file systems by default.

Mandatory arguments to long options are mandatory for short options too.

-a, --all
include dummy file systems

-B, --block-size=SIZE use SIZE-byte blocks

-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)

-H, --si
likewise, but use powers of 1000 not 1024

-i, --inodes
list inode information instead of block usage

-k like --block-size=1K

-l, --local
limit listing to local file systems

--no-sync
do not invoke sync before getting usage info (default)

-P, --portability
use the POSIX output format

--sync invoke sync before getting usage info

-t, --type=TYPE
limit listing to file systems of type TYPE

-T, --print-type
print file system type

-x, --exclude-type=TYPE
limit listing to file systems not of type TYPE

-v (ignored)

--help display this help and exit

--version
output version information and exit

SIZE may be (or may be an integer optionally followed by) one of following: kB 1000, K 1024, MB
1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.


n thats what my VM gave me :)

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 3945128 3945112 0 100% /
none 385124 0 385124 0% /dev/shm

//14.4.2.55/CodePart
117218300 58824100 58394200 51% /mnt/myshare


vaibhav