I'm curious to know the various ways that cubesat electronics can be protected from the effects of cosmic rays or solar events while in LEO. How different are the components used in cubesats from some off the shelf boards like Arduino or Raspberry Pi for example?
Radiation shielding in a cubesat (and spacecraft in general) is a tricky thing because radiation shielding adds mostly negative factors to the satellite. In general, the heavier your shielding is and the larger it is, the better it will work. Both of these are obviously no-go for a satellite that's supposed to be as light and as small as possible. This combined with the frequently short mission times of cubesats means that often there is no physical radiation shielding.
Radiation shielding on small satellites is instead done with software, electronics, and redundancy. For example, by having multiple computers, a single fault can easily be detected and that computer diagnosed and handled.
Electronics features also act to handle radiation events. The Cube Computer which is sold by the cubesat shop has multiple radiation resistance features. For example it has:
SEU protection by means of an FPGA-based EDAC
SEL protection by detecting and isolating latchup currents
Internal & external watchdog for added reliability
SEU (single event upset) and a SEL (single event latchup) are both events which could be triggered due to a particle interaction with the processor. A watchdog process is a process which is usually separate from the main program and "watches" to make sure nothing goes wrong. If it detects an issue, it usually forces a reset or other countermeasure. Having a internal and external watchdogs means that the processor has a watchdog built into it but that there is also a separate chip running a watchdog process.
Probably the most prolific cubesats to date, the MarCO pair, don't have any extra radiation shielding but similarly to the "Cube Computer" they had electronic and digital countermeasures for radiation events such as a "cascaded watchdog system" and state that "the radio has been designed to be radiation tolerant". Radiation tolerance includes a variety of physical (chip materials) and logical features.