To understand the intricacies of the various options available, its worth just having a little dig around in the source-code to see what happens with each option.  I'll try my best to put this is simply as possible, but with the caveat - you need to enjoy a bit of mathematics!

Lets grab the source-code:

 apt-get source gnome-desktop3
 cd gnome-desktop*
 cd libgnome-desktop

Now open the following source-module with your favourite text editor:

 gedit gnome-bg.c

There are two key functions to examine:

get_scaled_pixbuf

switch (placement) {
    case G_DESKTOP_BACKGROUND_STYLE_SPANNED:
                new = pixbuf_scale_to_fit (pixbuf, width, height);
        break;
    case G_DESKTOP_BACKGROUND_STYLE_ZOOM:
        new = pixbuf_scale_to_min (pixbuf, width, height);
        break;

    case G_DESKTOP_BACKGROUND_STYLE_STRETCHED:
        new = gdk_pixbuf_scale_simple (pixbuf, width, height,
                           GDK_INTERP_BILINEAR);
        break;

    case G_DESKTOP_BACKGROUND_STYLE_SCALED:
        new = pixbuf_scale_to_fit (pixbuf, width, height);
        break;

    case G_DESKTOP_BACKGROUND_STYLE_CENTERED:
    case G_DESKTOP_BACKGROUND_STYLE_WALLPAPER:
    default:
        new = pixbuf_clip_to_fit (pixbuf, width, height);
        break;
    }

and the function:

draw_image_area

switch (bg->placement) {
    case G_DESKTOP_BACKGROUND_STYLE_WALLPAPER:
        pixbuf_tile (scaled, dest);
        break;
    case G_DESKTOP_BACKGROUND_STYLE_ZOOM:
    case G_DESKTOP_BACKGROUND_STYLE_CENTERED:
    case G_DESKTOP_BACKGROUND_STYLE_STRETCHED:
    case G_DESKTOP_BACKGROUND_STYLE_SCALED:
        pixbuf_blend (scaled, dest, 0, 0, w, h, x + area->x, y + area->y, 1.0);
        break;
    case G_DESKTOP_BACKGROUND_STYLE_SPANNED:
        pixbuf_blend (scaled, dest, 0, 0, w, h, x, y, 1.0);
        break;
    default:
        g_assert_not_reached ();
        break;
    }

Lets first look at the option SPAN

This is described by the case option G_DESKTOP_BACKGROUND_STYLE_SPANNED

The wallpaper (pixbuf) is first scaled to the area to be filled (pixbuf_scale_to_fit) i.e. take the original wallpaper and expand its width and height to match the area.

It uses the following algorithm to expand:

factor = MIN (max_width  / src_width, max_height / src_height);
new_width  = floor (src_width * factor + 0.5);
new_height = floor (src_height * factor + 0.5);

src_ is the wallpaper dimension width or height, whereas max_ is the area dimension width or height

Quite a complicated algorithm as you can see, but basically it tries to see what is the minimum dimension that needs to be expanded before scaling both dimensions linearly by the same factor it has calculated.

This area is the combined area of your monitor or monitors.

The resulting wallpaper (pixbuf) is then blended with the desktop background colour for the whole area.

Lets look at the option SCALE

This is described by the case option G_DESKTOP_BACKGROUND_STYLE_SCALED

As you can see in the source code, its very similar to SPAN.  It uses the same algorithm to scale the picture as SPAN.

The resulting wallpaper (pixbuf) is then blended with the desktop background colour for the view port area i.e. not the combined area of all monitors, but the area of each monitor individually.

Lets look at the option Zoom

This is described by the case option G_DESKTOP_BACKGROUND_ZOOM

The wallpaper (pixbuf) is first scaled to the area to be filled (pixbuf_scale_to_min) i.e. take the original wallpaper and expand its width and height to match the area.

It uses the following algorithm to expand:

factor = MAX (min_width / src_width, min_height / src_height);

new_width = floor (src_width * factor + 0.5);
new_height = floor (src_height * factor + 0.5);

src_ is the wallpaper dimension width or height, whereas max_ is the area dimension width or height*

Notice the subtle difference than the previous two options - it calculates the maximum dimension that needs to be expanded before scaling both dimensions linearly by the same factor it has calculated.

The resulting wallpaper (pixbuf) is then blended with the desktop background colour for the view port area i.e. not the combined area of all monitors, but the area of each monitor individually.

Lets look at the option STRETCH

This is described by the case option G_DESKTOP_BACKGROUND_STRETCHED

The wallpaper (pixbuf) is expanded both width-wise and height-wise to the area - thus you can get a distortion if your wallpaper is not the exact dimensions of the wallpaper

The resulting wallpaper (pixbuf) is then blended with the desktop background colour for the view port area i.e. not the combined area of all monitors, but the area of each monitor individually.

Lets look at the option CENTER

This is described by the case option G_DESKTOP_BACKGROUND_CENTRED

The wallpaper (pixbuf) is actually clipped to size if its too large to fit the area i.e. the the width is reduced to the area width and the height is reduced to the area height.

The resulting wallpaper (pixbuf) is then blended with the desktop background colour for the view port area i.e. not the combined area of all monitors, but the area of each monitor individually.  The resulting image is then drawn into the center of the overall area of the monitor.

Lets look at the option TILE

This is described by the case option G_DESKTOP_BACKGROUND_WALLPAPER

The wallpaper (pixbuf) is similarly clipped as the Center option.

The resulting wallpaper (pixbuf) is then blended with the desktop background colour for the view port area i.e. not the combined area of all monitors, but the area of each monitor individually.  The resulting image is copied repeatedly starting in one corner filling the overall area with each image i.e. tiled width-wise and height-wise.


How do I assign a variable in Bash whose name is expanded ($) from another variable?

TL;DR: One way is local tmp="notif_$2"; printf -v "old_notif" "%d" "${!tmp}".

You are trying to expand a parameter (in this case, a variable) whose name must itself be obtained by expanding another parameter (in this case, a positional parameter). Furthermore, the positional parameter must be expanded, then concatenated with the text notif_, to produce the text that must then itself be expanded.

Bash lets you do this cleanly with indirect expansion or a nameref.

The first two sections of this post show drop-in replacements for your printf -v command, using those techniques. The remaining sections are optional; they further explain these features and what you can do with them.

Way 1: Indirect Expansion

Indirect expansion is the most similar, conceptually speaking, to what you have written. Instead of the printf -v command you have now, you can use these two commands:

local tmp="notif_$2"
printf -v "old_notif" "%d" "${!tmp}"

local makes the tmp parameter local to the shell function. If for some reason you don't want that, just omit the word local. The parameter doesn't need to be called tmp.

Indirect expansion is covered in 3.5.3 Shell Parameter Expansion in the Bash reference manual.

Way 2: Namerefs

Another way is to use a nameref. A nameref refers to a parameter. You create it from the name of the parameter, but once created, it behaves as though it is that parameter when you read from or write to it.

To use a nameref, replace your printf -v command with:

local -n ref="notif_$2"
printf -v "old_notif" "%d" "$ref"

Passing the -n option to local or declare causes the newly introduced parameter to be a nameref. Notice that, in the printf command, you will use ordinary parameter expansion ($ref) -- not indirect expansion -- because the shell performs the indirection automatically for the nameref.

You do need local or declare here, because -n ref="notif_$2" by itself would be an error and ref="notif_$2" by itself wouldn't make a nameref. declare without the -g option in a shell function behaves like local, so you can use that style if you prefer. Or, in the unusual case where you wanted the nameref to be usable after the function returned, you could use declare -g Thanks to G-Man for pointing out a mistake about this in an earlier version of this answer.

(Depending on your needs, it might even make sense to use a nameref for more than just these two lines. To learn how, read on.)

Namerefs are covered in 3.4 Shell Parameters in the Bash reference manual.

Detailed Explanation: How Indirect Expansion Works

Shell features are most easily demonstrated through interactive use, but positional parameters (like 2, expanded via $2) don't have quite the same meaning outside a shell function, and the local builtin doesn't work at all outside a function (you would use declare instead, or nothing).

So, to start with a simplified example, suppose you are working interactively in your shell and you have run:

x=foo
export "notif_$x=1234"

After you run that, 1234 is stored in the parameter notif_foo. (It also exports that parameter as an environment variable.) We can see this by inspecting notif_foo:

echo "$notif_foo"

This outputs 1234.

