Monday, December 31, 2007

How to: Restrict Users to SCP and SFTP and Block SSH Shell Access with rssh

FTP is insecure protocol, but file-transfer is required all time. You can use OpenSSH Server to transfer file using SCP and SFTP (secure ftp) without setting up an FTP server. However, this feature also grants ssh shell access to a user. Basically OpenSSH requires a valid shell. In this article series we will help you provide secure restricted file-transfer services to your users without resorting to FTP. It also covers chroot jail setup instructions to lock down users to their own home directories (allow users to transfer files but not browse the entire Linux / UNIX file system of the server) as well as per user configurations.
http://www.cyberciti.biz/tips/rhel-centos-linux-install-configure-rssh-shell.html

FTP is insecure protocol, but file-transfer is required all time. You can use OpenSSH Server to transfer file using SCP and SFTP (secure ftp) without setting up an FTP server. However, this feature also grants ssh shell access to a user. Basically OpenSSH requires a valid shell. Here is how sftp works:

SCP/SFTP -> SSHD -> Call sftpd subsystem -> Requires a shell -> User can login to server and run other commands.

In this article series we will help you provide secure restricted file-transfer services to your users without resorting to FTP. It also covers chroot jail setup instructions to lock down users to their own home directories (allow users to transfer files but not browse the entire Linux / UNIX file system of the server) as well as per user configurations.

rssh ~ a restricted shell

rssh is a restricted shell for use with OpenSSH, allowing only scp and/or sftp. It now also includes support for rdist, rsync, and cvs. For example, if you have a server which you only want to allow users to copy files off of via scp, without providing shell access, you can use rssh to do that.

Supported operations using rssh

Restricted shell only allows following operations only:

  • scp - Secure file copy
  • sftp - Secure FTP
  • cvs - Concurrent Versions System ~ you can easily retrieve old versions to see exactly which change caused the bug
  • rsync - Backup and sync file system
  • rdist - Backup / RDist program maintains identical copies of files on multiple hosts.

Install rssh

CentOS / Fedora / RHEL Linux rssh installation

Visit Dag’s repo to grab rssh package
# cd /tmp
# wget http://dag.wieers.com/rpm/packages/rssh/rssh-2.3.2-1.2.el5.rf.i386.rpm
# rpm -ivh rssh-2.3.2-1.2.el5.rf.i386.rpm

Debian / Ubuntu Linux rssh installation

Use apt-get command:
$ sudo apt-get install rssh

FreeBSD installation

# cd /usr/ports/shells/rssh
# make install clean

Make sure you build binary with rsync support.

rssh configuration file

  • Default configuration file is located at /etc/rssh.conf (FreeBSD - /usr/local/etc/rssh.conf)
  • Default rssh binary location /usr/bin/rssh (FreeBSD - /usr/local/bin/rssh)
  • Default port none - ( openssh 22 port used - rssh is shell with security features)

Continue reading rest of the rssh a restricted shell series.

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or full RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in...

Thursday, December 27, 2007

GRUB Splash Image HowTo

http://forums.fedoraforum.org/showthread.php?t=1243
http://ruslug.rutgers.edu/~mcgrof/grub-images/
http://gentoo-wiki.com/HOWTO_Splash_image_in_GRUB

Instructions

Requirements for GRUB splashimages:

1. xpm.gz file type
2. 640x480
3. 14 colors only

If you already have your image:

1. Gzip your xpm file and put it into your /boot/grub directory (as root)
Code:
# gzip myfile.xpm

2. Edit your grub.conf file
Code:
# nano /boot/grub/grub.conf

and add this line:
splashimage=(hd0,0)/GRUB/myfile.xpm.gz
NOTE Change the partition and directory according to your system's setup.
3. reboot

How to convert an image to only 14 colors
To get the GIMP to use only a 14 color palette, right click on your file and press ALT+I and put 14 where it says "Generate Optimal Palette:" on the top of the menu. If ALT+I doesn't get you there then right click on the image and go to:

Image-->Mode-->Indexed

Specify you want 14 colors and then if you want (*recommended*) select NO DITHERING. This will tell the gimp not to try to guess colors in between areas.

It does not have to be filename.xpm.gz only, but, compressed files load quicker that uncompressed files.

You can also change the foreground and background color of the menu, like this:
Just put something like the following in your menu.lst file:
foreground = ffffff (for text color)
background = 000000 (for background color)

Colors:
ffffff = white
000000 = black
333333 = cyan dark
666666 = cyan light

View images of currently available splashimages

Download working publically available GRUB splash images

------------------------------------------
The complete GRUB Splash Image Howto is here

Good Luck !!!
___________________________
Greetings
gonzalo


===================

Introduction

The splash image is the image shown in the background when GRUB is displaying the list of operating systems you can boot. All you need to customize it is the GIMP or Imagemagick. You will need to make sure your GRUB supports the splashimage command. I took image from gentoo.org and cut a little for the GRUB background.

Creating image (GIMP)

1. Start the GIMP.
2. Click on File » New or type Ctrl+n
3. In the new image dialog, change Width to 640 pixels and Height to 480 pixels (the image should be of size 640x480 pixels). Now click OK.
4. Create the image which you would like to be the splash image. It's quite fun to experiment with the various tools of the GIMP!
5. After you have finished creating the image, hit Alt+i or right click on the image and click on Image » Mode » Indexed.
6. In the Indexed Color Conversion dialog that appears, click on the radio button Generate optimal Palette and in # of colors enter 14. Click OK (the image should be of only 14 colors).
7. Now right-click on the image and click on File » Save As.... Save the file as ImageName.xpm in a directory of your choice. If you can't create ImageName.xpm you can save it as ImageName.png and then convert it with convert ImageName.png ImageName.xpm (convert is a part of imagemagick).
8. Open a terminal, change directory to where the ImageName.xpm was saved, then compress it using GNU-zip: gzip ImageName.xpm

But be careful if you create you work with GIMP under Windows. It will use the standard Windows newline CR+LF. Nethertheless it seems as if GRUB can only cope with plain LF newlines. You have to convert the lineformat manually.

Creating image (Imagemagick)

You can also pick an image (any type supported by ImageMagick) and execute:

convert picture.jpg -resize 640x480! -colors 14 -depth 8 ImageName.xpm.gz

Installing the Image

Make sure you are root, then run the following in the terminal:

# mount /boot
# mv ImageName.xpm.gz /boot/grub/


In the /boot/grub/grub.conf you have to point splashimage to newly created image i.e.:
File: /boot/grub/grub.conf

# Splash Image
splashimage=(hd0,0)/grub/ImageName.xpm.gz

If your boot splash did not change,then try the following:

# cp ImageName.xpm.gz /boot/grub/splash.xpm.gz

That's it! When you reboot, you will find your image in the background, with the menu of operating systems etc. in the foreground.
Changing text colors

If you do not like the look of the default text settings (white text with black shadow and highlighting) or it turns out to be hard to read with your splashimage even though the color command wont work, there is a way to modify these. Use the command foreground to edit the text and border color background will do for the shadows and highlighted background of the selected item.
File: /boot/grub/grub.conf

# Set text color to RRGGBB
foreground RRGGBB

# Set shadows and selected highlight to RRGGBB
background RRGGBB

RRGGBB must be a HEX-Colorcode, i.e. numbers 0-9 and letters A-F, each group of two representing a color. You can either try it out (R means red, G means green, B means blue, so the range from 00 to FF allows you to address a range of 0 to 255 for each color that will then be combined with those of the others to make up the color you chose) or (more conveniently ;-) copy the 6-digit code that e.g. the KDE or GIMP color choosers provide.
Credits

