Jordan Sissel (semicomplete.com)
Projects, articles, tips, and experiences on topics ranging from AJAX to Network Security.
Updated: 13 hours 4 min ago
November 8, 2009 - 4:14pm
Hop on over to the keynav project page and
download the new version.
The changelist from the previous announced release is as follows:
20091108:
- Added xinerama support.
* Default 'start' will now only be fullscreen on your current xinerama
display. read more »
November 8, 2009 - 4:56am
Ruby, like many other dynamic and modern languages, makes it easy for you to do
fun stuff like metaprogramming.
Ruby, also like other nice languages, comes with a builtin documentation
generator that scans your code for comments and makes them available in html
and other formats.
... until you start metaprogramming.
Take a simple example, the Fizzler! read more »
November 3, 2009 - 4:54am
Lots of changes since the last announced release. Grok should get some
more activity now that I'm actually using it in a few places. If you
find bugs or have feature requests, please file them on googlecode
issue tracker (see below)
The largest changes are:
- we ship with Ruby and C API.
- lots of new testing code.
- we now use tokyocabinet internally instead of bdb. read more »
October 30, 2009 - 4:24am
With all the TDD (test-driven design) and BDD (behavior-driven design) going
around these days, it'd be a shame not to use these tools on monitoring
applications.
You might have a boatload of tests that test your application before you roll a
new version, but do you use those tests while the application is in production?
Can you? Yes!
Let's take an important example of monitoring some complex interaction, like
searching google and checking the results. Simple with a mouse, but perhaps
complex in code. read more »
October 26, 2009 - 10:27pm
I see this in my server logs quiet often:
Oct 23 05:37:48 pww-5 snmpd[23946]: Connection from UDP: [XX.XX.XX.XX]:34650
Oct 23 05:37:48 pww-5 last message repeated 16 times
Oct 23 05:37:48 pww-5 snmpd[23946]: Connection from UDP: [XX.XX.XX.XX]:34652
Oct 23 05:37:48 pww-5 last message repeated 24 times
Googling points out that in snmpd.conf we should use
"dontLogTCPWrappersConnects" - but thet top search results claim that it
doesn't work (syntax errors, etc).
I tried this:
dontLogTCPWrappersConnects
This makes an error of:
/etc/snmp/snmpd.conf: line 29: Err read more »
September 29, 2009 - 2:54am
Use the ObjectSpace class to find all ancestors of a given class.
class Foo; end
class Bar < Foo; end
class Baz < Foo; end
subclasses = ObjectSpace.each_object(Class).select do |klass|
klass.ancestors.include?(Foo) and klass != Foo
end
# prints "[Baz, Bar]"
puts subclasses
Of course, you could always override Class#inherited instead, but if you don't
want to override methods, the above is a reasonable choice.
read more »
September 28, 2009 - 2:41am
I recently had to do a master failover in mysql to bring up a new mysql master
to replace an older one.
The switchover went awry shortly after we told the old master to start slaving
off of the new master. The output of 'show slave status' indicated a halt of
replication due to foreign key constraints: an auto_increment primary key had a
duplicate insert attempt. How did this happen? I'm not sure yet, still digging.
This puzzle made me wonder how we got into that state given that I put the old
master in 'read only' mode before doing the switch. read more »
September 24, 2009 - 2:20am
Got a program that can't setuid but needs to listen on a priviledged port? I
was hacking around with Linux's capabilities(7) tonight and came up empty
trying to allow a non-priviledged user to bind to port 80 without having to
start as root - after all, not everything is capable of setuid on startup, like
many java programs.
Speaking of java, if you do setuid, the java hotspot monitor file thing
(/tmp/hsperfdata_<user>/<pid>) is in the original user's directory,
not the setuid'd user, so you can't jstack reliably. I might be PEBCAKing it,
but this is the behavior I observe. read more »
September 22, 2009 - 10:28pm
There's some hot debate around the implications and rightness of service
providers to do things like traffic filtering, session hijacking, etc.
I'm not here to talk about that. The data below aims to focus on the technical
failures induced by dns hijacking, or dns redirection. I won't bore you with
the moral, political, or philosophical discussion around this topic.
Here's a summary if you don't want to read the details:
- DNSBLs probably don't work anymore for Comcast users
- Owned domains (semicomplete.com, google.com, etc) are also subject to hijacking. read more »
September 21, 2009 - 10:22pm
I wanted to test something quickly out in C, but didn't want to write the 5
line of code to do it. read more »
September 12, 2009 - 3:48am
A project I'm working on has some odd slowness about it. Using ruby-prof, I
found that String#scan was consuming most of the time, but ruby-prof didn't
tell me where it was coming from. A quick hack that replaced String#scan with
my own method showed who was calling it, DateTime.strptime -
class String
def scan(*args)
raise
end
end
I tried using the ruby debugger to break on String#scan, but it didn't seem to
work. read more »
September 11, 2009 - 2:25am
I was working on a new python 2.6 rpm to push at work and started wondering
about how to get python eggs to become rpms. Ruby has a gem package called
gem2rpm that aids in generating rpms from ruby gems, but there's not really an
egg2rpm project.
We're in luck, though. Python's setuptools supports generating rpms by default,
it seems. read more »
August 16, 2009 - 11:36am
I only noticed this now. Perhaps it is old.
% dig +noquestion +nostats +nocmd +nocomments www."I wonder if this query will return".com
www.I\032wonder\032if\032this\032query\032will\032return.com. read more »
August 15, 2009 - 6:55pm
Hop on over to the xdotool project page and
download the new version.
The changelist from the previous announced release is as follows:
20090815:
* Incorporate patch from Henning Bekel which adds a new ability to change
window properties such as window name, icon name, class, role, etc. read more »
August 7, 2009 - 1:50am
Just started playing with Munin as a potentially better option than Cacti
(hard to automate) for trending. I have about 30 hosts being watched by
munin. The munin update job (which fetches and regenerates graphs, etc), by
default, runs every 5 minutes. It takes almost 4 minutes to run on a 2.5gHz
host. If we add any more things to monitor it's likely that we'll soon overrun
the 5 minute interval.
Examining the process, it looks like most of the time is spent generating
graphs. read more »
July 29, 2009 - 2:34pm
All DNS servers should respond to invalid domains with advertisement space
</sarcasm>, but OpenDNS takes it a step further, by responding to A
record queries that aren't possibly valid:
% dig +short @208.67.222.222 "When is no-pants-o-clock?"
208.67.219.132
% dig +short @208.67.222.222 "$(dd if=/dev/urandom bs=1 count=30 2> /dev/null)"
208.67.219.132
Good job.
read more »
|
|
|
|