Feeding data to Flightradar24 using DVB-T stick. Part 2. Software

You want to feed data to Flightradar24 using DVB-T stick and you have already received your hardware. Great. Now, it is time to talk about software, installation and configuration. Note, that (contrary to FR24) I’m providing information about Windows Vista and later editions of Windows. If you’re an old dinosaur, still using Windows XP or you need info for Linux, Unix or Mac systems, consult “Add Coverage” pages at Flightradar24.

IMPORTANT! Read this article BEFORE you even plug your DVB-T stick to spare USB port. If you do this, you’ll waste some additional time on uninstalling Windows drivers, which are completely useless in this scenario (since we want to receive flight data, not the actual TV signal, right).

Read More “Feeding data to Flightradar24 using DVB-T stick. Part 2. Software”

Installing Composer to PHP on Windows

There are a few small issues and changes, when installing and using Composer dependency manager to PHP running on localhost (local development environment) on Windows.

This article should clarify these things and answer some questions about using Composer on Windows.

Enabling HTTPS

First of all, you need to have support for HTTPS protocol and wrapper enabled in your PHP. Edit php.ini and look for extension=php_openssl.dll line. If if has ; character in the beginning (library disabled), remove it (enable library). Then restart your Apache.

Now, to install Composer.

Just a single installation

If you need it for just a single project (it’s author forces you to use it, but you normally don’t care for all these composer.json files), then you may use typical way, described at Download page. I.e. execute:

curl -sS https://getcomposer.org/installer | php

from command-line. If this does not work (or if you don’t have curl), try alternate version of:

php -r "readfile('https://getcomposer.org/installer');" | php

It this, again, don’t work, try the next method of central installation.

Central installation

In most case you’d like to use Composer for many projects. Therefore you need to install central version, that will be accessible in every path. The simplest (and the only tested by me! :>) method is to use installer file. You’ll get it at Download page or in here.

Run downloaded Composer-Setup.exe file and follow on-screen instructions.

Default settings seems fine, so clicking Next > few time should do the trick.

Once Composer is installed on your system, you should either exit all terminal windows and/or all Windows Explorer windows and open them again, to force system to re-read PATH environment variable, just updated by Composer installer. Alternatively, if above seems to be not working, restart entire Windows.

Usage

Most pages for developers and most code repositories are handled by geeks using Linux. So, they write to run php composer.phar install. This won’t work under Windows and should be replaced by simple composer install. Since Composer is (should be) listed on your PATH, it should be available in any directory.

That, of course, matches only installing “central” installation, using Composer-Setup.exe file. If you installed only single, per-project version of Composer, you’re normally running php composer.phar install.

Remove all kind of quotation marks

I say: “Remove all quotation marks from a string“. You say: “stripslashes“.

Works fine. In most of situations.

If you have to deal with quotation marks manually entered to rich editor (i.e. by copying large block of text from Word for example) or with a string being a poor effect of even more poor encoding routine, you may be sure, that stripslashes won’t do all the dirty work for you.

This is the place where my handy method comes in.

Read More “Remove all kind of quotation marks”

Changing default icon for a file type in Windows 7

Windows XP was the last Windows system to have File Types tab in the Folder Options applet and to allow user easily changing default icon for particular file extension. This tab was replaced in Windows Vista and following systems by Default Programs applet from Control Panel. It lacks many features, including changing icons for file types. Therefore, in Windows systems following Windows XP you have to either use 3rd party software for achieving this simple task or dig in Windows Registry. This isn’t that hard task as it seems, so read on, if you want to give this method a try.

Read More “Changing default icon for a file type in Windows 7”

Dump current database state to Yii migration

There’s a wonderful extension to Yii 1.x, called database-command, written by the one and only schmunk, which allows you to quickly and easily generate any set of CDbMigrationCommands (actually, entire single migration code) based on current database schema.

This isn’t, of course, the only one out there. There are some others. But I like this one the most, mainly for flexibility (may parameters to suit generated migration file to your needs). However, if this is your first approach to using custom yiic commands, you may get a little bit confused. This article should help you.

Read More “Dump current database state to Yii migration”

Shortcuts for direct TeamViewer session on Windows desktop

To quickly access some partner or remote computer in TeamViewer 10, you can login to your account, check to be always logged it, and add particular machine to the list there. Each time you start TeamViewer, you’ll have list of your computer ready in a window to the right. All you have to do, is to double click any item in that list. Can it be even faster? Can we initiate TeamViever session to particular machine or customer by double clicking icon on Windows desktop? Sure thing, we can!

Read More “Shortcuts for direct TeamViewer session on Windows desktop”

Password prompt when accessing account without password via network

If you are trying to access computer, that has only one account, without password, you’ll be asked to provide password anyway. This is normal. By default, Windows blocks all non-local logins to accounts that don’t have passwords, for security reasons. There are few things you can do with this situation.

Read More “Password prompt when accessing account without password via network”

Use jQuery to load element from another page

You can use jQuery to load any element from another page as easy as you get it from the same document.

Here is how (source):

$.get("../index.html #header1", function(data)
{
    $("#indexHeader1").html(data);

    alert("Load was performed.");
});

It’s no magic. It’s a regular AJAX call, only jQuery parses result and tries to strip requested element only.

Keep Sublime Text 3’s replace panel open after replacing all elements

