Showing posts with label articles. Show all posts
Showing posts with label articles. Show all posts

Tuesday, February 27, 2007

Speed Up Network Browsing

Network sharing was way superior to the Internet file sharing available through a modest modem. Therefore, we all enjoyed our local sharing protocol. Time passed, broadband connections became so spread and popular that the old modem found his imminent death.

Nowadays, we share over the Internet. At such high speeds, the local network rather spread itself outside the local enclosure. However, LAN is not dead. We still use the Local Area Network at the office or in the neighborhood. The only problem is that users are not satisfied when browsing the network.

It seems that communication



between network computers under Windows has some lacks slowing down browsing. Excluding hardware problems, which are not the basis of this article, some tweaks can be applied in order to smooth things out.

All the tweaks have to be done by editing the registry, which means you need to be careful when doing that. To keep yourself out of trouble, make sure you backup the registry before you edit it.

Disable Network Task Scheduler

Applying this tweak, you will disable networked computers search for scheduled tasks. When you try to open a network folder, it will take a while which is not pleasant at all.

Go to Start > Run and type Regedit. When the registry editor opens, locate this path:

HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows > CurrentVersion > Explorer > RemoteComputer > NameSpace

Once you found it, just delete the following key:

{D6277990-4C6A-11CF-8D87-00AA0060F5BF}

It is possible not to find the keys mentioned above. It's OK. Just proceed to the next tweak.

Raise the threshold level for the requested buffer.

When dealing with a high-latency connection you need to modify (increase) the SizReqBuf value. We are talking here about a buffer, which is set by default to value of 4356 decimal. Microsoft states that this value provides acceptable level of performances under normal conditions. Well, as we are not satisfied how network browsing devolves we consider the “conditions” as being not normal and therefore, we need to change the value. It seems that in most LAN conditions, the best value for the SixReqBuf would be 16384. Use this value on computers equipped with more than 256 MB Ram.

To change the value, first open the Registry Editor (as presented at the previous tweak) and locate

HKEY_LOCAL_MACHINE > System > CurrentControlSet > Services > LanmanWorkstation > Parameters and then create a DWORD value named SizReqBuf. Edit it and provide a decimal value of 16384.

Tweak the Network Redirector Buffers

By increasing the number of these buffers, you may get a higher transfer rate for the data that travels though the network. Open the Registry Editor navigate to this location:

HKEY_LOCAL_MACHINE > System > CurrentControlSet > Services > LanmanWorkstation > Parameters

Using the procedure explained in the previous tweak, add two new DWORD values:

MaxCmds and MaxThreads

Give both the same value between 0 and 255. It is recommended to choose the value of 64.

Eliminate the shares from My Network Places

Windows has an annoying behavior to place a shortcut in My Network Places for each remote folder accessed through the network. This creates an unpleasant delay when accessing the network. There are two ways to teach Windows not to do that anymore.

For Windows XP Home Edition

Locate HKEY_CURRENT_USER > Software > Microsoft > Windows > CurrentVersion > Policies > Explorer with Registry Editor and add a new DWORD value called NoRecentDocsNetHood setting its value to 1. The value 1 will disable the shares to be added in My Network Places.

For Windows XP Profession

Under this version of Windows, the process is easier. There is no need to edit the registry. Just go to Start > Run and type Gpedit.msc. It will open the Group Policy Editor. Using it, just go to User Configuration > Administrative Templates > Desktop and in the right panel, enable the option: “Do not add shares of recently opened documents to My Network Places”.

Deploying Microsoft Office SharePoint Server 2007

Deploying Microsoft Office SharePoint Server 2007 will deliver a positive impact on the workflow inside an institution. Case in point-the Menninger Clinic. Microsoft revealed that the adoption



of Office SharePoint Server 2007 has reduced paperwork up to 25%. According to the Redmond Company, the clinic has adopted a single system with Microsoft Office SharePoint Server 2007 (MOSS) and Microsoft Office InfoPath 2007 at its basis.

“Microsoft SharePoint has been invaluable to us, as the application we were working with was becoming too complicated to maintain with one full-time employee and two consultants dedicated to its maintenance,” said Terry Janis, director of Information Technology at Menninger. “Now we can devote those funds to other projects that contribute to higher-quality patient care — all while fulfilling HIPAA requirements.”

“Office SharePoint Server 2007 offers Menninger the ability to easily store, manage and retrieve patient demographic information and clinical documentation,” said Chris Sullivan, Healthcare Provider Solutions Director of the U.S. Healthcare and Life Sciences Group at Microsoft. “A normalized relational database design for this application might require dozens of tables. The document-centric design of Menninger’s system uses SharePoint Server 2007 to reduce this to a handful of lists and document libraries.”

According to Microsoft, the Menninger Clinic, an international psychiatric hospital in Houston has managed to save $80,000 per year following the deployment of the new system, based on Office SharePoint Server 2007. Microsoft's announcement comes in concert with the Health Information Management and Systems Society’s annual IT conference for 2007.

Monday, February 26, 2007

A Second Google Desktop Vulnerability

"According to InfoWorld, Google's Desktop indexing engine is vulnerable to an exploit (the second such flaw to be found) that could allow crackers to read files or execute code. By exploiting a cross-site scripting vulnerability on google.com, an attacker can grab all the data off a Google Desktop. Google is said to be investigating. A security researcher is quoted: 'The users really have very little ability to protect themselves against these attacks. It's very bad. Even the experts are afraid to click on each other's links anymore.'"

Vulnerability to a little-known Web-based attack could allow an attacker to have access to any data indexed by Google Desktop


Google's PC search software is vulnerable to a variation on a little-known Web-based attack called anti-DNS pinning that could give an attacker access to any data indexed by Google Desktop, security researchers said this week.





Free IT resource



Free IT resource




Related Stories






This is the second security problem reported this week for the software. On Wednesday, researchers at Watchfire said they'd found a flaw that could allow attackers to read files or run unauthorized software on systems running Google Desktop.


As with Watchfire's bug, attackers would first need to exploit a cross-site scripting flaw in the Google.com Web site for this latest attack to work, but the consequences could be serious, according to Robert Hansen, the independent security researcher who first reported the attack. "All of the data on a Google desktop can now be siphoned off to an attacker's machine," he said.


Cross-site scripting flaws are common Web server vulnerabilities that can be exploited to run unauthorized code within the victim's browser.


Hansen, who is CEO of Sectheory.com, did not post proof of concept code for his attack, but he said that he has "tested every component of it, and it works." He has posted some details of how Google Desktop data could be compromised on his blog.


Google said it was investigating Hansen's findings. "In addition, we recently added another layer of security checks to the latest version of Google Desktop to protect users from vulnerabilities related to Web search integration in the future," the company said in a prepared statement.


Anti-DNS pinning is an emerging area of security research, understood by just a handful of researchers, said Jeremiah Grossman, CTO at WhiteHat Security. The variation of this attack described by Hansen manipulates the way the browser works with the Internet's DNS in order to trick the browser into sending information to an attacker's computer.


