Automate SSH client and server setup on every device

Introduction
My final script (ssh-setup) is done and SSH Open Server has been installed. The script doesn't do as much as originally envisioned. Someone can take it and modify it for automated setup in a large organization though. For everyone else it hopefully provides useful details to aid in installation.

Before raising concerns about MAC addresses below note that:

Is it dangerous to post my MAC address publicly?

Says:

MAC addresses are almost always only used "internally" (between you
and your immediate gateway). They really don't make it to the outside
world and thus cannot be used to connect back to you, locate you, or
otherwise cause you any direct harm.

ssh-setup Sample Output
$ sudo ssh-setup

Gathering system details - Will take 15 - 30 seconds

==========  systemctl status net*  ============================================

* network-online.target - Network is Online
      (... OUTPUT SNIPPED TO SAVE SPACE ...)
* networking.service - Raise network interfaces
      (... OUTPUT SNIPPED TO SAVE SPACE ...)
* network.target - Network
      (... OUTPUT SNIPPED TO SAVE SPACE ...)
* network-pre.target - Network (Pre)
      (... OUTPUT SNIPPED TO SAVE SPACE ...)

==========  systemctl status ssh  =============================================

* ssh.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

==========  [[ -d ~/.ssh ]] && SSH_Keys=$(ls -al ~/.ssh)  =====================

-rw-------  1 rick rick 1679 Oct  8  2019 id_rsa
-rw-r--r--  1 rick rick  392 Oct  8  2019 id_rsa.pub
-rw-r--r--  1 rick rick 1108 Jun 17 20:53 known_hosts

==========  apt list 2>/dev/null | grep ssh | grep installed  =================

libssh-4/xenial-updates,xenial-security,now 0.6.3-4.3ubuntu0.5 amd64
libssh-gcrypt-4/xenial-updates,xenial-security,now 0.6.3-4.3ubuntu0.5 amd64
libssh2-1/xenial-updates,xenial-security,now 1.5.0-2ubuntu0.1 amd64
openssh-client/xenial-updates,xenial-security,now 1:7.2p2-4ubuntu2.8 amd64
sshfs/xenial,now 2.5-1ubuntu1 amd64

==========  cat /etc/ssh/sshd.config  =========================================

==========  ifconfig -a | grep -v ^' ' -A1  ===================================

enp59s0   Link encap:Ethernet  HWaddr 28:f1:0e:2a:1a:ed
          inet addr:192.168.0.12  Bcast:192.168.0.255  Mask:255.255.255.0

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0

wlp60s0   Link encap:Ethernet  HWaddr 9c:b6:d0:10:37:f7
          inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0

==========  nmap -sn 192.168.0/24  ============================================

hitronhub.home (192.168.0.1) (0.0011s latency). MAC: AC:20:2E:CC:94:52 (Unknown)
dell (192.168.0.13) (0.00026s latency). MAC: 5C:F9:DD:5C:9C:53 (Dell)
dell (192.168.0.14) (0.00026s latency). MAC: 5C:F9:DD:5C:9C:53 (Dell)
hs100 (192.168.0.15) (-0.078s latency). MAC: 50:D4:F7:EB:41:35 (Unknown)
android-47cdabb50f83a5ee (192.168.0.16) (-0.076s latency). MAC: 18:4F:32:8D:AA:97 (Hon Hai Precision Ind.)
192.168.0.254 (0.00045s latency). MAC: 00:05:CA:00:00:09 (Hitron Technology)
alien (192.168.0.10) LOCAL NETWORK CARD
alien (192.168.0.12) LOCAL NETWORK CARD

==========  lshw -c network | grep -Ei 'description|product|serial'  ==========

Ethernet interface: Killer E2400 Gigabit Ethernet Controller - 28:f1:0e:2a:1a:ed
Wireless interface: QCA6174 802.11ac Wireless Network Adapter - 9c:b6:d0:10:37:f7

==========  cat /etc/hosts | grep 192.168  ====================================

192.168.0.10    alien  AW 17R3 WiFi                   9c:b6:d0:10:37:f7
192.168.0.12    alien  AW 17R3 Ethernet               28:f1:0e:2a:1a:ed
192.168.0.13    dell   Inspiron 17R-SE-7720 Ethernet  5c:f9:dd:5c:9c:53
192.168.0.14    dell   Inspiron 17R-SE-7720 WiFi      60:6c:66:86:de:bd
192.168.0.15    hs100  Sony TV Wall Light
192.168.0.16    android-47cdabb50f83a5ee  Sony Bravia TV KBL 50W800C

==========  FIREWALL: ufw status verbose  =====================================

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
-------------- Any error messages below are coming from tlp-stat --------------
cat: /sys/class/power_supply/hidpp_battery_35/present: No such file or directory
cat: /sys/class/power_supply/hidpp_battery_36/present: No such file or directory

==========  tlp-stat | grep -E '^autosuspend|ENABLE|WOL'  =====================

TLP_ENABLE=1
WOL_DISABLE=Y
autosuspend        = enabled

==========  cat /etc/default/halt  ============================================

# Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff".
HALT=poweroff

==========  cat /etc/network/interfaces  ======================================

# interfaces(5) file used by ifup(8) and ifdown(8)
# /etc/network/interfaces
# For Ubuntu 16.04 ONLY according to notes in ssh-setup
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.0.10
        netmask 255.255.255.0
        gateway 192.168.0.1
        dns-nameservers 192.168.0.1
        up ethtool -s eth0 wol g

==========  nmcli -p connection show  =========================================

====================================================================================
                         NetworkManager connection profiles
====================================================================================
NAME                UUID                                  TYPE             DEVICE
------------------------------------------------------------------------------------
XXXX-XXXXXX-5G      cf8fda92-0e59-4d0e-8821-cedb4be10d26  802-11-wireless  wlp60s0
Wired connection 1  378122bb-ad44-3ddd-a616-c93e1bf0f828  802-3-ethernet   enp59s0
XXXXXXXXX-5G        73c40a50-0f2e-431c-b12c-e4712b3abdb4  802-11-wireless  --

==========  ifconfig -a | grep ^'e' | cut -d' ' -f1  ==========================

Ethernet Interface that could be used for WOL:   enp59s0

==========  ethtool enp59s0 | grep -i 'Wake-on:'  =============================

==========  END OF REPORT  ====================================================

Although the report is long already it could be made even longer with explanations for each section. The explanations including links are in the actual script itself.

ssh-setup Bash Script
The script must be called with sudo powers. The same script is designed to be run on both the server and client. Some files such as /etc/hosts you will need to setup after running the report and then copy (perhaps by email) between machines.
After creating the script in a directory, remember to mark it executable with:
chmod a+x /path/to/ssh-setup

Then call the script with sudo /path/to/ssh-setup or simply ssh-setup if the /path/to/ is in your PATH environment variable. Where: /path/to/ is the folder you created the script in.
#!/bin/bash

# NAME: ssh-setup
# PATH: /mnt/e/bin
# DESC: Display network details needed to setup SSH or debug after setup.
# CALL: Called from terminal with `sudo` permissions.
# DATE: June 18, 2020. Modified: Original Version.

# NOTE: When debugging script place terminal results in appropriate sections.

# From: https://askubuntu.com/questions/628383/output-only-mac-address-on-ubuntu#comment892989_628387

export LANG=C       # Force english names for sed search. For example in
                    # another language HWaddr is direcciónHW

if [[ $(id -u) != 0 ]]; then # root powers needed to call this script
    echo >&2 "'$(basename $0)' must be called with 'sudo'"
    exit 1
fi

# Must have the nmap package.
command -v nmap >/dev/null 2>&1 || { echo >&2 \
        "'nmap' package required but it is not installed.  Aborting."; \
        exit 2; }

# Must have the lshw package.
command -v lshw >/dev/null 2>&1 || { echo >&2 \
        "'lshw' package required but it is not installed.  Aborting."; \
        exit 3; }

# OTHER PACKAGES CONSIDERED AND REJECTED:

# $ network-test
# The program 'network-test' is currently not installed. You can install it
# by typing: 'sudo apt install ifupdown-extra'
# Seems kind of lame and has md5 checksum error.

# $ netstat | wc -l
# 824
# Way to many lines to make use of. Might be good to track down specific addy.

# $ iwconfig
# wlp60s0   IEEE 802.11  ESSID:"XXXXXXXXXXXXXX"
#           Mode:Managed  Frequency:5.22 GHz  Access Point: AE:20:2E:CC:94:50
#           Bit Rate=6 Mb/s   Tx-Power=23 dBm
# Reveals router name (EESID) which is bad for neighbours to know us by....

echo
echo "Gathering system details - Will take 15 - 30 seconds"

Display () {

# $1 = command that was run (sometimes abridged version if lots of seds)
# $2 = output from command

echo " "
String1="==========  $1  "
String2="====================================================================="
String3="$String1$String2"
echo "${String3:0:79}"
echo " "
echo "$2"

} # Display

# What systemd network services are running?
NET_Service="" # Default no directory
NET_Service=$(systemctl status net*)
Display 'systemctl status net*' "$NET_Service"

: <<'END'
/* ------------ RESULTS -------------------------------------------------------

(ABRIDGED)

* network-online.target - Network is Online
* networking.service - Raise network interfaces
* network.target - Network
* network-pre.target - Network (Pre)

---------------------------------------------------------------------------- */
END
# Is SSH systemd service (aliased as sshd) running?
SSH_Service="" # Default no directory
SSH_Service=$(systemctl status ssh)
Display 'systemctl status ssh' "$SSH_Service"

: <<'END'
/* ------------ RESULTS -------------------------------------------------------

● ssh.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

---------------------------------------------------------------------------- */
END

# What SSH keys are already setup?
SSH_Keys="" # Default no directory
[[ -d ~/.ssh ]] && SSH_Keys=$(ls -al ~/.ssh | \
                              grep -v ^total | \
                              grep -v ^d )
                              # remove total line, ./ and ../ directories
Display '[[ -d ~/.ssh ]] && SSH_Keys=$(ls -al ~/.ssh)' "$SSH_Keys"

: <<'END'
/* ------------ RESULTS -------------------------------------------------------

id_rsa
id_rsa.pub
known_hosts

---------------------------------------------------------------------------- */
END

# What SSH packages are currently installed?
SSH_Installed="" # Default no SSH packages
SSH_Installed=$(apt list 2>/dev/null | grep ssh | grep installed | \
                     sed 's/ \[installed.*//')
                     # remove [installed] & [installed, automatic] strings

Display "apt list 2>/dev/null | grep ssh | grep installed" "$SSH_Installed"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

libssh-4/xenial-updates,xenial-security,now 0.6.3-4.3ubuntu0.5 amd64
libssh-gcrypt-4/xenial-updates,xenial-security,now 0.6.3-4.3ubuntu0.5 amd64
libssh2-1/xenial-updates,xenial-security,now 1.5.0-2ubuntu0.1 amd64
openssh-client/xenial-updates,xenial-security,now 1:7.2p2-4ubuntu2.8 amd64
sshfs/xenial,now 2.5-1ubuntu1 amd64

