how to make sure env variable will not be displayed when ran a script in debug mode

You need to check and remember the current debug setting, i.e. whether
the option -x is in effect when the script is run. Then you need to
surround each statement that you don't want to get printed with set +x
to turn the option off and set -x to turn it back on when it was
initially set. The variable $- contains the options that are in effect
when the script runs.

#!/usr/bin/env bash

export DB_DD=yesh
export DB_USER=user

# check and remember current setting of "-x":
if echo $- | grep -q x; then
    is_debug=1
else
    is_debug=0
fi

[ $is_debug -eq 1 ] && set +x   # temporarily disable "-x"
export DB_PWD=hello             # won't be printed
[ $is_debug -eq 1 ] && set -x   # again enable "-x"

echo 'sqlplus '\''user/hello@yesh'\'''
exit 0;

Output of sh -x tsts:

+ export DB_DD=yesh
+ export DB_USER=user
+ echo x
+ grep -q x
+ is_debug=1
+ [ 1 -eq 1 ]
+ set +x
+ echo sqlplus 'user/hello@yesh'
sqlplus 'user/hello@yesh'
+ exit 0

But keep in mind that this is pointless because everyone who can
run your script can also look into it and see the password there.


How to print to directly to a wireless printer

The answer depends on the protocols supported by the Wireless printer.
Usually, the procedure is exactly the same as written in the link you posted. So, simply find out the IP address and enter it in the "Host" text field under "discover network printer". If this doesn't work, then you have to enter the URL of the print server.

Nearly all network capable printers understand either the lpd/lpr or the ipp protocol, many can handle both.

Consult the printers manual to find out the ipp or lpr URL to use and and enter it in the corresponding text field in the "new printer" dialogue. Often it's either lpd://IP-ADDRESS/lpr or ipp://IP-ADDRESS/ipp.


How do i set CTRL not to show where the pointer is?

In Ubuntu 13.10 I found it only in the packet

sudo apt-get install gnome-tweak-tool

(german in "Optimierungs-Werkzeug") and there in the Setting for the mouse:

And here is the old german screenshot (Hebt die aktuelle Position des Zeigers hervor, wenn die Strg-Taste gedrückt und wieder losgelassen wird.)


The swap partition is a waste of disk space. New installations of Ubuntu 17.04 and later use a swap file on the / partition by default instead of a swap partition. Among other things this saves valuable disk space on SSDs. Another way of restating the same thing is that you only need one ext4 partition to fresh install Ubuntu 17.04 and later.

sda1 is your Windows partition. Don't format this partition as ext4 or else it will overwrite Windows 7. Instead leave the Windows 7 partition as NTFS and use the ext4 partition at /dev/sda3 for Ubuntu.

If you already overwrote the Windows partition, you should not install Ubuntu first, instead you should try to recover Windows 7 from an Ubuntu USB live session by following the instructions at How do I recover my accidentally lost Windows partitions after installing Ubuntu?. There's a good chance that you haven't overwritten any data, only the sda partition table.


I am using Ubuntu 13.10 and i can not access some website. my internet is wired (DSL)

ixwebhosting.com returned the same IP.
dailystar.net for me was 149.126.77.234, which differs from yours.
You could be sensored to certain websites by your ISP, or by your country.
Try accessing the above sites through one of the web proxy sites below.
webproxy.net
hidemyass.com
If you can get to the websites that way, you can google for a good proxy server. Then go to network settings in your ubuntu and manually add the proxy IP and Port.
With this setting, all of your browsers will go through the proxy.
Otherwise, you can do what I do.  Just set the proxy in Firefox, then use Chromium for non proxy connection.
Useful link:

How to Configure Ubuntu desktop to use your proxy server


How to deactivate nvidia 9600M GT on a Macbookpro 5,1/5,2/5,3

To disable the Nvidia 9600M GT you have to add the following to the grub menu entry outb 750x0, ie:

menuentry 'Ubuntu, with Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux     --class gnu --class os {
    outb 0x750 0
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod gzio
    insmod part_gpt
    insmod ext2
    set root='(hd0,gpt5)'
    search --no-floppy --fs-uuid --set=root bc495raf-515r-4r2b-b3de-0ec679a7303a
    linux   /boot/vmlinuz-3.0.0-12-generic root=UUID=bc495raf-515r-4r2b-    b3de-0ec679a7303a ro hpet=force
    initrd  /boot/initrd.img-3.0.0-12-generic
}

Additionally for powerdown after resume after suspend:

On resume, the discrete graphics controller will be turned on and active. We need to turn it off and switch back to the integrated GPU.

This can be done with a very simple little program:

#include <stdio.h>
#include <sys/io.h>

#define PORT_SWITCH_DISPLAY 0x710
#define PORT_SWITCH_SELECT 0x728
#define PORT_SWITCH_DDC 0x740
#define PORT_DISCRETE_POWER 0x750

static int gmux_switch_to_igd()
{
outb(1, PORT_SWITCH_SELECT);
outb(2, PORT_SWITCH_DISPLAY);
outb(2, PORT_SWITCH_DDC);
return 0;
    }

    static void mbp_gpu_power(int state)
{
    outb(state, PORT_DISCRETE_POWER);
    }

int main(int argc, char **argv)
{
if (iopl(3) < 0) {
perror ("No IO permissions");
return 1;
}
mbp_gpu_power(0);
gmux_switch_to_igd();
return 0;
}

Save that in a file called igd.c. Compile it with gcc -O2 igd.c -o igd. This will create an executable called igd. Executed with superuser privileges, it will turn off the discrete controller and switch to the integrated controller.

Now we need to execute this on resume. Create a file called /etc/pm/sleep.d/10igd

It should contain:

#!/bin/sh
#
/path/to/igd

Where /path/to is the path to where you put the igd executable we created in the previous step.

chmod +x /etc/pm/sleep.d/10igd

This file will be executed on suspend and resume. Done right, that 10igd script would check to see if this is a suspend/resume/freeze/thaw and only execute when needed. As-is, it executes on all of them. No big deal, it won't hurt to run it during freeze or suspend.

I got everything working on my mbp5,1: Sound, LCD Backlight, Keyboard backlight, Fans running low (since disabling 9600M GT),Apple like short cut (CMD+C to copy),Flash (almost stable)... So just ask if you need more help


Ubuntu Tweak - "enhance system security by disabling desktop lock"?

Checking the box for it does exactly what it says; it disables the lock screen.  I know a while back it was possible to restart the system from the lock screen, meaning if auto-login was enabled, it was possible to unlock the computer.  That has been fixed for some time though.


How do I run a windows program inside an iso file?

Here you have to use one software that provides you to run and extract and so many options (PowerIso). Or other wise you have to mount that file in to removable media and then you have to tap open with new window by right clicking the Disk drive (that you mounted) after that it will shows you all files held in that .ISO file. Simply go and use that ".exe and .bat" files.


12.10 blank purple screen on startup dell Dimension 3000

Have you tried this yet? I had the same issue with a Toshiba laptop recently and this helped me.


pentium t2390 dual core 3gb ram just installed 12.04, should I change to 14.04?

I agree if it's not broke don't fix it since that release has 5 years support. If there is a feature on 14.04 that is being eyeballed or just want most up to date then do the following command after making a backup if feels necessary even.

sudo update-manager -d


You need to make a new install with formatting all partitions except home partition.


How can I use face authentication to log in?

There is a program called pam-face-authentication, although it is not in the repositories, so you will have to install it by following the instructions - there is a ppa.

The documentation site doesn't seem to work but you can try looking in /usr/share/doc/pam-face-authentication to find documentation once you have installed.

You should note that the security of alternative authentication methods such as fingerprint readers and face recognition is questionable, i.e. not as good as a strong password.


Only Administrator user can execute some commands

In the POSIX systems, there are 3 modes of accessing a file: owner User, Group and Others with 3 types of permissions: Read/Write/eXecute. There is a bitmask for each file on system which contains those permissions. Read more…

The basic idea is to put Net User to others and deny others Read/Write/Execute the particular file. This is done by

sudo chmod 750 /path/to/file_or_directory

Initially, the others is the group where each new user appears. So if you want to deny them from accessing Bash, you have to write

sudo chmod 750 /bin/bash

This will set permissions to rwxr-x---. To allow access again, use

sudo chmod 755 /bin/bash


The tags will show up in Nautilus as little emblems that are displayed on top of the files' icons.
Write a file tag:
gvfs-set-attribute -t string 'PATH-TO-FILE.csv' metadata::annotation "This is a sample file annotation."

Read a file tag:
gvfs-info -a metadata::annotation 'PATH-TO-FILE.csv'

Example: For a file called FILE.csv that is located on your desktop 'PATH-TO-FILE.csv' would be '~/Desktop/FILE.csv'. The easy way to generate 'PATH-TO-FILE.csv' automatically, including the 2 apostrophe characters, is to simply drag the file's icon from the file manager into an open terminal.

Ubuntu 14.04 and later
Support for emblems in the default Ubuntu repositories is back in 14.04 and later. Open the terminal and type:
sudo apt install nautilus-emblems

To add an emblem to a file or folder right-click its icon, and from the popup context menu select Properties -> Emblems tab -> select an emblem to add. Navigate to a different directory and then back again to view the emblem that was changed.

(Click image to enlarge)


Why does Ubuntu not lock ATA-Password protected disc on reboot?

Your expectation is incorrect; it isn't the job of the OS to do this.  Instead the drive locks itself when you power off.

You may be able to manually unlock the drive in Ubuntu using the hdparm --security-unlock command, assuming the bios doesn't freeze the security settings, in which case it takes a power cycle to unfreeze it.


How to resolve Link Local hosts without typing .local

If you add something on /etc/resolvconf/resolve.conf.d/{head, base, tail} then the name resolution will be carried out by resolvconf, not by avahi-daemon hence just adding search local is not resolving the name.

To get the search domain working you need to set up a DNS server that will give response to your queries after the domain name being appended properly by your system.

Another option would be to add the entries in your /etc/hosts file like:

familyroom    192.168.1.4

Now if you ping familyroom you will get the response.

By far the laziest option would be to add an alias like this:

alias familyroom='ping familyroom.local'

in the ~/.bashrc file. Now source ~/.bashrc and you can just type familyroom to send the ICMP echo request to the device.


I think you are in wayland environment.In wayland, in case of non root login, access as root for any tool is prohibited. You should bind your self (localuser) with root previlage.To add localuser with root privilege:

xhost +si:localuser:root

https://www.youtube.com/watch?v=XVM090gB1wo

Once you have done, you can unassign the privilege by :

xhost -si:localuser:root

The given privilege will go away if you reboot your system.


How to remove latest kernel without removing linux itself

