...making Linux just a little more fun!

<-- prev | next -->

More 2-Cent Tips!

See also: The Answer Gang's Knowledge Base and the LG Search Engine


Variables in Shell Scripts

Jim Dennis (the LG Answer Guy)
Question by Guy Milliron (anonymous)

Anyhow, I know it's simple, but I can't figure it out for the life of me. I use tcsh for my shell. How would I alias a command to do a CD to a directory of choice, and then automagically do an ls.

Long Hand:

# cd [directory]
# ls -lag
[JimD]
alias foo 'cd \!*; ls -lag'
... works for me. If you give it one argument that's where you are chdir()'d to. No argument and you cd ~ and get a listing of your home directory. More args and you get an error from cd; just like you'd expect from the cd command.
Note that aliases are subject to history expansion. That's why I'm using \!* --- which expands into foo's argument list whenever the foo alias is used.
Note that bash aliases DO NOT perform history expansion. Thus you'd use a shell function instead:
function foo () { cd $1; ls -lag; }
(Where either the word function or the () are hints that this is a function definition --- but both can be used, too).


Linux-kernel OS radio....

Thomas Adam (The LG Weekend Mechanic)

Hi, all.

Stumbled across this[1] and I have to say it is weird but knowing people here someone (like me!) will find it interesting, if not amusing.

-- Thomas Adam

[1] http://radioqualia.va.com.au/freeradiolinux

[laugh] Man, that is seriously whacky. I like it. Let's see, where can we slide it into LG?...
The problem is, of course, the time factor. I mean, if anybody was to listen to them and type it all in, they'd be almost two years out of date by the time they finished! - not to mention seriously sore fingers and a sleep debt the size of the US national one. -- Ben


GUIs don't fill up the whole screen

Kapil Hari Paranjape (The LG Answer Gang)
Question by JKC (anonymous)

KDE and GNOME on Linux (Topologilinux3.1.0)doesn't take up the whole display of my Toshiba 2400 laptop. Linux in text mode does take up the whole screen. How do I get the GUIs to do the same? With thanks, JKC.

[Please don't give deatils of my email address or full name but otherwise I'm very happy for this rather lame question to be posted. Thanks. JKC]

As a gentle reminder, yes gentle readers, if you want to be anonymous either as someone asking a question or offering good answers, we're fine by that - just let us know! -- Heather
[Kapil] Have a look at: http://www.thorstenhaas.de/toshiba2410
While this is for Toshiba 2410, it should also work for 2400.

Thank you Kapil.

[Kapil] You're welcome. However, ...
Please send your replies to the list rather than the person who responded to your question so that other people with similar questions can benefit from your experience.

I've had a look at the site and it has some good ideas.

[Kapil] Thorsten Hass has created this very useful site for Toshiba Laptop (Satellite) info for Linux --- perhaps this should be in LG Tips.
Ok, so we took a while getting it into the mix, but done! -- Heather

I did, however, find that the XF86Config-vesa worked (renamed to XF86Config). Seems the Toshiba 2400 likes this Vesa configuration. This config doesn't seem to have any other unwanted side effects; I copied it from the default and there doesn't seem to be any localisation issues - we'll see.

[Kapil] It is nice that "vesa" does what you want. However, note that the "vesa" configuration is not "accelerated" which means that window movement/mapping and animations will seem sluggish. Perhaps you could try one of the other XF86config files at the site and tell us (on this list) what happened.
The problem may also be with the "nv" driver and you could try out the drivers from nVidia as explained at the site.
In any case, now that XFree86 supports generic "vesa" it is certainly much easier to get a basic working GUI under Linux than it used to be---at least for newer machines.
Regards.


Equivalents

Valery V. Kachurov (xoid26 from linux-online.ru)
This refers back to the article idea in issue 93's mailbag. -- Heather

The section should specifically address the typical daily activities of the Windows user and how to configure Linux to operate like Windows.

I have a little and uncompleted table (but this is the most completed list of that kind in Internet...), with nearly the same purpose :). First column - the activity, second column - Windows way, third column - Linux way :D.

URL: http://linuxshop.ru/linuxbegin/win-lin-soft-en/table.shtml Descripton: The table of equivalents / replacements / analogs of Windows software in Linux.

P.S. What do you think about this project? Can anyone help to convert this page from HTML to MySQL (to put all information from table to DB)? Thanks :).


create new lilo boot loader - on 2nd drive

