Jump to content


Tips for Linux Explorers


  • This topic is locked This topic is locked
375 replies to this topic

#301 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 26 April 2005 - 01:49 PM

DIRDIFF SCRIPT( Diff the content of 2 directories )In the previous Tip we combined the "find' command with the "diff" command to find the difference in the files located in 2 almost similar directories. It did involve a bit of work but we got the result we were after. Now imagine if there was a script that could do all the work for you ? Here is the "dirdiff" script that Ragnar sent me a while back. It compares the contents of two directories ( with the -r option also recursively ) An example of usage is:
$ dirdiff -r -q  /home/bruno/test-1  /home/bruno/test-2
The results will look similar like this:

Quote

$ dirdiff -r -q  /home/bruno/test-1  /home/bruno/test-2FILE: colors.txt6c6< # indigo---> # indigo-blue10d10< # sienna12a12> # darkblue15c15< # tomato---> # tomato-red
It searches the directory, finds the file that is different and shows us where the differences are in that file  . . . . . really clever and it saves us the trouble of giving  all the commands we had to give in the previous Tip.Next to the -r and -q options I gave in the example above there are also:

Quote

   -b        ignore trailing blanks   -B        include comparison of binary files   -c        ignore trailing carriage returns   -e file   exclude file from comparison   -E dir    exclude subdirectory from comparison   -l        list filenames only   -q        quiet mode (only list filename if there are differences)   -r        recursive mode (descend all subdirectories)   -L        show contents of files that only exist in leftdir   -R        show contents of files that only exist in rightdir   -T        ignore files that are text in one directory   -X        ignore files that only exist in one directory
Okay, so here is the script, paste in a text-editor, call it "dirdiff" make it executable with "chmod 755" and move it to /usr/local/bin
#!/bin/bash# dirdiff  compares the contents of two directories# made by Ragnar Paulson 2004SCRIPT=`basename "$0"`FILELIST=/tmp/$SCRIPT.list$$DIFFS=/tmp/$SCRIPT.diffs$$BADUSAGE="Type \"$SCRIPT -h\" for command usage."EXCLUDE_LIST=EXCLUDE_DIRLIST=BINARY=falseIGNORECR=falseIGNOREEXIST=falseLISTONLY=falseQUIET=falseRECURSIVE=falseSHOWLEFT=falseSHOWRIGHT=falseIGNORETEXT=falseDIFFOPTS=CMPOPTS=OPTIND=1while getopts bBce:E:hlqrLRTX switch; do    case "$switch" in    b)	DIFFOPTS="$DIFFOPTS -b";;    B)	BINARY=true;;    c)	IGNORECR=true;;    e)	EXCLUDE_LIST="$EXCLUDE_LIST $OPTARG";;    E)        EXCLUDE_DIRLIST="$EXCLUDE_DIRLIST $OPTARG"     ;;    h)	echo "$SCRIPT -- Compare files in two directories."	echo "Usage: $SCRIPT [options] leftdir rightdir"	echo "Options:"	echo "   -b        ignore trailing blanks"	echo "   -B        include comparison of binary files"	echo "   -c        ignore trailing carriage returns"	echo "   -e file   exclude file from comparison"	echo "   -E dir    exclude subdirectory from comparison"	echo "   -l        list filenames only"	echo "   -q        quiet mode (only list filename if there are differences)"	echo "   -r        recursive mode (descend all subdirectories)"	echo "   -L        show contents of files that only exist in leftdir"	echo "   -R        show contents of files that only exist in rightdir"	echo "   -T        ignore files that are text in one directory"	echo "   -X        ignore files that only exist in one directory"	exit 0;;    l)	LISTONLY=true	QUIET=true;;    q)	QUIET=true;;    r)	RECURSIVE=true;;    L)	SHOWLEFT=true;;    R)	SHOWRIGHT=true;;    T)	IGNORETEXT=true;;    X)	IGNOREEXIST=true;;    \?)	echo "$BADUSAGE" >&2	exit 1;;    esacdoneshift `expr $OPTIND - 1`if [ $# -ne 2 ]; then    echo "$BADUSAGE" >&2    exit 1elif [ ! -d "$1" ]; then    echo "Invalid directory: $1" >&2    echo "$BADUSAGE" >&2    exit 1elif [ ! -d "$2" ]; then    echo "Invalid directory: $2" >&2    echo "$BADUSAGE" >&2    exit 1ficdir=`pwd`	# current directorycd "$2"rdir=`pwd`	# right directorycd "$cdir"cd "$1"ldir=`pwd`	# left directoryif [ "$ldir" = "$rdir" ]; then    exit 0fiNODIRS=`(for name in $EXCLUDE_DIRLIST; do    find "$ldir" -name "$name" -type d -print | sed "s;^$ldir/;;"    find "$rdir" -name "$name" -type d -print | sed "s;^$rdir/;;"done) | sort | uniq`if $RECURSIVE; then    (	find "$ldir" -type f -print | sed "s;^$ldir/;;"	find "$rdir" -type f -print | sed "s;^$rdir/;;"    ) | sort | uniq >"$FILELIST"else    (	'ls' -a1 "$ldir" | while read f; do     if [ ! -d "$ldir/$f" ]; then         echo "$f"     fi	done	'ls' -a1 "$rdir" | while read f; do     if [ ! -d "$rdir/$f" ]; then         echo "$f"     fi	done    ) | sort | uniq >"$FILELIST"fiwhile read f; do    if [ -n "$EXCLUDE_LIST" ]; then	doexclude=false	for exclude in $EXCLUDE_LIST; do     if [ "`basename \"$f\"`" = "$exclude" ]; then  doexclude=true  break     fi	done	if $doexclude; then     continue	fi    fi    if [ -n "$NODIRS" ]; then        doexclude=false        for dir in $NODIRS; do            quit=`expr "$f" : "$dir"`            if [ $quit -gt 0 ]; then                doexclude=true                break            fi        done        if $doexclude; then     continue        fi    fi    lfile="$ldir/$f"    rfile="$rdir/$f"    if [ -f "$lfile" ]; then	if [ -f "$rfile" ]; then     if file "$lfile" | grep "text\$" >/dev/null; then  if file "$rfile" | grep "text\$" >/dev/null; then      if $IGNORECR; then 	 lfile=/tmp/$SCRIPT.lfile$$ 	 sed "s;*$;;" "$ldir/$f" >"$lfile" 	 rfile=/tmp/$SCRIPT.rfile$$ 	 sed "s;*$;;" "$rdir/$f" >"$rfile"      fi      if $QUIET; then 	 diff $DIFFOPTS "$lfile" "$rfile" >"$DIFFS" 	 if [ -s "$DIFFS" ]; then       if $LISTONLY; then    echo "$f"       else    echo "FILE: $f"    cat "$DIFFS"       fi 	 fi      else 	 echo "FILE: $f" 	 diff $DIFFOPTS "$lfile" "$rfile"      fi      if $IGNORECR; then 	 rm -f "$lfile" "$rfile"      fi  else      if $IGNORETEXT; then 	 continue      elif $LISTONLY; then 	 echo "$f"      else 	 echo "FILE: $f is not a text file in $rdir"      fi  fi     elif file "$rfile" | grep "text\$" >/dev/null; then  if $IGNORETEXT; then      continue  elif $LISTONLY; then      echo "$f"  else      echo "FILE: $f is not a text file in $ldir"  fi     elif $BINARY; then  if $QUIET; then      cmp $CMPOPTS "$lfile" "$rfile" >"$DIFFS"      if [ -s "$DIFFS" ]; then 	 if $LISTONLY; then       echo "$f" 	 else       echo "FILE: $f"       cat "$DIFFS" 	 fi      fi  else      echo "FILE: $f"      cmp $CMPOPTS "$lfile" "$rfile"  fi     fi	else     if $IGNOREEXIST; then  continue     elif $LISTONLY; then  echo "$f"     else  echo "FILE: $f does not exist in $rdir"  if $SHOWLEFT; then      if file "$lfile" | grep "text\$" >/dev/null; then 	 cat "$lfile" | sed "s;^;<;;"      fi  fi     fi	fi    else	if $IGNOREEXIST; then     continue	elif $LISTONLY; then     echo "$f"	else     echo "FILE: $f does not exist in $ldir"     if $SHOWRIGHT; then  if file "$rfile" | grep "text\$" >/dev/null; then      cat "$rfile" | sed "s;^;>;;"  fi     fi	fi    fidone <"$FILELIST"rm -f "$FILELIST" "$DIFFS"exit 0
Thanks Ragnar for this easy to use script !:lol: Bruno

