An all purpose swear word originally used by punks before made popularized by the british television show Red Dwarf dispite popular belief smegs origins did not have to do with smegma which is a crusty substance that develops underneath foreskin.
The shortened version of the word "smegma", which is defined as: coagulated semen surrounding the end of the penis; also found in the hair of high schoolers