What is the difference between running a command as logged in as a user vs doing sudo -u

What you need to remember is that there are two things that come into play when a command is run:

What is the user's permissions in that case.
What is the environment that the command is ran in.

When you log in as a specific user you change both of these, but when you are using sudo -u you simply change the first aspect.

Consider this, assuming a clean install:

(running as userA):

vim /home/userA/test

(and now as userB):

sudo -u userA vim /home/userA/test

Both commands will work perfectly, and you may not notice an error until much later on. Because in both instances vim needed to crate a directory for its configuration files. It was running with permissions of userA so that will be the owner of the directory, but in the first case the directory will be created in its correct place: /home/userA/.vim, but in the latter case there will be a problem, the environment was still pointing to userB's home directory, so /home/userB/.vim has been created with the wrong permissions.

If you try to start some other applications, like file managers (which create thumbnails, logs, etc) you will have many files all over the place, which have the wrong owner and permissions.

You can note that pwd displays your home directory and try the following on your computer:

as userA:

pwd
sudo -u userB pwd

both should give you /home/userA/, even though the second is running as userB

however, login as userB and then:

pwd

You will now see /home/userB/


Well, badblocks with writing enabled finds bad blocks on every attempt after rebooting. It is said that drives reallocate bad sectors themselves nowadays. This one not only has bad sectors always, but reallocated sector count is equal to zero according to S.M.A.R.T, regardless how many times I run badblocks.

It's interesting that once I set the number of tests badblocks perform to more than one, the first test found bad blocks, but subsequent tests found none. The bad blocks reappeared after reboot.

Once I've even cancelled the test and the drive stopped responding for a few days. (ATA error)

May someone explain that to me? (Disappearing and reappearing of bad blocks and especially the fact that the drive stopped responding and started responding again after few days.)


Ubuntu 14.10 Grub menu does not permit to choose Window 8.1

Do you mean that you see the GRUB screen, but keys do not work so you cannot boot anything except the default selection?

This can happen because you don't have USB Keyboard support enabled in your BIOS.


you ask a wide question. Hopefully I understood your point correctly and my few hints are useful.

Maybe first a bit of info about partitioning. Basically you could think of a fresh new disk like a excel table without lines. Basically a blank screen. When you partition a disk you put on the disk a structure. The analogy in Excel would be the grid lines that make an empty table. Obviously, there are many variable like how wide and high the cells are, how many cells in a row etc. A disk would be like an excel file. The term 'partitioning' means to put a structure in. Unfortunately there is another meaning of the term 'partition', a noun. In the excel analogy that is a sheet. You divide up the whole excel file into individual sheets. Each sheet is a partition. What the Excel analogy does not have is a kind of Table of Contents. That in fact are several tables. Each disk has a table that lists all partitions (i.e. sheets) on the disk. Then each partition also has a kind of table to tell it where which file can be found.
The matter gets complicated, because disks have been growing larger so much, that the first way of partitioning disks used numbers that were not large enough to be able to cover todays large drives, e.g. your 3TB drive. The borderline was 2GB maximum. So since 2006 there has been a new "partitioning scheme" introduces that is called 'GPT' GUID Partition Table. The concept is pretty simple, its a list with starting and end addresses of each partition. The old concept was the so called "Partition Table" in the "Master Boot record (MBR)", terms you might have come across. Thats basically the same. A table at the very first begin of the disk. The difference to GPT is that it uses smaller numbers and that it only has 4 table lines. That means you only can make 4 partitions. Thats actually not very much and has lead to the invention of an "Extended Partition". They are used until today in all computers that doe not run an "UEFI" BIOS. Its a pretty crude workaround where one of the 4 partitions is not really a partition but just a container for partitions inside. Since a container is not formally a partition, you can not boot from such a partition (at least not from windows). Linux is a lot smarter and has no problems doing that.
So partitioning itself is not really very complex. Complex it gets, because the two ways of partitioning are paired with a certain way to boot a computer. That differs very much between the "MBR scheme" and the "GPT scheme". The GPT scheme is used my modern computers with UEFI BIOS. The old bios is a pretty dump piece of code and quite linear. UEFI is more an operating system on its own and can have all sorts of modules. Its not easy to understand what it exactly does and how it works. It get worse, because the UEFI GPT scheme is downward compatible, that means it has a certain mode, so called "legacy mode" that should behave like the MBR scheme.

I am sure I totally lost you by now. Thats a good point to go into Wikipedia and read up about MBR and GPT. Also you should look into BIOS and UEFI. You'll get a good feeling about the complexity there and you will meet many terms from above again.
I'd recommend to get through that a bit, because some basic understanding can help you a lot as background knowledge when working with Linux in the long run.
The major thing you should remember is that whatever you do, you need to decide between UEFI/GPT and BIOS/MBR/'Uefi Legacy', because you can not mix those groups. That is disk wise. If you have installed on OS, say windows in UEFI mode, installing linux in BIOS/MBR mode is gonna make your disk inconsistent. Its extremly hard to correct that, sometime not possible and you may loose all data. Personally I struggle a lot with UEFI, because it behaves not exactly the same between all boards and is IMHO a lot more difficult to fix. All computers I maintain will use the old scheme. If the boards have UEFI bios I will use the UEFI legacy mode. Exception is only when a system disk is larger than 2GB, because then the old mode can not work any more. I can not see any disadvantage to use the older scheme. On the contrary, if you will meet some trouble, you can be sure there is not problem that someone did not have before your and fixed it with a description in the net. Thats quite different with UEFI. In your case I would install Linux on the SSD because its really large and linux does not require many resources.

I would start the live CD, run gparted, the partition editor, select the ssd and create 2 partitions.
1. a partition with the type "Linux swap" with 4GB (if you have 2 GB main memory)
2. a partition to have linux on it with 60GB, type "ext4" and in the box "mount point" select "/". The "/" just means that the whole Linux installation goes into that partition.
When you entered those in gparted you need to check the green check mark button, because it did not yet execute any of the changes you made.

Then I would run Install Linux, and in the selection where you want to install it you can select "other" and actually see the list of partitions you created and double check you are on the right disk. Then you select the linux disk with the "ext4" type and continue the dialog.

A final note to the very confusing way linux names its drives. You will see things like "sda", "sda1", "sdb1", "sdc". Linux has nothing like C: or D:. It takes quite a while to get used to that and its quite hard because you feel totally lost in the beginning. But you need to go through that. After a while you will get used to it because you are continually stumbling across those terms and grasp them. Its not too bad, because the system is very logic and actually predictable. That means you could often tell what the name a certain setup will have. The system is actually extremely helpful because it names disks and partitions even when they are not formatted. In Windows only a formatted disk has a name. Sometimes the C:, D: etc. get lost or mixed and your are in deep trouble. There are numbers but there is not deeper logic.

Right. Thats a long text. I apologies for all the typos. And I am really sorry to say that this is only a fraction of what you need to know about this "partitioning" to really get going.
Hopefully it provides a tiny little bit of orientation.

Cheers
CatMan


I posted a similar question recently. Am I the only one who finds it ironic that Canonical claims Ubuntu is touch optimised, yet touchscreens still do not work "out of the box" in Ubuntu 12.04 or 13.10?

Now a "sort of" fix. I have the same model & while touch screen does not work perfectly, you can make it work "relatively well" by putting your computer into suspend, wait 30 seconds, then wake it. My touch screen functions (although not with all of the capability it does in Windows) pretty well.


Internet Connectivity Indicator on Unity

The link you indicated is self explanatory. Even so, the necessary parts for implementing the script are:

Open up a console and type:

mkdir -p ~/scripts && cd ~/scripts
After that type the following

gedit pingtest.sh
Paste this code:

#!/bin/bash

if ping -c 1 -W 2 google.com > /dev/null; then
 echo "Up"
else
 echo "Down"
fi

Save the file
Again on the console

  chmod +x pingtest.sh

Then you have the file created, all you need is to follow the other steps indicated on the link you posted


Codeblocks16.01 in Ubuntu 16.04 stops working after opening the source file!

Well I found the solution, by disabling the the symbols browser problem is solved.

"Settings -> Editor -> Code completion -> Symbols browser -> Disable symbols browser"

But anyway it seems to be a problem since same version of code::blocks in Ubuntu 15 works fine.


Your system is setup to boot from harddrive rather from CD/DVD
Your harddisk does contain a non bootable OS (from the message, i guess it was windows)

Options:

Verify that your system is setup for booting from CD/DVD drive. Go into the BIOS settings and check the boot order
Verify the DVD (if not applicable to check from within the burning tool, test the disc with another computer it it boots correctly)
disconnect any USB harddrives or dongles during installation


If you go through the documentation on the dvd::rip site you'll be able to find the package there itself and instructions as well.

SOURCE:

  1.3.4 rar (for vobsub compression):

  Some special notes about the rar program. MPlayer supports vobsub
  files compressed with rar, but you need a 2.x version, 3.x and higher
  doesn't work. You can get a 2.x version locally from here:

  http://www.exit1.org/dvdrip/contrib/rarlnx271.sfx.bin

  I suggest to install the binary to e.g. /usr/local/bin. Then configure
  this path using the Preferences dialog.

EDIT:

First you need to open terminal and copy the file from its location to /usr/local/bin.
Then make the file executable
Run the file.

Example : (if the file got downloaded in my Downloads directory)

cp ~/Downloads/rarlnx271.sfx.bin /usr/local/bin/      #copies the file
cd /usr/local/bin/                                    #changes working directory
chmod +x rarlnx271.sfx.bin                            #makes file executable
./rarlnx271.sfx.bin                                   #runs the file


In /etc/default/keyboard you have:

XKBLAYOUT=us
XKBVARIANT=rus

which means that you have the Russian (US, phonetic) keyboard layout in the console.

To make it match your GUI settings, you probably want:

XKBLAYOUT=us,ru
XKBVARIANT=,


Accidentally deleted healthy UEFI partition

You can try boot-repair but if you deleted UEFI partition I don't think it will work.


Where can I report a bug for apps.ubuntu.com?

Ubuntu web catalog
Found it by searching google for "apps.ubuntu.com" site:launchpad.net -oneconf which shows bugs for apps.ubuntu.com in Ubuntu Web Catalog.


Do Sony cameras with memory stick work with Ubuntu?

Yes you can connect it to Ubuntu with out any problems and It will usually detect as a Memory card that similar to Connecting your mobile SD card to Ubuntu system.

You can synchronize them also.

Here a list of best image viewers & by clicking it them you can find features.

Alternative image viewers


Are you looking for auditd.conf? Try man auditd.conf...

If, per your comment, that also gives you an error, then you need to install the package first, see Volker's answer.


Can't select the drive to install Ubuntu