"Once you can re-point Google to another IP address, instead of Google getting the traffic, the bad guy does," he said.


Because this type of attack is so difficult to pull off and is poorly understood, it is unlikely to be used by the criminals any time soon, Grossman said. But anti-DNS pinning shouldn't be ignored, he added. "We should keep our eyes on it in case the bad guys shift gears."


News of the attack comes as Google is trying to enter the desktop productivity market. On Thursday, Google launched a suite of Web-based collaboration software, called the Google Apps Premier Edition, that analysts say could become a competitor to Microsoft Office.


The troubling thing about the attack Hanson identified, which he calls anti-anti-anti-DNS pinning, is that there is very little that can be done to avoid it short of eliminating cross-site scripting vulnerabilities on the Web.


"This is really just fundamentally about how browsers work," he said. "If you allow a Web site to have access to your drive -- to modify, to change things, to integrate, or whatever -- you're relying on that Web site to be secure."


Hansen and Grossman say that Google is not the only company vulnerable to a growing category of Web-based attacks. For instance, MySpace.com was hit when a fast-moving worm spread through the MySpace community in early December, stealing MySpace log-in credentials and promoting adware Web sites.


"A lot of these new attack techniques are going to require the browsers to improve," Grossman said. "The users really have very little ability to protect themselves against these attacks" he said. "It's very bad. Even the experts are afraid to click on each other's links anymore."



A New Screening Device That Gets You Naked



A new controversial federal screening system has been installed for 90 days on Friday at Sky Harbor International Airport, Phoenix, at the largest terminal.

This is the first test of the device that employs X-rays to “see” through passenger's bodies in the search of hidden explosives and other weapons. The technique is able to watch through clothes and reveals the body's contours with extreme accuracy, just as if the person would stay naked.

There are already critical voices claiming the high-resolution



images are too invasive. In response, the Transportation Security Administration said the device was tuned to make the image look less explicit, like a drawing line, but still tracking down hidden objects.

The new device will be used just as a second screening measure, and the passengers who do not pass by the metal detector could choose between the novel technique and a corporal search. "It's 100 % voluntary, so if the passenger doesn't feel comfortable with it, the passenger doesn't have to go through it," said TSA spokesman Nico Melendez.

The one-minute procedure requires passengers to stand in front of the closet-sized X-ray device with the palms of their hands facing out, from front and behind. "It seems faster. I'm not uncomfortable with it," said one of those tested. "I trust TSA, and I trust that they are definitely trying to make things go quickly and smoothly in the airport.”

Some experts are not so trusty.

"The more obscure they make the image, the more obscure the contraband, weapons and explosives. The graphic image is a strip-search. You shouldn't have to be strip-searched to get on an airplane. Millions of Americans would regard them as pornographic." said Barry Steinhardt, director of the Technology and Liberty Project at the ACLU in Washington, D.C.

TSA would like to install the same technique at the Los Angeles airport and New York's Kennedy Airport by the end of 2007. “The security officer who works with the passenger going through the screening will never see the images the machine produces. The pictures will be viewed by another officer about 50 feet (16 m) away who will not see the passenger. The machine cannot store the images or transmit them and once we're done screening the passenger, the image is gone forever," said Melendez.

Image credit: AS&E

Building A Linux Router

By Janne Nurminen
Expert Author
Article Date: 2003-08-06

Building a reliable, full-featured broadband router can be very easy and cost-efficient. This article is about building one for routing a LAN to the Internet with NAT (Network Address Translation -- Linux users also call it as IP Masquerading) using an old computer and a Linux micro-distribution designed to have very low hardware requirements. We'll end up having a very simple and stable system, yet featuring e.g. iptables based stateful firewalling and remote administration.

My brother had this old IBM Aptiva (which he had found from a trash can nearby his home) which happened to be just a suitable piece of hardware for the purpose:


  • Pentium 150 Mhz

  • 14 Megs of RAM

  • 1,6 GB Harddrive

  • Disk Drive

  • CD-ROM

  • 10 Mbps Network Interface Controller

  • Soundcard

  • Keyboard

  • Mouse

  • Video Card with 2 MB Memory, integrated to motherboard

  • IBM G50 14" Monitor


Choosing a suitable Linux Distribution

The basic idea was to build a router which would also provide firewall services to protect the internal network, and which could be administrated remotely. After doing a quick search, I found Coyote Linux which turned out to be just the perfect solution.

Basically, Coyote Linux is a single floppy distribution of Linux that is designed for the sole purpose of sharing an Internet connection. Being a single floppy distribution, it runs off of a single floppy disk and loads itself to RAM. The floppy itself can be created using either a Microsoft Windows wizard (!), or by using a set of Linux shell scripts. I created mine using the latter method.

Since the floppy was all that was needed, I decided to remove all unnecessary parts from the computer. This makes the machine a bit more silent and less heat-productive. I removed the hardrive, cd-rom and souncard, and replaced the old 10 Mbps NIC with two 100 Mbps NICs (the old one did have a Realtek chip on it, so it would've been supported, too). Luckily it had just the two needed PCI slots for the two network cards.

Creating a bootable floppy disk

The next thing to do was to create the boot diskette. I downloaded the Coyote Linux Floppy Creator Scripts (v1.32) and ran them on my laptop which runs Linux (yes, indeed do note that to run scripts on Linux you need a functioning Linux system ;-). The process itself is very straight-forward. But before you go, you need to know what modules need to be loaded in order to use your network cards. I used two identical D-Link cards which use the rtl8139 module. To find out which module you need, CoyoteLinux has provided a very good documentation, available in PDF format. Generally, more information can be found from the Linux Ethernet-Howto and Vendor/Manufacturer/Model Specific Information.

The script asks to make some trivial choices:

  • Please choose the desired capacity for the created floppy (3 choices)

  • Please select the processor type in the destination Coyote Linux system (2 choices)

  • Please select the type of Internet connection that your system uses (1. Standard Ethernet Connection, 2. PPP over Ethernet Connection, 3. PPP Dialup Connection, 4. ISDN Connection)

  • Does your Internet connection get its IP via DHCP? [y/n]

  • Install the Road Runner DEC protocol login software) [y/n]

  • Install the Big Pond login software? [y/n]

  • Do you want to enable the coyote DHCP server) [y/n]

  • Would you like to install sshd for secure remote access? [y/n]

  • Would you like to install Webadmin for system admin via a web interface? [y/n]

  • Would you like to create another copy of this disk [y/n]?


By default Coyote uses the following settings for the local network interface:
IP Address: 192.168.0.1
Netmask: 255.255.255.0
Broadcast: 192.168.0.255
Network: 192.168.0.0

These don't need to be changed (unless you need a whole lot of internal IPs, or want to to change the router's internal ip address).

Building the network

