Linux and Open Source
Ever since I upgraded my HP pavilion zt3000 laptop to Fedora Core 3 (from FC2), I’ve had no sound. By accident the other day I discovered that I was getting sound through headphones, but not the onboard speakers.
The solution as it turns out is fairly simple, go to a terminal window, and type “alsamixer”. Use the arrow keys to highlight “Headphone Jack Sense”, then hit the “m” key to mute it. It appears that ALSA is always sensing headphones and cutting off the internal speakers. Of course, now you’ve got the reverse problem, no headphones, but again to switch back, run alsamixer and unmute the headphone jack sense.
PS: You can program the extra volume and mute keys on the keyboard so that they work under gnome. just use the keyboard settings applet.
I’ve been using subversion a bit lately, and wanted a way to record the most commonly used commands for future reference. Like the vim stuff, if its of any use to anyone, great, otherwise at least its here for me.
To create a working copy of a project:
svn co [repositry URL] [working dir]
To update your working copy:
svn update
To send your changes back to the repository:
svn commit
This will prompt you in your favorite editor for your check in message.
To add a new file to the repository:
svn add [file name]
Don’t forget also to run this command so that svn will update the “Id:” tag…
svn propset svn:keywords Id [file name]
Adds and propsets need to be committed after they’ve been done.
To see differences between your working version and the repository:
svn diff [file name]
To revert back to the version of a file that is stored in the repository (loosing changes in your working copy):
svn revert [file name]
To view the history of a file:
svn log [file name]
To get help:
svn help
To get help on a specific command:
svn help command
e.g. svn help commit
They’re the Subversion commands I’ve used most often. The Subversion book is an excellent reference.
A bit more vi hackery…
Changing Syntax highlighting colours
:colorscheme [name-of-scheme]
e.g. :colorscheme murphy
Available colour schemes can be found in:
/usr/share/vim/vim63/colors/
Been playing with vim a bit and felt to need to record some of the things I’ve figured out before I forget. If this is useful to anyone, great, but its really here to jog my memory.
Setting tab widths
:set ts=2 sp=2
Turning suntax highlighting on/off
:syntax on
:syntax off
Files defining syntax highlighting stuff live in or near:
/usr/share/vim/vim62/syntax/
e.g. /usr/share/vim/vim62/syntax/php.vim
To load a vim macro file into vim
:source
All of these commands are active only for the current session. To make them run every time vim starts, add them to ~/.vimrc. My current .vimrc:
set ts=2 sp=2
syntax on
Found a link to this Remote-controlled digital picture frame project in my browsing today. I’d love to get my hands on an old laptop and try this myself.
My sister loves looking at photos. I’d seen do-it-yourself picture frames on Slashdot before, and you can buy digital picture frames here and there, but it’s really something else to design and perform this laptop-into-picture-frame mod yourself.
In an earlier posting I mentioned that I was yet to get the video on my HP Centrino laptop (HP Pavilion ZT3000) running at its native 1280×800 under Linux. A commenter on another post today asked me if thats still the case…
Fortunately, no it isn’t. My HP now runs quite happily at 1280×800, under both Fedora Core 2 and 3. It took a bit of fiddling in the GUI to get figured out, but here’s how I did it.
The trick is that there’s two separate ares you need to configure in the GUI. If you go to System Settings > Display. Set the monitor type to “LCD Panel 1280×800″ and the Video Card to “ATI Radeon 9200″. You may need to restart X after changing these settings (Ctrl-Alt-Backspace will do the trick).
That will tell X about the hardware, now to get the resolution going. Again we can do this in the GUI, go to Preferences > Screen Resolution and set it to 1280×800 at 60Hz. Again a restart of X may be required for this to take effect.
Thats what I’m running at the moment and the display is running nicely in its native resolution. I’ve also done a bit more fiddling about in the GUI and got a basic power management setup going. Its not ideal, but it does work reasonably well.
A while back when Installing Fedora Core 2 on my laptop, I ran into dual boot problems. I was able to work around them at the time, but now when installing Fedora Core 3 anaconda (the installer) crashes out with two error messages…
Assertion (heads > 0) at disk_dos.c:485 in function probe_partition_for_geom() failed.
Assertion (sectors < = 63) at disk_dos.c:490 in function probe_partition_for_geom() failed.
According to the answers given to this this FedoraForum.org post, this is a geometry related issue (same as the dual boot problems). Various posters mentioned installing different versions of Fedora first then performing an upgrade to work around this (this wouldn’t work in my situation), but the best solution I found was to use sfdisk and fix the partition table. The procedure for doing this is described in this LWN article, but the command line required is:
sfdisk -d /dev/hda | sfdisk –no-reread -H255 /dev/hda
I had to add a “–force” to mine to make it work, this isn’t necessarily recommended but it worked for me, YMMV.
The final very handy site I found in my aggregator’s backlog was the new Red Hat Magazine, Great reading, but where’s the RSS feed?
The editor has a blog, which has a an RSS feed. I guess that’ll do for the moment.
In a previous post I mentioned CentOS. A free redistribution of Red Hat Enterprise Linux. Since then, a couple of things have happened, firstly NewsForge reviewed CentOS and gave it the thumbs up (with some minor criticisms). One of the things that the review touched upon was CentOS’ update policy:
For CentOS, we track the Red Hat updates as closely and quickly as possible. Typically we release our updates within hours of Red Hat’s, but we publicize a 24-hour lead time. We have multiple people that have access to update the mirrors, so the team itself has the capability to consistently release updates quickly.
Anecdotally I’ve heard that CentOS is very quick with updates, and this confirms that CentOS has a policy of providing updates quickly.
Probably more importantly though, I’ve now got a production server running CentOS. For a long time Red Hat user such as myself, CentOS is awesome. For the most part people who are familiar with Red Hat operating systems won’t notice the difference! Some slight differences in the login prompts and the like, but otherwise the same operating system that we’ve always used.
The other really nice thing about CentOS is that it includes Yum. I’ve loved Yum ever since I started using Fedora Core 2 on my laptop. It makes installing and updating RPM’s a breeze (think apt-get for RPM’s and you’ve got an idea of what yum does). Updating a CentOS machine is a simple “yum update”:and everything else is taken care of. Couldn’t be simpler!
All in all, CentOS gets a big thumbs up from me. I’d recommend it to anyone who wants RHEL without the associated price tag.
Michael Firkins has posted (to the LinuxSA mailing list) a handy guide to creating a boot CD in order to install a flash BIOS update without requiring Windows or a floppy drive. The post can be found in the list archives.
I decided to update the bios on one of my machines. (It’s a MSI 845e msi 6566E). It has no floppy drive, and the only one still on the premises doesn’t work (it’s leaving in the morning when the garbage truck picks up). We also have no W98 machines, so bootdisks are hard to come by.