Is there a standalone graphical application for configuring Network Manager?

I've tested this with fresh Ubuntu server 14.04 installation on a VBox. Setup with:

sudo apt-get update
sudo apt-get upgrade
sudo reboot
sudo apt-get install xserver-xorg xinit xterm
sudo apt-get --no-install-recommends install firefox
sudo reboot
sudo apt-get --no-install-recommends install network-manager
sudo reboot

It does not seem that many packages as half desktop with --no-install-recommends?!

sudo apt-get --no-install-recommends install network-manager-gnome

The following NEW packages will be installed:
  dbus-x11 gconf-service gconf-service-backend gconf2-common gnome-icon-theme
  hicolor-icon-theme humanity-icon-theme libappindicator3-1 libatk-bridge2.0-0
  libatspi2.0-0 libcairo-gobject2 libcolord1 libcroco3 libdbusmenu-glib4
  libdbusmenu-gtk3-4 libgconf-2-4 libgnome-bluetooth11 libgnome-keyring-common
  libgnome-keyring0 libgtk-3-0 libgtk-3-bin libgtk-3-common libindicator3-7
  liblcms2-2 libnm-glib-vpn1 libnm-gtk-common libnm-gtk0 libnotify4 librsvg2-2
  librsvg2-common libsecret-1-0 libsecret-common libwayland-cursor0
  libxkbcommon0 network-manager-gnome policykit-1-gnome
0 upgraded, 36 newly installed, 0 to remove and 3 not upgraded.
Need to get 5,787 kB of archives.
After this operation, 34.2 MB of additional disk space will be used.

If not, I don't think this is the best way. What if we remove non-needed features from network-manager-gnome package.

--disable-migration to remove gconf dep
--enable-introspection=no no need for gi lib
--with-modem-manager-1=no, --without-bluetooth depending on the case
--with-gtkver=2 to build it using gtk2 only as firefox no extra
--enable-indicator=no, indicator is gtk3. didn't work for me, raise errors in building

So on other machine/or Vbox, make the minimum build

sudo apt-get install dpkg-dev
sudo apt-get build-dep network-manager-gnome
apt-get source network-manager-gnome
cd network-manager-applet-0.9.8.8/
./configure --prefix=/opt/nm/ --disable-more-warnings --disable-migration --enable-introspection=no --with-modem-manager-1=no --with-gtkver=2 --without-bluetooth
make
sudo make install
cd /opt/nm/
tar czf ~/Desktop/nm-custom.tgz .

Extract it on target machine

sudo mkdir /opt/nm
cd /opt/nm
sudo tar xvf ~/nm-custom.tgz

Install missing dependencies

sudo apt-get --no-install-recommends install libnm-glib-vpn1

Test

sudo /opt/nm/bin/nm-connection-editor


How to automatically switch off default display and set resolution if I connect a specific display?

Set resolution, depending on the presence of a (specific) attached screen

Below two options:

Set screen resolution and switch screen (automatic detection of second screen) by a shortcut key
Run a background script to automatically switch off the main screen and change the resolution

Option 1; shortcut

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

# set the default screen
default = "DVI-I-1"
# set the specific external screen
external = "VGA-1"
# set the resolution of the single screen setup
singleres = "1680x1050"
# set the resolution of the specific external screeen
extrares = "1280x1024"

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

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

def get_screens():
    return [l.split()[0] for l in get("xrandr").splitlines() if " connected" in l]

def set_screen(n_scr, screens):
    if n_scr == 1:
        run(["xrandr", "--output", default, "--auto"])
        run(["xrandr", "-s", singleres])
        print("1 screen")
    elif all([n_scr == 2, external in screens]):
        run(["xrandr", "--output", default, "--off"])
        run(["xrandr", "-s", extrares])
        print("2 screens")

screens = get_screens()
n_scr2 = len(screens)
set_screen(n_scr2, screens)

Option 2; a background version

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

# set the default screen
default = "DVI-I-1"
# set the specific external screen
external = "VGA-1"
# set the resolution of the single screen setup
singleres = "1680x1050"
# set the resolution of the specific external screeen
extrares = "1280x1024"

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

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

def get_screens(scrdata):
    return [l.split()[0] for l in scrdata.splitlines() if " connected" in l]

def set_screen(n_scr, screens):
    if n_scr == 1:
        run(["xrandr", "--output", default, "--auto"])
        run(["xrandr", "-s", singleres])
        print("1 screen")
    elif all([n_scr == 2, external in screens]):
        run(["xrandr", "--output", default, "--off"])
        run(["xrandr", "-s", extrares])
        print("2 screens")

n_scr1 = None

while True:
    time.sleep(4)
    scrdata = get("xrandr")
    if scrdata:
        screens = get_screens(scrdata)
        n_scr2 = len(screens)
        if n_scr2 != n_scr1:
            set_screen(n_scr2, screens)
        n_scr1 = n_scr2

How to use

Copy either one of the scripts above into an empty file, save it as set_screens.py
Replace in the head section of the script the values for:

# set the default screen
default = "DVI-I-1"
# set the specific external screen
external = "VGA-1"
# set the resolution of the single screen setup
singleres = "1680x1050"
# set the resolution of the specific external screeen
extrares = "1280x1024"

(the current settings are just for my test setup)
Test- run and apply the script:

if you use option 1, the shortcut:

Open a terminal, run the script subsequently with and without the external screen, with the command:

python3 /path/to/set_screens.py

It should set the screens as intended.

Subsequently add, if all works fine, the script to a shortcut: Choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:

python3 /path/to/set_screens.py

if you use option 2, the background script:

Open a terminal, run the script with the command:

python3 /path/to/set_screens.py

and connect / disconnect the external monitor. It should change the resolution and switch on / off your default monitor as intended.

Subsequently add, if all works fine, the script to Startup Applications: Dash > Startup Applications > Add. Add the command:

/bin/bash -c "sleep 10 && python3 /path/to/set_screens.py"


Guys can you please help me install ubuntu

Under Windows, you can download and install Grub2win and you'll be good to go. Please follow all of the instructions given by it. The first time you start up Grub2win control panel you'll have to install it by clicking on the yellow button (can be green too, just the upper one).

I hope this will help you.

-Thijs365


KVM switch and screen resolution problem

I just discovered that my previous answer is not the one I'm using on my current system.  That's okay.  I have another solution that I've tested recently which is working.  This version still changes the resolution after starting the desktop environment, but it does it using the autostart system from the freedesktop.org standard. ...

You can put a .desktop file into ~/.config/autostart to run a script that will set the right resolution for you.

In the .desktop file:

[Desktop Entry]
Name=ResFix
Comment=Fix my resolution at 1920x1080
NoDisplay=False
TryExec=ResFix.sh
Exec=ResFix.sh
Terminal=false
Type=Application
Categories=Utility;
StartupNotify=false

In the script:

#!/bin/bash
xrandr --newmode "1920x1080_60.00" 173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VGA-0 1920x1080_60.00
xrandr --output VGA-0 --mode 1920x1080_60.00

More information

My previous answer to this question has more information on what goes in the script.  You can find more details and a slightly more robust version of this solution in A Better Linux Startup.


I'm not sure where to create the ~/.texpander folder.

What do you mean? "~" already tells you where: your home (the . means "hidden") and creating the directory will already create it where it is needed.

mkdir ~/.texpander is equal to mkdir /home/$HOME/.texpander.


Yeah you're on the right path. Deal with standard images and update it with javascript.

You should have a look at webcam which is a little command line app that just snaps away and can upload over FTP. If you don't have an FTP server (eg only SSH) you could mount that and have it upload that way.

One note about refreshing the images: stick '?var=' + (new Date).getTime() on the end of the image URL each time you fetch it. This just forces the browser not to use a cached copy. And make sure you don't set the refresh interval too aggressive.


I had a problem with my raid6 array with 12 drives and 2 spares for a total of 14 drives. I got the following error:

mdadm: /dev/md20 assembled from 8 drives and 2 spares - not enough to start the array

So I did the following:

sudo mdadm -S /dev/md20
mdadm: stopped /dev/md20

Then I got the array uuid:

sudo mdadm --examine /dev/sdi1
sudo mdadm --assemble /dev/md20 --force --uuid=c28cf9bd:29fad7e9:1721f24c:e1059626

Then I received the following message:

mdadm: /dev/md20 has been started with 12 drives and 2 spares


Windows 8 failing to install on VirtualBox in ubuntu 12.10

you need to enable in the BIOS hardware acceleration config (VT-X or AMD-V, based on your cpu).


OpenVPN seems to connect, yet connect ping anything on the other side

As you can see I am new to using askubuntu. Here is the output of the dig command:

dig pear01 @108.20.23.70
; <<>> DiG 9.9.5-3ubuntu0.4-Ubuntu <<>> pear01 @108.20.23.70
;; global options: +cmd
;; connection timed out; no servers could be reached


Icons can't be seen on Ubuntu 12.04 LTS's  Launcher after updates

If it existed before, just press Alt+F2 and type:

unity --reset


Cannot find grub.efi after installing Ubuntu in a different driver partition

If your EFI partition is set up with .../EFI/Boot/bootx64.efi as a copy of shimx64.efi (check the sizes), then there needs to be a copy of grubx64.efi in that same directory, .../EFI/Boot/grubx64.efi.

While running the USB, start a terminal (ctrl alt t, or use the dash launcher for gnome terminal).  Make a directory in /mnt to mount the second hard disk:

sudo mkdir /mnt/d2

Mount the second partition of sdb there:

sudo mount -tvfat /dev/sdb2 /mnt/d2

Copy the missing file:

sudo cp /mnt/d2/EFI/ubuntu/grubx64.efi /mnt/d2/EFI/Boot/grubx64.efi

unmount the disk partition:

sudo umount /mnt/d2

Try rebooting the sdb disk now.  If you get the same error, repeat on sda, it looks like it's missing there too.


Is it possible to take raw-images with Ubuntu phone?

No, currently it is not possible. Here is the bug report against the camera-app. As there are multiple more important features missing in the camera-app (see this and this) I wouldn’t expect RAW images anytime soon.


This from Lenovo:

While the "To interrupt normal startup, press Enter" message is displayed at the lower-left area of the screen, press the F1 key. The BIOS Setup Utility menu will be displayed. If a password prompt appears, type the correct password.


Found it:

pnmtoplainpnm replaces pnmtopnm -plain, here the link: https://linux.die.net/man/1/pnmtoplainpnm. Whole story here:

pnmtoplainpnm(1) - Linux man page
Name
pnmtoplainpnm - replaced by pnmtopnm
Description
This program is part of Netpbm(1).

pnmtoplainpnm was obsoleted in Netpbm 10.23 (July 2004) by pnmtopnm(1).JustusetheNetpbmcommonoption -plain.

pnmtoplainpnm exists today for backward compatibility; all it does is call pnmtopnm -plain.

pnmtoplainpnm was new in Netpbm 8.2 (March 2000) as a renaming of pnmnoraw, which was new in Pbmplus in November 1989.
Referenced By
pamslice(1), pnmnoraw(1), ppmtoarbtxt(1)


Using LS To Show The Date Modified And A Specific Number Of Files

You'll want to use stat to get the file metadata:

stat -c $'%y\t%n' * | sort -n | head -8


How do I add an application to a specific sub-category of dash