---------------------------------------------------------------------------- */
END

# What is the SSH configuration?
SSH_Config="" # Default no SSH packages
[[ -f ~/etc/ssh/sshd.config ]] && SSH_Config=$(cat ~/etc/ssh/sshd.config)
Display "cat /etc/ssh/sshd.config" "$SSH_Config"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------
---------------------------------------------------------------------------- */
END

# What IP address are on this machine?
LOCAL_IP_Addresses="" # Default machine has no network cards
LOCAL_IP_Addresses=$(ifconfig -a | grep -v ^' ' -A1 | \
                     grep -v '\-\-')
                     # grep to -v to remove extra lines
Display "ifconfig -a | grep -v ^' ' -A1" "$LOCAL_IP_Addresses"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

enp59s0   Link encap:Ethernet  HWaddr 28:f1:0e:2a:1a:ed
          inet addr:192.168.0.12  Bcast:192.168.0.255  Mask:255.255.255.0

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0

wlp60s0   Link encap:Ethernet  HWaddr 9c:b6:d0:10:37:f7
          inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0

---------------------------------------------------------------------------- */
END

# What IP address (potential servers/clients) are visible on network?
NET_IP_Addresses="" # Default LAN is not running
NET_IP_Addresses=$(nmap -sn 192.168.0/24 | \
                   sed '/^Starting Nmap/d' | \
                   sed '/^Nmap done/d' | \
                   sed -z 's/Nmap scan report for //g' | \
                   sed -z 's/\nHost is up\./ LOCAL NETWORK CARD/g' | \
                   sed -z 's/\nHost is up / /g' | \
                   sed -z 's/\nMAC Address: / MAC: /g' )
#                   sed 's/MAC.*(/(/g') # MAC makes line too long
                   # Use sed to remove line breaks making results lengthy
Display "nmap -sn 192.168.0/24" "$NET_IP_Addresses"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

hitronhub.home (192.168.0.1) (0.00072s latency). (Unknown)
dell (192.168.0.13) (0.00021s latency). (Dell)
dell (192.168.0.14) (0.00022s latency). (Dell)
hs100 (192.168.0.15) (0.010s latency). (Unknown)
android-47cdabb50f83a5ee (192.168.0.16) (0.0093s latency). (Hon Hai Precision Ind.)
192.168.0.254 (-0.100s latency). (Hitron Technology)
alien (192.168.0.10) LOCAL NETWORK CARD
alien (192.168.0.12) LOCAL NETWORK CARD

---------------------------------------------------------------------------- */
END

#What network cards are installed:
NetworkCards="" # Contents of /etc/hosts should contain all IP addresses on LAN
NetworkCards=$(lshw -c network | grep -Ei 'description|product|serial' | \
               sed 's/       description: //g' |  \
               sed -z 's/\n       product: /: /g' | \
               sed -z 's/\n       serial: / - /g')
Display "lshw -c network | grep -Ei 'description|product|serial'" "$NetworkCards"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

Ethernet interface: Killer E2400 Gigabit Ethernet Controller - 28:f1:0e:2a:1a:ed
Wireless interface: QCA6174 802.11ac Wireless Network Adapter - 9c:b6:d0:10:37:f7

---------------------------------------------------------------------------- */
END

# Email /etc/hosts file to yourself and update contents below on machine
STATIC_IP_Addresses="" # Contents of /etc/hosts should contain all IP addresses on LAN
STATIC_IP_Addresses=$(cat /etc/hosts | grep 192.168)
Display "cat /etc/hosts | grep 192.168" "$STATIC_IP_Addresses"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

192.168.0.10    alien  AW 17R3 WiFi                   9c:b6:d0:10:37:f7
192.168.0.12    alien  AW 17R3 Ethernet               28:f1:0e:2a:1a:ed
192.168.0.13    dell   Inspiron 17R-SE-7720 Ethernet  5c:f9:dd:5c:9c:53
192.168.0.14    dell   Inspiron 17R-SE-7720 WiFi      60:6c:66:86:de:bd
192.168.0.15    hs100  Sony TV Wall Light
192.168.0.16    android-47cdabb50f83a5ee  Sony Bravia TV KBL 50W800C

---------------------------------------------------------------------------- */
END

# Firewall
# Selecteend TLP stats that might prove helpful for debuggin.
ufw_stats="" # Contents of /etc/hosts should contain all IP addresses on LAN
ufw_stats=$(ufw status verbose)
Display "FIREWALL: ufw status verbose" "$ufw_stats"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
-------------- Any error messages below are coming from tlp-stat --------------
cat: /sys/class/power_supply/hidpp_battery_23/present: No such file or directory
cat: /sys/class/power_supply/hidpp_battery_24/present: No such file or directory

---------------------------------------------------------------------------- */
END

echo -------------- \
Any error messages below are coming from tlp-stat --------------
# Selected TLP stats that might prove helpful for debuggin.
TLP_stats="" # Contents of /etc/hosts should contain all IP addresses on LAN
command -v tlp-stat >/dev/null 2>&1 && \
    TLP_stats=$(tlp-stat | grep -E '^autosuspend|ENABLE|WOL')
Display "tlp-stat | grep -E '^autosuspend|ENABLE|WOL'" "$TLP_stats"
: <<'END'

/* ------------ RESULTS -------------------------------------------------------

TLP_ENABLE=1
WOL_DISABLE=Y
autosuspend        = enabled

---------------------------------------------------------------------------- */
END

: <<'END'
/* ------------------  WOL (Wake On LAN) General Comments  --------------------

*******************  UBUNTU 16.04  *******************

From: https://askubuntu.com/questions/764158/
      how-to-enable-wake-on-lan-wol-in-ubuntu-16-04

Also:  http://manpages.ubuntu.com/manpages/xenial/man8/NetworkManager.8.html

In Ubuntu 16.04 set WOL_DISABLE=N in /etc/default/tlp to avoid getting WOL
disabled by TLP power management.

http://linrunner.de/en/tlp/docs/tlp-configuration.html

Add NETDOWN=no in /etc/default/halt to prevent powering off the network
card during shutdown

Enable Wake on LAN in /etc/network/interfaces when static network
configuration is used.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface

auto lo
iface lo inet loopback
# The primary network interface

auto eth0
iface eth0 inet static
        address 192.168.0.10
        netmask 255.255.255.0
        gateway 192.168.0.1
        dns-nameservers 192.168.0.1
        up ethtool -s eth0 wol g

Enable wake on lan in BIOS, enter the BIOS setup and look for something
called "Wake up on PCI event", "Wake up on LAN" or similar. Change it so
that it is enabled. Save your settings and reboot.

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

Warning some motherboards / network controllers don't support WOL from the
cold boot (S5 state, where the power to the system is physically turned off
and back on again). In that case, at least one power cycle (power up,
shutdown) has to be performed. To mitigate to the problem, the BIOS can be
configured to power up when AC is restored and schedule a shutdown inside
Ubuntu afterwards. Refer to the motherboard's manual for further details.

*******************  UBUNTU 18.04  *******************

NOTE: In Ubuntu 18.04 /etc/network/interfaces maybe DEPRECATED
      You might have to create your own script for WOL in:
      /etc/NetworkManager/dispatcher.d/99-Xxxxxx

      See: https://askubuntu.com/a/1111656/307523
           https://wiki.archlinux.org/index.php/
           NetworkManager#Network_services_with_NetworkManager_dispatcher

---------------------------------------------------------------------------- */
END

# WOL from: https://wiki.debian.org/WakeOnLan
# apt install ethtool
# ethtool -s eth0 wol g

# Above is NOT PERSISTENT across suspend/resume cycle so issue upon resume
# not just boot. /etc/network/interfaces above has setup.

# Archwiki: https://wiki.archlinux.org/index.php/Wake-on-LAN
# apt install wakeonlan
# wol target_MAC_address

# From: https://www.thegeekstuff.com/2008/11/
# wol-wakeonlan-guide-remotely-turn-on-servers-without-physical-access/
# wakeonlan 5c:f9:dd:5c:9c:53

# Do we have 'NETDOWN=no' line present for machines that shutdown"?
HaltConfig="" # Default no file
[[ -f /etc/default/halt ]] && HaltConfig=$(cat /etc/default/halt)
Display 'cat /etc/default/halt' "$HaltConfig"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

# Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff".
HALT=poweroff

---------------------------------------------------------------------------- */
END

# Do we have static IP addresses setup?
NetworkInterfaces="" # Default no file
[[ -f /etc/network/interfaces ]] && NetworkInterfaces=$(cat /etc/network/interfaces)
Display 'cat /etc/network/interfaces' "$NetworkInterfaces"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

# interfaces(5) file used by ifup(8) and ifdown(8)
# /etc/network/interfaces
# For Ubuntu 16.04 ONLY according to notes in ssh-setup
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.0.10
        netmask 255.255.255.0
        gateway 192.168.0.1
        dns-nameservers 192.168.0.1
        up ethtool -s eth0 wol g

---------------------------------------------------------------------------- */
END

# Hide your router address below if publishing!
nmcliConnections="" # Default no file
nmcliConnections=$(nmcli -p connection show)
Display 'nmcli -p connection show' "$nmcliConnections"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

====================================================================================
                         NetworkManager connection profiles
====================================================================================
NAME                UUID                                  TYPE             DEVICE
------------------------------------------------------------------------------------
Xxxx-Xxxxxx-Xx      cf8fda92-0e59-4d0e-8821-cedb4be10d26  802-11-wireless  wlp60s0
Wired connection 1  378122bb-ad44-3ddd-a616-c93e1bf0f828  802-3-ethernet   enp59s0
Xxxxxxxxx-5G        73c40a50-0f2e-431c-b12c-e4712b3abdb4  802-11-wireless  --

---------------------------------------------------------------------------- */
END

EthernetInterface=$(ifconfig -a | grep ^'e' | cut -d' ' -f1)
Display "ifconfig -a | grep ^'e' | cut -d' ' -f1" \
"Ethernet Interface that could be used for WOL:   $EthernetInterface"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

Ethernet Interface that could be used for WOL:   enp59s0

---------------------------------------------------------------------------- */
END

# What WOL_Settings exist for Ethernet Interface?
WOL_Setting="'ethtool' not installed."
command -v ethtool >/dev/null 2>&1 && \
    WOL_Setting="$(ethtool $EthernetInterface | grep -i 'Wake-on:')"
Display "ethtool $EthernetInterface | grep -i 'Wake-on:'" "$WOL_Setting"
: <<'END'

/* ------------ RESULTS -------------------------------------------------------

Supports Wake-on: pumbag
Wake-on: g

---------------------------------------------------------------------------- */
END

Display 'END OF REPORT' ""

## TEST STUFF