I made the mistake to delete the partition I created in Windows, to install Ubuntu in as I selected the option to install Ubuntu along side Windows and I thought the partition useless, so I deleted. Then whenever my pc booted, the bootloader, only displayed a console. I went through the process of deleting the bootloader from my EFI partition in Windows and then creating a new partition for Ubuntu.
TLDR: Make sure to delete the bootloader, create a new partition to install Ubuntu and don't delete it!


uninstalling and reinstalling 13.04 to a different hard drive

Pop up in the CD that has the Ubuntu install, and click Try Ubuntu when it loads. Click Dash (in the top left) and search for GParted. When the application opens up, on the top right, you should see a drop down arrow to scroll between different hard drives. Scroll between all of them, and (assuming you don't have any important data on this computer), delete all of the partitions so you can start fresh. You can do this by highlighting a partition and clicking the X, then the checkmark to verify that you want to delete the partition. Again, please be sure that the partition doesn't contain anything important before you delete it.. When this is all done, it should say unformatted or unallocated. After you have erased your previous Ubuntu installation, click Install Ubuntu, and go through those steps. When it reaches the step about where you want to install Ubuntu, do not click the Something Else option. Just let Ubuntu do it for you, but make sure you are installing it on a hard drive that does have enough disk space.


Failed to get size of gamma for output default when trying to add new screen resolution

You don't need sudo to register the new mode with xrandr, try without sudo.
Then you'll have to apply the new resolution with:

xrandr --addmode <your_connection_type> 1200x1000_60.00

Where <your_connection_type> is usually VGA1, DP1 or HDMI1. Check the output of xrandr to know the exact name of the connected output.


Disk read error occured in dual boot ubuntu and windows 7

I had to install Grub on to Ubuntu partition:

sudo grub-install /dev/sda1 --force

Then I repaired the MBR with windows recovery CD.

After that I booted to windows and installed EasyBCD (do not forget to install NeoGrub from the app).

And now I have a functional double boot machine with Windows 7 and Ubuntu on the same disk.


How do I prevent Duplicity from looking at every file in parent folders?

After digging in the source code as retrieved by apt-get source duplicity, I conclude that it's not possible without modifying the source code and its algorithm.

The way duplicity works:

Scan the *source_directory* for entry
For each entry found, do a lstat() call. This is used to determine the inode type (e.g. regular file or directory). The result will be cached for this entry
If the entry exists...

and is a symlink, the destination will be read using readlink
and is a regular file or directory, access() will be called to detect whether the entry is readable or not
if the entry is readable, it will be tested by each selection function (set by options like --include and --exclude)

This looks very reasonable and unless disk access is very slow (NFS?), there is no need to change this algorithm to do the path check before the stat calls.


How to set up simple static Ethernet connection?

Try using an Ethernet hub or switch to connect the two machines. If the machines are old then you can't use a conventional UTP cable to connect them.  (You can use a crossover cable.)  Even if the machines are new and are equipped with Auto-MDIX, what can happen is that both machines have their Ethernet ports switched off and niether one will switch its port on until connected to a peer with an enabled port.


Can't find lubuntu restricted access extras

Enable the multiverse repository and then update it.Finally install lubuntu-restricted-extras by running the below commands.

sudo apt-get update
sudo apt-get install lubuntu-restricted-extras


Ubuntu 19.04 Can't change LockScreen Background

in Ubuntu 19.04

the file /usr/share/gnome-shell/theme/Yaru/gnome-shell.css will do what you are looking for.

Edit on 10th Jan 2020

you may also have a detailed look on this page https://github.com/PRATAP-KUMAR/login-lock-screen-bg-change for setting the backgrounds via script for Ubuntu 18.04, 19.04 & 19.10


Hardware does not support unity after reboot

Installing Unity-2D by running the following commands may help you:

How do I install and switch to the Unity 2D desktop?


How to update kde version to kde plasma 5 on Kubuntu 14.04.3?

Neon has been replaced by Kubuntu CI (https://launchpad.net/~kubuntu-ci/+archive/ubuntu/stable). In any case this is a release for KDE developers. There is also a new KDE Neon project which can serve to install up-to-date KDE, but is currently also only available as unstable release (and not intended for Kubuntu 14.04).
http://neon.kde.org.uk/download

The solution is to update your Kubuntu to version 15.10
http://www.kubuntu.org/news/kubuntu-15-10/
which will give you a Plasma 5 version already.

Then you may add kubuntu-backports ppa to get recent bugfixes. The above mentioned KDE Neon project can then also be installed through a ppa, but be aware that this controversial project just started and stable releases are not yet available.

Possibly related question: Now when there is no neon/kf5 ppa, how can I install KDE 5 in gnome Ubuntu 14.04?


How do I pre-install a program on a Live CD to boot?

The comments above link to lots of options. If you choose to use Cubic, here are some detailed steps:

Install the software:
sudo apt-add-repository ppa:cubic-wizard/release
sudo apt update
sudo apt install --no-install-recommends cubic

Create a new project:
Launch Cubic.
On the first page, select a new empty directory. (For example, /home/tank/my_live_cd).
Click Next
On the Project page, select your original ISO. (For example ubuntu-21.04-desktop-amd64.iso).
Default values will be automatically filled out, so just click Next.

When you get to the Terminal page, copy your deb file:
mkdir Temp
cd Temp

Drag program.deb onto Cubic's Terminal area to copy it into your new Temp directory.

Then, install your package from your program.deb file:
apt-add-repository universe
apt-add-repository multiverse
apt install --no-install-recommends gdebi-core
gdebi program.deb

Remove unnecessary files.
apt autoremove --purge gdebi-core
cd ~
rm -rf Temp

Click through the next pages, accepting the defaults:
On the Terminal page, click Next.
On the Packages page, click Next.
On the Options page, click Next.
On the Compression page, click Generate.
On the Generate page, click Finish.
Click the Close button to exit the application.

Finally, Create a bootable USB, CD, or DVD using your new Live ISO file.


Is it possible to restore a file saved on a live-USB?

No it is not possible because you boot the pc via removable disk and when you remove the pen drive all the files and setting will reset..


what's going in /usr/bin/gnome-terminal?

The single process /usr/lib/gnome-terminal/gnome-terminal-server is the process handling all of your gnome-terminal windows.

The command gnome-terminal fires up gnome-terminal-server if it's not already running, or connects to the existing instance and asks it to open a new window.

If each invocation of the command gnome-terminal opened a new window itself and so each terminal window was handled by its own separate process, you wouldn't be able to drag-n-drop tabs across them. This is I belive the most important reason behind this design. There might be other reasons as well, I'm not sure.


How to mount network drive so that it can be used from applications and on wifi

Then I tried to use the "Connect to server" in Nautilus. This looked very promising and it sort of works. Only down side is that places connected with that option do not show up in browsers upload file dialog

Nautilus mounts those files under ~/.gvfs/share_name and they are available in the browsers upload file dialog from that directory too. Maybe the dialog hides that folder, because it is hidden, just press CTRL+H in the dialog to toggle showing hidden files/directories and browse to that folder.

To mount the same way as Nautilus mounts just use the command

gvfs-mount "ssh://user@host:port"

(Obviously filling out the parts correctly.) You can make a simple bash script with that command:

#!/bin/bash
sleep 20
gvfs-mount "ssh://user@host:port"

make it executable and make that script autostart with your login. (e.g. by typing "startup" in Dash and using the "startup applications" app to set it up.) This script will wait 20 seconds after startup to mount the share, if you need more or less time for the wifi to come up just change the number in the script to the seconds you want.


Block Unity keyboard shortcuts when a certain application is active

How to automatically disable multiple (specific) shortcuts if (and as long as) a specific application's window is active

The script below will disable specific key shortcuts when an arbitrary application's window is active.

Although you mentioned""I'd be willing to run a script every time I launch the application.", There is no reason to kill the script afterwards, it is extremely low on juice.

The script

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

app = "gedit"

f = os.path.join(os.environ["HOME"], "keylist")

def run(cmd):
    subprocess.Popen(cmd)

def get(cmd):
    try:
        return subprocess.check_output(cmd).decode("utf-8").strip()
    except:
        pass

def getactive():
    return get(["xdotool", "getactivewindow"])

def setkeys(val):
    # --- add the keys to be disabled below
    keys = [
         ["org.gnome.settings-daemon.plugins.media-keys", "logout"],
         ["org.gnome.settings-daemon.plugins.media-keys", "screensaver"],
        ]
    # ---
    writelist = []
    if not val:
        try:
            values = open(f).read().splitlines()
        except FileNotFoundError:
            values = []
        for i, key in enumerate(keys):
            try:
                cmd = ["gsettings", "set"]+key+[values[i]]
            except IndexError:
                cmd = ["gsettings", "reset"]+key
            run(cmd)
    else:
        for key in keys:
            cmd = ["gsettings", "set"]+key+["['']"]
            read =  get(["gsettings", "get"]+key)
            writelist.append(read)
            run(cmd)

    if writelist:
        open(f, "wt").write("\n".join(writelist))

front1 = None

while True:
    time.sleep(1)
    pid = get(["pgrep", app])
    if pid:
        try:
            active = get(["xdotool", "getactivewindow"])
            relevant = get(["xdotool", "search", "--all", "--pid", pid]).splitlines()
            front2 = active in relevant
        except AttributeError:
            front2 = front1
    else:
        front2 = False
    if front2 != front1:
        if front2:
            setkeys(True)
        else:
            setkeys(False)

    front1 = front2

How to use

The script needs xdotool:

sudo apt-get install xdotool

Copy the script into an empty file, save it as disable_shortcuts.py
In the head of the script, replace in the line:

app = "gedit"

"gedit" by your application, meaning: the process name that owns the window.
Test-run the script by the command:

python3 /path/to/disable_shortcuts.py

If all works fine, add it to Startup Applications: Dash > Startup Applications > Add. Add the command:

/bin/bash -c "sleep 15 && python3 /path/to/disable_shortcuts.py"

Adding more shortcuts to be disabled

As an example, I added the shortcut you mentioned: CTRL + ALT + L. Shortcuts are set in the dconf database, and can be set or disabled using gsettings.

In the script, these gsettings entries are set in the function: setkeys()

def setkeys(val):
    # --- add the keys to be disabled below
    keys = [
        ["org.gnome.settings-daemon.plugins.media-keys", "screensaver"]
        ]
    # ---

An example to add (disabling) the log out shortcut:

Open a terminal window, run the command dconf watch /
Open System Settings > "Keyboard" > "Shortcuts" > "System"
Re-set the shortcut to itself. In the terminal, you can see the gsettings key that belongs to the shortcut:

Now we have to add the found key (in a slightly different appearance):

["org.gnome.settings-daemon.plugins.media-keys", "logout"]

...to the "keys" list in our function:

def setkeys(val):
    # --- add the keys to be disabled below
    keys = [
        ["org.gnome.settings-daemon.plugins.media-keys", "screensaver"],
         ["org.gnome.settings-daemon.plugins.media-keys", "logout"],
        ]

Now both CTRL + ALT + L and CTRL + ALT + Delete are disabled if your application is in front.

Explanation

As mentioned, shortcuts, like the ones you mention, are set in the dconf database. In the example CTRL + ALT + L, the key to set or edit the schortcut is:

org.gnome.settings-daemon.plugins.media-keys screensaver

To disable the key, the command is:

gsettings set org.gnome.settings-daemon.plugins.media-keys screensaver ""

To reset the key to its default value:

gsettings reset org.gnome.settings-daemon.plugins.media-keys screensaver

The script looks once per second if:

your application runs at all
if so, it looks if any of its windows is active
again (only) if so, it disables the shortcuts, listed in

# --- add the keys to be disabled below
keys = [
    ["org.gnome.settings-daemon.plugins.media-keys", "screensaver"],
     ["org.gnome.settings-daemon.plugins.media-keys", "logout"],
   ]

...waiting for the next change in state.

If the active window is not one of your application any more, the keys, mentioned in the list, are reset to default.

Note

As mentioned earlier, the additional burden to the processor of the script is nihil. You could very well run it on startup, as explained in "How to use".

Affecting multiple applications

As discussed in comments, in OP's specific case, it is useful to apply disabling shortcuts on a group of applications, all residing in one directory.

Below a version to apply this on all applications of which the output of

pgrep -f

will include a specific directory. In my example, I set the /opt directory, so if the active window is one of any of the applications in /opt, the set shortcuts will be disabled.

bringing a window of one of the applications in /opt to front will disable the logout shortcut

re- enabling the shortcut if another window gets focus

The script

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

appdir = "/opt"

f = os.path.join(os.environ["HOME"], "keylist")

def run(cmd):
    subprocess.call(cmd)

def get(cmd):
    try:
        return subprocess.check_output(cmd).decode("utf-8").strip()
    except:
        pass

def getactive():
    return get(["xdotool", "getactivewindow"])

def setkeys(val):
    # --- add the keys to be disabled below
    keys = [
         ["org.gnome.settings-daemon.plugins.media-keys", "logout"],
         ["org.gnome.settings-daemon.plugins.media-keys", "screensaver"],
         ["org.gnome.desktop.wm.keybindings", "begin-move"],
        ]
    # ---
    writelist = []
    if not val:
        try:
            values = open(f).read().splitlines()
        except FileNotFoundError:
            values = []
        # for key in keys:
        for i, key in enumerate(keys):
            try:
                cmd = ["gsettings", "set"]+key+[values[i]]
            except IndexError:
                cmd = ["gsettings", "reset"]+key
            run(cmd)
    else:
        for key in keys:
            cmd = ["gsettings", "set"]+key+["['']"]
            read =  get(["gsettings", "get"]+key)
            writelist.append(read)
            run(cmd)
    if writelist:
        open(f, "wt").write("\n".join(writelist))

front1 = None

while True:
    time.sleep(1)
    # check if any of the apps runs at all
    checkpids = get(["pgrep", "-f", appdir])
    # if so:
    if checkpids:
        checkpids = checkpids.splitlines()
        active = getactive()
        # get pid frontmost (doesn't work on pid 0)
        match = [l for l in get(["xprop", "-id", active]).splitlines()\
                 if "_NET_WM_PID(CARDINAL)" in l]
        if match:
            # check if pid is of any of the relevant apps
            pid = match[0].split("=")[1].strip()
            front2 = True if pid in checkpids else False
        else:
            front2 = False
    else:
        front2 = False
    if front2 != front1:
        if front2:
            setkeys(True)
        else:
            setkeys(False)
    front1 = front2

How to use

Like the first script, xdotool needs to be installed:

sudo apt-get install xdotool

Copy the script into an empty file, save it as disable_shortcuts.py
In the head of the script, replace in the line:

appdir = "/opt"

"/opt" by the directory your applications are.
Test-run the script by the command:

python3 /path/to/disable_shortcuts.py

If all works fine, add it to Startup Applications: Dash > Startup Applications > Add. Add the command:

/bin/bash -c "sleep 15 && python3 /path/to/disable_shortcuts.py"

Adding other shortcuts to the list works exactly similar to version 1 of the script.

Does it work on all applications?

In your answer, you mention:

  xprop does not reveal PIDs for all windows. Failing example: stopwatch.

Windows with pid 0 (like tkinter windows, including Idle), have no window- id in the output of xprop -id. Idle does not have any clashing shortcuts though in my experience. If you run into any application with pid 0 that would require disabling specific shortcuts, please mention.

In that case, a possible escape would be to convert the output of

xdotool getactivewindow

to hex, the format wmctrl uses, and subsequently look up the corresponding pid in the output of

wmctrl -lp

Although that seemed the most obvious thing to do to start with, I didn't use it in the script to keep the script as light-weight as possible.


How to install vte-ng from the source: make command fails

First you should generate the Makefile from Makefile.am. For this follow the below instructions:

Make sure you have autoconf, libglib2.0-dev(for AM_GLIB_GNU_GETTEXT macro), gtk-doc-tools installed.

sudo apt-get install autoconf libglib2.0-dev gtk-doc-tools

Get inside extracted source folder, then run autoreconf

cd ./vte-ng-0.42.4.a
autoreconf

If you got any error run

automake --add-missing

Finally, build and install

./configure && make && sudo make install


I have problems with bluetooth mouse and bluetooth headphones simultanously in Ubuntu 20.04

It seems to be that the firmware for bluetooth of my notebook is sometimes in a invalid state (it does not respond to any command given like connecting or pairing). After turning my laptop completely off and on again it magically works.


I am stuck on this step of starting up an ubuntu virtualmachine using virtualbox. Please help

The error message on top may be related to a wrong graphics adapter in your VirtualBox settings.
You may try some different settings for the adapter and see what happens.


How do I solve this "unexpected '}' syntax error" in my bash script?

You're missing a fi statement to close the first if/then/else conditional.


Autodesk Maya symbol lookup error on start after installing AMD proprietary driver on Ubuntu 18.04

I was just debugging the same issue. This happens for the following reason. Most of the maya installation guides on ubuntu involve creating a symbolic link of libssl.so inside the maya installation (naming it libssl.so.10) so maya can load the ssl library. (since it looking for this specific name) However, ubuntu 18 has both libssl1.0 and libssl1.1 installed. 1.1 is missing the EVP_CYPHER_CTX_init symbol, (amongst some other ones) so you have to create a symlink pointing to libssl.so.1.0.0 instead of libssl.so.

Ie, run this command:

 sudo ln -sf /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/autodesk/maya2018/lib/libssl.so.10


To provide an answer to this question, I'll sum up the information from the comments:

To find out what the problem is, we checked first if the installed RAM (8GB) is recognized by the system with

free -m

which showed total available RAM of 7673 MiB, so we know RAM is recognized.

In the second step we used

top -%MEM

which will list the running processes sorted by memory usage in percent.

Several processes, all named HAVP were using up to 60% of memory. This processes belong to
HAVP, a proxy antivirus application. Uninstalling HAVP from the system solved the problem with the high memory usage.


Installing Windows 7 on Ubuntu via USB (without boot screen available!)

Is there ANY way for me to install Windows through Ubuntu, without using the BIOS screen?

Yes: Install virtualbox with sudo apt-get install virtualbox
under Ubuntu and Install Windows 7 in a Virtual Machine under virtualbox


How to install Ubuntu13.04 with windows xp & remove windows xp?

Installing any recent version of Ubuntu  is pretty much the same and there are plenty of tutorials out there.

If you have a current OS, XP or anything else, you can use this guide Use the steps given

If you do not have a current OS, you can just boot the system from your Ubuntu DVD and follow this installation guide.


Finally I have managed it with this official QT snapshot
You just need to download the tar.gz and unpack

./configure -webkit -nomake demos -nomake examples
make && make install

If you have problems with gold-liner, you should comment this line in /src/3rdparty/webkit/Source/common.pri

# QMAKE_LFLAGS+=-fuse-ld=gold


Virtualbox 5.23 Ubuntu 18 VM not running on another machine under Virtualbox 4.3.40

You can't expect any software to work when you're downgrading that far. Version 5 added a lot of new features; just upgrade your COLLEAGUE machine to v5.23 and you should be fine.


How can I make my Lubuntu 11.10 menus look like in 11.04?

You can change the theme of your Lubuntu desktop. Click the LXDE button, go to Preferences and choose Customize Look and Feel. Choose your desired Icon Theme, Windows Border, Color, Widget and other UI options.


How do I reset my display settings from the command line?

Here's what worked for me:

In a terminal, type:

xrandr

You'll see various modes, which look something like this:

eDP1 connected 1440x900+0+0 (normal left inverted right x axis y axis) 30mm x 179mm
   1440x900       60.0*+   59.9
   1360x768       59.8     60.0
   1152x864       60.0
   1024x768       60.0
   800x600        60.3     56.2
   640x480        59.9
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
   2560x1440_30.00   29.9

In my case, HDMI1 was the external monitor.

So, I just ran:

xrandr --delmode HDMI1 2560x1440_30.00

Now, when I plugged in the external monitor, it was as if it was the first time Ubuntu saw it.


How do I make links to web-sites and directories?

A neater (I think) and generic solution occurred to me during a nice cup of coffee. What I really wanted with these links was open the website in Firefox and the directory in the Files manager. So why not start these with the URL or pathname as parameters.

In /usr/share/applications I already discovered starter text files for the graphical programs in Ubuntu. So I copied these to the desktop and added the parameters. That worked just fine.

For example: I now have the following (stripped to the bare minimum) starters on my desktop. Don't forget to give them Executable permissions using Properties.

#Open a directory in Files:
[Desktop Entry]
Name=Weetjes
Exec=nautilus --new-window "/media/gus/Toshiba H3TB Internal/work/Ubuntu/Weetjes"
Icon=/home/gus/Pictures/UsedIcons/folder-documents.svg
Type=Application

#Open a web-page in Firefox
[Desktop Entry]
Name=Ixquick
Exec=firefox https://www.ixquick.nl/ned/advanced-search.html?hmb=1
Type=Application
Icon=/home/gus/Pictures/UsedIcons/ixquick.png

#Start my favorite Windows-only text editor using Wine
[Desktop Entry]
Name=Notepad++
Exec=wine start /unix /home/gus/WinApps/Notepad++/Notepad++.exe
Type=Application
Icon=/home/gus/Pictures/UsedIcons/Notepad++.png


It is possible.
Open the terminal in a workspace using the shortcut:

Ctrl+Alt+T

Switch the workspaces using

Ctrl+Alt+←↑→↓

Again Open another terminal using the same keys or
if you have opened two terminals in the same workspace, you can switch to other workspaces using the shortcut

Ctrl+Shift+Alt+←↑→↓


Unfortunately Apple hardware tends to not work so great with Ubuntu for some reason. I have ran Ubuntu on Macbooks and they have always had problems. I just stick to Virtualizing Ubuntu on Mac OSX.

One thing that might help is doing a fresh install and trying to just stick to the ubuntu-tested software. Don't install any proprietary drivers or anything, just stick to the ubuntu-tested drivers and all of that stuff. Don't try to install the latest kernel or any of that. If that works well, then you can start installing drivers until you figure out which drivers are screwing it up.


What is my computer IP address knowing that I have a router?

Okay, others have already answered but I've typed too much to hit cancel :P

To access computers inside your home network from an outside network, you need to use the IP address displayed by whatismyip.org.  192.168.1.101 in this case is your internal LAN IP address assigned to your system by your router via DHCP.  The outside world does not see this.  As your router handles incoming and outgoing network traffic, it translates between your "real" IP address and the various internal IP addresses inside your network.  This is called Network Address Translation or NAT for short.  Wikipedia has a nice analogy:

  A NAT device is similar to a phone system at an office that has one
  public telephone number and multiple extensions. Outbound phone calls
  made from the office all appear to come from the same telephone
  number. However, an incoming call that does not specify an extension
  cannot be transferred to an individual inside the office. In this
  scenario, the office is a private LAN, the main phone number is the
  public IP address, and the individual extensions are unique port
  numbers

You'll also need to setup some port forwarding rules on your router.  The instructions for this depend on what kind of router you have but the basic idea is that you are telling your router: "Hey, if you see any incoming traffic on port 22, send it to the computer that has 192.168.1.101 as its IP address".  Of course, change the port number and ip addresses as suits whatever it is you are trying to use.

You can usually access your router's configuration settings by opening a browser and typing in 192.168.1.1 or 192.168.1.0 for the address.  You can execute netstat -rn and look at the last line to find the correct address if you are not sure.

Now comes the tricky part.  Unless you tell your router "Always give this computer the IP address 192.168.1.101", there is no guarantee it will always be that...but it probably will.  Moreover, your public IP address is probably also assigned via DHCP from your Internet service provider.  So, if you reset your modem or if enough time goes by, your public IP address can also change and you'll have to look it up again at whatismyip.org.  There are ways around these issues but I've typed enough for now and I think it's a separate question.  Hope that clears some stuff up!


How to add volume visual feedback to i3 window manager?

if you are using i3status for your status bar you can look here:

https://i3wm.org/i3status/manpage.html#_volume


Its a bug in cups-pdf.
After installation, cups's pdf-printer doesn't get configured properly. To get it working you do the following:

Open a web-browser, and go to http://localhost:631.
Go to Administration > Manage Printers > (your pdf printer) > Modify Printer.
Provide your login credentials.
Click Continue for the connection and name page.
On the third page, when you are asked to enter the model of the printer, click Choose File, to select the PPD file.
Navigate and select /usr/share/ppd/cups-pdf/CUPS-PDF.ppd.
Click Modify Printer.
Go to Terminal and restart cups using the command:

sudo service cups restart

and voila! you are done.

PDFs will get printed in your /home/username/PDF directory.


How to delete KDE plasma desktop envivornment in Kubuntu?

Do sudo apt-get purge kde-desktop then reboot and login to another desktop. Hope this helps!


Following the guide of Cyberciti for bash arithmetic you are not using the correct method. To make arithmetics operations this is the format:

  $((expression))

So in your case this would be the right variable assignment:

export end_day=$(( $start_day+(((($start_day*24)+84)/24)-((($start_day*24)+84)%24)) ))
export end_hour=$(( ($start_day*24+84)%24 ))

NOTE: this need to be tested, not sure if results are correct.


If all else fails you might wish to get support from http://www.dell.com/support/home/us/en/04/product-support/product/xps-13-9343-laptop/manuals

I checked the certified models and your is listed as certified (as Pre-installed by the manufacturer for 14.04), it's not certified for 16.04


You probably want to use gksudo if you want to start it from your Desktop. That will open a window asking you for your password.

#!/bin/bash
gksudo -u userA bash -c 'PACKAGE_PATH=/home/userA/package1; cd /home/userA/scripts'

Also to debug, you probably want to run that script in your terminal first. That way it will not close just after printing some error messages.

Update

One way to do that is to create a file as follow:

/home/user_name/.gnome2/panel2.d/default/launchers/script_name.desktop

Then put something like this in it:

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=gdu-category-peripheral
Name[en_US]=Receiving fax
Exec=gksu /usr/bin/gnome-terminal
Comment[en_US]=Some description...
Name=My Script
Comment=Start my script
Icon=gnome-panel-launcher

That works great for me, in general. The gnome-terminal accepts parameters so you can change various settings.

Use --working-directory=... instead of your cd ... command. To get specific variables, you probably want to use the --profile=... option.

Exec=gksu -u userA /usr/bin/gnome-terminal --profile=/home/userA/profile --working-directory=/home/userA/scripts

Then create the profile script for the variable:

# In /home/userA/profile
PACKAGE_PATH=/home/userA/package1

Obviously you could add any other alias or anything else you need in the profile script.


Shell script to extract data from a file and store into another file as a csv

here is what I would work around :
sed '/noScreen/ !d ; s/.*\(CLAS[0-9]\{4\}:\).*\(class=.*\).*/\1\2/ ; s/class=.//; s/.\/.*//'

francois@zaphod:~/tmp$ cat toto

Intranet:
CLAS1206: Web Infrastructure (2019-2020)

Intranet:
CLAS1234: Web Infrastructure (2019-2020)

Intranet:
CLAS5678: Web Infrastructure (2019-2020)

francois@zaphod:~/tmp$ sed '/noScreen/ !d ; s/.*\(CLAS[0-9]\{4\}:\).*\(class=.*\).*/\1\2/ ; s/class=.//; s/.\/.*//' toto
CLAS1206:hide
CLAS1234:testline2
CLAS5678:testline3
francois@zaphod:~/tmp$

/noScreen/ !d  # grep the lines you need
s/.*\(CLAS[0-9]\{4\}:\).*\(class=.*\).*/\1\2/  # substrings CLASxxxx and class=
s/class=.//; s/.\/.*//' # substring to manage tailing chars
tips :
whenever it is possible (maybe all the time), choose only one language or tool for one action  (do not use grep+sed+awk or even 2 of them) keep your scripts simple


First things to do on fresh install of Ubuntu 14.04.3

Here a fine link, have fun and enjoy Ubuntu http://howtoubuntu.org/things-to-do-after-installing-ubuntu-14-04-trusty-tahr


There are two problems here.

1) You are not using a cloud, but instead using a hypervisor. This is fairly easy to work around - the Ubuntu Cloud Image developers made a path for this usage many years ago. See the Ubuntu Wiki for the step-by-step procedure. You must create a seed file to add your own password, then add your seed file to the cloud-image.

2) Unfortunately, the cloud-tools you need to edit the cloud-image are written for Linux, and don't work on Windows.