To my best knowledge this is solely decided by the Category-key of the application's .desktop file (either located in /usr/share/applications/ or for local user applications in ~/.local/share/applications/).

E.g.:

$ cat /usr/share/applications/gedit.desktop | grep Categories
Categories=GNOME;GTK;Utility;TextEditor;

$ cat /usr/share/applications/gimp.desktop | grep Categories
Categories=Graphics;2DGraphics;RasterGraphics;GTK;


How to get Mythtv to use TMDB version 3 api

You can get it to work:

Back up /usr/share/mythtv/metadata/Movie/tmdb.py
Grab the updated version of tmdb3.py from: https://raw.github.com/MythTV/mythtv/983bb0e4353d361f6c54f0de0c0db683b8d3be1d/mythtv/programs/scripts/metadata/Movie/tmdb3.py
Save it, overwriting /usr/share/mythtv/metadata/Movie/tmdb.py
Delete ~/.mythtv/pytmdb3.cache to clear out old values

After this, I was able to look up movie information by title and by entering the TMDB number.

Television updates still work fine.


snapd: slow bootup due to snaps mounting on boot

There are ways to check what is consuming boot time.
E.g. systemd-analyze blame or sudo systemd-analyze critical-chain, see also

Does snaps slow down the boot?
https://forum.snapcraft.io/t/snapd-causing-lengthy-boot-time/10466/6
https://forums.linuxmint.com/viewtopic.php?t=322732
https://ubuntu-mate.community/t/very-slow-system-boot-with-ubuntu-mate-20-04/22415
https://forum.manjaro.org/t/how-i-can-speed-up-booting-time-and-loading-userspace-on-manjaro-kde/61214

As for how to prevent mounting at boot time, assuming snaps are the culprit, I did not find a definitive solution.
But, possibly helpful/related:

https://forum.snapcraft.io/t/how-do-i-stop-snaps-mounting-during-boot-on-ubuntu-18-04/21434
Delete and recreate swap partition, probably useful if snap is not the culprit.
https://serverfault.com/questions/1044689/how-do-i-stop-snaps-mounting-during-boot-on-ubuntu-18-04


Ubuntu 14.04 cannot detect GTX 850M nvidia driver after installation

I found in 14.04 the only way to use the nvidia was to turn off the Intel card in the bios. There should be a disable option in there. From there, I suggest doing a re-install of ubuntu (if you have only just installed it) and install the nvidia drivers from there.


Hp printer works but scanner does not after installing 16.04

The "automatic" (recommended) install does not include sane support.  To fix, just remove and purge the install done as "automatic" and reinstall answering (c)ustom at about the 3rd choice you have to make.  A couple of questions later you'll have to go through five or so choices for support.  Be sure to choose the "Network/JetPrint" option as well as the "sane" support option.

The only big difference between the automatic and custom installs is that the automatic install does 3 of the 5 choices and you get a "spinner" to show progress through the "make" and "make install" steps rather than looking at the information stream that flows by as the step is running.


When trying to save music to home on Ubuntu, it says I would only have 20GB space even though my partition has 270GB, what's wrong?

When you install with WUBI, you give a selection for the size of the partition you want, usually up to 30GB. In this case, that was selected, and a 30GB file was created, in which everything Ubuntu uses, goes into. This file is not dynamic, as it will only hold up to 30GB, and it would be 30GB, even if you have only written 4GB to it. The best solution is to install Ubuntu from the live CD on its own partition with the amount of space you need.

If you want to still use Wubi, you can use /host to access your Windows C:\ drive from within Ubutu. If you configure your music downloader  to stick music there, or create a symlink with:

ln -s /host/Users/[yourWindowsUsername]/Music ~/WindowsMusic

and you can put your music into WindowsMusic in your home folder.


How to add a folder in environment variable permanently

You can use /etc/environment to set PATH environment variable, but it does not support variable expansion.

See this Link to get more information about enviroment variables


Can't see SSD hard disk after install Ubuntu 18.04 on HDD

I changed the bios setting of SADA from REID to AHCI as oldfred suggested, then I reinstalled the ubuntu on SSD, now I can see both, and HHD as a volume.


Command openbox --reconfigure seems to do the trick without logging out.


Openstack vm instance stuck in spawning state

I was never able to launch an instance on conjure-up lxd openstack if it was something other than an lxd image.
I then started using devstack instead which got rid of a lot of these 'issues'.

When I had to wait more than 10 minutes during instance launch it was due to the flavour I had assigned to the instance.
The vdi image was 8GB in size, I gave it 50GB disk space and after 30 minutes I got an error saying the 50 I assigned was too little, it needed 129GB minimum.

If it takes too long on creation I just stop it and gave it more space.


openjdk-9-jdk has been replaced by openjdk-11-jdk in Ubuntu 18.04. To install it open the terminal and type:

sudo apt update
sudo apt upgrade
sudo apt install openjdk-11-jdk

I don't expect this will fix the font size problem because Qt Creator doesn't have any Java version as a dependency.

My fonts in Qt Creator look OK with the following preferences.

Open Qt Creator.
Select Tools -> Options.
From the left pane of the Options window select Text Editor as shown in the below screenshot.
Select Fonts & Colors tab.
Under the Font heading after where it says Family: select Source Code Pro from the dropdown menu as marked by the mouse cursor in the below screenshot. After where it says Size: select 10 from the dropdown menu. Font size 10 is the best font size in my Qt Creator. If the font size still looks too small after continuing through the steps to step 6, select 11 or 12 instead of 10 from the dropdown menu.
Click the Apply button and then click the OK button to save the changes.


From a command line, run :

compiz-decorator --replace


How do I update pulseaudio to 12.x in Ubuntu 18.04

At present, no one maintains a PPA for newer PulseAudio releases.

This is presumably because the sound system is so deeply integrated into the system. An update bears a high risk that applications depending on a previous version of PulseAudio will no longer work as expected. In the worst case the sound system breaks entirely.

Because of this only try to upgrade PulseAudio after you are dead certain that it will fix the issue you have. Almost all issues do not come from an out-dated PulseAudio release version but are likely from erroneous settings, or less so from unsupported hardware.

If, however, you need to upgrade PulseAudio, you will have to download and install from source. Unfortunately there is little documentation on that and most people don't do so. You should be an advanced user because you will be pretty alone with this. Support for an untested bleeding edge application is usually not easy to get.

Latest PulseAudio source packages can be downloaded from here.


Web site for Update Manager changes / description

To get a changelog for a package on the command-line, run:

apt-get changelog package-name

There is a mailing list available which contains information about updates packages https://lists.ubuntu.com/#Package+Upload+and+Automatic+Notification+Lists

For previous updates, see the mailing list archives. Natty's archive page is available at https://lists.ubuntu.com/archives/natty-changes/

The two mentioned links provides updates on all package updates, not just the packages you're using.


Change font and cursor size with custom Xsession

This appears to be caused by lightdm. I installed and configured xdm (sudo dpkg-reconfigure xdm) to be the display manager, and the fonts went back to normal and everything was working as expected after the next login.

However, lightdm handles other things that are no longer handled. The worst is that the wireless network card (on a MacBook Pro) is no longer turned on, so there's no way to connect to the internet. I'm sure this has some other solution.


What am I supposed to do to get the most out of my Nvidia GeForce FX 5500 graphics card?

Based on mikehatever's comment:

Nvidia legacy driver 173 is not available in 17.10. The only currently supported Ubuntu release that has it is 14.04. It is supported until April 2019, and if you wish to try it, go with Xubuntu 14.04.1. Other than that, you probably can't do much more with 14 years old hardware.


Clipboard syncronization between wine and X11

The solution is listed in this thread, namely you need to create registry entry

[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"UsePrimarySelection"="1"

(some sources suggest "UsePrimarySelection"="y" but that has the same effect).

For more information refer this post. In particular if you want to copy text from VNC server (e.g. Linux) to VNC client (e.g. Windows), you need to install additionally autocutsel and add to ~/.vnc/xstartup something like this:

autocutsel -s PRIMARY -fork

This is needed because historically VNC protocol uses old and deprecated CUTBUFFER (legendary applications like xterm support it from those ancient times out of the box), while new applications like Wine use CLIPBOARD by default (switched to PRIMARY with registry option above). autocutsel should be used to synchronize all these types of buffers.


ASUS UX533F temperature too high and fan off on Ubuntu 19.04

To date, the best answer is to use the following workaround:

sudo prime-select intel

then log off.

After that, I have no more temperature issue with my laptop, and the fan does work when needed.

The drawback is that the NVidia GPU is simply not used at all, but it's fine for me.
If I'd known this laptop model had an NVidia card when I bought it, I'd have selected the same model but without an NVidia card.


I am not able to use the "apt update" command

Try to delete /var/lib/dpkg/lock file and retry.

I had similar problem when my earlier installation had failed. Sometimes that file stays locked.


You could try this:

55 11 * * * { echo -e "date: $(date -I)\nExecute command: description\nResult:\n"; curl -d '{"explorerId":'$(cat /root/id)', "turnOff":true}' -H "Content-Type: application/json" -X POST http://localhost:8080/descriptions ;} >> log/curl.log 2>&1

It will echo the date, discription and the result and append it in the log.


Ubuntu not shutting down ( going to black screen ) 12.04

Edit the GRUB configuration file (run in terminal gksu gedit /etc/default/grub).

Add to GRUB_CMDLINE_LINUX_DEFAULT= one of the following parameters:

acpi=force, acpi=on, nomodeset, noapic, acpi=off

For example, the new line might read:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force"

Save the file, quit the text editor, and run this command in the terminal:

sudo update-grub


I have an identical system and believe I experienced the same/similar issue where certain graphic elements render as interlaced fields with a horizontal offset.

At first I installed intel-linux-graphics-installer, but after reboot the issue remained.

I managed to resolve the issue by

sudo apt-get remove xserver-xorg-video-intel


I reinstalled 12.10 from the CD, it upgraded my 12.04 installation to 12.10 and everything has been working smoothly - 12.10 appears to be solid and fast.


Similar issue was discussed here

In that case removing the below file solve the problem:

sudo rm /tmp/mongodb-27017.sock

followed by launching mongo service again, solve the problem

Similar problem, with different source was discussed here

In this case /tmp permission got corrupted and it was solved by fixing /tmp by running:

sudo chown root:root /tmp
sudo chmod 1777 /tmp

Another option might be that /tmp/mongodb-27017.sock is not owned by mongodb - which can be fixed by (note that solution #1 above which delete the file should solve the wrong ownership issue as well):

sudo chown mongodb:mongodb /tmp/mongodb-27017.sock

Note that: providing relevant logs, might help identifying the problem. e.g.

tail -30 /var/log/mongodb/mongodb.log


External USB 2.0 drive formatted as ext4 periodically "freezes" if files are not read or written

I think it depends on hardware (controller) of external HDD. Possible issue: HDD suspending after 5(10) minutes. It could be also a specific management of USB controller in your computer system (USB inactivity time-out).
Control in Power Management Preferences if 'Spin down hard disks when possible' is switched off.

Good luck,
Vincenzo


I decompressed the whole eclipse package in my home folder and (Apart from skipping step 2) I added in Step 5 the sudo part:

sudo ln -s /opt/eclipse/eclipse

in my case it looked like this

sudo ln -s /home/cyrex/eclipse/eclipse

that's the only change I did and it worked. Note that my eclipse executable was in my home eclipse folder. eg: /home/cyrex/eclipse.

Also make sure you have the appropriate 32 or 64 bit version.


In my case login was possible again after removing $HOME/.Xauthority :

Press <ALT-Control-F1> and you get an ASCII login. Enter username and password.
Type rm .Xauthority. Then you can go back to the graphical login screen by pressing <ALT-Control-F7>.

After taking a closer look it appears that the contents of .Xauthority are destroyed by sshd when login in from a remote machine:

  before ssh-ing from a remote machine:

  ls -l .Xauthority

  rw------- 1 ubuntu ubuntu 50 Nov 24 18:46 .Xauthority

  after ssh-ing from a remote machine:

  ls -l .Xauthority

  -rw------- 1 ubuntu ubuntu 101 Nov 24 19:22 .Xauthority

What can be seen is that the file has an odd number of bytes after the ssh-login.

Maybe there are more programs besides sshd that damage .Xauthority.


Here is the complete procedure to install yED graphic editor. Open a terminal (Ctrl+Alt+T) and run :

wget https://www.yworks.com/products/yed/demo/yEd-3.14.4_64-bit_setup.sh
chmod +x yEd-3.14.4_64-bit_setup.sh
sudo -H ./yEd-3.14.4_64-bit_setup.sh


Answering my own question after lots of further research.

The new udev "philosophy"

Apparently the new "proper" way to use udev is not to incur long-running processes.

Via http://blog.fraggod.net/2012/06/16/proper-ish-way-to-start-long-running-systemd-service-on-udev-event-device-hotplug.html:

  RUN ... Starting daemons or other long running processes is not
  appropriate for udev; the forked processes, detached or not, will be
  unconditionally killed after the event handling has finished.

Note how this is in contradiction to the man-page citation in OP.

My best guess is a recent udev change (~2012 sometime) forces all processes including their forked children to finish before allowing execution to continue as an enforcement mechanism for this new philosophy.

Therefore, all easily accessible documentation and answers on the web which give the pattern in OP as a solution are now broken.

The new long-running pattern philosophy is understandable in the instance when you're talking about some daemon that is always running when the device is plugged in. However, is obliterates the effective defer use-case along with it.

Workaround

Nonetheless, I also discovered a workaround:

/lib/udev/rules.d/98-mouse-config.rules/

SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="008c", ACTION=="add|remove", ENV{ID_TYPE}!="hid", RUN+="/home/mikeknoop/scripts/udev-receiver.sh"

udev-receiver.sh

#!/bin/bash
echo /home/mikeknoop/scripts/mouse.sh | at now

mouse.sh

#!/bin/bash
sleep 3;
export DISPLAY=":0.0"
export XAUTHORITY="/home/mikeknoop/.Xauthority"
/usr/bin/xinput --set-prop 'pointer:Microsoft Microsoft Wireless Optical Mouse® 1.0A' 'Device Accel Constant Deceleration' 2.00000
... more xinput rules here

Note This was tested and works on Ubuntu 13.04

Note You'll need to install at which is an async task package via sudo apt-get install at

I pieced together the workaround from https://unix.stackexchange.com/questions/28548/how-to-run-custom-scripts-upon-usb-device-plug-in


You install Juju on your machine, the client. If you follow the instructions here you should be ready to go https://jujucharms.com/docs/#introduction


Determine time and length of last suspend

Looking at these lines:

[27075.428135] PM: suspend of devices complete after 998.769 msecs
[27075.432139] PM: late suspend of devices complete after 4.000 msecs
...
...
[27076.192213] PM: Restoring platform NVS memory

These, at a guess show when it start and finished suspending. So a way to get the time when it started suspending is:

dmesg | egrep -i "suspend|complete" | head -1 | cut -d ] -f1 | tr -d [

and when it finished

dmesg | egrep -i "resume complete" | head -1 | cut -d ] -f1 | tr -d [

So a way to get a guess at the time between when it suspended and resumed is:

expr "$(dmesg | egrep -i "resume complete" | head -1 | cut -d ] -f1 | tr -d [ | cut -d . -f1)" - "$(dmesg | egrep -i "suspend|complete" | head -1 | cut -d ] -f1 | tr -d [ | cut -d . -f1)"

There are likely much better ways to do this....

(N.B. using dmesg -T to show the time might not work - following this entry in man dmesg:

  -T, --ctime
   Print human readable timestamps. The timestamp could be inaccurate!
   The time source used for the logs is not  updated  after  system SUSPEND/RESUME.

)


In case someone need it;

It seems that

username-SATELLITE-L855

is too long as an hostname. Converted it to:

username-COMP

and it solved the problem.


Nautilus missing context-menu button (gear icon) in Ubuntu 14.04

As far as I know... with nautilus 3.10 in Ubuntu 14.04 there is a new patch to the source named restore-traditional-menu-bar.patch to bring back the "File | Edit | View | Go | Bookmarks | Help" menus instead the new "View" & "Location" buttons.

  In Nautilus 3.6, introduced in raring, the menu layout was changed
  from the traditional all-entries-in-one-menubar to:
  * an application menu called "Files" in the Unity menu bar
  * a view menu has moved to some toolbar buttons and a dropdown under an arrow in the upper right of a window
  * all other menu items have moved to a cog button dropdown in the upper right of a window

  For Unity, we should probably switch back to the more traditional
  layout (and keep the new layout for GNOME). I'll assign an Ayatana
  task to get design guidance on what the layout should be.

  ------------------------ Desired resolution:

  Remove the 'cog' icon from the top right of the Nautilus toolbar. Move the view and search buttons over to the right, so that the right
  most view button occupies the position which previously held the cog
  button.

In this way if you are using Unity you have the traditional menu, but if you are using gnome, gnome-session-flashback you have the new menu buttons.

Nautilus in Unity:

Nautilus in Gnome-Flashback:

If you want to have the traditional menu with the new buttons in Unity...You can try to edit the nautilus source code.

NOTE: I recommend you to do this in a Virtual Machine or in a Test Machine to see is everything is OK.
In this example I'm running Ubuntu "14.04" with "nautilus 3.10.1".

1) Make sure you have enable the Source code repository

Open the Ubuntu Software Center
In the Menu Bar choose Edit -> Software Sources. Click to enable "Source code repository".
Just in case I use the "Main Server" to Download.

Open a Terminal window Ctrl+Alt+T and type:

sudo apt-get update

2) In the Terminal type the following to install the necessary packages.

sudo apt-get install build-essential quilt

3) Install build dependencies.

sudo apt-get build-dep nautilus

4) Create a folder to download the source code.

mkdir ~/Downloads/src
cd ~/Downloads/src

5) Download the source code & Export variables.

apt-get source nautilus
export QUILT_PATCHES=debian/patches
export EDITOR=gedit

6) Create the patch and Edit the source code.

cd nautilus-3.10.1/
quilt new 99_restore_menu_buttons.patch
quilt edit src/nautilus-toolbar.c

Remove the lines... 550 and 572.

Remove the line 550

  if (nautilus_toolbar_show_menu_buttons ()) {

Remove the line 572

  }

Save the changes.

Before:

After:

7) Compile and build the deb packages.

quilt refresh
fakeroot dpkg-buildpackage

8) Install the deb packages.

cd ..
sudo dpkg -i *deb

9) Finally you can logout & Login or Kill Nautilus and restart it or Reboot your machine to see the changes.

Before:

After:

Hope this helps.


Various programmes crashing frquently - could be an issue with the system?

Running out of options I decided to re-install the system, this time with Ubuntu 15.04. I have now most programmes up and running and there are no crashes; the system is entirely stable and much faster.

I suspect these issues were cause by some incompatibility of kernel 3.16 with the hardware (Lenovo T420).


Does flash 10.3 support hardware acceleration?

Phoronix have an article on Flash 10.3 - in summary, Flash still does not have hardware acceleration except for the most recent NVIDIA cards.

See wikipedia for details of vdpau support in nvidia cards.

See also this Phoronix article for vdpau support in netbooks.

However the next release (10.4) should be more interesting for those of us using ATI or Intel since Adobe should start supporting these through the VA-API interface.


How do I extract the version number portion from the version string?

There are many ways of doing this, for example:

bash and similar shells (see here for more info)

$ string=customer-asset-tag-1.0.2.9
$ echo -e "Component: ${string:0:18}\nVersion: ${string:19}"
Component: customer-asset-tag
Version: 1.0.2.9

awk

$ echo $string | awk -F- -v OFS=- '{print "Component: "$1,$2,$3; print "Version: "$4}'
Component: customer-asset-tag
Version: 1.0.2.9

Here, we are setting awk's field delimiter to - (this is used to define fields, the 1st field is $1, the 2nd $2 etc). We are also setting the output field separator to - so it will print correctly.
perl

$ echo $string | perl -ne '/(.*)-([^-]+)/; print "Component: $1\nVersion: $2"'
Component: customer-asset-tag
Version: 1.0.2.9

This is the most robust and general of the three approaches since it simply looks for the longest string of non - characters and saves that as the version and everything before the version until the last - and saves that as a component.


Software Center - some installed programs not listed

The Ubuntu Software (Software Center) application is not omniscient. Linux systems do not have a central registry of all software.
Ubuntu Software only knows about deb and snap software.
It generally doesn't know about pip, AppImage, flatpak, brew, or other package systems, nor about manually-compiled software, nor about any scripts you may written or downloaded. Recognizing some additional software (like AppImage) can be added by extensions.


I assume this is your home network:

[  265.554197] wlan0: send auth to <MAC 'WLAN-SSEWTM' [AC3]> (try 1/3)
[  265.556317] wlan0: <MAC 'WLAN-SSEWTM' [AC3]> denied authentication (status 1)
[  265.789379] wlan0: authenticate with <MAC 'WLAN-SSEWTM' [AC10]>
[  265.809225] wlan0: send auth to <MAC 'WLAN-SSEWTM' [AC10]> (try 1/3)
[  265.991527] wlan0: send auth to <MAC 'WLAN-SSEWTM' [AC10]> (try 2/3)
[  265.994371] wlan0: <MAC 'WLAN-SSEWTM' [AC10]> denied authentication (status 1)

'Denied authentication' suggests that the wrong password was entered or, more likely, is stored in Network Manager. I suggest you click the network Manager icon, select 'Edit Connections,' highlight your home connection and delete it. Then, as a precaution, from the terminal:

sudo rm /etc/NetworkManager/system-connections/WLAN-SSEWTM

It is probably already gone; if so, just continue. Using another computer on the home network, log in to the administrative pages of the router and double-check the password.

Now, restart Network Manager:

sudo service network-manager restart

NM should see your home network. Supply the password and connect.


solution: make sure 3 env vars exist

to me, it's

sudo -u roroco DISPLAY=:0.0 DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-L9d2ku9CfF" XAUTHORITY=/home/roroco/.Xauthority notify-send 'prpr'

you can get env var value with echo $env-name


How to make TightVNC, TigerVNC, TurboVNC and other VNC servers run on a non-standard port

For TightVNC the default port is 5900 plus the display number, so 5901 for the first display, etc.

The server has an undocumented command-line option to override this port number

-rfbport 5900

Should manually set the port number to 5900.  Experiment with it.


place icon in side bar rather than desktop in ubuntu 17.10

To hide desktop icons install GNOME Tweak Tool (New name Tweaks) in your ubuntu. For installation instructions check this link.