Hans van Buitenen (jvbuiten from wanadoo.nl)
This offers help to Geraldine Koh from LG 93, help wanted #8 -- Heather
Hi, you don't really describe how you boot from the second disk. Do you switch this in the bios?
I will just give you two hints.
In my case I use to power down and use the removable drive switch to disable the disk in the primary bay. Then the secondary starts up. I can imagine that this dous not work in all systems.
If you use lilo on the first disk to startup lilo in the mbr of the second disk then you might consider putting lilo in hdb1 and not in hdb.
Kind greetings.


How to run chat with several phone numbers

David B. Sarraf (david.sarraf from paonline.com)
In reference to LG 93, Help Wanted #5 by Joao Coelho, where I asked any ppp/chat script experts to please chime in. -- Heather

Heather:

I agree with you on this question. Use a front end. My personal favorite is diald. The documentation has an example of how to use a pool of numbers. You may not need the control that diald offers however it does solve the reader's problem.

Dave Sarraf


The Dao of Knoppix for Rescue

Heather Stern (The Answer Gang's Editor Gal)

I know that this stumps people from time to time, Knoppix itself is cool but using it for a rescue environment is a little sneakier.

First and foremost unless your idea of rescue is "find a file and ftp or scp it to somewhere else" kill the darn automounter. Run: /etc/init.d/autofs stop

Wait a few moments then make sure to use 'ps was' or 'ps fax' and make sure it is good and properly dead. Use 'kill -9' on the automounter if you have to.

Next thing is, you can use ctrl-alt-f1 or even ctrl-alt-F2 to get a prompt; over on tty1 just press ENTER and it's there already. When I'm really deep into thoughts of rescue the whole gorgeous GUI thing just gets in my way. If you'd rather stay in the GUI though, you'll have to launch konsole (or an xterm) and run 'sudo su -' ... and it won't ask a password. (That's also a warning to those of you who use Knoppix just because it makes Linux easy to show to your pals...)

