TL;DR: This problem is now solved by upgrading Popcorn Time to Beta 0.3.0 or higher. It's not a bug that's been fixed, per se, but instead an incompatibility between some versions of Popcorn Time and some versions of Ubuntu.

Do I open my torrent client and download a movie and then it gets going?

If you know how to use a bittorrent client, and you have a .torrent metafile or magnet link for the torrent you want to download (for a movie or otherwise), you don't need Popcorn Time.
Popcorn Time automates this process for some torrents (though probably not as well as you can do it yourself, with torrents you have yourself selected and a bittorrent client you've possibly even configured to work as you like).
Learning how to use a bittorrent client is actually pretty easy, and searching for torrents is not all that difficult either. (Some torrent programs, like qBittorrent, even integrate search functionality.) So it's possible even many people who think they need Popcorn Time actually don't. I'm not saying this to insult the software in any way, but instead because I wish to encourage people to familiarize themselves with bittorrent, which is a widely implemented technology useful for numerous purposes, including the reliable and fast distribution of free OSes like Ubuntu.
But if you do want to use Popcorn Time, it does sound like you are having the problem addressed in André Marinho's answer: in Popcorn Time's binary distribution, its executable linked to the shared library libudev0, but newer versions of Ubuntu than 12.04 use libudev1. Though I believe this problem is fixed in more recent versions of Popcorn Time; see below.
Assuming the incompatibility is entirely superficial—i.e., that the executable links to the wrong (for Ubuntu) library but doesn't rely on any of the differences between libudev0 and libudev1—the solution of editing the executable with a hex editor so it declares linkage with libudev1 instead should work.
Here are another couple solutions.
Make sure you're running the latest version.
While development has stopped on the original version of Popcorn Time, it's currently being developed by others. 32- and 64-bit Linux versions are provided now and likely work out of the box on Ubuntu.
So make sure you're running the latest version, unless you have a specific need for an earlier version. That might, by itself, fix this problem.
(I did try this, on a 64-bit Utopic system. Both the 64-bit and 32-bit versions of Popcorn Time Beta 3.2 were able to run; neither had this problem. I only tried starting the program; I didn't test downloading.)
Just make a symlink to the needed library.
I've been able to reproduce the problem on a new version of Ubuntu by using an old version of Popcorn Time (Beta 0.29). I then tested this and the following solution, which worked.
If you're an administrator on your Ubuntu system, then you can run commands as root with sudo. So you can create a symbolic link to libudev1 and call the link libudev0. Then when Popcorn Time tries to use libudev0, it will automatically and seamlessly use libudev.
sudo ln -s /lib/$(arch)-linux-gnu/libudev.so.1 /lib/$(arch)-linux-gnu/libudev.so.0
You might have noticed something very similar in the script in MrVaykadji's answer to Install Popcorn Time from source files. This is actually the exact opposite—there, the script makes a link to libudev.so.0 called libudev.so.1 because old versions of Ubuntu (specifically, 12.04) have libudev.so.0 and new versions of Popcorn Time need libudev.so.1. In contrast, the solution I'm giving here is for old versions of Popcorn Time that need libudev.so.0 running on new versions of Ubuntu that have libudev.so.1.
The symlink solution, if you're not an administrator.
If you cannot run commands as root with sudo on the Ubuntu system you're using (because you're not an administrator), or if you don't want to go messing with those parts of your system, you can make the symbolic link elsewhere and run Popcorn Time in a special way to make it use the symlink even though it's not in a libs directory.
Suppose you have the Popcorn Time program folder in your home folder, so it's ~/Popcorn-Time. Run:
cd ~/Popcorn-Time
ln -s /lib/$(arch)-linux-gnu/libudev.so.1 libudev.so.0
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./Popcorn-Time

The ln -s command puts a symlink called libudev.so.0 (to the system's libudev.so.1) in the Popcorn-Time folder. The second command, runs Popcorn-Time with the current directory added to the LD_LIBRARY_PATH variable.
Since LD_LIBRARY_PATH is not commonly used and probably doesn't contain anything necessary for Popcorn Time to run (probably not anything at all, actually), this command will probably also work:
LD_LIBRARY_PATH=. ./Popcorn-Time

You should try that too, since if it doesn't work, it will make the next step a bit more complicated.
Making a Launcher
Running Popcorn Time from the terminal like that (typing LD_LIBRARY_PATH=...) is mainly for testing to make sure it's set up correct. It would be quite inconvenient to always have to do that.
So you should make a launcher to run Popcorn Time. (Depending on what desktop environment you use, you can probably do this by right-clicking on your desktop and clicking Create Launcher...)
The launcher should be made to run this command:
env LD_LIBRARY_PATH=/home/username/Popcorn-Time /home/ek/Popcorn-Time/Popcorn-Time
(I've used env since VARIABLE=value command syntax is not generally supported in application launcher icons. ~ and environment variable expansion is also not usually supported, which is why you have to give it the full explicit name of where to find Popcorn Time and your library symlink.)
Replace username with your actual username. (You'll have to edit both instances of /home/username/Popcorn-Time further if the Popcorn Time program folder is not right in your home folder.)
Alternative: Making a Launcher to a Shell Script
If the shorter command LD_LIBRARY_PATH=. ./Popcorn-Time didn't work, you'll probably need to write a shell script to assign LD_LIBRARY_PATH the correct value, incorporating its previous contents, while launching Popcorn Time.
I'd suggest creating the shell script in the Popcorn Time program folder, alongside the Popcorn-Time executable and the libudev.so.0 symlink.
cd ~/Popcorn-Time      # if you're not already there
gedit popcorn-time.sh  # if you want you can use a different text editor than gedit
Put this in the text file (this is your shell script):
#!/bin/sh
DIR=~/Popcorn-Time
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DIR $DIR/Popcorn-Time

If the Popcorn Time program folder is something other than ~/Popcorn-Time, you can conveniently change it in just one place in the script: on the DIR= line.
When you're done, save the file, quit the text editor, and make the shell script executable:
chmod +x popcorn-time.sh

Then when you make the launcher, the command it should run is simply:
/home/username/Popcorn-Time/popcorn-time.sh
Replace /home/username/Popcorn-Time with the actual path to the Popcorn Time program folder. So if it's ~/Popcorn-Time, just replace username with your actual username.


How to install Ubuntu on a CR-48 Chromebook?

There are two ways - one requires the Chrome OS to be present and utilizes the kernel there, but you can't do it from a bootable USB stick. The other way involves flashing a new BIOS - but again, you have to be in a workable Chrome OS session. I think the BIOS flash tool got pulled by its creator and is hard to find. But either way, you will need to restore Chrome OS. There is a recovery to do this -

Recover to stock cr48

Once its recovered, just google for the cr48 BIOS to install from a pen drive - good luck.


Failed to start Show Plymouth Boot Screen error while booting Ubuntu

Assuming that this is Ubuntu 20.04...
From the GRUB menu, choose Additional Options, then Recovery Mode, Root Access.
At the # prompt:
sudo update-alternatives --config default.plymouth

Choose the ubuntu-logo choice, then repeat the command with the bgrt choice.
sudo update-initramfs -c -k $(uname -r)

Then reboot.


you need to switch download folder to the external hard driver. The default place for all downloads is the folder called Downloads but this can be changed in the program.

so go to settings in the program you are using and select your hard drive instead of your downloads folder. It's really easy, comment the program if you have any problems and I'll guide you better.


How To Convert A Configured Ubuntu System To An Unlimited ISO?

Try clonezilla or norton ghost. You can use this to make a 1-to-1 copy of an existing image/Installation and copy it to a portable hard drive; then your friends computer.


How do I reset the icons in the notification area back to their default locations?

Move your current panel configuration so it is no longer used:

mv ~/.gconf/apps/panel ~/panel_backup

Log out and then log back in, you will now have the default panel setup.


Which system calls will be used for command : cat < in (in is an existing regular file)?

All of them will be needed except create !

strace cat < yourPreciousFile

just in case it's not clear, the magic is done by strace which is a debug tool which is very useful in this scenarios.


Is there a shortcut to restore desktop focus?

Try holding the Super key, maybe you know it as the "Windows" key. It should show you many of the shortcuts you can use in Ubuntu.

I think the one you're looking for is Ctrl+Super+d.


The reason it doesn't work is that panda might be installed in another python interpreter than the one in your project. In your screenshot, you seem to have cd'ed to the virtual environment of anaconda. However, you ran python like so:
$ python

instead of like so:
$ ./python

If you try it again with the latter, you'll see importing panda will not work.

This is a security feature in Linux, running scripts outside of $PATH needs to be a valid path, not just the file name. So you don't run malicious scripts by mistake.
For example, let's say you downloaded and extracted a directory from the internet. You want to list the files in it, and you do the following
$ cd directory-name
$ ls

If that directory had an executable called ls in it that does some really malicious things, you would accidentally run that scripts without realizing until it's too late.


The problem was that the /etc/apt/sources.list contained a minimum, so I took all sources entries from an 4.15 machine and now it works!


Either the '/var/log/mysql/mysql.log' file doesn't exist (the default on my 12.04 machine is just /var/log/mysql.log), or the user that's performing this operation doesn't have access to it and needs to be granted read permission.


Static Routes Problem with Network Plan on Ubuntu 18.04 Azure VM

Absolutely, it looks like you're trying to work with the correct file.  documentation as per https://www.networkinghowtos.com/howto/adding-persistent-static-routes-on-ubuntu-18-04-and-higher-using-netplan/
I'd suggest that your netplan configuration looks more like the following:
network:
    ethernets:
        eth0:
            dhcp4: true
            dhcp4-overrides:
                route-metric: 100
            dhcp6: false
            match:
                driver: hv_netvsc
                macaddress: 00:22:48:9a:d1:4e
            set-name: eth0
            routes:
                - to: 172.28.0.0/16
                  via: 10.3.0.1
    version: 2


`[!]` (exclamation mark in brackets) wildcard in bash

Citing man 7 glob:

An  expression  "[!...]"  matches  a single character, namely any character
that is not matched by the expression obtained by removing the first '!' from it.
(Thus, "[!]a-]" matches any single character except ']', 'a' and '-'.)

Emphasis on the single character part here, [] can not be used for whole strings in Bash Pattern Matching.

bash's Brace Expansion can be used to match strings, however there is no way (I know of) to negate them. E.g.

1.{gif,csv,mp3}

is expanded to

1.gif 1.csv 1.mp3

no matter whether these files exist.

As wchargin pointed out shopt can be used to enable extended pattern matching operators, one of them being !(). After running shopt -s extglob, e.g.

1.!(gif|csv|mp3)

is expanded to

1.jpg 1.bmp 1.png

if those files exist in the current directory. For more read man bash (section EXPANSION/Pathname Expansion) and Pathname expansion (globbing).

For what you're trying to do I'd always use find, which offers the negation and much more, e.g. in the following way:

find . -maxdepth 1 -type f ! -name "*.gif" -a ! -name "*.csv" -a ! -name "*.mp3"

This just lists the findings, if you want to remove them just append the -delete option to the end of the command. As always with removing actions: Always check carefully first.

find offers a ton of useful options very well explained by man find.


I have similar issue with my Sony Vaio. I tried all the methods that you have listed, but there was no effect.

However, in grub, editing lines as follows helped me. (Be sure to backup grub before any editing as a standard practice).

  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=legacy"
  GRUB_CMDLINE_LINUX="acpi_backlight=legacy"

Note: We are using acpi_backlight=legacy instead of acpi_backlight=vendor here.

After saving, run command $ sudo update-grub and reboot your laptop.

Once I did that, the commands cat and tee started working for me to display and change brightness from Terminal.

This will give you maximum numeric value of brightness that your screen supports.

$ cat /sys/class/backlight/dell_backlight/max_brightness

This will set your screen brightness value to  your specified value, between 0 to max_brightness.

$ echo <brightness_value> | sudo tee /sys/class/backlight/dell_backlight/brightness

For more information, refer to this backlight Wiki.


Trouble with Copy/Paste to a desktop folder

I can't say to be an expert. I run into difficulties in Nautilus just moving a picture from one directory to another. I've found opening a separate instance of Nautilus helps me out.

From the first window of Nautilus select copy. In the second instance of Nautilus select paste. Alternatively to move, just click the icon in the source Nautilus Window and drag it to the target Nautilus window.

Note there are problems reported in Nautilus DnD (Drag and Drop) for Ubuntu 19.04. For that version see:

Drag-and-drop functionality no longer working after upgrade to 19.04


Check out this guide for resizing the Ubuntu partition that will take you step by step using GParted. But WUBI does have the mentioned limit so if you cannot go past 30GB, this would be the reason why.
https://www.howtogeek.com/114503/how-to-resize-your-ubuntu-partitions/


To figure out what was uninstalled, you can run the following command:
cat /var/log/apt/history.log | grep -A3 'apt remove libssh-4' | sed 's/([^)]*)//g;s/,//g'

Then, you can either download the deb files from https://packages.ubuntu.com and manually install them
or you should still have networking capabilities through network-manager
First, run the following command to start NetworkManager:
sudo systemctl start network-manager

Then, try running an update command to see if you have networking capabilities (you should have full network capabilities):
sudo apt update

If you don't have a network set up, you can use nmcli commands to connect to the network.
First, scan for networks:
sudo nmcli device wifi rescan

Then, list your available networks by SSID:
nmcli device wifi list

Finally, use the following command to connect to a network:
sudo nmcli device wifi connect SSID password wireless-password

and replace "SSID" and "wireless-password" with the correct parameters

Once you have your network up again, you can reinstall the uninstalled packages.
Source: nullr0ute.com
Click here for more information.


How to download packages on Mac OS X to install to ubuntu 16.04?

Assume a 64bits Ubuntu 16.04 .

Examples 1) eclipse http://packages.ubuntu.com/xenial/eclipse : The red dots are the dependencies → eclipse-jdt, eclipse-pde → must also be downloaded and installed. Links to eclipse : http://packages.ubuntu.com/xenial/all/eclipse/download

2) git http://packages.ubuntu.com/xenial/git : Dependencies → libcurl3-gnutls, liberror-perl, libexpat1, libpcre3, perl-modules, patch, rsync, ssh-client .
Links to git, amd64 http://packages.ubuntu.com/xenial/amd64/git/download

The packages can be downloaded with any Internet browser, or with the wget command, if available.

Note : Be aware that the dependencies can also dependend on some packages, etc. etc. inter-dependencies. Please check.

Note 2 : Click the downloaded packages.deb , and they will be installed.


Ubuntu 12.04 with Intel 82845g/gl graphics card

I realize that this thread is pretty much dead, but I found some information that may help any future visitors who come here as I did in a desperate search for answers. I have a circa-2004 Dell Dimension 2400 I really wanted to install Linux on for a client, and was about to give up - esp. after reading numerous posts like this - when I decided to give Lubuntu 14.04 a try. Much to my amazement it installed and ran fine with all updates installed. Its not the perfect DE for this particular client (I was hoping for something a little more Windows-like, as they are Linux virgins) but hey, it works! Hope this info helps someone else as well.


11.10

Gnome 3 developers have dropped this from gnome-control-center with a recommendation that it be repackaged and available as a separate application.
A launchpad wishlist item was requested.

An alternative in for typing break is workrave.  It is now available as a backport:

sudo apt-get install workrave

You need to white-list this application to appear in the Unity indicator-applet. Read this question if you want a more detailed explanation about what to do.

12.04

An enterprising developer has resurrected DrWright for Precise. The package is available from a PPA:

sudo add-apt-repository ppa:drwright/stable
sudo apt-get update
sudo apt-get install drwright

12.10,13.10,14.04

Note, that for 12.10,13.10,14.04 ppa is not up to date, so you have to use precise repositories:

deb http://ppa.launchpad.net/drwright/stable/ubuntu precise main
deb-src http://ppa.launchpad.net/drwright/stable/ubuntu precise main

Find the applet in the Control-Center to launch:

image and source for the information

In a similar manner as for 11.10, workrave is available from the Precise Universe repository if you do not wish to use a PPA.


gnuplot is a command-line program; you have to run it in a terminal emulator. On Ubuntu the keyboard shortcut CTRL+ALT+t is set to open a new terminal window by default, but you can of course also find the terminal emulator in the Dash (or main menu).

In the terminal window, you can simply type gnuplot to launch the gnuplot command prompt. In order to plot your example, sin(x), on the gnuplot prompt, you can simply type:

plot sin(x)

to obtain:

There is a great tutorial in the Gnuplotting page...


GRUB 2 dual boot freeze for a few seconds

I believe this to be a Grub bug. I reported it at https://bugs.launchpad.net/linuxmint/+bug/1603261.


This is reported as http://debbugs.gnu.org/24682. A workaround is to use ./configure CFLAGS=-no-pie .


Some of the shell code from that source doesn't do what it claims to do; mainly the type that goes:

if [ -n $(pgrep -f vlc) ]; then (vlc &); fi

This runs vlc & in two cases. If there are no processes matching "vlc", and if there are exactly one process matching "vlc". If there are more than one process matching "vlc", vlc & will not be run. So these if blocks are rather useless. Just running vlc & instead will likely be more correct.

Bad shell advice is unfortunately commonplace on the internet.

From your problem description, what you want the result to be is that the program is run if it isn't already running, and if it is running, bring that window to the front, and give it focus. To do this, wmctrl could be used.

wmctrl -a 'Mozilla Firefox' will find a window containing "Mozilla Firefox" in its title, and "activate" it. That is, move to the workspace it's in, bring it to the front and give it focus. Secondly, if no windows match, wmctrl will do nothing and exit with a non-zero (false) exit status, in which case we can assume the program is not running, and start it instead.

wmctrl -a 'Mozilla Firefox' || firefox &

It's still not perfect though. Other windows than firefox windows could potentially contain that string in their title, so we should find a more reliable way of identifying the right window in this case.

With -x, wmctrl will operate on the VM_CLASS of a window, which will typically have a unique value per program. All firefox windows will have VM_CLASS "Navigator.Firefox" as can be seen by running wmctrl -lx while firefox is running

$ wmctrl -lx
...
0x03ba3d43  3 gnome-terminal.Gnome-terminal  pilot Terminal
0x04c000bc  0 Navigator.Firefox     pilot Group #1 - Speed Dial - Mozilla Firefox

With this we can select the window that has exactly "Navigator.Firefox" as VM_CLASS

wmctrl -Fxa Navigator.Firefox || firefox &

The same should hopefully be applicable for the other programs.


The CRC for the main partition and back up partition table are invalid

It sounds like you're encountering I/O errors. Such problems are usually caused by failing hardware. If you're lucky, this might be something simple and cheap to fix like a loose or defective cable. It could also be a failing hard disk, though. I recommend you run a SMART test on your hard disk. If you need help interpreting the results, post back with details. (Edit your question to include a screen shot or paste text-mode output to a pastebin site and post the URL to your document here.)

I/O errors can also be caused by buggy drivers. This is pretty rare, though. If your problems occur only in one OS, that might be the explanation.

Yet another possibility is that the Host Protected Area (HPA) may be set. This can sometimes cause problems, especially if you mix older and newer Linux kernels, since some older kernels ignore the HPA, causing a mis-match in perceived disk size and where GPT backup data structures reside. I don't think this hypothesis explains your symptoms all that well, but it's worth mentioning. You can type sudo hdparm -N /dev/sda to see if HPA is enabled on /dev/sda.


Starting tmux with the following flag fixes this for me:

tmux -2

from tmux man page:

-2            Force tmux to assume the terminal supports 256 colours.


First, you will want to add the PPA for the current compiz development.  While I realize this is not necessarily the most stable, it is significantly better than what comes in the repos:

https://launchpad.net/~smspillaz/+archive/compiz-experimental

I haven't tried this yet - it's my next step, but this is for emerald:

http://www.webupd8.org/2013/05/how-to-install-emerald-in-ubuntu-1304.html


Screen freezes but mouse usable but clicks are all inactive

I encounter the same issue almost daily running 18.04 on an HP Omen gaming desktop.  Hard power-cycle has been my only resource.
I did find a post that recommended re-installing some x11 input drivers.  Hasn't happened in the last 10 hours which is promising.
Laptop keyboard stopped working


Mouse and touchpad freeze without power supply

Thank you:

sudo apt-get install powernap
sudo powernap-action --disable usb_autosuspend

solved my problem!


Put this line in your .bashrc assuming you're using bash as shell:

export PATH=/path/to/your/script/:"$PATH"

You can use vi, nano or gedit to edit this line in the end of the file. Make sure your script is set to executable mode, if it's a bash script:

chmod +x script.sh

Or if it's a Python script:

chmod +x script.py

On your script indicate their type in the first line. If it's Python:

#!/bin/python

If it's bash:

#!/bin/bash


Landscape Script timed out while executing bash script

Let's ignore the fact that your script is likely incomplete (hinted by the trailing fi without a starting if;then).
First, I would make sure that what you run does not block for input. (e.g. sudo, gedit).
Second, there is a time limit setting in landscape when editing scripts, as is visible in the documentation. If your script runs for longer than 5 minutes, you may have to increase the timeout. You could also run as a specific user,


How to avoid openSSH showing authentication popup?

The thing is, that even with an SSH key, if you put a passcode on the ssh key you use, it'll require you to enter your passcode to unlock the key once during your login session (unless otherwise configured).  This is a security measure that some people enable so that others cant utilize their system nor their SSH key on their own system.

EDIT
In order to fix this, you'd need to edit your SSH key (if you use one) so that it does not require a passcode, and seahorse (the GUI for key management and things) will help you do that.  I strongly recommend you don't remove your passcode from your SSH key (if that IS the thing that's causing the popups, and I'm pretty sure it is)


Trying to install Ubuntu on Lenovo T61 laptop

So how big are the files going onto the CD from Ubuntu?

The full ubuntu-12.04.4-dvd-amd64.iso image of all the files is 1.6G in size.

  Why does the Ubuntu help topic on downloading sometimes say use a CD and other times a DVD?

Because some Ubuntu distributions (AKA 'distro') will fit on a CD, whereas the full Ubuntu distro with Unity requires a DVD. There are many flavors of Ubuntu, briefly explained on the Ubuntu wiki. You've got a choice with Ubuntu of which Desktop Environment you want to use to manage your desktop, and once you choose the desktop, then you also choose the utility programs which work with it, and the 'libraries' of files which support it.

  Isn't there a default Windows program for burning CDs and DVDs?

Not with XP. The Microsoft Forums recommend the free app ImgBurn, but the highest rated free app for Windows CD/DVD burning at Sourceforge is cdrtfe.

To make what you burn bootable, you must burn it using the Mastered format, as the Live File System on a CD or DVD is not bootable. The Mastered format is explained at this Windows Explorer for Windows 7 link.

  Should I use another program?

Since you're having problems with using a CD and DVD, perhaps you should use the free app for Windows which lets you create a LiveUSB on a flash drive to install from.

There's a big advantage to the LiveUSB; freedom of choice. LiveUSBs lets you try one version, wipe it clean, and then try another, to seee which you like then best. Then, once you settle on your preference and actually install it to your hard drive, then you can customize it with wallpaper, fonts, cursor and other visual elements.

The LiveUSB also leaves your XP install intact, and you can access the data on the hard drive, and save files to the hard drive.

The Xubuntu and Kubuntu versions are more similar to XP, IMHO, than Ubuntu with Unity, which uses a more different desktop.


USB thumb drive - why does file transfer speed vary so much?

Some things that could be the reason:

The transfer rate depends a lot on the file count/file size - more so on a filesystem like FAT32.

Are you sure the files were actually written completely when you measured the end time? I would guess the 3GB file was not yet finished writing, for example.

Possibly some files where in the buffer cache in the fast case.

Did you drop the cache before testing?
You can do it by echo 3 | sudo tee /proc/sys/vm/drop_caches


How to remove the error while installing python 3 packages in Ubuntu 16.04

This issue can be solved using following command:

sudo apt-get -f install

This command will remove all the error mentioned above.


Installation alongside Windows XP, or dual boot

Well if I understand your question correctly, what you need to do, if you don't want to use your existing XP hard drive, is to add another drive for Ubuntu, or create a persistent USB, and use Ubuntu that way.

A persistent USB will aloow you to run Ubuntu from it, and save any work that you may have.  For help on creating a persistent USB see Create a Persistent Bootable Ubuntu USB Flash Drive


Recently 12.04 introduced a bug in keyboard handling. The workaround is to use the following code in a terminal:

setxkbmap "en","fr"

where en and fr represent the keyboard layouts you use.

One step further is to run this command on startup by clicking the top right cog wheel and choose startup applications.


Note that OP is on 18.04, and my problem (and solution) is with 18.10. I suspect that with a "newer" nvidia driver the problem is the same on 18.04, comments confirm.

Problem: I'm on Thinkpad p51 which has nvidia quatro m2200 graphics. The laptop has a 4k display and I use external 4k monitor as well. The setup worked nicely on 18.04, but after the upgrade to 18.10 the external monitor was no longer detected. The external monitor wasn't showing neither in the Display settings nor in xrandr. Nvidia drivers are version 390.77.

Solution: Instal and use lightdm:

$ sudo apt install lightdm (or $ sudo dpkg-reconfigure lightdm if it is already installed).
Select lightdm when asked about the display manager selection.
Restart

Context

This seems a bit counter-intuitive, but the https://askubuntu.com/a/1049669/472560 gave a good hint of trying lightdm. Contrary to the linked solution reverting back to GDM didn't help. I need to stay with lightdm.

I've found this post which sheds some light on the issue:

  The Ubuntu developer who looks after the ubuntu nvidia-prime package has updated his work for Ubuntu 18.10 (...) Swapping between hybrid and intel-only (either way) works without rebooting, you just need to log out & in again (...) However, it does not work well with gdm3: external monitors don't work because the nvidia driver crashes (...)

Src: Optimus and Ubuntu 18.10: New packages are good but lightdm is required, gdm3 still broken

edit: I've posted a dramatization of the investigation on my blog.


Is a swap of internal HD (with OS) using ISO or a bit copy via /dev/sdb possible?

Yes, bit-by-bit copy is possible from a smaller to a bigger drive.
I did so from a regular SCSI-ATA 240 GB conventional HDD (/dev/sda) to a new ATA 500 GB SSD, mounted as a USB external drive, using a live Ubuntu DVD with GParted, ddrescue and dd  available.
Obviously the new SSD needed to be formatted (using GParted) into something suitable for the live Lx to be able to mount it. It does not matter what the format really is as long as its partition(s) can be mounted under Lx.
After formatting, one might want to check each available volume tag and signature, with:

sudo lshw -C disk

Cloning command syntaxes:

1) using dd:

dd -v if=/dev/sda of=/mnt/sdb bs=1024k

The default bs or block size is 512kB. I chose 1024kB hoping that it would speed up a little the bit-by-bit copy process.

2) using ddrescue:

