TortoiseSVN – Change User After Save Authentication

I had to update the credentials I use for one of the repos I work on but in TortoiseSVN there’s no built-in way of updating the saved credentials if the entered user is still valid (otherwise it will prompt you for a new username/password), except deleting all the saved authentication info for ALL repos worked on via TortoiseSVN.

After some research on Google I found this blog post by JohnnyCoder where he describes the same problem solved it using the above mentioned method of removing all the saved data. Lucky for me in one of the comments Brad Divine described a different approach which would only require you to delete a single file, the one holding the credentials for the one repo you want to update instead all of them. Sadly his approach didn’t work for me but with a slight adjustment to the path he mentioned I got it working on my Windows 7 system:

Go to this folder:

C:\Users\<your-username>\AppData\Roaming\Subversion\auth\svn.simple

The files you find here can viewed in any text editor and each file holds the credentials for one repository. They all have cryptic names but you can manually open them all and find the one you are looking for real quickly. Once you got it, just delete the file and next time you want to commit or update your local copy, TortoiseSVN will ask you for new credentials.

In case you are wondering, the folder for XP users looks like this:

C:\Documents and Settings\<your-username>\Application Data\Subversion\auth\svn.simple\

Dev-Box: mod_rewrite and Virtual Hosts for your Apache

This is gonna be a quick one, but I think you’ll find this quite useful … if you don’t already know it by heart ;)

As I promised in my initial Dev-Box post, I promised to give further useful instructions/tips for your development VM, so here we go: mod_rewrite and Virtual Hosts for Apache. Two basics that every coder should know by heart and uses every day (even though he might not be aware of it). I, for example, create a virtual host for every new project I start. That way I can access them easily via their own URL and don’t have to remember the exact folders they reside in.

Read the rest of this entry »

Dev-Box: Installing a Mail Server

It’s been a while, but I’m back with another useful tutorial for all those out there using VMs like my Dev-Box. Last time I talked about getting SVN to work on your VM and now time it’s all about setting up a mail server, something you need for pretty much every web application you might develop.

As my posts are meant for users that use VMs for local development, I’ll not tell you how to install a usual mail server, but rather how to configure it that way, that all outgoing emails go to one email address instead of the address they are meant for. Using such a catch-all setup allows you to test emails coming from your app without having to send mails to existing accounts and even allows you to use your live database for testing and not having to worry that the live users might get an email that’s only meant for testing.

Read the rest of this entry »

Leave Google alone ;)

Google just confirmed that the Federal Trade Commission is investigating them. Propably because other websites like Expedia, TripAdvisor, WebMD have complained that Google might prefer their own websites over others in their search results. I see why they might be upset about this but to be honest I don’t see why Google should care.

Sure, Google is the biggest web search provider around and everyone uses it, but no one forces people to use it and Google can pretty much do with their search engine what they want or am I wrong here? It was the same with Microsoft some years ago when they were forced by the European Commission to add other browsers like Firefox, Safari and Opera to Windows and let the user choose which one should be installed as the standard browser. They bent to that order and now we (at least in Europe) have a choice, but I don’t honestly don’t understand why they could be forced to do so. Don’t get me wrong, I’m glad more people might actually switch from IE to some other/better browser but why should a company have to actively support their competitors?