Then I cd /mnt and see a gazillion (that's a technical term) hd* and sd* entries. I use e2label religiously to label my volumes, or create them with -L options so they have them; RH distros make the volumes with labels; other distros might too. So you've a pretty good chance of getting some useful answer out of this:

cd /mnt
for i in hd* sd* ; do echo -n "$i: " ; e2label /dev/$i ; done

Yeah, yeah, I know, if you use reiser or somehting that won't help, but the heartening thing is knoppix supports extra journaling fs' too, including XFS (Klaus merges SGI's XFS patches into his kernels).

I also mkdir my own mountpoint - my favorite /mnt/pt (mount point, get it?) or /mnt/t (for target) and mount my poor benighted root fs there, then read its etc/fstab for what else to mount. Then you can safely chroot in and tweak lilo, or install that important package. If you are installing packages, some need /proc mounted to behave well... and then you'll need to recall to umount /proc in there too. Don't forget to umount all this stuff yourself before you reboot.

Last but not least, if you use knoppix to do a local install, get rid of or at least properly configure that annoying little MTA smail. Almost nobody will relay newuser@knoppix and that's what your outbound mail will look like it's from if you don't do something about it. Compared to that, fending off vestiges of German configuration is more charming than troublesome :)


New version of WinMD5 for Windoze available

Ken Dodge (k.dodge from comcast.net)

Hi all,

Back around mid-April 2003 I posted a reply to a querant about md5sum's, and mentioned that I often use Ed Olson's WinMD5 on one or another of my Win boxes when downloading and burning Linux distro .iso's (got to get that Linux system up for doing that sort of thing!) Ed sent me the following message regarding my original posting, and announcing the availability of his latest version of WinMD5 (v2.0), so I thought I would pass it on. I've been using v1.1 of his program for awhile now, with no problems at all.

BTW his v2.0 requires M$ .NET Framework (preferably v1.1 or newer) installed to run. It's available via Windoze Update on Win98/2K/XT systems.

HTH - Ken Dodge

It's still the current version, it's still a nice little app, and I'm sure those of you downloading a Linux ISO to the beast of Redmond before burning your shiny new CD would kind of like to know you aren't making a coaster. So here it is. -- Heather

...............

Subject: WinMD5
Date: Mon, 18 Aug 2003 14:41:30 -0400
From: Edwin Olson <eolson@MIT.EDU>

Howdy,

I'm the author of WinMD5. I noticed a whole bunch of hits against my website referred by a posting to linux-list from April, and found your name. (The link in your email http://www.ssc.com/pipermail/linux-list/2003-April/055560.html contains a spurious period, so my server was getting a lot of 404s).

FYI, The best web page to point people to is:

http://www.blisstonia.com/software/WinMD5

There's also a much nicer version 2.0 available now (still free, of course :) I would appreciate any feedback you might have.

Thanks for recommending my utility. It's nice to know folks are using it!

-Ed

...............


telnet connection problem

Karl-Heinz Herrmann (k.-h.herrmann from fz-juelich.de)
Question by gho boo (lovelearninggtmhh from 37.com)

i am trying to use telnet to learn more about internet protocols but every time i try to make a connention through the telnet i get a refuse message says couldnot make a connection to the web site. what i do is fisrt make a connection to the internet then i put in the host name the following address "whois.internic.com" and leave the term type and every thing else as it was but i also fail

[K.-H.] Well --- learning more about internet protocols is certainly worthwhile especiall since you've no clue. On the other hand this mailinglist you sent your question to is called *linux-questions-only*. Why would you guess somebody has a funny E-Mail adress like that? Because we are network and internet protocol specialists?
For further asking question at this place consider reading:
http://www.linuxgazette.net/tag/ask-the-gang.html
AND recommended places to find information like search linuxgazette, google or the Linux documentation project www.tldp.org which incidentially has a network administrator guide which explains many basics:
http://www.tldp.org/LDP/nag2/index.html

i tried another addresses but invain i tried google.com,yahoo.com but no connection was there maybe the proxy setting affect the telnet connection??????????/

[K.-H.] Certainly -- proxy is for the http (maybe ftp) protocol. This protocol definition includes a port number, usually 80. telnet on the other hand is a service usually not available to everybody and usually connecting to port 23 -- which is not covered by standard proxy services.
Since you wanted to study network protocols you probably wanted to telnet to the webserver on any of the machines you tried.
That could be done by: telnet www.whatever.com 80
the 80 specifies that you do not want to connect to the regular telnet port (which should not be available on any big webserver as its a gaping security hole) but to the http-server which is listening on port 80.
Maybe this gets you started in the right direction (i.e. start reading documentation).

please help me to answer this question as i read in the website you have a fabulous information about this things thanks very much...............

You're welcome. To others reading this - the trick works for any purely text based protocol, as long as it only needs one port, and you have your hceat card at hand. I use it to test my mailservers for clients before taking them out of the lab, using telnet to port 25 and using raw SMTP or ESMTP commands. -- Heather


networking problems(configuring a wi-fi card)

Karl-Heinz Herrmann (k.-h.herrmann from fz-juelich.de)
Question by Ben Vargas (Ben from Vargasent.com)

as of yesterday i fugured out my PCMCIA problem and have now configured my wi-fi card and everthiing seemed to be going well untill i launched the browser and i dont seem to be passing the IP adress to the browser, if i have an ip address at all. and my real question is, is there a ip configuration utility for red hat 9 where i can see if i indeed have a ip address that was DHCP to my machine and if so where can i find this program.

thanks for your time

Benjamin Vargas

[K.-H.] That question is completely confused. Read http://www.linuxgazette.net/tag/ask-the-gang.html to get an idea how to ask a good question. It would help to tell what netscape is doing/not doing. proxy setting in netscape. output of /sbin/route -n (one of the tools you ask for) would also help in finding out whats the problem.
Generally:
Your computer has an IP-adress attached to each of its interfaces. It is 127.0.0.1 on interface lo (loop back), it might have ethernet connections like eth0 with local IP-adresses (e.g. 10.10.10.1) and once you've dialed out via modem/ISDN you've a [i]ppp0 interface which got a dynamic IP adress assigned. That might be any IP-adress.
The IP-traffic is directed by routing, thats's the roadmap which tells the kernel where to send each IP packet depending on the IP. A packet to 127.0.0.1 will be passed to interface lo, while with appropriate netmask/broadcast setting any packet to 10.x.x.x will be passed to eth0. To direct all unknown (outside) IP-adresses to [i]ppp0 you would set a default route (shows up as 0.0.0.0 in route outpute) specifying where to send all the traffic.
If your netscape doesn't see the outside, it's because the packets go wrong (or the interface is not up and running).
interfaces are checked with ifconfig, routes with route [-n].
WLAN is no different, looks like an ethernet but has some special tools for the interface and status: iwconfig, iwspy, iwlist, iwpriv,... route is the same.
http://www.oreillynet.com/pub/a/wireless/2001/03/06/recipe.html has a Linux-setup for 802.11b cards. There are links to the wireless-tools which will help diagnose and set WLAN specific things.
K.-H.

This page edited and maintained by the Editors of Linux Gazette
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/

 

Copyright © 2004, . Released under the Open Publication license unless otherwise noted in the body of the article. Linux Gazette is not produced, sponsored, or endorsed by its prior host, SSC, Inc.

Published in Issue 102 of Linux Gazette, May 2004

<-- prev | next -->
Tux