The next thing to do was to build the network. I attached a cable from the modem to the router's Internet network card, and from the router's local network card to the switch. All other computers were directly connected to the switch. The result is shown in the fine picture on the right. After that I booted the new Linux Router with the newly made boot disk. Then I adjusted the network settings accordingly for all the computers connected (c1 - c4).

On Windows: Control Panel -->
Network and Dial-Up Connections
--> Local Area Connection
--> Internet Protocol (TCP/IP)
:











IP address: 192.168.0.n
Subnet mask: 255.255.255.0

Default gateway: 192.168.0.1

DNS servers: ...



... where n of course needs to be a unique number for each machine (IP addresses could be obtained also automatically by enabling Coyote Linux DHCP server for internal network, if needed). On Linux netconf is a good tool for changing network settings.

http://koti.mbnet.fi/~keiky/misc/linux/router/imgs/ethernet_lan.png

After that I pinged other computers and - being in Finland - Nokia:











[jn@karelia docs]$ ping nokia.com

PING nokia.com (147.243.3.73) 56(84) bytes of data.

64 bytes from www.nokia.com (147.243.3.73): icmp_seq=1 ttl=246 time=48.7 ms

64 bytes from www.nokia.com (147.243.3.73): icmp_seq=2 ttl=246 time=98.9 ms

64 bytes from www.nokia.com (147.243.3.73): icmp_seq=3 ttl=246 time=19.8 ms

--- nokia.com ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2014ms

rtt min/avg/max/mdev = 19.825/55.839/98.974/32.702 ms



and hua! It worked! Next I unplugged the monitor and keyboard from the router and placed it in its final place.(1

Conclusion

Building a broadband router can be very easy and cost-efficient, and Coyote Linux Router is a very easy solution for the purpose.

Btw, becase the whole file system is just a RAM disk, the machine can be shutdown by just pressing the power switch like in the good(?) old DOS times..

References

1) Next time when booting the router it hung up because of a keyboard failure (of course I had to remove the router from its Final Place to be able to plug the monitor back and see what was going on). That was resolved by changing the proper BIOS setting.

First appeared at http://koti.mbnet.fi/~keiky/misc/linux/router/lnx_router.html

Why Do Geeks Take the Chicks?



Even the scientific research proves it: girls like to hang around with sexy guys but they will marry a geek.

Those computer rats that overinvest in intelligence but undermine their social skills could be the best choice.

Women only have to figure that out for many reasons:

Geeks are reliable. You may think geeks, through their higher IQ and power of understanding the suffering they can inflict in their beloved partners, would not “go astray”. Thus, they will be loyal to their mates for better and for worse.

Is that right?

No, no, no.

Each male, the ultimate nerd, is programmed to spread sperm.

But the geek’s undeveloped social skills do not help in supporting an affair, and in



fact, he keeps on being puzzled about how they ended up with the lover they have been attracted to.

Dating with a geek is really the beginning of a relationship that can last forever.

Geeks are the best on what they do.

Theye won't sleep during the night cause they're preoccupied by things you have never heard about, from hacking, playing video games, or other issues like that.

If their new hobby is sex, you can imagine what follows: he will pirate your brain, hack your genitalia or whatever using also oral connections and links. Your previous lovers were jerks preoccupied by their person and coexisting with their own conceit. But geeks are not interested in social status; they won't spend the time with prosaic issues like sports and fashion, so they have more time for you, girls. Those activities would mean social contact, and they are extremely reluctant to this. As they are isolated, you could mean for a geek his whole universe, so you will be the only target of his attention, from nurturing to lascivious desire.

The previous guys you had came after years of dating lots of other women; they experienced many failures and deceptions, so they ended up being very aware of the reality and having no intention of letting you find out that in their minds you are “just another girlfriend”.

Don't even try to understand the mind of a girl that has serially dated many men and her opinions about men. But with a geek, for whom you may be his “destroyer”, you will be hit by the zest of a beginner. They are not sexually confident but once they achieved, oh God (!), a sex resource, they will fully use each moment.

One more thing: do not underestimate the geek’s power of concentrating! They are as fierce as predatory beasts (you should see them playing computer games!). Do you wanna see the actual meaning of “all night long”?

And we did not mention their finger dexterity. You think this is achievable by pulling up weights at the gym? No, no, but geeks roll dice, play video games, flip pages in books, type a lot (even those keys that you do not know what are there for). You should know they push buttons and joysticks, so, you can imagine where their imagination could lead them.

‘Cause boredom kills a relationship, but geeks have more information sources than others. Which is the biggest porn source? The Internet, of course, and hundreds of gigabytes on their computers are filled with porn.

So, go and get a geek now!

Most of them are on the net.

But remember: a single geek is not sexy, so watch out!

The iPod User's Best (Vibrator) Friend

iPods and vibrators represent 2 of the most popular brands of gadgets around the world, although they offer quite different types of satisfaction; and since these things can be found just about everywhere these days, it was just a matter of time before someone found a way to capitalize on their huge success.



And it seems that someone actually did exactly that, since a company called Suki, LLC. has launched a device called OhMiBod which is by far the most interesting iPod acsexsory (as the manufacturer calls it) ever created.

As mentioned before, the OhMiBod has been developed by the Suki company which was named after its owner, a former Apple,Inc. employee, and was meant to bridge the gap between one's music and sex life. And this little “playful” thingy manages to do just that, since it simply plugs into the iPod or any other music player and it automatically vibrates to the rhythm and intensity of the music.

This is possible due to the fact that the OhMiBod integrates special audio circuitry, which is capable of transforming the music's beats and rhythm into non-repetitive and stimulating vibrations. Moreover, although it's optimized for the iPod, the device is also compatible with just about any other electronic audio output source with a 3.5 mm jack, as for example MP3 and DVD players or even laptops, and comes with a 90-cm “freedom cord”, so that the users can really enjoy it, regardless of the situation.

The OhMiBod is also quite safe, since it's manufactured out of a hypoallergenic white, non-toxic and non-porous plastic material, with a chrome finishing. Moreover, if the users don't feel like listening to music at some point, they can simply attach a multi-speed cap and turn it into a normal, everyday vibrator.

This very kinky device is available for around 69 US dollars, and the users even get the possibility to join a growing online community, called Club VIBE, where they can share playlists and opinions about their experiences with the device. So, how about some Fatboy Slim, dear users?

We are just a few, but there are many of you, Softpedia users, out there. That's why we thought it would be a good idea to create an email address for you to help us a little in finding gadgets we missed. Interesting links are bound to be posted with recognition going mainly to those who submit. The address is .

13 Things to do immediately after installing Ubuntu

1. Enabling/Adding Extra Repositories
Ubuntu comes by default with only some of the repositories enabled because of licensing issue since downloading certain codecs and apps may be illegal in some countries so you have to enable these repositories/add new repositories to enable installation of these packages.