#Spare:
: <<'END'
/* ------------ RESULTS -------------------------------------------------------
---------------------------------------------------------------------------- */
END


LIBDBUSMENU-GLIB-WARNING **: Unable to get session bus: Failed to execute child process "dbus-launch" (No such file or directory) while x-forwarding

The solution to this issue was to install 'dbus-x11'.

sudo apt-get install dbus-x11

I came to this solution by looking for similar issues.

I've found Pablo Saratxaga's answer on Serverfault, suggesting a script for a similar issue.

https://serverfault.com/a/673837/409813

I've thought it would be worth to run

  export $(dbus-launch)

because this is the main command that the script is starting.

The error message from the output is the following.

The program 'dbus-launch' is currently not installed. You can install it by typing:
apt install dbus-x11

I installed dbux-x11 and x-forwarding started to work without showing an error message.


LibreOffice 3.6.0.4 Calc saving as Tab delimited

Just tied this way, with one of the people that need to use this, and that way is the correct way, even when it show it as (.csv) that doesn't matter, when opening up in Ubuntu gedit - it is working like the Notepad and everything is correct.

So even if you have the latest version of LibreOffice, that is still working, and that link is for Open Office, and still both version is working the same.


Random freezes in (X)Ubuntu 18.04 caused by filled up RAM

I had the same problem after updating from 16.04 to 18.04, RAM use gradually increasing until everything froze and I had to do a hard reboot.
The solution was to choose light DM as the display manager.  Install if not already installed.

sudo apt install lightdm

Then choose it

sudo dpkg-reconfigure lightdm

Follow the instructions on the screen, you will be given the choice of GDM3 or lightdm, select lightdm with the arrows and press return.  I found that there was no longer a gradual increase in RAM usage after this change.


Here you go, but note that It is unofficial.

https://uappexplorer.com/apps


How can GoToMeeting be used in Ubuntu 20.04 on any browser?

GoToMeeting is only available for Chrome and Edge but after installing Chrome in Ubuntu 20.04 it directly worked for me and asked for permission to use webcam, microphone and sound. (After that I could use everything.)
Did you check the lock symbol next to the URL? There you can grant the permissions to use video, audio and microphone even if Chrome doesn't ask for it specifically.
Or is it possible that you blocked the sound for Chrome in Ubuntu's sound settings?


Script for an incremental file system backup

You may wish to use a tool that automates the whole process for you, such as rsnapshot, which seems to implement what you are trying to do.


Future of Btrfs in Ubuntu - what is the plan?

It is too early to say. If that happens, it'll happen when it happens. If you want influence over the discussion, join the mailing lists and get involved. That's the beauty of a community-driven distribution.

But to try and give you some solace,

There are many companies involved in the development of Btrfs.
Red Hat (through RHEL) only targets enterprise deployments. Many of the other contributors target wider userbases.
RHEL "support" is somewhat different from community support. You're paying them to work through your problems whereas there's really no warranted service provision from the community. We volunteer. RH clearly doesn't think it makes commercial sense —for them— to support Btrfs.
From what we can see externally, Red Hat are targeting a different next-gen storage solution. Why? Maybe they think it fits their customers better. Maybe it's cheaper for them to support. Probably both.

I don't think Btrfs is going anywhere until something comes out that's objectively better. That doesn't happen overnight.


The noip2 (no-ip.com) package was deleted from the repository, now what?

Security issues with noip2

The removal of the noip2 Dynamic Update Client (DUC) from the repository is explained in
Debian bug #653957.
One of the problems was a security issue, described in
Debian bug #601229.

In addition to those problems, noip2 (at least version 2.1.9) sends your password unencrypted over the internet, which is a particularly bad thing if your No-IP account contains MX records (e-mail domain names), IMAP accounts, or any other important services.

If you want to continue to use the noip2 client, it could be a good idea to use a sub-account, i.e. a group with password (this feature is a pay-service). This way, the password only gives access to updating the specified hosts and not full access to your entire No-IP account.

Use ddclient instead

A good alternative to noip2 is ddclient. It can be found in the repository and it can use secure connections. How to set up ddclient for No-IP is described here:

How can I set up a Dynamic DNS fetching service on Ubuntu Server?


The following will show you how to setup LAMP, and install phpBB on Ubuntu 14.04 - Desktop X86-64 for the purpose of running it locally through http#://localhost/. If your goals are more advanced than that you will need to provide further clarifications in your post.