* Some splash images
* Some more splash images
* Even more splash images
* ImageMagick Tricks book

Wednesday, December 26, 2007

Module snd-via82xx

PCM Device VIA 8237

http://ubuntuforums.org/archive/index.php/t-1994.html

This is in my /etc/modprobe.conf
alias eth0 via-rhine
alias scsi_hostadapter libata
alias scsi_hostadapter1 sata_via
alias scsi_hostadapter2 pata_via
alias snd-card-0 snd-via82xx
options snd-card-0 index=0
options snd-via82xx index=0


========== Then do ==============
This seems to solve the problem and load always the module:
=========================================
If there is anyone still alive who has this problem, one solution is to insert the line

options snd-via82xx dxs_support=3

in /etc/modprobe.d/alsa-base and just reboot.8)
=========================================

But mplayer was working without sound
http://www.fedoraonline.it/modules/newbb/viewtopic.php?post_id=32086

Se non va ancora...
...se lanci mplayer con una di queste opzioni:
$ mplayer -ao nosound blablabla.avi
o
$ mplayer -ao sdl blablabla.avi
o
$ mplayer -ao alsa blablabla.avi
o
$ mplayer -ao oss blablabla.avi

The last option worked for me and gave sound to mplayer.

==========================
When the sound is working this are the modules that I have:
[root@localhost acardh]# /sbin/lsmod | grep 82
nfnetlink 8281 3 nf_conntrack_ipv4,nf_conntrack_ipv6,nf_conntrack
ip6t_REJECT 8257 2
dm_multipath 18249 0
snd_via82xx 25177 1
gameport 14665 1 snd_via82xx
snd_ac97_codec 92389 1 snd_via82xx
snd_mpu401_uart 10177 1 snd_via82xx
snd_pcm 63685 4 cx88_alsa,snd_via82xx,snd_ac97_codec,snd_pcm_oss
snd_page_alloc 11337 2 snd_via82xx,snd_pcm
snd 43461 12 cx88_alsa,snd_seq_oss,snd_seq,snd_via82xx,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_mpu401_uart,snd_pcm,snd_rawmidi,snd_seq_device,snd_timer
i2c_core 21825 9 dvb_pll,nxt200x,cx88_vp3054_i2c,tuner,nvidia,cx88xx,i2c_algo_bit,tveeprom,i2c_viapro
ehci_hcd 31821 0


[root@localhost acardh]# /sbin/lsmod | grep snd
snd_seq_dummy 6725 0
snd_seq_oss 29889 0
snd_seq_midi_event 9793 1 snd_seq_oss
snd_seq 44849 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_via82xx 25177 1
gameport 14665 1 snd_via82xx
snd_ac97_codec 92389 1 snd_via82xx
snd_pcm_oss 37569 0
snd_mixer_oss 16705 3 snd_pcm_oss
ac97_bus 6081 1 snd_ac97_codec
snd_mpu401_uart 10177 1 snd_via82xx
snd_pcm 63685 4 cx88_alsa,snd_via82xx,snd_ac97_codec,snd_pcm_oss
snd_rawmidi 21185 1 snd_mpu401_uart
snd_seq_device 10061 4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd_timer 20549 2 snd_seq,snd_pcm
snd_page_alloc 11337 2 snd_via82xx,snd_pcm
snd 43461 12 cx88_alsa,snd_seq_oss,snd_seq,snd_via82xx,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_mpu401_uart,snd_pcm,snd_rawmidi,snd_seq_device,snd_timer
soundcore 9633 3 snd


==============================
$$$$$$$$$$$$$$$$$$$$$$$
Sound problem correction link
This is what I have in my /etc/modprobe.d/alsa-base
===============================
options snd-via82xx dxs_support=3

#http://www.linuxquestions.org/questions/fedora-35/problem-with-audio-in-fc5-433011/
# ALSA portion
options snd cards_limit=2
alias snd-card-0 snd-via82xx
alias snd-card-1 cx88-alsa
options snd-via82xx index=0
options cx88-alsa index=1
# OSS/Free portion
alias sound-slot-0 snd-via82xx
alias sound-slot-1 cx88-alsa
====================================
This last oprions in /etc/modprobe.d/alsa-base seemed to work in my Fedora 8

And this is the data in my PC (Fedora 8)

Model: Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller

Sound problem: PCM device VIA 8237

=================
Whithout sound:
[acardh@localhost ~]$ /sbin/lsmod | grep snd
snd_via82xx 25177 0
gameport 14665 1 snd_via82xx
snd_ac97_codec 92389 1 snd_via82xx
ac97_bus 6081 1 snd_ac97_codec
snd_seq_dummy 6725 0
snd_seq_oss 29889 0
snd_seq_midi_event 9793 1 snd_seq_oss
snd_seq 44849 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss 37569 0
snd_mixer_oss 16705 1 snd_pcm_oss
snd_pcm 63685 4 snd_via82xx,snd_ac97_codec,cx88_alsa,snd_pcm_oss
snd_timer 20549 2 snd_seq,snd_pcm
snd_mpu401_uart 10177 1 snd_via82xx
snd_page_alloc 11337 2 snd_via82xx,snd_pcm
snd_rawmidi 21185 1 snd_mpu401_uart
snd_seq_device 10061 4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd 43461 12 snd_via82xx,snd_ac97_codec,cx88_alsa,snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_mpu401_uart,snd_rawmidi,snd_seq_device
soundcore 9633 1 snd


==============================
With Kaffeine:

Audio output unavailable. Device is busy. ()
*** PULSEAUDIO: Unable to connect: Connection refused


With MPlayer:
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 22050 Hz, 2 ch, s16le, 8.0 kbit/1.13% (ratio: 1000->88200)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)

Could not open/initialize audio device -> no sound.
Audio: no sound

===============================
Whit sound:
[acardh@localhost ~]$ /sbin/lsmod | grep snd
snd_seq_dummy 6725 0
snd_via82xx 25177 2
gameport 14665 1 snd_via82xx
snd_ac97_codec 92389 1 snd_via82xx
ac97_bus 6081 1 snd_ac97_codec
snd_seq_oss 29889 0
snd_seq_midi_event 9793 1 snd_seq_oss
snd_seq 44849 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss 37569 0
snd_mixer_oss 16705 3 snd_pcm_oss
snd_pcm 63685 5 cx88_alsa,snd_via82xx,snd_ac97_codec,snd_pcm_oss
snd_mpu401_uart 10177 1 snd_via82xx
snd_timer 20549 2 snd_seq,snd_pcm
snd_rawmidi 21185 1 snd_mpu401_uart
snd_seq_device 10061 4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd_page_alloc 11337 2 snd_via82xx,snd_pcm
snd 43461 13 cx88_alsa,snd_via82xx,snd_ac97_codec,snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_mpu401_uart,snd_timer,snd_rawmidi,snd_seq_device
soundcore 9633 3 snd


===============================

Tuesday, December 11, 2007

DynDNS and the ddclient

https://www.dyndns.com/support/clients/unix.html

In the ddclient.conf file I have:
###=============
daemon=300 #300 # check every 300 seconds
syslog=yes # log update msgs to syslog
mail=acardh #mail=root # mail all msgs to root
mail-failure=acardh #root # mail failed update msgs to root
pid=/var/run/ddclient.pid # record PID in file.
#ssl=yes # use ssl-support. Works with
# ssl-library
use=web
protocol=dyndns2
server=members.dyndns.org
login=acardh # default login
password=******** # default password
server=members.dyndns.org, protocol=dyndns2, acardh.homelinux.org
##===============================