ddrescue -d -f -b512 -n -v -r3 /dev/sda /dev/sdb [logfile-name]

A discussion on the differences between dd and ddrescue and even gddrescue does not fall within the scope of my initial question. It can be found elsewhere on askubuntu.com.


Dualboot Ubuntu w/ WIndows: Deleting Windows

OS Uninstaller will remove your Windows partition and fix your Grub bootloader.

enter the following int he terminal:

sudo add-apt-repository ppa:yannubuntu/os-uninstaller
sudo apt-get update
sudo apt-get install -y os-uninstaller && os-uninstaller

The program will install and start, it will look something like this:

Just select  Windows Vista in the menu and the click ok.

Click Apply The program will do the rest.

You can read more about OS-Uninstaller HERE

P.S. this is how I removed my Windows 7 from my computer, so I know it works.


when you see your desktop press Ctr+Alt+F1 and run

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

This will reinstall the desktop and its application set including software center.

If you can't run the command because you also removed the package manager then I am afraid reinstalling Ubuntu is your only option.


Importing custom CA and personal SSL certificates into Ubuntu Touch web browser

Unfortunately the answer is NO (at least for now). The web browser does not support import of SSL certificates at all. It is reported as bug (see https://bugs.launchpad.net/webbrowser-app/+bug/1313370) but apparently nobody is working on it.

For people relying on use of custom or personal SSL certificates for web access this makes ubuntu touch phones/tablets unusable at the moment :(


Capture2Text - Alternative (Capture text from Screen Directly) in Ubuntu Mate

You don't need "scrot".  Imagemagick (which provided "mogrify") can do the job of screen capture.   You also don't need to save an intermediate image, as "tesseract" can accept an image on standard input.

As such the above simplifies to...

convert x: -modulate 100,0 -resize 400% -set density 300 png:- |
  tesseract stdin stdout | xsel -bi

However I also added the following to my version of the script, to pop up the text on screen so you can check it.

xsel -po | xless - &

Of course tesseract could use some improvements for some fonts!  For example 'f's in some fonts have a small hook that makes tesseract think they are 'P's!  Arrghhhh...

EDIT:  Full script I use is located at...

http://www.ict.griffith.edu.au/anthony/software/#capture_ocr

I link this to a 'hotkey' (Meta-Print) using my window manager (openbox), so I can use it at any time.

If you can't use a hotkey, and need to uncover the part of the screen containing the text you can always launch it with a delay...

sleep 5; capture_ocr

Enjoy


Install vlc

Enter on Ubuntu Software Center, search for VLC and install it.

After that, right click on your music/video and open with VLC


Login Loop - "BadValue (integer parameter out of range for operation)" - 16.04

Adding +iglx to xserver-command in /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf.

[SeatDefaults]
# Dump core
xserver-command=X -core +iglx

After which you either reboot or Ctrl-Alt-F1, login, and sudo service lightdm restart.

Works like a charm


Is it possible to install Safari on Ubuntu 14.04?

Safari uses webkit as web browser engine. You can use epiphany-browser which also uses webkit engine for debugging and checking the compatibility:

sudo apt install epiphany-browser


Use auth required pam_yubico.so mode=challenge-response without the debug at the end.


SPI appears broken Ubuntu core and Intel Joule

As I understand it, Intel hasn't publicly released the tools necessary to enable SPI on the Joule just yet (they require an NDA, you can talk to them if you like). As a result, SPI isn't yet enabled on the Ubuntu Core image for the Joule (though work is ongoing).


Infinite boot after Nvidia driver installation no terminal

So as suggested by @MichalPrzybylowicz I just pushed e in grub added the init 1 to the end of linux line and then it brought me into recovery mode. I pushed enter to get to the terminal then just ran :

mount -n -o remount,rw / (not sure if it was necessary)
sudo apt-get remove --purge nvidia-*
exit

And the system rebooted and is working fine now.


Cannot resize Chome app icon on Unity desktop

here's the easiest way, I've found to fix this problem:

Find the .desktop file of the chrome-app: e.g.
~/Desktop/chrome-lbfehkoinhhcknnbdgnnmjhiladcgbol-Default.desktop
the Icon is set to something like this
Icon=chrome-lbfehkoinhhcknnbdgnnmjhiladcgbol-Default
I simply change this entry to include the full path and extension to the icon file:
Icon=/home/USER/.local/share/icons/hicolor/128x128/apps/chrome-lbfehkoinhhcknnbdgnnmjhiladcgbol-Default.png
You must replace USER in with your own user-name (note: ~/.local/share/icons/hicolor/128x128/apps/chrome-lbfehkoinhhcknnbdgnnmjhiladcgbol-Default.png does not work)
save the changes and now the icon has the correct size and I can also resize it.

Note:

I found out where the icon is stored via gnome-desktop-item-edit: e.g.
gnome-desktop-item-edit chrome-lbfehkoinhhcknnbdgnnmjhiladcgbol-Default.desktop
Then a small dialogue will appear - click the icon on the left and a file-chooser dialogue will open up.


OpenVPN DNS - use update-resolv-conf.sh failed: Permission denied

The script is called update-resolv-conf, you can check it by doing ls /etc/openvpn.

If so, please use

script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf


cannot recover windows8 after installing Ubuntu 16.04

Looks like a UEFI capable machine, running Windows 8 in legacy mode on an MSdos partition table disk got an UEFI Ubuntu install, instead of a legacy mode install (you select the mode in the BIOS/UEFI settings). There is an EFI partition at the end of the disk, sda8, but it contains no bootloaders, neither Ubuntu, nor Windows, but it now has the boot flag.  Fix one, move the boot flag back to the Windows partition, sda2 from sda8 (Ubuntu does not care, but Windows does).  Boot Ubuntu (in legacy mode), and run

sudo update-grub

Reboot and see if you get a Windows choice in the grub menu.  Try it and see if it works.

Check which grub you have installed, an UEFI install will leave you with the wrong one, grub-pc is needed for legacy, not grub-efi-amd64.

dpkg -l |grep grub

You can purge and reinstall the grub packages, or just reinstall in the correct legacy mode, formatting the existing Ubuntu partition.  That gets rid of any changes you made to the /etc/grub.d files too.


You could report and discuss your bug on the French-speaking forum first.

Have a look at http://www.ubuntu.com/support/community/local-language#french.


Assigning user quota in PureFTP/Pure-FTPD (command line)

This is old but someone else might use it:

sudo pure-pw usermod user1 -N 100 -m

Above will add user1 quota of 100 MB

-N = quota in MB
-m = build credentials database (if you omit this you have to run sudo pure-pw mkdb to apply changes)

Make sure to use -N not -n.

-n (lowercase n) will set file limit - a number of files, not the size.


How do I run the snapcraft webchat example?

If you take a look at the webchat example's snapcraft.yaml, you'll see this snippet:

apps:
  webchat:
    command: bin/webchat-for-a-snap
    daemon: simple
    plugs: [network-bind]

This tells Snappy that you want this command to be run as a daemon (i.e. a systemd service), which means this should be running as soon as you install it. Try this:

$ ps ax | grep webchat
  2095 ?        Ssl    0:00 node /snap/webchat/100001/bin/webchat-for-a-snap

The example is missing some documentation since it doesn't tell you how to use it, but it's simply running a webserver on port 3000, so try visiting http://localhost:3000 in your web browser.


How do I check if Ubuntu is using my NVIDIA graphics card?

I know the question is old, but I found a solution which I haven't found on any other topic.

Open a terminal and type

lspci -vnnn | perl -lne 'print if /^\d+\:.+(\[\S+\:\S+\])/' | grep VGA

Your output will be something like that:

00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09) (prog-if 00 [VGA controller])

01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Chelsea LP [Radeon HD 7730M] [1002:682f] (rev ff) (prog-if ff)

Now look for the [VGA controller] at the end of each device. Whichever device has it, is the active GPU. In my case it's the i7 processor (HD 4000) that's handling the work.


For UFW, you should make an Inbound rule which will allow you to accept connections via port 5123 (probably TCP and UDP).

sudo ufw allow proto tcp from [SourceIP] port 5123 should be sufficient for what you need, it'll open port 5123.

For the record, and for those who use iptables directly in case you are curious, the same functionality can be obtained with this:

sudo iptables -A INPUT -p tcp -s [SourceIP] --dport 5123 -j ACCEPT


AppArmor denial when trying to open file using content hub

In my manifest.json, I had to add a property called content-hub to hooks:

"content-hub": "hub.json"

And then create a hub.json file:

{
    "source": [ "pictures" ]
}


"Unable to find service record" when transfering files from 1 laptop to another after setting up a connection

Try using the command bluetooth-sendto --device=XX:XX:XX:XX:XX:XX file1 file2.. where XX:XX:XX:XX:XX:XX is the address of other laptop, which you can find from Bluetooth Settings dialogue.


GRUB failed to install after GRUB Rescue

What I did: I formated the disk and installed everything again. As I had backup of windows partition, it was just time loss.


Webcam recognised by cheese but not by Skype

I've had an issue like that before and i had to change the in-app settings on Skype then restart the app to fix it
-edit-

Open the Skype app
Ctrl+comma to open up the settings section
Go to Audio & Video
Activate your camera


By default, awk strips leading and trailing spaces and assigns each non-whitespace token to a field (if you do not change the field separator). This can be done in Python with:

import sys

f = sys.stdin
# If you need to open a file instead:
#f = open('your.file')
for line in f:
    fields = line.strip().split()
    # Array indices start at 0 unlike AWK
    print(fields[0])


Is there an IRC channel for this Ubuntu community where I can get help and talk to people?

There are many IRC channels, a full list can be found at https://wiki.ubuntu.com/IRC/ChannelList

The main channel is #ubuntu on irc.freenode.net


Replace title bar with a full window border

Even without window decorations, you should still be able to move the windows around, using Alt + Button1 mouse drag.

To replace them with a solid border that's equal around all sides, you'll need to create a Metacity theme which does so; or find an existing one that does already.


Configure simple-scan to produce PDF with better quality

I had the same problem...
This is a problem with the jpeg-quality settings:
Type gsettings set org.gnome.SimpleScan jpeg-quality 90 in a terminal and your problem should be solved. Choose the quality between 0 and 100. This will also effect your documentsize.
For further Information: https://wiki.ubuntuusers.de/Simple_Scan/#Konfiguration


MySQL database in tasksel LAMP stack for osCommerce

First, you should create a MySQL user for osCommerce to use. It's bad practise to use the root user/pass for a web application.

In a shell on the machine with the MySQL on it, do:

mysql -u root -p

Enter the root password you previously specified. This gets you a prompt which has full access to your mysql server.

Now, pick a database name - it doesn't matter what it is really so long as it's unique on the mysql server (to see existing ones: SHOW DATABASES;)

When you've decided on it:

CREATE DATABASE dbname;

For example, I'd probably just pick oscommerce.

Now you have to give a new user access to that database. Pick a username and password (the username can be oscommerce again, but make a secure password) - replace dbname here with what you chose a second ago:

GRANT ALL ON dbname.* TO username IDENTIFIED BY 'password';

Done. Now you have the details to put into your webform; the servername is just localhost or 127.0.0.1 (assuming the webserver is the same machine as the MySQL server), the user and password you just made, the database name is whatever you replaced dbname with. Port can be left empty.


Default kanji/Japanese font wrong in Ubuntu 14.04, how to change it?

I think I've found right answer.

Easiest way to show Japanese fonts under Ubuntu 14.04 is:

Copy 69-language-selector-ja-jp.conf to your ~/.fonts.conf or ~/.config/font-manager/local.conf.

That's it.  Easy, isn't it? ;)

