How to block Windows 10 Update

Windows 10 offers less UI control over the updating behavior of the operating system than previous versions of Windows , There is no option to turn off Windows Updates using the Control Panel or Settings app in Windows 10, it checks for updates automatically and install any updates they find, whether you like it or not.

To completely block all updates of Windows 10 use Windows Update Blocker tool.

How it works? Just download Windows Update Blocker – it’s freeware program and run it.

Here you can download Windows Update Blocker and get full instruction how to completely disable update of Windows 10.

Install Composer and Laravel

First install Composer package manager on on your project:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

php composer-setup.php

php -r "unlink('composer-setup.php');"

Now install Composer global:

php composer.phar global require laravel/installer

Install Composer to your project (change site-name to your project name):

php composer.phar create-project --prefer-dist laravel/laravel site-name "8.*"

You don’t need Windows anymore

Microsoft Windows is a proprietary operating system which has captured 80% personal computers in the world and using their monopoly position dictates their rules of the game.

In addition, Microsoft collects your personal information and sells it to third parties, which endangers your security.

To change the situation, many people are looking for alternative operating systems, and one such alternatives is GNU Linux.

Many years Linux was leader operating system on web servers and mainframes, but on personal computers it occupied a miserable 3%. But now the situation has changed and GNU Linux is the best free and open source alternative for proprietary Microsoft Windows.

Javascript: Closures, callback, context

A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function’s scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time.

window.onload = function(){
    var item = document.querySelector(".items .item");
    item onClick = activeItem;

    function activeItem() {
        console.log(item);
    }
}

In this example inner function activeItem() have access to global variable item. This called closure – when inner function have access to all variables, defined in global function.

JavaScript: Type conversion

To show variable type use typeof:

let value = true;
console.log(typeof value); // boolean

Let’s convert our variable to string:

value = String(value); // now value is a string "true"
console.log(typeof value); // string

Numeric Conversion

Numeric conversion happens in mathematical functions and expressions automatically.

For example, when division / is applied to non-numbers:

console.log( "6" / "2" ); // 3, strings are converted to numbers

We can use the Number(value) function to explicitly convert a value to a number:

let str = "123";
console.log(typeof str); // string

let num = Number(str); // becomes a number 123
console.log(typeof num); // number

Explicit conversion is usually required when we read a value from a string-based source like a text form but expect a number to be entered.

If the string is not a valid number, the result of such a conversion is NaN. For instance:

let age = Number("an arbitrary string instead of a number");
console.log(age); // NaN, conversion failed

Examples of numeric conversion:

console.log( Number(" 123 ") ); // 123
console.log( Number("123z") );  // NaN (error reading a number at "z")
console.log( Number(true) );    // 1
console.log( Number(false) );   // 0

Please note that null and undefined behave differently here: null becomes zero while undefined becomes NaN.

Boolean Conversion

The conversion rule:

Values that are intuitively “empty”, like 0, an empty string, null, undefined, and NaN, become false.
Other values become true.

For instance:

console.log( Boolean(1) ); // true
console.log( Boolean(0) ); // false

console.log( Boolean("hello") ); // true
console.log( Boolean("") ); // false

Summary

The three most widely used type conversions are to string, to number, and to boolean.

String Conversion – Occurs when we output something. Can be performed with String(value). The conversion to string is usually obvious for primitive values.

Numeric Conversion– Occurs in math operations. Can be performed with Number(value).

Boolean Conversion – Occurs in logical operations. Can be performed with Boolean(value).

Install monit in Debian 10 (buster)

Monit is a free open source utility for managing and monitoring, processes, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.

To install Monit on Debian 10 GNU Linux (Buster) you need to add backports repository:

printf "%s\n" "deb http://ftp.de.debian.org/debian buster-backports main" | \
sudo tee /etc/apt/sources.list.d/buster-backports.list

Then update package list:

sudo apt update

And install buster-backports and monit package:

sudo apt install -t buster-backports monit

To start monit service and show running status use commands:

sudo systemctl start monit
sudo systemctl status monit

If you want to enable auto start monit when system starts use command:

sudo systemctl enable monit

Now let’s configure monit to monitoring Apache2 and Nginx services. Open monit configuration file:

sudo vim /etc/monit/monitrc

To change monitoring interval change option:

set daemon 120

To send email if monitored services is down edit this options:

set mailserver your.mail.server
set alert your.mail.address

You can enable Web-interface where you can view information about monitoring services. By default monit starts on 2812 port. Enable this two lines and change administrator password:

set httpd port 2812 and
allow admin:monit # require user 'admin' with password 'monit'

Don’t forget to open port 2812 in firewall and restart monit service:

sudo systemctl restart monit

Now open http://your-site.com:2812 and see monit web interface:

Install Skype on Debian 10

Skype is not an open-source application, and it is not included in the default Debian repositories. We’ll install Skype using the Skype deb package.

Download Skype deb package:

wget https://go.skype.com/skypeforlinux-64.deb

When the download is complete, install Skype using command:

sudo apt install ./skypeforlinux-64.deb

Now run Skype and authorize with your login, that’s all

Install Viber on Debian 10

Step 1: install flatpak:

sudo apt install flatpak

Step 2: install Viber:

flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak --user install flathub com.viber.Viber

That’s all, scan QR code with your phone and use Viber on Debian 10!

Installing Wine 6 on Debian 10

Step 1: Enable 32 bit architecture

sudo dpkg --add-architecture i386 

Step 2: Add WineHQ repository

We will pull the latest Wine packages from WineHQ repository that is added manually. First, import GPG key:

sudo apt update
sudo apt -y install gnupg2 software-properties-common
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -

You should receive “OK” in the output. Add the Wine repository by running the following command:

sudo apt-add-repository https://dl.winehq.org/wine-builds/debian/

The command will add repository to line /etc/apt/sources.list file.

Update APT package index:

sudo apt update

Step 3: Install Wine 6 on Debian 10

After configuration of the APT repository, the final step is the actual installation of Wine 6 on Debian 10. Add Wine OBS repository:

wget -O- -q https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/Release.key | sudo apt-key add -    
echo "deb http://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10 ./" | sudo tee /etc/apt/sources.list.d/wine-obs.list

Then install Wine from Stable branch:

sudo apt update
sudo apt install --install-recommends winehq-stable

And for latest release in staging, use:

sudo apt install winehq-staging

After installation. verify version installed.

wine --version  # Stable
wine-6.0

wine --version  # Staging
wine-6.5 (Staging)