If you ever find yourself with a broken theme and can't even access the admin side of your wordpress blog, here's a quick way to get back on your feet.
Simply run the following query from the command line or via a tool like phpMyAdmin
UPDATE wp_options
SET option_value
= 'default'
WHERE option_name
IN ('template','stylesheet','current_theme');
(Make sure to select your wordpress database first, of course)
Sure. Your site looks like it was just setup 2 seconds ago, but at least now you can access all the GUI-licious tools of the WordPress Admin panel to fix whatever broke your theme.
careers
So you need to check if some string is a valid IP address. You could simply test it against a regular expression:
1 2 3 4 5 6 7
| function is_valid_ipv4 ($ip)
{
return preg_match('/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'.
'(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'.
'(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'.
'(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/', $ip) !== 0;
} |
Regular Expression obtained here
This will actually work for most situations, but it's lacking in a few ways. Suppose you want to exclude private or reserved IP addresses. Maybe you want to validate IPv6 addresses too; not just IPv4.
Enter PHP's Data Filtering Extension. It just works, and you don't have to worry about maintaining (or properly applying) complex regular expressions.
Read more...
content
Problem:
You've chosen the most simple, solid Linux server - Ubuntu 8.04 LTS, and you want to run the most simple, solid XMPP server - ejabberd. BUT, the version of ejabberd in Hardy's repositories is the really old (Sep 03, 2007!) 1.1.4 release.
Solution:
You could of course build ejabberd from source, but that's not why you chose the "It Just WorksTM" Ubuntu server, is it? Have no fear. A simple and (mostly) painless solution awaits!
Read more...
participate
Categories: Programming Tags: Administration, Ejabberd, Installation, Instructions, Jabber, Programming, Server, Tutorial, Ubuntu, Walkthrough, XMPP
23
103
28
7