The last time I posted my selection of podcasts was back in 2012. Since then, a lot has changed:
My podcast feed with the reason why I listen to each show:
the dark side of the internet.I love the stories and the way Jack Rhysider tells them.
And there you have it: my list of podcasts of October 2019. (Also available in OPML format.)
]]>A curated list of amazingly awesome open source sysadmin resources.
A curated list of things to read to level up your DevOps skills and knowledgeby Chris Short. (Source: DevOps’ish, issue 043)
PNG
files of the icons so I could use
the same icons in a different system.
Enter
Font Awesome to PNG. It
is a Python script written by Michał Wojciechowski that allows you to do
exactly that: extract the icons from the Font Awesome TTF
file and
save them as PNG
files.
One example of how I used it to get a blue version of the comment icon:
./font-awesome-to-png.py --color "#27a4cd" --size 48 comment
The result is a nice PNG
:
A big thank you to Michał and everyone that contributed to this code.
]]>To get some basic information about your system top is a very useful tool. But sometimes you need a little bit more.
If that is the case, you may want to check out Glances. Here’s an example of Glances in action on my virtual machine:
Besides the basics (CPU usage, load, memory usage) it also displays information like network usage and disk I/O. And incidentally Glances is written in Python.
]]>Examples of persons that went static are e.g. Alex Clark, Daniel Greenfeld and Tarek Ziadé. What these guys have in common is that they all use Pelican.
You could follow their example and use Pelican—and it’s probably a good choice—but I recommend you also at least have a look at Acrylamid. It is written in Python, quite easy to get up and running, it offers all a blog needs (articles, tags, lists of articles, pages and feeds) and the author quickly responds to issues, pull requests and questions. You can write your content in (amongst others) reStructuredText and Markdown. The templates can be Jinja2 or Mako.
Acrylamid is already great. But it is also under active development so it will even get better!
Disclaimer: Since today I use Acrylamid for this blog (more about that in the next article: migrating to Acrylamid). I also contributed some code to the project. So I might be a bit biased…
]]>When developing a Zope based application, the
Products.PrintingMailHost
package can really help you out. By including this package in your
setup, the Zope MailHost
class is patched so no actual emails are
sent. Instead the content of email is printed to the standard output.
But when working on a Django application (or any other non Zope
project) there is no MailHost
class that can be monkey
patched. Python’s
smtpd module to the
rescue. The first step is to configure the application to use
localhost as the SMTP server on a random port (say: 1025). Next, go to
the command line and type:
python -m smtpd -n -c DebuggingServer localhost:1025
Just like the PrintingMailHost, this SMTP server prints the emails to standard output. For more information see the “Testing e-mail sending” section in the Django documentation.
mail_debug
management command. This commands starts the same SMTP
debugging server, but you don’t have to remember the right
incantation.
Somewhat related to this: if you want to test your application against an HTTP server, you can use this command:
python -m SimpleHTTPServer
The SimpleHTTPServer module can be used to get server up-and-running quickly. It can also be a simple way to, for instance, copy files from one machine to another. By running the HTTP server in the directory containing the files, you can access the files via your browser on another machine. Safe? No. Convenient? Yes.
]]>DateTime
module.
Recently I have been bitten by a small difference in the way the DateTime
module parses differently formatted date strings. Naively, you would think there
is no difference between the following two DateTime
objects:
>>> from DateTime import DateTime
>>> DateTime('2009/06/16')
DateTime('2009/06/16')
>>> DateTime('2009-06-16')
DateTime('2009/06/16')
So far, so good. But:
>>> DateTime('2009/06/16') == DateTime('2009-06-16')
False
Wait… What?!?
>>> DateTime('2009/06/16').rfc822()
'Tue, 16 Jun 2009 00:00:00 +0200'
>>> DateTime('2009-06-16').rfc822()
'Tue, 16 Jun 2009 00:00:00 +0000'
As you can see, the way you format the date before feeding it to
DateTime
matters: it may take the timezone into account. And this
can really mess up catalog queries if you use slashes when storing
your content and dashes for the query (or the other way around). I’m
sure this is documented somewhere, but why search for documentation if
you ‘know’ how it works. :)
This time I decided to not wait for four months before updating to the new Ubuntu version. Especially since colleagues reported to work successfully with this new version. I’ve worked with this setup for a week or two now and everything seems to work. Here’s what I encountered:
I expected to run into problems with Python since the Ubuntu packages for e.g. Python imaging and XML (which I need for my day-to-day work) aren’t available for version 2.4 anymore. While Maurits van Rees and Sam Stainsby chose to work with virtualenv, I installed the required packages globally.
Setuptools and
PIL were relatively easy to
install. Just a matter of downloading and running “/usr/bin/python2.4 setup.py install
” (IIRC, to be honest I didn’t document this.)
However, the libxml2
python bindings proved to be a bit harder. I
needed the following steps to get it up and running (thanks to
Hedley Roos and Izak Burger):
limxml2
package../configure
” and “make
”$ CFLAGS=-I/usr/include/libxml2 /usr/bin/python2.4 setup.py build
$ sudo CFLAGS=-I/usr/include/libxml2 /usr/bin/python2.4 setup.py install
The new version of Ubuntu also brought a loud surprise: every time I powered down my laptop a beep was audible. Since it seemed to bypass the sound driver (muting the sound didn’t help) I could not even turn it down. Changing the Gnome settings as recommended did not work; my Dell Precision M65 kept on making the noise.
Luckily the solution provided on
another thread did
work. I added the following line to /etc/modpobe.d/blacklist.conf
:
blacklist pcspkr
And I enjoy the silence once again. As an additional benefit: no more lound beeps if I make mistakes (e.g. trying to scroll pas the end of my Tomboy note, try to use backspace at the beginning of a line in XChat, et cetera). So in a way I’m grateful of the loud beeps at shutdown: I wasn’t annoyed enough by the other beeps to silence them but I’m glad I got rid of them. And so do the people in my environment. :)
At Zest we use the thin (wired) Apple keyboards. They look slick and work quite well. The problem I had with them (besides that we’ve got the Dutch keyboard layout, which has the tilde placed near the “z” instead of where if should be: next to the “1” key) is that the function keys didn’t work. That is: I had to push the “fn” key. Otherwise pressing F12 turned up the volume instead of bringing up Firebug.
On Intrepid I solved this already by having a file called
/etc/modprobe.d/applekeyboard
with the following contents:
options hid pb_fnmode=2
Apparently this didn’t work anymore. Brian K. White on the other hand presented a solution that worked for me.
I’ve now got /etc/modprobe.d/hid_apple.conf
with this line:
options hid_apple fnmode=2
After updating initramfs (“update-initramfs -k `uname -r` -u
”) and rebooting
the machine, the function keys worked the way I like them. (While writing this
blog entry and checking my sources, I see that this information is now also
available on the
AppleKeyboard
page in the Ubuntu Community Documentation.)
python-setuptools
needed manual attention. Other than that: I love it!
Although Intrepid Ibex has been released quite a while ago, and the new release is only a few months away, I finally decided to upgrade. A colleague reported problems with his Nvidia chipset last year and he downgraded to Hardy again. Since I have setup my X so I can use my laptop with an extra monitor, I was afraid I’d also run into problems. A dying hard disk gave me the last push to finally upgrade.
(The hard drive in my laptop made a high pitched noise indicating a
problem with the ball bearings. To replace it, I created an image with
ddrescue
to a USB drive, which worked great! After restoring it I
decided this was the right moment to also test whether the upgrade of
Ubuntu would work. If anything would go wrong, restoring the image
again would be a breeze.)
All in all the upgrade went pretty smooth. There was just a small
problem with upgrading the python-setuptools
package. It probably
went wrong because I
upgraded it manually a while ago. Uninstalling the package (apt-get remove python-setuptools
) and reinstalling it again (yep: apt-get install python-setuptools
) solved it. Okay, I also had to install two
additional packages which were removed since they depended on
python-setuptools
, but that was it.
Since I haven’t done any actual work with this upgraded version, I cannot confirm everything works exactly as it used to. But I am confident I won’t be disappointed. Two things I noted and am very enthusiastic about:
nvidia-settings
utility makes it possible to apply changed
settings immediately without having to log out and in again.Especially the last will help me improve my daily routine! Now I can more easily disconnect the extra monitor I use at the office and take my laptop to e.g the desk of a colleague to pair program without losing the panels and half of my windows or logging out of X. Need to show something on a beamer? No problem, I can connect it and a couple of quick clicks later it just works.
Thanks Ubuntu community and Canonical!
]]>Earlier this week I ran into problems with setuptools on my Ubuntu Hardy Heron system, which uses subversion 1.5. Luckily I wasn’t the first as proven by several other reports.
To be able to develop Plone products properly I had to do two things:
The first part was the easiest: following the instructions (original link not working anymore) I was finished in no time. This prevents the scrambled eggs reported by Maurits.
The second task was a bit more labour intensive (albeit just
slightly). First I had to unpin the version of setuptools in the
buildout configuration. However, since there is no egg available on
PyPI at the moment with a fix,
buildout still uses an unpatched version. But I didn’t like the idea
of inserting a find-link in the buildout configuration. The simple
solution was to download an egg which contained a fix and put it in my
eggs
directory. (On a sidenote: I use a single egg directory for all
my Plone instances on my development machine. This makes this solution
viable.)
I’m not completely happy with the current situation, but at least I can continue working. Let’s hope a fixed version of setuptools will be released soon…