Skip to content

Linux

Redirecting a webpage using 301 redirect

Let’s say that someone on the Internet has been linking to one of your webpages, but for some reason you change the system you use (Changing from Drupal to WordPress, for instance), or just ended up moving the page somewhere else. Sending an email to the people linking to your site doesn’t guarantee that they’ll take the time to point to the new URL of the page. So what can YOU do? Use .htaccess and a 301 Redirect. I’ll not explain here where the file is to be placed, or how you configure Apache to take it into consideration.

Place the following bit of code in your .htaccess:

Redirect 301 /old-location/file.html http://www.new-location.com/file.html

Easy peasy.

Gnome notification area gone?

Right, this problem has been annoying me for ages. Sometimes the Gnome Notification area will disappear, leaving applications such as Pidgin or NetworkManager lingering outside the system tray area. Very annoying. The solution?

If you are using just one monitor, open the file named %gconf.xml located in ~/.gconf/apps/panel/general/ and add the following:

notificationarea_screen0

This should be added between the starting and closing entry-tags. Save and close the file, followed up by restarting your X-session. Things should be back to normal.

Now, if you’re using two monitors, with a separate X-screen on each, this will most likely happen to you. The reason behind this is that you must have only one notification area, one for both screens.

To solve this, remove the upper panel on both screens. Re-add the panel on your main monitor as you like it, and add a notification area there. Re-add it on your second monitor as well, only this time don’t add the notification area. Give it a shot, let me know if it works. :)

Packard Bell Easy One DC on Slackware 10.0

Packard Bell Easy One DC running Slackware Linux 10.0 with Linux kernel 2.4.26

  • Mobile AMD Duron 700 Mhz
  • VIA Apollo KT133 chipset
  • LCD 12.1” TFT SVGA , 800×600 pixel
  • 192 MB SDRAM (100MHz)
  • 6GB HDD
  • ATI Rage Mobility-M1 4MB APG Video Controller
  • Versaglide Touchpad / NX Pad
  • OZ6833 PC-Card Controller
  • VIA 686A PCI Audio Controller
  • Internal 24x CD-ROM drive
  • USB 1.0
  • Askey LT Winmodem (DSP1456/MARS3)
  • 2 Internet buttons
  • Super Input/Output Controller SMC FDC37N869

A list of built-in PCI hardware:

00:00.0 Host bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133] (rev 03)
00:01.0 PCI bridge: VIA Technologies, Inc. VT8371 [KX133 AGP]
00:06.0 Communication controller: Lucent Microelectronics LT WinModem
00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 22)
00:07.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C/VT8235 PIPC Bus Master IDE (rev 10)
00:07.2 USB Controller: VIA Technologies, Inc. VT6202 [USB 2.0 controller] (rev 10)
00:07.4 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 30)
00:07.5 Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97 Audio Controller (rev 20)
00:0c.0 CardBus bridge: O2 Micro, Inc. OZ6832/6833 Cardbus Controller (rev 34)
00:0c.1 CardBus bridge: O2 Micro, Inc. OZ6832/6833 Cardbus Controller (rev 34)
01:00.0 VGA compatible controller: ATI Technologies Inc Rage Mobility P/M AGP 2x (rev 64)
X11R6.7.0 (X.Org)

I configured X11R6.7.0 (xorgconfig) with the ati generic driver and it worked fine.

From my Section “Device” in /etc/X11/xorg.conf

Identifier  "** ATI (generic)               [ati]"
Driver      "ati"
Audio

The built-in audio card is an VIA686 PCI Audio Controller and is supported by the snd-via82xx module in the kernel.

ALSA device list:
#0: VIA 82C686A/B rev20
Internal 24x CD-ROM drive

Seems to work fine, and was found by kernel. No problem with playing any movies or sound.

hdc: ATAPI 24X CD-ROM drive, 128kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.12
Modem / PCMCIA

These are the things I’ve not had the opportunity to test myself, but I’ll attempt to give some information about them below.

  • The integrated modem seems to be recognized by the kernel.
  • I’ve not had the chance yet to test PCMCIA, but after a few searches on google, it seems like it doesn’t take much to make it work.

Should there be anything you would like to add to this document, please post a comment.

