Category Archives: Programming

How to change file permissions after SVN UPDATE

I was frustrated because SVN takes umask to assign file permissions for the user and I had one file that needed different permissions to run. After researching for a while at the best approach, I decided to create a 3 line bash script to do change the file permissions afters the svn update.

I named the file so running bash from shell changes the directory to public_html, updates the files, and then changes the permissions of the index.php file.

This is not meant to be an elaborate solution, but hopefully will point someone to a direction quicker that it took me.

Solved X11 GUI not working in putty

I was having all kids of issues trying to get a RETS server admin GUI display up and running. It uses java and the first error I was receiving from the command line was

Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.

I am sshing into the server with putty on Windows. The error above led me to download and install Xming. After downloading and installing I went to Putty > Connection > SSH > X11 > Click enable and set display location to

Still no dice. It wasn’t getting any error in putty window, but learned if you right click putty window > Event Log will give you tons of information. I found this gem:

2013-11-03 17:20:26 Remote debug message: No xauth program; cannot forward with spoofing.

of course, xauth wasn’t installed. I ran the follow to install and had gui up in no time.

yum search xauth
yum install xorg-x11-xauth

Another thing to look at is your sshd_config make sure you have the following set X11Forwarding yes

Finding the Google Places Reference String

The illusive Reference String. A client needed to pull their reviews from google and after research I found out that I needed to use the getDetails() method to gather this information. Upon going to their API docs, I was left with this

This method takes a request, containing the desired Place’s reference value.
If only they told you how to get the value…ugh… After playing around with it, I found that the textSearch() method included this value in its response. I put together a client side script that uses a jQuery geocomplete plugin to get the lat/lng to pass the textSearch() method to retrieve the Reference String. You only need to know the address of place you are searching for.

I am not going to provide the script for it, but if you view source you can pull the appropriate code. ——> Find Google Places Reference String Now

How to add a favicon to Yahoo Store Checkout

If you want to add your own custom favicon to your store checkout then follow these 2 simple steps.

1. Upload your icon to the “files” section of your account and copy the https:// version. This way you won’t get a security warning at checkout. note: IE pretty much only accepts .ico and .jpg so if you are trying to tailor to the 12.1% market then you will want one of those extensions.


2.ย Then on each of your checkout pages you would put the following in the “HTML Head Section” note: I am using single page checkout, but all checkout pages need the code for it to show up on all pages of checkout


You could also paste the two lines of code above into your “Head-tags” global variable in the store editor to have a favicon on call pages. Good Luck ๐Ÿ™‚

Save remote image to server with PHP

I was working on a project where I was using an API to connect to Amazon to pull book details via ISBN. I needed to store the remote images on my server to be associated with the product that was being created and I put together these few lines of code to do so. It obviously will need to be reworked for your own needs, but the logic is below.

If you wanted to use directories on server you could (remove the last line above and) do something like

This WordPress code tag BS is pissing me off and I will be finding a plugin to allow all this to be copied and pasted easily ๐Ÿ™‚