PLEASE NOTE: Using this script may make your wordpress installation unusable, it's just a find/replace script, it does NO error checking or verification!
I’ve written a small php script that allows you to search for all instances of a string recursively through a directory tree and replaces the results with another string, it can be used to debrand a wordpress in the default mode but there are certain files within a WP install that need to retain the “wordpress” so be careful and BACK UP your installation first.
Your system should have perl installed to use this. Note too that this won’t change your DB entries so any instances of the string within posts for example will remain, this will only change FILES i.e the php files that serve WP etc etc.
Simply open the extracted debrand.php file and alter the appropriate search strings then upload to your directory of choice and navigate to it.
I think this file should come with some warnings though.
- Don’t typo the search string!
- It’s CASE INSENSITIVE so WordPress is the same as wordpress or WoRDPReSs
- It’s RECURSIVE so all child folders of the one you are in are affected.
- I take no responsibility for the use of this script by inexperienced users, other than the responsibility of insisting you BACK UP your database and files before using the script.
Still interested?
Get it here (Downloaded 25 times) | Signature
I’ve seen a load of scripts to do this but they all seem overly-complicated imo. In the spirit of KISS I’ve run off a simple php script to do just this. (I don’t know why there’s no built-in function in php listdir($dir,SORT_TYPE) kinda thing, but there isn’t.
So here’s my offering… (Downloaded 43 times) | Signature
Toggle Code
<?php
$files = array();
$path = getcwd();
$handle = @opendir($path) or die("Error opening $path");
while ($file = readdir($handle)) {
array_push($files,$file);
}
sort($files);
foreach($files as $key => $file) {
echo "<a href='$file'>$file</a><br/>\n";
}
?>
Here’s another weird script I’ve done for linux & PHP.
It’s a very simple web interface for the linux “beep” program. You give it a sequence and your system beep plays the sequence.
first do a sudo apt-get install beep
then save the file to your web dir and play with it:
Get This Script(Downloaded 112 times)
If my linux machine is up you can see it in action at http://billy.thruhere.net/musicalbeep.php. Remember you won’t hear anything at that site, I will!
@Clarkee21 was looking for one, seems there are many online versions available and many single-page versions available but less easy to find are offline whole site validators. So I did a very simple one in PHP.
You need to install the htmlhelp validating proggie…
sudo apt-get install wdg-html-validator
Then save this as validate.php into the webserver folder you want to hit…
<?php
$path = dirname(__FILE__) ;
$dir_handle = @opendir($path) or die("Error opening $path");
echo "<h2>Validating ".getcwd()."</h2>\n";
while ($file = readdir($dir_handle)) {
if( is_dir($file) ||$file == ".." || $file == "." || $file == __FILE__ || strrchr($file,".bz2") == ".bz2" || strrchr($file,".png") == ".png" || strrchr($file,".jpg") == ".jpg" || strrchr($file,".gdf") == ".gdf" || strrchr($file,".JPG") == ".JPG" || strrchr($file,".gif") == ".gif" || strrchr($file,".exe") == ".exe") {
continue;
}
system('validate --verbose '.$file);
echo "<hr/>\n";
}
closedir($dir_handle);
echo "\n<h2>Validation Complete</h2>\n";
?>
and navigate to localhost/your/path/validate.php and see how you get on.
If my linux box is on you can see the results here (I recommend viewing source to easier read the output)
You can probably see the line where I parse out file types I don’t want checked, alter that to suit your setup. Possibly easier to just put the type(s) you DO want checked in there!
That’s a long winded title isn’t it, but the point is this. I sometimes want to redirect different users to different pages of a site, however using a regular header() redirect meant that you weren’t passing through any $_GET variables as they came in.
So I wrote this small workaround script to forward whatever GET variables were passed in to the page from which I’m redirecting.
Get it here (Downloaded 141 times) | Signature
Seems to work like a charm. It could even be expanded to forward all $_REQUEST parameters in their appropriate format I guess but $_GETs are fine for my needs.
Here’s a bash script that does exactly what it says on the box.
the key line is
shred -uz *.*
which tells linux to remove all files that have extensions from the folder from which you are running the command. It overwrites the files 26 times with jargon, then recursively renames the files with decreasing numbers of zeros to leave them un-get-backable!
So get the script, make it executable, put it in the folder you want to cleanse and run it!
Get it here (Downloaded 139 times) | Signature
Toggle Code
#!/bin/bash
#############################################
# #
# Billy's Linux File Shredder. #
# #
# http://billy.the-kid.org/myscripts/ #
# #
#############################################
shred -uz *.*
Xdialog --title "Shredder" --fixed-font --msgbox "Shredding Complete!" 8 50 ;
My Linux based PC is currently in storage. This means that the iTeddy video converters are currently offline for the foreseeable future.
I will be looking at somehow hosting them on this web-host but I’m not sure that’s even possible as I don’t have direct privileges to install the software that’s required. I will look into this further and apologize for any inconvenience this is causing.
…make it easier for you that is.
I ended my last post with the question
“Couldn’t make it easier than that could I?”
Well after some productive typing I’ve created another form which will handle conversion to .amv and extraction to .mp3 on uploaded videos. Not only this but if you enter a YouTube URL it will skip over to YouTube, grab the video directly and do the conversion(s) for you.
So here it is:
This saves you time as this PC can download the video from the site instead of having to wait for you to download then upload it. If you have a slow connection that could be ages! (not that my connection is anything to brag about!)
You can find this form here.
Now, I really can’t make it any easier can I?
PLEASE NOTE: Reading this from outside the UK? Ignore this post!
I would like to point out to those who may be not reading the comments that you DO NOT need a TV license to surf the net or own a PC or even a TV.
You only need a license to "WATCH or RECORD TV as it's being shown live".
Providing you're not watching or recording live TV you can have as many tellies etc. as you like without requiring a TV license.
(In researching this post I DO have a UK TV license!)
This isn’t particularly techy or geeky but since I closed my personal blog I’ll put it here as it’s ‘just’ internetty enough!
According to the TV licensing site you need a license if you watch TV ‘as its being shown live’ no matter which medium you use, be it a PC with a TV card or a TV itself. The wording being
You must be covered by a valid TV Licence if you watch or record television programmes as they’re being shown on TV.
Interestingly though, until recently(and I’ve not bothered to verify, favouring writing this blog post on it instead) you needed some sort of hardware designed specifically for the reception of TV signals. Now however that wording revision, backed up on this BBC page*, means that you need a TV license IF YOU HAVE INTERNET ACCESS AT HOME!! (as that’s live streaming at the same time as it’s shown on TV.)
Alternatively that wording could be construed to mean that you need to actually WATCH TV now to require a license. In which case I have a TV, digibox, PC and VCR, but since I’m not recording or watching I need no TV license?? I wonder which version the authorities favours…
Anyone wanna start a revolt?
*-clicking this link requires a TV license!