Thursday, August 23, 2007

Starting X11 VNC in Linux

Create vnc passwd
x11vnc -storepasswd

Use authentication while connecting
x11vnc -rfbauth ~/.vnc/passwd

Keep the VNC Session after each login and logout
x11vnc -forever
Don't use shm of X if you have problems in display
x11vnc -noshm

So the final command is
x11vnc -noshm -forever -rfbauth ~/.vnc/passwd

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

Saturday, June 30, 2007

Linux Operating System

Linux Newbie Administrator Guide (LNAG)
LINUX NEWBIE ADMINISTRATOR GUIDE
ver. 0.201 2004-07-22 by Stan, Peter and Marie Klimas
The latest version of this guide is available at http://linux-newbie.sunsite.dk.
Copyright (c) <1999-2004> by Peter and Stan Klimas. Your feedback, comments, corrections, and improvements are appreciated. Send them to linux_nag@canada.com This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0, 8 or later http://opencontent.org/openpub/ with the modification noted in lnag_licence.html.

(Click this icon to access the counter for this page)


Intro. We are relative Linux newbies (with Linux since Summer 1998). We run mostly RedHat and Mandrake -> the solutions might not be directly applicable to other Linux distributions (although most of them probably will be). Hope this helps; we try to be as practical as possible. Of course, we provide no warranty whatsoever. If you spotted a bad error or would like to contribute a part on a topic of your choice, we would like to hear from you.

General description of this Guide. A complete reference for new Linux users who wish to set up and administer their own Linux home computer, workstation and/or their home or small office network. The answers are meant to be simple, with just sufficient detail, and always supported with a readily usable example. The work is still in progress, but we hope the Guide can be helpful already. We welcome your corrections, advice, criticism, links, translations, and CONTRIBUTIONS. Pls note that there are no ad banners on our pages.

Conventions:
<> = single special or function key on the keyboard. For example indicates the "control" key.
italic = name of a file or variable you probably want to substitute with your own.
fixed width = commands and filenames.

Part 0: For the Undecided (Linux Benefits)
If you are wondering what the Linux pros and cons are, and whether Linux is for you.

Part 1: Before Linux Installation
What distribution should I use, how to obtain it, Linux hardware requirements, how to partition your hard drive, about dual boot, which packages to install, which graphical user interface (GUI) to install (gnome or kde?), and how to login for the very first time.

Part 2: Linux Resources, Help and Some Links
How to access the Linux documentation (from under MS Windows or Linux), what are Linux help commands, where to find the geek dictionary, + pointers to some Linux newsgroups and websites.

Part 3: Basic Operations FAQ
After you installed Linux, here are answers to some questions that Linux newbie users/administrators may have when trying to perform every-day tasks: what are the file name conventions, how to run a program, shut down my computer, set up the path, add users, remove users, make your passwords and system more secure, work with file permissions, schedule jobs with "at" and cron, change your shell prompt, print symbols in the text mode, use color in the text mode, redirect input/output, write a simple shell script, install a new program ...

Part 4.1: Boot-time issues
Some info on LILO and GRUB boot managers, how do I choose the operating system which boots on default, hints on configuration of the boot loaders, "uninstalling" Linux ...

Part 4.2: Drives
Where are my drives, how to access them, configure user access, get the zip drive recognized, set 32-bit hard drive IO, increase the limit on the number of opened files, add a new hardrive, manage the swap space ...

Part 4.3: X-windows
How to switch between text and graphical consoles, set up my video card, monitor and mouse for the X-server, setup a graphical login prompt, change a default desktop, have multiple sessions of Xwindows running at the same time, use Xwindow remotely, install TrueType fonts from my MS Windows partition to Linux, how to copy-paste under X and in the text mode, how to use VNC.

Part 4.4: Basic Configurations
Real basics on how to configure the printer and soundcard, bits about configuration files, daemons, and device files.

Part 4.5: Networking
Setting up a network, ppp (connection over the phone), remote access to your computer, ftp and html server, e-mail, how my computer can get hacked ...

Part 5: Linux Shortcuts and Commands
Maybe this should have come first. A practical selection of Linux shortcuts and commands in a concise form. Perhaps this is everything that a computer-literate newbie Linuxer really needs. Highly recommended.

Part 6: Linux applications (proprietary or not)
Essential and/or famous Linux applications with some hint/comments: word processing, spreadsheet, database, latex. Extensive info on how to set up and use a CD recorder to write data, audio, and mixed mode CDs.

Part 7: Learning with Linux (commands for more esoteric work or programming)
Review of some more advanced or less useful commands/tools to get you started with fancier text processing, encryption, digital signatures (gpg), simple programming plus some info on the Linux console tools that can help you learn about computers. Under development so perhaps not so good: grep, regular expressions, sed, gawk, sort, ascii codes, linux built-in c compiler and tools, perl, python, tcl/tk, "Reverse Polish Notation" (RPN) calculator, scilab, wine ... working on it.

Licence, Acknowledgments and log of changes.
The master copy of this page is http://sunsite.dk/linux-newbie/ (Denmark, Europe) hosted free by SunSite at Aalborg University. There are some official mirrors listed below.
Mirror: http://slayernetworking.com/newbie (Seattle, Washington, USA) hosted by Joe Morthland ( Skull ) (new).
Mirror: http://dbstreams.ca/mirrors/linux-newbie/ (Canada) hosted free by Kenan Bektas of DB Streams Inc.
Mirror: http://www.linsup.com/newbie/ (Australia) hosted free by linsup.com.
Only the link to the title page (e.g., http://sunsite.dk/linux-newbie/) is (rather) guaranteed not to change. Links to individual chapters may break because filenames may need to change in the future.
Translations
A Hebrew translation (partial, pdf only) is available locally here (new).
A Portugese translation is available at http://www.onlinux.com.br/dicas/lnag/index.htm (Brasil) and locally here contributed by Ronaldo T Morais .
A French translation (in progress, Part 1-3 so far) is available at http://www.gerelia.asso.fr/lnag.html (France). Thanks to David (new).
A Russian translation (new) is avialable at http://linuxbegin.by.ru/lnag_ru/ . An older Russian translation (ver. 0.10 ) is available here locally or at http://www.college.balabanovo.ru/rider/book/ (Russia).
A Polish translation is available at http://www.wzz.org.pl/~lnag/pl/ (Poland).
A Chinese translation (Big-5) of the "Linux Shortcuts and Commands" (ver. 0.32) is available (locally) here.
A Chinese translation (GB) of 3 parts is avialable (locally) here.
A pdf file of a full chinese translation is available here (new) ( ~ 1 MB).
Downloading for Printing and Viewing Off-Line
The following files are available for downloading:
The original OpenOffice.org document is available here and a ziped version is available here.
The Microsoft Word doc version of the Linux Newbie Guide is available here and a ziped version is available here.
The pdf version of the Linux Newbie Guide is here (~600 kB, best for printing and off-line reading).
The postscript version of the Linux Newbie Guide is here (~10 MB) and a ziped version is available here (~4 MB).
The html zip version of the Linux Newbie Guide is here (~300 kB, includes all the local html files).

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...