Skip to content

Malaczynski.eu Posts

Moving a window between screens

Another great live hack. If you normally work on two screens, and you need to work remotely on one, and you don’t see any window open, it’s probably open on the other screen. To move the window to your screen, press Winkey+Shift+left/right arrow.

And one more thing: if you press Winkey+arrow left/right/up/down, you can manipulate the active window.

Sleep

On one of the channels that I subscribed on YouTube is currently running a productivity week. That means they have special prices on their books, courses and webinars and run online webinars. But my point is:

A lecturer in this film said that sleep is one of the most important things. The body regenerates, which everyone knows, but I didn’t know that in addition to mental rest ant the work the brain does, it also regenerates physically thanks to melatonin, and now my thoughts on the subject:

Assuming that indeed the circadian rhythm makes any difference then most likely due to too little sleep and the sleep debt I have incurred, my body is much older that it should be. And what’s worse, my wife slowly finishes me off every day because her alarm clock wakes me up much earlier that I should get up, the sleep debt increase, and thus I get even older 😉

The solution to this problem will be either turning off my wife’s alarm clock in her phone and turning it on in her watch or giving up evening activities in favour of getting up e.g. at 5 o’clock which is before my wife’s alarm clock.

Technical stuff

When I’m not working on technical issues, I can’t publish things like that. So I decided to submit notes about other case.

Magic Mirror Birthday Updater

Year after year I have to update my birthday calendar on magic mirror. I use this solution:

https://forum.magicmirror.builders/topic/10126/getting-google-contacts-birthdays-into-calendar

But this year, some bugs made it impossible for me.

10:41:30 AM
Error
Exception: You have been creating or deleting too many calendars or calendar events in a short time. Please try again later.
Sync_Birth_Cal
@ 

I do nothing with this error, only ran the script again and again.

10:44:50 AM
Error
Exception: You have been creating or deleting too many calendars or calendar events in a short time. Please try again later.
Sync_Birth_Cal
@ 

This was more of a challenge. But one command added in last for loop fixed this problem.

  for (var t in eventToCopy){
    var newEvent = calendarDestination.createEvent(eventToCopy[t].getTitle(), eventToCopy[t].getStartTime(), eventToCopy[t].getEndTime());
  Utilities.sleep(500)
  }

Nginx subfolders

I wanted to publish another site on my server. Now I have Nginx and WordPress but how to publish another site lets say on address malaczynski.pl/test/?

We will use Nginx web server.

I put all new site files in /var/www/test folder,
now I open Nginx config:

 sudo nano /etc/nginx/sites-available/wordpress.conf

and add before last } :

location /test {
    root /var/www;
}

transfer.sh

It takes me a while to finish a post about Magic Mirror. It was too laborious to pull out the config file. But now I know transfer.sh site. It main functionality is “Easy file sharing from the command line” and it really was easy.

$ curl --upload-file ./config.js https://transfer.sh
https://transfer.sh/EDqx8K/config.js

And this is everything.

Edit. It is not a blessed by good program. I have no idea how to delete the file. Delete link generator is not working. And the worst is that Firefox block this site as a “This website is on the list of sites with potentially dangerous content.”

Windows 10 virtual desktops

It was something new to me when I realized that windows 10 has virtual desktops. Here are some shortcuts to enable and use them:

Windows key + CTRL + D Add a virtual desktop
Windows key + CTRL + Arrow right Switch to the virtual desktop on the right
Windows key + CTRL + Arrow left Switch to the virtual desktop on the left
Windows key + CTRL + F4 Close the current virtual desktop

Automatic switching off all lights

I came up with another NFC automation idea.  When I go to bed all the motion sensor activated lights are on. To turn them off, I stuck an NFC tag on the radiator knob and added that code to the Home Assistant automation file. Now when I touch the knob with my phone all the lights in the house are turned off.

- alias: lights_off_tag
  initial_state: true
  trigger:
    platform: tag
    tag_id: b542b144-2e75-4f7c-bede-a6dd8d149a25
  action:
    service: light.turn_off
    entity_id: all