#302 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 03 May 2005 - 01:23 PM

HEAD and TAIL We already know that for reading  text files ( config and logs ) we can use the command "cat" or for longer files print them in pages in the console with "less" and "more".Now imagine you just want to see the first 10 or last 20 lines of a file. Or even follow what is written to a log file "live". For this we use the commands "head"  and "tail"A few examples:I want to see the last 20 lines of /var/log/boot.log:
# tail -n 20 /var/log/boot.log
Or the first 30 lines of /etc/sensors.conf:
# head -n 30 /etc/sensors.conf
The default is 10 lines so you only need the -n option if you want to see more then 10 lines.Now something a bit more interesting and fun . . . . imagine you want to follow what is been written "live" to the /var/log/messages file ( one of the most important log-files ):
# tail -f /var/log/messages
This will first show the last 10 lines of the file but it will grow as new lines are added . . . .  ( just open another console and log in as root and you will see that that action gets logged by /var/log/messages ) When you get tired of looking at the logfile you can stop the printing of the messages to the terminal with Ctrl+C and it will then return your prompt.:hmm: Bruno

#303 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 10 May 2005 - 01:45 PM

INSTALLING MANDRIVA 2005 Limited Edition( General instructions ) . . . . . * Due to limitations of the forum software this how-to is split over 2 posts First read erratum:  Here Links to ISO images can be found Here- PreparationIf this is your first Linux install, check out Basic Rules for Install  If you are replacing a previous Mandrake Install back up: - Your browser plugins located in /usr/lib/mozilla/plugins - The ~/.evolution directory ( When I restore it, I chown (change ownership) it back to "chown -R bruno:bruno evolution" )- The ~/.galeon/bookmarks.xbel ( or other bookmarks ) - Personal things in your /home directory - Your /etc/lilo.conf ( if you are booting mutiple distros ) - Your /etc/hosts, /etc/aliases, /etc/rc.d/rc.local, ~/.bashrc, ~/.exrc if you made any modification to these files. - Set your BIOS to boot from CD and disable PNP aware OS.  - Put the first CD in the CD-ROM drive and boot your computer. - Install1st screen: The welcome screen. Press Enter Before the GUI comes back, the installer is loading into memory and devices are being configured.  2nd screen: Language selection Posted Image ( Click to enlarge )The default is US English,  Press Next  3rd screen: License agreement Posted Image ( Click to enlarge ) Select "accept" and Press Next  4th screen: Is this an install  or an upgrade ? Posted Image ( Click to enlarge )Tick the box of "install" and Press Next ( Advice: NEVER use Upgrade !!! )  5th screen: Security level Posted Image ( Click to enlarge )ATTENTION: By default the security level is set to "high", change this to "Standard"Fill in "root" or your email address and Press Next  6th screen: The DrakX Partitioning wizard found etc. etc. Posted Image ( Click to enlarge )- If  you have your partitions already made: tick the box "use existing partitions" and Press Next - If you still have to make partitions, or want to change the size of the existing ones: tick the box "Custom Disk Partitioning" and Press Next You will be taken to the very intuitive and easy partitioning tool. Make a 5G partition for / and a 2G for /home. 7th screen: Choose file Mount points Posted Image ( Click to enlarge )Chose the partitions where you want / and /home and Press Next ( Everybody using partitions for /tmp and /usr too . . you know what to do ;) ) 8th screen: Choose the partitions you want to format Posted Image ( Click to enlarge ). . Leave the /home box unchecked if you want to keep your mail addresses and personal settings Press Next  9th screen: Media Posted Image ( Click to enlarge )Here it shows what install media it has found and asks you if you want to add additional installation media . . . . . . . Choose "None" and Press Next ( NOTE: You will have less CDs listed because these screenshots are from the Club-Edition )10th screen: Packages http://www.brunolinux.net/Images/INSTALL_2005/2005-DRAKX-screenshots/9.png ( Click to enlarge )Do like in the screen shot: tick all the boxes on the left, and only the last 3 on the right and Press Next NOTE: Including Gnome will also give you all the gnome programs you can also use in KDE . . so even if you intend to never use Gnome it is better to install it anyway. Now the install really starts. It takes about 16 minutes and you have to change CDs twice . . . . . * Will be continued in next post

#304 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 10 May 2005 - 01:46 PM

. . . . . 11th screen: Root password Posted Image ( Click to enlarge )Fill in your root password twice and Press Next 12th screen: Adding a userPosted Image ( Click to enlarge )Fill in name twice and password twice and Press Accept  13th screen: Adding a user ( again ;) )Press Next  14th screen: Auto loginPosted Image ( Click to enlarge )De-select the box, you do not want this, and Press Next NOTE: It is safer to not use this feature, and it makes sure that you can choose at boot what window manager to start. Also if you ever get a corrupted /home directory the non-autologin makes fixing a lot easier. 15th screen: Boot loader,   Posted Image ( Click to enlarge )Select "First sector of drive ( MBR )" and Press Next NOTE: It will automatically include your Windows partition for dual boot 16th screen: Summary, . . . . This is very important . . check all the settings, look at the difference I have in the two screenshots: Posted Image ( Click to enlarge )Before configuring Posted Image ( Click to enlarge )After configuring  17th screen: Updates . . . say NO and Press Next NOTE: This feature rarely works,  you will have to do the updates in the MCC after the first reboot B) 18th screen: Complete  . . remove your CD and Press Reboot   After the reboot you absolutely have to install: Anacron, and get the Updates ( see and subscribe to This thread )Additionally you can add: xmms, xmms-alsa, aumix, galeon, gkrellm, kedit, mplayer, xine etc. etc.Also read the notes Here :huh: BrunoSpecial tweaks:Menu and kdm: http://forums.scotsn...showtopic=11825Smaller fonts: http://forums.scotsn...showtopic=11824Nvidia & dkms: http://forums.scotsn...showtopic=11791

#305 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 17 May 2005 - 02:14 PM

URPMI SOURCES MANDRIVA 2005 LEWant access to 100 GB extra software ??There are the new sources you can add to the package manager of Mandriva 2005 to get extra software. Some of them everybody can add, but a few ( the last two ) are only for Club Members.For those new to this concept, here how it's done:

Bruno, on Forum, said:

Go to a console, log in as 'su' and paste the line after the prompt and hit enter.Now it should work and get the list . . . be patient, it takes a while.Then as you get the prompt back, close the console ( Ctrl+d , 2x ).Now that we have added the source to your software manager, we can have a look at all the packages:Go to the MCC --> Software Management --> 'Look at installable software and install software packages' ( the icon with the + ). Now you will see the text : 'All packages' under the search-box., 'All packages' 'by group' change the by group in: 'by medium repository' and you will get a list with the sources you can choose from: CD1, CD2, CD3 and also the Update source and the just added source. Click in the little triangle in front of the new source, and a list will fold out with all the packages you can choose from . . . . FUN, MAGIC, BLISS !
Here they are: ( Don't click on the links but paste them in a root-console ) YOU HAVE TO BE ON LINE ! Contrib
# urpmi.addmedia contrib ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrake/official/2005/i586/media/contrib  with hdlist.cz
PLF-Free ( Needs the Contrib source )
# urpmi.addmedia plf-free ftp://ftp.easynet.fr/plf/mandrake/free/10.2 with hdlist.cz
PLF-NonFree ( Free to download and use, non-free as in licence ) ( Needs the Contrib source )
# urpmi.addmedia plf-nonfree ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandrake/non-free/10.2 with hdlist.cz
Thacs
# urpmi.addmedia thacs http://anorien.csc.warwick.ac.uk/mirrors/thac/10.2/RPMS/ with hdlist.cz
Jpackage
# urpmi.addmedia jpackage-test ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrake/official/2005/i586/media/jpackage/  with media_info/hdlist.cz
Club Contrib
# urpmi.addmedia club.contrib ftp://ftp.uni-bayreuth.de/pub/linux/Mandrakelinux/devel/testing/Mandrakeclub/10.2/i586 with hdlist.cz
>>> Only club-members commercial packages
# urpmi.addmedia club.comm_i586_2005LimitedEdition http://NICKNAME:PASSWORD@www.mandrivaclub.com/downloads2/comm/10.2/i586/ with ./media_info/hdlist.cz
( Do not forget the replace NICKNAME:PASSWORD :blink: )Club Testing
# urpmi.addmedia testing_i586_2005LimitedEdition http://NICKNAME:PASSWORD@www.mandrivaclub.com/downloads2/test/10.2 with hdlist.cz
( Do not forget the replace NICKNAME:PASSWORD :hmm: ):huh: BrunoIMPORTANT NOTESNOTE 1: If you add the sources today . . and you want to use them, let us say next week, you first have to update them because new packages might have been added, and old packages might have been removed . . . so each time before using them do "urpmi.update -a" as root in a console !!NOTE 2: Usually I only have the CD, Main and Contrib sources active all the time . . and only make all others active if I can not find the desired package looking in those 3 ( CD, Main and Contrib ) . . . . You will just get too many different versions of the same package if you have all the sources active all the time. Sticking to the native Mandriva ones is in general recommended !

#306 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 24 May 2005 - 02:41 PM

BOOTING in RUNLEVEL 3 ( Trick with Lilo )Sometimes when  troubleshooting you will want to boot in run-level 3 ( This is  the non-graphical mode ) because X is using the wrong driver or the system fails to boot the usual way, hanging on some module it fails to load.Here is a simple trick for the people using Lilo as their boot-loader:Imagine your Lilo menu usually shows you:PCLosMandrakeFedoraDebianSlackwareAnd it is PCLos you want to boot in run-level 3 . . . . When you get the lilo-screen where you can choose what distro to boot press the Esc-key and you will get a prompt . . . at that prompt type:
PCLos 3
( Basically it is the name of the menu entry you want to boot and a 3 ) . . . . It will then boot in level 3  . . . then you can login as "root" ( not "su" ) and do "XFdrake" to set the correct driver for your graphics card, or any other troubleshooting operation you need to perform. When you are ready you can either type "reboot" or log out as root with Ctrl+D, then log in as user and type "startx", . . . and it will magically continue booting from level 3 to level 5.NOTE: Sure you can type "PCLos 1" too so it boots in "single user mode" giving you a root-prompt, so in case you forgot the root-password you can just type "passwd" and change it to one you can remember next time you need it.:) Bruno

#307 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 31 May 2005 - 02:05 PM

START NEW SESSIONYou might have noticed there is an entry in your KDE and Gnome menu called "Start New Session" ( In some distros "Switch User" ). I will try to explain a few things about this feature. In the "old" days you could at any time do Ctrl+Alt+F1 ( to F6 ) to get a text console you could log in as another user ( also as root ) to perform needed tasks and at the same time have your X running under F7. So switching up and down between the X session and the text session was easy as pressing a few keys on your keyboard.Now, these days it is possible to start a second X-session and log in as another user ( also root ) on that second X-session and  switch between the 2 X-sessions with a simple Ctrl+Alt+F7 and Ctrl+Alt+F8.Here is how it is done: You select "Start New Session" from the menu and you get the following message:

Quote

You have chosen to open another desktop session.The current session will be hidden and a new login screen will be displayed.An F-key is assigned to each session; F7 is usually assigned to the first session, F8 to the second session and so on. You can switch between sessions by pressing CTRL, ALT and the appropriate F-key at the same time.
Pressing OK will give you the kdm or gdm ( the login manager your distro uses ) to log in and after logging in you will have the 2 sessions running . . . . hint: you can even have a KDE and a Gnome session running at the same time.As soon as you log out in one session you will automatically be switched over to the other session . . . isn't that cool ??Note: Next to the F8 you can start additional X-sessions on the F9, F10, F11 and F12 keys too, so you can have a maximum of 6 text- plus 6 X-sessions which is total of 12 sessions running at the same time on only one computer.:) Bruno

#308 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 June 2005 - 01:50 PM

LOOPING AN ISOCan you see what is in an ISO file without burning it to CD ? Yes, that is what the "loop" command does.. You mount the file as a loop device and then you can browse the ISO like any normal directory. Here is what you do ( we will take Fedora as example: FC4-i386-disc1.iso ).
# mkdir /mnt/loop# mount -o loop FC4-i386-disc1.iso /mnt/loop# ls /mnt/loop
That last command will show you the contents of the ISO file . . . you can read it, copy files from it, but ( of course ) not write to the ISO.But what you can do is copy the files to a special directory ( or partition ) and do an install from the HD.  In the case of the Fedora example above you would put the files of the 4 ISO's in a directory. Then download the "boot.iso" from the ftp mirror ( For Fedora Core 4:  Fedora4_boot.iso ).  1). Boot from the boot-CD 2). It will give you a dialog where you want to install from: choose "hard disk"3). The next dialog will ask you from which HD ( if you have 2 )4). After that a dialog will ask you on what partition the files are located5). And the next dialog asks "Directory or ISO image _________" type the path to the directory you copied the files to and press OKAfter that, the program will load into memory and proceed to go on as a normal install. This way you only have to burn 1 CD instead of 4.:hmm: BrunoNOTE: The Mandriva 2005 has a new feature in the boot.iso that can install directly from ISO files stored on the HD without having to "loop" them first.

#309 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 14 June 2005 - 12:53 PM