Terminal commands are not working Ubuntu 14.10

It appears you made a mistake (or followed bad instructions) while attempting to add a software source for libdvdcss. Since your libdvdcss.list contains nothing of value--just terminal commands, where instead there should be deb lines--you can simply delete that file, then update the package manager's information about available software:

sudo rm /etc/apt/sources.list.d/libdvdcss.list
sudo apt-get update

Run those commands in a Terminal window (Ctrl+Alt+T). If you get no errors from either of those commands, the problem should be fixed.

Alternatively, if you prefer to fix the problem with a GUI tool, open Software & Updates (on older versions of Ubuntu, it's called Software Sources), go to the Other Software tab, find the entry that looks different from the others (and has sudo in it), and disable it by unchecking it. When you close the dialog, you'll be told "The information about available software is out-of-date"; click Reload.

You don't have to follow both the command-line and GUI ways of solving this problem; either one by itself should be sufficient. (Though if you try one way and have difficulties, you could then try the other.)

You'll probably still want to achieve whatever you were trying to do when you ran the commands that produced a malformed libdvdcss.list file. Since I don't know specifically what that is, I cannot point you to advice to achieve it in precisely the way you had hoped. However, my guess is that you were trying to set up Ubuntu so that it will play encrypted (i.e., CSS-encumbered) DVDs.

To do that, see How can I play encrypted DVD movies?. Likely it will be sufficient simply to follow mac9416's advice and run:

sudo apt-get install libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh


Does a partition need to be mounted before data transfer to USB?

You have two issues here, so I suggest you open a new question about ddrescue.

To perform any disk operation you need to mount the disk beforehand, because Ubuntu needs to know that the disk is in the computer to handle it. Being the disk with Windows XP unbootable does not mean you can not mount it, so if the disc is not already on your computer, do so.

After restarting your Ubuntu, it should recognize the new hard drive and mount it for you. If this is true, then simply just browse it with Nautilus and copy to USB you need.

If not, you need to manually mount the disk. If you do not know which device is the disk with Windows XP, type in terminal:

sudo fdisk-l

and you should end up with an output like this:

joao@lightsaber:~$ sudo fdisk -l

Disco /dev/sda: 500.1 GB, 500107862016 bytes
255 cabeças, 63 setores/trilhas, 60801 cilindros, total de 976773168 setores
Unidades = setores de 1 * 512 = 512 bytes
Tamanho do setor (lógico/físico): 512 bytes / 512 bytes
Tamanho da E/S (mínimo/ideal): 512 bytes / 512 bytes
Identificador do disco: 0x0002cd22

Dispositivo Boot Início Fim Blocos Id Sistema
/dev/sda1   *        2048      208895      103424   83  Linux
/dev/sda2          208896    93956095    46873600   83  Linux
/dev/sda3        93956096   972859391   439451648   83  Linux
/dev/sda4       972859392   976771071     1955840   82  Linux swap / Solaris

Disco /dev/sdc: 7927 MB, 7927234560 bytes
244 cabeças, 62 setores/trilhas, 1023 cilindros, total de 15482880 setores
Unidades = setores de 1 * 512 = 512 bytes
Tamanho do setor (lógico/físico): 512 bytes / 512 bytes
Tamanho da E/S (mínimo/ideal): 512 bytes / 512 bytes
Identificador do disco: 0x00023ebe

Dispositivo Boot Início Fim Blocos Id Sistema
/dev/sdb1   *        2048    15482879     7740416    7  HPFS/NTFS/exFAT

Certainly your output will be different, mine is in Brazilian Portuguese; nevertheless it is perceived that it is listing two disks, one on /dev/sda and the other on /dev/sdb. Probably the disk with Windows XP should be the second on your system, so your partition will be /dev/sdb1.

To mount it, first create a folder for that Ubuntu can view its contents:

sudo mkdir /mnt/windows

Then mount the disk with

sudo mount /dev/sdb1 /mnt/windows

With this the disc content be available to be copied to an USB device.

I hope I have helped you.


How to tunnel traffic from one machine to another?

You can simply use openssh to do so:  https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding

The commands to look for are -L or -R.

Let's say you want to forward port 4444 on the server to port 5555 on the local machine. On the Server use

ssh -L 4444:local_machine_name:5555 user@local_machine_name

or on the local machine use

ssh -R 4444:localhost:5555 user@server_machine_name

(In the first example you could connect to any other machine, no need to connect to local_machine_name, you could just use localhost to connect to the server itself).

Another more complex way is to use the server as a router. See https://help.ubuntu.com/community/Router and especially https://help.ubuntu.com/community/Router#Enable_IP_forwarding_and_Masquerading.
This is what most small cable or DSL home router do.


Vodafone has one usb stick listed, namely K4305.

Looking at the user manual.  It can be installed on Ubuntu

  A computer running Microsoft® Windows® 8, Windows® 7 (SP1
  recommended), Windows Vista™ (SP2 recommended), or Windows® XP (SP3
  recommended), or an Apple Mac running Mac OS® X 10.5 (Intel®), 10.6 or
  10.7 (all with latest updates), or a computer running Linux Ubuntu 11.10, 11.04, 10.10, 10.04; OpenSUSE 11.4, 11.3; Fedora 14; Debian 6.0, 5.0 or Mandriva
  2010.2, 2010.1, 2010.0. There may be some limitations in the Linux implementation

Additionally, they give an address:

  Note: Linux users can access the Vodafone Mobile Broadband application
  by entering either of the following addresses into your browser:
  http:// VodafoneMobile.vmb or http://192.168.9.1.

So according to vodafone it is possible.  If you are not using the K4305, please post the model.


Slow directory listing when browsing Windows share

The full ls documentation (info '(coreutils) ls invocation' or the online version), has a probable solution:

 Note that using the ‘--color’ option may incur a noticeable
 performance penalty when run in a directory with very many entries,
 because the default settings require that ‘ls’ ‘stat’ every single
 file it lists.  However, if you would like most of the file-type
 coloring but can live without the other coloring options (e.g.,
 executable, orphan, sticky, other-writable, capability), use
 ‘dircolors’ to set the ‘LS_COLORS’ environment variable like this,
      eval $(dircolors -p | perl -pe \
        's/^((CAP|S[ET]|O[TR]|M|E)\w+).*/$1 00/' | dircolors -)
 and on a ‘dirent.d_type’-capable file system, ‘ls’ will perform
 only one ‘stat’ call per command line argument.

If you add network overhead to statting everything in the whole directory, your delay starts to become understandable.

Or, you could use an invocation of ls with --color=off, or no --color.


Use the automatic tool provided, "Additional Drivers" on Ubuntu 12.04 (https://apps.ubuntu.com/cat/applications/precise/jockey-gtk/).

Install "Additional Drivers" (if it's already installed, nothing will change) :

sudo apt-get install jockey-gtk
Run the application (Open it with Ubuntu launcher or in "System Settings") :

jockey-gtk
Follow the instructions in the GUI.


How to find current version of Gnome for Ubuntu 18.04 from internet?

TLDR: Ubuntu 18.04 LTS uses GNOME 3.28 and Ubuntu 16.04 LTS uses GNOME 3.18.

If you have installed GNOME as deb-packages, then you can visit packages.ubuntu.com and get info about gnome-session-bin:

  trusty (14.04LTS) (gnome): GNOME Session Manager - Minimal runtime
  3.9.90-0ubuntu12: amd64
  trusty-updates (gnome): GNOME Session Manager - Minimal runtime
  3.9.90-0ubuntu12.1: amd64
  xenial (16.04LTS) (gnome): GNOME Session Manager - Minimal runtime
  3.18.1.2-1ubuntu1: amd64
  xenial-updates (gnome): GNOME Session Manager - Minimal runtime
  3.18.1.2-1ubuntu1.16.04.2: amd64
  bionic (18.04LTS) (gnome): GNOME Session Manager - Minimal runtime
  3.28.1-0ubuntu2: amd64
  bionic-updates (gnome): GNOME Session Manager - Minimal runtime
  3.28.1-0ubuntu3: amd64
  eoan (19.10) (gnome): GNOME Session Manager - Minimal runtime
  3.34.1-1ubuntu2: amd64 arm64 armhf i386 ppc64el s390x
  focal (20.04LTS) (gnome): GNOME Session Manager - Minimal runtime
  3.36.0-2ubuntu1: amd64 arm64 armhf ppc64el s390x

On installed system you can use one of

dpkg -l gnome-session-bin
apt list gnome-session-bin | grep gnome

or directly view corresponding changelog files:

Ubuntu 16.04 LTS:

$ zcat /usr/share/doc/gnome-session-bin/changelog.Debian.gz | head -n1
gnome-session (3.18.1.2-1ubuntu1.16.04.2) xenial; urgency=medium

Ubuntu 18.04 LTS:

$ zcat /usr/share/doc/gnome-session-bin/changelog.Debian.gz | head -n1
gnome-session (3.28.1-0ubuntu3) bionic; urgency=medium

any current Ubuntu (to be mounted):

sudo mount /dev/sdXY /mnt
zcat /mnt/usr/share/doc/gnome-session-bin/changelog.Debian.gz | head -n1

For Snap-packaged GNOME you can use snap list (below is example for 18.04 LTS):

$ snap list | grep gnome
gnome-3-26-1604       3.26.0     64    stable/…  canonical  -
gnome-calculator      3.28.1     170   stable/…  canonical  -
gnome-characters      3.28.2     96    stable/…  canonical  -
gnome-logs            3.28.2     34    stable/…  canonical  -
gnome-system-monitor  3.26.0     41    stable/…  canonical  -


Boot from a live Ubuntu USB pendrive or CD
and
Install Boot-Repair on ubuntu by following steps

Open the terminal and run the following commands

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair

After completing the installation you can launch it from System->Administration->Boot-Repair menu if you use Gnome, or search "boot-repair" in the dash if you use Unity. Then follow the following screenshots:

Method 1

Click on the advanced options

Tick the options shown below

Change the tab to Grub Location Tab and Tick The options Shown in the figure

Press Apply and Reboot the system

Method 2

Select the recommended Boot repair options as shown in the first screenshot

Documentation :


There is a place you can download test build of kernels created by Ubuntu Kernel Team. It's called Kernel PPA. If you want to give kernel 3.9 a try please go to http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-raring/ and download the following files:

If you're running the 64 bit version of Ubuntu:

linux-headers-3.9.0-030900_3.9.0-030900.201304291257_all.deb
linux-headers-3.9.0-030900-generic_3.9.0-030900.201304291257_amd64.deb
linux-image-3.9.0-030900-generic_3.9.0-030900.201304291257_amd64.deb

Or if you're running the 32 bit version of Ubuntu:

linux-headers-3.9.0-030900-generic_3.9.0-030900.201304291257_i386.deb
linux-headers-3.9.0-030900_3.9.0-030900.201304291257_all.deb
linux-image-3.9.0-030900-generic_3.9.0-030900.201304291257_i386.deb

Then install those files by typing following command in the terminal:

sudo dpkg -i linux*.deb

Please note however that installing a kernel from outside distribution repository is very likely to break compatibility of some software/drivers e.g. VirtualBox, VMware or NVIDIA/AMD GPU drivers and is not supported.


How to install Ethernet in my Ubuntu 18.04?

ens33 is your Ethernet interface. It just isn't called "eth0" like the good old days.  I'm not sure what the algorithm is for naming interfaces, but they end up being unique.

edit:

See man systemd.link.

The fact that your prefix is "ens" indicates that your naming convention is "slot". Reference that section in https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html

(Search the page for "ID_NET_NAME_SLOT").

Reading this article will also explain other device name prefixes besides "ens" you may find. For example, mine is "enp" which means it was named with the "ID_NET_NAME_PATH" method.


I assume you currently use OpenJDK to run your IDE, you have to install Oracle Java JDK manually, here the command to use :

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Once the proprietary version is installed, you can switch system wide the java version with

sudo update-alternatives --config java

And choose the appropriate java version by typing selection number (3 in my case).

  0            /usr/lib/jvm/java-10-openjdk-amd64/bin/java      1101      automatic mode
  1            /usr/lib/jvm/java-10-openjdk-amd64/bin/java      1101      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode
* 3            /usr/lib/jvm/jdk-8-oracle-x64/jre/bin/java       318       manual mode


how to install a specific package version

Execute

man apt-get

and go down (/) to the install function.  This is worth reading.

By the way, did you try the following?

sudo apt-get install gunicorn=19.3.0

(one equal sign, not two)

As the man page states, use this feature with care.  I don't know why you'd want an older version of a package on your installation but I'd guess that it would be a lot easier in the long run to change the dependent package to rely on the latest version of a dependency (gunicorn?) and not keep using an older version.  Cleaner, IMO.


The clients get DHCP from eth0 which is setup as a dhcp server on Ubuntu. There is no internet connection on eth0

Then don't specify a default gateway on that interface. According to your screenshot, you have configured 192.168.137.1 as default gateway for this interface - which means that you tell your computer that 0.0.0.0/0 (aka the rest of the Internet) is reachable via 192.168.137.1 - when it is in fact not reachable this way.
In addition you will have to set up some kind of forwarding or NAT for the clients connected to eth0 to be able to reach the internet via this box.


In Digital Ocean, if you have disabled root access via SSH and are locked out of your VPS, you can always access it from browser through "Console access" in control panel.

You can rest your root password first if you don't remember and then use that to access your droplet.


Why is my DVD drive "/dev/dvd1" instead of "/dev/dvd"?

I can't say how but the udev rules is assigning those devicenames. In the past, with the Kubuntu: http://kubuntuforums.net/forums/index.php?topic=3107885.0.

A readme: /etc/udev/rules.d/README

  The files in this directory are read by udev(7) and used when events
  are performed by the kernel.  The udev daemon watches this directory
  with inotify so that changes to these files are automatically picked
  up, for this reason they must be files and not symlinks to another
  location as in the case in Debian.

  Packages do not generally install rules here, this directory is for
  local rules.  If you want to override behaviour of package-supplied
  rules, which can be found in /lib/udev/rules.d, you can do one of two
  things:

  1) Write your own rules in this directory that assign the name,
      symlinks, permissions, etc. that you want.  Pick a number higher
      than the rules you want to override, and yours will be used.

  2) Copy the file from /lib/udev/rules.d and edit it here; you
      should generally only do this if you want to prevent a program
      from being run.

  If the ordering of files in this directory are not important to you,
  it's recommended that you simply name your files
  "descriptive-name.rules" such that they are processed AFTER all
  numbered rules in both this directory and /lib/udev/rules.d and thus
  override anything set there.

The /etc/udev/rules.d/70-persistent-cd.rules has the CD and the DVD rules. You could modify it:

  This file was automatically generated by the /lib/udev/write_cd_rules
  program, run by the cd-aliases-generator.rules rules file.

  You can modify it, as long as you keep each rule on a single
  line, and set the $GENERATED variable.


Judging from the comments, you are using too many heavy applications at once. With so little RAM I suggest running fewer applications when using Eclipse and other heavy (especially interpreted) applications. Naturally most applications will slowly but surely increase the memory usage until you start to experience thrashing. To avoid this, restart the applications from time to time. If you are running Unity, you can also restart unity easily. Just run unity in the run dialogue to restart it. It will restart compiz as well, and free some memory.


prevent ubuntu 18.04 login screen from saying my key strokes back to me


Installing Opera Mobile Emulator tar.gz files

You don't need to install a tar.gz. It is a compressed file (like a .zip).

To extract the file from a terminal, download it (in this example, it will just be in your /home folder), and run

tar xvf Opera_Mobile_Emulator_12.1_Linux.tar.gz

Or you can right click it and choose extract here.

This will make a folder in /home called Opera_Mobile_Emulator_12.1_Linux, in this folder is an executable file (no install needed) called opera-mobile-emulator-launcher, double click this or run

cd ~/Opera_Mobile_Emulator_12.1_Linux
./opera-mobile-emulator-launcher

It should pop right up.

Here is the manual for the tar command.


Can't select text on double or triple click

Yay, great!

The problem was indeed the double-click delay (Activities > Universal Access > Double-click delay) set to zero. No X11 nor Wayland problem.


KDE's gui network manager can't connect to DSL using pppoe

if you are complaining about kde daemon asking for password, this should solve your problem :

go to your configured DSL connection.
under general tab,

just below "automatically connect to this network......."

CHECK "all users may connect to this network".

Doing this solved my dsl problem in kubuntu 14.04.3. it won't show kde daemon asking for password anymore.


Install Canon LiDE 300 / 400 on Ubuntu 18.04

Download the scanner's linux driver from the Canon website. It's the same driver for related models: scangearmp2-3.70-1-deb

Unpack and install the driver from the download directory:

./install.sh

Canon's own driver is not enough though, to get the Canon scanner working. It only half works. Assuming you have installed Sane. Sane will recognise the scanner.

$ sane-find-scanner

found USB scanner (vendor=0x04a9 [Canon], product=0x1912 [LiDE 400]) at libusb:003:008

But it won't work.

$ scanimage -L

No scanners were identified

$ scanimage --format=png > test.png

scanimage: no SANE devices found

Likewise, SimpleScan won't yet detect the scanner.

It will scan at this stage by running Canon's own scanning software, supplied with the scanner download: scangearmp2. But this software is as rudimentary as toddler's tea set. It won't even let you change the resolution, filetype or scan area.

But thanks to the good work being done by @pekhterev and Rolf Bensch, the scanner will run if you install some more home-grown software.

sudo add-apt-repository ppa:rolfbensch/sane-git
sudo apt-get update

(source here)

sudo apt install libsane-common
sudo apt install sane-utils
sudo apt install xsane

(source)

The scanner worked from Xsane, after doing this. And from Gimp, by calling Xsane (it sees it as a pixma:04A91912 scanner). But the image was dull.

Thankfully, it now also works from SimpleScan.

.

Canon, btw, when I contacted them for help because their scanner didn't work, said. 'we don't support linux'. I said - but you've taken the time to supply a driver - surely you would want to make sure it actually worked when people installed it. They said, 'we don't support linux'.


I found this thread by googling, so I hope this answer might inform someone. Running the risk of necromancing, FWIW we have several Asus UX303LA (and UX303UB for that matter) in the office, and they all run just fine under Ubuntu and ElementaryOS in recent versions (we have 18.04 and 18.10 atm), and they have been since 2015.

No apparent issues, even screen brightness keys worked out of the box.


Help: Unable to connect to 5G Wifi on raspberry pi 4 using ubuntu server 18.04

This same issue was driving me crazy the last two days, because I installed 19.10 on my Pi 4 with the 7” touchscreen, and wanted a desktop but didn’t want to do MATE or Lubuntu because their windows are hard-coded for > the touchscreen’s 800x480 resolution, making them impossible to use. So I did Enlightenment instead, which works wonderfully, but didn’t seem able to configure networks out of the box.

So I figured out an inelegant but working solution. The issue for me, and probably for you as well, is that 5ghz is a regulated frequency, which means if you don’t set your country code, you won’t be able to connect.

Here’s what I did, and I hope it works for you!

sudo apt update
sudo apt install network-manager wireless-tools
The key is to make NetworkManager know your country code. You can do this temporarily with the command sudo iw reg set[your country code, if you’re in America it’s US]
sudo nmtui This opens nmtui, the shiny interface for NetworkManager. You should be able to see your 5ghz networks now!

But there’s a problem here: this won’t persist after reboot. You have to do it manually every time. I tried using rc.local and it didn’t work, so I used crontab and it worked perfectly. Just remember: this has to be in the root user’s crontab (in this case just the ubuntu user).

crontab -e (It’ll ask you what editor, I like nano myself.)
add this to the end of the file: @reboot iw reg set[your country code as before]

Save it and sudo reboot now and when you’re back up, run nmtui as before and you should see your 5ghz networks!

You can create a configuration in nmtui to auto-connect to a network, which I did, so my Pi 4 running 19.10 connects automatically to my home network, but you can always run nmtui from the command line to connect to something else.

I have no doubt there are a billion better ways to do this, but this was a fast and working solution for me. If it doesn’t for you, chime in and I’ll figure out if I did anything else, as I’m doing this from memory 8 hours later and slightly high.


How to avoid killing the wrong process in a bash script?

Get the script to kill itself. For example, have something like this at the start of your script:

kill_myself () {
    while sleep 1
    do
        if [[ -f /tmp/kill-myself ]]
        then
            rm /tmp/kill-myself
            kill -- -$1
        fi
    done
}

kill_myself $$ &

Now, when the time comes:

touch /tmp/kill-myself

You could customize this, so that each instance of the script has its own kill file, which you would log somewhere. Then you'll use that file to kill that specific instance of the script.

Another way: You could probably use pgrep/pkill for finer matching. They can read from a pid file, match against the command name and arguments, etc.

Something like the following will only kill processes that have the same name as your script (assuming you invoked it as script-name or /path/to/script-name):

pkill -g "$previous_groupid" script-name

This won't work if you do bash script-name. Or just to kill the rsync command, which should probably get your script to exit after that:

pkill -g "$previous_groupid" rsync


Grub cannot boot Windows 7 loader entry on 3tb drive

First, your configuration is playing "fast and loose" with MBR data structures. MBR is generally considered to be limited to 2TiB disks, but in fact it's limited to 2TiB values for partition start points and sizes, so it can theoretically handle just under 4TiB disks, albeit with the final 2TiB in one partition. On your 3TB (2.7TiB) disk, your largest and final partition is about 1TiB in size and begins at about 1.7TiB. It therefore is within the letter of the MBR "law," but some OSes and utilities will flake out when shown this disk. In my tests, both Linux and Windows 7 handled this configuration OK, but most other OSes didn't. My tests were limited, though; it's conceivable that some utility would fail on this disk, even under Linux or Windows 7, and possibly corrupt your data. In fact, my guess is that this is what's happening to GRUB, although I'm not positive of that. Overall, I'd have to recommend the use of GPT on bigger disks.

That said, I realize you may be in trouble if you're trying to use a 3TB disk on an older computer with a traditional BIOS rather than an EFI. In such a case, the best option is to use an older and smaller disk as a Windows boot disk along with a secondary GPT disk to hold data, programs, and Linux. Another option is to use DUET or Clover to get the BIOS-based computer booting in EFI mode. Both DUET and Clover can be thought of as BIOS boot loaders that add EFI capabilities to a BIOS computer. Unfortunately, neither of them is easy to install, and the last time I checked, both had problems on most AMD computers. (They're more likely to work on Intel-based systems.)

I'm not positive, but my suspicion is that the problem you're encountering is due to the fact that your boot partition extends beyond the end of the hard disk. Thus, if you really must get this working as-is, my recommendation is to rearrange your partitions so that both the Linux and Windows boot partitions reside entirely under the 2TiB mark. Use the space beyond that point for a data or programs partition.

If your motherboard supports EFI-mode booting, a better option is to switch to GPT and boot in EFI mode. This page covers converting Windows to boot in EFI mode. Linux tends to be a bit easier; you need only install any of several EFI boot loaders for Linux. GRUB 2 is one of these, although rEFInd is likely to be easier to install manually. Note that most computers sold since mid-2011 use EFI, although most sold prior to the release of Windows 8 booted in BIOS mode by default. Even some pre-2011 computers support EFI-mode booting.


partition problem as installing windows 7 or 8 after ubuntu?

solved !
windows needed a primary partition and sda6 wasn't so by deleting it shrinking sda5 and extended partition, I got a new partition that was allowed to be primary and installed without removing anything.


How to run multiple Ubuntu 18.x with separate partition encryption and UEFI/Secure Boot?

Used the below steps to set up three separate Ubuntu systems on one machine. Works great!

Ideas

Use refind rather than grub to manage system selection during UEFI/Secure Boot.
Don't use a separate /boot partition per Linux instance. Let refind boot the kernel directly from the EFI system partition (ESP).
Set up Linux Unified Key Setup (LUKS) from the Ubuntu installer.
Note that the current solution doesn't encrypt the kernel files, as booting directly to encrypted disks is not supported by refind.

