Jump to content


Tips for Linux Explorers


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

#276 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 10 November 2004 - 02:28 PM

PROBLEMATIC CANON PRINTERSMost Canon printers work painlessly in Linux and are automatically set up . . . some however do give  a few problems.Here are 2 ways people have been able to solve the problems:CASE 1: Canon BJC2555SP Printer connected to Parallel Port in SlackwareOur good friend David struggled his way through getting his Canon Parallel Printer working in Slackware. Here is his solution to 2 problems he encountered:

Quote

CUPS Parallel Port lp and Slackware - Linux.Slackware v10: To enable CUPS to recognize the Parallel Port 'lp' in this Distro you will need to edit the following file with a text-editor./etc/rc.d/rc.modules and go to the headers indicated here by the ####, and activate these two lines (Remove the red #) and 'Save'.

Quote

#### PC parallel port support #### # /sbin/modprobe parport_pc io=0x378 irq=7#### Parallel printer support #### /sbin/modprobe lp
Ensure the Printer is plugged-in and turned on, then re-boot. This should 'detect' both the port and the printer. You will still need to manually install the Printer drivers.Canon BJC255SP and Slackware - Linux.There is a lot of information on the Net that refers to the .pdd file Canon-BJC-255SP-bjc250gs.ppd as being suitable for for the above printer using Linux. I have found that NOT to be the case when activating the printer using Slackware CUPS.The .pdd file Canon-BJC-600-bjc600.ppd is used by Mandrake, SuSE and Yoper for the above printer, and I found it was also the suitable one for Slackware. But! it has to be imported into Slack using the CUPS 'other' option.If you need this .ppd file, you can try the link below, or find it in the /etc/cups/ppd directory of other Distros.http://www.linuxprinting.org/ Do NOT try to cut-&-paste these files as they have embedded Codes / Commands in them and they WILL be corrupted. Download them or copy to floppy if 'borrowing' them locally from another Distro.Edit:Also, don't be fooled by the name BJC-255SP being used by CUPS as the 'Installed' drivers. The Distro gets this title / name from 'reading' the printer BIOS and appends it to CUPS. And that is why it is sometimes confusing as to what .ppd file is the proper one to use for a particular Distro - Printer combination.
Thanks David, this should help a good few other penguins to get their printers to do the job. :DCASE 2: Printer Drivers for Canon i printers:You can get official Canon drivers for your i series printers here:ftp://download.canon.jp/pub/driver/bj/linux/You need the "bjfiltercups"-rpm and the matching "bjfilterpixusXXXi"-rpm ( where XXX is the model number of your printer and "pixus" is the way they call those printers only in Japan )When during install you get dependency problems relating to "libpopt.so.0" install the "popt" package and do
# ln -s /usr/lib/libpopt.so.1 /usr/lib/libpopt.so.0
And try the install again.When both packages are installed successfully you have to restart cups and set your printer up to use the new drivers.Source: linuxforen.de:ermm: BrunoPS: Debian packages for Canon printers: http://mambo.kuhp.ky...on-pixus25.htmlAlso, Ubuntu specific: Canon PIXMA IP4000 drivers ( and others ) http://ubuntuforums....ead.php?t=38995

#277 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 16 November 2004 - 03:09 PM

VOIP WITH KPHONE( FreeWorld DialUp with Kphone in Simply Mepis )Our good friend Striker has made a how-to for Free World DialUp and how to configure it with Kphone in Simply Mepis. Here is his contribution:

Striker, on Forum, said:

Assuming you've registered for an account at http://www.freeworlddialup.com (FWD), you'll have received an email with your new FWD telephone number. Now all that's left to do is configuring kPhone to be able to call and receive calls. In order to be able to do so, you'll need to adjust the configuration of your Guarddog firewall amongst others. Let's try to guide you through the necessary steps to set up kphone step by step. Step 1 In order to adjust the Guarddog firewall settings, open up a konsole as user and type the below code:  
 $ su < password> # guarddog
  The guarddog firewall application window opens now, head over to the tab shown in the screen shot below :. . . .Posted Image In order to be able to call and receive calls the Netmeeting - H.323 chat option needs to be checked. After you have checked the option box, click Apply : a new window will open asking for your confirmation, click Continue. Again a new window will open telling you the firewall rules were modified, simply click ok to dismiss that window. Now click ok in guarddogs' main window.  Back in the konsole, type two times the exit command to get out of the root mode and close the konsole as user:
 # exit $ blah blah blah $ exit
  Step 2 Open up kphone: if there's not an icon in the kmenu to be found, instead of searching for the program's icon, click on "Run command ..." in the kmenu, and type in "kphone" - without the quotes of course: kphone's little main window will then open. It looks like the screen shot below:. . . .Posted ImageDo not pin your self down yet as to what your kphone copy displays behind the sip: line, kphone isn't configured yet.   To configure it, in the kphone main window click  File > Identity ...  in the menu bar - see the screen shot below : . . . .Posted Image Now just fill in here all of your user credentials like you did when you registered for an account at FWD. Note : "your FWD number" consists of six numeric characters like 123456. The FWD number is what you'll have received in the email after registering with FWD.  When you're ready click ok. TIP : Your FWD telephone number actually consists of 2 parts : the picture below explains this.. . . .Posted ImageStep 3 Go to Preferences > SIP Preferences ...  in the menu bar. See the screen shot below left: . . . .Posted ImageCheck those settings! Click ok.Step 4 Go to Preferences > Audio preferences  ... in the menu bar : See the screen shot above right; check the settings: note the settings for Device for WriteOnly or ReadWrite. Click  ok.   Step 5 Go to Preferences > Video preferences ... in the menu bar Screen shot below :. . . .Posted ImageStep 6 KPhone is configured now: repeat the steps above and check your settings once again. By now, in kphone's main window, the line behind sip will be filled with something else, namely your FWD telephone number followed by @fwd.pulver.com;  Now plug in a microphone and a headphone: back in the main window of kphone, type in 612@fwd.pulver.com, in the address field, - screen shot below - and click the first icon to the right of the address/number field (left from the video camera) : a new window will pop up asking your password - so fill it in, your user name will already be filled in automatically. Click ok.  After a few seconds you'll hear the spoken time and date through your headphones. After that is completed, the connection will be cut off automatically.. . . .Posted ImageBack in the main window of kphone, instead of 612@fwd.pulver.com, type in 613@fwd.pulver.com, and click the first icon to the right of the address/number field again (left from the video camera), just like you did above; After a few seconds you'll hear a ringing tone: once the other side connects, you'll hear a message with instructions to test the echo cancellation mode.   Once the settings are to your liking, hit the Hangup button: screen shot below. You will be disconnected immediately.. . . .Posted ImageOnce these tests are over, you'll be ready to make your first real VoIP telephone call.  Happy FWD-ing / calling!
If you have problems, Striker will be happy to help you getting Kphone configured. Thanks a bundle for the clear howto Striker . . . :devil: Bruno

#278 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 01 December 2004 - 03:06 PM

EXTRA PREFERENCES in FIREFOX( With help from Neil - steeler fan for life )Since Firefox is the smaller offspring of Mozilla, many of Mozilla's cluttered menus and its UI for everything have been removed. However, the underlying settings are many times still available if you know how to get to them. We can do that via the URL about:configWhen you open about:config, you'll see a giant list of prefs. You could scroll through the whole thing, or you can use the Filter at the top (much easier). It updates live (each letter you type takes away non-relevant entries), so you don't have to type much to find prefs.Firefox mouse wheel to open links in tab and close tabs by clicking on it:Addressbar: about:configFilter: mouse
middlemouse.contentLoadURL			   value = false
To hide the UI for what is known as "Single Window Mode"Addresbar: about: configFilter:  browser.tabs
browser.tabs.showSingleWindowModePrefs		value = true
Max number of popups that can be loaded at any one timeAddressbar: about: configFilter: dom.popup
dom.popup_maximum					value = 10
SmoothScrollAddressbar: about: configFilter: smoothscroll
general.smoothScroll				  value = true
Online banking: ( Maybe only in Europe )Works on sites where you have to type in information ( more then only nickname and password )  to go to the next level.Make exception in pop-up blocker for the address of the bank ( in options, webfeatures )Addressbar: about: configFilter: cache
browser.cache.check_doc_frequency			 value = 1
Addressbar: about: configFilter: alive
network.http.keep-alive				 value = falsenetwork.http.proxy.keep-alive			  value = false
All prefs set in about:config take effect immediately (you don't even have to restart the browser !)Thanks to Neil for his input ! ( See also Here )>_< Bruno

#279 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 December 2004 - 03:07 PM

INSTALLING MANDRAKE 10.1 OFFICIAL( General instructions ) . . . . . * Due to limitations of the forum software this how-to is split over 2 posts First read erratum:  http://www.mandrakel.../en/errata.php3 - 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 )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 4G 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

#280 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 December 2004 - 03:08 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  12th screen: Adding a user ( again B) )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, 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: 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 :thumbsup: 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.Please read the NOTES at the bottom of this post :D BrunoIMPORTANT NOTES:1). EVOLUTION: If you replace your current Mandrake install and want to keep your mail and addresses in Evolution: Do NOT format your /home partition !!If you have no separate /home . . backup the evolution directory, and after the install place it in /home BEFORE starting evolution . . . the new directory will be called .evolution ( hidden ) and uses another format for mail and addresses . . . only the procedure above will start a script to transform mail and addresses to the new format. If you miss this chance to save your data, there is no way back. . . . . only starting the full install from scratch. 2). NVIDIA: There was a bug in the nvidia drivers ( version Linux-x86-1.0-6111-pkg1 ) regarding kernel 2.6.8 and up, BUT recently Nvidia released a new driver ( version Linux-x86-1.0-6629-pkg1 ) the install of it should no longer be a problem. See Announcementnew drivers and Tip Install Nvidia Drivers3). UPDATES: Update problems ? No updates available ? Have a look Here and Here ( 4th post ! )

#281 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 07 December 2004 - 03:08 PM

URPMI SOURCES MANDRAKE 10.1Want access to 100 GB extra software ??There are the new sources you can add to the package manager of Mandrake 10.1 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 --> 'RpmDrake helps you 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.nluug.nl_i586_10.1Official ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrakelinux/official/10.1/i586/media/contrib/ with ./media_info/hdlist.cz
PLF:
urpmi.addmedia plfplf ftp://ftp.proxad.net/pub/Distributions_Linux/plf/mandrake/10.1/ with hdlist.cz
You do need Contrib ( not club-contrib ) for PLF to work properly ;)Thacs: ( Music instruments ! )
urpmi.addmedia thacs.rpms http://rpm.nyvalls.se/10.1/RPMS with hdlist.cz
Club-contrib:
urpmi.addmedia club.contrib_ftp.uni-bayreuth.de_i586_10.1Official ftp://ftp.uni-bayreuth.de/pub/linux/Mandrakelinux/devel/testing/Mandrakeclub/10.1/i586 with hdlist.cz
Java packages:
urpmi.addmedia jpackage_ftp.nluug.nl_i586_10.1Official ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrakelinux/official/10.1/i586/media/jpackage/ with ./media_info/hdlist.cz
Eslrahc: Link
urpmi.addmedia eslrahc http://www.eslrahc.com/10.1/ with hdlist.cz
Norlug: Link
urpmi.addmedia NORLUG-10.1 http://mirror.datapipe.net/norlug/mandrake-10.1/RPMS/  with hdlist.cz
More small ones: http://www.thebrix.org.uk/ONLY CLUB-MEMBERS:Club-Commercial:
urpmi.addmedia club.comm_i586_10.1Official http://NICKNAME:PASSWORD@www.mandrakeclub.com/downloads2/comm/10.1/i586/ with ./media_info/hdlist.cz
( replace "NICKNAME" and "PASSWORD" ) Club-Testing: ( Be Careful With These !! )
urpmi.addmedia testing_i586_10.1Official http://NICKNAME:PASSWORD@www.mandrakeclub.com/downloads2/test/10.1 with hdlist.cz
( replace "NICKNAME" and "PASSWORD" ) B) 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: So again the warning: Mainly I only have the CD and Contrib source active all the time . . and only make all others active if I can not find the package I look for in those two ( CD and Contrib ) . . . . also you will get just too many different versions of the same package if you use all the sources at the same time, and sticking to the native Mandrake ones is recommended !  DISCLAIMER: It is still very early in the release . . so things might change or not yet work 100% . . . please let me know so I can adapt the info.

#282 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 14 December 2004 - 03:27 PM

THE FIND COMMANDSometimes there are tips that should have been posted long ago, but because they are less simple to explain, I never did find the time to set them up properly.This one I found hanging around in my Pre-Tip directory for a long time, and today it is time to finally pick it up.The "find" command is a command we use next to other commands like "locate" ( or "slocate" ) and "whereis" but it has a good few extra options we can use with it.We can use "find" with a wild card ( * ), but it works best when we know the name of the file or directory we are looking for. ( NOTE: * does not replace a dot, so you can do "lilo.*"  but not "lilo*" to find lilo.conf )My advice is, read the text and experiment a bit to see how it works for you.Okay, let's go for it, first step:
$ find -type f -name dummy
This is the basic way to use "find". If no path is given, it looks in the present directory and its subdirectories. Then we use the "-type f" to tell find it we are looking for a file ( f ) directory ( d ) or link ( l ) after that "-name dummy" to tell it we are looking for a file with the name "dummy"  ( with wildcard "-name *ummy?" ).You will see it will find the answer:

Quote

./.kde/share/config/dummy
One step up:
$ find / -type f -name dummy 2>/dev/null
This time "find" not only searches the local directory, because the first argument we give it has to look in "/" ( the complete filesystem . . . . so that takes a while ) and because we give the command as "normal user" and not as root it would lead to a lot of "permission denied" messages if we did not add the last bit "2>/dev/null"  ( See: The black hole  )On my Mandrake install the answer to this command is:

Quote

/home/bruno/.kde/share/config/dummy/usr/share/mdk/kde/root-interface/dummy
Another step up:
$ find / -type f -name dummy 2>/dev/null -exec cat {} \;
This time it  does all  the previous,  but at the end of the command you see "-exec cat {} \;"  . . . this means "-exec" execute the next command "cat" on the results found from the find command "{}" . . . . the "\;" means that the exec command ends there.Again on my system the result is:

Quote

[$Version]update_info=kio_help.upd:kde3_2,favicons.upd:kde3_2
Now the final step up:
$ find / -type f -name dummy 2>/dev/null -exec cat {} \; >tesst.txt
Also, this time it has all the things listed above, but I added ">tesst.txt, which tells it to  ">"  write them in a file called "tesst.txt" instead. ( And not put the output on the screen )So if you do not know where your lilo.conf file is located, but you want a copy of it for reading in your home directory, here is what you do:
$ find / -type f -name lilo.conf 2>/dev/null -exec cat {} \; >lilo.txt
And you will find a file called lilo.txt in your /home directory ;)And because I know you want to know more, here is the FUN step:
$ find /home -type f -name "*.sxw" -atime -3 -user bruno
Here we "find" in "/home" all "-type f files with the "-name"  "*.sxw" so all OpenOffice sxw documents that "-atime -3" have been accessed in the last 3 days ( "-atime +3" would be: have NOT been accessed ) and that are owned by the "-user bruno" ( So basically: has anyone been messing with my files in the last 3 days ?? :hmm:  ) Additional tip: if you look for *.sxw, type "*.sxw" same goes for "*.txt", "*.doc" etc.etc. Well, that is it for today, if you want to know even more, have a look at: man find:w00t: Bruno