Back to Linux-on-Laptops.com

How to join multiple .avi or .mpg files

Imagine that you for some reason end up having several files, such as a.movie.avi.001, a.movie.avi.002, and so on. How do you then join them up into one big avi file? The answer is actually pretty simple – cat and mencoder.

Do the following if you don’t have mencoder installed:

# yum install mencoder mplayer

Then:

$ cat a.movie.avi.001 a.movie.avi.002 a.movie.avi.003 > a.movie.avi

That’s pretty much it, but there’s one final step before it’s done.

$ mencoder -forceidx -oac copy -ovc copy a.movie.avi -o a.movie.final.avi

And you’re done. :)

Contributing to Fedora

After having grown so fond of Fedora, I sort of felt that I should start to contribute back to the Open Source community, as I haven’t done that in a while. So I volunteered as a translator for the Norwegian language. Go figure. ;)

And on that note..

Can’t wait!

RHCT/RHCE exam preparation

Right, first off let me start by saying that I can’t tell you the contents of the RHCT/RHCE exam. At the beginning of each exam you have to sign a contract that legally binds you to keep silent about it. I can however tell you the methods I used to prepare myself for the exam.

If you’re wondering what things you should be studying, this list from Red Hat should always be up to date, as far as I know. So this is, or should be, your only reliable source when it comes to finding out exactly what you need to prepare for.

Attending a Red Hat course is brilliant. Even experienced Linux system administrators can learn something new there. I myself attended RH133 (Red Hat Linux System Administration) and RH253 (Red Hat Linux Networking and Security), and there are a lot of things there that will prepare you properly for the exam, IF you pay attention. These courses give you some studymaterial as well, so I used those books for studying also.

I can’t emphasize this enough, there is NOTHING like hands-on training. You can read and read all you want, but unless you experience it first-hand, it just won’t sink in. As far as I know, the operating system that’s most similar to Red Hat Enterprise Linux, is CentOS, which means that you can use that for training (and the test-exams!). How to do this, you ask? Easy. Use VirtualBox, or some other software that’s similar, VMWare, Qemu, Paralell if you’re on a mac. You can install a virtual machine and just play around there. That’s what I did. I set up both a client and a server, and from there I tested everything from NFS, NIS, Samba, DNS, HTTP, Squid, and so on. It really helps, believe me.

The following point is particularly important. Read the exam properly. That’s right. Out of 8 people in total taking the exam on Friday, including myself, one failed right at the start because he wasn’t properly prepared, and another one failed because she didn’t go through the exam task-list properly, thus made a mistake that just couldn’t be reversed. So take your time, go through the list of tasks you are given, and make some mental notes, or even better, scribble them down on the sheet of paper you are given. It helps to systematically cross out the tasks you’ve done, so keep a clear overview of how much left there is to do. And remember to spend your time wisely. If a task seems too difficult, try another easier task, and get back to the more difficult one when you have time. At least that way you’ll get some things completed, rather than getting stuck on that particular problem, and not really gaining anything.

If there’s something you feel confident about, read about it again, and again, and again. You might think you know a lot, or everything, about something, but you don’t. Simple as that. Better to be over-prepared if you ask me.

If this sounds like hard work, you’re damn skippy that it is. RHCE isn’t meant to be simple, but I can tell you that the satisfaction of passing is greater than you think. And if you think “I can’t possibly do this”, you can! I myself knew close to nothing about Red Hat-systems a month ago. So what they say is true, if there’s a will, there’s a way.

Good luck to you future RHCT/RHCE’s!

Passed RHCE!

I’ve intentionally been waiting to write this post, as I’ve not been so sure of what to write. I guess it all depended on the outcome of my RHCE-exam that I had yesterday. The results? Well, see for yourself.

SECTION I:    TROUBLESHOOTING AND SYSTEM MAINTENANCE
RHCE requirements:  completion of compulsory items (50 points)
overall section score of 80 or higher
RHCT requirements:  completion of compulsory items (50 points)

Compulsory Section I score:                        50.0
Non-compulsory Section I score:                    50.0
Overall Section I score:                           100

SECTION II:  INSTALLATION AND CONFIGURATION
RHCE requirements: score of 70 or higher on RHCT components (100 points)
score of 70 or higher on RHCE components (100 points)

