This page has been translated from Spanish

...::: Guatewireless.org ::::..

Technology, Software Libre, Guatemala, Open Source, Linux, Wireless, WiFi, Scripting, Debian, CentOS, Gentoo, Redhat, SuSE, Windows

Chapter 3.2 Bash configuration

I modify shell startup scripts of commands throughout the system in accordance with my preferences:

  / etc / bash.bashrc Replace with private one
      / etc / profile Keep accompanying lai
                              distribution copy (\ w -> \ W)
      / etc / skel / .bashrc Replace with private copy
      / etc / skel / .profile Replace with private copy
      / etc / skel / .bash_profile Replace with private copy
      ~ /. bashrc Replace with private copy for all accounts
      ~ /. profile Replace with private copy for all accounts
      ~ /. bash_profile Replace with private copy for all accounts 

See details in my example scripts I like a transparent system, so I set umask to 002 or 022.

PATH is determined by the following configuration files in this order:

  / etc / login.defs - before the shell sets PATH
      / etc / profile (may call / etc / bash.bashrc)
      ~ /. bash_profile (may call ~ /. bashrc) 

3.3 Mouse configuration


3.3.1 PS / 2

In the case of a mouse with PS / 2 connector on an ATX motherboard, the signal flow should be:

  mouse -> / dev / psaux -> gpm -> / dev / gpmdata = / dev / mouse -> X 

