Monday, July 23, 2007

Disabling Caps lock in Linux

Master Your Linux Keyboard (And Fix Caps Lock Forever)
Exorcising Caps Lock



Want to get rid of the evil caps lock key without mutilating your keyboard? Want to give those silly Windows keys useful jobs, or put all those extra multi-media keys to work? Want to become a powerhouse keyboarding commando? Then come along and join the fun, because Linux has all kinds of good tools for taming wayward keyboards and increasing your efficiency. In this two-part series we're going to use xmodmap, XBindKeys, and KeyTouch to create custom keybindings for launching applications and running commands.

The placement of the caps lock key is a demonstration of malicious cunning. It's above the shift key and it's usually oversized, so it's way too easy to hit it when you don't want to, which for me is all the time. On a case-sensitive operating system it's not all that useful anyway. Unhappy users often resort to remedies like prying it off entirely or covering it with duct tape. You can do this if you're careful, but elite geeks resort to more sophisticated measures that do not mangle their nice keyboards. It's not the fault of the keyboards that manufacturers have giant Windows-sized blind spots, and as always, Linux makes lemonade out of lemons and provides useful alternatives.

This command reverses whatever position the caps lock key is in, so first make sure it is not on:
$ xmodmap -e "remove lock = Caps_Lock"

What if you do this when caps lock is on? One remedy is get used to typing like a dork: "dEAR jUPITERMEDIA, i WANT MORE STORIES ABOUT hp, ibm, AND dELL." Or you could fix it. First run this command:
$ xmodmap -e "add lock = Caps_Lock"

Then make sure it is not on, and re-run the "remove lock" command.

This won't survive a reboot, so put it in your ~/.bashrc file to make it permanent.

Remove LAME Logging and Version Exposure in BIND

Got LAME server errors? Are you exposing your BIND version?

Problem Scenario

Are lame-server errors filling up your logs? Are you letting bind send its version out to potential attackers? You can fix these issues with some simple changes.

If you look in your message logs, you may see an error about a “lame server”. A lame server is when the NS record for a domain specifies a server that is not authoritative for the domain.

Cause

For example, the NS record for www.domain.com may list ns1.domain.com as one of its nameserver; however, if you actually query ns1.domain.com, the nameserver does not answer as an authoritative server. The latter is due to a mis-configuration of that nameserver, not yours. Lame servers are increasingly common as more and more people run their own DNS, often with improper configurations. Errors will look something like this in your messages log:


lame server resolving ‘www.domain.com'
 (in ‘domain.com’?) : 192.168.1.1#53: 1 Time(s)

Impact

On a busy server, especially if you have a lot of users and email traffic, your servers logs can fill up with lame-server entries, thus obscuring more important system messages. A simple configuration change, outlined below, can stop lame server logging. We will get to the changes soon, but first, you may also want to know how to hide your bind version.
BIND Version

Solution

The file that you need to change is:

/etc/named.conf

To disable lame logging errors, add the logging section as given below.

options {
 directory “/var/named”;
 dump-file “/var/named/data/cache_dump.db”;
 statistics-file “/var/named/data/named_stats.txt”;
};
logging {
 category lame-servers { null; };
};


Add-on

BIND has had a history of exploits and security issues. Many scanners and exploit tools rely on the version number to identify exploitable servers. These scanners note the version and flag the server for later investigation by the hacker. Getting your server to show the version of BIND is very easy with dig unless secured at Server end.

VERSION.BIND. 0 CH TXT “8.2.3-REL”

Now set your bind version simply change the file to include these statements.

options {
 directory “/var/named”;
 dump-file “/var/named/data/cache_dump.db”;
 statistics-file “/var/named/data/named_stats.txt”;
version “surely you must be joking”;
};

Save these changes and then restart bind. You should now not have lame-server errors in your logs nor should a dig return the version of your BIND server.

To make sure the changes worked, run the following command:
dig @ns1.domain.com version.bind chaos txt

Now your server should return the string you set in the configuration file. As mentioned before, this is not a substitute to updating BIND, but these simple are a part of a comprehensive approach to server security. For more information on BIND, see the official documents at the BIND web site.

Saturday, July 14, 2007

Display Problem in SUSE 10 with Matrox G400 Graphics Card and USB Mouse

 

After installing SUSE 10.0 Display was not working.