Your scenario is analogous to not knowing what is in the x parameter. (In your case, you instead don't know what's in the second positional parameter passed to your shell function. I'll get to that soon.)

But you can build the parameter name and put it in another parameter:

y="notif_$x"

Now y holds notif_foo, so you can use indirect expansion on y, which looks like this:

"${!y}"

That expands to 1234, just as if you had used "$notif_foo". But you don't need to know $x is foo to use it.

For example, this will assign 1234 to old_notif:

old_notif="${!y}"

If you need to format the contents of $notif_foo, you can do that, too. For example, you can use printf if you need it. This command is similar to the printf command in your question, and has the effect of assigning 1234 to old_notif:

printf -v old_notif '%d' "${!y}"

(It also works in your original quoting style, i.e., printf -v "old_notif" "%d" "${!y}" has the same effect.)

Of course, this relies on the y parameter being suitably assigned first.

To write your shell function, you will replace $x with $2, and you will probably want to use the local builtin to prevent your temporary variable--which I will now call tmp instead of y--from leaking out of the function's scope.

local tmp="notif_$2"
printf -v old_notif '%d' "${!tmp}"

Or, using the quoting style you used in the question:

local tmp="notif_$2"
printf -v "old_notif" "%d" "${!tmp}"

Detailed Explanation: How Namerefs Work

To try out namrefs interactively, you must use declare -n rather than local -n (because local only works--or is needed--inside the body of a shell function).

As before, suppose you have run:

x=foo
export "notif_$x=1234"

Thus $notif_foo expands to 1234. You can create a nameref to the parameter named by the result of expanding "notif_$x":

declare -n y="notif_$x"

Now y refers to the name notif_foo, and ordinary parameter expansion on y will automatically dereference that name, thereby expanding the notif_foo parameter. That is, this expands to 1234, just as if you had used $notif_foo:

"$y"

To write your shell function, you will replace $x with $2, and I recommend using local instead of declare. I suggest also using a somewhat more descriptive name than y; for a short function with no other nameref declarations, ref is probably adequately clear.

local -n ref="notif_$2"
print -v old_notif '%d' "$ref"

Or, with the quoting style you've been using:

local -n ref="notif_$2"
print -v "old_notif" "%d" "$ref"

Namerefs are Powerful

A nameref lets you do more with its referred-to parameter than just read from it. You can also, for example, write to it:

x=foo
declare -n y="notif_$x"
y=1234

The second command creates a nameref to a parameter that might not yet exist. That's no problem! It will be created when you first assign to it, even if that assignment is through the nameref.

The third command looks like it assigns 1234 to y, but really it assigns it to notif_foo. Now both $y and $notif_foo expand to 1234. $notif_foo expands to 1234 because that's the value stored in notif_foo; $y expands to 1234 because y is a nameref for notif_foo.

Suppose you want to know what y refers to, though. That is, suppose you want to get notif_foo, rather than 1234, from y. Well, you can, because with a nameref, indirect expansion has the opposite of its usual effect. This expands to notif_foo:

"${!y}"

In your function, you could introduce notif_$2 through a nameref.

This suggests another way to deal with notif_$2 in your function: you can introduce it through a nameref, and use the nameref for each subsequent access.

Currently you have:

x1=$(date +%s)
export "notif_$2=$x1"

As an alternative, you could use:

x1=$(date +%s)
local -n ref="notif_$2"
ref="$x1"
export "${!ref}=$ref"

That's more complicated that necessary, though, since presumably you only created the x1 parameter because export "notif_$2=$(date +%s)" is hard to read. ref="$(date +%s)" is just as simple, though, so you can omit the x1= line and write:

local -n ref="notif_$2"
ref="$(date +%s)"
export "${!ref}=$ref"

It occurs to me that you might have been using export just to assign the parameter for use in your shell. If you don't actually need to export it to child processes, then you can just use the first two lines, and that's simpler than what you have.

If you do need to export it, use all three. It's still a bit more complicated than what you have... but it may let you simplify the rest of your function, because, afterwards:

Instead of having to write notif_$2, you can just write ref.
This works even in scenarios where writing notif_$2 is inadequate. That is, it is no longer necessary to do anything special (like Way 1 and Way 2 above) to expand the parameter whose name is the result of expanding notif_$2. Just write ref.
This even works for writing -- and creating, and unsetting -- the parameter. (After the point of declaration, ref=text writes to and can even create the referred-to parameter; unset ref unsets the referred-to parameter.)

If you're going to use a nameref throughout your whole function, you may want to think of a more meaningful name for it than ref. (The best name will, of course, be determined by the task you are writing the function to carry out.)


Applications aren't displayed in dash after upgrading to 12.04

I had similar problem, moved zeitgeist directory to zeitgeist.bak and re-login:

mv ~/.local/share/zeitgeist  ~/.local/share/zeitgeist.bak

The problem is that the zeitgeist directory has the wrong permissions. You can also select the folder in Nautilus, and select properties, and make the directory read/writeable for yourself. Then you don't need to log out and in again.


Can't get Steam to launch with Ubuntu 14.04 64bit

Try to open the terminal and type in:

sudo dpkg --add-architecture i386
sudo apt-get update

This worked for me. Maybe you can find some more help here.


I believe this is just a normal scan it performs of a network to find other KDE connect devices. Perhaps the reason it mistakes the desktops for phones is that the KDE programmers were trying to make it possible to find KDE phones running (k)ubuntu rather than the stock android kernel. I'm pretty sure this is the case for me as well because my Samsung phone with KDE connect shows up as an option instantly, so a scan must be occurring. On the topic of attack vectors, it may be possible for a desktop to run a virtual KDE phone and expose its network interface to that which would be used on the laptop, but from there, you would need to authenticate the device from yours, so the attack would probably only yield what was delivered in the communication packets. I'm sorry I didn't answer your questions sequentially, but I, too am unsure of the specifics of this situation.


Ubuntu 18.04 bluetooth only 2 connections possible with sixad

Apparently this can be fixed by forcing the bluetooth devices to act as a master device. Maybe the bluetooth stack/hardware only supports 2 slave connections? By default, my controllers connect as a slave device on Ubuntu 18.04. So I do the following:

connect 2 controllers regularly
2x '#hcitool sr [mac] master' for connected devices
connect remaining 2 controllers


Upgrading system to 12.04 using CD did not preserve my users - how's best to restore them?

When performing an "upgrade" skipping releases (as you did when upgrading from 10.04 to 11.10) we will create a new installation with files in HOME untouched. Unlike an upgrade from 10.04 LTS to 12.04 LTS or from 11.10 to 12.04 users and groups from the previous installation are not preserved.

There is no other way than creating these users again with their home pointing to the former user home in /home/<username>. This will at least restore configuration settings and the private files for each user.

Command line

When creating our new user from the command line we can also assign a path to the HOME (which would be the existing path):

sudo adduser --home /home/myuser myuser

GUI

To do so from a GUI you may have to install gnome-system-tools  to have access to advanced user settings from users-admin (search for Users & Groups in the Dash). Choose Advanced Settings to configure the users's home:

Take care to give the users the same permissions they had before. In case there were any groups other that the default groups relevant to the user you need to assign them to these groups as well.


Freshly installed Ubuntu 14.04 and is very slow

Ubuntu 14.04 should fly on your laptop. Definitely go ahead and install it.

According to ubuntu system requirements, your pentium 4 should not have serious problems running ubuntu. Are you using the 32bit version? Since you have less than 2 GB of RAM, you should install the 32 bit version of ubuntu. 64 bit version might lag a bit.

A quick way to see if your display drivers are installed is to open up 'details' from the dashboard and look at 'display'. If your chipset is listed there, then the display drivers are proper and graphics is not the reason your system lags.


chrome flash plugin crash on ubuntu 14.0

In chrome, type chrome:plugins in the address bar to open the Plug-ins page and on the Plug-ins page that appears, find the "Flash" listing.

To enable Adobe Flash Player, click the Enable link under its name.

To disable Adobe Flash Player completely, click the Disable link under its name.

Source: https://support.google.com/chrome/answer/108086?hl=en


Check this entry in your /etc/apt/sources.list:

deb http://archive.ubuntu.com/ubuntu vivid main restricted universe

Start an update

sudo apt-get update

And install with

sudo apt-get install libffi-dev

The Package is in the main repositories:

% apt-cache policy libffi-dev
libffi-dev:
  Installed: 3.2.1-2
  Candidate: 3.2.1-2
  Version table:
 *** 3.2.1-2 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
        100 /var/lib/dpkg/status


Sudo not avaliable, cannot sudo su and root is not enabled

I used the latest Ultimate Boot disk (which runs Redhat), mounted the drive and as sudodus suggested, I chowned the affected directories back to root:root. restarted and now sudo is available to me again.


Google-chrome window loading problem - invisible

I've had this problem before.  To fix it I disabled the compositer and the problem went away.   It is kind of a lame fix but it has worked for me multiple times in the past.


Adding extract tool to nautilus (compiled from source code)

I think the "Extract Here" and "Compress..." menus are displayed when the File Roller utility is installed. (Nautilus source code check for the file-roller).

File Roller is an archive manager for the GNOME environment.  This
means that you can create and modify archives; view the content of an
archive; view and modify a file contained in the archive; extract
files from the archive.

You can install it with:

sudo apt-get install file-roller

Nautilus without file-roller:

Nautilus with file-roller installed:

Edit:
Do to nautilus was installed from source with the prefix /usr/local instead /usr. the package file-roller install the libnautilus-fileroller.so under /usr/lib/nautilus/extensions-3.0. To solve this issue you can try the following:
1) Create a softlink to the extension in /usr/local.

cd /usr/local/lib/nautilus/extensions-3.0

sudo ln -s /usr/lib/nautilus/extensions-3.0/libnautilus-fileroller.so .

2) Make sure the softlink was created.

ls -l /usr/local/lib/nautilus/extensions-3.0/libnautilus-fileroller.so

Finally you can Logout & Loging to see the changes.
Hope this helps.


How can I change the "timeout" duration for Nautilus "find the filename as you type" feature?

Unfortunately, the five second delay is hard-coded into Nautilus. Here's how to hack it:

First, set up your build environment:

sudo apt-get install build-essential
sudo apt-get install devscripts
sudo apt-get build-dep nautilus

devscripts might ask you to configure Postfix, select anything you want ("No configuration" should be fine, if you don't use Postscript, it shouldn't ask otherwise)
Get the source code of Nautilus:

apt-get source nautilus

(Notice no sudo here)
Now to change Nautilus. Open nautilus-2.32.0/libnautilus-private/nautilus-icon-container.c in your favourite text editor. The line we're concerned with is about line 149. It should say:

#define NAUTILUS_ICON_CONTAINER_SEARCH_DIALOG_TIMEOUT 5

Replace the 5 with any amount of time you like. This must be an integer, and ≥ 1. I've change it to one second, as the article recommends. ;-)
Now to build the package:

cd nautilus-2.32.0/
sudo debuild

This will take a while. It should, at least. If it finishes with an error like "patch does not remove cleanly", run sudo debuild -nc instead). Note also that this may complain about it not being able to sign the package. You don't need a signed package in this case, they're only required if you want to upload them somewhere.
You should now have some .deb packages in the parent directory. Install them all:

cd ..
sudo dpkg -i *.deb