If you are already comfortable with Linux, you can use an Ubuntu LiveUSB environment to generate the seed-file and edit the cloud-image.

If this is your first time using Linux, then I would recommend using the normal Server Image instead of a Cloud Image.


gpg2 locate keys wont work (immediately returns)

I also couldn't have gpg2 --locate-keys working. Here are steps that worked for me.

Download kernel:

$ curl -O https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.15.10.tar.xz
$ curl -O https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.15.10.tar.sign

Unzip kernel:

$ unxz linux-4.15.10.tar.xz

Try to verify kernel:

$ gpg2 --verify linux-4.15.10.tar.sign
gpg: assuming signed data in 'linux-4.15.10.tar'
gpg: Signature made Thu 15 Mar 2018 12:57:15 PM MSK
gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
gpg: Can't check signature: No public key

Verification will fail , but you will get RSA key fingerprint: 647F28654894E3BD457199BE38DBBDC86092693E. Now receive corresponding public key with gpg2 --recv-keys:

$ gpg2 --recv-keys 647F28654894E3BD457199BE38DBBDC86092693E
gpg: key 38DBBDC86092693E: public key "Greg Kroah-Hartman <gregkh@linuxfoundation.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1

Now you have public key for mentioned above fingerprint. If you verify kernel again, you will get warning:

$ gpg2 --verify linux-4.15.10.tar.sign
gpg: assuming signed data in 'linux-4.15.10.tar'
gpg: Signature made Thu 15 Mar 2018 12:57:15 PM MSK
gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
gpg: Good signature from "Greg Kroah-Hartman <gregkh@linuxfoundation.org>" [unknown]
gpg:                 aka "Greg Kroah-Hartman <gregkh@kernel.org>" [unknown]
gpg:                 aka "Greg Kroah-Hartman (Linux kernel stable release signing key) <greg@kroah.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 647F 2865 4894 E3BD 4571  99BE 38DB BDC8 6092 693E

Just as official kernel.org page says, you may opt to use TOFU trust model and verify kernel using it:

$ gpg2 --tofu-policy good 647F28654894E3BD457199BE38DBBDC86092693E
...
$ gpg2 --trust-model tofu --verify linux-4.15.10.tar.sign
gpg: assuming signed data in 'linux-4.15.10.tar'
gpg: Signature made Thu 15 Mar 2018 12:57:15 PM MSK
gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
gpg: checking the trustdb
gpg: no ultimately trusted keys found
gpg: Good signature from "Greg Kroah-Hartman <gregkh@linuxfoundation.org>" [full]
gpg:                 aka "Greg Kroah-Hartman <gregkh@kernel.org>" [full]
gpg:                 aka "Greg Kroah-Hartman (Linux kernel stable release signing key) <greg@kroah.com>" [full]
gpg: gregkh@kernel.org: Verified 1 signature in the past 0 seconds.  Encrypted 0 messages.
gpg: gregkh@linuxfoundation.org: Verified 1 signature in the past 0 seconds. Encrypted 0 messages.
gpg: greg@kroah.com: Verified 1 signature in the past 0 seconds. Encrypted 0 messages.

Verification is done. TOFU trust model is saved as default, so later you may use just gpg2 --verify linux-4.15.10.tar.sign to make further verifications.


Touch App with QML Extension Library does not run on device or emulator, only desktop

You need to install intltool in the chroot in which you're building your binaries.

In Qt Creator, select Tools > Options... and choose the Ubuntu item from the list at left.  Select the Click tag, and then click the Maintain button next to the appropriate build target.  This will open a terminal with a root shell inside the chroot.  From here, use apt-get to install intltool and whatever else you need to compile your project.  If you have multiple chroots, repeat this with each.


SSH connection failing since I changed server port number

First of all, once you change the port at the server you have connected with the -p switch.
As you are not able to connect even with the -p option, it is definetly an issue of the firewall.
Check if ufw is enabled in the server using ufw status.

If ufw is enabled in the server, try running

ufw allow 1993/tcp

on the server. This should work.

If your system does not have ufw, try disabling the firewall by flushing iptables and stoping the firewalld service.


How to access mounted online accounts from filesystem?

In reference to when you got this output from ls:

lrw------- 1 ray 0 Jan 19 15:56 1IkBP3RVzCkMPO8UYI8LFyLo71rCOhbEirSMuS39GxUc
lrw------- 1 ray 0 Jan  5 10:06 1JkZJuIN4U-XwOLfKmYr3-0Y2KYQMQ_EmVrZPj1i1AMI
lrw------- 1 ray 0 Jun 15  2018 12TmyqxUuLFQIktoec0Pe2ygDVPVx9YsDfi6tS2hAXFc
drwx------ 1 ray 0 Jun 15  2018 1E3zpESlcc90ZmhjztC4HD22chifWHUkk/
lrw------- 1 ray 0 Jun 15  2018 1uUnjOG172XdBQ1fLe6AbslNjsHiTK-IaUpzImwkwSbc
lrw------- 1 ray 0 Jun 15  2018 1PhljWusfB-JWfKSu3xqzSzCOqztgDTEDWqfG3E2KioQ

Those are actually the names of the google drive files and directories themselves and is how google manages data (useful in versioning files and having multiple files with the same name).  The human readable names are just bits of metadata attached to each file.  Once you're in your google drive directory you can use the gio interface to view those human readable file names with this:

gio list -d

That prints what gnome calls the display names of each file.

Just man gio for other gio list options like --long, --hidden, etc.

In that man page you'll also see other gio commands for manipulating your cloud files from a terminal.  Unfortunately I have yet to find or figure out a good approach to wrapping the standard shell commands around the gio commands for a more seamless experience (like the way Google Drive File Stream just works when accessing files from a terminal on Windows or macOS).  I'll update this answer if I find a good solution.

That said, this is all an attempt to just use the Gnome's integrated cloud drive interface because it is dead simple to set up and seems to preform well in the Nautilus GUI.  But there are alternatives such as rclone and ocamlfuse which both work pretty well but can be difficult to configure especially in terms of maximizing speed.


Install a .terminal file to change Terminal color scheme - Ubuntu Gnome

The main problems with those themes is they are in Apple's (probably proprietary) format. So you have to decode bits and pieces to find what is used.

You can get the RGB value of each color in this itermcolors version of the theme, or perhaps the original Atom theme - you should then be able use the colour info from those to edit the profile colors:

To some extent, you can also decode some other sections of the theme using base64 - e.g. to find the font by decoding this bit:

$ echo "YnBsaXN0MDDUAQIDBAUGGBlYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKQHCBESVSRudWxs1AkKCwwNDg8QVk5TU2l6ZVhOU2ZGbGFnc1ZOU05hbWVWJGNs
YXNzI0AkAAAAAAAAEBCAAoADXxAVU291cmNlQ29kZVByby1SZWd1bGFy0hMUFRZaJGNs
YXNzbmFtZVgkY2xhc3Nlc1ZOU0ZvbnSiFRdYTlNPYmplY3RfEA9OU0tleWVkQXJjaGl2
ZXLRGhtUcm9vdIABCBEaIy0yNzxCS1JbYmlydHZ4kJWgqbCzvM7R1gAAAAAAAAEBAAAA
AAAAABwAAAAAAAAAAAAAAAAAAADY" | base64 -d ; echo
bplist00�X$versionX$objectsY$archiverT$top��U$null�

VNSSizeXNSfFlagsVNSNameV$class#@$��_SourceCodePro-Regular�Z$classnameX$classesVNSFont�XNSObject_NSKeyedArchiver�Troot�#-27<BKR[birtvx�����������

From that we can guess the font is Source Code Pro (Regular).

I also found this which may be able to convert the theme to a json format, the issue is it needs libplist integrated with python to work:

$ python ./osxterminalthemer.py --convert json ./One\ Dark\ 0.7.0.terminal
/bin/sh: plutil: command not found
Traceback (most recent call last):
  File "./osxterminalthemer.py", line 284, in <module>
    thm_data = unpackage_theme(thm_data)
  File "./osxterminalthemer.py", line 150, in unpackage_theme
    v_plist = plistlib.readPlistFromString(v_plist)
  File "/usr/lib64/python2.7/plistlib.py", line 103, in readPlistFromString
    return readPlist(StringIO(data))
  File "/usr/lib64/python2.7/plistlib.py", line 78, in readPlist
    rootObject = p.parse(pathOrFile)
  File "/usr/lib64/python2.7/plistlib.py", line 406, in parse
    parser.ParseFile(fileobj)
xml.parsers.expat.ExpatError: no element found: line 1, column 0

This script was probably made for Mac where the appropriate libraries are available, but I could not get it to work.


Accidentally departitioned in Ubuntu installation - now boot manager doesn't work

Boot up off of a live CD and selecting Test Ubuntu or whatever it says then get your network card configured so you can get online. Then once you have access to the internet your going to want to install a program called testdisk. The program is awesome and it will find and recover your old partitions. You shouldn't have to reinstall windows, I have even used it to recover partions that had been formatted.

Lost Partition

If you made a mistake while partitioning and the partition no longer appears in the partition table, so long as you have not written data in that space, all your data is still there.

Installing Software while running from Live CD

Go to /etc/apt/sources.list file and uncomment every section, once done with that run apt-get update followed by apt-get install testdisk, can also do this for any other package your needing to install that is not on the live cd based system. Do not run apt-get dist-upgrade as the system will not be able to do the actually upgrades while running from a live cd. If your running from a USB key this will work for almost everything but might in fact fail for hal the kernel and the initrd image but should work for everything else.

Testdisk

Alternatively, the testdisk application should be able to recover your partition. Use apt-get to install the tesdisk package. Run testdisk and it will scan your computer for media (hard drives, sd cards and any other drives) and offer you a menu-driven way to recover your partition. If your not running it as root you will need to run it as follows:

sudo testdisk

Also do yourself a favor even if the drive your working on is not large or isn't quite damaged this process could take a long time to do its job. If for some reason the process was to stop, you would have to restart the whole thing over again. But When you start test disk you can have it create a log file and then it would continue from whereever it left off last time, you can do that by feeding it options like this:

testdisk /log /dev/sda

If your imaging the whole disk or if its just a single partition table

testdisk /log /dev/sda1

If your drive is really hosed and it turns into doing data recover there is another program called photorec that is part of testdisk, and again... awesome stuff, really powerful and have used both of these to save data for a lot of clients now over the years.


Backslash missing in file while replace the string content using backslash contain variable

You can use shell parameter substitution to escape the backslashes. Ex.:
$ set -x
+ set -x

$ echo 'foo target_value bar' | sed "s/target_value/${TEST//\\/\\\\}/"
+ echo 'foo target_value bar'
+ sed 's/target_value/\\etc\\hello/'
foo \etc\hello bar

See also:

sed: Substituting text pattern containing backslash


Even after doing fresh Ubuntu install on SSD didn't work.

Then I thought of swapping of Internal HHD and SSD (that i inserted into HDD Caddy). After swapping just a normal boot-repair worked perfectly.

Then I thought, May be, we can't have Ubuntu bootable in external HDD installed in HDD Caddy. But before swapping to HDDs i did a fresh install in internal HDD too that is working even with HDD Caddy. TO be sure I don't really know the exact issue on it. But what i really know is Putting SSD in internal HDD slot worked.


Not yet, you'll want to follow this bug for status of MAAS 2.0 and Juju 2.0 https://bugs.launchpad.net/juju-core/+bug/1564577

As for OpenStack on 16.04 you'll want to do:

sudo apt install conjure-up
conjure-up openstack


This problem should be all fixed in Tunesviewer 1.5.2 :)


I can not give exact answer because I don't know your topology

Case 1.

__________________
|                |
|   PC           |-------|
|  192.168.24.1  |       |     _____________
------------------       |_____|           |  __________
                         |     | ip_tables |  |        |
                         |     | PC        |--| router |--- internet
__________________       |     |           |  |        |
|                |       |     -------------  ----------
|   PC           |-------|
| 192.168.24.2   |
------------------

In this topology you need iptables

Case 2.

__________________
|                |
|   PC           |-------|
|  192.168.24.1  |       |
------------------       |  __________
                         |  |        |
                         |--| router |
__________________       |  |        |
|                |       |  ----------
|   PC           |-------|
| 192.168.24.2   |
------------------

You don't need iptables. You need to do port forwarding on router.

port 80 is for http -> 24.1
port 443 is for https -> 24.1
port 20 is FTP data transfer -> 24.2
port 21 FTP control -> 24.2

Also you must have fix public ip address on wan interface of your router.
Then you must make dns record. DNS resolv logical name aka mydomainname.com to ip address and ip address to logical names.

192.168.x.x range is private range of ip address I can't be router via internet.

Traffic flow is:

I type mydomainname.com in browser on my pc
PC ask DNS to resolve mydomainname.com to ip
When pc have ip, send http/https request to given ip
web server answer and send traffic to requester

IP address plan:

PC [private ip} -> router with private address on LAN and public ip on WAN. Router do NAT -> internet [only public ip address

Edit 2

Fallowing will work if your server do nat for 24.2 via 24.1

The first thing to do is do enable IP forwarding. This is done either by using

 echo "1" > /proc/sys/net/ipv4/ip_forward

or

sysctl net.ipv4.ip_forward=1

Then, we will add a rule telling to forward the traffic on port 21 to ip 192.168.24.2 on port 21

iptables -t nat -A PREROUTING -p tcp --dport 21 -j DNAT --to-destination 192.168.24.2:21

Then, we will add a rule telling to forward the traffic on port 20 to ip 192.168.24.2 on port 20

iptables -t nat -A PREROUTING -p tcp --dport 20 -j DNAT --to-destination 192.168.24.2:20

and finally, we ask IPtables to masquerade

iptables -t nat -A POSTROUTING -j MASQUERADE


Horizon: Apache exceptions at import_module

I am not sure about Essex, but OpenStack Grizzly is not compatible with django 1.5(the version you are using); you need to have django 1.4 installed.

To uninstall django 1.5, open a terminal(Ctrl+Alt+t) and type the following:

sudo pip uninstall django

and then to install django 1.4:

sudo pip install django==1.4.10

confirm version 1.4 is installed:

python

you  will get the python interpreter

>>> import django;django.VERSION

the output should be:

(1, 4, 10, 'final', 0)

then restart apache service(which uses django):

sudo service apache2 restart

Source: Similar question on OpenStack's official question-answer forum


I finally found the solution. The driver for the accelerometer of the ThinkPad is in package tp-smapi-dkms. Then I must load the hdaps module. The position can now be accessed in /sys/devices/platform/hdaps/position.


Unable to uninstall or reinstall Ubuntu desktop

Rename or remove the C:\ubuntu directory and run wubi.exe again.

As it says in the log:

  Exception: Cannot install into C:\ubuntu. There is another file or
  directory with this name. Please remove it before continuing.


I assume you're using an administrative account. (By which I don't mean root) Then you just enter your password you supplied when you installed Ubuntu.

