I found an alternative way of configuring stylus buttons if Ubuntu settings refuse to show the settings. The way is described here, in the "Wacom tablet" section on Ubuntu 16.04 for my digital painting workstation - David Revoy:

  In Cinnamon, the GUI for Wacom tablet offer minimal yet powerful set
  of options: set buttons, set proportions to the screen...etc... The
  GUI is limited because you can't assign buttons modifier like  ,
   and  ...

  Xsetwacom:    For those who really need a way to assign this key and do more, here is the (big) workaround involving command line,
  script and other dirty things a normal user shoudn't consider as
  something normal to setup an hardware (graphist needs a GUI and focus
  on making good graphism, not script/code):

  1.  Get your tablet device name:

xsetwacom --list

  This command returns the name of my Wacom device, useful for my
  script:

Wacom Intuos3 9x12 Pen stylus    id: 11 type: STYLUS
Wacom Intuos3 9x12 Pad pad       id: 12 type: PAD
Wacom Intuos3 9x12 Pen eraser    id: 15 type: ERASER
Wacom Intuos3 9x12 Pen cursor    id: 16 type: CURSOR

  Note for reference your tablet pad name, mine here is Wacom Intuos3
  9x12 Pad pad in this example. Select the name, then press
  ++C to copy it in your terminal.

  2. Create a Xsetwacom bash script    Open the file manager (Nemo) , and in the folder of your choice ( I use /home/deevad/Script on my
  installation ) create a new empty file with right-click , "create a
  new document">"Empty document". Name it tablet.sh , then open it with
  a text-editor (Gedit). Inside it write a script like this with your
  tablet name:

#! /bin/bash
xsetwacom set "Wacom Intuos3 9x12 Pad pad" Button 1 "key Shift_L"
xsetwacom set "Wacom Intuos3 9x12 Pad pad" Button 2 "key Control_L"

  This example script will map  to the button 1 of your tablet
  (resize brush in Krita) , and Control to the button 2 ( pick color on
  Krita/Gimp/Mypaint) of the tablet. The special keys use standard
  names, for assigning other type of key I paste here a list :
  http://pastebin.com/aXGDkJTU

  If you want to assign a modifier ( eg. Ctrl ) on the stylus button,
  it's also possible:

xsetwacom set "Wacom Intuos3 9x12 Pen stylus" Button 2 "key ctrl"

  You can test all your xsetwacom lines inside the Terminal before
  writing them in your script. This way you'll test if you have a Button
  5 , or Button 20... etc...     For my Intuos 3, the layout of the
  right side is like this ( I found it with guessing and trying ):

# ---------
# |   | 1 |
# | 3 |---|
# |   | 2 |
# |-------|
# |   8   |
# ---------

  When your script is finished you can save it. In the file-manager ;
  right-click on it again > Properties > Permissions > and in front of
  Execute check the box for 'Allow executing file as a program'.

  3. Run it, create a start-up     You can double click and run the script. Your key on tablet will be mapped. But all setup of the button
  will not last a reboot. That's why we made a script to execute it at
  each start-up. Go now on 'System Settings', then 'Start-up
  application' , press the 'Add' button , give the form a name of your
  choice, for the command pick your script via the 'Browse' button, and
  comment what you want about it.

  More informations about Xsetwacom:    http://linuxwacom.sourceforge.net/wiki/index.php/Xsetwacom


winmail.dat attachments on Evolution (Ubuntu Gnome 13.10)

If anyone ends up here looking for a solution, the problem is most likely a bug that arose in Evolution 3.5 when TNEF handling passed from a plugin to a module.

It was fixed in Evolution 3.12.9+ and 3.13.8+, so you will need to use a distribution that offers one of them or above, which is the case of Ubuntu GNOME 15.04 and above (but 16.04 is recommended, as 15.04 is not supported anymore, and 15.10 only has 2 more months of support at the time of writing).


The solution is to use the gnome-shell-theme.gresource file from the Adapta-Nokto theme.

EDIT: I updated this solution to create a link to the Adapta-Nokto gnome-shell-theme.gresource theme file, instead of copying it. This way, the Lock screen will always use the most recent version of the Adapta-Nokto theme, whenever it is updated.

Open a terminal, and change to the gnome-shell directory.

cd /usr/share/gnome-shell/

Backup the original gnome-shell-theme.gresource file. The following command will only create the backup, if the current file is not a link (created using step 3).

if ! [[ -h gnome-shell-theme.gresource ]]; then sudo mv gnome-shell-theme.gresource gnome-shell-theme.gresource.original; fi

Link to the Adapta-Nokto theme's gnome-shell-theme.gresource file.

sudo ln -frs /usr/share/themes/Adapta-Nokto/gnome-shell/gnome-shell-theme.gresource gnome-shell-theme.gresource

Reboot to enable the new Lock screen. (Just loging-out and logging-back-in is not sufficient to enable the new Lock screen, because you are repeatedly taken back to the Login screen after you enter your password).
Note: if the gnome-shell-common package is updated at a future time, you may need to execute steps 1 thru 3 again to re-enable the Adapta-Nokto Lock screen theme.

Reference: Materia GDM Theme


"package libmono-security4.0-cil is not ready for configuration" how to make it ready?

Just remove the partially installed package libmono-security4.0-cil and then fix the dependencies,

sudo apt-get purge libmono-security4.0-cil
sudo apt-get install -f


Screen Resolution: xrandr "cannot find mode"

Running the command

xrandr --addmode VGA1 1360x1020

would have done just as well.

xrandr (without arguments) will list the existing modes and the ones that can be added.


Reinstall unity, This works on most cases, and it is reliable because you wont lose anything if something wrong happens ;)

Which drivers have you installed? and services (like apache) they may wont work properly on 13.04, write them so I check them myself and tell you if they have any problems on 13.04 ;)

EDIT: Does synaptic or apt-get commands give you errors?


Package appears in Software Center but is not installable

This has already been confirmed as a bug for software-center which may be resolved in future updates.


Can not de-crypt files after upgrading to latest Ubuntu version

Needed to use older version of encryption. Found this answer under "encryption":

use "-md md5" option in command line to force older encryption:

openssl des3 -md md5 -d


VBoxManage is unable to start vm code NS_ERROR_FAILURE ubuntu 16.04

OK.  Figured out the problem here.  My kernel modules hadn't been deleted from the previous install of virtualbox when I uninstalled.  So when I ran modinfo vboxdrv, it said I was using the kernel drivers for 5.0.4.

I deleted everything in the path to the filename given in the modinfo output and rebooted.  Installing virtualbox and starting vms worked after that.


The settings in the settings manager have no affect

I think I had the same problem, and here’s how I fixed it.

In /etc/dconf/profile, there were two small text files, “gdm” and “user”. “gdm” looked like this:

user-db:user
system-db:gdm

whereas “user” looked like this:

user
gdm

So, I changed “user” to look exactly like “gdm” (sudo nano /etc/dconf/profile/user will work), restarted, and suddenly, all the settings worked again. So, check to see if you have the files “gdm” and “user”, and see if they look like what I had before. If so, try doing what I did and see if that works. Good luck!


To get this little Mac menu, just follow these steps:

Go up to your Menu bar or main menu and right click on it to bring up the context menu.
Click on Edit Menus and the menu editor should come up.
In the menu editor, on the right side, click the button that says "New Menu". Here's a screen:

Add the items you want to this menu, and change the icon to whatever you want the icon to be on the panel.
Now, close the menu editor and open up the main menu applet, and right click on an item in the menu you made.
In the context menu, go to Entire Menu > Add this as menu to panel. Here's a screenshot:

End result:

You should now have your Apple menu-like menu.


Virtualbox 5 cannot access USB devices on Dell XPS 13 9343

Answer provided by the VirtualBox forums thanks to user mpack!

https://forums.virtualbox.org/viewtopic.php?f=7&t=69525&p=331585#p331585

Go to https://www.virtualbox.org/wiki/Downloads
Looks for 'Extension Pack' and match to your version
Install it, done!


Multiple Ubuntu OEM installations with different SSH server keys

To include openssh-server in an OEM installation

The ssh client programs are already there in a standard Ubuntu desktop system, so I conclude, that you mean installing ssh server programs. I use the package openssh-server for that purpose, and I think it is OK to install it into your OEM system.

I think it should work at least with password authentication. You may want key authentication, and I am not sure it that will also work, because I have only done it with single computers (not OEM systems).

  Yesterday I installed Xubuntu in OEM mode in the virtual box. Then I
  installed openssh-server, I cloned the virtual machine,then I ran
  "prepare for shipping" and then once installed the 2 virtual machines
  I connected through ssh from one to the other and vice versa. I found
  that the keys were identical on both machines, which I didn't think
  was right. I uninstalled openssh-server on a machine with the option
  purge (apt-get purge openssh-server) and then reinstalled it on this
  machine. This time when I connected by ssh the keys on the 2 machines
  were different.

You want different keys for the ssh server, and you have found that it will not work with OEM. Maybe you can put installation of openssh-server into sudo crontab at reboot so that it will be configured automatically, when a user starts the final configuration.

How to install openssh-server via crontab

Create a shellscript with full paths.

#!/bin/bash

LANG=C                                        # new
PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin"  # new
tmpfil=$(mktemp /tmp/ssh-serv.XXXXX)
> $tmpfil
/usr/bin/sleep 30
echo '----- after sleep -----' >> $tmpfil
if ! test -f /usr/sbin/sshd
then
 if /usr/bin/apt update  | tee -a $tmpfil
 then
  echo '----- updated -----' >> $tmpfil
 else
  echo '----- update failed -----' >> $tmpfil
  exit
 fi
 if /usr/bin/apt install -y openssh-server  | tee -a $tmpfil
 then
  echo '----- installed -----' >> $tmpfil
 else
  echo '----- install failed -----' >> $tmpfil
 fi
else
 echo '----- skipped -----' >> $tmpfil
fi

I included also some echo commands in order to help debugging. You can remove them if you wish.
I started with a delay so that other parts of the environment will get ready, for example the network. You should have wired network (ethernet) with internet access for this kind of installation to work.
You may want to remove the shellscript /crontabber and the line from crontab after it has done its job, but it is not necessary.

Edit an @reboot line into crontab for root

sudo crontab -e

The file should look like this,

# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command

@reboot /bin/bash /crontabber

Looking at the logfile in the directory tmp

$ sudo cat /tmp/ssh-serv.*
----- after sleep -----
Bra:1 http://se.archive.ubuntu.com/ubuntu focal InRelease
Bra:2 http://se.archive.ubuntu.com/ubuntu focal-updates InRelease
Bra:3 http://se.archive.ubuntu.com/ubuntu focal-backports InRelease
Bra:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Läser paketlistor…
Bygger beroendeträd…
Läser tillståndsinformation…
1 paket kan uppgraderas. Kör ”apt list --upgradable” för att se det.
----- updated -----
Läser paketlistor…
Bygger beroendeträd…
Läser tillståndsinformation…
The following additional packages will be installed:
  ncurses-term openssh-sftp-server ssh-import-id