My complete ddclient.conf is here (restricted access).

Scaling the video in MPlayer

Example:
mplayer -vf scale=720:576 laverdad18092007.wmv

Livna repostory for Fedora

http://www.my-guides.net/en/content/view/59/26/
http://www.my-guides.net/en/content/view/59/26/1/1/#livna
http://www.my-guides.net/en/content/view/91/26/
http://www.my-guides.net/en/content/view/91/26/1/1/#livna

Livna Repository

In Livna repository you can find additional programs and multimedia codecs. Install it like this:
$ sudo rpm -hiv http://rpm.livna.org/livna-release-7.rpm
$ sudo rpm --import sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-livna

** Note: From now on you should choose only one of the Livna and FreshRPMs repositories for installing additional packages. I prefer the freshrpms repository. You can disable the one you don't want or both of them like that:

$ sudo nano /etc/yum.repos.d/livna.repo
or
$ sudo nano /etc/yum.repos.d/freshrpms.repo

and change "enabled=1" to "enabled=0". For the rest of this guide I will suppose that you have both of them disabled and each time you want to add a package you will enabled the appropriate one.

================///////////////////////////

In a similar way the plugin from Adobe:

Alternativelly you can install the Adobe Fedora Repository and install/update Flash plugin easilly. Open a console and type:

$ sudo rpm -Uvh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm Now you can install flash plugin by typing:

$ sudo yum install flash-plugin
and update it like that:

$ sudo yum update flash-plugin

By default this repository will be enabled. I prefer to disable it and enable it manually each time I want to look if there is an update for Flash Plugin. To odo so type:

$ sudo nano /etc/yum.repos.d/adobe-linux-i386.repo
And change enabled=1 to enabled=0. Now whenever you want to look for an update you can type:

$ sudo yum --enablerepo=adobe-linux-i386 update flash-plugin

=====================/////////////////////////////

In the case of ATRPMS for RHEL/CEntOS/SL follow the instructions provided by http://atrpms.net/ and I recommend to set to 0 the "enabled". Then in order to install a package you can do as root:

yum --enablerepo=atrpms install x

Friday, October 26, 2007

ATI X1300 3D effects in Linux

To install XGL:
Code:
sudo apt-get install xserver-xgl
To check if you have direct rendering:
Code:
glxinfo | grep "direct rendering"
And if you change a setting you shouldn't have and need reconfigure XGL:
Code:
sudo dpkg-reconfigure -phigh xserver-xorg
Instructions to install it in the Open Source ATI driver.

I got the next message after installing xserver-xgl.
===================
Xgl server setup changed

The Xgl server will now be started automatically next time you login. It is no longer necessary to use any special X session to start Xgl, and such sessions will likely fail to work properly. Please select a regular session from your session manager next time you log in. To disable Xgl autostart for this user, create a file named ~/.config/xserver-xgl/disable

===================
To check your ATI hardware do:
lspci | grep ATI
I get:
01:00.0 VGA compatible controller: ATI Technologies Inc M52 [Mobility Radeon X1300]
==================
After trying this my 3D effects still not working.
:o(
===================
The new ATI driver version 8.42.3 supports AIGLX but is kind of buggy.
http://ati.amd.com/support/drivers/linux/linux-radeon.html
http://ati.amd.com/online/rss/atilinuxdriver.rss?OTC-rssfeedlinux
http://ati.amd.com/support/driver.html

Wednesday, October 03, 2007

Convert man Pages to Text

(link to page)

At the command line, run:

$ man | col -b > filename.txt

Here's what it means:

man = display the man pages for a stated command

| = pipe the output of the man pages somewhere else

col -b = format the output

> = send the output to a file

filename.txt = name of the file you wish to create and populate with output

Tuesday, September 18, 2007

Removing orphaned dependencies in Gentoo

(link to Gentoo documentation on Portage)
emerge --update --newuse --deep --ask world
revdep-rebuild -X -av

emerge --depclean

Tuesday, September 04, 2007

Using the command texhash

(link to page)

To write a resumé in LaTeX you need a special class file called res.cls.

To use these files you will need the resume class file res.cls available from the CTAN TeX archive. You can do one of two things with this file: If you want to correctly install it for future use, place it in your TeX search path (/usr/local/share/texmf/tex/misc on my machine) then run ``texhash'' as root to rebuild the hash table. If you only plan to use it for this one project, you could alternatively just place the file in the same directory as the Makefile and tex file.

Once you have done this, simply edit the file cv-us.tex and then type ``make'' at the command prompt. DVI, PS, and PDF files will be created automatically.

Saturday, August 11, 2007

Video processing in Linux

To split video, one good tool is Avidemux.

And to compress the video the command transcode might be used.
transcode -i myinput.mpg -o myoutput.avi -y xvid4

Other useful commands are mencoder and ffmpeg
http://gentoo-wiki.com/HOWTO_Mencoder_Introduction_Guide
http://electron.mit.edu/~gsteele/ffmpeg/

Friday, August 10, 2007

Packages blocking in Gentoo

results into a block with aspell.

emerge wants to update app/dicts/aspell-en-6.0.0 [0.51.1]
wants to install new app-text/aspell-0.60.5
and blocks: app-dicts/aspell-en-0.5* (is blocking app-text/aspell-0.60.5


What am I doing wrong?

That's ok.
Just unmerge apsell-en-0.5* & emerge spell-en-6.0.0:

# emerge -C aspell-en && emerge -1 aspell-en

=========
For blocking packages in KDE check http://www.gentoo.org/doc/en/kde-config.xml

Code Listing 4.1: Removing KDE 3.4 packages

# emerge --unmerge =arts-3.4* =kdelibs-3.4* =kdebase-3.4* ... 

Obviously this is very frustrating if you have many KDE packages installed. However this operation can be automated in many ways. The following one is an example.

First we list all the packages that we want to remove. We use the equery command for this, part of the app-portage/gentoolkit package:

Code Listing 4.2: Listing packages to remove

(List all the installed KDE packages)
# equery list kde-base/
(List all the installed KDE packages and select the ones from KDE 3.4)
# equery list kde-base/ | grep 3\.4

At this point you should double-check that the list corresponds to the packages that should be removed from the system. If you think it is ok, you can go on and pass the list to the emerge --unmerge command.

Code Listing 4.3: Removing selected packages

# equery list kde-base/ | grep 3\.4 | xargs emerge --unmerge --pretend 

Check again the output and reissue the command without --pretend to start the unmerging process.




Friday, June 29, 2007

Enabling and disabling services during start up in GNU/Linux

In any Linux distribution, some services are enabled to start at boot up by default. For example, on my machine, I have pcmcia, cron daemon, postfix mail transport agent ... just to name a few, which start during boot up. Usually, it is prudent to disable all services that are not needed as they are potential security risks, and also they unnecessarily waste hardware resources. For example, my machine does not have any pcmcia cards so I can safely disable it. Same is the case with postfix which is also not used.

So how do you disable these services so that they are not started at boot time?

The answer to that depends on the type of Linux distribution you are using. True, many Linux distributions including Ubuntu bundle with them a GUI front end to accomplish the task which makes it easier to enable and disable the system services. But there is no standard GUI utility common across all Linux distributions. And this makes it worth while to learn how to enable and disable the services via the command line.

But one thing is common for all Linux distributions which is that all the start-up scripts are stored in the '/etc/init.d/' directory. So if you want to say, enable apache webserver in different run levels, then you should have a script related to the apache webserver in the /etc/init.d/ directory. It is usually created at the time of installing the software. And in my machine (which runs Ubuntu), it is named apache2. Where as in Red Hat, it is named httpd. Usually, the script will have the same name as the process or daemon.

Here I will explain different ways of enabling and disabling the system services.

1) Red Hat Method

Red Hat and Red Hat based Linux distributions make use of the script called chkconfig to enable and disable the system services running in Linux.

For example, to enable the apache webserver to start in certain run levels, you use the chkconfig script to enable it in the desired run levels as follows:
# chkconfig httpd --add
# chkconfig httpd on --level 2,3,5
This will enable the apache webserver to automatically start in the run levels 2, 3 and 5. You can check this by running the command:
# chkconfig --list httpd
One can also disable the service by using the off flag as shown below:
# chkconfig httpd off
# chkconfig httpd --del
Red Hat also has a useful script called service which can be used to start or stop any service. Taking the previous example, to start apache webserver, you execute the command:
# service httpd start
and to stop the service...
# service httpd stop
The options being start, stop and restart which are self explanatory.

2) Debian Method

