installing a new hard drive on an existing Ubuntu machine

There are a number of different approaches that will resolve your problem. The simplest one to describe would be to copy the original drive to the larger drive using dd or dc3dd. Another option is to determine what is using the most space and moving all that data to the new drive and mounting the new drive in the location on the tree where the data came from. du can help you determine usage by directory. du -h ~/Documents from a terminal prompt will give you the disk usage of your documents directory.
Changing the command to ~/Downloads, ~/Pictures, ~/Music or ~/Videos will give you the usage for those directories as well. Comparing the totals will tell you where you are using all your space. If you have multiple users on the system it may be appropriate to move the entire /home directory to the new drive and mount that in fstab. Fair warning: dd dc3dd and du are all CLI tools that are run from the terminal and dd & dc3dd if improperly used can wipe your data. To understand permissions see How do file permissions work? The /media directory is usually used for temporarily connected storage like flash drives and external drives. Your data lives at /home/yourusername or perhaps /home/jean. the ~ in the above is shorthand for that and literally means my home directory (so if you are jean it means /home/jean and if you are bob it means /home/bob). When deciding where to mount your new drive you might find How to understand the Ubuntu file system layout? useful. For a rundown on fstab options open a terminal and issue the command
    man fstab


Memory issues with recently installed ubuntu

Your issue is that your computer files are currently mounted on /sda1 which is only 100GB, whereas SDA2 seems to be an empty junk drive at the moment. To fix this, do the following, but read every step before trying anything.

The format for fstab, which is the partitioning and mounting file is as follows:

UUID=????????   /home    ext3          defaults       0       2

So you will need the following to fix this:

UUID of your drive, which can be found with sudo blkid
The directory to your /home folder (or where most of your files are being stored)
What kind of file system you want, I recommend (ext3 or ext4: See here for difference(s))
The last 2 tags are always going to be 0 and 2 unless you are experienced in Ubuntu enough to know what they do

Now that you have this information, run the following command as root:

sudo gedit /etc/fstab

I use gedit, but any text editor will work.

Once there, at the bottom of the file you will see a line like this:

UUID=00000000  /   ext4          defaults       0       2

The UUID may be different, and depending on how you formatted your computer, some others may be, but what is important is that you remount (the folder/directory with most files in it) onto the 500GB /sda2. You can do this by adding the following to the bottom

/sda2          /     ext(3 or 4)       defaults        0          2

Then save, exit, and reboot!


Checksum a group of folders to another group of folders using md5sum

Without more details from you, it's hard to give an answer that's more specific than "yes it is".

Although it would be possible to script something using find and md5sum, it will almost certainly be easier to use the --checksum option of rsync in dry run mode (using the --dry-run or -n flag) as described here Verify backup integrity with rsync, sed, cat, and tee.

Since you copied the directories from diverse locations, you will likely need to do it three times - once for each source directory i.e.

rsync -Pahn --checksum path/to/originaldir1/ path/to/newdir1/
rsync -Pahn --checksum path/to/originaldir2/ path/to/newdir2/
rsync -Pahn --checksum path/to/originaldir3/ path/to/newdir3/

(you may be able to automate this somewhat, depending on your directory names and paths - but for 3 dirs it may not be worth the effort).

The output will consist of a single line for each filename whose checksum differs e.g.

$ rsync -Pahn --checksum olddir/ newdir/
sending incremental file list
subdir2/file


UEFI : os boot manager still has an entry for ubuntu after it's removal

I do not know how to do this in Windows (though it might be possible with WSL "Windows Subsystem for Linux"), but if you boot the system with an Ubuntu Live CD or usb-stick you might be able to try this:

Run efibootmgr command as root to list all entries registered by the bootmanager. In the following example you can see that there are three boot options

# efibootmgr
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0001,0000
Boot0000  ubilinux
Boot0001  UEFI: Built-in EFI Shell
Boot0002* ubuntu

Then use the number for Ubuntu (0002 in the example above) to remove the entry with

# efibootmgr -b 2 -B

DISCLAIMER the above is what I found in man efibootmgr. Use at your own risk


Startup script for starting applications in certain workspaces and positions

There is Devilspie which will do everything you want.


How to fix the Gnome/Unity shortcut for an application?

If you do locate gimp.desktop will it output this:?

/usr/share/app-install/desktop/gimp:gimp.desktop
/usr/share/applications/gimp.desktop

If there are some excess lines starting with /usr/local/share, your deinstallation may have failed. Unfortunately there seems to be no command to let the unity-applications-daemon refresh its application cache.

You may achieve this by logging out and in.


For more information on the "Home Directory" encryption, see https://help.ubuntu.com/community/EncryptedPrivateDirectory .

For more information on the "Whole Disk" encryption, see https://help.ubuntu.com/community/EncryptedFilesystems .

If the computer is used exclusively by a single person, then yes, "Home Directory" encryption offers very little additional security if "Whole Disk" is in place.  If it's shared between multiple people, however, either you all share the password for the whole-disk encryption, or you have separate keys that each unlock the whole-disk encryption.

If you do have "Home Directory" encryption, it's not actually the case that your entire home directory is encrypted.  Rather, you have a directory ~/Private that you can store files (or symlink dot-files) in, backed by directory ~/.Private.  Someone who can become root on the system can see rough file sizes, last-modification times, and directory-tree depth within that directory.  Furthermore, if you use a program to edit one of those files, it's possible that unencryted sensitive material could be written to swap or temporary files.

To "delete the encryption", just move files out of ~/Private with mv.


Start Wine program using nVidia video card

the solutin is : primusrun wine "C:\Program Files (x86)\Adobe\Adobe Photoshop CS6\Photoshop.exe"


First Installation Problem with GNU GRUB

(breaking protocol here, comments are disabled for my account):

Please post the output of running ls at the command prompt. Also how did you produce the Ubuntu liveusb?

Also to search the drives run:

ls (hdX,partY)/dir

Where:

X is the number of a hard drive
partY is the second part of the partition label returned by the first ls
dir optional path for further partition search

Hopefully you can find the vmlinuz and initrd files from this, if not, you probably have a faulty usb install.


Nothing will show up as you type your password, this is an intentional security feature!

Make sure you type the password correctly, remember that Ubuntu is case-sensitive!


Is there a way to open the "Connect to Server" without opening Nautilus first?

Yes, there is a way to open the “Connect to Server” without opening Nautilus first.

Run nautilus-connect-server. It will appear as a Nautilus icon in your launcher, so you can right click it and "Keep in launcher" to make it stay there.


How do I display login message such as password expiry warning?

I managed to create a script that works for exactly my problem. Thanks to @kos for the answer - it helped me to show the dialog itself.

I wrote the script based on this solution but since dscl is not available for me I searched for another way to query the AD. This blog entry helped me to get started and find a solution to get exactly what I was looking for..

So here is my script which I then just trigger on session startup:

#!/bin/bash
pwPolicy=90
warnDays=10
user=`whoami`
userRecord=`ldapsearch -h mydomain.de -b 'dc=mydomain,dc=de' "(sAMAccountName=${user})" 2>/dev/null`
lastpwdMS=`grep -i pwdLastSet <<< "$userRecord" | sed 's/pwdLastSet: //'`
todayUnix=`date "+%s"`
lastpwdUnix=`expr $lastpwdMS / 10000000 - 11644473600`
diffUnix=`expr $todayUnix - $lastpwdUnix`
diffdays=`expr $diffUnix / 86400`
daysremaining=`expr $pwPolicy - $diffdays`

if [ "$daysremaining" -le ${warnDays} ]
then
  zenity --info --title="Password expiration" --text="The password for ${user} will expire in ${daysremaining} days."
fi

I'm not familiar with the AD but just try ldapsearch -h mydomain.de -b 'dc=mydomain,dc=de' "(sAMAccountName=${user})" 2>/dev/null if it works for you.

IMO this solution is neither pretty nor usable for other scenarios but it fixes this single problem. I'm still interested if anyone knows how to just show a dialog with the messages that would appear when logging in via ssh.


Unable to locate package ubuntu-after-install

When Apt Unable to locate package, you should add appropriate repository, In your case run following command: (for ubuntu-after-install)

sudo add-apt-repository ppa:thefanclub/ubuntu-after-install
sudo apt-get update
sudo apt-get install ubuntu-after-install

To add universe, restricted and partner repository run:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
sudo add-apt-repository "deb http://archive.canonical.com/ubuntu $(lsb_release -sc) partner"
sudo apt-get update


Auto-selected text in a browser address bar

A changable setting in Firefox governs text selection in the address bar.

Type about:config in the Firefox address bar, search for browser.urlbar.clickSelectsAll and change its value to true by double clicking.

You may also want to use ctrl+l or alt+d to autoselect text in the address bar, and ctrl+k to do the same in the search bar.


How do you delete a folder that contains spaces?

Your terminal hangs, that's very odd. In the terminal I'm usually able to remove spaces by escaping the space character with a backslash:

rm -r test\ dir

If that doesn't work, have you tried enclosing it in single or double quotes:

rm -r "test dir" or rm -r 'test dir'

Another idea would be to install a terminal file manager such as Midnight Commander and try to remove the file that way.
Good luck!


