VirtualBox Guest Additions not working in Lubuntu 17.04 – Solved

Environnement:

Host OS: Windows 10 x64
VirtualBox Graphical User Interface
Version 5.1.26 r117224 (Qt5.6.2)

Guest OS: Lubuntu 17.04

VBOXADDITIONS_5.1.26_117224

Problem:

I manually installed VirtualBox Guest Additions from VBOXADDITIONS_5.1.26_117224 ISO and restarted the guest.

The bidirectional clipboard and the drag and drop still not working.

Solution:

Installation of Guest Additions from Ubuntu repository.

Command:

sudo apt-get install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11

Because I didn’t uninstall the ISO version, the setup process it asked me if I want to use the maintainer version or the latest version. Personally I chosed Y for the maintainer version. Here is a sample:

Setting up virtualbox-guest-x11 (5.1.22-dfsg-0ubuntu1.17.04.1) …

Configuration file ‘/etc/X11/Xsession.d/98vboxadd-xclient’
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer’s version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation

It works! The above text was copied from clipboard directly from Guest OS Lubuntu 17.04 in Windows 10 host OS.

cPanel not starting with Internal Server Error – fix

The problem:

All websites are down with Internal Server Error 500

Symptoms:

Cpanel wasn’t loading with the following error:

Internal Server Error

500

Can’t fork: Cannot allocate memory at /usr/local/cpanel/Cpanel/SafeRun/InOut.pm line 40.
cpsrvd/11.62.0.15 Server at hostname.example.com

How I fixed it?

First of all I was trying to increase this limit by searching for “Max cPanel process memory” in:
“WHM Home » Server Configuration » Tweak Settings”

It was already over 512MB, the default value of 768MB. I increased to 1024MB. The Cpanel restart was unsuccessful.

As last resort I run the following commands:

/scripts/upcp –force

service cpanel restart

The first command will upgrade cPanel even if you got latest version of cPanel, in order to rule out any update inconsistencies.  Depending on the server configuration, this may run for about 10 minutes.

The second command will restart cPanel.

I hope that was helpful for you.

 

How to sync Microsoft Outlook with Google Calendar and other CalDav Calendars

For this purpose we need to use Outlook CalDav Synchronizer.

Here are the features and description from developer:

Free Outlook Plugin, which synchronizes events, tasks and contacts between Outlook and Google, SOGo, Horde or any other CalDAV or CardDAV server. Supported Outlook versions are 2016, 2013, 2010 and 2007.

Features:

  • free and open-source software (FOSS), the only free Outlook CalDav plugin (AGPL license)
  • tested CalDAV servers: SOGo, Google Calendar, Horde Kronolith, NextCloud, OwnCloud, SabreDAV, Synology NAS, GroupOffice, one.com , Yandex, OpenX-change, Posteo, Landmarks, Kolab, Zoho Calendar, GMX, Tine 2.0, Fruux, Mac OS X Server, iCloud, Mail.ru, Radicale, Cozy Cloud, Cyrus Imap 2.5
  • two-way-sync
  • modern WPF GUI
  • Supporting OAuth2 for Google
  • SSL/TLS support, support for self-signed certificates
  • Manual proxy configuration support for NTLM or basic auth proxies
  • Autodiscovery of calendars and adressbooks via well-known redirects or DNS SRV/TXT lookups
  • configurable sync range
  • sync multiple calendars per profile
  • sync reminders, categories, recurrences with exceptions, importance, transparency
  • sync organizer and attendees and own response status
  • task support
  • CardDAV support to sync contacts (distribution lists planned)
  • Google native Contacts API support with mapping of Google contact groups to Outlook categories.
  • Google Tasklists support (sync via Google Task Api with Outlook task folders)
  • sync contact pictures, categories, notes and x509 certificates
  • manual or time-triggered sync
  • change-triggered sync
  • sync triggered by Outlook Send/Receive
  • Category Filtering (sync CalDAV calendar to Outlook categories)
  • map CalDAV server colors to Outlook category colors
  • show reports of last sync runs and status
  • configurable system Tray Icon with notifications
  • bulk creation of multiple profiles
  • Use server settings from Outlook IMAP/POP3 account profile
  • Map Windows to standard IANA/Olson timezones
  • Configurable mapping of Outlook custom properties

The project page is here: https://sourceforge.net/projects/outlookcaldavsynchronizer/

Windows Server 2008 PDC external time

Internet time is hidden from control panel.
As a PDC, Windows Server 2008 need to be synchronized with external source.
You can select the closest NTP server from http://www.pool.ntp.org/en/