If you, however, have no administrative account and don't know the root password, you need to ask a person who owns an administrative account to give you the password or to fix this for you.

This whole situation comes up because user and password information is stored in files only root has access to. Thus, these changes can only be accomplished by root or an account which can give root execution rights to a program, in which case an authentication password is asked to prevent abuse. (and sometimes foolishness of users like me)

As you disabled your password when enabling autologin, here's the way to reset it:

Reboot your computer to GRUB menu (Hold Ctrl or Shift on boot)
If 1. doesn't work, hit Ctrl+Alt+Del during boot. Your computer will immediately reboot to GRUB menu.
Select the Recovery Mode option.
Select the Root shell entry (I think it's at the bottom). Now Ubuntu will boot into a root terminal.
Remount the system as RW: mount -o rw,remount /.
Set your new password: passwd yourusername.
Set the root password: passwd.
Reboot: reboot.


Ubuntu 16.04/server edition: How do I setup the openvpn client to autostart?

To achieve the OpenVPN client, you should add the application in the "gnome-session-properties".

Just click alt+f2 and search for "gnome-session-properties".
In the command, browse and add your application.

Hope it helps to achieve what you wanted.


Nothing's wrong with tee. Python buffers output if it detects it's not writing to a TTY. See this Unix & Linux post. Use sys.stdout.flush() to force flushing the buffer.


You may launch atom by the following command:

snap run atom

In order to launch it using the shorter command atom, you can set this alias:

alias atom='snap run atom'

and write it into your .bashrc or .zshrc file, so every new terminal instance has it automatically set.


Install Ubuntu on a multipath SAN device

I have done this recently using Ubuntu 16.04.2 Server and Cobbler/PXE boot. The kernel options / boot string used is as follows:

biosdevname=0 net.ifnames=0 netcfg/choose_interface=eth0 netcfg/get_hostname=openstack-controller-node install disk-detect/multipath/enable=true

This detects the multipath disk and I can partition it fine but there seems to be a bug in grub because it is not installing to the multipath device leaving the server stuck with no way to boot.

EDIT: Managed to get the server booting, I had run grub-install manually:

grub-install /dev/mapper/mpatha

Hope this helps


Can Ubuntu computers have network viruses

Ubuntu doesn't have viruses

You mean malware and yes it does have viruses.

  could it spread through the network and infect a windows PC on the same wireless network like a worm?

Not unless it either runs on Linux to go through the network or it gets transferred through other means.


When I am trying to install Ubuntu for a dual boot, the drive I pick is showing more gigabytes than it actually is

It's calculational "problem".

Hard Disk Creators are calculating with 1000 and computer with 1024.

750*1000^3 = 750.000.000.000 Bytes
750.000.000.000 Bytes / 1024^3 = rd. 698,5 GiB (Gigabit binary Bytes)

i didn't read the rest of your text, because it's too long.

have a look on your hdd , I guess it's written 750GB on it, since there are no 698GB disk out.


How can an ISO be mounted in the terminal in the way that Ubuntu mounts an ISO by double-clicking the ISO file?

You can invoke manually the Gnome Disk Image Mounter:

gnome-disk-image-mounter /path/to/the/iso/file.iso


Ubuntu 18.04 wired connection unreachable when not logged in

Go to Settings/Wired Network and check "Make available to other users". This will allow log on of wired network before a user is logged on.


How do I configure touchscreen on my HP tx1000 laptop running xubuntu?

It uses a proprietary driver called eGalax.  It's not available or supported in Ubuntu but here's a link to the driver download:
http://home.eeti.com.tw/web20/eGalaxTouchDriver/linuxDriver.htm

Ideally, the Linux kernel's general purpose evdev input driver should make the touchscreen "just work", however its support for touchscreen models is far, far from complete.  If you're really interested in getting it working and don't mind getting your hands dirty into some source code, you might be able to lend a hand to the evdev kernel developers to make it work for this hardware (or they might have some configurable settings you could try.)

I wouldn't bother with evtouch for this hardware; it's not at all maintained and is being deprecated in favor of evdev.


How to delete a row when even one column of the row has a value less than one

In Awk, you would loop over the fields (columns) and test each one. Since your rows have a non-numeric first column, start at the second (i=2):

So

awk '{for(i=2;i<=NF;i++){if($i+0 < 1) next}} 1' file

Ex. given

$ cat example
a       1       2       4       7       9
b       0.5     0.9     6       10      3
c       3       5       12      7       9
d       7.96681779026634e-05     6       7       4       10

then

$ awk '{for(i=2;i<=NF;i++){if($i+0 < 1) next}} 1' example
a       1       2       4       7       9
c       3       5       12      7       9

In Perl you could grep the default split @F array after shifting out the first column:

perl -ane 'shift @F; print unless grep { $_ < 1 } @F' file


This is a known issue with the the AppImage provided by the OpenShot project on http://openshot.org/download/: It is currently broken because it only includes half of the required Qt libraries. It needs to be fixed. https://github.com/OpenShot/openshot-qt/issues/220

Normally, an AppImage contains all the libraries and other components that it needs to run which cannot be assumed to be part of the target system(s).


How do I download and install dhcpv6 on my server using Ubuntu?

IPv6 address provisioning usually works like this:

The router sends a Router Advertisement (RA).
On Linux/Unix/etc this is done by RADVD

The RA indicates for how long the sending router can be used as default gateway
The RA contains flags that indicate the provisioning method used:

The (M)anaged flag indicates if there is a DHCP server for address assignment (stateful mode)
The (O)ther configuration flag indicates if there is a DHCP server for other configuration options (stateless DHCP: only provides options but does not do address management)

The RA contains the prefixes that are used on the LAN

Each prefix option indicates if that prefix can be used for (A)uto-configuration

RA's can also contain the addresses of DNS resolvers

StateLess Address Auto Configuration (SLAAC) is the name for when there are prefixes with the (A) option on in the RA. The systems then can configure their own IPv6 addresses based on those prefixes and use the router as default gateway. Optionally a stateless DHCP server can provide extra options (like domain name, DNS resolvers, time server, etc).

So if you want to configure your Linux box as a router you will need RADVD and optionally a DHCPv6 server in either stateful or stateless mode.


How can I have a "show desktop" icon when scrolling through opened applications using Alt+Tab in 18.04?

This is not implemented in Gnome Shell, the desktop used by Ubuntu 18.04. In many cases, gnome extensions can implement desired features, but I do not know of an extension that specifically meets your desire to have a "Show Desktop" icon in the application switcher.

To quickly show the desktop, you can set up a hotkey to hide all windows at once (i.e., show desktop). In Settings - Keyboard, find "Hide all normal windows" under "Navigation" and assign it a shortcut, for example Super+d.

A hack you might try, if you think it is worth it, is to create a "Show desktop" launcher as outlined in this Askubuntu question. Pin it as a favorite to your Dock (or Dash if using pure Gnome). Then install the extension Super+Tab launcher, which is well maintained at the time of writing. This extension includes your not running favorites in the Alt+Tab switcher. It thus will also contain your launcher to minimize all windows. The catch however is that all favorites will now be in the launcher, unless you remove the other favorites from the dock/dash.


To add ICQ account to empathy. You need to download a plugin.

Here is the steps:

Open terminal and type

sudo apt-get install account-plugin-icq

Now open empathy and click on add account. You will be able to see ICQ on the list.


How to filter out hidden files and directories in 'find'?

Use path instead of iname:
find -not -path '*/.*'

* - matches any string.
/ - directory separator.


Run Ubuntu and Windows 10 on same laptop

Yes, I am running one in dual boot. I would recommend reserving some free HD space in the windows disk management space, so that you can run Ubuntu on an Ext filesystem.


Can I run Ubuntu on something other than Linux Kernel?

TL;DR
You cannot remove the Linux kernel from Ubuntu, without irrevocably crashing your entire system but in the future you might be able to replace it.
The long answer:
This is due to the history of GNU/Linux:
Once upon a time, there was a guy called RMS that wanted to keep software to be free¹. He ended up publishing the source of his software (what we call "Open-Sourcing" today) and eventually this all became the GNU Core Utilities after a few other people helped him out.
However, these utilities missed just one little thing to be 100% free and that was a Kernel to run on as the GNU Utilities were running on UNIX System V and its clones and this is where we bring Linus Torvalds in: he developed a Monolithic Kernel² and published his source too with the understatement of the XXth century:

I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones.³

The kernel is the bit of software that talks to the hardware, so manages the Memory, Disks, Keyboard, Mouse, Screen, Display Adapter, Speakers, Webcam, ...  so you cannot run any OS without some kind of kernel.
Fast forward a quarter of a century and the GNU Utilities still run on that same kernel (in the meantime named "Linux")
Ubuntu = Linux Kernel + GNU Core Utilities + a ton of other software.⁴

So: No, today you cannot delete the kernel, but in a few years when the GNU HURD from the Free Software Foundation's⁵ multiserver microkernel comes out of development⁶ you will be able to replace the Linux Kernel with the Hurd one but you can never run any OS without some kind of kernel.
Alternatively,
You can run the GNU Core Utilities on another OS entirely:

BSD or one of its variants: MacOS
Windows (32-bit only)

But these also have kernels, though none of the above use Linux kernels.
Note 1: "Free" as in Freedom, not Free beer ;-).
Note 2: GNU Hurd took the decision to go for a multiserver microkernel because they wanted the kernel to be distributed amongst multiple machines because RAM was so expensive at the time.
Note 3: OK, maybe Houston, we have a problem is the biggest understatement of the century...
Note 4: I.E. All the software you install yourself.  :-).
Note 5: the FSF is the copyright holder of the GNU Core Utilities.
Note 6: The GNU Hurd multiserver microkernel has been in development for 20+ years, so don't expect anything in the next couple of years (maybe decades)
Note 7: Please be aware that changing Ubuntu's Linux Kernel would make the concoction you just created off-topic on this site! (As it would not be Ubuntu any more)


Xsane Menu exceeds screen size. Unable to move or resize it

It appears that you needs a 1920 screen with Xsane. I just got a 1920x1080 monitor in tonight. I had been using my old 1366x768 monitor for many years. It actually has the same resolution as a a Windows Laptop that I sometimes use.

But I finally broke down and purchased a new 1920x1080 monitor. It makes a world of difference. All of the Xsane menus fit on the screen at the same time. Other programs seem to go through an adjustment as they load.

So Xsane is working perfect now, as long as I am using a 1920x1080 monitor.


Program refuses to install in wine, telling me that "the operating system is not adequate"

As you said, Win 7/8/8.1/10. In Wine configuration, start via Configure Wine, you can select 95/98/ME/2000/XP and so on and Windows 8, too. All right?

Now start the installation of Bookshelf

wine BookshelfSetup.exe


Kubuntu not booting on T420 after update

Thank you everyone for your suggestions.I was finally able to overcome the problem and this is what I did:

I downloaded the update as usual and let it run it's course until it came to the part where it asked me if I wanted to delete the files from the old version before installing new ones. I clicked on "keep old files" and believe it or not I had no black screen or problem booting in. Everything works flawlessly. However, please do not ask me to explain how and why, I have no idea! :-)


How do I restore an accidentally deleted initrd image?

This is the answer to the original question, how to extract the initrd.lz from the live CD, typically used if you are making a custom live CD.

copy the initrd.lz to a working directory ( ~)

cp /media/cdrom/initrd.lz ~

Make a directory to extract the contents to, I will use initrd, cd into the directory

mkdir ~/initrd
cd ~/initrd

Extract

lzma -dc -S .lz ../initrd.lz | cpio -imvd --no-absolute-filenames

Make any changes you might need, re-package

cd ~/initrd
find . | cpio --quiet --dereference -o -H newc | lzma -7 > ../cusotm.initrd.lz

Your new initrd will be in your home directory and called cusotm.initrd.lz


Wifi can't connect, cable connection barely works

(Based on input from your other question that got deleted...)

The one thing I can think of that the software center, apt-get, and the "certain websites" you mentioned (including Facebook and YouTube when you're logged in) all have in common is that they use an encrypted connection.

So maybe it's a problem with encrypted connections. Please confirm this by trying out several websites with and without SSL (provided they support it). For example, try both:

http://en.wikipedia.org/wiki/Main_Page and
https://en.wikipedia.org/wiki/Main_Page

If my guess is correct, the first one should load without problems but the second one should be slow.

Now to be honest, I have little clue as to what you should attempt to do in order to fix this. I can suggest one thing that might and might not be useful, and that would be reconfiguring all SSL related packages on your system.

First, query them using:

dpkg --get-selections | grep ssl

Then, after stripping the version and architecture (if any), you can reconfigure them using:

dpkg-reconfigure pkg1 pkg2 pkg3 pkg4 etc.

You might want to reboot after reconfiguring them.

Also, while at it, you can try booting up a live CD/USB and seeing whether things work well from there.


Whitespace Problems With Script and Variables

As other people said before me: Don’t parse the output of ls!

Why not simply:

stat --printf='%y\t%n\n' -- *

If you want to do something with each file name and time stamp, read the output of stat like this:

stat --printf='%y\t%n\0' -- * | \
while IFS=$'\t' read -rd '' timestamp i; do
    echo "filename: ${i}, timestamp: ${timestamp}"
done

No need to spawn a new stat process for every file, which you'll notice as soon as you spawn a few hundred processes for a few hundred files.

For more complicated matches than simple globbing, I recommend find with a suitable -printf option.

Edit: As per the comments to this answer, I found out that OP actually wants to copy the modification time stamps from files of one directory to another. This is what I suggest:

for f in /source/dir/*; do
    touch -c -r "${f}" "/dest/dir/${f##*/}"
done

This takes all entries from /source/dir as time stamp references (-r) for entries of the same file name in /dest/dir without creating new files that don't exist in /dest/dir yet (-c).


Clarification of dual boot step 4 options

Install dual boot Windows 10 uses the most basic partitioning scheme. It creates a swap partition, and a partition to hold the file system. And on EFI systems it uses the EFI partition on the first internal drive for installing grub.

For many online partitioning guides, the poster is asking how to create a certain set up; for example, separate home partition, server partitioning schemes, USB boot, preconfigured partitions, etc. Also many, recommend custom partitioning schemes for the reasons listed in the next section. Thus, the do something else option is needed to set up partitioning that is different from the default.

There is no difference in performance. Some of the most popular reasons for custom partitioning are:

Specify the size of the swap partition. I forget how the installer determines swap partition size, but on larger drives, it can be excessive.
Separate  /home partition makes it easier to snapshot system files, or do reinstalls without copying a lot of personal files.
Separate data partitions can be mounted into various installs without the need to copy large amounts of data into each.
I'm not sure why, possibly for departmentalization, but server installs tend to use separate partitions for many system folders.
Separate /boot partition is needed for full disk encryption or RAID setups


DVD ROM with interactive Uni activities won't install on Ubuntu

Could you tell us what degree this is, with possible course code?

The chance is that this DVD is intended for Windows.
Since this is Linux it isn't supported out of the box.
However, Linux has the ability to run Windows software by means of 'WINE', this is a program intended to run Windows software under Linux.

By knowing the course, we can check if it runs well, and tell you how to install it.


How to find out if USB flash drives are USB 2.0 or 3.0

Check the color of the insulator strip in the connector.

A 2.0 device will have a black or white insulator.  A 3.0 device will have a blue insulator and a 3.2 device is supposed to have a red insulator, but I've never seen a devices rated for 3.2 in the wild.


How to stop window from opening up maximized in Ubuntu Mate 17.10

Sounds like you've enabled maximising new windows in MATE Tweak. Open MATE Tweak, click Windows amnd make sure "Do not auto-maximise new windows" is checked.


Part of an old window remains after program closes

I found the answer, which I record here for others who may have the same issue.

First I used xprop to find what window was causing the problem. (xkill was ineffective here.) It turned out to be gtk-window-decorator.

Then I killed it by its pid (given by xprop or ps). Finally, I restarted it (using Alt + F2 so it would not be bound to the terminal) to get the title bars and other decorations.


Paramvir,

If you have a working version of windows along with Ubuntu. Log into windows and then insert a CD drive and use GUI options to reinstall windows OS.

Probably, it will stop recognizing the Ubuntu OS.

Simple way to fix this issue is, you have boot the system with alternate CD of Ubuntu and install Boot-Repair Tool.

Follow this link for Boot-Repair Installation

Once you are done with the these steps, just restart system and you will get both OS running alongside.


If you are having trouble with booting problems then use the live cd to install boot-repair by following the instructions from here


Wireless switch on Dell XT2 - strange behaviour of rfkill

There's already a daemon you can use for this purpose: udevd

You can create a rules file for it to listen to rfkill events, see this unix.stackexchange.com answer. Just adapt the script to your purpose, see below. Be aware my bash is not the best - it works, but probably cannot be considered a good example.

#!/bin/bash
#/usr/local/bin/unblock-dell-wifi

DEV_CHANGED_BY_HW_SWITCH=phy0
DEV_TO_UNBLOCK=dell-wifi

if [ ${RFKILL_NAME} != ${DEV_CHANGED_BY_HW_SWITCH} ]
then
        exit
fi

# get $DEV_TO_UNBLOCK rfkill id
DEV_TO_UNBLOCK_ID=`rfkill list wlan | grep $DEV_TO_UNBLOCK | grep -o -e "^[0-9]*"`

# maybe add error handling if $DEV_TO_UNBLOCK couldn't be found
if [ -z $DEV_TO_UNBLOCK_ID ]
then
        echo "$DEV_TO_UNBLOCK not found in rfkill list" 1>2&
        exit
fi

if [ ${RFKILL_STATE} = 0 ]
then
        sudo rfkill block $DEV_TO_UNBLOCK_ID
else
        sudo rfkill unblock $DEV_TO_UNBLOCK_ID
fi


Check this issue on OpenVPN bugtracker: https://community.openvpn.net/openvpn/ticket/328
It seems TOR proxy is too slow and updating your OpenVPN client version to 2.4 might help.


How can I move files across network? -- unattended / handles errors without waiting for user input?

Have you tried rsync?

It's a command-line utility so it's not as user-friendly as Nautilus, but the command line is the best for automating stuff like you want. rsync will indeed try to transfer as much as possible, it will log all errors, and since it only transmits the "differences" or changes, it's "cheap" to just rerun it to bring things back up to sync.

Other than rsync, you need to install openssh-server on the receiving computer(s), then do something like this:

rsync -avu --progress source_folder remote-computer.local:Desktop/

the folder will be sent to remote-computer and placed on the Desktop.

Instead of remote-computer.local, you can use an IP address if you know the IP of the destination system, but by default the .local domain should work, so if a computer's hostname is "buckaroo", you can just specify it as buckaroo.local.


Installed Ubuntu after Windows 10, no boot options whatsoever

Re-installed Ubuntu in UEFI mode to finally get the "Ubuntu" option displayed in the UEFI menu. I also had to change the option in the UEFI from "Secure Boot > UEFI Windows" to "Secure Boot > Other OS" in order to be able to boot Ubuntu, otherwise it would just freeze.


This is what I did to fix things the way I was looking for them to be when I asked the question. I'm not sure if this is the best way; but, it's working for now:

Setting up symbolic links:

Remove existing links:

rm /usr/bin/gcc
rm /usr/bin/g++

Change name of default executibles because I want to run commands gcc and g++:

mv /AntonProj1/bin/gcc /AntonProj1/bin/gcc-4.7.4
mv /AntonProj1/bin/g++ /AntonProj1/bin/g++-4.7.4

Set new symbolic links:

ln -s /AntonProj1/bin/gcc-4.7.4 /AntonProj1/bin/gcc
ls -s /AntonProj1/bin/g++-4.7.5 /AntonProj1/bin/g++

Setting up PATH stuff:

export "PATH+=:/AntonProj1/bin"

While I'm not sure my method of setting up the path is ideal (it must not be since I have to add a path to any directory I'd like to run gcc or g++ from), this easy export appends the correct path to the end of whatever path is already set... I can imagine setting it up in a profile.d or something; but, for my purposes it's OK as it is.


How can I connect to Nexus 7 (running Ubuntu) via SSH?

I have just installed Ubuntu 13.04 on a nexus 7.
The steps were, in a terminal on the nexus:

$ apt-get install openssh-server # answer y
$ ifconfig wlan0 # to find nexus IP address

Then, on a computer in the same wireless network,

$ ssh loginname@ip-address

The authenticity of host '192.168.131.40 (192.168.131.40)' can't be established.
ECDSA key fingerprint is 54:22:d3:ea:2e:af:b2:87:23:74:1a:ce:f5:e5:e4:11.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.131.40' (ECDSA) to the list of known hosts.
loginname@192.168.131.40's password:

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Welcome to Ubuntu Raring Ringtail (development branch) (GNU/Linux 3.1.10-8-nexus7 armv7l)

 * Documentation:  https://help.ubuntu.com/

loginname@nexus:~$


Virtual machine manager error (did not find USB device)

Solved

So this is how I got it fixed:

virsh edit <vmname> # brings up emacs (or vim for the really smart people) with the xml for the vm

-- added  startupPolicy='optional' to the <source> line as below

  <hostdev mode='subsystem' type='usb' managed='yes'>
       <source startupPolicy='optional'>
         <vendor id='0x03f0'/>
         <product id='0x4217'/>
       </source>
     </hostdev>


Source package: precise build dependencies policy for Software Centre

Replying to myself, my apologies.