I booted UBUNTU to a USB flashdrive. How can I run it now?

If you have done everything perfectly while making bootable drive  , then you will see some different icon of USB.  If that is correct then you should plug in your USB. Then go to your BIOS settings. There you may have to press esc , f2 ,f10 or f12 (fully depends upon your pc). These will mostly appear below the boot menu . If you have pressed correctly then you will see blue screen.  If not then reboot oncemore and try. After going into that bios menu, you should select your USB by arrows and enter key. Then you will boot up there you press install ubuntu or you can try ubuntu and then decide whether or not use ubuntu and then install with icon in desktop. There you first select language, keyboard format etc. Then if you want to dualboot then give install ubuntu along with windows or you can replace windows if you want. Then it will install (note: you should allocate drive with recommended space for ubuntu as for windows ).
Then remove USB and you should see a grub menu insterd of regular windows boot . There you can select ubuntu and use.


How to install Samba and Share directory and Printer

In addition to defining the share in smb.conf as mentioned I also found it necessary to define SAMBA users (distinct from Ubuntu users):

For example to add a SAMBA user to your Ubuntu system with the user name jseinfeld, you would enter this command at the prompt:

sudo smbpasswd -a jseinfeld

The smbpasswd application will then prompt you to enter a password for the user:

New SMB password:

Enter the password you wish to set for the user, and the smbpasswd application will ask you to confirm the password:

Retype new SMB password:

Confirm the password, and smbpasswd will add the entry for the user to the SAMBA password file.

For further assistance, see:

https://help.ubuntu.com/8.04/serverguide/configuring-samba.html


Lubuntu font size on any window is too small

How do you switch to Noveau from Nvidia you ask? Just open up synaptic from a terminal with sudo synaptic and look up noveau. Mark it for installation. Once you do it should replace your graphics driver on reboot. I don't use LXDE but there should be a font settings menu for it where you can change the font size system wide.


Do some files downloaded from the internet have execute permission by default?

No. Whenever you create a new file the umask is applied. This umask is a number that dictates what permissions will the file have.

For having execution permission masks should be either 7, 5 or 3. No file is created with those masks. But, beware of compressed files, since those keeps their file permission when you extract them. If you keep downloading things from trusted sources and verify the content before doing anything, you should be alright.

Let's see how umask works:

For files the default mask is 0666 and the umask is 0022. The system each time you create a file do this operation:

mask - umask = file permissions
0666 - 0022  = 0644

The permissions numbers broken down is like follows:

0644
^^^^
||||
|||\_ others permissions, in this case only read
|| \__ groups permissions, in this case only read
| \___ user permissions, in this case read and write
 \__ special byte

Hence, each file created by your user is created so you can read and write the file, your group can read them, and others can read them too. Nothing to do with the executables.


What could prevent an Ubuntu server from booting without a VGA connected monitor?

Make a backup of  /etc/default/grub and then edit the file with ...

sudo nano /etc/default/grub

and then find the line ...

GRUB_CMDLINE_LINUX_DEFAULT

and remove quiet and splash if they are there (doubt that they are cuz otherwise it would never work) and add ...

nomodeset

From comments for you this would be

  GRUB_CMDLINE_LINUX_DEFAULT="biosdevname=0 nomodeset"

You will need to do a

sudo update-grub

to reload grub. A reboot should let the system pass grub without a monitor.


I am not sure if I understand you right. If you want to install Ubuntu into the win98 partition and leaving it a win98 partition as it is at the moment.

If that is correct, you can use wubi.exe to install Ubuntu just into the win98 file system. You can find the wubi.exe file at the Ubuntu download page.

If you want to replace the win98 partition, you can just install Ubuntu from the live CD and choose the first partition to be replaced by the Ubuntu installation during the installation process.


How to remember a window position in gnome shell

I could achieve something like that using devilspie2 (also check here for a few tips https://help.ubuntu.com/community/Devilspie)

sudo apt install devilspie2 lua5.2

and then created the following file at ~/.config/devilspie2/terminator.lua

if (get_application_name() == "terminator") then
  -- x,y, xsize, ysize
  set_window_geometry(683, 32, 683, 768);
end

Nevertheless I still can't exactly reproduce gnome shell's behavior. If I tile terminator to the left win win-left, the windows decoration disappears, and it appears again if I restore it, with this lua script windows decoration remain visible

And finally to make it autostart I created the following file at ~/.config/autostart/devilspie2.desktop

[Desktop Entry]
Name="devilspie2"
GenericName="devilspie2"
Comment="devilspie2 process"
Exec=/usr/bin/devilspie2
Terminal=false
Type=Application
X-Gnome-Autostart=true


Trying to share a folder with host and guest in Virt - manager / KVM

You can get your IP with

ip addr

You will need to add the directories you want to share in the /etc/samba/smb.conf directory.

I'm not sure how you're planning on sharing your drives with guest or user auth. But the samba wiki might be a good place to start.


PCIe Ethernet Controller that works with 11.04?

Canonical have put out a list of certified hardware for Ubuntu 10.04, 10.10 & 11.04

This also includes network cards.  Have a look through this list for PCI-Express cards to find one that fits your budget and requirement.


Ubuntu crontab runs skript but it doesn't work

Never mind actually I got it working SOMEHOW, but now it run a bugged version of both the discord bot and the server, so I have to do some more troubleshooting now apparently...


Is there any way to create a LXDE customized panel as a launcher?

I would suggest running Cairo because it had the most configurations available. I run Lubuntu 12.10 with xcompmgrm manager enabled and have no issues with work-flow. I can run multi panels and choose which lunchers I want.

Easy to install just open synaptic and choose cairo-dock. It will supply the correct dependencies and you are off and running.


Backup all databases with a character set:

mysqldump --all-databases \
          --add-drop-database \
          --add-drop-table \
          --default-character-set=utf8 \
          --user=myuser \
          --password=mypass \
          > youfile.sql

on older mysql use the latin1 character set.


What is the difference between Vi and Vim?

Functionally, vim is almost a proper superset of vi. Therefore, everything that is in vi is available in vim.

Vim adds onto those features. Here are a some of the extended vim features:

Vim has been ported to a much wider range of OS's than vi.
Vim includes support (syntax highlighting, code folding, etc) for several popular programming languages (C/C++, Python, Perl, shell, etc).
Vim integrates with cscope.
Vim can be used to edit files using network protocols like SSH and HTTP.
Vim includes multilevel undo/redo.
Vim allows the screen to be split for editing multiple files.
Vim can edit files inside a compressed archive (gzip, zip, tar, etc).
Vim includes a built in diff for comparing files (vimdiff).
Vim includes support for plugins, and finer control over config and startup files.
Vim can be scripted with vimscript, or with an external scripting language (e.g. python, perl, shell).

There are many more differences. Refer below sources which are few of good places to start finding out more.

Source: Vim.Org, Vim on Wikpedia.

Hope it helps! :)


Remapping Caps Lock in 14.04 Trusty Tahr

You should edit the file /etc/default/keyboard
and modify the XKBOPTIONS setting.

For example to map capslock to control set XKBOPTIONS=“ctrl:nocaps” (source: Archlinux wiki

log out and log in again for changes to impact your system.


From my understanding the answer is no. This is an excerpt to explain this:

Device nodes of the same type (block or character) with the same major number use the same driver.
The minor number is used only by the device driver to differentiate between the different devices it may control, or how they are used. These may either be different instances of the same kind of device, (such as the first and second sound card, or hard disk partition) or different modes of operation of a given device (such as different density floppy drive media).

An example:
$ ls -l /dev/sda*
brw-rw---- 1 root disk 8,  0 Dec 29 06:40 /dev/sda
brw-rw---- 1 root disk 8,  1 Dec 29 06:40 /dev/sda1
brw-rw---- 1 root disk 8,  2 Dec 29 06:40 /dev/sda2

Now each is a block device hence they share the same driver, here being 8, but of course the different minor numbers 0, 1, and 2 to differentiate them.


ERROR 1045 (28000) on mysql-server installation

To reset your mysqld password just follow these instructions :

Stop the mysql demon process using this command :

sudo /etc/init.d/mysql stop

Start the mysqld demon process using the --skip-grant-tables option with this command

 sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

Because you are not checking user privs at this point, it's safest to disable networking. In Dapper, /usr/bin/mysqld... did not work. However, mysqld --skip-grant-tables did.

start the mysql client process using this command

mysql -u root

from the mysql prompt execute this command to be able to change any password

 FLUSH PRIVILEGES;

Then reset/update your password

SET PASSWORD FOR root@'localhost' = PASSWORD('password');

If you have a mysql root account that can connect from everywhere, you should also do:

UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';

Alternate Method:

   USE mysql
   UPDATE user SET Password = PASSWORD('newpwd')
   WHERE Host = 'localhost' AND User = 'root';

once have received a message indicating a successful query (one or more rows affected), flush privileges:

FLUSH PRIVILEGES;

Then stop the mysqld process and relaunch it with the classical way:

sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start

There is another way using "Purge" given in link

Source


Those errors suggest that the graphics driver (in this case the native Nouveau driver) is causing the kernel (NMI) watchdog to throw those stuck messages.

You might want to try temporarily disabling the driver, or choosing a different driver (either different release or an Nvidia driver). I'd opt for the former to try to exempt the graphics driver from the problem entirely.

I should add that I run Ubuntu 17.10 on an XPS 15 (9560), and I'm pretty sure you have an onboard Intel HD Graphics chipset, so you might want to get spun up on that first, and then introduce the Nvidia driver when your system is stable.


MMA9 Pythonika compiling error on Ubuntu 14.04

I have succeeded in compiling pythonika on Ubuntu 14.04.
I need to add -lpthread -lm to the command line.

##     Ununtu 14.04
LIBS = -L${LIBDIR} ${LIBDIR}/libML64i3.a -lstdc++ -lpthread -lm -lrt -lpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}