MANDRIVA SECURITY SETTINGS ( MSEC )Mandriva/Mandrake has a clever tool to control the security settings system-wide, it is called MSEC. There are 6 preconfigured levels you can choose from to secure your computer.I recently noticed that with a few of the installs of Mandriva 2005, the default security level ( on the 5th screen during the install (see Here ) is set to "high" . . . where for a regular desktop "normal" should be enough . . .Just to show you the different Mandriva security settings ( Msec ) here is a table of the levels 0 to 5 where 5 is "paranoid" and 0 is "none" . . . . 2 is the "normal" level you want . . . :hmm:

Quote

****************************Security level 0 :- no password- umask is 002 ( user = read,write | group = read,write | other = read )- easy file permission.- everybody authorized to connect to X display.- . in $PATH****************************Security level 1 :- Global security check.- umask is 002 ( user = read,write | group = read,write | other = read )- easy file permission.- localhost authorized to connect to X display and X server listens to tcp connections.- . in $PATH- Warning in /var/log/security.log****************************Security level 2 ( Aka normal system ) :- Global security check- Suid root file check- Suid root file md5sum check- Writable file check- Warning in syslog- Warning in /var/log/security.log- umask is 022 ( user = read,write | group = read | other = read )- easy file permission.- localhost authorized to connect to X display and X server listens to tcp connections.****************************Security level 3 ( Aka more secure system ) :- Global security check- Permissions check- Suid root file check- Suid root file md5sum check- Suid group file check- Writable file check- Unowned file check- Promiscuous check- Listening port check- Passwd file integrity check- Shadow file integrity check- Warning in syslog- Warning in /var/log/security.log- rpm database checks- send the results of checks by mail if they aren't empty- umask is 022 ( user = read,write | group = read | other = read )- Normal file permission.- X server listens to tcp connections.- All system events additionally logged to /dev/tty12- Some system security check launched every midnight from the ( crontab ).- no autologin- home directories are accesible but not readable by others and group members.****************************Security level 4 ( Aka Secured system ) :- Global security check- Permissions check- Suid root file check- Suid root file md5sum check- Suid group file check- Writable file check- Unowned file check- Promiscuous check- Listening port check- Passwd file integrity check- Shadow file integrity check- Warning in syslog- Warning in /var/log/security.log- Warning directly on tty- rpm database checks- Send the results of checks by mail even if they are empty to show that the checks were run.- umask 022 ( user = read,write | group = read | other = read ) for root- umask 077 ( user = read,write | group = | other = ) for normal users- restricted file permissions.- All system events additionally logged to /dev/tty12- System security check every midnight ( crontab ).- localhost authorized to connect to X display.- X server doesn't listen for tcp connections- no autologin- sulogin in single user- no direct root login- remote root login only with a pass phrase- no list of users in kdm and gdm- password aging at 60 days- shell history limited to 10- shell timeout 3600 seconds- at and crontab not allowed to users not listd in /etc/at.allow and /etc/cron.allow* - Services not contained in /etc/security/msec/server.4 are disabled during package installation ( considered as not really secure ) ( but the user can reenable it with chkconfig -add ).- Connection to the system denyied for all except localhost (authorized services must be in /etc/hosts.allow).- ctrl-alt-del only allowed for root ( or user in /etc/shutdown.allow ).- most sensible files and directories are restricted to the members of the adm group.- home directories are not accesible by others and group members.- X commands from /usr/X11R6/bin restricted to the members of the xgrp group.- network commands (ssh, scp, rsh, ...) restricted to the members of the ntools group.- compilation commands (gcc, g++, ...) restricted to the members of the ctools group.- rpm command restricted to the members of the rpm group.- forbid exporting X display when switching from root to another user*******************************Security level 5 ( Aka Paranoid system ) :- Global security check- Permissions check- Suid root file check- Suid root file md5sum check- Suid group file check- Writable file check- Unowned file check- Promiscuous check- Listening port check- Passwd file integrity check- Shadow file integrity check- Warning in syslog- Warning in /var/log/security.log- Warning directly on tty- rpm database checks- Send the results of checks by mail even if they are empty to show that the checks were run.- umask 077 ( user = read,write | group = | other = )- Highly restricted file permission- All system events additionally logged to /dev/tty12- System security check every midnight ( crontab ).- X server doesn't listen for tcp connections- no autologin- sulogin in single user- no direct root login- no list of users in kdm and gdm- password aging at 30 days- password history to 5- shell history limited to 10- shell timeout 900 seconds- su to root only allowed to members of the wheel group (activated only if the wheel group isn't empty)* - Services not contained in /etc/security/msec/server.5 are disabled during package installation ( considered as not really secure ) ( but the user can reenable it with chkconfig -add ).- Connection to the system denyied for all (authorized services must be in /etc/hosts.allow).- ctrl-alt-del only allowed for root ( or user in /etc/shutdown.allow ) .- most sensible files and directories are restricted to the root account.- home directories are not accesible by others and group members.- X commands from /usr/X11R6/bin restricted to the members of the xgrp group.- network commands (ssh, scp, rsh, ...) restricted to the members of the ntools group.- compilation commands (gcc, g++, ...) restricted to the members of the ctools group.- rpm command restricted to the members of the rpm group.- forbid exporting X display when switching from root to another user******************* level4/level5 : "services disabled" explanations :- Some server aren't really considered as secure, these one, should for example be compiled from sources. server considered as secure are specified in /etc/security/msec/server.4/5 When enabling level4/5, all servers which aren't considered as secure are disabled ( NOT uninstalled, just disabled ) user can reenable them using the chkconfig utility ( server will be launched at next boot ). In these level, we are also denying rpm to enable any server considered as insecure ( off course rpm can install the server ). The user have the choise : chkconfig --add servername will enable the server. Or add the server in the secured server list*** Future Release : ***- Automatic tty locking ( unlock by passwd ) after X time of inactivity.***
If you want to change the msec settings after the install you can give the command ( as root )
# msec 2
;) Bruno

#310 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 21 June 2005 - 01:20 PM

SHA-1 CHECKSUMSSHA-1 is the successor of MD5 ( Read about MD5 here ) and is a tool to check the integrity of your downloads.The SHA-1 algorithm is the brainchild of the US-based National Security Agency (NSA) Basically it works the same as the MD5, a SHA-1 file is available on the FTP server where you downloaded your ISOs and when opening it you will see a string of numbers that you compare to the output of the command:
$ sha1sum /home/bruno/downloaded.iso
The string you get from this command typically looks like:

Quote

f560f26a32820143e8286afb188f7c36d905a735
You compare it to the string you find in the SHA-1 file on the FTP mirror. If both of them are identical you can be sure your downloaded ISO is okay and you can burn it to a CD.:drooling: BrunoNOTE: Windows users can download a tool Here to check MD5 and SHA1 hashes. ( works in all flavors of windows )

#311 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 28 June 2005 - 01:40 PM

CONFIGURE NDISWRAPPER in the CONTROL CENTERJulia ( aka teacher ) wrote us some words on an easy way to configure NDISwrapper:

Quote

Installing a windows wireless driver in Linux can be done through the use of a program called ndiswrapper. This is the way to go if your wireless card does not have Linux support. If you are using Mandriva/Mandrake or PCLinuxOS, then you may be able to install your NDISWrapper through the Control Center.  The very first thing you need to do is locate the .inf file in Windows that supports your driver. If you do not have Windows on your computer, you will need to search on the Internet or the disks that came with your card for the .inf file. Make sure the file is somewhere you have easy access to it from Linux.With that said, we will now go through the easy way to install with NDISWrapper. The first thing to do after you have located your driver, is to make sure it is handy. I move mine from windows to my home directory. You can get it from the Internet by googling for it or checking some of the resources available or you can find it on a CD or in your Windows where it is usually under /WINDOWS/system32/Drivers/ and then in a folder. Mine is in Atheros/Wireless \LAN/ within the Drivers folder. Notice the backslashes in the folder name. Those represent spaces in the folder name. The easy way to get past that is to press the tab key after you start typing. If I type cd followed by the first part of the name, it will then fill in the rest of the name for me. Handy trick. B)  I simply type
 cd At