Overview

Obviously create multiple backups of any valuable data beforehand. Changing the boot procedure, formatting disks, enabling encryption, etcetera can be hazardous and care needs to be taken.
Install Windows first.

Seems to be a general recommendation, though should matter less with UEFI.
It will prepare the GPT and ESP, this can also be done manually using GNOME Partition Editor from the Ubuntu USB/DVD.
The ESP created by the Windows installer might not be big enough, depending on the number of Ubuntu instances and kernel sizes. 512 MB seems enough for 2 Ubuntu-instances, but 1 GB would be safer and allow more instances.

Install refind and make sure it boots with Secure Boot.
For each desired Ubuntu system instance:

Run the default Ubuntu installer from USB or DVD.
Select the option "Something else" to manually set up encryption and select partitions.
Don't reboot after the installation, but stay to setup the refind boot process.

Over time, perform maintenance tasks if there are kernel or driver updates.

Per-instance installation

Assumes that the GUID Partition Table (GPT) and the ESP has been set up by the Windows installer, and that there are additional partitions(s) or empty disk space for the Ubuntu instance(s).

Partition paths and names

For consistency I'll use this partition path naming below. Paths will be different on your system, and will vary by instance, so please keep notes.

/dev/nvme0n1p11 is your ESP.
/dev/nvme0n1p22 is your temporary /boot partition.
/dev/nvme0n1p33 is your per-instance "physical volume for encryption" (locked) root / partition.
/dev/mapper/nvme0n1p33_crypt is your (unlocked) root / partition.

Partition and install a new (additional) Ubuntu instance

Get Ubuntu on USB or DVD, boot it selecting "Try out Ubuntu".
Open a terminal to update and start the installer.

sudo apt update && sudo apt dist-upgrade -y
ubiquity --no-bootloader

When asked about installation type (co-existing with other operating systems) and disk formatting/partitioning, select "Something else" to see a list of disks and partitions.
Find the partition with type efi, the ESP.

On my system this is /dev/nvme0n1p11.
Make a note of the partition path name as you'll need it below.
Check that it has at least 200 MB free before continuing, as it will be needed for the new instance kernel.

Select or create a boot partition.

On my system this is /dev/nvme0n1p22.
Make a note of the boot partition path name as you'll need it below.
Will be reused for subsequent Ubuntu instance installations.
Create or select a small (maximum 512 MB) partition.
Erase/format as EXT4.
Click "change" and mount it as /boot.

Select or create a root partition for Ubuntu.

On my system this is /dev/nvme0n1p33.
Make a note of the root partition path name as you'll need it below.
It will be erased.
5 GB for minimal, 25+ GB for a full installation.
Click "change" and make it an "physical volume for encryption".
Choose a password which is not the same as for the other instances.

Find the new, unlocked partition ending with _crypt.

On my system this is /dev/mapper/nvme0n1p33_crypt.
Change the mount point to root /.

Let the installer finish, but do not reboot at the end by selecting "Continue testing".

Set up refind for the new instance.

Enter chroot to the new operating system to make more changes.

# NOTE: create temporary mount directories.
sudo mkdir /mnt/bootpartition /mnt/ospartition

# NOTE: Mount the newly created encrypted partition.
sudo mount -o subvol=@ /dev/mapper/nvme0n1p33_crypt /mnt/ospartition
sudo mount /dev/nvme0n1p22 /mnt/bootpartition

# NOTE: Copy the boot files into the encrypted partition.
# NOTE: Watch those trailing slashes! rsync is very sensitive to them.
sudo rsync -aXAH /mnt/bootpartition/ /mnt/ospartition/boot/

sudo mount /dev/nvme0n1p11 /mnt/ospartition/boot/efi
sudo mount --bind /dev /mnt/ospartition/dev
sudo mount --bind /proc /mnt/ospartition/proc
sudo mount --bind /sys /mnt/ospartition/sys

# NOTE: change root to the newly installed Ubuntu.
sudo chroot /mnt/ospartition

Edit /etc/fstab and comment out the line for /boot. The other entries are correct.
Optional: make other low-level system file changes, such as workarounds for broken drivers1.
Create an EFI-bootable copy of the kernel (vmlinuz) and the initial ramdisk (initrd) for refind. Remember to replace ubuntu-instance with something of our own. I use "ubuntu-work" and similar. Do not use just "ubuntu" as it might get overwritten by the Ubuntu installer.

# NOTE: Choose your own per-instance directory name.
sudo mkdir /boot/efi/EFI/ubuntu-instance/
sudo cp /boot/vmlinuz* /boot/initrd* /boot/efi/EFI/ubuntu-instance/

Look for /dev/nvme0n1p33, the physical volume for encryption for this instance. Make a note of (or copy to the clipboard) the UUID (but not the PARTUUID).

sudo blkid

Prepare refind's Ubuntu instance kernel boot options for the encrypted partition in refind_linux.conf. Create /boot/efi/EFI/ubuntu-instance/refind_linux.conf from the below template, but with your path and UUID.

"Boot with standard options"  "root=/dev/mapper/nvme0n1p33_crypt cryptdevice=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:nvme0n1p33_crypt ro quiet splash"
"Boot to single-user mode"    "root=/dev/mapper/nvme0n1p33_crypt cryptdevice=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:nvme0n1p33_crypt ro single"
"Boot with minimal options"   "root=/dev/mapper/nvme0n1p33_crypt cryptdevice=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:nvme0n1p33_crypt ro"

Exit chroot and reboot. Remember to select the new kernel in refind.

exit
sudo reboot

Cleanup

Optional. This will remove unused boot options in refind. I like to keep them around as a backup until the system is stable.

Remove any leftover shared Ubuntu Grub bootloader.

# NOTE: The shared Ubuntu Grub EFI loader might be leftover from previous installations.
#sudo rm -r /boot/efi/EFI/ubuntu/

Remove files from the unused boot partition.

# NOTE: Optionally clean up files from the Ubuntu installer.
#sudo mkdir /mnt/bootpartition
#sudo mount /dev/nvme0n1p22 /mnt/bootpartition
#sudo rm -r /mnt/bootpartition/*

Maintenance after kernel or driver updates

As Ubuntu doesn't know about refind, kernel+driver updates require a manual copy step for vmlinuz+initrd.

After installing updates, but before rebooting, copy the new vmlinuz+initrd from the encrypted /boot to the unencrypted ESP's ubuntu-instance like above.
If you forget to do this, and the system broke or new drivers didn't load, boot either:

Single-user mode from refind by choosing custom boot options.
The Ubuntu installer USB/DVD, and mount to temporary locations:

The encrypted disk which contains /boot.
The ESP.

Copy the vmlinuz+initrd from your /boot to the ESP's ubuntu-instance like above.

Future improvements