Graphics Card : Matrox G 400
Monitor : Samsung SyncMaster 594 MG


1. I logged into runlevel 3 and tried to fire up X11
systemp5:~ # startx
xauth: creating new authority file /root/.serverauth.8991
X Window System Version 6.9.0
Release Date: 21 December 2005
X Protocol Version 11, Revision 0, Release 6.9
Build Operating System: SuSE Linux [ELF] SuSE
Current Operating System: Linux systemp5 2.6.16.21-0.8-ppc64 #1 SMP Mon Jul 3 18:25:39 UTC 2006 ppc64
Build Date: 17 June 2006
Before reporting problems, check http://wiki.X.Org
to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri Jul 13 18:41:41 2007
(==) Using config file: "/etc/X11/xorg.conf"
(EE) No devices detected.

Fatal server error:
no screens found

Please consult the The X.Org Foundation support
at http://wiki.X.Org
for help.
Please also check the log file at "/var/log/Xorg.0.log" for additional information.
XIO: fatal IO error 104 (Connection reset by peer) on X server ":0.0"
after 0 requests (0 known processed) with 0 events remaining.
2. So I tried to configure it using “X -configure”

systemp5:~ # X -configure
X Window System Version 6.9.0
Release Date: 21 December 2005
X Protocol Version 11, Revision 0, Release 6.9
Build Operating System: SuSE Linux [ELF] SuSE
Current Operating System: Linux systemp5 2.6.16.21-0.8-ppc64 #1 SMP Mon Jul 3 18:25:39 UTC 2006 ppc64
Build Date: 17 June 2006
Before reporting problems, check http://wiki.X.Org
to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri Jul 13 18:42:20 2007

List of video drivers:
atimisc10b
chips
dummy
via
glint
s3
s3virge
savage
sisusb
tdfx
trident
v4l
nvidia
ast
ati10b
ati
atimiscold
atimisc
i810xorg71
atiold
i810
r12810b
mga
nv
r128old
r128
radeon10b
radeon
radeonold
sis
fbdev
vga

dlopen: /usr/X11R6/lib/modules/drivers/atimisc10b_drv.so: undefined symbol: ATIPublicOptionSize
(EE) Failed to load /usr/X11R6/lib/modules/drivers/atimisc10b_drv.so
(EE) Failed to load module "atimisc10b" (loader failed, 7)
No devices to configure. Configuration failed.
systemp5:~ #


3. Tried to blow up with “X -configure” through a few more switches.
systemp5:~ # X -ignoreABI -bestRefresh -disableVidMode -configure
-modulepath /usr/X11R6/lib/modules/ dpms -config -allowMouseOpenFail

Again the same error
dlopen: /usr/X11R6/lib/modules/drivers/atimisc10b_drv.so: undefined symbol: ATIPublicOptionSize
(EE) Failed to load /usr/X11R6/lib/modules/drivers/atimisc10b_drv.so
(EE) Failed to load module "atimisc10b" (loader failed, 7)
No devices to configure. Configuration failed.
systemp5:~ #



4. There is utility SaX to probe for the monitor.Made an attempt with it

systemp5:/opt/xf86-video-mga-1.4.2 # sax2
SaX: initializing please wait...
SaX: your current configuration will not be read in

Can't load '/usr/lib/perl5/vendor_perl/5.8.8/ppc-linux-thread-multi- 64int/auto/SPP/SPP.so' for module SPP: libqt-mt.so.3: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/ppc-linux-thread-multi- 64int/DynaLoader.pm line 230.
at /usr/lib/perl5/vendor_perl/5.8.8/ppc-linux-thread-multi-64int/SPP.pm line 7
Compilation failed in require at /usr/share/sax/modules/SPPParse.pm line 12.
BEGIN failed--compilation aborted at /usr/share/sax/modules/SPPParse.pm line 12.
Compilation failed in require at /usr/share/sax/init.pl line 21.
BEGIN failed--compilation aborted at /usr/share/sax/init.pl line 21.
systemp5:/opt/xf86-video-mga-1.4.2 #

Here is related with some libraries.I couldn't find the library at the moment.So I went through playing with editing /etc/X11/xorg.conf and some other drivers available