Afterwards, restart your computer (logging out may be sufficient, I'm not sure), and test the changes. As you know, your changes will be undone with every update of Nautilus.


How do I stop xscreensaver during movies play?

You may try similar script to this one. Watch for player state through DBUS.

I lower delay to 55 sec, work better with 1min screen saver idle time.

Example VLC:

BTW, VLC in Ubuntu 14.04 has DBUS interface enabled by default. Where in Ubuntu 12.04 is not. Check it from:

Tools → Preferences → Advanced (or All) → Interface → Control Interfaces → D-Bus control interface.  (Apply then Restart VLC)

Create a file heartbeat.sh in ~/Desktop/:

#!/bin/bash

while sleep 55
do
    if [ "$(pgrep vlc)" != "" ]
    then
        state=$(bash -c 'gdbus call --session \
            --dest org.mpris.MediaPlayer2.vlc \
            --object-path /org/mpris/MediaPlayer2 \
            --method org.freedesktop.DBus.Properties.Get \
            "org.mpris.MediaPlayer2.Player" \
            "PlaybackStatus"')
        if [ "$state" = "(<'Playing'>,)" ]
        then
            #xscreensaver-command -deactivate
            xset s reset
        fi
    fi
done

Open terminal Ctrl+Alt+t
Add run permissions:

chmod +x ~/Desktop/heartbeat.sh

Run script:

~/Desktop/heartbeat.sh

Try VLC player.

For Gnome MPlayer (D-Bus enabled by default), use:

"$(pgrep gnome-mplayer)" and
--dest org.mpris.MediaPlayer2.gnome-mplayer
For (Totem) Videos player (D-Bus plugin disabled by default),

Edit → Plugins → Check D-Bus service. (Restart totem)

Use:

"$(pgrep totem)" and
--dest org.mpris.MediaPlayer2.totem
This is modified with to work with any player that provide MPRIS. It gets the list dynamically (drawback, it doesn't distinguish between audio only play and video play). The best way I think is to put manually the list of players you like:

#!/bin/bash

players_list=$(gdbus call --session --dest org.freedesktop.DBus \
    --object-path / --method org.freedesktop.DBus.ListNames | \
    awk 'BEGIN { RS=","; } /org.mpris.MediaPlayer2./ { gsub(/[\[\]()\x27]/, ""); print $1; }')

while sleep 55
do
    for player in $players_list
    do
        state=$(gdbus call --session \
            --dest $player \
            --object-path /org/mpris/MediaPlayer2 \
            --method org.freedesktop.DBus.Properties.Get \
            "org.mpris.MediaPlayer2.Player" \
            "PlaybackStatus")
        if [ "$state" = "(<'Playing'>,)" ]
        then
            echo $player $state send signal
            #xscreensaver-command -deactivate
            #use xset to work with all screensaver tools and avoid dimming display ...
            xset s reset
            break
        else
            echo $player $state
        fi
    done
done

Debug hints:

Watch X idle time

watch -n1 xprintidle

or:

while sleep 1; do xprintidle; done;

Check if disabling screensaver works (while running this script, xscreensave should not pop up)

    #!/bin/bash

    while sleep 55
    do
        #xscreensaver-command -deactivate
        #xdg-screensaver reset
        xset s reset
    done

Check for DBUS list for MPRIS player interface, example with VLC running:

    gdbus call --session --dest org.freedesktop.DBus \
    --object-path / --method org.freedesktop.DBus.ListNames | \
    awk 'BEGIN { RS=","; } /org.mpris.MediaPlayer2./ { gsub(/[\[\]()\x27]/, ""); print $1; }'

Output:

    org.mpris.MediaPlayer2.vlc
    org.mpris.MediaPlayer2.vlc.instance3939

Or using dbus-send command

    dbus-send --session \
    --dest=org.freedesktop.DBus \
    --type=method_call \
    --print-reply \
    /org/freedesktop/DBus \
    org.freedesktop.DBus.ListNames \
    | grep org.mpris.MediaPlayer2.

Output:

    string "org.mpris.MediaPlayer2.vlc"
    string "org.mpris.MediaPlayer2.vlc.instance3939"

References:

How to set up DBus query to get play state of VLC? original script by JB0x2D1
MPRIS D-Bus Interface Specification
Use qdbusviewer to check the correct destination name or to use other player you like.


Is it safe to shutdown computer without unmounting NTFS partitions?

Yeah its safe. Ubuntu unmount the NTFS partition during shutdown.You can also set your NTFS partition to auto mount so that you don want to mount it every time you logon.

To auto mount ntfs partitions in ubuntu, you must install ntfs-config

sudo apt-get install ntfs-config

You can also edit your fstab file to auto mount your NTFS partition,but it may be little confusing one for a beginner.See the below post to edit your fstab file to auto mount your NTFS partition but be sure what you are doing is right.

http://ubuntuforums.org/showthread.php?t=785263


Is there a way set my resolution to 1600x1200 without a monitor plugged in?

By default, X will use DDC to probe the monitor for its supported resolutions.  If the monitor is not plugged in, then this will not be possible.  If you know the characteristics of the monitor, you can program in additional modes through the xorg.conf file.

If you haven't already, add a Monitor section.  This can be hooked in in one of two ways: either a Monitor "$IDENTIFIER" directive in the Screen section (the old way), or a Option "monitor-$OUTPUT" "$IDENTIFIER" directive in the Device section (the new multi-head aware way).  If you use the second method, it uses the same output names as the xrandr utility.

In the Monitor section, add one or more ModeLine directives for each of the modes you want to program.  According to the man page, the format is as follows:

ModeLine "name" clock hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal options

If the monitor is plugged in, you should be able to get this information from the xrandr --verbose command.  For instance, if it shows the following:

  1920x1080 (0x59)  148.5MHz +HSync +VSync *current +preferred
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   67.5KHz
        v: height 1080 start 1084 end 1089 total 1125           clock   60.0Hz

Then the corresponding ModeLine would be:

ModeLine "1920x1080" 148.5 1920 2008 2052 2200 1080 1084 1089 1125 +HSync +VSync

You should then be able to configure that mode even though the monitor is not initially connected.


Java jar launcher which preserves programmatically set icon and name

To get rid of the gray question mark, you add this line of code:

stage.getIcons().add(new Image(getClass().getResourceAsStream("/Images/orca.png")));


You can install GDAL with Python binding from the repository using:
sudo apt-get install python3-gdal python-gdal libgdal-dev


Why does do-release-upgrade on Xubuntu running version 18.04 not offer to update to 20.04.1?

The Ubuntu Release Team has delayed point releases in the past to ensure a safe transition for the largest number of folks.

In this case, 20.04.1's release took place on a Thursday. The Release Team has historically been (understandably) reluctant to enable upgrades for millions of machines right before they leave for the weekend.

Some systems cannot be upgraded quite yet due to blocking bugs


These are individual files from the chosen icon-Theme. Of course you can use them for any purpose.

Where they live depends on the chosen icon-theme.

Example:

/usr/share/icons/AwOken/clear/128x128/apps/gmail.png

This is an Icon of the Theme "AwOken" in the size 128x128 pixel. The application-Icon are found in the subfoilder "apps" of each theme.

If you have installed an individual icon-theme (not root) the icons are saved in your home-directory (hidden sub-folder ".icons").

Example:
/home/michael/.icons/elementary/apps/128/gmail.png

An icon theme can point to another icon theme for all the icons it doesn't support itself. Therefor each icon them has an initial-file called "icon.theme". The row starting with "Inherits" points to the other icons-themes, that should be used in case of a missing icon.

Example:

[Icon Theme]
Name=elementary
Comment=Smooth modern theme designed to be intuitive.
Inherits=gnome,ubuntu-mono-light,hicolor,gnome-colors-brave

Example=directory-x-normal

#Directory list
Directories=actions/16,actions/22,actions/24,actions/32,actions/48,actions/64,actions/72,actions/128,animations/16,animations/22,animations/24,animations/32,animations/48,animations/64,animations/128,apps/16,apps/22,apps/24,apps/32,apps/48,apps/64,apps/112,apps/128,categories/16,categories/24,categories/32,categories/48,categories/64,categories/128,places/16,places/22,places/24,places/32,places/48,places/64,places/128,mimes/16,mimes/24,mimes/32,mimes/48,mimes/128,devices/16,devices/22,devices/24,devices/32,devices/48,devices/64,devices/128,emblems/16,emblems/22,emblems/24,emblems/32,emblems/48,emblems/64,emblems/128,status/16,status/22,status/24,status/32,status/48,status/64,status/128,stock/16,stock/22,stock/24,stock/32,stock/48,notifications/16,notifications/22,notifications/24,notifications/32,notifications/48,panel/16,panel/22,panel/24,panel/48,

[actions/16]
Size=16
Context=Actions
Type=Fixed

Theoreticaly, you can build your own icon-theme containing only one icon and including another icon-theme for the whole rest.

I hope this answers your question. Please excuse my poor english...


Error message when loading into Ubuntu 18.04 /.xprofile

Just remove .xprofile in your home directory. Alternatively, remove the lines that the system complains about (1-7 in your case), but I doubt that you need .profile at all.


Im trying to find out why plex isnt starting on boot any more, ubuntu 15.04 server

Is there somewhere else to look?

Yes:

systemctl status plexmediacenter
systemctl status plexmediaserver
journalctl -e -x

  I have to do it manually now

systemctl preset plexmediacenter is probably going to be your friend.  But that's getting ahead of yourself.  Read the logs first.

Further reading

Problems starting plexmediaserver on Kubuntu 15.04


Ubuntu 16.04 Jan 3 2018 update causing screen/access issues

As version 17.2.4 of the Mesa graphics library causes the problem, below  commands upgrade this library to its newer version that is free of this bug feature:

sudo add-apt-repository ppa:paulo-miguel-dias/pkppa
sudo apt-get update
sudo apt-get upgrade
sudo reboot


xrandr - different effect when put in .xprofile

The method used by others (linked in comments) is considered "hack" by OP. Which I guess it might be.

Using X configuration file which is loaded before login screen and not after login can be done here:

$ cat /etc/X11/xorg.conf
Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Monitor"
    Identifier "DP-1-1"
    Modeline "3840x2160_54.00"  637.50  3840 4152 4568 5296  2160 2163 2168 2230 -hsync +vsync
    Option "PreferredMode" "3840x2160_54.00"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "None"
    Option "TearFree"    "true"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1@0:0:0"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
EndSection

Xorg Monitor options


From the attached logs, it would appear the the main drive (/dev/sda) is failing. At the very least, the early sectors have been corrupted or overwritten since the repair utility does not detect an MBR.

You have successfully booted a USB stick, so you can use the "Disks" application to check the disk for S.M.A.R.T. errors.

If the drive is physically OK, it is still logically ruined. If you need data from it, you will need to engage some kind of disk data rescue service. If you don't need the data on the drive, you can just attempt a fresh re-install and overwrite the existing contents.


You can use libgraphicsmagick in C, download the library and the header using apt-get:

sudo apt-get install libgraphicsmagick1-dev

Now you have the headers installed, you should be able to use the library in your C code:

#include <magick/api.h>

Please see the API documentation for further programming examples and help: http://www.graphicsmagick.org/api/api.html


Graphic Card GeForce GT 630 installation on 64bit Ubuntu 15.04

There is an easier way of installing the latest Nvidia Drivers on ubuntu.

Open terminal Ctrl+alt+T
Remove all previous installations of Nvidia with :

sudo apt-get remove --purge nvidia*
Update the repositories :

sudo apt-get update
Install the Driver:

sudo apt-get install nvidia-352
Finally Reboot :

sudo reboot

Installed :)

NOTE: Your latest driver number may not be 352 Please make sure the latest available version of the Driver for your card On Nvidia (352.66 =>352)

Update: I removed the PPA from the answer because it is not necessary to add it when installing 352.


how to decrypt pgp file? What is best GUI tool for it?

A bit of info before. There are two forms of encryption, symmetrical and asymmetrical.

Symmetrical encryption uses the same key to both encrypt and decrypt a file. The key is usually a passphrase that you chose when you encrypted the file. The same passphrase is required to decrypt the file.

Asymmetrical encryption uses two different keys. One to encrypt a file a different one to decrypt it. Usually, the key to encrypt the file is public, and the file is encrypted with one recipient in mind, because it is the recipient's public key that will be used to encrypt the file. And then only the recipient, with his private key can decrypt the file.

A simple video explaining it.

Since there are two ways of encrypting a file, there are also two ways of decrypting a file. When dealing with OpenPGP encryption on Linux the program used is usually GNU Privacy Guard, or GnuPG, invoked with the command gpg. GPG and PGP are both implementations of the same thing, a standard called OpenPGP, so usually both can handle files encrypted with either one.

Decrypting a file encrypted with symmetrical encryption

Usually, all that is required is a simple gpg FILE.gpg. Once issued, you will be requested for a passphrase, and if correct, you will have a new FILE, on the same folder, which is the decrypted version of that file.

Sometimes, instead of remembering passwords, people might choose to symmetrically encrypt a file with a key instead. In this case, the key is still a passphrase/password, just one that you don't need to type. If you were given a key file together with the file, you might decrypt it with something like:

gpg --batch --passphrase-file PASS.key --output FILE --decrypt FILE.gpg

Decrypting a file that uses asymmetrical encryption

If you read the bits I posted before and watched the video, you should know that there are two files used with asymmetrical encryption. Both a public key and a private key. The private key is, well, private. You do not want to share your private key, and nobody should be sending you their private key.

You should generate your own key pair, and share your public key with whom else might want to send you something. Likewise, you should share your public key with them, so that they can send encrypted files to you. Again, do not share your private key.

When dealing with asymmetrical keys and files, you have to add the keys to your keyring. When you generate your key pair, both of them should have been automatically added to it. And you want to add your friends public key to it so that you can encrypt files for them. If, for some reason, you were given a private key, you also have to add it to your key ring before you can decrypt files with it. To list which keys you already have stored you should use:

gpg --list-keys and gpg --list-secret-keys.

To import a key into your keyring you want to:

gpg --import KEY.

Once you have the private key in your keyring, all that you need to do is a simple gpg FILE.pgp. If you secured your private key with a passphrase, you will be prompted for it. Alternatively, if you wish to decrypt the file into a specific file, you can use:

gpg --output MYFILE --decrypt FILE.gpg

Now, dealing with your specific case. If you do not have the private keys necessary to decrypt it in the keyring, first you have to add them. My guess is that the private key is actually sec.key, and maybe the nazar-2000.pgp file. There is no real naming convention around it, so you'll have to either to test or use the file command to figure it out. As you might already know, Linux doesn't really care about file extensions. After that, decrypting them is as simple as I pointed out in the answer. That is, assuming they are using asymmetrical encryption.

As to GUI, I can't be of much help, maybe someone might chime in. I personally use and recommend the Enigmail extension with Thunderbird (Addon link). The KDE program, Kleopatra, seems to be highly recommended to use on the system. Gnupg also have a few recommended frontends.


USB ports and other peripheral devices on laptop sometimes don't work

The reason for my problem is a bug in core (previous versions) for my laptop. Now I use 3.19.0-74 Kernel and don't have problems.


Region 1 DVD won't play - all region 2 dvds play fine

This seems to be a peri-hardware issue with a few solutions:

Don't import DVDs, use local-region ones
Buy another DVD drive and set that to your second region
Replace the drive with one whose firmware ignores region bits (a multi-region drive)

If you want to get a little dirtier, some DVD drives can have an RPC1 (multi-region) firware written to them but —and I have to stress this— it is extremely model specific and not at all common. Google is your friend here. Chances are the tool for your drive, if it exists, is also only going to run in Windows; do not try Wine for this.


You're using examples out of the master branch of Snapcraft, which represents Snapcraft 2.x. Since you're using Snapcraft 1.x, I suggest either using the example here, or use the examples distributed for your Snapcraft release with:

$ sudo apt-get install snapcraft-examples

Those examples should work a bit more like what you expect :) .


I do not find the version of LibreOffice

Easiest way to find out which version is to open a document, in the global menu goto

Help > About Libre Office


How to make a deb file which tells the system a reboot is required?

If you do need a reboot after installation you will make a call to /usr/share/update-notifier/notify-reboot-required in the .postinst script for your package.  This can easily be found be reading the .postinst script of any linux-image package.

However, I would be concerned about any custom PPA that requires a reboot after installation.

Other than kernel updates, there are few packages that require a reboot.  There are important libraries that may required certain services to be restarted.

If your install script requires the service it installed to be restarted, it should perform the restart as part of the post installation procedure.  This is normally the case for daemon processes.

Many packages don't require any restart at all.


How to adjust the font size in Ubuntu browser?

I don't think the Ubuntu browser zooms at this point.

Its a version of very lightweight browser called Oxide (https://launchpad.net/webbrowser-app) and this issue is a known bug in Oxide (https://bugs.launchpad.net/oxide/+bug/1447395).

There are tweaks and hacks for zooming/magnifying the screen (Zoom desktop tool for Ubuntu 14) but I doubt these will satisfy you.


Accessing Ubuntu VM GUI over SSH remotely

ssh -X will do the trick. It will forward X so that you can launch graphical apps from the remote server.


What to do with announcement about ttf-mscorefonts-installer?

Purge it and install it again.

sudo apt purge ttf-mscorefonts-installer
sudo apt install ttf-mscorefonts-installer

That will make it ask for the EULA again.
Could it be you neglected to accept the EULA the 1st time? Because that is possible and would stop fetching the actual fonts (the package does not contain the fonts but makes a webrequest to fetch them).


How to list also two lines after a grep match?

grep -A 2 'STRING' filename

lists the matching lines and two lines that follow the match.


Unable to open any graphical app with "sudo"

Older post is below, but is still 100% valid.

Mir is not what one would consider stable/ready for operation. Most of the Ubuntu core (such as the below mentioned gksudo and other programs) still relies on X, and can't handle what Mir uses. Until further notice, it's recommended you switch back to X11 unless you have a very good reason to use Mir. If the latter is true, get comfy with sudo nano.

Repeat after me:

  NEVER RUN GRAPHICAL PROGRAMS WITH sudo! *

*except in extremely rare cases where you know exactly what you're doing.... Or you have a thing for pain. Either/or.

Again. And once more to your dog for good measure.

Instead, use the gksudo command to launch a graphical command with root powers, like so:

gksudo gedit /var/log/auth.log

If your system does not have GKsudo installed on it, install it first with apt:

sudo apt install gksudo

Note that if you're running KDE, use the equivalent kdesudo command.

The reasoning behind this is that sudo does not preserve user-land permissions, which are very often used by graphical applications. For example, if you change the gedit config file after opening it with sudo, you'll have an issue where gedit's config file is now owned by root and is unreadable and/or unwriteable to you, the user.

gksudo takes care of this for you and handles all of the heavy lifting of ensuring that permissions stay the same and don't break anything.

Console commands are different because they often don't save userland configs, and are designed for the use of sudo as opposed to gksudo.


From the (few) sources available (such as this one at Engadget: http://www.engadget.com/products/acer/aspire/one/zg5/specs/), it would seem that the RAM controller chip in your netbook is capable of using only 2 RAM slots, each with up to 1 GBytes.

Since you already have 512 MBytes in one of the slots (soldered to the motherboard), following this reasoning you can only put in 1 GByte extra RAM in the other slot, giving the 1.5 GBytes total given in the reference above.

This being said, if you have a spare 2 GBytes DDR2 bar available, I would try it out and take it from there. The only thing I can see that would damage the RAM would be excess clock, but the Acer seems quite low in this respect.

Unfortunately, 4 GBytes seems impossible on this machine.

Hope this helps.

PS: if you find Ubuntu is a tad slow on this computer, it may also be due to the graphics card. A desktop with lower requirements such as LXDE, XFCE or Mate would probably help speed things up.


Ubuntu hangs on startup at /dev/mapper/ubuntu--vg-root. How do I fix it?

After two months with this problem, I could find a solution. For some reason, when I ran apt upgrade, my kernel: 5.4.0-52-generic (18.04.4 LTS) had this error that you said. So I moved to a older kernel 5.4.0.48 recovery mode.
sudo apt install aptitude
sudo aptitude update
sudo aptitude dist-upgrade
reboot :)
And that is all, I could fix all the broken packages. Now I'm using this kernel 5.4.0.48.


Are there any commands I can use to ensure that the NTP service is running and is also responsive?

The answer is version specific, you can use official Ubuntu Server documentation for references.

Ubuntu 14.04 LTS

In 14.04 LTS official documentation recommends to use ntp / ntpdate (see page 49 of Ubuntu 14.04 LTS Server Guide):

  Ubuntu uses ntpdate and ntpd.

So expected command would be service ntp status or similar.

Ubuntu 16.04 LTS

In 16.04 LTS official documentation says different (see page. 54 of 16.04 LTS server guide):

  Starting with Ubuntu 16.04 timedatectl / timesyncd  (which are part of systemd) replace most of ntpdate / ntp

Ubuntu 16.04 LTS I do not know about chrony, time serving is done with ntpd from ntp package. So here systemctl status ntp.service may be used to check server status.

Ubuntu 18.04 LTS

In 18.04 LTS as Rinzwind already answered chrony is used (see page. 56 of 18.04 LTS server guide).

I expect that systemctl restart chrony.service may be used for status check.


alt+f4 script equivalent for custom keyboard shortcut?

I found a solution:
http://tripie.sweb.cz/utils/wmctrl/
and
Close active window from terminal
where helpful.

You do have to run sudo apt install wmctrl but it it OK


ON UBUNTU 14.04

Switch to tty1 using Ctrl+Alt+F1
Login to your user account
And export your Display with

export DISPLAY=:0

Add opengl to Compiz active plugins list

dconf write /org/compiz/profiles/unity/plugins/core/active-plugins "[`dconf read /org/compiz/profiles/unity/plugins/core/active-plugins | sed -r 's/(\[|\])//g'`, 'opengl']"

Or reset the key to default

dconf reset /org/compiz/profiles/unity/plugins/core/active-plugins

If it didn't work, come back and reset all Compiz settings to defaults

dconf reset -f /org/compiz/

Restart graphical display manager after one of the dconf command above

sudo service lightdm restart

Switch back to tty7 (X graphic display) Ctrl+Alt+F7

Try login again.

However, Compiz ccsm applies changes instantly so may be it's a nice habit to make configuration backup before change.

Backup before change:

dconf dump /org/compiz/ > compiz.dconf

Restore if things went wrong:

dconf load /org/compiz/ < compiz.dconf

Sometimes it is helpful to monitor the changes: dconf watch /org/compiz/

Reference:

man dconf
What is dconf, what is its function, and how do I use it?


Why does ubuntu 13.10 on a AMD fusion boot into a corrupted graphical screen?

You need fglrx

press f4 during the purple bootscreen
and then f8 to add '--radeon.modeset=0' to the bootline.

or hold the left shift key during boot to enter the grub menu. with the 'e'key you can add the parameter so that it will boot.

once you have booted, you can install fglrx by entering

apt-get install fglrx

in a terminal


How do I connect Picasa 3.9 to my online account?

read the instructions here ...

Install Picasa 3.9 in linux


Problem after "sudo apt-get install fglrx-amdcccle"

In your login screen, press ctrl+alt+f1 you should be in tty now, login using your username and password. Now

Issue the commands one by one. Make sure you have a working Internet connection.

sudo apt-get purge "fglrx.*"
sudo rm /etc/X11/xorg.conf
sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx:i386 libgl1-mesa-dri:i386 libgl1-mesa-glx:amd64 libgl1-mesa-dri:amd64
sudo dpkg-reconfigure xserver-xorg
sudo reboot


I looked into this mostly for fun and for learning (and hopefully for the rep!). I wish I could have some more time to play with ioctl (thanks to Sneetsher for the suggestion) and with what I've done so far in order to make a more elegant solution, but the bounty is about to expire and it's not likely that I can make everything in time, so I'm posting this solution "as it is" (at least for now).

Disclaimer:

I don't know which are the consequences of changing something into /proc/device-tree, so if you really know what you're doing, keep reading.

This particular implementation of this solution requires a running kernel > 3.10. It involves the compilation of a custom kernel module and the execution of a bash script to perform a sort of hot-switch between /proc/device-tree and a custom file device-tree_new.

Limits:

Upon module removal, the custom /proc/device-tree it's removed! Another reason to read the disclaimer again.
The custom /proc/device-tree's buffer has a limit of 65535 characters. Everything over the 65535 character is truncated. To adjust the buffer's size, change the following constant definition and variable declaration in the module's source code:

#define MAX_BUFFER_SIZE 65535
static unsigned int proc_buffer_length_v; (so that it can hold a number > 65535)

How it works:

The module itself:

deletes /proc/device-tree
creates a new blank /proc/device-tree with permissions 0666

The bash script itself:

Loads the module
Writes into /proc/device-tree the content of device-tree_new

This is the "Makefile" Makefile for the module (note that all the whitespaces at the beginning of each make line must be replaced with a TAB character):

obj-m += proc_module.o

all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

This is the "proc_module.c" source file of the module:

#include <linux/module.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/slab.h>
#include <linux/uaccess.h>

#define DEBUG 1
#define MAX_BUFFER_SIZE 65535

static struct proc_dir_entry* proc_dir_entry_p;
static struct file_operations file_operations_s;
static char* proc_buffer_p;
static unsigned int proc_buffer_length_v;
static unsigned short int read_flag;

int read_proc(struct file* file, char* buffer, size_t count, loff_t* offset) {
    if(DEBUG) printk(KERN_INFO "read_proc() called.\n");
    if(read_flag)
        read_flag = 0;
    else {
        read_flag = 1;
        return 0;
    }
    copy_to_user(buffer, proc_buffer_p, proc_buffer_length_v);
    if(DEBUG) printk(KERN_INFO "Ok. (count = %zu)\n", count);
    return proc_buffer_length_v;
}

int write_proc(struct file* file, char* buffer, size_t count, loff_t* offset) {
    size_t n;
    if(DEBUG) printk(KERN_INFO "write_proc() called.\n");
    if(count >= MAX_BUFFER_SIZE) {
        if(DEBUG) printk(KERN_INFO "write_proc(): Buffer exceeded!\n");
        n = MAX_BUFFER_SIZE;
    }
    else
        n = count;
    kfree(proc_buffer_p);
    if(DEBUG) printk(KERN_INFO "kfree() called.\n");
    if(!(proc_buffer_p = (char*)kmalloc(MAX_BUFFER_SIZE*sizeof(char), GFP_KERNEL))) {
        if(DEBUG) printk(KERN_INFO "kmalloc() ko.\n");
        return count;
    }
    if(DEBUG) printk(KERN_INFO "kmalloc() ok.\n");
    copy_from_user(proc_buffer_p, buffer, n);
    proc_buffer_length_v = n;
    if(DEBUG) printk(KERN_INFO "Ok. (count = %zu)\n", count);
    return count;
}

static int __init init_f(void) {
    if(DEBUG) printk(KERN_INFO "Module inserted.\n");
    remove_proc_entry("device-tree", NULL);
    if(!(proc_dir_entry_p = proc_create("device-tree", 0666, NULL, &file_operations_s))) {
        if(DEBUG) printk(KERN_INFO "Proc entry not created.\n");
        return -1;
    }
    if(DEBUG) printk(KERN_INFO "Proc entry created.\n");
    file_operations_s.read = read_proc;
    file_operations_s.write = write_proc;
    if(!(proc_buffer_p = (char*)kmalloc(1*sizeof(char), GFP_KERNEL))) {
        if(DEBUG) printk(KERN_INFO "kmalloc() ko.\n");
        return -1;
    }
    if(DEBUG) printk(KERN_INFO "kmalloc() ok.\n");
    proc_buffer_p[0] = '\0';
    proc_buffer_length_v = 0;
    read_flag = 1;
    if(DEBUG) printk(KERN_INFO "Ok.\n");
    return 0;
}

static void __exit exit_f(void) {
    kfree(proc_buffer_p);
    if(DEBUG) printk(KERN_INFO "kfree() called.\n");
    proc_remove(proc_dir_entry_p);
    if(DEBUG) printk(KERN_INFO "Proc entry removal requested.\n");
    if(DEBUG) printk(KERN_INFO "Module removed.\n");
}

module_init(init_f);
module_exit(exit_f);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("kos");
MODULE_DESCRIPTION("proc_module");

This is the "switch.sh" bash script:

#!/bin/bash

sudo rmmod proc_module.ko
sudo insmod proc_module.ko && cat device-tree_new > /proc/device-tree

Instructions:

Open a Terminal with Ctrl+Alt+t
Create a new folder: mkdir <folder_name>
Change the current working directory to the new folder: cd <folder_name>
Create the three files above using the exact same names enclosed between the double-quotes
Create the custom device-tree file and name it device-tree_new
Mark "switch.sh" as executable: chmod a+x switch.sh
Compile the module: make (two warnings will be thrown by gcc)
Launch the bash script: ./switch.sh
cat /proc/device-tree to see the result


Ubuntu killed Window volume. How to reinstall window from Ubuntu

Ok, if that image represents your PC's true situation, then your installed Windows is pretty much gone for good. Irrecoverable. Because you reformatted that partition from ntfs to ext and did overwrite the allocated space with your Ubuntu.

Next i will present the easiest solution i could use and i do use to dual-boot Win+Ubuntu for more than 5 years now. It doesn't necessary means it's the best one, it's just the one than makes most sense to me. Other people may find other/better solutions.

First i boot a Live Ubuntu and sanitize my hard disk: in GParted i erase all partitions, all of it. Just empty space. Then i decide if a want BIOS-MBR partitioning or a UEFI-GPT one. It's actually a matter of motherboard capability, it's either BIOS or UEFI (UEFI is more modern solution).

I create a new partition table (MBR or GPT) in GParted, but i create no partition (yet). I reboot, i remove the Live Ubuntu medium and insert the Windows installation medium. I let Windows install itself the way it wants (with system, recovery and main partitions, whatever).

When Windows installation has finished, i reboot , i remove the Windows installation medium and insert the Live Ubuntu back again. I boot into Live Ubuntu again, open GParted and create one ext partition after the Windows partition. I DO NOT delete or merge any of the partitions created by Windows.

At this point i have 3 primary Windows partitions + one Ubuntu primary partition. This is possible even for older BIOS computers. Next, for BIOS-MBR PCs i create an extended partition and create a swap partition inside the extended space. UEFI-GPT supports 6 primaries easily, so no need for the extended trick.

I apply changes in GParted, then i click the install Ubuntu icon. I choose the "install Ubuntu alongside Windows" option. When asked where i want Ubuntu installed i point to the ext partition. I choose to install GRUB to /sda, meaning the root of the harddisk, not to a specific partition like /sda1, /sda2, etc.

After the installation finishes, i reboot, i remove the Live Ubuntu medium, and the GRUB menu should present itself asking me to choose what OS to start: Ubuntu or Windows. That's all! Easy-Peasy dual-booting for newbies.


Extend battery by killing unnecessary services

Getting rid of drivers or modules won't help you much and I doubt that unnecessary services consumes noticable amount of battery life. But of course you might want to look for processes that consume CPU time using top, htop or glances. For I/O operations it's better to use iotop. And for network connections you might want to look at netstat, lsof or tcpdump.

What you can do to really extend your battery life is to maintain it in proper way in the first place, but you can read about it elsewhere.

Then, if you need terminal with word processor - switch to lightweight window manager, i.e. xfce. Or you can even go crazy and switch to blackbox window manager.

Consider disabling services like cups if you don't use printers, bluez if you don't use bluetooth. If you're paranoid you might even switch to static IP configuration and disable DHCP.

I also recommend Stacer for cleaning stuff up, if you want something that works automagically.


Installed Ubuntu, windows 7 boots up by default?

If you installed grub onto your 'c:' drive (primary boot device), then hit shift when turning it on to bring up the menu. If you are using the windows 7 bootloader, hit f8 to bring up the windows boot menu.


How to kill MySqlWorkBench process in Ubuntu?

Search for mysql-workbench in the processes.

$ps -ef |grep mysql-workbench
XX    8327  1159  0 12:04 ?  00:00:00 /bin/bash /usr/bin/mysql-workbench
XX    8330  8327  0 12:04 ?  00:00:00 /bin/sh /usr/bin/catchsegv /usr/lib/mysql-workbench/mysql-workbench-bin

2nd column will have the process ID to kill. In this case 8327. It will also stop the 2nd line.

Regarding the options: -ef options help us to list all processes (-e) using full-format syntax (-f)

  And is there any other faster and lighter Mysql query browser for Ubuntu ?

See but I doubt they will be as good.


Can't connect to Ubuntu/Lubuntu via VNC (gray screen)

Looks like that there is no solutions for gnome, so I chose xfce4
 $ sudo apt update
    $ sudo apt install xfce4 xfce4-goodies
    $ sudo apt install tightvncserver
    $ vncserver
    $ vncserver -kill :1
    $ mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
    $ nano ~/.vnc/xstartup
    (paste the follow being in the xstartup file and write out)

    #!/bin/bash
    xrdb $HOME/.Xresources
    startxfce4 &

    $ sudo chmod +x ~/.vnc/xstartup
    $ vncserver


You could edit the /etc/fstab file in a text editor like such as gedit or subl, or you could just do this:

Make sure the Hard Drive is connected.
Open Disks
Click on the Hard Drive you want to modify.
Click on the Partition you want to modify.
Click on the gear icon
Click on Edit Mount Options
Move the Automatic Mount Options slider to Off
Type in the path you want the Partition mounted too in the Mount Point text box.
Click the OK button.
Type in the super-user password.  This will make the necessary changes to the /etc/fstab file for you.


How can I use conditional constructs in a bash case statement?

Something like this should do the trick. I think it looks kind of nice this way:

case $((
  sumcreate_retval <  0 && movesum_retval <  0 ? 1 :
  sumcreate_retval >  0 && movesum_retval >  0 ? 2 :
  sumcreate_retval >  0 && movesum_retval <  0 ? 3 :
  sumcreate_retval >  0 && movesum_retval == 0 ? 4 :
  sumcreate_retval <  0 && movesum_retval >  0 ? 5 :
  sumcreate_retval <  0 && movesum_retval == 0 ? 6 :
  sumcreate_retval == 0 && movesum_retval >  0 ? 7 :
  sumcreate_retval == 0 && movesum_retval <  0 ? 8 :
  0
)) in
  (1) script_retcode="$both_warn_err";;
  (2) script_retcode="$both_crit_err";;
  (3) script_retcode="$createwarn_movecrit_err";;
  (4) script_retcode="$createwarn_err";;
  (5) script_retcode="$createcrit_movewarn_err";;
  (6) script_retcode="$createcrit_err";;
  (7) script_retcode="$movewarn_err";;
  (8) script_retcode="$movecrit_err";;
  (0) script_retcode="success_return";;
esac


Disable automatic printer detection in Kubuntu 20.04

How about apt purge cups-browsed? All gone?


Second Monitor Not Detected After HDMI unplugged and plugged back in

Some system updates came out today, and I applied those using Synaptic Package Manager. After the update and another reboot, the dual-monitor system is working again. I don't see anything in the updates that appear to have anything to do with display, but my guess is that maybe running the updates flushed out whatever the disconnect was that was keeping the second monitor from being picked up.


How to hit Ctrl + C on a terminal so that child terminals do not be closed?

Run the script itself with a fork &, i.e. if your script name is test.sh, run it like:

:$ ./test.sh &

Even if the parent process is killed, your spawned terminals should still be running :)