[Any urls I've typed that have a # after the http/https should not be typed. I just did that to bypass the max 2 urls limit, and the inability to post local host links.]

Steps:

In terminal type "sudo apt-get install lamp-server^".
You will be prompted to pick a root password for MySQL.
In terminal type "sudo apt-get install phpmyadmin".
You will be prompted to pick a web server; choose "apache2".
You will be prompted to configure database for phpmyadmin wiht dbconfig-common; choose "yes".
You will be prompted to provide the password for the database's admin user. Enter the password you previously choose for MySQL root.
You will be prompted to pick a password for phpmyadmin.
Open Mozilla Firefox, go to https://www.phpbb.com/downloads/ and download the .zip file for phpBB. [At this time the current version is 3.0.12.]
Navigate to where you saved it, the default is your Downloads folder, and extract the contents by right clicking and choosing "extract here".
Enter the folder that was extracted, select all, and copy.
In terminal type "sudo -i nautilus",browse to "/var/www/html", delete "index.html", and paste in the PhpBB files.
Right click on "config.php" and change the "others" settings to "read and write".
Open Firefox, and visit "http#://localhost/install/index.php". Click the "install" tab, "proceed to next step", and "start install".
In another tab visit "http#://localhost/phpmyadmin/". Login using "root" as the username, and the MySQL password you choose during installation.
Click on the "databases" tab, enter a name (eg: phpbb), and click "create". Under the tab "more" click "prividges", and the "add user". Enter a username, enter a password, and click "check all" for global permissions. Leave the other fields blank, and click "go" at the very bottom of the page. Logout of phpmyadmin.
In the first tab you can now enter you details. Being the name you choose for the database, the user name you just created, and the password for the user account you just created.
You will now setup a user account on PhpBB.

screenshot 1: https#://copy.com/NRb3H93J4G1U
Now the "advanced settings" for which you can leave the default settings.
You will get a congratulations screen telling you that phpBB is setup.
In terminal type "sudo -i nautilus", and navigate to "/var/www/html". Delete the "install" directory.
You can now access phpBB from "http#://localhost/".

screenshot2 = https#://copy.com/pqbNg62StakT

screenshot3 = https#://copy.com/YlfAlkPRR6P6

Notes:

PhpBB requires some directories to have 777 permissions. By default these folders should already have these permissions, but if for some reason they don't you will need to manually change them. See the official installation guide for details regarding which folders to change: https://www.phpbb.com/support/documents.php?mode=install&version=3&sid=d113b3ae012cbd0d9e8c0736f8c9a02d#quickinstall
Tested with Ubuntu 14.04 - Desktop X86-64 on May 31 2014
Tested with Ubunty 16.04 - Desktop X86-64 on August 30 2016


Try this command

sudo service lightdm restart

If lightdm fails to get back to normal :-

then Run:-

`sudo apt-get update`

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


How do I sign a file with my smartcard on Ubuntu 20.10?

I solved the issue using an app distributed by poste.it
other options such as dike, the estonian app, etc. all had issues with groovy gorilla


How to install gst-plugins? Unable to locate package

gst-plugins-* is somehow an alias or vice versa for the name of the related source packages withing the repositories.

If you search for Gconfaudiosink you will reach to this page: gconfaudiosink at freedesktop.org, and you will find out that the gconfaudiosink should be a part of:
 GStreamer Good Plugins 0.10.

Also, if you search in the gst-plugins-good repository on GitHub for gconfaudiosink yo will find out some commits with that names and you will be pretty sure that it's the correct package.

To download and install the binary package:

sudo apt install  gstreamer0.10-plugins-good

To download the source you can use either of these commands:

Just to show that gst-plugins are avaiable from source.

apt source --download-only gst-plugins-good0.10

apt source --download-only gstreamer0.10-plugins-good

I also downloaded the source package to have look around it, and yes, the file you are looking for is there:

~/gst-plugins-good0.10-0.10.31/ext/gconf/gstgconfaudiosink.c


The logs should always be your first port of call. Check syslog for anything untoward:

less /var/log/syslog

Also check the Xserver logs in case there's any indication of a graphics driver problem (although that sounds less likely given your description):

less /var/log/Xorg.0.log

In your particular case, these steps might not throw up anything interesting. In which case, I'd be interested to see what's going on on your system at the time of the problem developing. To that end, personally, I'd set up a temporary log of top output at short intervals - say every 5 or 10 seconds. This should hopefully reveal if a process is running wild with resources at the time of the issue.

Note that alternatives exist, such as switching to another tty with Ctrl+Alt+F1..F6 (to get back to the GUI, it's Ctrl+Alt+F7) and running commands interactively, or configuring a SSH server and logging in remotely. Both of these might be awkward if your machine is moreorless nonresponsive, hence my more awkward suggestion to write a logfile (which could also encounter the same problem, but is more likely to succeed).

It would involve something like this:

while [ 1 -eq 1 ] ; do top -b >> ~/top.log; sleep 10; done

This would write top output to a logfile at ~/top.log every 10 seconds or so. Note that this log would grow quite large if this command is left running for a prolonged period, so keep an eye on it if your machine suddenly starts behaving itself! And remove the log with rm ~/top.log when you're done with it. Note also that executing the above command is a one-time thing; it won't restart itself after a reboot.

To read the logs generated after a crash, you'd use

less ~/top.log

and hit the End key to get to the bottom. You'd be looking for processes with an unusually high %CPU value, or an unusually high RES value.

It may or may not help, but it's handy information to have.


Filezilla is already available in default repos of Ubuntu 13.04

You can try this

> sudo apt-get update
> sudo apt-get install filezilla

nischay@NischayLaptop:~$ apt-cache search filezilla

filezilla - Full-featured graphical FTP/FTPS/SFTP client
filezilla-common - Architecture independent files for filezilla

nischay@NischayLaptop:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"


Terminal not opening when in root mode in nautilus. What to do?

I've had a number of experiences where terminal wouldn't open. To work around this I created a keyboard shortcut with dbus-launch gnome-terminal

Perhaps creating a similar shortcut for nautilus would remedy the problem?

dbus-launch nautilus

You can try it at a command prompt and see if that is a bridge fix for you.


Why aren't there multiple notifications? And how to enable?

No, there is not a way to enable multiple notification bubbles:

  JD, this is the intended behaviour. We queue application notifications,
  so that only one will be displayed at any time. That means they are
  delivered asynchronously, which drives a number of the changes in our
  implementation from other implementations.

  - Mark Shuttleworth


How do I configure x11vnc.service to run x11vnc as root?

You could try adding -auth /run/lightdm/root/:0 instead of guess, as this is the default path for quite a while now with most distros/display managers.
If this doesn't help, it seems there is a race condition despite the ordering you enforced via your service file. Maybe the display-manager service signals "ready" before everything is actually properly up. A not-so-nice-but-works workaround for that could be adding ExecStartPre=/bin/sleep 5 to your service to make sure X11 is properly up and running.
There is also libvnc.so from the TigerVNC package (apt install tigervnc-xorg-extension), which is a module you can load directly into your X11 server. In theory that should yield the best performance, but last time I tried it there were issues with some applications (like VMware Player) just displaying as a black window remotely.
Create /etc/X11/xorg.conf.d/10-vnc.conf with content:
Section "Module"
Load "vnc"
EndSection

Section "Screen"
Identifier "Screen0"
Option "UserPasswdVerifier" "VncAuth"
Option "PasswordFile" "/path/to/passwd"
EndSection

Where /path/to/passwd was created via the vncpasswd command.


CPU temperature embedded in Bash command prompt

Yes, it is possible, but the details depend on your system. In most cases, the command sensors should show it.

Install the necessary package

sudo apt-get install lm-sensors

Run sensors-detect and follow the prompts

sudo sensors-detect

Install any extra drivers if sensors-detect tells you to.
Run sensors to make sure it works

$ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +27.8°C  (crit = +110.0°C)
temp2:        +29.8°C  (crit = +110.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +63.0°C  (high = +105.0°C, crit = +105.0°C)
Core 0:         +62.0°C  (high = +105.0°C, crit = +105.0°C)
Core 1:         +63.0°C  (high = +105.0°C, crit = +105.0°C)

nct6776-isa-0a00
Adapter: ISA adapter
Vcore:                  +1.86 V  (min =  +0.00 V, max =  +1.74 V)  ALARM
in1:                    +1.36 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
AVCC:                   +3.33 V  (min =  +2.98 V, max =  +3.63 V)
+3.3V:                  +3.33 V  (min =  +2.98 V, max =  +3.63 V)
in4:                    +1.01 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                    +0.00 V  (min =  +0.00 V, max =  +0.00 V)
in6:                    +0.21 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
3VSB:                   +3.31 V  (min =  +2.98 V, max =  +3.63 V)
Vbat:                   +3.18 V  (min =  +2.70 V, max =  +3.63 V)
fan1:                     0 RPM  (min =    0 RPM)
fan2:                  3292 RPM  (min =    0 RPM)
SYSTIN:                  +0.0°C  (high =  +0.0°C, hyst =  +0.0°C)  sensor = thermistor
CPUTIN:                 +51.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = CPU diode
AUXTIN:                  +0.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = CPU diode
PCH_CHIP_CPU_MAX_TEMP:  +58.0°C  (high = +80.0°C, hyst = +75.0°C)
PECI Agent 0:           +60.0°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +105.0°C)
PCH_CHIP_TEMP:           +0.0°C
PCH_CPU_TEMP:            +0.0°C
intrusion0:            OK
intrusion1:            OK
beep_enable:           disabled

Parse the output to get only the CPU temperature.

As you can see above, the output on my system is different than yours. However, the line we care about here is the same. You can get the CPU temperature with:

$ sensors | grep -oP 'Physical.*?\+\K[0-9.]+'
63.0

Edit your ~/.bashrc (or equivalent file if you're using another shell) and add a function that runs the command above:

show_temp(){
    sensors | grep -oP 'Physical.*?\+\K[0-9.]+'
}

Use the function in your prompt. For example:

PS1="\u@\h $(show_temp) $ "


First try to update then upgrade your current version. If that didn't make it, than I imagine that you don't have required headers try:

$ sudo apt-get install linux-image-4.2.0.34
$ sudo apt-get install linux-headers-4.2.0.34
$ sudo apt-get update
$ sudo apt-get upgrade


If I already have windows as separate partition, is there a way to run this with VirtualBox?

Yes its possible, to run windows (at real partition in your hd) in native and at virtualbox, but (we always have "but") its more problems than honey.

we have chance to catastrophic errors (boot active host linux as guest)
windows detect a new hardware (now its virtualbox hardware)
maybe you need re-register windows
and for sure need reinstall lot of drivers

I try it. Sure you have solution for each above points, but you get more problems than solutions. Its a lot easy install a new windows and re-install windows app you need.

(my 5 cents)


The simplest is to make an alias in your .bashrc.

To do so open your .bashrc with:

nano ~/.bashrc

or

nano ~/.bash_aliases

and add  in the section # some more aliases a new  line containing

alias python='python3'

Open a new terminal and it should work fine.

NOTE: It's not recommended to make a symbolic link in your /usr/bin.

For visual studio code: The settings for python3 has to be set within the program - look at this link how to set the right python path.


Ubuntu 12.10 Fresh Install Blank Screen Issue With Gateway Nv7802u Laptop

Apparently I fixed it by pressing the brightness key on my laptop. Which was strange because yesterday it didn't do anything. But I also found out that it was a brightness issue and that Ubuntu apparently interprets my brightness keys the wrong way. So lets say I press Fn+Up it dims instead of brightening. Kind of strange but I can live with it until I get a new machine. Thanks for the help.


How to do a  Automatic shutdown when Dropbox stops synching?

I would create a script that runs every 30 seconds (after being manually invoked by the user), and checks the output of the command dropbox status. If the status is found to be Idle for 3-4 consecutive runs, I would then issue the command for shutdown.


Looks like it is a temporary issue with keyserver.ubuntu.com itself. I couldn't upload my PGP keys to it for a couple of days either. And currently, the signing key for a newly created PPA is not showing up there although more than four hours has already passed since the PPA creation.


What you have is a fake raid controller.  Blow away the array in the bios and set up a software raid during install.


Why does my choice of mouse cursors only work sometimes?

After putting up w/this for the better part of a year, I finally hit upon https://askubuntu.com/a/295114/412179, specifically, the part where he talks about editing /usr/share/icons/default/index.theme. It seems some quirk of Ubuntu 18 that will only be affected by what's in that file.


Which version of OSS do I download for drivers for my soundcard?

Ubuntu 64 bit 13.10  means you are using amd64 so this one:

Linux 2.6 (amd64): For any Linux 2.6.xx kernel ether SMP or UniProcessor kernel on AMD Athlon64/Opteron

would be my choise. The easiest method is to remember what the name of the ISO was that you downloaded. It will have amd64 or i386 (that would be the 1st group you listed) in the name.

By the way: solaris is a totally different platform. So are "all the others". General rule: 1st try ubuntu software center, next try to find a debian installer (.deb), next tar.gz marked as Linux i386 (32 bit) /amd64 (64 bit). And if that fails you might consider hunting down the source and compile yourself.


Apitude Doesn't work, Unmet Dependancies error for any Program

@The Syndicate's diagnosis is right. Your whole package set is probably out of whack. I suspect you have different versions installed in this piecemeal way. Take your peddle off the gas when you are trying to figure out what's wrong.

Don't rush everything into one command. Do not try to do the automatic thing when there are malfunctions.  Run "sudo apt-get update" (I'm old fashioned on the '-get' part, apt is what they suggest now, but I'm not changed over.) Review if it can talk to servers correctly.  It may be looking for files on versions that you are no longer running.  All of this is configured in /etc/apt/sources.d, most likely. Once you get the update to run, try next setp.

Find out how bad your update problem is going to be.  Run

apt-get upgrade

DO NOT use -y, don't make this automatic. This will do nothing, it will review changes it wants to make. You need to know what things you have now are contradicting what you want to install.  You may be able to run "apt-get install xyz" to get a particular package. The message about fortune is telling you that the package you are asking for does not exist by that name anymore.  The error you got about other things required by fortune-mod was telling you it requires a newer or older package of something else but the automatic updating system was not pulling the version you needed. In presence of danger, try to understand what's going wrong.

The error you got happens when you surf around the net and pull in versions of packages that are not from the main repositories.  You get newer versions of things that contradict what the main Ubuntu wants to do.

The request for "linux-image-4.13.0-37-generic" signals the fact that the apt upgrade will often refuse to fiddle with kernel packages. I'm using Ubuntu 18.04 after upgrading from 17.10, here are all of the linux-image files I have:

$ dpkg -l | grep linux-image
ii  linux-image-4.13.0-36-generic                               4.13.0-36.40                                amd64        Linux kernel image for version 4.13.0 on 64 bit x86 SMP
ii  linux-image-4.13.0-39-generic                               4.13.0-39.44                                amd64        Linux kernel image for version 4.13.0 on 64 bit x86 SMP
ii  linux-image-4.15.0-20-generic                               4.15.0-20.21                                amd64        Signed kernel image generic
ii  linux-image-extra-4.13.0-39-generic                         4.13.0-39.44                                amd64        Linux kernel extra modules for version 4.13.0 on 64 bit x86 SMP
ii  linux-image-generic                                         4.15.0.20.23                                amd64        Generic Linux kernel image

The kernels 4.13 are old ones still floating about.  If you are on current Ubuntu, your kernel would be 4.15.0

$ uname -a
Linux delllap-16 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Sometimes it is easier to work this out with the package manager named synaptic. Have you tried it?  Its old school, but helpful. Maybe your system is no so far gone, if you can succeed with

apt-get install synaptic

then run

sudo synaptic

it gives you a more granular view of your situation.


dpkg --configure -a hangs when found initrd image

Temporally fixed it!

After some reboots and some attempts to apt-get update, apt-get upgrade, apt-get dist-upgrade and dpkg --configure -a, the last command finally ended successfully and the rest of commands started to also run with success.

Updated to 3.19.0-42-generic kernel during the process.

So I'm not sure what exactly caused it, neither what exactly fixed it, but anyway... :)


I know it's too late but I had same issue today and finally find out that it could be solved by removing docker.io and reinstall it
sudo apt remove docker docker-engine docker.io
sudo apt install docker.io

PS: another solution that works for me is this:
sudo apt remove docker-ce runc
sudo apt install docker-ce

After that I restart gns3 and it works fine.


The first step whenever you are debugging something is to have your script print the various variables it is using. For example, here, if you add an echo $choice before the case statement, you will see that it will print 0 no matter what value you give it.

This is because you're using the -i option to declare which does (from help declare):

  -i    to make NAMEs have the `integer' attribute

So, you are declaring that variable to be an integer and then are passing it letters (strings) and since bash is expecting an integer, it converts it to a 0.

The next issue is that you are running a while loop that will only exit when $choice is 5. Even if the rest of your syntax were OK, that would only happen for choice e.

Here is a working example of your script. I have removed the declare which is unnecessary.

#!/bin/bash

## Use another variable to exit the loop
ok=0;

while ((ok==0))
    do
    echo "Main Menu:"
    echo -e "\t(a) Add a contact"
    echo -e "\t(b) Remove a contact"
    echo -e "\t(c) Seach contacts"
    echo -e "\t(d) Display contacts"
    echo -e "\t(e) Exit"
    echo -n "Please enter your choice:"
    read choice
    case $choice in
        "a"|"A")
        ok=1
            ;;
        "b"|"B")
        ok=1
            ;;
        "c"|"C")
        ok=1
            ;;
        "d"|"D")
            ok=1
        ;;
        "e"|"E")
            exit
        ;;
            *)
            echo "invalid answer, please try again"
            ;;

    esac
done

echo "You entered $choice"


How do I get TV out working on an ATI X800 GTO²?

From the X.Org Wiki:

You can enable TV-Out either dynamically (by issuing commands to the running X server) or statically (through the xorg.config file, before starting the X server). For testing, the dynamic method is probably easier.

Enabling TV-Out Dynamically

TV-out may be enabled by using a recent driver and xrandr utility:

xrandr --addmode S-video 800x600

xrandr --output S-video --mode 800x600

xrandr --output S-video --set tv_standard ntsc

Enabling TV-Out Statically

Several options need to be specified. See the radeon(4) manpage for a description. In particular, you must set "TVStandard" to match your flavour of video.

This recipe is not definitive, but it has worked.

In the "Device" section:

   Driver  "radeon"
   Option "TVDACLoadDetect" "TRUE"
   Option "TVStandard" "ntsc"
   Option "monitor-S-video" "TV-monitor"

In the "Monitor" Section:

   Option  "PreferredMode"  "800x600"

In the "Screen" section:

    DefaultDepth  24
    SubSection "Display"
            Depth          24
            Modes         "800x600"
    EndSubSection


Again, try installing the Proprietary Drivers for nVIDIA.

Search for "Jockey" in the Dash, then click Additional Drivers. Find the one that says "nVIDIA" in the title.

Click Activate. The games should work.


Alternate between windows on launcher click

There is not, exactly. It will focus that application. If you click it while that application is focused though, it should show the zoomed out view of all the application windows and you can click on another that way.


Is it possible to set a portable application as default?

It is possible to set a portable application as default, but if you have a special filetype (e.g. .skp for SketchUp under Wine), you need to create a mimetype, and then add the 'MimeType' to the launcher file (I found this out by looking at wine deals with stuff by placing launchers in ~/.local/share/applications and stuff in ~/.local/share/mime). You can check if it has a mimetype by looking at the File's properties in Nautilus (may work with other file managers):

If the mimetype already exists (e.g. text/plain), it is quite easy to make a launcher for it. As an example, you can create a launcher like this:

[Desktop Entry]
Type=Application
Name=Custom Program
Icon=firefox
MimeType=text/plain;
Exec=gnome-terminal -e "nano %f "
NoDisplay=true
StartupNotify=true

save it to ~/.local/share/applications/Custom Program.desktop, and you should get (perhaps after logout/login, restarting the file manager, running update-desktop-database ~/.local/share/applications/ or something):

Which should be able to open txt files in nano in gnome terminal. You should also be able to make this program default in the File manager;s properties.

If you are using a custom version of a existing system installed version of a program such as VLC, you can make/edit a launcher based on the existing one in /usr/share/applications:

[Desktop Entry]
Version=1.0
Name=VLC media player
GenericName=Media player
Comment=Read, capture, broadcast your multimedia streams
Exec=/usr/bin/vlc --started-from-file %U
TryExec=/usr/bin/vlc
Icon=vlc
Terminal=false
Type=Application
Categories=AudioVideo;Player;Recorder;
MimeType=video/dv;video/mpeg;video/x-mpeg;video/msvideo;video/quicktime;video/x-anim;video/x-avi;video/x-ms-asf;video/x-ms-wmv;video/x-msvideo;video/x-nsv;video/x-flc;video/x-fli;video/x-flv;video/vnd.rn-realvideo;video/mp4;video/mp4v-es;video/mp2t;application/ogg;application/x-ogg;video/x-ogm+ogg;audio/x-vorbis+ogg;audio/ogg;video/ogg;application/x-matroska;audio/x-matroska;video/x-matroska;video/webm;audio/webm;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-wav;audio/x-mpegurl;audio/x-scpls;audio/x-m4a;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;application/vnd.rn-realmedia;audio/x-real-audio;audio/x-pn-realaudio;application/x-flac;audio/x-flac;application/x-shockwave-flash;misc/ultravox;audio/vnd.rn-realaudio;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-wav;audio/x-pn-windows-acm;image/vnd.rn-realpix;audio/x-pn-realaudio-plugin;application/x-extension-mp4;audio/mp4;audio/amr;audio/amr-wb;x-content/video-vcd;x-content/video-svcd;x-content/video-dvd;x-content/audio-cdda;x-content/audio-player;application/xspf+xml;x-scheme-handler/mms;x-scheme-handler/rtmp;x-scheme-handler/rtsp;
X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb
Keywords=Player;Capture;DVD;Audio;Video;Server;Broadcast;
X-Desktop-File-Install-Version=0.22

You could use this, modify the Exec and Name path (you can remove the TryExec), add it to one of the application launcher directories, and have your own custom VLC launcher :)

See also:

Desktop Entry Specification

For an example on how to set as default portable applications downloaded from portablelinuxapps.org or others made portable with the utilities that can be also downloaded from there, take a look at this answer about VLC.


How can I change folder permissions in a luks encrypted partition

sudo chmod -R 777 /media/user/luks-partition/folder

Also, to change the Owner: sudo chown -R username /media/user/luks-partition/folder

I would look into what permissions you should use though too.
http://en.wikipedia.org/wiki/Chmod


In your case there is no need for a makefile, since make has built-in rules that know how to compile a simple program.

Easy way

Create a hello world test program named test.cpp.

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello, World! << endl;
    return 0;
}

Change directories with cd to the directory containing test.cpp and runmake.

make CC=g++ test

In order to run the above command make and g++ must be installed.
Run the test executable.

./test

Results of ./test :

Hello, World!

Hard way

Create a hello world test program named test.cpp, the same as in the easy way.
Change directories with cd to the directory containing test.cpp and create a makefile named makefile1.

CC      = clang++
CFLAGS  = -g
RM      = rm -f

default: all
all: Hello
Hello: test.cpp
    $(CC) $(CFLAGS) -o Hello test.cpp
clean veryclean:
    $(RM) Hello

The two indented lines must begin with tabs, not 4 spaces. The above makefile will also run correctly if you replace clang++ with g++ .
Runmake.

make -f makefile1

In order to run the above command make clang and g++ must be installed.
Run the Hello executable.

./Hello

Results of ./Hello :

Hello, World!


Use su without sudo to correct the mistaken text file entry. The real root user can perform the task without using the sudo system


How to configure locations of installed applications on Ubuntu 18.04

I recommend installing all applications on the SSD. SSDs have no moving parts and are more reliable and have a longer life expectancy than HDDs. If disk space on the SSD is at a premium, you can save valuable disk space on the SSD by configuring the default locations of the guest OSs in VirtualBox to be on the HDD. In addition you don't need to store much data in your /home directory on the SSD. In order to free up space on the SSD, files that take up a lot of space such as your music library can be stored on the HDD instead. Another way of saving space on the SSD is to move your entire /home directory from the SSD to the HDD by following the instructions in the answers to: Move home folder to second drive.

You can use custom folders for folders in /home/. Example:

 xdg-user-dirs-update --set DOWNLOAD /media/user/Downloads/

would switch from /home/$USER/Downloads/ to /media/user/Downloads/ and documents downloaded would then download to the HDD and not the SSD. Same applies for all the other directories. See ~./config/user-dirs.dirs on manually editing these settings.


xserver-xorg-core update failed. Not fully installed or removed

Problem caused because that you are trying to install a package which is available in 14.04. The xserver-xorg-core version appropriate for 13.10 is 2:1.14.3 See.

You can install xserver-xorg-core appropriate for your system by just typing :

sudo apt-get install xserver-xorg-core

If you are still having the problem please add the output of :

apt-cache madison xserver-common


I can't resize/partition my disk using gparted

When you shut down Windows 8, 8.1 and 10 it's is not really shut down. It's a hybrid between shut down and hibernation. Filesystem on Windows is not really closed too. To get rid of those exclamation marks RESTART Windows and then boot into Linux. Then GParted should be able to do partition resizing.


Wrong locale alpha-numeric display in spite of locale settings?

For some reason, the System Settings>Locale just didn't take effect.

The locale can be set manually, according to the document linked in the question, by setting the desired locale value instead of the wrong locale value (in my case en_GB.UTF-8 instead of en_NP).

The locale settings are written to /etc/default/locale, hence to modify them: sudo nano /etc/default/locale, change the values, save the file and reboot.


Sublime 3 Stopped Working on Ubuntu 14.04 after System Crash

If an application does not work after a crash
Remove ~/.config/sublime-text-3, immediately log out and back in. I am pretty sure it will work then.
In these situations, local files can get corrupted, rather then the global ones. The fact that you reinstalled Sublime Text with no success is another indication the cause is locally.


Daily (open source) Bible devotional guide software

Try Xiphos  or gnome-sword  (this is for older installations) for a complete solution, including the option to install daily devotionals (though nothing beats reading the Bible as the Spirit leads in a free way ;)).

P.S. they are the same program, but Xiphos is the renamed newer version.

There is also bibletime  if you use QT/KDE or just want variety.

If you want to install extra Bible translations, Bible maps, and devotions, then add the crosswire.org sources within the program, and download as many as you want ;).

Hope that helps ^^!


I'm new with ubuntu and I made a misstake in system settings

To enable/disable touch-pad using the command line in Ubuntu.

It’s very easy, just open terminal from the dash or use key combination Ctrl+Alt+T

Then to disable the touchpad run the command

synclient TouchpadOff=1

To re-enable the touchpad

synclient TouchpadOff=0

This will enabled the touch-pad back.


NFS stops responding after connecting to NordVPN

Whitelist your local network in NordVPN
NordVPN has a whitelist option that can whitelist ports as well as IP address ranges. Try the command:
nordvpn whitelist add subnet 192.168.0.0/16

or alternately a more restrictive version should also work if your local network only consists of IP addresses in the ranges 192.168.0.xyz, where xyz is a number between 1-255.
nordvpn whitelist add subnet 192.168.0.0/24

See NordVPN's support page for more information.


Your .iso file is corrupted. Download it again. The best way is to use torrent to be sure the right image has been downloaded.


Can I create an image that incorrectly reports its file size?

Assuming you are not talking about
steganography, you can hide
a big image in a bigger file (perhaps the opposite of your question),
simply by concatenating it on the end of another smaller image.

Though you wont fool ls you will fool many programs that display or
manipulate the image, as they will only see the first part of the file and
report the size of the first image and ignore the second bigger image.

cat a.png b.png >new.png
identify a.png b.png new.png

a.png   PNG 114x98 114x98+0+0 8-bit sRGB 2.51KB 0.000u 0:00.000
b.png   PNG 81x54  81x54+0+0 8-bit sRGB 256c 2.86KB 0.000u 0:00.000
new.png PNG 114x98 114x98+0+0 8-bit sRGB 5.36KB 0.000u 0:00.000


Acer Revo (ION platform) + Maverick + 5.1 surround over HDMI

Let's first start by making sure you've got updated alsa-lib (libasound2) and pulseaudio from maverick-proposed (note: you may have to use a non-updates/proposed kernel for testing).  Next, please see this link for trying the updated, daily-built sound drivers.


Here's what I've been able to find so far:

A: The amdgpu driver, pre-installed in 16.04, is used for AMD's newest graphics cards. 3
B: The radeon driver, also pre-installed in 16.041, is a replacement for the fglrx driver1, and is used for older AMD cards that amdgpu doesn't support.
C: amdgpu-pro is not its own driver, but rather an overlay on top of amdgpu2. It is optimized for gaming2.

I think Ubuntu decides automatically. Although the amdgpu-pro driver has to be downloaded manually.

The amdgpu driver is completely open-source
The radeon driver is completely open-source
The amdgpu-pro driver is partially open-source

I have no idea. Probably not.
Still have to do more research....
amdgpu-pro is the replacement for fglrx.


/usr/bin/java: No such file or directory

In a terminal, run the following:

update-java-alternatives -l | awk '{ print $1; }'

Pick one of the listed options, and run:

sudo update-java-alternatives -s the-option-you-chose


You can do this pretty easily by modifying your grub file.  I use Grub Customizer for this purpose:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

After installation, start the program by opening the dash, and entering 'grub'.  On the tab marked 'General Settings' you can set the default OS to start, and the timeout before it automatically starts that OS


BIOS
Gigabyte Z390 Aorus Pro WiFi
You have BIOS version F12c.
There's a newer BIOS available, version F12j, dated 9/16/2020, and can be downloaded here.
Note: Confirm that I have the correct web page for your motherboard.
Note: Have good backups before updating the BIOS.
memory
Go to https://www.memtest86.com/ and download/run their free memtest to test your memory. Get at least one complete pass of all the 4/4 tests to confirm good memory. This may take many hours to complete.


How to save battery life in Dell Vostro 3446 (Ubuntu 15.04)

The laptop consumes a lot of power because both video adapters always work.
You need to install Nvidia proprietary video drivers and switch to integrated video.
Nvidia graphics acceleration is needed mostly for gaming.

Run in the terminal

sudo apt-get install nvidia-346 nvidia-prime

And reboot.

After that you will be able to switch video adapters in NVIDIA X Server Settings application.

If after reboot graphics do not start (this happen sometimes), then press Ctrl+Alt+F1, login to console and run

sudo apt-get purge nvidia*

And reboot again.

I hope this will not be necessary. Otherwise we will install a newer driver.


Problems executing make USE_PGXS=1 on Ubuntu 14.04(postgresql9.3)

Install freetds-dev:

sudo apt-get install freetds-dev


gconf override glib schema error - "can not parse as value of type 'd'"

So it turns out it's the quotation marks that mess this up. The contents of the file should be:

[org.gnome.desktop.interface]
text-scaling-factor=0.75
scaling-factor=2


SSH Into Server - Network Error: Connection Timed Out

I don't mean to insult  you by telling you the obvious. I seem to do that a lot.

I suspect you are not using the correct IP to talk to the SSH server from your computer. Remember, inside the router area, the server will have an IP number that is meaningful only inside the router's subnet, usually 192.168.xxx.xxx.  That works fine for everybody within the router, such as friend A.

Now, from outside the router, you probably need to log in differently on the server.  Server has different address if you look at it from outside the router. Right now,  my computer is given dynamic ip at 192.168.0.105, for example, but my IP seen by rest of world is the IP assigned to my router by the cable company.

Here's what I'd do if I were you.  Go to the server and use it to log in on the website "whatismyip.com".  That will tell you what IP  number your system seems to be on.  However, you will probably find that every other computer in that subnet appears to be at same outward facing IP.  Hence, you cannot "get into" your server using that IP.

Usually, you have to configure the router so that messages on a port (SSH usually 22) will go to one of the computers inside the network.

You say it is set up as DMZ, which I remember from days of playing computer games, but it does not tell us much about how your computer is getting through to the server. In particular, the router has to pass through the messages to the server.

Think it over, let us know what you find out.


Create new admin account with other account's software already installed

By default the Ubuntu package management installs all applications for all users.

This will not stop you from manually installing additional applications to a user's HOME directory. In this case you will have to copy this installation over to the other user's HOME.

Most applications will store user defined settings in a user's HOME. Most but depending on the application not all setting may also just be copied over to a new account to make them identical.

A special case are virtual machine's hard drives or Wine bottles that will be stored in a user's HOME by default. To use these from all accounts we can either make a copy resp. clone them to the other account, or we make sure we store these in a shared directory accessible to multiple users.


Change colour of calendar on ubuntu phone

Open a drop-down menu with the button in the right top corner.
Select 'Calendars'.
Do a long press on the black square that is next to the google calendar.
Color picker should appear.

For more precise control the colors of the color picker are defined in the source file
/userdata/system-data/opt/click.ubuntu.com/com.ubuntu.calendar/current/ColorPickerDialog.qml on the phone. So it's possible to manually smuggle some different color.


The answer to your question is as follows:

It's not possible to have the super-slick Alt-Tab switcher because you're using Unity 2D and not 3D.


I want to completely uninstall IntelliJ IDEA community Edition

I did it by installing JetBrains Toolbox and uninstalling it from there


What's the current status of migration-assistant?

The Migration Assistant is still there. See
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/natty/ubiquity/natty/files/head:/ubiquity/plugins/

The Migration Assistant file was last modified in December 2010.


Resetting network settings in Ubuntu 13.04

I struggled with a similar problem, and I stumbled on this. It solved my problem pretty fast.

I first went to /etc/NetworkManager/ where I found the file NetworkManager.conf, then disabled Network Manager with this command:

sudo service network-manager stop

Then I opened NetworkManager.conf with the nano text editor:

sudo nano NetworkManager.conf

and changed ifupdown managed=false to ifupdown managed=true

then restarted the Network manager using this:

sudo service network-manager start

And that's it!


Appear To Have Cinnamon Backgrounds In Ubuntu 12.04

As per this comment:

  ... I just un-installed Cinnamon and the issue went away. Cinnamon is no longer among my login options. – ChunkyDrew 41 mins ago

one should uninstall cinnamon-desktop.


Nevermind. I see that gedit is marked as unmaintained and is seeking maintainers . I switched to geany and setting up F5 for the date/time is trivial (Preferences/Keyboard/Keybindings.


why does Ubuntu software have so many dependencies (.deb) files and Windows and Mac doesn't?

Programs often use some of the same files as each other. Rather than
  putting these files into each package, a separate package can be
  installed to provide them for all of the programs that need them. So,
  to install a program which needs one of these files, the package
  containing those files must also be installed. When a package depends
  on another in this way, it is known as a package dependency. By
  specifying dependencies, packages can be made smaller and simpler, and
  duplicates of files and programs are mostly removed.

  When you install a program, its dependencies must be installed at the
  same time. Usually, most of the required dependencies will already be
  installed, but a few extras may be needed, too. So, when you install a
  package, don't be surprised if several other packages are installed
  too - these are just dependencies which are needed for your chosen
  package to function properly.

The advantage is that you don't accidentally download multiple copies of the same dependencies, which can often be the case with windows. There and installer will often carry copies of the required dependencies, and install them in a separate location. Which will cause problems with the path when the system finds the same thing (or worse the same thing in different versions) in 2 locations.

Source:Ubuntu Help


Just update-grub put the new installation at the end of the list, my concern was unjustified. Thanks for the help  PRATAP .

It seems a long way around but life's short and that works!


I had a similar problem that the installer could not write a registry key.

I found this comment how to switch wine to 32 bit. I used probably 64 bit on Ubuntu 16.04 LTS.

That worked fine for me...

Oh, year, and I set up the windows version to Windows 7.


How to manually download Ubuntu Touch Image for Ubuntu emulator?

Open the terminal and navigate to the chache image directory:

  cd ~/.cache/ubuntuimages/pool/

Get the name of the image file which was partially downloaded:

  export IMGFILE=$(ls ubuntu*xz_)

Generate the link and download the file with pause/resume support:

  wget -c http://system-image.ubuntu.com/pool/${IMGFILE//[_]/}

Once downloaded, create a new instance of Ubuntu Touch:

  ubuntu-emulator create instance_name


How do I run Ubuntu 12.04 ARM supported Edition on Oracle Virtual Box on Windows

Sorry, Virtualbox does not support hardware emulation of the ARM architecture. You may want to look at qemu instead, which does support software emulation (slow, but works).


Erase and Install a fresh copy of Ubuntu to start over

Christina,  At least your are trying.  I will give you my best answer for now, since I don't know exactly what you are working with.  For starters, do you have a DVD player or are you using only usb? Reference: http://www.ubuntu.com/download/desktop

If you are using a DVD, you will want to download the iso image for your chip, (32bit or 64bit). If you can still use the operating system, burn the ISO and run the disk.  If you are using usb, you will have to create a bootable usb device. Reference: http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-ubuntu

You will have to make adjustments in your bios, select your boot device.  Once you get the correct device selected to boot, you will be able to follow the directions to install our software. When you get to the part that ask you how you want to install it, choose erase and use the entire disk.

Hopes this helps you.

Jim


The problem solved itself so I don't know how. :(


How can I recover from accidental chown -R

Try booting using advanced settings, and do a system restore...there is an option for that on the ubuntu bootloader menu


Is there an open source alternative to "Adobe Digital Editions"?

.acsm can only be used with Adobe Digital Editions and stands for Adobe Content Server Manager.

For more information about Adobe Digital Editions please see http://www.adobe.com/products/digitaleditions/faq/

Side note (may not be generally applicable to Digital Editions users): Stated in the agreement (may be of concern in making a program to access .acsm ) for Adobe Content Server section 11.1 you agree not to:

  (d) obtain or attempt to obtain any materials or Information through
  any means not intentionally made available through the Services;

 Interpret this as you will, I will not give you legal advice.


Neither pidgin or empathy receive offline Gmail chat messages

This is broken on the side of Google. See this discussion, we are not alone:

You have to go to gmail to see unread offline messages. They call this an improvement.


Cannot scan with Canon MX300, but I can print

Ciao.
I have an issue like you. The simple scan application solve all my problems.
Try with apt install simple-scan


How do i manage my battery more efficiently?

Well there's a known bug with the kernel but you can try this solution!

Open a terminal with ctrl+alt+T and put these commands one by one, copy one line at a time.

sudo add-apt-repository ppa:artfwo/ppa

sudo apt-get update

sudo apt-get install indicator-cpufreq

When you reset your pc will have an icon on the tray. Select the conservative plan for your cpu.


Why does the kernel not get updated when using a persistant Live USB?

i found this solution also on askubuntu and i apply it and worked for me and i share again here:

gksudo gedit /etc/kernel/postinst.d/zz-update-grub

**

Comment out line 15

**

BEFORE

*/postinst.d/*:|*/postinst.d/*:configure|*/postrm.d/*:|*/postrm.d/*:remove)
    exec update-grub
    ;;

AFTER

    */postinst.d/*:|*/postinst.d/*:configure|*/postrm.d/*:|*/postrm.d/*:remove)
#       exec update-grub
        ;;

Run the configuration script:

$ sudo dpkg --configure -a
(lots of debugging)
$

You should see a lot of debugging, and NOT the error line at the end.

To be sure, re-run the configuration. It should end immediately without any logs:

$ sudo dpkg --configure -a
$

Now, you can restore the zz-update-grub file, just in case you want to install an other kernel later and Grub start to work with overlayfs...


NVIDIA display issue with brightness control and video playback

This solution was initially posted by the OP as a part of the question.

To remove the NVIDIA drivers completely

sudo apt purge ^nvidia

Some of the additional components which may raise issue need to be removed

sudo apt purge bumblebee vdpauinfo vulkan-utils

The removed and the pending dependencies can be fixed by installing the Ubuntu Desktop

sudo apt install ubuntu-desktop

In some versions of Ubuntu the xorg config will create some issue so it needs to be removed. If not found it will be well and good.

sudo rm /etc/X11/xorg.conf

Now make nouveau the default driver

echo 'nouveau' | sudo tee -a /etc/modules

If nouveau was blacklisted it is advisable to remove the blacklist

sudo rm /etc/modprobe.d/blacklist-nouveau.conf

This the last and the final step of the process

sudo update-initramfs -k all -u

Reboot the computer and check the brightness controls and the video playback.


How do I choose the default guest session?

Changing the default is done through Login Screen Settings. At the bottom there is a drop-down list that lets you set the default. I'm not sure if this affects guest sessions too. Let me try it out and I'll update this post.

edit: Yeah it changes the guest session too. I guess it would've been obvious since you need to unlock it with admin privs. For some reason it doesn't work until a restart though.


XRDP - no matter what I do I can not make it work in 18.04 and Win10

First, check which version of Ubuntu 18.04 you are running...  To check this, type in a terminal the following command

lsb_release -sd

If you are running Ubuntu 18.04.3, there is a known issue with xrdp package provided by Canonical (more info at https://c-nergy.be/blog/?p=13390).  The xrdp package cannot install the xorgxrdp package because of failed dependencies.  This might be why you cannot connect remotely to your Ubuntu.

Best option -  Install the new xorgxrdp-hwe-18.04 package

Install the new xorgxrdp package by issuing the following command

sudo apt-get install xorgxrdp-hwe-18.04

This should fix your issue

Dirty Quick Fix - Downgrade xorgxserver package

We assume that you have already installed xRDP package and you want to fix it

sudo apt-get install xserver-xorg-core
sudo apt-get -y install xserver-xorg-input-all

Hope this help

Till next time

See ya


EDITOR environment variable changes after reboot

I usually configure this behaviour globally using update-alternatives:

$ sudo update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
* 3            /usr/bin/vim.basic   30        manual mode
  4            /usr/bin/vim.tiny    15        manual mode

Press <enter> to keep the current choice[*], or type selection number:

I've already selected Vim, but nano is the Ubuntu default. You would type 3 to select Vim in my example, if it weren't already selected.

As well as less, any program that calls an editor (such as sudoedit) should now call the selected one.


Unmount/Remove HDD with Windows on /dev/sda

When a drive is not spinning down, like I think you describe you want,  then use the hdparm it has option to set the time it takes for it to go to sleep.
How can I control HDD spin down time?


I experienced the same problem as you when I replaced Ubuntu 10.10 by a fresh install of Ubuntu 11.04 (and later on,  Ubuntu 11.10): my "console" tty's were desperately blanks but actually working -- i.e. I could log in and enter commands that actually work, but there was nothing visible on my screen.

I spent a huge number of hours on Google and various Ubuntu forums, I tried plenty of suggestions and I finally came to the following conclusion: the problem is linked to the proprietary NVIDIA driver -- if I remove the proprietary NVIDIA driver and use the "nouveau" driver, the problem disappears but then of course I can't benefit from the hardware acceleration any more.

I managed to fix the problem on my system (ZOTAC ZBOX with on-board NVIDIA GT218) by using the Uvesafb framebuffer driver.

Here is the procedure I used:

apt-get install v86d
apt-get install hwinfo
hwinfo --framebuffer

From hwinfo's output, I picked up the "best" resolution compatible with my screen -- in my case 1280x800 24-bit -- and I added the following line at the end of /etc/initramfs-tools/modules file:

uvesafb mode_option=1280x800-24 mtrr=3 scroll=ywrap

(The string "1280x800-24" comes from the resolution I chose -- your mileage may vary.)

Then I rebuilt grub and initramfs images as follows:

update-initramfs -u
update-grub

Finally I rebooted the system and my console tty's were finally visible again.

I don't use encrypted filesystem, so I cannot check whether or not the passphrase is to be entered "in the dark", but anyway I hope the above workaround will help you.


Nexus 4 not detected as USB device with OTA update 4.3

I had the same problem but I solved it a few seconds ago after reading a post on another forum.
It seems like the MTP option somehow got unchecked (not by me!), maybe when installing the latest Android update…

  Settings → Storage → ⋮ → USB-connection to computer → MTP media device ☑

Note that I run Android in Swedish, so the line above is only a translation from Swedish to English…


How can I run only one instance of Thunar?

Launch or Switch To
If the application by itself does not allow to connect to a running instance when it is run a second time, you can use wmctrl to switch to a running instance if present.
Following one liner will do:
wmctrl -x -a Thunar || thunar

This runs wmctrl, which will switch (-a, activate) to a window with class (-x) "Thunar". If the command fails, i.e., there is no such window, then the command after || is run, the command to start thunar. Find the correct window class (not sure if "Thunar" is valid) in the output of wmctrl -lx.
Adapting the launcher
You now can customize the launcher for Thunar in your menu. Launchers are text files with the .desktop extension. They live (among others) in /usr/share/applications. Copy the launcher of Thunar to your ~/.local/share/applications folder:
cp /usr/share/application/thunar.desktop ~/.local/share/applications

Then edit the copy and change the Exec= line to something like:
Exec=sh -c "wmctrl -x -a Thunar || thunar %U"

You enclose the command (which in reality is two commands) in a call to bash (sh -c) because launchers do not support having more than one command on the Exec is line. thunar %U should be the command that originally appeared in the launcher.
**Adapting a hotkey to launch Thunar"
If you use a hotkey to launch Thunar, you can instead specify sh -c "wmctrl -x -a Thunar || thunar as the command. Now, pressing the hotkey will bring a running instance in front if any is there.
Optional tip
Instead of directly using wmctrl, I use the bash script jumpapp (https://github.com/mkropat/jumpapp), which does the same but on steroids. Subsequent invocations will cycle through all open windows. The script has different options to cope with the particular behaviour of different applications.


How do you diagnose constant crashing issues?

When i have a problem like that i normally do the following:

In the grub menu select the RECOVERY MODE
When the blue menu appears select to run as root in the terminal/shell
When you login in the shell as root type dmesg to see any problem of devices when you were loading the system.
To see a more specific summary type cat /var/log/syslog which will show you EVERYTHING when you were loading the system.
You can add | less to the command above like this cat /var/log/syslog | less so it shows you the info and you press down or up to see the output and press Q to quit.
If everything shows good type startx which will start the gui desktop for gnome where the actual problem appears to be.
startx will mention what problem he is having in the terminal so you can fix it.
If by some chance the computer gets stuck when loading startx press CTRL+ALT+F2 or CTRL+ALT+F3 (OR F4,F5,F6) and type in your login user and password. Then type ps -ex so you can see the ID for gdm process or startx and just killall -9 startx / killall -9 gdm or kill -9 ID or whatever process it was loaded when you started startx. This way you will the process and the system is not stuck anymore.

With that you have dmesg, cat /var/log/syslog and startx to see where the problem is. At least for a quick look.

Let me know if it helps somehow. This is just a quick check for problems.


Go to Software Sources and choose extra drivers. Try to activate one, if available. Maybe, you will need an internet connection with a cable to activate the driver.


I recognized that my driver name is ath10k_pci instead of ath10k.. So after I added to /etc/modprobe.d/ath10k.conf "options ath10k_pci nohwcrypt=1" and I also replaced the default network-manager with wicd and it worked very slow and stable now.


Overlay scrollbars disabled on upgrade - how to reenable?

Linuxicle explains how to enable and disable the overlay scrollbar in easy method.

gsettings reset com.canonical.desktop.interface scrollbar-mode


No A2DP streaming audio from 12.04 to Bluetooth headset

I made it work the following way :

Before going further :

Update your system (I'm running 13.10)
Remove blueman
Install pulseaudio-module-bluetooth, pavucontrol (Utility to set up
pulseaudio) and make sure bluez is installed
Remove any "Disable=Socket" or "Enable=Socket" entry in file /etc/bluetooth/audio.conf
(edit with sudo)

Steps :

Put device in pairing mode (even if already paired)
Pair the device with your system using default bluetooth manager (blueman should have been removed) or if already paired go to step 3
Select A2DP or Audio Sink connection for the paired device.
If it fails try "sudo hciconfig hci0 reset" (where hci0 is your bluetooth device) check scan is ok with hcitool scan then retry this step (do hciconfig -piscan to identify your bluetooth device)
With pavutools, select a2dp in "configuration" tab and your device in "Playback" tab / If a2dp is not selected, try pactl list cards short" to get your device id (1,2,3..) then do pactl set-card-profile X a2dp where X is your device id
If it fails, restart avahi-daemon / bluetooth service and reset device through hciconfig hci0 reset. Check if scan is ok with hcitool scan. Then do steps 3 and 4


I want a non admin user to install software. What commands do I need to add to sudoers?

Note that giving users access to dpkg (or to a smaller extent any other package managers) effectively gives them complete root access. There is nothing stopping such a user from creating a totally new package with a setuid shell and installing it via dpkg, and then running that shell to gain full root privileges.


When you run apt-get remove <package>, it only removes the package itself, not the data files created by the application. apt-get never removes config/data files from users' home directories, so you'll have to delete these manually. sudo apt-get purge steam removes all general config files, if they exist (usually in /etc or /var/lib).

As an example, let's think about a server running MySQL and creating huge databases. Now, if I want to switch from MySQL to Percona Server, I don't want my databases to be removed when I run apt-get remove mysql-server && apt-get install percona-server, but instead I want the server itself replaced with the new package.

The same could be said for desktop tools such as Picasa if that's more easily approachable. You wouldn't want to lose your photo library when you remove the application itself, would you?


The Ubuntu Base you are talking about is a way to aggregate the updates available for ubuntu-desktop.

I run Xubuntu - when updates are available for me - I see Xubuntu Base.

Further information on this can be found here - https://wiki.ubuntu.com/SoftwareUpdates#Expanded_presentation_of_updates

Previously Update Manager listed all updates available - it could, and can, at times be a long list. It's just a method of simplifying what you see when Update Manager starts.


If I install ubuntu on my external hard drive, will my data be deleted?

You can use gparted to resize the partintion on the USB disk

Install with

  sudo apt-get install gparted

Run it by looking for it on your dash or by typing sudo gparted on a terminal.

Re-size it by right clicking on the partition with the right button and choosing 're-size'.

After you resided your partition install Ubuntu side by side inside the USB disk's new unallocated space. If possible do a backup of all the data inside the USB disk before doing any of this, if the files are important you should always take the safe side.

Resizing does not delete the data on the USB disk partition and allows you to free up space for your Ubuntu installation.


To install the drivers:

Get the drivers here:

source

Extract file from terminal in the download directory:

tar -zxvf cnijfilter2-5.20-1-deb.tar.gz

extract by right clicking with mouse and selecting extract here

Change into the extracted directory (cnijfilter2-5.20-1-deb) and run:

./install.sh

With that your drivers are ready to use.


Ubuntu 19.04 server doesn't boot, but 19.04 desktop does

There is defininitely something wrong with the 18.04.02 and possibly newer server install iso's.  After installing 18.04.02 and saying use the q whole dies, the Thinkpad T420 won't boot and the BIOS keeps coming back to ask which device you want to boot from.

I got around the problem by installing the 16.04.3 64 bit servber ISO and the doing a do-release-upgrade.  Ubuntu people: please fix this problem!


Chrome always maximize windows in Gnome Shell

Have you tried starting Google Chrome in a terminal with appropriate switches? For example, you could use --window-position and --window-size

--window-position ⊗ Specify the initial window position: --window-position=x,y
--window-size ⊗ Specify the initial window size: --window-size=w,h

So you'd enter something like google-chrome --window-position=x,y --window-size=w,h.

Once you've figured things out by trial and error, you could edit your Google Chrome .desktop file (/usr/share/applications) with a text editor and change the first Exec line from

Exec=/opt/google/chrome/google-chrome %U

to

Exec=/opt/google/chrome/google-chrome --window-position=x,y --window-size=w,h %U

I just use

Exec=/opt/google/chrome/google-chrome --start-maximized %U

Once you've edited the .desktop file you don't need to start via a terminal anymore.
These switches and more are found here: List of Chromium Command Line Switches.


Simply copy and paste each command:

sudo apt-get install build-essential git
git clone https://github.com/gnab/rtl8812au.git
cd rtl8812au
make
sudo make install
sudo modprobe 8812au

You should be all set.

You have compiled the driver for your current running kernel only. When Update Manager installs a later one, also known as linux-image, re-compile:

cd ~/rtl8812au
make clean
make
sudo make install
sudo modprobe 8812au

Glad it's working!


apt-get update says "Reading package lists ... Done" and then ends the process

apt-get update only updates the package lists. You need to do apt-get dist-upgrade to upgrade the actual packages. People often combine the two as sudo apt-get update && sudo apt-get dist-upgrade


Why can I only run Hamster Time Tracker as root?

Are you sure you weren't su'd in, and/or didn't use sudo with any of the other pre-installation commands? Because it works perfectly for me as a normal user when built in the following manner:

izx@ppauvm:~/src$ sudo apt-get build-dep hamster-applet
git clone git://git.gnome.org/hamster-applet
cd hamster-applet
./waf configure build --prefix=/usr
sudo ./waf install
hamster-time-tracker


18.04 problem moving mouse cursor between monitors

After some recent updates, the problem is now minimal. There is a slight bump shifting the mouse cursor between screens, but it's minimal and no longer a process of moving the mouse an extreme amount just to cross the threshold. That bump now feels like a usability feature rather than a bug! I'm assuming there was something that got affected in an update and fixed in a later update!

Although I cannot determine what it was that caused the error or what was done to fix it, the age old advice remains true with any problem: have you tried updating first?


Ubuntu 18.04 UEFI - This is not a bootable disk error

Eventually the problem was because the MBR partitioning on my drive. I need to change my drive to GPT partition first in order for Ubuntu to boot in UEFI mode.

Hopefully this answer helps someone.


fatal error: numpy/arrayobject.h: No such file or directory

Fixed by using the following command:

$ export CFLAGS="-I /usr/local/lib/python2.7/dist-packages/numpy/core/include $CFLAGS"


sh HAS execution permissions. Well it basically is a symlink to dash.

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Feb 17  2016 /bin/sh -> dash

And dash has execute permissions:

$ ls -l /bin/dash
-rwxr-xr-x 1 root root 154072 Feb 17  2016 /bin/dash

All dash has to do is parse the script so the file needs to be readable.


Would it be possible to save gedit backup files in a "specific" Folder?

No, you cannot do this with gedit. This was a declined feature request. It can apparently be done with a plugin, but such a plugin is not published - not that I can find, anyway,


Can't create directory in etc for hadoop?

Probably because nautilus is not opened as root (superuser).
Try to launch it from root with sudo nautilus&. But know that everything that you will do from that will not be accessible for standard users. So do not create files in your home directory.


Woobly windows effect not working on Kubuntu 16.04

Very disappointed with Plasma 5 environment. I have the same problem of "Hans" and the desktop crashes regularly.
So far I have found that ALT +SHIFT +F12 restore the settings (Thanks to this bug report) in the "System Setting" the shortcut is defined as "Suspend Compositing" (some more info present in the Kubuntu forum "PlasmaShell and Compositing Problems" )


Mounting a pendrive as a swap partition, having problems

I wouldn't suggest creating a swap partition on a flash device. The read/write rate when swapping would shorten the life of the drive considerably.  But if you like, here how its done:

Open disks from dash, and follow the images below in the order that they are listed:
Click the + sign to create a partition

Make sure the right type is choose, and name is optional, and them click create

Click the little wheels, to change the partition type

Make sure the right type is chosen, and click change

Notice that the partition type is now Swap

Click on the little square to mount, and that's it


How DisplayLink will be treated in Ubuntu 16.04 (fb ov display device?)

Ok. So basically the answer is simple: it depends on the hardware on the other end of DisplayLink cable.

If device being attached to DisplayLink port identify itself as a display, than Linux will treat it as a display (physical monitor device to be precise).

If device being attached to DisplayLink port identify itself as a Video card than Linux will treat it as a video processing hardware.

There are many thing that can be attached to DisplayLink and in such case DL will play only a transport role.

What about my own question:
Matrox TrippleHead2Go DP edition present itself as a display device (monitor). Configurable firmware in the appliance will define resolution of such a "virtual" device for Linux on one hand and will split image across several physical monitors to match such presentation on another.


youtube-dl file download progress with zenity progress bar

Yes, it is possible. You need to

Make sure that output is unbuffered, that it is printed as soon as it's received. Pipes are buffered by default.
Parse the downloader's output so that only the percentages are printed;
Parse the output so that the file number is printed with a # at the beginning of the line. Zenity will automatically update the text of its dialog with lines starting with #.

Combining the above, and implementing a little regex magic, we get:

#!/bin/bash
youtube-dl --extract-audio --audio-quality 0 --newline --audio-format mp3 \
           https://www.youtube.com/playlist?list=PL1C815DB73EC2678E |
 grep --line-buffered -oP '^\[download\].*?\K([0-9.]+\%|#\d+ of \d)' |
    zenity --progress \
  --title="Download" \
  --text="Downloading..." \
  --percentage=0

Explanation

The --line-buffered option makes grep print its output immediately, turning off the default buffering. The -o makes it print only the matched portion of the line and the -P turns on Perl Compatible Regular Expressions.

The regex is a little complex, so let's break it down:

^\[download\] : matches lines that start with [download].
.*? : 0 or more characters, but the ? makes it stop at the shortest possible match.
\K : this is basically a lookbehind, it means "ignore anything matched so far".
(...|...) : the | means OR. Therefore, (A|B) wil match either A or B.
[0-9.]+\% : 1 or more numbers or . followed by a %. This prints the percentage.
#\d+ of \d : a # followed by one or more digits, of and then one or more digits again. This matches the "Video X of Y" line.

Taken together, that grep command will print:

#1 of 4
0.1%
0.3%
0.8%
1.7%
3.4%
7.0%
14.0%
28.2%
56.5%
99.5%
100.0%
100%
#2 of 4
0.1%
0.3%
0.8%
1.6%
3.4%
6.9%
13.9%
27.8%
55.8%
[...]

etc, and that's precisely the output that zenity needs. Finally, you can make the whole thing more useful by implementing the ability to specify multiple URLs from the command line:

#!/bin/bash
for url in "$@"
do
  youtube-dl --extract-audio --audio-quality 0 --newline --audio-format mp3 \
           https://www.youtube.com/playlist?list=PL1C815DB73EC2678E |
   grep --line-buffered -oP '^\[download\].*?\K([0-9.]+\%|#\d+ of \d)' |
    zenity --progress \
  --title="Download" \
  --text="Downloading..." \
  --percentage=0
done

Then, you can call your script like this:

myscript.sh "http://url1.com" "http://url2.com" "http://urlN.com


How can I reassign the -space keybinding?

I just found how to do it:
sudo apt-get install compizconfig-settings-manager
Open it, then
CompizConfig->general options->key bindings: window menu!
disable it!


Your external disk is using Microsoft's NTFS file system. (Thats the default on most external disks.)

While Linux can read and write NTFS pretty good, it is not good in repairing this file system.

An unclean file system means, that the disk might be removed from a computer without a clean unmount. So not all data could be written correctly and the file system is in an unclean state.

As the message tells you: You should run chkdsk /f on Windows, and reboot into Windows again. This will most likely repair the file system.


Why does network-manager always keep trying to connect to neighbours wifi?

Bring up a terminal to execute commands (CTRL + ALT + T is a shortcut). Type the following command, press Enter, and submit password.

sudo nautilus '/etc/NetworkManager/system-connections'

Your computer stores a network profile any time a connection attempt is made even when a connection is not fully established. It sounds like you just need to clean out this folder to fix the issue by deleting all the network profiles you do not need to keep.


Wired connection not using DNS (Wireless is fine) 16.10

I have never seen a problem (in recent memory) using OpenDNS and it does provide some measure of security against some of the hacking going on.

It's possible that 404- page not found errors are due to your IP being blocked by the target site and has nothing to do with DNS.

To test if DNS is working, type:

dig bbc.com

If it returns the IP for bbc.com, the DNS piece is OK.  To check if a particular DNS server is serving up the correct lookup type:

dig @208.67.222.222 bbc.com # Where @ = the desireed DNS lookup server

Many web sites (e,g, Craigslist) block queries for proxy IPs so you will see this problem a lot if you use a proxy server or go through a VPN.