Detailed expressions are below:

First, there are mechanisms to show Japanese fonts including vlgothic fonts under /etc/fonts/conf.d/ (or /etc/fonts/conf.avail/).  Those are written in 65-fonts-xxx.conf files.  However those mechanisms are only available in Japanese environment.  For example, you can see following lines in those configuration files.  This restricts it.

  <test name="lang" compare="contains">
    <string>ja</string>
  </test>

On the other hand, similar mechanisms for Chinese fonts are available in 69-language-selector-xxx files.  Those mechanisms are not checking language environment, so those are available whenever.  I don't know why there is no 69-language-selector-ja-jp.conf in Ubuntu 14, but it is a reason why Chinese fonts are shown under English environment.

You can remove above language checks from 65-fonts-xxx.conf files to show Japanese fonts if you want.  Or, you can modify only your configuration file like described at the top.


Replacing Windows and trying to figure out how to backup old files on Ubuntu

Is you current windows install working/bootable? If so, you could simply use an external hard drive to copy files from Windows and the restore files to your new Ubuntu install. It should be easier if your external HD is formatted as FAT32.

If your Windows install is not working, you could use Ubuntu LiveCD to boot your computer, plug your external hard drive and copy the files.


Amd Radeons Overscan is reset after every boot

Open a terminal with Ctrl+Alt+T and enter the following:

sudo amdconfig --set-pcs-val=MCIL,DigitalHDTVDefaultUnderscan,0

Then reboot.


pdflatex not found while installing "R" software on Ubuntu 19.04

You need to install the texlive-latex-base package, which provides this utility:

sudo apt-get install texlive-latex-base

And also please note, that R is packaged in Ubuntu as r-base and r-base-dev packages (see search results, you will get R 3.5.2). You do not need to compile R by yourself (usually).
If you need R 3.6 - use binary repository from R-CRAN.


Please help, I can't access my pc after bad upgrade

What Ubuntu version were you using before? Ubuntu 14.04.x? Also how did you create a system restore point? To my knowledge this is not possible using Ubuntu.

I'd recommend creating a bootable USB medium (instructions for Windows and Ubuntu) using Ubuntu 16.04 LTS ISO and launching the live environment from it. When you have booted into the live environment, backup all your files and configs on a separate hard drive and just reinstall Ubuntu 16.04, replacing all other Ubuntu installations.


What is the /etc/init/failsafe.conf file for?

One purpose for failsafe.conf is to prevents problems like this one with slow DHCP servers: https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/838968

You shouldn't hack at the sleep timer. The problem is probably that you have an auto [ifname] line in your /etc/network/interfaces file for an interface that doesn't get an address. This frequently happens if you install using a wired connection, and then stop using that wired connection in favor of another one (e.g. wlan).


There should be a space between cd and /home/ashley/downloads, but the point is, to change the current directory to the one, where the downloaded file is.


How do I stop this constant loss of free space?

You've got some out-of-control logs. Instead of deleting like crazy everyday, find the fast growing file or files, and look inside to investigate what may be causing this. Maybe some program is spinning in a loop logging some condition. Either disable that program, disable its logging or try to fix the condition that it's complaining about.

If a file is growing before your eyes, and you have no idea which program is writing to it, you may be able to find that out easily.  Here is an example. Who has /var/log/syslog open? We use the fuser command:

# fuser /var/log/syslog
/var/log/syslog:      602

Only one process has /var/log/syslog open. It is process 602. What is that? Let us not bother with ps and grep, but look at the /proc filesystem directly:

# ls -l /proc/602/exe
lrwxrwxrwx 1 root root 0 Mar 29 17:45 /proc/602/exe -> /usr/sbin/rsyslogd

Aha, it is rsyslogd. We are not surprised that rsyslogd has /var/log/syslog/ open.

This method is not guaranteed to work. The reason is that programs do not have to keep files open ino rder to write to them. Suppose you have a process which opens a file, appends to it, and then closes it. You will have a somewhat more difficult investigation. You could run fuser many times until by chance you catch the process "red handed". That process itself could be going into and out of existence quickly. Another problem is that multiple processes could have the file open, but only one is making it larger. In that case, you can trace their system calls.

# fuser /var/log/huge-annoying-file
/var/log/huge-annoying-file:   1234 23459

Oops! Two processes have it open: 1234 and 23459. Let's see what they are doing:

