Thursday, January 15, 2009

Tip: Disable beep in Fedora

The first thing I realized I just had to change on Fedora 10 was the bloody beep. Fedora ships with a kernel module for the PC speaker named pcspkr.ko that if left loaded will drive you mad.

With this module loaded you get to hear a lovely beep while using a terminal. To turn off the beep, simply remove the kernel module and blacklist it to have it gone for good.

Here's how:
  1. $ su
  2. # rmmod -v pcspkr
  3. # echo "blacklist pcspkr" >> /etc/modprobe.d/blacklist
On step 1 become superuser, on step 2 we've removed the module for the running session and on step 3 we've prevented it from loading at boot.

These steps can be performed similarly in other distros.

Tip: Disable shutdown beep in FreeBSD

Beeps are annoying and the one at shutdown is no different.

Here's how to get rid of shutdown beeps:
  1. % su
  2. # sysctl hw.syscons.bell=0
  3. # echo "hw.syscons.bell=0" >> /etc/sysctl.conf
  4. # exit
We've started by becoming the superuser and then on step 2 we've disable the console bell. To guarantee that on next boot that horrible beep doesn't crop up we've added a sysctl to disable it in /etc/sysctl.conf.

Tuesday, January 13, 2009

Tip: Log console messages in FreeBSD

If you run FreeBSD without X11 you've noticed already that messages are presented in the console. Well you can log these messages with the help of syslog.

Here's how:
  • % su
  • # touch /var/log/console.log
  • # chmod 600 /var/log/console.log
  • # vim /etc/syslog.conf
Make sure that that the console.info /var/log/console.log is uncommented.
  • # /etc/rc.d/syslogd restart
And that's it!

Wednesday, January 7, 2009

HowTo: Upgrade FreeBSD 7.0 to 7.1

Disclaimer: this post is for those that instead of using FreeBSD's excellent documentation maintain the bad habit of googling for things already covered in the project's official documentation. This is more or less a copy-paste of the FreeBSD 7.1-RELEASE Announcement instructions for upgrading 7.0 to 7.1.

These are needed steps to upgrade, through the binary path, the kernel and userland utilities to 7.1-RELEASE:
  1. % su
  2. # freebsd-update upgrade -r 7.1-RELEASE
  3. # freebsd-update install
  4. # reboot
  5. % su
  6. # freebsd-update install
  7. # reboot
On step 1 we've started of by becoming the superuser. Step 2 initiates the freebsd-update utility pointing the upgrade to 7.1-RELEASE, after that we proceed with the installation of the kernel on step 3.

Upon rebooting the new kernel is enabled and we move into step 6. Here we end the upgrade process by updating the userland utilities.

That's it!

If you found this post useful that's actually a bad news: you aren't reading the project's official documentation! So please point to http://www.freebsd.org and educate yourself on FreeBSD ;)

Wednesday, December 17, 2008

Tip: Updating FreeBSD with freebsd-update with full filesystem

My old 266 Mhz Celeron (soon to be replaced my an ASUS I220GC motherboard with integrated Celern 220 CPU) is installed on a 4GB HDD which leaves about 297Mb for the /var filesytem.

freebsd-update, the base tool to perform binary system updates, uses by default the /var filesystem. While updating to the recent FreeBSD 7.1-RC1 I couldn't finish the update due to a full filesystem.

Here's how solve the issue and fully update the system:
  • % su
  • # freebsd-update -d /path/to/big/path/directory/ upgrade -r 7.1-RC1
  • # freebsd-update -d /path/to/big/path/directory/ install
  • # shutdown -r now
  • # freebsd-update -d /path/to/big/path/directory/ install
  • # shutdown -r now
In other words, simply use freebsd-update's -d option. man freebsd-update and http://lists.freebsd.org/pipermail/freebsd-stable/2008-December/047014.html for more info.

Happy updating ;)

Tip: Fix freebsd-update problems

I tried to update my desktop from FreeBSD 7.1-PRERELEASE to 7.1-RC1 however I came across an error along the lines of "No mirrors remaining, giving up" .

Here's how to fix the issue:

% su
# env UNAME_r=7.1-PRERELEASE freebsd-update upgrade -r 7.1-RC1

Substitute the current and target versions according to you particular system and you should be able to update the system as usual.

Friday, December 5, 2008

Tip: Enable sound on Enemy Territory under FreeBSD

Enemy Territory is available in FreeBSD's ports system under /usr/ports/games/linux-enemyterritory. The port's Makefile makes no mention that if you install the game and run it you'll be playing without sound.
Here's a quick tip on how to enable sound on Enemy Territory under FreeBSD 7.0:
  1. % su
  2. # sysctl hw.snd.compat_linux_mmap=1
  3. # echo "hw.snd.compat_linux_mmap=1" >> /etc/sysctl.conf
  4. # exit
Step 2 enables sound immediately and with step 3 sound will be enabled at boot time.
And that's it. Now hurry and go play the world great first-person shoot ever.
d^.^b