How can the Ubuntu font be used with LyX or LaTeX?

To use the Ubuntu font (or any other system font), use XeTeX

sudo apt-get install texlive-xetex

Once you have created your document in LyX, add some TeX code at the start of the document (using the TeX button): \fontspec{Ubuntu}. This makes the whole document use the Ubuntu font. If you want to switch to another font at some point use the \fontspec command again with the font name of the other font.

To allow this to render to a DVI/PDF/etc., some settings need to be changed in Document>Settings.

Click on 'LaTeX Preamble' and enter this into the text box:

\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}

Also, under 'Language', set the encoding to Unicode (XeTeX) (utf8).

Now export the document as LaTeX(pdflatex):

This will appear to do nothing but will actually output to DOCUMENT_NAME.tex.

Now open a teminal (Applications->Accessories->Terminal) and enter:

cd ~/Documents
xelatex ubuntu.tex
xdg-open ubuntu.pdf

Replace ~/Documents with the path of the folder containing your document and ubuntu with the name of the document. This should create a PDF file of the output of your document and open it in the default PDF reader:

Doesn't it look pretty? :D

Thanks to Marcel Stimberg for suggesting XeTeX and providing the useful links to resources. I suggest people to have a look at those for more details.


The package name is gobjc – the GNU Objective-C compiler, therefore

sudo apt-get install gobjc

or the GNU Objective-C++ compiler

sudo apt-get install gobjc++


The trick is to check the folder's content at certain intervals, and compare the list of files with the last check. Since only new files need to be converted, files that were already in the list the last time can be skipped.

That is what the script below does. It is in python, but the principle is the same in any language.

What it does:

When the script initiates, it makes a list of files in the directory.
Then, in a loop, every 5 seconds:

it checks for additional files
if additional files were found, they will be converted, files that were already there are skipped.
it sets the last checked file list to be the "new" initial file list.

#!/usr/bin/env python3

import subprocess
import time

directory = "/path/to/your/files"

def current_files():
    read = subprocess.check_output(["ls", directory]).decode("utf-8").strip()
    return [item for item in read.split("\n")]

initial_files = current_files()

while True:
    update = current_files()
    for item in update:
        if (item in initial_files, item.startswith("frm")) == (False, True):
            subprocess.call(["/bin/bash", "-c", "dos2unix", directory+"/"+item])
    initial_files = update
    time.sleep(5)

Copy the script into an empty file, set the path to your folder, save it as convert.py,  and run the script in the background by the command:

python3 /path/to/convert.py


Look at drivers, not applications

You won't find a program doing this, because of these three types of touchpads the drivers tries to abstract to a single representation to applications:

Touchpads reporting absolute positions data is being translated by the Xorg driver to relative movement for the applications. A regular application can't talk to the touchpad directly (by design), so you really have to look for a solution in the driver.
Touchpads capable of both relative and absolute modes needs switching of modes, which is very hardware specific and not application-aware.
Some more basic touchpads don't have the capability of reporting the absolute positions.

Unfortunately, even if you have a touchpad pretty much capable of reporting all absolute values, most touchpad drivers do not let you use them in Linux applications. The absolute data is really there, as the driver can detect whether you are touching it at the edges for scrolling for example. Test this for yourself using evtest in a virtual terminal (to suspend X). My Synaptics touchpad reports the absolute positions as follows:

Event type 3 (EV_ABS)
  Event code 0 (ABS_X)
    Value   3332
    Min     1472
    Max     5648
    Fuzz       8
    Resolution      39
  Event code 1 (ABS_Y)
    Value   2017
    Min     1408
    Max     4806
    Fuzz       8
    Resolution      79

The capability of actually putting a Synaptics device in absolute mode in Xorg has been removed recently by this commit in the xf86-input-synaptics driver:

Remove absolute mode

Moving a touchpad in absolute mode is unusual - touchpads are disconnected
from the output device, so direct interaction is hard. There appears to be
little usage of it (I haven't seen bug reports from people claiming to use
it). Joe Shaw, author of the code and only known user doesn't have a use for
it anymore, so purge it from the repo.

System wide basic driver: evdev

The only way I see this to be possible at this moment in Linux is using the evdev driver in Xorg. It was discussed back in 2010 on the Xorg mailing list (an excerpt below):

    I have to get the absolute
    position of a finger on the touchpad rather than just relative
    movement.

  the synaptics driver doesn't do this, but the evdev driver does. So
  you need to configure your X server to use the evdev driver for the
  touchpad instead. The following configuration snippet will do that for
  you provided you're running server 1.8 or later.

Section "InputClass"
    Identifier "evdev touchpad"
    MatchIsTouchpad "on"
    Driver "evdev"
    Option "Mode" "absolute"
EndSection

  Save this as /etc/X11/xorg.conf.d/99-evdev-touchpad.conf and restart
  the server. Note that this only changes the behaviour of the touchpad
  itself, not the data in the events but then again that data is always
  absolute anyway. Also, by using evdev instead of synaptics you're
  losing the ability for two-finger scrolling, tapping, etc.

Bottom line: create a feature request

I see room for a feature request on the upstream bugtracker for the synaptics driver (and possibly others). It would be very much useful to have an interface in Xorg to be able to read the absolute position values of the touchpad. The main blockers I see is that this might be very much hardware specific and therefore hard to implement.

I think talking to Joe Shaw and Peter Hutterer could also be of great value to see what the history in this is exactly, how to make it a great feature request and what to expect from it.


UE Boom 2 sound quality with laptop is awful

