The Power of SED

I use pydio on a few of my servers for sharing files.  Recently, on one of them, I decided it would be good to move the document root for the site.  Everything seemed really great, until I started getting reports of files that were shared earlier were no longer working.

Seems that when you share a file, pydio creates a tiny php file that gets stored in /your_doc_root/data/public

Inside that php file, onf of the things that you find is a line that says,


So, when I changed my doc root from /usr/local/www/apache24/data/admins/ to /usr/local/www/apache24/data/, things stopped working.

If you only had one or two files shared, you could just go in and edit each of them.  I had hundreds to deal with.  Luckily for me, my google-foo was excellent today and I came across an excellent post about using sed to replace text within files.

Long story short, for me to get rid of the offending “admins” in all of the shared files, I just needed one tiny sed command.

sed -i '' -- 's/admins\///g' *.php

You would want to cd to the data/public folder, then issue that command.  Doing so will look in all files in that directory ending in .php and replace anything that is “admins/” with nothing.

Happy day!  Thank you internet!


If I build it

I have the opportunity to build a server for a company that I’ve been doing some freelance work for.  It will mostly be a file server.  Originally it was just going to be an easily expandable archive/backup of digital images. Lots and lots and lots of digital images. (3-4 TB, I know…to some of you that isn’t very much) It was really only going to be accessed by a single employee on a daily basis.

Given that brief description of desires, I thought a FreeNas box would be perfect. Set up a VPN, a ZFS filesystem and some shares and be done.

Now, things have changed a little. The thought has been brought up that maybe the fileserver should become the primary repository for images. Currently all images are uploaded to the “cloud” by the various photographers and then downloaded to a disk as a backup. The “cloud” provider has been having some performance issues lately and has negatively impacted the back of house production workflow. Thus the idea to switch things up.

So the question is, does it still make sense to use FreeNas? The main issue as I see it is there is a desire for a super simple user-friendly way for all the photographers to be able to upload images to the fileserver. I thought that SFTP would be a winner, but sadly, some of the locations that the photographers shoot at have restricted web access. Also, the photographers have had problems in the past with FTP.(operator error mostly, but still a real issue) That makes me think that WebDAV might be a good solution, as it runs over port 80. However, I’ve had problems with it when trying to use certain OS’es to access a webdav share. For example, the apache webdav implementation under FreeBSD 8.x does not play nice with Mac OS X 10.6.x.

Another thought is to have all the photographers connect to the VPN and then do standard file sharing. That will mean running the VPN over a non-standard port to get around the restrictions at some of the sites. Not a deal breaker. However, I am not looking forward to trying to train all the photographers on how to use the VPN.

Last thing that I’ve looked at is a solution like ajaXplorer. I have no experience with this type of web software other than playing with it for an hour in a FreeNAS VM. It might be the best solution…just don’t know enough about it to make an educated decision.

So, if anyone is out there and listening, I could use some advice.