signal0

examples of pygment styles

So in this blog post I talked about how you’d have to test each of the pygments styles for yourself. Well, turns out that’s just not true, thanks to Favio Manriquez Leon over at http://favrik.com/. He posted a cool page with an example of all the built in pygments styles at http://blog.favrik.com/2011/02/22/preview-all-pygments-styles-for-your-code-highlighting-needs/

Enjoy!

signal0 now on github

Some friends asked that I share my site source and so I figured it was probably worth sharing with the world. I’ve added a link over on the sidebar to my github repository for the signal0.com source code (and learned how to add my own sidebar entries - I’ll put a blog post up about that soon).

I figure I might as well give a quick outline of how I got the code into github just in case folks were curious.

Read more...

Syntax+pep8 checking before committing in git

UPDATE 2012/08/13: I’ve updated the git hook code per suggestions from folks in the comments.

I write quite a bit of code in python. As a considerate python programmer I tend to try to follow PEP8 as best I can. That said, even though I’ve been working with python & pep8 for years it’s still easy to forget the little things.

While PEP8 is great while you’re working alone, it’s even more important when you’re working on code with other people. Wouldn’t it be nice if you could make sure that every piece of python code you push into your repository that other people might see is pep8 compliant? Fortunately this is very possible, and you can even add some syntax checking as well thanks to Tarek Ziade’s awesome flake8 script.

Read more...

Modifying Tinkerer Themes

Update: After I wrote this I ended up going back to the ‘native’ pygments style. The reason was that monokai didn’t seem to produce css for the shell console code-block type, and I wanted those blocks to be pretty like the rest of them.

So one of the reasons it took me so long to create this site was that I had a really hard time finding a system I liked to create it with. My thought process on that is probably the content of another blog post, but since I’m in the middle of working on making this site the way I want it I figured I’d share some of the things I’ve found about the static blog generator I settled on, Tinkerer.

While for the most part I really enjoyed Tinkerer’s default theme (modern5), one thing I wanted to mess around with was the theme it used for syntax highlighting.

Read more...

signal0?

Or ‘Where did the name signal0 come from?’

It comes from a ‘trick’ I like to use in unix shell scripts.

Basically when you want to check to see if a process is running with a given process ID in unix there are a lot of ways to check - but the way I think is the best is to execute a ‘kill -0 <pid>’. On my laptop I want to check if there is a process with a PID of 777:

$ kill -0 777
-bash: kill: (777) - No such process
$ echo $?
1

Or, used in a simple shell script that tells your nginx process is running:

1
2
3
4
5
6
7
8
9
#!/bin/sh

_pid=`cat /var/run/nginx.pid`
if kill -0 $_pid 2> /dev/null
then
    echo "nginx pid $_pid is running."
else
    echo "nginx pid $_pid is not running."
fi

A while back (like 2010?) I was looking to start a blog to write about various techy things I was working on and so I started looking for domains. Took a look, and sure enough signal0.com was available.

Of course I bought the domain, but then I never got around to actually writing that blog. Well here we are two years later. Lets see if I’ll keep up on this.