Debian Linux has its own script to enable and disable services across runlevels. It is called update-rc.d. Going by the above example, you can enable apache webserver as follows
# update-rc.d apache2 defaults
... this will enable the apache webserver to start in the default run levels of 2,3,4 and 5. Of course, you can do it explicitly by giving the run levels instead of the "defaults" keyword as follows:
# update-rc.d apache2 start 20 2 3 4 5 . stop 80 0 1 6 .
The above command modifies the sym-links in the respective /etc/rcX.d directories to start or stop the service in the destined runlevels. Here X stands for a value of 0 to 6 depending on the runlevel. One thing to note here is the dot (.) which is used to terminate the set which is important. Also 20 and 80 are the sequence codes which decides in what order of precedence the scripts in the /etc/init.d/ directory should be started or stopped.

And to disable the service in all the run levels, you execute the command:
# update-rc.d -f apache2 remove
Here -f option which stands for force is mandatory.

But if you want to enable the service only in runlevel 5, you do this instead:
# update-rc.d apache2  start 20 5 . stop 80 0 1 2 3 4 6 .
3) Gentoo Method
Gentoo also uses a script to enable or disable services during boot-up. The name of the script is rc-update . Gentoo has three default runlevels. Them being: boot, default and nonetwork. Suppose I want to add the apache webserver to start in the default runlevel, then I run the command:
# rc-update add apache2 default
... and to remove the webserver, it is as simple as :
# rc-update del apache2
To see all the running applications at your runlevel and their status, similar to what is achieved by chkconfig --list, you use the rc-status command.
# rc-status --all
4) The old fashioned way
I remember the first time I started using Linux, there were no such scripts to aid the user in enabling or disabling the services during start-up. You did it the old fashioned way which was creating or deleting symbolic links in the respective /etc/rcX.d/ directories. Here X in rcX.d is a number which stands for the runlevel. There can be two kinds of symbolic links in the /etc/rcX.d/ directories. One starts with the character 'S' followed by a number between 0 and 99 to denote the priority, followed by the name of the service you want to enable. The second kind of symlink has a name which starts with a 'K' followed by a number and then the name of the service you want to disable. So in any runlevel, at any given time, for each service, there should be only one symlink of the 'S' or 'K' variety but not both.

So taking the above example, suppose I want to enable apache webserver in the runlevel 5 but want to disable it in all other runlevels, I do the following:

First to enable the service for run level 5, I move into /etc/rc5.d/ directory and create a symlink to the apache service script residing in the /etc/init.d/ directory as follows:
# cd /etc/rc5.d/
# ln -s /etc/init.d/apache2 S20apache2
This creates a symbolic link in the /etc/rc5.d/ directory which the system interprets as - start (S) the apache service before all the services which have a priority number greater than 20.

If you do a long listing of the directory /etc/rc5.d in your system, you can find a lot of symlinks similar to the one below.
lrwxrwxrwx  1 root root 17 Mar 31 13:02 S20apache2 -> ../init.d/apache2
Now if I start a service, I will want to stop the service while rebooting or while moving to single user mode and so on. So in those run levels I have to create the symlinks starting with character 'K'. So going back to the apache2 service example, if I want to automatically stop the service when the system goes into runlevel 0, 1 or 6, I will have to create the symlinks as follows in the /etc/rc0.d, /etc/rc1.d/, /etc/rc6.d/ directories.
# ln -s /etc/init.d/apache2 K80apache2
One interesting aspect here is the priority. Lower the number, the higher is the priority. So since the starting priority of apache2 is 20 - that is apache starts way ahead of other services during startup, we give it a stopping priority of 80. There is no hard and fast rule for this but usually, you follow the formula as follows:

If you have 'N' as the priority number for starting a service, you use the number (100-N) for the stopping priority number and vice versa.

(link to original post)

Thursday, June 28, 2007

K3B extra plugins

yum --enablerepo=livna install k3b-extras-nonfree


Auto Loading modules at boot time

Add the module to the list to be loaded at boot with
Code:
nano -w /etc/modules.autoload.d/kernel-2.6

Saturday, June 23, 2007

Linux WebCams

http://mxhaard.free.fr/download.html

Java, bashrc

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=/opt/jdk1.6.0_01/bin:$PATH
# User specific aliases and functions

============

In the case of root in Fedora 7
==============

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=/opt/jdk1.6.0_01/bin:/sbin:$PATH

=========
To activate the changes you can just use the next command:
source .bashrc
Or logout and login.

Friday, June 22, 2007

Add/Remove modules - drivers

(Link to webpage)

=> At boot time, only a minimal resident kernel is loaded into memory.

=> If you add new hardware you need to add driver aka modules

=> modprobe intelligently adds or removes a module from the Linux kernel

=> Usually modules stored in the module directory /lib/modules/$(uname -r)
$ ls /lib/modules/$(uname -r)

Task: Add a module called foo

Type the command as root user: # modprobe foo

Task: List all loaded modules

Use lsmod command to show the status of modules in the Linux Kernel:
# lsmod

Task: Remove a module called foo

Pass -r option to modprobe command to remove a module
# modprobe -r foo
You can also use rmmod command, which is simple program to remove a module from the Linux Kernel
# rmmod foo


Wednesday, June 20, 2007

17. Creating RPMs with checkinstall

(link to webpage)
Many times tarballs don't have uninstall scripts. This way your system becomes a mess when you want to uninstall these programs. Checkinstall is a program that allows you to easily build an rpm from a tarball. Download and install it from here.

Then when you want to install a tarball instead of ./configure && make && make install just type:

./configure
make
su -c '/usr/local/sbin/checkinstall'

Answer all the questions and finally install the given rpm. Checkinstall gives you the path it has stored the rpm. Now you can easily uninstall tarballs that don't have an uninstall script. This way you can keep your system clean.

Wednesday, June 06, 2007

Fixing Clock Drift On Gentoo

(Link to the original post)
Recently a machine I set up with Gentoo linux started having its hardware clock drift quite wildly. In the morning it could be up to half an hour out. This was caused by a severe skew with the hardware clock and the system clock (or the BIOS clock and linux clock respectively). So to fix this I did two things, 1 install ntpd and 2 fix the hwclock.

