Wednesday, November 28, 2007

Fun with JavaScript

This is a JavaScript I found while stumbling.
It works like this. Just search for an image in Google. Once it shows up images as the result of your search, enter the script (without quotes) in the address bar of your browser. It will rotate the images around. If you keep pressing enter again and again, the speed of rotation keeps increasing as well.

Thursday, August 9, 2007

UltraSparc T2 : Mainframe-on-a-chip?

In my previous post, I wondered whether Niagara 2 (ULtraSparc T2) could run 64 different OS instances or were they just Solaris Zones (containers). It is confirmed that it could indeed run 64 OS instances using LDom built-in technology in T2. I found this Sun blog post that demonstrates 64 instances of Solaris running in 64 T2 threads. In another post it goes further and shows Solaris and Ubuntu running simultaneously. That makes T2 one helluva multicore chip!

Wednesday, August 8, 2007

Niagara 2 i.e. UltraSparc T2

It's very sad that most of the processor news in the world is confined to x86 only. When I commented on processors last year, I mentioned Niagara chip ie UltraSparc T1. Now Sun has come out with the second version of the energy efficient Niagara 2, officially named UltraSparc T2. With 8 cores in the chip and 8 threads per core it will have a total of 64 hardware threads. The 8 threads in each core would run in an I/O multiplexed way i.e. at any time only 1 thread can run and another thread will switch in if the running thread enters I/O cycle. That means at any point of time, 8 threads will be running simultaneously in the chip. UltraSparc T1 was similar but had 4 threads per core, for a total of 32 threads.

From the webcast on Sun's page, I found the following interesting information on T2 chip:

One major difference between T2 and T1 is that T2 has a floating point unit on each core. T1 had one such unit for the entire chip that made it practically useless for floating-point intensive tasks. T2 thus seems to have taken care of that limitation. T2 threads run at 1.4 GHz.

For crypto intensive tasks there is a cryptographic processor unit on each core. Also, there are two PCI express I/O ports on the chip as well as integrated 10 Gb Ethernet.

Sun aims to sell this chip to other vendors as well if they want to use it in their servers. This is a departure from its earlier policy where it used its chips only in its servers and sold those servers.

This chip seems great for multi-threaded applications written in languages such as Java.

One thing that was funny in the webcast was that T2 was getting marketed as the fastest processor at 89.6 GHz. It was simply calculated by multiplying 64 by 1.4 GHz.
It was like saying a train with 10 coaches running at 100 miles/hr the fastest vehicle at 1000 km/hr!

A few times during the webcast it was mentioned that 64 Operating systems could run simultaneously in 64 threads due to LDom technology. I think they were talking about zones, and not really different OS's. Or is it possible to really run different OS's in that way? I think not but correct me if I am wrong.

UltraSparc T2 sure is a great chip with energy efficiency and should give good throughput for well written applications, at a very low form-factor in a data center.

Sunday, August 5, 2007

Preventing Gmail cookie stealing

There has been a news of a vulnerability from the use of cookies by email sites like Gmail at Wi-Fi hotspots. Cookies can be stolen by using sniffing softwares and entire session can be hijacked to do malicious things on the target accounts. A simple method to stop such attacks is to use SSL for the entire session, not just for login that gmail does by default. A nice add-on from CustomizeGoogle can be used for making sessions use SSL. In addition, there are many other cool features we get on installing this add-on to Firefox browser. These features can be selected from Tools menu of Firefox and includes options such as making ads invisible in gmail and google search results. Also, links to search results from Yahoo and other popular search engines can be added for the same search string in Google search.

Wednesday, July 25, 2007

Find specific files like mp3 from Google search

It seems old tip but I found this only recently. To search files like mp3 or other smaller files from Google - e.g. if you want to find mp3 for a certain song, say, "hips don't lie", do

intitle:index.of + "mp3" + "hips don't lie"

To get results having no *.htm or *.html files, you can do

intitle:index.of + "mp3" + "hips don't lie" -htm -html