what are generic packages
Those generic packages are in fact meta-packages.  This is a mechanism to allow newer kernel packages to be downloaded and automatically loaded.
Hence - you should in-fact keep these.
suggestions
The better way is to pin the kernel you wish to boot from.  Once done, you can keep booting from the older kernel - but you will also be able to see when a newer kernel arrives.  Thus you can then test out the newer kernel to see if your issue has resolved.
Another alternative is to test out one of the latest hardware enablement kernels - you can see if the latest kernel + latest graphics also resolves your issues.  As a side effect you often see much faster graphics and better performance.
As always - anything that changes BOTH your kernel and graphics can lead to issues - so make sure you take an image backup first.
We already have great Q&A's on both how to pin your grub entry - as well as installing the hardware enablement stack.  Thus, I wont repeat here those answer but instead guide you to click the links and view the already excellent answers there.
At the time of writing this, the latest hardware enablement stack is saucy

Linked Questions:

How do I change the GRUB boot order?
How to Upgrade Ubuntu 12.04.2, 12.04.3 to 12.04.4, the next Hardware Enablement Stack?
How to make a disk image and restore from it later?


>> redirects the output of the command on its left hand side to the end of the file on the right-hand side.

So,

echo '* - nofile 65535' >> /etc/security/limits.conf

will append * - nofile 65535 to the end of the /etc/security/limits.conf file, instead of printing * - nofile 65535 on the screen.

If you instead had

echo '* - nofile 65535' > /etc/security/limits.conf

(note the >> replaced by >), everything already present in /etc/security/limits.conf would have been replaced by * - nofile 65535, and not appended.

You may also like to read this question:

Difference between "redirection" and "piping"


How do I tell if my brute force protection (fail2ban) is running?

I would use fail2ban's client for the check because it not only tells you if the server is running but also which jails are enabled which is equally important information because if a particular jail is not enabled, fail2ban does not monitor and perform bans on it.

To check the service:

$ sudo fail2ban-client status


My booting speed went from 8 seconds to 30 seconds

Things I've noticed from the boot chart:

The bottleneck seems to be disk utilisation. You may have a slow hard disk.

ureadahead is taking a long time to run while waiting for I/O.  This indicates hard disk speed is a factor.


Installing windowsxp alongside dual boot system already having ubuntu and windows 7

shrink your biggest partition so there is at least 8 GB space for windows XP. The insert the reinstall disc of winXP and when it asks you which partition select the empty one(better remeber how big it was.) it should install. Also do quick format as FAT32. This will actually make the ubuntu system not run fsck. it really should work. Then once XP is running, get a package of the net called grub4dos. This should update grub. And there u go! And no, partition there is no concern if it shows that for an extended partition.


external password protected hard drive not mounting

If you used the WD software to password-protect the harddisk, it is very unlikely that you would be able to use it under Linux. In addition, it sounds like you damaged the filesystem somehow, if you cannot even open it in Windows any more. If you need to encrypt the harddisk, I would suggest that you find a software to encrypt that supports both linux and windows.


Dual Windows 7/Ubuntu machine no longer sees Ubuntu partition after uninstalling Wubi

I finally ended up with a regular Ubuntu installation instead of Wubi.

The problem may have been somehow related to my CD/DVD drive. I made a bootable USB medium and everything worked perfectly. Now I only see GRUB (listing both Ubuntu and Windows 7) so this is more streamlined than the previous setup using the Windows boot leader followed by GRUB. Both OSs load properly and any Windows apps that use networked licensing systems still run.


Keyboard shortcut equivalent for OSX Super+Backtick

What you are looking for Alt+~ (~ is the same key as the backtick)


You can use Autokey. You can find it in the Ubuntu Software Centre.


Please obtain a temporary internet connection, open a terminal and do:

sudo apt-get update
sudo apt-get install bcmwl-kernel-source

Reboot and your wireless should be working.

NOTE: This technique is valid for Ubuntu 14.04 and later. If your version is different, I urge you to upgrade.

You can try to coax your ethernet to connect with:

sudo ethtool -s eth0 speed 100 duplex full autoneg off

Then see if Network Manager can connect and install the wireless package as above.


You could try installing Zenmap from the Ubuntu software centre. This tool allows you to scan your LAN (and therefore wifi) for other devices.

Zenmap would only be useful when you manually run it.  If you need a continuous background monitoring tool, I don't think it will help directly.  But the command-line nmap command could be scripted to keep an eye on your network periodically, and tell you if other IP addresses appear.


.cpp and .h files of new classes are not showing in Ubuntu SDK tree

The CMakeLists.txt file within the backend folder needs to be modified.

Add modules/my-project/my-class.cpp to 'set'.


The documentation says that Qt5 and HTML5 are the technologies to play with. Qt has extensive APIs dealing with every kind of "native" (non-web) functionality. Well, they are native apps with not that much of restrictions. In the case of HTML Apps there is nothing published but the web standards themselves. But both, Qt and Js in HTML, have some file access API for example.

I asked a more specific question regarding also phone calls and the like: What is the equivalent to Android Intent and BroadcastReceiver?


How to extend Ubuntu installation partition size?

I don't have enough rep for commenting, so I'll leave this here.
First, back up everything important, may be make a backup of the system with Timeshift.

You need a live media for this. Boot into Ubuntu (or for that matter,
any distro with gparted) with a live USB or CD.

Choose "Try Ubuntu" and run GParted. If you don't have that on that distro, try installing it.

Then you can safely unmount (if already mounted) and resize your / partition from there.

You cannot resize your / partition if you boot into the Ubuntu that's on your drive (ie, the installed version).


After installing OpenGL to run genymotion, Ubuntu 14.04 stopped booting

I can only answer part of this question.

The message Fontconfig warning /etc/fonts/conf.d/65-droid-sans-fonts.conf, line 61: having multiple values in test isn't supported and may not work as expected. seems to be the result of a program incorrectly adding the to the file - but is only a warning and not your main issue as it's just a warning.

I can confirm this issue still exists in 16.04LTS and it appeared after using an updated release of wine (wine-2.4) and downloading additional font packages (via Wine Tricks).

To fix, simply use you favourite text editor (in my case vim), and edit the file /etc/fonts/conf.d/65-droid-sans-fonts.conf. You'll see several places where you have back-to-back <string> tags that need to be broken up. You'll want to go from:

<test name="lang" compare="not_eq">
  <string>zh-cn</string>
  <string>zh-sg</string>
</test>

to:

<test name="lang" compare="not_eq">
  <string>zh-cn</string>
</test>
<test name="lang" compare="not_eq">
  <string>zh-sg</string>
</test>

Apparently the fix was pushed 6 years ago according to launch pad [1], so somehow there is still some issue going on here. There also a blog post detailing the fix here (in Chinese) [2].

[1] https://bugs.launchpad.net/debian/+source/ttf-wqy-zenhei/+bug/1034928

[2] https://www.cnblogs.com/lishpei/p/6130807.html


FATAL: password authentication failed for user "postgres" Ubuntu v20.10

By Default, the user is 'postgres' and the password is the one which you enter while installing the database. (Version 11,12 I have tested). and enter the password used while installing. Or create a user with login permissions using PgAdmin tool. Except if you forget to give a password during the install.


People have had mixed results getting Rosetta Stone to run under Wine.  See Rosetta Stone under Wine.

I would recommend that you run it under VM.  You can use VirtualBox.  VirtualBox is available in Ubuntu Apps, to install click VirtualBox


Is it possible to tell WINE to use OpenJDK instead of having to install Java in it

No, because wine is "in its own world;" it doesn't share any programs with Linux. You have to install Java inside of it, but there is no reason to because Java programs are cross-platform.


Too many drivers in 'Additional Drivers'

This screen shows available drivers, that you can install from repositories.

According to your screen neither of the drivers are installed, so there is nothing to remove.

The Nouveau driver is the default open source drivers that is always installed. Others are proprietary Nvidia drivers.

The ones you see as open source are proprietary drivers from a PPA. The system can't detect that they are proprietary because they come from an unofficial repository


Is it possible to completely disable Grub timeout?

Change GRUB_TIMEOUT value from 10 to -1, save the file and then run sudo update-grub2. Reboot and now you have infinite time to choose the OS.

While this works in GRUB, it doesn't work with BURG, and you'll have to change GRUB_TIMEOUT value to some large number like 120 seconds to wait before booting into any OS and run sudo update-burg to reflect the changes. Also note that this change must be made to file /etc/default/burg as BURG doesn't consider options set in /etc/default/grub


Open /etc/network/interfaces with your favorite text editor, ie:

  sudo nano /etc/network/interfaces

Locate the interfaces and set them as desired, ie:

auto eth0
iface eth0 inet static
address 192.168.10.101
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255

auto eth1
iface eth1 inet dhcp

That should be all.


Fresh Virtualmin install - MySQL root password?

You can reset your MySQL instance with

sudo dpkg-reconfigure mysql-server-5.5

If you are using another version of MySQL change the (5.5) (execute mysql --version from command line to find the version).

After doing that use the username and password to connect from Virtualmin to your MySQL.


Sluggish refresh when scroll on texteditor

The problem has been identified, and is a bug in the Intel drivers of Ubuntu 12.04 :-)

Take a look at the wiki: http://glx-dock.org/ww_page.php?p=Intel%20cards&lang=en#1-Visual%20artefacts%20when%20scrolling%20in%20some%20windows

Basically, update to the latest version of Mesa, or disable the option "display windows thumbnails" in the Taskbar section.


Hard drives can come formatted, unformatted, or unformatted without a partition table. I'm guessing you don't know which your's came as, but if your goal is to erase Ubuntu and have the drive empty and ready to have something else installed on it then unformatted is a good option. Knowing whether or not you have a BIOS computer or a UEFI based computer would also be helpful in deciding whether to use a gpt or mbr partition table. The steps below will tell you how to get rid of Ubuntu, create a fresh mbr or gpt partition table, and leave the drive unformatted.

Step #1 = Insert an Ubuntu livecd into your computer's dvd/cd drive.

Step #2 = Reboot the computer.

Step #3 = When the computer powers up immediately press the key listed for entering your bios (or uefi) quickboot menu. This key is different for different computers but popular keys are F2, F4, F10, F11, F12, and Esc.

http://i.stack.imgur.com/db3lQ.png

Step #4 = In the Bios (or UEFI) quickboot menu you will see a list of boot options. Choose cd/dvd, as this will allow you to boot the Ubuntu livecd. Use the arrow keys and press enter to choose the desired entry.

http://i.stack.imgur.com/8px17.png

Step #5 = Once the livecd boots up choose "Try Ubuntu without installing".

http://i.stack.imgur.com/oSVr6.png

Step #6 = Once the desktop appears, choose the launcher icon, search "gparted", and click to launch it. It should be pre-installed on the livecd if you are using 12.04, but if not you can install it by typing in terminal "sudo apt-get install gparted".

http://i.stack.imgur.com/Lchzf.png