About the second question, may be a possible answer could be to use a compiler targeting ISO/ANSI C, as some high level language compilers do. To re‑use the example case, let say an application requires this or that commercial or non‑free Prolog compiler to compile, then if that Prolog compiler is able to target C (and not just native machine code), then perhaps that's OK to have a source package based on the C source the higher level compiler produced. This kind of machine‑generated source is most of time less well presented than hand‑written source, but does it really matter after all…

If these assumptions are right, then this would means if one wish to publish something to the Software‑Centre, then he/she have to use a tool chain which is able to generate C source as the target.


19.10 uses more RAM and CPU compared to 19.04 with Chrome and Chromium Browser

Chrome's and Chromium's extensions each have their own process, consuming RAM and CPU time. Try removing every extension from those browsers.

If the problem persists, consider changing from Ubuntu's GNOME desktop to LXQt or XFCE. Both are faster and use less RAM.


How to install Ubuntu Touch OS on a bricked N900 phone?

Ubuntu on a mobile is much more complicated than on a PC, you need an image especially made for your mobile. Ubuntu is not really ready for phones (yet) and the most advanced images are listed here but there seems to be no progress on yours:
https://wiki.ubuntu.com/Touch/Devices


The default user is ubuntu. Password for this user must be specified while deploying process.
For example for VMware player deployment process:
Setting password for a default user


Disclaimer: I am the original author of WereSync

WereSync can clone a running drive. It will also clone to a drive of a different size, including a smaller one if need be.

Install with pip:

pip install weresync

Then run the program with root permissions. It needs root permissions because it has to access your block devices in order to copy. The following is for a GPT partition table:

sudo weresync -C --grub-partition 2 --efi-partition 1 /dev/sda /dev/sdb

This command will make a bootable clone of /dev/sda on /dev/sdb. The -C flag marks that the target drive may not have the same partition scheme as the source drive. If the check fails, WereSync
will repartition the target drive so it matches the source drive. After your first backup, you probably want to remove this flag, since the checking mechanism sometimes returns false positives and will erase the previous backup. WereSync backs up incrementally, so it's faster if you have the previous backup intact.

The --grub-partition flag should be passed the partition number for the partition on which grub should be installed. This is usually the partition mounted on /. So if you have /dev/sda2 as your root partition, pass --grub-partition 2 to WereSync.

The --efi-partition flag is only relevant to UEFI systems. It should be the number of your efi partition. If your efi partition is on /dev/sda1 pass --efi-partition 1 to WereSync. To find your efi partition use sudo parted /dev/sda p and look for the partition with the "boot" flag. It's number is in the far left column.

If you have your boot directory on a seperate partition, you will need to pass that partition's number to the --boot-partition flag.

This command will erase all data on /dev/sdb, so be sure to save any data you want from there. More documentation and command line options can be found at the WereSync documentation.

WereSync uses rsync, as mentioned in the question, but automatizes the process of copying. It will also update your fstab and reinstall grub to make the clone bootable. However, because of the variance of Linux systems, certain setups may not work properly.

Because of using rsync, clones made with WereSync will be update incrementally, greating increasing the speed of clones.


Is it really missing or just not the default anymore?

This may just be a misconception, please take a look at the boot order in your firmware setup screen or run efibootmgr if you are in Ubuntu. Windows actually installed two bootloaders: the default UEFI bootloader for the drive in \EFI\boot\bootx64.efi, which – to my experience – will create a new entry in the NVRAM that is linked to \EFI\Microsoft\Boot\Bootmgfw.efi, the "real" UEFI Windows bootloader. It's very likely that by choosing to boot the Windows entry from the GRUB menu you booted the default UEFI bootloader, which set Windows as the default again. In that case simply move the Ubuntu entry up to the top in in the boot order.

Windows is not evil, Fedora does it too

I found that Fedora does something very similar, but neither Windows' nor Fedora's default bootloader removes entries from NVRAM. Your Ubuntu entry should still be in NVRAM and you should be able to boot it via boot override (ASUS boards have this feature in the setup screen), firmware boot menu (F8, F11 or F12) or – as mentioned above – by rearranging the boot order in the firmware setup screen (formerly called BIOS setup screen).

I want to point out that this is not a bad idea or bad practice. If you have installed an operating system and it boots from an entry in the NVRAM of the firmware, you can't take the drive out and boot it on another computer. That's where the default bootloader on the EFI System Partition (ESP) comes into play and can either boot the operating system or create a new entry in the NVRAM to the proper bootloader or do both.

Workarounds

Boot Windows always via it's "Windows Boot Manager" entry from the firmware boot menu (F8, F11 or F12). Never use the default bootloader (e.g. selecting the hard drive from the firmware boot menu), as it will alter the boot order.
Create a custom GRUB entry to boot Windows. Be aware that you need to change every occurrence of msdos from the example to gpt as you seem to be using a GPT partition table, like all Windows 8 preinstallations do.
Backup \EFI\boot\bootx64.efi and replace it with Gummiboot, it will also find the Windows Bootloader on the ESP, but not alter the boot order. (Follow only step 1 from this answer for instructions.)
You can also try the workaround suggested in the Arch Wiki. (The answer from Rod Smith looks similar, but a GRUB loader in the Microsoft directory of the ESP doesn't look quite right.)

You can combine 1-3 of course.


Can I run Ubuntu, Xubuntu and Kubuntu in the same computer?

Here's a nested list of your various options:

You can install multiple desktop environments in the same Ubuntu system, by installing the corresponding package. Most of these are metapackages.

GNOME 3 with Unity / Unity 2D: ubuntu-desktop
GNOME 3 with GNOME Shell: gnome-shell
GNOME 3 with GNOME Fallback (looks like, but isn't, GNOME 2): gnome-session-fallback
KDE 4 Plasma Workspaces - kubuntu-desktop
Xfce 4 - xubuntu-desktop
LXDE - lubuntu-desktop

That's not an exhaustive list of metapackages providing desktop environments. Other variants, like edubuntu-desktop, can also be installed this way.

The best way to have an Ubuntu system with GNOME Unity, KDE 4, and Xfce 4 installed is probably to install the Ubuntu desktop CD, then add the kubuntu-desktop and xubuntu-desktop packages.

If you're installing from the command-line with sudo apt-get install ..., make sure to run sudo apt-get update first to update information about what versions are available of software to install. Otherwise, and especially given that these are big metapackages:

It may try to install some versions that are no longer available, causing the installation to fail.
It may try to install some versions that are buggy and don't work right with each other.
You may incur security vulnerabilities (though you could fix them by a subsequent upgrade of everything to the latest version).
It takes much more time and effort to upgrade potentially hundreds of packages after installing old versions, than to run sudo apt-get update first and install the newest recommended versions in the first place.

Remember, when you install these big metapackages, many packages are installed.

Of course, you can install them just as well through the Software Center (no sudo apt-get update needed, it's taken care of automatically).

If you have more than one desktop environment installed, you can work in one system where you have access to everything. This is quite valuable, so this is probably what you'll want to do. However, note that, unless you do quite a bit of manual reconfiguration, you'll see all applications when in each desktop environment (in its menus, or when you search for installed apps), including applications designed for the other desktop environments.

They will still run, and most of them without any problems at all, since even those applications that are very strongly pinned to a particular DE have that DE installed in this scenario. When running, though, they may cause significant background user services associated with their desktop environment to start up in the background. This sort of thing is particularly common when running KDE programs in GNOME.
You can install Ubuntu and its derivatives (Kubuntu and Xubuntu) separately, on separate partitions. There's another major choice to make, within this:

You can have a separate /home partition which they all share. Your per-user settings and other user-specific files like browser bookmarks, cookies, and cache if you use the same browser application will be shared. This is very convenient.

But with multiple versions of some software using the same settings and data (since some programs are shared between GNOME/Unity, KDE, and XFCE), you may experience some problems. For example, if one system is updated before another, older versions of software may be unable to access configuration data "upgraded" by the newer versions. Yu may also want to customize your personal menus differently in ways not facilitated easily when the different systems share /home.
Each system has a separate /home. You have separate Documents, Downloads, and Desktop folders (for example) and each application is configured separately for you in the separate systems.

A secondary choice to make is whether or not to use separate swap partitions.

You should probably share the swap partition. The systems aren't both swapping to it at the same time, after all.
But if you use it for hibernation (i.e., suspend to disk) and you want to be able to run one system while hibernating another, you should have separate swap partitions. Even if you don't want to do this, if you plan to use hibernation at all, you might want separate swap partitions in case you make a mistake, so you don't overwrite one system's hibernation state by booting the other system by accident.


Ubuntu: no root file system is defined + freezing

Recreate the installer and check the validity of the download and the installed installer. See on the checksum.

A / partition is mandatory (ie. the message) but the installer crashing to me means you have a faulty installer.


Which way is the best to manage a workstation from windows server 2008?

you can check out Landscape by Canonical (the company that backs ubuntu)

http://www.canonical.com/enterprise-services/ubuntu-advantage/landscape

but there are only paid licencing models.


Ubuntu stuck on black screen with blinking underscore after using xdiagnose

I've resolved this issue on my computer, following the solution here.

Specifically, these steps were performed:

Restart your machine holding shift, and boot into recovery mode.
Open a root command prompt, and mount your system drive in rw using the command mount -o remount,rw /.
Uninstall xdiagnose completely by entering apt-get purge --auto-remove xdiagnose.
Restart your system by entering shutdown -r 0. The system should boot normally, although mine still showed the diagnostic information.
Log in and reinstall xdiagnose by entering sudo apt-get install xdiagnose in a terminal window.
Once installed, open xdiagnose and disable the diagnostic options.


Add a chromium link to the Plasma desktop

Of course. Right-click on the desktop, click "Unlock widgets" (unless they are already unlocked), right-click again and click "Add widgets." Click and drag the "Folder View" widget to the desktop. Right-click on the widget and go to Create New > Link to application. Type the name of the link in the box and use the"Application" tab to set the command. Here's an example command:

chromium "https://www.example.com"


By default does RDesktop use any encryption?

By default all the rdesktop connections are encrypted.

You can use -e, -E option to disable encryption based on your need.

Alternatively you can use ssh to connect to a remote desktop with x11 forwarding

Syntax: ssh -X user_name@the_server_IP_or_hostname.domainame


Gparted will not allow me to unmount partitions

You need to boot up a "live" session from an installation media such as a USB device or a DVD like the one you used to install ubuntu.

Once you boot up into your "live" session, select the option to try Ubuntu without installing.

Finally, open gparted and resize the partition because it will not be in use or mounted during the live session unless you choose to mount it first.

You can download the 64 bit live session DVD (or USB) iso from here.

You may need to delete the swap and any other unused partitions that are after the partition (to the right) to free up some unallocated space. Just do not forget to create a new swap partition when you are done because running without swap is not recommended.


Why the command is giving that output and what do in this case?

It appears that there is no problem with conf files. dpkg --verify is automatically set to display outputs upon testing file authenticity and checking for problems.