Operating Systems - Unix, Linux, MacOS X, Windows,Operating Systems - Unix, Linux, MacOS X, Windows,A blog on Operating systems like Unix and Linux and Programming.
Articles:
1, 2
Articles
Fun with JavaScript
2007-11-28 18:04:00 This is a Java Script 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. More About: Javascript
UltraSparc T2 : Mainframe-on-a-chip?
2007-08-09 16:11:00 In my previous post, I wondered whether Niagara 2 (ULtraSpar c 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! More About: Ultra , Chip , Mainframe
Niagara 2 i.e. UltraSparc T2
2007-08-08 15:07:00 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 UltraSpar c 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 intens...
Preventing Gmail cookie stealing
2007-08-04 21:15:00 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. More About: Vent , Stealing , Eventing
Find specific files like mp3 from Google search
2007-07-24 20:50:00 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", dointitle:index.of + "mp3" + "hips don't lie" To get results having no *.htm or *.html files, you can dointitle:index.of + "mp3" + "hips don't lie" -htm -htmlThe results give a lot of locations to download the files from, sites that are normally hard to find. More About: Search , Google Search , Find , Files
SysAdmin mag & How to write unmaintainable code
2007-06-18 17:40:00 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 hereFound this hilarious take on unmaintainable code written some time back when it was slashdotted: More About: Write , Code
Which "for loop" works better/faster
2007-06-16 14:04:00 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 for (j=0; jprintf("hello ");2 - for (j=0; jfor ( i=0; i printf("hello "); More About: Works , Bett , Loop , Aster
How file recovery software works
2007-06-15 01:33:00 I discussed about a File recovery tool in one of my earlier posts and deferred the discussion on how such tools work for some future post. Today I will discuss how file recovery software actually works.Files in a computer have a volume table (directory table) that contains, among other things, an entry for each file in the hard disk along with the address of the location where the file is stored. When a file is deleted, a small part of the table for that entry is modified marking the space as free. The data still remain in the disk until it is overwritten at some later time. Now two possibilities arise:1) The table entry for a deleted file is intact. In this case, it will still contain the pointer to the file. A quick reading of volume table by the file recovery software followed by looking at the location for the file may recover data if it is not overwritten by that time. This is QuickScan option in the tool in the figure of earlier post.2) The table entry itself is overwritten, ... More About: Software , Recovery , Works
Linus likes ZFS, but
2007-06-14 01:35:00 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:- Open Solaris 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 tha... More About: Like
ZFS flavor of the month
2007-06-12 20:48:00 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... More About: Flavor , Month , Mont
Informative slide
2007-06-11 21:27:00 From the net: More About: Internet , Slide , Informative , Form , Format
Creating a dynamic library - example
2007-06-05 01:58:00 We all use library functions in the programs we write. An example of library that is always used in Solaris and Unix like Operating systems is libc.so. But how to create a library? It is not hard. A dynamic library can be easily created as shown in the following example.Let's say we want to create a library called libgeek.so. It will contain an example function called my_library_func() that we will use in our program. We will create a simple program called geek.c that has the function we wanted. We will compile this as a library and call it libgeek.so (library names begin with lib) :$ cat geek.cmy_library_func(){ printf("Inside my library function");}The above is a library function we wanted to create. We then compile it into a dynamic library by giving a -G option to compiler :$ cc -o libgeek.so -G geek.cNow, we can use the generated library libgeek.so in our programs like:$ cat hellolibrary.cint main(){ my_library_func(); return 0;}Now, we can compile our program and tell the ... More About: Library , Creating , Eating , Dynamic
Active File Recovery tool
2007-06-03 15:09:00 Today, I'll talk about a tool for Windows. Under Windows, [Shift]+[Delete] deletes files without sending them to recycle bin, so we can't get it back. Similarly, if a disk is formatted, the data is lost and we can't get it back, normally. Data loss can also be a result of virus attack. Well, the data itself is not lost. We can actually recover data that is accidentally or unintentionally deleted. How a data is actually not lost, and how it can be recovered in theory will be a topic of some future post. Today I will review a product that practically recovers lost or deleted data from a PC with Windows Operating System.This product is called Active File Recovery and it recognizes the most common types of file and filesystems to recover.There is a demo version of the software that one can download and try. It recovers files of only upto 65 KB. The full version has no size limit on the files it can recover. I downloaded the demo version for this sponsored review to see how it works. ... More About: Tool
Firefox Add-on - Split browser
2007-06-02 12:20:00 I've recently started using Split browser Add-on for Firefox browser and am greatly impressed with it. It adds value to my browsing experience. No need to switch to another tab when I want to reference something in a different page. I can look at both pages together by splitting the current browser window in any way I want - Left, Right, Top, Bottom. Once done, I can gather all the split windows to old style tabs. Tab that is currently open can also be split horizontally or vertically.On a related note, I un-installed the Cooliris Add-on I had installed about a month ago. While it did look useful in the beginning, it was becoming too obtrusive and an annoyance, especially when there were links very near to each other. Trying to open a link would bring up a preview of another link. Also, I was using it less and less. Good-bye Cooliris, Hi, Split broswer! More About: Internet , Browser
How to find address of stack top : C
2007-06-01 20:27:00 In technical interviews, sometimes candidates are asked how they would find the address of the top of the stack in their system by programming in C. One simple program that should work mostly is:int main(){ int i; printf("Top of the stack is %p", &i); return 0;}As local variables are stored on stack, this would give an approximate top of stack. There can be variations of this program that are also few-liners like above and give more accurate results. Any more example piece of code to find stack top? More About: Find , Address
LaMacchia Loophole
2007-05-30 14:41:00 Year 1993. A 21 year-old student at MIT named David LaMacchia set up a bulletin board system called "Cynosure." It generated a lot of traffic worldwide. People used this service to download software they wanted or upload what they had. It was online for about six weeks before being taken down by the authorities. Software companies claimed that they lost one million dollars from Cynosure. Federal grand jury charged LaMacchia with 'one count of conspiring with unknown persons to violate the wire-fraud statute'. What LaMacchia did wasn't criminal conduct under the Copyright Act. The infringement was not for the purpose of commercial advantage. So, the charge was dismissed . The lawmakers had not thought that someone might engage in these types of activities with a non-financial motive. In 1997, Congress closed this loophole with NET (No Electronic Theft) Act. More About: Internet , Hole , Loop , Lama , Chia
No archives (*.a ) in Solaris anymore
2007-05-27 16:41:00 While discussing static libraries in one of my previous posts, I commented that libm is provided as both dynamic library ( libm.so ) as well as static archive ( libm.a ).Well, that is not true for Solaris anymore. Solaris 10 doesn't ship with a single static library.Doingls -la |grep *.ain /usr/lib where libraries are usually present returned no results. Tried in some more directories with same result.I don't know when static libraries were dropped from Solaris. My guess is that it was Solaris 10, but any pointers to information would be welcome. More About: Unix , Archives , Chives , Hives
FLV to MPEG converter
2007-05-26 21:46:00 Many times we come across videos on net we want to download but can't as they are in FLV format/flash video. There is an online opensource tool to download such online videos from sites such as YouTube. The tool converts the FLV files into MPEG format online, which can then be saved to a computer. The online FLV converter is a very useful tool. I downloaded this hilarious video clip from YouTube using this online tool.The quality of download was very good and it was fast. Try it out! More About: Internet , Converter , Vert
Wanted computer engineers
2007-05-25 15:41:00 Found this fun advertisement on net today: More About: Computer , Engineers , Engineer , Wanted
Clicky Web Analytics - a good web analysis tool
2007-05-23 15:10:00 I've been using Clic ky Web Analytics for my blog for about 6 months now and have been very satisfied. It's been a great tool to gather data on the visits to my blog. I'm using the basic free service from them which has many unique features that are not present in other services such as Google Analytics or Feedburner.It has most of the features expected in an analytic tool and many more. I can see how many people have visited my site, at what time, from what IP address, from which country and city (can also see that on a google map), which browser and Operating System they used, which website they came from, which pages they visited, what actions were performed by them on the blog and how long they stayed on my blog. I can also see how many people have come through search and what search keywords were used.The display for Clicky website is pretty neat. I can see the referral websites in a descending order in time for any given day. The history of all visits is saved for two weeks ... More About: Analysis , Tool , Good
Static linking : library options in command line
2007-05-19 15:25:00 In my last post I asked why it's advised that library options be the last in the command line in case of static linking.Here is the explanation:The symbols on the command line are resolved from left to right.Stating linking looks through the static library for "undefined" symbols when it is processed.Now in case ofcc -lfoo hello.cthere are no undefined symbols when libfoo.a gets processed and so nothing gets extracted from it. When the object file is processed, it doesn't find any symbol and it gives an error "Undefined symbol"If hello.c is put before -lfoo as incc hello.c -lfoothere are undefined symbols when libfoo gets processed and so they get extracted. This works fine.Dynamic linking doesn't have this issue as all symbols are available through the virtual address space of the output file.Static libraries have other issues like bigger executable size, and lack of ABI ( application needs to be relinked with each new version of the library).One advantage of having static libr... More About: Library , Options , Linking , Solaris , Line
quirk of static linking
2007-05-18 14:52:00 A question related to linking today.Why is it advised to put the library options at the end of command line for compilation? Hint: If we have a static library, say libfoo.a which we want to link to our program hello.ccc hello.c -lfoorather thancc -lfoo hello.c-l option tells the compiler to link to library [lib]foo. Note that "lib" from libfoo is dropped and only "foo" part is given with -l. More About: Linking , Solaris , Stat , Linkin , Static
How Nerdy are you?
2007-05-17 22:26:00 Took this Nerd test and was worried I was going to score a "less nerdy" type. But the result were pleasantly surprising. It said " All hail the monstrous nerd. You are by far the SUPREME NERD GOD!!!"Perhaps, my score was helped by a few dirty clothes in my room, and Solaris .For now, I am in heaven! More About: Nerdy
RAID Primer
2007-05-16 21:03:00 Found a brief and good online paper on different types of RAID ( Redundant Array of Independent Discs ). It explains RAID concepts with a brief explanation of each type along with their pros and cons.The paper can be read here. More About: Prime , Rime , Prim , Raid
Top 10 funniest gadgets
2007-05-15 19:47:00 While surfing the net today, I stumbled upon this list of top 10 funniest gadgets.My favorite are DVD rewinder and USB powered butt cooler. What are yours? More About: Gadgets
Microsoft threatens Linux with patents
2007-05-14 21:44:00 According to a news article, Microsoft has alleged that Linux and other Open Source software violate its patents. This includes 42 by Linux kernel alone and many by OpenOffice , totalling 235 patents in all.Looks like an open source arm-twisting effort by MS directly related to their deal with Novell last year.More at :CNNCRN
Memory Overcommit and the OOM Killer
2007-01-02 23:25:00 Linux has a feature called memory overcommit. Put simply, it means kernel allocates memory even if it doesn't have enough. This happens when a new process is created using fork(). This effectively copies the parent's address space, and so requires twice the parent process' memory once the new process (child) is created. The memory overcommit feature means that fork() always returns a success. Even if there is not enough memory to create a new child process!The idea behind a memory overcommit feature of Linux is that the child process rarely uses all the memory allocated to it. fork() is followed by exec() which overlays the child address space with some exectutable. Once the exec() is done, the child process exits and the parent process (which goes into wait() after creation of child) resumes.Failing to allocate enough memory when it is needed by the child results in another process being invoked. This process is called Out Of Memory (OOM) killer. The job of this process is to s... More About: Linux , Unix , Killer , Solaris
Search from Firefox address bar
2006-12-24 15:03:00 I've been using Google toolbar for Firefox for a long time. There is a Firefox feature which can make the use of the toolbar reduntant by doing Google search from Firefox address bar. For a single word search, Firefox takes us to the homepage of the first search result found. It is like the "I'm feeling lucky" feature of Google search. Just like the infamous "failure" or "miserable failure" and "I'm feeling lucky" combination does. But if we enter more than one word string in the Firefox address bar, it is like normal Google search, and makes installing Google toolbar unnecessary.A cool feature of Firefox which many are not aware of. More About: Search , Address
The toilet
2006-12-21 23:20:00 1- Say, there is a common toilet with many doors.2- A person can enter from only one of these doors at any time i.e. the door to enter is fixed for him.3- A door can be used for entry into the toilet by many persons i.e. it is a common entrance for some persons.4- Only one person can use the toilet at a time.5- There is a toilet supervisor whose job is to see that persons behave properly.6- The supervisor gives each of the persons who use that toilet a number so he can recognize them when they come to use the toilet.7-The higher the number the higher the chance of the person getting to use the toilet.8- If a person is using the toilet and another person comes up whose number is bigger, the supervisor kicks the first person out and lets the second person to use the toilet. The kicked one get to use the toilet once the bigger number person is finished. The same fate awaits the second person if another person with even bigger number comes. In this case however, the first kicked person ... More About: Computer , Toilet
Outstanding OpenSolaris questions by James McGovern
More articles from this author:2006-12-20 20:09:00 James left a comment to one of my earlier posts and suggested I answer some of the outstanding questions he posted on his blog sometimes back. Though I am not an authority on this, I will try to answer some of them as per my understanding. I was thinking of replying in comments section but it became too long, so here is a reply to James comment.Hi James,Unfortunately I have little information related to SPARC chips. It's an open architecture and anyone can see the specification and is free to implement.I don't think Sun produces SPARC chips for appliances as they are a server-focussed company.Maybe Fujitsu does it. I have heard of SPARC chips in some cameras, but you'd have to google search to find out more.Regarding Open Solaris , I believe OpenSolaris.org community is much more capable to answer those queries. e.g. I searched Xen community list there and it seems they have some working Xen code for OpenSolaris. Of course, Xen itself is not yet complete, so Xen for OpenSolaris wou... More About: Questions , James , Ames 1, 2 |