Of course, if you do it this way, the Ctrl+C will have no effect [i.e, the process will still be running in the background. I killed it with a kill -9. You could also close the shell.]

And to answer your second question, if the parent terminal/proccess is killed, then the parent id does indeed become 1. See the screenshot I've attached :)


Failed to download repository information with Google Chrome installed on Ubuntu 14.04 64bit since beginning of March 2016

Cause

When you install Google Chrome, it adds its own repository to your system so that it can be updated via Software Updater. Around the beginning of March 2016, Google dropped their 32bit builds for Chrome. On 64bit Ubuntu, Software Updater expects to see both 32bit and 64bit versions of packages in a given repository. Since Google removed the 32bit version, Software Updater can't find that package anymore and produces an error that shows up as Failed to download repository information, Check your internet connection.

Fix the repo

In order to fix this, you have to tell the package manager that the Google repository is 64bit-only. To do this you have to edit the Google repository file to add [arch=amd64] after the deb at the beginning of the line. The following snippet will check if the error is indeed with the Google repository and make the change for you. Make sure you copy the whole snippet (it's one line) and paste it in your favorite terminal:

url=http://dl.google.com/linux/chrome/deb/; if sudo apt-get update 2>&1 >/dev/null | grep --quiet "$url"; then for file in $(sudo grep -Rl "deb $url" /etc/apt/); do sudo sed -i 's/^deb/deb [arch=amd64]/' "$file"; done; fi

Upgrade Chrome

Close and re-run Software Updater and upgrade Chrome to the latest version - 49.0.2623.87-1 or later.


Clearing out Deja-Dup backups from my Ubuntu One cloud?

1) Go to https://one.ubuntu.com/
2) Login
3) Go to Files and Folders
4) Look for ~/dejadup/Cr-48
5) Delete this folder.

