Saturday, February 1st, 2014

Website made entirely using ncurses!

As an interesting proof-of-concept idea, I built an entire website, my personal profile page using nothing more than ncurses and a vt100 terminal emulator! I recently unleashed it out into the public, and there was lots of positive and nostalgic responses. This is only the first iteration of the site, and more features will be coming soon.

The result was unexpectedly usable! Although hosting such a site is only ideal for low traffic websites as the server resources can really be used up by each forked Python process. How it works is simpler than you might imagine, it is merely a standard Python console application running directly in the browser! To obtain the vt100 emulation and access to the Python application, I used a popular remote shell tool called Shellinabox. Shellinabox is normally used to provide a Linux admin with a remote login shell via their browser to administer the server, just as he/she would while using SSH. Shellinabox can actually run any terminal program you tell it to run, and this gave birth to this idea. I first tested it by running Lynx in a web browser directly, so accessing a page would immediately display the popular Lynx browser. Amazingly, the mouse was also able to control Lynx! So... I thought, if I could make my own ncurses application which can also use a mouse, I could build an entire website using just ncurses!

You can view it live by clicking on my name below my photo in the right bar of this website. There is also an alternative telnet interface for those whom don't have a graphical browser handy, as vt100 emulation requires a decent JavaScript engine.

This is more of a proof-of-concept, as I am planning on building this idea further with a complete recode of my Hacker's Edge massively multiplayer online game. I had some difficulties making Hacker's Edge what I wanted it to be, and I believe turning it into a full Python console application with some ncurses components might be what I need to really make this game take off. The game will end up featuring both a web-based vt100 terminal emulation for those without a compatible Telnet client, and telnet connection support. The new idea will be to add a better network simulator, many console applications, and a fake assembly language to built fake viruses and malware to create fake botnets. Think of it as a Grand Theft Auto for CyberCrime! As you can see from my Bitbucket page, I have been creating some specialized applications, such as the CPU simulator, which will make it's way into Hacker's Edge.

Comment #1: Posted 7 years, 8 months ago by Itamar Turner-Trauring

Twisted has a (much less capable than ncurses) library called insults which would let you build stuff without having a Python process per web client. You could probably serve thousands of web pages with a single Python process. For example:

Comment #2: Posted 7 years, 8 months ago by Kevin Veroneau

@Itamar, Thank you for that. I was looking at twisted awhile back, and may very well get back into it soon.

About Me

My Photo
Names Kevin, hugely into UNIX technologies, not just Linux. I've dabbled with the demons, played with the Sun, and now with the Penguins.

Kevin Veroneau Consulting Services
Do you require the services of a Django contractor? Do you need both a website and hosting services? Perhaps I can help.

This Month

If you like what you read, please consider donating to help with hosting costs, and to fund future books to review.

Python Powered | © 2012-2019 Kevin Veroneau