Re-activate previously activated Windows, which suddenly became not activated

If your installed, configured and activated Windows 7 suddenly becomes not activated again, after weeks or months of normal work, first thing you should do, before hanging hours on Microsoft support phone line, is to attempt to activate (re-activate?) it again. This post should help a little bit.

Note that I’m covering only a legal ways here, assuming that you have your valid, legal product key.

Read More “Re-activate previously activated Windows, which suddenly became not activated”

Redirect from post to an external URL

Why would you like to redirect a page’s visitor to an external URL instead of presenting post content?

Well, they may be a dozens of reasons. I found one. I was building a simple product showcase page with cool image scroller based on WordPress and Modest theme from Elegant Themes. Since image scroller contained not only image, but also title and two line entry, it was based on actual posts.

I wanted my users to see these texts, but to not be able to access posts itself. Because there was nothing more than just this image, title and two-line description. That’s why I used URL redirection.

Read More “Redirect from post to an external URL”

Quick mobile UI review

Here is a quick review of some mobile UIs that you can use to develop your mobile application, if you’re developing HTML-like mobile apps.

Note that I don’t like jQuery Mobile for being ugly and slow and I don’t like paid full-featured stuff like Sencha or Kendo. You won’t find them here. I like fast and beauty mobile apps (possibly written in PhoneGap).

So you will find performance-first, beauty-second UI frameworks here. With special emphasis on being PhoneGap-oriented. Only quick review without any unnecessary blah-blah.

Read More “Quick mobile UI review”

Move repository from GitHub to Gogs or any other remote

This is basically a check-list on pushing entire local repository, with all branches, tags and entire history to brand new remote repository and changing default remote setting in local repostiory from one to another. A compilation of this and this answers on Stack Overflow plus some own thoughts. Gogs and GitHub are quite similar to each other and all operations an made on command-line, so you can use this article as an aid in migrating one remote repository to another.

Read More “Move repository from GitHub to Gogs or any other remote”

Installing Gogs on Windows [discontinued]

This article is unfinished and discontinued! It contains a lot of useful information, but will not lead you to the very end. The only reason, for which I wanted to install and use Gogs was the fact, that my programming model (Yii2-based) required me to have a really large number of private repositories (each for every component, that my applications are using). And storing them on GitHub was very expensive.

However, as of May 11, 2016 GitHub has announced an unlimited number of private repositories available for every paid plan. This rendered Gogs completely useless for me. But, in the same time, it was also a very relief for me, because even though a whole long year passed since I started writing this article, I have never actually even touched problem of reconfiguring Composer to use source other than GitHub (Gogs).

Feel free to use this article to learn more about Gogs and its installation on Windows, but keep in mind, that this artice is unfinished and pretty much likely will never be finished.

Read More “Installing Gogs on Windows [discontinued]”

Is PhoneGap’s applications size a big problem to end users?

Since PhoneGap wraps HTML5 and Javascript code (plus all the stuff) into native app wrapper, then we may assume, that in general PhoneGap-based mobile applications will have significantly higher size in compare to native mobile application. This is true in most scenarios and this leads us to a question, if large mobile application size may be a problem to end user?

By an accident, I run into this question from December 2011 asking, if 4 MB of executable size for mobile devices is too much for a simple application. Even though it is over 3,5 years after asking this question, the general rule remains. I found my answer to this question quite interesting and thus I’m sharing it in here.

Read More “Is PhoneGap’s applications size a big problem to end users?”

Fix problems with sudoers or sudoers.so file on QNAP

Root / power-user configuration on QNAP devices is a little bit different (quite weird) than this, what you can find on most Unix/ Linux systems. And sometimes you may be hit with error messages like “admin is not in the sudoers file. This incident will be reported“, “sudoers.so must be owned by uid 0” etc. Here are some tips on what to do in this case.

For second error, claiming that sudoers.so file uid isn’t 0, first go to folder containing this file (/opt/libexec/ on QNAP TS-210) and ls -ls to check, who is current user of it. It should be admin:administ (actually admin:administrators, but ls -ls chops names to 8 characters).

If it isn’t, change ownership of this file and /opt/etc/sudoers folder, by executing:

chown admin:administrators /opt/libexec/sudoers.so
chown admin:administrators /opt/etc/sudoers

As for first error, saying, that admin is not in the sudoers file, you may try to execute sudo usermod -aG sudo,adm admin, but this will most likely fail on QNAP.

If it does, then fix this manually as described in here:

  1. Execute visudo command to edit /opt/etc/sudoers.tmp file.
  2. Scroll down contents of this file, until you reach root ALL=(ALL) ALL.
  3. Hit Enter to add a new line below and write admin ALL=(ALL) ALL.
  4. Hit Esc, enter wq and hit Enter to save file and exit forsakend vi editor.

This is the only solution, that I found working on my QNAP TS-210.

All others, that required using GRUP, were impossible, as you don’t have access to GRUP during QNAP boot.

Bringing Git to QNAP TS-210

There are two (quite obvious) ways, how you can use Git on your QNAP TS-210 (or any other QNAP).

If you only want to be able to update local repositories (i.e. use QNAP as Git client) then this article is for you and all you need to do is to install Git on QNAP and generate proper SSH keys.

If, on the other hand, you would like to store on QNAP repositories, that other uses (i.e. use QNAP as Git server), then you need to search the Internet for some alternative solution, sorry.

Read More “Bringing Git to QNAP TS-210”

actionParams are not available in ACF’s matchCallback

When using matchCallback in AccessControlFilter in Yii2, an attempt to read $action->controller->actionParams or Yii::$app->controller->actionParams inside this callback fails, because these attributes are empty.

This is by design, because AccessControlFilter is executed at an earlier stage than parameters binding.

If you need to read action parameters inside matchCallback (for example to judge, if user has access to particular action, basing on action’s parameters) then the only way is to read them from Yii::$app->request->get(). More details here or here.

Using Yii2’s DetailView in a little bit more advanced way

The simplest and easiest way of rendering DetailView is to declare model and attributes list. This will renders each listed model’s attribute in a cool-looking, responsive table.

This article contains examples and solutions for going a little bit beyond that and using DetailView in a little bit more advanced way.

Read More “Using Yii2’s DetailView in a little bit more advanced way”

Multi-folder usage of IrfanView’s batch mode

Batch conversion tool (B in main screen or File > Batch Conversion/Rename) in IrfanView is both flexible and powerful tool that allows you (as menu item says) to: quickly convert many images, quickly rename many files or mix these two operations.

The Add All button in mentioned tool’s window is even more powerful, because it lets you add files (to be converted or renamed) from given folder and all subfolders. But not everyone knows, that the same goes for saving converted files. They also can be placed by IrfanView in many folders

Read More “Multi-folder usage of IrfanView’s batch mode”

Enabling Polish letters in Delphi 2010

Using non-Latin keyboards with Delphi and non-Latin characters in code was always a big problem in Delphi.

To enable correct support in Delphi 10 you have to:

  • go to Tools > Options > Editor Options > Key Mappings,
  • uncheck Use Ctrl-Alt keys.

Hopefully in Delphi 2010 you can do this from IDE settings. You don’t have to play with stupid .reg files to change some dully strings in Windows Registry, as you were forced in Delphi 5 to achieve the same.

Resolving strange FTP-related issues on your QNAP

Not being able to delete or rename a file on QNAP via FTP? First thing you have to check, is:

  • who is the file owner (it should be your user name) and
  • what is file group (it should be everyone).

On various occasions QNAP can set it to admin:administ, which is wrong, in this case.

The same problem will most likely appear, if you access your QNAP via FTP and try to rename or delete a file while using different credentials that were used when uploading that file. If another FTP user uploads a file then only that user can delete or rename or move that file.

If you wish to do this yourself, you have two options:

  • use that other user’s credentials (if possible) or
  • change owner and a group of that file to you.

The second solution is discussed in this article.

Read More “Resolving strange FTP-related issues on your QNAP”

Deploying a PhoneGap app to Windows Marketplace

After Deploying a PhoneGap application to iTunes (App Store) and Deploying a PhoneGap app to Google Play articles, here comes the time to deal with Windows Mobile platform and Windows Marketplace. This article should provide you with all the necessary information on how to successfully submit your .xap file (compiled locally or through Phonegap Bulid) to Windows Marketplace.

Read More “Deploying a PhoneGap app to Windows Marketplace”

Remove system menu button from PhoneGap application

By default your PhoneGap application will contain system menu button, even on those systems (Android 4.0+) that doesn’t support this button any more (i.e. applications written for this system should not use this button; it is handled anyway and you can use it, if you really wish to).

On most new devices user pressing this button will be simply ignored by system and nothing will happen. So, this problem reduces itself to purely aesthetic means (whether you care about seeing that unusable button on system bar, when your app is active, or not).

However, there are reports, that PhoneGap applications crashes on small group of devices, when user presses this not handled system menu button. In this case, more radical solutions must be considered.

Read More “Remove system menu button from PhoneGap application”

Deploying a PhoneGap application to iTunes (App Store) [updated]

This article was initially written in June 2015 and generally updated 15 months later so you’ll find information and examples as they were available in mid-August 2016.

This article deals about deploying PhoneGap application to Apple App Store. Question: Is it possible without having a real Mac computer or using Mac-lease-like service? The quick an straight answer is: you can’t do this. It was possible around two years ago, but things has changed and s for now (2015) you must have any of above to submit your application to App Store.

Read More “Deploying a PhoneGap application to iTunes (App Store) [updated]”

Install and run OS X Yosemite in Virtualbox on your Windows

There are so many articles in the Internet (type Mac OS X virtual machine to Google or your favorite search site to get thousands of them) about running OS X on PC in VirtualBox, that writing another one is just a pure stupidity. Instead, this article includes only a quick check-list to extract essential information from these articles and leave all unnecessary garbage blah-blah behind.

This post is a short version of this article. Refer to it for all details, explanations, solutions for a possible problems and things like that. This guide assume, that you’re installing OS X inside a virtual machine only for one purpose — sending your iOS apps to iTunes through ApplicationLoader program. For this reason, certain parts of original guide are skipped. If you intend to use OS X for other purposes, you may need to enhance your knowledge, by reading missing parts from other sources.

Read More “Install and run OS X Yosemite in Virtualbox on your Windows”

A link to the same URL with a different port

Let’s say, that you need to make a <a href=""></a> link, that will point you to the very same URL (as page, in which have this link), but to a different port. Even though there are no reasons for not implementing support for links like <a href=":8080">jump</a>, as of writing this, such support is not implemented in any known browser. And thus, neither this link work nor pure-HTML solution is available.

You must hire Javascript to resolve this problem.

Read More “A link to the same URL with a different port”

Triple Town

Just wanted to share a couple of cool and not-so-cool screenshots about my favourite game.

Well… I think, I can call it a favourite game given the fact that I’ve been playing it for four years in a row (and another four years from time to time — update from 2021).

Read More “Triple Town”

AdMob Plugin and pure-Javascript ads in PhoneGap Build application

It all started with this Stack Overflow question asked by me 2,5 year ago, when I was attempting to strike with ads in mobile applications for the first time. I’m still using PhoneGap Build only therefore in the past I was very limited to only these ad networks, that supported displaying their add through pure Javascript only. However, all the things had changed radically, with introduction of npm plugins to PhoneGap Build. You can now use in pure Javascript PhoneGap Build application all the ad networks, that require you to use their native SDKs…

Read More “AdMob Plugin and pure-Javascript ads in PhoneGap Build application”