Thursday, November 26, 2009

Fedora Core 12 on PS3

I installed Fedora Core 12 on my PS3 today.

It started out as a disaster and got better as time went on. If you are trying the same version, you should definitely read:

Friday, October 2, 2009

Turn Off Nautilus in Yellow Dog Linux 6.2

I wanted to turn off Nautilus in Yellow Dog Linux's default E17 session. A quick Google search revealed that the answer was the following command:

gconftool-2 -s -t bool /apps/nautilus/preferences/show_desktop false

Monday, September 14, 2009

Euclidean Algorithm in C

Hello,

My number theory professor asked the class to program the Euclidean Algorithm in a language of our choice. I did mine in C.

I've attached my copy.
gcd_euclidean.c

Sunday, September 13, 2009

Yellow Dog Linux release 6.2 (Pyxis)

My computer, my partner in crime for six years, died. The motherboard went bad. So I used my wife's old computer, and the hard drive went in that one. Then I got a used one from a friend. That one broke, too (I suspect it's the motherboard, but who knows?).

All I have left is my trustworthy Playstation 3.

I've messed around with Linux on the PS3 before, but I've never had to use it as my only desktop. This time around, I had to make it work (I'm out of a job right now, so buying something else is not an option).

I installed Yellow Dog Linux 6.2. It definitely feels more responsive than 6.1 (the swap performance improvements are certainly noticeable). In addition, they have now added many more packages to the yellowdog-extras repo.

After a fairly quick install, I installed all of my favorites from the YUM repositories, namely Fluxbox, LaTeX, and Emacs. The base install had already chosen Firefox and Pidgin, so I was ready to roll. I've been relying on Google Docs for some time as my office suite, and it continues to work well within Firefox. Audio worked out of the box, so no issue there. I do admit to being a little old and crotchety in the audio player department, so I compiled XMMS 1.x from source and installed it in my home directory.

The only thing missing? Printing. I had never really used CUPS before, but now I'm glad that I did. It was a total snap! My particular wireless printer didn't have a driver with the base CUPS install. I pointed Firefox to the CUPS configuration server at http://localhost:631 and began to add a printer. It was no big deal to download a PPD file from the OpenPrinting database. Minutes later and I was printing out my documents.

I sincerely LOVE Linux! It even works for poor people.

Monday, July 20, 2009

Emacs Keybindings in Visual Studio

I've been using the Emacs keybindings in Visual Studio for a little while. There was just one thing that drove me crazy. It would not autoindent into the current line, nor would it indent when you hit TAB. You actually had to have source code on the line before TAB would do a smart indent.

Someone from Microsoft had originally written some Visual Studio macros to address this. You could rebind TAB to just do a plain old tab insert. Of course the source code URL I found was no longer valid... So I contacted the engineer at Microsoft. He got back to me and told me that he no longer had the source, but that it shouldn't be too hard to write my own.

It took me about 15 or 20 minutes to get it correct. You have to use the Macros IDE to add a module under "MyMacros". I called mine "EditorMacros". You should unbind "Edit.InsertTab" and rebind it to the sub routine below ("Macros.MyMacros.EditorMacros.EmacsInsertTab.") It looks like this


Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics

Public Module EditorMacros

'' Please insert a TAB!
Sub EmacsInsertTab()
Dim editPoint As EnvDTE.EditPoint
Dim selection As EnvDTE.TextSelection
Dim startPoint As EnvDTE.EditPoint
Dim currentPoint As EnvDTE.EditPoint
Dim endPoint As TextPoint

selection = DTE.ActiveDocument.Selection
If (selection.IsEmpty()) Then
editPoint = selection.ActivePoint.CreateEditPoint()

'' 0x09 is an ASCII horizontal tab
editPoint.Insert(Microsoft.VisualBasic.Constants.vbTab)
Else
startPoint = selection.TopPoint.CreateEditPoint()
endPoint = selection.BottomPoint
currentPoint = startPoint
Do While (True)
Dim line As Integer

line = currentPoint.Line
If (line = endPoint.Line) Then
If Not (currentPoint.AtEndOfLine()) Then
currentPoint.Insert(Microsoft.VisualBasic.Constants.vbTab)
End If
Exit Do
End If
currentPoint.Insert(Microsoft.VisualBasic.Constants.vbTab)
currentPoint.LineDown()
currentPoint.StartOfLine()
Loop
End If
End Sub

End Module
That seems to work just fine. But every time I hit TAB, a pop-up balloon would flash from the task tray. After seeing that thing for 10 or so times, I lost my mind. It was so brief I couldn't even read what it said. What to do? Why not add a sleep function into my macro? Here's the snippet:

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub EmacsInsertTab()
'' Somewhere in the body...
Sleep(3000)
End Sub


The pop-up said that a macro was running and that I could kill it from the pop-up. Thanks! That's so useful! My macro takes a fraction of a second, of course I'd like the opportunity to stop it. Anyway, it has the option to dismiss it forever.

I took the sleep out and went on my merry way.

Thursday, May 14, 2009

toggle word wrap add-on in Thunderbird

Nine times out of ten, I want Thunderbird to wrap my lines at 72 characters. However, there are times when I'm pasting code or other pre-formatted text that I need word wrapping off. Someone must have had the same problem and made an add-on that easily disables this from the Options menu in the composer.

https://addons.mozilla.org/en-US/firefox/addon/2351

Saturday, April 18, 2009

fluxbox hotkeys, keyboard shortcuts, keybindings, whatever

I've been away from Fluxbox for a long time. It took me FOREVER to figure out how to even set my background. I headed on over to http://www.fluxbox-wiki.org and started to get a grasp on a few of the new features. The biggest one that they have has to be a great keyboard shortcut system. Just edit ~/.fluxbox/keys and you're on your way. I've added the following to mine:
# use the arrow keys to change workspaces
Control Mod1 Left :PrevWorkspace
Control Mod1 Right :NextWorkspace

# volume settings
Control Mod4 Up :Exec mixer pcm +1 ogain +2
Control Mod4 Down :Exec mixer pcm -1 ogain -2

And before I forget, you can set your background with an override in ~/.fluxbox/overlay like this:

background.pixmap: /home/mick/private/pictures/gta3_greencar.jpg

Monday, March 23, 2009

freebsd moused

In the 6 or so years that I've used FreeBSD, I've never successfully configured the mouse daemon (moused). It allows the user to have a mouse in both the virtual consoles and X windows, using the same device. I have a pretty standard Logitech USB mouse. It shows up as /dev/ums0 in FreeBSD 7.1. Turning on moused is as simple as adding the following lines to /etc/rc.conf


moused_enable="YES"
moused_port="/dev/ums0"
moused_type="auto"


Now I've got a fully functional mouse with looks that kill.

Friday, February 20, 2009

xdm hold the debian, please

I switched from GDM to XDM. You have no idea how infuriating that extra second of waiting can be for someone who works on computers all day long. Anyway, the Ubuntu package of XDM appears to be directly from Debian. They replaced the standard X.org logo with a Debian swirl. To change this back to how it was, edit /etc/X11/xdm/Xresources.

Change:
xlogin*logoFileName: /usr/share/X11/xdm/pixmaps/debian.xpm


To:
xlogin*logoFileName: /usr/share/X11/xdm/pixmaps/xorg.xpm


This also points to you being able to change that pixmap to whatever suits your fancy. May I recommend a sweet photo of Max Headroom or HAL 9000?

God is love,
Rev Beav

Wednesday, February 18, 2009

xmessage and the simple things in life

I have a slow computer. I bought it before I could grow a beard or even any back hair. Full on GNOME is usually a little too heavy, so I run everything from FVWM to Fluxbox to whatever.

I thought it would be nice to shutdown with a menu command.

The program xmessage will allow you to setup multiple buttons, each with a different number. That number will be the return code for the program. Bash (bless its little heart) will allow you to query the return code in the variable "$!". They seem like a natural fit!

I did a little visudo so that my group could call shutdown without entering a password.

%admin ALL=NOPASSWD: /sbin/shutdown


Here's the contents of my shutdown script:

#!/bin/bash

xmessage -buttons "Yeah boy!":0,"Quit rushin' me...":1 "Shut this bitch down?"

if [ $? == 0 ]; then
sudo shutdown -h now
fi

Wednesday, January 21, 2009

using html instead of plain text in mozilla thunderbird

I generally use plain text mode in Mozilla Thunderbird for all of my email. Sometimes I need to send off an HTML mail, though. It turns out that holding shift and then clicking "Write" or "Reply" is all it takes to switch to HTML mode for just that one email. I read about it here:

http://forums.mozillazine.org/viewtopic.php?f=39&t=595955

Essentially, hold down shift when you click "Write" or "Reply". That's that.