#283 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 21 December 2004 - 02:39 PM

SOUNDCHECK SCRIPT( Revised version 01-23-2005 )It is already a while back that Owyn wrote us a really nice script to troubleshoot sound issues on our forum. It is only today that I noticed it never actually was  posted in the Tips   . . . . so today we will make up for it !The script does work on most distros, but there might be parts that will not return output because that particular distro does not recognize a line in the script.Here is what to do to run the script:1). The first command:
$ kwrite sound.sh
This will open a window with a blank file . . . .2). Next copy and paste the following text in that empty file:
#!/bin/sh# soundchk.sh# Rev 1.00 2003-10-13 Initial Release - Mandrake 9.1 specific# Rev 1.01 2003-10-13 Added Checking Devices#					 Added grep steps to restrict output. Really needed for Knoppix.#					 Add file exists tests to find correct tools#					 Completed port to Knoppix 3.3. Should also be much better for UNKNOWN.# Rev 1.02 2003-10-14 Added test -x for aumix#					 Fix bug in lspci greps# Rev 1.03 2003-11-24 Add additional tests from alsa aadebug script# Rev 1.04 2003-11-25 Fix typo in 1.03 lspci grep#					 Add check for artsd#					 Add check for using cdrom# Rev 1.05 2005-01-22 Adapted to udev and kernel 2.6 by Bruno# Rev 1.06 2005-01-23 Adapted by Bruno to better suit SUSE and Slackware# Rev 1.07 2005-01-23 Added a bit of interactivity at the end --Bruno# Rev 1.08 2005-01-23 Adapted chkconfig to suit SUSE --Brunoechoecho "soundchk.sh v1.08 - Running Sound Configuration Checks"echoecho# time and userdate=$(date)echo "Today is $date"me=$(whoami)echo "Sound tested by $me"echoechoecho "== Identifying System =="uname -s -r -v -p -ocat /proc/cpuinfo | grep -i "model name"cat /proc/cpuinfo | grep -i "cpu mhz"cat /proc/meminfo | grep -i memtotalcat /proc/meminfo | grep -i swaptotalechoecho "== Checking dsp devices =="ls -l /dev | egrep -i dsp\|soundechoecho "== Checking mixer devices =="ls -l /dev | egrep -i dsp\|mixerechoecho "== Checking Knotify =="cat ~/.kde/share/config/knotifyrc# adapted to suit SUSE and Slackechoecho "== Checking Driver ==" if test -f /usr/bin/lspcidrakethen /usr/bin/lspcidrake -v | egrep -i "(audio|multimedia|host bridge)"elif test -f /sbin/lspcithen /sbin/lspci -v | egrep -i "(audio|multimedia|host bridge)"elif test -f /bin/lspcithen /sbin/lspci -v | egrep -i "(audio|multimedia|host bridge)"elif test -f /usr/bin/lspcithen /usr/bin/lspci -v | egrep -i "(audio|multimedia|host bridge)"elseecho "==> Test not available on this system !"fiechoecho "== Checking Actual Driver in Use (/etc/modules.conf) kernel 2.4 =="if test -f /etc/modules.conf; then	 cat /etc/modules.conf | egrep -i snd\|soundelse	 echo "==> Test not available on this system !"fi# added for kernel 2.6 by Brunoechoecho "== Checking Actual Driver in Use (/etc/modprobe.conf) kernel 2.6 =="if test -f /etc/modprobe.conf; then	 cat /etc/modprobe.conf | egrep -i snd\|soundelse	 echo "==> Test not available on this system !"fiif test -d /dev/snd; then	 echo	 echo "== Checking alsa /dev/snd =="	 ls --color=none /dev/sndfiechoecho "== Checking if Module Loaded =="/sbin/lsmod | egrep -i snd\|sound\|audio\|gameecho if test -x /sbin/chkconfig; then	 echo "== Checking in what level Sound service is configured to run =="	 /sbin/chkconfig --list sound	 echo	 echo "== Checking in what level Alsa service is configured to run =="	 /sbin/chkconfig --list alsa	 echo	 echo "== Checking in what level AlsaSound is configured to run ( Only SUSE !! ) =="	 /sbin/chkconfig --list alsasoundelse	 echo "==> Test for run levels not available on this system !"fiechoecho "== Checking if Sound Volume muted =="if test -x /usr/bin/aumix; then	 aumix -qelse	 echo "==> Test not available on this system !"fiechoecho "== Checking artsd setup =="ps -A -f | grep -i artsd | grep -v grepechoecho "== Checking which program uses the sound card or cdrom =="echo "				(no output is okay)"if test -x /sbin/fuser; then	 /sbin/fuser -v /dev/dsp	 /sbin/fuser -v /dev/cdromelse	 /bin/fuser -v /dev/dsp	 /bin/fuser -v /dev/cdromfi# Extra test added by Brunoechoecho "== Test wav file . . . . . please wait =="# test on SUSEif test -f /opt/kde3/share/sounds/KDE_Startup.wav then /usr/bin/play /opt/kde3/share/sounds/KDE_Startup.wav# test on Slackwareelif test -f /opt/kde/share/sounds/KDE_Startup.wav  then  /usr/bin/play /opt/kde/share/sounds/KDE_Startup.wav# test on Mandrake, Fedora and PCloselif test -f /usr/share/sounds/KDE_Startup.wav  then  /usr/bin/play /usr/share/sounds/KDE_Startup.wav else  echo "==> Test not available on this system !"fi# Interactive partecho -n "Did you hear the soundfile Yes/No ?:"read answer# the user did not enter anything:while [ -z "$answer" ]; doecho "You did not tell me Yes or No !!!"echo -n "Did you hear the soundfile Yes/No ?:"read answerdoneecho "You typed:  $answer   Thanks !"sleep 2echoecho "== End of Checks;-)"echo
3). Now save the file ( File --> Save ) and close the kwrite window.4). Next another command:
$ chmod 755 sound.sh
. . . it will look like nothing happens, this is okay.5). And the last command is:
$ ./sound.sh
. . . now the script is running and will print the output to screen. ( Don't forget the dot before the slash in the command ! )6). You can use the output of the script to post on the forum where you go to solve your Linux related problems.The script has proven to be very useful in the past, so in case of sound related problems: just run the script and post the results.;) Bruno

#284 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 28 December 2004 - 02:19 PM

Ctrl+C ( Stop Processing Command ) It's the holidays, so here is an Ultra short, but no less important tip:Imagine you just typed in a command and hit the Enter-key . . . andsuddenly you realized it was the wrong command and it is copying the fullhda8 partition into a plugins directory . . . how do we stop the commandfrom processing ?? Crtl+C And the command will stop its insane work instantly . . . . sure a bunchof files will already have been copied, but you do not have to wait thefull 15 minutes until it has finished. Any command given in the terminal can be stopped like this, a search forrootkits, a virus scan, updatedb . .you name it, all things that takelong enough to give you time to think . . and say "Ouch ! I did itwrong, I have to stop this !" :thumbsup:  :) Bruno

#285 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 04 January 2005 - 02:53 PM

FIND AND REPLACE with SEDLet us start off simple:Imagine you have a large file ( txt, php, html, anything ) and you want to replace all the words "ugly" with "beautiful" because you just met your old friend Sue again and she/he is coming over for a visit.This is the command:
$ sed -i 's/ugly/beautiful/g' /home/bruno/old-friends/sue.txt
Well, that command speaks for itself "sed" edits "-i in place ( on the spot ) and replaces the word "ugly with "beautiful" in the file "/home/bruno/old-friends/sue.txt"Now, here comes the real magic:Imagine you have a whole lot of files in a directory ( all about Sue ) and you want the same command to do all those files in one go because she/he is standing right at the door . . Remember the find  command ? We will combine the two:
$ find /home/bruno/old-friends -type f -exec sed -i 's/ugly/beautiful/g' {} \;
Sure in combination with the find command you can do all kind of nice tricks, even if you don't remember where the files are located !Aditionally I did find a little script on the net for if you often have to find and replace multiple files at once:
#!/bin/bash for fl in *.php; do mv $fl $fl.old sed 's/FINDSTRING/REPLACESTRING/g' $fl.old > $fl rm -f $fl.old done
just replace the "*.php", "FINDSTRING" and "REPLACESTRING" make it executable and you are set.I changed a www address in 183 .html files in one go with this little script . . . but note that you have to use "escape-signs" ( \ ) if there are slashes in the text you want to replace, so as an example: 's/www.search.yahoo.com\/images/www.google.com\/linux/g' to change www.search.yahoo.com/images to www.google.com/linuxFor the lovers of perl I also found this one:
# perl -e "s/old_string/new_string/g;" -pi.save $(find DirectoryName -type f)
But it leaves "traces", e.g it backs up the old file with a .save extension  . . . so is not really effective when Sue comes around ;-/:( Bruno

#286 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 11 January 2005 - 03:00 PM

SPAMASSASSIN TWEAKSI am very satisfied with the integration of Spamassassin in Evolution, it does a really good job and detects 95 to 97 % of the 100+ spams idiots send to me.But, there are some spammers that are getting clever, ( mainly they offer bogus Rolex watches and Cialis ) and they keep finding new ways to fool Spamassassin pretending they are regular text mails.Sure you can train Spamassassin to recognize those too, but the spammers seem to know that and keep finding ways around.With this little tweak below I managed to bring the effectiveness up to 99% and when a new product comes up I just update the file with a section of 3 lines and that brings back the smile to my face.This is the file to add the sections:/etc/mail/spamassassin/local.cfAnd here is how I composed them, you will see that the actual word is there 4 times in 3 lines, 3 times in CAPITAL characters preceeded with MM and closed with 2. And one time between slashes and an i.5.0 is the score that marks it as junk, I gave the last 2 a 3.5 because " pharmacy" and "medicines" are words that can be in regular mails too, only the chance of them being together is the biggest in spam.
# MM ADDED BY BRUNO NOV 2004body  MMVIAGRA2   /viagra/idescribe  MMVIAGRA2  mmrulescore  MMVIAGRA2  5.0body  MMVICODIN2   /vicodin/idescribe  MMVICODIN2  mmrulescore  MMVICODIN2  5.0body  MMPRESCRIPTION   /prescription/idescribe  MMPRESCRIPTION  mmrulescore  MMPRESCRIPTION  3.0body  MMCIALIS2   /cialis/idescribe  MMCIALIS2  mmrulescore  MMCIALIS2  5.0body  MMROLEX2   /rolex/idescribe  MMROLEX2  mmrulescore  MMROLEX2  5.0body  MMLEVITRA2   /levitra/idescribe MMLEVITRA2  mmrulescore  MMLEVITRA2 5.0body  MMVIOXX2   /vioxx/idescribe MMVIOXX2  mmrulescore  MMVIOXX2 5.0body  MMVALIUM2   /valium/idescribe  MMVALIUM2 mmrulescore  MMVALIUM2 5.0body  MMPHARMACY2   /pharmacy/idescribe  MMPHARMACY2 mmrulescore  MMPHARMACY2  3.5body   MMMEDICINES2	 /medicines/idescribe	MMMEDICINES2  mmrulescore	MMMEDICINES2  3.5body   MMSOFTABS2	 /softabs/idescribe  MMSOFTABS2   mmrulescore	MMSOFTABS2  5.0body   MMMICROCAP2	 /microcap/idescribe	MMMICROCAP2  mmrulescore	MMMICROCAP2  5.0body   MMSMALL-CAP2	 /small-cap/idescribe	MMSMALL-CAP2  mmrulescore	MMSMALL-CAP2   5.0body   MMSMALLCAP	 /smallcap/idescribe	MMSMALLCAP2  mmrulescore	MMSMALLCAP2   5.0body   MMTRADERS2	 /traders/idescribe	MMTRADERSS2  mmrulescore	MMTRADERS2   3.5body   MMEJACULATION2	 /ejaculation/idescribe	MMEJACULATION2  mmrulescore	MMEJACULATION2  5.0
Additionally I found another little tweak on the PCLos forum, posted by Yama HereIt seems that if you add:
score MICROSOFT_EXECUTABLE 5.0
Mails with an MS executable as attachment will be seen as spam too !Somehow the virus writers seem to have me scratched from their mailing list because I have not received one in a long time . . . so I have not been able to verify this one. ;):P Bruno

#287 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 18 January 2005 - 02:18 PM

LOST URPMI DISTRIBUTION SOURCES( Mandrake )Imagine all your software sources are gone, all CD's removed from the packet manager in the MCC ( or corrupted ). Here is an easy trick to add them all in one go:If there are still some sources left and you want to remove those first so you can have a fresh start:
# urpmi.removemedia -a
If you still have the CD's and want to add those: ( Put CD 1 in the CD-ROM )
# urpmi.addmedia --distrib cd- removable://mnt/cdrom/
If you have no CD's you can add the FTP sources for the distribution:
# urpmi.addmedia --distrib nluug- ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrake/official/10.1/i586/
It will automatically add all the available media . . . . and get the correct paths to the hdlists !If you are on dial-up you may prefer the synthesis-hdlist to the normal hdlist because it takes less time to download:  
 # urpmi.addmedia --distrib --probe-synthesis --wget nluug- ftp://ftp.nluug.nl/pub/os/Linux/distr/Mandrake/official/10.1/i586/
( The --wget option is a personal preference, I use it to give priority to wget over curl to get the hdlists ) :P BrunoRELATED:The tip on how to use the the urpmi sources:Installing software URPMI How to add additional software sources, and a complete list of sources:URPMI Sources in Mandrake 9.2 URPMI Sources in Mandrake 10.0 Official URPMI Sources in Mandrake 10.1 Official And also important, how to keep your sources up to date:Updating your urpmi-sources

#288 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 25 January 2005 - 02:36 PM

INITSCRIPT SERVICES ( chkconfig )And how to turn them on, off, start, stop or restartA lot of services are started at boot with the initscripts. There is a way to see what service is started in what run-level, a way to start and stop a service temporary from the commandline, and a way to make a service to run on or stay off at boot.Let us first see what services there are and in what level they are started:
# chkconfig --list
This gives you the full list.Now we know all the services we have 4 commands that are useful ( let us take "numlock" as an example ):
# service numlock stop# service numlock start# service numlock restart# service numlock status
The first command will stop a service temporary until the next time you reboot. The second one will start it, also until the next reboot. The third command speaks for itself. Now you want to stop a service, but you also want to prevent it from being started the next time you boot:
# service numlock stop# chkconfig numlock off
Or the other way around, you want to start a service that is not running and make sure it will be up running next time you reboot:
# service numlock start# chkconfig numlock on
NOTE: The first command is "service", but the second one ( with the off and on argument ) is "chkconfig" !! Next time you want to service your car, remember how easy and effortless that was in Linux !:rolleyes: Bruno

#289 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 01 February 2005 - 02:08 PM

PARTITIONING TOOLS  ( And which ones not to use )Our good friend Striker sent me some very useful info about partitioning tools. I copied the full text here so we can learn from it:

Striker, on Forum 2004, said:

What's the difference between partitioning your drive with Windows applications and partitioning with Linux applications when preparing the drive for installing Linux ?"Let us take a hard disk drive and install Linux on it", isn't that something you said to yourself sometime ago ? Or something similar like "I've got this spare hard disk drive and there are so many distros around, let's set up something in Linux"? Well, sooner or later you will have to partition the drive in question to be able to install any Linux flavor on it. That brings us to the next question: "Which application to use for that". In the windows territory there are many applications that will do it for you with a couple of mouse clicks, with or without graphical interface. "Hey, come to think of that? there's a partitioner in windows XP, really good looking and it works, and I also have partition magic laying around. Everybody uses this, so Linux partitioning will be an easy one!" Or maybe not so easy?I have heard something like the above scenario too on more than one occasion, almost always after I was called due to problems with the system in question. And after I asked how they did the partitioning, either one or the other non-Linux application was used to do the job of partitioning. When I asked why they used that and not the default Linux partitioner which comes with every distro nowadays, the answer was something like "because it was easier"?So in order to set things straight for once and for all, I experimented with this back home, and I hereby present you some results / observations.For this I used a completely new, brand named hard disk drive to install Linux on, along with an in-use hard disk drive, same brand, same type, same capacity. On the first drive there were 4 partitions, C-D-E and F, all windows partitions with a FAT32 file system. In the machine were also 2 floppy drives, A and B, and also a CD writer drive G and a CD player drive H. After the second hard disk drive was in the machine, I used partition magic to create the necessary partitions on it for Linux to be installed. That was no problem at all, Linux got installed and ran well for a couple of weeks. Then the problems started, first in Windows: Partition Magic has an application you can install for viewing the partitions, which I did install. This gem started to complain about detecting some cylinders not starting at their appropriate place and asked if it was allowed to correct things. Well that sounded alarming enough so I said yes, do it. Well, the machine just started and no further problems were encountered? until the next start the following morning. Then the same question appeared on the screen. This went on and on, day after day ?.Then one day, the Linux distro I had installed wouldn't even boot: especially for this experiment I didn't do any updates and I didn't even install one extra package: the distro was there just like I installed it a few weeks ago. "So what the heck is going on here, it's getting weird now" I spoke to myself, not knowing what was the actual culprit. I even made a second boot disk, like I always did: using the second boot disk I was not able to boot Linux either.Second attempt: Using Windows XP partitionerI decided to do a complete reinstall: after Windows XP was up 'n running again on drive C:\, I used XP's Disk Management partitioner to repartition the second hard disk drive and do a reinstall of Linux. While installing Linux, I formatted the drive to reiserfs. So I partitioned in Windows and formatted in Linux. While installing Linux, I encountered several difficulties, amongst others, the partitions where recognized the wrong way. See below for the fstab file./dev/hdd6 / reiserfs defaults 1 1/dev/hdd2 /data1 auto noauto,user 0 0/dev/hda1 /windows/C vfat users,gid=users,umask=0002,iocharset=iso 08859-1,code=437 0 0/dev/hdd1 /windows/D vfat users,gid=users,umask=0002,iocharset=iso 08859-1,code=437 0 0/dev/hda5 /windows/F vfat users,gid=users,umask=0002,iocharset=iso 08859-1,code=437 0 0/dev/hda6 /windows/G vfat users,gid=users,umask=0002,iocharset=iso 08859-1,code=437 0 0/dev/hda7 /windows/H vfat users,gid=users,umask=0002,iocharset=iso 08859-1,code=437 0 0/dev/hdd3 swap swap pri=42 0 0/dev/hdd5 swap swap pri=42 0 0devpts /dev/pts devpts mode=0620,gid=5 0 0proc /proc proc defaults 0 0usbdevfs /proc/bus/usb usbdevfs noauto 0 0/dev/cdrecorder /media/cdrecorder auto ro,noauto,user,exec 0 0/dev/cdrom /media/cdrom auto ro,noauto,user,exec 0 0/dev/fd0 /media/floppy auto noauto,user,sync 0 0/dev/fd1 /media/floppy1 auto noauto,user,sync 0 0To make this a little more understandable, below is what actually was in the machine and how it should have been recognized: compare it to the markings in red above./dev/hda1 windows C/dev/hda5 windows D (volume name = data1)/dev/hda6 windows E (volume name = data2)/dev/hda7 windows F (volume name = storage)/dev/cdrecorder was actually the cd writer drive G/dev/cdrom was actually the cd player drive HThe comparison above shows a real mess.As you can clearly see from the above, partitioning with a non-Linux partitioner may result in mis recognizing the partitions which result in all the weird behavior mentioned in the first paragraph. Again, after a few weeks there were some problems encountered, one of them not being able (again!) to boot Linux.The right way: Partitioning in Linux for Linux setups"I've had it, throw this thing out of the window " you might think or something similar, but why not do it the right way for once and for all, what is the right way?" I took the opportunity to do a complete reinstall again. Remember, it was an experiment? (I never had the intention to throw a machine out of the window for real, but okay ? sometimes it's tempting ! )To make a long story short, I reinstalled Linux after I decided to partition the second hard disk drive using the Linux installer. Therefore I tested cfdisk to do the partitioning, and a second time I used Mandrakes partitioner while I was installing a multi boot environment on a different machine.To my own surprise all partitions got recognized okay in all distro's I attempted to install, including the CD drives. I loaded the machine with 6 different distro's, updated them, installed extra packages, no problem to this today: I'm using this set up now for more than a few months. No more hiccups, no more not-booting-Linux, just "using" Linux and ? it's a multi-boot environment ? Windows. Let's put one and one together: I did my partitioning for the Windows environment (remember those 4 partitions?) with DOS fdisk, then installed Windows on the hard disk drive.For Linux I used a second hard disk drive on which I used Mandrakes disk partitioner to do the partitioning, but I could have used cfdisk too.That left me with a usable Windows and Linux : if I would have partitioned the Linux drive again with anything else than a Linux partitioner, I would have created a mess like above again.
Thanks a bundle for this elaborate info Striker !So what partitioning tools can we recommend ?? ( in order of pure personal preference )1) Diskdrake ( The default Mandrake tool, by far superior and easy to use even for people that never came close to a partition before )2) fdisk ( commandline tool for the more advanced, but still very intuitive )3) Diskdruid ( The RedHat partition tool )4) QTParted ( GNU clone of Partition Magic, the tools from SUSE, RedHat and PCLos are based on this )5) Yast ( the SUSE partition tool )6) Qparted ( the non-GUI brother of QTParted, I would go for fdisk myself )You see there are plenty of tools . . . so, again,  please use a Linux tool to make Linux partitions !!:thumbsup: Bruno

