Reverse dates in filenames using Total Commander’s multi-rename tool

Multi-rename tool in Total Commander is fantastic (when you know how to use it) and it saved my ass (before manually renaming many files) in many scenarios, including some very specific or even weird ones.

This scenario is one of such.

I had dates written directly as a part of filename, i.e.: Document name (DD-MM-YYYY).jpg, but (as shown) starting with day and ending with year. I had to reverse them, but only dates, keeping the rest of file untouched — i.e. Document name (YYYY-MM-DD).jpg.

At first, I thought that this time I will be forced to do this manually. But, I recalled multi-rename tool’s documentation and its small part about backward characters counting (i.e. from end of filename).

Read More “Reverse dates in filenames using Total Commander’s multi-rename tool”

Doing IT in Switzerland

I have a chat with a HR guy from Switzerland. He gave me some wages for the IT (May 2021; post-COVID!):

Most likely gross, but still… Swiss IT is doing good. Really, good…

Various wako problems with Alt+Tab and Microsoft products

Ever since Windows exists there was a very handy Alt+Tab combination to quickly switch between open applications. Nowadays, when people are using many screens for single computer it might be less often used, but still is very familiar and handy.

Not for so long time, but still for quite long, Microsoft is doing everything to make that simple, obvious and easy to understand combination work as wrong as possible in their products, so from time to time you may run into a really weird behaviour. For example:

Fortunately these inconsistencies and workflow breakers exists only in certain Microsoft products and are easy to fix.

Read More “Various wako problems with Alt+Tab and Microsoft products”

MEGA — file sharing and cloud storage far above average

The IT world grows, big data becomes your everyday’s pal. Whether you are a developer or project manager, you need to store more and more data each and every day. Getting a good quality and reliable solution becomes a bit challenge. To help you with that I wanted to tell you a bit about MEGA service.

I found it by a complete coincidence (I am not getting paid for this post!) — a friend has shared a file with me. I dug into details and found it interesting. In my opinion MEGA is far better than most file sharing services and can challenge even well known cloud storage options like Google Drive, Dropbox or OneDrive.

So, what makes MEGA that unique? In short: command-line tool, NAS support, mobile apps, browser’s extensions and many more.

Read More “MEGA — file sharing and cloud storage far above average”

Force Microsoft Edge to safe images with .jpg instead of .jfif extension

There are million of guides in the Internet on how to correct this stupid default behavior that happens in Microsoft Edge nearly every time and in Google Chrome from time to time. But all these solutions requires you to read through long block of text or watch 2-3 minutes long video while solution is actually ultra-fast.

  1. Start > type regedit > hit Enter
  2. Paste Computer\HKEY_CLASSES_ROOT\MIME\Database\Content Type\image/jpeg to address bar > hit Enter
  3. Double click on Extension > paste .jpg > hit Enter

And… you’re done! Restart Edge to see the effects. No more .jpg files saved with stupid .jfif extension.

File upload blocked despite ALLOW_UNFILTERED_UPLOADS set to true

Some file types are reporting its MIME type different than it is associated with given file extension in WordPress database. Such file upload will be blocked for security reasons (.epub file in my case):

X.epub: Sorry, this file type is not permitted for security reasons

A special ALLOW_UNFILTERED_UPLOADS flag is used in WordPress in such situations. You should try it first. If you still have not satisfying results (i.e. you still can’t upload a file of certain type) then it may mean some MIME table changes made by either your plugin or theme or even a nasty bug in WordPress itself.

In all cases, using must-use plugin with some small filter should solve the problem.

Read More “File upload blocked despite ALLOW_UNFILTERED_UPLOADS set to true”

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”

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 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.)

Multiple cursors and selections

Sublime Text 3 allows you to edit text in more than one place at once, using multiple cursors. Simply hold Ctrl key, click in two or more places to set multi cursors. Then start typing anything and observe the effect of text being entered in all these positions simultaneously. Click anywhere without Ctrl pressed to “reset” back to one cursor mode.

You can also use multiple selections. Select some text and press Ctrl+D to select next instance of the very same text, as in current selection. Continue pressing Ctrl+D to move forward and select following instances of selected text. Press Ctrl+U to move backward, unselecting each previously selected instance. Press Ctrl+K and Ctrl+D to skip current instance and move to the next one.

If you wish to select entire line, press Ctrl+L.

There are few useful keyboard shortcuts for quick selection expanding. Ctrl+Shift+Right or Ctrl+Shift+Left traditionally (as in many editors) spans selection over next or previous word. Alt+Shift+Right and Alt+Shift+Left does the same, but they operate of “subwords”, which means — will stop also on underscore (_), which is very useful for selecting variables, symbols etc. Previous set of shortcuts stops only on spaces, so in the word this_is_an_example it will expand selection for the entire word at once, while Alt+Shift and arrows will expand on each of these “subwords” respectfully.

Pressing Ctrl+Shift+M will select entire text inside current brackets. Used mostly, when cursor stands next to the opening bracket, to expand selection all the way to the closing bracket. But, can be used also in any place between two brackets.

Ctrl+T is used by default for transposing (swapping together) two letters or two words. But, if you installed CTags plugin (more about in this article, then this shortcut will be overridden by that plugin for its base functionality. You must define your own for transposing or redefine CTags’s shortcut to use these two functionalities together. Read [Netbeans-like keyboard shortcuts in Text 3.txt] to find out more about key bindings in Sublime Text 3 and for examples of user-defined keyboard shortcuts.

Searching and replacing

When search box (Ctrl+F) is opened, you can use both F3 and Enter to move to the next search result (found text instance) and both Shift+F3 and Shift+Enter to move back to previous one. If search box is hidden, but search query defined, you can use only F3 / Shift+F3 shortcuts. With the same logic, you can use both Alt+F3 and Alt+Enter to select all instances matching current search criteria, when search box is open, or only first one, if it is closed.

You can use Ctrl+Shift+H to replace currently selected instance of search criteria with given replace pattern and move and select following one (if nothing is selected, it selects nearest instance, but not replaces anything with first pressing of this shortcut). You can also use Ctrl+Alt+Enter to replace all instances at once. These two shortcuts works no matter, if replace box (Ctrl+H) is open or closed.

Hit Esc to dismiss both search and replace pane.

Other shortcuts

Press Ctrl+0 to focus sidebar, to be able to use it (navigate through files and folder) with just your keyboard. Hit Esc to go back to the editor.

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! :]