Thursday, February 19, 2015

leveling up with tail -f: linux live view of error logs

I've been using 'cat' every time I wanted to look at a log view --which was often when I was in the middle of debugging.

You don't have to do that.

http://www.howtogeek.com/howto/ubuntu/a-live-view-of-a-logfile-on-linux/

 instead, just use

tail -f /path/to/thelogfile.log , 


which gives you a live view of your log file.

===============
edit: I've been using this for awhile now and just today I was having issues with wanting to search through the log without leaving the tail -f call.  The solution to that is listed here:

http://www.brianstorti.com/stop-using-tail/

Basically, you can use the same "follow" capability in Unix "less" if you only need to follow one file.

less +F /path/to/thelogfile.log

The cool thing here is that you can use vi navigation and search commands to get around quickly.

Also, it's fairly common that I've been using vim to look at files that I don't want to alter.  It might make more sense to just start out with less.

Saturday, February 14, 2015

Gorgeous vanilla javascript to make a simple Pong using only canvas

I've been thinking about getting into vanilla javascript and specifically into the canvas element.  You can read through tutorials and so on, but nothing is nicer for something like this than seeing good code.  It's even better if it's simple.

So tonight I felt extremely lucky to happen upon this:

Ben Shepherd did a screencast of himself coding up a very simple pong using Javascript canvas here (check out the music on this video too):

https://www.youtube.com/watch?v=ITmH-W49Mvk

But, even better he posted the code.  It's beautiful, with good patterns, and it's extremely easy to understand.  Wow.

Here's the code (and, since this is JS, it's a working Pong):

 http://passion4web.co.uk/ben/pong.html

Friday, February 6, 2015

Django in ipython notebook

Holy moly:

I've been using ipython notebook forever.  And I've been working intensively with django for many moons.  I just didn't know that they two could be married so easily.

Enter django_extensions .

For the details, check out this blog post:

http://opensourcehacker.com/2014/08/13/turbocharge-your-python-prompt-and-django-shell-with-ipython-notebook/

12 factor apps

I was reading through the "django-configuration" documentation and found a reference to a fascinating document that may be worth reading through.  Here's a link:

http://12factor.net/

It seems to be about making maintainable, portable applications.  Yeah, I'm kindof excited about it.

Thursday, February 5, 2015

tool of the day: netstat

Want to know what's going on in your box?  Use netscan.  It will name every port along with the application that uses it.

$ sudo netstat -nlp