How to hide the Jetpack menu for users

To hide the Jetpack menu for subscribers and regular users, it’s enough to add the following code to the active theme functions.php file:

function ap_remove_jetpack_page( ) {
if ( class_exists( 'Jetpack' ) && !current_user_can( 'manage_options' ) ) {
remove_menu_page( 'jetpack' );
}
}
add_action( 'admin_menu', 'ap_remove_jetpack_page', 999 );

Also for this there are several plugins, but those that came across to me are quite old.

Ufw setup in Ubuntu

ufw stands for Uncomplicated Firewall.

If ufw is not installed in the system, then install it with the command:

sudo aptitude install ufw

The command activates ufw in the system, it will also be included every time the system starts:

sudo ufw enable

If ufw does not start after restarting the system, then edit ENABLED=no to ENABLED=yes in the file:

sudo nano /etc/ufw/ufw.conf

To disable is used:

sudo ufw disable

Deny all incoming connections:

sudo ufw default deny

To allow access for a subnet or address:

sudo ufw allow from 10.0.0.0/24

To re-enable all incoming connections:

sudo ufw default allow

Permit SSH connection from outside:

sudo ufw allow ssh

An example of allowing access to a specific port:

sudo ufw allow 80/tcp

View status:

sudo ufw status
sudo ufw status verbose

Disable logging:

sudo ufw logging off

View profiles for applications:

sudo ufw app list

The configuration files are in /etc/default/ufw and /etc/ufw/applications.d

View official documentation:

man ufw

See also my article – Configure IPTables

Resolving Error 0x80246017 in Windows 10

You can solve the error 0x80246017 by quickly completing a few points:

1) Open the command prompt as administrator.

2) Execute the following commands in it:

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /v "BranchName" /d "FBL_AWESOME1501" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /v "ThresholdRiskLevel" /d "low" /t REG_SZ /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /v "ThresholdInternal" /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability" /v "ThresholdOptedIn" /f

Done, the error should not be.

Installing and configuring Tiny Tiny RSS in Ubuntu

Tiny Tiny RSS – aggregator of RSS feeds, which can be viewed in a single personal web-interface.

To get started, download the latest Tiny Tiny RSS version by running the command:

git clone https://github.com/gothfox/Tiny-Tiny-RSS tt-rss

Install the web server and MySQL server if they are not installed:

sudo apt-get install apache2 php5 mysql-server mysql-client

Create a database:

mysql -p -e "CREATE DATABASE `ttrssdb` CHARACTER SET utf8"

The previously downloaded directory from Tiny Tiny RSS will be moved to the web server directory:

sudo mv ~/tt-rss/ /var/www/

Open the installation directory in the browser http://HOSTNAME/tt-rss/install/, and follow the instructions on the screen.

After installation, open the main page http://HOSTNAME/tt-rss/ and enter the name: admin, password: password.

To update the RSS, add the following line to /etc/crontab:

*/30 * * * * /usr/bin/php /var/www/tt-rss/update.php --feeds --quiet

Alternatively, in the configuration file config.php, we change the parameter SIMPLE_UPDATE_MODE from false to true, and the RSS feeds will be updated when the web interface is opened.

In the settings it is desirable to change the administrator password.

Solution of the error “The ordinal 42 could not be located in the DLL” (xlive.dll) when starting games

One day while starting the game, Fallout3.exe noticed a pop-up window with the error:

The ordinal 42 could not be located in the dynamic link library
C:\Windows\SYSTEM32\xlive.dll.

So, this error is solved easily and quickly by installing the application “Games for Windows Software”.
Download it at the link:
http://go.microsoft.com/fwlink/?LinkId=98609

That’s all.

Configure Loop Protect in RouterOS (MikroTik)

Finally, starting with the version of RouterOS v6.37 and higher, protection against loops has appeared.
Loop Protect can be enabled on ethernet, vlan, eoip, eoipv6 interfaces.
Via WEB and Winbox on the interface settings page, opening the Interfaces menu.

Through the CLI, you need to go to the required submenu:

/interface ethernet
/interface vlan
/interface eoip
/interface eoipv6

Continue reading “Configure Loop Protect in RouterOS (MikroTik)”

Recovering file systems using fsck

Fsck (File System ChecK) – checks and restores file systems.

Before starting the scan, unmount the file system with the command:

umount /dev/sda1

An example of starting a scan (where /dev/sda1 is a device or partition to be checked):

fsck -V -C -f /dev/sda1

View brief documentation:

man fsck

I will describe some startup keys:
-C (display progress bar if possible)
-M (do not check mounted file systems)
-p (auto mode)
-y (agree to all questions)
-n (disagree on all questions)
-f (forced check)
-V (more detailed information)

Installing and using the nbtscan network scanner

Install command in Linux Ubuntu/Debian:

sudo apt-get install nbtscan

The Windows version can be downloaded from http://www.unixwiz.net/tools/nbtscan.html

Network scan example:

nbtscan 192.168.1.0/24

I will describe the possible startup keys:
-O FILENAME (output information to file)
-v (more detailed information output)
-p (port indication)
-H (generate HTTP header)
-m (MAC address indication)
-n (do not convert names to DNS, display only IP)
-t NUMBER (response time in seconds, default 1)
-v (display version nbtscan)

HP LaserJet P2055dn Firmware Update

I noticed once that the HP LaserJet P2055dn printer began to print for a long time, there were long pauses between printing, while there were no problems with the network and the size of the printed files was small.

Going to the IP-address through the browser in the printer’s web interface in the menu “Status” – “Device Configuration” you can see the version of the current firmware (firmware), it should be older than the downloaded one.

Let’s download the new firmware from the official site
https://support.hp.com/us-en/drivers/selfservice/HP-LaserJet-P2000-Printer-series/3662052/model/3662058

Run the downloaded file, select the printer in the window that opens (it should be turned on) and click “Send Firmware” to start the firmware update process. Wait for the firmware update to complete.

This completes the update process. By the way, after the update, the problem with the delay in printing disappeared.