In this case, you create a symlink /dev/mouse that points to /dev/gpmdata to leave under some configuration utilities happy and to make reconfiguration easy. (if after all decide not to use the daemon gpm just point the symlink /dev/mouse to /dev/psaux after eliminating the demon haver gpm

This signal flow allows the keyboard and mouse to be unplugged and reinitialized by restarting gpm upon reconnect. X will stay alive!

The protocol of the signal flow between the output of gpm and X input can be implemented in either of two ways, as "ms3" (serial mouse protocol Microsoft 3 buttons) or "raw" (protocol mouse connected) and this choice dictates the choice of protocol used in X configuration

Let's look at some sample settings for a PS / 2 Logitech three button (traditional Unix-style mouse).

If one of the unfortunate whose graphics card is not supported by the new X4 and need to use the old X3 (some ATI 64 bit cards), install the X3 and configure / etc/X11/XF86Config instead of / etc/X11 / XF86Config-4 in the following examples.


3.3.1.1 The ms3 protocol approach

  / etc / gpm.conf | / etc/X11/XF86Config-4
      =========================+======================== ==============
      device = / dev / psaux | Section "InputDevice"
      responsiveness = | Identifier "Configured Mouse"
      repeat_type = ms3 | Driver "mouse"
      type = autops2 | Option "CorePointer"
      append = "" | Option "Device" "/ dev / mouse"
      sample_rate = | Option "Protocol" "IntelliMouse"
                               | EndSection 

Using this approach, the mouse type adjustment is done by simply editing the file gpm.conf and X configuration is left unchanged. See mis scripts de ejemplo


3.3.1.2 The raw protocol

  / etc / gpm.conf | / etc/X11/XF86Config-4
      =========================+======================== ==============
      device = / dev / psaux | Section "InputDevice"
      responsiveness = | Identifier "Configured Mouse"
      repeat_type = raw | Driver "mouse"
      type = autops2 | Option "CorePointer"
      append = "" | Option "Device" "/ dev / mouse"
      sample_rate = | Option "Protocol" "MouseManPlusPS / 2"
                               | EndSection 

Using this approach, the mouse type adjustment is done by editing gpm.conf as adjusting X configuration


3.3.1.3 How to adjust to different mice

It is assumed that the device type autops2 gpm autodetect most of the PS / 2 mice on the market. Unfortunately not always work and not available in older versions of Woody. In these cases, try using ps2 or the file imps2 gpm.conf instead of autops2. To see what kinds of mouse gpm type: gpm-t help. See gpm(8)

If using a PS / 2 two button, set the X protocol to enable Emulate3Buttons. The difference of protocol between the 2-button mouse and a 3-button mouse is auto-adjusted for gpm after tapping once the center button.

For X protocol with raw protocol approach, Section 3.3.1.2 or without gpm use:

  • IntelliMouse: serial port (repeater gpm with "ms3")
  • PS / 2: PS / 2 (always test this first)
  • IMPS / 2: any PS / 2 (2, 3, or scroll mice, better)
  • MouseManPlusPS / 2: PS / 2 port Logitech
  • ...

See more at Mouse Support in XFree86

For standard wheel mice from Microsoft, is reported to work best with:

  / etc / gpm.conf | / etc/X11/XF86Config-4
      =========================+======================== ==============
      device = / dev / psaux | Section "InputDevice"
      responsiveness = | Identifier "Configured Mouse"
      repeat_type = raw | Driver "mouse"
      type = autops2 | Option "CorePointer"
      append = "" | Option "Device" "/ dev / mouse"
      sample_rate = | Option "Protocol" "IMPS / 2"
                               | Option "Buttons" "5"
                               | Option "ZAxisMapping" "4 5"
                               | EndSection 

For some Toshiba notebook PCs, activating gpm before PCMCIA in the System-V home can help prevent system lockup. Weird but true.


3.3.2 USB mice

Make sure you have all required kernel functions activated through kernel compile time configuration or modules:

  • Under "Input core support":
    • "Input core support" (CONFIG_INPUT, input.o
    • "Mouse support" (CONFIG_INPUT_MOUSEDEV, mousedev.o
  • Under "USB support":
    • "Support for USB" (CONFIG_USB, usbcore.o
    • "Preliminary USB device filesystem" (CONFIG_USB_DEVICEFS)
    • "UHCI" or "OHCI" (CONFIG_USB_UHCI | | CONFIG_USB_UHCI_ALT | | CONFIG_USB_OHCI, usb-uhci.o | | uhci.o | | usb-ohci.o
    • "USB Human Interface Device (full HID) support" (CONFIG_USB_HID, hid.o and
    • "HID input layer support" (CONFIG_USB_HIDINPUT)

Here, lower case names are module names.

If you are not using devfs, create a device node /dev/input/mice with major 13 and minor 63 as follows:

  # Cd / dev
      # Mkdir input
      # Mknod input / mice c 13 63 

For typical scroll USB three-button, the configuration might be:

  / etc / gpm.conf | / etc/X11/XF86Config-4
      =========================+======================== ==============
      device = / dev / input / mice | Section "InputDevice"
      responsiveness = | Identifier "Generic Mouse"
      repeat_type = raw | Driver "mouse"
      type = autops2 | Option "SendCoreEvents" "true"
      append = "" | Option "Device" "/ dev / input / mice"
      sample_rate = | Option "Protocol" "IMPS / 2"
                               | Option "Buttons" "5"
                               | Option "ZAxisMapping" "4 5"
                               | EndSection 

See Linux USB Project for more information


3.3.3 Touchpad

Although the default behavior of the touchpad on a laptop computer emulates a PS / 2 two-button, the package tpconfig allows control of the device. For example, setting OPTIONS = "-tapmode = 0" in /etc/default/tpconfig behavior disable pesky "click by tap". Configure the /etc/gpm.conf as follows to use both touchpad and USB external control as the console:

  device = / dev / psaux
      responsiveness =
      repeat_type = ms3
      type = autops2
      append = "-M-m / dev / input / mice-t autops2"
      sample_rate = 

3.4 NFS configuration

Configure NFS in /etc/exports

  # Apt-get install nfs-kernel-server
      # Echo "/ *. domainname-for-lan-hosts (rw, no_root_squash, nohide)" \
              >> / Etc / exports 

Véase mi script de ejemplo para más detalles


3.5 Samba configuration

References:

  • http://www.samba.org/
  • package samba-doc

Setting up Samba with "share" mode is easier since this creates WfW-type share drives. But it is preferable to set "user" mode.

Samba can be configured through debconf or vi

  # Dpkg-reconfigure - priority = low samba # in Woody
      # Vi / etc / samba / smb.conf 

Véase mi script de ejemplo para más detalles

Add a new user to the smbpasswd file can be done via smbpasswd

  $ su-c "smbpasswd-a username" 

For optimum compatibility, be sure to use encrypted passwords.

Choose the level of the OS according to the following system equivalences (the larger the number, the higher the priority as server):

  0: Samba with a loose attitude (will never become a master browser)
      1: WfW 3.1, Win95, Win98, Win / Me?
      16: Win NT WAS 3.51
      17: Win NT WAS 4.0
      32: Win NT SVR 3.51
      33: Win NT SVR 4.0
      255: Samba with mighty power 

Make sure that users are members of the group owning the directory that gives shared access and that the execute bit is enabled directory.


3.6 Printer Configuration

The traditional method is lpr / lpd There is a new CUPS ™ system (Common UNIX Printing System). PDQ is another approach. See the Linux Printing HOWTO for more information.


3.6.1 lpr / lpd

For spoolers lpr / lpd lpr lprng and gnulpr set the file /etc/printcap as follows if they are connected to a PostScript printer or text:

  lp | alias: \
              : sd = / var / spool / lpd / lp: \
              : mx # 0: \
              : sh: \
              : lp = / dev/lp0: 

What the above lines:

  • Head line: lp - name of spool, alias = alias
  • mx # 0 - max file size unlimited
  • sh - suppress printing of burst page header
  • lp = / dev/lp0 - local printer device or port @ host for remote

This is a good configuration if you are connected to a PostScript printer. Also, when printing from a Windows machine through Samba, this is a good configuration for any supported printer (no bidirectional communication is supported). You must select the appropriate printer configuration under Windows.

If you do not have a PostScript printer, you need to set up a filtering system using gs There are several automatic configuration tools to configure the file /etc/printcap Any of these combinations is an option:

  • gnulpr lpr-ppd and printtool - I use this.
  • lpr and apsfilter
  • lpr and magicfilter
  • lprng and lprngtool
  • lprng and apsfilter
  • lprng and magicfilter

To run GUI configuration tools such as printtool see Getting root in X, Section 9.4.11 to gain root privilege. Printers created with printtool use gs and act like PostScript printers. So when accessing them, use PostScript printer drivers. On the Windows side, "Apple LaserWriter" is the standard.


3.6.2 CUPS ™

The Common UNIX Printing System (or CUPS ™) is installed with aptitude "Tasks" -> "Servers" -> "Print Server". (Sarge) For best result, aptitude "F10" -> "Options" -> "Dependency handling" -> "[X] Install Recommended packages automatically".

The desktop environments KDE and Gnome allow easy printer configuration. Alternatively, if you have installed swat can configure the system using any web browser:

  $ Mybrowser http://localhost:631 

For example, to add a printer on a port to the list of accessible printers:

  • Click "Printers" (Printers) on the main page and then "Add Printer" (Add Printer),
  • enter "root" as username and its password,
  • proceed to add the printer following the prompts,
  • return to the "Printers" page and click "Configure Printer" (Printer Setup) and
  • proceed to configure the paper size, resolution and other parameters.

See more information at http://localhost:631/documentation.html and http://www.cups.org/cups-help.html


3.7 Other host installation hints


3.7.1 Install a few more packages

Once reached this point, has a small but functioning Debian system. It's time to install bigger packages.

  • Run tasksel See Installing tasks tasksel Section 6.2.1.Si the need, you can choose the following packages:
    • End User - X window system
    • Development - C and C + +
    • Development - Python
    • Development - Tcl / Tk
    • Other - TeX / LaTeX
    • For the rest - I prefer to use tasksel looking for guidance and install info> <task selectively through dselect
  • Run dselect Here the first thing you might want to do is select your favorite editor and any programs you need. You can install many Emacs variants at the same time. See dselect Section 6.2.3 Popular editors, Section 11.1.También can replace some other default packages with more options.
    • ...
  • ...

I usually edit /etc/inittab for easy shutdown my machine.

  ...
      # What to do when CTRL-ALT-DEL
      ca: 12345: ctrlaltdel: / sbin / shutdown-t1-a-h now
      ... 

3.7.2 Modules

Modules for the device drivers are configured during the initial installation. modconf menu provides an interface for module configuration afterward. This program is quite useful when some modules were left during the initial installation or install a new kernel after doing the same.

All modules are loaded in the file /etc/modules I also use lsmod and depmod to control them manually.

Also make sure to add a few lines in /etc/modules to handle IP masquerading (FTP, etc..) For 2.4 kernels. See The modular kernel 2.4, Section 7.2 and, in particular, Network Functions, Section 7.2.3.


3.7.3 Basic configuration of a CD burner

For an IDE CD-RW drive with 2.4 kernel, edit the following files:

  / etc / lilo.conf (add append = "hdc = ide-scsi ignore = hdc"
                       run lilo to activate)
      / dev / cdrom (symlink # cd / dev; ln-sf scd0 cdrom)
      / etc / modules (add "ide-scsi" and "sg". After this "sr" if
                       required.) 

See CD, Section 9.3 for details.


3.7.4 Large memory and auto power

Edit the /etc/lilo.conf as follows for large memory (for 2.2 kernels) and auto power off (for APM):

  append = "mem = 128M apm = on apm = power-off noapic" 

Run lilo to install these settings. Apm = power-off is needed for a SMP kernel and noapic is needed to minimize the effects of my hardware. The same can be done directly by entering options at the boot prompt. See Other tricks with the boot, Section 8.1.5.

If APM is compiled as a module, as with the Debian default 2.4 kernels, run insmod apm power_off = 1 after boot or set /etc/modules by:

  # Echo "apm power_off = 1">> / etc / modules 

Alternatively, compiling ACPI support achieves the same goal with newer kernels and seems to be more SMP-friendly (this requires a newer motherboard). The 2.4 kernel on newer motherboards should detect large memory correctly.

  CONFIG_PM = y
      CONFIG_ACPI = y
      ...
      CONFIG_ACPI_BUSMGR = m
      CONFIG_ACPI_SYS = m 

and add the following lines in /etc/modules in this order:

  ospm_busmgr
      ospm_system 

Or recompile the kernel with all the options above and. In any case, none of you do not need any of the boot-prompt parameters.


3.7.5 Strange access problems with some websites

By default, Recent Linux kernels enable ECN, which can cause access problems in some websites on a bad routers. To check ECN status:

  # Cat / proc/sys/net/ipv4/tcp_ecn
       ...  or
      # Sysctl net.ipv4.tcp_ecn 

To disable it, use:

  # Echo "0"> / proc/sys/net/ipv4/tcp_ecn
       ...  or
      # Sysctl-w net.ipv4.tcp_ecn = 0 

To disable TCP ECN on every boot, edit /etc/sysctl.conf and add:

  net.ipv4.tcp_ecn = 0 

3.7.6 Configuring PPP Dialup

Install the package pppconfig to set up dialup PPP.

  # Apt-get install pppconfig
      # Pppconfig
       ...  follow the prompts to configure PPP
      # Adduser user_name dip
       ...  allows the user to access the Internet via PPP 

PPP access can be initiated by the user (user):

  $ Pon ISP_name # start PPP access to your ISP
       ...  enjoy the Internet
      $ Poff ISP_name # stop PPP access, ISP_name
      optional 

See Configuring a PPP interface, Section 10.2.4 for more details.


3.7.7 Other configuration files to tweak in /etc

You may want to add a file /etc/cron.deny missing from the standard Debian install (you can copy /etc/at.deny

Popularity: 1%

Please enter a comment

Please note the following:
Comments are moderated, so it can take in being published. No need to repeat his comment.
Your email will never be revealed.