5. First browsed the Vendor's Home Page
But unfortunately The download URL
http://www.matrox.com/graphics/en/corpo/support/drivers/driverInfo.php?id=145
was not accessible

6. Then after googling
Downloaded the source RPM from
http://software.opensuse.org/download/X11:/Drivers:/Video:/mga/SLE_10/src/

7. Compiled the source
systemp5:/usr/src/packages/SPECS # pwd
/usr/src/packages/SPECS

systemp5:/usr/src/packages/SPECS # rpmbuild xorg-x11-driver-video-mga.spec
error: Failed build dependencies:
Mesa-devel is needed by xorg-x11-driver-video-mga-4.3.14.3-1.2.ppc64
libdrm-devel is needed by xorg-x11-driver-video-mga-4.3.14.3-1.2.ppc64
8. Installed the dependancies through YaST interface
systemp5:/usr/src/packages/SPECS # yast -i Mesa-devel
systemp5:/usr/src/packages/SPECS # yast -i libdrm-devel
9. Built the RPM
systemp5:/usr/src/packages/SPECS # rpmbuild xorg-x11-driver-video-mga.spec

10.Refer the following from a Mailing List

Symptom
You cannot configure your graphics card with sax or sax2.

Cause
Problems with the drivers or your graphics card is not supported by the current XFree86 packages.

Solution
A list of all problematic chipsets currently known to the installation support desk follows. Each device has a vendor ID (manufacturer) and subsystem ID (device ID) that identify the hardware. The command

/sbin/lspci -n | grep 0300

enables you to easily find your graphics card's data. If you have one of the graphics chipsets listed below, refer to the following articles for the configuration:

If you want to configure the framebuffer:
http://en.opensuse.org/SDB:Setting_up_Unsupported_Graphics_Cards_with_the_Framebuffer_Device_(GRUB)

General information about sax and sax2
http://en.opensuse.org/SDB:X_Server_Configuration_with_SaX2

Solution
Use the framebuffer device to address your graphics card. To do this, proceed as follows:
Enter the following at the boot prompt:
linux 3 vga=xxx

Replace xxx with a value from the table below. This value specifies the resolution and color depth used by the X server later.
Resolution in pixels
Color depth | 640x480 800x600 1024x768 1280x1024
256 (8bit)| 769 771 773 775
32000 (15bit)| 784 787 790 793
65000 (16bit)| 785 788 791 794
16.7 Mill.(24bit)| 786 789 792 795

For example, to make an X server run with 16-Bit color depth and a 1024x768 resolution, enter the following value at the boot prompt:
linux 3 vga=791

Especially in the case of notebooks, this value might not be supported. If this is the case, select a lower resolution (800x600 16-bit).

But this editing in the lilo.conf while booting didn't help in my case
From SuSE Linux 8.2 on, the specification of the framebuffer modes has changed. To find out the modes supported by your graphics card, execute the command
hwinfo --framebuffer

systemp5:/usr/X11R6/lib/modules #
systemp5:/usr/X11R6/lib/modules # hwinfo --framebuffer
systemp5:/usr/X11R6/lib/modules # hwinfo --framebuffer
It returns nothing
Take a look at the sax log file
systemp5:~ # cat /var/log/SaX.log

/*************
SaX2 log : SaX2 version 7.1 - SVN Release: 1.49 2003/03/17
**************
SVN RELEASE : 1157
:
DESCRIPTION : X11 configuration log file to collect information
: about detection, startup and configuration.
: There are three parts of logging:
: ---
: 1) INIT ( detection, 3D )
: 2) STARTUP ( xorg.conf, X11 log, glxinfo )
: 3) CONFIG ( config actions )
: ---
:
VERSION : SaX2 compiled for: [SUSE Linux Enterprise 10 (PPC)]
PARAMETER : -m 0=mga_drv.so
:
LOG DATE : Fri Jul 13 17:05:35 IST 2007
*************/
============================
Framebuffer Info:
----------------------------
Framebuffer is active

From this it is clear that sax is trying with MGA driver