Installing ntpd was quite easy:

# emerge net-misc/ntp
# nano -w /etc/conf.d/ntpd

Fill in the server you want, you can use the links specified for a list of servers.

# /etc/init.d/ntpd start

If no errors are reported go on, else see if something silly has happened (e.g. typo in /etc/conf.d/ntpd).

# rc-update add ntpd default

Next I fixed adjtime and set the h/w clock correctly:

# rm /etc/adjtime
# date MMDDhhmm[[CC]YY][.ss]

(e.g. date 100912002002 for 12:00pm 10/9/2002)

Finally I set the h/w clock with the system time.

#hwclock --utc --systohc

Comments

Ruben

I tried this but it's not working can you tell me if this will work if my /etc/localtime links to /etc/zoneinfo/US/Central or do I have to change that too

Curtis

By the way, to avoid clock conflicts if your machine is a dual-boot with Window$, you should set your hwclock to local, not utc. So the last command in your tutorial here should be:

#hwclock --local --systohc

Michael Twomey

Wow, never noticed these comments, darn.

Ruben - no, the time zone should have no impact

Curtis - this is true if you dual boot. However I recommend using UTC if you aren't dual booting, as it solves a few nasty problems when daylight savings time changes.

Sunday, June 03, 2007

To chroot from one Linux to another

# /bin/bash
# chroot_to_gentoo.pl (from linux 1)
mount /dev/sda9 /mnt/gentoo ;
mount /dev/sda8 /mnt/gentoo/boot ;
mount -t proc none /mnt/gentoo/proc ;
mount -o bind /dev /mnt/gentoo/dev ;
/usr/sbin/chroot /mnt/gentoo /bin/bash

#source /etc/profile && env-update
#export PS1="(chroot) $PS1"
==================================
# /bin/bash
# chroot_to_gentoo2.pl (from linux 2)
#mount /dev/sda9 /mnt/gentoo ;
#mount /dev/sda8 /mnt/gentoo/boot ;
#mount -t proc none /mnt/gentoo/proc ;
# mount -o bind /dev /mnt/gentoo/dev ;
#/usr/sbin/chroot /mnt/gentoo /bin/bash

#This has to be in the gentoo side (gentoo partition).
source /etc/profile && env-update
#export PS1="(chroot) $PS1"
======================================
# /bin/bash
# chroot_to_gentoo3.pl (from linux 2)
#mount /dev/sda9 /mnt/gentoo ;
#mount /dev/sda8 /mnt/gentoo/boot ;
#mount -t proc none /mnt/gentoo/proc ;
# mount -o bind /dev /mnt/gentoo/dev ;
#/usr/sbin/chroot /mnt/gentoo /bin/bash

#source /etc/profile && env-update ;

#This has to be in the gentoo side (gentoo partition).
export PS1="(chroot) $PS1"
===============================
#/bin/bash
# exit_chroot.pl (from linux 1 after the command "exit" from linux 2)
#cd /home/acardh ;
umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
=================================

Invalid atom in gentoo

# emaint --check world
Checking world for problems

'sys-apps/coldplugapp-admin/syslog-ng' is not a valid atom

Finished
====================
# emaint --fix world
Attempting to fix world
Finished
========================

Thursday, May 24, 2007

Chroot: Gentoo installation steps

mount /dev/hda8 /mnt/gentoo
mount /dev/hda7 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
/usr/sbin/chroot /mnt/gentoo /bin/bash

source /etc/profile && env-update
export PS1="(chroot) $PS1"


###################################

rc-update add net.eth0 default

passwd

useradd -m -G users acardh
# passwd acardh

nano -w /etc/rc.conf

emerge syslog-ng
# rc-update add syslog-ng default
logrotate

emerge vixie-cron
# rc-update add vixie-cron default

emerge dhcpcd

emerge grub
vi /boot/grub/grub.conf
grub
grub> root (hd0,6) (Specify where your /boot partition resides)
grub> setup (hd0,6) (Install GRUB in the MBR)
grub> quit (Exit the GRUB shell)

emerge firefox
emerge aspell



# exit
cdimage ~# cd
cdimage ~# umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
cdimage ~# reboot





# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,10)
# kernel /vmlinuz-version ro root=/dev/hda12
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=15
splashimage=(hd0,10)/grub/splash.xpm.gz
#hiddenmenu
title Fedora Core (2.6.18-1.2257.fc5)
root (hd0,10)
kernel /vmlinuz-2.6.18-1.2257.fc5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-1.2257.fc5.img

title=Gentoo Linux 2.6.18-r6 (genkernel)
root (hd0,6)
kernel /boot/kernel-genkernel-x86-2.6.18-gentoo-r6 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda8 udev
initrd /boot/initramfs-genkernel-x86-2.6.18-gentoo-r6

#title Fedora Core (2.6.18-1.2239.fc5)
# root (hd0,10)
# kernel /vmlinuz-2.6.18-1.2239.fc5 ro root=LABEL=/ rhgb quiet
# initrd /initrd-2.6.18-1.2239.fc5.img
~

Gentoo Linux on IBM ThinkPad T60

http://gentoo-wiki.com/HARDWARE_IBM_ThinkPad_T60

http://thomasgersdorf.com/linux/index.php/Gentoo_Linux_on_IBM_ThinkPad_T60

http://www.gtishrine.com/t60.php

http://www.thinkwiki.org/wiki/Category:T60

http://buzzy.tesuji.org/thinkpad_t60p.html

Wednesday, May 23, 2007

Two packages mutually blocking each other in Gentoo

I try to update and recive error:
>=x11-proto/xproto-7.0.6 (is blocking x11-libs/libX11-1.0.1-r1)

i did uninstalled xproto but my computer had xproto-7.0.5 not xproto-7.0.6

# emerge --search xproto
* x11-proto/xproto
Latest version available: 7.0.7
Latest version installed: [ Not Installed ]
Size of files: 130 kB
Homepage: http://xorg.freedesktop.org/
Description: X.Org xproto protocol headers
License: xproto


===========
The solution
emerge -C xproto && emerge -C libX11 && emerge xproto libX11
==========

Safe make.conf in Gentoo

http://gentoo-wiki.com/Safe_Cflags
x86 - (32bytes)
Intel Core Solo/Duo

vendor_id : GenuineIntel
cpu family : 6
model : 14
model name : Genuine Intel(R) CPU TXXXX @ XXXGHz

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

Monday, May 21, 2007

Hide a zip file in an image

Here's how to combine your .gif and .zip.

cat somefile.zip >> somefile.gif

It turns out that this works with .jpg files as well. Just

cat somefile.zip >>somefile.jpg

to retrieve the original somefile:

unzip somefile.jpg

I will leave it to the rest of you to find out what
other image formats work this way.

Sunday, May 20, 2007

WinAmp in Linux

First you have to have Wine installed in Linux.
============
4) Winamp Installs just fine, on first load it says your missing arial.ttf, download it and stick it in /home/$yourname/.wine/drive_c/windows/fonts and your good to go, loads up, I have yet to check any plugins, but I'm in the process of starting that.

============
Friends, I just discovered how to run winamp in Ubuntu. I'm amazed it runs!

