Quickly post gists to GitHub Enterprise and github.com

The gist gem from GitHub allows you to quickly post text into a GitHub gist. You can use it with the public github.com site but you can also configure it to work with a GitHub Enterprise installation. To get started, add two aliases to your ~/.bashrc: alias gist="gist -c" alias workgist="GITHUB_URL=https://github.mycompany.com gist -c" The -c will copy the link to the gist to your keyboard whenever you use the gist tool on the command line....

2014-08-08 · 1 min · Major Hayden

Getting apache, PHP, and memcached working with SELinux

I’m using SELinux more often now on my Fedora 15 installations and I came up against a peculiar issue today on a new server. My PHP installation is configured to store its sessions in memcached and I brought over some working configurations from another server. However, each time I accessed a page which tried to initiate a session, the page load would hang for about a minute and I’d find this in my apache error logs:...

2011-09-08 · 3 min · Major Hayden

Reincarnation of Twitter’s realtime XMPP search term tracking with ruby

When Twitter was still in its early stages, you could track certain search terms in near-realtime via Jabber. It was quite popular and its performance degraded over time as more users signed up and began posting updates. Eventually, Twitter killed the jabber bot altogether. Many users have asked when it will return. Well, it hasn’t returned, but you can build your own replacement with ruby, a jabber account, and a few gems....

2010-06-17 · 2 min · Major Hayden

Idiot’s guide to OAuth logins for Twitter

It certainly shouldn’t be difficult, but I always have a tough time with OAuth. Twitter is dropping support for basic authentication on June 30th, 2010. I have some automated Twitter bots that need an upgrade, so I’ve been working on a quick solution to generate tokens for my scripts. I formulated a pretty simple script using John Nunemaker’s twitter gem that will get it done manually for any scripts you have that read from or update Twitter:...

2010-05-20 · 2 min · Major Hayden

New Linux security advisory Twitter bots

Thanks to the simplicity of ruby as well as the twitter and httparty gems, I’ve whipped up some Twitter bots today. The three bots will alert you when there are Red Hat, Ubuntu, or Debian security advisories. I’d set one up for Fedora, but their feed is broken today. @redhaterrata - Red Hat Errata Updates @ubuntusecurity - Ubuntu Security Notifications @debiansecurity - Debian Security Advisories As always, you can let me know if you have any suggestions for improvements, or other bots you’d like to see....

2009-02-05 · 1 min · Major Hayden

Viewing documentation for your ruby gems

I stumbled into this four line ruby script that will serve up all of the rdoc documentation for your server’s currently installed gems: #!/usr/bin/env ruby require "rubygems/server" options = {:gemdir => Gem.dir, :port => 4242, :daemon => true} Gem::Server::run(options) Thanks to Daniel for the ruby code!

2008-11-06 · 1 min · Major Hayden