and then press tab and it does the rest.Now that you have finally found that elusive driver we can go to the menus and go from here.Click on the menu-button down on your task bar across the bottom of your screen.  Go up to configuration and then over and down to PCLinuxOS Control Center or Mandrake Control Center.. . . . . . . Posted ImageA menu will pop up that starts off as "run as root". You will need to type your root password in the box and press enter. . . . . . . Posted ImageNow you are in the control center. This is a good spot to explore around and see all the things that can be done the easy way - by clicking on links. But before you go off and exploring, let's take a look at the tab labeled "networking". Don't get distracted by the last menu entry either. That is for after your drivers are set up for your wireless device.. . . . . . Posted ImageThe first thing to do is to click on that first entry - the one labeled "Create a new network interface (LAN, ADSL, Wireless, etc.)." Simple enough? Let's get going.Now under new connection we are going to click on the bottom button - wireless connection. Once you have done that then click next. . . . . . . Posted ImageNext it asks about the network to configure. It gives you two choices. First you can select "manually load a driver" and see if you can follow it from there and if it works. If it does, great, you are done.. . . . . . Posted ImageIf not, you will use ndiswrapper, and you will go back to where you selected "manually load a driver," and this time click the bottom option to "use a windows driver with ndiswrapper" and once again click next. It will then ask if you want to install a new driver and that is what you will do. . . . . . . Posted ImageThe next screen says "net device" and that is it. Simply click next. The next few screens will vary according to your boot situation. Since you are running wireless, I assume you are going through a wireless router and it holds your configuration. I simply click next through the next few screens but you will need to adapt them as necessary for your situation. The screens are: Automatic ip (boot/dhcp) or manual configurationAssign host name or defaultWireless parameters: You will need to think about this screen. You can simply click "auto" and "any" or you can change this. If you are using encryption you will use the word "managed" instead of "auto" and then you will indicate the network name and your encryption id. Otherwise, you can go with "auto" and "any". . . . . . . Posted ImageThe next screen is for the wireless parameters for your card. I have never needed to put anything here but if you know of specific parameters then you will enter them here. If in doubt, go take a look at the desktop link for the "man pages". Host name: If you need to enter something here, then go ahead. I leave it blank. It is the same for the next screen: zeroconference host. Do you want to allow users to connect? If you say no then only root will be able to connect. Finally, it tells you the network needs to restart and asks for your permission. Here you need to tell it yes and then wait a minute or two while it does its thing.Hasn't this been easy so far? Now it says the configuration is finished and wants you to restart your x environment. What on earth is that? Simple. All you need to do is to go back to your menu-button and click on log out and then you will log back in and everything should be working. If that does not work, it will be a good time to go post questions on the forum, giving as many details as possible about your wireless device. Happy Browsing.
Thanks Julia  . . . . this looks so simple maybe it is time to get a wireless myself soon ! <g>B) BrunoPS: Here is an interesting link with a list of cards known to work with ndiswrapper

#312 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 05 July 2005 - 02:12 PM

THE GROUPS COMMANDJust as penguins live in large groups, we Linux users like to belong to a group too . . . . . <g>If you want to see to what groups your user belongs to, there is a simple command "groups", See here how it works. When I give the command in Slackware I get:
$ groupsusers audio video plugdev
So I belong to the group "users", "audio" "video"and "plugdev"Or giving the same command as root:
# groupsroot bin daemon sys adm disk wheel floppy
This shows that root belongs to 8 different groups.Now imagine that you want to add yourself to the "audio" group . . . there are 2 simple ways to achieve that:Either do  
# usermod -G audio bruno
Or if the command usermod is not available on your system, just edit the /etc/group file and add your login name to to group   . . . Here is an example of my /etc/group file:

Quote

# cat /etc/grouproot::0:rootbin::1:root,bin,daemondaemon::2:root,bin,daemonsys::3:root,bin,admadm::4:root,adm,daemontty::5:disk::6:root,admlp::7:lpmem::8:kmem::9:wheel::10:rootfloppy::11:rootmail::12:mailnews::13:newsuucp::14:uucpman::15:audio::17:brunovideo::18:brunocdrom::19:games::20:slocate::21:utmp::22:smmsp::25:smmspmysql::27:rpc::32:sshd::33:sshdgdm::42:shadow::43:ftp::50:apache:x:80:messagebus:x:81:haldaemon:x:82:plugdev:x:83:brunopower:x:84:pop::90:popscanner::93:nobody::98:nobodynogroup::99:users::100:console::101:
Each line has 4 parts separated by colons: The first part is the name of the group. The second part ( not in use here) is for storing a password to allow users of another group to log in, if a x is in this field, the shadow group passwords are used. The third part is the GID ( Group ID ) number. The fourth part lists the users that are member of that group separated by comma's. ( So there is where you want to add your name !! )For more info on the /etc/group file type "man 5 group" in a terminal.NOTE: If you want to add a new group ( like "penguins" ) you give the command "groupadd penguins"  . . . LOLB) Bruno

#313 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 12 July 2005 - 01:48 PM

SRPMs ( Source RPMs )Maybe you noticed when searching for RPMs that sometimes you find packages that ends with ".src.rpm". These are Source RPMs, and although it will be a bit more work to install them, it might, in some cases, be just the ticket if all the other RPMs you find don't fit your distro-version or architecture.Source RPMs ( SRPMs ) allow you to build a RPM package tailored to your distro and system. They contain the program's source code and you need a special rpm command to compile them.Also you will need several development packages to be able to customize your own RPMs: rpm-build, autoconf, automake, spec-helper and rpm-devel ( + dependencies ) are the main ones.So, when you have all the needed devel packages, all you have to do is:
# rpm --rebuild name_of_package.src.rpm
This will build a RPM package suited to your system architecture and distro-version, after the compile and rebuild is finished you can find the "name_of_package.rpm" in your "/usr/src/rpm/rpms/<arch>/" directory. To install that new RPM you use the usual "rpm -ihv" command . . . <g>For more info and tricks on SRPMs see here: http://www.linuxnovi...EW=VIEW&t_id=52:hysterical: Bruno

#314 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 30 August 2005 - 01:59 PM

SHRED ( Really Delete )Some people make a living recovering data from old harddisks. If that knowledge makes you nervous, here is a command you will want to remember: "shred"Shred is a real powerful command . . . . much better then just deleting-- it shreds a file, or wipes a partition, so that absolutely no recovery is possible ( even those businesses specialized in data-recovery will not be able to get it back  . . . so be careful )Here is the basics of the command:
$ shred -n 50 -z -u secret.txt
The -n 50 means that the file "secret.txt" will be overwritten 50 times. The -z means add a final overwrite with zeros to hide the shredding. The -u makes sure the file is removed after shred is done with it.You can shred a complete drive or partition too:
# shred -n 50 -z /dev/hda
This will make sure that no data will be found when you send this drive to the local dump <g>:unsure: BrunoNOTE: Shredding a single file on a partition with a journaled filesystem can be less permanent as one might think ( because of the journal ), shredding the complete partition is needed to be absolutely sure.

#315 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 06 September 2005 - 01:32 PM

CD SPELLCHECKIf, like me, you often make typos and find this annoying when typing cd commands here is the right Tip for you:
 $ shopt -s cdspell
