linportal's blog

Your ATI Radeon very slow on Xorg X server 1.3?

This one has bothered me for a long time. The solution is, of course, simple. But, I still don't understand why was it necessary to force users to search so hard for this piece of information, where all the older X server releases worked OK out of the box?

If you find that after upgrading to X.Org 7.3 your display becomes very slow, and you own ATI Radeon, all you need to do is to put this line in the Device section of your xorg.conf:

Replaying terminal sessions with scriptreplay

OK, this is so cool and sexy, I really don't understand how I didn't find about this earlier. Possibly because it's the recent add-on to the well known script utility?

So, I suppose you all know about script. You type script, do your work, type exit, and you have your complete session logged in the file named typescript. Quite handy if you want to log everything you did in the shell for whatever reasons.

What you might not know is that script has an interesting switch which allows you to also save the exact timing data of the screen output you're capturing. And an additional utility called scriptreplay which can later replay your session in real-time. Like a movie. With perfect timing.

Two ways to force SSL on your website

Two solutions, both to be put in the .htaccess file, when you want to force your website visitors to go through SSL:

Solution A:

RewriteEngine On
RewriteCond %{SERVER_PORT} !443$
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R]

Solution B:

RewriteEngine on
RewriteCond %{HTTPS} !^on$ [NC]
RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]

Pick whatever solution looks nicer for you.

What to do if you forget root password?

Although this may seem like a small catastrophe to you, it's actually very easy to recover from that situation. What you need to do is to reboot (power on) your system, but on the LILO prompt you should type something like:

LILO: Linux init=/bin/sh rw

Where Linux is the example image name, you should supply the actual data, of course. And same parameters should be provided to GRUB or any other boot loader you might use.

How to grep for IP addresses using the GNU egrep utility

This is an useful regular expression if you're looking for IP addresses:

egrep '([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}'

Related:
How to sort IP addresses using the GNU sort utility

How to check when Daylight Saving Time (DST) will commence?

Using time zone dumper utility (zdump) like this:

zdump -v /etc/localtime | grep 2007

we can see that:

/etc/localtime Sun Mar 25 00:59:59 2007 UTC = Sun Mar 25 01:59:59 2007 CET isdst=0 gmtoff=3600
/etc/localtime Sun Mar 25 01:00:00 2007 UTC = Sun Mar 25 03:00:00 2007 CEST isdst=1 gmtoff=7200
/etc/localtime Sun Oct 28 00:59:59 2007 UTC = Sun Oct 28 02:59:59 2007 CEST isdst=1 gmtoff=7200
/etc/localtime Sun Oct 28 01:00:00 2007 UTC = Sun Oct 28 02:00:00 2007 CET isdst=0 gmtoff=3600

How to extract contents of an RPM package

Use the following procedure to extract contents of an RPM package:

rpm2cpio package.rpm | cpio -dimv

As the name implies, rpm2cpio takes an RPM package file and converts it to a cpio archive. The -i flag to the cpio command indicates that cpio is reading in the archive to extract files, and the -d flag tells cpio to construct directories as necessary. The -v flag tells cpio to list file names as files are extracted, and the -m flag tells cpio to retain previous file modification times when creating files.

Soft scrollback for the Linux VGA console

If you're a heavy user of the Linux VGA console, you'll like this feature. Recent 2.6 kernels have added support for soft scrollback. This feature enables you to have much bigger scrollback buffer than the standard console has, at the price of slightly slower console output.

The scrollback buffer of the standard VGA console is located in VGA RAM. This RAM is fixed in size and is very small. To make the scrollback buffer larger, it must be placed instead in System RAM. We call this soft scrollback.

The feature and the size of the buffer are enabled/configured through kernel config options, during kernel compilation. Beside consuming kernel memory, enabling this feature will slow down the console by approximately 20%.

Running Linux on the ASRock 775Dual-VSTA motherboard

ASRock 775Dual-VSTAASRock 775Dual-VSTABeing a happy owner of the ASRock 775Dual-VSTA motherboard for a week, I decided to share my opinions about it and also give an advice or two to other people thinking about running Linux on it.

In short, this board is an exceptional piece of engineering and Linux runs GREAT on it. I'm not going to list all the specifications of the motherboard, because they're readily available on its official page, but let me go through the interesting features:

  • the board can use both DDR & DDRII memory (but not at the same time!)
  • you can equip it with AGP or PCIe graphics card, your choice
  • there's plenty of connectors for both older ATA or newer SATA drives
  • you can run any LGA 775 processor you can get hands on, including latest Intel Core 2 Duo (Conroe core)
  • the board is very affordable (or should I say dirt cheap)

How to sort IP addresses using the GNU sort utility

Need to sort list of IP addresses in shell? Here’s the invocation that works:

sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4

Thanks for this tip goes to Paul Heinlein.

Related:
How to grep for IP addresses using the GNU egrep utility

Syndicate content