Here is quick look at the steps that can be followed to resize an Image using gimp.
Resize could be either to reduce the height and width or the memory size of the image. For example if you need the a image to be of only 40KB, and the current size is 100KB then you can resize the image to a smaller height and width and reduce the memory size of the image .
Pages
▼
vmware vmplayer unable to install all modules ubuntu
While installing the vmplayer 16.1.2 in ubuntu 20.04 the installation failed with the error message
The logs indicated that the issue with the installation of the module vmmon. One of the workaround that worked was to download the source file from
After downloading, unzip the files and go to the folder vmmon-only/include . Open the file vm_asm_x86.h and comment out a part of the code a shown in the figure below.
Now rebuild the new modules and install using the follwing set of commands, running them inside the new folder that was downloaded from the above link.
Now launch the vmplayer, it should open with out any errors. Please note that the solution has been verified on the specific version mentioned so it might or might not work on all versions.
Linux bash script to find Average of prime numbers in range
This post in reponse to a comment on the post " Linux script to find prime numbers in a range of numbers "
The request was to find the average of all the prime numbers found in the given range.
Save the file say as average_prime_range.sh Execute it using bash.
Following is a sample output
Save the file say as average_prime_range.sh Execute it using bash.
Following is a sample output
Sending mails from the command line to multiple receipents using gnome-gmail.
Here is a script which can be used to send a common mail to all number of receipients, with all the recepient mail ids stored in a text file.
The script uses the tool gnome-gmail, which can be installed from your package repository, In debian based systems it can be installed using
Create a file called mialIds which will have a a list of mail ids to which mails need to be sent. For example
Create a file with the following script and name it as mailscript.sh
The input variable in the script should point to the file containing the mail ids.. If the script and the file containing mail ids are in the same folder, then just the name is enough.
The variable subj is used to store the content to be filled in the subject line of the mail. The variable bod will contain the text for the body of the email.
Execute the script
If you execute it the first time, gnome-gmail will prompt you to enter the gmail id that needs to be use dfor sending the email. If the gmail is in the logged in state in the browser, it will be able to send the mail automatically, else it might open the login prompt for you to login into the gmail account. Gnome-gmail Its a great way to automate sending default emails.
The script uses the tool gnome-gmail, which can be installed from your package repository, In debian based systems it can be installed using
Create a file called mialIds which will have a a list of mail ids to which mails need to be sent. For example
Create a file with the following script and name it as mailscript.sh
The input variable in the script should point to the file containing the mail ids.. If the script and the file containing mail ids are in the same folder, then just the name is enough.
The variable subj is used to store the content to be filled in the subject line of the mail. The variable bod will contain the text for the body of the email.
Execute the script
If you execute it the first time, gnome-gmail will prompt you to enter the gmail id that needs to be use dfor sending the email. If the gmail is in the logged in state in the browser, it will be able to send the mail automatically, else it might open the login prompt for you to login into the gmail account. Gnome-gmail Its a great way to automate sending default emails.
[: -eq: unary operator expected
The above error might come when we are using conditional operators to compare two values in a bash script. For example , conisder the following script to compare a user input number with a constant.
The above script when executed will throw the error as listed before. The error in the program is use of $ while taking the input, that is the right way of using the read command is "read
The second possible reason for the error could be not passing two values to compare for the operataor , for example the script below will also throw the same error as the operator "eq" has been given only a single operand.
In the above example, we have missed passing the constant after the comparision opertaor.
Looking in the above two possibilities should fix the error.
Guess the number game in shell script
Execute the following script to play "Guess the number" Game on the linux terminal. The computer picks a random number between 0 and 10 and the user has to guess the same, with in 3 attempts.
Save the file as "guessTheNumber.sh" and execute the script from the terminal.
Save the file as "guessTheNumber.sh" and execute the script from the terminal.