Thanks,
Yoshihiro Sato


Ubuntu 14.04 Login Loop from running startx in root

You could maybe enter this from dropshell:

 linux64
 grub-install
 update-grub
 update-grub2
 efibootmgr

and then from tty enter this:

 sudo apt-get update
 sudo apt-get install --reinstall ubuntu-desktop

and then enter in tty:

 sudo apt-get upgrade
 reboot

and it might work fine this way.


Ubuntu 12.04 always hang when progressing installation on IBM T23

Besides MD5 testing the .iso image file you downloaded (as Mitch suggested), you should also check the CD/DVD or live USB you made, using the built-in facility.


Ubuntu 16.04 Server Permission denied(publickey,password). via ssh connection

I assume that you are trying to exchange keys but can't log in to do so?  I recommend using 'ssh -v' or even 'ssh -v -v -v' to get more information about what is failing.

Setting

PermitRootLogin yes

in /etc/ssh/sshd_config should do it.  And don't forget to restart the ssh server:

sudo service ssh restart


Run last command with all the letters transformed to lowercase

You can accomplish that by adding the following small function (I call it ?? to be very simple, but you can change this as you wish) in your .bashrc file:

?? () { "${@,,}"; }

Next, when you will run:

?? !!

the last command will be run with all the letters to lowercase.

Explanation

!! :  this is part of bash's history tools, specifically, it expands to the last command run. So, for example, echo !! will print out the last command run in this particular shell session.
"${@,,} : The construct ${foo,,} will convert the contents of the variable $foo converted to all lowercase letters. $@ is the array of positional parameters.  When used inside a function, it is expanded to the parameters passed to that function.

So, "${@,,}" will simply convert whatever was passed to the function into lowercase and then execute it. Therefore, running the ?? function with !! as a parameter will convert the last command to lowercase and run it.


The little search thing wont work anymore

Open the dash and click "Filter results". Make sure that things you want to search for are checked. Then make sure that you are on the home lens.

You might also want to disable online results. Open System Settings -> Security and Privacy -> Search.

That should solve your problem.


No scrolling with Wacom Bamboo on Ubuntu 13.04

I was able to fix the hover click by setting the property TabletPCButton to 'on'.

This can be done using xsetwacom device_name TabletPCButton on (note that xsetwacom is only runtime changes, so a script with the xsetwacom has to be run on startup).

The scrolling can be enabled Ubuntu wide (not only in the browser), by installing EasyStroke and configuring it to recognize the scroll movement and map it to a scroll movement.

This has also worked for me in Ubuntu 13.10 and 14.04.


Issue in moving windows from one desktop to another with the compiz cube

To move a window from one cube-face (desktop) use the right mouse button on windows title bar. (clicl-click-zoom   ⁛  ⁙ ⁘ ‧)

To switch windows use the "window buttons" on a panel ( I like the lower panel for this )

Consider getting the Compiz Fusion Icon and starting it up when starting your session.  It's extremely useful - note that it is invoked with the right mouse button when on the panel.

I use comiz cube and 3D windows in my work and have for a coupla years.  Their documentation is now much better, see it here.

I set cube face opacity during rotation to about 10 or 20, make the cube caps transparent and enable skydome to a muted gradient - with 3D windows this is very helpful in finding the right window.

Here's my desktop (without gradient skydome)


Correctly packaging for /opt with dh_make

The packaging produced by dh_make should just be considered a starting point. In all but the most straight forward cases, you'll need to edit some of the files. In order to install to /opt, you'll need to set an install prefix. Assuming that you are using an autotools build system, your debian/rules file might look like:

#!/usr/bin/make -f

%:
    dh $@ --with cli

override_dh_auto_configure:
    dh_auto_configure -- --prefix=/opt/my_program


It's there for windows which support it:

$ xprop -id 0x0540019c| grep _NET_WM_PID
_NET_WM_PID(CARDINAL) = 25685

But not all do:

$ xprop -id 0x2000006| grep _NET_WM_PID
$

As far as I know there is no way to access the PID for such a window.


Nvidia Ion Asus Eee PC Seashell series 1215n and Optimus

Got the several desktop managers working again:

sudo apt-get install --reinstall  nvidia-346 nvidia-settings nvidia-prime
sudo nvidia-settings

Check intel power saving mode.
Save and write/overwrite config.
Restart.
Lightdm is working now.
I think it was a problem with xorg configuration.
Althought my Question was only involving desktop managers like gdm lightdm, i think i haven't fixed any hardware acceleration.
But i got what i needed.
Hope this helps.


Follow this link on kdevelop package in Ubuntu and use this repository:

PPA for Andreas Roth

There, however, a large number of packages is provided. Be careful what you install or are upgrading.

sudo apt-add-repository ppa:aroth/ppa


Laptop-mode-tools or tlp is needed to be installed to optimise your laptop battery. Please note it should be either of the two. Hope it helps.

Linux usually fail to match Windows battery management due to lack of proprietary driver support, we have to rely on open source drivers in many cases.


Messed up libc 2.17 and libc 2.15 dependency error on 12.04LTS

Don't bother with trying to install 2.17.

You need to re-install the specific versions of the libraries from 12.04 to fix the issue. Do the following:

sudo apt-get install --reinstall libc6=2.15-0ubuntu10.12 libc6-dev=2.15-0ubuntu10.12
sudo apt-get -f install

This should resolve the issue.


System won't suspend after upgrading to 14.04

Had the same problem updating 13.10 server to 14.04.

Did you do a grub update after updating? I had a parameter in my grub that was "usbcore.autosuspend=-1"

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash xbmc=autostart,noredir usbcore.autosuspend=-1"

And somehow the grub wasnt updated even though nothing was changed. After doing a  sudo update-grub it suspended fine.


Looking for an Open Source Project Management system supporting notifications

There are various options, but I would recommend you to go with Redmine.

  Redmine is a flexible project management web application. Written
  using the Ruby on Rails framework, it is cross-platform and
  cross-database.

  Redmine is open source and released under the terms of the GNU General
  Public License v2 (GPL).

It has the features you request and is very scalable, it can easily cope with large organisations and multiple projects, but is largely seamless for small teams. Some of the features that might interest you:

Gantt chart and calendar
Feeds & email notifications
Time tracking
Multiple databases support


Software center and update manager not working

Here is one method to allow for installing untrusted 3rd party software.

From a command line, run sudo apt-get update

At the end of the command output, you will see an error similar to the following message:

W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6AF0E1940624A220

Copy the alpha-numeric string following the NO_PUBKEY message. In this case, it will be 6AF0E1940624A220

Next, enter the following command, using the alpha-numeric string copied from the above-mentioned error message:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220

This will load the applications public key into your list of 'trusted' sources.

After running this command, you should be able to install updates from the software center.


The message Expecting: TRUSTED CERTIFICATE indicates a problem with the certificate file at ("/home/pz/piotrzak.design.chained.crt")

The fact that your crt file has 'chained' in the name looks like the problem.

I suggest changing the file name from crt to pem, and see if NGINX likes that better.

If that fails, does your chained file contain only the public certificate and the intermediate certificate? If not, I would try a pem with only those two certs.


terminal window disappears after I minimize it

Unfortunately you caught a bug while installing it. You will need to reinstall it or attempt to reinstall terminal. But before doing any of that restart your computer and then make sure that everything is updated on your system. You can also try doing this.

CTRL+ALT+F1
Unity -- replace &
CTRL+ALT+F7
CTRL+ALT+T
unity

In that order. It basically resets Unity.
To remove Terminal and attempt to reinstall. Open Software center and search terminal. Choose the installed terminal and uninstall. Reboot. Then install from software center again.

Very Respectfully,

Matthew Kaulfers


While there might be several possibilities, I suggest we first look at a few of the most likely candidates. If Network Manager is using dnsmasq, as is the default, then /etc/resolv.conf ought to read:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1

Let's check:

cat /etc/NetworkManager/NetworkManager.conf

The default configuration is:

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false

As you can see, dnsmasq is enabled. If it is not on your system, we will edit the file to correct it.

Next, click the Network Manager icon, select Edit Connections > Wi-Fi > your_network > IPv4 settings. Be certain that the Method is Automatic (DHCP).

Next, let's edit /etc/resolv.conf:

gksudo gedit /etc/resolv.conf

Use nano or kate or leafpad if you don't have the text editor gedit. Change the file to read:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1

Proofread carefully, save and close the text editor. Finally, restart NM:

sudo service network-manager restart