This will turn on autocorrection when you mistype the name of a directory . . . so when you type
$ cd /ect/X11
the autocorrection will read this as
$ cd /etc/X11
The "shopt" command will last as long as you are logged in . . . if you want it permanently you will have to add a line to your ~/.baschrc so it gets enabled at every boot.Shopt has more nice options . . . have a look what "shopt -p" shows us:

Quote

shopt -u cdable_varsshopt -u cdspellshopt -u checkhashshopt -s checkwinsizeshopt -s cmdhistshopt -u dotglobshopt -u execfailshopt -s expand_aliasesshopt -u extdebugshopt -u extglobshopt -s extquoteshopt -u failglobshopt -s force_fignoreshopt -u gnu_errfmtshopt -u histreeditshopt -u histappendshopt -u histverifyshopt -s hostcompleteshopt -s huponexitshopt -s interactive_commentsshopt -u lithistshopt -u login_shellshopt -u mailwarnshopt -u no_empty_cmd_completionshopt -u nocaseglobshopt -u nullglobshopt -s progcompshopt -s promptvarsshopt -u restricted_shellshopt -u shift_verboseshopt -s sourcepathshopt -u xpg_echo
If you want to know exactly what all of those options do, have a look in "man bash" in the section "Shell Bulletin Commands" under "shopt"B) Bruno

#316 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 13 September 2005 - 01:20 PM

NICEIf you start a process that will take long to execute and is heavy on CPU resources, it may be a good thing to let it run in the background ( so you can continue doing other things ) and change the priority of the process.With adding  a "nice" value before the command you can set the priority . . . and closing the command with an "&" you set it to the background and thus will get your prompt back so you can continue working. This Tip is about "nice", but  we will handle forground and background processes more extensively in the next Tip.So let us give a simple example:
# nice -n 19 updatedb &
Here the nice priority is set to 19 ( its lowest value )  . . . You will see the command returns "[1] 8037" in your terminal, this is because "&" did place the process in the background, the "[1]" is the job number and the "8037" the process number. But like I said, more about that next time.If you want you process to have the highest priority ( so to be less "nice" to other processes ) you can go up to -20 ( the highest value ) so the process will finish quick:  
# nice -n -20 updatedb &
B) Bruno

#317 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 20 September 2005 - 01:27 PM

BACK- and FOREGROUND PROCESSESLike promised in the previous Tip ( "nice" ) now we will tell how to send a process to the background and get it back to the foreground.There are 2 ways you can send a process to the background, the first is with the "&" sign:
# nice -n 19 updatedb &
Another way to do this is start it as usual:
# nice -n 19 updatedb
And then interupt it with Ctrl+Z, and then to continue the process in the background you give the command:
# bg
Now let us start 2 processes in the background:
# nice -n 19 updatedb &
This will return something like:

Quote

[1] 8697
Meaning job number "1" and process number ( PID ) "8697"Now the second command:
# ls -alR / >file-list.txt 2>&1 &
( makes a "file-list.txt" of all the files on your computer and sends the error messages to the same file )This will return something like:

Quote

[2] 8724[1]   Running                    nice -n 19 updatedb
So the second command gets job number "2" and proces number "8724" and you can see that job number "1" is still running.Next if we give the command "jobs" we will see:

Quote

[2]+  Running                 ls -alR / >file-list.txt 2>&1 &[1]   Done                    nice -n 19 updatedb
You see the first job is "Done" and the second job is still running. Now if we do:
# fg %2
It puts the second job back in the foreground and you will have to wait for the job to finish to get your prompt back. ( or do Ctrl+Z and bg again )So in a nutshell, the "&" sign at the end of a command puts it in the background, you get a job number and with that job number you can with "fg %<jobnumber>" and "bg %<jobnumber>" put it back and forth.Now, there are some restrictions:1). There should no input needed from the keyboad for the background process.2). Better send output from the process to a file and not to the screen.3). If you exit the shell the process is stopped ( you can prevent this by preceeding the command with "nohup" ):pirate: Bruno

#318 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 27 September 2005 - 01:10 PM

THE COMMAND "INFO"There is a lot of information installed by default on your Linux distro.   Sure we all know about the "docs" and the "man" pages, but there is more: the command "info" ( They say it is easier to read than the man pages, but don't blame me if you don't  agree with that statement <g> )You can use "info" from the commandline but also, and even easier to navigate, in konqueror thanks to info2html. ( note: konqueror works in Gnome too if properly installed )So have a look, open konqeror and type "info:/bash" in the address bar  . . . you will see that the info-pages  give in-depth info about the subject you are looking for. There are links you can click to go to the next level.If you want to know what subjects are handled by "info" type "info:/info/Top" in the konqueror address bar.Now I hear you thinking: "Bruno, what's up with you ? We thought you were a command line junkie" . . . . Okay okay, you asked for it:
$ info bash
And you will get the same page as above.Note that:"q" = exit"n" = next chapter"p" = previous chapter"space" = follow link in "* menu"More info on how to use "info":
$ info info
Sure there are "man" pages about "info" too . . . just try "man info" :D !!:) Bruno

#319 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 11 October 2005 - 03:51 AM

INSTALLING A KERNEL-SOURCEImagine you want to compile drivers for your Nvidia Card, so you need the source for the kernel you are running . . . . and the distro does not provide the source for that kernel on their mirrors . . . . what can you do ??Well, for example if "uname -r" shows you "2.6.12.2" for the kernel you are running, go here: http://www.kernel.or...ux/kernel/v2.6/ and look for the "linux-2.6.12.2.tar.gz", then  download it to "/usr/src/" and do:( as root and after you cd to /usr/src )
# gzip -cd linux-2.6.12.2.tar.gz | tar xvf -
( Note the | is a "pipe"-sign and not an L or an i . . . and do not forget the - at the end of the command )This will make a /usr/src/linux-2.6.12.2 directory. ( NOTE: unpacked you will need about 190 MB free space )Next step is to make a symlink so the compiler of the driver you want to install can find it:
# ln -s /usr/src/linux-2.6.12.2 /usr/src/linux
Or if you already have a 2.6 or still the 2.4 source in /usr/src, you will have to change the symlink "linux" from that 2.4 source to the new one . . . so:
# rm -rf /usr/src/linux# ln -s /usr/src/linux-2.6.12.2 /usr/src/linux
After that you are all set to download the Nvidia drivers and install them.:hysterical: Bruno

#320 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 18 October 2005 - 01:09 PM

