Getting an MYSQLDump error

I upgrade MySQL DB from 5.6 to 5.7 version not too long now with no issues happened after. But at that time I did not use mysqldump command. Now I tried to backup the database and gettting this error message:

mysqldump: Error: ‘Access denied; you need (at least one of) the PROCESS privilege(s) for this operation’ when trying to dump tablespaces

How to fix this error.

ANSWER

The PROCESS privilege requirement was added only in MySQL version 5.7.31. This is an expected behavior and affects mysqldump utility. There is a report here and some discussions –

https://bugs.mysql.com/bug.php?id=100219

If your user has no admin privilege to the MySQL database, the quick workaround is to add the –no-tablespaces option. The usage like below.

mysqldump --no-tablespaces -u user -p DB_NAME > BACKUP_FILE.sql

On the other hand, if you have admin access, then grant that user the PROCESS privilege like this:

GRANT PROCESS ON *.* TO user@localhost;

Be warned that such privilege is usually reserved for server administrator users. It works on a global context, so it cannot be specified on a per database approach. Granting just any user this PROCESS privilege is not a good idea. It may cause “data leaks” when sensitive queries gets exposed because this privilege can allow a user to see queries being executed in active sessions. This becomes more critical when the server instance is shared.

How to fix error: snap “telegram-desktop” has “install-snap” change in progress

I enconter this error message when installing a Snap app Telegram for Desktop from the terminal command line. I followed instructions on how to do this from the Install button of the snapcraft.io website.

First one I select is use the GUI app store. But nothing happens when click install button. Installing progress starts but go back to install. Click again and same thing is happens.

When using the command line that is I got the error of:

error: snap "telegram-desktop" has "install-snap" change in progress

How to fix?

ANSWER

The error is because you are telling Snap to install an app that has already been scheduled for installation. It’s in the queue. The GUI app store is not very informative about this scenario. Hence, it will seem like the installation process failed when in fact that is not the case.

My guess is it is put on schedule for installation because a higher priority install needs to be done first, most likely Snap core updates that have not yet been applied to the system yet.

Either wait for the core updates to finish and wait for Telegram to get installed after, or force it to update right away.

At the command line, do:

:~$ snap changes

It will show something such as:

ID Status Spawn Ready Summary
101 Done yesterday at 20:33 PST yesterday at 20:34 PST Auto-refresh snap "intellij-idea-community"
102 Doing today at 11:36 PST - Install "slack" snap

Abort the scheduled install for the app listed there, in your case “telegram-desktop” snap using the following command:

:~$ sudo snap abort 102

In the example above, I chose to abort install scheduled with ID 102. Choose the ID of the app you are trying to install that you will see on your terminal after the command above.

Then install the snap app manually:

:~$ sudo snap install telegram-desktop

This should force snap to go ahead with the install, but first it may start with its core updates, followed by the telegram-desktop snap app.

Change default app to open torrent magnet link

I installed a Popcorn-time desktop software on my Ubuntu linux to try that out. It appears to use a torrent technology to stream content as it downloads at the same time. Somehow that now gets the default to open magnet links for torrent files. Have not remembered any setting asking me to make the app open by default during installation or at download.

I don’t want this, don’t know how to change to my default torrent software – Transmission BitTorrent.

How to change back?

ANSWER

Add/edit it into the following files. Either or both is fine, but better to have it in for the system-wide list if you have multiple users.

  • System-wide: /usr/share/applications/defaults.list
  • User-specific: ~/.local/share/applications/mimeapps.list

The value of this entry – x-scheme-handler/magnet – needs to be set to the application you prefer.

For example, since you want it to be Transmission it will be similar as shown below:


x-scheme-handler/magnet=transmission-gtk.desktop

Just make sure the .desktop file for the desired application is correct. Again you can check for that file in the same directory where this list is found.

As an alternative, the following terminal commands will also help.

Find out what is the existing default app that will handle such mime-type for your existing user:

:~$ xdg-mime query default x-scheme-handler/magnet

Replace that by using the next command:

:-$ xdg-mime default transmission-gtk.desktop x-scheme-handler/magnet

Lastly, you can check again if the last command was successful by running the first one.

Support for Ubuntu Unity Desktop after 16.04 LTS

Can still use the Unity Desktop after Ubuntu 16.04 Xenial Xerus? Is it still supported?

I like the Unity desktop way of things. Been using it many years now. Read about and tried the new Ubuntu that with Gnome Shell, but I don’t like it much at all. It look clunky with many of missing things from it.