Frequently asked question - pSeries
When running SUSE SLES8 on a pseries p615, which has a Matrox G400 graphics card, the p615 claims the card is on PCI Bus 290, but the XFree86 scan of the PCI bus does not see the card. I am assuming that is because the scan does not go above 255. How can I get XFree86 to recognize the card?
Answer
XFree86 should be able to use it only as a frame buffer device. This should be enabled by default with SLES8, and though there were some video issues, they have all been resolved with Service Pack 3. Since you have installed SLES8, then the frame buffer should work by default. If not, then you will need to make sure that you are running SP3.
Also, instead of trying to use the mga driver, you should use the matroxfb. In case if you have edited conf files to expect the mga driver, they will have to fix what you have changed before trying the matroxfb.
11. Downloaded the Matrox drivers from
http://xorg.freedesktop.org/releases/individual/driver/xf86-video-mga-1.2.1.3.tar.gz
http://xorg.freedesktop.org/releases/individual/driver/xf86-video-mga-1.4.2.tar.bz2
Reference : http://www.tuxx-home.at/projects/mga/HOWTO_mga_Xorg7

systemp5:/opt # tar xjf xf86-video-mga-1.4.2.tar.bz2
systemp5:/opt # cd xf86-video-mga-1.4.2/
systemp5:/opt/xf86-video-mga-1.4.2 # ./configure
.
..
.....
........

/configure: line 19710: pkg-config: command not found
checking if DPMSExtension is defined... no
checking for pkg-config... no
checking for XORG... configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables XORG_CFLAGS
and XORG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see .
See `config.log' for more details.
systemp5:/opt/xf86-video-mga-1.4.2 #


12. I tried to install it through YaST

systemp5:/opt/xf86-video-mga-1.4.2 # yast -i pkg-config
systemp5:/opt/xf86-video-mga-1.4.2 #
But nothing happened

Solution at last

1.Configured display using xorgconfig
The driver got setup automatically was "mga"

But while trying to start X11 using startx it showed the following error message

Error while loading module atimisc10b
No driver found
No screens found
No device to configure ,etc
2.In the IBM FAQ it was said that XFree86 should be able to use a frame buffer device
when running SUSE on a pseries , which has a Matrox G400 graphics card

So i decided to force it manually ,edited the Device Section for the Monitor
Replaced the
Driver "vga" entry by
Driver "fbdev"

Now it looks like below
Section "Device"
Identifier "Matrox"
# Driver "vga"
Driver "fbdev"
# unsupported card
#VideoRam 262144
# Insert Clocks lines here if appropriate
EndSection

3. Started X11 by startx

It showed an error related with resolution
The error was just a graphical message displaying "Hz ?"



4.So again edited /etc/X11/xorg.conf and replaced the

Modes "1280x1024" "1024x768" "800x600" "640x480"
with
Modes "1024x768"
under the Subsection "Display"
So now it looks as
Subsection "Display"
Depth 24
Modes "1024x768"
ViewPort 0 0
EndSubsection

5. And the Defaultdepth was set to "24" in the "Screen" Section
6. X11 Display got workig after this
7.But there were problems related with Horizontal and Vertical Refresh Rates.And the
USB mouse was also not working
So looked into the Rerfresh Rates under the
"Monitor" Section and set as

HorizSync 30 - 70
VertRefresh 40-160

8.Mouse device got detected was /dev/device-mapper

After referring the YaST Hardware Database it is clear thet the Mouse device is /
dev/input/mice . So edited the "InputDevice " Section for mouse as below

Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Protocol" "Busmouse" # Bus Mouse
## Option "Device" "/dev/device-mapper"
Option "Device" "/dev/input/mice"


9. But it didn't help.The mouse didn't work

Again looked into the same .And this time I just commented the
Option "Protocol" Section
and commented out "Resolution 256"
as shown below
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
## Option "Protocol" "Busmouse" # Bus Mouse
## Option "Device" "/dev/device-mapper"
Option "Device" "/dev/input/mice"
# Mouse-speed setting for PS/2 mouse.
Option "Resolution" "256"
# Option "BaudRate" "9600"
Option "SampleRate" "150"
Option "ZAxisMapping" "4 5 6 7"
Option "Emulate3Buttons"
# Option "Emulate3Timeout" "50"
# ChordMiddle is an option for some 3-button Logitech mice
# Option "ChordMiddle"
EndSection

After this everything got working except the Colour depth . It displays a lower bit Colour Pattern

AT&T USA | Internet not working | Fix by custom APN

If the AT&T Mobile internet is not working on your cellphone, it can be fixed easily by adding an APN configuration. You can read this a...