Tips & tricks from my 4 months at Pythian
After working with Yanick Champoux on a few little Perl projects here and there, we finally met face-to-face at YAPC::NA last summer. A few months later, when I was looking for a co-op position, I immediately thought of Pythian.
They’re a mid-sized company in Ottawa that does database services. They’re the expert DBAs you hire if you don’t have your own (or enough of your own). Their in-house development team works on 2 major pieces of software: Support Track, a ticket tracking web application, and Avail, a server monitoring tool. I was hired to do quality assurance on these two systems over the winter semester.
A lot of the testing was manual, and I learned a bunch of new techniques for testing and debugging web applications. Because I did a bunch of little things while I was there, I wanted to share a bunch of little tips & tricks you might find useful if you don’t already know about them.
Testing/debugging tips & tricks
openssl s_serverands_clientare a simple server and client included with the standard OpenSSL installation. If you need to see what your SSL server or client is doing, these provide the instrumentation you’re looking for. I used this extensively in my testing for a project adding SSL support to an HTTP client library – see also SSL Security in HTTP::Tiny.telnet,netcatmake a nice server/client pair for plaintext protocols like HTTP or memcached.mtris the best of ping and traceroute rolled into a single package.perldoc -lwill tell you which module is being loaded.Module::Versions::Reportis also very helpful.- Symlinks are often used to provide a kind of versioning for a directory. To switch the symlink to the new target atomically, do:
ln -s new-thing link-tmp && mv -Tf link-tmp link– themvmakes is atomic.. If you try to give the symlink a new target withlndirectly, it isn’t atomic. Usestraceif you don’t believe me. cphas a-sflag that makes symbolic links with a less confusing syntax thanln.- To follow a file being appended to while also being able to scroll back and forth, use
lessand pressFto follow just liketail -f. - To make columnar data from various commands actually readable, pipe into
column -t. - perltidy is your friend.
- Just do
echo 'alias fail="tail -f"' >> ~/.bash_alisesalready and be done with it!
Posted: May 19th, 2012, by Mike Doherty
Categories: Linux, Perl, Programming, Work
Tags: Linux, Perl, Pythian, yanick
Comments: 4 Comments.
Great tips, thanks for sharing!
Funny how you do ‘alias fail=”tail -f”‘. I usually do ‘alias duff=”diff -u”‘ ;-)
The ‘cp -s’ one is not very portable (not POSIX) as ‘ln -s’ is.
For example, it may not work in Solaris, FreeBSD, OpenBSD, etc.
Anyway, reading ‘strace’ in the previous paragraph, the context of the tips, is clear enough :-)
Nice tips.
Very nice post. Thanks for sharing these. On the topic of aliases, I always use alias rm=’rm -i’; so for mv and cp. Saved my behind more than once.
[...] Tips & tricks from my 4 months at Pythian, I showed how to give a symlink a new target atomically. I wasn’t aware of any module to [...]