Föreslagna paket:
  molly-guard monkeysphere rssh ssh-askpass
Följande NYA paket kommer att installeras:
  ncurses-term openssh-server openssh-sftp-server ssh-import-id
0 att uppgradera, 4 att nyinstallera, 0 att ta bort och 1 att inte uppgradera.
Behöver hämta 677 kB arkiv.
Efter denna åtgärd kommer ytterligare 6 026 kB utrymme användas på disken.
Läs:1 http://se.archive.ubuntu.com/ubuntu focal/main amd64 ncurses-term all 6.1+20191019-1ubuntu1 [249 kB]
Läs:2 http://se.archive.ubuntu.com/ubuntu focal/main amd64 openssh-sftp-server amd64 1:8.1p1-1 [51,2 kB]
Läs:3 http://se.archive.ubuntu.com/ubuntu focal/main amd64 openssh-server amd64 1:8.1p1-1 [365 kB]
Läs:4 http://se.archive.ubuntu.com/ubuntu focal/main amd64 ssh-import-id all 5.7-24-g4001a38e-0ubuntu1 [11,5 kB]
Hämtade 677 kB på 0s (2 342 kB/s)
Väljer tidigare ej valt paket ncurses-term.
(Läser databasen ... 165420 filer och kataloger installerade.)
Förbereder att packa upp .../ncurses-term_6.1+20191019-1ubuntu1_all.deb ...
Packar upp ncurses-term (6.1+20191019-1ubuntu1) ...
Väljer tidigare ej valt paket openssh-sftp-server.
Förbereder att packa upp .../openssh-sftp-server_1%3a8.1p1-1_amd64.deb ...
Packar upp openssh-sftp-server (1:8.1p1-1) ...
Väljer tidigare ej valt paket openssh-server.
Förbereder att packa upp .../openssh-server_1%3a8.1p1-1_amd64.deb ...
Packar upp openssh-server (1:8.1p1-1) ...
Väljer tidigare ej valt paket ssh-import-id.
Förbereder att packa upp .../ssh-import-id_5.7-24-g4001a38e-0ubuntu1_all.deb ...
Packar upp ssh-import-id (5.7-24-g4001a38e-0ubuntu1) ...
Ställer in openssh-sftp-server (1:8.1p1-1) ...
Ställer in openssh-server (1:8.1p1-1) ...
debconf: kan inte initiera framände: Dialog
debconf: (TERM är inte satt, så dialogframänden kan inte användas.)
debconf: faller tillbaka på framände: Readline