Microsoft recommends (quote from technet.microsoft.com):

  1. Click Start, and then click Command Prompt.
  2. In the Command Prompt window, type the following line, where peers is a comma-separated list of IP addresses of the appropriate time sources, and press ENTER:w32tm /config /manualpeerlist: peers /syncfromflags:MANUALThe time sources you choose depend on your time zone. For example, if your domain controller is located in the Pacific Time zone, this line might read:w32tm /config /manualpeerlist:131.107.1.10 /syncfromflags:MANUALIn this example, the IP address of the timeserver is used instead of the fully qualified domain name for security purposes.
  3. Press ENTER. You should get a message that the command completed successfully.
  4. Type w32tm /config /update
  5. Press ENTER. You should get a message that the command completed successfully.W32time uses a variable poll interval based on the quality of timesync with the server. On DCs, this interval defaults to between 64 and 1024 seconds.
  6. To immediately synchronize with the external time server, type w32tm /resync and press ENTER. You should get a message that the command completed successfully.
  1. Type Exit and press ENTER.

Example:
For Canada we can use
ca.pool.ntp.org wich has the ip 207.194.97.58 or
clyde.concordia.ca 132.205.1.1
bonnie.concordia.ca 132.205.7.81
tick.encs.concordia.ca 132.205.96.93
tock.encs.concordia.ca 132.205.96.94

w32tm /config /manualpeerlist:207.194.97.58 /syncfromflags:MANUAL
w32tm /config /syncfromflags:manual /manualpeerlist:”132.205.96.94,0×1 207.194.97.58,0×1 ” /update /reliable:yes

Blocking spambots with SCROLLOUT F1 and fail2ban

I asume that you have a fuly functional SCROLLOUT F1 instalation and you want to add spambot blocking feature.
Ad the following line to /etc/apt/sources list

deb http://ftp.debian.org/debian unstable main

Then run

apt-get update
apt-get -t unstable install fail2ban
cd /etc/fail2ban
cp jail.conf jail.local

Edit jail.local

[postfix]
enabled = true
port = smtp,ssmtp
filter = postfix
logpath = /var/log/mail.log
maxretry = 2
bantime = 7200

Edit /etc/fail2ban/filter.d/postfix.conf

failregex = reject: RCPT from (.*)\[\]: 450 4.7.1
reject: RCPT from (.*)\[\]: 554 5.7.1
reject: RCPT from (.*)\[\]: 550 5.1.1
reject: RCPT from (.*)\[\]:\d{5}: 550 5.5.1

Then run
service fail2ban restart
To check if it is working run:

fail2ban-client status postfix
iptables -L -n

You can play with following parameters:
maxretry, bantime, findtime
Do not forget:

  • always edit jail.local instead of jail.conf (this way you don not risk to stay outside if software is updated
  • put your trusted IP addresses in ignoreip

How to recover ext4 from GPT partitioned disk

Hard drive sizes had increased dramatically in last several years, but block device drivers are still outdated. For hard drives more than 1TB currently seems to be an advantage to use GPT instead of legacy MBR partition table. You can see more details at http://en.wikipedia.org/wiki/GUID_Partition_Table .

One of the inevitable disadvantage of GPT is the possibility of corruption by using outdated partition editor like cfdisk, or other disk tools, even without any intention to modify the partition.

It happened recently on one 1.5TB WD Caviar Green with GPT and one ext4 partition full of data.

I tried to repair the superblock using tools like:

  • For partition listing:

fdisk -l

  • To check the filesystem:

fsck.ext4 -v /dev/xxx

  • To list where the superblock backups are stored:

mke2fs -n /dev/xxx

  • To restore superblock from backup:

e2fsck -b block_number /dev/xxx

My story was completly different. It does not work this time. Could work fine if you have a traditional MBR partition table. In case of GPT, TestDisk was the magic software that saved my disk. Read documentation first, think carefully what do you want to do and you have a chance to recover 100% your disk. One note here. TestDisk has an “invasive mode” and a “recovery mode”. In recovery mode you can save a specific file or a disk image. This is not distructive. But you must have a spare disk to save the data. In my case I simply fixed the GPT table and I was lucky. That is why I recommend you to fully read the documentation from TestDisk.

http://www.cgsecurity.org/wiki/TestDisk

 

Clear DNS cache windows

Operating systems affected: MicrosoftTM Windows XP, Windows Vista, Windows 7

To clear dns cache:
ipconfig /flushdns

To restart dnscache service:
net stop dnscache
net start dnscache

You can also do this visually from MMC. Just type services.msc in run/search and use appropriate command in order to restart dnscache service.

Benefits: could solve web browsing problems if internet connection is ok with many websites but not with all.
Also it is good to see if you recently moved your hosting and you have changed the name-servers.
This apply just for desktop computer you use to browse when everybody see a website but not you. For DNS servers, it is another story.

Also it is possible to clean DNS cache per browser like Firefox, etc. like you can see on other articles on this website.