I had the same problem when first connecting mine to my laptop.
I had to change one thing in Sound settings (Volume control) then Configuration (not sure it's the good translation, my xubuntu is not in english).
There for UE Boom, I changed "Headphones" to "High Quality ... A2DP".

Hope it works for you.


How to Remove elementary desktop environment?

There's a way to remove all packages installed through a ppa and restore the original ones.

sudo apt-get install ppa-purge
sudo ppa-purge ppa:elementary-os/daily

If daily was installed

or

sudo ppa-purge ppa:/elementary-os/stable

If elementary os stable was installed.

That's it.


Fonts showing as squares in Libre office

You might need to install the specific font of specific language  i.e: You will have to download Arabic version of the font. I have the link here


How can I switch from Trinity Desktop to KDE Plasma and viceversa?

I found out now. I just want to share some thoughts on Kubuntu. I've been using Ubuntu since around 2008, if I remember correctly, I started with a really brutish GNOME on Ubuntu 8.04, but it wasn't until I tried KDE that I learnt to love Linux. And now, how far we've come. The internet with its modern logo designs, and here I am back at the software I used to enjoy, Amarok 1.4, KDE 3.5. It's almost like going back to the past, but thanks to Trinity they're working once again, and the HD wallpapers, well, I used to have a huge outstanding collection of HD wallpapers most of which I had to delete with my system, never knowing how good they were, and now I'm back at finding good pics to fill my desktop. Some are even mine, not that good, but at least they're mine. And I remember that website "The Linux Game Tome", at happypenguin.org, designed solely to count all working games on Linux. Most were bad, and overall, the games were few. Now there's all the power of Steam and Linux, and though it's still a bit hard to configure for newbs like I was before, the results can be amazing. You get a fully functional system with all the benefits of security and freedom. Huge, huge respect for all those Linux developers, designers, sysadmins, users, and so on, out there, you're doing the best of jobs.

Now
https://live.staticflickr.com/65535/47682815201_fd91881d64_o.png

and then
https://live.staticflickr.com/65535/33805397798_025807f51b_b.jpg


Where to install Ubuntu bootloader on a Mac?

Fist make sure your in BIOS mode. There is no good way to tell this, but if your in the Ubuntu Live CD Your probably in BIOS emulation mode. Specially if your using ReFiT.

Next install on /dev/sda. This will not hurt your mac booting because it boots via EFI (which is a file in one of those partitions).

Then Refit should sow you a Linux partition, and you can use that to boot. The mac boot loader doesn't understand Linux and will always call it "Windows". In addition it may not start in BIOS mode (which will make a lot of things not work). Your best is to use ReFit and install on /dev/sda

One other thing. Make sure your two partition tables are in sync. This can be done from refit.


after upgrading 14.04 my display is locked at one resolution and I cannot change it from the GUI

The easiest thing to do is add that resolution using xrandr - this is a good guide. You would then need to add the xrandr configurations to a startup file, so that you'll get your desired resolution upon reboot/startup:

Create a bash script, xrandr.sh for example, and place your xrandr commands into it: #!/bin/bash
sudo xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
sudo xrandr --addmode Virtual1 1920x1080_60.00
xrandr --output Virtual1 --mode 1920x1080_60.00
Make the script executable with chmod +x xrandr.sh
Search for "Startup Applications" in the dash, run it, and add the script as a startup application.

The commands will now run every time you log into your account.

OR you can go the easy way and use a program that does the above for you -  ResolutionX.


The correct package name is python-pyqt5.

So run

sudo apt install python-pyqt5


How to display a program output through a "dialog" window

The --progressbox option is what you are seeking. See this example:
{ while true ; do date ; sleep 2 ; done ; } | dialog --progressbox 30 100

It will display the data as it is printed to stdout. In your case, you can pipe your application's output to the dialog command like this:
appname 2>&1 | dialog --progressbox 30 100

If you want to display an OK button, when the output from appname finishes, you can use the --programbox option instead.
See man page for details.


How do I correctly display the content of an environment variable (here: current user's home directory)?

TL;DR Variables in Linux start with the $.

The command is

echo $HOME

If you type in

printenv

it will show you all the variables and what they equal.

Or

printenv | grep '^HOME='

or a few more you can try:

terrance@terrance-ubuntu:~$ echo ~
/home/terrance
terrance@terrance-ubuntu:~$ printf "%b \n" ~
/home/terrance
terrance@terrance-ubuntu:~$ printf "%b \n" $HOME
/home/terrance


Keyboard backlight not working on an Asus N56V

For N56V and N76V, you need :

a 3.5 kernel (from quantal)
to get the subwoofer

I add on /etc/modprobe.d/alsa-base.conf this line: options snd-hda-intel model=asus-mode4
reboot and select 2.1 output in audio pref

to get the fn keys + keyboard backlight

install asus-wmi-dkms_0.2_all.deb.gz package (from http://ubuntuforums.org/showpost.php?p=12057336&postcount=49)
reboot

to get the GeForce (when you want)

install bumblebee and driver from x-swat repository

to get the Ethernet

build/install alx module (http://www.linuxfoundation.org/collaborate/workgroups/networking/alx)


You can pipe the output of seq.

progname `seq 5 | sed -e 's/^/a/' -e 's/$/z/'`

You can use history substitution to add a prefix to all the elements of an array:

set a = (`seq 5`)
progname ${a:s//a/}

I don't know how to add a suffix, but I'm not a tcsh expert.

Tcsh is kind of dead this century, and even before was widely recognized as less suitable for scripting than Bourne-style shells. How about using zsh?

a=($(seq 5))
progname a${^a}z


How to copy files from a directory to desktop by directly dragging it in Ubuntu 20.04.1

As answered here

No, you do not miss anything.
In Ubuntu 19.10, icons on the desktop are not anymore provided by the
file manager Files (a.k.a. nautilus), but by a separate Gnome Shell
extension, "Desktop Icons". Sushi works with Files, but not with the
extension.
To preview files that live on the desktop, you can go to the Desktop
folder in Files.

And this trend follows to 20.04 also. Hence the answer is NO. Hence the conclusion is that desktop is not a part of nautilus, hence the answer is NO.
Also read the comments of this answer.
You could use mv or cp commands in the terminal.


How do I change Naulilus to preserve the original date (created)

It's easy: there is no such thing on a UNIX filesystem. See countless sources, for example "Timestamp, modification time, and created time of a file" on Unix & Linux SE. The point is that UNIX-like file systems do not store a file creation date. You have an access date (which on modern Linux filesystems shows by default the last time the file was accessed with a precision of 24 hours), a modification date (the last time data was changed) and a change date (the last time metadata such as permissions was changed).

As far as I know Nautilus cannot show anything else but the data modification date.


'/snap/bin' is not included in Ubuntu 18.0.4

May be you can try this to install snap on ubuntu 18

  https://codeburst.io/how-to-install-and-use-snap-on-ubuntu-18-04-9fcb6e3b34f9


When you install a package, it may also need to install dependencies for it to work - for instance installing torcs (e.g. with sudo apt-get install torcs), it needs torcs-data etc to work - they are also installed, and are fairly large in size (so also take time to download etc).

When removing torcs (e.g. with sudo apt-get remove torcs), it will likely leave the torcs-data packages and other no longer needed packages behind, taking up space. You can solve this by running sudo apt-get autoremove <package>, or sudo apt-get autoremove after removing it with purge/remove.

You can also you the --purge option with autoremove to remove left over configuration files.

An extra way of clearing space is to use sudo apt-get clean, to clear out the repo information and cached packages which also take up space. You will likely need to run sudo apt-get update afterwards.

Here are the relevant entries from the manual page:

   purge
       purge is identical to remove except that packages are removed and
       purged (any configuration files are deleted too).

   clean
       clean clears out the local repository of retrieved package files.
       It removes everything but the lock file from
       /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. When
       APT is used as a dselect(8) method, clean is run automatically.
       Those who do not use dselect will likely want to run apt-get clean
       from time to time to free up disk space.

   autoremove
       autoremove is used to remove packages that were automatically
       installed to satisfy dependencies for some package and that are no
       more needed.


How to get the "new launcher"-wizard back into my context-menu?

There is a nautilus script for that. Here are the commands:

wget  http://dl.dropbox.com/u/47950494/Create-Launcher
cp Create-Launcher ~/.gnome2/nautilus-scripts
chmod +x ~/.gnome2/nautilus-scripts/Create-Launcher
mv ~/.gnome2/nautilus-scripts/Create-Launcher 'home/[your user name here]/.gnome2/nautilus-scripts/Create Launcher'

The fourth command is just to rename the file, you can do that in Nautilus as well. Enjoy!

Source: here


As noted in the comment by steeldriver above, the answer is as such:

vnstat -i venet0 -tr | awk '$1 == "rx" {print $2,$3}'


From the launchpad page of biblatex in 14.04 You can see that

 1.7-1
DELETED: Trusty pocket Release in component universe and section tex

    Removal requested on 2013-10-24.
    Deleted on 2013-10-24 by Colin Watson

    (From Debian) ROM; included in TeX Live, no need for separate packaging;

It has been removed as a seperate package and has been included in texlive, specifically the texlive-bibtex-extra package. So just install that package as follows:

 sudo apt-get install texlive-bibtex-extra

You may also want biber, in which case instead run:

 sudo apt-get install texlive-bibtex-extra biber


Cant use wired or wireless after ubuntu 13.10 installation

I'm also new to Ubuntu and had the same problem. Here's a way
restart your computer
when the choosing operating system screen appears, click on "Advanced Ubuntu users"..
 there will be a option of "recovery mode".. choose it
 then a screen will appear with couple of options, choose "repair dpkg files" and run it..
then go on "resume normal boot"..
and check if its done..


Ubuntu 13.10 apache keeps giving this error while accessing website

I don't know what the following command did, but it solved the problem  for me:

sudo chmod -R 755 /var/www


Error message when excuting sudo apt-get update

There will be a file /etc/apt/sources.d/ with an entry for that PPA. That said, that PPA does not support Natty, and you really shouldn't be on Natty. Natty, or Ubuntu 11.04, reached End-of-Life in October 2012. Do upgrade to Ubuntu 12.04 or Ubuntu 14.04.


How to determine the host Multi-Arch default folder

I will post the scripts for the methods I found. But if there is another default way, please post it.

Using the ldconfig:

ldconfig -v 2>>/dev/null | grep /usr/lib* | head --lines=1 | sed -e 's/://'

I guess that it can return another folder if someone config another search order, eg. adding another folder before the default host multiarch folder.

Using the /etc/ld.so.conf.d folder:

lines=$(cat /etc/ld.so.conf.d/* 2>>/dev/null)
for line in $lines ; do
    case "$line" in
    *Multiarch*)
        found_multiarch=1
        ;;
    /usr/lib/*)
        if [ "$found_multiarch" = 1 ] ; then
            folder=$line
            break
        fi
        ;;
    esac
done
echo $folder

It will return the first folder under /usr/lib that comes after the line with *Multiarch*.

Both scripts tested on armv7 and x86_64 (default installations, no foreign architectures) and returning the expected results.

Not tested in boxes with foreign architecture installed.


Ubuntu with high resolution computer have very small title or header bar

If you go to System Settings, and select the Displays settings, you'll see there's a place to set the menu and title bar size...

You might also try Unity Tweak Tool and Tweak Tool. Here's a screenshot of Tweak Tool, and a HiDPI setting that might help...


My 256gb "Silicon Power" USB drive is fine when copying files normaly to and from it, but when I try and boot from it it becomes impossible to use

Not surprising that an overseas, relatively unheard of, cheap USB performs quite badly with a full-fledged OS.

According to reviews R/W speeds are around ~40 MB/s- pretty slow, indeed.

USBs are not meant to run complete OSes! Most have far lower tolerances than standard HDDs and SSDs.

However, in your case, it sounds like your USB is defective as you tested it on several OSes with the same level of success (very slow).


How do I tell if Ubuntu supports hardware-accelerated graphics on my laptop?

Gnome-Shell has very similar graphical requirements as the Unity interface.  Therefore, if you want a quick test of potential compatibility, you could run the unity graphical test application via a live CD:

/usr/lib/nux/unity_support_test -p

If you get a picture similar to this with all "yes" values - you probably can assume Gnome-Shell will work.

Linked Question:

What do the "no"s mean, in the output of unity support test?


how to to use lapack library, on Ubuntu 14.04

For using lapack++ in Ubuntu (I tested it in my Ubuntu 15.04):

sudo apt-get install build-essential liblapack-dev libblas-dev checkinstall

Download lapackpp-2.5.4.tar.gz from http://sourceforge.net/projects/lapackpp/files/ to user home.

Unpack it and afterward, in a bash console, move to the folder lapackpp-X.X.X and run:

./configure
make
sudo checkinstall
sudo cp /usr/local/lib/liblapackpp.so* /usr/lib/

To test lapack++ library save next code as autov.c++ in your user home:

#include <iostream>
#include <stdio.h>
#include <lapackpp/laslv.h>

using namespace std;

int main(){

double a[]={ 1.0, 2.0, 3.0,
             2.0, 1.0, 4.0,
             3.0, 4.0, 1.0};

    LaVectorDouble v(3);

    LaVectorDouble c(3);

    LaGenMatDouble A(a,3,3);

    LaEigSolve(A,c,v,A);

    cout<<"\neigenvectors are:"<< endl;

    cout << A;

    cout << "\neigenvalues are:"<< endl;

    cout << c;

    return 0;

}

Compile and run with:

g++ autov.c++ -o autov -llapackpp
./autov

The result is:

eigenvectors are:
0.505785  0.824038  -0.255232
0.584374  -0.544925  -0.601302
0.634577  -0.154979  0.757161

eigenvalues are:
7.07467
-0.886791
-3.18788


In Ubuntu 18.04 mounted drives no longer show up in Nautilus by default. They need to defined as "bookmarks".

You need to bookmark them and will likely want to rename the bookmark. This GIF illustrates the technique:

Pick a partition from your "Other Locations" list.
Click the upper right "hamburger"  (☰) menu.
From the dropdown menu click the center menu button to bookmark it.
Move to the new sidebar entry and rename it from the mount name ("c" in my example) to something more meaningful ("Windows 10 SSD" in my example).


Lost display after nvidia driver update on optimus laptop (everyting else works)

That's the black screen issue with nvidia-prime, xorg, wayland and the heavy work on these topics during the last year(s).
The most recent cause of that problem is explained herein:

Black screen when in nvidia mode after updating to kernel 3.13.0-45 See the answer from Charl Botha, Feb 2 at 22:15
This one is an extremely annoying bug.

As a rule of thumb: You always should switch to a virtual console Ctrl + Alt + F1 and back to your X-console Ctrl + Alt + F7 (or F8). This will work in many cases. Ater the solution from above I had to do so (once again).

This error has many reasons but most of them are due to corrupt xorg.conf file or bad dkms modules/drivers. Another good point to start with is Ctrl + Alt + F1; sudo service lightdm stop; sudo prime-switch intel; sudo service lightdm start; Ctrl + Alt + F7 and once on desktop window start the gksudo/kdesudo nvidia-settings and save it without clicking anywhere, just quit with saving, reboot an hope.

There are many older (before 2015) solutions to similar problems. All together they relay on the black screen when using nvidia after the boot splashscreen immediately on login screen or after login.


Windows won't load and neither will Ubuntu after removing Ubuntu partitions

OK, so what you did is screwed up the bootloader.  You need a standalone bootloader CD, which you can get an image of here: http://www.supergrubdisk.org


Making partition with unallocated disk space

You can check that free space using the command vgs. It should show you that approximately those 160G are free within a volume group.

I guess what you really want here instead of a new partition is a new logical volume, since all the free space you are talking about is managed by the Logical Volume Manager (lvm) in your case. You can create one using a command like this:

lvcreate -L 20G -n myvolume ikoda-yellow-vg

This will create a new logical volume named myvolume in the ikoda-yellow-vg volume group, with a size of 20GB.

After lvcreate you will be able to use the new volume (for e. g. formatting with a file system) under the name /dev/ikoda-yellow-vg/myvolume.


In Xubuntu you can go to settings manager -> Session and Startup, there is a checkbox you can click to save session on logout if you log off and shutdown, it will still have the session saved when you turn it back on. (Answer assumes ubuntu desktop use)

Many computers do not support Linux hibernation and so it is not enabled by default in Ubuntu 12.04 and 12.10.


Powerline not display properly on alacritty

Install this font:
JetBrainsMono
Grab this file alacritty.yml from github repo.
mkdir -p ~/.config/alacritty
curl -L https://github.com/alacritty/alacritty/blob/master/alacritty.yml -o ~/.config/alacritty/alacritty.yml

Then update the alacritty.yml file with the example below
vi ~/.config/alacritty/alacritty.yml

# Font configuration (changes require restart)
font:
  # Normal (roman) font face
  normal:
    # Font family
    #
    # Default:
    #   - (macOS) Menlo
    #   - (Linux) monospace
    #   - (Windows) Consolas
    family: "JetBrains Mono"

    # The `style` can be specified to pick a specific face.
    style: Regular


How can I integrate DeadBeef into the sound indicator menu?

how to

First install deadbeef - you should check the authors launchpad website for precompiled versions of deadbeef.  At the time of writing this, no 12.10 or later version was available:

sudo add-apt-repository ppa:alexey-smirnov/deadbeef
sudo apt-get update

sudo apt-get install deadbeef

add deadbeef to sound indicator

Using dconf-editor you can add deadbeef to the sound indicator:

add volume control options

To add the volume controls you need to compile from the MPRIS plugin from source.

important note - this was highly unstable for me on 64bit ubuntu causing deadbeef to continually crash and I dont recommend you do so.

sudo apt-get install deadbeef-plugins-dev git

Next download the mpris plugin source from github

git clone https://github.com/kernelhcy/DeaDBeeF-MPRIS-plugin.git
cd DeaDBeeF-MPRIS-plugin
./autogen.sh
./configure
make
sudo make install

If you want to remove Rhythmbox from the sound indicator then the linked Q&A will help

Linked Questions:

How do I change the Sound Menu's default music player?
How do I remove players I don't use from the sound indicator?


How can I find a specific custom key binding via its name?

Small script to find the keybinding by name

The script below will output the keybinding when you run it with the shortcut's name as argument. an example:

$ python3 '/home/jacob/Bureaublad/find_keybinding.py' rename
> '<Primary><Alt>r'

How to set up

Copy the script below into an empty file, save it as find_keybinding.py
Run it by the command:

python3 '/path/to/find_keybinding.py' <shortcut_name>

Explanation

The information is in the output of

dconf dump /

On the custom keyboard shortcuts, this will output sections like:

[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9]
binding='<Primary><Alt>r'
command='/home/jacob/.local/share/nautilus/scripts/change_name'
name='rename'

As you can see, we need the line, two lines above

name='rename'

...and so the script outputs that line, stripped from binding=

The script

#!/usr/bin/env python3
import subprocess; import sys
key = "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/"
# read the output from dconf dump /, split into lines
ls = [l for l in subprocess.check_output(["dconf", "dump", key]).decode("utf-8").splitlines()]
# find line corresponding to searched name, print two lines higher
print(ls[ls.index([l for l in ls if "name='"+sys.argv[1] in l][0])-2].replace("binding=", ""))

Additionally

...you could create the directory ~/bin (if it doesn't exist yet) and save the script there without extension, and make it executable. Log out and back in, then simply:

find_keybinding <name>

will do


Install package into virtualenv using apt-get

Another alternative is to download the file with apt-get download, extract it with dpkg -x and to move the extracted files to your virtualenv:

Example:

apt-get download python-xyz

assume this results in:

./python-xyz_1.2.3-3ubuntu5_amd64.deb

Then, use dpkg to extract the data portion of the .deb file:

dpkg -x python-xyz_1.2.3-3ubuntu5_amd64.deb ./xyz-tmp

In the newly created ./xyz-tmp directory, you now have all files that would have been installed to / (root) had you used apt-get install.

Assume they are:

./xyz-tmp/usr/lib/python2.7/dist-packages/xyz/
./xyz-tmp/usr/lib/python2.7/dist-packages/xyz-1.2.3.egg-info

You still need to map the subdirectories (e.g. dist-packages vs. site-packages), and can then move the files into your virtualenv (assuming a virtualenv /home/user/.virtualenvs/py27):

mv ./xyz-tmp/usr/lib/python2.7/dist-packages/* /home/user/.virtualenvs/py27/lib/python2.7/site-packages/

Compared to my previous answer, this approach has the advantage that you don't have to research which files got installed, because you can see them in the extraction directory. It still requires a mapping of directories between the extracted archive and the virtualenv.


Canon PIXMA MX870 can't use papers from the cassette tray

Read this thread. I found it useful.

ubuntuforums.org/showthread.php?t=1475336


Does your computer have speaker/headphone connected? If not try connecting headphone or speaker and try. I had the exact same issue, when speaker/headphone is not connected, so it could be an issue related to audio not being available.

Note: My ubuntu is running in virtualbox VM.


Firefox: dconf-Warning When opening Firefox from the Command Line

I am receiving a similar error yet I have figured out for me its tied to one of my firefox addons attempting to connect yet being blocked due to multi factor authentication. I would recommend starting firefox in safe mode (firefox -safe-mode askubuntu.com) and see if there is a issue with any extension or addon.


Is there a way to enable debug inspector on Ubuntu 16.04 (Unity)

1) You need to install libgtk-3-dev package:
sudo apt-get install libgtk-3-dev

2) Then you can enable inspector with:
gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true


Problem installing elementary desktop on Ubuntu

You have to install all the dipendecies before install a package. You can try to install elementary with apt-get install -f.
The option -f resolve dependencies and fix broken packages.


Horrible graphics on my Dell Inspiron 17 with Ubuntu 13.10

Well, my identical machine does the same (inspiron 17 3737 - processor i3-4010U with hd4400). The RGB signal is all messed up.

Weirdly enough , when I connect a display on the HDMI port, that one works fine.

If you only need 1 display, and not much graphics : boot with NOMODESET (procedure to do this can be found here ).

Otherwise : Ubuntu 12.04, 13.04, 13.10, daily 14 do not solve the problem, with or without update, with or without the 1.0.3 or 1.0.4 Intel drivers from Intel 01.org


Problems with LibreOffice 3.6.0.4 rendering MS Office 2007 documents

Are the fonts in your source document compatible?

One of the first things I would try is to understand if you are using compatible fonts in your source document as Ubuntu (libre office) may be substituting these and causing the effect you are experiencing.  MS Core fonts are not installed as standard in ubuntu and you have to do this manually

Go to the terminal (Ctrl-Al-T)and type in

sudo apt-get install msttcorefonts

This will give you the core fonts, but if there are other TrueType fonts that you want installed, it is as easy as copying the font files to the ~/.fonts/ directory.


Using dd to clone a server with multiple partitions

The digit at the ends  is about the partition.
Without the digit you are talking about a disk so with the partition layout.

So drop the digits ...
dd if=/dev/sda of=/dev/sdb

will clone your 1st disk to your 2nd disk. If you want to see progress:
sudo apt install pv
dd if=/dev/sda | pv | dd of=/dev/sdb

Be very very careful about what you put at the "of"/output file: it WILL destroy the destination. Contents of sdb are gone. Unless you have a backup.


Remote desktop access to Ubuntu MATE 15.10

Access throught ssh
If you want a terminal access to your laptop, you can use SSH. For that, you need to install ssh server on your laptop and have an ssh client on your Windows machine.

On you laptop, install ssh server (and client)

sudo apt-get install ssh

On your windows machine, you can use a tool like putty.

If you need an access to transfert file, you can use WinSCP. Using the same tool on server side.

Access throught VNC
If you prefer have a remote access to your desktop (more visual), you can use VNC.
In this case, install vino. It is a VNC server.

sudo apt-get install vino

And use a VNC Desktop Remote Viewer like vinagre, or RealVNC on Windows.


I'm trying to install wine but an error shows up

Wine's repository for Disco isn't ready yet thus the error was thrown. To remove that repository, run:

sudo apt-add-repository --remove 'deb https://dl.winehq.org/wine-builds/ubuntu/ disco main'

Also, from your question and sources.list, it seems that you are using bionic but somehow repository of Wine's Cosmic was added which will create dependency issues. Remove that also,

sudo apt-add-repository --remove 'deb https://dl.winehq.org/wine-builds/ubuntu/ cosmic main'

Wine is present in Official repositories of Ubuntu too. To install that, run:

sudo apt update; sudo apt install wine-stable

Wine doesn't have any kind of front-end. It's just a background kinda app. Thus, it isn't listed in applications. But it is still there. You can check it by running any .exe Windows compatible program.

There are some front-end available in Software center of which I use PlayOnLinux. To install PlayOnLinux, run

sudo apt-get install playonlinux


Permission denied when trying to run a script that uses 'sshpass'

It looks the message Permission denied, please try again. is generated by the SSH client. The password should be quoted to escape the special meaning of characters as $, !, etc. (ref):

sshpass -p 'footbar' ...

Or you can use a file where the password to be stored (source):

sshpass -f "/path/to/passwordfile" ...

However, I remember, this is a script from my previous answer where I mentioned that: "Note here is assumed there is ~/.ssh/config file and additional parameters as -p 2222 are not needed (reference)." What I meant was:

The better solution is to (1) setup Key based SSH authentication, (2) create ~/.ssh/config file and (3) modify the script to work with this setup.

1. Setup Key based SSH authentication (source).

Generating RSA Keys and don't enter passphrase:

mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa -b 4096
chmod 600 ~/.ssh/id_rsa

Transfer Client Key to each Host (please note the quote marks):

ssh-copy-id "<username>@<host> -p <port_nr>"

Now you should be able to connect to the server(s) without password:

ssh <username>@<host> -p <port_nr>

Once this works, you could disable the password authentication (that is less secure method) by editing the file /etc/ssh/sshd_config of each host machine in this way:

#PasswordAuthentication yes
PasswordAuthentication no

2. Create ~/.ssh/config file. (Read also: How do I add multiple machines with the same configuration to ~/.ssh/config?)

The content of the file ~/.ssh/config could look as this (host-i is object of your choice):

Host host-1
    HostName <domain-or-IP-address>
    IdentityFile ~/.ssh/id_rsa
    User <username>
    Port 2222
    # other parameters...

Host host-2
    HostName <domain-or-IP-address>
    IdentityFile ~/.ssh/id_rsa
    User <username>
    Port 2222
    # other parameters...

Host host-3...

Change the file permissions:

chmod 600 ~/.ssh/config

Now you should be able to connect to each of these hosts by a command as:

ssh host-1

3.A. You can keep using the above scrip with a little modification:

#!/bin/bash

[[ -z "${1}" ]] && OUT_FILE="WhereTheAnswearIsGoing.txt" || OUT_FILE="$1"
[[ -z "${2}" ]] && IN_FILE="Hosts.txt" || IN_FILE="$2"

while IFS= read -r host; do
        indication="$(ssh -n "$host" 'who -b' | awk '{print $(NF-1)" "$NF}')"
        printf '%-14s %s\n' "$indication" "$host" >> "$OUT_FILE"
done < "$IN_FILE"

In this case the Hosts.txt file should be:

host-1
host-2
host-3

3.B. Or you can modify the script in more general way:

#!/bin/bash

# Collect the user's input, and if it`s empty set the default values
[[ -z "${1}" ]] && OUT_FILE="WhereTheAnswearIsGoing.txt" || OUT_FILE="$1"
# Provide the list of the hosts as an array
HOSTS=("host-1" "host-2" "host-3")

for host in "${HOSTS[@]}"; do
    indication="$(ssh -n "$host" 'who -b' | awk '{print $(NF-1)" "$NF}')"
    printf '%-14s %s\n' "$host" "$indication" >> "$OUT_FILE"
done


"Try Ubuntu without installing" results in graphical artifacts on MacBook

There is two solutions, that i've already tested on my MacBook Pro 5.3:

When you see "Try Ubuntu without installing", select it and type e for editing and add as kernel option nomodeset. You must insert it on the most long line who contains "splash silent", before the "--". After that press F10 key.
Alternatively you can download and use the special iso for Mac here. Then choose "64-bit Mac (AMD64) desktop CD." Everything works well without touching anything.


When i go to network and click on windows network Unable to access location Failed to retrieve share list from server: No such file or directory

Network -> Windows network is for when you have more than 1 computer and 1 of them is a Windows system. You can connect those 2 systems and copy things over using that connection. An example where you have a network would be: Desktop with Ubuntu <-> router <-> notebook with Windows.

This has -no- relation with a dual boot system since a dual system only supports 1 OS at a time.

What you need to do is mount your Windows disc. Example:


Ubuntu netboot installer point to point (peer) Network

This problem solved by doing :

1- first config network manually and set random ip address like 1.3.4.5 this can be any value and next set random netmask like 255.255.255.0 and leave Gateway blank

2- set nameservers like 1.1.1.1 or 8.8.8.8

3 continue to choose mirror archive and select country... then you get bad archive mirror error

4- go back to installer main menu and execute a shell

5- run this following command :

# ip addr add <ip-address>/32 peer <peer-address> dev <interface-name>
# ip route add defualt via <peer-address>

6- execute debian-installer by running this command : debian-installer

7- in menu select choose a mirror of ubuntu archive and you are good to go ...

note : you should run the installer in expert mode


Having troube to mount my FILES partition

Firstly - BACKUP your USB drive.

Any command (like I am about to share) - possibly will corrupt/loose your data. So PLEASE bask the device up.

Assuming that you have BACKED it up

ntfsfix /dev/hda5

This is assuming that you have installed ntfs-3g so you refer to that device.

I can see you tried the command I mentioned - but the Error messages do not help....

To show which drive is mounted do a

sudo fdisk -l

And assuming that your USB Drive is there... change the ntfsfix


How to share one pgp-key on multiple machines?

In a terminal, run the following:

gpg --export-secret-key -a > secretkey.asc

And on the other system, import the secret key with:

gpg --import secretkey.asc

Alternatively, if you've got ssh access to the other system you should be able to combine these two actions into a single command:

gpg --export-secret-key -a | ssh othermachine gpg --import -

Once the keyfiles have served their purpose, securely delete them:

shred secretkey.asc && rm secretkey.asc

or

shred --remove secretkey.asc

Make sure to shred and remove the key instead of using normal deletion.  Additionally, instead of moving the keyfile with mv, copy it, then shred and remove the original. These methods will prevent an attacker from recovering the key through low-level bit inspection.


You are definitely not on the right website there (finaljuyu.com? doensn't sound at all like the website you were trying to reach).

Try to go to kickass.to, search for a torrent (possibily not copyrighted material), press  "Download Torrent" and it will download the right .torrent file.


I solved the issue by setting proper option for an "Executable Text Files".  The location is bit tricky:

Applications > Accessories > Files > Location options > Preferences > Behavior tab > "Executable Text Files" -> choose "Ask each time".

Click Run when you need launch application.


Adobe flash player not working with Amazon Prime

I had this same problem on Ubuntu 12.04 using Chromium.  I fixed it my following the instructions on the adobe help page for installing Hardware Abstraction Layer module:

Prerequisites for protected content playback

For Ubuntu 10.04 or later, ensure that the Hardware Abstraction Layer module is first installed using apt-get.
(Watch carefully for “hal” install errors, as a damaged package install can continue to affect video playback.)

sudo apt-get install hal

After the "libhal" (HAL) library install completes, close the browser and clear the Adobe Access directories by executing the following shell commands:

cd ~/.adobe/Flash_Player
rm -rf NativeCache AssetCache APSPrivateData2

Note:
If the Hardware Abstraction Layer module is missing, Flash Player still functions. However, it cannot play protected content that requires the Adobe Flash Access DRM (Digital Rights Management) module.


Brightness setting not working on Xubuntu 15.04 ( vivid vervet)

I had the same problem in Ubuntu 15.04. This is how I solved it.
First use ls /sys/class/backlight/ to see which video card is installed. In my case the above command showed intel_backlight. After this I did:

sudo touch /usr/share/X11/xorg.conf.d/20-intel.conf # create 20-intel.conf file`

sudo gedit /usr/share/X11/xorg.conf.d/20-intel.conf #open the file

and add the following lines to this file

Section "Device"
            Identifier  "card0"
            Driver      "intel"
            Option      "Backlight"  "intel_backlight"
            BusID       "PCI:0:2:0"
    EndSection

save and exit. Log out and log-in back.

Try the following if the above did not work:

sudo nano /etc/default/grub

Make the line that say GRUB_CMDLINE_LINUX="" to look like the following:

GRUB_CMDLINE_LINUX="acpi_backlight=vendor"

Update grub by: sudo update-grub and reboot.

As a final option try this: xrandr --output LVDS1 --brightness 0.8. Play with numbers other than 0.8 and see what happens.


Using internal speakers for skype calls with headset plugged in

I think you need to choose either one of them , since I assume you only have one 'Jack' port so either it can be headphones or speakers!


From man mount(8)

  Mount options for ramfs

  Ramfs is a memory based filesystem. Mount it and you have it. Unmount it and it is gone. Present since Linux 2.3.99pre4. There are no mount options.

ramfs doesn't support any mount options including umask, uid, gid. Use tmpfs instead.


Where can I find the source code of Ubuntu?

Linux Kernel Source Code:
apt-get source linux-source-3.2.0

Where can I find the source code for the Ubuntu Kernel?

Ubuntu Source Code:
Ubuntu archive

Specific Software Source Code:
sudo apt-get build-dep $package

where package is the program/package's source code you want to adopt.
Then type:
apt-get source $package

to get the source for that package.
For instance:
sudo apt-get build-dep abiword
apt-get source abiword


why doesn't the standardized way to change default terminal work?

Since Ubuntu 12.04 there is a new tool to change default applications. According to this answer, we need to use gsettings now. I can confirm that it works on Ubuntu 13.10.

For example, if you want to use Sakura as default terminal:

gsettings set org.gnome.desktop.default-applications.terminal exec 'sakura'


How to troubleshoot slow web browsing in Ubuntu VBox guest (Windows host)?

OK, I found an (excellent) answer to my question, here.

It turns out that the only non-comment line in my /etc/resolv.conf file was

nameserver 127.0.0.1

...which coincides with the situation presented in that other thread.

In my case, the problem was resolved by performing only the first adjustment suggested in that answer, namely:

run gksudo gedit /etc/NetworkManager/NetworkManager.conf;
comment out the dns=dnsmasq (→ # dns=dnsmasq);
run sudo service network-manager restart.


Clementine and other Qt-based apps crash when click file manager window

Looks like a typo; it should be

sudo apt-get remove qt-at-spi

This worked for me.


Backup Failed: Could not understand duplicity version + Cannot ask duplicity for its version

If you are not comfortable with using rsync (or Grsync) commands and having problems with Duplicity, then use LuckyBackup downloadable from the Ubuntu Software Center.

It uses the rysnc command set but in a much more user friendly fashion with the added advantage that you can try out your selections first before committing them to a final run. Not only that but you can schedule backups to make life much more simple.
I have been using this for some time now backing up various drives (including a NAS) and backups can be made to cloud based storage (such as DropBox).


Why does Ubuntu 12.10 update to 13.04 on its own?

i don't think that its automatic update as 13.04 on beta

Because the ubuntu 13.04 is still on beta test , so it's not offcial released if you want to update to ubuntu 13.04 beta

open terminal , and type this   ( this is the easiest way )

sudo do-release-upgrade -d

any way its not bad to test beta as on 27 april its offcial released and u can update it


Hibernate command in 12.04 causes my PC to hibernate temporarily and restart

In my case this was happening because swap space was encrypted thus hibernate wont know how to resume

This blog post explains how to modify encrypted swap. The swap page in the Ubuntu help wiki may help also.


texstudio tooltip is solid black instead of texfield

this issue has been answered in other posts as well: https://askubuntu.com/a/101913/6278

That is,

sudo apt install gnome-color-chooser

run gnome-color-chooser and then select the ticks in the 'Tooltip' section of tab 'Specific'.


Is a Ubuntu LiveCD technically a virtual machine?

A live CD system is installed... on the live CD itself.
Most of the time, we boot our computers from an internal hard drive. The computer's BIOS (or EFI/UEFI, which may informally be called a "BIOS") accesses the drive, loads the operating system's boot loader, and executes it.
It works the same way for booting from drives other than an internal hard drive. Which drives your computer can boot from (without leveraging another layer of software) depends on your computer's BIOS. Essentially all PCs manufactured anytime in the last couple decades can boot from:

an internal hard drive
an optical drive, if the computer has one built in
an external, USB-attached hard disk or similar device (like a pendrive / flash drive)

Many computers can boot over a network (PXE booting), which is as nifty as it sounds but is complicated enough to set up that it's usually not worth it for booting from a single computer. Some computers can also boot from other devices, such as Firewire (IEEE 1394) drives.
Booting from an internal hard drive runs the system installed on it. In your case, that's whatever operating system was installed by your school's IT people.
Booting from a removable disk, like a CD/DVD or USB flash drive, runs the system installed on the removable disk. When you write an Ubuntu desktop ISO image to a USB flash drive, or burn it to CD or DVD (or other optical medium, such as a Blu-Ray), this causes an Ubuntu live environment to be installed on the CD/DVD/USB.
But there are different kinds of installation.
There are differences between an Ubuntu system installed in the usual way on your computer (i.e., what you would get if you selected Install Ubuntu... which you should probably not do on your school's computers), and a live environment.
A live system is designed to run on a very wide range of different hardware. Therefore, installing it (i.e., making the live medium from an ISO image file) does not require specialized steps to identify hardware, enable drivers for it, and perform other customizations. This is why it can simply be "stamped out" from a disk image.
In contrast, while there is such a thing as a disk image for a hard drive (and they're used by backup solutions like CloneZilla and Ghost), writing a generic disk image to a hard disk would not be an effective way to create a normal operating system installation. This is because:

Where on the disk partitions must be created, and of what size, varies. Some installations, especially (but not only) on servers, have partitions on multiple disks or use RAID or LVM.
What initial software is installed and how it is configured varies somewhat, mainly with respect to device drivers.
An initial user account must be created and some files--at least the user's home folder--are named with their username. The user account's home folder is often located on the same partition as the rest of the system.

A virtual machine is different.
Unlike booting your computer from a traditionally installed system on an internal drive, or a live system on a CD/DVD or USB flash drive, a virtual machine does not involve booting your computer at all. That's why it's virtual: it is a computer simulation of a (different) computer.
As Ruslan Gerasimov says, a virtual machine can run a traditionally installed system or a live system. Whether or not a machine is virtual and whether or not it's running a live environment are independent.
There is one important similarity, practically speaking, between a live system and a virtual machine (live or not):

You can take a live CD/DVD or live USB from one computer to another, and it should work, because it is not specialized to any particular hardware configuration or user customization.
You can do the same thing with a virtual machine--because even if the OS installation is machine-customized, it's customized to the guest (virtual) machine, which can be emulated/virtualized on multiple host (physical) machines.


Are card reader/writers supposed to poll all the time?

The problem is in the design of the rts5139 driver, which is in the 'staging' portion in the kernel hierarchy, meaning it's not yet up to the quality standards of some of the other drivers.

It seems, though, that the problem has been acknowledged on Linux driver development mailing list in May. However so far I'm not seeing changes after that in the kernel tree that would affect the actual problem. I can confirm that I'm seeing the polling on my machine in Ubuntu 12.10, and I'm doing the cumbersome 'rmmod rts5139' in /etc/rc.local to not used the card reader by default (I only use it rarely).


16.04 Reboot after installation hangs Assuming drive cache: write through

Normally, you can check the boot log (sudo journalctl -xb) to see boot errors that were not shown on screen. If grub cannot detect any partitions, your boot entries may be messed up though.


Does the system suffer in performance because of full-disk encryption?

Well in the past, encrypting the system would have a strong performance hit since all the I/O and processing that needed to be done between encryption and reading/writing to the disk. But since a couple of versions ago, the performance hit is less than 5%. I would even be so bold as to say it is less than 1% since, with some tested I did, the video performance, copy/paste, hdd benchmark and speed of boot were almost the same.

And since you are using Ubuntu 12.10, there is even less of a performance penalty.

Here is a link of the Performance on Ubuntu 11.10 with and without Encryption

And here is a very old benchmark on how it looked on 9.10

As you can see the performance has gone up since 11.10 and you are using 12.10, so the performance is basically the same. I was actually amazed n how it was running when I first tested this on 12.04.


Try this from terminal to identify what you need:
lspci -nn | grep 0280
Then find your driver from other pc (google for linux driver of your device) and move it to laptop with flash-drive.
Finaly from settings go to additional drivers and activate it.
You may want to search more info if you don't get it working.
http://docs.xubuntu.org/1304/internet-networks.html


Can't boot back to windows please help me

From your paste, there is only one disk, and the entire disk is used by a single partition formatted with the ext4 filesystem, with Ubuntu installed. Sorry, but I don't think you will be able to get Windows back without re-installing it.


Dual-booting Ubuntu with Windows 8, Motherboard Settings inaccessible

Most computers do give a way to access the firmware setup tools at boot time, but that method is often unprompted. Usually it's by pressing Del or a function key before GRUB appears, so try that. Shut down (don't reboot; it's often easier when starting cold) and try each of these keys.

If that fails, you may be able to get in from Windows, as described here (among other places).

Several boot managers, such as gummiboot and rEFInd, provide a means to enter the firmware setup utility; but this feature doesn't work on all computers. Also, if your computer is set with Secure Boot active, you'll have to jump through some extra hoops to get either of those boot managers installed. See the rEFInd Secure Boot documentation for details.


Udev rule not executing on usb insertion, should run script in background

From the udev man page for RUN:

  Execute an external program specified as the assigned value. If no absolute path is given, the program is expected to live in /lib/udev; otherwise, the absolute path must be specified.

sh is not in /lib/udev.

Furthermore, by beginning with sh the script is run by the Sh interpreter.  However, from the command line likely no interpreter was given, so the #!/bin/bash line would be used to select Bash.

The disown is Bash specific.  Therefore just remove the leading sh from this part of the rule:

RUN+="/usr/local/bin/setup_wifi_wrapper.sh"


How can I show user name on gear icon in ubuntu 12.04?

Try this command to enable username on top-panel,

gsettings set com.canonical.indicator.session show-real-name-on-panel true

try this to disable,

gsettings set com.canonical.indicator.session show-real-name-on-panel false


NetworkManager editor can't edit wired connection

You cannot edit /etc/network/interfaces via the NetworkManager connection editor.


Installation of Ubuntu 18.04 from the .iso file downloaded from the site

After downloading the ISO file to your PC, you insert a blank/unused DVD into your DVD writer, and you use the "Burn CD" option in Windows to copy the ISO onto the DVD.

You can then take that DVD and insert it into a DVD drive on the destination PC. When you boot that PC, if you have the DVD set as the default 1st boot device, it should read the DVD that you created and start the Ubuntu install process. If you do not have a DVD burner, there is a way to burn the ISO image onto a USB flash drive. You can then boot the target PC from the USB to start the install process.

I believe that you can find detailed instructions and a walk-through with a Google search.


dev-loop*.device lines show the loading apps installed by Snap, discussed here and if those apps are uninstalled, then you don't wait for them to load.

Apps installed Old School with apt don't consume as much time or memory.

Snaps are not necessarily eeevil; developers like them.


How do I mount an Active Directory Windows share?

I had the same problem. I got the solution from here.

in /etc/samba/smb.conf add the following to the bottom of the [global]
section:

client lanman auth = yes
client ntlmv2 auth = no

Worked perfectly after that.


I found this on Stack exchange! give it a shot!

#!/bin/sh

REMOTEUSER=username
REMOTEHOST=remotehost

SSH_REMOTEPORT=22
SSH_LOCALPORT=10022

TUNNEL_REMOTEPORT=8080
TUNNEL_LOCALPORT=8080

createTunnel() {
    /usr/bin/ssh -f -N  -L$SSH_LOCALPORT:$REMOTEHOST:SSH_REMOTEPORT -L$TUNNEL_LOCALPORT:$REMOTEHOST:TUNNEL_REMOTEPORT $REMOTEUSER@$REMOTEHOST
    if [[ $? -eq 0 ]]; then
        echo Tunnel to $REMOTEHOST created successfully
    else
        echo An error occurred creating a tunnel to $REMOTEHOST RC was $?
    fi
}

## Run the 'ls' command remotely.  If it returns non-zero, then create a new connection
/usr/bin/ssh -p $SSH_LOCALPORT $REMOTEUSER@localhost ls >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
    echo Creating new tunnel connection
    createTunnel
fi

This script will open two ports, ports 22 which will be used to check if the tunnel is still alive
and port 8080 which is the port you might want to use (you can change that ofcourse)


linking cpp object file to c object file and create executable

If you have two output object files, let's call these files a.o and b.o you can link them into one executable like so:

gcc a.o b.o -o output_executable_name

Obviously, replace 'output_executable_name' with the name of the program you want to build.
You will need, by default, to have a 'main' function defined in one of those object files and you need to not have any unresolved dependencies with external libraries.

However, I want to urge you to perhaps investigate going to a C++/C programming forum as AskUbuntu.com is for solving problems/issues with Ubuntu not for learning C/C++ programming.

I have, as a token of goodwill, attempted to answer your question though - good luck with your programming :)


How does Linux know how to execute shell vs machine code?

The binfmt subsystem of the Linux kernel recognizes various magic numbers at the start of the file and invokes the appropriate loader for it.


Google Chrome Drop Down Menus not Working

Uninstall Chrome completely.

After you have done so, goto the Ubuntu Software Center and search "Chromium".

Chromium is an open source version of Chrome and it is pretty much the same thing.

I know this does not solve your problem, but it is easier than fixing the issue.


Copying files from Windows 8 to Ubuntu causes unknown network error

For those who land on this page for solution.

This happens with Windows Server 2012 R2 not just Windows 8.

Increasing SEND and RECEIVE buffer might fix the issue.

Add the following line in your smb.conf and restart the services.

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

Another alternative is to  edit /etc/sysctl.conf and add

net.ipv4.tcp_wmem = 4096 32768 131072
net.ipv4.tcp_rmem = 4096 87380 174760

Then run sysctl -p for the changes to  take  effect. But this only helps for smaller size files (100Mb). It gets transferred fast enough before it errors out. Large file transfer (above 1Gb) still fail. It might helpful for other applications though.


Will I be able to set a 2560x1440 resolution on a 27" screen?

Quoting this blog post:

  I'm using the Displayport connector [...] and have no problems running at the full 2560x1440 resolution. Further, I had zero problems using the Nvidia driver that comes with Ubuntu. It detected the display, set the maximum resolution and refresh rate, and worked right out of the box.

I can only assume that it will work fine when using a dual link cable.

BTW, the monitor's manual explicitly states that the HDMI resolution is limited to 1080p, so ignore all the threads where people complain about not getting 2560x1440 via HDMI. :)


Minimal BASH-like line editing is supported - GRUB error - Ubuntu 16.04, luksPartition, boot-repair does not work

The solution was to boot from the EFI-bootable USB pendrive.
Then decrypt the luks with cryptsetup.
Then run the boot-repair.
Got my OS back :)


How to install Intel HD 4000 grapics driver

Here seems to be the latest linux driver for hybrids like yours (according to google) - a

new beta for Linux just went out ( have you already been here ? ) :

http://support.amd.com/us/gpudownload/Pages/index.aspx

(addition of 22nd July 2013 - because of newer news):

You have chosen the tag resp. the category 'ATI' for this thread ?

There is a new video since today as tutorial :

https://video.linux.com/videos/installing-official-linux-ati-drivers-from-amds-website


Ubuntu 14.04 doesn't boot on Sony Vaio pcg7l1m

Try the below command by plugin the USB drive,

  sudo mkdir /media/floppy

sudo mount -t msdos /dev/sdb /media/floppy


How can I install Windows 7 on Ubuntu? (Dual-Boot)

excuse my english.   if you know about install Windows System Operative.
it's easy,
1) begin install Windows 7. .
2) create partitions, for windows 7 and Ubuntu
3) continue to end installation windows 7.
4) install ubuntu, (previously downloaded the .ISO image and burn a DVD.)
5) take the left partition for Ubuntu
6) share you experience,


How to "dismount" an active partition from Ubuntu

You mean unmount?

You say you've tried Gparted, but did you actually click the "unmount" button?


20.04 pulseaudio weirdness at boot and unix sockets

OK finally got the time to figure out a fix.
For some reason the creator of a pulse Unix socket matters (even though its all permissions for everyone). And Gnome is running pulse at startup - using the system config by default with some extra bits. So simply commenting out the use system conf (or giving it a bespoke config i suppose - don't think I get prelogin sounds with the commenting out) in /var/lib/gdm3/.config/pulse/default.pa fixes this issue.

I expect this is a bug/ overzealous security feature in pulse's start up - it can't create the file because it exists, and won't use it because it didn't create it. Why restarting pulse with -v flags will work and just --start won't does confuse me a little though - with the -v flags it does overwrite the socket - so I presume either it doesn't check and abort or it does a cleanup step first in verbose mode. But I've not looked through Pulse's code at all.


Xubuntu 18.04 daily front left and right left channels are not balanced in PulseAudio

I believe I've found the solution.

I had 4 shortcuts in the keyboard "Application Shortcuts" menu. volume-up for media+ key, and ctrl+pageup key. Also volume-down for media- key, and ctrl+pagedown key.

I removed the "ctrl" variants of the shortcuts, and so far no left/right unbalance has happened.

Will update if anything changes.


ubuntu 16.04 is automatically connecting to its own created wifi-hotspot via create_ap. And avilable wifi networks are not detected

I partially solved the "wifi is not showing" issue by logging out and logging in again.
Apparently this resets the GUI session.

But when I restart, create_ap is (probably) creating the network and it's connecting to it, no further wifi networks are listed except the created hotspot network, I have to hit disconnect and logout-login and this resets the GUI and I can see the wifi networks. (without clicking disconnect logining out and loging in doesn't solve the issue)

It makes sense becuase all drivers and sudo lshw -C network output is clean.

I tried to disable create_ap service by systemctl disable create_ap and reboot, but it didn't work (I had to disconnect from the created hotspot network and logout-login again)

Wierdly, when I rebooted and the hotspot network is created, when I run systemctl status create_ap the output is the following:

create_ap.service - Create AP Service
   Loaded: loaded (/usr/lib/systemd/system/create_ap.service; disabled; vendor p
   Active: inactive (dead)

It says that the service is disabled and inactive, but somehow the hotspot network is created (I don't understand what is going on here)

  when I attempt to start a network it displays this error ERROR: Your adapter can not transmit to channel 56, frequency band 5GHz.

This error was because the wifi adapter is connecting to the router via 5GHz frequency band, disconnecting and connecting solved the issue (it re-connected via 2.4 GHz frequency band and was able to create a hotspot network)


Restoring Win7 to Factory Image: Good Idea?

Dell's factory image will wipe the entire drive and replace it with Windows 7.  If you do not want to do this, do not restore to factory defaults

(I've got a dell, did this once by mistake, and hell ensued)

If you're not going to use Windows 7, then I'd suggest just wiping out the Windows 7 partitions and utilizing the extra space as storage (or expand your Ubuntu to use it all), but if you still have a purpose for Windows 7, don't change anything in terms of partitioning.


Stop Keyboard Shortcuts information screen appearing

Right now this feature to disable isn't in Ubuntu yet.

You can set it by command line for now till the feature is available

gconftool --set "/apps/compiz-1/plugins/unityshell/screen0/options/shortcut_overlay" --type bool false

In case you get gconftool not found, then you can first install the package gconf2 either from Software center or command line

  sudo apt-get install gconf2

In my case it shows installed as I have already installed it


Changing themes and environment variables :: 14.04 lts

Install GNOME Color Chooser. This provides a variety of options.

sudo apt-get install gnome-color-chooser

  This however just alters the title bar and menu texts, not the main
  fields of the windows.

This tool allows you to change the color of the text boxes and panels and such. Hope this is what you are looking for.


I had a similar issue resolved by uninstalling xfce-terminal and reinstalling in ubuntu 19.10. In my case the terminal woul

sudo apt remove xfce4-terminal
sudo apt install xfce4-terminal


How to reduce brightness for sony vaio with 7650 HD

you have to concentrate on top right corner of your Ubuntu main screen, there will be one screen brightness adjustment option u will see.Then go through that option and make your own desired brightness.


How to give a specific pyqt program read/write permission?

This is why you should not run graphical programs as root in the first place...

Run

sudo chown nick:nick /home/nick/.config/gtk-2.0/gtkfilechooser.ini

to restore ownership of the configuration file. This of course assumes that the username is nick

You may want to do this recursively for all of ~/.config

sudo chown -R nick:nick /home/nick/.config/


You're probably looking for something like smokeping.

There's several ways of having it run, here's one.


vitualbox NAT stopped working after Ubuntu upgrade to 12.10

I had the same problem, but without updating to 12.10: I already was in 12.10 last Wednesday, the last time I used the virtualmachine, but on Sunday I couldn't access the network from any virtual OS (tried both Windows 7 and Windows 8). Also tried to update from virtualbox 4.1 (bundled with ubuntu) with virtualbox 4.2 from the Oracle website, but nothing changed.

I guess an Ubuntu update broke something.

I've tried an answer from another thread and it does work

VBoxManage modifyvm "name" --natdnshostresolver1 on
VBoxManage modifyvm "name" --natdnsproxy1 on

(PS: I couldn't add this as a comment to the original question, don't have enough reputation, but thought it could be useful)


What is the meaning of "[command] &" in Ubuntu?

It is simply saying that appending an & after a command will run that command in the background.  Example:

sleep 10

This will wait for 10 seconds before returning you to the prompt.  Add the & after it and you get the prompt right away.


Open terminal and edit your system wide crontab.

sudo nano /etc/crontab

After last hash-tag enter and save the following line.

@reboot root lightdm

After several reboots, system seems to have no problems. And hopefully never will. Can't say for sure that this is the best solution...


Based on the low PID, what you are likely seeing is a kernel thread. For example, on my system (which also does not have any RAID devices, nor either of the raid packages mdadm dmraid installed) I see the following:

$ ps -ef | grep -e '\[md\]' -e '\[kthreadd\]'
root         2     0  0 Mar10 ?        00:00:00 [kthreadd]
root        35     2  0 Mar10 ?        00:00:00 [md]

(note the md process's PPID is the PID of kthreadd).

Looking at my kernel config file, I see that MD is configured as a built-in (so you won't see it using lsmod):

$ grep CONFIG_MD= /boot/config-`uname -r`
CONFIG_MD=y

although most other RAID capability is provided by modules. According to Managing RAID on Linux, CONFIG_MD is also required for LVM - so perhaps that is why it is enabled by default.

To figure out why your system monitor is showing a different icon for this kernel thread in particular takes some sleuthing. Looking at the source code for gnome-system-monitor (on which I believe the Mate system monitor is based) we see in ./src/prettytable.cpp the following function:

void
PrettyTable::set_icon(ProcInfo &info)
{
  typedef Glib::RefPtr<Gdk::Pixbuf>
    (PrettyTable::*Getter)(const ProcInfo &);

  static std::vector<Getter> getters;

  if (getters.empty())
    {
      getters.push_back(&PrettyTable::get_icon_from_gio);
#ifdef HAVE_WNCK
      getters.push_back(&PrettyTable::get_icon_from_wnck);
#endif
      getters.push_back(&PrettyTable::get_icon_from_theme);
      getters.push_back(&PrettyTable::get_icon_from_default);
      getters.push_back(&PrettyTable::get_icon_from_name);
      if (has_kthreadd())
        {
          procman_debug("kthreadd is running with PID 2");
          getters.push_back(&PrettyTable::get_icon_for_kernel);
        }
      getters.push_back(&PrettyTable::get_icon_dummy);
    }

  Glib::RefPtr<Gdk::Pixbuf> icon;

  for (size_t i = 0; not icon and i < getters.size(); ++i) {
    try {
      icon = (this->*getters[i])(info);
    }
    catch (std::exception& e) {
      g_warning("Failed to load icon for %s(%u) : %s", info.name.c_str(), info.pid, e.what());
      continue;
    }
    catch (Glib::Exception& e) {
      g_warning("Failed to load icon for %s(%u) : %s", info.name.c_str(), info.pid, e.what().c_str());
      continue;
    }
  }

  info.set_icon(icon);
}

The gist seems to be that it constructs a list of icon "getters", and then tries each in turn until it finds a match, eventually falling through to get_icon_for_kernel in the case of kernel thread processes - this is the one that returns the default applications-system "cogwheel" icon that you see for the other processes:

Glib::RefPtr<Gdk::Pixbuf>
PrettyTable::get_icon_for_kernel(const ProcInfo &info)
{
  if (is_kthread(info))
    return Glib::wrap(gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), "applications-system", APP_ICON_SIZE, GTK_ICON_LOOKUP_USE_BUILTIN, NULL));

  return Glib::RefPtr<Gdk::Pixbuf>();
}

So it seems likely that one of the higher priority "getters" is erroneously returning an unrelated icon for the md process. If we guess that might be based on the process name, then we are looking for some software package that installs an icon named md. One candidate from standard Ubuntu repositories is

mate-icon-theme: /usr/share/icons/mate/scalable/animations/md.svg

which is the flag of the Republic of Moldova, whose ISO 3166-1 alpha-2 code is md.


Installing Ubuntu on acer aspire 5551-2450

I'm not sure about this, and others may be able to give you a direct answer, but to start with you could try to install Ubuntu 11.10 and then upgrade it to 12.04
You will need to make a bootable USB or a CD of the iso image for Ubuntu 11.10, install it from the USB drive or CD. After you have got that working, you use the update manager to upgrade to 12.04. Good luck


To be able to port forward from Internet to your web server, you can't have a NAT behind a NAT.
To figure that out, your routers external address must be the same as seen when you surf on internet.

So log into your router and look up what IPv4 address you have on your external interface. You might get help from this site, it has worked for me before: http://portforward.com/

Then you have to see what address other servers see when you surf out from your LAN, behind the router.  I use this siter, but there are others:
http://www.whatismyip.com/

It the first are a private address and/or those two addresses are not the same, then your modem is giving you a private address and not a public one.  That makes it impossible (or at least hard) to make your server accessable from Internet.

The solution for both your problems are of course IPv6, as you will not give you a private address but a real public /64 network of IPv6 addresses for your LAN.  And as many servers as you like, or actually (2 to the power of 64) - 2, which is quite a lot. ;-)


Initializing Problem when using the Catalyst Control Center with fglrx

You chipset is still not supported, the linux ATI drivers will not work with your card. Latest version of fglrx still does not support switchable graphic cards as yours.

At the moment you are running with an integrated Intel graphics GPU, not with the ATI card that is also present in your system. Some motherboard BIOS support an option that allows you to switch completely to either the Intel or the ATI. If you can check it and switch from "hybrid" to either the Intel or better only to the ATI that will solve the problem.

The only possible good recommended option is really remove the drivers and keep checking the ATI site for newer drivers, maybe the next version will bring the so much desired support for these kind of chipsets.


How to install gnome 3.29.92 or 3.30 in Ubuntu 18.04?

Yes, it is possible to upgrade any software you want from any ubuntu release if you're willing to do things a little unconventionally and have to deal with more complexity, potential risk and issues of compatibility.
I too could not upgrade to 18.10 as it breaks some essential software for me. On the other hand, Gnome 3.30 is by far superior to 3.28 and 3.26 in terms of stability and performance. Most especially true for Gnome Wayland which goes from disastrous to actually usable as of 3.30...
Here is the general gist of what I did:

temporarily modify apt repo list to use cosmic's repos instead of bionic.
update ONLY gnome shell to 3.30 and the files it needs to run in a stable manner and nothing more.
make a list of the files updated in 2.
undo step 1, so that the rest of the packages on the machine can use the LTS updates
the rest of the packages can be updated normally but the files I updated in 2 will need to be updated manually via a script that will be built with the list made in step 3.

I've made a very thorough tutorial on how to do this. Should you follow this closely, you should not have any trouble but know that there are no guaranties and that you are playing with things that could break an install, so backup your install before doing this or do this on a virtual machine to see how it goes for you.

Detailed Instructions (numbers don't correspond to the list above):
Prep
Unless I specify otherwise, assume all commands are in elevated privileges and that I just don't feel like typing sudo 100 times. To go into sudo mode enter:
sudo -H bash #or sudo su

Before doing anything, make sure all is in order by running:
apt-get --fix-broken install

Step 1
Make a copy of the original and temporarily modify the apt repository lists so that it checks the Cosmic repos for updates instead of the Bionic ones:
cp /etc/apt/sources.list /etc/apt/sources.list.bionic
#make a cosmic version of the apt list
cat /etc/apt/sources.list.bionic| sed 's/bionic/cosmic/g' > /etc/apt/sources.list.cosmic
# set the apt list to cosmic
cp /etc/apt/sources.list.cosmic /etc/apt/sources.list

# backup your two list files to another directory - just in case some smart ass updater decides to delete them.
mkdir /etc/apt.bak
cp /etc/apt/sources.* /etc/apt.bak

Step 2
Update package lists and check for upgradable packages:
apt update
apt list --upgradable > upgradable

Step 3
Using grep, run a text based search for the numbers 3.30 and 3.28. This should only show you the updates related to the Gnome Shell. Additionally, you can  search for packages related to Wayland (essential!) and glib, gir, gtk (up to you). I really don't care about Xorg, as I think it's terribly insecure, but if you want to use gnome-x11, you can search for xorg packages to update as well. The idea behind this approach is to avoid upgrading too many packages to the Cosmic branch, because Cosmic only has 9 months of fixes and Bionic will have 5-10 years of security updates and fixes, so it is to your interest to keep as much of your system as possible on the Bionic line.
#updates directly related to 3.30 or needed by it.
cat upgradable | grep "3.30" | grep --color=NEVER "3.28" > upgradable-3.30 #this got me 78 packages
cat upgradable | grep --color=NEVER -i "nautilus" >> upgradable-3.30 #if you endup choosing to do step 9, don't do this
cat upgradable | grep --color=NEVER -i "gdm" >> upgradable-3.30
cat upgradable | grep --color=NEVER -i "gnome-shell-extension-appindicator" >> upgradable-3.30
cat upgradable | grep --color=NEVER -i "gnome-shell-extension-ubuntu-dock" >> upgradable-3.30
cat upgradable | grep --color=NEVER -i "gvfs" >> upgradable-3.30
cat upgradable | grep --color=NEVER -i "network-manager" >> upgradable-3.30

#wayland
cat upgradable | grep --color=NEVER -i "wayland" > upgradable-wayland

#x11
cat upgradable | grep --color=NEVER -i "xorg" > upgradable-xorg
cat upgradable | grep --color=NEVER -i "x11" >> upgradable-xorg

Not sure how necessary the upgrades below are. I would imagine that the library packages needed for the healthy functioning of Gnome Shell 3.30 would be automatically downloaded if I install the files in uprgradable-3.30. I would say, try without them and if you feel it's not stable, install them.
cat upgradable | grep --color=NEVER -i "gnome-bluetooth" >> upgradable-3.30 #version change doesn't seem very for this one, maybe keep it on bionic
cat upgradable | grep --color=NEVER -i "gnome-keyring" >> upgradable-3.30 #version change doesn't seem very for this one, maybe keep it on bionic
cat upgradable | grep --color=NEVER -i "gnome" >> upgradable-3.30
cat upgradable  | grep --color=NEVER -i "gtk" > upgradable-libs
cat upgradable  | grep --color=NEVER -i "glib" >> upgradable-libs
cat upgradable  | grep --color=NEVER -i "gir" >> upgradable-libs

Each upgradable list should look something like this:
adwaita-icon-theme/cosmic,cosmic 3.30.0-0ubuntu1 all [upgradable from: 3.28.0-1ubuntu1]
baobab/cosmic 3.30.0-1 amd64 [upgradable from: 3.28.0-1]
cheese/cosmic 3.30.0-0ubuntu1 amd64 [upgradable from: 3.28.0-1ubuntu1]
cheese-common/cosmic,cosmic 3.30.0-0ubuntu1 all [upgradable from: 3.28.0-1ubuntu1]
etc... etc... etc...
You should be upgrading a max of 100 to 250 packages out of 1500
Step 4
Using sed, reformat the lists made in step 3 to turn this:
adwaita-icon-theme/cosmic,cosmic 3.30.0-0ubuntu1 all [upgradable from: 3.28.0-1ubuntu1]
baobab/cosmic 3.30.0-1 amd64 [upgradable from: 3.28.0-1]
cheese/cosmic 3.30.0-0ubuntu1 amd64 [upgradable from: 3.28.0-1ubuntu1]
cheese-common/cosmic,cosmic 3.30.0-0ubuntu1 all [upgradable
etc...etc.... etc..
into this:
apt-get install --assume-yes adwaita-icon-theme baobab cheese cheese-common etc... etc... etc..
cat upgradable-3.30             |  sed 's/\[//g'| sed 's/\/cosmic/\[/g'| sed 's/), /\] /g'| sed 's/)/\]/g'| sed -e 's/\[\([^]]*\)\]//g'|sed '/^\s*$/d'|sed "s/^/apt-get install --assume-yes /g" > up-3.30
cat upgradable-wayland             |  sed 's/\[//g'| sed 's/\/cosmic/\[/g'| sed 's/), /\] /g'| sed 's/)/\]/g'| sed -e 's/\[\([^]]*\)\]//g'|sed '/^\s*$/d'|sed "s/^/apt-get install --assume-yes /g" > up-wayland
#again, xorg is optional for those using it, don't upgrade it if you don't use it. You want to keep as many files as possible on the LTS track.
cat upgradable-xorg             |  sed 's/\[//g'| sed 's/\/cosmic/\[/g'| sed 's/), /\] /g'| sed 's/)/\]/g'| sed -e 's/\[\([^]]*\)\]//g'|sed '/^\s*$/d'|sed "s/^/apt-get install --assume-yes /g" > up-xorg
#same for the libs
cat upgradable-libs            |  sed 's/\[//g'| sed 's/\/cosmic/\[/g'| sed 's/), /\] /g'| sed 's/)/\]/g'| sed -e 's/\[\([^]]*\)\]//g'|sed '/^\s*$/d'|sed "s/^/apt-get install --assume-yes /g" > up-libs

make the newly created script executable
chmod +x up-*

Step 5
Taking note of the time and date before beginning, I used the results of 4 to update the packages that need updating:
date > upgrade-start
./up-3.30
./up-wayland

#etc...

#Install the Yaru themes (they're not included in 18.04 and are need in 3.30)
apt-get install yaru-theme-*

#as regular user (non-sudo), activate themes via:
gsettings set org.gnome.desktop.interface gtk-theme 'Yaru' #or 'Yaru.dark'
gsettings set org.gnome.desktop.interface cursor-theme 'Yaru'
gsettings set org.gnome.desktop.interface icon-theme 'Yaru'
gsettings set org.gnome.desktop.sound theme-name 'Yaru'
#or use gnome-tweaks to do it

#If you get any errors, run

apt-get --fix-broken install

date > upgrade-finished

#reboot your machine
reboot

Step 6
The files upgraded in 5 are no longer on the LTS update track. Meaning, when step 1 is undone and an update is initiated, the normal Bionic packages will update, but these ones will always be considered newer. Furthermore, any dependencies updated or installed in step 5 will be in the same situation. Updating these packages will require the creation of a script that will update them manually.
Let's use the apt history log file to figure out what files will need manual updating:
cp /var/log/apt/history.log ./cosmics-upgrade.log

Do nano cosmics-upgrade.log and delete any entries from before upgrade-start and those that are after upgrade-finished (in step 5).
Now, let's make a script that will manually upgrade our non-LTS packages for us:
echo '#!/bin/bash' > update-cosmics
echo 'cp /etc/apt/sources.list.cosmic /etc/apt/sources.list;apt update' >> update-cosmics

The next step will use sed to format the logs into something we can put in our update-cosmics file (same idea as in step 4).
cat cosmics-upgrade.log | sed 's/([^)]*)//g'| sed 's/,//g'|sed "s/End-Date:/# End-Date:/g"|sed "s/Start-Date:/\n\n\n# Start-Date:/g"|sed "s/Commandline: /# Commandline: /g"|sed 's/Install: /\napt-get install --assume-yes /g'|sed 's/Update: /\napt-get install --assume-yes /g'|sed 's/Remove: /\napt-get remove  --assume-yes /g'|sed 's/Upgrade: /\napt-get install  --assume-yes /g'|sed "s/Requested-By:/\n\n\n# Requested-By:/g" >> update-cosmics

Finally, add the following line to the very end of update-cosmics:
echo 'cp /etc/apt/sources.list.bionic /etc/apt/sources.list;apt update' >> update-cosmics

Make the script executable and move it to /usr/bin
chmod +x update-cosmics
cp update-cosmics /usr/bin

Step 7
Undo Step 1 to allow your system to perform updates normally.
cp /etc/apt/sources.list.bionic /etc/apt/sources.list;apt update

Step 8
Use update-cosmics to temporarily switch to Cosmic repos and update the packages on the Cosmic track. You can run it manually or schedule it using cron.
Step 9: Bonus Round: Ditch Nautilus 3.26
This is a matter of preference: if you don't use Desktop icons or if you want to give the Desktop icons extension a try, you can get rid of the outdated Nautilus 3.26 that Ubuntu has forked for the much improved Nautilus 3.30. I like 3.30 because it has WAY better touch screen support and because 3.26's implementation of Desktop icons injects an X11 layer (XWayland really) - even if you are running a Wayland session. The Desktop icons Gnome Shell extension only works with 3.30. It is about 80% feature-complete, but does not inject an X11 layer into your Wayland session.
Nautilus 3.30 can be obtained by downloading the deb files from Debian's servers:
wget http://ftp.us.debian.org/debian/pool/main/n/nautilus/nautilus_3.30.4-1_amd64.deb
wget http://ftp.us.debian.org/debian/pool/main/n/nautilus/libnautilus-extension1a_3.30.4-1_amd64.deb
wget http://ftp.us.debian.org/debian/pool/main/n/nautilus/nautilus-data_3.30.4-1_all.deb

Use dpkg to install them:
dpkg -i *nautilus*.deb

Future updates to Nautilus can be found here and you'll have to manually install them (click modification date twice to see the latest debs).
The desktop icons extension can be found here.
If you decide to stick with the Debian 3.30 Nautilus, you'll have to remove these 3 packages from the update-cosmics script we generated earlier. You will also have to do:
apt-mark hold libnautilus-extension1a nautilus-data nautilus

This avoids Ubuntu's updater accidently "uprgrading" Nautilus from 3.30 back to 3.26 (yes, it actually can't tell that 3.30 is a higher number than 3.26).
To undo this, you can just do:
apt-mark unhold libnautilus-extension1a nautilus-data nautilus
apt-get install nautilus nautilus-data libnautilus-extension1a #and unstill the desktop-icons extension


How do I fix inverted movement of mouse?

You can change the mouse behaviour in Settings -- Mouse & Touchpad -- Natural Scrolling. Natural "Scrolling moves the content not the view".


Unpacking .lz format: what does this command do?

Packing and unpacking are here two-step processes: when packing, the
entire directory is stored in an uncompressed single file,
presumably with an index which indicates which segment comes from
which file. Next, this single file is compressed.
Rather than creating an intermediate file, cpio sends this uncompressed single file to stdout, and the compressor receives it over stdin.
Analogously, unpacking sends the decompressed file via its stdout
to cpio's stdin, causing cpio to unpack its stdin.
The pipe symbol | indicates that the prior program's stdout is the
next program's stdin.
Read the man pages of xz and cpio for details, e.g. which options
cause the programs to use stdin and stdout rather than a file.


How to grab a webpage with an open drop-down menu?

You can use this application called  shutter  Alternatively run the following to install the package via a terminal (Default keyboard shortcut: CtrlAltT) sudo apt-get update && sudo apt-get install shutter

It has options to capture dialog boxes, tooltips and pretty much everything that you will ever encounter or need to take a screenshot of.

To capture a drop-down menu with Shutter, open Shutter after installing it and click on the button pointed by the arrow in the screenshot below:

After clicking, you'll have a timeout before you which you can select a drop-down, keep the drop-down clicked until the timeout finishes to capture the selected drop-down menu

After capturing, click on Export button to either save the file to your desktop or host it on an image hosting service or FTP it or even push it to your Ubuntu One account.

You could also set a timeout and click the Window button and choose your browser from the dropdown. Before the timeout reaches 0, select the drop-down in the site to take a screenshot of the drop-down menu along with the website open.


Well, you didn't package your kernel, which is going to make things a bit harder. First, you need to delete the following files:

/boot/vmlinuzKERNEL-VERSION
/boot/initrdKERNEL-VERSION
/boot/System-mapKERNEL-VERSION
/boot/config-KERNEL-VERSION
/lib/modules/KERNEL-VERSION

Your compiled Linux has been removed. Now, you should be able to run update-grub and it, hopefuly, won't find anything related to your old kernel. Look at the output and see if the kernel you compiled is in there.

If you want to select what kernel you want to use at startup, you have to set GRUB to show when you turn on your computer. Open up your favorite text editor as root and edit GRUB's configuration file, which is located at /etc/default/grub. You'll find a line that says GRUB_TIMEOUT. This setting says how many seconds you want GRUB to show. It's probably set to 0, which is where your problem lies. Set it to something like 5 seconds instead by changing the 0 to a 5. Also, is you see a line that says anything like GRUB_HIDDEN_TIMEOUT and/or hiddenmenu, remove them in their entirety from the file. Save and exit, and make sure to run update-grub. You should be able to reboot and see GRUB. If not, there are some other settings in GRUB's configuration file you'll have to play with. You can choose Ubuntu to go with the default kernel, or you can go to 'Advanced options for Ubuntu' to choose your kernel and access recovery mode for any given kernel.


Why 16.04.4 packages are older than of 16.04.1 packages?

Because both 7.0.15-0ubuntu0.16.04.1 [1] and 7.0.15-0ubuntu0.16.04.4 [2] have been released. So the newer version of 7.0.15 which is 7.0.15-0ubuntu0.16.04.4 takes over, while the only available revision of 7.0.18 is: 7.0.18-0ubuntu0.16.04.1.

so if I run:

apt-cache madison php7.0-sqlite3 | grep -iv source

I will get:

php7.0-sqlite3 | 7.0.18-0ubuntu0.16.04.1 | http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
php7.0-sqlite3 | 7.0.15-0ubuntu0.16.04.4 | http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
php7.0-sqlite3 | 7.0.4-7ubuntu2 | http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages

and to see which version is candidate for  installation:

apt-cache policy php7.0-sqlite3

You'll see that the candidate version for installation is: 7.0.18-0ubuntu0.16.04.1.

You can check published versions here which are:

php7.0-sqlite3 7.0.15-0ubuntu0.16.04.4 in amd64 (Security)
php7.0-sqlite3 7.0.15-0ubuntu0.16.04.4 in amd64 (Updates)
php7.0-sqlite3 7.0.18-0ubuntu0.16.04.1 in amd64 (Proposed)


How to prevent accidentally unmounting and destroying my Windows drive from Ubuntu?

You can go ahead and unmount your Windows partition. That will not hurt anything. Unmounting a partition means making it no longer accessible to currently running system until it is mounted again.

This should have no effect on the Windows system itself. Unmounting a partition does not damage it in any way. Unmount does not mean anything like format or erase.

Therefore there is no reason for you try to to prevent yourself from unmounting it by accident. The damage you're worried about will not occur just from the partition being unmounted.

As psusi explained, the only situation where it would be harmful to unmount a partition is if there are open files on it that need to be written to disk before the partition is unmounted. But when that is the case, Nautilus will not unmount the partition when you click the "eject" button on it. So whether or not and to whatever extent you're using files on your Windows partition when booted into your Ubuntu system, this is not a problem either.

To clarify further, you asked:

  So just to be sure, if I do press the button, it should automatically remount when I boot into Windows again?

Yes.

Or, more precisely: Whether or not your Windows partition is mounted in your Ubuntu system is completely unrelated to what happens when you actually use Windows.

Windows must (in a sense) mount this partition every time you boot into Windows, whether or not it was mounted before in Ubuntu. In fact, your Windows partition, like all your other mounted partitions, is automatically unmounted when you shut down or reboot your Ubuntu system.

Whether or not a partition is mounted is almost entirely a matter of what state the currently running operating system is in, not of what state the partition itself is currently in. When your Windows partition is mounted in Ubuntu, this means Ubuntu can access data on it. It has nothing at all to do with what Windows can do, next time it runs.

Totally optional reading: I say "almost entirely" since some types of partitions keep information on the disk about whether or not they're currently mounted, so that if they are not unmounted when they should be, like during reboot, automatic corrective action can be taken. Such repairs apply to situations where a partition is not unmounted as needed, rather than those where the partition is unmounted. Specifically, when you write a file to a partition, it's possible the file will not be (fully) written to disk until the partition is unmounted.


Nvidia driver installed but no menu, hud, or dash are shown

Ok, so you are experiencing something that happens to a small group, me included. The solution is a little bit tedious but if you have an internet connection then we can proceed.

Another point to be noted, if you are trying to install the driver into a optimus/hybrid graphics enabled laptop/All in one, you may stuck at black screen or low resolution (or some weird situation).

These nvidia-driver doesn't support optimus enabled computer. To know how to work with these models see Is a NVIDIA GeForce with Optimus Technology supported by Ubuntu?.
To know whether you have optimus, execute lspci | grep VGA, if the output is two line intel HD and nvidia, you do have optimus. If you only have one nvidia card in the output, please follow instruction below.

First, when booting, hold the SHIFT or press ESC like crazy until the GRUB menu appears. Select the option about "Recovery".

After the recovery menu appears, go to the option that gives you the chance to go to the terminal with root privileges.

After going to the terminal add the Xorg Edges PPA. Why this PPA?, Because on some machines I have worked on, the solution is the specific drivers and xorg version found in this PPA.

sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get upgrade

Now the following line, which is the one to install a specific driver, depends totally on the video card you are using.

This will literally vary, for example, if you have an Nvidia 730m from HP DV 6000 for example, the only driver that will work correctly will be the oldest one. This is, the Nvidia 173 packages.

If you have a more up to date model, then you can test the 304, 310 or 313 series.

simply do ONE of the following and reboot afterwards to see if it worked:

sudo apt-get install nvidia-173 - For very old models ranging from 5xxx to 9xxx

sudo apt-get install nvidia-304 - For old/new models ranging from 6xxx and up

sudo apt-get install nvidia-310 - For new models

sudo apt-get install nvidia-313 - For newest models

After executing one of those, simply do sudo reboot

One of those will, after rebooting, fix all problems. Unity and Compiz should work correctly. The only thing left would be that, if after opening the Nvidia Panel you get an error about some missing file, simply go to a terminal and sudo nvidia-xconfig, then reboot again.

This is the quickest way to solve this, although,adding the specific Nvidia model would help narrow down the package you need to install. I can confirm this in 12.04, 12.10 and 13.04 with about 10 computers that happen to have the same problem since I encounter it a couple of months back.


Is there a way of activating AltGr as a means of putting accents on vowels?

You are looking for the Compose Key.

For 11.04 go to system settings; keyboard; layout and click options. Now find Compose Key and set it to Right Alt.


ls does not have such flag, but stat command allows showing octal permissions. Consider sample output for a test file,

testdir:$ stat TESTER
  File: ‘TESTER’
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 801h/2049d  Inode: 1197        Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/ xieerqi)   Gid: ( 1000/ xieerqi)
Access: 2015-11-05 17:42:01.914917433 -0700
Modify: 2015-11-05 17:42:01.914917433 -0700
Change: 2015-11-05 18:41:04.463776180 -0700
 Birth: -

stat also has --format flag , which allows you to "simulate" ls -l :

testdir:$ stat --format="%a %h %U %G %s %y %n" * | head -n 3
664 1 xieerqi xieerqi 0 2015-11-05 17:42:01.918917452 -0700 Aaaaaaa.bbb - 0000003 tag tag_tag 9tag
664 1 xieerqi xieerqi 0 2015-11-05 17:42:01.922917471 -0700 Aaaaaaa.bbb - 0000004 tag tag_tag 9tag
664 1 xieerqi xieerqi 0 2015-11-05 17:42:01.930917509 -0700 Aaaaaaa.bbb - 0000005 tag tag_tag 9tag

The only limitation here is the time format cannot be altered and color output cannot be added .

You could always alias that command in .bashrc to some shorter command, e.g. alias lsl2='stat --format="%a %h %U %G %s %y %n" *'

Alternatively, I've put together a small function that uses find and awk for nicer formatting

 function lsl2
   {
     find . -maxdepth 1 | sort |  xargs -I{} stat --format="%a %h %U %G %s %y %n" {}  | awk '{$7=substr($7,1,5);$8    =" ";print}'
  }

Sample output

testdir:$ lsl2 | head -n 7
775 3 xieerqi xieerqi 4096 2015-11-05 22:20   .
664 1 xieerqi xieerqi 0 2015-11-05 17:42   ./Aaaaaaa.bbb - 0000003 tag tag_tag 9tag
664 1 xieerqi xieerqi 0 2015-11-05 17:42   ./Aaaaaaa.bbb - 0000004 tag tag_tag 9tag
664 1 xieerqi xieerqi 0 2015-11-05 17:42   ./Aaaaaaa.bbb - 0000005 tag tag_tag 9tag
664 1 xieerqi xieerqi 0 2015-11-05 17:42   ./Aaaaaaa.bbb - 0000006 tag 9tag
664 1 xieerqi xieerqi 0 2015-11-05 17:42   ./Aaaaaaa.bbb - 0000006 tag tag_tag 9tag
664 1 xieerqi xieerqi 0 2015-11-05 17:42   ./Aaaaaaa.bbb - 0000007 tag 9tag

testdir:$ type lsl2
lsl2 is a function


Terminal closes after entering a non-existing command

Let me guess, there is set -e (or it’s long form set -o errexit) option in your .bashrc (.bash_profile).

-e

Exit immediately if a pipeline (which may consist
of a single simple command), a subshell
command enclosed in parentheses, or one of the commands
executed as part of a command list enclosed by braces (see
SHELL GRAMMAR above) exits with a
non-zero status. The shell does not exit if the command that
fails is part of the command list immediately following a
while or until keyword, part of the test
following the if or elif reserved words, part
of any command executed in a && or ||
list except the command following the final
&& or ||, any command in a pipeline
but the last, or if the command’s return value is
being inverted with !. A trap on ERR, if set,
is executed before the shell exits. This option applies to
the shell environment and each subshell environment
separately (see COMMAND EXECUTION
ENVIRONMENT above), and may cause subshells to
exit before executing all the commands in the subshell.

— bash(1)
This option is very useful for some scripts – it allows to avoid numerous || exit 1, e. g. instead of
cd /var/ || exit 1
tar -cvf myarchive.tar "$SOMEDIR" || exit 1
rm -r "$SOMEDIR"

you can write
set -e
cd /var/
tar -cvf myarchive.tar "$SOMEDIR"
rm -r "$SOMEDIR"

But of course there is no any reason to set it for interactive bash session.


Ubuntu 18.04 GUI is not working after installing cuda 10.0 in virtual ubuntu machine using vmware on windows 10 host machine

Try the next suggestion:

You need to switch to tty3 somehow (Ctrl+Alt+F3 -
I don't remember how to do it in vmware) and try to switch to a different display manager:

sudo apt install gdm3
sudo dpkg-reconfigure gdm3
sudo systemctl enable gdm3
sudo systemctl start gdm3

The same could be executed for lightdm, lxdm, kdm, ssdm, xdm.

To switch to tty, try:

Press Ctrl+Alt+Spacebar.
Keep holding Ctrl+Alt but release the space bar.
Press the desired key (for example F3).