If/when there are EFI file system drivers so refind can read encrypted LUKS partitions, investigate not keeping the kernels on the unencrypted ESP. This might greatly simplify the above setup.
Running ubiquity --no-bootloader skips installing shim-signed, so third-party DKMS modules/drivers (nvidia etcetera) require manual signing for secure boot. This can be done using kmodsign for /lib/modules/x.y.z/updates/dkms/*.ko after each kernel/driver update. A smoother alternative is to install shim-signed (including parts of grub), which does automatic signing. Perhaps there's an alternative which is less grubby?
Figure out if kernel+driver updates can automatically trigger updating the per-instance ESP vmlinuz+initrd copy for refind.
Improve temporary boot partition usage with one of:

Configure the temporary boot partition as encrypted swap space in each of the Linux instances.
Reusing the ESP for temporary /boot files. Didn't want the added risk of destroying the ESP by accidentally formatting it or similar, but might work just as well.

Inspiration

Thank you!

@Aleksandr Dubinsky's answer to "Ubuntu full disk encryption with encrypted /boot".
@StefK's answer to "Installing Ubuntu 12.04 without installing Grub".
@Rod Smith's answer to "How do I install two independent Ubuntu installations on a single hard drive with UEFI?"
Many more answers, articles, documentation written by Roderick W. Smith, who is the author of refind.
Ubuntu's installation documentation for desktop usage.

1 This Wayland plus Nvidia grapics driver problem caught me. It causes a black screen after the disk has been unlocked. Luckily it's easy to fix and Wayland can be restored once updated Nvidia drivers have been installed -- just remember to copy the updated kernel+initrd to your ESP.


Perl module Set::IntervalTree is not installing

Look at this part of the error message:

c++: not found

If you type the command that fails, ubuntu tells you what package provides it:

$ c++

The program 'c++' can be found in the following packages:
 - g++
 - clang

Type this to install it:
sudo apt-get install g++

Hope this helps


Font rendering in most applications is done by FreeType 2.

So mainly, you can use:

TrueType
OpenType (with TrueType or PostScript CFF glyphs)
PostScript Type 1, Type2 (aka CFF) & Type 9 (CID-keyed Type 1)
a whole bunch of legacy bitmap font formats


Does Ubuntu have drivers for an IBM Thinkpad T40?

I have used Ubuntu 11.10 ona t42 and all the drivers are there, works like a dream!

Unfortunatly the T42 doesn't have a pae supporting processor so it didn't want to have 12.04 LTS installed, but I imagine there might be a work around for that somewhere.

But other than the pae issue Ubuntu works fine on a T42 which is similar enough to the T40 to almost guarantee support.

To recommend a version I would need to know the specs of the computer (CPU, RAM etc). Although if you create a live CD/DVD/USB then you can boot into it and see for yourself without making any changes to your current installations/set up.

Hope this helps,


When you type dir in terminal, the name file with space separate with symbol backslash \

What you experience is quoting, dir has the -N or --literal option to disable it:

-N, --literal
       print entry names without quoting

The exact same applies to ls, just that it quotes the whole filenames with single quotes instead of escaping special characters (which can be triggered with -b or --escape for ls as well). Calling ls with -N disables this behaviour as well.

Example run

$ touch 'la la '{1,2}
$ dir
la\ la\ 1  la\ la\ 2
$ dir -N
la la 1  la la 2
$ ls
'la la 1'  'la la 2'
$ ls -b
la\ la\ 1  la\ la\ 2
$ ls -N
la la 1  la la 2

Further reading

man dir and info dir
Difference between 'dir' and 'ls' terminal commands?
Regarding the similar behaviour of ls: Filenames with space showing as 'file name' after upgrade to 18.04


Recommended way to install Kdenlive on Ubuntu 18.04

The preferred way to install any application in Ubuntu is to use Official Ubuntu repositories. You can use search for any package on http://packages.ubuntu.com .
There is kdenlive version 17.12.3-0ubuntu1 in Ubuntu 18.04 LTS repository (see this page for details).
To install you can run
sudo apt-get install kdenlive

This command will download about 200 MB of packages and will use about 450 MB disk space.

If you really need a bleeding-edge version of kdenlive on 18.04 LTS you can choose AppImage or Flatpak (you pay with disk space):

AppImage (20.04.2c, ~0.25GB downloads)
wget https://files.kde.org/kdenlive/release/kdenlive-20.04.2c-x86_64.appimage
chmod +x kdenlive-20.04.2c-x86_64.appimage
./kdenlive-20.04.2c-x86_64.appimage

FlatPak (20.04.1, ~0.5GB downloads)
sudo apt install flatpak

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --from https://flathub.org/repo/appstream/org.kde.kdenlive.flatpakref

For Ubuntu 19.10 and 20.04 LTS you can use PPA:

“Kdenlive” team PPA (20.04.1, ~0.1GB downloads on non-Qt system):
sudo add-apt-repository ppa:kdenlive/kdenlive-stable
sudo apt-get update
sudo apt-get install kdenlive


Make sure the ISO you downloaded wasn't corrupted during the download. You can do this by downloading the MD5SUM list from http://releases.ubuntu.com/12.04/MD5SUMS to the same directory as the ISO you downloaded, then running

md5sum -c MD5SUM

If the sums do not match, then it is corrupt and you will need to redownload the ISO. If the sums do match, then you might try burning the CD at a slower speed or using a USB instead of a CD.


VirtualBox release key after a few seconds

I assume you're using the right Control key. That's set as the "host" key in VirtualBox which means it gives the keyboard back to the host machine (with focus on VirtualBox).

You can change this in the VirtualBox preferences (File → Preferences → Input → Virtual Machine → Host Key Combination).


How to install Intex DC14.4SWM modem in Ubuntu 14.04

Yup.  That's an "Olivetti Olicard 300" and there are no drivers for Linux.

The 200 and 500 models do have drivers (but are not standard, so it means compiling them into the kernel), so if you've just bought it, return it for the 500 model if you're a bit of a tinkerer.

Otherwise, return it for a refund and look for one in the Ubuntu Catalog.  These are standard and "will just work".

Sorry to be the harbinger of bad news.


What cd/dvd burning software should I use?

Brasero Disc Burner

Comes as a default application in Ubuntu. Supports features like on-the-fly burning, multi-session, on-the-fly conversion of music playlists in all formats supported by GStreamer and so on.

Click on your Dash and type Brasero to access it and give it a try

OR

If its not installed (for whatever reason) you can install it from the Ubuntu Software Centre


Login and password for multipass instance

This might be a bit late but you can login to the instance from multipass without being asked for username and password. From there, you can set the password so that you can login using Hyper V.
First find the name of your instance
multipass list

then login to the instance in multipass
multipass shell <instance name>

Next you can set your password for the default ubuntu user
sudo passwd ubuntu

Now when you try to login using hyper v, just use ubuntu as the username and whatever password you set as the password.


Issue with SSH after migration from Amazon Linux to Ubuntu (EC2)

It looks like there is some difference in default handling of SIGHUP between Amazon Linux and Ubuntu 14.04 on EC2. So, basically adding nohup resolves the issue:

ssh -t $PROXY_HOST sudo 'nohup /etc/init.d/tinyproxy start'


Boot doesn't proceed on my laptop, but do on other machines

You probably want to check your BIOS, and see if it is set to boot in UEFI mode.

You may need to change it to Legacy mode to be able to install Ubuntu.


Use rsync to change only the date modified of folders/files

Recursive with find and touch

cd /source/dates/dir
find . -exec touch -c -m -r {} /destination/dates/dir/{} \;

Changing directory is important in order to get a relative path with find.


Touchpad in Dell Vostro 1540 behaves strangely

I suffered from these issues as well. It behaved normally when booting into Xorg rather than Wayland which is default for Ubuntu 17.10. This is done by pressing the small setting wheel in the login page and choosing Ubuntu on Xorg.


Escaping spaces in .desktop file Exec line with "bash -c"

You can pass the %f argument as a positional parameter to the shell by placing it after your command string, and quote it inside the command string in the usual way.

Ex.

Exec=sh -c 'somecommand "$1" 2>> /path/to/stderr.log' sh %f

This technique even works with the %F multi-file placeholder:

Exec=sh -c 'somecommand "$@" 2>> /path/to/stderr.log' sh %F

I'm using sh not bash here since there doesn't seem to be anything bash-specific about your command, however the same applies in bash:

       -c        If the -c option is present, then commands are read from  the
                 first non-option argument command_string.  If there are argu‐
                 ments  after  the  command_string,  the  first  argument   is
                 assigned  to  $0  and any remaining arguments are assigned to
                 the positional parameters.  The assignment  to  $0  sets  the
                 name  of  the  shell, which is used in warning and error mes‐
                 sages.


Filtering for a set of files that start and end with certain characters

Yes, that will work.

You can simply try with using echo or printf in your loop:

$ for file in "$STEP_2"/BG2*.riboassembled.fastq; do printf '%s\n' "$file"; done
/BG2*.riboassembled.fastq

Search for globbing to get more information and tutorials on how it works, e.g. https://www.tldp.org/LDP/abs/html/globbingref.html

Note, variables containing file names (here $STEP_2) should be put in double quotes, otherwise it will cause problems if the variable contains spaces.


A true (practical usable) ubuntu (that's not a live disk) install cannot be made on a flash drive (well it can but it's quite difficult to do properly and fully functional) You can however install ubuntu on an external hard drive (you can buy those for like 25 dollars because the capacity doesn't have to be that big).

First thing you do (optional but it might save you the trouble of having to fix your windows disk if you make a mistake) is disconnect your internal hard drive (it's not that hard, just take out the cable).

Next is just plain installing ubuntu on the external hard drive.

Reconnect your internal hard drive.

Change your boot setting so the usb has boot priority and you're done

Now I do have to note that unless you have usb 3.0 or e-sata it might run a little sluggish but not so much as to make it unusable. I've had some good results with a BM usb port in the past myself.

If you really want to use a flash drive I would just recommend to use a live version and keep about 500mb to a gig of "usable" space available. You can set this "usable" space using Unetbootin by simply increasing the space for user files.
Unetbootin is available in the repositories and in the Ubuntu software center.

To install if from the Terminal use

sudo apt-get install unetbootin


The directory for (local) Startup Applications is ~/.config/autostart.  Startup Applications creates .desktop files in the directory, which are automatically launched on log in.

.desktop files there can include the line:

X-GNOME-Autostart-enabled=true

but not necessarily. If they are disabled by Startup Applications, the file will include the line:

X-GNOME-Autostart-enabled=false

Local versus global .desktop files

As mentioned by Chai T.Rex, startup launchers in /etc/xdg/autostart work for all users (also on log in).

However:

If launchers are set in /etc/xdg/autostart, but disabled locally, the local one in ~/.config/autostart overrules the one in /etc/xdg/autostart.


Kubuntu 18.04 not login from SDDM but from tty

After review carefully several log files, I realize that the SDDM were putting its logs into the /var/log/syslog, so reviewing carefully this file, and after try several options, this lines were came up in front of me:

systemd[1613]: /usr/lib/environment.d/99-environment.conf:16: invalid variable name "export ANDROID_HOME", ignoring.
systemd[1613]: /usr/lib/environment.d/99-environment.conf:17: invalid variable name "export PATH", ignoring.
systemd[1613]: /usr/lib/environment.d/99-environment.conf:18: invalid variable name "export PATH", ignoring.
systemd[1613]: /usr/lib/environment.d/99-environment.conf:19: invalid variable name "export PATH", ignoring.
systemd[1613]: /usr/lib/environment.d/99-environment.conf:20: invalid variable name "export PATH", ignoring.

So, I commented these lines inside the /etc/environment and everything went ok.

export ANDROID_HOME=/media/my-user/ANDROID/SDK/sdk-linux
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

Finally I cut these configuration from the /etc/environment and pasted it inside the /home/my-user/.profile for a better configuration.

Just a few lines in a wrong config file of the system caused this disaster, :(


When using a variable to set the path, I get "No such file or directory", but works fine otherwise

In the shell, even though double quotes provide a weaker form of quoting than single quotes, they still suppress tilde expansion, which is what converts ~/catkin_ws (in some contexts where it appears) into an actual path.

Because catkin_ws contains no characters treated specially by the shell, I suggest you simply omit the double quotes in that assignment, writing this instead:

CATKIN_WS=~/catkin_ws

(That works because after the = in a variable assignment, i.e. at the beginning of the value you assign to a variable, is one of the places where tilde expansion is performed. The others are after a : in the value you assign to a variable and, of course, at the very beginning of a word.)

But if you wanted to quote catkin_ws you could:

CATKIN_WS=~/'catkin_ws'

You can also use $HOME instead of ~ as ajgringo619 suggested, since even though tilde expansion is not performed instead double quotes, parameter expansion is. So long as HOME is set, it will achieve the same thing. (If HOME is unset, which is weird and not likely something you want to attempt to handle, then different shells behave differently; bash looks in the database of users to figure out the correct home directory in this situation.) This is a common and reasonable alternative.

Note that, while an initial use of double quotes prevented the tilde expansion you wanted, they will not prevent the parameter expansion of $CATKIN_WS later. You should double-quote those expansions. If you don't quote them, the expanded value is subject to word splitting and globbing, which you don't want here (and most often don't want, when you use parameter expansion).

Further reading: Why doesn't the tilde (~) expand inside double quotes?


If you are using Ubuntu 13.10, install playonlinux instead of using Wine directly. That should make things significantly easier for you. If you are not using Ubuntu 13.04, you may download playonlinux here: http://www.playonlinux.com/en/


Software Center doesn't prompt for password

As already said, the problem may be your PolicyKit configuration. I would be interested in the contents of the files in /etc/polkit-1 directory and the file /usr/share/polkit-1/actions/org.debian.apt.policy. The output can be lengthy, so you may want to compress it and upload it somewhere rather than copy it here...

grep -IR '^[^#]' /etc/polkit-1
cat /usr/share/polkit-1/actions/org.debian.apt.policy

EDIT: After you've uploaded the files I can see that the problem is in your /var/lib/polkit-1/localauthority/50-local.d/20-xbmclive.pkla file which seems to have been installed by XBMC and effectively turns off all authentication via polkit (why it has done so and if it is really needed I don't know, I don't use this software).
[XBMC-Live user permissions]
Identity=unix-user:azizjoh
Action=*
ResultAny=no
ResultInactive=no
ResultActive=yes


TV13 in ubuntu 14.04 64bit error. "Not ready, Please check your connection"

I also experienced similar issue with Ubuntu 16.04.4.. However Teamviewer started working normally once I made sure no processes were running and restarted it again. Teamviewer says that 14.04 / LTS should be supported with Qt 5.2 on Ubuntu 14.04 / Debian 8 for the moment. https://community.teamviewer.com/t5/Knowledge-Base/How-to-install-TeamViewer-for-Linux/ta-p/6318

Perhaps try removing or purging Teamviewer 13 and installing from the stable repository? It could be that you have Teamviewer preview -repository enabled, which might have Ubuntu 14.04 incompatible packages.

Installing Teamviewer from the .deb-file downloadable on TV website should add the repositories for Teamviewer in /etc/apt/sources.list.d/teamviewer.list

Currently I have:

        ###   TeamViewer DEB repository list

        ### NOTE: Manual changes to this file
        ###        - prevent it from being updated by TeamViewer package updates
        ###        - will be lost after using the 'teamviewer repo' command
        ###       The original file can be restored with this command:
        ###       cp /opt/teamviewer/tv_bin/script/teamviewer.list /etc/apt/sources.list.d/teamviewer.list
        ###       which has the same effect as 'teamviewer repo default'

        ### NOTE: It is preferred to use the following commands to edit this file:
        ###       teamviewer repo                - show current repository configuration
        ###       teamviewer repo default        - restore default configuration
        ###       teamviewer repo disable        - disable the repository
        ###       teamviewer repo main [stable]  - make all TeamViewer packages available (default)
        ###       teamviewer repo tv13 [stable]  - make TeamViewer 13 packages available
        ###                             stable     omit preview and beta releases

        ### Choose stable main to receive updates for TeamViewer 13 and upcoming major releases
        ### Choose preview main to receive early updates for TeamViewer 13 and to receive major beta releases

        ### Choose stable tv13 to receive updates for TeamViewer 13
        ### Choose preview tv13 to receive early updates for TeamViewer 13

        deb http://linux.teamviewer.com/deb stable main
        #deb http://linux.teamviewer.com/deb preview main

        # deb http://linux.teamviewer.com/deb stable tv13
        # deb http://linux.teamviewer.com/deb preview tv13


in virualmin resource usage , before crash happen my cpu and swap is 100% , and ram is 50%

These values definitely mean your RAM value is too low.
You should watch the current RAM usage together with swap usage as the OS is swapping in advance when there is a risk of RAM exhaustion.
Swap is generally used when RAM is exhausted. Swap is a (slower) substitute of RAM when there is not enough RAM available, so a server should not really use swap. (Its real long-term usage could be something like 1 or 2 %.)


For a reverse shell to be able to be used your network has to be broken already.

So don't install a rootkit and you will be fine ;) Stick to repositories and if really needed PPAs from launchpad. Make sure what you install is from a secure source. Don't install software you do not need, disable services you do not need, keep your system up to date. Keep an eye on the log files and keep an eye on your logs from your router.  And turn the machine off when you are not using it (don't keep it on during the night for instance).
Simple answer: If you let your system get hacked you are not going to be able to prevent a reverse shell.
More elaborate answer: Prevent creation of outbound TCP connections, excepted for trusted addresses is a way to make it more difficult to have someone create a reversed shell. But you will seriously limit your system: that will also prevent browsing the internet, patches installed over HTTP and if you use it, updating antivirus so is basically good for a server, lousy for a desktop.

This will prevent anything but DNS lookups (source):

iptables -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
iptables -A OUTPUT -j REJECT
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --dport 23 -j ACCEPT
iptables -A INPUT -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -p tcp --dport 53 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 139 -j ACCEPT
iptables -A INPUT -p tcp --dport 445 -j ACCEPT
iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
iptables -A INPUT -p tcp --dport 5432 -j ACCEPT
iptables -A INPUT -p tcp --dport 8009 -j ACCEPT
iptables -A INPUT -p tcp --dport 8180 -j ACCEPT
iptables -A INPUT -p tcp --dport 21107 -j ACCEPT
iptables -A input -j REJECT

But port 53 ...

$ grep Domain /etc/services
domain      53/tcp              # Domain Name Server

will still allow for a reverse shell over this port basically making it impossible to prevent it without making your system totally unusable.

So to come back to the 1st part: leave the system as it currently is and don't let a malicious user get access to your system. Then you do not need to worry about reverse shells.


Lightning is not compatible with Thunderbird 7.0.1

I'd suggest making sure you're using the version in the Ubuntu archive instead of the version from addons.mozilla.org.  The package is called xul-ext-lightning (Click to install). We keep lightning updated with Thunderbird.

There will be an upgrade to 8 early next week that should come with a new compatible lightning as well.  Also, the version in the Ubuntu archive is architecture specific as opposed to addons.mozilla.org which is i386 (32 bit) only.


Ubuntu 14.04 Type 'http://old-releases.ubuntu.com/ubuntu/' is not known on line 1 in source list /etc/apt/sources.list.d/ia32-libs-raring.list

It appears your newly installed Ubuntu is not so newly installed. Probably the best thing to do is delete everything from /etc/apt/sources.list.d/ and then do apt update


USB Bluetooth Adapter Not Working in Ubuntu 14.04

Ubuntu 14.04 (current patches up to 1/15/2015)
Lenovo ThinkPad W530.

I found the Cirago BTA8000 at Fry's Electronics for $19.99.
It was literally "plug and play".

I tried several different brands and kept returning them because they couldn't be made to work.

When I plugged in the BTA8000, I thought it was another failure - no dings, no horns, nothing to indicate a success.
But, the BTA8000 was blinking every 1 or 2 seconds.
Then I noticed the bluetooth icon on the upper right screen boarder.

I used one of the W530's USB 2.0 ports and it come right up.
No drivers to load, no services to start, no fiddling and no issues.

I have now paired my Apple keyboard and the Logitech bluetooth mouse. Each went painlessly and exactly as I would hope.

Cirago Bluetooth 4.0 Mini USB Adapter
EDR / Low Energy
Backwards compatible 1.1/1.2/2.0/3.0
www.cirago.com.


Here you're a corrected and improved script:

#!/bin/bash

###################################################
## Script to create permanent and unique aliases ##
###################################################

## alias is equal to the first argument.
alias="$1"

## command is equal to an array holding all
## the positional parameters minus the first.
## (i.e. for "ls -la" it would be ["ls, "-la"]).
command=("${@:2}")

## If .bash_aliases exists, load it. Now the alias check
## will take in account any alias not sourced yet on the current shell.
test -f ~/.bash_aliases && source $_

## If there are less than 2 parameters, prints the usage and exits.
if [ $# -lt 2 ]; then
    echo "Usage: $0 <alias_name> <command>"
    exit 1
fi

## If the command is not valid, prints an error and exits.
if ! type "${command[0]}" &> /dev/null; then
    echo "Wrong command"
    exit 3
fi

## If the current alias already exists, prints a error message and then exits.
if [[ "$(type -t '$alias')" == "alias" ]]; then
    echo "This alias alredy exists"
    exit 2
fi

## Append the alias to the .bash_aliases file.
echo "alias $alias='${command[@]}'" >> ~/.bash_aliases

## Print a sucess message.
echo "Alias '$alias' linked to the command '${command[@]}'!"

Things that I changed:

Commented code.
Used type to detemine if the alias already exists.
Removed the function because I think that is not necessary.
Used type to detemine if a command is valid or not.
Removed some unnecessary elif.
Improved the conditionals.
command may be unquoted (i.e. myscript pingoogle ping google.com)


OpenSSH intermittent error ( ssh_exchange_identification: Connection closed by remote host ) on a public IP

It was actually a DOS attack and it got solved after changing the ssh port & MaxStartups variable in /etc/ssh/sshd_config to ,

port 2244
 MaxStartups 100

Restart the service ,

service sshd restart


How to make user home folder after account creation?

You have $ at the command prompt because you are using the sh shell.

The shell with name@server is based on the bash shell.

You have to change the default shell for the newly created user via : usermod -s /bin/bash .

Using usermod again to add the user home directory if it wasn't present. usermod -d /home/username

If the user has no home directory specified in /etc/passwd :

Run mkhomedir_helper <username> to create the home directory. mkhomedir_helper will create the user home directory and copy the stuff in /etc/skel as well.

If the user already has a home directory specified in /etc/passwd :

Such as via usermod -d /some/directory , mkhomedir_helper will not work. The only way is to manually create the home directory for the affected user.


Ubuntu 15.10 identifies itself as Kali 2 after dist-upgrade

After a while looking around , I decided to do a fresh install but making backup of data is so boring! so i didn't do anything, grub works fine. theme is changed to Kali but core is fine.
by using Ubuntu default desktop environment, I have removed Xfce and many extra packages installed before. then by cleaning up the system I installed them again. errors are gone and system works fine. the only problem is Software center which doesn't work at all. but don't worry, synaptic is here.

sudo apt-get clean
sudo apt-get autoclean
sudo apt-get update
sudo apt-get purge xfconf xfce4-utils xfwm4 xfce4-session xfdesktop4 exo-utils xfce4-panel xfce4-terminal  thunar
sudo apt-get autoremove
sudo apt-get -f install
sudo apt-get install xfce4
sudo apt-get install xfce4-goodies


GNOME Screenshot area selection causing freezes

As a workaround, I've added a keyboard shortcut for xclip -selection clipboard /dev/null using commands from CompizConfig Settings Manager.
To avoid a gnome freeze, you must always clean the clipboard before take a new screenshot:

Take your area screenshot.
Clean the clipboard with the new Keyboard
Shortcut you've selected to call xclip -selection clipboard /dev/null.
Repeat 1 & 2 as many times you want.


Full screen with gnome-player and VLC not working properly

I get the solution in the Ubuntu forum http://ubuntuforums.org/showthread.php?t=2121224 So easy as changing the gnome-player video output options until it works. I've changed it to x11 and know it's working :)


sudo apt upgrade executes but has no effect on kernel. (Lenovo X1 Carbon Gen 7, Ubuntu 18.04)

I don't think sudo apt upgrade will update your kernel. I had the same issue with my X1 and solved it by updating the kernel to 5.5.7 manually. If you have access to the internet through cable, try this sudo apt-get update && sudo apt-get dist-upgrade && sudo reboot. If you don't have Ethernet like me, checkout this link https://askubuntu.com/a/142000. Basically what I did was to download 4 files for the 5.5.7 kernel and put those .deb files in my home directory. Then I did sudo dpkg -i *.deb, and finally reboot.


According to the ThinkWiki: Put the following in /etc/modprobe.d/thinkpad_acpi.conf:
options thinkpad_acpi fan_control=1

Then reboot. Then you should be able to echo level disengaged > /proc/acpi/ibm/fan


You have to follow official compilation guide and install many development packages by
sudo apt-get install libboost-all-dev libusb-1.0-0-dev doxygen python3-docutils python3-mako python3-numpy python3-requests python3-ruamel.yaml python3-setuptools cmake build-essential

and then retry.
Or simpler - install binary UHD packages by
sudo apt-get install libuhd-dev uhd-host gnuradio


The extension should be packaged in a tar.gz file, it should not be a directory (for Gnome Tweak Tool to work). Alternatively you can place the directory in ~/.local/share/gnome-shell/extensions, then it should work.