This may be obvious, but gave me a headache, and I couldn’t find an answer anywhere online.

In the above example an sftp connection is made, and we attempt to scan the root directory. In many cases (especially with shared hosting), this won’t work, and depending on your error reporting, may tell you that you have insufficient permissions to look at this folder. After some searching, I found one possible solution was to change a small part of the second line, like so:

While this “worked,” I was able to view the contents of the server root, but none of my files. In this case (Hostgator shared account) I tried to access the ‘/home’ directory, but again was told I have insufficient permissions.

The solution is rather simple, I just hadn’t considered it (and it seemed no one else had my problem):

My problem had been trying to access the home directory, and not my home directory.

Occasionally I’ll need to update an image on a page that has some javascript involved. In those cases, rather than saving the image, reloading the page, and then doing whatever interactions I would need to do to get that image to be visible again, here’s a quick tip to get Chrome to reload the image inline.

Right click on the image URL and choose "Edit Attribute"

Right click on the image URL and choose “Edit Attribute”

Inspect the image you want to refresh, right click the ‘src’ attribute and choose ‘Edit Attribute’. Once editing the ‘src’ attribute of the image, simply append a query string (I often just use “?1=2”). If there is already a query string, just append another one (“&1=2”). This will make Chrome reload the image, and you should see whatever changes have been made without having to reload the whole page.

Simple utility function to append a string to a filename. Requires file name/path and string to be appended. Returns full path with new name.

UPDATED 2015-06-23: Justin pointed out a bug that would occur for paths that contained the filename. I’ve updated the function to handle those cases based on a suggestion from him.