#290 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 08 February 2005 - 02:04 PM

SYSTEM-NOTIFICATIONS FAILUREIf you do have sound from the multimedia players, but no system notifications.  ( maybe even an ARts errormessage at boot )Here is what you can do to . . . as user . . not as root, ( so no "su" )
$ kwrite ~/.kde/share/config/knotifyrc
That will open a file where you see text . . compare it and make it 100% the same as:

Quote

[Misc] LastConfiguredApp=KDE System Notifications  [StartProgress] Arts Init=true KNotify Init=true Use Arts=true
Then log out and back in and you should have sound from your system notifications.BUT: If even that did not help, try this: on the system-notifications GUI in the KDE Control Center --> Look & Feel there is a button "Player Settings" where you can set an external player . .  . set it to "/usr/bin/play" and test a sound-event. In most cases this will work :D( In Debian you will need to have "sox" installed for /usr/bin/play ):thumbsup: Bruno

#291 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 15 February 2005 - 03:46 PM

SPEED UP OPENOFFICEBecause there are days we all are in a hurry, here is a real short one that will save you time ;)If you have sufficient memory on your computer you can increase the speed of OpenOffice by tweaking the memory settings:Go to: Tools --> Options --> Memory Set the "Graphics Cache" to 128 MB and "Memory Per Object" to 24.0 MB( Source: http://www.desktop-l...Ospeedtweak.htm ):thumbsup: Bruno

#292 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 22 February 2005 - 02:14 PM

WIFI SUPPORT ( In Mandrake and PC Los )After her recent struggles to get the wifi configured on her new laptop, Julia ( nickname "teacher" ) wrote us down a few very handy tips and useful links:

Julia, on Forum 2005, said:

Doing wireless is not easy at all in Linux. :blink: If your card is not on the list, it may not work without hours of work or at all. :( The first thing to do is go to the Mandrake/Master Control Center and look at your hardware. At the very bottom of the list you will find a listing of the driver that Linux uses for it. That is the best clue on how to proceed. If you have your router set up for WEP then I would put it at Managed (non-encrypted) until you know what to do next.1.Start menu -> Configure Your Computer --> Mandrake Control Center --> Hardware tab --> Hardware.2. Look for your WiFi unit. If it is not there then you will have to look at something different. In Mandrake it should be under the heading "Ethernet".3.If there, click on your unit and look down to the bottom where you will see the heading on the right of Misc. Under Misc. it should list Module. That module will be the driver you look for on the Run Config Tool in the next step.4.At the lower right you will see Configure Module and Run Config Tool. Click on the bottom right button labeled Run Config Tool. 5.Select wireless on the new menu.6. At the next screen select a driver and scroll down and look for the one you found and select it.7.If it asks for more options if necessary just move on or fill in what you know.8. If you get the option to put in a user name and WEP key, fill in what you do use (I identify my laptop as "laptop" ) 9. If it takes you back out to start over we will have to do some more research. Try again before you give up. ;)10. If it finishes, reboot your computer (don't just log out of your user as it suggests) and see what happens.11.If it works celebrate as you just had one of the easiest installs for WiFi in Linux.If this did not work do not worry -- all is not lost. Sometimes it takes several times to get it to work. If you have your router set up for WEP encryption, try to remove that on your router console before trying again. You can add that back in after you get a connection.If your wireless card just will not work, do not give up hope. You can pick up different WiFi cards fairly inexpensively. Further, you can look for a bargain card. A USB WiFi connection is supposed to be harder to install, but that is what I use as my internal card just will not configure.Some important links, contributed by Jeber and others:An ATL thread on installing Wifi.Drake 10.1 and D-Link productsLinux Wireless networkingAbsoluteValueSystems They have some excellent scripts that help here as well (wlancfg).
This was part 1 . . we will have a part 2 and 3 soon if / when we can get Julia to tell more about her secrets and adventures with WiFi ;) . . . . Thanks Julia !B) Bruno

