Install, configure a printer in Linux for Windows network.

sudo apt-get update
Install drivers and CUPS.
sudo apt-get install printer-driver-foo2zjs printer-driver-foo2zjs-common sudo apt-get install cups cups-filters
See if driver was installed. Replace MODELNO with your printer model number.
sudo getweb MODELNO sudo lpstat -s
If nothing shows up, try to unplug and reconnect your printer.

Print a test page.

Create a document.
touch test.txt
write something and close.
nano test.txt
lp test.txt
...and your page should roll from the printer!

Share printer with Windows

Install Samba.
sudo apt-get update sudo apt-get install samba
Configure Samba.
nano /etc/samba/smb.conf
Near [PRINTERS], make sure these are like so:
[printers] browseable = yes guest ok = yes
Restart Samba.
sudo service smbd restart sudo service nmbd restart
Update firewall.
sudo ufw allow 139/tcp sudo ufw allow 445/tcp sudo ufw allow 137/udp sudo ufw allow 138/udp
Find your printer name.
sudo lpstat -s
In windows, go to configuration > printers > add printer > add network printer. Now Windows will try to find it. If everything works, you see the printer appearing. Good. Add it and you are done. Windows will probably complain about drivers. Select the best driver, and if there isn't any, select the generic driver. These drivers will only print text! for best results, download the drivers from the manufacture website. For HP laser printers we uploaded some generic inhouse drivers however do not rely on them, always use the drivers from the manufacturer first. Done.