linux

$ fortune ruby

More often than I’d like, I have to open the Pickaxe to look up a core class or module that I can’t quite remember the methods on. I wanted to put some reminders in a place I could review them daily, yet was unobtrusive.

Enter the Phosphor screensaver for X-Windows; it scrolls text from a file or command by the screen. I pulled the classes and modules I wanted from the “ri” utility, made them into a “fortune cookie file” (run “man fortune” for details on fortune), and then piped fortune’s output through the screensaver.

I’ve attached the files I made. Unzip and drop them in /usr/share/games/fortune (or wherever fortune cookie files go on your system) and you’ll be able to type “fortune ruby” at a command prompt. Only core classes are included, but I’ll make a separate one for Rails on request. You can set up Phosphor (or other text-display screensavers like StarWars) from the xscreensaver control panel.

RubyFortuneCookies

Edit: On systems using gnome-screensaver, save this in your screensaver config folder, probably as /usr/share/applications/screensavers/xscreensaver-phosphor-ruby.desktop:

[Desktop Entry]
Encoding=UTF-8
Name=Phosphor - Ruby ri
Comment=Draws a simulation of an old terminal, with large pixels and long-sustain phosphor. On X11 systems, This program is also a fully-functional VT100 emulator! Written by Jamie Zawinski; 1999.
TryExec=phosphor
Exec=phosphor -root -scale 2 -program 'fortune ruby'
StartupNotify=false
Type=Application
Categories=GNOME;Screensaver;

…then select “Phosphor - Ruby ri” in your Screensaver Preferences. This should also scale back the text so you can see the whole ri screen.

ri - StarWars

Ruby
development
linux

Comments (0)

Permalink

Playing with Fedora 8 on the new Dell at work… Pretty nice. I feel like I jumped from Windows 95 straight to XP. It’s fast. Firefox popped up in 3 seconds. Even turned on wobbly windows for the hell of it. The main system menu and the various app menus still aren’t organized worth crap, though.

OK, why the hell can’t I find a Windows text editor with a “Filter Selection Through Command” option? TextMate has it. Even freaking KDevelop has it. Ctrl-A, Shift-space, “sort”, Enter, and my document’s sorted. (The Ctrl-space is a custom setting.) And piping it through Ruby only takes a fraction of a second.

Oh, I could very readily become a Linux user for that alone. But the experience outside my editor might drive me mad. Wonder if TextMate would be as fast as KDevelop?

Heh, 8 days till I’m outdated again - that’s when Fedora 9 is released.

linux

Comments (0)

Permalink

cat and control-d…

My latest way to make Windows play nice with Linux is to paste in files via the terminal. I do:

$ cat > file.txt
[pasted content]
^D
$

That Control-D ends the file and puts me back at a prompt, with [pasted content] saved safely in file.txt.

Well, I just realized the same thing will work with xargs. I had some noisy terminal output that contained some file names I needed to delete. I copied it out, pasted it to my favorite text editor, played around with it until only file names were left, and then did this:

$ cat | xargs rm
[pasted file names]
^D
$

And voila - the files are gone. I haven’t used this (or xargs) extensively, so try at your own risk, but it seems to work nice so far.

applications
linux
unix

Comments (0)

Permalink