Short program snippets for performing various system tasks in C