Put significance on tens and ones or round to a negative precision [updated!]

I had a situation in Excel where tens and ones are the only significant parts of a any number. For some Polish language-specific issues I have come with the situation that no matter how big number is, I need to know the value of its last two digits or last digit.

For example:

21 --> 21 and 1
56 --> 56 and 6
160 --> 60 and 0
1122 --> 22 and 2
679014 --> 14 and 4
1053405 --> 5 and 5

Learning the fact that ROUND(), ROUNDUP() and ROUNDDOWN() functions in Excel can be used with a negative precision parameter helped me solved this issue.

I am not too good in Excel, so maybe (update!) there are prettier solutions. This one works, however…

Read More “Put significance on tens and ones or round to a negative precision [updated!]”

Introduction to curl

This is just a barely memo about very, very basics of curl. Since curl fetches URLs and data from some endpoints, it can be used for a variety of reasons. I am using to for a very basic (and quick!) API calls tests.

If you’re on Linux, Unix or any of its clones or if you’re on Mac then you most likely have curl. If you’re on Windows, but you’re using Git for Windows (or some similar tool) then you have curl.

So, let’s jump into that basics. Be warned — you will not find here anything that you wouldn’t already knew.

Read More “Introduction to curl”

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”

Disable automatic restarts in Windows 10

Windows knows better then you when to restart your computer. And Windows 10 is the most qualified in such knowledge. That’s why in some scenarios you may lost 40+ tabs open in your browser and a lot of programs running, when your Windows decided that it must be restarted right now.

There are many approaches to preventing Windows 10 from auto-restarting itself:

However, the solution that worked for me is “Disable Automatic Windows 10 Restarts” script at GitHub.

Increasing “Max upload file size” in WordPress the right way

To all those disbelievers — yes, uploading 1 GB or bigger files to WordPress is possible! :)

And you don’t have to play with some workarounds like uploading files through FTP and hard-linking them with your post. You can upload large file right in WordPress built-in file uploader.

However, a lot of steps may be needed before you will be able to achieve this.

Read More “Increasing “Max upload file size” in WordPress the right way”

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”

Batch-change value of thousands of cells in Excel sheet

There are milion of ways on modifying many cells’ value in single pass using… formula. But, what about a situation, when you need to perform only a single one-time bulk-change of value in many Excel’s cells?

I had a situation when I was preparing some IT project’s budget. Since I am an IT geek then writing amounts in thousands like 1,30k USD was no problem at all. However, this solution had two falls:

  • Some accounting freak, having nothing to do with IT, had problems understanding that “k” means thousands
  • Cells itself had to use some custom formatting of ##0,00k USD in order to add that damn “k”

Thus, I had to do a one-time recalculation of most of cells in my sheet to multiply their value by 1000.

Read More “Batch-change value of thousands of cells in Excel sheet”

Factory reset Kindle with semi-frozen screen

The steps for performing factory reset of a Kindle are quite easy:

  1. From the home screen, select Menu.
  2. Select Settings.
  3. Select Menu again then select Reset Device.

The problem appears when your screen is frozen and you don’t see anything or almost anything.

I had this situation that only tiny part of my screen was still responsive. I wasn’t able to see most of the menu and settings sections, but at least I managed to see:

  • When my Kindle is awaken
  • When its menu is or isn’t opened up (I didn’t see many menu items though)
  • Which page of Settings I am currently at

This allowed me to figure-out a key combination needed to blind-reset my Kindle.

If your Kindle has a completely dead screen and you don’t see anything of above then sorry, this article won’t help you.

Read More “Factory reset Kindle with semi-frozen screen”

Change page size when scanning in Windows 10

If you’re scanning images using Window’s native drives and software (i.e. not those provided by your scanner manufacturer) you may often hit the wall of not being able to change scanned page side due to fact that corresponding list is disabled:

In this article I’ll show you how to change this value (page size). But, keep in mind that this will be a one time solution. As far as I know there is now permanent solution for this problem.

Read More “Change page size when scanning in Windows 10”

Can’t enable BitLocker for pendrive or USB removable drive

If your pendrive or removable drive (after selecting it in This PC) has BitLocker button disabled (in Protect section of Drive Tools tab) or if you can’t see it listed in BitLocker itself then it is (currently) not supported. Most guides you’ll find will tell you that the destructive way of formatting drive is the only option.

That turned out to be not true, at least in my case. Simple deactivation of pendrive’s partition using DiskPart solved problem.

Of course you need Windows 10 Pro, because “lower” editions of this system does not have BitLocker.

Read More “Can’t enable BitLocker for pendrive or USB removable drive”

Different PHP versions per single hosting

Using simple one-liner in .htaccess file you can enforce different PHP version in two or more of your folders. If you have different websites / domains / services registered for each folder, you can as an effect have single hosting running two or more applications that requires different version of PHP parser.

Note that this will most likely work on shared hostings only, where your ISP provides different versions of PHP at your service and some web tool (i.e. cPanel) to switch between them. In most of such cases web tool allows you to pick the same PHP version for the entire hosting. With this solution you can have them different.

However, on your private servers and hostings you have to provide that different versions of PHP parser will be installed and made available.

Read More “Different PHP versions per single hosting”

Enable System UI Tuner on Android 11 and 10

System UI Tuner is gone from Android 11 and 10? Long-pressing config gear gives no effect? You no longer can control what (and how) is displayed in your status bar in Android device?

Well… not quite. It is still there. Only some weird person decided to remove access shortcut to it.

And you need to recreate it:

  • an activity in Nova Launcher, if you’re using it,
  • a Tasker script, if you are using it,
  • a standalone app, if none of above works for you.

The need of installing a 3rd party app only to enable some existing feature is as weird as it can be.

But, hey!, it Android, right?