By default, if you open the replace panel (Ctrl+H) enter search and replace patterns and click Replace All button or hit Ctrl+Alt+Enter, replace panel will be hidden. This is very annoing to many users. However, there’s a partial solution to this problem.

This is tested only in Sublime Text 3, but should work in Sublime Text 2 as well:

  1. Select Preferences > Key Bindings — Default.
  2. Search for ctrl+alt+enter and copy entire block.
  3. Select Preferences > Key Bindings — User.
  4. Paste copied block anywhere and remove , "args": {"close_panel": true} part from it.
  5. Save Key Bindings — User and test it (you don’t need to restart Sublime Text).

Since, you have just modified key binding, then you should remember, that expected behavior will work only if you execute Ctrl+Alt+Enter inside it. If you click Replace All button, the “old” behavior will be applied — i.e. replace text panel will be closed.

Posted to Stack Overflow.

Feeding data to Flightradar24 using DVB-T stick. Part 1. Hardware

So… you want to have a Flightradar24 Premium account for free or you want to make the world better and you decided to start feeding data to this service, right? Well, great! But, information provided by FR4 about installation, configuration and feeding process itself have a lot of crappy and irrelevant parts. So, I decided to write my own mini-serie of articles on how to start, what to purchase and what to look for. So you can avoid all the pitfalls I felt into.

IMPORTANT! Read the next article, about software BEFORE you even plug your DVB-T stick to USB port. If you do this, you’ll waste some additional time on uninstalling Windows drivers, which are completely useless in this scenario (since we want to receive flight data, not the actual TV signal, right).

Read More “Feeding data to Flightradar24 using DVB-T stick. Part 1. Hardware”

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”

Text truncating function that secures both HTML tags and full words

Akshaya K Sahu’s answer to this question at Stack Overflow is a great example of text parsing function that can truncate any HTML-encoded string at given length, taking care of all the needed aspects, i.e.:

  • full words,
  • properly closed HTML tags and
  • respected UTF-8 encoding (double-byte characters!)

I have actually nothing to add to it, so I keep a copy of this code only for my own reference. And only because the original answer lacks some comments.

Read More “Text truncating function that secures both HTML tags and full words”

Legal user right to resell software purchased in EU

Software licensed under COA, OEM and similar licenses can be legally sold on European Union area, according to Court of Justice of the European Union’s verdict dated July 3, 2012. It judged that both private persons and companies can sold original software and licensees purchased from companies like Microsoft.

This judgement is a direct interpretation of the law of European Union directive 2001/29/WE, which says that producer’s law for an exclusive distribution ceases with the moment of software selling for the first time and producer or IT company cannot legally block any attempt of re-selling such software attempted by the person or company, who initially purchased it.

No contacts on Windows Mobile after adding Google account

If you have just purchased new Microsoft Lumia phone (or any other device, that uses Windows Mobile system), added your Google account to this device and you found out, that even though synchronization was successful, you have absolutely no contacts imported, then you’re in the same situation, as I was and this article should help.

Read More “No contacts on Windows Mobile after adding Google account”

Setting up new project in Gerrit

Because Gerrit is evil and wrong (see here for details), even such simple task,like creating a new project, requires a separate document and todo list.

Also, keep in mind, that you can’t delete a project through web GUI of Gerrit. This is most wanted and requested feature of this dully project management tool, but still hasn’t been implemented for years.

So, create your new project wisely, because you won’t be able to delete them, without playing around console, installing some third-party plugins or doing stupidities similar to this.

Read More “Setting up new project in Gerrit”

Why Panasonic Lumix DMC-TZ35 is a wrong choice?

When I decided to purchase a new digital camera, I nearly immediately felt in love with Panasonic Lumix DMC-TZ35. Mainly because its 20x optical zoom in a piece of hardware available for a reasonable price. I have purchased it and… nearly immediately returned it to the shop. I found some glitches. Not many, but serious enough to make shooting a photos with this device nearly pointless.

Read More “Why Panasonic Lumix DMC-TZ35 is a wrong choice?”

PhoneGap Audiobook Player. An abandoned project

I’m a an audiobook maniac. Listening to audiobooks requires MP3 player to have a special feature, which remembers last file/track played in a folder and last position within that file, for all folders, not just current one. This allows to listen to many audiobooks simultaneously, just as you’d be making bookmarks to a regular, printed book. All MP3 player, that I tested so far, hasn’t got than feature. Once you switched from folder/book A to folder/book B and then back to A, book/folder A was “reset” and play started from the very beginning. In this situation, I decided to write my own audiobook player in PhoneGap and release it as open source. Pity, but I failed to finish this project. Thus, I’m publishing only an unfinished sources and links to resources.

Read More “PhoneGap Audiobook Player. An abandoned project”

Completely remove file from local and remote (GitHub) repository

This is the short version of “Remove sensitive data” article in GitHub Help. And an alternative solution to the one presented [here](Remove file from repository and from all revisions.txt). It assumes, that you are the only collaborator to repository, so you can perform steps at once (you don’t have to contact others and wait until they rebase your changes) and that your repository doesn’t use tags, so you don’t have to perform all steps.

If any these two assumptions is not correct in your case, then avoid this article and rather follow to mentioned article. Keep in mind, however, that in some certain situations, you have to contact GitHub Support in order to finish entire procedure.

Read More “Completely remove file from local and remote (GitHub) repository”