To enable new repositories go to (System -> Administration -> Synaptic Package Manager ) , type in the root password .Then Go to (Settings -> Repositories ), there enable all the check-boxes to enable all the repositories you need .


Also for installing some apps extra repositories are needed since they are not in the default repositories so go to third Party and add the following there


deb http://givre.cabspace.com/ubuntu/ edgy main main-all
deb http://ntfs-3g.sitesweetsite.info/ubuntu/ edgy main main-all
deb http://flomertens.keo.in/ubuntu/ edgy main main-all




deb http://mirror.ubuntulinux.nl edgy-seveas all









After doing this exit Synaptic Package Manager Fire up Console and type the following command to import GPG keys .


wget http://flomertens.keo.in/ubuntu/givre_key.asc -O- | sudo apt-key add -

wget http://mirror.ubuntulinux.nl/1135D466.gpg -O- | sudo apt-key add -



After doing this your system should be ready for installing extra application.

2. Installing ntfs-3g

ntfs-3g this is necessary if you have a ntfs drive in your computer ( Usually Windows XP installs on NTFS drive) and you want to read and write data to the drive you have to install this .

This can be installed as following type the following at the command prompt

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install ntfs-config

Then type the following command
gksu ntfs-config

This is automatic configuration of ntfs-3g , enable read , write support and it should be configured.


these commands would back up fstab file if configuration goes wrong.


sudo cp /etc/fstab /etc/fstab.bak
gksu gedit /etc/fstab


Now one more thing you want your windows (NTFS) drive to be mounted automatically add the following entries to /etc/fstab

/dev/
/media/ ntfs-3g defaults,locale=en_US.utf8 0 0



Where /dev/partition is the partition which is NTFS drive , in my case /dev/hda1
/media/ this is just the directory you want to use as a mount point where windows drive would be mounted , you can very well use any drive you like.

now Restart ubuntu your windows partition should be working well.

3. Making Windows see your Linux partition


Windows XP lacks support for reading and writing files to Linux file system however external utilities like free Ext2 File system for windows allows Windows XP to read and write files to a Ext2 , Ext3 file system however ReiserFS file system is not supported .

You can get Ext2 file system for windows at the following link : -
(www.fs-driver.org/download.htm)



4. Installing flash-plugin

Macromedia Flash player is not installed by default but since we would be surely needing it while browing the net , installing it is necessary
it can be installed by following command


sudo apt-get install -y flashplugin-nonfree

5. Installing Microsoft True Type Fonts

If you are making a jump from windows to ubuntu you would surely miss the true type fonts that Windows uses , since Microsoft has released them free so they can be installed without a hitch in ubuntu (Though not distributed with Ubuntu) .

sudo apt-get install -y msttcorefonts

6. Installing unrar

RAR is one of the very widely used archives on Windows , however unrar tool to decompress RAR is not shipped with distribution and has ti be installed manually.

sudo apt-get -y install unrar

7. Installing mpg123

mpg123 is a very nice command line based mp3 player that can play mp3 files even on a slow processor based computer , further installing this provides a way of playing mp3 files from within the nautilus file manager . Hence i recommend installing mpg123

sudo apt-get install -y mpg123

8. Installing Adobe Reader

Though ubuntu comes with default evince reader for viewing pdf files , but i am sure you would like to use more complete version of pdf reader Adobe Reader 7.0 which is quiet professional and
more robust , the Linux version of Adobe Reader 8.0 has not been released but the version 7.0 is available and could be downloaded from the following website : -

http://www.adobe.com/support/downloads/product.jsp?product=10&platform=unix


9. Installing DVD playback support

Now this is a contentious issue , in some countries playing DVD files through DEcss is illegal so use it at your own will , anyways to enable dvd playback issue the following command at the command line : -

sudo aptitude install libdvdcss2

Note : the above commands would only work if you have added the repositories i had mentioned before the Seveas repositories.

However if you do not have these Repositories installed issue the following command to install the DVD playback support : -

sudo /usr/share/doc/libdvdread3/./install-css.sh

10 . Installing the extra multimedia codecs,players

Now you would surely want to install all the codecs for playing various media files and the players primarily xine,vlc,mplayer issue the following commands to install the multimedia codecs.

sudo apt-get install gstreamer0.10-pitfdll gstreamer0.10-ffmpeg gstreamer0.10-gl gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libxine-extracodecs w32codecs
vlc mplayer

This command would install most of the codecs for gstreamer multimedia architecture and vlc media player and Mplayer , as well as the dll files codec (w32codecs) for decoding various files whoose open source decoder are not available.

11. Updating the system

After installing Ubuntu you would surely like to update the system so that all the packages on the system are up to date to new version of the software .
It can be done by following steps , go to (System > Administration > Update Manager)
Now press the Check button and then Install updates to start the installation of updates to the ubuntu system.


12 . Installing beagle

Now Ubuntu does not come with beagle pre-installed maybe because it is still not a final 1.0 release still it is very nice and efficient for searching files and directories on Linux providing features similar to Google Desktop Search and Mac OS Spotlight anyways to install beagle issue the following command at command line :

sudo apt-get install -y beagle


13. Installing gdesklets

gdesklets gives user a collection of impressive widgets that can be placed on desktop this is similar to feature available on Windows Vista and Mac OS X , it does provide quite a good look to the desktop.

To install gdesklets issue the following command at the command line

sudo apt-get install -y gdesklets

after installation go to (System -> Preferences -> Sessions) There go to Start up program and add gdesklets shell , now every time gnome loads up you should see your gdesklets on the desktop.

This is how my desktop looked like with all the desklets (Widgets )