The results give a lot of locations to download the files from, sites that are normally hard to find.


Monday, June 18, 2007

SysAdmin mag & How to write unmaintainable code

June's issue of SysAdmin magazine, has some interesting Q&A's on Solaris. Questions on superblock, alternative methods for patching, etc. are given along with answers. It can be read here


Found this hilarious take on unmaintainable code written some time back when it was slashdotted:

Saturday, June 16, 2007

Which "for loop" works better/faster

I was asked this question in an interview long ago and thought I would post it here.
Which of the following for loop works better assuming no special compiler play, just on programming logic. Will both code pieces execute equally fast?

1 -
for ( i=0; i <10; i++)
for (j=0; j<100; j++)
printf("hello\n");


2 -
for (j=0; j<100; j++)
for ( i=0; i <10; i++)
printf("hello\n");

Thursday, June 14, 2007

Linus likes ZFS, but

Online world is abuzz with discussions on the mail that Linus Torvalds sent to lkmk.org with some seemingly incendiary anti-Sun remarks, and a more cool-headed response by the Sun CEO Jonathan Schwartz. It has sent all the Paris Hilton front page stories down to page 5 to bite the dust. Some things this all seems to imply:

- OpenSolaris has surely begun to ruffle some feathers; even Linus says OpenSolaris' ZFS is something which could make Linux to change its license. That is something!

- The only thing most Linux developers including Linus think OpenSolaris needs Linux for are drivers. Does it imply that if a user can get a machine working with OpenSolaris, there'd be no need to install Linux?

- Linux users want ZFS. Linux developers have started to realize its importance as a Filesystem, but are diverting the issue with licensing and patent issues. Why not directly talk to Sun and implement the stuff? Surely. if FreeBSD and Mac OS X can implement it, so can Linux. It could be that it is harder to port it to Linux and the developers have become lazy.

- Somehow Linus seems to know that "Linux code is _better_". Does it mean he already has peeked into OpenSolaris code and compared it with the Linux before coming to conclusion? That is interesting, and as illuminating as his assertion.

I have a great respect for Linus as is evidenced by one of my earlier posts. But mails like this are uncharacteristic of him. I even feel that it could have been rebuked as FUD-spreading if it had come from someone other, say Microsoft. Hopefully, in the future, Linux and OpenSolaris will be living at peace and users will have choice of an OS not dictated by the license.

Wednesday, June 13, 2007

ZFS flavor of the month

A week after Sun CEO Jonathan Schwartz commented that ZFS would be in Leopard, an Apple executive said, "ZFS is not happening", when questioned about ZFS's inclusion in Leopard. Without ZFS announcement in the Apple WWDC, Mac developers would be disappointed and some reporters said they felt sleepy during the keynote.

(Update : Apple has denied the executive's claims and is clarifying that ZFS will be available as a limited option in OS X. See comments on the original story for details.)

ZFS seems to be flavor of the month. While many were expecting Apple to announce it was adding ZFS to Mac OS X, it doesn't seem likely after reading the Apple executive's comment. At least not in the forthcoming release.

In other news, ZFS was reviewed very positively in an InfoWorld article. The editor reviewing the ZFS was all praise for it. "It’s not every day that the computer industry delivers the level of innovation found in Sun's ZFS. More and more advances in the science of IT are based on simply multiplying the status quo. ZFS breaks all the rules here, and it arrives in an amazingly well-thought-out and nicely implemented solution."
Ok that makes up for "late by a year review." One thing that I've observed is that though Sun says ZFS doesn't stand for Zettabyte File System anymore, most reporters still make it a point to expand ZFS that way.

Then, eWEEK gave an Excellence award to ZFS in the E-Business Foundations category. ZFS deserves many such awards and kudos. It has made a big difference in the world of File systems.


Steps to install PyTorch on VMware workstation (Ubuntu guest)

  The following is the list of steps to install pytorch 2.0 in VMware workstation (Ubuntu guest): $ mkdir ~/pytorch $ mkdir ~/pytorch/as...