1. Winamp was already installed in my windows directory (c:\windows\program files\winamp\winamp.exe)
2. I mounted (http://www.ubuntuguide.org/#windows) the windows partition in Linux
3. Browsed down to winamp installed in windows NTFS partition
4. Double clicked on winamp.exe
5. It runs, but can't play a file as yet. This is because winamp uses the direct sound system as default sound output. click "options-->preferences" from winamp menu, and change sound output to "wave out".
6. Now press L to load your favorite mp3, and press the play button!
7. Enjoy the music!
==========

http://ubuntuforums.org/archive/index.php/t-98190.html
http://www.overclock.net/linux-unix-mac/146317-short-list-things-work-linux-via.html

Thursday, May 17, 2007

IBM (Lenovo) ThinkPad Recovery CD

(Link to original webpage)
Most IBM (now Lenovo) ThinkPad laptops no longer come with recovery cds or even operating system installation cd-roms. Replacing the cds, on the expense of ThinkPad users, is a hidden service partition that contains all the recovery images and files, and provides interactive rescue and recovery predesktop workspace, which is an operating environment specifically designed for rescue and recovery operations independent of the Windows operating system.

The problems with the ThinkPad’s service partition are that it’s easily taking out some 4 to 5 GB of precious hard disk space. Beside, since it’s residing on the harddisk itself, when the harddisk is spoilt, the recovery partition will be gone too. If you change the hard drive, the Rescue and Recovery partition will not be available on the new harddisk too, so there is no way to restore the ThinkPad to the original factory state pre-load only just as when it was manufactured.

So it’s wise to create the ThinkPad product recovery cd. To get hold on the recovery cd, there are several ways:

1. Create Rescue Media or Product Recovery CD

Go to “All Programs > ThinkVantage > Create Rescue and Recovery Media. Then select your desirable type of rescue media. To create recovery CD, check the “Create a set of Product Recovery Discs now” and then click “OK” to start the creation process.

You will need about 7 cds or 1 cd and 1 dvd for the product recovery cd. And you also need to have CDRW or DVDRW drive. An external USB driver will do the job too as alternative.

2. Order Product Recovery CD from IBM

You can get a ThinkPad product recovery cd from IBM/Lenovo. However, you may not be able to do so if you’re out of warranty, and even if you’re in-warranty, you may need to pay for the cds.

To order, contact IBM/Lenovo support centre. You can find contact number of support centre here.
Get help or contribute tips or tricks at My Digital Life Forums

Sunday, April 29, 2007

Yum commands

[root@sempron acardh]# yum --disablerepo=macromedia update

Thursday, April 26, 2007

Download and install NVIDIA Drivers

First of all, if you tried using the script then you can find the NVIDIA installer package in /usr/share/doc/nvidia If the installer package is not there go to NVIDIA Download Page, and get the latest drivers for your computer.

Install the drivers

If you are in runlevel 5, go to runlevel 3 by typing the following comand as root in one of the consoles (which you can access by pressing ctrl-alt-f1 [f1 up to f6])

telinit 3

Now go to the directory containing the drivers.

cd /usr/share/doc/nvidia

or

cd /the/path/where/you/saved/the/drivers/from/nvidia/website

Now simply type the following and follow instructions

sh NVIDIA-Linux----.run -q

Monday, April 16, 2007

Tuesday, March 13, 2007

Remote X session from Linux to Linux

To have a remote X session from Linux machine A to Linux machine B connect to A using the command:
ssh -X 192.168.0.6 -l mylogname

Replace 192.168.0.6 for your IP or hostname.

Tuesday, February 20, 2007

Mounting ISO images

http://www.linuxquestions.org/questions/showthread.php?t=277643

Do this:
Code:
md /mnt/iso

Code:
mount -o loop -t iso9660 .iso /mnt/iso
Try this...

mount -t iso9660 -o ro,loop=/dev/loop0 /home/ste/cd.iso /mnt/iso

Tuesday, February 13, 2007

Combining multiple PDF files in one

http://www.debianadmin.com/combine-multiple-pdfs-into-one-file-in-ubuntu-linux.html
http://www.newsforge.com/article.pl?sid=04/06/09/1844259

Preparing Your system
sudo apt-get install gs pdftk
(Merge, merging, cancatenate, concatenating pdf files)

Now we will see one example how to combine pdf files let us assume we have 1.pdf,2.pdf,3.pdf files and now we need to cobmine this files using the following command:
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combinedpdf.pdf -dBATCH 1.pdf 2.pdf 3.pdf
Another different approach:
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf
In the above command after “-sOUTPUTFILE=” type whatever name you want for the merged file (don’t forget to append .pdf to the end of the file name). Rename “1.pdf 2.pdf 3.pdf” to whatever your file names are (separate your file names with a space).
After you run the above command, a new PDF file called combinedpdf.pdf will be created with your individual files merged according to the order you list.
The same can be done with PS files:
gs -sDEVICE=pswrite -sOutputFile=output.ps -dNOPAUSE -dBATCH file1.ps file2.ps file3.ps
If you want to know more options available for gs command check man page

Tags: , , , , , , ,

Merge PDF files with pdftk
Having some of my manuals/documentations downloaded in several separated pdf files, I wanted to merge them into a single file.

First, I installed pdftk

# apt-get install pdftk

In Ubuntu 18.04 the previous command won't work. Instead:

sudo snap install pdftk

Then, I merged the files into a single file

$ pdftk   file1.pdf    file2.pdf    file3.pdf   cat  output   file123.pdf

When the files to be merged is a lot, I edited the file list in a text editor (or, when I am in a good mood, using ls & awk & sed) then combine it with the script found here

$ cat stdin_pdf.sh
#!/bin/sh
# combine PDFs; pass filenames in on stdin;
# pass output to stdout
read input_filenames
pdftk $input_filenames cat output -

$ cat filelist|./stdin_pdf.sh>mergedfile.pdf

So far, I am satisfied with the result. (link)

Saturday, February 10, 2007

Switching between different keyboard mappings

http://www2.blogger.com/post-create.g?blogID=4592078922113874023
setxkbmap us_intl # to write Spanish stuff
setxkbmap us # to write English stuff and code
setxkbmap es # to write Spanish stuff and code

Sunday, February 04, 2007

Saturday, February 03, 2007

Lenovo T60 with fedora core 6

http://www.thinkwiki.org/wiki/Installing_Fedora_Core_6_on_a_ThinkPad_T60

Lenovo Thinkpad T60

http://statgen.ncsu.edu/~jdstarme/fc5_on_t60.txt

I am much indebted to all of the great information there is already on the
internet about how to get Fedora Core 5 (FC5) working on a ThinkPad T60.
In this document I attempt to cite the sources where I got various bits
of information, however, I may have missed a few. To those authors I offer
an apology and ask that you send me an email! (jdstarme_at_ncsu.edu)

Special thanks to Tom Davidson for sending me feedback and good suggestions
for revisions to this document.


System:

Lenovo Thinkpad T60

Intel Core Duo T2500 2.00 GHz
1 GB RAM
100 GB Hard Drive (SATA150)
ATI Mobility Radeon X1400 M54
VGA video out


0) Boot into windows and make sure everything is working the way. Make
the rescue CDs (there are 7 total - oh, and it is not obvious how to make
the back up CDs. However, if you search around enough, you'll figure it out.)


1) Download the latest System Rescue CD from

www.sysrescd.org

I ended up with: SystemRescueCD-x86-0.2.19

(I tried using the version I made long ago when I installed FC2, but the
graphical partitioning program, qtparted, would not recognize the new
SATA type hard-drive)

In order to burn the ISO, I had to download something called "Nero 7". After
fiddling around for a bit, I figured out how to use it to burn the ISO to
a CD.

Reboot with the new CD in the drive

at the prompt, type: run_qtparted