Step #7 = Once gparted opens, you need to select the desired drive using the selector on the top right. If you only have 1 hard drive then it will already be selected so there is no need.

http://i.stack.imgur.com/nRpcF.png

Step #8 = Right click on the "linux-swap" partition and choose "swap-off". You will notice after doing this that there are no more "lock" icons on any partitions. If for some reason you have a partition still showing a lock icon, right click on it an choose "unmount".

http://i.stack.imgur.com/sjzoX.png

Step #9 = Go to the "devices" menu, and choose "create partition table".

http://i.stack.imgur.com/mY6t5.png

Step #10 = Click the advanced tab on the popup that appears. From the list choose "msdos" if you want an MBR partition table, or gpt if you want a GUID partition table. If you don't know which then pick MBR as it's standard and is used by both Windows and Linux operating systems. If your computer is a Windows 8 UEFI computer then you would likely want GPT.

http://i.stack.imgur.com/Pc2Of.png

Step #11 = Your drive should now be unallocated. You have a partition table, but no partitions. You can shutdown and eject the livecd.

http://i.stack.imgur.com/36TDD.png

[Please note: The drive has only been quick-formatted so there is potential for data recovery. This is fine if you plan to keep the drive, but if you selling this hard drive or giving it away you should consider a "low level format" to prevent recovery of your data by the new owner. This may not apply to you, but it might to someone else reading this posting.]


This answer was originally posted by the OP as a part of the question.

The solution was reinstalling 18.04, after making changes to BIOS (Legacy) on the computer. All 3rd party drivers are taken within the installation.


Ubuntu 20.04 stuck on "EFI stub: UEFI Secure Boot is enabled."

nomodeset
nomodeset only disables the video driver, and should only be used for troubleshooting. Update your video driver. Remember to change "nomodeset" back to "quiet splash".
Secure Boot
See the BIOS update.
fast boot/hibernation

boot into Windows
open the Power control panel
choose change what the power buttons do
choose change options that are unavailable
uncheck fast startup
close the Power control panel
open an administrative command prompt window
type powercfg /h off
type chkdsk /f c:
approve to run chkdsk at next reboot
type chkdsk /f x: (replacing "x" with drive letters of other visible NTFS partitions)
reboot into Windows to let chkdsk run on drive C:

BIOS
ASUS UX303UA
You have BIOS version 202.
There's a newer BIOS that might fix your problem. Version 302, dated 6/5/2019, can be downloaded here.
Note: Confirm that I have the correct web page for your model #.
Note: Have good backups before updating the BIOS.
Note: Disable Secure Boot after updating the BIOS.


Completely eliminating all password prompt

On 12.04 for package management

gksudo gedit  /var/lib/polkit-1/localauthority/50-local.d/package-manager.pkla

Use this, save

[Install package file]
Identity=unix-group:sudo
Action=org.debian.apt.install-file;org.debian.apt.update-cache;org.debian.apt.install-or-remove-packages;org.debian.apt.upgrade-packages
ResultActive=yes

[Install package synaptic]
Identity=unix-group:sudo
Action=com.ubuntu.pkexec.synaptic
ResultActive=yes

[Change add repo]
Identity=unix-group:sudo
Action=com.ubuntu.softwareproperties.applychanges;org.debian.apt.change-repository
ResultActive=yes

As far as a password - when you first install Ubuntu still allows a min. password of 1 character. After install it goes up to 6 min.


Your NO_PUBKEY  problem

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16126d3a3e5c1192
sudo apt-get update

And you don't have the main repository enabled

sudo apt-add-repository main
sudo apt-get update
sudo apt-get install postfix

And if software-properties-common isn't installed (we need apt-add-repository)

cd
wget http://mirrors.kernel.org/ubuntu/pool/main/s/software-properties/software-properties-common_0.92.37.5_all.deb
sudo dpkg -i software-properties-common_0.92.37.5_all.deb
sudo apt-get update
sudo apt-get install -f

Or use this /etc/apt/sources.list and don't forget to start

sudo apt-get update
sudo apt-get install -f

after replacing the content with the lines below

# See http://heus.archive.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu trusty restricted universe main multiverse
deb-src http://us.archive.ubuntu.com/ubuntu trusty main universe restricted multiverse #Added by software-properties

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu trusty-updates restricted universe main multiverse
deb-src http://us.archive.ubuntu.com/ubuntu trusty-updates restricted universe main multiverse #Added by software-properties

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.

deb http://us.archive.ubuntu.com/ubuntu trusty-security restricted universe main multiverse
deb-src http://us.archive.ubuntu.com/ubuntu trusty-security restricted universe main multiverse #Added by software-properties

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://us.archive.canonical.com/ubuntu trusty partner
# deb-src http://us.archive.canonical.com/ubuntu trusty partner

deb http://us.archive.ubuntu.com/ubuntu trusty-backports main universe restricted multiverse
deb-src http://us.archive.ubuntu.com/ubuntu trusty-backports main universe restricted multiverse #Added by software-properties


Launch Steam games without a X Desktop running

You need have a window manager running.
If you don't know how, there's a project for what you want to do:
steam big picture xsession


ip addr will show your virtual interfaces (highlighted pink):

sudo ip link delete enp5s0 will remove virtual interface (link) enp5s0
Note in my case that's my ethernet and I don't want to delete it, but I had a whole bunch of other ones that were messing with my LAN games and getting rid of them solved a huge headache.


Try this

mkdir /mnt/root
mount /dev/sda7 /mnt/root
mount /dev/sda5 /mnt/root/boot
mount --bind /dev /mnt/root/dev
mount --bind /proc /mnt/root/proc
mount --bind /sys /mnt/root/sys

This will create a chroot environment and now you need to run chroot and create configuration file for grub

chroot /mnt/root
/usr/sbin/update-grub2
reboot

Now it should works


Can't execute terminal commands: "the command 'sudo' is available in '/usr/bin/sudo'"

As the error say, you should add /usr/bin directory to your PATH environment variable. To do this, run the following command in terminal:

export PATH=$PATH:/usr/bin

After you can use sudo, you can edit /etc/environment file to make the change permanent, so, run in terminal:

sudo nano /etc/environment

to edit the file. Make sure that the path is something like this:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

Save and close the file with Ctrl+X and press Y when you are asked.

See also: How to add a directory to the PATH?


ubuntu 12.10 usb startup brought settings from the last computer

A persistent live usb will retain settings from your install. If you are not sure how to change the settings to what you need, the simplest thing would be to remake the usb, being sure to reformat the drive at the same time.


Ubuntu 14.04 setup for Canoscan 9000 Mark II

Canoscan 9000 Mark II is using sane-pixma backend, so editing /etc/sane.d/canon-dr.conf is wrong.
See SANE Supported Scanners database for more info.

WARNING: Following is NOT The Right Way™ to do things!

I got mine to work by updating my udev, libsane and libusb from Debian's Testing version. I don't know, if some of them wasn't necessary.

Like this in terminal:

$ sudo echo "deb <mirror> testing main contrib non-free" >> /etc/apt/sources.list
# Sources are not necessary but here they are if wanted
$ sudo echo "deb-src <mirror> testing main contrib non-free" >> /etc/apt/sources.list
$ sudo apt-key --keyserver keyserver.ubuntu.com --recv-keys 46925553
$ sudo apt-get update
$ sudo apt-get install udev libsane libusb-1.0-0

Debians <mirror>'s.

Do NOT use atp-get upgrade, because it's about The Best Way™ to destroy your Ubuntu installation. Do remember to remove or comment out those repositories from /etc/apt/sources.list afterwards.

$ sudo <put your preferred text editor here> /etc/apt/sources.list
$ sudo apt-get update


Check the FAQs. They have a lot of good answers to these kinds of questions.

How do I resolve unmet dependencies after adding a PPA?


There are two ways to avoid a truncated dump file:

As suggested by Doug Smythies, use termination signal (SIGTERM) instead of SIGINT to kill the tcpdump process:

kill <pid>

Tell tcpdump to write packet directly to file as each packet is saved (option -U). This way, even using SIGINT, the file will not be truncated. From man tcpdump :

   -U
   --packet-buffered
          If the -w option is not specified, make the  printed  packet
          output  ``packet-buffered''; i.e., as the description of the
          contents of each packet is printed, it will  be  written  to
          the standard output, rather than, when not writing to a ter‐
          minal, being written only when the output buffer fills.

          If the -w option is specified, make  the  saved  raw  packet
          output  ``packet-buffered'';  i.e., as each packet is saved,
          it will be written to the output  file,  rather  than  being
          written only when the output buffer fills.

          The  -U flag will not be supported if tcpdump was built with
          an older version of libpcap that lacks the pcap_dump_flush()
          function.


I got the same error on ubuntu-xenial 4.4.0-75-generic.

I found I had a /usr/include/asm-generic folder, but no /usr/include/asm, which gcc was looking for.

Creating a symlink solved it for me.

sudo ln -s /usr/include/asm-generic/ /usr/include/asm

Fair warning: Although, sometimes, one has to do this kind of trickery, it's not always a good idea just because it works. I'm doing this in a virtual machine, which I can recreate by running a simple script, and that is why it's no big deal if I break something.


Can I install NetworkManager Version 0.9.6.0 on 12.04?

If possible download the DEB package from Quantal/12.10 and try to install that with Ubuntu Software Center. If there are no problems it will install. It looks like most installations are source based for network manager though.

You can get the source files and install that. There will be a 'how to install' or readme among the files. This does require more than average knowledge; you might need to tinker with settings or be able to understand errors or notices you get along the way. It is not for the faint hearted.

Other options:

Unless you need to stick with 12.04 (it being a LTS) consider updating to 12.10. It is something that will be less hassle then installing from source.

When installing from source you can also try IRC channel #nm at irc.freenode.net. It might even be worth to see if someone can help you get the version from 12.04 fixed.


Why when I use wget for a website does it download additional parts of the website?

Did you read man wget? The option you want is --mirror, documented as

   -m
   --mirror
       Turn on options suitable for mirroring.  This option turns on recursion and time-stamping, sets infinite recursion depth and keeps FTP directory listings.  It is currently equivalent
       to -r -N -l inf --no-remove-listing.

By typing -mirror, you've specified -m, -i, -r (3 times), and -o. These single letter options have their own meanings, see man wget.


You can change the shortcuts by installing Advance keyboard shortcuts tool - gconf-editor (GConf-Editor)

You can install this tool by typing the following command :
 sudo apt-get install gconf-editor

Now run gconf-editor
 you can run is through the terminal by typing
gconf-editor &

--->Now double click the "apps" folder

--->Next double click the "metacity" folder

--->Finally click the global_keybindings folder

now you can change the value for next_tab and prev_tab. :)


Welcome Diana. Your questions are more about opinions than something we can answer that is black or white.

