Wednesday, December 24, 2008

BlackBerry charging


When you connect your device to charge via USB cable to a Linux desktop it reports back something along the lines of:

"USB charging current is not sufficient. Verify that your handheld is connected to a powered USB charging source and that the proper USB driver is installed."

But if you use the same cable and connect it to the BlackBerry cradle first and then put your device into it, it will charge just fine.

No need to look around for a program that exists somewhere on the net that allows you to up your USB current output :)

Wednesday, December 17, 2008

Quicker cp/mv

Quick way to copy or move a file with less typing:


$ cp test{,.bak}
$ ls
test test.bak


will expand the first non existent parameter (note just the comma in the curly brackets) as the file name test making a copy named test.bak.

Very useful as it allowes you to type less since you have to supply only one argument plus the new file's extension.

Tuesday, December 16, 2008

Monitor dd(1) progress

When using dd(1) on command line you might want to see the speed it is being used at and its progress. This can be done by sending SIGUSR1 signal to the process, like so:

1. start dd: dd if=/dev/urandom of=/dev/zero

2. in another terminal run ps and find the dd's PID and send it SIGUSR1 signal like so:

kill -SIGUSR1 PID

which will output the results but in the first terminal where you started the dd process:

712107+0 records in
712106+0 records out
364598272 bytes (365 MB) copied, 64.4686 s, 5.7 MB/s

You can take this a bit further if the dd process is copying a large file and run it in a while loop at n intervals:


> while :
> do
> kill -SIGUSR1 13925
> sleep 5
> done

Monday, November 10, 2008

Sun's 7000 line of Open Storage appliances

What they offer ?

Smart NAS devices have embedded FISHWorks, which stands for: Fully Integrated Software and Hardware. Complete with SSD drives as storage.

1. The entry-level 7110 is called Iwashi, Japanese for a baby sardine.

2. Mid-range 7210 Fugu product, Fugu being a Japanese pufferfish which is lethally poisonous if prepared incorrectly. Let's not read anything into that.

2. Finally Toro, Japanese for fatty blue fin tuna belly, is the high-end product, the 7410. (the souce for Japanese names was taken from The Register)

Tech spec of 7410 and the types of RAID: Striping, Mirroring, RAID-Z, DP (RAID 5, 6). With DP being NetApp's not standard double parity storage.

Cool stuff: you can get the VMware demo from here to try it out. Or a web based one.

All this is great, but what is this Open in Open Storage ?

The answer lies in this quote from InfoWorld: "Some time after rolling out the NAS appliances, Sun will offer the software components as an "appliance kit" for OEMs (original equipment manufacturers) to build their own products. As an example, Sun pointed to Dell,..."

Theres your answer :)

Estimate the size of tar archive

If you ever need to find out how big your potential tar archive will be without creating it, try this little trick:

tar -cvf - XYZ | bzip2 | wc -c

Where XYZ is a file/directory you want to archive.

Thursday, November 6, 2008

Find out Netbackup's media & master server

Run the following command query Netbackup's Enterprise Media Manager about all the hosts it has visible to it.

/usr/openv/netbackup/bin/admincmd/nbemmcmd -listhost

It would list the media and master server, like so:

server hercules
master hercules

Thursday, October 23, 2008

Strip HTML

In some situations you have a installation instruction file that is in HTML. You want to read it in the console but you don't have links|elinks|lynx installed. What do you do ?

You pass the file through:


sed -e :a -e 's/<[^>]*>//g;/</N;//ba'


I used something like this before but lost it. Hence this blog, I want to keep little useful things like this to re-use.

A very useful way of using this is to bind it to a alias in your .profile as something like striphtml:


alias striphtml="sed -e :a -e 's/<[^>]*>//g;/</N;//ba'"


so that you have it handy. Which you can then use like:

striphtml readme.html | less


The original found here.