Quote

NOTE: Ivan reported us that for people on WiFi using PCLos 8.1 and 8.1a . . . . . you might want to stop the Shorewall firewall that is started by default, because it seems that if you have eth0 and eth1 ( 2 NICs ) and the wlan card is on eth1 all traffic on eth1 gets blocked.To stop shorewall give the following command as root: "service shorewall stop" . . . .or open the MCC --> System --> Services and press the "stop" button there for Shorewall.


#293 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 01 March 2005 - 02:24 PM

NDISWRAPPER( Installing Windows Wireless Drivers in Linux )Here is the second Wireless Networking Tip from Julia aka Teacher. If you have a card that is not supported under Linux, this is one way you can get it working with the Windows drivers. It will not give you the full 100% download speed, but still, it is better then not being connected at all.

Julia, on Forum 2005, said:

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.  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 from Linux.Ndiswrapper does not work with old kernels.  You must be running at least a 2.4 or higher kernel.  You will also need a package called Wireless Tools installed.  This comes with most distributions and is there ready for you to install it.  1.Install Wireless Tools through your control center of your distro.2.Obtain your copy of ndiswrapper and wireless tools.  If it is available through your distribution then go ahead and install it that way.  If not download the latest from ndiswrapper on SourceForge.Extract the file with:
$ tar zxvf ndiswrapper-1.0.tar.gz$ cd ndiswrapper-1.0$ su<password># make# make install
3.  Now that you have your ndiswrapper and your wireless tools installed, you are ready to get down to business:
# ndiswrapper -i (name of your file).inf# ndiswrapper -l
This should give you a printout like this:
[root@localhost julia]# ndiswrapper -lInstalled ndis drivers:netasag driver present, hardware present
Now you are ready to continue.  4.Next it is time to probe for  your ndiswrapper.  It should just continue without any messages.  If so, you will then continue to the next step:
# modprobe ndiswrapper# iwconfig
This will give you a printout like this:
lo		no wireless extensions.eth0	  no wireless extensions.eth1	  no wireless extensions.sit0	  no wireless extensions.wlan0	 IEEE 802.11g  ESSID:"YourNetworkname"  Nickname:"localhost"		  Mode:Managed  Frequency:2.412 GHz  Access Point: 00:00:00:00:00:00		  Bit Rate=54 Mb/s		  Encryption key:off		  Link Quality:22/100  Signal level:-93 dBm  Noise level:-256 dBm		  Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0		  Tx excessive retries:0  Invalid misc:0   Missed beacon:0
With this you can continue with
# iwlist wlan0 scan
This will give you all the details  to show it is working.  Here is mine:
wlan0	 Scan completed :		  Cell 01 - Address: 00:0F:3D:5A:95:BC					ESSID:"XXXXXX"					Protocol:IEEE 802.11g					Mode:Managed					Frequency:2.437 GHz (Channel 6)					Quality:0/100  Signal level:-50 dBm  Noise level:-256 dBm					Encryption key:off					Bit Rate:1 Mb/s		  ......					Bit Rate:54 Mb/s					Extra:bcn_int=100					Extra:atim=0
You can see that I have an ESSID of XXXXXX and am using Channel 6.  Managed means I am not running WEP at the moment. If you are then you will need to tell it "open" rather than managed.   You will take the information from this printout to do your configuration:
# iwconfig wlan0 mode Managed (or Open or Shared if using WEP)# iwconfig wlan0 key restricted XXXXXXXXXX (if using wep this is where you tell it your key)# iwconfig wlan0 essid YourNetworkName [code]Now that you have it configured you have just a few things left to do.;)You will need to do one of the following three commands.  You might have to do trial and error.  For me in mandrake it was dhclient wlan0 (which of course was the last I tried. :D  The choices are:[code]# ifconfig wlan0 up# dhclient wlan0# dhcpcd wlan0
If that worked you are now ready to tell it to load it automatically each time you boot up.  
# ndiswrapper -m
In most cases it will finish by saying "Adding "alias wlan0 to ndiswrapper" to /etc/modprobe.conf".  Happy wireless browsing. :)
Julia has more wireless tricks up her sleeve and even some that can give a better connection than this hack with the Windows drivers . . . but more about that next time in the next episode of Wireless Networking.Thanks Teach !:thumbsdown: BrunoPS: Here is an interesting link with a list of cards known to work with ndiswrapper