Come April 2021 Ubuntu 16.04 will EOL. Starting to find alternatives, but if Unity is still out there, I’d pick it over the others.

ANSWER

In one word, Yes.

Still can run on both LTS versions of 18.04 and 20.04. Go ahead and install it with:

sudo apt install ubuntu-unity-desktop

Choose Lightdm display manager when asked during install. Best to restart your computer afterwards. Then enjoy.

Consider that many people have said some weird looks of Unity when installed on said LTS versions appear. I forget, but I think its the window decorations and such. This is supposedly caused by the newer Gnome versions, and unpatched by Ubuntu. Unlike before.

You may also like to try out an alternative in the Ubuntu Unity Desktop spinoff. Can be found at this website – https://ubuntuunity.org/

It is not official Ubuntu flavor, but being maintained by some other 3rd party group. The experience is different from just installing 20.04 and then install Unity DE afterwards. Try it out if it suits you.

Convert a Map to POJO in Java

How do I convert a Map object to my other plain old Java object (POJO) without going into loops and having to write a class using Java reflection, or some other?

ANSWER

Well, yes, reflection is one but you didn’t want to do that yourself. For some good reason, I bet. It’s a good exercise if you have all the time in the world. But when faced with deadlines and having to write Unit tests for a whole class you wrote, there must be an easier way.

There is more than one way, but what I normally use is the Jackson ObjectMapper. Yes, the same one from the com.fasterxml.jackson library.

Anyway, with ObjectMapper it is pretty straightforward to do so. If I have a Person class like this:

    public class Person {
        private String firstName;
        private String lastName;
    }

My Map object will look like this:

        Map<String, Object> map = new HashMap<>();
        map.put("firstName", "Johnny");
        map.put("lastName", "Foo");

Then with ObjectMapper one can simply do this:

        ObjectMapper mapper = new ObjectMapper();
        Person person = mapper.convertValue(map, Person.class);

Alternatively, the keys in the Map may not align with the fields in the Person class. Well, I usually encounter this when working with JSON objects with lots of crazy looking field names. Something like this – NZT_Mor_First_Name__c – which I clearly don’t want my class field name to be like.

Well, we can use @JsonProperty annotation which is part of Jackson by the way and assign that our class field. The Person class will now look like:

    public class Person {

        @JsonProperty("NZT_Mor_First_Name__c")
        private String firstName;

        @JsonProperty("NZT_Mor_Last_Name__c")
        private String lastName;
    }

Again the Map will hold these values:

        Map<String, Object> map = new HashMap<>();
        map.put("NZT_Mor_First_Name__c", "Jose");
        map.put("NZT_Mor_Last_Name__c", "Yamut");

Now it will map out those weird looking key names to its corresponding class fields.

One thing to note is you might need to set ObjectMapper features such as ignoring unknown properties and make it case insensitive. Allow it a bit more room to wiggle, wiggle.

        ObjectMapper mapper = new ObjectMapper()
                .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
                .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_VALUES);

Re-publish Kafka record not setting partition number?

Well, I plan to re-publish Kafka records that my app is consuming to another Kafka topic on another host (internal only). This sort of lets other groups consume data from this topic without having to create connections outside of the private network, since the original data source is a 3rd party vendor. They can then also do their own transformations or other business logic on it as if they were consuming from the original source. Delay from source to re-publish should be minimal. Will still be close to real time.

What I normally do when producing records is not to set a partition by default. Would this be okay when re-publishing records? Will there be conflict with original record partition number to the target topic partition?

ANSWER

How many partitions does your target topic have? Do you have freedom to create as many partitions as the source?

(1) If you can create 1:1 partitions then my suggestion is to retain the original partition number of that record when you publish to the destination topic.

(2) You can also assign the partition in a round-robin way when you have lesser partitions on your target topic. Save metadata info of that record in the headers, such as original partition assignment and etc. Perhaps that will be useful down the line for your consumers.

(3) Lastly, you can NOT assign a partition number. Instead, let Kafka do the magic for you. When no partitions are set, Kafka will determine the next partition in a round robin method. You can do this with a null value instead of an int for partition number.

Bottom line is that it depends on the project requirements, I suppose, or more so on the infrastructure of your destination Kafka.

cant restore nuget packege on ubuntu after upgrae to .net core 3.1

i am running .net core 2.1 on Ubuntu 18.04 so far so good

