Things for which I trully hate PHP and its creators

PHP is the most popular programming language for development of webpages and web services. With addition of a good framework it can even produce a professional results. However, this does not change the fact, that it is also the most shitty programming language in the world, full of garbage and with number of stupidities beyond imagination. And professional programming (without a good framework) is impossible.

Even though this is a language of my choice (only after cleaning it from all the shit, by using a good framework), I decided to write this article, where I’m pointing out most annoying and stupid things, I ever found in PHP.

Notice, that I’m not talking here about things that some may see as wrong, while other will see as good. For example, I’m not talking about types auto-declaration and auto-change, which ones (mostly newbies) takes as ease of coding and others (mostly profs) as source of mess.

I’m talking here only about pure madness, confirmed piece of shit and horrible pain in the ass, this language is.

Please, take also into consideration that this text was written under strong emotional influence and thus it (intentionally!) contains a lot of harsh language and words or phrases that some readers may not accept.

Read More “Things for which I trully hate PHP and its creators”

Get rid of Police-blocked computer or other type of ransomware

Your computer has been blocked by a police due to serious crimes you did and the only way to unblock it is to pay a ransom? Even a complete moron should understand that real police (or any other legal, law-oriented forces) has nothing to do with it. Here, you’ll find, why and most important — how to get rid of this problem, without loosing your data (in most cases).

Read More “Get rid of Police-blocked computer or other type of ransomware”

Some SQLite Rowid Issues

Rowid is a special, hidden column added to each SQLite database table (and to many more RDBMSes), which uniquely refer to a row. But, there are some things about rowid, that some people may not be aware of.

I know, that for some this could be a trivial. But it was not so obvious to me and since this is my blog, I can decide, what will be published here, right? :]

Read More “Some SQLite Rowid Issues”

screen: Force program to continue after logging-off from the console

So, there I was… needing to have any solution, that will allows me to write my very own port listener. Since the only language, in which I am handy is PHP, I was forced to be able to run PHP script without interruption, 24 hours a day, 7 days a week. That was a bit of challenge for me, given my quite very limited Linux knowledge, but — as they say — the only thing not possible in IT is to open an umbrella in your ass! :>

Read More “screen: Force program to continue after logging-off from the console”

Running Google Chrome in app mode [updated!]

If you have a web application, you can run it on any computer equipped with Google Chrome, in so called “app mode”. Chrome will display your page in a regular way, but will limit its own user interface to absolute minimum. If you’re web application has user interface somehow similar to Windows, you can even pretend, that this is not a web browser showing web page, but a regular Windows-based application.

Read More “Running Google Chrome in app mode [updated!]”

Remote access directly from your browser — SSH and RD in Chrome?

Well, I’ll be honest. I personally dislike (sometimes even hate) all these things, fireworks, plugins, tools and other kind of addings, people adds to their browsers. I can’t understand (or even imagine) where there is a fun to play a game or draw some pictures in browsers. It is even a bit irritiating, as Google gives us everything in their products and soon, we won’t be using anything else.

But, for Chrome extensions, I must admit, that I made an exception. Mainly because these exts I’m using (from time to time, let’s be honest) have actually nothing to do with the browsers and browsing the Internet. Each time I’m using them, I’m asking myself: is it still a simple webbrowser or does Chrome magically changed into a home or work command center, from which you can do nearly anything?

Read More “Remote access directly from your browser — SSH and RD in Chrome?”

A good on-line JS obsfucator for minifying purposes only [updated]

I’ve searched the web for a Javascipt obsfucator for my specific needs — actually a minifier and obsfucator that will minify a code (pretty like BrainJar do) and obsfucate all variables, function names etc. to 1-2 character length (shortest possible). I know that this could be less secure, but due to purpose (internal project), size of the code, not security, is a key here. I also need it as one-click, on-line ready tool.

Since my searches failed, I’ve asked a question on Stack Overflow, but it was closed as off-topic.

Following article is a summary of answers already given on Stack Overflow (before question was closed) plus my some other thoughts and findings.

Read More “A good on-line JS obsfucator for minifying purposes only [updated]”

Changing look of website, if Javascript is disabled

There is a nifty trick, that allows you to change look&feel of your website and even hide certain elements on it, in case user has disabled Javascript in his or her browser.

Facebook is not working, when Javascript is disabled and world collapses, when Facebook is not working, thus no one serious is disabling Javascript nowadays.

Yet, I still think that a good web developer should be prepared for everything. Even for JS turned off…

Read More “Changing look of website, if Javascript is disabled”

Full-featured shooter in 20k of Javascript code!

KhanAcademy showed an example Javascript code on how to write a full-featured space-shooter written in just 1500 lines of code (20k of pure Javascript code after minification).

No matter, whether you are a JS-minification freak or just want to introduce some space shooter on your website to enjoy your visitors — this is certainly worth seeing. Of course, KhanAcademy offers a lot of more nifty Javascript examples.

Non-alphanumeric Javascript?

Ever heard about Brainfuck? It is an esoteric programming language? Designed with only one purpose — to test the boundaries of computer programming… and human brain. It uses only eight single characters ([, ], <, >, +, -, . and ,) as entire set of programming words. Yes, it really fucks your brain!

To mine extreme surprise with proper tools you can turn regular Javascript into very similar brainfucking experience!

Read More “Non-alphanumeric Javascript?”

Transfering files from Galaxy Nexus or other device with Android 4.0

Samsung Galaxy Nexus phone and Samsung Galaxy Nexus 7 tablet, as good as probably all other devices with Android 4.0 or higher on-board, are missing USB Mass Storage mode, which allowed you (under older Android) to use your mobile device as external hard drive and copy files directly via Windows Explorer.

Here you’ll find some alternatives to transfer files from Android 4.0-based device.

Read More “Transfering files from Galaxy Nexus or other device with Android 4.0”

Enabling remote access to Asmax AR1004g router

To access your Asmax AR1004g router remotely (i.e. from WAN / Internet side, not from your local network), you have to remember about two things. Because I nearly always forget about one of these things (or about both in the same time), I wrote this simple memo-post as a reminder to myself.

In this post you may also learn how stupid are Asmax engineers and designers.

Read More “Enabling remote access to Asmax AR1004g router”

Successfull online marketing for beginners

Once upon a time I read (tried to read) a book about on-line marketing. It was authored by Caroline or Catherine Seda, if I’m not mistaken. It was so complete disaster, that I left this book in the train, where I was reading it. Out of nearly two hundreds pages (or something around this) I was able to write-down only thirteen or so interesting ideas. Rest was a total blah-blah and a complete waste of my time.

I present these ideas here, supported a bit by my own thoughts. I divided them into two groups — one group of tips and tricks to be used on your everyday journey through Internet and the other one to be considered when building your website.

Read More “Successfull online marketing for beginners”

General info on Xexun TK102 GPS tracker

This is general post about Xexun TK102 GPS tracker and many of its clones. You’ll find here a bunch of useful information, including some tech specs, list of differences between original tracker and clones and some more.

The localizer and its clones

We’re talking about “Xexun TK102 Tracker” here. The original one, because there are many clones under other companies from China, selling similar hardware, with the same cover and logo, but with:

  • lesser performance (able to report location once per 20-30 seconds, not once per 5 seconds),
  • lesser information (lack of direction/bearing, altitude, number of satellites used for location fix and more),
  • different format of data or non-standard protocols (unable to use UDP protocol, using non-standard data packets).

“Coban” / “Kintech” are just two of many clones sold on eBay etc., claiming to be original “Xexun” trackers.

On the other hand, original “Xexun” and some clones (like “Coban” for example) are harder to control from own script, because they require a correct answer from the server, where data is sent over GPRS. If unit does not receive such reply, it breaks connection. The cheapest unit does not have this checking and will always sent location data to specified IP address over provided port.

Product description

Here is product description of original “Xexun” localizer (and here is a clone under “Kintech” name).

Possible buyer must be very careful (and should secure return policy, for which buying directly in China is not recommended) as there are many reports about sellers claiming to sell original “Xexun” device and sending a clone actually.

Though this device is five years old, it is still sold at many places (including eBay), but even at theses sources it is very hard to get anything worth for developers, except some simple, very basic user guide.

I have confirmed information (from two different sources) that there is no official API available for this device. The only option is to Google around, ask other users or use forums (see below).

If you own original “Xexun” localizer, you may try to contact company international departament and ask their technicians to include some changes to device source code and to send you updated firmware, with your changes – wow! That was confirmed by company itself.

Forum

I found a perfect forum for TK102 device, with a lot of questions and answers:

  • here is a general forum on TK102 device (kept alive for 5 years with 174 pages and 2000+ posts!),
  • here you’ll find more specific topic on receiving data from this localizer,
  • this forum is also about TK102 unit, but it is entirely in French.

There are many other devices dissussed and in general, this is the biggest forum in the world, with topics for localizers and similar information.

GPRS Protocol Specs

In general, any TK102 related devices is opening a socket for a direct TCP transmission (original one can be switched to use UDP protocol). Data is being transmitted over port specified by user, in configuration and using GPRS only (requires SIM card with enabled GPRS, there is no way to use WiFi).

Sending frequency, format and amount of data being send, entirely depends on kind of device is being used — it is more extensive and more configurable in original one than in clones.

Correct server response problem

Take into consideration, that many TK102 clones requires a correct response from the server after each data, it send. It breaks connection after sending some welcome garbage UDP packet, as it does not receive response, it waits for.

It is quite hard (quite impossible?) to find any guide to many of these clones, on what kind of responses server should sent. This often leads into situation of developer being unable to establish two-way communication between server and localizer. Many localizers are sold to be used only via SMS communication or throughs paid services that had signed and agreement with producer and received protocol specification that contains valid responses server should generate for particular TK102 clone.

Double check, if this is not source of problem, if you can’t communicate with your localizer from your app.

Summary

This is all the information, I managed to get up until now. I don’t found any API for this tracker so far. I found some technical documentation, but it did not helped me much in the area of programming this device on server-side. If you need more information, look around this blog or make Google your friend.

Using AJAX head-type requests to check size of remote scripts

Checking size for inline scripts is as easy as document.getElementsByTagName('script')[0].text.length (solution taken from here). But, when it comes to measuring size of remote resources things gets a little bit complicated. Mostly due to cross-site restrictions and reducing unnecessary server load. Head-type of AJAX call, not so famous among developers, may help in this case.

Read More “Using AJAX head-type requests to check size of remote scripts”

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.