software
Fixing permissions after a Wordpress prefix change
Let’s say that you renamed your Wordpress tables.
There may be several reasons for this. For instance, you installed Virtual Multiblog to support more than one blog with the same setup.
And now, you are facing the dreaded “You do not have sufficient permissions to access this page”
What to do, what to do?
Turns out, after some research, I found out that there is a proper procedure for us lazy webmasters:
1. Download the force-upgrade script and run it. It’s a fairly old script but since it all it does is invoke Wordpress’ upgrade mechanism, it still works very well with 2.7. I know, it’s not an upgrade! But you can also run the script to right some wrongs…
2. Using your favourite SQL editor, edit the “usermedata” table. Let’s say that your old table prefix was ‘wp_’ and your new prefix is ‘wp_new_’ you would type this simple SQL command to make sure that your first user is still admin:
update wp_new_usermeta set meta_value='a:1:{s:13:"administrator";b:1;}' where meta_key='wp_new_capabilities' and user_id=1; |
You’re all set.
If you enjoyed this post, make sure you subscribe to my RSS feed!
A quick-fix for the Tweetback spam issue
I do not get it. I am a big fan of Smashing Magazine and I think that it was very nice of @jdevalk to write a plug-in that gives us full control over “Tweetbacks”. See this blog entry.
Where Smashing Magazine and the author lose me, though, is that I have not seen any reaction, either on the magazine’s web site, or the author’s blog, regarding the issue that many blogs who installed the plug-in seem to now be suffering: they are being inundated with thousands of spammy Tweetbacks, most of them containing text like “This is a test”, presaging a potentially much more virulent attack when the spammers get their tool working.
In fact, it may not be spam, but simply some tests gone wrong, but whatever the reason it caused grief to many blog owners — including me.
After de-activating the plug-in, here is the SQL command you can use to get rid of these Tweetbacks:
delete from wp_comments where comment_author_url like 'http://twitter.com/%/statuses/%'; |
If you do not have access to your database, contact me, I may end up writing a short plug-in that will wrap this query.
Again, I really like Smashing Magazine and that is why I am very surprised by their silence on this issue.
If you enjoyed this post, make sure you subscribe to my RSS feed!
Six Resources To Study And Master Git Source Control
It’s no secret that Git, as a source code control tool, has become quite popular in 2008, in part boosted by the success of the socially oriented github.com Here is a list of six resources that will help you get more comfy with Git, whatever your current knowledge of the tool. Let me know if you think that, after reading these six documents, you can still point to a few stones left unturned.
3 Reasons To Switch To Git From Subversion
A to-the-point document, created by Mark McBride, that covers several scenarios and for each scenario, shows how Git could make your life easier if you are not using it yet.
My Git Cheatsheet
A concise guide for the absolute beginner who wants to hit the ground running. Go through the exercises and you will end up with a pretty good picture of what Git can do.
Everyday GIT With 20 Commands Or So
A quick cheat sheet: start with the section corresponding to your role (individual developer, contributor, integrator…) You will not learn a lot about Git’s philosophy, but you will certainly get the job done.
Git Magic
Ben Lynn wrote a whole book covering not just cloning and branching but also some precious recipes: What to do when something goes wrong? What if my commit is too big? Remote access magic, history digging…Even Git’s shortcomings and their workarounds are covered.
Git from the bottom up
John Wiegley makes a convincing case that approaching Git from a 10,000 ft level is not the best way to understand the tool’s philosophy. Rather, building your knowledge of the tool based precisely on the very concepts that it uses make it much easier to get an overall grasp of Git’s world.
Using Git to Maintain Your Website
Using source code control has always been an effective tool to maintain a web site, especially avoiding these “Uh-oh I clobbered something I shouldn’t have” moments. But Git is particularly well suited to this task, due to its self-sufficient nature. Daniel Miessler shows us how to do just that using Git hooks.
If you enjoyed this post, make sure you subscribe to my RSS feed!
A very geeky Holidays break
Was your break as geeky as mine? Come on, admit it: you’ve done at least one incredibly unsexy thing in the last couple weeks. I know I have. Well, in fact, I had to take a four weeks-long break and it shows in the number of silly things I’ve played with.
In no particular order:
- I improved this blog’s look — well, I like to think that I have:

- I finally created a personalized Twitter page:

- I also created a Twitter page for Twitterified:

- I created an icon set call “More Blaqua“:

- I added a drawer to the Twitterified client – you will see why sometime in January, hopefully!

(Oh, and I finally mastered transparency in Flex, too! Yay)
- I started separating nextBBS v2’s components so that the framework can be used on its own and the message board part is now a module.
It is the first MVC PHP framework that seamlessly support plug-ins.
- I added to nextBBS v2 a limited amount of compatibility with Wordpress plug-ins.
I re-read Getting Things Done by David Allen and made a new year resolution to stick with the program, this time.
So far my Inbox is empty and my tasks list still is a manageable size…
I have installed Medialink on my iMac and use it to stream Divx movies to my PS3. Works flawlessly.
I have also installed PlayOn! in Parallels to stream Netflix. I wish there was an equivalent program for OS X. Well, I “kind of” wish because Netflix’s streaming choice is not that exciting. Not to mention that Netflix innovates by being, to my knowledge, the first company to proudly blog about letting go 50 employees.
- I setup an old P4 with Nexentra. The project bills itself as “The land of free and open source distribution combining OpenSolaris kernel with Ubuntu userland.”
In fact I installed it because I wanted to create a ZFS array. Unfortunately the clunky old PC is way too noisy. Fortunately I realized that a read-write implementation of ZFS for Leopard is available at Mac OS Forge.
- I cancelled XM Radio. They had been annoying me for quite a while, inserting their stupid advertisements in talk radio channels, and now that they merged with Sirius they got rid of some channels I happened to like so, good riddance XM, welcome free radios on my iPhone! — and ironically but quite logically I have better reception in tunnels.
If you enjoyed this post, make sure you subscribe to my RSS feed!
GMail is the new Mutt! Shortcuts galore.
I know, it’s a bold assertion. But, please, bear with me: as a longtime Unix-head, I need a tool that allows me to zoom through my emails rather than click-glance-click-glance-click-yawn-right-click-delete, etc.
For years I’ve been happy with Mutt because nothing compares with using the arrow keys to navigate through my emails, ALT-O to open a folder, SHIFT-O-R to do a reverse-sort, M for a new message, etc.
That, and using Visor, give me the comfort of a HUD-based email management tool whose speed is quite unbeatable.
Unfortunately, with today’s evolution of mail, everything is more or less HTML-based, which really doesn’t work well with Mutt — even using V to open in a text-based browser isn’t that good. If I ask Mutt to open a full-fledged browser instead, there goes the speed advantage…
So, I have reluctantly moved to a pure Google Mail solution and my experience has been positive so far: I run GMail as a standalone program using Fluid — on another platform I would use Prism — and I can keep using keyboard shortcuts for all my tasks!
If you wish to give it a try, start with only this subset of GMail’s keyboard shortcuts: JKEX#[ENTER]U are all you need to replicate 99% of your Mutt experience…
K/J: cursor up/down
X: select message
E: archive messages
#: delete messages
ENTER: read message
U: back to messages list
If you enjoyed this post, make sure you subscribe to my RSS feed!
Google Chrome: an index of what developers need to know (good and bad)
For quite some time, some of us have heard a very persistent rumor about the new Google browser. Well, here it is. And by that I mean: now. Well, tomorrow. And when you see some of the technological pieces it incorporates, it is definitely months ahead of the other guys (Javascript, you are so sexy!)
You can find the official announcement here.
Philipp Lenssen, at Blogoscoped, does a good job of listing the visually appealing goodies offered by Chrome. He even scanned and posted the comic book he got in the mail.
Here is, for your convenience, a list of what’s exciting for developers (oh yeah, it’s open source!):
Each tab runs its own process. Why, in this day and age, should a modern application that will remain open for days or weeks, stick with a memory model close to that of dinosaurs like VxWorks?
It’s WebKit + the V8 JavaScript VM. With a JIT compiler and all the optimizations offered by a VM, we should start seeing JavaScript performance close to that of native languages. Unfortunately, the DOM is not mentioned. Ideally, all DOM manipulation should be also compiled (with the possibility of inlining, etc)…we will know more as soon as we run some tests.
V8 uses aggressive garbage collection. OK I was a bit dishonest in the previous bullet point. This is a bit less exciting than some might think. Yes, there is a cost with conservative collection, since the gc needs to go through the execution stack and identify pointers heuristically and it is impossible to keep track of actual space allocation. Oh, and no generational collection…so, wait, it’s great that we don’t do that, right?
Well, I do not think that it’s the cat’s meow the Google guys are claiming it to be. Precise pointer housekeeping means that your program may incur quite a dramatic overhead, which of course depends on your program’s structure. For instance, one of the advantages of garbage collection is to reduce the need for synchronization in multithreaded programs. Precise housekeeping, however, requires the re-introduction of safe points, which force the compiler to synchronize bits of code where it is safe to reclaim memory. This would explain why some existing benchmarks show the new JavaScript VMs as not performing so well when simply running dumb loops as opposed to performing lots of local allocations.
Tabs run in their own sandbox. That’s certainly a proven security model and it makes it very hard to meddle with another tab’s content. Note that plugins are exempt, however. I wonder if frames are sandboxed,because if they are this is going to break a great deal of pages, just like AIR does.
Google Gears comes standard. Well, it’s no surprise. But it certainly makes me wonder if I want to change the browser requirements for the professional applications I am working on. After all, it’s been proven that Gears can really help desktop-like applications scale more easily.
OK, that’s what I have for now.
Oh, just a last, non-technical comment: I hope that regular users do not read this page and take its content literally. It makes it look like scammers “send users to a nearly exact copy of their bank’s website” and shows a somewhat different URL. People need to be made aware that they could actually be sent to the VERY SAME link as their bank’s and still fall prey to a scammer, since it is possible to fake that link’s destination through DNS poisoning.
If you enjoyed this post, make sure you subscribe to my RSS feed!
How To Make The EFF ISP Throttling Tool Work On Leopard
I love the idea of Switzerland, the new EFF tool for checking ISP throttling; unfortunately as of release Zero.0.5, Leopard seems to still be a mere afterthought. Here is how I worked around the few things that were not working out of the box.
First, Switzerland is written in Python and will require Psyco. It’s a good thing since Psyco is all about performance. If you do not have it already installed:
svn co http://codespeak.net/svn/psyco/dist/ psyco-dist cd psyco-dist/ sudo python setup.py install cd .. |
Download Switzerland from https://sourceforge.net/project/showfiles.php?group_id=233013
Extract it and change to its directory; eg
tar zxvf switzerland-0.0.5.tgz cd switzerland-0.0.5 |
The FastCollector provided doesn’t work. So…
rm bin/FastCollector.darwin |
Now when we build FastCollector, it will be available in /usr/local/bin/FastCollector
Here comes the only moderately scary thing for non-developers. Use the patch command to modify switzerland/client/PacketListener.py. This is the input for patch:
diff --git a/switzerland/client/PacketListener.py b/switzerland/client/PacketListener.py index 211b68f..dc0bbcc 100755 --- a/switzerland/client/PacketListener.py +++ b/switzerland/client/PacketListener.py @@ -93,8 +93,7 @@ class PacketListener(threading.Thread): p = platform.system() # Implementing the recommendations from # http://www.net.t-labs.tu-berlin.de/research/hppc/ - if p[-3:] == "BSD" or p == "Darwin": - print p + if p[-3:] == "BSD": cmd = ["sysctl","-w","net.bpf.bufsize=10485760"] try: # Recent FreeBSDs proc = Popen(cmd, stdin=PIPE, stdout=PIPE) @@ -110,6 +109,14 @@ class PacketListener(threading.Thread): proc = Popen(cmd, stdin=PIPE, stdout=PIPE) assert proc.wait() == 0 + elif p == "Darwin": + cmd = ["sysctl","-w","debug.bpf_bufsize=10485760"] + proc = Popen(cmd, stdin=PIPE, stdout=PIPE) + assert proc.wait() == 0 + cmd[2] = "debug.bpf_maxbufsize=10485760" + proc = Popen(cmd, stdin=PIPE, stdout=PIPE) + assert proc.wait() == 0 + elif p == "Linux": vars = [("/proc/sys/net/core/rmem_default", "33554432"), ("/proc/sys/net/core/rmem_max", "33554432"), |
Let’s build and install everything:
sudo python setup.py install |
Well, it was easy (if it worked!)
Let’s create a log directory for Switzerland:
sudo mkdir /var/log/switzerland-pcaps sudo chmod a+wx /var/log/switzerland-pcaps |
And finally let’s run it:
sudo switzerland-client |
or if you wish to run your own server (you need to advertise it too!)
sudo switzerland-client --server yourserveraddress |
Questions?
If you enjoyed this post, make sure you subscribe to my RSS feed!
Twitterified…at last!
I cannot believe that it took me so long to get my ducks in a row.
First, Twitterified was entirely written in Javascript, like most AIR clients. But some testing showed that rewriting in AS3 would dramatically increase responsiveness.
Then, I had to work on my web framework while creating twitterified.com. And finally I was only able to offer a decent video thanks to the overall godness offered by Vimeo.
But hey, here it is! For a limited period of time, if you go to the invite page and enter the code “nexus”, you will be automatically added to the private beta program.
Twitterified powers up your Twitter experience, allowing it to compete with the “new kids”: Pownce, Friendfeed, etc.
If you enjoyed this post, make sure you subscribe to my RSS feed!
Best Online Storage Service: adrive.com
Yup. I am completely, arbitrarily, crowning them “best service” in my book.
So, you may ask, what amazing feature are they offering, thus justifying my edict?
After all, my previous favourites were xdrive.com and box.com, both piling on announcements of sexy new features, such as an AIR desktop or widgets.
Well, here it is, in all its glory: more free storage space. That’s all. Where xdrive offers 5GB, they, no-doubt, did the math and realized that with storage space becoming an ultra-cheap commodity, they could give their users 50GB free.
So, that’s it. The killer feature: more.
Oh, and, icing on the cake, their web interface doesn’t suck. A mandatory requirement that some free providers seem to forget.
OK, now I’ve listed the whole package.
Of course there are some concerns that I hope they address soon: their “about us” page is quite laconic and they do not seem, like many other Web2.0 outfits, to have thought of a business plan yet. Well, their site offers ads for paid storage services -that so happen not to be theirs. Weird.
If you enjoyed this post, make sure you subscribe to my RSS feed!
Kodachi 0.5.1 now skinnable (and more)
Kodachi v0.5.1 is out! It’s good news for developers who want to write plug-ins or if you wish to change the look and feel of the application:
- A demo plug-in is now included. All it does is add a new direct word to Kodachi’s vocabulary: ‘Demo‘. Type it, select some action, and it will display a Growl-like notification confirming your action. A very easy starting place for budding plug-in developers.
- - Kodachi’s user interface is now skinnable. Actually this goes a bit beyond a simple skin as you can change its behaviour alltogether. Note that when launching Kodachi, you will now see the new demo skin, called ‘Bezel‘, that I created. If you are familiar with QuickSilver, this is certainly an interface you are already used to. If you wish to work with the old interface, simply disable the ‘BezelInterface’ plug-in.
- - The installer now checks which version of .Net is installed on your PC, if any, and offers to install the correct version if necessary.
If you enjoyed this post, make sure you subscribe to my RSS feed!












