Terms and abbreviations
How to get things done on Mandrake with KDE
How to change the window behaviour of KDE
How to make a backup (ghost, sort of) of your other OS
DVD playback setup with xine
How to listen to audio cd's with xmms
How to watch tv with mplayer
How to record tv with mencoder
How to get to the graphical environment if your system boots to the console only
How to get more out of the graphical environment XFree86
How to start and use more X-sessions
How to prepare a new harddisk for use
How to change the defaults of Konqueror
How to reset the password of a normal user
How to reset the root password
Howtos about the various (Mandrake) linux things
Terms and abbreviations:
cli : command line interface, 'dos like prompt'
mcc: mandrake control center (icon on desktop, or via the startmenu, configuration, Mandrake control center)
kB, KB, K: kilobyte
kde, KDE: the K Desktop Environment
kdecc: kde control center (start menu, control center)
System tray: the bottom bar that normally has the clock, etcetc. Taskbar in MSwin speak.
Start menu, start button: the 'gears' button with the K on it, normally on the left side on the system tray / taskbar. The menu appears if you left click on that button.
OS: operating system.
OSS: open source software.
commands to type have this colour and font
keystrokes/presses have this colour and font
lmb = left mouse button, mmb = middle mouse button, rmb = right mouse button
Howto use Mandrake linux and KDE, which programs to use for what
Here is a small selection of programs that I like to use:
mozilla, opera (you'll have to download this one, get the static version to avoid any problems with missing libs),
evolution (looks like outlook, I've been told, never seen outlook),
KMail, mozilla mail, opera mail
kmix (you can set 'enable system tray volume control' to have a small applet in the system tray),
mplayer, xine (for me, these two complement each other)
k3b, gcombust (data, audio, iso's),
gcdmaster (needs cdrdao installed, you have to do that explicitly) to prepare wav-files and make audio cd's without any gap between the songs.
For more replacement programs, check this link: http://linuxshop.ru/linuxbegin/win-lin-soft-en/, it has a nice table where you can find which linux program can replace which windows program.
Howto optimise KDE's window behaviour
The following is the ideal behaviour for me; it is also one that I cannot get on MSwin, and only partially on HP-UX/CDE (or VUE). Which I find lacking on the part of MS and the makers of CDE/VUE.
BTW I couldn't get gnome2 to do things this way either, which is a shame. But then, I didn't really try. (Had gnome2 on redhat for a while, decided for other reasons to go back to Mdk.)
I want to be able to select things in a window that is not on the foreground, paste them into a window that is not in the foreground. I want the active window not to switch to foreground when it becomes active.
KDEcc, look'n'feel, window behaviour (alternatively, you can right click on the left top icon on any window, and select 'configure').
There are 4 tabs, the first is marked 'focus' -- select: focus follows mouse, don't select 'auto raise'. Next tab: 'actions' -- select any function to your liking, I put all 'inactive inner window' options to 'activate and pass click'. Don't forget to click apply (bottom of the window) to accept the changes.
Also, here you can define how you can lower/raise/move or resize a window; I made the alt-key my modifier, and alt+left button: move, alt+middle: toggle raise lower, alt+right: resize.
Another nice feature is 'shade' on double clicking the title bar. In the advanced tab, you can select 'enable hoover' and a delay for that. Then you can shade windows, and if you put the mouse pointer on the title bar (which is then the only visible part), the window opens after the selected delay.
This is a nice way to effectively user your desktop real estate.
How to use linux to make a backup of your windows system partition, instead of a ghost image.
If you have enough space, just copy all the files. This will not be very space efficient, but the fastest, since the files are not compressed.
You can do this with a filebrowser, or on the command line:
cp /mnt/win_c (or whereever your windows c partition is mounted) /path/to/where/you/want/to/have/your/backup (make sure there is enough space on that partition).
To know if you have enough space, just do
df -h | grep /win
and the system will tell you how large the total size of all files on your windows-drives is.
Then you can do the following to find out if you have enough space:
If you want to create a single, compressed file you can use an archive program (from the menu) that comes with Mandrake.
To restore the backup copies, just remove all from the windows c-drive/partition and copy the files back, or use the archive program to unpack the files there. Important: if you want to preserve the dates of all the files, you must use the archive method, the cp command will not preserve the date and time properties.
(On other filesystems, like the linux ext2 or 3 it can do this by using: cp -p [file] [newfile] )
How to use xine for dvd playback
just some hints, most is quite straightforward.
Make sure it actually finds the dvd drive, normally Mandrake should have done this for you.
ls -l /dev/dvd
if that gives something like:
lr-xr-xr-x 1 root root 30 Dec 1 13:10 /dev/dvd -> ide/host0/bus1/target1/lun0/cd
all is well.
If it gives
ls: /dev/dvd: No such file or directory
you may want to log in as root, (command:
su followed by the root password) and issue the following command:
ln -s /dev/hdd /dev/dvd
if your dvd is a slave device on the second ide controller.
Change hdd into hdb if it is a slave on your primary ide controller, and to hdc if it is a master device on your secondary ide controller.
If you don't know where your dvd is connected, don't go for your screwdriver just yet.
Still as root (superuser/admin), do:
cat /var/log/dmesg | grep -A 4 hda
This should show (amongst other things) the position of your drives: (my results as an example)
hda: MAXTOR 6L060J3, ATA DISK drive
hdc: PCRW1208, ATAPI CD/DVD-ROM drive
hdd: Pioneer DVD-ROM ATAPIModel DVD-105S 013, ATAPI CD/DVD-ROM drive
(Btw, if you have one harddisk, a cd-burner and a dvd-rom, this configuration is to be adviced)
In case of problems, start xine from the command line, so you can see what it says.
Make sure you have installed the
libdvdcss2, xine-ui, xine-dvdnav packages.
Now when the xine gui shows up, pop a dvd in the dvd-rom drive and click the dvd button, the dvd-drive will spin, xine will be non-responsive for a couple of seconds (if you move the mouse pointer over the play/stop/pause controls, they won't light up). Then press the arrow/play button. This should get you started.
Now some more hints: you can control the language/audio tracks during playback, by clicking on the small up or down arrow in front of the word 'aud' (audio) on the gui.
Likewise for 'sub' the subtitles. (Some dvd's I have come across are only in German, or in English with German subtitles; the subtitles cannot be switched off, claims the box. Well, maybe in some other OS, but in linux you just select the (audio) language as the one without the subtitles, and then switch the audio during playback. Voila.)
Pressing 'i' during playback turns on (or off) the deinterlacing; you can select the de-interlace method in the configuration menus. (The tool-icon, left bottom of the gui, next to the off-button)
Also in that configuration menu you will find the settings for many interesting things, like the number of speakers you have etcetc.
How to watch tv with mplayer
First: why would you watch tv with mplayer instead of Xawtv? Well, for me Xawtv doesn't scale to the full screen when I select: full screen. Zapping (another tv app) does it better, but still, the tv quality is not too nice. In comes mplayer, which allows to do on-the-fly de-interlacing and 3D denoising (meaning: it reduces noise in both spacial directions and on the temporal axis). The command that works best for me is:
mplayer -tv on:driver=v4l:device=/dev/v4l/video1: input=0:channel=27:width=768:height=576:fps=25 -vop lavcdeint,denoise3d=4:3:6
Be sure to put all that on one line (note that I have inserted extra spaces to avoid the lines getting too long; after none of the ":" should there be a space)! Oh, in this case, the tv-tuner is set to channel 27; for watching the signal on the composite video input of the tv-card (video recorder for instance), use:
mplayer -tv on:driver=v4l:device=/dev/v4l/video1:input=1:width=768:height=576:fps=25 -vop lavcdeint,denoise3d=4:3:6
Also, to have audio you have to make sure the mixer control for the input channel of your audio card that you connected the tv-card-audio output with, is set to 70% of maximum volume or so.
How to record tv with mencoder
This was quite tough, since I couldn't manage to get the audio as well. After a lot of messing around I found that selecting the audio input for recording in kmix and alsamixergui was not good enough (beats me why), but aumix does the job. It even does the job on the command line (but you are free to use the GUI and play with the buttons and sliders), so you can just do:
aumix -l R -l 75
Which sets the record channel to the line input of the audio card, and the record volume to 75. Then you should be able to record, which I do with:
mencoder -tv on:driver=v4l:device=/dev/v4l/video1: channel=27:width=768:h eight=576: fps=25 -vop lavcdeint,denoise3d=4:3:6 -oac mp3lame -lameopts abr=:preset=128 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1500 -info name=test:artist=channel-27: genre=trash:subject=snippet:copyright=aRTee: srcform=teevee:comment='just testing' -frames 500 -o videocap.avi
man mencoder for the right syntax and options (note that I have inserted extra spaces to avoid the lines getting too long; after none of the ":" should there be a space); the -frames 500 equals 20 seconds (25 frames per second) which I just put there for testing. With this bitrate you get 1 hour of video into 770MB or so. Play with the settings to get the right balance; the command I use is just here as an example and startingpoint. Also, this pushes my system to 92 - 98% load, quite high for an Athlon 2400+ (2GHz) CPU....
How to get to the graphical environment if your system boots to the console only
The easy way: just type
If your setup is not okay,
xf86config is most likely the command that you want to try out. To install the NVidia drivers (if you have an NVidia graphics card of course), follow the instructions on the NVidia website; try
lynx www.nvidia.com to browse the web, even from the command line.
Howto get more out of the graphical environment XFree86
-You can switch the resolution of the display by doing: ctrl-alt-+ (plus) or ctrl-alt-- (minus)
-You can kill the x-server (= graphical environment) by doing
Don't do this unless it was really hanging/not responding at all. If just one program is hanging, do a
ctrl-alt-esc to change the mouse pointer into a skull, and click in the hanging window to kill it. Alternatively you can just kill the process through the cli, which is definitely the preferred method; restrict your use of the
ctrl-alt-esc windowkiller to windows that are not responding anymore, after the underlying process is already killed.
/etc/X11/XF86Config-4 contains the settings for the x-server. If your display refreshrate is lower than you know is possible (viz, in windows it is higher or so) at the resolution you are using, you can for instance edit that file: put a higher minimum horizontal refreshrate, and restart the x-server (logout, then on the login screen select the option to restart the x-server) or test the setting by making a test XF86 config file in the same directory, and test it by following the indications in the howto about multiple x-servers. The
Another neat thing that you can do with XFree is, when you have a network. You can actually login to another computer running linux (or X, viz on BSD or so) and run programs, of
which you see (and control) the graphical window/gui on your desktop. For instance, if your pc doesn't have a cd-burner, but another one does, but it is being used by someone else, just put in a blank cd, log in remotely via ssh and start your program to burn the cd (of course the data must be reachable from that pc with the cd-writer, and you need to have the necessary rights, to log on and to use the burner).
Howto create multiple x-servers
First: why this can be useful. Well, before that: what are 'multiple x-servers'?
Unllike MSwindows, the graphical part is only built on top of the core of the system (which is the linux kernel and then some). This is the reason that you can actually have various
graphical environments, with different window managers and desktop managers.
So in some other popular OSes you have the core of the system (the underlying code, i.e. windows), with on top of that the graphical part (also windows), with on top of that (or in the same thing, whatever) the window manager and the desktopmanager.
In linux you have: the core system/kernel (linux), on top of that the graphical environment (also called X-server, generally XFree, but there are commercial alternatives), on top of that the window manager (twm, mwm, icewm, metacity, sawfish or whatever), on top of that (if so desired; on older systems you may want to do without) the desktopmanager (KDE or Gnome for instance).
So the graphical part, aka x-server, is what this is about? Why would you want to have 2 or more of those?
For instance, if you and several other people want to use the same pc, and one is already logged on, and doesn't want to log off. (Viz. when you have a permanent internet connection
(cable, adsl) and you have some download running, all your programs up, or you don't want to log off since you are downloading the iso´s for the next version of Mandrake linux. Or you want to play a game (like starcraft) that has a lower resolution.
Use ctrl-alt-F1 (you can actually use F1 through F6 for a console, and later F7 through F12 for a graphical environment) to switch to the console.
If you want to have a different x-session for another user, log on as that user. Type:
X :1 &
(if you want to try out an XFree86 configuration file, try "
X -xf86config /path/to/test/config :1 &"; the number '1' is the number of that graphical environment, you need to use it later; you can use another number if that makes you happy; I think it might be limited to 255 or so ...)
Use ctrl-alt-F1 to get back to the console again, and type:
And you are ready to launch a windowmanager. For kde, use the command 'startkde' for gnome 'gnome-session'. For a lighter window/desktopmanager, try 'icewm' or 'twm'.
And put a '&' after the command if you want to be able to still use the cli. Use ctrl-alt-F7 to switch to the original graphical environment, ctrl-alt-F8 to switch to the new one.
Howto home networking
- Share your internet connection: if you have several pc's, and just one internet connection (telephone modem - use the same time, to save costs and time that you're not available on the phone, cable and adsl - often you cannot connect more than one pc to the modem).
This implies you have 2 network cards in the machine that does the sharing, and that you have setup the network cards in the appropriate way: the card connected to the modem to be
DHCP and the other one with an address in the private home domain address range:
192.168.x.y (where y should not be 0 or 255, x and y between 0 and 255). For instance, use
192.168.0.1 for the server,
192.168.0.2 for the first other pc (linux or windows) etc.
BTW just use the mcc -> network part to set this up. In the windows or linux pc's, set the internet gateway and dns servers to
192.168.0.1 (very annoying, Win98se has to reboot each time you change any setting in the network dialog... not nice for troubleshooting. First make sure this works for linux, then adapt your windows machines with the same settings..) Use
ping 192.168.0.1 to see if your linux server can be seen by the other pc's. Alternatively, you can ping from the server to the other machines.
Note that with a high security level, the linux pc will not respond to a ping. (This also happens when you share your connection)
- Now to share the internet connection:
Just start the Mandrake control center, select network/internet on the left, and then connection sharing. Follow the wizard. Done.
- Share your files: mandrake control center, mount points, partition sharing. In an all linux environment, just use nfs. If you also want to be able to read your partitions/shared directories from windows pc's use samba. You can also use the program linuxconf for this.
- Likewise you can configure the nfs or samba shares from other machines in the mount points menu. Again, you can also use linuxconf.
- With other pc's running windows or linux, you can remote control them with VNC, which is included in Mandrake linux.
On linux (contrary to windows) the VNC session is actually not what is running on the screen; a different x-session is started, which can have a different resolution and colour depth.
Start it by typing (as a user, not as root!):
vncserver :1 (remember the number!)
If you haven't set a password, it will tell you to do so first (vncpasswd).
After that, you can connect to it from another (or the same, for testing) machine by typing:
vncviewer or by K-menu - Networking - Remote Access - TightVNC
Now type the address of the server, followed by a colon (:), followed by the number that you started the vncserver with:
Then type your vnc password in the next appearing box.
If your server is actually not running a graphical environment (my server doesn't even have a monitor attached to it), it can still run a vncserver. If the graphics of the server don't allow anything more than 8 bit at 1024x768, you can still have more via your vncserver; I start mine with:
vncserver :3 -geometry 1280x1024 -depth 16
so I have some more screen real estate, and a higher colour depth. (This is not possible with windows.) This does somewhat slow down the whole thing, but in my case the connection takes about 20KB/s, which is not a lot on a 100Mbit/s network.
The nice thing with the vncserver is that you can shut down your client pc, connect again later etcetc. Viz. if your server is downloading a large file, you can shutdown your pc and keep the server running. Idem for p2p programs.
- Logging on with ssh and starting an application locally that runs on the server you logged onto. (the application you start can also be vnc, so that you can subsequently do everything in there) From the cli, do:
give the username (if different from the one proposed) and password. You should now be on that other system, where you can give commands like:
or so (which is what I used to do to start the vncserver after the server has been rebooted, now I just make sure the vncserver is started when the server is booted)
BTW "telnet" would/could give similar functionality, but since it is one gaping security hole, it is adviced to never use it, and even never to install it.
Howto add a new harddisk
If you get a new harddisk, normally (supposing you're a windows user), you'd have to initialise it with a bootable floppy that came with it, with some tools from the manufacturer. If you didn't get this floppy, you'll have to download it from the manufacturers website etcetc.
Not so with Mandrake (or another linux distro) - just put the disk in the computer, check in the bios that it's correctly detected, and (re)boot the machine. Now, goto mcc, hardware, hardware list, select the new harddisk, and click 'run config tool'.
In diskdrake (the config tool), you can select the empty space, create partitions, and indicate mount points. With a bit of luck, you won't even have to reboot before using them; just format after partitioning the drive (ext3 partitions for those that are to be used under linux, fat32 for those that will be used/have to be accessed from under windows), and mount the partitions.
How to listen to audio cd's with xmms
There are other programs you could use, for instance the cd-player you get when you do: Kmenu-multimedia-sound-KsCD. But xmms has some very nice plugins (synaesthesia!!), and why not get more out of your 500MHz+ system?
To listen to an mp3 file (or other file on the harddisk) you can just browse to it. Music cd's have to be approached in a different way, since they are not cd-roms and comply to another standard (unless you have one of those new copy protected 'almost-audio cd's -- just avoid those like the plague.
Anyway, to play a music cd in xmms, just do: open URL, and put /dev/cdrom (or /dev/cdrom0 or 1 or whatever number your cdrom is in the /dev dir).
To find out, you can do:
ls -l /dev/cdrom*
(you can also use the command
ll instead of
ls -l on many systems)
which in my system results in:
lr-xr-xr-x 1 root root 13 Jan 29 19:43 /dev/cdrom -> cdroms/cdrom0
lr-xr-xr-x 1 root root 13 Jan 29 19:43 /dev/cdrom0 -> cdroms/cdrom0
lr-xr-xr-x 1 root root 13 Jan 29 19:51 /dev/cdrom1 -> cdroms/cdrom1
lr-xr-xr-x 1 root root 33 Jan 1 1970 cdrom0 -> ../ide/host0/bus1/target1/lun0/cd
lr-xr-xr-x 1 root root 34 Jan 1 1970 cdrom1 -> ../scsi/host0/bus0/target2/lun0/cd
From which you may conclude that my cdrom0 is the slave device on my second ide controller (my normal dvd-rom) and the cdrom 1 is my writer, which is tied into the system via scsi emulation.
Prefer detailed list view? Click on the icon for list view. Want to have the same settings next time? Set it up as you want it then go to Window -> save profile. Here you can also select if you want the window to be the same size.
Konqueror will also let you have more than one pane with the files open, so you can comfortably copy and paste, not unlike in the good old Windows Commander.
How to reset a user password
In case any of the normal user account passwords is forgotten, there is a very easy way to correct that little problem:
[enter the root password]
[enter the new password for that user]
Here the system may tell you that the password was BAD because it's too easy, too short or whatever. It's up to you to ignore that.
[enter the new password again for that user]
Done. Naturally, you can just use the tool
How to reset the root password
Here's the "new" method to change your root password without too much hassle. I found out about this quite some time ago, but forgot I had this on my site, so I didn't update this page.
Just boot your pc, and when the bootscreen gives you the choice of which OS you want to boot, you hit
[esc] and type:
When you get the prompt ( # ) you can just give the command
after which you will be asked to enter your new password, twice (the second time is to make sure you didn't make a typo).
If you've lost the root password, make sure your pc is no longer connected to any network. You are going to have to boot with the first cd, when the first screen comes up, hit F1, then type
rescue and let the machine boot to rescue mode. It will propose a number of things, just select to
mount the existing partitions and then go to the
shell / console. Then do the following:
And edit the following files with any text editor (I'm using
vi in this example -- check the howto on
Then change the first line, that looks like:
(With vi you just use the cursor keys to move the cursor on top of the x that has to be deleted, then hit the key x, which deletes any character under the cursor)
Save and exit the file by typing
[esc] :wq [enter]
and make the first line (that starts with
root) look like this:
(one colon, a '*' and four colons at the end). Again save and exit the file by typing
[esc] :wq [enter]
Reboot and log on as a normal user, then
su to become root, and use the command
passwd to set a password. Don't connect your machine to the internet before putting in a new, safe root password.