Select the main partition and re-size it to about 20GB then commit your change.
I was unable to create all of the sub-partitions I usually make for linux.
However, I was able to do that when I installed FC5.


2) Boot up with FC5 disk1 and press return to begin installing. The old
problem (from FC2 days) of having to specify the hard-drive geometry in order
to get the system to dual boot no longer exists, so you
don't have to worry about specifying anything on the command line.

NOTE: this destroys part of the ThinkVantage buttons functionality. You can
still use the ThinkVantage button to get into the bios, but you can no
longer use it to restore and recover the system (good thing you made those
backup CDs?) This really doesn't bother me that much since I only
intend to use windows once in a blue moon and the only thing I'm really
concerned about being able to fix without reformatting the whole drive is
the linux stuff and the FC5 distribution comes with a rescue mode...


I did my own partitioning:

/dev/sda
/dev/sda1 ntfs 19807 1 2525
/dev/sda3 /boot ext3 102 2526 2538
/dev/sda4 extended70473 2539 11522
/dev/sda5 / ext3 10001 2539 3813
/dev/sda6 /usr/local ext3 4997 3814 4450
/dev/sda7 swap 2000 4451 4705
/dev/sda8 /home ext3 53474 4706 11522
Free FS 6 11523 11523
/dev/sda2 vfat 5006 11523 12161


3) Reboot (note, I did not have the problem with the system hanging on the
initial boot that was mentioned on the think-wiki site
http://www.thinkwiki.org/wiki/Installing_Fedora_Core_5_on_a_ThinkPad_T60),

The monitor was not detected
(it is a 14.1" TFT display with 1400x1050 resolution)

Set the monitor to LCD Panel 1400x1050 (generic).

THINGS THAT WORKED OUT OF THE BOX

- SMP (symmetrical multiprocessing support for the core duo)
- Sound (just remember to turn up the volume so you can hear the sound!)
- USB
- Suspend (after an update to (at least) kernel version 2.6.17-1.2139_FC5.
This means that suspend will not work immediately after a fresh
install. However, once you run "yum update", everything should
work fine.)

A NOTE ON SUSPEND: sometimes the wireless daemon or the
network-manager daemon is dead when you bring the computer back to
life. To remedy, just select System->Administration->Services
and then stop and start whichever daemon died.


After rebooting and verifying that I could boot into Windows XP,
I booted back into Fedora and updated the installed packages:

shell# yum update

This took forever and a day over my painfully slow DSL provided by BellSouth.

Getting the the thinkpad buttons to display information on the monitor only
required:

a)
shell# yum install tpb

b)
and then a restart.


To get X programs (like xterm and xfig) to have white backgrounds...

edit the file: /etc/X11/Xresources

and then add the lines:

xterm*background: white
xterm*scrollBar: true

xfig*background: white
xfig*foreground: black

(be sure to end the file with a new line)

The changes will take effect after you log out and then log back in, or you
can cause them to take effect now with the command:

shell> xrdb /etx/X11/Xresources


To make X programs have readable fonts, I set the font for the xterm and
emacs to 7x14 (you can do this per program with the -fn 7x14 option)


3) Wireless

0: Get NetworkManger working: all you have to do for this is to start
the NetworkManger services. System->Administration->Services


1: Add the "ATrpms" repository for yum by adding the file:

atrpms.repo

to the directory: /etc/yum.repos.d/

and in this file I put the lines:

[atrpms]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/fc$releasever-$basearch/atrpms/stable
enabled=0

and then ran the commands:

shell# rpm --import http://ATrpms.net/RPM-GPG-KEY.atrpms

shell# yum --enablerepo=atrpm\* install ipw3945 ipw3945d
ipw3945-ucode ipw3945-kmdl-CURRENT_KERNEL_VERSION_FC5smp

where CURRENT_KERNEL_VRESION is the version of the kernel that you are running.
You can figure out the version you are running with the command:

shell> uname -a

and this will print out all kinds of information about your kernel. Your
kernel version should be something like 2.6.17-1.2174_FC5smp.



2: Get the wireless kernel modules working...

shell# /sbin/depmod -a (you only have to do this once, right after installing
the rpms)

shell# /sbin/modprobe ipw3945 (load the kernel module)
shell# /sbin/ipw3945d (start the wireless daemon)

and then the wireless networks appear in the NetworkManager applet.

However, on restart, the module is not automatically loaded. However, to
fix this, I took the "wireless" script from Jim Hall's page:
http://us.fdos.org/linux/laptops/tp-t60/

and removed the case where it checks for eth0, since I'm going to let
NetworkManager deal with wired vs. wireless connections. So here's
my /etc/init.d/wireless file:

#! /bin/bash
#
# wireless Bring up/down integrated wireless networking (ipw3945)
#
# chkconfig: 2345 90 10
# description: Activates/Deactivates eth1 wireless interface (ipw3945)
#
### BEGIN INIT INFO

# # ipw3945d --help
# usage: ipw3945d [--OPTION]
# options:
# --quiet Load silently (unless errors occur)
# --version Display version information
# --debug=value Specify debug level to print
# --dvals View possible debug values
# --foreground Do not fork to background
# --kill Kill any running ipw3945d instance and exit
# --help View this help message
# --isrunning Check if already running. Returns 0 if yes.


# See how we were called.
case "$1" in
start)
/sbin/ipw3945d --isrunning
if [ $? -eq 0 ] ; then
echo "ipw3945d already running"
exit 1
fi

modprobe ipw3945
/sbin/ipw3945d
#ifup eth1

echo "ipw3945d started .."
;;

stop)
/sbin/ipw3945d --isrunning
if [ $? -ne 0 ] ; then
echo "ipw3945d not running"
exit 1
fi

ifdown eth1
/sbin/ipw3945d --kill
rmmod ipw3945

echo "ipw3945d stopped .."
;;

restart)
$0 stop ; $0 start
;;
esac

Once you create this file, make sure you set the permissions on this
file so that everyone can execute it (i.e. chmod a+x) and then run the
chkconfig program:

shell# /sbin/chkconfig --add wireless

Since nine-times out of ten I'm going to be using a wireless network,
I selected: System->Administration->Network and edited eth0 so that it would
not attempt to activate on startup. NetworkManager does a fine job activating
eth0 if you plug in an ethernet cable.

NOTES: One thing that can mess up wireless is if you have added an entry for
eth1 in System->Administration->Network. If you have done this, just delete
the entry and if you have followed the previous steps, things should work.


4) Touchpad...

turn off tapping, actually tapping is pretty good on this machine (better
than on my old T42), but still, I find it annoying overall.

Back up the file: /etc/X11/xorg.conf
Edit the file: /etc/X11/xorg.conf
Add the line:

Option "SHMConfig" "on"

to the section for the "Synaptics" mouse. It should then look like....

Section "InputDevice"
Identifier "Synaptics"
Driver "synaptics"
Option "Device" "/dev/input/mice"
Option "Protocol" "auto-dev"
Option "Emulate3Buttons" "yes"
Option "SHMConfig" "on"
EndSection

Now reboot the computer...

You can test that your editing of the xorg.conf file worked with the command:

shell# synclient -l

You should see a listing of all of the parameters settings.

you can experiment with various settings by using the synclient program
on the command line. For example, to turn off tapping:

shell# synclient MaxTapTime=0

To make these changes permanent, add the commands to the Synaptics section
of the xorg.conf file. For example:

Section "InputDevice"
Identifier "Synaptics"
Driver "synaptics"
Option "Device" "/dev/input/mice"
Option "Protocol" "auto-dev"
Option "Emulate3Buttons" "yes"
Option "SHMConfig" "on"
Option "MaxTapTime" "0"
EndSection


I also turned off the "forward and reverse" thing that affected web browsing
by adding the line:

Option "BottomEdge" "5500"

to the same section in my xorg.conf file... So the final version looked
like this:

Section "InputDevice"
Identifier "Synaptics"
Driver "synaptics"
Option "Device" "/dev/input/mice"
Option "Protocol" "auto-dev"
Option "Emulate3Buttons" "yes"
Option "SHMConfig" "on"
Option "MaxTapTime" "0"
Option "BottomEdge" "5500"
EndSection


5) .bashrc

# .bashrc


# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions

alias cleanup="rm -f *~; ls"

alias emacs="emacs -fn 7x14"

alias rm="rm -i"
alias mv="mv -i"
alias cp="cp -i"

export EDITOR="emacs -nw"
export GRACE_EDITOR=emacs

export CVS_RSH=ssh


6) An mp3 player. I know they are not Free, as in speech, but I have to be
able to play them, otherwise I can't rehearse for gigs. Bands always send me
their stuff as mp3s...

add the "livna" repository for yum by adding the the file:

livna.repo

to the directory: /ety/yum.repos.d/

and in this file, put the lines:

[livna]
name=Livna for Fedora Core $releasever - $basearch - Base
baseurl=
http://rpm.livna.org/fedora/$releasever/$basearch/
http://livna.cat.pdx.edu/fedora/$releasever/$basearch/
http://wftp.tu-chemnitz.de/pub/linux/livna/fedora/$releasever/$basearch/
http://ftp-stud.fht-esslingen.de/pub/Mirrors/rpm.livna.org/fedora/$releasever/$basearch/
failovermethod=priority
#mirrorlist=http://rpm.livna.org/mirrorlist-5
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-livna


import the GPG key...

shell# rpm --import http://rpm.livna.org/RPM-LIVNA-GPG-KEY


and install xmms with mp3 support...

shell# yum --enablerepo=livna install xmms-mp3 xmms-faad2


7) A DVD player...

shell# yum --enablerepo=livna install xine libdvdcss

(However, until you can get hardware support for video, it's going to drop
a lot of frames - so see the tips below for "Graphics Card".)


8) Graphics Card (everything (video playback, OpenGL rendering, etc)
works as of kernel 2.6.17-1.2174 and the fglrx driver version 8.28.8)

shell# yum --enablerepo=livna install kmod-fglrx-smp

shell# /usr/sbin/ati-fglrx-config-display enable

restarted.

and then selected "display" form the administration menu, and then configured
the hardware graphics card to "fglrx". I then restarted X.
This seems to have done the trick!

You can double check that things are going well by looking at:
System->Administration->ATI-fglrx



9) Suspend (If you are running a kernel older than 2.6.17-1.2139_FC5)

First, make sure the kernel module for the wireless card exists (if a new
kernel just came out, you may have to wait a few days).

a: get a newer kernel (version 2.6.17-1.2139_FC5 or higher)

shell# yum update

b: plug the computer into a wired network and reboot into the new kernel.

c: remove the old wireless stuff...

shell# yum remove ipw3945 ipw3945d ipw3945-ucode ipw3945-kmdl-OLD_KERNEL_VERSION_FC5smp
Removing : ipw3945-kmdl-2.6.16-1.2133_F ######################### [1/5]
Removing : ipw3945-firmware ######################### [2/5]
Removing : ipw3945d ######################### [3/5]
Removing : ipw3945 ######################### [4/5]
Removing : ipw3945-ucode ######################### [5/5]


d: install the newer wireless stuff...

shell# yum --enablerepo=atrpm\* install ipw3945 ipw3945d ipw3945-ucode ipw3945-kmdl-CURRENT_KERNEL_VERSION_FC5smp
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
ipw3945 i386 1.0.10-10.rhfc5.at atrpms 35 k
ipw3945-kmdl-2.6.17-1.2139_FC5smp i686 1.0.10-10.rhfc5.at atrpms 89 k
ipw3945-ucode noarch 1.13-1.at atrpms 65 k
ipw3945d i386 1.7.19-2.at atrpms 35 k
Installing for dependencies:
ieee80211-kmdl-2.6.17-1.2139_FC5smp i686 1.1.14-11.rhfc5.at atrpms 34 k

Transaction Summary
=============================================================================

e: get the wireless daemon running again

shell# /sbin/depmod -a
shell# /sbin/modprobe ipw3945 (load the kernel module)
shell# /sbin/ipw3945d (start the wireless daemon)

And reboot. To suspend the computer, select suspend from the System
menu. Do not select "Shut Down" and then click on the "suspend" button. For
some reason, that doesn't work.

I then modified my Power Management Preferences so that the laptop would
suspend when the lid is closed. Also, when running on battery, I set it so
that it would suspend the computer if is inactive for 30 minutes.






##################################################################
#### ######
#### HOW TO UPDATE THE KERNEL ONCE YOU HAVE EVERYTHING SET ######
#### ######
##################################################################


a: First make sure everything is updated:

shell# yum update --exclude kernel-smp

b: Make sure there are wireless RPMs for new version of the kernel on the
ATRpms site:

http://atrpms.net/dist/fc5/ipw3945/

c: Install the new kernel:

shell# yum update

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
kernel-smp i686 2.6.17-1.2157_FC5 updates 15 M
Removing:
kernel-smp i686 2.6.16-1.2133_FC5 installed 39 M
Removing for dependencies:
ieee80211-kmdl-2.6.16-1.2133_FC5smp i686 1.1.13-10.rhfc5.at installed 84 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 2 Package(s)
Total download size: 15 M
Is this ok [y/N]: y
Is this ok [y/N]: y
Downloading Packages:
(1/1): kernel-smp-2.6.17- 100% |=========================| 15 MB 04:32
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Removing : kernel-smp ######################### [1/3]
Installing: kernel-smp ######################### [2/3]
Removing : ieee80211-kmdl-2.6.16-1.2133 ######################### [3/3]


d: plug the computer into a wired network and reboot into the new kernel.

c: remove the old wireless stuff... (replace "OLD_KERNEL_VERSION" with the
actual version number.)

shell# yum remove ipw3945 ipw3945d ipw3945-ucode ipw3945-kmdl-OLD_KERNEL_VERSION_FC5smp
Removing : ipw3945-kmdl-2.6.16-1.2133_F ######################### [1/5]
Removing : ipw3945-firmware ######################### [2/5]
Removing : ipw3945d ######################### [3/5]
Removing : ipw3945 ######################### [4/5]
Removing : ipw3945-ucode ######################### [5/5]


d: install the newer wireless stuff...

shell# yum --enablerepo=atrpm\* install ipw3945 ipw3945d ipw3945-ucode ipw3945-kmdl-CURRENT_KERNEL_VERSION_FC5smp


e: Get the wireless daemon running again

shell# /sbin/depmod -a
shell# /sbin/modprobe ipw3945 (load the kernel module)
shell# /sbin/ipw3945d (start the wireless daemon)

(at this point you should be able to disconnect the ethernet cable from the
computer and the wireless should kick in automatically)

g: update the ati driver (if you can)

shell# yum --enablerepo=livna update kmod-fglrx-smp

shell# /usr/sbin/ati-fglrx-config-display enable

g: reboot!

Everything should be working....