If you edit text regularly and are interested in learning a highly efficient editor to make your work more efficient, definitely check our this great interactive vim tutorial. vim is a very popular editor for unix command line interfaces, although gVim is available for Windows and Mac too!
I run a Moodle installation that is backed by MySQL and authenticates users with an Active Directory (AD). Recently there was some reorganization of the organizational units (OUs) in AD and, upon attempting to log in to our Moodle site, I got this message:
“LDAP-module cannot connect to any servers: Server: ‘ldap://domaincontroller1.beyondlogical.net/’, Connection: ‘Resource id #2′, Bind result: ””
In my case, the user account Moodle uses to bind to AD had been moved and simply needed updating, which is simple enough to edit through the database once you know where to look. Here is the SQL query to return the value to be edited:
SELECT value FROM moodle.config_plugins WHERE plugin = 'auth/ldap' AND name = 'bind_dn'
Check the returned value against your AD tree and figure out what needs to change. It should look something like this:
CN=Bind AD Query,OU=IT Department,OU=Users,OU=Beyond Logical Enterprises,DC=beyondlogical,DC=net
Compare this with AD and figure out what needs to change. If you aren’t familiar with AD, this string specifies an account (CN means “Common Name”, OU means “Organizational Unit”, DC means “Domain Controller”) and, if you read it from right to left, provides a path down the AD tree to specify how to locate that account.
Here is the SQL to update this value, make sure you replace the value I provide with whatever is appropriate for your AD:
UPDATE moodle.config_plugins SET value = 'CN=Bind AD Query,OU=IT Department,OU=Users,OU=Beyond Logical Enterprises,DC=beyondlogical,DC=net' WHERE plugin = 'auth/ldap' AND name = 'bind_dn'
You may also see this error if the password on the account has changed. The current password is stored in this value:
SELECT value FROM moodle.config_plugins WHERE plugin = 'auth/ldap' AND name = 'bind_pw'
and can be updated using this query:
UPDATE moodle.config_plugins SET value = 'your_password_goes_here' WHERE plugin = 'auth/ldap' AND name = 'bind_pw'
I was upgrading Virtualbox on an XP host the other day and it seemed to stall toward the end. I hit “Cancel” and nothing happened, but when I logged off it politely rolled back its changes and quit. I tried it again, same thing. Then I realized I had dropbox running, closed it, and the upgrade carried on to completion. I’m guessing this is because virtualbox needs to restart the network interfaces and can’t do so while dropbox has a connection open. Why dropbox would hold a connection open instead of polling periodically is beyond me. I can confirm I wasn’t syncing at the time, so this is the normal state while the dropbox client is running.
echo “This goes to the clipboard” > /dev/clipboard
It’s that simple… usually. For some reason some program output going to STDOUT doesn’t end up there. There is a simple fix, that being to pipe it through cat first:
echo “This goes to the clipboard” | cat > /dev/clipboard
Upon upgrading to 3.2.8 and re-starting a client you might get an error message such as:
“differencing image not associated with parent”
“differencing but not associated with any parent in media registry”
“Parent medium with UUID x not found in media registry”
For some reason, inaccurate info ended up in your vdi file. VB is now more strict, and this inaccurate information just needs to be expunged to prevent VB from panicing. See this ticket for details:
http://www.virtualbox.org/ticket/7289
The short of it is: You download the tool for your host platform:
http://www.virtualbox.org/download/VBoxFixHdd/
“Identify the affected images. You can either use the VirtualBox GUI and check which base images are inaccessible, but shouldn’t be. The same can be done with “VBoxManage list hdds”, in this case make sure you only look at images which say “Parent UUID: base”.
Run the repair tool:
VBoxFixHdd –filename /path/to/image.vdi –zeroparentuuid
Repeat for all affected images.”
Worked like a charm.
The Soladey-J3X [toothbrush] has a solar panel at its base that transmits electrons to the top of the toothbrush through a lead wire. The electrons react with acid in the mouth, creating a chemical reaction that breaks down plaque and kills bacteria. The toothbrush requires no toothpaste, and can operate with about the same amount of light as needed by a solar-powered calculator.
(PhysOrg.com)
I tried downloading StarCraft II via the provided Blizzard downloader app, but pointed it to a partition that was formatted FAT32. Since the file is larger than FAT32 can hold (~4GB) the download failed. The downloader does not provide you with a way of switching the download location after you run it the first time; to do so, you need to edit the Windows registry. Here’s how:
Click your Windows “Start” button and select “Run”, or hold down the “Windows Key” and press “R”.
Enter “regedit” in the “Open:” dialogue box and press OK.
Press “Ctrl” and “F” to open the Find dialogue.
Enter “Blizzard Entertainment”. It should display a folder on the left entitled “Blizzard Entertainment”. Expand this folder by clicking the “+” to the left of it. You should see a “Downloader” folder. Expand this too. There should be a key with some random string of alphanumerics. Click on that.
In the right pane you should see a key that titled “Path”. Right click on that and click “Modify.”
Change the “Value data” to set the location for the download folder and press “OK”. Close RegEdit.
Enjoy!
Standard disclaimer: when mucking about in your registry, be careful, as you can bork Windows.
Suppose you want to take a picture of yourself laying down in the mud in front of a bulldozer. What side should the bulldozer be on when you take the picture?
Does the directionality of a person’s primary writing system (left-to-right, top-to-bottom for English) affect the way in which they take in other compositions, such as a photo or painting, creating a “perceptual directionality”? If so, should visual composition be informed by knowledge of the target audience’s perception directionality? After a brief search I came up with this paper, which seems to indicate that I’m not too far off the mark.
Writing Direction Influences Spatial Cognition
Now that doesn’t exactly answer the original question, although it does inform the decision of how to compose the shot.
PHP apparently lacks a function to return the byte length of a string, such as you might need for a Content-Length header. Assuming your PHP internal character encoding is a single byte charset (such as latin1 / “ISO-8859-1″) then the answer is the same as your character count and you could use strlen(). This is the default (in the US anyway) and will of course break should you ever change the internal encoding to a multibyte charset like UTF-8 and use the mbstring.func_overload faculty to transparently replace the non-multibyte functions with their multibyte equivalents.
In that case, mb_strlen() becomes strlen(). mb_strlen() is strlen() with support for different charsets, which may use different byte lengths for a single character. By default, it will use your internal encoding. However, it supports an explicit character encoding as its second parameter. Knowing that latin1 uses a single byte, mb_strlen($string,’ISO-8859-1′) will do what we want and count the bytes in $string regardless of your current internal encoding or the string’s apparent encoding.
Let’s wrap this in a function for clarity, and in case we need to change our counting method because of a change in PHP or some such helpfullness:
function bytelength ($string) {
// Returns: (int) number of bytes in string
// Use latin1 as a alias for "1 byte"
return mb_strlen($string,'ISO-8859-1');
}
Due to (a bug in) the way fonts are rendered in the “SQL Query Area” of the MySQL Query Browser[1], most of the fonts available end up looking clipped. Beyond aesthetics, you might want to change the default font due to its lack of support for UTF-8 characters. You can change the “Code Font” choice under Tools > Options > General Options.
I prefer Arial Unicode MS 8.3pt for default & data, but due to it rendering poorly in the code area I’m using Bitstream Vera Sans Mono 8pt as a tolerable alternative. Both support UTF-8.
[1] MySQL Query Browser 1.2.17 on Windows XP.
It’s not just an admonishment, it’s the name of a project I maintain at code.google.com.
test-more-php version 0.1 is out now and ready to help prevent hours of debugging with so little effort it’s ridiculous not to use it. The API is a direct port of the popular Perl Test-More library with some minor PHP adaptations. Both object and procedural interfaces are available, so pick your flavor and get coding!
I started test-more-php after getting sucked into writing PHP full-time and casting about for a testing library with the elegance I knew from Test-More. Eventually I discovered a few, but each was incomplete or failed me by silently bailing on an error that could have been reported appropriately. Test-More.php is a drop-in replacement for those other libraries and provides me with the confidence that, if something goes wrong, I will know about it.
I’ve tested it under Windows XP, Ubuntu Linux, FreeBSD and Cygwin but not OS X, so if anyone with a Mac wants to take it for a spin please let me know how if it passes all it’s tests. (Of course it comes with its own test suite!)
The title of this post at dagolden.com really struck me. The post, about a new CPAN client that doesn’t mimic the “swiss army chainsaw” mentality of the Perl community’s approach to software design, is apt in its critique not only of the project itself, but of its reception by the community. There is a religious type zeal some people express when shifting their allegiance from one idea to another that seems to compel them to attack the subject of their former allegiance.
This talk by Douglas Crockford, standard bearer of JSON, is an interesting history lesson on JSON’s origins. Douglas provides plenty of amusing perspective on JSON’s position as the popular data interchange format it has become and the landscape it evolved in. He seems to enjoy taking a “heretical” perspective, which is usually more fun to listen to in a tech talk, and this is no exception.One recurring theme that caught my attention was the aspiration to simplicity in the format, especially in comparison to xml. It’s a lesson worth revisiting.
Public service message: firefox 3 does not play well with self closed script tags.
I discovered this when I was repointing my jQuery libraries toward the googleapis hosted versions, to take advantage of their speed. I tested the switch in Opera, where it looked fine. Later, doing some debugging with firebug, I noticed those pages were no longer executing any javascript. Chrome had no problem loading them, and initially I thought the jQuery lib was the issue, but curling a new copy proved it was identical to my locally hosted version. Finally I noticed the difference in how I had self closed the script tags, which is perfectly legal… firefox 3 just doesn’t like it.
So I like the ajax.googleapi.com hosted libraries, although I don’t buy that using the google.load() method is better than pointing to the hosted library directly. Profiling the difference between two pages that do nothing more than load jquery shows that using google.load() adds about 0.2 seconds to the load time. Try it yourself:
Pointing directly vs Using google.load(). Which only makes sense, since loading the google api takes time… so where is the extra “power” they boast you receive by using this method? The only potential advantage I see is the ability to load the library conditionally, avoiding the load unless you need the library. I say potentially because I’ve yet to make use of that kind of just-in-time loading. If you have, or I’ve overlooked some strength to this method, I’d love to hear it.
One last googleapi related note: using a script tage to call your library, you can use https to load the file. The google.load() method appears to load files using http, which is quicker but poses a security risk by injecting insecure code into a supposedly secure environment. This is the same reason secure method pages should use the secure-only flag on cookies: you are only secure as your weakest link.
I’ve been running more PHP apps for virtualhosts lately, and one thing I dislike about such bundles is having a config file in the app root. For one, it’s sitting in the web root, and if improperly configured the server could serve it as content, posing a security risk (as they tend to hold database login information, passwords, etc.) The other reason is that I like to maintain a single copy of the app (via the FreeBSD ports tree, or from a single repository checkout.) I don’t want to make copies, because then I need to maintain each copy too, and I can’t just set the primary installation directory as the server document root, or alias a subpath to it, because each deployment would receive the same default config file. Any modifications to the application code, to make it look elsewhere for the config, would likely be lost in the next upgrade. So how can you share a single installation for multiple deployments?
The key is that the config file itself is usually left as-is during upgrades, as it is supposed to be altered by the user. We use this file to include another config file from elsewhere based on webserver variables.
For example, here is my config.inc.php for phpMyAdmin:
<?php
/*
Delegate to another file.
Set web server variable PHPMYADMIN_CONFIG_FILE to the file that would normally be located here (config.inc.php).
Under Apache, it would look like this:
SetEnv PHPMYADMIN_CONFIG_FILE /usr/home/rj/.phpmyadmin
Include the absolute path, or make sure the file is in the PHP include path.
Ensure that the file is readable by the account the web server runs under.
*/
include($_SERVER['PHPMYADMIN_CONFIG_FILE']);
?>
You now just need two lines in a virtualhost config to set up a new installation:
SetEnv PHPMYADMIN_CONFIG_FILE /usr/home/$USER/.phpmyadmin
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
Of course, you still need to set up each .phpmyadmin file, but that’s easy enough. Of course, if you’re deploying lots of similar database setups, you could also use the virtualhost config to set up the configuration and re-use a common config.inc.php tweaked to use server variables (PHPMYADMIN_HOST)… but I’ll leave that as an exercise for the reader. Avoid passing passwords this way, however, as server configuration variables are another potential data leak.
Started by the MIT Media lab in 1993, Computer Clubhouse is a computer focused after-school program with 100 chapters worldwide.
The Computer Clubhouse provides a creative and safe out-of-school learning environment where young people from under-served communities work with adult mentors to explore their own ideas, develop skills, and build confidence in themselves through the use of technology.
Their learning model principles:
1) Learning by designing
2) Following your Interests
3) Building a Community
4) Respect and Trust
Computer Clubhouse also has programs focused on women, and guiding participants on college/career paths.
Here’s a neat tool created by the MIT media lab. It makes creating little flash type animations simple enough that a literate person with no programming experience could do it, all the while learning the basic concepts of programming. Calling it “Logo 2009″ wouldn’t be far off.
Scratch is a new programming language that makes it easy to create your own interactive stories, animations, games, music, and art — and share your creations on the web.
Scratch is designed to help young people (ages 8 and up) develop 21st century learning skills. As they create and share Scratch projects, young people learn important mathematical and computational ideas, while also learning to think creatively, reason systematically, and work collaboratively.
Scratch website
Introduction to programming and Scratch (Harvard CS50 Lecture 2)
MySQL director of architecture Brian Aker provides the scoop on Drizzle in a short video interview. If you’re a MySQL user, and especially if you hadn’t heard about Drizzle, and extra especially if you had any concerns about MySQL’s future due to the recent Sun acquisition by Oracle, you should check this out.
Here are my takeaways:
- Drizzle uses a modular system akin to Apache to remain light(er) weight and highly tweakable. Sweet!
- It focuses on convenience of community based development, i.e., Drizzle is viable even if Sun decided to defenestrate the MySQL team.
- Big names are putting time into supporting Drizzle development too.
- MySQL is pronounced My-S-Q-L
Having found many of the works of Frank L. Baum available as free audio books via the awesome Librivox, we have been downloading them for the kiddos to listen to in bed at night. Check out the wikipedia article for a full list of Oz books (including cover art!) Librivox also provides links to relevent wikipedia entries, archive.org content, and even a “Chapter a day” service you can subscribe to.
More than once, especially in discussing something in correspondance, I’ve want to have something I can easily cite that explains my perspective on disagreements, discussions, and how I percieve them. Here’s a rough cut.
We disagree! (Probably. At the moment. About a likely very small subset of topics.)
You think I’m wrong? That’s OK with me! I’ve been wrong before, so this wouldn’t be the first time. You have good reason to assume that you’re probably right and that I’m wrong. So do I, even if I’m actually wrong! But I certainly prefer to be right. Hopefully you want to help me understand why I’m wrong, and can spare a few moments to set me straight; then we can both be right. *High fives!!!*
Here is where I’m coming from:
- I have opinions. These are like theories, in that they’re simply the a general rule I cobbled together from anecdotal experiences.
- I have “knowledge” about “facts” which are opinions about “reality” highly corroborated by “evidence.”
- I find knowledge and opinions useful in making decisions. I want to have useful knowledge and opinions, which means ones that are most accurate. This is why, if I”m wrong, I want you to tell me! Just do so in a helpful way, by pointing out which opinions are wrong and then showing me what refutes them.
This is where we stand:
- We might not actually disagree. We might realize, in explaining our positions, that we’re just talking about the same thing in different ways. I can’t tell you how many times this has happened!
- We might question the evidence. Let’s be honest, there is a lot of bad “evidence” out there. I tend to trust certain sources more than others, and you probably do too. Perhaps we can agree on some sources. That would make this a lot easier! For example, I tend to reference snopes.com whenever someone asks me to forward a chain message so they can get a free laptop from Microsoft/Dell/Disney/Facebook/etc. If we don’t agree on a source then it isn’t useful in our discussion. We could debate a source’s validity, but that’s a whole different discussion.
- We might question the logic used to present the evidence as supporting or refuting our opinions. Let’s be honest, it’s not uncommon for people to make a mistake in logic. Also, lots of people get paid to make highly convincing but fallacious logic (we call them “magicians,” “marketers,” and “con artists” among other things.) I wouldn’t fault anyone for falling prey to a reasonable sounding fallacious argument; sure, I’ve done that too! Perhaps we can take a closer look at the logic behind the evidence.
I’m also open to the idea that it can be useful to hold opinions that aren’t based on evidence. I only oppose these opinions when they contradict legitimate evidence, because then they lead to making bad decisions. That’s not useful… in fact, that’s can be dangerous!
When I’m wrong: it might take me some time to accept that, especially if I’ve invested an time or effort into projects that you’ve now shown to be misguided, flawed, pointless or, at worst, counter to my benefit. While I want to find out if I’m wrong, I don’t enjoy being wrong, and I actively dislike dealing with the consequences, because it might take effort to adjust to my newly enlightened position. BUT! I would rather make the necessary adjustments than continue to put my energy into the wrong investments. Just allow me some space while I’m adjusting. I’ll try not to get too cranky. Note: gloating is an invitation for me to openly question your lineage and olfactory prescence.
If you don’t want to discuss it: I’ll be irritated. You’ve basically said to me “Hey, there’s a problem with your model of the world, which might get you into trouble, and I know what the problem is, but I don’t want to bother helping you get things straight.” It’s frustruating to be taunted like that, and I hope you understand why I dislike it.
So hey, I don’t dislike you just because we disagree. Quite the opposite: I rely on my friends to point out when I’m wrong, because although that’s fair game for anyone, my friends are the ones who help set me straight. Thank you for your time, I appreciate it!
By the way, I tend to assume that this is generally your policy too. If it isn’t, let me know, and why. Perhaps I’ll amend my own policy, if yours is more useful!