Article written by : -
Ambuj Varshney
For Linux On Desktop (http://linuxondesktop.blogspot.com)
(C) 2007 Linux on Desktop

6 Reasons Why Sex is Very Healthy for You

Not just good, but good for you


Mounting evidence suggests sex helps keep us healthy











 

F.Birchman / MSNBC.com


 

By Brian Alexander


MSNBC contributor
















 










 


July 1 - To paraphrase a great old slogan for Guinness beer: Sex isn’t just good, it’s good for you!

Okay, so maybe there’s some wishful thinking going on — the science isn’t exactly iron-clad — but evidence is accumulating that the more sex you have, the better off you are.


There is one caveat, though. “We do not have good data to show a direct connection [to all-around good health]," says Jennifer Bass, the head of information services at the Kinsey Institute for Research in Sex, Gender and Reproduction in Bloomington, Ind. "We know that healthier people have more sexual activity. But we do not know which comes first. Does the good health make you more willing to have sex, or does the sex have a positive impact?”




Story continues below ↓


advertisement







And you dirty girrrls and Don Juans should know that the assumed health benefits of sex are generally thought to accrue to people in loving, monogamous relationships or those flying solo. Risky sex with lots of partners will probably do more harm than good.


But while researchers try to nail down the impact on overall health, data is mounting when it comes to some specifics. Here are several potential benefits:



1. Easing depression and stress
Bass says this is pretty definite. “The release from orgasm does much to calm people. It helps with sleep, and that is whether we talk about solo sex or sex with a partner,” she says.

But wait, there’s more. A recent study of college students at the State University of New York in Albany suggests that semen acts as an antidepressant. Females in the study who were having sex without condoms (see safe sex caution, above) had fewer signs of depression than women who used condoms or abstained from sex.


“These data are consistent with the possibility that semen may antagonize depressive symptoms,” the authors wrote, “and evidence which shows that the vagina absorbs a number of components of semen that can be detected in the bloodstream within a few hours of administration.”


I kid you not, ladies. Semen is good stuff. It gives a shot of zinc, calcium, potassium, fructose, proteins -- a veritable cornucopia of vitality!



2. Relieving pain
Orgasm is a powerful pain-killer. Oxytocin, a natural chemical in the body that surges before and during climax, gets some of the credit, along with a couple of other compounds like endorphins.

According to a study by Beverly Whipple, professor emeritus at Rutgers University and a famed sexologist and author, when women masturbated to orgasm “the pain tolerance threshold and pain detection threshold increased significantly by 74.6 percent and 106.7 percent respectively.”



3. Boosting cardio health
I can’t resist another plug for semen. It’s possible that male goo can lower blood pressure. Another recent study found that women who gave their men oral sex, and swallowed, had a lower risk of preeclampsia, the dangerously high blood pressure that sometimes accompanies pregnancy.















Live Vote






























Do you think sex is good for what ails you?

Vote to see results












No, I’m not making this up. “The present study shows that oral sex and swallowing sperm is correlated with a diminished occurrence of preeclampsia,” said the Dutch authors.

See? We told you it was good for you.


There have been other studies showing that sex lowers blood pressure, and might even protect against strokes because of its stress-relieving ability.


But when we think of sex and the cardio system, we tend to think of poor old Nelson Rockefeller having a heart attack in flagrante delicto. Well, not only does that hardly ever happen, but sex might actually protect the heart. A 2002 report from a large British population of men said “some protection from fatal coronary events may be an added bonus” of frequent sexual intercourse.



4. Countering prostate cancer
Over the past few years, several journals have published studies showing that the more ejaculations the better.

Now the Journal of the American Medical Association, no less, has reported that “high ejaculation frequency was related to decreased risk of total prostate cancer.” It doesn’t matter how a man climaxes -- intercourse or masturbation. So next time he says, “Really, honey, it’s therapy,” he could be telling the truth.



5. Healing wounds
Some evidence suggests sex can be rejuvenating to the point of helping wounds to heal faster. Several experiments have shown that oxytocin can help even stubborn sores, like those suffered by diabetics, to heal by regenerating certain cells.

6. Fighting aging
Maybe it’s the rejuvenation, maybe the happiness, maybe all of the above. One thing’s for sure: “Use it or lose it” is literally true. For example, postmenopausal women often suffer from “vaginal atrophy,” which is what it sounds like and can lead to all sorts of complications like urinary tract infections. What’s one way to prevent it? More intercourse.

Sex is a form of exercise, after all, and like all exercise, it burns calories and can help battle the onslaught of the years. In fact, nursing home experts say they wish oldsters would have more sex.


Can sex really make you live longer? Maybe. In the same population of British men I cited earlier, researchers found a 50 percent reduction in overall mortality in the group of men who said they had the most orgasms. There was a dose response: the more orgasms, the better.


Of course, as Kinsey’s Bass reminds us, it could be that these blokes were just healthier and felt like having sex more often. But since there’s no evidence that lots of sex is bad for you, what have you got to lose?


Brian Alexander is a California-based writer who covers sex, relationships and health. He is a contributing editor at Glamour and the author of "Rapture: How Biotech Became the New Religion" (Basic Books).

Monday, February 19, 2007

Google Releases Paper on Disk Reliability

"The Google engineers just published a paper on Failure Trends in a Large Disk Drive Population. Based on a study of 100,000 disk drives over 5 years they find some interesting stuff. To quote from the abstract: 'Our analysis identifies several parameters from the drive's self monitoring facility (SMART) that correlate highly with failures. Despite this high correlation, we conclude that models based on SMART parameters alone are unlikely to be useful for predicting individual drive failures. Surprisingly, we found that temperature and activity levels were much less correlated with drive failures than previously reported.'"

Ballmer: Novell deal proves open source needs to ‘respect IP rights’

by Mary Jo Foley

The same week that Microsoft issued a press release providing further details about some of the technological advances that will result from the November 2006 technology agreement between Novell and Microsoft, Microsoft CEO Steve Ballmer told Wall Street what he really thinks the deal means to Microsoft.

During a forecast update meeting for financial analysts and shareholders on February 15, Ballmer reiterated that, to him, the deal is more about Microsoft exerting intellectual property (IP) pressure on Novell than anything else.

Ballmer didn't talk up technological cross-collaboration. He didn't mention helping customers with interoperability challenges. He didn't mention new sales opportunities. Instead, he said:

"The deal that we announced at the end of last year with Novell I consider to be very important. It demonstrated clearly the value of intellectual property even in the Open Source world. I would not anticipate that we make a huge additional revenue stream from our Novell deal, but I do think it clearly establishes that Open Source is not free and Open Source will have to respect intellectual property rights of others just as any other competitor will."

Ballmer has riled the Novell management team more than once by hinting that Microsoft believes that Novell and other open-source vendors are violating Microsoft patents.

(This past weekend, in an interview with LinuxWorld, former Novell employee and lead Samba developer Jeremy Allison, when asked about supposed Microsoft threats over alleged open-source patent violations, said the rumors were true.
"I have had people come up to me and essentially off the record admit that they had been threatened by Microsoft and had got patent cross license and had essentially taken out a license for Microsoft patents on the free software that they were using, which they then cannot redistribute. I think that would be the restriction. I would have to look quite carefully. So, essentially that’s not allowed. But they’re not telling anyone about it. They’re completely doing it off the record," Allison said.)

Until customers come forward and admit these Microsoft threats, it's gong to be tough to prove Allison's contention.

But it isn't difficult to see that Microsoft's brass sees the Microsoft-Novell deal as being, above all else, about setting a precedent by getting an open-source vendor to pay royalties for IP.

5 Things the Boss Should Know About Spam Fighting

"Sysadmins and email administrators were asked to identify the one thing they wish the CIO understood about their efforts to fight spam. The CIO website is now running their five most important tips, in an effort to educate the corporate brass. Recommendations are mostly along the lines of informing corporate management; letting bosses know that there is no 'silver bullet', and that the battle will never really end. There's also a suggestion to educate on technical matters, bringing executives into the loop on terms like SMTP and POP. Their first recommendation, though, is to make sure no mail is lost. 'This is a risk management practice, and you need to decide where you want to put your risk. Would you rather risk getting spam with lower risk of losing/delaying messages you actually wanted to get, or would you rather risk losing/delaying legitimate messages with lower risk of spam? You can't have both, no matter how loudly you scream.'"

Getting Clueful: Five Things You Should Know About Fighting Spam


The battle for your users' e-mail inboxes probably will never end, but it's not a failure of technology. Experienced e-mail and system administrators share the key points they really, really wish you understood.

By Esther Schindler



February 15, 2007

When you started your e-mail client this morning, you were prepared for the usual set of correspondence: your daily dose of corporate politics, a dollop of technical emergencies and the background hum of projects under way. Annoyingly, your inbox also contained a few messages advertising products you would never buy, and perhaps a phishing notice warning that your account was frozen at a financial institution where you don't have an account. Your company has antispam measures in place; surely, the IT staff should be able to keep this junk out of your inbox?

Perhaps they can, but the task of doing so has become much more difficult in recent years, partly because 85 percent or more of all e-mail traffic today is spam. If you haven't been listening closely to the dark mutterings in your e-mail administrator's office, you may have missed out on significant clues about the nature of the problem and what the IT department can do to address it. However, when you do listen to the technical staff, it's easy to get lost in their arcane acronyms, such as SPF and RBLs, and you may drown in more information than you really wanted to know.

To learn what's really happening in the technical trenches, we asked several e-mail administrators to tell us about the key items—the single key item, in fact—that they wish their IT management understood. If you read through their wish list, you may be able to understand the nature of their challenges and, perhaps, help them clean out your inbox.

In brief, says Keith Brooks, vice president at Vanessa Brooks, "Stopping spam is a mixture of luck, intelligence, alcohol and planning." With luck, he says, your CEO never hears about spam. "But without it, the CIO never stops hearing about this issue."

1. Lose No Mail.

The primary directive, for e-mail admins, is "lose no mail." If that means that an occasional spam message wends its merry way into users' mailboxes, so be it. E-mail administrators would prefer that users encounter a few annoyances than miss an important business message.

Dr. Ken Olum, a research assistant professor in the Tufts Institute of Cosmology, also maintains the institute's computers. Olum explains, "The most important thing is never to silently drop an important e-mail. If you just drop it, your correspondent thinks you aren't answering on purpose or forgets all about you. So suspected spam should always be rejected and never dropped. Sequestering it is only slightly better than dropping it, because you have to look through the sequestered spam, and most people don't bother."

Nonetheless, many CIOs ask their IT department to keep the e-mail boxes clear of anything offensive. Yet, according to Scott Kitterman of ControlledMail.com, "I want zero spam and I want to never ever miss a legitimate message" isn't feasible. Kitterman explains, "This is a risk management practice, and you need to decide where you want to put your risk. Would you rather risk getting spam with lower risk of losing/delaying messages you actually wanted to get, or would you rather risk losing/delaying legitimate messages with lower risk of spam? You can't have both, no matter how loudly you scream."

Tom Limoncelli, author of The Practice of System and Network Administration (Addison-Wesley) and Time Management for System Administrators (O'Reilly), stresses that because fighting spam is not an exact science, there always will be false positives and false negatives. The IT department has to cope with this. Limoncelli had a CTO complain when he missed an important message because it was caught in the spam filter. Says Limoncelli, "This system sent him e-mail once a day with a list of his messages that had been blocked; clicking on any of them 'releases' it from the quarantine. … He wanted a report for every message that was blocked. At least that was his initial request; he then realized that he had asked for an e-mail to warn him of every e-mail!"



2. There's No Silver Bullet.

In many areas of IT, the long-term solution is a simple one: Adopt the single right methodology, hire the right consultant, buy the most appropriate product. But your IT staff wants you to understand that spam isn't a problem that can be solved with a single technology, a single product or any one answer.

Vendors of spam-fighting hardware and software will tell you different—but they're wrong. Bill Cole, senior technical specialist at T-Systems North America, has been fighting spam for more than a decade. Everyone involved in that fight, he says, dreams of the "Final Ultimate Solution to the Spam Problem." But, he cautions, people who yearn for a single answer may fall prey to a vendor's magical "answer," but "in a year or so, the magic is gone and the spammers have adapted." Then, he notes, "managers get upset, a new 'solution' gets deployed, and the cycle goes around again."

Brad Knowles, a consultant, author, and former senior Internet mail systems administrator for AOL, adds, "In almost all cases, the so-called 'simple' answers are the ones that don't work. In fact, they're almost always the ones that make the problem much worse than it already was. Since we've been fighting spam for over a decade, pretty much all the good simple ideas have already been thought of and implemented, and the spammers have already worked around them."

Unfortunately, the result is that fighting spam is a complex endeavor. Says Knowles, "You're probably going to have to use multiple solutions from multiple sources. You're going to have to keep a constant eye on things to make sure that, when they blow up, you find out as quickly as possible. And you [need] multiple layers of business continuity plans in place to handle the situation."

3. It's a Continuous Battle. Budget Accordingly.

Spammers succeed only when they get messages to user inboxes, so they are motivated to counter any barrier between them and their intended recipient. As a result, your IT department will never be done implementing solutions.

Points out David Linn, computer systems analyst III at Vanderbilt, "Spam pushers update their tools as fast as the spam defenders work out a defense to yesterday's attack type. This seems to be the thing that those who want to buy an off-the-shelf solution and then forget about it least understand and least want to understand. The very speed of innovation that makes 'Internet time' so attractive in other contexts is the enemy here."

Cole describes spam as mail that evolves and adapts and thus requires an adaptive and evolutionary approach to defense. Spam cannot be handled as a discrete project with a list of deliverables and a three-month project plan. While you may initially have success by doing so, he says, "Expect to repeat the exercise again next year, and the year after that, and on infinitely."

This is a major nuisance to managers, because they have to pay a staff of high-skill people (either directly or indirectly) for ongoing open-ended work. As Cole notes, "Like many other areas of security, it is a potential bottomless pit for computing resources and the best technical staff and hence for money, so drawing the lines on it are a managerial challenge."

Martin Schuster, in charge of IT at CenterPoint, argues the business case for spam defense by extending spam fighting past technical and ethical issues (such as, say, forcing everyone to use PNG instead of GIF, not use special characters in file names, and so on). Schuster focuses on the financial cost and motivations, from the cost of sending spam to the cost of removing it (from infrastructure to manually deleting messages). He comments, "Fighting spam costs money. If your mail server administrator talks to you about fighting spam, and wants equipment and time to implement it, listen to him. His haircut may seem weird, but he's talking about saving money."

Adam Moskowitz, a Boston-area independent consultant and author of Budgeting for Sysadmins, says, "If a sysadmin can't show that fighting spam is costing the company money, then that sysadmin has no business talking to management about the problem. If the sysadmin doesn't understand and can't demonstrate how fighting spam affects the company's bottom line, upper management certainly isn't going to be able to make the connection."

Does all this seem insurmountable, given your company's resources? If you aren't willing or able to manage the e-mail and spam measures yourself, outsource it. Plenty of hosted e-mail service providers can handle part or all of a company's e-mail system. According to Limoncelli, "The spam system has to be upgraded constantly. This can fill an entire full-time position. If you don't have that kind of staffing, the best solution is to let someone else handle it."

4. Understand the Basics of E-mail Technology.

Administrator Micheal Espinola Jr. says his primary wish is for "top management to understand the mechanics of how e-mail works. Then, and I believe only then, would they be able to grasp the concepts that elude most users of e-mail." When management has the right information, Espinola believes, it can make excellent decisions, but a lack of understanding can severely hinder that ability. "If the admin is wasting time troubleshooting or improvising because of subpar technology, it takes away from time spent for the productivity issues of others."

This doesn't mean you have to become a guru on the subject; just learn enough to understand what your e-mail administrator is telling you. Michael Silver, network administrator at Parkland Regional Library, emphasizes, "A great deal of difficulty arises when trying to address spam—and e-mail problems in general—if the people involved don't have a good understanding of how the mail system works, including a basic understanding of the different protocols, services, etc. I don't expect [CIOs] to know the ins and outs of configuring sendmail, but [they] should have a basic understanding of terms like POP, SMTP, IMAP, MTA and MUA." Added an admin named Eric, "If the CIO knows and understands the mechanisms of how e-mail is received and sent, then explaining the need for additional servers, bandwidth, storage, redundancy, etc., is accomplished much more easily. ... Once you understand that, you get a very good insight in the shortcomings of the SMTP protocol and how/why spam is becoming such a huge problem and cost nightmare."

While most admins want you to understand e-mail basics to make it easier to explain corporate challenges, sometimes it gets personal. Larry Ware, Federal Signal Global Network Boffin, is frustrated by managers who don't understand how the technology works. "They spent some money for some software; why is spam still getting in? Even worse: Why did the system block mail from my nephew? He is running a mail server on his cable modem; he clearly knows how to set up a mail system, why can't you? Explaining why his nephew's mail server is in dozens of public blocking lists for being a spam cannon is a lot harder than you might think. How do you do it without implying his nephew is an idiot?"

Another side effect of the lax understanding of e-mail technology is that the entire system is misused, with spam only one tiny part. Stewart Dean, a Unix system admin at Bard College, says, "The result is users who regard e-mail as a sort of problematic tool that might as well be magic. Not understanding it, they bang on it and misuse it in the most preposterous ways." According to Dean, that's why your e-mail admin screams when users attach a 200MB file to a mail message without knowing that it was 200MB or even what 200MB means. Then those same users wonder why it doesn't go through. Worse, they then repeatedly resend the message. Finally, Dean says, "they get furious at IT that the goddamn magic isn't working."

5. People are Making Money on Spam. Respond Appropriately.

Most of e-mail administrators' time is spent dealing with technology issues or trying to explain it to you in business terms. But for some, the issue is a larger one: someone else's business model. They want you to understand that spam is sent by an intelligent, adaptable and well-funded enemy. Some admins believe that with corporate budgets and legal resources, it's even possible to fight back.

Brent Jones, network technician at Smarsh Financial Technologies, wants IT management to understand that someone is working very hard to destroy the spam barriers administrators put in place. "There is a large financial incentive [for spammers] to get their spam into your mailbox," he says. "They will fight to get your eyes, and it costs them nothing to try everything in the book."

Nor are spammers ordinary businessmen. Alessandro Vesely, a freelance programmer and service provider in Milano, Italy, points out that "much spam is the result of criminal actions, such as infecting IT systems and using false identities. Technically, spam can be stopped if everybody else wants to be responsible for what they send. What lacks is the political will to do so."

Sam Varshavchik is an independent contract consultant who serves many of the better-known financial firms on Wall Street. He believes strongly that "CIOs should stop giving their business to Internet providers with a bad track record of engaging in spam support services and instead encourage and support—with their budgets—lesser-known but more socially responsible and respected providers of data and Internet service." If CIOs instituted a policy of disqualifying any vendor of Internet, data or communication services that appears anywhere on Spamhaus's top 10 list from doing any business with the company, Varshavchik feels, "the spam problem will pretty much disappear, mostly overnight." Few CIOs who are considering vendors take the time to do so, he says, and those few minutes can save an untold amount of grief.

Perhaps you'll take some of the e-mail admins' advice; perhaps not. But they desperately wish that company management would support them in the endeavor to clean up users' e-mail inboxes. Fritz Borgsted, a system engineer at Unicorn Communications who also leads the development of ASSP (Anti-Spam SMTP Proxy, an open-source project), believes that fighting spam reflects the quality of life in the digital age. Borgsted says, "A mailbox without spam is like a private restroom; with spam, it looks like a public one."



Monday, February 12, 2007

Creating an RSS Reader: the Reader

In this article we are going to discuss how to create a PHP-based RSS reader. It would be helpful if you know something about XML, but not really necessary. RSS documents have three main tags: Title, Link and Description. And they all do exactly what their names suggest. I will go into detail about these tags in my second article dealing with “building an RSS file.” For now, we will only focus on the “reading” part of the article.
A downloadable file is available for this article.
As an extra I will introduce a database aspect of the reader. We will use the database to store and retrieve the latest stories. To continue with this article you will need PHP 4 and higher and optionally MYSQL.

Below is an example text from an RSS document:

Start example text

<item>

<title>First example</title>

<link>www.mylink.com/someplace.html</link>

<description>Some description, blah,blah,blah
</description>


</item>

<item>

<title>Thousands set to attend todays celebration</title>

<link>http://
www.mylink.com/someplace.html /NewsTopStories?m=318</link>


<description>blah,blah,blah </description>

</item>

End example text

Code

To create an RSS Reader in PHP, we need to:

  1. Create a function to read the start tag (start element).

  2. Create a function to read the end tag (endElement).

  3. Create function to read the text associated with the tags.


A typical RSS document will have the following structure:

<RSS>

<channel>

<item>

</item>

</channel>

</RSS>

A start tag is a tag without the “/” character, for example: <items>. An end tag is a tag with the “/” character, for example: </item>.

So the start and end tag functions will search for the “<item></item>” tags and once they have found those, it will be a simple matter of retrieving the text data from them to display.


Now, PHP provides us with several XML-related functions, a few of which we will be using here:


xml_parser_create() – Creates an instance of the xml parser object. Xml_parser_create() is a class. In order to use any class we need to instantiate it, or create a copy of it.

To create a new copy:

$xmlParser = xml_parser_create();

xml_set_element_handler() – Searches and sets the start and end elements(tags). This function sets the start and end tags for the parser. It accepts three parameters:

  • The parser: references the parser that is calling the handler.

  • The tagname: contains the name of the element for which the handler is called.

  • The attributes: an array that contains the element's attributes.


The parameters are used later in this article.


xml_set_character_data_handler() – This handles the text part of the tag elements. This function takes two parameters, the parser and data.




  • The parser: references the parser that is calling the handler.

  • The data: contains the character data as a string.


You can get more information about these and other XML functions at:


http://uk2.php.net/manual/en/ref.xml.php

The first thing we do is set the global variables that are going to be used by the functions.


$GLOBALS['titletag'] = false;

$GLOBALS['linktag'] = false;

$GLOBALS['descriptiontag'] = false;

$GLOBALS['thetitletxt'] = null;

$GLOBALS['thelinktxt'] = null;

$GLOBALS['thedesctxt'] = null;

These variables are going to be used to read in tag information from the RSS file that is going to be used with this reader.


The function below deals with the starting element. This function searches through the document to find one of the three tags we discussed earlier:


function startTag( $parser, $tagName, $attrs ) {

switch( $tagName ) {



case 'TITLE':

$GLOBALS['titletag'] = true;

break;

case 'LINK':

$GLOBALS['linktag'] = true;

break;

case 'DESCRIPTION':

$GLOBALS['descriptiontag'] = true;

break;

}

}

This next function deals with the end tag:

function endTag( $parser, $tagName ) {

switch( $tagName ) {



case 'TITLE':

echo "<p><b>" . $GLOBALS[the'titletxt'] . "</b><br/>";

$GLOBALS['titletag'] = false;

$GLOBALS['thetitletxt'] = "";

break;

case 'LINK':

echo "Link: <a href="". $GLOBALS['thelinktxt'] . "">" .
$GLOBALS['thelinktxt'] . "</a><br/>";


$GLOBALS['linktag'] = false;

$GLOBALS['thelinktxt'] = "";

break;

case 'DESCRIPTION':

echo "Desc: " . $GLOBALS['thedesctxt'] . "</p>";

$GLOBALS['descriptiontag'] = false;

$GLOBALS['thedesctxt'] = "";

break;

}

}

This next function verifies the tag that the text belongs to. Once we know which tag it is that we are dealing with, we set the global variable to true.

function txtTag( $parser, $text ) {

if( $GLOBALS['titletag'] == true ) {

$GLOBALS['thetitletxt'] .= htmlspecialchars( trim
($text) );




} else if( $GLOBALS['linktag'] == true ) {

$GLOBALS['thelinktxt'] .= trim( $text );

} else if( $GLOBALS['descriptiontag'] == true ) {

$GLOBALS['thedesctxt'] .= htmlspecialchars( trim
( $text ) );


}

}


Now that we have created the required functions, let's continue with the meat of the code:


function parsefile($RSSfile){

// Create an xml parser

$xmlParser = xml_parser_create();

// Set up element handler

xml_set_element_handler( $xmlParser, "startTag", "endTag" );



// Set up character handler

xml_set_character_data_handler( $xmlParser, "TxtTag" );

// Open connection to RSS XML file for parsing.

$fp = fopen( $RSSfile,"r" )

or die( "Cannot read RSS data file." );



// Parse XML data from RSS file.

while( $data = fread( $fp, 4096 ) ) {

xml_parse( $xmlParser, $data, feof( $fp ) );

or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));


}



// Close file open handler

fclose( $fp );

// Free xml parser from memory

xml_parser_free( $xmlParser );

}

