Categories
Uncategorized

Apple wireless Keyboard lag

When experiencing keyboard lag on your Apple wireless keyboards I found that resetting all connected apple devices resolved the issue. Simply removing / disconnecting the keyboard didn’t solve the issue.

Reset Connected Apple Devices

  1. Hold down the Shift and the Option keys and click on the Bluetooth icon in the top menu bar.
  2. Select Factory Reset all Connected Apple Devices.
  3. Reconnect (pair) your Bluetooth devices.
Categories
Uncategorized

High CPU usage by Google Drive

I’ve been noticing high CPU (20% and higher) by multiple google drive processes on an RDS Server. Killing Google Drive on the server did not fix the issue.

After further investigation it appeared that the users on the RDS server had Google Drive auto started but couldn’t use it as the screen would never show up to login. I’m guessing Google drive got into some weird loop or so. For each user on their desktop I went to the Settings > “Startup Apps” settings and disabled the auto start of Google Drive. This solved the issue all together.

The multiple high CPU processes created by Google Drive disappeared. This makes sense as I did not see just one Google Drive instance but multiples.

Categories
Uncategorized

Initialize MySQL 8 Data Directory on Windows 10

When installing MySQL 8 on Windows 10 you will have to initialize the data directory. Run a CMD as administrator and paste the following in

"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld" --initialize-insecure --basedir="C:\Program Files\MySQL\MySQL Server 8.0" --datadir="C:\Program Files\MySQL\MySQL Server 8.0\data" --console

Without the data directory being in initialized you will get messages like:

  • “Failed to find valid data directory”
  • “Data Dictionary initialization failed”
Categories
Uncategorized

Resize Linux osDisk partition on Azure

1) Login to the VM using SSH, we can check the size of the disk by using:
sudo dmesg | grep -i sda

We should see something similar to the output below (assuming you changed the size to 100GB on the portal for the disk):
[    3.100914] sd 2:0:0:0: [sda] 209715200 512-byte logical blocks: (107 GB/100 GiB)

2) To proceed with the partition resize, we will use: sudo fdisk /dev/sda

type: p
this will show partition /dev/sda1

type: d
type: n then p1 (to recreate partition 1) you can accept the default values
NOTE: if you receive a message about deleting or keeping a signature on the disk, just answer N
type: w (to save the new partition)
type: q (to exit fdisk)
sudo reboot (to reboot the VM so the partition is updated)

3) To finalize the resize, after the reboot, execute the command: resize2fs /dev/sda1

4) Use the command: df -h to verify its size:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 99G 698M 94G 1% /

From: https://docs.microsoft.com/en-us/archive/blogs/linuxonazure/how-to-resize-linux-osdisk-partition-on-azure

Categories
Uncategorized

Install the Azure Linux Agent

Perhaps as easy as? –

apt install waagent
service walinuxagent restart

——-NOT THE FOLLOWING?!—–

Choose the Azure Linux Agent release here:

https://github.com/Azure/WALinuxAgent/releases

Copy the URL to the tar.gz file

Go the the directory you want to download the file and enter

wget https://github.com/Azure/WALinuxAgent/archive/XXXXX.tar.gz

Expand the file

tar -xvf XXXXXXXX.tar.gz

Install the new python downloaded version

sudo python setup.py install --register-service

Restart the waagent service

sudo service waagent restart

Verify the version details

waagent -version

If you get an error saying setup tools is missing run the following:

To install setuptools on Debian:

sudo apt-get install python3-setuptools

For an older version of Python (Python 2.x):

sudo apt-get install python-setuptools

Reference: https://github.com/Azure/WALinuxAgent

Reference: https://cloudskillsup.com/upgrade-microsoft-azure-linux-python-agent-in-private-network-node/

Categories
Uncategorized

Gnome GUI “Authentication Required” Administrator password

When getting a popup message to Authenticate as “administrator” in gnome it most likely means the user you are using does not have the correct groups associated to them.

Some of the messages you see were “Authentication required to refresh system repositories”

When rebooting or relogging in, it will now show your username to authenticate instead of “administrator”

Add the user to the adm and sudo group.

sudo usermod -a -G adm <username>

sudo usermod -a -G sudo <username>

Not exactly related – but similar issue:

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/352

Categories
Uncategorized

Compacting Linux VHDX with Hyper-V

