If Apple's mac web browser, Safari, crashes on your web page, look for mismatched beginning and end tags. With a fairly complex page, using lots of CSS, we found that Safari was crashed by a simple mismatch of h1 (opening) and h2 (closing) tags ... note that we first debug-interpolated the error to the CSS file, but there was no error to fix ... the typo was in HTML that used the CSS file ...
(keywords: crash, crashes, crashed, safari browser)
Thursday, September 27, 2007
Tuesday, September 25, 2007
Firefox img border problem
Of course, since Firefox is probably the most compliant browser, this is more an artifact than a problem. But I'd like to help people out with this, so I'll keyword it: problem, bug, issue ...
In Firefox an image (img) with (a href) link tags around it, often shows up with a visually unwanted blue border. The fix is simple. Set " border=0 " in the img tag:
In Firefox an image (img) with (a href) link tags around it, often shows up with a visually unwanted blue border. The fix is simple. Set " border=0 " in the img tag:
< img src="file.jpg" border=0 >
Friday, August 31, 2007
Good habits: lengthen your history
It's important to know what you've done, as a sysadmin. If you're one of a group of admins, history becomes even more important.
The first thing I do on a legacy Linux system, is edit /etc/profile, and change HISTSIZE to 100000 or more. Note, this does not erase previous history (although etting it to zero will).
Of course, "history" records only one side of the conversation. The responses of the machine are just as important. Unfortunately, there's no straightforward mechanism like history, which would automatically log everything you see. Your terminal client can often do this for you, but it would be nice to do it on the machine itself.
To bug the bash people about this, for their next release, go here.
The "script" command is a temporary fix ... it records your session in a transcript file. You type "exit" or ^d to stop recording. It writes into a file called "typescript", unless you specify something different.
Trying to automate this:
... you cannot just put "script" in your .bashrc file ... it will go into an infinite loop, because "script" itself starts a new shell (when you stop this, amusingly, you'll find yourself at the bottom of a few hundred nested shells ...)
You can't put it in .login ... because script starts a shell. When .login exits, so will the "script" shell. But that's not what you need.
What you need to do, is set an environmental variable in .bash_login, unset it in .basrc, and then start "script" just once.
The first thing I do on a legacy Linux system, is edit /etc/profile, and change HISTSIZE to 100000 or more. Note, this does not erase previous history (although etting it to zero will).
Of course, "history" records only one side of the conversation. The responses of the machine are just as important. Unfortunately, there's no straightforward mechanism like history, which would automatically log everything you see. Your terminal client can often do this for you, but it would be nice to do it on the machine itself.
To bug the bash people about this, for their next release, go here.
The "script" command is a temporary fix ... it records your session in a transcript file. You type "exit" or ^d to stop recording. It writes into a file called "typescript", unless you specify something different.
Trying to automate this:
... you cannot just put "script" in your .bashrc file ... it will go into an infinite loop, because "script" itself starts a new shell (when you stop this, amusingly, you'll find yourself at the bottom of a few hundred nested shells ...)
You can't put it in .login ... because script starts a shell. When .login exits, so will the "script" shell. But that's not what you need.
What you need to do, is set an environmental variable in .bash_login, unset it in .basrc, and then start "script" just once.
Monday, August 13, 2007
MSN Messenger very broken on Macs
Microsoft's closed-protocol Windows Live, Microsoft Messenger IM environment will work for a mac under some conditions. If you first authenticate on the machine you first sign in on, you're ok, and the client works passably well (although there are many irritations, like a nearly useless search feature) ... but if you need to take on previously authenticated identities, you're hosed. It simply doesn't work on a mac. The re-authentication e-mail never gets sent. Also, the web ui, "webmessenger.msn.com" is simply broken for any browser that runs on a Mac (Firefox, Safari, and the old IE) ... it loses connections and messages quite easily.
However, MSN Messenger even works well on 8-year-old machines running Windows 2000 Pro ... set one up so you don't need to buy a new machine and give money towards Microsoft's monopoly-driven attempts to create working software.
However, MSN Messenger even works well on 8-year-old machines running Windows 2000 Pro ... set one up so you don't need to buy a new machine and give money towards Microsoft's monopoly-driven attempts to create working software.
Monday, March 26, 2007
cp -r hangs. use cp -R.
My primary purpose for this blog, is to make small little nuggets that a search engine will find, when you have a problem, and you haven't slept for three days, and you type in the first thing that comes to you.
I could do this with keywords: cp, cp -r, cp -R, hangs, takes forever, special devices, licq_fifo, linux, unix, large copy, massive copy, etc.
But that's not the way you think when you haven't slept. If you're a human, you ask questions "why is my cp hanging?" or "my copy is hanging, but why?" or just statements "my cp hangs" or "my copy hangs." Very commonly, you think in terms of time-based sequences of statements, as if you were talking to a doctor ... something like "I'm on Linux. I had to copy a lot of data from one disk to another. One disk is remote, using NFS. I used cp -r. It took forever, so I did df, and found that the new disk size wasn't increasing. Then I killed it with control-c. And ran it cp -r -v, to see what was going on. It got hung up on a file licq_fifo. I googled licq_fifo, and found out it was a special device. cp -r doesn't follow symbolic links, why would it not recognize special devices? Oh, wait, I remember this, it's a normal problem. I typed "man cp", and then the more recent "info cp". And, right, cp -R will ignore special device files. I should go to sleep."
This is of course the simplest problem, quite quick to resolve. But look at the volume of problem-solving information in the above paragraph. What can we do to make search engines more like expert systems, so that we can preserve more of the world's problem-solving-sequence information? Not just with IT, but with everything involving such traversals of ordered fuzzy graphs?
I could do this with keywords: cp, cp -r, cp -R, hangs, takes forever, special devices, licq_fifo, linux, unix, large copy, massive copy, etc.
But that's not the way you think when you haven't slept. If you're a human, you ask questions "why is my cp hanging?" or "my copy is hanging, but why?" or just statements "my cp hangs" or "my copy hangs." Very commonly, you think in terms of time-based sequences of statements, as if you were talking to a doctor ... something like "I'm on Linux. I had to copy a lot of data from one disk to another. One disk is remote, using NFS. I used cp -r. It took forever, so I did df, and found that the new disk size wasn't increasing. Then I killed it with control-c. And ran it cp -r -v, to see what was going on. It got hung up on a file licq_fifo. I googled licq_fifo, and found out it was a special device. cp -r doesn't follow symbolic links, why would it not recognize special devices? Oh, wait, I remember this, it's a normal problem. I typed "man cp", and then the more recent "info cp". And, right, cp -R will ignore special device files. I should go to sleep."
This is of course the simplest problem, quite quick to resolve. But look at the volume of problem-solving information in the above paragraph. What can we do to make search engines more like expert systems, so that we can preserve more of the world's problem-solving-sequence information? Not just with IT, but with everything involving such traversals of ordered fuzzy graphs?
Friday, March 23, 2007
Discovering a legacy purpose for LDAP / slapd
If you're on a legacy Linux/Unix system, and you notice slapd running a directory service, you might wonder: what is this directory service for? What is slapd doing? Why is ldap here? Why do I have slpad running? What data is slapd serving? [I'm playing with search engines here -- I typed these questions into google and found nothing quickly.]
A search of the data will answer most of your questions.
ldapsearch
.. is a common LDAP client command on Linux/Unix. It will tell you if no ldap is available ("Can't contact LDAP server").
But, even with a slapd daemon running, you won't find any data by typing this command with no arguments. You need to tell it where to start looking: the base of the ordered data on the local server.
So, find the config file -- usually somewhere like /etc/ldap/slapd.conf. If it isn't there, use "locate slapd" or "locate ldap" to find it.
In the file, you'll see something vaguely like this:
# The base of your directory
suffix "dc=onething,dc=something,dc=else"
Use the string in quotes to search your directory:
ldapsearch -b "dc=onething,dc=something,dc=else"
You'll see the data, and then the purpose of LDAP on your server should be quite clear.
A search of the data will answer most of your questions.
ldapsearch
.. is a common LDAP client command on Linux/Unix. It will tell you if no ldap is available ("Can't contact LDAP server").
But, even with a slapd daemon running, you won't find any data by typing this command with no arguments. You need to tell it where to start looking: the base of the ordered data on the local server.
So, find the config file -- usually somewhere like /etc/ldap/slapd.conf. If it isn't there, use "locate slapd" or "locate ldap" to find it.
In the file, you'll see something vaguely like this:
# The base of your directory
suffix "dc=onething,dc=something,dc=else"
Use the string in quotes to search your directory:
ldapsearch -b "dc=onething,dc=something,dc=else"
You'll see the data, and then the purpose of LDAP on your server should be quite clear.
Friday, March 16, 2007
BIOS disappears
I'm putting an EIDE drive in a 7-year-old server, which has SCSI disks from that time -- still working, but they're very small.
There's only one startup setting I need to change:
I hit "delete" to enter the "CMOS Setup Utility".
I go to "BIOS Features Setup".
The setting I need to change is "HDD Sequence SCSI/IDE First".
I need to set it to SCSI, which is still the boot drive. The default is IDE ... the shop that made the server didn't need to change this, because there were no IDE drives ... they should have, but oh well.
But, inexplicably, sometimes, the system doesn't boot up properly. What's up?
Oh. 7-year-old server. The little CMOS backup battery is dead. I've been turning the machine off at the power strip, and it doesn't get the 3 volts it needs to keep my one change to the BIOS ...
There's only one startup setting I need to change:
I hit "delete" to enter the "CMOS Setup Utility".
I go to "BIOS Features Setup".
The setting I need to change is "HDD Sequence SCSI/IDE First".
I need to set it to SCSI, which is still the boot drive. The default is IDE ... the shop that made the server didn't need to change this, because there were no IDE drives ... they should have, but oh well.
But, inexplicably, sometimes, the system doesn't boot up properly. What's up?
Oh. 7-year-old server. The little CMOS backup battery is dead. I've been turning the machine off at the power strip, and it doesn't get the 3 volts it needs to keep my one change to the BIOS ...
Sunday, January 28, 2007
In a deadirectory
After some apt-get update and apt-get install, I get this funny error message when I try to restart apache:
"shell-init: could not get current directory: getcwd: cannot access parent directories: No such file or directory"
But the command runs fine.
Something felt familiar ... oh right. This is a UNIX error message for "you are in a directory that no longer exists".
"shell-init: could not get current directory: getcwd: cannot access parent directories: No such file or directory"
But the command runs fine.
Something felt familiar ... oh right. This is a UNIX error message for "you are in a directory that no longer exists".
Monday, January 01, 2007
Mysql broken increment
Changing table names, I changed the name of the primary key as well, and forgot to set all the attributes.
If you don't, things start to break, because the attributes aren't "saved" for you in any way. For example, the auto-increment stops working, the table is no longer functional, and you get this error:
Duplicate entry '0' for key 1
To fix this, add the attributes to the primary key field. This won't hurt the values (at least, it didn't for me):
alter table X change column key_name key_name int(12) unsigned not null auto_increment
If you don't, things start to break, because the attributes aren't "saved" for you in any way. For example, the auto-increment stops working, the table is no longer functional, and you get this error:
Duplicate entry '0' for key 1
To fix this, add the attributes to the primary key field. This won't hurt the values (at least, it didn't for me):
alter table X change column key_name key_name int(12) unsigned not null auto_increment
Subscribe to:
Posts (Atom)