0

Tech training: using Internet search to get what you need

You’re really motivated this time. No, pumped is a better word. And you’re absolutely ready to invest some significant time and energy into reaching your learning goals. There are all kinds of reasons why you just have to master “that” skill. What is it: Python? HTML? Linux? You’re ready to rumble.

Got a great how-to book or video course to work with? Check. Suitable environment for some serious skills’ practice (because you know that it won’t work if you just sit back and passively watch or read)? Check. But what will you do when you run into trouble: if you’re going to spend a lot of time playing with an unfamiliar software platform, there will be setbacks and you will need help.

Who ya gonna call? Google search, of course. Here’s how to make that call work for you:

Use your problem to find a solution

Considering that countless thousands of people have worked with the same technology you’re now learning, the odds are very high that at least some of them have run into the same trouble as you. And at least a few of those will have posted their questions to an online user forum like Stack Overflow. The quickest way to get at look at the answers they received is to search using the  exact language that you encountered.

Did your problem generate an error message? Paste exactly that text into your Google search engine. Were there any log messages? Find and post those, too.

How do you find log messages? On older Linux distributions, you could search through the /var/log/syslog file for events occurring around the time you encountered the problem. Alternatively, you could filter for a specific text string:

$ cat /var/log/syslog | grep filename.php

Some programs, like the Apache web server, have their own log files (/var/log/apache2/error.log on Ubuntu 14.04, for example). Details about most HTTP and PHP problems will eventually end up there.

On more recent Linux systems that use the Systemd process manager, logs are handled by journald. You can simply run journalctl and filter for a likely text string:

$ journalctl | grep filename.php

…or restrict your search to entries from within a specific time range:

journalctl --since "2016-02-14 14:25:00" --until "2016-02-14 14:35:00"

Once you find a likely-looking log entry, copy and paste it into Google and see what comes back.

Be precise

Google covers billions of pages of content from the entire public Internet, so your search results are bound to include a whole lot of false positives. That’s why you want to be as precise as possible. One powerful trick is to enclose your error message in quotation marks, telling Google that you’re looking for an exact phrase, rather than a single result containing all or most of the words somewhere on the page. However, you don’t want to be so specific that you end up narrowing your results down to zero.

Therefore, for an entry from the Apache error log like this:

[Fri Dec 16 02:15:44 2015] [error] [client 54.211.9.96] Client sent malformed Host header

…you should leave out the date and client IP address, because there’s no way anyone else got those exact details, and include only the “Client sent…” part in quotations:

"Client sent malformed Host header"

If that’s still too broad, consider adding the strings Apache and [error] outside the quotation marks:

"Client sent malformed Host header" apache [error]

search-timeBe timely

Google, through their “Search Tools” option, lets you narrow down your search by time. If your problem is specific to a relatively recent release version, restrict your search to just the last month or year.

Search in all the right places

Sometimes Google will do a better job searching through a large web site than the site’s own search engine (I’m looking at you: Government of Canada). If you feel the solution to your problem is likely to be somewhere on a particular site – like Stack Overflow’s admin cousin, Server Fault – but you can’t find it yourself, you can restrict Google results to just that one site:

"gss_accept_sec_context(2) failed:" site:serverfault.com

Know what you don’t want

Finally, if you see that many or all of the false positives you’re getting seem to include a single word (that is very unlikely to occur in the pages you’re looking for), exclude it with a dash:

writing scripts -movie

There’s really no end of helpful information waiting for you out there on the Internet. With just a little careful planning, you’ll be amazed how quickly you can get to it.

Leave a Reply

Your email address will not be published. Required fields are marked *