Tag Archives: command-line

HOWTO monitor your servers via Twitter

Alert: your server has failed!

UPDATE: thanks to a reader’s comment I looked into what it would take to get this working again since Twitter has completely disabled the old style of authentication in favor of full on OAuth. Basically a lot. To just post messages now it seems far more complex than it once was.My original idea with this was to do it as low tech as possible so users wouldn’t have to install a ton of stuff and configure it – I wanted it to ‘just work’ easily. Now with OAuth it seems this will never work easily, first of all you have to ‘register an application‘ for it to have access to OAuth – which seems crazy to me, we don’t want it to have access, just the ability to push a message to an account. Then if you look there are libraries out there that *can* post, but look at the directions for one of the libraries, it involves not only building the app and getting temporary access to the twitter API, then you also have to get the two keys from that and bake them into the app by recompiling it, and then more configuration, etc. So for now I am MARKING THIS IDEA AS DEAD. If I figure out a new way to do it that I can sketch out I will, or if anyone else has a simple way post it in the comments and I’ll update it here. Thanks for your interest and good luck!

HOWTO securely delete files in OS X on the commandline

So I’ve had my MacBook Pro for a few months now, and since I have a 500 Gig harddrive, I haven’t bothered to empty my trash yet. I’m currently on a work trip in China, and it makes me think about the privacy (internet and otherwise) that I have in the US, that I don’t expect here. In fact, since we’re blocked from posting to either Facebook or Twitter, I know this post will only make it there because this site will post if for me after I post it to my site (again, not something you’d think about just living in most other parts of the world). So what a good time to learn how to securely emptying my trash! The first thing I did was use the ‘Secure delete’ feature of the OS X trash folder, but with over 190,000 files to remove, it sat there at 0% while the fan spun up for about 15 minutes. That was it for me, it was clear it was going to take years for this to happen, so canceled that and hit Google to learn the right way to do it via the commandline. One of the best pages talks about srm a secure file deletion for posix systems that is installed by default on OS X. I’ve crafted my srm command to use the nice command to reduce the amount of overhead the process causes (again, the GUI version was taking over the system and heating things up quickly) and the sudo command to ensure all files would be deleted regardless of permission/ownership. In the end in looks like this: