Uploading MIME-conflicted ebooks and files to WordPress

Starting with 5.0.1 version WordPress introduced an additional security check, where file’s MIME type must match extension. So an attempt to upload any executable file file with .jpg extension will fail with:

Sorry, this file type is not permitted for security reasons

This can be a real pain when trying to upload certain ebook format, because this is exactly the case — a MIME-type conflicted with extension (at least as seen by WordPress). For example: Kindle’s .azw3 files declares itself (content; look inside) as BOOKMOBI. Or .epub format which has application/epub+zip as MIME-type and being a modified version of .zip file or actually a regular .zip file with some predefined content.

There are some ways to workaround this (discussed here), however, not all of them works, sorry!

Read More “Uploading MIME-conflicted ebooks and files to WordPress”

Removing some lines from .srt subtitle files

The .srt format seems to be most popular for storing subtitles for corresponding video files. It is very flexible (allowing you to define begin and end of displaying each phrase to the level of single frame).

One big disadvantage of this format is that it is indexed. Meaning that each following line has a consequential numbering. You cannot simply delete let’s say line number 511 (as you would do in case of .txt or other subtitle file formats), because you’d have to renumber manually all following lines. Which, in case of modern movies, can have up to 1000-2000 lines.

Thus, if you wish to get rid of some line or lines (i.e. sound-like sentence) you must either use some designated software that will do the auto-renumbering of the following lines (not covered in this article) or do this manually, keeping some tips in your mind.

Read More “Removing some lines from .srt subtitle files”

Quickly find shortcut-related commands in Word

The Ctrl+Alt+D keyboard shortcut in Word 2010, for inserting endnote, was pissing me off quite much. I wanted to un-assign or re-assign it. But I had a real trouble finding it among all keyboard shortcuts. Mostly, because Word sometimes is using totally misleading codenames for corresponding operations.

By an accident I found a quick workaround to this problem.

Read More “Quickly find shortcut-related commands in Word”

Restore not working Windows Spotlight

Windows Spotlight is a Windows 10 feature that displays you a beautiful images on your lock screen along with some location’s information and from time to time, some tips. On contrary to some users, I really like this feature and prefer to have different lock-screen image each day instead of the same dully picture.

When Windows Spotlight stops working there are several solutions in order to restore it.

If you’re lucky, the simplest one will give you expected results and you’re done in a matter of seconds. If you’re unlucky, you’ll end up messing up with Windows PowerShell, for which you need administrator privileges.

Read More “Restore not working Windows Spotlight”

My first Zoom.us experience

Current situation forces us to switch from face-to-face meetings into on-line experience. I was forced to lead my courses this way. Today I had first attempt and wanted to share some info on how it went.

I decided to use Zoom.us, because I had some previous a bit less positive experience with Microsoft Teams and quite very bad experience with Cisco Webex. And thus I wanted to try something else or different. Zoom.us was first that came on my list after removing Teams and Webex from this list. It was also very important to me that free version offers quite a lot and paid version isn’t that expensive at all.

If you’re new to on-line meetings topic then this article might be useful to you. If you have been using this kind of services previously or have otherwise experience in this area then you may not find much value here.

Read More “My first Zoom.us experience”

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”

Migration that requires user confirmation to continue

Since there’s a pure Linux underlying PHP, you can use STDIN (actually: php://stdin) and read it with fopen when your PHP script is run in console to stop execution of your script and read a button user pressed.

Since Yii migrations are run in console, you can use this mechanism to ask user whether she or he want to continue with your database migration.

Quite handy in some scenarios (like: destroying entire database), don’t you think?

Read More “Migration that requires user confirmation to continue”

Working with code snippets in Sublime Text 3

This is another article about my transition from Netbeans to Sublime Text 3. This time I’m going to handle code snippets topic. This is another area, which is much better solved in Sublime Text 3 than in Netbeans.

This article is generally based on “Working With Code Snippets In Sublime Text” blog text from hongkiat.com. And — of course — wonderful, yet unofficial Sublime Text documentation’s chapter about snippets. With some my personal additions and updates.

Read More “Working with code snippets in Sublime Text 3”

Useful keyboard shortcuts in Sublime Text 3

This is one of the last article in my private serie of blog entries targeting developers, who starts their journey with Sublime Text 3. Treat it as memo or list for easy remembering sometimes very useful, not always often, keyboard shortcuts, that are available in ST3. Where it is possible, I’m adding links to Sublime Text Unofficial Documentation, which is great source of information in any aspect related to Sublime Text 3.

Note, that entire document is based on default Sublime Text 3 key bindings, before any user changes, like for example those mentioned in [Netbeans-like keyboard shortcuts in Text 3.txt] text. Also note, that when speaking about Alt key, I’m referring to left key. As on some non-English keyboards, right Alt key may have different meaning (entering language-specific letters etc.).

Read More “Useful keyboard shortcuts in Sublime Text 3”

Key difference between GPL and BSD licenses

For the project, I’m working on, I came over Plupload library, which is dual-licensed on GPL+OEM model. Since paying commercial license (OEM) in this project is not an option, I told my boss, that we can’t use this library, because we’d have to publish all our project’s sources as open source (base GPL licensing requirement).

He told me, that this is not true, because both PHP and Yii, that we use, are licensed in the same model.

I was so sure, that I’m correct, that I immediately made some research and wrote this article as a summary of all my findings. I was more than happy to prove my boss, that he is wrong! :>

If you think similarly to my boss, then you should definitely read this post.

Read More “Key difference between GPL and BSD licenses”

Reverse geolocation with OpenStreet Maps reverse geocoder. Pros and cons

Reverse geolocation is a process of obtaining certain geographical information (like street name, city, country etc.) based on geographical coordinates only.

OpenStreet Maps offers a cool looking (at least at first sight) reverse geocoder that can feed your application or website with a valuable geolocation data. However, as you go deeper in to the details, more cons over pros can appear.

Read More “Reverse geolocation with OpenStreet Maps reverse geocoder. Pros and cons”

List of all countries in the world, split by continent

Here is the list of 197 countries in the world, split by five continents, put as simple, not formatted list (for future use as data for some form or selection) and as HTML code.

Note, that this list contains only “full featured” countries, without any dependent territories, special municipalities, incorporated territories etc. So, you won’t find here many of the Oceania’s or Antarctic islands. Also very small, Caribbean-based dependent territories are not listed here.

Note also, that this list contains both North America’s and South’s America’s contries put together.

Read More “List of all countries in the world, split by continent”

Digital Ocean’s introduces AMS2 datacenter

Digital Oceans has officially opened new AMS2 datacenter in Amsterdam. This event forced me to do some small tests on quality of services, from my own (Poland’s perspective) point of view.

I’m not talking about Quality of Service, because this is beyond any discussion. With standard (simple to answer) tickets being answered with 3-5 minutes (!!!) and with more complex cases solved with 3-5 hours, Digital Ocean’s set itself a new world-standard. I have never found or met support of this scale.

So, if we’re not talking about QoS, lets talk about performance.

Read More “Digital Ocean’s introduces AMS2 datacenter”

Are password-protected ZIP files really secure?

In general, password-protected .zip files can be considered secure.

Some may be surprised to find out that (without knowing the correct password) any program (or user) can:

  • browse list of files inside password-protected ZIP archive,
  • check file types (try to send encrypted, password-protected ZIP containing EXE file via Gmail).

And… there are some other “interesting” things you should be aware of…

Read More “Are password-protected ZIP files really secure?”

node.js based TK102 listener

There is a fairly good looking listener for TK-102 localizers, based on node.js. You can find it in this GitHub repository. I wasn’t able to check it out yet, but from the first sight it looks promising.

The only thing, that concerns me, is that many TK-102 clones requires properly formated reply from the server, to continue connection and send actual GPS data. If localizer does not receive such reply, it will break connection. I don’t see nothing about sending reply back to localizer, so I’m worried, if this will work with these clones requiring reply-back. But… we’ll check it, we’ll see it! :]

Remove some pages from PDF and other PDF-editing operations

Acrobat Reader is a free program, but does not contain nothing around editing (with small exception). So operations like removing some pages, rotating some or all pages, converting PDF to other format, extracting pages to graphic format like JPEG, merging two and more PDF files etc. are not available in Acrobat Reader. For these you have to either purchase a paid, full version of Adobe PDF or seek for some other tools or options.

This post discuss a variety of ways and methods of removing certain pages from PDF document and doing some other editing operation on such docs.

Read More “Remove some pages from PDF and other PDF-editing operations”

Convert NTFS to FAT32 without losing data [updated]

Many people on many forums and websites claims that this or that piece of software is able to convert NTFS partition to FAT32 without losing data. In most cases this turns out to be only a blunt lie and results in a huge time waste on installing software that is only able to achieve such conversion by formatting partition.

Here you have the only known to me method of getting your drive from NTFS to FAT32 under Windows, while keeping your data safe.

One small note. Before I was really able to perform NTFS-to-FAT32 conversion without losing data I wasted hours on installing and uninstalling crappy software which was expected to be able to do such conversion, but eventually turned out not. This irritated me a little bit, so expect (and please, forgive me for) a harsh language in this article.

Read More “Convert NTFS to FAT32 without losing data [updated]”

Automate compare in folder sync tool in Total Commander

To automate compare phase (first step) in folder sync tool you should:

  1. Set the parameters as you need them.
  2. Click on the folder button in the top left of the sync dialog to save these settings.
  3. Create a button with the c:\totalcmd\totalcmd.exe /S=S:=backup command.

The := instead of just /S=S:backup causes an automatic start of the comparison.

Of course you must adjust path to reflect your location of Total Commander.

Currently you can automate the compare step, not the copy step. It is considered to risky to be automated.

Over hundred cool icon sets for your website or application

Here you have three different pages, each holding links to 25+ beautiful icons sets:

There are 109 total icons sets presented on these three webpages. Most of them are free. Some of them are devastating beautiful, some have medium quality. But, put together, makes a strong icon sets compilation, in which nearly anyone should find something interesting for his or her current project.