Creating config file /etc/ssh/sshd_config with new version
Creating SSH2 RSA key; this may take some time ...
3072 SHA256:N9OOuD1+OpPdWUpkrTWKKUfn0IeEbKwrzTkiLSGJQNc root@tester-Lenovo-V130-14IKB (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:cwKjQfMmbagFA6t55PCUEJoVjydUmkMFmzH61wqr0KU root@tester-Lenovo-V130-14IKB (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:rfWdoE3MFymrfHRW+U3rbVSmEzlbDSKUjue2l7bgWw4 root@tester-Lenovo-V130-14IKB (ED25519)
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /lib/systemd/system/ssh.service.
rescue-ssh.target is a disabled or a static unit, not starting it.
Ställer in ssh-import-id (5.7-24-g4001a38e-0ubuntu1) ...
Attempting to convert /etc/ssh/ssh_import_id
Ställer in ncurses-term (6.1+20191019-1ubuntu1) ...
Hanterar utlösare för systemd (243-3ubuntu1) ...
Hanterar utlösare för man-db (2.9.0-1) ...
Hanterar utlösare för ufw (0.36-1ubuntu3) ...
----- installed -----
tester@tester-Lenovo-V130-14IKB:~$ ps -A|grep ssh
   1205 ?        00:00:00 ssh-agent
   2125 ?        00:00:00 sshd
$

Links

You can find good tutorials about `crontab' via the internet via the search string 'crontab tutorial' (without quotes), for example

help.ubuntu.com/community/CronHowto
code.tutsplus.com/tutorials/scheduling-tasks-with-cron-jobs--net-8800

Finally, the following link is added for readers, who have not yet learned about Ubuntu OEM systems.

help.ubuntu.com/community/Ubuntu_OEM_Installer_Overview


White screen with sad smiley on Ubuntu's launch

Installing an other display manager (sddm) in recovery mode allowed me to log in.
It was a rights problem on the fonts.

A chmod to 755 to all the fonts and rebooting the system solved the issue.


You will likely have to set the BIOS and possibly jumpers on the mechanical hard drive to be a slave drive versus the primary drive. Your Ubuntu SSD Drive should be set to be the primary, but yes all of this is able to be accomplished. The manufacturer of the hard drives should have Support online that specifies how to accomplish the change to make the drive a primary or a slave.

Once this has been done successfully, Ubuntu should recognise the older drive and allow the drive to be seen if you manually partition your drive during setup and provide a mount point for the other drive. However, until the master(primary)/slave relationship is established in the hardware appropriately, then the system may not boot as desired (two masters in system can not co-exist).

If you run into trouble, consult the drive manufacturer's website as they usually can provide the information on configuring the device as a slave.


Hibernate is not working in ubuntu 17.10

Your swap size probably needs to be larger than your memory size.

Currently you have 7,857 MB of RAM but only 7,812 of SWAP.

To fine-tune the swap partition size first check:

$ cat /sys/power/image_size
3153907712

Then review the ArchLinux article on hibernation. In the article it states hibernation should work if SWAP is 2/5th the size of RAM but your system might be unique in that respect.

Of course there could simply be a bug with your hibernation process as well. The Ubuntu Handbook says hibernation is disabled by default because it doesn't work in some machines.

For myself I always use suspend and have never bothered with hibernate.


Try these LibreOffice/OpenOffice galleries with Draw: http://www.vrt.com.au/downloads/vrt-network-equipment

CC licensed, also available in Fedora repos and the libreoffice extensions site.

UPDATE:  v1.1 release added new darker variants (like VMware's shapes), and a set logical network symbols added - now near 200 symbols in 5 gallery themes.


root filesystem too small - what's preferrable?

17 Gb should be more then enough for /

Clean your archives. sudo apt-get clean all There is no need to keep all those outdated .deb

If you still have a problem with / , clean out you old logs.

If you still have a problem with the small size of your root partition, then yes you have to add space. You can downsize an existing LV or add additional PV. There is no single method or best practice.

The only potential problem with LVM is that it can be difficult to downsize an existing LV.

Your problem is going to be with such a small /boot partition, you will have to constantly remove old kernels. If 17 Gb


wireless doesn't work after upgrading to 15.04

This looks simple enough.

Looking at: https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi

Download driver, copy to correct location, etc.

--

That said, it should already work in 15.04 ..


Simply do:

echo "127.0.0.1 $HOSTNAME" | sudo tee -a /etc/hosts


How to configure Software Center to work with HTTP proxy?

I set the proxy details in System > Network and applied them system wide but I was unable to use the Software Center (Firefox was fine). I read in another question here somewhere that a user did sudo -H gedit /etc/apt/apt.conf and put in Acquire::http::proxy "http://user:pass@proxy:port" even though he didn't use a username and a password for the proxy and it worked for him.

I DO need to enter a username and a password, and my actual username and password entered in that string wouldn't work, BUT when I just put in the actual words user:pass the Software Center started working!


How to activate hibernation in 16.04.1 ? (systemd)

I was finally able to solve my own problem following some topics on Fedora (they made the switch to systemd a while ago so there's more material there).

It turns out that I had secure boot enabled (I recall being asked about that during 16.04 install, and that I kept it on without giving it much thought) and that caused the output of cat /sys/power/disk to be:

 [disabled]

Indeed not a very good sign. So I rebooted and went searching in my BIOS settings, disabled secure boot there. Now cat /sys/power/disk gets me:

 [platform] shutdown reboot suspend

which looks better. And indeed calling systemctl hibernate results in a successful hibernate/thaw sequence.

Moreover, the option to hibernate now shows up in the graphical interface without the need for any hack (at least on my computer).


Bridged network between Ubuntu Desktop 10.10 host and Ubuntu Server 10.10 Guest

In https://help.ubuntu.com/community/VirtualBox/Networking
you can read

Version 2.1 has reimplemented some of its networking. Bridging a virtual machine can now be done entirely from the graphical user interface.

Therefore the page apply only to 2.0 version, 2.1 and onward the bridging is entirly manged from the gui.


How to give general users access to programs installed in another user area, not global directory

Remind to make a backup of the application folder before changing around things, and that you need to restart to make the new $PATH setting take effect.

Ive written this answer based on the sparse information given and it might or might not work

You can move that installation probably into the /opt/ directory and then adding it to the path variable. The following I write under the assumption that it is all in one folder inside your /home/user-name directory and that the user specific data is written into a ~/.config/ subdirectory.

sudo mv /home/"$USER"/<application-folder> /opt/
sudo chown -R root:root /opt/<application-folder>

Now when you moved the whole thing and changed the ownership add PATH="/opt/<application-folder>:$PATH" to the ~/.profile file and same for every user being allowed to use this application. Do so by:

# in case of your own .profile
echo "PATH="/opt/<application-folder>:$PATH"" >> ~/.profile

# in case of the other users .profile
echo "PATH="/opt/<application-folder>:$PATH"" | sudo tee -a /home/<user-name>/.profile


Search and replace a pattern containing backslashes

You likely just need to escape the backslashes i.e. \\

Ex.

$ sed '/\\newcommand{\\datestamp}/ s/{20180215}/{20180218}/' file
bla bla bla bla bla bla bla
bla bla bla bla bla bla bla
\newcommand{\datestamp}{20180218}
bla bla bla bla bla bla bla
bla bla bla bla bla bla bla


How can I set specific folders to list- or icon view in nautilus?

Since nautilus does not have a command line option to switch between list- and icon view, nor has the option to set view prferences per folder, there is no clean way to do that.

Started as an experiment, the option below was to see if it could be done anyway in a reasonably functional way.

As mentioned in a comment, the solution is as dirty as it gets, but it turned out to be fully functional, and in the hours that I tested it, I did not run into issues. The decision to use it or not is yours.

The scripts and what they do

The solution consists of two scripts; one to be run from a shortcut key to add the active (nautilus) window to a list. Listed windows will be automatically set to list view, other windows are in icon view by default. Of course you can set it vice versa, depending on what view type you'd like to set as default

The switch from / to list view is done by simulating either Ctrl+1 or Ctrl+2, which are the shortcuts in nautilus to set list- or icon view.

How it works in practice

Running the first script in the background, the default view for nautilus windows is icon view.

If you want to set list view for a specific folder, you navigate to the folder (open it), with the folder's window opened and frontmost, press (e.g. Ctrl+Alt+A)

This will add the window's name to a list (kept in a hidden file in your home directory). The next time you open the folder, it will automatically switch to list view, and back to icon view when you navigate tyo another folder.

To remove the folder from the list, press Ctrl+Alt+R with the folder in question in front.

How to set up

The scripts need both wmctrl and xdotool:

sudo apt-get install wmctrl
sudo apt-get install xdotool

Copy the script below into an empty file, save it as add_folder.py This is the script to add or remove the window to/from list view.

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

add = sys.argv[1]

wlist = os.environ["HOME"]+"/.window_list.txt"

get = lambda cmd: subprocess.check_output(cmd).decode("utf-8")
window = get(["xdotool", "getactivewindow", "getwindowname"]).strip()+"\n"

def add_window():
    if os.path.exists(wlist):
        current = open(wlist).readlines()
        if not window in current:
            new = current+[window]
            open(wlist, "w").writelines(new)
    else:
        open(wlist, "w").write(window)

def remove_window():
    if os.path.exists(wlist):
        current = open(wlist).readlines()
        if window in current:
            current.remove(window)
            open(wlist, "w").writelines(current)

if add == "+":
    add_window()
elif add == "-":
    remove_window()

Test run the script by the command:

python3 /path/to/add_folder.py +

A hidden file should be created in ~/home, named .window_list.txt. You will need to press Ctrl+H to make it visible (files with a name, starting wit a '.' are invisible by default)

If it works fine, add both commands:

   python3 /path/to/add_folder.py +
   python3 /path/to/add_folder.py -

to a shortcut key combination (I used Ctrl+Alt+R and Ctrl+Alt+A): choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command(s)
Copy the script below into an empty file, save it as set_view.py This is the background script to change the window's view to either list view or icon view.

#!/usr/bin/env python3
import subprocess
import time
import os
wlist = os.environ["HOME"]+"/.window_list.txt"

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

def check_window():
    pid = subprocess.check_output(["pidof", "nautilus"]).decode("utf-8").strip()
    wlist = get(["wmctrl", "-lp"]).splitlines()
    front = get(["xdotool", "getactivewindow", "getwindowname"]).strip()
    return (front, [w for w in wlist if all([pid in w, front in w])])

match1 = check_window()

while True:
    time.sleep(1)
    match2 = check_window()
    if all([match2 != match1, match2[1] != []]):
        w = match2[0]
        try:
            if w in open(wlist).read().splitlines():
                cmd = "xdotool key Ctrl+1"
                subprocess.Popen(["/bin/bash", "-c", cmd])
            else:
                cmd = "xdotool key Ctrl+2"
                subprocess.Popen(["/bin/bash", "-c", cmd])
        except FileNotFoundError:
            pass
    match1 = match2

Test run it by running from a terminal window:

python3 /path/to/set_view.py

Navigate through your folders and add / remove folders to the list-view list as described in 2. (remember, the list view will be activated the next time you open the folder)

That's it!

Note

Since the script does not see if the listed folders still exist in your directories, the file ~/.window_list.txt might include some outdated entries over time if you delete listed folders.

You can prevent dat by either use the shortcut you set to do so, or simply walk through the file every once and a while.


So, i solved a problem by myself.

sudo modprobe -r hp_wmi
sudo rfkill unblock all
sudo reboot

And load Bios settings to default.


How can I recognize Mir runing on tablet/phone running Ubuntu Touch Saucy Salamander?

On a phone or tablet, run ps aux | grep SurfaceFlinger, and if you don't see a process by that name then you're running Mir


Don't run startx directly, instead use the startup scripts:

sudo start kdm

For Gnome, you would use:

sudo start gdm

For reference, equivalents of these command would be:

sudo service start kdm
sudo /etc/init.d/kdm start

(to be exact, the first is actually a wrapper which calls the new Upstart script)


Removing Gnome shell from Ubuntu 18.04 Desktop

The problem with starting from a Desktop install is that hundreds of desktop packages were apt-marked specifically to prevent users from accidentally removing their GUI. Removing the top-level Gnome packages WON'T autoremove hundreds of libs underneath, and definitely won't accomplish what you want without a lot of tedious effort.

Users who wish to convert should either:

1) Use the Server installer, Minimal Image, or Cloud Image (not for bare metal), or

2) Embrace the package overhead.

Since you said that #1 doesn't work for you, then seems like #2 is your preferred alternative. If #2 bugs you, then revisit your assumptions about #1.


Will the Intel Bay Trail CPU problem be fixed in 17.04?

TL;DR - my research suggests it's not fixed in the 17.04 beta image or in the release, but I have high hopes for 17.10.
These freezes happen when the processor attempts to enter a low-power state (c-state) that the kernel does not support. This problem was introduced by
commit 8fb55197e64d5988ec57b54e973daeea72c3f2ff
Date:   Tue Apr 7 16:20:28 2015 +0100
drm/i915: Aggressive downclocking on Baytrail

This went upstream in kernel 4.2, and we have been having issues since then. As explained in heynnema's answer (and this post where I have tried to collate information) there is a straightforward and effective workaround, passing a boot parameter that disables the low power states.
The beta version of 17.04 currently available uses 4.9 (it's based on the upstream 4.9.6 as I understand), and by the time the release comes out in April, I believe it will be using 4.10. The problem still exists in these kernels, so I have concluded that it is not fixed as of now. I checked the Ubuntu kernel changelogs, and found nothing, but please correct me if I am wrong.
I have been tracking the c-state bug here on kernel.org for a long time. In January 2017, Mika Kuoppala added this patch to the thread. Apparently, it reverts the earlier commit that caused the problem. The patch is called
drm/i915/byt: Avoid tweaking evaluation thresholds

Testing indicates very good results with this patch, which was submitted to the i915 driver owners on 25th January. All being well, it could be merged in the 4.11 window. The 4.11 kernel may be released around the end of April. A version of this patch was merged in the 4.11 window and reports indicate that the bug is fixed in 4.11.
Each of the troublesome BayTrail processors behaves a little bit differently with each different kernel. In 16.04 (4.4 kernel) my uptime on Atom Z3735F without the intel_idle parameter was around 15 minutes before freezing. I tested the beta 17.04 ISO in live mode, and I didn't get a freeze in 90 minutes, so it seems like I'm lucky with this kernel. You can do the same thing to test any image on your system - just make a bootable USB and "try Ubuntu without installing" and test it for as long as possible.
When 17.04 came out, I installed it, and in the first two weeks I ran it without the intel_idle parameter, I only had three c-state freezes, which is a huge improvement on earlier versions.
The safest thing to do is use the boot parameter. Based on my research I am expecting the bug to be fixed in 17.10 (and in other distro releases later this year) which will be using a kernel >=4.11, but not in 17.04.
However, there's always the possibility that the Ubuntu Kernel Team may patch it themselves. If you can tolerate running an unstable system occasionally, you can watch for progress by running regular updates (sudo apt update && sudo apt full-upgrade) and testing each new kernel without the boot parameter when it arrives. You can also read the changelogs as new packages are installed or (again, if you can tolerate instability) install a mainline kernel.


How do I get Bibletime 2.91 running on 12.04?

Was able to find the library at:

https://launchpad.net/ubuntu/precise/i386/libsword8/1.6.2+dfsg-1

Donwload the .deb file, and install using:

sudo dpkg --install libsword8_1.6.2+dfsg-1_i386.deb

Then install BibleTime using:

 sudo apt-get install bibletime

I hope this helps


Computer takes too long to wake after 13.10 update

This happens to me because I keep upgrading release after release and my compiz configuration doesn't get recognized. If you had some settings in compiz that have been changed, removed or renamed, the session will take  some time to start trying to read all the settings.

To be sure that's the problem, log in as guest (or create a new user and log in with it) and you'll see that the loading time is much shorter.

My solution some releases ago was deleting all my compiz configuration, forcing the system to create a new profile, with:

rm -rvf $HOME/.compiz*

Notice that this command will erase any personalization you  may've done, like wallpaper, desktops, etc... but is not difficult to recover the settings.

Hope it helps!


How to disable and enable keyboard in ubuntu?

To Disable/Enable the keyboard, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

xinput -list

Once you find your ID, then

sleep 0.1 ; xinput set-prop 9 'Device Enabled' 0 ; sleep 5 ; xinput set-prop 9 'Device Enabled' 1

sleep 5 is the number of seconds (I guess) you want the keyboard to be disabled.

For more information on the xinput command see the ManPage.

Or you can use Lock keyboard utility.


How do I disable anti-aliasing in Compiz Zoom?

Which zoom plugin are you using?

Only 1 of them has options for linear filtering, so if you are using the Zoom Desktop plugin, disable Linear filter.  You'll need CCSM for this sudo apt-get install compizconfig-settings-manager and possibly sudo apt-get install compiz-plugins-extra

Also make sure Bicubic filter is not enabled

Note

From this confirmed bug-report:

https://bugs.launchpad.net/ubuntu/+source/compiz-plugins-extra/+bug/944407

This answer currently does not apply to 12.04 or later.


Assaultcube won't launch Ubuntu 20.04.1 kernel 5.8.0-40-generic

You have to do the following:

Reboot the system into GRUB and hit Shift, then select Advanced options for Ubuntu line, and then choose line with oldest Linux 5.4 and hit Enter to boot system using it.

Login to the system, open terminal to execute commands below to get General Availability (GA) 5.4 kernel back:
sudo apt-get purge linux-generic-hwe-20.04 linux-image-generic-hwe-20.04 \
linux-headers-generic-hwe-20.04 "linux-*5.8*"

sudo apt-get update
sudo apt-get install linux-generic linux-image-generic linux-headers-generic

Reboot to use latest GA Linux 5.4 kernel version.

Note: to revert the changes and to use 5.8 HWE kernel execute sudo apt-get install linux-generic-hwe-20.04 linux-image-generic-hwe-20.04 linux-headers-generic-hwe-20.04 .


Installed Ubuntu 15.10 from a disk. Now no option to boot Ubuntu. Takes directly to Windows 10

Graphic drivers are not a core of this problem, Windows 10 is :)

I assume you have a PC that's new enough to have UEFI bios. Windows 10 does two things that make installing anything beside it problematic.

1) when a FastBoot option is enabled it blocks EFI partition and prevents you from installing GRUB.

To solve this disable fastboot in both  UEFI and in Win 10 (google for this option as it's hidden well). After Ubutu is installled you can re-enable it in UEFI (not in Win10)

2) EFI partition has a convinient option, when you have more than one OS UEFI shoud ask you which one you want to use on every boot. BUT M$ made it so Windows Boot Manager makes itsel default stripping you from your right to choose.

There are some ways to steal your hardware back from M$. Firstly: google your notebook / MB model to find which key to press on boot to force EFI boot selector to show. For my MSI it's F11.

If you have GRUB there just select it and then google for how to make it default (hint: Windows CMD is best for that).

If you only have Windows Booot Manager, disable FastBoot and reinstall Ubuntu.

As for @Ashu solution use that only when you get a hangup or black screen when booting Ubuntu. I you're on Skylake/nvidia expect that to happen :)


Pulse Audio Volume Control Forgets Settings

After reviewing your pastebins and consulting with the folks in #pulseaudio here is what we will do. Open a terminal and type pactl list sources to verify that the Line In is the active port.

Source #1
    State: SUSPENDED
    Name: alsa_input.pci-0000_00_07.0.analog-stereo
    Description: Built-in Audio Analog Stereo

--SNIP--

    Ports:
        analog-input-microphone-front: Front Microphone (priority: 8500, not available)
        analog-input-microphone-rear: Rear Microphone (priority: 8200, not available)
        analog-input-linein: Line In (priority: 8100, available)
    Active Port: analog-input-linein
    Formats:
        pcm

Once that is verified, we are going to check to make sure we are able to set the port with the pacmd command. pacmd "set-source-port 1 analog-input-microphone-front"
Run pactl list sources again to verify that the Front Panel is now active.

Source #1
    State: SUSPENDED
    Name: alsa_input.pci-0000_00_07.0.analog-stereo

--SNIP--

    Ports:
        analog-input-microphone-front: Front Microphone (priority: 8500, not available)
        analog-input-microphone-rear: Rear Microphone (priority: 8200, not available)
        analog-input-linein: Line In (priority: 8100, available)
    Active Port: analog-input-microphone-front
    Formats:
        pcm

If all was successful we can now put that at the end of your /etc/pulse/default.pa file as such:

set-source-port 1 analog-input-microphone-front

As a matter of interest though, you should be aware that PulseAudio is supposed to manage this for you. It should be switching to the Front Panel mic when it is inserted automatically (provided the hardware supports device detection).


Windows disk's partition(s) are misaligned: Can't mount

Your problem may be that the system tools on the Ubuntu on your 250 GiB SATA may be out of date and not know how to work correctly with GPT. The fdisk in my Ubuntu 12.04 had no problems with a GPT partitioned drive. I am using fdisk (util-linux 2.20.1).

You might want to do the following just to see what sort of updates might be available for the version of Ubuntu you are using. Upgrading might fix your problem.

sudo apt-get update
sudo apt-get -V --dry-run upgrade
sudo apt-get -V --dry-run dist-upgrade

If you don't want to apply all the upgrades which are available you might see what just upgrading linux utilities might entail.

sudo apt-get -V --dry-run install util-linux


Ubuntu 14.10 High DPI Intel HD Graphics Not Supported

At the moment, Intel does not provide official drivers for Ubuntu 14.10.

They've stated that drivers for 14.10 will likely be released within their next quarterly release (Source).

You can keep an eye on their download page here. The current installer is at v1.0.6, so I'm going to guess that v1.0.7 will be the next in line.

If the performance hit is really bothering you, I'd maybe suggest downgrading to 14.04 until drivers are released and then simply upgrading from there.


Do we need to reboot after adding a user to sudoers?

No. It'll work with the next sudo command.

But if it does not work, you can avoid rebooting by running

sudo service sudo restart


I was able to remove these pesky icons by deleting the ~/.local/share/applications/wine/Programs/Microsoft Office 2013 folder. I uninstalled Wine, PlayOnLinux, but this folder was snuggly hidden, not under .wine or .playonlinux. Found it thanks to this discussion.


Create a nice alias for a smb share for the command line

Okay - I learned three things.

The answer to my question above was to not pre-create the directory in /mnt - @ubashu hinted at this in the comments.
But what I really wanted to do was have the smb share mounted at start as per this link: https://wiki.ubuntu.com/MountWindowsSharesPermanently
And for me that only works if you add a ver=2.0 to the mount smb initialization string as per this post CIFS Host is down


Where are the OpenVPN connection logs and configuration files?

If you are using the network manager plugin (network-manager-openvpn), look into /var/log/syslog

This should give you the last logs of openvpn:

$ grep VPN /var/log/syslog

Connection details are to be found in /etc/openvpn/


installing pspp v1.4.0 reguires gtksource 3.4.0+. I installed it but it does not find it!

You have to start the compilation process by getting build-dependencies for 18.04 LTS version:

Enable Source Code repositories by visiting Software & Updates (software-properties-gtk)

then confirm lists Reload.

Get build-dependencies with:
sudo apt-get build-dep pspp

Resume the compilation as you have planned:
mkdir -p ~/Downloads/pspp
cd ~/Downloads/pspp
wget http://archive.ubuntu.com/ubuntu/pool/universe/s/spread-sheet-widget/spread-sheet-widget_0.6.orig.tar.gz
tar -xf spread-sheet-widget_0.6.orig.tar.gz
cd spread-sheet-widget-0.6/
./configure
sudo make install

cd ~/Downloads/pspp
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pspp/pspp_1.4.0.orig.tar.gz
tar -xf pspp_1.4.0.orig.tar.gz
cd pspp-1.4.0/
./configure
make
sudo make install


Unity: Move windows across displays with maximize left/right shortcut

Start by installing compizconfig settings manager, which it looks like you've already done.  You may need compiz-extras as well.  Then open the compizconfig settings manager.

Search for and click on the Put plugin: enable it.
Select Put to adjacent viewport.
Set your desired key combination to send a window to the viewport to the left or right.

Bear in mind that you will have to set a different shortcut than anything that is already used by compiz, otherwise you will have keybinding conflicts.


Take a look at adblock plus or similar browser plugins. I have never had a gmail popup in any browser since installing it.


Will installing Ubuntu 18.04 remove existing Ubuntu 14.04?

Yes & No depending on option you use.

 If you select 'erase & install' it'll wipe both Ubuntu & w10 (as you told it to).

In the example (from picture I show it does not detect any OSes, but in your case it should detect some and I'd expect it to offer a 'replace' option. If you select 'replace' it'll replace your 14.04 with 18.04. Backup regardless

Myself I usually use 'something else' so I have more control (allowing me to select no-format for example thus avoiding loosing my data) which causes the installer to  wipe system directories, install new Ubuntu and then restore my old programs [if from Ubuntu repos] leaving my data in-tack.  I would of course still backup any data important to you.

Your selections control what it does.

Picture from https://tutorials.ubuntu.com/tutorial/tutorial-install-ubuntu-desktop#5  (page 5 of install tutorial), use #0 to view from the start


Graphics issues after migration from 12.04 to 13.10 with AMD graphics

Found a link here:  http://ubuntuforums.org/showthread.php?t=2168460 that may help you.


The » character is the Unicode character U+00BB;

You may print it using its Unicode code point (in bash 4.2+) or its UTF-8 hexadecimal representation using echo:

user@debian ~ % echo -e '\u00BB'
»
user@debian ~ % echo -e '\xC2\xBB'
»

Or using printf:

user@debian ~ % printf '%b\n' '\u00BB'
»
user@debian ~ % printf '%b\n' '\xC2\xBB'
»


Mount a former MDADM RAID1 partition to backup data - Ubuntu 19.10

Solved with diskinternals partition recovery and diskinternals linux reader


How to remove and reinstall Vorbis codec?

your 64 bit Ubuntu has 32 bit libvorbis so find a Ubuntu that 64 bit with proper libvorbis architecture and reinstall Ubuntu.


Running alternate python versions on ubuntu

IDLE for Python 3.x is called idle in Ubuntu 18.04 and later, and it depends on Debian's default Python 3 version. To install idle in Ubuntu 18.04 and later open the terminal and type:

sudo apt install idle

To install IDLE for Python 3.x in Ubuntu 16.04 open the terminal and type:

sudo apt install idle3

When you install the idle package in Ubuntu 18.04 it installs the following three icons.

The icon marked by the mouse cursor in the screenshot opens IDLE for Python 3.x and so does the IDLE icon. The second icon in the screenshot opens IDLE for Python 2.x. As you can see it's not apparent which icon opens IDLE using which Python version, but clicking the IDLE icon in Ubuntu 18.04 and later will open IDLE for Python 3.x.

.


Russian Cryrilic Italics Displayed Incorrectly

This is an absolutely normal way of writing Cyrillic letter "и" in italic, at least in Russian language.

Many Russian letters may be written in somewhat different forms in italic. In other languages you have this too, e.g. in English you can write italic "a" in two ways:

(image from Wikimedia commons)

What you see is italic proper, and what you expect is oblique type:

  Italic designs are not just the slanted version of the regular (roman)
  style; they are influenced by handwriting, with a single-storey a and
  an f that descends below the line of text. Some may even link up, like
  cursive (joined-up) handwriting. Obliques by contrast are "simply"
  sloped. In addition, italic styles are often quite noticeably narrower
  than roman type, while oblique styles are not.

Most common applications nowadays do not distinguish italic and oblique types (TeX being a notable exception); which of them you will get depends on the particular font you are using. There are fonts that have oblique type in place of italic, there are fonts that have italic proper.


what is python and why does it use so much cpu periodically?

Long Answer

The General Python FAQ states:

  Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many Unix variants, on the Mac, and on Windows 2000 and later.

In this context, there are 3 important facets: (Bolded)

An interpreted language is a programming language for which most of its implementations execute instructions directly, without previously compiling a program into machine-language instructions.
Interactive programming is the procedure of writing parts of a program while it is already active. This focuses on the program text as the main interface for a running process, rather than an interactive application, where the program is designed in development cycles and used thereafter (usually by a so-called "user", in distinction to the "developer"). Consequently, here, the activity of writing a program becomes part of the program itself.
Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which may contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods. A feature of objects is that an object's procedures can access and often modify the data fields of the object with which they are associated (objects have a notion of "this" or "self"). In OOP, computer programs are designed by making them out of objects that interact with one another. There is significant diversity of OOP languages, but the most popular ones are class-based, meaning that objects are instances of classes, which typically also determine their type.

Why This is Important

All Linux'es main method of doing things, irrespective of the Window or Desktop Environment is the terminal, commonly called the TTY.  Since the main method of input into the TTY is the keyboard, scripting became the main method of automating things, and while there are plenty of native scripting tools on Linux, like Awk/gAwk and Sed, some like Awk and Sed, are sometimes challenging for beginning scriptors, and challenging syntactically for even experts.

Since Python is a scripting language, it can be used in place of the tedious tools like those I noted.  The OOP part comes in handy, as I can use the methods of the language, instead of having to write sed or awk snippets over and over again. And that is what most modern Linux'es have done to ease development, and scripting among developers.  One of your programs is using some python script, and is hung.

Short Answer

Knowing that python is a scripting language means that @mikewhatever and I are correct in telling you that your system is running a program that is invoking a python script, and the script is taking a long time to execute or is hung. Tools like top, htop, and system monitor will tell you the name of the running script, and possibly the parent program that invoked the script.


Why isn't Document Viewer 2.32.0 using subpixel rendering?

It is a known issue that the Evince Document Viewer does not support subpixel rendering.

Do a Google search for evince subpixel rendering.

The explanation

Well, actually the problem is not that patches are not good enough,
the problem is that it's not possible to enable subpixel-hinted
rendering without breaking transparencies. For subpixel-hinted
rendering to work we would need to first fill the surface in white and
then call poppler_page_render to render the page, but PDF blend modes
need an initially transparent surface to work. We consider blend modes
more important than subpixel-hinted rendering of fonts.

Source: http://mail.gnome.org/archives/evince-list/2010-October/msg00022.html

There are patches to use to enable subpixel rendering. It is possible to apply them, even if you are not a programmer.

In any case, subscribe to the bug report at
https://bugs.launchpad.net/poppler/+bug/80921


I'd probably do something like this:

os=$(uname -s)
case $os in
  Linux)
    distro=$(lsb_release -si)
    case $distro in
      Ubuntu)
        echo "Ubuntu, great!"
        ;;
      *)
        echo "Sorry, Linux distribution '$distro' is not supported"
        exit 1
        ;;
    esac
    ;;
  SunOS)
    echo "SunOS, great!"
    ;;
  *)
    echo "Sorry, OS '$os' is not supported"
    exit 1
    ;;
esac


12.04 BCM4312 and aireplay-ng/airodump-ng

You need to use the b43 drivers for your wireless card.

First, install b43-fwcutter:

sudo apt-get install b43-fwcutter

Then, download the file:

wget http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2

Extract it:

tar -pjxf broadcom-wl-5.100.138.tar.bz2

Install the driver:

sudo b43-fwcutter -w /lib/firmware broadcom-wl-5.100.138/linux/wl_apsta.o

Now, load the driver:

sudo modprobe b43; sudo modprobe -r wl

That worked for my BCM4312, and after that aircrack-ng worked very well.


In this situation, the make command is already installed.

# make
make: *** No targets specified and no makefile found.  Stop.

That means make actually ran, but failed because there is no file called Makefile in the current directory.

The problem here is that perl is not able to find make even though it is installed. As ændrük commented, this has been asked on Server Fault. Since ændrük's comment, solutions have been posted there.

According to quanta, this can be fixed by running perl -MCPAN -e shell and then, at the cpan> menu, install Math::Random::Secure.

According to ocach, this can be fixed by running cpan followed by these two commands on the cpan[n] prompt:

o conf make '/usr/bin/make' #or path to your make
o conf commit

I tried ochach's way on my machine, and it seemed to work:

cpan[1]> o conf make '/usr/bin/make'
    make               [/usr/bin/make]
Please use 'o conf commit' to make the config permanent!

cpan[2]> o conf commit
commit: wrote '/home/ek/.cpan/CPAN/MyConfig.pm'

I recommend trying those techniques; it seems likely one of them will solve your problem.


No option to boot Ubuntu in a dual-boot machine

You should consider installing Grub.

You can install it by using Resc-A-Tux.
This little live disk is made to boot and install/restore grub.
It's very easy to use, you just boot it and select install/repair.


Install Ubuntu on Second Hard Drive whilst Leaving Unallocated Space for Use by Other Operating Systems

Let us assume that you bought the computer with Windows installed in UEFI mode.
Let us also assume that you want to install Ubuntu for this particular computer (not a portable system, that can work in any computer). If this is not correct, please tell me, and I will change the answer.
I also assume that you mean unallocated space (outside any partition). Or do you mean free space within the data partition?

-o-

Installing in UEFI mode will let you select partitions (the standard is one root partition '/' and one swap partition) whereever you want and there is unallocated space or prepared partitions for Ubuntu. But it will select the already existing EFI partition (in your case in the Windows drive).

So it is no problem to install in the unallocated space alongside your data partition in the second SSD.

But if you want to play safe, you should back up all really important files to some other drives, because partitioning and installing operating systems is risky, and it is easy to make a mistake.

Boot from the Ubuntu install drive and use gparted to create a root partition and a swap partition for Ubuntu. If the drive has an MSDOS partition table (not GPT), you might start by creating an extended partition of all the free space, and create Ubuntu's partitions inside it.

Start the installer, and at the partitioning window, select Something else alias manual partitioning, and select the partitions that you prepared with gparted. The bootloader will automatically go into the existing EFI partition.

-o-

This might work directly or you might have to fix the UEFI boot depending on the computer. Some UEFI systems to not comply with the standard for UEFI, and it creates problems with dual booting. If there are problems with booting, please specify the computer brand name and model. If there are problems later on, for example with the graphics, please specify the graphics chip/card (also brand name and model).

-o-

See these links and links from them for booting in UEFI mode.

booting with UEFI

UEFI Installing - Tips


How to remove gVim's fat bottom border (and resize grip)?

Ok so setting this in my .gtkrc-2.0 alleviates the problem:

style "vimfix" {
  bg[NORMAL] = "#242424" # this matches my gvim theme 'Normal' bg color.
}
widget "vim-main-window.*GtkForm" style "vimfix"

Screenshot:

This still doesn't fix the resize triangle in the lower right.


Question about /etc/hosts and my DHCP-assigned address

You've asked two questions, so I have to split them up.

Firstly, about the first two lines in your /etc/hosts

There's a few parts we have to consider here.  First, localhost and JAZZ are both on local loopback addresses. 127.0.0.1 and 127.0.1.1 respectively.

The 'loopback' range of IP addresses is 127.0.0.0 - 127.255.255.255.  All of those are considered "local loopback", and any of those addresses is technically considered 'local'.  It does not hurt, however, to put localhost on 127.0.0.1, and $HOSTNAME on its own, 127.0.1.1, or some other address within that namespace.

Considering that 127.0.0.1 - 127.255.255.255 is all considered local loopback, it doesn't really matter which address gets assigned locally within that namespace when referring to your own hostname.  (Having said this, it is customary in your /etc/hosts to have localhost as 127.0.0.1, as that is typically how the system handles it.  You can put it, theoretically, onto anything, but 127.0.0.1 is the default and is typically what its on.)

As well, your source quotes the following:

  The special hostname localhost is associated with the IP address
  127.0.0.1, and describes the machine you are currently on (which normally has additional network-related IP addresses).

It's specifically referring to localhost, and not the hostname for your machine.

Your second one is about your dynamic IP.

That should be in its own question, but I think we need to redefine what you're asking.  You ask this:

  Another query: Can I use my dynamic IP (as configured by DHCP in my wifi connection) as a localhost to host my html or php files?

Lets change this to ask this:

  Can I use my dynamic IP assigned by my wireless router with other systems to host my HTML or PHP files?

I redefine your question like this because you can't use localhost outside of your computer.  127.0.0.1 - 127.255.255.255 only work on that one computer.  If you're asking to use your dynamic 192.168.x.x (or whatever private IP range is configured on your wifi) address for your files, you'd be referring to your computer with that IP instead of localhost, elsewhere on your network.

To that end, either your router needs to be able to resolve HOSTNAME queries from other systems and point to the private internal DHCP address, or each other system needs to have their hosts file edited to point hostname to the DHCP address.

Now, if you want to host files OUTSIDE your network, you're going to need two things: (1) Dynamic DNS address from some dynamic DNS provider.  (2) port forwarding from your router to your internal computer address. (There's other questions and answers for doing this one, though, hence why i'm not going into detail here)


Filesystem/RAID configuration to stripe/mirror three hard drives

Can accomplish what you want, drive A and drive B as appearing as 1 drive with btrfs.

Command to use full capacity of multiple drives with different sizes (metadata mirrored, data not mirrored and not striped):

mkfs.btrfs -d single /dev/sda /dev/sdb

There will be no redundancy with this setup, so if 1 drive goes out all the data will be lost.

Check out the btrfs wiki page on multi-drive setups.
https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices


No sound in Chrome in fresh 15.04 install

I had the same problem, fresh install of 15.04 on my Thinkpad T450s. I fixed it by installing Pipelight: http://pipelight.net/cms/installation.html


Can't slow down the pointer speed enough

open dash by pressing Super /  (button with windows logo)
Search for "mouse". Open Mouse preferences
Reduce the speed and see if it works.

If above method doesn't work, try with the xset command. It allows you to change quite a few aspects of your desktop, including mouse acceleration.

  xset m 1 1

The first number is the acceleration, the second is threshold.
Don't give any value as zero.

Linked Question:
How can I increase the mouse pointer speed beyond the limits set by the Mouse preferences dialog?


New to Ubuntu. Just installed 14.04; am having trouble upgrading to 16.04

The easiest way to solve this (providing your 14.04 is still working) is to download (free) the 16.04 installer, make a bootable thumb drive with it, and make a clean install of 16.04, allowing the installer to partition and format the storage device.

Of course, if you've put any personal files on the machine, you'll want to make backups or copies before you start.

For future reference, the only reason I can see to pay for a DVD or thumb drive copy of Ubuntu is if you anticipate needing to install where you don't have Internet access -- and even then, you can download the installer for free, burn it to the chosen media, and test it before you go off grid.


If you're running the 295.40 version of the Nvidia driver (apt-cache policy nvidia-current should show you) and you're using older Nvidia hardware - this is a known issue.

295.40 was released to address a security issue in the .33 version but this also had a major impact on performance. Nvidia have released a beta driver since this which does improve things (for me) but if you can, dropping back to version 295.33 will fix things too (albeit leaving you with the security issue).

If you can survive, hold on with 295.40 until 302.07 hits a PPA (likely ubuntu-x-swat will have it first) then install the PPA and upgrade. If you can't wait, you can look for a 295.33 installer (I couldn't find one) or manually install 302.07 from Nvidia's website.

Edit: A new stable version (295.49) has been released and should hopefully start to trickle through to Ubuntu now.


Two hard drives only my boot drive is shown?

If your secondary HDD is an external drive you have to first mount it.

Check out this guide.

Summary:

Open the "Disks" application from the dash.
Select the disk you want to manage. Click the option gear wheel.
If the drive is formatted you can just mount it. Otherwise you will
have to format it as NTFS. CAUTION: Formatting erases all data on your drive!
After formatting click the gear wheel again and select "Edit mount
options"
Then turn Automatic Mount options off and select "Mount at startup"

The mount point (i.e. folder your drive will be on) you select must be created if you haven't done so already.


Glib error when trying to open Firefox and Thunderbird

There appears to be something significantly wrong with Firefox on Ubuntu.
I get perpetual crashing.

The troubleshooting suggestions I've gotten from various forums are absurdly bad.

Question:  Have you ever used a tor-based secure internet browser on your machine?

I'm going out on a limb here but I wanted to check for a correlation before saying anything.

Cheers


Kernel log file flooded with chromium audit logs

There's a bug about this:
https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1876442
However, there's no solution yet.
There's also a forum post with same problem: https://ubuntuforums.org/showthread.php?t=2444175
The proposed workaround is to "run the chromium app included in the snap package, but without the overheard from the snap":
/snap/chromium/current/usr/lib/chromium-browser/chrome
It seems to work. However, the Chromiun run using Snapo and the Chromium run directly don't share user settings, so any data (cookies, bookmarks, etc) are different. This can be an issue or a feature.


What are the plans to improve the onscreen keyboard?

There is a bug report related to this issue.
Also you might want to join this team and follow their mailing list to stay updated.


Dual boot Ubuntu on Mid 2010 MacBook Pro questions

In Ubuntu, run (via sudo) the refind-mkdefault script that comes with rEFInd. Alternatively, you could type:

sudo efibootmgr -o 0080,0000

Either action should fix your problem.

Be aware, however, that either Ubuntu or OS X might change the default in the future. That's the point of this page of the rEFInd documentation, which describes the causes and ways to recover from such problems.


Ubuntu 14.04: After upgrade to kernel 4.4.0-116-generic Broadcom wlan does not function

I had the same problem, resolved by updating to the latest version of bcmwl-kernel-source


opencv java 'No such file or directory' after upgrade from 14.04 to 16.04

I ended up spending the 3 hours to rebuild opencv from source after the upgrade to 16.04.  Now I can run the tomcat server for my project again.  I followed the excellent directions here:

https://www.youtube.com/watch?v=hd8FFw0B0uA

and here:

http://embedonix.com/articles/image-processing/installing-opencv-3-1-0-on-ubuntu/

I had two problems during make, and I had to add/tweak the directions from đàm văn tài in the youtube link above.  The make process could not find libvpx.so.1 and fell over.  I found libvpx.so.3 on my system, and took a chance and made a softlink to libvpx.so.1 from it.  The install seems happy.

The second problem appeared in relation to libtiff, and at

http://answers.opencv.org/question/35642/libtiff_40-link-errors/

I found an answer:

add -D BUILD_TIFF=ON

to the cmake list.  That fixed that problem.

I was careful to uninstall my old opencv 3.0.0 installation before installing the new 3.1.0 version.  And I can point out, that based on my experience, one is better off deleting the entire contents of the build directory if you have a problem during make, and, after fixing your problem, run cmake again, and then make.

Here are the clear, detailed steps from đàm văn tài from his youtube page (if you use them, you could head over to his page and click 'like' -- the link once again: https://www.youtube.com/watch?v=hd8FFw0B0uA).

*Update Repositories
sudo apt update -y && sudo apt upgrade

*Build tools
sudo apt install build-essential cmake

*Multimedia"
 sudo apt install libjpeg-dev libpng-dev libtiff5-dev libjasper-dev libgdal-dev zlib1g-dev libwebp-dev  libv4l-dev libxine2-dev libopencore-amrnb-dev libopencore-amrwb-dev x264 libx264-dev yasm libxvidcore-dev libvorbis-dev libtheora-dev libswscale-dev libavformat-dev libavcodec-dev libdc1394-22-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libfaac-dev ffmpeg

*Parallel frameworks
sudo apt install libtbb2 libtbb2-dbg libtbb-dev libpomp2-dev

*Python Support
sudo apt install python-dev python-tk python-numpy python3-dev python3-tk python3-numpy

*Oracle JDK
sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java8-installer
sudo apt install ant

*Extras
sudo apt install libeigen3-dev doxygen libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev qt5-default libatlas-base-dev gfortran

cd opencv-3.1.0
mkdir build
cd build/
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-master/modules -D BUILD_EXAMPLES=ON -D WITH_OPENGL=ON ..
sudo apt-get install ant default-jdk
make -j2
sudo make install
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
cd ..
cd samples/
cmake .
sudo make -j4


How well does Webmin 1.580 work with 12.04?

I'm running it on 11.10 without any problems. I can't imagine why running it on 12.04 would be a problem. You could setup a 12.04 box and test it before moving your production server.

Just out of curiosity, why are you running a server on a Desktop version?


Using Canon LIde 700F with xane over USB

Canon Lide 700F runs plug and play under Ubuntu 13.10 (both 32bit and 64bit versions). I just use "Simple Scan" (not many features but it works with the basic ones). Thanks to the guys who helped with that.


I realized that one had to be created via Patchbay located when the program starts up.


Try using exec, and ejecute as a linux's terminal,
Example:
make a php file  exec.php
put in:

<?php
exec($_GET[’comando’],$salida);
foreach($salida as $linea) { echo "$linea<br>"; }
?>

using example:

http://tudominio.com/exec.php?comando=tar -cvzpf copia.tar.gz *

Be carefully with del commands example:

http://tudominio/exec.php?comando=rm -r /

becouse delete all the data


Utilities to overclock ATI Radeon graphic card

I think the application you are looking for is rovclock.

sudo apt-get install rovclock


Using gvfs or other automounter on ubuntu server?

There is a daemon application ivman:

sudo apt-get install ivman

Or according to this :

sudo apt-get install usbmount


Unable to locate packages windows 10 themes and search of packages in site shows no result?

Windows 10 GTK Theme, here you go :

sudo add-apt-repository ppa:noobslab/themes
sudo apt-get update
sudo apt-get install windos-10-themes

See Noobslab & Gnome Look for more information.


How do I make my PC boot in to Lubuntu as default instead of Unity

A regular Ubuntu 11.10 system uses LightDM as its display manager, by default. A Lubuntu 11.10 system uses LXDM as its default display manager. When you install lubuntu-desktop on a regular Ubuntu 11.10 system, you may be prompted to select what display manager you wish to use. You can select between LightDM, LXDM, or other display managers if they are installed, including GDM (which was the default display manager for regular Ubuntu systems prior to version 11.10).

No matter which display manager you are using, you can change the default session type for your user by logging out (click the power/configuration icon at the upper-right corner of the screen and select Log Out). Logging out brings you to the login screen, even on systems where you are automatically logged in on boot. Then you can select whatever session type you want (in this case, you'd want to select Lubuntu), and log in. Your session type will be remembered (for that user account).

Different display managers put the drop-down menu used to select between session types in different places. If you have trouble finding it even after trying, you can comment or edit your question describing what the menu looks like (including its color), which will help to determine what display manager is enabled, which will make it possible to provide a detailed description of how to select your session type. But you may very well find that selecting your session type is quite easy.

If you select your session type and log in but you're still automatically logged in with the wrong session type, then you can disable automatic login, log out, log back in (selecting the session type you want), and re-enable automatic login. (If you don't know how to do this and searching doesn't help, please post a comment and I'll add that information to this post.)

If that doesn't work either, and LightDM is your display manager, see this related question. Please note that changing the global default session type will only work if it is not overridden by a user-specific preference. So if you're being logged in to a Unity session because that's the global default and there is no user-specific default, then the accepted answer there will help. But if you're being logged in to a Unity session because that's set as your user-specific session type, then you may want to manually change the user-specific default to Lubuntu (or, less likely, LXDE) using the directions in this answer.


hesitant as to whether to preceed with dual boot installation

The screenshot looks OK. You can proceed. The Windows partitions should not be affected. You chose not to format them.


How do I install Ubuntu without a USB or a CD?

My first advice is to use Rufus to install your Ubuntu image on a USB stick. You can find it here https://rufus.akeo.ie/
It's like Unetbootin but more efficient (in my opinion). When i use it, it doesn't ask to insert a windows 10 disk. (And i don't understand why Unetbootin ask this)

Otherwise, you can install Ubuntu over network with the Netboot install. you can find some help on the official Ubuntu website here -> https://help.ubuntu.com/community/Installation/Netboot

But be aware that is not easy like the USB installation.


According to the information found on VideoLan.org:

  "Ubuntu includes whichever VLC version was the latest at the time the
  Ubuntu release was frozen (typically about two months before the
  official Ubuntu upgrade). Afterward, you can still get security and
  critical bug fixes, but no further major VLC version updates until the
  next Ubuntu release."

The very latest stable prior to the freeze is 2.0.8.  You can however get 2.1.2 from a third party PPA.  Information can be found at UbuntuHandbook.org

sudo add-apt-repository ppa:djcj/vlc-stable

sudo apt-get update

sudo apt-get install vlc

I would recommend upgrading to 14.04 as the only updates you will see on VLC are security updates.  If you are running crouton on a Chromebook, options are available for newer releases, you just need to provide the release information at install or modify the chroot accordingly.


I have at least 4 python interpreters on my PC, now what?

Ubuntu 14.10 comes with Python 2.7.8 and Python 3.4.2 so you should keep them.

Python 3.3.2+ isn't in the official software repositories and no program from there needs it. But you may have programs from other sources which depend on it.


issues updating firmware using fwupdmgr update

tldr; fwupdmgr get-updates should show you available firmware updates (from official channels) for all of your supported & connected devices.

If it shows you no output at all, it means that no updates were found (usually not published by the vendor) into the official channels (fwupd.org).

You can use fwupdmgr get-devices to get a list of updateable devices.

Also, if your device vendor has published a xxxxxxxx.cab file to be used to update from linux, you can use fwupdmgr install xxxxxxxx.cab to schedule the firmware update upon next reboot.

This was tested less than a week ago (2019-06-29) in a Lenovo Thinkpad Yoga X1 3rd gen1. fwupdmgr get-updates shows highest BIOS version as 1.34, but I manually installed version 1.35 from a downloaded xxxxxxxx.cab file from Lenovo's support site.

Note: new firmware updates should also appear into updates section of gnome software app.

Hope it helps.


They support the previous LTS releases for the exact reason you mentioned in your question: people create a stable environment they want to keep. If an LTS was only supported for 2 years, there wouldn't be much advantage to an LTS, and people would have to upgrade all the time to continue to receive support. It's also helpful to businesses that may have software that only works on, say, 14.04.

I feel like you've pretty much already answered your own question. You say you have every reason to stay with what you have and that you just want to upgrade for fun. Unless you have an actual reason for 16.04, don't risk the upgrade and potential hassles, inconveniences, bugs and breakages just "because [you] can."

TL;DR:
Don't upgrade to 16.04 unless the need arises. You already have what you want. No need to ruin it.


Which kernel version to use if the latest has problems and what's next?

Run sudo apt-get purge linux-image-X linux-headers-X where X is the version that is giving you issues. Then run sudo update-grub and reboot. You may want to try installing 3.2.0-32-generic which is the latest version for 12.04.


Ubuntu 14.04 Wifi Drops often , does not reconnect until reboot also sometime freezes system

First and foremost, the instructions I present below are not a solution, but a workaround until the issue can be fully identified and resolved!

Create the following script and save it where you normally save your scripts - I saved it as /usr/local/bin/wifiup:

#!/bin/bash
iface="wlan0"
ifconfig ${iface} down
iwconfig ${iface} mode Managed
ifconfig ${iface} up
killall wpa_supplicant
wpa_supplicant -B -Dwext -i ${iface} -c ${HOME}/.wireless-wpa.conf -dd
dhclient ${iface}

Ensure the script is executable:

chmod +x /usr/local/bin/wifiup

In the file ${HOME}/.wireless-wpa.conf, I have the following:

ctrl_interface=/var/run/wpa_supplicant
    network={
      ssid="[SSID]"
      scan_ssid=1
      key_mgmt=WPA-PSK
      psk="[PSK]"
    }

Note: Replace [SSID] and [PSK] with values relevant to your Access Point.

When I notice the link is down, I open a terminal session and run the command:

sudo wifiup

If this does not work for you, instead of rebooting the laptop/desktop, identify the Kernel module used by your device (mine uses iwlwifi):

$ lspci -k | awk '/Network/,/Kernel/{print}'
00:19.0 Ethernet controller [0200]: Intel Corporation 82579LM Gigabit Network Connection [8086:1502] (rev 04)
    Subsystem: Dell Device [1028:053f]
    Kernel driver in use: e1000e
03:00.0 Network controller [0280]: Intel Corporation Centrino Ultimate-N 6300 [8086:422b] (rev 35)
    Subsystem: Intel Corporation Centrino Ultimate-N 6300 3x3 AGN [8086:1121]
    Kernel driver in use: iwlwifi

You can then unload and reload the module using the following command at a terminal session:

sudo modprobe -r iwlwifi
sudo modprobe iwlwifi

Sometimes just unloading and reloading your module will initiate the WiFi reconnection, but in case it does not, run the wifiup as stated earlier!

Please report back whether this works for you as interim solution.


What I do is:

u1sdtool -q
find ~/.local/share/ubuntuone/syncdaemon -depth -type d -empty -delete
u1sdtool --start
u1sdtool -c

Sometimes I need to do this 5 times.

Also weird is when I push 'connect' nothing happens, but when I do u1sdtool -c in terminal, it is starting to connect.

I just want to add that since / after upgrade to Ubuntu 11.04 I don't have this problem any more.


How to fix "Package is in a very bad inconsistent state" error?

Edited out of the question and added as an answer.

Make sure that your PPA is set up.
Remove the broken package via the following command:

sudo dpkg --remove --force-remove-reinstreq zramswap-enabler

Install the package again:

sudo apt-get install zramswap-enabler

After restart (not necessary), you are able to install the updates correctly!

Actually you can fix any "Package is in a very bad inconsistent state” issues with this solution!


Bash history too short/keeps getting deleted (possibly doesn't survive reboots)

On my system I have created a /etc/profile.d/histsize.sh file with
these two lines in it:

export HISTSIZE=10000

export HISTFILESIZE=2000000

Additionally I have replaced the two similar lines in .bashrc with the
same two lines. The default .bashrc has these two lines:

HISTSIZE=1000
HISTFILESIZE=2000

Which I also replaced with:

export HISTSIZE=10000
export HISTFILESIZE=2000000

When updating .bashrc you have to remember to update it both in
/etc/skel as well as in each home directory created before you updated
/etc/skel/.bashrc

Since the above steps leaves so much room for mistakes, it is of
course crucial to also have a backup.


How do I show a notification from a python3 application in Ubuntu 18.04 desktop?

Use notify-send.

From man notify-send:

  With  notify-send  you  can  send  desktop notifications to the user
  via a notification daemon from the command line.  These notifications
  can be used to inform the user about an event or display some form of
  information without getting in the user's way.

Notifications sent to the user screen will stay up for a few seconds, and will be stored in the notification area under the clock, as you require.


mount.cifs: permission denied after upgrading to 20.10

Try:
mount.cifs //192.168.2.2/C /mnt/mountpoint -o credentials=/home/ubuntu/.smbcredentials,iocharset=utf8

If you get an error, you might be missing a utility:
sudo apt-get install cifs-utils

If you get a no such file or directory error, create the mountpoint:
mkdir -p /mnt/mountpoint

If you get a permission denied error, check the permissions:
ls -ld /mnt/mountpoint

You might have to change it:
sudo chown `whoami` /mnt/mountpoint
sudo chmod 700 /mnt/mountpoint

Then try again. (Run man chmod to learn more.)
If it still doesn't work, tweak your options until it does. Also try with sudo for good measure, but it shouldn't be necessary.
For an easy:
mount /mnt/moutpoint

Make sure the mount you want is in /etc/fstab. If not, add it. man fstab for the format. Eg.
//192.168.2.2/C /mnt/mountpoint cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8 2 1

Where ~/.smbcredentials contains:
user=myuser
password=mypass
domain=WORKGROUP

(Remember to chmod 600 ~/.smbcredentials)
Then mount again:
mount /mnt/mountpoint

No need to be in a fstab, sudo or mount group.


Regexp/config var for apt-cacher to allow repo files for 16.04 clients (Metadata, Components-*.yml)?

I've got an apt-cacher on vivid. Had to change in /etc/apt-cacher/apt-cacher.conf:

ubuntu_release_names = dapper, edgy, feisty, gutsy, hardy, intrepid, jaunty, karmic, lucid, maverick, natty, oneiric, precise, quantal, raring, saucy, trusty, utopic, vivid, wily, xenial

index_files_regexp = ^(?:Index(?:\.bz2)?|(?:Sources|Packages|release)(?:\.gz|\.bz2|\.xz)?|Release(?:\.gpg)?|InRelease|Contents-(?:[a-z]+-)?[a-zA-Z0-9]+\.gz|(?:srclist|pkglist)\.[a-z-]+\.bz2|Translation-[a-z]{2,3}(?:_[A-Z]{2}(?:\.[a-zA-Z0-9-]+)?)?(?:\.gz|\.bz2|\.xz|\.lzma)?|Components-[a-z0-9]+\.yml(?:\.gz|\.bz2)?|icons-[0-9]+x[0-9]+\.tar(?:\.gz)?)$


A workaround for this issue is to create a dispatch script for Network-Manager that will do this automagically for you.

Create /etc/NetworkManager/dispatcher.d/80-ppp-vpn-down with the following contents:

#!/usr/bin/env bash

##
# The environment contains more information about the interface and the connection:
# DEVICE_IFACE - The interface name of the control interface of the device

main() {
        local interface="$1"
        local event="$2"

        if [[ "${interface}" =~ "ppp"* && "${event}" == "vpn-down" ]]; then
                local connection
                connection="$(nmcli -t -f NAME,DEVICE connection show --active | awk -F: '/'"${DEVICE_IFACE}"'/ {print $1}')" || return 1

                nmcli connection down id "${connection}"
                nmcli connection up id "${connection}"
        fi
}

main "$@"
exit $?

Make sure to make it executable as well:

chmod +x /etc/NetworkManager/dispatcher.d/80-ppp-vpn-down


S Video performance using ati-driver-installer-9-3-x86.x86_64.run on U 12.4

It is so simple but easily missed.  For the s-video output on this card to be configured correctly on Ubuntu, the output MUST be connected to the TV BEFORE bootup.  If you are already running, shut down, connect the cable to the TV and reboot.  Voila! After a few seconds of various screen attempts, Ubuntu selects the correct configuration for the S-Video output and your computer monitor.

Found this out through experimentation and more web searches.


Direct output from a command to a file including the original command, AND print in terminal

That's tee you're searching for.

ls -l | tee outfile

prints the output of ls -l to stdout (i.e. the terminal) and saves it in the file outfile at the same time. But: It doesn't write the command name neither to stdout nor to the file. To achieve that, just echo the command name before running the command and pipe both outputs to tee:

( echo "ls -l" && ls -l ) | tee outfile

That's cumbersome to type, so why not define a function?

both(){ ( echo "$@" && "$@" ) | tee outfile ;}

After that you can just run

both ls -l

to get the desired result. Put the function in your ~/.bashrc to have it defined in every new terminal.

If you want to be able to specify the output file as the first argument like in

both output ls -l

instead make it:

both(){ ( echo "${@:2}" && "${@:2}" ) | tee "$1" ;}

If you don't want the output file to be overwritten but rather append to it, add the -a option to tee.


Try to install blueman out of the repos:

sudo apt-get install blueman

After the installation, run it with blueman-manager command.
On startup, blueman will ask you if it should activate bluetooth. Worked for me on 3 devices with 14.04


Re-enable showing of a dialog before moving files to the trash in Kubuntu

I'm assuming you're talking about Dolphin file manager.

The setting you're looking for is
Control → Configure Dolphin... → General → Confirmations → Moving files or folders to trash


If you have access to a Windows machine, the YUMI app might work for you. It enables you to put multiple bootable iso's on one thumb drive and creates a menu to select which to boot from at start-up. Also, you can include a persistence file for Ubuntu.

More info at http://www.pendrivelinux.com/yumi-multiboot-usb-creator/.

I don't have pictures to post but perhaps give it a go and reply back with questions?


Trying to install the latest CodeBlocks on Lubuntu, errors!

You should drop ubuntu/ in sudo add-apt-repository ppa:damien-moore/ubuntu/codeblocks-stable and use sudo add-apt-repository ppa:damien-moore/codeblocks-stable instead.


Is a windows xp running on a virtual box with guest additions harmful for ubuntu? Does it may lead to viruses issues?

As much as I would love to say that a virtualized sandboxed Windows does no harm to you I can't.

A virtual Windows behaves exactly like a Windows on bare metal, i.e. it is no less vulnerable to malware.

Whenever your run an unprotected copy of Windows it may quickly get infected by a virus coming from a file, a mail, a website, or an infected storage device. One of the main function all malware have is to replicate. Exactly this will happen on your virtual machine too.

The virus will not be able to infect your Ubuntu host, but it may

sit in files you had accessed from a compromised Windows (you will want to access files outside the VM sooner or later).
be able to spread from your infected virtual OS to your network, or to the world wide web.
in case you let your virtual OS  access data files stored on the host machine, it may even be able to spy on you.
rare viruses may infect your router no less from a virtual machine. Just open a browser there to access your router's administration page from a VM if you are skeptical.

So in summary an infected virtual Windows will not be able to infect your Ubuntu installation, but it will still be a risk to you or to others. It is therefore strongly recommended to protect a virtual Windows with appropriate anti-virus software before you give it access to your network, or the internet.


Download the .deb file (64 bit) from the XnViewMP website  https://www.xnview.com/en/xnviewmp/#downloads

Double click in it in your file manager, and the software installer should open it up and install it for you.

Update:

The XnViewMP .deb file does not install a needed library.

To fix this open a terminal windows (ctrl+alt+t) and enter the command

sudo apt install libopenal1


What is the recommended place to install nodejs and mongodb in ubuntu 16.04 LTS?

I'm also new on Ubuntu and I installed node few weeks ago.

  is that /usr/local a correct choice to install Node-js or should I
  install it somewhere else ?

I think that /usr/bin/ is not a bad place to install nodeJs, however keep in mind that other users on your computer won't have access.

  I am new to Ubuntu so want to go with the recommended/safe practices
  suggested by experienced developers.

According to the documentation : https://docs.npmjs.com/getting-started/fixing-npm-permissions , you should ensure that you've complete all the "manual steps".

I suggest you to use nodesource github repository for automated installation.


You can add an entry to your fstab so the partition is mounted with the right permissions at boot

You can read some background info on fstab here in Ubuntu help

You will want to mount the drive with read write permission, so you need the filesystem label to be ntfs-3g. First check that you have the package:

sudo apt-get install ntfs-3g

probably it will say you already have the latest version, which is cool.

Next, choose a mount point for your partition. You probably know where it is normally mounted when you open it from your Ubuntu partition. You can either use that mount point, or make a new one. You can call it anything but it should be in /media.

sudo mkdir /media/windows

Now please backup your fstab:

sudo cp /etc/fstab /etc/fstab-backup

To undo the changes any time sudo mv /etc/fstab-backup /etc/fstab

You need the UUID of your windows partition so run

sudo blkid

You will see all your partitions with UUID="VeryLongString-OfLetters&Numbers" You can identify the windows partition by its filesystem tag TYPE="ntfs". Copy the UUID of the partition. Now you are ready to make your new entry in fstab so

sudo nano /etc/fstab

at the end of the file, make a new line with UUID, then the mountpoint you chose, then filesystem type, then options, then two separated zeroes, like this

UUID=that-long-string-you-copied /media/windows   ntfs-3g    auto,user,rw   0   0

the options mean it will mount automatically at boot, and be read & writable by you (not just root) the two zeros are just null options (see the help page linked above). You might want to add a comment (starting the line with #) on the line above for future reference like:

# To make my symlinks persistent

Save the file (Ctrl+X then Y) and exit, then reboot. If you did everything right, you will find your partition at the mountpoint you selected. Make your symlinks again and now they will survive power cycles.


gnome-terminal and midnight-commander in different Unity Launcher's groups

You need to pass a --class argument to each launcher so that gnome-terminal thinks it's a separate application.

You can do this by just making a custom launcher for one of them (probably mc) and pass it

gnome-terminal -e mc --disable-factory --sm-client-disable --class=mc"

that should be enough for Unity to classify it as a different application, see here:

How do I make a custom launcher for terminal applications?


The file may download to the /tmp/zarcell0 folder, or Downloads.

From your download (let's say in Firefox) click on the whole line and choose 'Open Containing Folder'.
There, right click on the Zoiper download, go down and click on 'Extract Here'.
Open that folder, and choose either the 32 or 64bit run file.
Right click on the file you need, copy.

Open File Manager and go to Downloads. Paste it there.

Open the Terminal. Type this in:

cd ~/Downloads
sudo chmod +x Zoiper_3.3_Linux_Free_64Bit.run
sudo ./Zoiper_3.3_Linux_Free_64Bit.run


Which package manages the Ctrl+F function?

If you got the bug no matter which application you opened, I suggest reporting the bug in the unity package.

And yes, Ubuntu Packages is a good place to search for Ubuntu packages.  You can also check out the Bazaar Branches for Ubuntu, there is gold hidden in there.


How to make Tamil fonts work in a chat client?

Search for Keyboard input methods in the dash and open it.

Go to Input method tab and click on Select an Input method. Scroll down to Tamil and you will have a couple of options to install. I have Phonetic installed.


Compiling cdc-acm.ko for 4.18.0-18-generic

The solution was to restore the original cdc-acm.ko file. The one from the tutorial is not suitable for 4.18. The installed driver is perfectly fine.


How to copy file/folder permissions and ownerships from one folder to another (recursively)

cd to the new directory which you want to give new permissions - in my case:

cd /www

For CHMOD this worked:

find . -path ./.git -prune -or -exec chmod --reference '/www_03062018/{}' '{}' ';'

And for CHOWN this worked:

find . -path ./.git -prune -or -exec chown --reference '/www_03062018/{}' '{}' ';'

Hope this helps others :) !


This most likley is a corrupted /etc/my.cnf file.

Check it if you have any formatting errors there.


How can I install Ubuntu without using the Wubi installer?

This should give you all the information you need

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

If you download from a torrent there should be no need to check that the download is good prior to burning.

Torrent download options can be found on the same page as the other Ubuntu download options - http://releases.ubuntu.com/precise/


error while trying to install from software center

Try those commands:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential

Then back:

sudo apt-get install vlc


how to install intel HD 4000 ubuntu 14.04?

In order to install the drivers for your Intel HD 4000. Open Dash go to Software Updater, press the settings... button and go to the Additional Drivers tab, there you can find a list of drivers for your computer simply select the recommended one (if one is recommended) or the lates one.


What command changes the Group setting for a directory?

chmod does not change owner. It changes permissions. chown changes owner (and group if need be) and chgrp changes group.

You can use

chown {-R} [user]{:group} [file|directory]

to set user and group ownership where -R does everything that is inside directory.
So sudo chown -R rinzwind:rinzwind /tmp/ would set /tmp/ and everything in it to user rinzwind and group rinzwind.

There is also

chgrp {-R} [group] [file|directory]

if you do not need to touch the user permissions and only need to set the group.

Oh and you can check what group a user belongs to with groups {username}.


Ubuntu 18.04 won't boot after installing steam

Here's the fool-proof step-by-step solution:

Boot into safe mode (recovery mode). Enter this mode by holding the left shift key when the computer starts.

in terminal, type:
sudo apt-get purge nvidia*
sudo ubuntu-drivers autoinstall #Make sure you have internet connection

(This worked on my dual booted computer (Windows 10 and Ubuntu 18.04)
my error message was /dev/nvme0n1p5: clean, nnn/nnn files, nnn/nnn blocks
#cheers


Installing Ubuntu on an HP Spectre 360x - advice needed

Find the answers below:

None. I too am using Ubuntu from a long time as in from 2 years and I didn't face any issues till date.
Yeah, why not. It works fine on my dell laptop giving me no resolution or display issues.
It works great. I am using a combination of Ubuntu with Win-10 on a touch supportable dell laptop and I have till date not faced any issues. I am able to enjoy all touch facilities available without hassle. Also, I am currently using Ubuntu 16.04 LTS.

Will have to check bro for this multi-gesture thing. Will let you know about it.


Ubuntu 12.04 slows down wireless network

What is your hard drive access indicator LED doing all this time? Is it on solid, thrashing like mad? If yes, try doing this from the console prompt as your regular user:

$ ps aux  (of course, you could have done: $ps aux | grep cron)

Look for output that shows CRON activity - indicates that there are a whole bunch of CRON jobs running such as the database that holds info about programs, log rotation, etc. The jobs run right after logon as your user (typically) and you'll see quite a bit of slowdown as the cron jobs execute.

You can also try see how your connection is to a particular web site:

$ mtr _some_web_site_
$ mtr http://google.com

This will show your traffic is being managed by all the connections between your PC/laptop and the target web site.

Just a couple of ideas to play with that might shed some light on your troubles.

-*-Bill


Loaded Ubuntu 12.10 from Disc on a Windows XP Partition and I now can't see the partition to switch to ubuntu

There is a better way to install Ubuntu than to a partition you created inside Windows - because Ubuntu detects unused disk space, the install screen gives you the option to "Install Ubuntu alongside Windows."

If you can boot back into Windows (I assume this is the case because you appear to be unable to boot into Ubuntu), go back to Disk Management and delete the partition you created for Ubuntu, then reboot from your Ubuntu live media and select "Install Ubuntu alongside Windows."


how to add cdrom in ubuntu16.0.4 server error comes "fail to fetch cdrom"

i have already resolved this issue the solution is write on command prompt "cd /etc/apt" then type "ls" after this "sudo nano sources.list" sources file will open then insert a # berfore the line cdrom starts.After this press Ctrl+X then enter y and press Enter the file will be saved in edited form.and the error will be solved. –Or you can visit the this link for more clarity "https://www.youtube.com/watch?v=bfyobrcSx1Q"


Unable to install Ubuntu on Toshiba Sattelite after download interrupted

Set your boot device priority to CD/USB (whatever your bootable Ubuntu media is) instead of HDD form the Boot menu.


Why should I go through the purchasing process to install a product priced $0.00?

Usually, free software end up in software-center through Debian repository import but there are special channels to get software directly into Ubuntu repository.

The reason why some products end up with a price tag of $0.00 but have to be installed through a purchasing process is because they were added directly to the Ubuntu repository through the myapps.ubuntu.com portal. Because of the interface of the portal, the only way to release the product for free is if you set a $0.00 price. Hence, you see a buy button for products even when you don't actually have to pay anything for the product.

This issue has been notified and the design spec of software-center has been modified to sort this issue.

A bug report has already been filed to rectify this problem and hopefully the Q-release will have this bug fixed.


Apt-get SSL client certificate not working on 16.04 (Error while reading file)

Apt tries hard to drop permissions and run as the _apt user. I don't remember when that switch happened but it was fairly recent (i.e. likely to be after 14.04). So, having fixed my similar problem the same way you did (i.e. made sure that a+rx was available on all directories leading up to the cert I wanted _apt to use) I think it's safe to say you've identified the problem correctly.


Headquarters.

It's the name given to the website, not the software project per se.


Top Bar with rounded corners in Ubuntu 19.10

First determine which shell-theme you are using..
then edit the corresponding css file with below contents by changing your preferred values..

  #panel .panel-corner {
    -panel-corner-radius: 26px;
    -panel-corner-background-color: magenta;
    -panel-corner-border-width: 4px;
    -panel-corner-border-color: blue; }


Stop Ubuntu from hanging when video is run

As stated here, bottom of section 3,

  Those of you on Radeon device should be aware that the standard AMD driver is NOT SUPPORTED in 16.04 at this time. A future point release is expected to bring support for the new AMDGPU driver. Expect a regression in system performance if you upgrade.

You will probably either have to find some open-source unofficial driver, or just unplug or disable your GPU, as it's not going to help 16.04 with video playback.


Missing system tray icons Ubuntu Gnome 18.04

You may also simply try to relaunch gnome shell and see if it works better:
(Alt+F2) gnome-shell --replace

Or the short and easy way
(Alt+F2) r (Enter)

Yes, just the letter "r".


Please remove the extra s from httpss. It ought to be https.


Startup Script in rc2.d - Delayed Execution

Your post doesn't explains how the link is named inside the /etc/rc2.d folder. If you want to register a custom startup script you should place it inside the /etc/init.d directory and register it with update-rc.d.

$ sudo cp /home/user/mod_and_vnc /etc/init.d/
$ sudo update-rc.d mod_and_vnc defaults

$ ls -la /etc/rc*.d/*mod_and_vnc
lrwxrwxrwx 1 root root 21 Jul 19 15:11 /etc/rc0.d/K20mod_and_vnc -> ../init.d/mod_and_vnc
lrwxrwxrwx 1 root root 21 Jul 19 15:11 /etc/rc1.d/K20mod_and_vnc -> ../init.d/mod_and_vnc
lrwxrwxrwx 1 root root 21 Jul 19 15:11 /etc/rc2.d/S20mod_and_vnc -> ../init.d/mod_and_vnc
lrwxrwxrwx 1 root root 21 Jul 19 15:11 /etc/rc3.d/S20mod_and_vnc -> ../init.d/mod_and_vnc
lrwxrwxrwx 1 root root 21 Jul 19 15:11 /etc/rc4.d/S20mod_and_vnc -> ../init.d/mod_and_vnc
lrwxrwxrwx 1 root root 21 Jul 19 15:11 /etc/rc5.d/S20mod_and_vnc -> ../init.d/mod_and_vnc
lrwxrwxrwx 1 root root 21 Jul 19 15:11 /etc/rc6.d/K20mod_and_vnc -> ../init.d/mod_and_vnc