Import/create your file in this URL. Then generate the .hex
file.
https://config.qmk.fm/
Flash your keyboard by pressing the buttom on the back.
To check if it is indeed in flash mode, check it by running $ lsusb
it should show the name of the microcontroller in one of the items (in my case ATMEGA32U4
)
$ sudo dfu-programmer erase atmega32u4