.* Due to limitations of the forum software this how-to is split over 2 postsINSTALLING MANDRIVA 2006( General instructions ) >>> As long as the free ISOs are not yet available you can do an FTP install following these instructions: HerePlease first read the erratum: http://qa.mandriva.com//twiki/bin/view/Mai...Linux2006Errata - PreparationIf this is your first Linux install, check out Basic Rules for Install  If you are replacing a previous Mandrake Install back up: - Your browser plugins located in /usr/lib/mozilla/plugins - The ~/.evolution directory ( When I restore it, I chown (change ownership) it back to "chown -R bruno:bruno evolution" )- The ~/.galeon/bookmarks.xml ( or other bookmarks ) - Personal things in your /home directory - Your /etc/lilo.conf ( if you are booting mutiple distros ) - Your /etc/hosts, /etc/aliases, /etc/rc.d/rc.local, ~/.bashrc, ~/.exrc if you made any modification to these files. - Set your BIOS to boot from CD and disable PNP aware OS.  - Put the first CD in the CD-ROM drive and boot your computer. - Install1st screen: The welcome screen. Press Enter Before the GUI comes back, the installer is loading into memory and devices are being configured.  2nd screen: Language selection Posted Image ( Click to enlarge )The default is US English,  Press Next  3rd screen: License agreement Posted Image ( Click to enlarge ) Select "accept" and Press Next  4th screen: Is this an install  or an upgrade ? Posted Image ( Click to enlarge )Tick the box of "install" and Press Next Advice: NEVER use Upgrade !!! )  5th screen: Security level Posted Image ( Click to enlarge )ATTENTION: By default the security level is set to "high", change this to "Standard"Fill in "root" or your email address and Press Next  6th screen: The DrakX Partitioning wizard found etc. etc. Posted Image ( Click to enlarge )- If  you have your partitions already made: tick the box "use existing partitions" and Press Next - If you still have to make partitions, or want to change the size of the existing ones: tick the box "Custom Disk Partitioning" and Press Next You will be taken to the very intuitive and easy partitioning tool. Make a 5G partition for / and a 2G for /home. 7th screen: Choose file Mount points Posted Image ( Click to enlarge )Chose the partitions where you want / and /home and Press Next ( Everybody using partitions for /tmp and /usr too . . you know what to do B) ) 8th screen: Choose the partitions you want to format Posted Image ( Click to enlarge ). . Leave the /home box unchecked if you want to keep your mail addresses and personal settings Press Next 9th screen: Packages Posted Image ( Click to enlarge )Do like in the screen shot: tick all the boxes on the left, and only the last 3 on the right and Press Next NOTE: Including Gnome will also give you all the gnome programs you can also use in KDE . . so even if you intend to never use Gnome it is better to install it anyway. Now the install really starts. It takes about 16 minutes and you have to change CDs twice * Will be continued in next post . . . . . .  

#321 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 18 October 2005 - 01:19 PM

. . . . . 10th screen: Root password Posted Image ( Click to enlarge )Fill in your root password twice and Press Next 11th screen: Adding a userPosted Image ( Click to enlarge )Fill in name twice and password twice and Press Accept user 12th screen: Adding a user ( again B) )Posted Image ( Click to enlarge )Here you can add another user, or leave it empty and Press Next  13th screen: Auto loginPosted Image ( Click to enlarge )De-select the box, you do not want this, and Press Next NOTE: It is safer to not use this feature, and it makes sure that you can choose at boot what window manager to start. Also if you ever get a corrupted /home directory the non-autologin makes fixing a lot easier. 14th screen: Boot loader,   Posted Image ( Click to enlarge )Select "First sector of drive ( MBR )" and Press Next NOTE: It will automatically include your Windows partition for dual boot 15th screen: Summary, . . . . This is very important . . check all the settings by clicking on the Configure button, look at the difference I have in the two screenshots:Posted Image ( Click to enlarge )Before configuring Posted Image ( Click to enlarge )After configuring  16th screen: UpdatesPosted Image ( Click to enlarge ) . . . say NO and Press Next NOTE: This feature rarely works,  you will have to do the updates in the MCC after the first reboot :D  17th screen: Complete  . . remove your CD and Press Reboot- After the install: After the reboot you absolutely have to install: Anacron, and get the Updates ( see and subscribe to This thread )Additionally you can add: xmms, xmms-alsa, aumix, galeon, gkrellm, kedit, mplayer, xine etc. etc.NOTE:  I removed "kat" in the MCC after the install because it takes up to many resources ( kat = desktop search prog. )Info about "kat": http://kat.mandriva.com/After the first boot please issue the following command ( as root ) to fix a cron/msec bug:
# ln -s /etc/security/msec/security.conf /var/lib/msec/security.conf
Also read the release notes:  HereSpecial tweaks:Menu and kdm: http://forums.scotsnewsletter.com/index.php?showtopic=11825Smaller fonts: http://forums.scotsnewsletter.com/index.php?showtopic=11824Extra software sources can be configured, have a look HereHave FUN ! B) Bruno

#322 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 25 October 2005 - 01:53 PM

URPMI SOURCES MANDRIVA 2006Want access to 100 GB extra software ??There are the new sources you can add to the package manager of Mandriva 2005 to get extra software. Some of them everybody can add, but a few ( the last two ) are only for Club Members.For those new to this concept, here how it's done:

Bruno, on Forum, said:

Go to a console, log in as 'su' and paste the line after the prompt and hit enter.Now it should work and get the list . . . be patient, it takes a while.Then as you get the prompt back, close the console ( Ctrl+d , 2x ).Now that we have added the source to your software manager, we can have a look at all the packages:Go to the MCC --> Software Management --> 'Look at installable software and install software packages' ( the icon with the + ). Now you will see the text : 'All packages' under the search-box., 'All packages' 'by group' change the by group in: 'by medium repository' and you will get a list with the sources you can choose from: CD1, CD2, CD3 and also the Update source and the just added source. Click in the little triangle in front of the new source, and a list will fold out with all the packages you can choose from . . . . FUN, MAGIC, BLISS !
Please remember that after a while your sources might be outdated, so before searching and installing new packages you will have to update your sources with "urpmi.update -a" !!Here they are: ( Don't click on the links but paste them in a root-console ) YOU HAVE TO BE ON LINE !All commands are ONE line.Contrib
# urpmi.addmedia contrib  ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrakelinux/official/2006.0/i586/media/contrib with ../media_info/hdlist_contrib.cz
Main ( Distribution, what is on your CDs B) )
# urpmi.addmedia main ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrakelinux/official/2006.0/i586/media/main with ../media_info/hdlist_main.cz
PLF-Free ( Needs the Contrib source )
# urpmi.addmedia plf-free ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandrake/free/2006.0/i586 with hdlist.cz
PLF-NonFree ( Free to download and use, non-free as in licence ) ( Needs the Contrib source )
# urpmi.addmedia plf-nonfree ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandrake/non-free/2006.0/i586 with hdlist.cz
Jpackage
# urpmi.addmedia jpackage ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrakelinux/official/2006.0/i586/media/jpackage with ../media_info/hdlist_jpackage.cz
NL-Club
# urpmi.addmedia NL-Club  ftp://ftp.nluug.nl/pub/os/Linux/distr/mandrakeclubnl/2006/i586/ with hdlist.cz
Thacs rpms
# urpmi.addmedia thac_rpms http://anorien.csc.warwick.ac.uk/mirrors/thac//2006.0/RPMS with hdlist.cz
SeerOfSouls
# urpmi.addmedia SeerOfSouls http://seerofsouls.com/RPMS-2006/ with hdlist.cz
Borgnet
# urpmi.addmedia Borgnet ftp://ftp.planetmirror.com/pub/borgnet/2006.0/i586/ with ../hdlist.cz
>>> Only Mandriva Club-MembersCommercial Packages
# urpmi.addmedia "club.commercial_x86-32_2006" https://bruno%40forum.com:PASSWORD@dl.mandriva.com/rpm/comm/2006.0/i586/ with hdlist.cz
( Do not forget to replace "bruno%40forum.com:PASSWORD" which are the login: <bruno@forum.com> and the <password> for the club . . the @ in your email address is replaced by a %40 )Club Testing
# urpmi.addmedia "club.testing_x86-32_2006" https://bruno%40forum.com:PASSWORD@dl.mandriva.com/rpm/test/2006.0/i586/ with hdlist.cz
( Do not forget to replace "bruno%40forum.com:PASSWORD" which are the login: <bruno@forum.com> and the <password> for the club . . the @ in your email address is replaced by a %40 )Club Club
# urpmi.addmedia "club.club_x86-32_2006" https://bruno%40forum.com:PASSWORD@dl.mandriva.com/rpm/club/2006.0/i586/ with hdlist.cz
( Do not forget to replace "bruno%40forum.com:PASSWORD" which are the login: <bruno@forum.com> and the <password> for the club . . the @ in your email address is replaced by a %40 )Will be updated when there are more sources available . . . . !!:) BrunoIMPORTANT NOTESNOTE 1: If you add the sources today . . and you want to use them, let us say next week, you first have to update them because new packages might have been added, and old packages might have been removed . . . so each time before using them do "urpmi.update -a" as root in a console !!NOTE 2: Usually I only have the CD, Main and Contrib sources active all the time . . and only make all others active if I can not find the desired package looking in those 3 ( CD, Main and Contrib ) . . . . You will just get too many different versions of the same package if you have all the sources active all the time. Sticking to the native Mandriva ones is in general recommended !