i upgrade my project to .net core 3.1 and installed the 3.1 SDK

since than i cant use ‘dotnet restore’

this is the full output

/usr/share/dotnet/sdk/3.1.401/NuGet.targets(128,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/repos/myproj/portal/PortalApi/PortalApi.csproj]
/usr/share/dotnet/sdk/3.1.401/NuGet.targets(128,5): error :   The SSL connection could not be established, see inner exception. [/repos/myproj/portal/PortalApi/PortalApi.csproj]
/usr/share/dotnet/sdk/3.1.401/NuGet.targets(128,5): error :   The remote certificate is invalid according to the validation procedure. [/repos/myproj/portal/PortalApi/PortalApi.csproj]

any idea why ?

thanks

Go to Source
Author: David Munsa

Combining Two Containers

I’m working on a Windows laptop and running Docker for Windows on it. I want to run an Ubuntu container with a specific version and a MySQL server on it. So the question is, do I have to download MySQL on the Ubuntu container or can I run 2 containers (Ubuntu and MySQL) and combine them? How do I combine these 2 containers?

Go to Source
Author: user19215

How to show Snap app icon properly on Ubuntu Unity desktop

Had this issue where after I logged into my Ubuntu desktop all Snap apps icons do not show properly. Instead I see a plain icon in place of what the app icon should be. Have you the same experience?

This might have been fixed in later Ubuntu LTS releases, I really don’t know. But I am still on 16.04 Xenial Xerus until its EOL. Also, the reason is that I love the Unity Desktop. The Gnome Shell replacement just doesn’t cut it for me.

I have been looking for a solution on this issue for some time. The 2 main things people point out are:

– Add /snap/bin to the /etc/environment file, and;

– Something to do with the profile.

Neither of those solutions worked for me. But it did work for others according to what I have read so far.

ANSWER

To fix this icon issue, create a symlink of the Snap’s .desktop shortcut file to your user’s .local/share/applications directory.

It is as simple as that. Once done the problem will go away, and you will be left with a nice-looking icon that came with the Snap installation. This won’t go away on following restarts.

For more details on how to do this fix exactly, refer to this article – https://www.joseyamut.xyz/2020/08/13/getting-that-ubuntu-snap-icon-right-on-unity-shell/

How to stop truncate command safely

I am trying to empty my syslog.1 file which was flooded with some messages and has the size of 77 GB. I did

sudo truncate -s 0 /var/log/syslog.1

but the command is taking more than 2 hours to return. Is it safe to stop it by Ctrl-C or by the kill command? I am afraid that these methods may cause inconsistency in the file system. Is there a better way?

The system is Ubuntu 16.04. The root partition where /var/log/syslog.1 sits is almost full due to the sudden increase in size of this file as well as /var/log/syslog and /var/log/kern.log. The latter files are still continuing to grow, but the command line is still responsive.

Go to Source
Author: norio

Video4linux: /dev/video0 open failed

I am new to linux and am trying to run the ARToolKit simpleTest program. I am using Ubuntu 14.04.
I try doing ./Configure selecting the video4linux option. When I finally run the ./simpleTest command, it gives me this output:

Using supplied video config string [-dev=dev/video0 ].
video device (dev/video0) open failed

I have already modified the simpleTest.c file as such

#ifdef _WIN32
char            *vconf = "Data\WDM_camera_flipV.xml";
#else
char            *vconf = "-dev=dev/video0 ";
#endif

Please help me understand the problem! My objective is to use the inbuilt webcam of the laptop. Would appreciate any suggestions

Go to Source
Author: pranp2001

Copy and paste a folder

I am trying to make a copy of an OpenFoam tutorial folder to my desktop through Ubuntu since I don’t want to mess up the original files. I use the command line:
cp -r $FOAM_TUTORIAL /mnt/c/Users/username/Desktop

but this error pops up
cp: missing destination file operand after ‘/c/Users/username/Desktop’

Can I get any help with this?

Go to Source
Author: user421564

How to display Apache Tomcat metrics on Ubuntu (Like cPanel’s metrics)

I need a way to display metrics like number of visitors, location of visitors and so on using Ubuntu and Apache Tomcat.
I would like it to work in a cPanel or Webmin fashion where the data is displayed on a webpage and I can access it from another machine (something lightweight too, because my server is a weak machine).

I am using Apache Tomcat v9.0.36 and Ubuntu 18.04.4 LTS.

Thanks

Go to Source
Author: Ivan Dimitrov