*nix quick multiple file search and replace

When originally setting up the blog, I needed to do a bit of reorganization for security purposes. Lots of CodeIgniter projects have the system directory browsable, and rely on a default index.html to shield the contents of the directory or its subdirectories. Adequate, but simple improvements are possible.

If I change the system folder name from system to .system: this makes it a dotfile which is hidden from browsing by default on almost all web servers (turns out to need a little configuration file help, but thought so at the time). A small change to the index.php to point to the new location and voila: improved security. No more browsing of the system directory, no worries that I'll accidentally expose something or someone will stumble on something. I can create arbitrary directories in the system folder without fear.

Unfortunately the view files for Open Blog (http://www.open-blog.info/) are all hardwired to use a specific path for javascript, stylesheets and images. Enter the shell:

for a in `find . -iname *.php -exec grep -l application/views {} \;`; do sed -i 's/application\/views/assets/g' $a; done

and we're done.

Note that the command is all a single line, so make sure to type the contents of the above without line breaks.

P.S. If you're looking to use your Android phone as a Bluetooth GPS device, checkout SolidSync Network/Bluetooth GPS in the Google Play Store or on the web at http://solidsync.com/networkbluetooth-gps.

Image

Need to send mail in a hurry?

Try Send Overnight Mail for your FedEx Overnight, USPS Priority Express or USPS Priority mailing needs. Send Overnight Mail is the easiest way to send overnight mail, online or offline: early-morning orders can even be sent same day!