The “Couldn’t agree a key algorithm” error in Git for Windows

When trying to perform any authentication-related operation in Git for Windows you may hit the wall with:

Couldn’t agree a key algorithm (available: list of available methods)

Some people says (here and here for example, but also in many other places) that this is due to your PuTTY not being up-to-date and ordering getting latest version of PuTTY as a cure. You’re lucky, if that works for you! :>

I wasn’t that lucky and it turned out that in case of my Git for Windows TortisePlink was actually the problem.

Read More “The “Couldn’t agree a key algorithm” error in Git for Windows”

Say bye, bye to any website screenshot stuff. Chrome DevTools 62 are here…

If you’re using any kind of software or browser’s plugin for capturing entire website, viewport areas longer than current screen or just a small pieces of website then with new Google Chrome DevTools 62 you can say bye, bye to all of them!

You can now capture screenshot of selected node (which includes capturing entire page, as I’ll show you) directly in DevTools in Google Chrome 62.

It is said that you can also capture a screenshot of selected part of viewport, but I managed to get this working only two times per ten on less than 10% of websites. Thus, I decided to not write about it.

Read More “Say bye, bye to any website screenshot stuff. Chrome DevTools 62 are here…”

Fresh XAMPP installation — a step-by-step guide

This is more like my private memo, to have a clean check-list of steps I usually undertake, when installing fresh XAMPP for Windows installation. Most steps aren’t unique to my environment, so this article can also help others, that are stuck at some point. Note, that this is purely development environment-oriented installation guide, as XAMPP is not meant to be used as production server.

Read More “Fresh XAMPP installation — a step-by-step guide”

Plural formula in PHP to evaluate ending for a number in Polish language

Providing correct plural form of countable words in English is easy, because there is a difference only between one (1 item) and other (0 items, 2 items, 5 items etc.).

In Polish (and some other languages) this is much harder, because Polish has two different plural forms and plural form of countable words is way, way more complicated and based sometimes not only on whole number but also on last digit of this number etc.

Read More “Plural formula in PHP to evaluate ending for a number in Polish language”

Configure email sending solution under XAMPP

This is the ultimate (at least for me! :]) solution to configuring mail sending in your XAMPP. Verified and confirmed that this is working. If you go through these steps and still have no results, I’m 95% sure, that problem is outside XAMPP or sendmail (i.e. something is wrong with your configuration). I hope, I don’t have to remind you, that every wise guy uses XAMPP only for development purposes and never, ever as stand-alone, production, webserver!

Do not get confused! This article is about fake sendmail, a solution designed for development environments, like XAMPP, to mimic mail delivery subsystem for developers, that is found on production servers. This text has nothing to do with original sendmail, world famous MTA, started 1979 (25 years before fake sendmail!) and still widely used on production servers and anywhere else in hosting area.

Read More “Configure email sending solution under XAMPP”

Enable LDAP support in PHP served under XAMPP and Windows

Connection to LDAP in PHP isn’t that easy task by itself. Things get even more complicated, if you’re working in XAMPP environment under Windows. It hope this article will help you in getting un-stuck, if you’re stuck on the similar things, as I did.

Notice: solution provided in this article may not work for you! It worked on my office computer and failed completely on my home computer, though both are quite similar (same version of Windows and XAMPP etc.).

Since, we’re talking about very stupid system (Windows) and about even more stupid situation (claiming, that file is not found, though it exists in folder listed in PATH variable), I have no bloody idea, why it doesn’t work (or why it does work on certain computers) and how to solve this problem.

Read More “Enable LDAP support in PHP served under XAMPP and Windows”

Git in Netbeans — Push or Push to Upstream

Netbeans’ Git client is a bit different that others (like TortoiseSVN) and offers additional option for push/pull commands (starting from version 7.3). It is Push to Upstream and Pull from Upstream. What is the difference from regular “non-upstream” versions. Not to big. Second (“upstream”) ones offer dirrect execution of command, without displaying any dialog (if properly configured). While regular (“non-upstream”) always opens Push to Remote Repository dialog.

So, after initial configuration, it is more convinient to use Push to Upstream instead of Push.

It is always a few clicks less, right? :]

Read More “Git in Netbeans — Push or Push to Upstream”

Self-documenting code is a myth

How many times did I heard that stupid talk? “Comments aren’t needed! Code should be self-documenting”. If you think this way, then… believe me or not, you’re wrong. Good developer does not need comments to describe, what he or she is doing. But there’s always a purpose for doing something, which must be documented for future reference. If you think, you can achieve the same with self-documenting code, you’re going strictly into violating fourth of Five major software development rules. Which says: “Premature optimization is the beginning of all hell!“.

Read More “Self-documenting code is a myth”

Upgrading MySQL on-board XAMPP

XAMPP is a great package of Apache, MySQL, phpmyadmin and some others (actually the best I’ve ever used). The only disadvantage of it, is that guys behind this project haven’t got much spare time and update it fairly slow. Newest XAMPP version (1.8.1) is over a year old now and still has MySQL 5.1.41 on-board, while version 5.6.10 is available for download, as of writing this. Here are some tips on manually upgrading MySQL on-board your XAMPP package.

Simple copy & folder switch does the job and is enough to upgrade MySQL on-board XAMPP from 5.1.41 to 5.6.10. However there are slight side effects, you must consider.

Read More “Upgrading MySQL on-board XAMPP”

Too long URLs in Apache

It turned out that in current version of Apache you’re limited to 255 characters at most between each pair od slashes (after URL decoding is done). This short article discusses this issue and maybe useful to all developers, who are dealing with “beauty” (SEO-optimized) URLs, like for example URLs to blog posts containing entire title inside.

This is a rare situation (255 characters limit between slashes, not for the entire URL), but still worth exploring.

Read More “Too long URLs in Apache”

Free hosting for ASP

You can find a lot of free hostings for PHP and MySQL, but not that much for ASP and MS Access. In addition to being free, these hostings also offer absolutely not ads, neither on your websites nor in sent e-mails:

100 MB might seem to be very low among nowadays offers (counted in GB or even not limited in space). But since you get: ASP Support, MS Access database and ISS 6 (on Windows 2003), absolutely free for lifetime with 100% no ads, then I think it would be hard to find similar offer with higher storage.

Five major software development rules

To all those, who just don’t get it!

  1. DRY = Don’t Repeat Yourself!
  2. KiSS = Keep it Simple, Stupid!
  3. You ain’t gonna need this!
  4. Premature optimization is the beginning of all hell!
  5. Copy-paste is time waste!

Never, ever forget about these five, if you’re developing anything.

Force HTTP 403 error when there is no index file

If you want to display HTTP 403 error (instead of files list) for folder, where there is no index.html or index.php file, then in .htaccess file you must add following line:

Options -Indexes

This works for current folder and all subfolder (unless .htaccess file if any of these subfolders will “locally” change this setting).