How can I identify the poles of the magnets?

There are several simple methods that can be used to identify the (Scientific) North and South poles of neodymium magnets.
1)  The easiest way is to use another magnet that is already marked. The North pole of the marked magnet will be attracted to the South pole of the unmarked magnet.
2)  If you take an even number of magnets and pinch a string in the middle of the stack and dangle the magnets so they can freely rotate on the string, the North pole of the magnets will eventually settle pointing North. This actually contradicts the "opposites attract" rule of magnetism, but the naming convention of the poles is a carry over from the old days when the poles were called the "North-seeking" and "South-seeking" poles.  These were shortened over time to the "North" and "South" poles that we know them as.
3)  If you have a compass handy, the end of the needle that normally points North will be attracted to the South pole of the neodymium magnet.

Will magnets erase my hard drive or harm my computer?

Not unless you really work at it. While you probably don't want to stick magnets directly to your computer case, having them nearby will not harm your computer. Magnets can damage floppy disks and magnetic tape storage media, so you must keep magnets away from these items. They should not, however, damage any data on your hard drive unless you place a very large and powerful magnet directly on top of the drive.  Every hard drive already contains a powerful neodymium magnet, so one moving around outside the case will not affect the data.