Decibel (decibel45) wrote,

Ahh, SQL (or, my own personal DailyWTF)

I'm in Chicago right now. I wanted to do something on my other laptop, which is sitting in the loft at home. No problem; since it's running a real OS, I can just SSH in via my server at home. Except I can never remember what IP address it always gets handed.

After some random guessing, I try and get the ability to query mDNS setup on my FreeBSD server. After screwing around with that for a while I give up. Then inspiration strikes, and I whip up the following in psql:

select 'ping -c 1 '|| a || '>/dev/null && touch ~/tmp/'||a || ' &' from (select '192.168.42.'||b from generate_series(50,254) b) a(a)
\g | tcsh

I now have a set of files in ~/tmp that match IP addresses. 4th one I try is the charm.

Yay PostgreSQL! :)

  • On the importance of diversification...

    One of the newsletters recently made a sell recommendation on a stock that's been a huge loss. I was reading the board for that stock…

  • Pool party!

    Sunday, 2PM-???. Grill will be going and I'll have burgers and chicken, but feel free to bring something else by if you want.

  • Lets memorialize memorial day!

    Party at cowhaus, Monday, Memorial Day (the 25th). Start at 2PM. I'm going to smoke a brisket and probably do something else as well. We have some…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.