The simplest way to get budgie from where you are is to just install it on top of your vanilla Ubuntu installation. As @guiverc says you can have several different desktops installed which you can choose between when you log on. Some people report the odd issue with multiple desktops but I’ve not found it to be a problem.
Whilst some people don’t have any swap enabled you can hit problems depending on how you use your system and how much ram you have. If memory runs short you will risk problems.
If you are a new user in my opinion it’s best to use the defaults suggested in the installer. As a more experienced user you might have reasons to set up all the partitions you list. If you are unaware of any reason to add extra partitions don’t do it at this stage.

Hope this helps. As I said these are just opinions and other approaches can have their merits.
Update, answering the questions in comments below:
#1 Since you say you have just installed vanilla Ubuntu the quickest way to get the Budgie desktop is to install it like any other application using the software centre or the command line. Don’t try to do that with the Budgie installer unless you want to start again from scratch. If you are not confident doing this, search on here for how to do it or ask your own specific question.
#2 The only drawback of using swap is it will use disk space. What you don’t want to happen is have the computer freeze when you are working on something important and potentially lose your work.
#3 You can run Linux with one partition or lots. I use a single partition and prefer that approach because that makes all my disk space available to every aspect of the computer. If you have a root partition and a home partition you can run out of space on one and not make use of spare space available on the other without resizing. On the other hand having a separate home partition arguably makes it easier to reinstall Linux and not lose data and settings in home.


How to change to a specific openoffice document in Unity?

For this situation I would use the "Spread Mode" keyboard short-cut.

Press the Super + W key (i.e. the windows symbol button and the w key)

This will display all open windows on the same screen.  You can then click which ever document you now wish to work on.


difference kill -9 pid and kill pid command

kill pid (which sends signal 15 (SIGTERM)) tells pid to terminate, but said program can execute some code first or even ignore the signal. kill -9 pid, on the other hand, forces the program to immediately terminate (it cannot be ignored).

You should always try kill pid first, as it allows the program to do things like saving/closing open files before exiting. Only use kill -9 when you need the program to close and it won't respond to a simple kill pid.


What is inside the yellow box is just a warning. I think that if you trust the package you can just type "Y" when promted to proceed instalation of your package.


You can use the find command, with its output directed to a file, in the following way:

/tmp/FILES$ find . -name "*.zip" -print > outfile.txt

Find every file ended with zip inside the current folder (FILES) and print it path
The output of the find command is directed into a text file:

The content of the outfile.txt is:

/tmp/FILES$ cat outfile.txt

./TWO/two.zip
./ONE/one.zip

  Note, if you'll execute the find command in one folder above the FILES folder, your output will include also the FILES part of the folder.

e.g. when find output is directed to stdout

/tmp$ find FILES -name "*.zip" -print
FILES/TWO/two.zip
FILES/ONE/one.zip


Raspberry Pi 4B - Ubuntu 19.10 - Wired Network Unmanaged

I figured this out.

To view the netplan configuration run the following commands.

$cd /etc/netplan
$sudo nano 50-cloud-init.yaml

If the 50-cloud-init.yaml file is blank run the following commands.

^X
$sudo netplan generate
$sudo netplan apply

Now you can edit 50-cloud-init.yaml to manage the wired network.

$sudo nano 50-cloud-init.yaml

Here is what will be displayed in the terminal window.

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        eth0:
            dhcp4: true
            optional: true
    version: 2

You edit 50-cloud-init.yaml by adding renderer: NetworkManager.  You have to make sure all of the indents are correct or the file won’t work.  You use the space bar and not tab to set the indents.  When you are finished 50-cloud-init.yaml will look like this.  I deleted the optional: true line.

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following
# network: {config: disabled}
network:
    renderer: NetworkManager
    ethernets:
        eth0:
            dhcp4: true
    version: 2

 Now you save the edit.

^X
# Save Modifed Buffer
Y
# File Name to Write: 50-cloud-init.yaml
# Press Enter Key

Now you apply the revised 50-cloud-init.yaml file.

$sudo netplan apply

I rebooted the Raspberry Pi and the wired network was available to tweak.   My first exposure to Linux and Ubuntu was exactly one week ago this morning.  I am pleased that I was able to piece together online resources to figure this out.   Hopefully this update will make this task easier for others.


It seems that your particular card requires some additional proprietary software components to be installed which come with a licence that has restrictive distribution terms, this is why Ubuntu was unable to take care of this issue for you during the install.

Seems that other users with same same installed hardware have already faced and resolved this problem as there is a wiki page which is specific to your specific issue as such I think it is probably best to refer you to the existing document.

https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx


Monitor randomly reboots - could it be Ubuntu fault?

Try connecting the screen to another system if possible. If the problem doesn't persist it's related to your current system and the manufacturer of your screen is right. If it does persist, then:

Contact the manufacturer again or contact place of purchase. Stress that you have this problem with 2 different video cards (highly unlikely if the screen isn't to blame)


Ubuntu Virtual Desktop for web development

I've been through the whole RDP, XRDP, VNC, Chrome Remote headaches.

I don't know why this isn't more well-known, but I use:

NoMachine
https://www.nomachine.com/

Also, read up on
https://en.wikipedia.org/wiki/NX_technology

NoMachine listens on port 4000 so make sure it's open.


Problem in dual boot with Ubuntu 12.04 and windows 8 (can't choose an os when boot)

I would suggest trying to repair GRUB. The easiest way to do that is probably to use Boot Repair application.

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair

After installation launch it using Bash and try default repair. If it will not help You can try advanced options.

And if anything goes wrong remember that You can also use this application with Live-CD.

Hope that will help.

I just get a an idea. You wrote that You cannot see any boot menu. Try to check grub with commend below.

sudo gedit /etc/default/grub

Check out this line:

GRUB_TIMEOUT=

. What number is there? If there is 0 You should change it to higher number, save file and update grub with

sudo update-grub

as I think.
But anyway the easiest and safest way is to use Boot Repair application. It changes this line by default also as I know.


Thunderbird Mails (not enough disk space)

In my case;

I am using Ubuntu 12.04. My inbox size was 4GB (I think limitation of os), so i created a new archives directory like 2013 and moved all old mails on date 2013 from Inbox.

Also you can check your box size from your thunderbird folder:

    cd /home/username/.thunderbird/axxmjtdv.default/Mail/pop.googlemail.com/

    ls -all


Altering command to start application by mouse click - how to

The alias you have tried alias googleearth='LIBGL_ALWAYS_SOFTWARE=1 googleearth' should work, maybe you did this:

alias googleearth='LIBGL_ALWAYS_SOFTWARE=1 googleearth' ; googleearth

or you used the alias in a script or in a fuction. Nothing of this works.

If it still doesn't work for you, try creating a function instead of an alias. Don't forget to provide an absolute pathname to the googleearth command inside the function so it's not interpreted as recursive function.


I doubt using an earlier version of Ubuntu would help too much as the same happens with Zorin 15, it's more likely to do with how exFAT and FAT32 volumes are handled. Here's a solution that works for me from github:

If you are running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local

Go to the bottom of the file and leave a space then paste in those two lines.

Save the file with ctrl + x then press y.

To revert the changes enter this in console and remove the lines in /etc/rc.local

echo 0 > /proc/sys/vm/dirty_background_bytes
echo 0 > /proc/sys/vm/dirty_bytes

More info and references:
https://gist.github.com/2E0PGS/f63544f8abe69acc5caaa54f56efe52f
https://unix.stackexchange.com/questions/107703/why-is-my-pc-freezing-while-im-copying-a-file-to-a-pendrive/107722#107722


To stop icons appearing in the dash we check for the .desktop files in two places:

In the /usr/share/applications for apps stored system wide for all users.
And in /home/username/.local/share/applications for applications installed for one user in their default home directory or applications that have been customized by user
Then remove it using two methods from a terminal:

a. sudo rm my_icon.desktop for those found in /usr/share/applications folder

b. rm my_icon.desktop for those found in /home/username/.local/share/applications directory

c. In step b above you can also do a right click and select move to trash with your mouse.
Then restart your system to have it take effect.


Unlocking applications from launcher from the command line

The command to get the current launcher's icons is:

gsettings get com.canonical.Unity.Launcher favorites

This will give you a list like:

['item_1', 'item_2', 'application://application_to_remove.desktop', 'etc']

If you remove your item from the list and set the altered version of the list by the command:

gsettings set com.canonical.Unity.Launcher favorites "['item_1', 'item_2', 'etc']"
(mind the double quotes)

Your application is unlocked from the launcher.

Example script

As an example of how the job can be done by a (python) script:

#!/usr/bin/env python3
import subprocess
import sys

key = "com.canonical.Unity.Launcher"
desktopfile = sys.argv[1]

curr_launcher = eval(subprocess.check_output([
    "gsettings", "get", key, "favorites"
    ]).decode("utf-8"))
new_launcher = [item for item in curr_launcher if not desktopfile in item]
subprocess.Popen(["gsettings", "set", key,"favorites",str(new_launcher)])

How to use

Paste the script into an empty file, save it as remove_fromlauncher.py
Run it by the command

python3 /path/to/remove_fromlauncher.py <application.desktop>

or shorter:

python3 /path/to/remove_fromlauncher.py <application>

Example remove Virtualbox:

python3 /path/to/remove_fromlauncher.py virtualbox.desktop

Note

Keep in mind that you cannot simply remove all items from the list; It also includes items which are not applications.

EDIT

Version of the script to remove multiple icons at once:

#!/usr/bin/env python3
import subprocess
import sys

key = "com.canonical.Unity.Launcher"

desktopfiles = sys.argv[1:]

for desktopfile in desktopfiles:
    curr_launcher = eval(subprocess.check_output([
        "gsettings", "get", key, "favorites"
        ]).decode("utf-8"))
    new_launcher = [item for item in curr_launcher if not desktopfile in item]
    subprocess.Popen(["gsettings", "set", key,"favorites",str(new_launcher)])

Usage is pretty much the same, but now you can use multiple argumnents at once, e.g.:

python3 /path/to/remove_fromlauncher.py gedit thunderbird

will remove both Thunderbird and Gedit from the launcher.


Ubuntu refuses to boot due to an error - (EE) SynPS/2 Synaptics TouchPad: Read error 19.

Well you could follow this that has the same issue as yours, but I suggest for simplicity, just reinstall Ubuntu, as this will get rid of all headaches that you would get trying to fix the problem. I learnt the hard way when I upgraded to GNOME 3.12.


/usr/bin no longer in path after booting into windows 7

If you're saying that it is looping at the login prompt, that is the password shows no errors but returns you to the login prompt. I might be able to help. It happened to me. I don't know why.

Ubuntu gets stuck in a login loop

might help.

The code dpkg-reconfigure lightdm entered in the terminal is what did it for me. Apparently, some problem in .Xauthority file.
I hope the link helps.


Ubuntu 13.10 - how can i install package?

Open up your Software Center by going to the dash and searching for it.
In the menu, select "edit"->"software sources".

In the pop-up window that opens, there will be a 'Ubuntu software' tab (the first one) and a 'Download from select option'. Choose 'Main server' and enter your password.

Then try running sudo apt-get update && sudo apt-get upgrade in terminal.


Can using gParted let me use my failed windows flash drive?

Yes. Use "udevadm monitor" then plug in your drive, it will show you what dev device it is created as. Then use "mount / dev/sdx /mnt" where x is the drive it was created as in the dev directory to mount it on /mnt


How to remove right click format option to a disk icon in the launcher?

As far as I know...the Format option is hardcoded in the Unity source. You can try to edit source code to remove the format item.

NOTE: I recommend you to do this in a Virtual Machine or in a Test Machine to see is everything is OK. (In this example I'm running Ubuntu 12.04 with Unity 5.20.0).

1) Make sure you have enable the Source code repository

Open the Ubuntu Software Center.
In the Menu Bar choose Edit -> Software Sources. Click to enable "Source code repository".
Just in case I use the "Main Server" to Download.

Open a Terminal window Ctrl+Alt+T and type:

sudo apt-get update

2) In the Terminal type the following to install the necessary packages.

sudo apt-get install build-essential quilt

3) Install build dependencies.