RHCT requirement:  score of 70 or higher on RHCT components (100 points)

RHCT components score:                             100.0
RHCE components score:                             100.0

RHCE Certification:                                PASS

I just can’t believe that I aced the test! 100% correct, god! I have to tell you, I never ever thought this was possible, but the countless hours I spent studying and practicing for the test was well worth it. :)

I’ll be posting some tips and tricks concerning the RHCE-exam soon, so stay tuned.

Creating, bridging and using host networking in Fedora 8/9 (VirtualBox)

As I’ve mentioned in previous posts, I’m quite fond of VirtualBox, and thus we write some more about it! A default installation will give every virtual machine you create an ip of 10.0.2.15, but what if you’d like to enable your virtual machines to be able to interact with each other, each of them having their own ip? Here’s where bridging comes into play. As I’m using Fedora 8, this little section is for – that’s right – Fedora 8 (works in Fedora 9 as well). I’ll be assuming that your host-machine is getting its ip from a DHCP-server.

Add the following line to the bottom of /etc/sysconfig/network-scripts/ifcfg-eth0:

BRIDGE=br0

Then create the file /etc/sysconfig/network-scripts/ifcfg-br0, and add the following:

DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes

Once you’ve done that, restart the network:

# service network restart

Now that we have that finished, you can create a virtual ethernet interface for VirtualBox like this:

# VBoxAddIF vbox0 USERNAME br0

Replace USERNAME with the username of the user you’ll be running VirtualBox as (the user michael would have put the username michael there).

Give all users write access to the device used by VirtualBox to communicate with the host network (/dev/net/tun in this case).

# chmod 0666 /dev/net/tun

Now, start VirtualBox and select your virtual machine, then go to Settings.

Then change Attached to to Host Interface, and type vbox0 into the field Interface Name.

And that’s basically it! If you’d like to create another virtual interface for VirtualBox, just run the line above again, only replace vbox0 with vbox1, vbox2, and so on. All depends on how many virtual machines you’re planning on running simultaneously.

Oh, if your virtual machine seems to stop at boot, when trying to get hold of the network information, it might be your firewall that’s causing the problem. So on the host-machine, disabling the firewall might do the trick:

# service iptables stop

Good luck!

How to display UTF-8 in your Putty bash shell

My girlfriend was having some problems displaying the correct characters while talking on IRC through irssi, and putty. Eventually I came to the conclusion that it wasn’t my server or irssi that was configured badly. Searching the internet I found this:

echo -ne 'e%Ge[?47he%Ge[?47l'

Simply put that into your .bash_profile or .bashrc and relog to your server. It’s a collection of terminal escape codes that together means ESC %G – “switch to UTF-8”.

Quake Wars and switchscreen

Still being thrilled about having gotten my 22” monitor, after 2 years of nagging (I need to emphasize that I’ve spent TWO years nagging my better half about a damn monitor. Did I mention I spent 2 years?), I briefly spoke to a co-worker of mine about having nothing to play after I quit World of Warcraft. He said that he’d heard about a game called Quake Wars, and that it had a Linux-client. So I took a look at it, downloaded the demo, and now I’m hooked! Not as much as before, but it’s fun nonetheless. Anyway – playing the game with a 1680×1050 monitor resolution is INSANE! I can just about feel a grenade blowing up in my face. We’re about 3 people at work planning on making a clan, so we just need a few more to make it work. And I am definitely going to buy the full game tomorrow! For more information about Quake Wars, take a look at http://community.enemyterritory.com/.

Right, that was that about Quake Wars. Now to my next subject – a nifty little program named switchscreen. A quote from the website:

switchscreen is a command-line utility that moves the X mouse cursor to a given point on a given screen. I wrote it because I could find no other program that can define both the mouse position and screen number.

In other words – you can use your keyboard to navigate between your two monitors instead of your mouse! I find it to be a wicked program that I just had to mention. ;)

Update: I forgot to mention yesterday (as I’m typing it’s the 29th) that I nearly got bald and (even more) nuts by not being able to find the “x-devel-” package for SuSe, being that we need libx.h to make switchscreen work. Just fire up YaST and search for xorg-x11-devel, and there you go!