Replace all copies of a file under Linux

Today, after making a change to a php file, I had to update all copies of this file with the changes. The following command will update all files with the same name. Note that this will only work as expected if the name is unique. A theoretically better way to do it would be to find all files with a certain hash.

Anyways, here’s the linux shell command. First copy the updated file into the current directory (/tmp for example):

find /target_path/ -iname "some_file.php" -exec cp new_file.php '{}' \;

June 15, 2011 at 12:22 PM in Linux

Smart Podcast Playlist

Create a smart playlist with all unplayed podcasts. By using this playlist you no longer have to find the next podcast on your iPhone whilst driving back home. Make sure that you include the smart playlist on the Podcast tab of your iPhone, iPad or iPod Touch.

Although this seemed a great solution in theory, there are some issues with this approach in practice. As diskspace on the iPhone is at a premium you will have to limit the amount of podcast data stored on your device. However, because there is not an option to keep 1 unplayed episode per podcast in the smart playlist editor you have to set the amount of diskspace used. When you have several podcasts and some are updated more frequently then others you will end up for some podcasts not being on your device and others that are continuously listened to. Therefore I opted for InstaCast which caches 1 episode per podcast and comes with continuous playback in its latest update.

June 8, 2011 at 3:49 PM in Windows