The above function calls both the startTag/endTag functions to loop through the XML file and displays the contents.




While it is good to have an RSS reader that can read any RSS document, it would be even better if you could store that information in a database and read it at your leisure when you are not connected to the Internet. It would also be good to be able to update your RSS file through the use of the database. It is relatively easy to achieve this, so let's create a table from which we will add our data:


CREATE TABLE `rss_tbl` (

`feed_id` int(5) NOT NULL auto_increment,

`title` varchar(200) NOT NULL default '',

`link` varchar(200) NOT NULL default '',

`description` text NOT NULL,

`the_date` date NOT NULL default '0000-00-00',

PRIMARY KEY (`feed_id`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;

The table will store the individual links as they are read in by the RSS reader. Fill this table with data, using the following format:

  • Title – the title of your story.

  • Link – The link to your story.

  • Description – A short description of your story.


You can then use this data to write to your RSS file :

<?

$fp=fopen(“myrssfile”, “w+”);

if (!$fp){

echo “error opening file”;

exit;

}else{

$query1="Select *,DATE_FORMAT(the_date,'%W,%d %b %Y') as thedate
FROM rss_tbl WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) ORDER BY
the_date DESC LIMIT 10 ";


$result=mysql_query($query1);

while($row=mysql_fetch_assoc($result)){

fwrite($fp,$row[‘title’]."\r\n");

fwrite($fp,$row[‘link’]."\r\n");

fwrite($fp,$row[‘description’]."\r\n");

fwrite($fp,$row[‘thedate’]."\r\n");

fwrite($fp, ” ”);

}//endwhile

fclose($fp);

}//end else

This code does two things. First, it opens (or creates) a file called "myrssfile":


$fp=fopen(“myrssfile”, “w+”);

The "w+" instructs PHP to create the file if it does not exist and to overwrite any contents that it might have. Then it checks to see if there are any problems opening the file:

if (!$fp){

echo “error opening file”;

exit;



If there are problems, the program displays a message and stops execution. If every thing is okay, a SQL query is run that retrieves ten articles from the database that were created in the last thirty days:

$query1="Select *,DATE_FORMAT(the_date,'%W,%d %b %Y') as
thedate FROM rss_tbl WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY)
ORDER BY the_date DESC LIMIT 10 ";


The DATE_FORMAT() function enables us to format the date column in what ever fashion we like. After this the code writes the database data to the file:

fwrite($fp,$row[‘title’]."\r\n");

fwrite($fp,$row[‘link’]."\r\n");

fwrite($fp,$row[‘description’]."\r\n");

fwrite($fp,$row[‘thedate’]."\r\n");

fwrite($fp, ” ”);

That’s it. A file called "myrssfile" should now be available and contain ten articles from the database. With small changes to the table you can expand the database usage and create an RSS aggregator, which is like a online "newspaper" that is entirely made up of RSS feeds from different websites.


To actually enter the data into the database, you only need to create a form that will take the necessary input values and write them to the table. In one of the articles that I wrote about RSS, I discuss how to create and populate an RSS file through a form. Although in that particular article we transfer data from a form to a file, with some small changes you can transfer the data from a form to a database.


Conclusion

To use this code make sure to include “xmlparser.php” in whatever page you are using. Then just call the “parsefile(“yourRSSfileLocation”)” function and your file data will parsed. Also, you might have noticed that in some news sites, the news headlines are scrolling from right to left on the screen. You can achieve this by using the <marquee> HTML tag; Google it to find out how to use it.


Download the xmlparser.php here. This is the same file we link to at the beginning of this article. Next, I will be discussing how to build a RSS File. Till then have fun.