This is how it looks like:

And you will have to delete the files (just stop syncing will not free up space):


Python (v2.7) requires to install plugins to create media files of the following type: Vorbis encoder

Same thing happened to me, but I finally get some clues in this thread.

Turns out that problems are caused by the config file:

sudo gvim /usr/share/rhythmbox/rhythmbox.gep

Delete or comment the "preset" line as follow

[profile-oggvorbis]
name = oggvorbis
description = Ogg Vorbis
format = application/ogg
type = container

[streamprofile-oggvorbis-1]
parent = oggvorbis
type = audio

#preset = rhythmbox-custom-settings

format = audio/x-vorbis
presence = 1

and, voila, restart your Rhythmbox, problem solved.


grub error no such partition on Dual boot of windows 7(32 bit) and ubuntu 12.04 64 bit on two patritions

Re-install Ubuntu and while installing in partitioning screen check for where to install bootloader(on bottom of window). Set 1TB disk there and proceed with installation.


Ubuntu 12.10 no network devices detected

The simplest thing to do and which doesn't seem to have been suggested yet, is to open Additional Drivers (jockey-gtk), and check if you can install the proprietary drivers for your wireless card (if any). Then I would suggest a precautionary reboot. If it still doesn't work, right-click NetworkManager ensure that Enable Wireless is checked. If it still doesn't work, then double-check wireless connectivity using wicd-gtk (sudo apt-get install wicd).


How can I install 'Revenge of the Titans'?

Try running this command first:

sudo mkdir -p /opt/revengeofthetitans/full_length_music


Installing ubuntu to my windows 8 tablet pc

Try Disableing Secure boot. On windows 8: Hold the shift key and then click restart from the power menu then you should reboot into the settings screen Do you see a UEFI option? if you don't click on the advanced options tile.


Made a huge mistake and deleted my /home/user folder (Ubuntu 14.04 LTS)

Stop using that Ubuntu installation

First of all immediately stop using that Ubuntu installation. Now!

You should boot straight to a live DVD/USB. If you don't have one, do not download it from that system and go get it somewhere else. However, if you have a dual boot, you might also use Windows to download the ISO.

Try to access the deleted files

When you are using the live DVD, check the partitions with:

sudo parted -l

You need to find the right one that contains your home directory. For example, my computer shows the following for drive /dev/sda:

Number  Start   End    Size   Type      File system  Flags
 1      1049kB  256MB  255MB  primary   ext2         boot
 2      257MB   250GB  250GB  extended
 5      257MB   250GB  250GB  logical

This is not the best example because I am using full disk encryption, but assuming I wanted to restore files from /boot I would target /dev/sda1  (basically look at the number).

At this point, connect an external hard drive where you want to recover the files.

Now you need to install a program called Testdisk:

sudo apt install testdisk

Then run it on your drive:

sudo testdisk /dev/sda

It will display an interactive procedure that you need to follow through the textual interface. Basically you will arrive at a list of partitions and you need to select the right one with the arrow keys.

Then you will need to press P to show the files and navigate in the directory tree. Once you have determined that hopefully your home directory contains the stuff (shown in red since it has been deleted), go one level up so that you highlight your username inside /home and press C to activate the Copy function.

Testdisk will ask you where you want to save the files. Navigate to a directory in your external hard drive and confirm. Wait patiently while it restores your data in the external drive.

Bottom line

Ubuntu has a backup program installed by default. You should use it routinely, before something like this happens again.


I think that the best option for your request/issue is to go in CompizConfig Settings Manager, select General Options, Focus & Raise Behaviour tab, and uncheck Click To Focus and Auto-Raise options:

If you want that the window in which you go with the mouse to scroll to come on top of the other windows, you can keep Auto-Raise checked, but in this case I suggest you to increase the value for Auto-Raise Deleay somewhere around 1000.


There is a program called Universal Extractor. It works with many exe files.


Which graphic or graphics card for 4 monitors?

Prior to mainstream adoption of the PCIe bus, configurations of more
  than two monitors were either achieved with an AGP card with dual
  video outputs or by using an AGP graphics adapter as the primary
  device and a conventional PCI graphics adapter as a secondary device.
  However, given the bandwidth limitations of the older PCI bus[citation
  needed], such setups were not common, and maximum overall graphics
  performance could be obtained only by using specialty solutions such
  as the Matrox G450, which features four outputs from one graphics
  adapter. Now that computers with two or more PCIe interfaces are
  popular, middle- and high-end computers are no longer limited to two
  monitors driven by a single main graphics adapter. If a dual PCIe
  interface is not available or is otherwise occupied, a standard PCI
  graphics card can still be used to provide additional video outputs,
  albeit with performance trade-offs. Specialized
  application environments such as CAD, day trading of corporate stocks,
  and software development are increasingly using six or more monitors
  on one production system.

  A quad-monitor Digital Audio Workstation Additional monitors can also
  be connected to PCs via a USB connection such as DisplayLink.

Seems that it doesn't matter much if it's connected to a PCI Express slot. If it's just a normal PCI (or maybe an AGP) it's recommended to use 2 seperate graphic cards.

Source: http://en.wikipedia.org/wiki/Multi-monitor#More_than_two_monitors

Also, here's a PCI Express graphic card that support 4 monitors. Don't know how Ubuntu compatibility is though.
http://www.nextag.com/VisionTek-Radeon-HD5570-PCIe-827596030/prices-html


Expansion with *.txt in the shell doesn't work if no .txt file exists

