>Fun with RSS feeds and hash tags

>Here’s a fun tip I had thought about but never gotten round to looking into: making the most of Twitter and your RSS feed reader!

I follow quite a few people on Twitter now. It helps me keep up-to-date with interesting articles in my field, find out what peers are doing, catch up on the latest funnies — but there comes a time when you’re following so many people that your stream becomes simply unmanageable — you just don’t have enough time to read through everything. And perhaps that’s the point; you’re just meant to quickly skim through the information, trust your subconscious to pick out items of interest.

And then, there are a few tricks that help keep you focused, like the one posted by Mark Sample on ProfHacker: it allows you to view items marked with hashtags as an RSS feed:

http://search.twitter.com/search.atom?q=%23xxxx

Here’s another one I like, as seen on SEO Alien – RSS feed for a particular person:

http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=xxxx

Now I could be wrong about this, but I don’t think the API implements a search for content limited to the people you follow. Presumably, you could write a ruby script that does this, though – or use your google-fu. Observe:

site:twitter.com @brucon volunteer

will return all tweets from (or mentioning) the user @brucon, with the word “volunteer” in it. You can toss that into a google alert as a feed (www.google.com/alerts), et voilà! Filtered twitter feeds. Note: the above search works fine on google.com but when I put it through google alerts, it gave me a smaller set of results – ye be warned.

>Inventory fun with Kaseya and Service Tags…

>… aka “how to grab all your dell service tags from kaseya and pipe them to Dell without going crazy”. I think the first title is catchier.

I’m sure that you sysadmins out there have been asked by your Finance department to provide an inventory of IT equipment; usually this is right before an audit or something, or when you’re selling off old equipment. It’s not like we’re tracking millions of machines in our company… But I’m not big on running around trying to track down information that’s readily available in my existing systems, are you?

In case you don’t know Kaseya, it’s an IT management systems solution — basically an auditing, monitoring, scripting, remote control, patching and reporting solution. I think there’s a version of the software that also cooks and does the dishes for you. Neat.

So this hack works nicely for Kaseya — but you could probably also come up with a version for other auditing software such as LanSweeper.

Here are two bits of code. The first bit you can execute on the SQL server hosting Kaseya, and the second bit you can execute on your handy dandy linux box (hell, an Ubuntu LiveCD or ArchLinux VM will do the trick). Hope this helps 🙂

SQL Query
select Name, OperatingSystem, WhenCreated, chassisType, chassisManuf, chassisSerialNum
    from kadComputers inner join auditRsltSmbios on kadComputers.deployedAgentGuid = auditRsltSmbios.agentGuid
    where DomainName = ‘who-hq-mmv.int’
    order by Name, WhenCreated

What you can do is save this output as a CSV. If you do that, you can parse the results in a ruby script and have it retrieve all service tags’ shipment dates:

GetServiceTag.rb
# GetServiceTag – Take batches of service tags and extract their ship dates.
# Very practical when you’re doing inventory…

FIELD_INDEX = 5 #Change this if you have changed the SQL query
servicetag_file = File.open(“queryResults.csv”, “r”)

puts “servicetag, date”
servicetag_file.each do |servicetag_line|
    servicetag = servicetag_line.chop.split(“,”)[FIELD_INDEX]
    date = `curl “http://support.dell.com/support/topics/global.aspx/support/my_systems_info/en/details?c=us&cs=RC956904&l=en&s=hied&servicetag=#{servicetag}&~tab=1” | grep “Ship Date:” | egrep -o [0-9]+/[0-9]+/[0-9]+`
    puts “#{servicetag}, #{date}”
end

Like I said, this works for Kaseya, but the same process could work just fine for LanSweeper; it also runs on an SQL database. I like LanSweeper; good interface, very practical for quick searches on your campus machines. I did find, ahem, a small problem with the default installation’s security – still checking the impact of the problem though. But a great tool to have in your toolbox nonetheless. Wouldn’t it be great if we could also collect Service Tag information with LanSweeper? Something like, I don’t know, select Computer, Username, SerialNumber from tblComputers inner join tblBIOS on tblComputers.Computername = tblBIOS.Computername? 😉 If you do make use of this query, though, do remember that you’ll have to change the FIELD_INDEX in my GetServiceTag script…

So there you have it. Impress your Finance Department! Make the most out of your Kaseya server! Don’t spend late nights doing something that your machine could spit out for you in a fraction of time! Etc. etc.