Test:

ping -c3 www.ubuntu.com


How do I locate and remove Proprietary Drivers

The answer depends on which version of Ubuntu are you running:

In 12.04 and below search for the application called "Additional
Drivers"
In 12.10 it is a tab in "Software Sources".

From there you can remove the drivers you don't need. After a reboot, all open source drivers will be restored and "problematic packages" will be removed.


Using sed to replace multi-line strings in apache2.conf file

sed by default operates on each line separately, thus you cannot use \n. If you want to operate on multiple lines, you can use the -z flag, which separates the lines by NUL characters and allows the use of \n.
Also, you don't have to pipe cat's output to sed, since sed can read files by itself.
Furthermore, it is not mandatory to use / as delimiter in your sed command, as sed accepts other delimiters too. Using a different delimiter in your case has the benefit of not having to escape every / using a backslash (\).
So the command you need to run is:
sed -z 's|<Directory /var/www>\n\tOptions Indexes FollowSymLinks|<Directory /var/www>\n\tOptions -Indexes -FollowSymLinks -ExecCGI|' /etc/apache2/apache2.conf

Notice that in the above command I used \t as a tab character. However, not all versions of sed accept \t as a tab character. If the above command does not work for you, you can replace \t by a literal tab in your terminal by pressing Ctrl+V and then hitting Tab, or use another method from this Stack Overflow question: Why is sed not recognizing \t as a tab?


i would back up my files first.

then i would install the newest version off ubuntu.
click here for how to to that.  check the first post.

you can do this  by cd/dvd or usb i would use usb option because it can be faster most of the times.
here is how to create bootable usb on ubuntu click here

PS. sorry for the bad english writing.


Why does sytemd-analyze underreports boot time?

Not sure, but systemd-analyze records time until the default target has been reached which is graphical.target.

You can look at systemd-analyze critical-chain output to make this apparent.