Am I the only one that thinks this isn’t right?`Or am I missing the point here? Please feel free to comment on/explain what’s going on here!

Dev-Box: Installing SVN

My last post about setting up a Virtual Machine to use as your local webserver was quite the success (hits increased from about 30 to nearly 1000 within 2 days…and dropped back to somewhere slightly above the old value by now) and I promised I would write some more tutorials on how to install some useful libs, so here we go and start with SVN in combination with TortoiseSVN a SVN client for Windows.

Read the rest of this entry »

Dev-Box: Virtual Machines for Developers

This post goes out to all the coders using a Windows machine for development. Might be interesting for others aswell but I can’t say much about that as I’m a Windows user myself ;)

So what is this about? Well, some time ago I ran into smaller problems when trying to move a website from my local machine (which used XAMPP) to a real server (which was running on Ubuntu or some other Linux distro) and it was hard to fix the problems because of the differences between Windows and Linux servers.

I talked about this with a friend of mine and he told me about Virtual Machines (=VM). I had never heard of them before but what I heard was intriguing. Virtual Machines allow you to run a machine inside your machine, e.g. a Linux server inside your Windows machine. So you can use this VM with Linux to test your website locally before moving it to the real server. I know that no server is like the other and you might still run into some problems due to different library versions and so on, but you gotta admit that two Linux servers have way more in common than a Linux and a Windows server ;)

So in this post I’ll tell you how to setup your own VM with all the libs you need. Even if you haven’t worked with Linux before, you should be able to follow this tutorial/example easily.
Read the rest of this entry »

Proto.Spy

A while back a friend of mine mentioned this site to me: It checks which porn sites you have been on.

The technology used to achieve this is quite simple. It inserts links to a bunch of porn sites in the page and uses Javascript to check the link color, abusing the fact that browsers by default use different colors for links you have visited or have not.

Some days ago I came across a blog post by David Walsh in which he described how to perform the above described check using jQuery. I was amazed how easy that was and thought it must be equaly easy to do the same using Prototype. Well, here we go:

I’ve set up a demo that checks a small number of sites (no porn, sorry).

Here is the small function I use to do the checks:

Event.observe(window,'load',function(){
 siteList.each(function(site){
  var a = new Element('a', { href: 'http://' + site, }).addClassName('check').insert(site);
  if(a.getStyle('color') == '#800080' || a.getStyle('color') == 'rgb(0, 128, 0)') {
   $('link-list').insert(a.addClassName('highlight').removeClassName('check').wrap('li'));
  } else {
   var b = new Element('a', { href: 'http://www.' + site }).addClassName('check').insert(site);
   if(b.getStyle('color') == '#800080' || b.getStyle('color') == 'rgb(0, 128, 0)') {
    $('link-list').insert(b.addClassName('highlight').removeClassName('check').wrap('li'));
   } else {
    $('link-list').insert(a.removeClassName('check').wrap('li'));
   }
  }
 });
},false);

with siteList being an array of sites that will be checked. The basically creates an anchor element for each site in the array and checks that elements color. If it matches my defined css style for visited links, than I add the class name ‘highlight’ to the element, otherwise I don’t. That’s pretty much what David Walsh does aswell, but additionally to that I check both http://example.com and http://www.example.com as some might have visited the one but not the other. If none were visited, I show the http://example.com link.

Any questions? No? Then start abusing this ;)

P.S.: This is an older post I copied from my old blog. Thought some of you might find this useful.

Extended logging of database errors in CodeIgniter

Some of you might and now and then have run into a database error while working with CI. Such errors are mostly caused by errors in your querys like not escaping user input or your fields or simply syntax errors.

In small applications that not much of a problem, but the bigger the application the harder it get’s to find the part where the bad query is hiding.

dootzky from the CodeIgniter Forum had exactly that problem and with a little help from wiredesignz we were able to add some more detail to the error messages!

Simply add this to the body of ‘application/errors/error_db.php’:

if($_SERVER['HTTP_HOST'] == 'localhost') {
   $trace = debug_backtrace();
   echo "The error occured in file ".$trace[4]['file']." on line ".$trace[4]['line']."";
}

Now additionally to the error you already know, you will be shown in which file and on which line the error occured (the db->get() method was called)! As this might pose a security risk on live systems, dootzky added the check for localhost.

I know that with CI 2.0 this might be obsolete because the error messages were enhanced, atleast the database errors now show filename and line, but someone still using some older version of CI (like I do for most of my older projects) might still find this handy.

P.S.: This is an older post I copied from my old blog. Thought some of you might find this useful.

I’m back!

It took me quite a while but now it’s official: I’m back in the blogging business!

My old blog was running on my own blogging software, dBlog, but as development wasn’t coming along as well as I hoped it would (mostly due to me constantly running out of time) I finally came around to switching to WordPress and setting this thing up properly. It still needs some work, e.g. a different theme and maybe some header image,  but it’s running and I’ll improve on the rest in the following few weeks.

So what’s to expect of this one? Pretty much what I blogged about before: coding :) Propably less about my own projects than more general stuff that might be handy for some of my readers (do I even have any? haha) like code-snippets, tutorials and whatever else I might stumble upon.

If I find the time I’ll copy some of my old entries and post them here, but I won’t promise anything ;)

So long!