sudo apt-get build-dep unity

4) Create a folder to download the source code.

mkdir ~/Downloads/src

cd ~/Downloads/src

5) Download the source code & Export variables.

apt-get source unity

export QUILT_PATCHES=debian/patches

export EDITOR=gedit

6) Create the patch and Edit the source code.

cd unity-5.20.0/

quilt new 99_no_format_option.patch

quilt edit plugins/unityshell/src/DeviceLauncherIcon.cpp

Remove the lines... from 171 to 185.

Save the changes.
7) Build the deb packages.

quilt refresh
fakeroot dpkg-buildpackage

8) Install the deb packages.

cd ..

sudo dpkg -i *deb

9) Finally you can logout and Login to see the changes.
Before:

After:

Hope this helps.


How add cpu frequency that should be available?

The CPU frequency is handled by your BIOS, not by the OS (usually), adjusting either the vcore, the base multiplier, etc. (varies depending on the BIOS) should give you the speeds that you are looking for.


I am using the 64bit version of Ubuntu 14.10 and it has Empathy

They might have removed it from the 32bit version? You could always download it from the Ubuntu Software Centre


Can another user see a file even if they don't have any permissions?

Bellow you can see me make a test folder and change the ownership of that folder to another user. I cannot create a file if the directory isn't owned by me. Similarly, as testuser, I couldn't remove a test file owned by my account. But as you see, if a user can run sudo, that user can change ownership of the folder, change file permissions, and thus - view and modify the file

$ mkdir tester
$ chown testuser:testuser tester/
chown: changing ownership of ‘tester/’: Operation not permitted

$ sudo chown testuser:testuser tester/
[sudo] password for xieerqi:

$ ls -l tester
total 0

$ touch tester/testfile
touch: cannot touch ‘tester/testfile’: Permission denied

$ sudo chown xieerqi:xieerqi tester/
$ touch tester/testfile
$ chmod 700 tester/testfile
mksh: chmod: can't execute: Permission denied

$ sudo chmod 700 tester/testfile
$ sudo su testuser

testuser@foo $ ls -l tester/testfile
-rwx------ 1 xieerqi xieerqi 0 May  2 08:46 tester/testfile
testuser@foo $ rm tester/testfile
rm: remove write-protected regular empty file ‘tester/testfile’?
testuser@foo $ ls -l tester/testfile
-rwx------ 1 xieerqi xieerqi 0 May  2 08:46 tester/testfile


How to activate/deactivate a gnome-shell extension from command line

It is well described in the Gnome wiki, quoting:

  You can do this with the GSettings key, org.gnome.shell.enabled-extensions, or several tools that manipulate this GSettings key, such as GNOME Tweak Tool or a recent version of gnome-shell-extension-tool.

If you invoke gnome-shell-extension-tool --help, you will see that it is capable of enabling and disabling extensions by their name. For example, the following command enables user themes:

gnome-shell-extension-tool -e user-theme

Oh, and you can get the names of all your locally installed extensions by doing ls ~/.local/share/gnome-shell/extensions. It will give you entries of the form the-name@author.


Can I open a new terminal with a new binary executing in it?

I tried to use a similar script to make run a script and an executable. It functions in both cases.

Case of an executable /usr/bin/xlogo:

#!/bin/bash
XTERM="/usr/bin/xterm -bg RED -e /usr/bin/xlogo"
exec $XTERM 2>&1 &

  The terminal starts, so it does the binary xlogo; the original shell give me the prompt back, because the script finish its execution. No error are returned.
  (It ends well because the xterm starts).
  If I press CTRL+C when the focus is on the xterm window I interrupt the xterm session and the executable. If I close the executable, the xterm session finish too.

Case of a script, that I make executable with chmod u+x MyScript.sh

#!/bin/bash
pwd         # To confirm in which directory it works
echo Please insert something
read a      # It asks to input something
echo inserted $a We sleep for 10 seconds
sleep 10    # It will wait 10 seconds to exit

  It runs, again as in the binary case.
  If I try to interrupt the script this will make finish the  xterm session too.
  It shows clearly that the xterm session runs from the current path.

So if your file is executable  doesn't really make difference if it is a binary or a script.

Classic debug checklist:

Check if you can run /usr/bin/xterm
Check if it is executable ( in your example with ls -l /home/ambuj/practice/myBinary).
If it is executable try to run it from the current location (directory) to see if it needs to be executed from a particular path if  it needs some file somewhere, or if it is compiled for your architecture...

Note that if the execution of your binary (or script) finishes your terminal session will finish immediately after, and it doesn't matter if because of an error or because of a  natural reasons.

Never forget that the error more difficult to find is the one that doesn't exists: so if your program is executed and finish fast, it will seems to you that your xterm will  open and close without doing anything.


What is the difference between sh and ./

There are differences between them.

Let's look at the first one:

  sh myapp

It opens myapp in sh.
The command may not work with binaries as muru said.

Let's look at the second one:

  ./myapp

It tells the shell to open myapp. The shell gets the app set as preferred and then sends to the application command to open the app.

I remember that  the sh way doesn't require executive rights. (may someone who is sure confirm?)


How to centrally administer Ubuntu servers

The keyword is configuration management. One tool I use for this purpose is Ansible. There you express your desired configuration with a YAML file and Ansible takes care of it all. Of course you can also reboot hosts with this, see this answer which also gives you a first impression of how it will look.

There are also other options like Salt, Puppet, or Chef.


Losing hope with Apache2 (IP refused connection)

Try this

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

And ofcourse need to save the rules. Iptables-persistent is nice tool for this:

sudo apt-get install iptables-persistent

After it's installed, you can save/reload iptables rules anytime:

sudo /etc/init.d/iptables-persistent save
sudo /etc/init.d/iptables-persistent reload

How to configure apache and iptables to allow incoming connections ubuntu server?


source /etc/environment not working from bash script

You could source your script instead of executing it. Then the script's source command occurs in your current shell.

Also, JAVA_HOME should be a directory:

printf 'JAVA_HOME="%s"\n' "$(dirname -- "$PLACE")" >> /etc/environment

that also allows you to drop the VAR and QUOTE vars

Also, you must use quotes: [ -z "$JAVA_HOME" ]

if JAVA_HOME is actually empty, the shell sees [ -z  ]
with only a single argument, the [ command returns true if the argument itself is not empty.
Since the string "-z" is never empty, the condition is always true,
and you'll get a new JAVA_HOME=... in the /etc/environment every time.


find + grep

Use find command

find /that/directory -type f -exec sha1sum {} \; | grep 'known sha1 sum'

The way this works is as follows:

find will operate recursively on /that/directory
-type f allows us to filter out only regular files
exec sha1sum {} \; will perform sha1sum command with each file as argument ( which is what {} brackets signify )
grep 'known sha1sum' allows us to filter the output of find command to get the line of output with the sha1 hashsum that we need.

Bash's globstar

Another things that could be done, is to use bash's globstar to enable recursive globbing, and iterate that way. Here's how I would search for a file with known sha1sum

bash-4.3$ shopt -s globstar ;
bash-4.3$ known_sha1sum="4b1e65aab01f76b8863707eda5215af09633d275"
bash-4.3$ for f in ./**/* ; do [ -f "$f" ] && shasum=$(sha1sum "$f" | awk '{print $1}'); [ "$shasum" = "$known_sha1sum" ] && echo "$f"; done
./golang/hello_world

Instead of iterating via for loop, we can make this even shorter:

bash-4.3$ shopt -s globstar
bash-4.3$ sha1sum ./**/* 2>/dev/null | grep '4b1e65aab01f76b8863707eda5215af09633d275'4b1e65aab01f76b8863707eda5215af09633d275  ./golang/hello_world

While this method might be short, I would be skeptical of this method on a directory with large amount of files, where glob might expand outside of range of maximum amount of command-line arguments. Caveat emptor

Python 3

Of course being a Python aficionado, I couldn't leave without providing a python script for this task.  This script takes multiple arguments, so you can specify multiple sha1sums that you need to find, which aligns with the requirement of the question for doing this task for multiple files.

Note that the script assumes you want to search from current working directory down to subdirectories, so ensure you cd to desired top directory first

#!/usr/bin/env python3
import os
import sys
from hashlib import sha1

def get_sha1sum(file_path):
    sha1sum = sha1()
    with open(file_path, 'rb') as fd:
        data_chunk = fd.read(1024)
        while data_chunk:
              sha1sum.update(data_chunk)
              data_chunk = fd.read(1024)
    return str(sha1sum.hexdigest())

def find_files(treeroot):
    for dir,subdirs,files in os.walk(treeroot):
         for f in files:
             full_path = os.path.join(dir,f)
             path_sha1sum = get_sha1sum( full_path  )
             if path_sha1sum in sys.argv[1:]:
                 print(path_sha1sum,full_path)

def main():
    find_files('.')

if __name__ == '__main__': main()

Test run:

$ ./find_with_sha1.py  '4b1e65aab01f76b8863707eda5215af09633d275' '38ab29bdda161da8082cbbc97d33747dff6fb848'
4b1e65aab01f76b8863707eda5215af09633d275 ./golang/hello_world
38ab29bdda161da8082cbbc97d33747dff6fb848 ./golang/hello_world.go

This script is also available on my personal GitHub respository, where further development and changes will be added to this script.


Reformatting and re-installing Ubuntu
You wanted it, and i will try my best to make you understand the progress on how to fix this. Lets assume that something went wrong during the installation of the OS. It could be that your pc was restarted before it could finish the installation, or the GRUB boot loader wasn't properly installed. Now, i am going to show you how to reformat the harddrive, which from my view, seem to be the easiest and best solution to your problem.

Make sure to put in your LiveCD, and start up the Ubuntu Installation again. When you come to the step where it asks you to wipe any old installations on your system, you should choose "Something Else"

When you have, it will appear a new window (image below). You will have one or more partition the list. A partition is in many ways a virtual hard-drive, but is physically just space divided into different sections on your harddrive. However, this step isn't that hard. Select the hard-drive using "ext3" or "ext4" located under type and click delete. (Be sure you are doing changes on your hard-drive and that you don't have any other devices like memory sticks inserted while you do this)

