Doug’s Blog

Handily dispensing information to .00000001% of the world’s population

Archive for the ‘Websites’ Category

Disable search in google chrome address bar

Thursday, July 14th, 2016

I dislike how Chrome has turned the address bar (also known as a “location bar” or “URL bar”) into an “Omnibox”. Since I run Chrome on my Linux box, and I have a bunch of test hosts defined in my /etc/hosts file, everytime I try to shortcut by just typing a dev hostname, Google pops up a damn search result!

There are some posted methods to avoid this. One was to check chrome://flags, which does have a bunch of nice settings, however my version of Chrome DID NOT have the one to do this!

Instead I found that creating my own search engine option was the solution. Go to chrome://settings/ and choose “Manage Search Engines”. In there, add a new one with “none”, “null” and “http://%s” as the options.

Boom! No more annoying forced search! Suck it, Omnibox!

OK, deep breath.

Amazon S3 forcing streaming or download

Wednesday, July 6th, 2016

When you upload MP3 files into AWS S3, they will default to being a content-type that browsers will treat as a download (I believe “octet-stream”). If you want to change this so the delivery will be streaming, you need to change the content-type to “audio/mpeg” via the AWS console by editing “Properties” -> “Metadata”:

And if you want to revert back to forcing download, just remove the content-type metadata — note that there is no pulldown value for octet-stream!

Bootstrap Button Text Word Wrap

Monday, June 20th, 2016

Using bootstrap to display button pulldowns, http://getbootstrap.com/components/#btn-dropdowns, I had trouble getting the text to wrap and make the button taller as needed. The fix was adding this to the CSS for the button!

white-space: normal;

Change back to the old Google icon

Friday, September 4th, 2015

My opinion is that Google made a huge mistake with the new name “Alphabet” — they should fire the marketing people behind that concept, who no doubt must have had a bad experience mixing Redbull, Ecstasy, and AlphaBits. I mean, hey, I get it, when in Vegas — but wait until after you sober up before renaming the company.

Anywho, the thing that really gets me upset is now there is some new horrible favicon that google uses and it looks out of place on my chrome browser tabs now. This new google icon is distracting, too busy, and insults any reasonable sense of aesthetic. So, here is how to change it back!

Download the Favicon Changer chrome extension (I use chrome, but I think there are versions for other browsers if you look around). Visit google.com, and when you use the extension you’ll have to give it a URL to your chosen favicon, I have a sample on at http://dougco.com/678934759.png — if you don’t want to see a broken https link for https sites, you’ll need to give a SSL URL, like https://dougco.com/678934759.png

There, now your browser tabs are more serene.

Google Maps API stopped working on IE

Thursday, February 19th, 2015

Just got reports today from customers that websites with Google Maps Javascript API stopped working, and it seems Google made some changes a day or so ago.

I found a link that had helpful information, http://stackoverflow.com/questions/28582943/google-maps-v3-19-wont-load-using-embedded-vb6-browser and the exact fix that worked for me was adding this META tag:

<meta http-equiv=”X-UA-Compatible” content=”IE=EDGE” >

Webmail on Linux

Friday, July 6th, 2012

I maintain my own mail server and for cases where I can’t easily connect directly with an IMAP mail client, I use a webmail interface.

I’ve been using SquirrelMail for a while, and just recently installed Roundcube webmail which looks worlds better!

The only drawback is that it does not have vacation plugin that works right away with Dovecot, so I’m still playing around with that functionality…

Running root commands in PHP via Apache

Friday, April 29th, 2011

I have a web application that needs to perform shells commands as root within a PHP function, and you would think that would be pretty straight forward… but it did take my a few googles to get all the details, so here are my handy notes on it. This is on a Linux system running Apache, and we’ll be using “sudo” within “shell_exec” to run the commands.

The main thing is to edit the /etc/sudoers file, and typically you can (as root) use the ”visudo” command to do so.

Make sure apache can run commands, AND not require a password:

apache  ALL=(ALL)       NOPASSWD: ALL

Then you need to comment out this line:

#Defaults    requiretty

If you don’t, then you will see these errors in /var/log/secure: “sorry, you must have a tty to run sudo”. Now you are ready to go, and the PHP code is simple:

$results = shell_exec(‘sudo date’);

Changing to PHP5 in Yahoo Web Hosting

Friday, January 28th, 2011

I was updating some code on a Yahoo hosted site, and it wasn’t working because Yahoo will default you to PHP4 on their hosting. My code of course requires PHP5.

I spent a fair amount of time searching around for an answer and finally found it at http://help.yahoo.com/l/us/yahoo/smallbusiness/webhosting/php/php-38.html

I was surprised at how difficult it was to find this switch option! After I made this post, Yahoo support replied to give me the proper link and some more information, which I must compliment Yahoo support for doing.

http AJAX fails in Internet Explorer

Friday, December 3rd, 2010

I ran across an interesting bug recently where I had an AJAX routine failing when I viewed the page in IE8. When you clicked the little warning icon in the lower left, it gave a message of “Object doesn’t support this property or method”!

It was failing around code that looks like:

function parseCalcResponse() {
if (http.readyState == 4 && http.status == 200) {
results = http.responseText;
results = results.split(“|||”);
document.getElementById(‘test’).innerHTML = results;
}
}

It turns out, the fix was to declare “results” at the top of the function code with:

var results=”;

And that fixed it!

Ontok’s domain has expired!

Tuesday, June 9th, 2009

I’ve been using ontok’s API for geocoding for a few years now, and all of a sudden my routines were getting errors! It turns out their domain expired!

I’m not sure why they let that happen, I’m hoping they just didn’t pay attention and it will be back up soon. Maybe I should just call Sourabh! :)

Domain Name: ONTOK.COM
Created on: 20-May-05
Expires on: 20-May-09
Last Updated on: 20-May-08

Administrative Contact:
niyogi, sourabh  niyogi@mit.edu
humdaq, inc.
55 Grove St
Somerville, Massachusetts 02144
United States
6177641078      Fax –