# strace -p 1234
Process 1234 attached - interrupt to quit
select(1, NULL, NULL, NULL, {9, 922666}

It's not doing anything, just blocking in a select call. Ctrl-C to break the trace:

select(1, NULL, NULL, NULL, {9, 922666}^C <unfinished ...>

Check the next one:

# strace -p 23459
write(5, "Useless garbage ..."..., 512) = 512
write(5, "More useless garbage ..."..., 512) = 512
write(5, "More useless garbage ..."..., 512) = 512
write(5, "More useless garbage ..."..., 512) = 512
write(5, "More useless garbage ..."..., 512) = 512
write(5, "More useless garbage ..."..., 512) = 512
write(5, "More useless garbage ..."..., 512) = 512
^C

Oops, that one is writing constantly. It must be the bad one. We can even check that the file descriptor 5 which the process is writing to is in fact the large file:

# ls -l /proc/23459/fd/5
lr-x------ 1 root root 64 Apr  3 23:39 /proc/23459/fd/5 -> /var/log/huge-annoying-file

I don't suspect you have a corrupt filesystem, but to force a full check, you don't have to boot a DVD.

Firstly, review your filesystem's maximum mount count setting. Identify your partition using the df command. Example on an Ubuntu system I have here:

# df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1       18062108 5499320  11645284  33% /
udev              392152       4    392148   1% /dev
tmpfs             159768     768    159000   1% /run
none                5120       0      5120   0% /run/lock
none              399416     200    399216   1% /run/shm
/dev/sr0           43668   43668         0 100% /media/VBOXADDITIONS_4.1.4_74291

You can see that the / filesystem is mounted on /dev/sda1. So /dev/sda1 is the storage device of the root partition (and the only partition in this particular system).

Let's look at some attributes of that filesystem. This is safe to do even though it is mounted. The command spews a lot of output. Here is an excerpt:

$ dumpe2fs /dev/sda1
dumpe2fs 1.42 (29-Nov-2011)
Filesystem volume name:   <none>
Last mounted on:          /
[ ... SNIP ... ]
Last mount time:          Fri Mar 29 17:45:18 2013
Last write time:          Tue Mar  5 09:08:03 2013
Mount count:              22
Maximum mount count:      22
[ ... SNIP ... ]

Hey look, the mount count is equal to the maximum mount count. Next time I reboot, there will be a filesystem check.  The important thing is that the mount count is a positive value. If yours is zero, change it to some positive value like 22 using tune2fs -c 22 /dev/whatever. Zero means that a check is never forced regardless of how many times the partition is mounted.  Rarely rebooted systems should have low values here. A server that goes down once a year could probably use a fsck each time it reboots. You can set date-based check intervals also.

Now to force a check, you can override the actual count to be greater than or equal to the maximum, and then reboot. That's done with capital C: tune2fs -C 1234 /dev/whatever. Now the partition looks like it has been mounted 1234 times without a check, which is greater than the one- or two-digit maximum.


Building a windows executable in qt on a Linux system

For QT4

The following steps are taken from an answer on a post on stack overflow, for building with qt4 if it works make sure to give them an upvote.

Just use M cross environment (MXE). It takes the pain out of the whole process:

Get it:

git clone https://github.com/mxe/mxe.git

Install build dependencies
Build Qt for Windows, its dependencies, and the cross-build tools; this will take about an hour on a fast machine with decent Internet access; the download is about 500MB:

cd mxe && make qt

Go to the directory of your app and add the cross-build tools to the PATH environment variable:

export PATH=<mxe root>/usr/bin:$PATH

Run the Qt Makefile generator tool then build:

<mxe root>/usr/i686-pc-mingw32/qt/bin/qmake && make

You should find the binary in the ./release directory:

wine release/foo.exe

Some notes:

Use the master branch of the MXE repository; it appears to get a lot more love from the development team.

The output is a 32-bit static binary, which will work well on 64-bit Windows.

For QT5

The following steps are taken from an answer on a post on stack overflow, for building with qt5 if it works make sure to give them an upvote.

Here are the full instructions:

Get it:

git clone https://github.com/mxe/mxe.git

Install build dependencies
Build Qt 5 for Windows:

cd mxe && make qtbase

This will first build its dependencies and the cross-build tools; It should take less than an hour on a fast machine with decent Internet access.

Due to the new modular nature of Qt 5, various major Qt components are now in different tarballs. The one selected above, qtbase, should give you enough functionality to run ordinary GUI apps, which is all I needed for my own (smallish) app.

If you want to build all of Qt 5 instead, you'll need to run make qt5 (instead of make qtbase). Note that it will take a lot longer to complete, so be sure that you need the extra functionality.
Get to the directory of your app, and run the Qt Makefile generator tool:

<mxe root>/usr/bin/i686-w64-mingw32.static-qmake-qt5

Build your project:

make

You should find the binary in the ./release directory:

wine release/foo.exe

Some notes:

This was tested on my 64-bit Debian 8, and on Windows of course.

The output is a 32-bit static executable, which will work well on 64-bit Windows.

If you want a 64-bit executable, build Qt with:

make MXE_TARGETS=x86_64-w64-mingw32.static qtbase

The default MXE_TARGETS value is i686-w64-mingw32.static.


How do I create a package that contains pictures that copy themselves directly to the "Backgrounds" folder?

Backgrounds are stored in /usr/share/backgrounds/

There is a packaging guide on:
https://wiki.ubuntu.com/PackagingGuide/Basic


List Installed Applications Grouped By Type

The following script will give the output much similar to what you want.

var=$(echo $(for f in /usr/share/applications/*.desktop;do cat $f|grep -i categories|sed -e 's/Categories=//g;s/\;/\n/g';done|sort|uniq))
for n in $var
do
  echo $n
  for f in /usr/share/applications/*.desktop
  do
    echo -e -n "\t" $f|sed -e 's!/usr/share/applications/!!g;s/.desktop/::/g'
    echo $(cat $f |grep -i categories|sed -e 's/Categories=//g;s/\;/:/g')
  done |grep -i :$n: |sed s/'::.*'//
done

Will give output as

...
Development
     bluefish
     boa-constructor
     eclipse
     gambas3
     GNUSim8085
     python2.7
     python3.2
     qtcreator
     ubuntusdk
DiscBurning
     brasero
     furiusisomount
Documentation
     yelp
...

Explanation

var: stores the list of all possible categories.
The inner for loop finds list of applications that contains the category as provided by outer for loop. The inner for loop also outputs everything required.

I also tried another script which outputs the real name(GIMP Image Editor) rather than package name(gimp) but it gives weird results because some desktop files do not contain newlines


The way on Ubuntu would be to use libvirt on top of KVM/QEMU/VirtualBox. Quoting the Arch Wiki:

  Libvirt is collection of software that provides a convenient way to
  manage virtual machines and other virtualization functionality, such
  as storage and network interface management. These software pieces
  include a long term stable C API, a daemon (libvirtd), and a command
  line utility (virsh). A primary goal of libvirt is to provide a single
  way to manage multiple different virtualization providers/hypervisors,
  such as the KVM/QEMU, Xen, LXC, OpenVZ or VirtualBox hypervisors
  (among others). Some of the major libvirt features are:

  VM management: Various domain lifecycle operations such as start, stop, pause, save, restore, and migrate. Hotplug operations for
  many device types including disk and network interfaces, memory, and
  cpus.
  Remote machine support: All libvirt functionality is accessible on any machine running the libvirt daemon, including remote machines.
  A variety of network transports are supported for connecting remotely,
  with the simplest being SSH, which requires no extra explicit
  configuration.
  Storage management: Any host running the libvirt daemon can be used to manage various types of storage: create file images of various
  formats (qcow2, vmdk, raw, ...), mount NFS shares, enumerate existing
  LVM volume groups, create new LVM volume groups and logical volumes,
  partition raw disk devices, mount iSCSI shares, and much more.
  Network interface management: Any host running the libvirt daemon can be used to manage physical and logical network interfaces.
  Enumerate existing interfaces, as well as configure (and create)
  interfaces, bridges, vlans, and bond devices.
  Virtual NAT and Route based networking: Any host running the libvirt daemon can manage and create virtual networks. Libvirt virtual
  networks use firewall rules to act as a router, providing VMs
  transparent access to the host machines network.

CLI management is done primarily using the virsh command. There's an associated GUI front-end, called virt-manager.

As for starting VMs automatically, assuming you have a VM named foo, to mark it for starting at boot:

virsh autostart foo

And to unmark it:

virsh autostart --disable foo

The Ubuntu LTS Server Guide has a chapter on libvirt.


The script below will play a sample of 5 seconds of all mp3 files inside a directory in a row, asking you if the file should be deleted or not after each sample.

After proceeding, the script will produce a report like:

--------------------
remove: /home/jacob/Bureaublad/test/04 Suite Espanola Nr. 1 Op. 47 Nr. 4.mp3
keep: /home/jacob/Bureaublad/test/08 Danzas Espanolas Op. 37 Nr. 3.mp3
remove: /home/jacob/Bureaublad/test/02 Suite Espanola Nr. 1 Op. 47 Nr. 2.mp3

The script

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

dr = sys.argv[1]
report = []

for f in [f for f in os.listdir(dr) if f.endswith(".mp3")]:
    file = os.path.join(dr, f)
    subprocess.call(["timeout", "5", "mpg123", "--quiet", file])
    try:
        subprocess.check_output([
            "zenity",
            "--question",
            "--text=Delete?",
            ]).decode("utf-8").strip()
    except subprocess.CalledProcessError:
        report.append("keep: "+file)
    else:
        os.remove(file)
        report.append("remove: "+file)

print("-"*20)
for l in report:
    print(l)

How to use

Unnecessary to say, but install `mpg123:

sudo apt install mpg123

Copy the script into an empty file, save it as filter_mp3.py
Run it with the targeted directory as argument:

python3 /path/to/filter_mp3.py /path/to/folder

Explantion

The script:

lists all mp3 filse in a directory:

for f in [f for f in os.listdir(dr) if f.endswith(".mp3")]:
    file = os.path.join(dr, f)

plays them for 5 seconds:

subprocess.call(["timeout", "5", "mpg123", file])

runs a zenity question dialogue:

try:
    subprocess.check_output([
        "zenity",
        "--question",
        "--text=Delete?",
        ]).decode("utf-8").strip()
except subprocess.CalledProcessError:
    report.append("keep: "+file)
else:
    os.remove(file)
    report.append("remove: "+file)

The dialogue will raise a subprocess.CalledProcessError if user either clicks No or closes the window (nothing happens), or will close error free if user chooses Yes.

In the latter case, the file will be removed:

os.remove(file)


first you need enabled on your phone the "discover" mode, then in your Ubuntu Desktop click on your bluetooth icon and select "setup a new device..." this open a windows witch will guide you to pair you system with your phone.


Blue-striped boot screen after uninstall gnome

The blue stripes you are seeing is actually the boot splash, which is configured through the plymouth themes. You can change it by executing sudo update-alternatives --config default.plymouth in terminal and selecting a different theme.


Can I run my full Ubuntu Unity desktop on my Windows machine using X?

This post may be a bit dated, but the principal applies.

Intro to X Forwarding

Unix machines have been able to run software on a remote machine and display the GUI locally for almost two decades. Linux and Mac OS X support X Forwarding with no extra software. Any terminal on Linux should do X Forwarding, Mac users need to run "Applications > Utilities > XTerm". In a command line terminal run "ssh -Y jdoe@compute.example.edu matlab" and you'll be running matlab on "compute.example.edu" but seeing it on your desktop.
Windows users need two pieces of software: an secure shell program (ssh) to establish the remote connection and an X Server to handle the local display.
Prerequisites

Putty for SSH
Xming for the XServer

**Configuring Putty

Add Unix hostname
Switch Protocol to SSH
Type name of session in saved sessions
Click 'Save'

Expand the 'SSH' tab from the 'Category' list
Choose 'X11' from 'SSH' list
Check 'Enable X11 Forwarding'

Choose 'Session' from 'Category' list
Click 'Save'

Starting the X Server on Windows
Configuring Xming

Just run "All Programs > Xming Xming" and it should work if you've got PuTTY configured.

Connecting

Start Xming
Start Putty
Double click on the saved session you want

Enter username and password as requested
You should now be able to run X applications from the host on your local desktop

Source: Math.umn.edu


how can I create a MySQL account using terminal

mysql -u root File ""

Is not valid.

I would expect this from the bash prompt:

mysql -u root -p < file.sql

where file.sql contains valid SQL and it will be executed on the database noted in file.sql. Otherwise supply a database after "-p " and before the "<".
and -p will prompt for the password for root.


It seems that lm-sensors is getting wrong data. Try to run sudo sensors-detect first. Read carefully every output, on the last question:

Do you want to add these lines automatically to /etc/modules? (yes/NO)

type: yes+Enter, then reboot. See if something changed.


Error during installation of smatch in ubuntu 14.10

Enter these two commands:

sudo apt-get clean
sudo apt-get autoclean

Try to fix the broken dependencies:

sudo apt-get -f install
sudo dpkg --configure -a

And enter again sudo apt-get -f install.

This should solve your dependency problems and you can now install libgtk2 again.


steam libgl error. wont load swrast_dri.so and swrast

We need to know what graphic card you use,seems to me from here that you use open source driver and Steam not run usually from 1st with open source driver,but it possible to make it run..also double check that your Ubuntu is 64 bit OS as you downloaded 64 bit version of Steam launcher..
so step by step→we can see if your system is 64bit,and many more from command uname -a and then what is your graphic adapter enough will be output from command lspci | grep VGA. Then we can proceed further..
also you as ordinary user can see that if you go in upper right corner, and click on your user name and click on "about computer" , after with that information, we can proceed further.

But you can try this workaround in meantime: with Ctrl+Alt+T start terminal and run:

cd ~/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu
mv libstdc++.so.6 libstdc++.so.6.bak
cd ~/.steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu
mv libstdc++.so.6 libstdc++.so.6.bak

and then start Steam,result will depend on your graphic card ...
first line is valid if you use 32 bit system,and 2nd line is if you use 64bit system ,both lines are valid if you use open source driver for your graphic...
Well, as for Ubuntu 15.10 is still possible to use proprietary AMD fglrx driver I will recommend to not upgrade to 16.04, but more detailed and precise answer I or we really need to know what graphic card you use, good is to be sure about is it 32 or 64 bit system, etc..

As if you are still on Ubuntu 15.10 sure for best results with Steam will be to use proprietary drivers,and not open source ones... but with Ubuntu 16.04 there will be no more support for fglrx AMD proprietary driver, even to manually installation.. but will be amdgpu and amdgpu-pro drivers for newer and new amd cards..so really iIneed to know more details to give you precise answer exactly for your computer that will fit just you.


Thunderbird does not have a way to pipe in custom scripts to send out emails.

An option you should look into would be to setup a postfix service on the osTicket server to allow it to send out messages from localhost out.

In the documentation mentioned by osTicket ( http://osticket.com/wiki/Email_Piping ), they talk about how to set it up for cPanel. We will be doing the same thing but on postfix:

Step 1: Find what alias mapping you are using

sudo postconf | grep -e ^alias_maps

Example result from the command above: alias_maps = hash:/etc/aliases

Step 2: Edit file to add a new alias

(use any editor you want with root access)

sudo vim /path/to/alias/file

Example result from the command above: sudo vim /etc/aliases

Step 3: Add this line to the alias file

support@domain.com: "|/path/to/api/pipe.php"

You should change: the email address to the one you are going to us and the path to the correct path to the pipe.php file

Step 4: Save alias file and exit

For vim: :wq!

Depending on the editor, use the command/options to save the file and exit.

Step 5: Initialize alias database

sudo newaliases

This will make sure the changes you made will be used for postfix/sendmail. This will only work if you if you are editing the /etc/aliases file. Read the manual page for more information on how to initialize alias data for postfix man newaliases.

Step 6: Test if it works

echo "TEST Email" | mail -s "This is a test" support@domain.com

Once its been complete, you should be able to read the mail log to make sure it used the php script when sending it: /var/log/mail.log

You should see a line about it being sent but being delivered to a command: (delivered to command: /path/to/api/pipe.php)

Website References

Official information from osTicket about email piping

http://osticket.com/wiki/Email_Piping

Question about postfix piping

https://stackoverflow.com/questions/6723596/piping-with-postfix-aliases-and-mysql

piping.html - More detailed explanation about piping for a helpdesk service called Vision Helpdesk

http://www.thevisionworld.com/vision-helpdesk-faqs-exim-postfix-qmail-sendmail-email


How to install IKE software on Ubuntu 20.04

Following the above general instructions  and after googling some time, I found also the way to enable ShRew to run full, including GUI, on ubuntu 20+ / Debian 9+.
You can download the full software from https://mega.nz/file/4xV10IqZ#nmAJYGBJvdcI5jhp61DAIHhM4ILKg8x2hHYTpJD6eP4
Execute the script install_shrew.sh and VOILA!!!
Please, test and share (if you like) :)
Thanks to Kulfy for his good work


I deleted /etc/nginx by mistake. How to fix this?

Well the obvious course of action is:

restore from backup

best option here: have etckeeper installed and configured and running and restore the latest configuration ... depending on the backend for etckeeper make sure that you clone it to another machine, i.e. include it in your backup strategy.

Run sudo dpkg-reconfigure nginx
reinstall the nginx package after purging it, thus restoring the default configuration. Make sure to purge, not just to remove.

To reiterate: etckeeper is a convenient and unified frontend to various distributed version control systems. You should use it to protect yourself from disaster and keep an off-site backup of the underlying repository.


How can I stop charging my battery at 60%?

Kernel 5.4 did bring the ability to set the battery percentage under which charging will trigger.

The change in asus-wmi added a charge_control_end_threshold in sysfs.

You can manually set the charge_control_end_threshold to 60 in /sys/class/power_supply/BAT0/charge_control_end_threshold as su to test if it works on your laptop. You should unplug your device and let the battery discharge a little  and then plug your device, if  system doesn't charge your battery when it's over 60% then you're good. but it will regenerate every time you reboot.

A simple udev rule can be made:

KERNEL=="BAT0", SUBSYSTEM=="power_supply", ATTR{charge_control_end_threshold}="80"

Within /etc/udev/rules.d

Read the udev arch wiki for more info.


Allow regular user to update software via GUI and update notifier

The GUI uses Polkit for authentication and authorization. The relevant Polkit actions seem to be, for apt:

org.debian.apt.cancel-foreign
org.debian.apt.change-config
org.debian.apt.change-repository
org.debian.apt.clean
org.debian.apt.get-trusted-vendor-keys
org.debian.apt.install-file
org.debian.apt.install-or-remove-packages
org.debian.apt.install-packages-from-new-repo
org.debian.apt.install-packages.high-trust-repo
org.debian.apt.install-purchased-packages
org.debian.apt.set-proxy
org.debian.apt.update-cache
org.debian.apt.upgrade-packages

Possibly, you might need the following as well, for snaps:

io.snapcraft.login
io.snapcraft.snapd.login
io.snapcraft.snapd.manage
io.snapcraft.snapd.manage-interfaces

Additionally, Ubuntu Software does various actions via PackageKit, so actions for those as well:

org.freedesktop.packagekit.cancel-foreign
org.freedesktop.packagekit.clear-offline-update
org.freedesktop.packagekit.device-rebind
org.freedesktop.packagekit.package-downgrade
org.freedesktop.packagekit.package-eula-accept
org.freedesktop.packagekit.package-install
org.freedesktop.packagekit.package-install-untrusted
org.freedesktop.packagekit.package-reinstall
org.freedesktop.packagekit.package-remove
org.freedesktop.packagekit.repair-system
org.freedesktop.packagekit.system-network-proxy-configure
org.freedesktop.packagekit.system-sources-configure
org.freedesktop.packagekit.system-sources-refresh
org.freedesktop.packagekit.system-trust-signing-key
org.freedesktop.packagekit.system-update
org.freedesktop.packagekit.trigger-offline-update
org.freedesktop.packagekit.trigger-offline-upgrade
org.freedesktop.packagekit.upgrade-system

And for update-manager:

com.ubuntu.update-notifier.pkexec.cddistupgrader
com.ubuntu.update-notifier.pkexec.package-system-locked

And for synaptic:

com.ubuntu.pkexec.synaptic

To configure Polkit privileges, create a .pkla file in /etc/polkit-1/localauthority/50-local.d named, say, allow-pkg-mgmt.pkla, containing:

[Allow Package Management to user foo]
Identity=unix-user:foo
Action=org.debian.apt.*;io.snapcraft.*;org.freedesktop.packagekit.*;com.ubuntu.update-notifier.*
ResultActive=auth_self

See man 8 pklocalauthority for more on configuring Polkit privileges, and the output of pkaction for more actions. For some reason, I had to use ResultActive instead of ResultAny before it would ask for the unprivileged user's password.


How can I make my laptop a server for the Intranet?

You have to give to this laptop a static ip.

Lets say that your router gateway is 192.168.1.254 and your primary network is eth0

Edit the /etc/network/interfaces

sudo nano /etc/network/interfaces

to look like this

  auto lo eth0

  iface lo inet loopback

  iface eth0 inet static

  address 192.168.1.10

  netmask 255.255.255.0

  broadcast 192.168.1.255

  network 192.168.1.0

  gateway 192.168.1.254

  dns-nameservers 192.168.1.254

save, exit and restart networking (or reboot)

sudo /etc/init.d/networking restart

Now from any intranet pc browser write:

http://192.168.1.10

you must see (as you say having install the lamp server) the Apache message It Works!

Now you can install any Lamp application in subdirectories, which can be called from any intranet pc like this:

  http://192.168.1.10/your_app


Why does my Windows XP/Ubuntu dual boot not let me select an operating system?

This may answer your question; however, there could be a variety of problems with this, but I hope I'll find the solution for you.

First, whenever you boot, hold down both Shift keys as soon as your computer hits the BIOS screen. Normally the Left one is necessary, but both won't hurt. :) What this does is, if it is configured already, will display the GRUB selection menu. GRUB, or the GRand Universal Bootloader, will list both Ubuntu and Windows booting options. If this doesn't work, read on.

The problem may be that the partition with GRUB on is not being booted, but the Windows one is. Boot from your Ubuntu DVD/CD/USB and select "Try Without Installing". Now, open up terminal from the Unity dash. Run the following commands:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer

sudo apt-get update

sudo apt-get install grub-customizer

Then, with the Dash, open up Grub Customizer. Now, click on Preferences on the top right corner. Now, look for default entry and select the Ubuntu partition (Not recovery). Click close, Save, and close the application. Now, reboot. It should now load GRUB.

Edit: This solution is for if you have Ubuntu installed on a separate partition; it may work for separate hard drives, however. I do not know from experience if this works for multiple drives, but I know that it works for separate partitions on ONE drive.


Separate keyboard shortcuts for switching between keyboard layouts

Simple: go to keyboard settings, click on "Shortcuts", and add "Custom shortcut". For each shortcut, add the respective command that chooses one layout. The commands are

setxkbmap -layout en
setxkbmap -layout pl
setxkbmap -layout it

etc.


You can download the .deb I've created using Andrew Starr-Bochicchio's packaging from HERE.

Once installed, log out and log back in for Unity Reddit Lens to work.

For more info (like configuring it - you must edit a file for this), see the article on WebUpd8.


Dual boot. How do I reinstall the Ubuntu partition?

The short answer is Yes, you can re-install Ubuntu without having to re-install Windows 7. You might be able to apply this answerto your situation:

How to install Ubuntu, remove Mint and set up a separate home partition?

You should be able to follow the same steps, but ignore the last part about the separate /home partition.


What are common causes for greatly decreased internet speeds?

It might be irrelevant, but are the Windows download speeds after using a download accelerator? I think windows did not report its download speeds for updates.

In case you are wondering why the software center downloads are slow, it might be because it uses wget (which does not use an accelerator) and is like downloading files using plain firefox.

Try installing axel, apt-fast and see if that might help :

sudo apt-get install axel
sudo add-apt-repository ppa:tldm217/tahutek.net
sudo apt-get update
sudo apt-get install apt-fast

And then use apt-fast instead of apt-get for eg. sudo apt-fast upgrade or apt-fast update.

I cannot speak about any other reasons for slow speeds on Ubuntu, and am pretty sure that I've gotten better download speeds in Ubuntu than ever in Windows. Try taking a look at your network usage in gnome-system-monitor and see your network usage. Also since you are on a wireless network, try updating your network drivers.


Firefox not creating sslkeylog file after setting SSLKEYLOGFILE variable

The variable you describe works as intended for me on Firefox 62. Perhaps the browser builds you are using have been built to ignore the variable? From https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format:

  [S]tarting with NSS 3.24 (used by Firefox 48 and 49 only), the
  SSLKEYLOGFILE approach is disabled by default for optimized builds
  using the Makefile (those using gyp via build.sh are not affected).
  Distributors can re-enable it at compile time though (using the
  NSS_ALLOW_SSLKEYLOGFILE=1 make variable) which is done for the
  official Firefox binaries. (See bug 1188657.) Notably, Debian does not
  have this option enabled, see Debian bug 842292.


All Settings lost after restarting Ubuntu

Same thing happened to me, that usually happens when you are using a guest account. If that's not the problem, there might be a problem with the startup options. Your most likely bet would be to use a different USB or a different Linux distro.


How to prevent Firefox from trimming the URLs on the address bar?

Its considered a "feature" since version 7.

To turn it off type on the address bar about:config, look for browser.urlbar.trimURLs and set the value to false.


Apt-get fails on 16.04 or 18.04 installing mongodb

Ubuntu 16.04 and MongoDB 4.0
First, remove any existing repository file for MongoDB.
sudo rm /etc/apt/sources.list.d/mongodb*.list

Next, add the key:  (without the key, the repository will not load)
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E52529D4

Now, create a new MongoDB repository list file:
sudo bash -c 'echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" > /etc/apt/sources.list.d/mongodb-org-4.0.list'

Complete the installation with update of repositories then install:
sudo apt update
sudo apt install mongodb-org

Enable the mongod service and start it up:
systemctl enable mongod.service
systemctl start mongod.service

Check your mongodb version:
~$ mongo --version
MongoDB shell version v4.0.5
git version: 3739429dd92b92d1b0ab120911a23d50bf03c412
OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1604
    distarch: x86_64
    target_arch: x86_64

Check if the service is running:
~$ systemctl status mongod.service
● mongod.service - MongoDB Database Server
   Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-01-21 00:33:51 MST; 7s ago
     Docs: https://docs.mongodb.org/manual
 Main PID: 2906 (mongod)
   CGroup: /system.slice/mongod.service
           └─2906 /usr/bin/mongod --config /etc/mongod.conf

Ubuntu 18.04 and MongoDB 4.2
First, remove MongoDB from previous if installed:
sudo apt remove --autoremove mongodb-org

Remove any mongodb repo list files:
sudo rm /etc/apt/sources.list.d/mongodb*.list
sudo apt update

Now, add the new key:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 4B7C549A058F8B6B

Add the new repository:
echo "deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

Install MongoDB
sudo apt update
sudo apt install mongodb-org

Enable and start the mongod server service:
systemctl enable mongod.service
systemctl start mongod.service

Check your installation:
~$ mongo --version
MongoDB shell version v4.2.2
git version: a0bbbff6ada159e19298d37946ac8dc4b497eadf
OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1804
    distarch: x86_64
    target_arch: x86_64

You can also check your service has started:
~$ systemctl status mongod.service
● mongod.service - MongoDB Database Server
   Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: e
   Active: active (running) since Mon 2019-12-30 08:05:48 MST; 1min 7s ago
     Docs: https://docs.mongodb.org/manual
 Main PID: 7941 (mongod)
   CGroup: /system.slice/mongod.service
           └─7941 /usr/bin/mongod --config /etc/mongod.conf

Ubuntu 20.04 and MongoDB 4.4
First, remove MongoDB from previous if installed:
sudo apt remove --autoremove mongodb-org

Remove any mongodb repo list files:
sudo rm /etc/apt/sources.list.d/mongodb*.list
sudo apt update

Now, add the new key:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 656408E390CFB1F5

Add the new repository:
echo "deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu $(lsb_release -sc)/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org.list

Install MongoDB
sudo apt update
sudo apt install mongodb-org

Enable and start the mongod server service:
systemctl enable mongod.service
systemctl start mongod.service

Check your installation:
~$ mongo --version
MongoDB shell version v4.4.3
Build Info: {
    "version": "4.4.3",
    "gitVersion": "913d6b62acfbb344dde1b116f4161360acd8fd13",
    "openSSLVersion": "OpenSSL 1.1.1f  31 Mar 2020",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "ubuntu2004",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}

You can also check your service has started:
~$ systemctl status mongod.service
● mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset>
     Active: active (running) since Sun 2021-01-24 07:52:50 MST; 27s ago
       Docs: https://docs.mongodb.org/manual
   Main PID: 2353629 (mongod)
     Memory: 59.2M
     CGroup: /system.slice/mongod.service
             └─2353629 /usr/bin/mongod --config /etc/mongod.conf

Jan 24 07:52:50 terrance-ubuntu systemd[1]: Started MongoDB Database Server.

Hope this helps!


Reimaging the OS drive from within the OS

Here is how I got it to work:
Step 1: Create a new partition. You can use any number of utilities to do this, I used cfdisk since it was available
Step 2: Image that new partition with a live distro that has SSH enabled and default username and password. In my case the old OS was on /dev/sda1 and the new one was on /dev/sda2. The new OS must be able to accept an SSH connection from boot without any prompts, or you will lose contact with your remote computer. It must also have the network properly configured. Either set a proper static IP, subnet mask, gateway, etc; or use DHCP and use your remote router to find the computer's new IP address.
Step 3: Run update-grub to add it to the boot options.
Step 4: View the file /boot/grub/grub.cfg and find the menuentry for the new OS image. It should look something like this: menuentry "KUbuntu 16.04 amd64 desktop (live)" --class windows --class os.  What you need is the label in the quotes, in this case: KUbuntu 16.04 amd64 destop (live)
Step 5: Open /etc/default/grub in any editor and look for GRUB_DEFAULT=. Make sure it is set to GRUB_DEFAULT=saved.
Step 6: Run grub-reboot followed by your chosen menu entry in quotes.  In this case grub-reboot "KUbuntu 16.04 amd64 desktop (live)"
Step 7: Run sudo reboot to get your remote computer to reboot. If you have done everything right you should be able to SSH into the new system once it boots.
Step 8: From your new operating system, overwrite the image of the original OS. In my case it was on /dev/sda1. This will also overwrite the grub settings on the boot partition causing you to boot into the updated OS on the original partition next time you boot. Again, what ever OS you put on that partition must have SSH enabled, default username and password, and network settings configured already.
Step 9: Reboot and you should be in your newly imaged operating system.


Add

export SHELL=/bin/bash

to your ~/.bashrc.


From Ubuntu Run type Additional drivers then the drivers search windows will show up with a list of drivers missing from your system and the same list contains drivers compatible to your system, choose the recommended one and install it, then restart system and see if it's working.
Remember to include Canonical partners and Independent for other upgrade resources in the software and updates options.


In case that you have not done this already,
install the GNOME partition editor tool.

Open GParted - select the USB flash drive.
Right-click the partition - select unmount.

Right-click the partition - select format to.
Choose fat32 - Click on Apply in menu bar.


Restoring Windows 8 Backup while keeping Ubuntu 12.04

From what you said in the question, I'll assume that you have Windows 8 completely removed and you only have Ubuntu 12.04 on your laptop.

Here is the steps that I would do, in summary, installing Windows 8 alongside Ubuntu first then restoring it from your backup

Install GParted (search in the software center).  Here's a screenshot of it:

Right click the Ubuntu partition and click "Resize/Move".  You will need at least 20 GB for Windows 8, which is 20480 MB.  Enter that in the "Free Space Following" box, or put a larger number if you need more space for Windows 8.
Grab a Windows 8 Installation CD and boot into it.  Enter you license key (next, next, next) and stop at this screen.

Choose "custom".  Then select the Free space, create a new NTFS partition, and click on "Next".
By now you should have Windows 8 and Ubuntu on your computer, and your computer only boots into Windows 8.  Now boot into a Ubuntu Live CD or USB, and install Boot-Repair.  Type the following lines in the terminal:

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

sudo apt-get install boot-repair

Launch Boot Repair from the Dash, and select "Advanced"

Select "Reinstall GRUB".  Then apply and restart your computer after Boot Repair did its job.
Now you should be able to boot into both Windows 8 and Ubuntu with Windows 8 being a clean install.  Boot into Windows 8, then go to the "Windows 7 File Recovery" panel.

Plug in the drive where your backup is located and Restore the backup.
Done!


PHP Curl Errors with libidn2-0:amd64 (2.2.0-1+ubuntu18.04.1+deb.sury.org+1)

The answer verified to be working:

https://bugs.launchpad.net/ubuntu/+source/libidn2/+bug/1843507/comments/15

wget http://mirrors.kernel.org/ubuntu/pool/main/libi/libidn2/libidn2-0_2.0.4-1.1build2_amd64.deb
dpkg --purge --force-all libidn2-0 && dpkg --purge --force-all libidn2-0 && dpkg --purge --force-all libidn2-0 && dpkg --purge --force-all libidn2-0
dpkg -i libidn2-0_2.0.4-1.1build2_amd64.deb
apt-mark hold libidn2-0
apt --fix-broken install
apt-get update
apt-get upgrade


How do I find out what is trying to connect to the ldap and why? You look at the log, and see it saying:12:19:25 vagrant-ubuntu-vivid-64 sh[482]: nss_ldap: reconnecting to LDAP server... You think: "Aha!  Process ID 482." And then you run journalctl -o verbose _PID=482 and possibly journalctl -o verbose SYSLOG_PID=482 and look at the log some more, to see exactly what program "sh" is, what command line it was passed, and what user was running it.


How to Install Gnome 3.8 on ubuntu 13.04

Open a terminal using ctrl+alt+t and enter line per line:

sudo apt-add-repository ppa:gnome3-team/gnome3
sudo apt-get update
sudo apt-get dist-upgrade


Problems with installting cURL on Nginx + php 7 (ubuntu 14.04)

After hours of work I managed to solve the problem with an upgrade. Then it started to work!

The secret was:

sudo apt-get update && sudo apt-get upgrade


I don't think there is a single unified command for this.

For most things, you can use the finger command:

$ finger $USER
Login: root                             Name: root
Directory: /root                        Shell: /bin/bash
On since Thu Jan 15 13:46 (IST) on tty1    19 days 18 hours idle
Last login Tue Feb  3 20:55 (IST) on pts/5 from localhost
No mail.
No Plan.

You get the username, home directory, shell, count of unread mails, and last login details.

To list groups, either groups or id will do:

$ groups
muru adm cdrom sudo dip plugdev lpadmin sambashare debian-tor libvirtd autopilot socks
$ id
uid=1000(muru) gid=1000(muru) groups=1000(muru),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),124(sambashare),127(debian-tor),132(libvirtd),136(autopilot),999(socks)

Permissions, of course, depend on what they are for. For sudo, use sudo -l:

$ sudo -l
[sudo] password for muru:
Matching Defaults entries for muru on ica:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User muru may run the following commands on ica:
    (ALL : ALL) ALL

With PolKit it's a lot tougher, pkcheck can assess whether an individual process can use some privilege, but I couldn't figure out a way to list all permissions.


I don't have this problem now, but did in the past. I only had it briefly, after somebody in here said "get the test kernel".

Other good suggestions are 1) update hardware bios 2) make sure ubuntu firmware is up to date 3) if you are using proprietary video drive, stop for a while to test.

Try to isolate problem.

I would make sure the ssh server is running and log in with another pc when this slowdown happens. It will often be true that an ssh session will be ok, even when computer seems frozen.

One point of this is to see if only your user account is stuck, or the kernel itself is flailing.

In the terminal, run some diagnostics like

$ top

$ ps aux | more

$ dmesg

You doubt memory trouble, but you also mention Java. I am suspicious, for me Java is a constant source of trouble.

Top will give summary. Ps gives comprehensive output.

Another idea it to try Alt-Ctl-F1 to get to VT. May not work if system is entirely frozen.

I fear that constantly suspending will cause zombie processes to accumulate and you should log out, maybe restart.


Why does installing gnome shell extensions from extensions.gnome.org fail silently?

I had a similar problem myself and I tried resetting GNOME settings and it worked for me. After resetting GNOME settings, try logging out and back in (and to be safe, try rebooting as well) and now, you should hopefully be able to install the GNOME extensions.

How do I reset GNOME to the defaults?


Ethernet network disconnected - wireless working

Can you try this:

Get your IP address, Subnet Mask, Gateway & DNS from your Windows PC.
Assume that it is 192.168.0.101, 255.255.255.0, 192.168.0.1 & 8.8.8.8 from your windows pc.
Now replicate all this settings into your Ubuntu wired network. Of course you have to change the IP address to something else e.g. 192.168.0.102 to avoid IP conflict.
If you are able to connect now, then it could be something wrong with your router DHCP server when it tries communicating with Ubuntu, vice versa. There are a few times I have experienced this and by rebooting all devices at once it works again.


How to move Unity Launcher on boot automatically?

The easiest way is to open "Automatically Started Applications" from dash and add there this command.

If it does not work, try to add it as

 sleep 10;xrandr --output VGA1 --primary

Another way is to add it to [SeatDefaults] section of /etc/lightdm/lightdm.conf as

 display-setup-script=xrandr --output VGA1 --primary

I am not 100% sure it will work as a command in lightdm. It can be also be done as a script.

You can create a text file display.sh with this content

#!/bin/sh
display-setup-script=xrandr --output VGA1 --primary

run chmod +x display.sh

and then add to lightdm.conf

display-setup-script=<path_to_display.sh>


What process is responsible for auto-screen rotation? I want to disable it (on 16.04)

I have since found a more practical way of disabling screen rotation, but it only works in the GNOME desktop environment and not in Unity.

In GNOME click on the top right menu. The button in between the one that opens the Settings menu and that locks your screen controls your screen rotation. Click the button to disable it.

This screenshot was taken from a similar question for Fedora:

This feature does not appear to be in Unity. A graphical tool that will at least help you with your screen rotation in Unity is called ScreenRotator.


Install wine1.6-amd64 from ubuntu-wine ppa asked for installing wine1.6-i386 as well

I found the answer... at least a solution.

Can't install wine (or ia32-libs) in Ubuntu 12.10 64 bit

Using /etc/apt/preferences to assign Pin-Priority would solve the dependencies problems while installing wine-i386.  However, in some of my machines it would remove almost all kde packages and I need to re-install them back after installing i386 packages.


In general rename renames the filenames supplied according to the rule specified as the first argument of the command. The the filenames are supplied by the arguments that follow the first one.

The first argument in the example command (rename 's/\.htm/\.html/' *.htm) has fur parts, where in this case / is a delimiter of these parts:

s/regexp/replacement/[flags]

The s command means substitute: s/<old>/<new>/. Match the regular-expression against the content of the pattern space. If found, replace matched string with replacement.
Regular expression that matches to the strings that should be substituted. In the current case this is just the string .htm.

In most regular expressions the dot . matches to every character. In this case we want to use the dot literally, so we need to escape its special meaning by using the back slash \ (quoting a single character).
Replacement of the sting/regexp matched to 2.
Flag that is not presented in the current example. It could be for example the flag g - apply the replacement to all matches to the regexp, not just the first. Let's assume we have a file named my.htm-file.htm:

The original command rename 's/\.htm/\.html/' *.htm will rename the file in this way: my.html-file.htm. Look at the bottom of the answer how to avoid this problem.
By adding the g flag - rename 's/\.htm/\.html/g' *.htm - the new filename will be: my.html-file.html.

According to the filenames: * can represent any number of characters (including zero, in other words, zero or more characters). The shell will expand that glob, and it passes the matching filenames as separate arguments to rename So *.htm - will match to all filenames in the current path that end with the string .htm. For example if you have 1.htm, 2.htm, 3.htm, 4.htm, and 5.htm then rename 's/\.htm/\.html/' *.htm passes exactly the same arguments to rename as running:

rename 's/\.htm/\.html/' 1.htm 2.htm 3.htm 4.htm 5.htm

The whole command  (rename 's/\.htm/\.html/' *.htm) could be read in this way:

rename `<substitute>/<the string ".htm">/<with the string ".html">/` <do it for all files in the current path that end with ".htm">

Let's go back to the example when we have a file named my.htm-file.htm. Probably we want to change the last part of the filename so called extension after the last dot. For this purpose we should modify the rename command in this way:

rename 's/\.htm$/\.html/' *.htm

Where the $ sign matches to the end of the line and literally means "read backward".

  ^ - Matches the null string at beginning of the pattern space, i.e.
  what appears after the circumflex must appear at the beginning of the
  pattern space. (read more)

  ^ acts as a special character only at the beginning of the regular
  expression or subexpression (that is, after \( or \|). Portable
  scripts should avoid ^ at the beginning of a subexpression, though, as
  POSIX allows implementations that treat ^ as an ordinary character in
  that context.

  $ - It is the same as ^, but refers to end of pattern space. $ also
  acts as a special character only at the end of the regular expression
  or subexpression (that is, before \) or \|), and its use at the end of
  a subexpression is not portable.

References:

Bash Guide for Beginners: Shell expansion
GNU/Linux Command-Line Tools Summary: Wildcards
perlre - Perl regular expressions
GNU: sed, a stream editor
Online regular expression testers


Fake CSR 4.0 Bluetooth Dongle with error Set Event Filter(Invalid HCI Command Parameters) after kernel patch

i solved my problem by comment the lines 296 and 297 of hci_core.c(plus patches).
static void bredr_setup(struct hci_request *req)
{
    __le16 param;
    __u8 flt_type;

    /* Read Buffer Size (ACL mtu, max pkt, etc.) */
    hci_req_add(req, HCI_OP_READ_BUFFER_SIZE, 0, NULL);

    /* Read Class of Device */
    hci_req_add(req, HCI_OP_READ_CLASS_OF_DEV, 0, NULL);

    /* Read Local Name */
    hci_req_add(req, HCI_OP_READ_LOCAL_NAME, 0, NULL);

    /* Read Voice Setting */
    hci_req_add(req, HCI_OP_READ_VOICE_SETTING, 0, NULL);

    /* Read Number of Supported IAC */
    hci_req_add(req, HCI_OP_READ_NUM_SUPPORTED_IAC, 0, NULL);

    /* Read Current IAC LAP */
    hci_req_add(req, HCI_OP_READ_CURRENT_IAC_LAP, 0, NULL);

    /* Clear Event Filters */
    //flt_type = HCI_FLT_CLEAR_ALL;  HERE!!
    //hci_req_add(req, HCI_OP_SET_EVENT_FLT, 1, &flt_type);

    /* Connection accept timeout ~20 secs */
    param = cpu_to_le16(0x7d00);
    hci_req_add(req, HCI_OP_WRITE_CA_TIMEOUT, 2, &param);

Maybe the "#define lmp_bredr_capable(dev) 0" also work. But im not sure. I still run the bredr_setup() but bypass the clear event filter step...
obs: Its working flawless for 2 days. Only problem, i cant turn it into a HSP\HSP profile but i think its another story(even after the ofono gambiarra). Bluetooth in linux is a pain in a$..


Will it be possible to use ReactJS Native for Ubuntu Touch development?

Maybe yes, it seems that they are working on it.

the source code:

https://github.com/CanonicalLtd/react-native

the blog entry:

https://developer.ubuntu.com/en/blog/2016/08/05/introducing-react-native-ubuntu/


How to download Ubuntu default sounds in mp3 or wav format?

If you have Ubuntu installed, you can find them in /usr/share/sounds/<theme>/stereo where <theme> can be replaced with Ubuntu (if using releases before 18.04) or  Yaru (if using releases after 18.04).

Alternatively, you can download the corresponding packages from pool of archives to get Yaru theme sounds or Ubuntu sounds.

Once downloaded extract using

dpkg -x deb_name.deb

And navigate to /usr/share/sounds/<theme>/stereo. To convert the OGG or OGA sound to MP3, you can use ffmpeg. In order to convert all sounds in one go, you can use for loop. The below command will convert all OGA/OGG sounds into MP3 and save it into ~/Downloads/sounds.

mkdir ~/Downloads/sounds; for i in /path/to/sounds/*.{oga,ogg}; do ffmpeg -i "$i" ~/Downloads/sounds/"${i%.*}.mp3"; done


Apps are running into another apps like a new instance

I couldn't find the related questions, but aftes I publish it, the forum itself show me someones... I found my solution here Slack shows opened links to browser as another slack instance in task bar but please, attention to use the response from user bltcrew


How to switch orientations of a bamboo tablet?

xrandr will only change the orientation of the screen, and not always the orientation of the tablet. For that you need to use xsetwacom:

xsetwacom stylus rotate ccw
xsetwacom eraser rotate cw
etc...

Se the man page for full details: man xsetwacom, if you want the changes to be perminant then add the commands to a new file in your home directory called .xinitrc and now your settings will load on reboot.