Skip to content

Recent Articles

24
Apr

Fixing: apt-get install mc is not available error on Ubuntu

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).

24
Apr

Install VirtualBox Guest Aditions on CentOS 7 Linux Guest

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
24
Apr

Install Mate Desktop on CentOS Linux 7

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
24
Apr

Find out the ip of your network card in CentOS 7

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.

24
Apr

Mount a CD in CentOS 7 Linux

To mount a CD in CentOS 7 Linux run mount:

mount /dev/cdrom /mnt
24
Apr

ifconfig: command not found in CentOS 7 Linux

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.

12
Apr

Circle crop image with PHP imagick

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();
19
Mar

Compile latest version of ImageMagick and PHP imagick on Ubuntu 14.04

Packages required to be able to compile

sudo apt-get install build-essential automake pkg-config checkinstall php5-dev

Delegates dependencies

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

1
2
3
sudo chown $USER /usr/local/src
ln -s -T /usr/local/src sources
cd sources

Compile the latest version of ImageMagick

Read more »

19
Jan

Error: username is not in the sudoers file. This incident will be reported.

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:

visudo

and add the following line:

username ALL=(ALL) ALL

where username is your username you want to allow to run sudo.

19
Jan

Remount a root filesystem with read write options in Ubuntu Linux

Let’s say you’ve entered in Recovery mode and you want to make changes to your config files (for example you want to add a new user or you want to change network config) but your root partition is mounted read only. To mount it read write run:

mount -o remount,rw /