Read More “Enable System UI Tuner on Android 11 and 10”

Turn off Bluetooth discoverability on Android devices

Some folks responsible for design and development of different Android versions or different UIs for this system must have some problems with their mental sanity, because they think that it is very funny to have your device discoverable to all surrounding devices whenever you only enable Bluetooth.

I don’t find it funny. Even more, I find it weird, bad and evil.

I had an issue with Xiaomi Redmi 6 phone, having MIUI 11 launcher installed. I find the regular way of turning off Bluetooth discoverability on this phone impossible and ended up with the need for installing some app.

This is a generic solution that may work in your case, even if you have some other Android gear, so I decided to share my experience here.

Read More “Turn off Bluetooth discoverability on Android devices”

Transfer private MP3 files from PC to iPhone SE 2020

It is not possible to simply copy files from PC to iPhone, over a cable. If you connect your iPhone (or probably any other Apple mobile device) to your PC, you will be only able to access “DCIM” folder and your photos or maybe videos. No way to copy MP3 music or audiobooks.

Using iTunes to achieve above was the simplest and preferred way in my case though this wasn’t as easy process as I expected. And that’s why I decided to wrote this article to let you avoid some bottlenecks.

If you’re looking for some other options or ways, like some non-iTunes way, this is also briefly discussed here.

Read More “Transfer private MP3 files from PC to iPhone SE 2020”

Listen to YouTube’s audio with screen turned off

It is impossible to use YouTube like an audiobook or audio source because a moment after your turn off your screen or after it is dimmed off due to timeout the playback is stopped and audio is cut-off.

To workaround this problem you can either consider or another YouTube client app:

or you can consider some other browser (namely Firefox).

Read More “Listen to YouTube’s audio with screen turned off”

Get rid of Redirect Notice from Google Calendar

Google wants to know everything about you. One of the way of achieving it is to put every link, you paste or write into any of their services (i.e. Gmail, Calendar etc.) through their own sniffing tool. In other words, anything like http://www.example.com, it will be turned into https://www.google.com/url?q=http://www.example.com or something similar.

For most Google services this being done nearly silently. You’re still sniffed at all paces, but your user experience isn’t affected. Sniffing and redirects are nearly invisible. All you can notice is a difference between URL you’re looking in browser and the one that you see in browser’s status bar.

However, there’s a on exception. It was proven many times that Google Calendar developers are a complete morons. And yes, they wasted up even their very own sniffing tool. Thus, whenever you click any link in Google Calendar, you see a supremely annoying “Redirect Notice” middle page.

Read More “Get rid of Redirect Notice from Google Calendar”

System interrupts kills PC / eats up to 100% of CPU

If your computer is suddenly slowing down noticeable and you have just:

  • installed a new driver or added new piece of hardware,
  • installed or started using some new hardware-related service (i.e. Internet phone, conference software)

then check Task Manager to see, if System interrupts isn’t consuming most of / all of CPU power of your PC.

Read More “System interrupts kills PC / eats up to 100% of CPU”

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”

The server drafts location you entered for offline editing is not valid (updated)

At some point in your struggle with Office 365 off-line applications (Word 365, Excel 365, PowerPoint 365 etc.), when trying to save any changes to Options dialog, you may run into following error:

The server drafts location you entered for offline editing is not valid or you do not have permission to access that location. Specify a location on your local computer.

In short, this has nothing to do with Office and most likely, you (or someone / something else) deleted your c:\Users\[username]\Documents folder. Closing Office 365, re-creating this folder should fix this problem.

Read More “The server drafts location you entered for offline editing is not valid (updated)”

Blaupunkt VCH601 for the seniors

I had to pick a handheld-hoover for my oldies. Due to their age, the actual weight of the device was an absolute priority. I decided to get Blaupunkt VCH601 — which seems to be unbeatable in this category (only 2.2 kilograms) — even though it turned out that it surprised me in some other areas.

If you think that a handheld-hoover description is far from IT and shouldn’t be published here then you may be wrong. Even IT geeks must clean up their rooms from time to time, sorry! :>

Read More “Blaupunkt VCH601 for the seniors”

QNAP TS-210: Support, reset and configuration

One of my disk in two-disk stripping array of my ol’ good QNAP TS-210 has failed. I had to do some reasearch to update my knowledge and decided to share it here, to have it handy and hopefully help others.

Here you’ll find some quick details on resetting and configuring your QNAP TS-210 (may also apply to some other models?) and on getting some support, if all else fails.

Read More “QNAP TS-210: Support, reset and configuration”

Paste not formatted text to Word

In many programs, applications and web services you can use the Ctrl+Shift+V keyboard shortcut when pasting to override source formatting and paste copied text “as is”, thus using destination document’s formatting. Google services are especially promoting this shortcut, which you can use to paste not formatted text i.e. to Gmail message.

In Word this isn’t that easy. You must:

  • bring up Paste Special window (I use another keyboard shortcut for this — Ctrl+Shift+Insert for example),
  • navigate through list of available options (using Up or Down keys) to locate Unformatted Text option,
  • confirm selection with Enter or by clicking OK.

I wanted to make it simpler and working the same way as in other services. Fortunately, it was an easy keyboard shortcut assignment in Word.

Read More “Paste not formatted text to Word”

Rules for pasting large text to Gutenberg / WordPress

Here’s the rule of thumb:

  1. Gutenberg changes pasted large text into separate blocks, if you have two line separation between paragraphs,
  2. If you have single line paragraph separation then Gutenberg will paste whole text into single block.

If you’re pasting from Word or other rich editor then everything should be OK. But, if you’re pasting from some non-rich text editor (I am using Notepad++) and you have a single line paragraph separation then a short trick must be done prior pasting text to Gutenberg.

Read more