Now you have deleted that file-system from your hard-drive. on this step, you must select the partition you just deleted the file system from, and click add.

A new window pops up. Make sure primary is selected. From the menu in the "Use as", select EXT4 Journaling File System.
The Size you have as default, should be subtracted with 1024. (if you have 2048 as default, you should enter a value like this: 2048-1024 = 1024) --> this will be used as Swap. Now, click OK.

Now you have an empty partition, a small one. Select that small one, and click add. Leave the Partition size as it is here, and from the list on Use As: you simply select Swap and click ok.

Once you are happy with the changes you have made, click “Install now” and you are good to go. Hopefully this installation will work.
Good luck, got questions --> just ask :)


With Ubuntu 14.04 I get errors related to QGIS when I type sudo apt-get dist upgrade

/usr/lib/qgis/crssync: error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory

You are missing this shared library. You should run apt-get -f install to correct problems. This may result in the qgis packages being uninstalled. I'm not sure where you got those qgis packages from, but it seems they are built possibly with a new library which is not available in 14.04 (or in the archive you may have installed them from), which is causing the configuration of the qgis-providers package to fail.


Driver for Epson Stylus C70 for Ubuntu 12.04

Here are drivers for Epson STYLUS C70 for Linux.  Information about Epson STYLUS C70 Linux Driver v.1.0., and to download it, Click Here.


I think that the problem here is that you miss the gcc package..so ensure that you have an internet connection and then do:

sudo apt-get install gcc

Please note that there is already a version of HPLIP in the Ubuntu Software Centre for Ubuntu 11.10, as you can see here:

https://launchpad.net/ubuntu/oneiric/+source/hplip


How do I move to directory "Program Files (x86)" with CD command?

2 methods (there are more):

cd "Program Files (x86)"
cd Program\ Files\ \(x86\)


How to get back shortcut commands in menus in various apps

Those commands never went anywhere , just press Alt key when you open firefox , the same old menu will pop in the top.

EDIT 1 :

Well when I press alt I have it in my browser.

EDIT 2 :
Well a little misunderstanding but see here when you press the Alt key , you can see the some letters are underlined and thats the shortcut for that ,Such as in nautilus to make a new folder press Alt + F key. Tada.

Cheers


Easier method:

mkdir -p foo/bar{00..50}
$ ls foo/
bar00  bar02  bar04  bar06  bar08  bar10  bar12  bar14  bar16  bar18  bar20  bar22  bar24  bar26  bar28  bar30  bar32  bar34  bar36  bar38  bar40  bar42  bar44  bar46  bar48  bar50
bar01  bar03  bar05  bar07  bar09  bar11  bar13  bar15  bar17  bar19  bar21  bar23  bar25  bar27  bar29  bar31  bar33  bar35  bar37  bar39  bar41  bar43  bar45  bar47  bar49

So the 1st part can be:

 mkdir -p foo/bar{00..50}

And then all you need to create are the "index" files with the text.

Regarding the 2nd part I would use a reference file

