Send tech-support questions, answers and article ideas to The Answer Gang <email@example.com>. Other mail (including questions or comments about the Gazette itself) should go to <firstname.lastname@example.org>. All material sent to either of these addresses will be considered for publication in the next issue. Please send answers to the original querent too, so that s/he can get the answer without waiting for the next issue.
Unanswered questions might appear here. Questions with answers--or answers only--appear in The Answer Gang, 2-Cent Tips, or here, depending on their content. There is no guarantee that questions will ever be answered, especially if not related to Linux.
Before asking a question, please check the Linux Gazette FAQ to see if it has been answered there.
In its place there appear to be three new parameters:
ipfrag_high_thresh - INTEGER
Maximum memory used to reassemble IP fragments. When ipfrag_high_thresh bytes of memory is allocated for this purpose, the fragment handler will toss packets until ipfrag_low_thresh is reached.
ipfrag_low_thresh - INTEGER See ipfrag_high_thresh ipfrag_time - INTEGER Time in seconds to keep an IP fragment in memory.
Any idea what are 'reasonable' settings?
What settings will mimic, as closely as possible, the behavior of ip_always_defrag?
-- James Garrison
I just installed Mandrake 8.0. I intend to use gcc (the compiler) quite a bit to recompile lots of software. Mandrake 8.0 ships with a development version of gcc (2.96) but I really want to stick with 2.95.x for stability/portability. How can I remove the development-gcc and put an older version in without breaking the system. I know there must be a way to do this via RPM, but it eludes me and I was seriously frightened to rebuild from an unmanaged source tarball.
I just got an older laser printer and it works very well with a HP LJ III printcap setting, except it has only 1 MB of RAM. This works well until I try to print a PDF, then it runs out of printer memory about 7/8 of the way through the page.
Is there some way to tell ghostscript/lpd to go easy on the thing? I was able to print them fine on my inkjet, and it definitely doesn't have 1 MB of memory installed...
Oh yes, the same .PDF prints fine on the Evil(tm) Operating System.
-- Jonathan Markevich
I run Linux 2.2.14 on a laptop with a by now small hard drive. To put some huge files (such as graphics in the middle of editing) on it, I installed the e2compr patch to the kernel. I'd like to upgrade to 2.4, but the patch doesn't seem to be available for 2.4. Anybody know what happened to it?
There's at least one new compressed filesystem in the new kernels, but I'm not sure that the one I'm thinking of is realy ext2 compatible. Still, you might not need that. There's a curious new style of ramdisk available too. Anyone who knows more is welcome to chime in ... -- Heather
I'm reading the gazette for a wile now, and never found an answer to my simple question Where can I found Baby's clothes related to Linux? With Linux logo or something. I want my baby to be cool (and to use Linux) .....
It looks like The Emporium (a UK company) sells child size sweatshirts but I don't know what sizes are good for babies. Comments welcome. If you are a commercial entity which has 'em, let us know, and we'll put you in News Bytes. -- Heather
One more quickie: do you know of any IRC channels where I can get some IPChains questions answered? I'm trying to put in a firewall for a client using a script that has worked very well for me for several years (used to be IPMasq, but has been modified for IPChains) but just dies now and for the life of me I can't figure out why.
The only difference in this case that I can see is that the DSL line it sits behind is running Ethernet bridging (PacBell DSL) over an Alcatel modem and the script has been running behind a Cox@Home cable modem (no bridging); but why is that such a "deal-killer"?
Anyway, thanks again!
Recently,in the pipeline of converting my NT server to a Redhat 7.1 Linux
Server with Samba on it. But the problem is I'm using a a HP SureStoreDAT 40
tape Drive. And there is nowhere I can find the driver for this
device(including the HP and Redhat website). I really hope that I can
realise my dream of setting up 2 Linux server(with UPS and backup tape
driver on) at my place. I don't want to scrap the whole project halfway.
Does you knows where I can get the above driver or a generic driver well do?
Or is there any recommendations on a almost similar tape drive that is well
supported with Redhat? If I can't succeed then I 'll have to go to
Windows2000 with all those expensive licenses. Thanks
Yes, Gentle Readers, this is also in TAG this month, but folks looking for article ideas are encouraged to take this and run with it. For that matter, we have a PostgresSQL related article this month (nielsen.html) but it would be fun to have an article comparing PostgresSQL to MySQL. -- Heather
I would love to see an article about making sense of MySQL.Perhaps some basic commands, and how to do something useful with it.
Here are some basic commands. As far as "something useful", what would you consider useful?
I have found a lot of articles either lack basic usage and administration or it it fails to show how to put it all together and have somehing useful come out of it.
The 'mysql' command is your friend. You can practice entering commands with it, run ad-hoc queries, build and modify your tables, and test your ideas before coding them into a program. Let's look at one of the sample tables that come with MySQL in the 'test' database. First we'll see the names of the tables, then look at the structure of the TEAM table, then count how many records it contains, then display a few fields.
$ mysql test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1325 to server version: 3.23.35-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer mysql> show tables; +------------------+ | Tables_in_test | +------------------+ | COLORS | | TEAM | +------------------+ 2 rows in set (0.00 sec) mysql> describe TEAM; +------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+---------------+------+-----+---------+----------------+ | MEMBER_ID | int(11) | | PRI | NULL | auto_increment | | FIRST_NAME | varchar(32) | | | | | | LAST_NAME | varchar(32) | | | | | | REMARK | varchar(64) | | | | | | FAV_COLOR | varchar(32) | | MUL | | | | LAST_DATE | timestamp(14) | YES | MUL | NULL | | | OPEN_DATE | timestamp(14) | YES | MUL | NULL | | +------------+---------------+------+-----+---------+----------------+ 7 rows in set (0.00 sec) mysql> select count(*) from TEAM; +----------+ | count(*) | +----------+ | 4 | +----------+ 1 row in set (0.00 sec) mysql> select MEMBER_ID, REMARK, LAST_DATE from TEAM; +-----------+-----------------+----------------+ | MEMBER_ID | REMARK | LAST_DATE | +-----------+-----------------+----------------+ | 1 | Techno Needy | 20000508105403 | | 2 | Meticulous Nick | 20000508105403 | | 3 | The Data Diva | 20000508105403 | | 4 | The Logic Bunny | 20000508105403 | +-----------+-----------------+----------------+ 4 rows in set (0.01 sec)
Say we've forgotten the full name of that Diva person:
mysql> select MEMBER_ID, FIRST_NAME, LAST_NAME, REMARK -> from TEAM -> where REMARK LIKE "%Diva%"; +-----------+------------+-----------+---------------+ | MEMBER_ID | FIRST_NAME | LAST_NAME | REMARK | +-----------+------------+-----------+---------------+ | 3 | Brittney | McChristy | The Data Diva | +-----------+------------+-----------+---------------+ 1 row in set (0.01 sec)
What if Brittney McChristy changes her last name to Spears?
mysql> update TEAM set LAST_NAME='Spears' WHERE MEMBER_ID=3; Query OK, 1 row affected (0.01 sec) mysql> select MEMBER_ID, FIRST_NAME, LAST_NAME, LAST_DATE from TEAM -> where MEMBER_ID=3; +-----------+------------+-----------+----------------+ | MEMBER_ID | FIRST_NAME | LAST_NAME | LAST_DATE | +-----------+------------+-----------+----------------+ | 3 | Brittney | Spears | 20010515134528 | +-----------+------------+-----------+----------------+ 1 row in set (0.00 sec)
Since LAST_DATE is the first TIMESTAMP field in the table, it's automatically reset to the current time whenever you make a change.
Now let's look at all the players whose favorite color is blue, listing the most recently-changed one first.
mysql> select MEMBER_ID, FIRST_NAME, LAST_NAME, FAV_COLOR, LAST_DATE from TEAM -> where FAV_COLOR = 'blue' -> order by LAST_DATE desc; +-----------+------------+-----------+-----------+----------------+ | MEMBER_ID | FIRST_NAME | LAST_NAME | FAV_COLOR | LAST_DATE | +-----------+------------+-----------+-----------+----------------+ | 3 | Brittney | Spears | blue | 20010515134528 | | 2 | Nick | Borders | blue | 20000508105403 | +-----------+------------+-----------+-----------+----------------+ 2 rows in set (0.00 sec)
Now let's create a table TEAM2 with a similar structure as TEAM.
mysql> create table TEAM2 ( -> MEMBER_ID int(11) not null auto_increment primary key, -> FIRST_NAME varchar(32) not null, -> LAST_NAME varchar(32) not null, -> REMARK varchar(64) not null, -> FAV_COLOR varchar(32) not null, -> LAST_DATE timestamp, -> OPEN_DATE timestamp); Query OK, 0 rows affected (0.01 sec) mysql> describe TEAM2; +------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+---------------+------+-----+---------+----------------+ | MEMBER_ID | int(11) | | PRI | NULL | auto_increment | | FIRST_NAME | varchar(32) | | | | | | LAST_NAME | varchar(32) | | | | | | REMARK | varchar(64) | | | | | | FAV_COLOR | varchar(32) | | | | | | LAST_DATE | timestamp(14) | YES | | NULL | | | OPEN_DATE | timestamp(14) | YES | | NULL | | +------------+---------------+------+-----+---------+----------------+ 7 rows in set (0.00 sec)
Compare this with the TEAM decription above. They are identical (except for the multiple index we didn't create because this is a "simple" example).
Now, say you want to do a query in Python:
$ python Python 1.6 (#1, Sep 5 2000, 17:46:48) [GCC 188.8.131.52] on linux2 Copyright (c) 1995-2000 Corporation for National Research Initiatives. All Rights Reserved. Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved. >>> import MySQLdb >>> conn = MySQLdb.connect(host='localhost', user='me', passwd='mypw', db='test') >>> c = conn.cursor() >>> c.execute("select MEMBER_ID, FIRST_NAME, LAST_NAME from TEAM") 4L >>> records = c.fetchall() >>> import pprint >>> pprint.pprint(records) ((1L, 'Brad', 'Stec'), (2L, 'Nick', 'Borders'), (3L, 'Brittney', 'Spears'), (4L, 'Fuzzy', 'Logic'))
Another approach is to have Python or a shell script write the SQL commands to a file and then run 'mysql' with its standard input coming from the file. Or in a shell script, pipe the command into mysql:
$ echo "select REMARK from TEAM" | mysql -t test +-----------------+ | REMARK | +-----------------+ | Techno Needy | | Meticulous Nick | | The Data Diva | | The Logic Bunny | +-----------------+
(The -t option tells MySQL to draw the table decorations even though it's running in batch mode. Add your MySQL username and password if requred.)
'mysqldump' prints a set of SQL commands which can recreate a table. This provides a simple way to backup and restore:
$ mysqldump --opt -u Username -pPassword test TEAM >/backups/team.sql $ mysql -u Username -pPassword test </backups/team.sql
This can be used for system backups, or for ad-hoc backups while you're designing an application or doing complex edits. (And it saves your butt if you accidentally forget the WHERE clause in an UPDATE statement and end up changing all records instead of just one!)
You can also do system backups by rsyncing or tarring the /var/lib/mysql/ directory. However, you run the risk that a table may be in the middle of an update. MySQL does have a command "LOCK TABLES the_table READ", but interspersing it with backup commands in Python/Perl/whatever is less convenient than mysqldump, and trying to do it in a shell script without running mysql as a coprocess is pretty difficult.
The only other maintenance operation is creating users and assigning access privileges. Study "GRANT and REVOKE syntax" (section 7.25) in the MySQL reference manual. I always have to reread this whenever I add a database. Generally you want a command like:
mysql> grant SELECT, INSERT, DELETE, UPDATE on test.TEAM to somebody -> identified by 'her_password'; Query OK, 0 rows affected (0.03 sec)
This will allow "somebody" to view and modify records but not to change the table structure. (I always alter tables as the MySQL root user.) To allow viewing and modifying of all current and future tables in datbase 'test', use "on test.*". To allow certain users access without a password, omit the "identified by 'her_password'" portion. To limit access according to the client's hostname, use 'to somebody@"%.mysite.com"'.
Remember that MySQL usernames have no relationship to login usernames.
To join multiple tables (MySQL is a "relational" DBMS after all), see "SELECT syntax" (section 7.11). Actually, all of chapter 7 is good to have around for reference. The MySQL manual is at http://www.mysql.com/doc/
-- Mike Orr
On Thu, 10 May 2001, you wrote:
I realize that this question was quite old, but I just came across it while cleaning out my inbox. Here's a couple of quick suggestions:
Thanks very much, very useful.
First: don't use this sort of "psuedo array." If you want an array (perhaps an associative array, what PERL calls a "hash") then use an array. Korn shell supports associative arrays. Bash doesn't. With other shells, you'll have to check.
Not easy when you have to work with what is given Actually I ditched it all and rewrote the app in XML and XSLT
Martin is one of our authors.
This is to inform the world of an idea we are playing with. I work for an 3rd world aid organisation and recently returned home from a trip to Dar es Salaam, Tanzania. One of the ideas I brought with me back was the wish of some of our member organisations to set up some kind of computer training in "rural" Tanzania.
The interest of computers, and computer aided training is great, the means of buying computers non-existant. So, the idea is to set up training centres using "second hand" computers. My idea is to have this equiped with Linux and Star Office which will be ideal in terms of priceing and stability - if not perhaps in trained staff.
All of this is of course only in a very early stage of planning, but we hope to go ahead with the project at the latest during next year. If anyone else has any experiences of similar projects I am interested in hearing from you!
Martin Skjöldebrand CTO, Forum Syd The Swedish NGO Centre for Development Co-operation.
Thank you for your reply...I know I answered it already but at that point I
had only seen what was written on the TAG site (board/whatever) which was
very brief. Your email to me had not arrived at that point, so I didn't get
much of a message from you -as you may? have gathered from my answer to it.
Sorry about my email settings...I was sending from a machine which was
only just set up and running on defaults which I hadn't looked at. (Or
maybe it was the setup of the message board....perhaps I pressed a "include
html tags" button or something , not thinking. I really can't remember).
I'll pay more attention to it in future.
As for your answer, thank you very much. It will help me in the future, I'm
sure. I don't really know anyone who I can talk to about this sort of stuff
(computers) so reading what I can find and filing away little tips like
that is pretty much my sole reference source when things f up. I only found
out that TAG even existed on the weekend, so maybe I'll write again
sometime. A really useful site.
Thanks again and keep up the good work helping people.
All the best, Peter.
On Sun, May 06, 2001 at 06:12:32AM +0100, Peter P wrote:
Content-Type: text/html; charset=iso-8859-1
Don't do that, please. Sending e-mail in any format other than plain text lowers the chances of your question being answered. It's impolite ... "Bad signature" is, of course, a software-dependent error, but it seems to be a pretty standardized one: what it usually means is that something scribbled over the last couple of bytes of the first sector on the drive. ...
That others have been helped by having this out there. thanks!
Of all the articles I have read on how wonderful Linux is, seldom have I seen any that [cynically] document how the average Windows user can go from mouse-clicking dweeb to Linux junkie. Perhaps such an article does not exist? Or, maybe those that made the jump to Linux have forgotten the hoops us Win-dweebs are still facing.
A few years back, when this giant Linux wave began to crest, I was working for a local Electronics Boutique (EB) store for a few hours a week. Microsoft was in the news almost daily, and as the lawsuit against it grinded close to a close, anything Linux faired very well in the stock market and in the software reviews, it seemed. Heck, even EB was begining to stock games for Linux, maybe this is the little OS that can make it after all. So, like others, I took the dip into Linux, bringing home a copy of RedHat and pretty much every version since.
< Buying Linux >
Perhaps the first thing to be forgotten about Linux versus Windows was "Hey, Linux is FREE". What someone forgot to tell the rest of the world was that its one helluva download that doesn't always like to finish. And, up here in the NorthEast (Maine specifically), broadband wasnt here, so your idea of a good download was a 5.3k connect on the 56k modem! So, off to the store and buy a copy for $30 or so bucks. Then, not more than 3 months later, another build is out! Off we go and spend another $30 bucks....and repeat this process a few more times to our current build. Hmmm, well, its cost me more than all my Microsoft updates, and the Windows Update button sure is vastly easier than the Linux equivalent(s).
So, the claim of FREE FREE FREE really isn't so....I've found other places that you can buy a CD copy cheaper but still, some money negates the FREE.
Many free software notables would stand firmly on the point that "free" in "free software" is not about money, it's about your ability to improve, debug, or even use these applications after their original vendor gives up on them, disappears, or even simply turns to other things.
On the flip side(s) of this coin (these dice?), there are some who say "some work negates the FREE" ... such as your note below ... and those for whom a "free download" (which is certainly available for most Linux variants) is really quite expensive. Thus the appearance and eventual success of companies pre-loading Linux. - Heather
< Install...I dare you...>
Linux this, Linux that...that's all we've heard. Microsoft is bad (say using the Napsater Baaad sound effect from cartoon portraying Lars Ulrich). So now we give it the go, and guess what? The Linux operating system that w anted so much to be different from Windows looks JUST LIKE IT. Now while I will concede it IS easy to jump into for a user like me, all the books I had seemed to point to the beauty of working in the shell.
And another favorite of mine, something I can't understand at all. Why doesn't Linux do the equivalent of a DOS PATH command? Newbie Me is trying to shutdown my system and I, armed with book, type "shutdown -h now" and am told 'command not found'. But wait, my book says...etc etc....and of course, I now know you have to wander into sbin to make things happen. Why such commands aren't pathed like DOS is beyond me....perhaps that's another HowTo that has eluded me.
<...and the adventure continues...>
And now, two years later, I'm pleased to inform you that I have three Linux machines on my network, two are DNS servers and the other acts as my TUCOWS mirror. The DNS Servers work great....their version of BIND was flawed and five days into service, they were hacked into. Its just not fair, is it? But, my local Linux Guru solved the problem with a newer version of BIND and he's been watching over the machines to date. While I am still trying to learn more, its a slow process for a WinDweeb. While others wait for their ship to come in, I'm hunting for that perfect HowTo to guide me into the halls of Linux Guru-Land.
While Paul later noted that he meant this "tongue in cheek" ... meanwhile, The Answer Gang answered him (see this month's TAG). Still, Linux Gazette will cheerfully publish articles aiding the true Newbie have a little more fun with Linux. If you have tiny picce of his "WinDweeb-to-LinuxGuru-HOWTO" waiting in you, check out our author guidelines, and then let us know! -- Heather
Soon, all GIF images in the back issues of LG will be converted to PNG or JPG format. If you have a graphical browser that doesn't display PNG images properly (like the ones in The Weekend Mechanic article), speak up now.
I'll try to get right to the point. It's been two months since HelpDex finished up on LinuxToday.com. Since then, strips have only been appearing on www.LinuxGazette.com but nowhere else. A huge thanks to Mike from LG for this.
Can you spread the word for me please, the more I know I'm wanted the more likely I am to not be lazy
Oh, and there's also plenty of cool reading around. Check out Sir JH Flakey (http://www.core.org.au/cartoons.php) and of course, ANY book that comes out of O'Reilly