#294 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 08 March 2005 - 02:02 PM

CONFIGURING USB WIRELESS(  When All Else Fails )Here is another trick from Julia aka teacher. If you can not get your regular wifi card configured get a cheap $10 USB wireless adapter and configure that one. ( The next tip will show you what brands are best for this )

Julia, on Forum 2005, said:

If everything else has failed you will want to take a look at thisscript and adapt it to fit your installation.  It just might be the answer to your wireless woes.  This wlan script will run through the various settings to make sure everything is correct.  If it stops after a specific step, then go back and look at how you have that step configured.  Keep in mind that if you are running encrypted you will set your wep attributes to true and false if you are not.  Remember that the default SSID is "Default".  I use a different one so must change it to what I use.  You do not use quotation marks when putting in your ssid or authtype.  Managed means you do not use WEP and Open means you do. ;)The wep key is given in two character increments with each two characters followed by a colon.  This took me a long time to figure out.  If you are not running wep then you can simply put a # in front of the lines that set the wep key.  This will comment out those lines. The bottom lines with the ifconfig wlan0 followed by 192.etc. will need to be filled in with what you find when you look at your router's configuration.  You may also correctly find the numbers by looking at another distro on your given computer.  The gw took me a while to figure out as well.  In this case gw is not gross weight but instead stands for "gateway". :D  On your router you will have a number of options for encryption keys.  Mine numbers them from 1 to 4.  These numbers do not match in Linux.  Linux would number these same keys as being 0 to 3.  Be sure to subtract one from what your router specfies as the WEP encryption key.Wlan Script:
#! /bin/sh##Wireless USB setup##step 1 - enable wireless USB for wlan0wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable# step 2 - set SSID for network SSID requires OpenSystem while a systemwithout encryption would be Managed Authtype will be opensystem ormanaged.wlanctl-ng wlan0 lnxreq_autojoin ssid=**** authtype=****# step 3 - set wep attributes  True for Encrypted and False for Not.wlanctl-ng wlan0 lnxreq_hostwep encrypt=true decrypt=true#step 4 set wep key if running encrypted.  Key 1 in windows is Key 0 inLinux.  Key 2 in Windows is Key 1 and so on.  wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKeyID=*wlanctl-ng wlan0 dot11req_mibsetmibattribute=dot11WEPDefaultKey1=**:**:**:**:**:**:**:**:**:**:**:**:**#step 5 - set IP configuration  Sample IP, Netmask and Gateway shown:Replace with what you use.ifconfig wlan0 192.168.0.103 netmask 255.255.255.0 broadcast127.255.255.255 route add default gw 192.168.0.102
When you are finished configuring this to your situation, save it aswlanscript.
# chmod 755 wlanscript# ./wlanscript
Notes: If you use a SSID name other than default you will find a filecalled /etc/wlancfg/wlancfg-*****.  (Replace ***** with the name of yournetwork).  If that does not automatically happen when you insert yourSSID then go in and edit /etc/wlancfg/wlancfg-DEFAULT and saveas /etc/wlancfg/wlancfg-(your name).If all else fails, run
# ifup wlan0
to try to bring up your network manually.Good Luck!<If you asked for patience, you will know now that you have been tested to see if you need more patience. :D
In the next issue Julia will list a number of resources to find a suitable card or USB adapter.Thanks Julia !B) Bruno