I wasn’t able to reduce the file size of my Linux disks on Hyper-V through the build in compact function of Hyper-V

In order to compact your disk run the following command on the Linux install

sudo fstrim -v

Shutdown your Linux install

Compact your disk

Credit: https://helgeklein.com/blog/2016/11/faster-trimming-compacting-hyper-v-ubuntu-vms/

Categories
Uncategorized

Default page to serve Apache2 and Debian9

sudo nano /etc/apache2/mods-enabled/dir.conf

Add file name that it can access only with directory’s name, or change the order

DirectoryIndex index.html index.htm
Categories
Uncategorized

Install Ubuntu 18.4, Apache2, PHP 7.3 and Percona 5.7

Update system repositories

sudo apt update

Install Apache 2

Install Apache 2 with the apt command

sudo apt install apache2

Allow Apache on UFW and verify its status

sudo ufw allow 'Apache'

Install PHP 7.3

Update system repositories

sudo apt update
sudo apt upgrade

Add PPA for PHP 7.3

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

Install PHP 7.3 for Apache

sudo apt install php7.3

Install PHP 7.3 Extensions

Install extensions through:

sudo apt install php7.3-extension_name

sudo apt install php7.3-common php7.3-mysql php7.3-xml php7.3-xmlrpc php7.3-curl php7.3-gd php7.3-imagick php7.3-cli php7.3-dev php7.3-imap php7.3-mbstring php7.3-opcache php7.3-soap php7.3-zip php7.3-intl

Adjust php.ini file

sudo nano /etc/php/7.3/apache2/php.ini

upload_max_filesize = 100M
post_max_size = 48M
memory_limit = 512M
max_execution_time = 600
max_input_vars = 3000
max_input_time = 1000

Restart Apache2 and PHP services

sudo systemctl restart apache2.service

Test PHP7.3 and Apache2 install

sudo nano /var/www/html/phpinfo.php

Add the following line and save

<?php phpinfo( ); ?>

Load web browser with localhost/phpinfo.php

The following is ONLY for dev environment

Add current user to group that owns /var/www/html folder

sudo usermod -a -G GROUPNAME USERNAME

Reboot system

Change group permissions to rwx

sudo chmod -R g+rwx /var/ww/html

Install Persona 5.7

Source: https://www.percona.com/doc/percona-server/5.7/installation/apt_repo.html

Update max_allowed_packet in mysqld.cnf to 32M to prevent Mysql went away message when doing large imports like: “ERROR 2006 (HY000) at line XXXX: MySQL server has gone away”

sudo nano /etc/mysql/percona-server.conf.d/mysqld.cnf

[mysqld]
max_allowed_packet=32M

sudo service mysql restart

Install PHPMyAdmin

sudo apt update && sudo apt install phpmyadmin

For WordPress installation /

Enable mod_rewrite

sudo a2enmod rewrite

sudo systemctl restart apache2

By default, Apache prohibits using an .htacess file to apply rewrite rules.

sudo nano /etc/apache2/sites-available/000-default.conf

Add the following code between <VirtualHost *:80>

<Directory /var/www/html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>

sudo systemctl restart apache2

Create a .htaccess file in the web root folder

sudo nano /var/www/html/.htaccess

Add default WordPress .htaccess file contents:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Source: https://vitux.com/how-to-install-and-configure-apache-web-server-on-ubuntu/

Source: https://www.cloudbooklet.com/how-to-install-php-7-3-on-ubuntu-18-04/

Source: https://websiteforstudents.com/install-php-7-3-php-7-3-fpm-with-apache2-nginx-on-ubuntu-16-04-18-04-18-10/

Categories
Uncategorized

Setup Remote Desktop XRDP on Debian 9

Install XRDP

sudo apt install xrdp

Configuring the firewall

sudo ufw allow 3389

Modify the Xwrapper.config file when you get a blank screen when removing in.

sudo nano /etc/X11/Xwrapper.config

Change:

allowed_users = console

to

allowed_users = anybody

Restart XRDP.

sudo systemctl restart xrdp

Actually, reboot the entire server

When logging in and you receive the message: Authentication Required – Authentication is required to create a color managed device click cancel and it’s all working.

In case you get a blue screen after login I found the following code works to fix this when you use Gnome as your desktop

$echo gnome-session > ~/.xsession
$chmod +x ~/.xsession