NodeMCU
The NodeMCU is an open-source firmware and development environment based on the Lua script language for the ESP8266 wifi-enabled microcontroller. For easy development there is available the NodeMCU devkit board that map the contacts of the ESP8266 chip to easy to use pins and contains extra hardware, such as a serial port to USB adapter to flash new firmwares, update the scripts or simply communicate with a PC.
Generating a new firmware
The easiest way to generate a new firmware is to use the online service: NodeMCU Build In it, you only need to select the modules you want to be build into the firmware and then download the generated firmware binary file.
Flashing the firmware
One of the options for flashing a new firmware into a ESP8266 under GNU/Linux is to use this tool: ESP Tool (GiHub) or File:Esptool-master-20151216.zip (Tuxamito).
Under the directory where the tool you will execute the command:
$ ./esptool.py --port PORT write_flash 0x00000 FIRMWARE.bin
where PORT is the serial port to where the hardware is connected (and you need to have read and write permissions for the user) and FIRMWARE.bin is the binary file of the firmware to flash. An example:
$ ./esptool.py --port /dev/ttyUSB0 write_flash 0x00000 ~/Downloads/nodemcu-master-14-modules-2015-12-23-21-28-43-float.bin
http://lb9mg.no/2015/05/30/first-steps-with-nodemcu/