This certainly means it records time until lightdm (or your dm) has been launched and not after. Which means it did not take into account the 3s that unity needs to open your session (I'm guessing you are using auto-login).


It's  required to disable Nvidia Optimus feature in BIOS. In my case it fixed the problem. I see that your ASUS laptop also has got the feature. So it should help you


Bash file for sending a signal to a process

This one should do what you expect

#!/usr/bin/env bash
if [ $# -eq 0 ]; then
    echo "No arguments supplied";
else # at least the process name was passed ($1)
    num=$(pgrep -c -x "$1");
    if [ "$num" -gt 1 ]; then # more than one process found
        pidof "$1"
    elif [ "$num" -lt 1 ]; then
        echo "Warning: the program doesn't have any processes";
    else
        signal=SIGINT # default signal
        if [ $# -ge 2 ]; then # signal provided, use it
            signal=$2
        fi

        pr=$(pidof "$1")
        kill -"$signal" "$pr"
    fi
fi


How to access my Android's files using Wi-Fi in Ubuntu?

There is a free application on the Google Play store called Software Data Cable:

Once you've installed it, turn on your WiFi connection and launch the app.

Tap on the "start service" button.

It creates a FTP server on the android device that lets you connect from any computer by opening the resource:

ftp://192.168.1.xxx:8888

where 192.168.1.xxx is the IP address of your device.

You can now copy/paste files over WiFi from/to your android device.

PS - on ubuntu 18.04 get into nautilus and hit + Other Locations then at bottom enter ftp URL above into Connect to Server


There must be some error with the liveCD.  As suggested by @psusi, you should check the disk.  If there's an error, you may want to replace it before using it for anything else.  And it's a good idea to check the ISO before burning.

Originally, I had thought that sudo was not required since there's no password, but I found that this is not the case.  Programs like gparted, that normally prompt for a password, will run from the menu without prompting; but commandline programs still require sudo, although they don't prompt for a password.

But you should be aware that update-grub would not be the correct method to fix this in any case; it simply generates the menu configuration file (/boot/grub/grub.cfg) in the partition that the GRUB MBR code reads (in this case, the CD, which can't even be written).  In your case, the GRUB code is not in the MBR, so it is not being run; therefore, it never reads the menu configuration file.

What you need to use is grub-install to fix your problem, which is a bit more complex, and requires mounting the disk.  It may be easier for you to use the boot repair disk  .  This disk will automatically fix this problem.

In order to actually put GRUB on the MBR, you need to run grub-install, specifying which directory to use for grub.cfg (it will default to /boot/grub/grub.cfg), and specifying the disk for the MBR code, such as sudo grub-install --root-directory = /media/sda2 /dev/sda; assuming /dev/sda2 is mounted at /media.  The main point is that the partition must be mounted to have grub.cfg installed.

The syntax for grub-install is basically:

sudo grub-install < mounted location of grub.cfg > < name of disk MBR for GRUB itself >

So, in my example it assumes /dev/sda2 is mounted at /media/sda2, and will put grub.cfg in /media/sda2/boot/grub.


How do I group /etc/passwd and /etc/shadow file content into new file by username?

You could use the join utility

sudo bash -c 'join -t: <(sort -t: -k1,1 /etc/shadow) <(sort -t: -k1,1 /etc/passwd)'


How to close GNOME Terminal search window shortcut key?

and if the Esc won't work for you, you can always use Alt+F4


Where's the settings/preferences in Cheese photo booth?

You just need to move your mouse to the upper left corner of your screen to reveal the Cheese Menu:

Then open the Preferences to select your device:


Apache (and other services) work on localhost, but not IP address

Please check your Security Group on Amazon EC2 and if there is no rule for 443 port, add one.


What accounts for the differing instructions on setting password for postgres?

There is no real difference between the two methods. User/login roles and passwords are stored server-wide and not database-wide. In other words, the password is for connecting to the server, so it doesn't matter which database you connect to. The command

sudo -u postgres psql template1 (Thanks to Daniel Vérité for the comment)

in effect tells the system to switch to user postgres and run the CLI client (psql) to connect to the server and use the "template1" database. If no user and/or database name is specified, then psql tries to connect as the current user and "to use" a database with the same name as the current user (postgres in this case - which makes the "template" parameter superfluous)

This is what the above command is doing step by step:

sudo -u postgres This switches to the postgres user. Notice the absence of the -p parameter from sudo. This is essential, because the "os user postgres" (who has no password and his sole purpose is to own the running server processes) is different from "database user postgres" (who is the database root user or rather the database administrator and absolutely needs a password.)

psql --username=postgres --database=template1 This connects to localhost using database username postgres and database template1.

For your purpose, this line can be abbreviated to

sudo -u postgres psql

ALTER USER postgres with encrypted password 'your_password';

This will change to user postgres and connect to localhost as user postgres to the database named postgres and then set the password.

If you need further clarification please ask. I'll be happy to help.

A brief note on template databases. When creating a new database, postgres uses a template named template1. This is something like the skeleton file used to set user default when creating user accounts in linux. It is usually modified by the dba to make sure certain tools and behaviors are enforced server-wide. But why the 1 you may ask. Well, there is another template database named template0 and it is a protected "clean slate" copy of template1 just in case something goes south with it. Here is a wiki page describing such a scenario.


i also had same problem on Ubuntu 14.04, i figured out there is another service listening on port 21

# netstat -ltnp | grep ':21'

it shows:

tcp    0      0 0.0.0.0:21  0.0.0.0:*    LISTEN      1956/pure-ftpd (SER
tcp6   0      0 :::21       :::*         LISTEN      1956/pure-ftpd (SER

stop pure-ftpd service by:

#service pure-ftpd stop

then i manage to remove vsftpd with --purge option

#apt-get remove --purge vsftpd

then install it again

#apt-get install vsftpd

and now vsftpd runs great

#ps ax grep vsftpd
6914 ?        Ss     0:00 /usr/sbin/vsftpd
7942 pts/4    S+     0:00 grep --color=auto vsftpd


Adjust volume change step in Ubuntu 18.04

I know that the original question asks about 18.04, but in 20.04 there is now a setting for this:
dconf write /org/gnome/settings-daemon/plugins/media-keys/volume-step 2

Replace 2 with your desired step value.
Reference: https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/871133


HELP I changed permissions nothing works and I got locket out

You need to change the ownership of each file back to the way it was. Basically from what I understand from the man pages is that you made every symbolic linked file to the user group 'root'. The problem where it occurred was when you did the /. because that just means you did the chown recursively in the root folder. You will have to go back through each link to set it with the right ownership.

Good luck!


How to change the command of the application launcher in Docky?

According to Robert Dyer (here), you should change the launcher at the main menu and then drag it to Docky because the launcher at Docky can't be configured directly.


Problem installing Ubuntu on Several computers

You're on the right track with UNetbootin. The live USB is a better way of storing data than burning a CD/DVD.

The md5 checksum hash is used for file verification. The Ubuntu Documentation UbuntuHashes wiki contains all of the md5 Hashes for the different versions of Ubuntu. Let's assume that you downloaded a file called FILE.iso to your Downloads folder on a Mac computer, and you want to find its md5 checksum. To find the md5 checksum of a file called FILE.iso on a Mac, open the terminal and type:

cd ~/Downloads
md5 FILE.iso


How to start lightdm services at startup

First run this command for a graphical environment

sudo systemctl set-default graphical.target

Because you have used sudo systemctl set-default multi-user.target before.

Then repair the entries in /etc/default/grub

This statement is completely wrong:

GRUB_DEFAULT="quiet splash"

Open the configuration:

sudo nano /etc/default/grub

and replace the entry

GRUB_DEFAULT="quiet splash"

with

GRUB_DEFAULT=0

add the entry

GRUB_CMDLINE_LINUX="quiet splash"

After that run

sudo update-grub

GRUB_DEFAULT

The default menu entry. This may be a number, in which case it identifies the Nth entry in the generated menu counted from zero, or the title of a menu entry, or the special string ‘saved’. Using the title may be useful if you want to set a menu entry as the default even though there may be a variable number of entries before it.
GRUB_CMDLINE_LINUX

Command-line arguments to add to menu entries for the Linux kernel.
GRUB_CMDLINE_LINUX_DEFAULT

Unless ‘GRUB_DISABLE_RECOVERY’ is set to ‘true’, two menu entries will be generated for each Linux kernel: one default entry and one entry for recovery mode. This option lists command-line arguments to add only to the default menu entry, after those listed in ‘GRUB_CMDLINE_LINUX’.

Source


Add flag as a label in the keyboard layout switcher, for layouts that do not have flags stored

Copy your flag (flag.png) in the following directory.

/usr/share/kf5/locale/countries/eu/

Τhe eu subdirectory has to be created. You do not need to create a complete locale file.

the result looks like this:

Checked on KUbuntu 18.04 to 19.10.


There is no python-xml package in the repository. What made you decide you need a package with that specific name? Are you looking for python-lxml instead? This is the common Python XML library that I believe most people use.


We've got documentation on the wiki pages that describe how to add a new language to Ubuntu. In a nutshell:

Choose the name of the locale. The format is language_REGION@modifier, where language is an ISO 639-2 two-letter code (or the three-letter one if the former is not available), REGION is an ISO 3166 code representing the region where this language is spoken, and modifier has no set syntax and can be used to specify advanced uses for the locale (e.g. a different script). Most locales will not need a modifier.

Examples: bn_ID is the locale for Bengali in India, it_CH is the locale for Italian in Switzerland.

Create a file with that name. Once the name has been chosen, you'll have to create a file with that name, which will contain the definition of your locale. Note that if your language is spoken in different regions, you might have to create different files, one for each region.

Example: ca_AD, ca_ES, ca_FR, ca_IT are locale definitions for the Catalan language as spoken in the regions of Andorra, Spain, France and Italy.

Define the locale. At this point you'll have to populate the file with the definition of your language. Locale definition files have got a specific syntax. Consult the additional resources below to learn about this syntax and how to define the new locale. Looking through the available locale files in the glibc sources can be helpful to get an idea of the format. Also remember to reuse: use the copy statement to include sections from locales with identical content.

Test the locale definition. Once your locale file or files are ready, you should test them locally to ensure they are correct. The basic steps are:

copying the file to /usr/local/share/i18n/locales/,

running the following command to generate a binary file to be used by applications, and doing the actual test.
  localedef -i inputfile -c -f <charset> <locale>

Example (testing the Asturian locale with the date command):
 cp ast_ES /usr/local/share/i18n/locales/ast_ES
 localedef -i ast_ES -c -f ISO-8859-15 ast_ES
 LANG=ast_ES date

Additional resources on creating a glibc locale:

IBM Locale Definition document
Available locale files in the glibc sources (click on the blob link to see the contents of the file)
Tips on writing a glibc locale file
Glibc Documentation on localedef
Translate Toolkit project documentation
Examples:
Submission of the Pashto locale
Submission of the Chuvash locale


Logitech K800 keyboard has non-functioning keys

I had a similar problem with my k800 keyboard today. My i key wasn't working.

I disassembled the keyboard to discover that there was a lot of dirt and dust in it. I also noticed that under the key tab there's a little soft part that make a contact while pressed.  Under this soft transparent rubber part there a little electrical contact and it was dirty.

So I removed the two little white brackets clipped under the key cap around the soft rubber part. I de-clipped them gently. Then I cleaned the area of the key with a small child's paintbrush and my vacuum hose close to it to remove the dust. Then I use 99% isopropyl alcohol and the little paintbrush to clean the electrical contact under the rubber part. I also put some more alcohol over the soft rubber part and pressed it several times. After that I reassembled the keyboard and the i key was fixed.


Gparted won't let me resize an EXT4 partition

Unlike NTFS partitions, EXT4 partitions cannot be "hot-resized". This means you cannot resize the partition while you are booted from it.

You will need to boot from a live USB stick or DVD to resize it.

Once you have done that, open Gparted, and right-click on your main partition. Select Resize/Move from the context menu.

From that screen, you can enter a new size for the partition in MB.
Since you want to make a 200GB partition for Ubuntu, you will need to enter the new size as the current size in MB, minus 204800. Once you have done that, click the Resize/Move on that same screen.

You will then need to click the Apply All Operations (the green check mark) button on the main screen.

Once the operation completes, you should have some unallocated space after your main EXT4 partition.

During the Ubuntu installation, make sure to select the Something Else button on the "Where do you want to install Ubuntu?" screen. Format the unallocated space as EXT4, and set it's mount point as /.
Finally, make sure to set the location for the installation of GRUB as /dev/nvme0n1.
Then you can proceed with the installation as normal.


How to create a bash listener with netcat in Ubuntu?

Ports 1-1023 are "privileged", in that they may be used only by the root (UID=0) processes. Your example was probably assuming root.
Try -p 1666. Or, sudo, if you want to export a root shell..


Best software for Android Device On Ubuntu?

Can be use gMTP.

More info on Ubuntu Apps:
https://apps.ubuntu.com/cat/applications/saucy/gmtp/

*Note that you have to turn on the option to use mtp transfer on you android confi storage section.


Try to boot into your BIOS.  Look under boot order or something similar.  Your computer must support boot to USB.  If you don't see this option under the BIOS boot order - your out of luck.

Best,
Tim


Ubuntu 20.04 LTS (Server) - Rerun Installer Network Setup

A little more poking and help from a friend and we figured it out.
Although I had tried editing the /etc/netplan/00-installer-config.yaml file, I didn't know I had to run $ sudo netplan apply before it would take effect.
So the solution in summary is as follows:

Open /etc/netplan/00-installer-config.yaml:

$ sudo nano /etc/netplan/00-installer-config.yaml

Edit the file to read as follows:

#This is the network config written by 'subiquity'
network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2

Exit (Ctrl+X) and save (Write buffer? Y, Enter).

Now apply the configuration:

$sudo netplan apply

Restart.

$ shutdown -r +0
On restart, ip a will show a working eth0 connection and ping 8.8.8.8 works!


From what research I've done on this (and there's not much out there to look at in terms of eopkg resources that are not Solus OS-centric), eopkg seems to be a Solus OS specific package manager.  It does not work with Debian style .deb packages, nor does it work with RHEL-style .rpm packages, and is not available in Ubuntu.

There does not seem to be any specific upstream project that I can find which has eopkg, and it seems to be Solus OS-specific.  I do not believe that you can install eopkg in Ubuntu (and I can't say if it even compiles properly in an Ubuntu environment, because the source code doesn't seem to be published on GitHub anywhere), so if your application / applet is dependent on eopkg, then it's likely a Solus OS-only application/applet and will not work with Ubuntu.


Build failed LaunchPad "Dependency wait on lgw01-31"

The problem is that you are attempting to build the package for Trusty (Ubuntu 14.04), but your control file requires a newer version of gawk than is currently available for Trusty:

the latest version of gawk available for Trusty is 1:4.0.1+dfsg-2.1ubuntu2
your control file is requesting a version >= 1:4.1.1+dfsg-1

The solution is to either change your control file to require an earlier version (assuming you aren't depending on a feature introduced in a later version) or backport the newer gawk version.


Use Ubuntu server (16.04) for MacOS High Sierra TimeMachine backups

[Updated answer]

  On disks formatted with APFS in MacOS 10.13 High Sierra, files can't be shared over AFP anymore [...]

This is a popular misconception - you can back up an APFS volume to a Time Machine using AFP via Netatalk. Confusion stems from ambiguous wording on https://support.apple.com/en-gb/HT208018 :

  Any Time Machine share points must be shared over SMB instead of AFP. [emphasis added]

This caught out a number of people (including me). The HT208018 support article is trying to say: you can't do fileserving of files from an APFS volume to other Macs using AFP and further, you can't use a Mac APFS volume as the destination for a Time Machine backup (see https://apple.stackexchange.com/a/299720 for a detailed explanation).

Having said all the above, you can also use Time Machine with an SMB server (such as Samba) if the SMB server advertises the correct options (see below). At the time of writing (1 Oct 2017) you're in for a mildly rocky ride when trying to use Samba because you have to do a custom compile of Samba in the near-term (it will likely be next year that an appropriate pre-built Samba turns up by default in the periodic release Linux distributions).

[Update 2]

The patches have gone in and will likely be part of the Samba 4.8 release (currently that future release is too new to have a date on https://wiki.samba.org/index.php/Samba_Release_Planning ).

[Update 3]

The changes are now part of Samba 4.8 and above.

[Original text below]

The short of it is keep an eye on https://github.com/samba-team/samba/pull/64 and the mailing list thread related to it over on https://lists.samba.org/archive/samba-technical/2017-September/thread.html#122882 because something like it will have to go in for Time Machine to work with Samba without extra manual configuration on the Mac.

It's unclear how much Apple care about Samba these days (which started occurring when they stopped shipping it with MacOS after the Samba project switched to be GPLv3) so I'm afraid delays are to be expected. Let's see how it goes - kevinanderson1, omor1 and Ralph seem to be making progress so good luck to them!


When you are logged in:

Go to Network menu in the panel.
Navigate to "Edit connections".
When that window opens, select "Auto eth0", and press "Edit" (This assumes that you are connected to the Internet on some other port, for example wlan0 using wireless).
A new window will open. Navigate to the tab titled "IPv4 Settings", and change the Method to "Shared to other computers".

After restarting the computer, you should now be able to plug in any computer into your other Ethernet port or share through your wireless card.


Since your model isn't supported in the official list then I suggest you try an older version that is supported like 10.10 or 10.04 LTS.

it would make it easier to help you more if we knew the exact model.

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

I would guess from your tips that your model is Aspire One 532h.


Issue with dir is other-writeable but not sticky (blue text, green background on all directories)

This is perfectly normal on drives formatted with NTFS, since NTFS does not support Unix-style permissions (and as such, trying to change the permissions of a file or directory on that drive will do nothing), and Ubuntu, by default, sets the permissions of NTFS mountpoints to 777. However, you can set the permissions manually at mount time with the umask option:

sudo umount /dev/your_usb_stick
sudo mount -o umask=002 /dev/your_usb_stick /path/to/mountpoint

Note that the value for umask is actually the inverse of the permissions you want; this will set the permissions to 775.

Also, with default LS_COLORS at least, a green background for directories isn't changed by setting the sticky bit; the only way you can get rid of it is to make the directory not be other-writable.

Bottom line: If your drive is formatted with NTFS, try mounting it with the option umask=002. If it's formatted with ext2/3/4, try running chmod o-w on the directories that are green.


How can I assign variables from file into a bash script and write a specific loop for it?

Assuming a.file contains your data:
while IFS=, read var1 var2 var3; do
    msg="""\
To $var1
You need to buy $var2
From $var3
"""
    echo "$msg"
done < a.file

$IFS is the character that separates your words
read is a builtin shell function that reads a line of input, split it into words and assigns them to the given variables.


Ubuntu 18.04: Printer not working for most apps (PDF, evince, Firefox...)

I got it solved as follows:

Reinstall hplip

sudo apt-get purge hplip
sudo apt-get install hplip

and
add a second network printer. (Note that I had manually installed the newest hplip version in order to get the printer running which did not help and resulted in an error message after bootup, if you did not do this, maybe just step 2 is enough.)

Even though there is a printer already shown in "Settings / Devices / Printers", I had to add a second printer as follows:

Go to Settings → Devices → Printers.
Additional Printer Settings
Add Network Printer
Choose the shown IP address or own printer name and follow the dialogues.

It now works for me. In the Settings → Devices → Printers tab there are now 2 printers shown.


Xbacklight won't help to change brightness in lubuntu

You should set the brightness from /sys/class/backlight/intel_backlight/brightness file, see my answer in: i3wm, adjust brightness through command line


Synchronising Ubuntu 20.04 across multiple machines

To give you a quick rundown:

Syncthing I'm not sure about.
rsync is like a beefed up scp. You'll need to write a script or cron job using rsync if you want the synchronization to be automatic.
unison is great if you have the same OS and OS version on the machines you're syncing. It's critical that the same version of unison be used on each machine. This is like an even more beefed up version of scp, so you'll need one of your machines running unison as a daemon and able to access the other one via ssh. It works better if you have a third central server, like a backup server, that each computer stays in sync with.

Searching around for "keeping linux computers in sync" there are a ton of other tools for this too.


You could try playing around with AutoFS. It will let you set the NFS shares and it'll handle mounting them on demand. It's a pretty good system once it's up and running but that's not to say you won't have issues.

One thing that is apparent to me is Banshee might struggle with a library that keeps expanding and contracting as AutoFS connects and disconnects. It might have the net effect of removing half your library and then needing to re-add it. If this happens, you might lose library-specific data (eg playcounts, ratings, etc). It might not have this problem though. I haven't tested it.


Damaged swap partition - How and what to do?

Just a shoot in the dark, but IMHO your swap partition isn't damaged at all. I've already seen discrepancies between fdisk and gparted and, it's sad to say, but fdisk is almost always right.

Try a:

#> cat /proc/meminfo | grep -i swap
SwapCached:        10632 kB
SwapTotal:       2094076 kB
SwapFree:        2053324 kB

you should see that your swap space is actually in use (or at least I hope so).

The explaination for that "unreadable" /dev/mapper/cryptswap1 partition is that cryptswap1 is actually a mapped encrypted swapspace, so it should be fine that no one can understand what's in there. If you want to disable it, you can look at this thread: How to disable cryptswap?

Last but not least, your SMART status: at first sight (just watching the read error rate and the seek error rate), I'd have said that your drive was about to melt down. But, no, it's fine, I have a drive whose SMART says exactly the same. I'll post the full output just for reference (both for me and others) for future visits.

#> sudo smartctl --all /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-24-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.12
Device Model:     ST3250318AS
Serial Number:    9VM2R3AN
LU WWN Device Id: 5 000c50 015aa8d47
Firmware Version: CC35
User Capacity:    250,059,350,016 bytes [250 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Sun May 27 18:03:03 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                    was completed without error.
                    Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever
                    been run.
Total time to complete Offline
data collection:        (  617) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine
recommended polling time:    (   1) minutes.
Extended self-test routine
recommended polling time:    (  52) minutes.
Conveyance self-test routine
recommended polling time:    (   2) minutes.
SCT capabilities:          (0x103f) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   118   099   006    Pre-fail  Always       -       196559365
  3 Spin_Up_Time            0x0003   097   097   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       320
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   067   060   030    Pre-fail  Always       -       6277671
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       517
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       158
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   099   000    Old_age   Always       -       41
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   065   065   045    Old_age   Always       -       35 (Min/Max 21/35)
194 Temperature_Celsius     0x0022   035   040   000    Old_age   Always       -       35 (0 12 0 0)
195 Hardware_ECC_Recovered  0x001a   052   045   000    Old_age   Always       -       196559365
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       72748156060552
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       968998393
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       939693204

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

And I have another drive that looks more "normal":

#> sudo smartctl --all /dev/sdc
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.0.6-gentoo-goomba-test-3]
(local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Green (Adv. Format)
Device Model:     WDC WD20EARS-00MVWB0
Serial Number:    WD-WCAZA2437330
LU WWN Device Id: 5 0014ee 205473c89
Firmware Version: 51.0AB51
User Capacity:    2,000,398,934,016 bytes [2,00 TB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Sun May 27 18:16:09 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x84) Offline data collection activity
                    was suspended by an interrupting
command from host.
                    Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine
completed
                    without error or no self-test has ever
                    been run.
Total time to complete Offline
data collection:        (37500) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off
support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 255) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x3035) SCT Status supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED
WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always  -       0
  3 Spin_Up_Time            0x0027   253   253   021    Pre-fail  Always  -       1233
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always  -       390
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always  -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always  -       0
  9 Power_On_Hours          0x0032   094   094   000    Old_age   Always  -       4988
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always  -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always  -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always  -       388
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always  -       33
193 Load_Cycle_Count        0x0032   135   135   000    Old_age   Always  -       197801
194 Temperature_Celsius     0x0022   119   109   000    Old_age   Always  -       31
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always  -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always  -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline -       0
199 UDMA_CRC_Error_Count    0x0032   200   199   000    Old_age   Always  -       451
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

And another one with some "real" error, that however is still alive after several months of tiny complaints:

#> sudo smartctl --all /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.0.6-gentoo-goomba-test-3] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Maxtor DiamondMax 20
Device Model:     MAXTOR STM3160211AS
Serial Number:    6PT56QN7
Firmware Version: 3.AAE
User Capacity:    160,041,885,696 bytes [160 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   7
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Sun May 27 18:33:59 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                    was completed without error.
                    Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever
                    been run.
Total time to complete Offline
data collection:        (  430) seconds.
Offline data collection
capabilities:            (0x5b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    No Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine
recommended polling time:    (   1) minutes.
Extended self-test routine
recommended polling time:    (  54) minutes.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   102   087   006    Pre-fail  Always       -       4542948
  3 Spin_Up_Time            0x0003   095   095   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       1011
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       11
  7 Seek_Error_Rate         0x000f   089   060   030    Pre-fail  Always       -       846828717
  9 Power_On_Hours          0x0032   086   086   000    Old_age   Always       -       13126
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       1019
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   064   052   045    Old_age   Always       -       36 (Min/Max 22/37)
194 Temperature_Celsius     0x0022   036   048   000    Old_age   Always       -       36 (0 14 0 0 0)
195 Hardware_ECC_Recovered  0x001a   050   046   000    Old_age   Always       -       11583613
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   169   000    Old_age   Always       -       48
200 Multi_Zone_Error_Rate   0x0000   100   253   000    Old_age   Offline      -       0
202 Data_Address_Mark_Errs  0x0032   100   253   000    Old_age   Always       -       0

SMART Error Log Version: 1
ATA Error Count: 204 (device log contains only the most recent five errors)
    CR = Command Register [HEX]
    FR = Features Register [HEX]
    SC = Sector Count Register [HEX]
    SN = Sector Number Register [HEX]
    CL = Cylinder Low Register [HEX]
    CH = Cylinder High Register [HEX]
    DH = Device/Head Register [HEX]
    DC = Device Command Register [HEX]
    ER = Error register [HEX]
    ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 204 occurred at disk power-on lifetime: 5852 hours (243 days + 20 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 2d 72 00 00 e0  Error: ICRC, ABRT 45 sectors at LBA = 0x00000072 = 114

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 3e 61 00 00 e0 00      00:01:52.203  READ DMA
  27 00 00 00 00 00 e0 00      00:01:52.133  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      00:01:52.125  IDENTIFY DEVICE
  ef 03 42 00 00 00 a0 00      00:01:52.104  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      00:01:46.941  READ NATIVE MAX ADDRESS EXT

Error 203 occurred at disk power-on lifetime: 5852 hours (243 days + 20 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 2d 72 00 00 e0  Error: ICRC, ABRT 45 sectors at LBA = 0x00000072 = 114

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 3e 61 00 00 e0 00      00:01:45.519  READ DMA
  c8 00 02 5f 00 00 e0 00      00:01:45.511  READ DMA
  27 00 00 00 00 00 e0 00      00:01:45.503  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      00:01:45.431  IDENTIFY DEVICE
  ef 03 42 00 00 00 a0 00      00:01:45.423  SET FEATURES [Set transfer mode]

Error 202 occurred at disk power-on lifetime: 5852 hours (243 days + 20 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 00 60 00 00 e0  Error: ICRC, ABRT at LBA = 0x00000060 = 96

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 02 5f 00 00 e0 00      00:01:45.519  READ DMA
  27 00 00 00 00 00 e0 00      00:01:45.511  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      00:01:45.503  IDENTIFY DEVICE
  ef 03 42 00 00 00 a0 00      00:01:45.431  SET FEATURES [Set transfer mode]
  27 00 00 00 00 00 e0 00      00:01:45.423  READ NATIVE MAX ADDRESS EXT

Error 201 occurred at disk power-on lifetime: 5852 hours (243 days + 20 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 00 60 00 00 e0  Error: ICRC, ABRT at LBA = 0x00000060 = 96

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  c8 00 02 5f 00 00 e0 00      00:01:44.035  READ DMA
  25 00 08 af 8a a1 e0 00      00:01:43.980  READ DMA EXT
  27 00 00 00 00 00 e0 00      00:01:43.972  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      00:01:43.968  IDENTIFY DEVICE
  ef 03 42 00 00 00 a0 00      00:01:43.904  SET FEATURES [Set transfer mode]

Error 200 occurred at disk power-on lifetime: 5852 hours (243 days + 20 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 00 b6 8a a1 e0  Error: ICRC, ABRT at LBA = 0x00a18ab6 = 10586806

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 08 af 8a a1 e0 00      00:01:44.035  READ DMA EXT
  25 00 06 41 8a a1 e0 00      00:01:43.980  READ DMA EXT
  27 00 00 00 00 00 e0 00      00:01:43.972  READ NATIVE MAX ADDRESS EXT
  ec 00 00 00 00 00 a0 00      00:01:43.968  IDENTIFY DEVICE
  ef 03 42 00 00 00 a0 00      00:01:43.904  SET FEATURES [Set transfer mode]

SMART Self-test log structure revision number 1

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

For what concerns the read speed benchmark, I think that a speed decrease over time is normal. I suspect that caching mechanisms make the disk appear faster in the initial phase of testing, and slower at the end. However I see that your "worst" read speed is around 80MB/s that is well above my "best average" read speed (around 60MB/s), so I wouldn't worry about this aspect.


After bit searching on net, it turn out compiz config settings are stored in:

$HOME/.config/compiz-1
$HOME/.gconf

Though I'm not sure, you might just want to backup/restore these file supposing it work. Worth a try.

Easiest alternative ways would be export your settings, with profile manager this can be done easily, so we'll save current settings to profile.

Launch CompizConfig.
Go to Preferences in left pane.
On Profile section, press Export to export your compiz settings.
Choose folder where to save your .profile.
Press Save then.

To import, repeat previous steps with Import button, load your .profile files.


How to change keyboard layout to Finnish, but keep language in English?

How to keep the system language in English
First, go to System Settings → Language Support and in Langage tab, apply system wide English:

In Regional Formats apply system wide your favorite English:

Second, go to System Settings → User Accounts and select English as your language:

How to change keyboard layout to Finnish
Go to System Settings → Text Entry and add Finnish keyboard layout:

See also: Keyboard layout switches to English each time I reboot


After upgrading to Ubuntu 13.04, KDE programs don't work any more

I just got around to upgrading my work ubuntu machine, KDE environment would not run but it did complain about starting dbus.  CTRL+ALT+F1 (or any console).

sudo apt-get install qdbus

The update uninstalled the 386 version and installed a new version.  ALT+F7, login with KDE came up just fine after this.


You have an error in this line of /etc/default/grub:

GRUB_CMDLINE_LINUX="" acpi = nolapic

It should be

GRUB_CMDLINE_LINUX="acpi=nolapic"


Why am I getting a black screen when booting VM using qemu?

By default qemu-system-x86_64 does emulation, not virtualization. Emulation is slow and CPU intensive - you can see that by running top, which will show your CPU at close to 100%. I just booted Xubuntu 14.04 using qemu-system-x86_64 on my system, and it took 10 minutes to boot to the desktop. Ubuntu normally hides boot information, which is why you are seeing a black screen (or some other graphical artifacts caused by BIOS changing resolution). If you remove splash quiet and add debug to the kernel parameters you will see what it is doing during this time.

What you probably want to do is to run qemu-system-x86_64 -enable-kvm to enable support for hardware virtualization.

qemu-system-x86_64 -enable-kvm -m 1024 -cdrom /host/iso/ubuntu-13.10-desktop-amd64.iso -name mac -hda ~/ubuntu

From man qemu-system-x86_64:

-enable-kvm
       Enable KVM full virtualization support. This option is only available
       if KVM support is enabled when compiling.

(You might see people recommending the program kvm from the package qemu-kvm. kvm is just a wrapper script that does exec qemu-system-x86_64 -enable-kvm "$@")

KVM uses hardware virtualization rather than simulation, and hence is much faster. It requires a CPU that supports hardware virtualization extensions (VT-x for Intel, or AMD-V for AMD), which most modern PC systems have.

With virtualization, the CPU is actually executing the raw executable binary code from the guest OS. Virtualization is fast, but has the limitation that host OS and guest OS must be binary compatible. With emulation, the binary code of the guest OS is rewritten to run on the host CPU. It is slow, but has the advantage that you can run a guest OS compiled for a different CPU architecture (eg. A QEMU image for Debian armel explains how to run Debian ARM on a PC).

Another popular option for virtualization is VirtualBox.


Can I restore a backup on a different computer than it was made?

Sure. These instructions are for a fresh ubuntu install.

Open Déjà Dup. Search the dash for deja.

Click on the big “Restore” button.

A dialog will appear asking where your backup files are stored (your “Backup location”). Choose “Other…” and navigate to the folder of backups. On this same screen, select whether you encrypted the backup or not. Click “Forward”.

Choose the date you want to restore from. Usually you can just leave this alone, as the default is the most recent backup. Click “Forward”.

Choose where to restore. Since this is a full system backup, leave it as the default (to restore over your current install). Click “Forward”.

Review your selections and click “Restore”.

Wait. Your files won’t appear in your home directory until the entire restore is finished. It may take a while.

Reinstall any programs that you enjoyed in your previous install.

Taken from the deja dup help wiki.
My pronouns are He / Him


Openstack Ubuntu 14.04 cannot access dashboard after reboot

If I understand you right, it seems like you have disabled Unity. I did the same in Ubuntu 15.04.

If you can see your mouse, right-click to access the terminal, otherwise hit Ctrl+Alt+t. From there, enter the following in terminal:

dconf reset -f /org/compiz/

then

setsid unity

I found this answer here. Hope it helps.

P.S. To reboot, type sudo reboot or sudo shutdown -r now.


I am unable to edit gedit ~/.bashrc in ubuntu please help how to do

You can use sudo nano ~/.bashrc to edit .bashrc file . Then reload the file using  source ~./bashrc


After doing sudo apt autoremove I had the same issue with Elantech Touchpad.

Adding the following line blacklist ideapad_laptop to /etc/modprobe.d/blacklist.conf and rebooting (could also reload the config) the laptop fixed the issue for me.

  Lenovo Y700
  Ubuntu 17.04


How to automount a partition on boot / Como hago para montar un particion al inicio del sistema?

you can try also pysdm .

sudo apt-get install pysdm

and run it: sudo pysdm


Merging many MP3 files via command line on Ubuntu

mp3cat seems to have no limitations as you can add a directory as the input. From the link:

Summary
mp3cat reads and writes MP3 files.

$ mp3cat [options] - - < infile.mp3 > outfile.mp3
$ mp3cat [options] - outdir < infile.mp3
$ mp3cat [options] indir - > outfile.mp3
$ mp3cat [options] indir outdir

You would need the 3rd option.

Installation

mkdir -p /usr/local/src
cd /usr/local/src
git clone https://github.com/tomclegg/mp3cat
cd mp3cat
make install

The installation dir is not what I would use but the command was written for FreeBSD. I would install in /opt/ if it was me.


How can I give a new user to access file/folders in an existing user

There are many ways to handle file sharing permissions in Linux/unix:

Add the developer user to the deploy group, and set the script's permissions to allow read and execute for the group. e.g. chmod 750 myscript.sh
you may find in helpful to use linux "ACL" or access control lists, for instance instead of a developer user, you have a developer group, with many members.  You can add an ACL to a sort of bin directory owned by deploy that automatically gives new files the read and execute permissions to the developer group
the benefit of "ACLs", is that directories and files can "belong" to more than one user or group, and inheritance properties can be added to directories, so new files "inherit" the applicable ACL permissions of the parent dir

In some cases, you may shy away from ACLs, because they're a special filesystem feature that may not be available on the FS you're using, or may be missed during a backup.

In the first case you're out of luck.  You have to make a group specifically for the purpose of running these scripts, add your developers to it, and remember to chown and chmod the relevant scripts upon creation.  (all parent dirs must be readable AND executable by the relevant users)


Grep string with special character on remote server using ssh

Quoting and escaping over SSH is a PITA, so send the pattern to grep over a pipe:

$ echo '0e1430$gvauj1@ausxipmktpc11.us.dell.com' | ssh localhost grep -Ff - foo
Mar 29 18:15:06 mailserver amavis[12049]: (12049-13) Passed CLEAN {RelayedInbound}, [111.111.111.111]:25667 [111.111.111.111] <automated_email@dell.com> -> <johndoe@domain.com>,<orders@domain.com>, Queue-ID: 7711E18023F, Message-ID: <0e1430$gvauj1@ausxipmktpc11.us.dell.com>, mail_id: GQj-5bhH37Yi, Hits: -, size: 15551, queued_as: EE75C180429, 148 ms

Use the -F option so that grep doesn't treat it as a regex. The -f - option tells grep to read patterns from stdin.

Or quote and escape if you must:

$ ssh "grep '0e1430\$gvauj1@ausxipmktpc11.us.dell.com' bar"
Mar 29 18:15:06 mailserver amavis[12049]: (12049-13) Passed CLEAN {RelayedInbound}, [111.111.111.111]:25667 [111.111.111.111] <automated_email@dell.com> -> <johndoe@domain.com>,<orders@domain.com>, Queue-ID: 7711E18023F, Message-ID: <0e1430$gvauj1@ausxipmktpc11.us.dell.com>, mail_id: GQj-5bhH37Yi, Hits: -, size: 15551, queued_as: EE75C180429, 148 ms


Is there a Pdf reader with regular expression search

pdfgrep, in the repos, isn't exactly a reader and requires use of the terminal but it eliminates the need to first convert the pdf file to a text file and then to open that in a capable text editor:

In addition to the features listed in Synaptic, you can search multiple files and recursively. One big difference from regular grep is that pdfgrep doesn't provide line numbers but page numbers. man pdfgrep has details.

A simple example:

pdfgrep -in PATTERN FILENAME

Here, i is for case-insensitivity and n gives the page number, not line number.

An example of the output looks like:

There's a brief YouTube video, Pdfgrep - Search Text Inside PDF Files - Linux CLI , as well.


Custom keyboard shortcut to bash script doesn't work

I tried recreating your issue and I guess I got close.

The problem I figured out that you're facing is with the if [[ -t 1 ]] condition.

According to tldp

  This test option may be used to check whether the stdin [ -t 0 ] or
  stdout [ -t 1 ] in a given script is a terminal.

So, the script will not be able to detect the program that invoked it via this conditional. Hence, this is not the accurate solution to your problem.

Now, internally, the keybindings in Ubuntu are executed via a fake terminal. In fact, the TERM variable is set to dumb, when a command via the keybindings is run.

So, to solve your problem, you could use the following code.

if [ $TERM == "dumb" ]
then
        TERMINAL=false
        CREATE="-c"
else
        TERMINAL=true
        CREATE="-nw"
fi

I can not guarantee that it will work in all the cases, but it works for the usage you described.
Hope it helps. :)


Update the default location for screenshot in Ubuntu 18.04+?

Note: I have tested this in Ubuntu 18.04 but this works in Ubuntu 20.04 as well.
First disable the default screenshot shortcut from settings:

Create a custom keyboard shortcut in the settings:
Name it gnome-screenshot, put the command as gnome-screenshot as well
Shortcut value : enter the key [Print Screen]
Create a custom shortcut:

Now enter into dconf-editor (Install it if you do not have it yet).
Go to: org -> gnome -> gnome-screenshot -> auto-save-directory: Change the auto save directory's custom value to the one you want.
Enter the custom path:


Removing python3.9 installed from third part

Since you followed the instructions for installing Python 3.9.2, presumably, you also did make install with sudo.  If you did that, then Python has been installed in /usr/local/.  The executable python3 is placed in /usr/local/bin/, which is earlier in your PATH variable (i.e., the list of locations that are searched for when looking for programs).  That is why when you type python3, you get 3.9.2 .
You can confirm this by typing env | grep PATH.  One of the lines start with PATH= and that's the list of locations that are searched when looking for programs.  Paths earlier in the list have higher priority.  Your list is probably like mine.  /usr/local/bin appears before /usr/bin.
So, to fix your problem, just erase all traces of Python 3.9 .  It is in /usr/local/.  Do this to remove them and yes, you will need to use sudo:

sudo rm -f -r /usr/local/lib/python3.9
sudo rm -f -r /usr/local/include/python3.9
sudo rm -f -r /usr/local/lib/libpython3.9.a

Lastly, cd /usr/local/bin/.  You'll have to delete all of the relevant files here.  Unfortunately, they aren't contained in a directory that you can erase, so you will have to delete them one-by-one using sudo.  I believe these are the files you have to erase (I just installed Python 3.9.2 to replicate what you were seeing).  Obviously, don't erase anything else:
2to3              idle3    pip3.9    python3           python3-config
2to3-3.9          idle3.9  pydoc3    python3.9
easy_install-3.9  pip3     pydoc3.9  python3.9-config

After you've done all this, in a new shell, you can type which python3 and it should report /usr/bin/python3.  If you then type ls -al /usr/bin/python3, you might see something like this:
lrwxrwxrwx 1 root root 9 Oct  6 18:28 /usr/bin/python3 -> python3.8*

This is a symbolic link (i.e., a "Windows shortcut) that points python3 to python3.8.
By the way, answer at the link you showed is not relevant.  That's for the case when someone has installed two versions of Python from the Ubuntu repositories.  In your case, the second version was installed from the Python web site, outside of the Ubuntu repositories.  So the answer at this link doesn't help you.
In summary, when you downloaded Python from Python's web site, compiled it and installed it, it is placed in /usr/local/bin/.  It isn't "registered" in any way with the Ubuntu system.  All it did is put it in a location that is searched first before /bin/.  So, there's no single button that you can hit to remove all traces.  You just have to go into /usr/local/ and manually remove it.  Since there will be other programs there, you can't remove all of it...you need to go in and remove a file or a directory at a time.  Once you do that, then Python 3.8 will be found first.
I think this is correct now; I hope this helps.


How to run ubuntu in windows 7 like a app?

open turn on/off features
and enable subsystem for Linux and virtual machine platform
click on OK
open powershell and type wsl --install
and wsl --set-default-version 2 then press enter
type exit
open Microsoft store and search for Ubuntu then click on the first result
then click on install/get this app
then open the installed app
wait for few minutes and it will be installed
after that type the new user and password
type sudo apt-get update
and sudo apt install xfce4 -y
then press enter
install VcXsrv app from here https://sourceforge.net/projects/vcxsrv/
and then type cat /etc/resolv.conf
this command in the Ubuntu app
copy the ip
type nano ~/.bashrc
in the bottom type
export DISPLAY=:0
replace the  with the ip address
press ctrl+x and y
press enter
18 type source ~/.bashrc
19 run the VcXsrv app
complete the wizard
in additional parameters add
-ac
save the configuration and click on finish
type startxfce4
in Ubuntu app to start the Ubuntu desktop
if we go back to our VcXsrv app
you will see the Ubuntu desktop

All Done :)


upstart init script remains on apt-get remove

apt-get remove only removes the packages, it does not remove the associated configuration files of the package.

apt-get purge is the command snippet you use if you also want to remove a package's configuration files. Test your application with that and that should get you the result you need.

See also:

https://help.ubuntu.com/community/AptGet/Howto
manpage for the apt-get command