#295 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 15 March 2005 - 02:26 PM

FINDING A WIFI CARD( Linux Compatible )And here is, for this moment, the last in our series about Wireless Networking in Linux. This time a little guided tour in hardware-land by our dear Julia ( aka teacher ) who knows all the hot-spots in town. B)

Julia, on Forum 2005, said:

You want to go wireless but you just can not connect with your wireless card no matter what you do. All is not lost. There are a number of resources that will help you find a wireless card that will work in Linux. One way to find a compatible card would be to go to your hardware configuration tools and look at the drivers available. This would not be a practical solution. What to do? Look at the hardware links on the Internet and find one that will work for you: An Awesome Overall list of WiFi Linux resources! Absolval Resources Linux-wlan driver compatibility list This one also has links to Amazon of cards/adapters that are compatible. Prism 2 Cards Atmel AT76C502/3/5A based wireless USB devicesI highly suggest that you print out a list and take it with you when you shop! That is the only way to find one that works. If you know the component manufacturers then you can find one that works no matter what label it wears. Most of the units have the same chipsets in them despite the name on the outside. Research until you find what that chipset inside is called. You can pick up units for as cheap as $5 to $50 for inexpensive ones and up from there. ;) In major computer shops you can look right on the box to see if it matches. Online shopping may require some research to find out what is behind the name. ;)Happy Hunting!
I hope the Wireless series was of good help to you . . . . and that by now you are WiFi connected . . . . .  I would like to thank Julia again for all the work she did put into these Tips !B) Bruno

#296 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 26 March 2005 - 04:53 PM

XLIB ERRORSome people prefer a GUI based text editor to edit their config files as root, other people are comfortable with Vi or emacs and for them the next problem really does not exist.If, when starting an editor as "su", you get the following error message in the console:

Quote

xlib: connection to 0.0 refused by serverxlib: no protocol specified
To fix this problem the solution is simple, give the following commands: (as normal user)
$ xhost +
And (as root)
# set DISPLAY=localhost:0.0
In some extreme cases the error returns after a reboot, in that case making a little bash-script for the "user command" and putting it in the ~/.kde/Autostart directory. And adding the "root command" at the end of the /etc/rc.d/rc.local file will do the trick at every next boot.:w00tx100: Bruno

#297 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 29 March 2005 - 01:34 PM

TWEAKING MTU SETTINGSThe default of 1460 bytes per packet can vary with the connection, distro or hardware you have.On some systems you can have better results with low MTU settings and some with high MTU settings, you will just have to see and try what works best for you.Here is how you can change the MTU settings for your network interface:First have a look on how the settings are now:
# ifconfig eth0
And you will get something similar to this:

Quote

eth0   Link encap:Ethernet HWaddr 00:07:95:XX:XX:59     inet addr:10.0.0.152 Bcast:10.0.0.255 Mask:255.255.255.0     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1     RX packets:29861 errors:0 dropped:0 overruns:0 frame:0     TX packets:26784 errors:0 dropped:0 overruns:0 carrier:0     collisions:0 txqueuelen:1000     RX bytes:6378900 (6.0 Mb) TX bytes:2889677 (2.7 Mb)     Interrupt:11 Base address:0xd400
Now we will test another setting ( MTU 1460 ):
/sbin/ifconfig eth0 mtu 1460
And see if you get better results . . . No ? Well, try again
/sbin/ifconfig eth0 mtu 1300
or
/sbin/ifconfig eth0 mtu 1200
Now imagine you found the value you want to make permanent: MTU 1250 , pull up the file "/etc/sysconfig/network-scripts/ifcfg-eth0" and make it read:

Quote

DEVICE=eth0MTU=1250BOOTPROTO=dhcpNETMASK=255.255.255.0ONBOOT=yesMETRIC=10
After the next boot the MTU settings will be on 1250 :DHave fun, but be careful not to break things !:blink: Bruno

#298 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 05 April 2005 - 01:35 PM

BROWSERS & PRIVACYFor people worried about their privacy on a computer shared by more then one user, the most obvious option is, of course, to make a user account for each user. But if  you would want to do some additional cleaning, this tip may be one for you.In the KDE Control Center under Security there is a section called "Privacy" where you can clear the cache, history, cookies etc. from the Konqueror web browser. If, however, you use the Galeon or Firefox web browser this action has no effect on the privacy related items of that browser.What you can do in that case is make a little script that will run every time you log in to KDE . . . here is what you do ( as user ):
$ vi ~/.kde/Autostart/clean-browser.sh
  ( or use any other editor if you are not comfortable with Vi )Copy and paste the next lines:

Script said:

#!/bin/bashrm -rf ~/.galeon/favicon_cache.xmlrm -rf ~/.galeon/mozilla/galeon/Cache/*rm -rf ~/.galeon/history.xmlrm -rf ~/.galeon/mozilla/galeon/cookies.txtrm -rf ~/.galeon/mozilla/galeon/cookperm.txtrm -rf ~/.galeon/mozilla/galeon/search.rdfrm -rf ~/.galeon/session_crashed.xmlrm -rf ~/.mozilla/firefox/*.default/history.datrm -rf ~/.mozilla/firefox/*.default/cookies.txtrm -rf ~/.mozilla/firefox/*.default/downloads.rdfrm -rf ~/.mozilla/firefox/*.default/formhistory.datrm -rf ~/.mozilla/firefox/*.default/history.datrm -rf ~/.mozilla/firefox/*.default/search.rdfrm -rf ~/.mozilla/firefox/*.default/Cache/*
Save the file ( In Vi with Esc+ZZ )And make the script executable:
$ chmod 755 ~/.kde/Autostart/clean-browser.sh
Now every time you log in the script will run and clear out the cache, cookies and history of the Galeon browser.If you would like to automate the same thing for Konqueror ( so you don't have to go to the KDE Control Center --> Security --> Privacy after every session ) you can add the next lines to the script above:

Script said:

rm -rf ~/.kde/share/apps/konqueror/konq_historytouch ~/.kde/share/apps/konqueror/konq_historyrm -rf ~/.kde/share/apps/kcookiejar/cookiestouch ~/.kde/share/apps/kcookiejar/cookiesrm -rf ~/.kde/share/config/konq_historytouch ~/.kde/share/config/konq_history
And maybe . . now that you are removing traces anyway . . what about the "recent documents" ?  . . Just add this one as well:

Script said:

rm -rf ~/.kde/share/apps/RecentDocuments/*
So now you can stop worrying if your browsing habits will be visible to the next  person that boots your computer. ;)Hint: Just giving the command "~/.kde/Autostart/clean-browser.sh" will do the cleaning for you without logging out and back in again.:lol: Bruno

#299 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 12 April 2005 - 01:09 PM

DIFF & CMP( Find the difference )Comparing two files to see if they are identical is not always easy using a GUI text-editor and having them side by side. But of course Linux has a command for that to make things easier. Actually there are two commands: "diff" and "cmp" but you will see that the first one is so much easier to use then the second one.Okay let us set up an example to explain things . . . I place two almost identical files ( colors1.txt and colors2.txt ) in a "test" directory.First we cd to that directory:
$ cd /home/bruno/test
Now first I will show you the use of diff without any options:
$ diff colors1.txt colors2.txt6c6< # indigo---> # indigo-blue11d10< # sienna12a12> # darkblue15c15< # tomato---> # tomato-red
We have to admit that the output is at least confusing . . . so now we add the -u ( unified ) option:
$ diff -u colors1.txt colors2.txt--- colors1.txt 2005-04-01 20:45:21.954828407 +0200+++ colors2.txt 2005-04-01 20:44:50.152742422 +0200@@ -3,13 +3,13 @@ # darkred # deeppink # firebrick-# indigo+# indigo-blue # limegreen # royalblue # sandybrown # seagreen-# sienna # silver+# darkblue # skyblue # teal-# tomato+# tomato-red
Now we start to see clearly . . . . . the differences from color1.txt to color2.txt are marked with "-" and "+" . . . . In the first file it says "indigo" in the second one "indigo-blue" the second one has no sienna but has the darkblue the first one has not . . etc. etc.Okay now we will make it even better to read:
$ diff -y -W 70 colors1.txt colors2.txt# chocolate			   # chocolate# crimson				# crimson# darkred				# darkred# deeppink			   # deeppink# firebrick			   # firebrick# indigo			 |   # indigo-blue# limegreen			   # limegreen# royalblue			   # royalblue# sandybrown			  # sandybrown# seagreen			   # seagreen# sienna			 <# silver				# silver				  >   # darkblue# skyblue				# skyblue# teal				 # teal# tomato			 |   # tomato-red
See this ??  . . . . The "|" indicates there is a difference and the ">"  and "<" tells us what is left out or added !! The -y option stands for "Side by side" . . and the -W 70 sets the width for the column.Now we have found the best way to compare the two files I will show you the other command: "cmp" The cmp command is a whole other story.  Let me first give an example:
$ cmp colors1.txt colors2.txtcolors1.txt colors2.txt differ: byte 64, line 6
That is all the output it gives . . . that is because cmp stops at the first byte that differs and then exits, writing the line and the byte that causes it to stop. Not really a clear output is it ?Sure we can give cmp the -l option so it does not stop at the first byte that differs but give all the bytes that are different . . but then you will see that ALL the bytes after byte 64 are different and you will only get a real long list even from the short example we use:
$ cmp -l colors1.txt colors2.txt 64 12 55 65 43 142 66 40 154 67 154 165 68 151 145 69 155 12 70 145 43 71 147 40 72 162 154 73 145 151 74 145 155<<---------------------I did remove byte 75 to 140 to shorten it a bit ---------------------->>141 43 153142 40 171143 164 142144 145 154145 141 165146 154 145151 157 145152 155 141153 141 154154 164 12155 157 43156 12 40cmp: EOF on colors1.txt
So it will be clear to you that I prefer using diff  . . . . . and the next time we will be using it together with another command we already know to check out the differences of the content of 2 directories. In the 3rd episode on diff I will post a script Ragnar sent me a while ago : "dirdiff" . . . . see you then !:thumbsup: Bruno

#300 OFFLINE   Bruno

Bruno

    Le Professeur Pingouin

  • Admin Emeritus
  • 37,904 posts

Posted 19 April 2005 - 02:49 PM

DIFF, FIND & MD5SUM( The difference in 2 Directories )In the previous Tip I explained about the commands diff and cmp . . . . here is a nice example on how to use diff ( we agreed we would forget about cmp :"> ) in combination with the "md5sum"  and "find" command.There was a question from a forum member about how to make a list of checksums of all files in a directory and those below. Again we make a "test" directory and placed in it some files to create the example.First we cd to that directory:
$ cd /home/bruno/test
Then we make the checksums of all the files in that directory using the find command: ( you can see all about the find command Here )
$ find  .  -type f   2>/dev/null  -exec md5sum {} \; >list1.txt
( Note: the dot just after the command "find" means: current directory and below )This will make a file called "list1.txt" and this is how it will look like:

list1.txt said:

f3dd21a2023813be41c9f4b879783d38  ./colors.txt9dab480789443d080d347138acdad7e5  ./quick_ref.pdff91449e7f5661b64c568a6c8a8834224  ./Console-Colorsa1ef1c1dc94d5a6d44dd5e0678f436a8  ./dsp.sxw37e30a1472eec2d643ff3c68dfec9b91  ./Host_DSL.kwd8f7a56b9b2a4e5ad703d5771f1194745  ./knoppix.pdf79619689e2f2427914e7375024a8f3f6  ./New.txt17b5e1592a475ce4657dd37b614a4b01  ./list1.txtf37f98c529cfb9cf81fae1cf8eff3726  ./Xsreensaver4ab309b66eaaf843b8ab3a89abac5a89  ./Prompt.txt35239c3bf13ac2d6ed68bfcda173cca9  ./Test_Cronc961818ee81c546ba23ba0f9d025045a  ./Color-Wheel
Now I copy that test directory, make some changes to only one file ( colors.txt ) in that second directory and we run the same command again but write the output this time to "list2.txt"
$ find  . -type f  2>/dev/null  -exec md5sum {} \; >list2.txt
After that we have 2 files with checksums: list1.txt and list2.txt . . . and we use the "diff" command to see what the difference is and what files in that directory are the same and which files have changed.This shows us that  only the "colors.txt" file is different and all the other files have the same checksum . . . now, we can do a diff on the 2 color.txt files to see where the different checksum comes from:
$ diff -y -W 70 colors1.txt colors2.txt# chocolate			   # chocolate# crimson				# crimson# darkred				# darkred# deeppink			   # deeppink# firebrick			   # firebrick# indigo			 |   # indigo-blue# limegreen			   # limegreen# royalblue			   # royalblue# sandybrown			  # sandybrown# seagreen			   # seagreen# sienna			 <# silver				# silver				  >   # darkblue# skyblue				# skyblue# teal				 # teal# tomato			 |   # tomato-red
And now we not only see what file in the two directories was different from the other, but also where the difference comes from.Another approach is this:
$ find  . -type f   2>/dev/null  -exec md5sum {} \; >test.md5
That will make a "test.md5" file that you can use at a later date to check if anything in that directory has changed:
$ md5sum -c list.md5
The output will be a list of files present in that directory with "OK" or "FAILED"Next time the "dirdiff" script from Ragnar that automates what we have done here above ;);) Bruno




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users