Not hard at all to pretend to be a dude on the internet because harrassers are looking for obvious marks.
Here is my simple list.
Dude name. Just sort of lazily masculinize your current name. So if it were Eliza it could be Elton or Billie could be Bill.
Don't post selfies.
Don't talk about your period or PMS.
Once in a while claim you got an injury doing something stereotypically manly. For bonus convincing steal a real story from a male friend or relative so you can share a picture of the damaged limb.