How to set default editor in WinSCP

When it comes to secure file transfer, one or the other of you should probably have heard of the SFTP-client named WinSCP. WinSCP enables the secure transfer of data between two computers based on either the SSH protocol or the SFTP protocol and provides, as also many of the normal FTP-clients do, the functionality of editing files directly on the server (respectively edit them direct out of the WinSCP interface without the premise to manually download the files before editing).
Unfortunately WinSCP will open all text files in his own simple style editor. But if you want to edit script files like PHP scripts, which is what I want to do most times, you will miss the comfort of a good text editor like Notepad++ or Sublime Text. But don’t worry – there’s a solution also for this problem, so that you don’t have to give up your beloved features like syntax highlighting […]

How to compare dates in PHP

php_date_compareHow to actually compare 2 dates in PHP with each other? The question sounds easier than it is.  The first thought that usually comes is the following. We store both dates as strings and compare them.
Preliminary

<?php
$date1 = "2012-1-12";
$date2 = "2011-10-12";

if ($date1 > $date2)
echo "$date1 is newer than $date2";
else
echo "$date1 is older than $date2";
?>

Output:

2012-1-12 is newer than 2011-10-12

At first glance this seems to be a workable solution. But what if the two data is in a different format?

<?php
$date1 = "12-1-12";
$date2 = "2011-10-12";

if ($date1 > $date2)
echo "$date1 is newer than $date2";
else
echo "$date1 is older than $date2";
?>

Output:

12-1-12 is older than 2011-10-12

Now the date in 2012 is declared to be older than the date in 2011, which is of course wrong. However, from PHP’s point of view, this behavior is correct, because two […]

How to add multiple free images to your eBay auction

ebay_logoToday it is about eBay. Specifically, about how you can add as many pictures as you like into your auction description for free. So there will be no additional costs, such as it would normally be the case, when you use the image features of eBay. Thankfully eBay gives us almost everything that is needed to add free images to our auctions.
To better explain the procedure, I created a fictitious offer on Ebay. Who does not like to read, of course, can also scroll to the end of the article and watch the whole explanation as screencast. And here’s how it works:
Step 1:
ebay_kostenlos_bilder_1  ebay_kostenlos_bilder_2
After you have entered the basic information and are located yourself in the sales […]

How to install Ubuntu on Samsung Galaxy S2

Android Ubuntu ScreenshotToday there is again an article on Android. More specifically, it’s about how you can run Android and Ubuntu (Linux) in parallel on your smartphone or tablet. Although I had already blogged about it before, but today I want to explain the whole setup process, step-by-step (using a slightly different method).
The title of this article is actually not quite correct, because we will not install Ubuntu, but setup some kind of a live system – so we get down to business.
I used my Galaxy S2 for the project. If it works with other smartphones, I could not test, but would be happy about comments on your part, if you tried it.
 
For our purposes we need the following things / conditions:

Android based device with root rights
Android Terminal Emulator (freely available on Google Playstore)
android-vnc-viewer (freely available on […]

Tutorial: How to create a simple HTML5 JavaScript based progress bar

JavaScript Progressbar
Since I needed a javascript based progress bar for a Web project and I could not find a component that meets my expectations, I decided to write my own progressbar.
The project was implemented in JavaScript with help of the HTML5 canvas element. The progress bar gets along without any image files, as it is usually the case with other JS / CSS progress bar solutions. By default it can handle 100 states (0-100%) and input errors will be caught and visualized.
Since I like to share my developments I present you the progressbar of course. I’m always open for criticism, praise and suggestions.
For a demo / example click here. The source can be found over here: pbar.js
Below I will show you quickly how to use the progressbar.
At first you have to embed the progress bar script and […]