Archive for the 'Programming' Category

Sound after command in terminal has finished

Wednesday, October 6th, 2010

Add ” && say Finished “(ignore the quotes) after any command in OSX terminal and you will hear a voice say “finished” when the command has finished executing.
So a command like:

sudo find / -name hosts* && say “hosts files search complete”

Would alert you when the find command has finished searching for hosts files. This is a helpful trick when you don’t want to keep checking back at an executing command to see if it’s finished, or end-up forgetting you have one running.

Coda – Error code 37 – “Host Key Changed for…”

Tuesday, July 6th, 2010

Coda error code 37 is caused when a site’s ip address changes. This causes the SSH keys to no longer valid. It can be fixed by connecting via SSH with Terminal, inside Coda, and reading the response. The response will tell you what line needs to be deleted in the known_hosts file. The known_hosts file is located /Users/user_name/.ssh/known_hosts

Allow PHP to access files but not website visitors

Thursday, April 29th, 2010

Add the following to an .htaccess file, and all .php files under the .htaccess file will not be available via the web:
<FilesMatch "\.php$">
Order deny,allow
Deny from all
</FilesMatch>

The files will be available through PHP though. As PHP is not requesting the files through Apache webserver, rather is it requesting include files via the file system.

webcal link in IE

Monday, March 8th, 2010

webcal links (eg. webcal://www.domain.com/calendar.ics)will only work in Internet Explorer if Outlook 2007 is installed on the users machine. Office 2003 or earlier do not install the support required to make webcal links active.

“This page contains both secure and nonsecure items” IE fix

Tuesday, January 26th, 2010

Use a CGI proxy service on your secure site. Download CGIProxy. Upload to your sites cgi-bin folder (most hosting packages will have that set already). Once uploaded, change the permissions of the ‘nph-proxy.cgi’ file to 755 (rwxr-xr-x) Owner=Read,Write,Excute   Group=Read, No Write, Excute   Everyone=Read, No Write, Execute.
Visit the CGI script on your secure address: https://www.yoursite.com/cgi-bin/nph-proxy.cgi
Type in the address of the non-secure item you’re trying to show on your secure site. Uncheck “Show URL entry form”. Click “Begin Browsing”.
After the page loads, you can copy the address from the address bar, and it will be using your secure address.
Should look something like: https://www.yoursite.com/cgi-bin/nph-proxy.cgi/000000A/http/www.nonsecure-site.com/awesome-page.html
Now paste that address in your site and no more IE warning.