Adapting from the bash shell man page,

  bash  scans each  word  for the characters *, ?, and [.  If one of
  these characters appears, then the word is regarded as a pattern, and
  replaced  with  an alphabetically  sorted list of filenames matching
  the pattern.  If no matching  filenames  are  found,  and  the shell
  option  nullglob is not enabled, the word is left unchanged.  If the
  nullglob option is set, and no  matches  are  found,  the  word  is
  removed.

In this case I presume nullglob is not enabled, so the word is left unchanged - hence the output you see.


Major problems with setrlimit after upgrading to Saucy

There where changes to apparmor that could affect rlimit enforcement in the Ubuntu 3.11 kernel in saucy. Note these changes currently only apply to the Ubuntu Saucy kernel and not to the upstream kernels as saucy is using apparmor patches that have not entered the upstream kernel yet.

If rlimits are not working correctly please file a bug.


Try these:

sudo apt-get remove gnome-screensaver
sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra

Then search for "Screensaver" in the menu and tweak its settings to your needs.

To add Xscreensaver to startup, open Startup Applications and add "xscreensaver -nosplash".

To get CTRL + ALT + L to lock the screen and start the screensaver, go to System Settings > Keyboard and on the "Shortcuts" tab, under "System", change the "Lock screen" keyboard shortcut from CTRL + ALT + L to something else, then under "Custom Shortcuts", click the "+" button to add a new custom shortcut, under "Name" enter "Xscreensaver" and under "Command" enter "/usr/bin/xscreensaver-command -lock", then click "Apply".

And finally, click next to the newly created shortcut and press CTRL + ALT + L to assign it to it (or use any other keyboard shortcut you want, but make sure it's not already assign to something else). Alternatively, you can run the following command instead of assigning a new keyboard shortcut for the old screensaver:

sudo ln -s /usr/bin/xscreensaver-command /usr/bin/gnome-screensaver-command

To revert the changes (go back to the black GNOME Screensaver screen), use the commands below:

sudo apt-get remove xscreensaver xscreensaver-gl-extra xscreensaver-data-extra
sudo rm /usr/bin/gnome-screensaver-command
sudo apt-get install gnome-screensaver

If you've used the alternative method to assign CTRL + ALT + L to Xscreensaver lock screen, open System Settings > Keyboard again, remove the custom Xscreensaver command and assign CTRL + ALT + L back to "Lock screen" (under "System").


Can't open Google Chrome, can't search applications in dash, startup applications stopped running

To solve this problem needs to give sudo permissions to /tmp it is where those/certain programs/apps write their temporary stuff to. For this run in Terminal:

sudo chmod 1777 /tmp


That wording is a bit confusing. What they mean is that you should be in the the root directory of juju's source branch. So:

$ bzr branch lp:juju
$ cd juju/

This is more of an assumption than a prerequisite. It seems to me that the only reason why this is "required" in the example is so that the paths in your commands match the paths in the example commands. Like this one from the "Test run" section:

$ juju deploy --repository=examples local:oneiric/mysql
$ juju deploy --repository=examples local:oneiric/drupal

If you're not in "juju trunk" you could rewrite that as:

$ juju deploy --repository=path/to/repo local:oneiric/mysql
$ juju deploy --repository=path/to/repo local:oneiric/drupal


Corrupted local files
In many cases, when removing/reinstalling does not work, corrupted local files are the cause. Often these local files are in a hidden folder (starting with a dot) in your home directory.
In the case of Bluefish, just remove the folder ~/.bluefish. That should work :)


I downloaded a package and all of its dependencies, how can I easily install them all at once?

I downloaded .deb packages with their dependencies... How could I install it once?

You can use 1 installation instruction with the package names divided by a "space".

Example

 dpkg -i first.deb second.deb third.deb

You can also install all .DEBs in a directory with ...

dpkg -R --install packages/

If packages/ has first.deb second.deb third.deb it will install them all.

This will not "automically searches for its dependencies on my library...". It will install the packages listed; nothing more. It is you who needs to make sure the dependencies are all downloaded too.

There is a tool to help you with dpkg called "gdebi". Installation:

sudo apt-get install gdebi-core

You can install .deb packages like this ...

sudo gdebi /path/to/filename.deb

and it will also try to install dependencies.

And do not forget: when you get a broken package warning due to above: sudo apt-get -f install will fix most of those (if not all)


I have had a lot of issues with the Eclipse that is in the Ubuntu repositories.  I've found it's much better to just dowload it and run it directly.  If you're doing Android, I highly recommend the Android SDK/ADT bundle.  It doesn't get much easier than that.  If you need Eclipse for other projects you can get it at their website.


Package libgeotiff-epsg is not available and has no installation candidate

edit /etc/apt/sources.list add

deb http://us.archive.ubuntu.com/ubuntu trusty main multiverse

Save

sudo apt-get update
sudo apt-get install libgeotiff-epsg


The resolver looks in /etc/resolv.conf for nameservers, not /etc/network/interfaces. Create /etc/resolv.conf containing:

nameserver 206.248.154.170
nameserver 206.248.154.22

Manual pages:

http://manpages.ubuntu.com/manpages/trusty/en/man5/interfaces.5.html
http://manpages.ubuntu.com/manpages/trusty/en/man5/resolv.conf.5.html


Need help with this shell script getting syntax error

There are various issues here. First, you are not actually saving the name as $name. You nead read VARIABLE to save the entered string as $VARIABLE. You also don't need the echo but more on that later.

Now, the syntax error you are getting is presumably this:

  line 6: ((: wget --spider http://example.com | grep *M >= 250M : syntax error in expression (error token is "spider http://example.com | grep *M >= 250M ")

That's because you're using a very wrong syntax. The grep will print the entire line, not only the number on megabytes. Therefore, you are actually attempting to check whether  a line like this:

Length: 272629760 (260M)

is more than 250M and that makes no sense. In addition, the output of wget --spider is printed to standard error, not standard output so you need to redirect it to stdout in order to grep it:

wget --spider $url 2>&1 | grep ...

You also need to filter out everything but the number itself. One way of doing this is with a positive lookahead, and -P for Perl Compatible Regular Expressions (PCRE) and -o to tell grep to only print the matching portion of the line:

grep -oP '\d+(?=M)'

In PCRE, \d means any digit and + means "one or more". The (?=foo) construct, the positive lookahead, will only match if the next characters are foo. So, the regex above will match one or more digits, followed by the letter M.

So, a working (and slightly improved) version of your script would be:

#!/usr/bin/env bash

read -p "Name your file: " name
read -p "Paste the url you wish to check: " url

if (( $(wget --spider $url 2>&1 | grep -oP '\d+(?=M)') > 250 ));
then
    wget -O $name $url
else
    echo "This is not what you are looking for."
fi

Or, for a more compact syntax that does the same thing:

#!/usr/bin/env bash

read -p "Name your file: " name
read -p "Paste the url you wish to check: " url

(( $(wget --spider $url 2>&1 | grep -oP '\d+(?=M)') > 250 )) &&
    wget -O $name $url ||  echo "This is not what you are looking for."


You might want to use OpenCV (Open Source Computer Vision), which is a library of programming functions for real time computer vision.


Second monitor doesn't work with nvidia drivers

I fixed the problem by returning to Ubuntu GNOME 16.04, for some reason it doesn't work on Ubuntu 16.10.

I did a clean install, installed nvidia drivers, and used the same xorg.conf described in the question. The second monitor was recognized on reboot by the System Settings and NVIDIA X Settings.

This also fixed a long-time problem that I had, which was the mouse blinking (even if I disabled the ghost monitor - more info on Mouse cursor flickering and disappearing)


"broken packages" error when installing Shutter from linuxuprising PPA on Ubuntu 20.04

Your output of sudo apt-cache policy shutter shows that there is already a version of shutter installed (/var/lib/dpkg/status is what's actually installed or partially installed), so there is/was probably an update problem due to broken dependencies.

In such cases, I try to remove the problematic package first and then reinstall, first by doing apt-get remove shutter, and then by doing dpkg -P shutter, maybe with --force-depends, followed by apt-get -f install. Watch carefully what the last command does, because it tends to remove other packages which were also part of the problem - and sometimes more.

On my system, just upgraded from 18.04 to 20.04 and no shutter installed anymore, the following three lines were enough for reinstalling shutter (it's possible that something was fixed meanwhile..):

sudo add-apt-repository ppa:linuxuprising/shutter
sudo apt-get update
sudo apt-get install shutter


Can Ubuntu be installed on Intel Atom based laptop or mini PC?

I was able to install Lubuntu 17.10 onto a Lenovo Ideapad 100S, I think mine might be a little later generation (14-1BY) because the bios does allow modification of boot order, and other things I'm used to in a bios.

Regular install of just the standard 17.10 64-bit iso for Lubuntu did not work; booting into the LiveCD was fine, install seemed fine, but then it wouldn't boot on its own. Through searching threads like these, it seems the Ideapad really does need a 32-bit booter.

I was able to get there (pointed to by other posts like this) using isorespin.sh. I respun the lubuntu 17.10 64-bit iso with options --atom -u -s 2GB (-u updates to latest kernel, and -s makes a persistent partition, because I thought, if this fails, at least I'll have a more usable bootable USB). Check also respun ISOs (suitable for Intel Atom and Intel Apollo Lake devices).

Before, with preinstalled Windows 10 and Quickbooks and Chrome and THAT'S IT, the measly 32gb drive was full and screaming about windows updates it couldn't apply because it had no room. It's irresponsible of Lenovo to make a pc with a drive that small and sell it with windows 10 on it. I pity all the less-computer-literate, low-income households that bought one of these because of the price, and found it largely unusable.

Now with Lubuntu installed I've got 22GB drive space available! More than I'll ever need because this box will only ever need to be used for browsing (including document and spreadsheet writing in Google Docs).


public_html permissions for local development

I usually use this guide from linode for creating a local development environment: http://library.linode.com/hosting-website

The only personal addition I make to this is that sometimes, I want to test URL paths and things of that nature so I trick my computer into thinking localhost is www.example.com

sudo nano /etc/hosts

Add: 127.0.0.1 example.com Don't forget to remove it when you go live!

Note: DIRECTLY COPIED

Disable the default Apache virtual host by entering the following command: ::

sudo a2dissite default
Navigate to your home directory by entering the following command: ::

cd ~
Create a folder to hold your website by entering the following command: ::

mkdir public
Create a set of folders inside public to store your website's files, logs, and backups. Enter the following command, replacing example.com with your domain name: ::

mkdir -p public/example.com/{public,log,backup}
Set your home directory to be readable and accessible to all users on the system by entering the following command: ::

sudo chmod a+rx ~
Set the public directory (and all of the files in it) to be readable and accessible to all users on the system by entering the following command: ::

sudo chmod -R a+rx ~/public
Create the virtual host file for your website by entering the following command. Replace example.com with your domain name: ::

sudo nano /etc/apache2/sites-available/example.com
Now it's time to create a configuration for your virtual host. We've created some basic settings to get your started. Copy and paste the settings shown below in to the virtual host file you just created. Replace example_user with your username, and example.com with your domain name.

.. colorize:: apache

# domain: example.com
# public: /home/example_user/public/example.com/

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@example.com
  ServerName  www.example.com
  ServerAlias example.com

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /home/example_user/public/example.com/public

  # Log file locations
  LogLevel warn
  ErrorLog  /home/example_user/public/example.com/log/error.log
  CustomLog /home/example_user/public/example.com/log/access.log combined
</VirtualHost>

Save the changes to the virtual host configuration file by pressing Control + x and then pressing y.
Create a symbolic link to your new public directory by entering the following command. Replace example.com with your domain name: ::

sudo a2ensite example.com

Restart Apache to save the changes. Enter the following command: ::

sudo service apache2 restart

Repeat steps 1-11 for every other website you want to host on your Linode.


Sony Vaio Pro 13 can't boot after install Ubuntu 14.04

The reason why you are getting this is Secure Boot.

You can disable Secure Boot on your system following these instructions.


Autostart C++ compiled application upon boot

I assume you're using the default Ubuntu flavor so you have gnome-terminal as your terminal emulator.
To run an executable that outputs to the terminal at startup, you can create a myapp.desktop file in ~/.config/autostart containing the following lines:
[Desktop Entry]
Type=Application
Exec=gnome-terminal -e /home/<username>/myproject/build/myapp
Hidden=false
NoDisplay=false
X-GNOME-Autostart-Enabled=true
Name=myapp
Comment=My awesome video streaming app.

Don't forget to change <username> with the actual value of your UNIX username, which you can get by running whoami in a terminal window.
The most important lines in this .desktop file are the Exec line (the command line of the program to run) and the X-GNOME-Autostart-Enabled line (whether it runs at startup or not). It launches a terminal window (gnome-terminal -e) and runs your compiled app. You can customize the lines beginning with Name and Comment to your liking.


I cannot compile gtk apps after updating to 18.04

As of gcc-6.2 gcc in Ubuntu is configured with the --enable-default-pie option, (Position Independent Executable),  that's why it's a shared object. (- LSB shared object

The compiler override for this is -fno-pie , the linker override  is -no-pie

Apparently for an a.out file you only need to apply the linker -no-pie  though both options together  also work.

Also a factor may be your file manager, some will allow marking & running the shared object as exectubale. Nautilus doesn't anymore.(nemo does


Minecraft launcher Won't Work On ubuntu 20.04 lts

export MESA_GL_VERSION_OVERRIDE=4.5

...and then run Minecraft. Should solve it.


Can't boot Ubuntu 18.04 on my Asus FX553VD laptop

I had the same problem with all kernels after 4.13. Try to use acpi_osi=! as kernel parameter. That's What I did and worked. I also had the same problem with ASUS laptop FX503VD and tested this on Manjaro and Kubuntu.


How can I tell which drivers are backported to stable kernels?

The problem is that you're looking at the meta package for the modules. If you use apt-cache show linux-backports-modules-wireless-maverick-generic | grep ^Depends you can see what the actual package is that contains the modules. In this case, it's linux-backports-modules-wireless-2.6.35-22-generic

As for a webpage, the easiest is via packages.ubuntu.com, where you can keep clicking down to get the list of files. Without a webpage, if it's already installed, you can use dpkg -L linux-backports-modules-wireless-2.6.35-22-generic


First of all, I'm sorry my bad english.

The problem is that check_hping requires sudo for its use.

To remedy this, I used the following steps:

-You need to remove sudo from a line in the script(look for PRE variable setting).

-Change the command to the following:

define command{
        command_name    check-ping-on-port
        command_line    sudo $USER1$/check_hping $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$
        }

-Add nagios on sudoers file to use this script without password.

Hope this solution works for you too.

Best regards.


I want to block usb access in ubuntu 11.10 , i have tried it by some codes given before but not working

FS permission solution

To block:

sudo chmod 700 /media

To unblock:

sudo chmod 755 /media

BIOS option (If available)

You can also disable USB from system BIOS configuration option. Make sure BIOS is password protected.
Grub option

You can get rid of all USB devices by disabling kernel support for USB via GRUB. Open grub.conf or menu.lst and append "nousb" to the kernel line as follows:

kernel /vmlinuz-2.6.18-128.1.1 ro root=LABEL=/ console=tty0 console=ttyS1,19200n8 nousb

vmlinuz-2.6.18-128.1.1 - is just an example, put your own

Save and close the file. Once done just reboot the system:

sudo reboot


Ubuntu dolphin add a "create archive" option to menu

Go to

~/.kde/share/kde4/services/ServiceMenus

Add a new file:

createArchive.desktop

Paste the following content:

[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
Actions=createAnArchive
MimeType=all/all

[Desktop Action createMyArchive]
Name=Create Archive...
Exec=file-roller --add %U

Restart Dolphin: close all instances (and eventually open again)
You might now check, if you successfully added that entry:

Open dolphin -> Settings -> Configure Dolphin -> Services -> [check, If the list contains

"Create Archive...". Also make sure it's checked]

Now you should be able to see the following entry:

Dolphin -> Context Menu -> Actions -> Create Archive

explanation:

MimeType=all/all

"all/all" makes sure, that the item will appear for any selected file, you use

Actions=createAnArchive

The action specified here must be the same as in

[Desktop Action createMyArchive]

This is the action, that will be called

Exec=file-roller --add %U

File-roller is the archive-program
%U will make invoke ONE instance of file-roller with ALL the selected files as parameters.
If you use %F here, you will invoke ONE instance PER selected item - which is probably not,
what you want.

You might also want to check out the dir

/usr/share/mime/

to see further mimetypes, in order you want to restrict it more


Either Mysql won't start or the client shows error "Found option without preceding group in config file"

In my own case I am using Ubuntu 16.04
Which had !include with external files like so

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
innodb_buffer_pool_size = 20M

I just included [mysqld] before new line I added for my Wordpress new installation

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
innodb_buffer_pool_size = 20M


Specifying directory type when removing characters from directory name

Note: this assumes that your original glob expression *.* is correct, i.e. that you wish to loop over directories whose names contain a period character, like foo.bar
You can make the shell glob *.* match only directories by suffixing it with /:
for file in *.*/ ; do mv "${file}" "${file//UNWANTEDWORD}"; done

Alternatively, add a simple directory test:
for file in *.* ; do [ -d "$file" ] && mv "${file}" "${file//UNWANTEDWORD}"; done


I would guess that only 2.10.9 is available in the Ubuntu repos.  You can check which version is available with the command apt-cache policy pidgin. Here's what I get when I run that command on Ubuntu 15.04:

  dagrha@laptop:~$ apt-cache policy pidgin

  pidgin:   Installed: (none)
  Candidate: 1:2.10.9-0ubuntu8
  Version table:
       1:2.10.9-0ubuntu8 0
          500 http://us.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages

So you can see, 2.10.9 is the latest that is available through the Ubuntu repos.

If you want the newest version you'll probably have to install from source: https://www.pidgin.im/download/source/.  That website will have a readme or set of instructions for how to install from source.


This basically means that the package doesn't exist anymore in the repositories or that one or more of your repository definitions in the /etc/apt/sources.list file or in the folder /etc/apt/sources.list.d/ are incorrect.You can find more troubleshooting information in this very good thread: "Unable to locate package" while trying to install packages with APT


What you have is partition problem.

You should start by checking the partition created by Ubuntu, by going to Ubuntu desktop search and searching disks and click to start disks manager, or from terminal by using:

gnome-disks

After starting the utility, look-up manually the partition SD3 you should be able to find out:

Partition type: HPFS/NTFS or Extended or Linux swap or Unallocated space or Linux (file system).

The files which you were using under windows which you are looking for can be only in NTFS or FAT32 types as this type is windows NT file system.

If SD3 is not partitioned as NTFS probably your files were lost during the new partition.

If you find it with NTFS check the mounting status of SD3, and try to mount it.

If SD3 is not allocated, you can allocate it by clicking the + sign to add new partition, and make sure in the contents option of create new partition to choose don't overwrite existing data, after the partition is created, mount it and try to find your files.


Boot into Windows, open command prompt as administrator and execute:

powercfg /h off

Open Windows Control Panel -> Power Settings and uncheck Fast startup.

In case it is not visible, enable show hidden settings.

Shutdown the machine completely - do NOT reboot.

Now you should be able to boot from Ubuntu DVD.


How do I fix unsatisfied dependency and install Chrome in 13.10?

someone at Google goof up and put 64 bit dependencies in the 32 bit architecture. So basically we have to wait on them to fix it. But you can install chromium in the software center.


ubuntu-touch for OnePlus One lockscreen problems

magic-device-tool dev here.
Please try the devel_rc-proposed channel. The power button but is a known issue on the stable channel and should be fixed by now in devel_rc-proposed.


Unable to boot windows 10 or Ubuntu in dual OS installation

Windows is BIOS/MBR and it looks like you forced an UEFI install of Ubuntu on a MBR(msdos) partitioned drive. Normally UEFI uses gpt partitioning. But  Windows in BIOS boot mode must be MBR and boot flag must then be on the NTFS partition with Windows boot files or your sda1.

You show errors on NTFS sda2, not sure if just Windows 10 hibernation or it needs chkdsk which you can only run from Windows or Windows repair disk or installer with repair console. Use gparted and move boot flag back to sda1, see if Windows boots or if f8 takes you to repair console.

First fix Windows, chkdsk and turn off fast start up, You need to make Windows repair flash drive as you will need both Boot-Repair/Ubuntu live and Windows repair flash drives with BIOS/MBR.

Then use Boot-Repair from Ubuntu live installer booted in BIOS/Legacy/CSM boot mode and in advanced mode do a full reinstall of grub2, so it is the BIOS boot version of grub. You do not need to reinstall Ubuntu, just grub2.

Windows 10 works better dual booting in UEFI mode. Windows will, with updates, turn fast start up back on. Then grub will not boot it and you only can then directly boot using Windows boot loader. With UEFI, you can choose that from UEFI boot menu. But with BIOS, you only have one MBR and then have to temporarily restore Windows boot loader, fix Windows & then restore grub to MBR.

Since you have newer UEFI hardware, the other option to to reinstall Windows in UEFI boot mode. But that will erase system, and you need good backups of all your data & configuration. How you boot install media UEFI or BIOS, is then how it installs for both Windows & Ubuntu.


Permission denied error while copying the files to another user directory using WINSCP?

If you log in to an Ubuntu server as user1, then generally you do not have permission to add anything to user2's home directory.

If you want to be able to, then here is one way you could get permissions. Execute these commands on the server (they will need to be executed by someone with sudo ability).

sudo addgroup sharers
sudo adduser user1 sharers
sudo adduser user2 sharers
sudo chgrp sharers /home/user2
sudo chmod g+w /home/user2

Then user1 will be able to drop files in to the /home/user2 directory.

Finer grain control could be obtained using Access Control Lists (ACL's), but I won't go in to that here.


problem with ubuntu instalation on my Dell Workstation

I had the same issue with a Dell Precision Tower 7810 but I was finally able to install and run Ubuntu 16.04 on the workstation.

Change the following things on BIOS setup:

Disable safe boot.

Change SATA operation to AHCI.

Creating the bootable device (Pendrive):

Download Rufus and Ubuntu 16.04 LTS iso in a Windows machine.

Open "Rufus and select GTP partition scheme for UEFI computer". This will need a functional internet connection as the program will download two files from the internet.

Now boot from the bootable drive and install Ubuntu on the machine.
You can check once after installing the OS if the system is booting or directly run the "Boot Repair" program in live mode after the installation.
After the process is complete reboot the machine, it will detect the Ubuntu installation now.

You can try this process with 14.04 version also.