#323 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 01 November 2005 - 02:02 PM

THE COMMAND "FILE"Here is a real short one, the command "file".This command can help to determine the type of file you are viewing. The file command performs 3 tests to check the file type: file system tests, magic number tests, and language tests. By default the magic number test is checked against the /usr/share/misc/file/magic.mgc or /usr/share/misc/file/magic but there are options to let it use another customized file. More about how exactly this command works and even a bit of history about this UNIX command existing since 1973 can be found by typing "man file"Here are a few examples, you will see the output on the second line:
$ file /etc/lilo.conf/etc/lilo.conf: ASCII text
Now if we add the -i option we sometimes get some more useful info ( uses another magic file ):
$ file -i /etc/lilo.conf/etc/lilo.conf: text/plain; charset=us-ascii
Or on another file:
$ file -i /usr/bin/top/usr/bin/top: application/x-executable, for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped
And another:
$ file -i /usr/bin/startkde/usr/bin/startkde: Bourne shell script text executable
A few alternative options, the -z option looks in compressed files:
$ file -iz /usr/share/man/bg/man1/apropos.1.bz2/usr/share/man/bg/man1/apropos.1.bz2: text/troff; charset=iso-8859-1 (application/x-bzip2)
The -s option for reading block or special character files
$ file -s /dev/hda10/dev/hda10: Linux rev 1.0 ext3 filesystem data (needs journal recovery)
The command "file" is not prefect, it only makes a guess of what the file is you are looking at: text, executable or data ( everything else ) . . . so still can be of good use.:'( Bruno

#324 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 08 November 2005 - 02:30 PM

FTP on the COMMANDLINEThere are multiple tools to do your FTP jobs in a GUI, but the Tips for Linux Explorers would not be complete if there was not a hint about how to use FTP on the command line.The basics of FTP on the command line are simple, you type the address, login, cd to the directory where the file is you want, and you type "get  <file_name>" and when the file is downloaded you type "bye" to close the connection.To show you that the FTP program is running your prompt will change to a special FTP prompt:ftp>Okay, let me show in an example how to download the D Small Linux ISO: "dsl-1.3.1.iso" using the commandline:We start with making a connection to ftp.nluug.nl, in the quote you will see in GREEN the text I typed and in GRAY the answer received:[quote][bruno:~]$ ftp -v ftp.nluug.nl Connected to ftp.nluug.nl.220-There are currently 183 users logged in (max 850).220-There are 50 extra sessions available for IPv6 clients220-This is an IPv4 session220-220-Welcome to the FTP archive of SURFnet BV and220-The Netherlands Unix Users Group (NLUUG).220-220-This server is located in The Netherlands, Europe.220-If you are abroad, please find an ftp site near you.220-Most information on this site is mirrored.220-220-Information about your login and any transfers you do are logged.220-If you don't like this, disconnect now.220-220-For statistics, see [url="http://ftp.surfnet.nl/.statistics/"]http://ftp.surfnet.nl/.statistics/[/url]220-Problems?  Mail ftpmirror-beheer @ surfnet.nl220-220-You may login as "ftp" or "anonymous".220-220530 Please login with USER and PASS.530 Please login with USER and PASS.KERBEROS_V4 rejected as an authentication type[/quote]Now we are asked to login and we will use the name "anonymous":[quote]Name (ftp.nluug.nl:bruno):  anonymous 331 Please specify the password.[/quote]And give a password ( in most cases your email address ):[quote]Password: ********230-230-================================================================230-Want to know where to find what data?  See the file230-                                        /pub/WhereToFindWhat.txt230-230-================================================================230-230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.[/quote]Now we get the FTP prompt and we can cd to the directory where the file is located: ( Note, next to the cd command also ls and pwd are commands known by FTP, but more about that later ):[quote]ftp> cd /pub/os/Linux/distr/damnsmall/current/ 250 Directory successfully changed.[/quote]Next we are going to download the file:[quote]ftp> get dsl-1.3.1.iso local: dsl-1.3.1.iso remote: dsl-1.3.1.iso200 PORT command successful. Consider using PASV.150 Opening BINARY mode data connection for dsl-1.3.1.iso (50745344 bytes).226 File send OK.50745344 bytes received in 1.5e+02 seconds (3.3e+02 Kbytes/s)[/quote]And after seeing "File send OK" you can close the connection and get your usual prompt back:[quote]ftp> bye 221 Goodbye.[bruno:~]$[/quote]See ? That was simple . . . . but sure you will want to know a bit more about FTP on the command line, like the command "put" to upload files, the command "bell" to have a signal when the file is finished downloading, or "hash" that prints # marks, one for each block of 1024 bytes recieved.If you want to see a full list of commands that your FTP program can handle just type a ? at the FTP prompt:[quote]ftp> ?[/quote]For more elaboration on FTP check out: [url="http://www.faqs.org/docs/Linux-mini/FTP.html"]http://www.faqs.org/docs/Linux-mini/FTP.html[/url]:icon8: Bruno

#325 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 15 November 2005 - 02:04 PM

ACCESS LINUX PARTITIONS FROM WINDOWSWe all know that you can easily access your Windows partitions from Linux, but that the other way around is a problem. There is good news for the dual-booters, Alphaomega sent me the next interesting note:

Quote

Have you ever needed to access a Linux ext2/ext3 Partition from Windows?You can with the help of Explore2fs !When I first started with Linux...I set up my machine to dual boot with Windows XP Home and Mandrake Linux 9.2...so just in case I had problems...I could still get into Windows.Well wouldn't you know it...I had problems being the noobie that I wasso I kept having to jump into Windows to get on-line and look stuff up.That is when I realized that I could not access my Linux partitions fromwithin Windows...until I found explore2fs. This utility allows you to accessyour Linux partitions from Windows. It has a explorer like interface and navigation is similar to that of Windows Explorer. I have used it in Windows98 SE and Windows XP Home and have not had any problems. I have notput the program to any heavy duty testing...just copying over a few files hereand there when the need arises and it has not given me any problems (YMMV so be sure to check out the ReadMe).For more information about Explore2fs see:http://uranus.it.swi.../explore2fs.htmCheersalphaomega
Note: Explore2fs works only for Ext2 and Ext3 partitions.  It is supposed to work in Win 9x, ME, NT4.0, 2000, XP and server 2003. You simply unzip the file in Windows and you are set up to browse your Linux partitions.Also I would like to point out that the program only provides "read" access . . . no "read/write" access.Thanks for the tip Omega !:D Bruno




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users