touch file2
vi file2 (and add content)
shop -s globstar && for f in **/*(/); do cp -p file2 "$f/index"; done


Rsync creates error message unexplained error (code 255) at io.c(837)

To investigate, add one or more -v options to the rsync command.
Also, try to use plain ssh:

ssh -v 192.168.1.21 /bin/true

to find out whether it is rsync or the underlying ssh connection that is causing the trouble.


How to get rid of lvmetad is not active yet; using direct activation during sysinit warning message?

Because it is activated in the /etc/lvm/lvm.conf and lvm just do that it allways do and try first to use it.

 #LVM uses built-in clustered locking with clvmd.
 #This is incompatible with lvmetad. If **use_lvmetad** is enabled,
 #LVM prints a warning and disables lvmetad use.

< Blacker47> lvmetad is a ~caching-deamon for the metadata, so for every rescan (done if you creates new lv, new snapshot, activates new lv and many more) there is no need to access drives again and again. may have much more usecases. for me it helps not to spinup disks in standby if i activate my backup lv.

On the boot the daemon not running, so it has to work without with the fallback. the warning at the boot is just for ignore. it would be only interesting if you get such warning later and not on boot.

If I would like to do not use lvmetad I should set this in /etc/lvm/lvm.conf

use_lvmetad 0

and then update all initramfs images with

sudo update-initramfs -u -k all


What is the Policy for Updating grub-pc in LTS?

It's a question of time, not policy.  Sorry for not having dealt with this yet.  I've opened a bug target in an effort not to forget again.


why does NetworkManager add a host route to the gateway?

After thinking about this for a few weeks, I've concluded that this is done to prevent any routes obtained over the VPN from matching the VPN gateway itself, creating a loop where the kernel is trying to route over the VPN to reach the VPN gateway.  The most obvious case is if you acquire a default route over the VPN.

So, in my case, I'm now convinced that this is a bug.  The logic makes sense, but has to be applied more intelligently.  Maybe add a route to the VPN gateway only after checking that you would otherwise route gateway traffic over the VPN.


how to make Chromium-browser start on vnc display?

The xrandr messages I do not believe are related.

What's happening is that you have two X servers running, one of which is for your VNC server. Chrome doesn't know which to display on -- and it can't display on both like other X apps can. That's a documented bug in the Chromium Open Source project. (See also this duplicate bug report which mirrors your situation.)

What's happening is that Chrome is displaying on your local X server instead of a remote one. Unfortunately, the bug is open in the official Chrome project, which means there isn't an immediate solution that's elegant, but some users on the bug report have managed to get it working by basically making two config directories for Chrome, one for each X server, and running them totally separately. (Search for "--user-data-dir" for a discussion of that on the first bug report.)


How can I change the mode of Sqlite Database?

First, make sure you have write permission to the sqlite file. Then, make sure you have write permission to the directory that the sqlite file is in. This is because SQLite keeps a hidden journal file in the same directory.


Check for system updates, upgrades and fixing installs. Then delete the crash reports and reboot to see if the error stays there. Do you have a dual boot?

sudo apt update && sudo apt upgrade
sudo apt install -f
sudo rm /var/crash/*
sudo reboot


How do I move back to original directory?

To cd to the previous directory, you can use one of the following commands in bash:

cd -
cd "$OLDPWD"

To cd to your home directory, use one of:

cd
cd ~
cd "$HOME"

If you want to undo multiple cds, cd can't help you. You'll have to use the pushd and popd commands. Instead of cd foo/bar, do

pushd foo/bar

Then you can use the popd command to undo as many times as you have used pushd.

Example:

/tmp/lightdm-1.10.5 $ pushd ~
~ /tmp/lightdm-1.10.5
~ $ pushd devel
~/devel ~ /tmp/lightdm-1.10.5
~/devel $ popd
~ /tmp/lightdm-1.10.5
~ $ popd
/tmp/lightdm-1.10.5
/tmp/lightdm-1.10.5 $

Also see:

How do I use the pushd and popd commands?


journalctl chops lines longer then screen

This can be simply done by setting the SYSTEMD_LESS environment variable.
For instance setting SYSTEMD_LESS=FRXMK (that means S should not be in the set ) will show the message in a wrapped format.
This can be set in your .bashrc (export SYSTEMD_LESS=FRXMK) or directly in front of the journalctl command:
SYSTEMD_LESS=FRXMK journalctl -b

The output should now be wrapped:
Jul 09 20:47:57 myubuntu org.kde.kglobalaccel[1452]: Invalid Context= "Legacy" line for icon theme:
"/usr/share/icons/Adwaita/8x8/legacy/"

More about setting the SYSTEMD_LESS variable can be found in less(1) and journalctl(1).
From less(1) :

-S or --chop-long-lines
Causes  lines longer than the screen width to be chopped (truncated) rather than wrapped.  That is, the
portion of a long line that does not fit in the screen width is not shown.  The default is to wrap long
lines; that is, display the remainder on the next line.


Could not execute 'gpgv' to verify signature (is gpgv installed?)

I solved the same issue in two steps:

Installed debian-keyring (sudo apt-get install debian-keyring)
run apt-get update again and for each missing key run (sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys XXXXXXXX)

Hope this helps


Capturing fdisk output into an array and printing it

Assuming your shell is bash, use the mapfile command with input from a process substitution

mapfile -t disks < <(sudo fdisk -l | awk '/^\/dev/ {print $1}')

I removed the unnecessary grep from the pipeline since awk can do that.

You can inspect the contents of the array with declare -p disks


Upgraded to 12.04 and now wont stay connected to secure network

I think selecting the checkbox "Available to all users" fixed this for me... it was either that or taking out the word "Auto" in the Connection name... either way, I was getting the exact same thing until I did that.


https://www.ubuntu.com/download/desktop
You should use ubuntu 18.04 (support for 5 years) or ubuntu 18.10 (support for 9 months)


Windows 7/Ubuntu installed on separate drives, get Invalid EFI message when selecting Windows at boot

Your Windows installation seems to be on an MBR disk. Given that Microsoft ties the partition table type (MBR vs. GPT) to the boot mode (BIOS/CSM/legacy vs. EFI/UEFI), this means that Windows was almost certainly installed in BIOS mode. The fact that you've got Windows boot loaders on /dev/sdb and /dev/sdc further supports this analysis. Mixing a BIOS-mode Windows with an EFI-mode Linux is tricky, and GRUB can't handle it.

The easiest solution, but one that's not guaranteed to work, is to edit the /boot/efi/EFI/refind/refind.conf file (or wherever you've installed rEFInd). Uncomment the scanfor line and ensure that hdbios is listed among the options. If you're lucky, that will create a new icon in rEFInd that will enable it to redirect the boot process to a BIOS-mode boot loader. This won't work if your firmware lacks a CSM, though; and it also won't work if your CSM is set to boot only from /dev/sda. Still, it's an easy enough thing to try, and if it works it should get things running just fine. Note that if you go this route, you'll probably want to remove the /boot/efi/EFI/Microsoft directory (from Linux), since it clearly  doesn't contain a real Windows boot loader, just a copy of GRUB created by Boot Repair. (That's why selecting Windows from rEFInd launches GRUB.)

Another solution is to install the BIOS-mode version of GRUB (from the grub-pc package; installing it should automatically uninstall the EFI-mode version of GRUB) and reconfigure your firmware to boot only in BIOS/CSM/legacy mode. The latter part of the task is impossible to describe in detail because how you do this varies from one computer to another.

If all of this fails, you may need to convert /dev/sda from GPT to MBR. You can do this with gdisk: Launch gdisk on the disk, type r to enter the recovery & transformation menu, type g to convert from GPT to MBR, type p to view the partition table to verify that all your partitions are included, and type w to save the changes. You'll then need to re-install a BIOS-mode version of GRUB. (This whole process is basically a last-ditch effort to get the computer booting in BIOS mode rather than in EFI mode.)


SSH : User can only access a particular folder in webroot

I see two (similar) solutions for your problem:

SSH Chroot jail
When the user logs in with ssh he will chroot automatically in the directory you've configured and will not be able to exit it (jail)

SFTP
I've used mysecureshell on several occasions when needed to provide access to webroot directory. MySecureShell is basically a wrapper around chroot so more or less it will do the same.


I was able to discover and ping the printer from a Mac but not from the DELL XPS. It occurred to me that perhaps there was a conflict with other users in the network. I searched 'unable to ping printer at 10.0.1.2' Taking the hint from another similar question I found, I unplugged the modem, router, and printer and restarted the system components.

Ubuntu still didn't show the printer until I deleted the old connection to the printer and cold rebooted the DELL XPS laptop. The System Settings/Printers then showed the printer after I clicked on Network Printer and added the printer which now works as before.

I imagine this wasn't the fastest way but solved the problem. I decided to post this on Ubuntu Help page, in case others find similar connection problems.


Ricoh aficio mp c6501 only prints white pages

i have the same problem of spitting paper on a ricoh aficio 3025 (open the tray to erase the job the only way).
i do this:

1)install as a smb windows printer chossing a generic driver, and a "Generic PCL 6/PCL XL Printer - CUPS+Gutenprint v5.2.8-pre1" in the next selection

2)later go to properties of the printer and change the uri "socket://xxx.xxx.x.xxx:yyyy"
the "yyyy" is the port printer (appears in the original uri)

try it.........works ok, good luck


I am looking for software/command to control IrDA

IRDA is supported on ubuntu, but many individual hardware implementations are not. Install the the irda-utils package and issue the included findchip command to see if you are in luck..

sudo apt-get update ; sudo apt-get install irda-utils
sudo findchip -v

If you luck out, you might find the following link useful...

http://blogs.fsfe.org/stefan.a/2011/05/24/irda_infrared_data_transfer_on_ubuntu/


Reinstall indicator-datetime. It should be installed by default, but just in case you have removed it unknowingly, it is best to run the install command again.

sudo apt-get install indicator-datetime

  Next, we are going to reconfigure the date time:

sudo dpkg-reconfigure --frontend noninteractive tzdata

  Lastly, restart unity.

sudo killall unity-panel-service

  That’s it. The date and time indicator will appear in the menu bar now.

(Source)


Can I participate in showdown contest with friend?

Yes you can write the application with your friend, as you can see in the Showdown contest rules:

  [A]ll submissions must be new open source applications, created either
  as an individual (the Participant) or in a team.

But i don't think that you'll get 2 T-shirts.


No Grub after installing aside Windows 10

As mentioned by oldfred, the problem was that Windows 10 was UEFI and I installed Ubuntu as BIOS. Solved reinstalling it in UEFI mode.


Firefox on newly installed Ubuntu 20.10 does not stream videos

Installing a video streaming program, VLC, recognized by Firefox, solved the problem.
Perhaps Ubuntu could include a Firefox friendly audio-visual streaming package in its installation image.


'Launch terminal' launches terminator instead of terminal

Run sudo update-alternatives --set x-terminal-emulator $(which gnome-terminal.wrapper)

The system has x-terminal-emulator , which is symlinked to a particular program. When you've installed terminator , that symlink has been somehow changed to terminator. The command above will restore that to gnome terminal.


Ubuntu 18.04 Server for a 4k laptop display?

You can reconfigure the console-setup package:

sudo dpkg-reconfigure console-setup

It will ask you questions about the language/font and size to use for TTY consoles. Note that there are some limitations because of VGA graphics standards. Check man console-setup for more information on those limitations.


File permissions vulnerability in pure-ftpd using php script

The problem is the HTTP server since (by default) scripts are run as the www-data user.

To continue your analogy, Steve likely has file permissions for /var/www/steve/somefile set to 755 - which grants read and execute permissions to any user. Because Apache executes PHP scripts as the www-data user, PHP scripts won't encounter any problems accessing the file.

Steve can prevent others from seeing his file by running the following command:

chmod 700 /var/www/steve/somefile

This will prevent other users (except for root of course) from being able to access the file. Note that the same problem applies to directories and because of this, other users may be able to see that the file exists (though they won't be able to read its contents).

Some FTP clients provides means of changing file permissions, so I would encourage you to consult the manual for your FTP client.

Tools such as Apache suEXEC will cause the PHP script to be executed under the user's actual account - but of course it won't protect against the vulnerability you're referring to.


Bash completion for custom command to complete static directory tree

You could use a custom completion function like the following:

_foo () {
  local cur
  COMPREPLY=()
  cur=${COMP_WORDS[COMP_CWORD]}
  k=0
  i="/a/b/c" # the directory from where to start
  for j in $( compgen -f "$i/$cur" ); do # loop trough the possible completions
    [ -d "$j" ] && j="${j}/" || j="${j} " # if its a dir add a shlash, else a space
    COMPREPLY[k++]=${j#$i/} # remove the directory prefix from the array
  done
  return 0
}

And then register the function to be used with your command foo:

complete -o nospace -F _foo foo


How to copy files with superuser rights without gksudo nautilus?

Run this command:

sudo cp /path-from /path-to/


Inverse Sine, Cosine, and Tangent on Ubuntu Calculator


How do I refer to a display with xinerama enabled?

There is no syntax to refer to individual monitors in a screen in a display string.

However, you might be able to use the --geometry option to do what you're after.  If you have two monitors side by side and the first is 1920 pixels wide, then the following should position a terminal window at (50,50) on the second screen:

gnome-terminal --geometry=80x24+1970+50

The syntax of the argument is ROWSxCOLS+X+Y


I had docker package installed through apt and snap at the same time.
So the issue is fixed by removing docker through the snap packaging system.

# apt list --installed | grep docker
docker/bionic,now 1.5-1build1 amd64 [installed]
docker-ce/bionic,now 5:19.03.5~3-0~ubuntu-bionic amd64 [installed]
docker-ce-cli/bionic,now 5:19.03.5~3-0~ubuntu-bionic amd64 [installed,automatic]

# snap list | grep docker
docker                18.09.9                     418   stable    canonical✓  -

# snap remove docker
docker removed


MAAS on Ubuntu Server 12.10 - Node autodetect not enlisting

after much more research I found the lack of the tftpboot dir is intentional.  in order to send any kernel options to the node (i.e. noapic nolapic etc) edit
/usr/share/pyshared/provisioningserver/kernel_opts.py
way at the bottom the compose_kernel_command_line method has an options array there.

I ended up running the maas-cli accept-all function to get my node to boot through the default pxe schema. It checked in (I had to accept and commission again) then I was able to get everything bootstrapped and running.


How can I disable touchpad while typing? On Ubuntu 16.04 syndaemon isn't working

You may have two touchpad drivers running, where syndaemon would then interact with the wrong one. I had the same issue on a Dell XPS 13, and this thread (http://ubuntuforums.org/showthread.php?t=2316240) helped me.

If you also see two touchpad devices, try to disable one. As you have a different computer, the instructions in the link may or may not be literally applicable for you.

From the post referred to, the procedure is:

open the file /usr/share/X11/xorg.conf.d/51-synaptics-quirks.conf as root with your text editor
Insert the following text:

# Disable generic Synaptics device, as we're using
# "DLL0704:01 06CB:76AE Touchpad"
# Having multiple touchpad devices running confuses syndaemon
Section "InputClass"
Identifier "SynPS/2 Synaptics TouchPad"
      MatchProduct "SynPS/2 Synaptics TouchPad"
      MatchIsTouchpad "on"
      MatchOS "Linux"
      MatchDevicePath "/dev/input/event*"
      Option "Ignore" "on"
EndSection

Either reboot or restart Xorg with the command sudo systemctl restart lightdm
Credit goes to ddarling from ubuntuforums.org.

Since january 2018, Dell has an official page in its Knowledge Base on Ubuntu Touchpad/Mouse Issues. The page describes this fix to disable the "SynPS/2 Synaptics TouchPad", and also suggests to move to libinput rather than synaptics as the mousepad driver.


Can I enable dhcp4 on all interfaces globally without knowing the interface names with netplan and networkd?

It is possible to enable wifi on an interface without knowing the exact interface name by using the match syntax:
network:
  version: 2
  renderer: networkd
  ethernets:
    alleths:
      match:
        name: en*
      dhcp4: true

Be sure to avoid any settings that would collide between multiple interfaces (and do not use set-name).


How to tell cron to find paths to tools?

This is from man 5 crontab:

   Several environment variables are set up automatically by  the  cron(8)
   daemon.  SHELL is set to /bin/sh, and LOGNAME and HOME are set from the
   /etc/passwd  line  of   the   crontab's   owner.   PATH   is   set   to
   "/usr/bin:/bin".   HOME,  SHELL, and PATH may be overridden by settings
   in the crontab; LOGNAME is the user that the job is running  from,  and
   may not be changed.

So, PATH is set by cron to "/usr/bin:/bin". Now, to add more paths to the PATH to be used by cron, just edit the crontab file (using crontab -e command) and add, for example the following line somewhere at the beginning:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

See also this Q&A from StackOverflow: crontab PATH and USER.


Minecraft Server keeps crashing out of memory, but stil empty swap left

You can allocate manually how much RAM java can use for minecraft. From Minecraft Wiki

  Using the Xms and Xmx parameters, the initial and maximum memory size
  for Java can be specified. By default, your server runs with about 100
  MB of RAM, which is very little. Most people will change their server
  to run with more, for example:

java -Xms512M -Xmx1G ...
java -Xms1024M -Xmx1024M ...
java -Xms1G -Xmx2G ...


I tried to simulate the process of Picasa deb-package installation on modern Ubuntu 20.10. It is almost impossible because of very limited set of 32-bit packages. And Qt4 is missed in the repositories.
So I would recommend to use PlayOnLinux with Wine to install the Picasa application. You have to:

Install PlayOnLinux
sudo apt-get install playonlinux

Launch PlayOnLinux

Click Install

Search for Google Picasa in the wizard, click Install

Allow wizard to download Picasa 3.9 from the internet and install it

Launch Picasa


How to permanently disable the "save session" feature in Xubuntu?

The solution is two-step.

Disable Automatically save sessions on logout in Settings > Sessions > General > Logout Settings. Also make sure that you disable Save session for future logins in the Logout prompt (the window that pops when you actually try to logout).

See:

How do I totally disable all forms of session management in Xubuntu?

You need to log out, delete the contents of ~/.cache/sessions, then log into a clean session. (You can also delete your current session via Settings > Sessions > Session > Clear Saved Sessions.)

See:

Xubuntu reopens last session applications even though it shouldn't


Open dropbox preference. Go to Account tab.

Click on Move button under Location section. A file browser dialog box will appear and you will be able to select different location for your dropbox folder, even to to external hdd. Only you need to give correct path.

  To know the exact path of your external hdd open a folder in Nautilus, right click on it and check the Location of the folder in its Properties.

  Note: Your dropbox will not function properly if the external hdd is not mounted.


I think you can install Xubuntu with a Live CD/DVD, and choose to place bootloader on your Xubuntu partition and not where your grub is so grub stays as it is. After you finish installing Xubuntu, you can boot into Archlinux and play with update-grub or better use another Live CD or some USB pendrive with Boot Repair on it to fix your dual-boot configuration. Boot Repair can be written on USB with Unetbootin tool. But you need to make sure you can boot into Archlinux after first reboot when finished with installing Xubuntu.

Oh, also make sure you download the right iso image for Boot Repair, they have iso images for both 32bit and 64bit machines.


Can I upgrade windows 8.1 to 10 and not affect ubuntu?

Depends on how your system is configured.  Normally, if Windows is installed after Linux, it over-writes the MBR or bootsector of the drive installing its own BCD.  Windows BCD does support multiboot to Ubuntu, but it is not as elegant as GRUB is.  You can reinstall GRUB after if that happens by following the instructions here:

https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows


Should I dual boot or get rid of Windows and just run Ubuntu?

If you need Windows for anything, like Netflix streaming, iTunes, etc, you can either keep it, but with a small partition, or better yet - assuming you have a bootable Windows CD, use VirtualBox to create a Windows VM so you don't even need to leave Ubuntu to run the windows programs.  I use this method, and it works well, although I use it with XP, which is probably less resource intensive.

If you're keeping your old laptop, you could just use that for your emergency Windows usage.


fresh install, won't boot, only in safemode

Try to install proprietary drivers if you can access System settings -> Additional Drivers. Then reboot.


how to edit sudoers file and pass a file which contains list of commands instead of commands list in sudoers file

You could create an additional configuration file, located in the directory /etc/sudoers.d/. You should use the same syntax as in /etc/sudoers/.

But note! If you commit a typo in these files, you will not be able to use the sudo command anymore, while the typo exists, so you will stuck out of the administrator's privileges.

  visudo parses the sudoers file after the edit and will not save the
  changes if there is a syntax error - read more.

Here is a great answer related to this question:

How do I run specific sudo commands without a password?


Below are instructions for restoring the elegant Unity 3D in your computer:
NOTE: Should work when you have a laptop fitted with MOBILE (GxxxM) Nvidia graphics card and has capability of switching graphics (ie. you have Intel Integrated graphics as well). This is a special case of graphics issue and must be handled differently.
Remove all nvidia drivers, install only x-swat PPAs (uses OpenGL and mesa-libs):
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates

or you can manually add in Update Manager settings, in the tab Other Software, type in the following APT line:
deb http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu precise main

Then, perform a list update and install the appropriate driver:
sudo apt-get update
sudo apt-get install xserver-xorg-video-intel

Remove all Nvidia drivers, install mesa-utils:
sudo apt-get remove nvidia-current nvidia-graphics-drivers
sudo apt-get purge nvidia*
sudo apt-get install mesa-utils

Type in the following line in terminal, if there's an error saying no GLX found in display, proceed
glxinfo

Reinstalling all components to refresh:
sudo apt-get install --reinstall xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
sudo dpkg-reconfigure xserver-xorg
sudo update-alternatives --remove gl_conf /usr/lib/nvidia-current/ld.so.conf

Reset Unity (CLOSE AND SAVE EVERYTHING BEFORE DOING): (add sudo in front if superuser required)
unity --reset

Now wait till everything stabilises (even though your terminal window will go randomly on top and unmovable, no big deal), then (force?) relog in Ubuntu. You should see your perfect Unity 3D waiting for you.

(Did I mention that this worked so well for me? Had exactly the same problem as you before, searched high and low for solutions that don't apply, finally went through this.)
Ubuntu 12.04 Precise Pangolin 64bit, Geforce 310M with CUDA, Intel Core i5-460M.


How can I enable access to local network devices while connected to VPN through GUI Network Manager in Ubuntu 19.10?

It really depends on what you are trying to achieve. For example, if you are only trying to use certain resources through the VPN you can try cheacking this box

If you are trying to tunnel all traffic and you don't control the other end point, you should still be able to access local resources via their IP (assuming that the VPN you are connecting to does not use the same IP range).

For example, I have OpenVPN setup on my PFSense. It shunts VPN Users to a 10.x.x.x network, while most home networks start with 192 or 172. This means that there is no confusion about which machine I am trying to access if I ping 192.168.1.111.

Hopefully this helps clear things up. As for your specific samba question you can hit

ctrl + l while in Nautilus (Files app) to bring up the bar. You can then type smb://some.ip/sharename and connect that way


connect a laptop to a desktop via Ethernet cable (both offline)

If you question is about the network, your answer is 'Yes'. You can set static IP on both your laptop and your PC. To do so, use network-manager:

Open Network manager
Edit LAN
Go to IPv4 Setting Tab
Set method to Manual
Set IP address.

e.g. set 192.168.1.1 for the PC and 192.168.1.2 for laptop.

Then you can use any network remote connection tool to access PC from laptop of vice versa. For example: SSH, AnyDesk, VNC Viewer, etc.


What power settings can I use for Asus U32U-ES21 to achieve something close to the stated 10 hours battery life?

I suggest checking out:

https://wiki.ubuntu.com/Kernel/PowerManagement/PowerSavingTweaks

and also:

https://wiki.ubuntu.com/Kernel/PowerManagement/IdentifyingIssues


-----------Next answer------------

It's also possible that you've configured the gateway incorrectly for each interface. Please configure the interfaces as follows:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
 address 192.168.128.254
 netmask 255.255.0.0
 gateway 192.168.1.1
 network 192.168.128.0
 broadcast 192.168.128.255
 dns-nameservers xxxxxx

auto eth1
iface eth1 inet static
 address 192.168.11.1
 netmask 255.255.0.0
 network 192.168.11.0
 broadcast 192.168.11.255

auto eth2
iface eth2 inet static
 address 192.168.21.1
 netmask 255.255.0.0
 network 192.168.21.0
 broadcast 192.168.21.255

auto eth3
iface eth3 inet static
 address 192.168.31.1
 netmask 255.255.0.0
 network 192.168.31.0
 broadcast 192.168.31.255

With these changes, all of the interfaces should look to the same gateway and communicate properly. You may need to remove some of the routing that you did.


Download 64bit packages in a 32bit system

You can use aptitude (to be installed):

sudo aptitude -o APT::Architecture="amd64" update
aptitude -o APT::Architecture="amd64" download package-name

(after that, remember to do an apt-get update without -o option, to restore correct i386 information).

It is also possible to show packages URLs with

apt-get --print-uris install package-name

but this only works for non inistalled packages. For 64 bits packages, change the suffix _i386.deb with _amd64.deb.

Alternatively,

apt-cache --no-all-versions show package-name | grep ^Filename

shows URL but without the leading server information. Server information can be obtained from:

apt-cache --no-all-versions policy package-name |
    grep -A2 '^  [^ ]' | tail -1 | awk '{ print $2 }'


g++ doesn't automatically know the source code file is on your desktop. It's looking for it in your current directory -- wherever you are in your shell from which you run it. If you haven't changed directory with the cd command, that's probably your home directory. The Desktop directory is a subdirectory of your home directory.

variabili.cc is in ~/Desktop, so you must either...

...be there in your shell when you run g++:

cd ~/Desktop
g++ variabili.cc

...or tell g++ where the file is:

g++ ~/Desktop/variabili.cc

Of these two options, I recommend cding to the location where your file is. That way, the generated executable and any other output files will automatically be put in the same directory as your source code.

You might want to give g++ some other options too, such as to enable warnings (-Wall -Wextra) or specify the name of an output file (-o filename), but neither is necessary to make your code compile.

If you're wondering what directory currently you're in, your prompt likely shows you. For example, on my machine (Io), logged in as the user ek, I started in my home directory (~, which for me means /home/ek), changed directory to ~/Desktop, then changed directory to /:

ek@Io:~$ cd Desktop/
ek@Io:~/Desktop$ cd /
ek@Io:/$

The text that I have shown in bold is the prompts.

You can also always find out where you are by running pwd, which stands for "present working directory":

ek@Io:~/Desktop$ pwd
/home/ek/Desktop


HyperV was deinstalled incorrectly and interfered with Virtual Box.

Check that all your old VM's are deinstalled correctly.


Why does Tor unexpectedly exit every time I open it?

Aug 04 01:38:35.837 [warn] /usr/bin/tor-browser/Data/Tor is not owned by this user (brody, 1000) but by root (0). Perhaps you are running Tor as the wrong user?

tells us what we need to know. The directory that the file is trying to write to is owned by root, and your privileges aren't sufficient. If you installed tor through the apt repository, that would probably be why.

Download the latest tor tarball from https://www.torproject.org/ and extract the contents, from there go into a terminal window, navigate to the directory you extracted and type chmod +x start-tor-browser.sh (may not be the exact file name, but I digress).

Then type ./start-tor-browser.sh to start the browser. It should work from there.


See here. Basically, whatever process you're running is already running. Use ps -A or ps aux to see what processes are running (if you have a lot of processes running, you can try greping the output to find what you're looking for). Kill it with sudo kill PID and the errors should stop.


How do I wipe a harddrive with Ubuntu on it?

You can do this directly from Windows installer, just select "Advanced" partitioning, remove all partitions of your drive, create a new one (Windows will create addtitional partitions - recovery and ESP) and proceed as in normal installation.

Alternatively you could use Live CD/Live USB of some Linux distribution, e.g. drive you installed Ubuntu from. Click "Try Ubuntu without installing". There are variety of tools you can use at this point. For GUI operation I'd recommend GParted, you can install it using apt-get install gparted like you'd do on regular Ubuntu installation. Operation is preety straightforward, but in case of problems you can refer to manual.

Please note that this will remove all your data from the drive you kept Ubuntu on!


The Intel® Core™2 Duo Processor E7300 has 2 Cores hence the x 2.  See the Intel data sheet for the processor and the Wikipedia page for Intel Core 2 for more information about your processor.  Basically, 2 Cores is equivalent to having 2 discrete CPUs on the silicon die.