If you want to install VirtualBox Guest Additions on Ubuntu Linux Guest here what you need to do.
First go to VirtualBox -> Devices and click on Insert Guest Additions CD Image.
From the terminal look where the image is mounted. Usually it is under:
where username is your username used to login to your machine.
Then we need to install some packages:
sudo apt-get update sudo apt-get install build-essential linux-headers-$(uname -r)
Then we run the script from the CD image:
cd /mnt/username/VBOXADDITIONS_5.0.18_10667 sudo ./VBoxLinuxAdditions.run
You need to run this script after every kernel update.
So you’ve just installed Ubuntu 16.04, you’ve configured networking and it works properly but when you want to install Midnight Commander (or other package) you get an error:
apt-get install mc is not available
To fix the problem run first apt-get update command:
sudo apt-get update
Then try to install mc:
sudo apt-get install mc
Of course there could be other reasons (like your /etc/apt/sources.list file missing or containing wrong links to package repos) but on a default Ubuntu installation this could fix the problem).
If you want to be able to move your mouse cursor outside the VirtualBox CentOS Guest window without pressing a key and also automatically scale CentOS Guest window you need to install VirtualBox Guest Aditions on your CentOS Guest.
In order to do that run:
yum install dkms yum install kernel-devel
Then add the cd from VirtualBox (Devices -> Insert Guest Aditions CD image). If you are using a window manager (like for example Mate) the iso will be mounted in /run/media where we can find the install script:
cd /run/media/root/VBOXADDITIONS_5.0.18_106667/ ./VBoxLinuxAdditions.run
Let’s say we’ve installed a minimal version of CentOS Linux 7 from minimal cd iso and now we want to install Mate desktop. In order to do that we will need to install the epel repository, then to install Xorg server and then to add Mate from epel.
First we want to update our system to make sure we have latest version:
yum check-update yum update
Then let’s proceed with installation:
yum groups mark convert yum install epel-release yum groups install "X Window System" yum groups install "Mate Desktop" yum install dkms
Then we want to enable graphical desktop at boot:
systemctl set-default graphical.target
If you want to see the IP of your network card use the ip command:
ip addr show
If you’ve installed CentOS from minmal cd image then the ifconfig command is not installed. If you really want the ifconfig command you need to install net-tools:
yum install net-tools
This is working, of course, if your network is properly configured. And don’t think to add net-tools package from CentOS 7 minimal install since it is not there.
Some will say that ifconfig, netstat, arp and route commands have been deprecated for some years now and have been removed from the default CentOS 7 install.
To mount a CD in CentOS 7 Linux run mount:
mount /dev/cdrom /mnt
If you try to run ifconfig command on CentOS Linux 7 and you find out you do not have ifconfig installed then to be able to run it you must install net-tools package:
yum install net-tools
This will work of course if you have the networking configured. Or you can install it from CD media.
To create a circular crop with ImageMagick PHP library we will draw a black circle that will be used as a mask for the original image.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
// original image $image = new Imagick('path_to_image'); // get width an height of the image extract($image->getImageGeometry()); // create circle mask $circle = new Imagick(); $circle->newImage($width, $height, '#fff'); $circle->setImageFormat('png'); $circle->setImageMatte(true); $draw = new ImagickDraw(); $draw->setFillColor('#000'); $draw->circle(round($width / 2), round($height / 2), round($width / 2), $width); $circle->drawImage($draw); // apply mask $image->compositeImage($circle, Imagick::COMPOSITE_SCREEN, 0, 0); // save image $image->writeImage('circle_image_path'); $image->destroy();
Packages required to be able to compile
sudo apt-get install build-essential automake pkg-config checkinstall php5-dev
sudo apt-get install ghostscript libgs-dev libautotrace-dev libpcre3-dev libbz2-dev libdjvulibre-dev libfftw3-dev libgraphviz-dev liblcms2-dev liblqr-1-0-dev libpango1.0-dev libwebp-dev
Directory to use for the sources
sudo chown $USER /usr/local/src ln -s -T /usr/local/src sources cd sources
Compile the latest version of ImageMagick
If you try to use sudo to run commands with root privileges in Ubuntu Linux and you get the following error message:
username is not in the sudoers file. This incident will be reported.
then you must boot in Recovery mode and either add the username to admin group (which is allowed to use sudo) or edit the config file by running:
and add the following line:
username ALL=(ALL) ALL
where username is your username you want to allow to run sudo.