Tag Archives: Ubuntu

Hot to install GPaste on Ubuntu 23.10

GPaste is an open-source clipboard management tool for Linux-based operating systems. Clipboard managers like GPaste allow users to manage and access a history of items they have copied to the clipboard, enabling them to easily paste previously copied content.

Sadly, there are binary packages available but you can compile it and install it manually.

Continue reading

This machine ID is already enabled with a different key or is non-unique

I have purchased new VPS and I wanted to enable Ubuntu live patch service for it. Unfortunately, the command canonical-livepatch enable [TOKEN] failed with this ugly error message:

This machine ID is already enabled with a different key or is non-unique.
Either “sudo canonical-livepatch disable” on the other machine, or regenerate a
unique /etc/machine-id on this machine with
“sudo rm /etc/machine-id /var/lib/dbus/machine-id && sudo systemd-machine-id-setup” :
{“error”: “Conflicting machine-id”}

I thought to myself “Ok, let’s try the suggested solution”. What I did was to backup the file /etc/machine-id, than delete it and run suggested systemd command. I was surprised to see the newly generated UUID was the same! Consulting with man page of systemd-machine-id-setup command revealed that “If run inside a KVM virtual machine and a UUID is configured (via the -uuid option), this UUID is used to initialize the machine ID. The caller must ensure that the UUID passed is sufficiently unique and is different for every booted instance of the VM.”. Obviously, my new VPS provider did not ensure that and somebody else has the same machine ID on his/her VPS and enabled Ubuntu live patch for it.

Continue reading

Control screen backlight brightness from the command line

I have a Dell Latitude E5430 running Linux Mint 19 Tara. In Cinnamon, my function keys for brightness work correctly, but that was not the case with i3wm session. My first bet was to bind shortcuts executing xbacklight command but it doesn’t work because of this bug. So, I started to research for workaround and I found brightlight – “a program that can get and
set the screen backlight brightness on Linux systems using the kernel sysfs
interface.”. Sounds perfect but there are no prebuild binaries so you need to do it by yourself. The following steps are short guide how to build and install brightlight on Ubuntu and Ubuntu derivatives.

Continue reading

How to install PHP Data Structures (DS) extension on Ubuntu 16.04

First, you will need to install PEAR via apt-get to get the necessary package and distribution system that both PEAR and PECL use. From a shell prompt enter:

sudo apt-get install php-pear

You will be prompted to confirm the install. Just press “y” and enter. If all goes well you should see it download and install the php-pear package.

Now you will need to install the php-dev package to get the necessary PHP7 source files to compile additional modules. Enter the following from a shell prompt:

sudo apt-get install php-dev

If you do not install the php-dev package and try to install a PECL extension using “pear install”, you will get the following error:

sh: phpize: not found
ERROR: `phpize’ failed

The PECL_HTTP extension requires an additional dependency package to be installed. You can probably skip this for other extensions:

sudo apt-get install libcurl4-openssl-dev

Now we are finally ready to actually install the extension. From a shell prompt enter following:

sudo pecl install ds

The installer may ask you about some specific options for the extension you are installing.  Just accept the defaults and go ahead.

Once the install is complete, it’s time to enable the extension.
First, edit the following file (create it if it does not exist already):

sudo vi /etc/php/7.0/mods-available/ds.ini

and change it’s contents to:


; configuration for php ds module
; priority=30
extension=ds.so


Than check and remove any symbolic links to 20-ds.ini file, such as:

sudo rm /etc/php/7.0/fpm/conf.d/20-ds.ini
sudo rm /etc/php7.0/apache2/conf.d/20-ds.ini
sudo rm /etc/php7.0/cli/conf.d/20-ds.ini

You need to remove above listed symlinks because of bug: there is hard dependency on the json extension. DS extension shouldn’t try to implement JsonSerializable if the json extension is not loaded, but actually do it and it will complain with exception if it is not found:


PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/ds.so'
 - /usr/lib/php/20151012/ds.so: undefined symbol: php_json_serializable_ce in Unknown on line 0

That’s why we removed 20-ds.ini symlinks and specified ds.so to load after json is already enabled.

Now, disable and then re-enable the extension:

sudo phpdismod ds
sudo phpenmod ds

You may need to restart your HTTP server:

# If you are on apache
sudo service apache2 restart
# if you are on nginx
sudo service nginx restart

VLC does not support the audio or video format “hevc”. Unfortunately there is no way for you to fix this.

Just you have chosen a good mоvie to watch, you are seated comfortably in an armchair with pack of popcorn, clicked on your favorite media player VideoLAN and… bang! Error!

VLC does not support the audio or video format “hevc”. Unfortunately there is no way for you to fix this.

The error message above is not really correct. There is a way to fix it!

 

Enabling SSH Upgrade Access on WordPress on Ubuntu Server

As you may be already know, WordPress allows you to install and update plugins,  widgets, themes etc, as well as whole system trough the admin panel. It’s very convenient time-saving feature but it requires you to provide FTP or FTPS credentials every time when its used. It could be really frustrating!

SFTP (SSH over FTP) should not be confused with FTPS (File Transfer Protocol Over SSL). FTP is vulnerable to attacks and should be avoided because the server can only handle usernames and passwords in plain text. So, as many people, I don’t have it installed on my virtual private server. If you feel that you need to install and enable a FTP server, just for WordPress, think twice – you can use SSH instead and I’ll show you how! Continue reading

How to Undo Changes in “nano” Text Editor in Ubuntu

Nano has experimental undo/redo feature. As you’ll see from the nano manual (type “man nano” in a Terminal to read that), you’ll need to start nano with the -u option

 $ nano -u somefile.txt

… and then you can use Alt-U to undo and Alt-E to redo.

It’s little bit frustrating that you have to type the “-u” option every time when you want to edit a file, but hopefully there is a solution and its name is “alias”.

Aliases are a way for you to customize the commands by giving them aliases (nicknames). You can use them to remember commands with a lot of options or make their names shorter and easier to type. To setup aliases, all you need is to open the ~/.bash_aliases file and type in:

alias nano='nano -u'

If you want to add more aliases, enter each of them on separate line.

Now, typing “nano” is equal as typing “nano -u”. Tricky, yeah?

 

How to setup the perfect LAMP stack on Ubuntu 14.04 LTS

Ok, ladies and gentlemen!

I needed local development server closer as possible to the production one. I downloaded and Installed Ubuntu, but didn’t know how to get Apache, MySQL and PHP installed. After a few hours of reading random blogs found on Google and head banging I succeed.

My requirements was:

  1. Set up multiple subdomains automatically (i.e. Virtual Document Root)
  2. Password protect all my subdomains when they are accessed outside my home network but access them directly, without need to provide password, when I am connected to my local network and develop.
  3. To separate the error logs by virtual host (subdomain).

Below is a laundry list of commands to help you configure your own perfect Ubuntu server, too.

Continue reading

How to resolve the “CIFS VFS: Server not responding” error on shutdown

On my laptop I wanted to mount some shared directories (via samba), located on my office network and accessible trough OpenVPN. I need them to work remotely  (there is in my office local development server, used from all my colleagues). Connecting to the VPN and mounting the shares was straightforward. I just have had to install smbfs (Samba file system utilities) and put the following line in my /etc/fstab:

//192.168.91.1/deals  /mnt/deals-old  cifs  credentials=/etc/samba/deals-user,noexec,noperm  0 0

Continue reading