Multiple workspace wallpapers without using ccsm

Having different wallpapers on different workspaces without using ccsm

The script below does not use compiz settings manager, but it assumes:

python3 is installed (if not let me know)
wmctrl is installed (to fetch the data on the workspaces). You might need to install it:
    sudo apt-get install wmctrl

It works no matter the number of workspaces; it calculates the number of columns of the workspaces and the row of the current workspace, and sets the user defined wallpaper for that (current) workspace.
After the script is started, just switch to the different workspaces and set the wallpaper in the "normal" (GUI) way. The script keeps track of the wallpaper(s) per workspace in a small file it creates. That should not cause any lag in performance, since the file is only read when the script initiates, or when the wallpapers per workspace are changed by the user.

The script

#!/usr/bin/env python3

import subprocess
import time
import os

key1 = "gsettings set org.gnome.desktop.background picture-uri "
key2 = "gsettings get org.gnome.desktop.background picture-uri"

def write_wspaces(file, current):
    with open(file, "wt") as wt:
        wt.write(current)

def read_wspaces(file):
    with open(file) as src:
        return src.read().strip()

def get_info(command):
    return subprocess.check_output(["/bin/bash", "-c", command]).decode("utf-8")

def get_currwallpaper():
    return get_info(key2).replace("file://", "").strip()

# get resolution
output = get_info("xrandr").split(); idf = output.index("current")
res = (int(output[idf+1]), int(output[idf+3].replace(",", "")))

def calculate_geometry():
    # get viewport data
    vp = get_info("wmctrl -d").split(" ")
    span = vp[4].split("x"), vp[7].split(",")
    # calculate number of (horizontal) viewports
    n_vps_hor = int(int(span[0][0])/int(res[0]))
    n_vps_vert = int(int(span[0][2])/int(res[1]))
    n_wspaces = int(n_vps_hor)*int(n_vps_vert)
    # calculate current viewport
    curr_vp_hor = int((int(span[1][0])/int(res[0]))+1)
    curr_vp_vert = int((int(span[1][3])/int(res[1]))+1)
    return ((curr_vp_vert-1)*n_vps_hor)+curr_vp_hor, n_wspaces

home = os.environ["HOME"]
wspaces = home+"/"+".config/wall_wspaces"
if not os.path.exists(wspaces):
    os.makedirs(wspaces)
if not os.path.exists(wspaces+"/wspaces.txt"):
    current = get_currwallpaper().replace("'", "")
    writelist = []; [writelist.append(current) for i in range(calculate_geometry()[1])]
    write_wspaces(wspaces+"/wspaces.txt", str(writelist))
wall_list = eval(read_wspaces(wspaces+"/wspaces.txt"))

while True:
    curr_vp1 = calculate_geometry()[0]; currwallpaper1 = get_currwallpaper()
    time.sleep(2)
    curr_vp2 = calculate_geometry()[0]; currwallpaper2 = get_currwallpaper()
    if curr_vp1 != curr_vp2:
        command = key1+"file://"+str(wall_list[curr_vp2-1])
        subprocess.Popen(["/bin/bash", "-c", command])
    elif currwallpaper1 != currwallpaper2:
        wall_list = eval(read_wspaces(wspaces+"/wspaces.txt"))
        wall_list[int(curr_vp2)-1] = currwallpaper2
        write_wspaces(wspaces+"/wspaces.txt", str(wall_list))
    else:
        pass

How to use

Simply copy the script into an empty file, save it as workspace_walls.py and run it by the command:

python3 /path/to/workspace_walls.py

If it works as you like it to, add it to your startup applications: Dash > Startup Applications > Add

Edit:

Below a completely rewritten version of the script, to the model of this one.

The script (with a few minor differences) + GUI is also available as ppa:

sudo add-apt-repository ppa:vlijm/wswitcher
sudo apt-get update
sudo apt-get install wswitcher

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

workspace_data = os.environ["HOME"]+"/.wallpaper_data_"
key = [
    "gsettings get ",
    "gsettings set ",
    "org.gnome.desktop.background picture-uri",
    ]

def getwall():
    return subprocess.check_output(
        ["/bin/bash", "-c", key[0]+key[2]]
        ).decode("utf-8").strip()

def get_res():
    # get resolution
    xr = subprocess.check_output(["xrandr"]).decode("utf-8").split()
    pos = xr.index("current")
    return [int(xr[pos+1]), int(xr[pos+3].replace(",", "") )]

def current():
    # get the current viewport
    res = get_res()
    vp_data = subprocess.check_output(
        ["wmctrl", "-d"]
        ).decode("utf-8").split()
    dt = [int(n) for n in vp_data[3].split("x")]
    cols = int(dt[0]/res[0])
    curr_vpdata = [int(n) for n in vp_data[5].split(",")]
    curr_col = int(curr_vpdata[0]/res[0])+1
    curr_row = int(curr_vpdata[1]/res[1])
    return str(curr_col+curr_row*cols)

curr_ws1 = current()
currwall1 = getwall()

while True:
    time.sleep(1)
    currwall2 = getwall()
    # print(currwall2)
    curr_ws2 = current()
    datafile = workspace_data+curr_ws2
    if curr_ws2 == curr_ws1:
        if currwall2 != currwall1:
            open(datafile, "wt").write(currwall2)
    else:
        if not os.path.exists(datafile):
            open(datafile, "wt").write(currwall2)
        else:
            curr_set = open(datafile).read()
            command = key[1]+key[2]+' "'+str(curr_set)+'"'
            subprocess.Popen(["/bin/bash", "-c", command])
    curr_ws1 = curr_ws2
    currwall1 = getwall()

Budgie now supported

Added support for Budgie on July 21, 2017 for Zesty, when installed from the ppa (see above)


Remove folder if it has another folder with the same started numbers

Loop through all directories named *empty and check if same directory without .empty exists and delete if true:

for d in *.empty; do
    [ -d "$d" ] && [ -d "${d%.empty}" ] && rmdir "$d"
done

Replace rmdir with rm -rf if the directory is not empty despite its name ;-)

A find alternative:

find -maxdepth 1 -type d -name '*.empty' \
  -exec sh -c '[ -d "${1%.empty}" ]' find-sh {} \; \
  -delete

Replace -delete with -exec rm -rf {} \; if the directory is not empty.


How to know if the system is running a live or an installed version?

You are on live-usb, when command mount returns:

aufs on / type aufs

and then commands users and hostname returns:

ubuntu


Apache setup: directive requires additional arguments

What is the idea of using ~ in http.conf?. Assuming you meant a user home directory: apache http.conf is not a bash script so expanding will not happen. You need either absolute paths or a relative path to the apache root.


Issue changing Document Root in Ubuntu 16.04

First fix the broken Apaches2

You have apparently broken Apache2.  You should use the default host settings and create a virtualhost for the changes custom root directory you want.  Remove or rename the configuration files you have edited and restore the original files.

Use the default 000-default.conf file as a template.  Copy it to a name for your virtual host and make modifications to your custom file.

You can rename the files using these steps:

$ cd /etc/apache2/sites-available
$ sudo mv 000-default.conf mysite.conf
$ cd /etc/apache2
$ sudo mv apache2.conf apache2.conf.test

Now restore the default files with this commandline:

$ sudo apt -o Dpkg::Options::="--force-confmiss" install --reinstall apache2

Now create your virtual host, "mysite.com".  You can replace the /home/web/mysite to any directory.  In your case you can use /home/{user}/projects/web.

$ cd /etc/apache2/sites-available
$ sudo cp 000-default.conf mysite.conf
$ sudo mkdir -p /home/web/mysite/www
$ sudo mkdir -p /home/web/mysite/log

If the mysite.com host doesn't exist, create it locally with:

$ gksudo gedit /etc/hosts

Add it to the hosts file:

127.0.0.1  mysite.com

Now edit your mysite.conf file to point to your Document Root choice.

$ pksudo gedit /etc/apache2/sites-available/mysite.conf

Make the following changes to this file.  This is the difference between the 000-default.conf file and your newly created mysite.conf file.  The difference is highlighted in bold type.

&ltVirtualHost *:80&gt
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        ServerName mysite.com

        ServerAdmin webmaster@localhost
        DocumentRoot /home/web/mysite/www

        &ltDirectory /&gt
                Options +FollowSymLinks +ExecCGI +Includes
                Require all granted
        &lt/Directory&gt

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog /home/web/mysite/log/error.log
        CustomLog /home/web/mysite//access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
&lt/VirtualHost&gt

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Now enable the new site with:

$ sudo a2ensite mysite.conf

When making a change to the Apache configuration files restart the service with:

$ sudo systemctl restart apache2

Write Permissions to the directory and files of the VirtualHost:

You can use the commands chown and chgrp to change the owner of the files and folders of /home/web/mysite/www.  If they are owned by your userID, you'll have read and write access to the files and folders.

You can also create a specific group and add users to the specific group so that user's of that group will have read/write access to the files and folders.

Using the latter consideration may be a better security alternative than giving other users group access to files and folders in your /home space.


Why can't I install Latex in ubuntu12.04?

I also faced this type of problem when I choose a custom server for update. If those repository is not available then this type of problem occurs.
First go to dashboard and search for software and updates. Now change the option like this and select download from option to Main Server

Now open Terminal (ctrl+alt+t)
Type

  sudo apt-get clean && sudo apt-get update

After completing previous operation

  sudo apt-get upgrade

and then

  sudo apt-get install --fix-missing

Now this will keep you up to date to the main repository. Then try your operation

  sudo apt-get install texlive-latex-base


Launch Keyboard Config GUI from terminal

Maybe this article solves your problem:

http://noobish-nix.blogspot.de/2012/06/how-to-add-and-switch-keyboard-layout.html


Since SSD drives are designed to use completely different parameters than HDDs, most SMART utilities do not report SSD data correctly.  The smartmontools package for linux contains a utility to scan for SSDs which will report drive health.

Install the smartmontools package from the command line:

sudo apt install smartmontools

Then use the smartctl tool with the following command where X is the letter of the SSD you want to test (in your case it would be /dev/nvme0n1p1 instead of /dev/sdX):

sudo smartctl -i /dev/sdX

You can a short test on the SSD with this command:

sudo smartctl -t short -a /dev/sdX

Or also a long test with this command:

sudo smartctl -t long -a /dev/sdX


Apple Wireless Keyboard does not reconnect reliably after reboot (Ubuntu 15.10)

I had a similar problem with my Apple Magic Mouse on Ubuntu 15.10 and a Macbook Retina Pro.

I could pair the mouse which worked until reboot. After reboot I could see the pairing, but couldn't reconnect. I use the Blueman applet which gave the error "Failed to connect Input/Output error".

A temporary fix was to delete the pairing, scan and connect the mouse which would work until reboot.

Whilst the mouse is connected, the command lsmod | grep magic returns:

$ lsmod | grep magic
hid_magicmouse        16384  0
hid                  118784  5 hidp,hid_generic,usbhid,hid_apple,hid_magicmouse

When the mouse wasn't connected, hid_magicmouse wasn't present.

Eventually I solved the problem by adding the line

  hid_magicmouse

to the file /etc/modules.

Now the mouse reconnects automatically on reboot.

Perhaps the same approach will work for you.


JD-GUI and Boomerang Deompilers Installation for Ubuntu

I'm not sure about Boomerand but for JD-GUI you need to install java runtime environment first
sudo apt install default-jre

Then you need to download the decompiler from here.
Install the deb package using:
sudo dpkg -i package_name.deb


That would be terminal, which displays your user name, @, then your computers name.  You don't have to type anything in there, it is just waiting for your command.

Do you get a graphical user interface, or do you only see terminal interface?


How do you extract a particular column or row from the output of a command?

That's exactly what awk was made for. Using the output of xinput on my system:

$ xinput --list --short
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SIGMACHIP USB Keyboard                    id=12   [slave  pointer  (2)]
⎜   ↳ Logitech M325                             id=14   [slave  pointer  (2)]
⎜   ↳ AlpsPS/2 ALPS DualPoint Stick             id=17   [slave  pointer  (2)]
⎜   ↳ AlpsPS/2 ALPS DualPoint TouchPad          id=16   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ SIGMACHIP USB Keyboard                    id=11   [slave  keyboard (3)]
    ↳ Dell WMI hotkeys                          id=18   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=13   [slave  keyboard (3)]
    ↳ Sleep Button                              id=9    [slave  keyboard (3)]
    ↳ UVC Camera (046d:0819)                    id=10   [slave  keyboard (3)]

$ xinput --list --short | awk -F"\t" '{print $2}'
id=2
id=4
id=12
id=14
id=17
id=16
id=3
id=5
id=6
id=7
id=8
id=11
id=18
id=13
id=9
id=10

awk will automatically split each input line into fields on the value given by -F. By default, it splits on whitespace, but here we need a tab. The 1st field is $1, the second $2 etc.

Alternatively, you can use cut:

$ xinput --list --short | cut -f2
id=2
id=4
id=12
id=14
id=17
id=16
id=3
id=5
id=6
id=7
id=8
id=11
id=18
id=13
id=9
id=10

You can save the output in a shell variable just like you would for any other command:

$ ids=$(xinput --list --short | awk -F"\t" '{print $2}')
$ echo $ids
id=2 id=4 id=12 id=14 id=17 id=16 id=3 id=5 id=6 id=7 id=8 id=11 id=18 id=13 id=9 id=10
$ echo "$ids"
id=2
id=4
id=12
id=14
id=17
id=16
id=3
id=5
id=6
id=7
id=8
id=11
id=18
id=13
id=9
id=10

You could also save it as an array:

$ ids=( $(xinput --list --short | awk -F"\t" '{print $2}') )
$ echo ${ids[@]}
id=2 id=4 id=12 id=14 id=17 id=16 id=3 id=5 id=6 id=7 id=8 id=11 id=18 id=13 id=9 id=10
$ echo ${ids[2]}
id=12


Downgrade Linux Kernel - Invalid Module Format

According to the link you posted, the software comes with precompiled drivers.
Kernel modules (drivers) are compiled to run with specific kernels.

You have two options:

1) Install a supported kernel. Look in DUO3D-LIN-v1.0.80.20/DUODriver/ to see which kernels they have compiled for. You can have more that one kernel installed, so downgrading isn't necessary.
In grub, select "Advanced Options" and you can boot with the old kernel when you need to use DUO.

2) try to find the source code or dkms package for the driver so you can build it to your kernel.


Shell know if minecraft is running or not

Firstly, when minecraft is running, run

pgrep -a java

Now find something unique, maybe it's just minecraft.

You will get your pid by running

pgrep -f minecraft


When you see the pics of keyboard and man when it boots - hit any key.

You can then choose various boot options - https://help.ubuntu.com/community/BootOptions#Changing_the_CD.27s_Default_Boot_Options

I think that F4 at that screen has safe mode as an option.


Ok, for your initial problem, where you expanded the partition, but it did not show up, you then needed to grow the filesystem as well. Follow this guide and your original issue would have been fixed.

Now coming to the actual question. Look carefully, you actually have both / and /home on the same partition (the lvm2pv partition).

What is LVM?

LVM is Logical Volume Management, it is a storage device management technology that gives users the power to pool and abstract the physical layout of component storage devices for easier and flexible administration.

What the eff does it have to do with my problem?

That is what I am getting at. You don't HAVE a problem. Yes, your / and /home might be in a different space, but they are on an LVM partition, and you can grow and shrink them as you need.

What's more, once you run out of space, just add another disk, add it to the LVM, and now you can see the space on that disk inside your /home. Learn how to manage LVM here.

Yes, now with LVM, your /home can span over multiple physical volumes (partitions) on multiple disks (yes, your /home might also be on /dev/sdc4)

What you need to do is, learn up on LVM and enjoy your new found power and freedom. While others labour under the constrains of partitions and disk space, you can rise above it.

What's more, transitioning to another disk would also be easier. Just add the disk to your lvm, and then remove the current disk from the lvm, linux (and some other commands) will take care of everything else.*

It is more complicated than that, but still doable.


Go to Edit Connections... on network manager applet, select your wifi connection.

Enable all users may connect to this network


Set which pulseaudio sink is affected by volume control buttons

It sounds like you most likely are experiencing a bug.

If you are not experiencing a bug, notice that switching the default output sink with pavucontrol will only affect programs you start -after- the change has been made. It will not affect programs that are already running.

To affect programs you already have running, each one will need to be switched individually under the pavucontrol "Playback" tab.

Your pulse-audio configuration files are stored under ~/.pulse/


I'd suggest that you also try systemctl default as suggested by the CLI. If this does not help, there is a similar issue here.


How can I install Ubuntu from within Windows XP on an old PC with no CD reader nor USB port?

I believe if you mount the iso virtually with Daemon Tools or PowerISO and run it, you should get a screen with an option of "Demo Installation." Try that it should get you to Live Mode.


Boot problems with Ubuntu on a external drive

You've run into a design flaw of the way Ubuntu configures GRUB 2. Basically, on an EFI-based system, the main GRUB binary goes in the EFI System Partition (ESP), but that binary relies on a grub.cfg file that resides in the Ubuntu /boot/grub directory, which in your case is on the external disk. Because Ubuntu configured GRUB as your default boot loader, the result is that the boot process fails whenever you unplug that external disk. There are several ways to correct this problem, including:

Move /boot -- You can repartition your disks so that you have a ~500MB /boot partition on your internal disk, then re-install GRUB. This way, GRUB will be able to read its configuration file from the internal disk even though the bulk of Ubuntu will be installed to the external disk. The drawback is that you'll see an Ubuntu entry whenever the system boots, even when it's non-functional because the external disk is unplugged.
Re-prioritize your boot loaders -- You can use efibootmgr in Linux, EasyUEFI in Windows, or other tools to re-order your boot loader priorities. Typically, you'd want to put Windows at the top. You'd then use your firmware's built-in boot manager (typically accessed by hitting Esc, Enter, or a function key, usually F8 or above) to select Ubuntu only when you want to boot it. This may be a workable solution if you boot Ubuntu infrequently, but the awkwardness of accessing the boot manager makes this solution a poor one if you want to boot Ubuntu frequently.
Use rEFind (or another boot manager) -- You can install my rEFInd boot manager to the ESP. It will then take over as the default boot manager. Because rEFInd builds its boot list on a boot-by-boot basis, the result will be a boot menu that shows only Windows when the Ubuntu disk is unplugged, and a boot menu that shows Windows and Ubuntu when the Ubuntu disk is plugged in. If you set rEFInd's default to boot Ubuntu, the result would even boot Ubuntu when the disk is plugged in and Windows when it's not plugged in. There are other boot managers, like gummiboot/systemd-boot and rEFIt (rEFInd's predecessor) that would work in this role, too.


How can I install Django for Python 3.x?

I would strongly suggest avoiding pip3 to install things in the system site-packages. I've made these arguments before but I'll give you the notes:

System updates break everything
Installing apt packages can overwrite pip-installed things
Version conflicts
Distribution upgrades are unpredictable chaos. Seriously. I've lost hair to these.

I would strongly advocate using virtualenv. It's a massive pain in the wherever to get going but once you've got it set up you have a complete Python environment under your complete control. This does mean more work (you'll have to check things for updates and pip doesn't really help there yet) but you don't have to worry about what Ubuntu's doing.

I have an environment for each site (just sitting in a subdirectory called venv). Some people —including me, once upon a time— prefer to share their environments between multiple sites. I found this easier to maintain in terms of issuing updates but some sites can be fragile or require old versions and that holds the whole environment back. YMMV.

In terms of installing this, and just to slap me in the face, virtualenv isn't packaged for Python 3 yet so we have to use pip3:

$ sudo pip3 install virtualenv
...

$ virtualenv-3.3 myenv
Using base prefix '/usr'
New python executable in myenv/bin/python3
Also creating executable in myenv/bin/python
Installing setuptools, pip...done.

$ source myenv/bin/activate  # This is important!

Your bash PS1 should now be preneded with (myenv) to let you know you're in a different environment. We can test the environment to check we're on the right versions of things (not using the system versions for starters):

$ python --version
Python 3.3.2+
$ which python pip
/home/oli/Desktop/myenv/bin/python
/home/oli/Desktop/myenv/bin/pip

And then you can just carry on as if you were master of the universe. You don't need root to use pip anymore and you don't need to specify pip3. It's just a lot more friendly.

$ pip install django umemcache
...

If you're using something like uwsgi to host this (you should) use its -H flag (or home config argument) to tell it where the Python environment lives.

As for making development easier, you can automatically "mount" your virtualenv environment. There are many scripts out there but this one is mine (this lives at the bottom of my ~/.bashrc:

export VENVDIR="/web"
export VENVDIR_VENV="$VENVDIR/venv"

venvcd() {
        wd=$(pwd)
        [[ $wd == $VENVDIR/* || $wd == $VENVDIR ]] && wasin=true || unset wasin

        builtin cd "$@"

        wd=$(pwd)
        if [[ $wd == $VENVDIR/* || $wd == $VENVDIR ]]; then
                source $VENVDIR_VENV/bin/activate
        else
                [ $wasin ] && deactivate
        fi
}
alias cd="venvcd"

cd .

Whenever I cd into /web (where all my development websites are stored), it mounts the virtualenv for me. Note that I only have one environment for all my sites so this will only suite you if you do something similar. There are many other ways of doing similar things.


When booting from a live USB, graphics error

Boot option nomodeset

You can try to get the nvidia graphics to work with the boot option nomodeset manually according to this link,

Boot options

and if it works, you can edit your boot configuration file to add it permanently in the [multiboot] live drive.

Proprietary driver

If it works with nomodeset or some other boot option, and you want to install a proprietary driver to use the full power of the nvidia graphics card, you need to install the operating system (and it is possible to do that into [another] USB pendrive).

Try Ubuntu (Kubuntu, Lubuntu, Xubuntu, ...) before installing it

Multiboot versus many single boot pendrives

New iso files are released all the time, and it is a lot of work to keep a multiboot USB pendrive up to date. I store the new systems as iso files (and sometimes as compressed image files), and use USB pendrives as 'temporary devices', install the system I want from its file and use it. Next time I will overwrite it with the next system I want to use.

Cheap but reliable USB pendrives for cloned live-only systems

If you want to test several systems at the same time and bring the systems to some other place, I suggest that you get a bunch of cheap but reliable USB pendrives (for example Sandisk Cruzer Blades or some Transcend 4 GB pendrives) and create single boot drives by cloning, which is much more straightforward than to use a multiboot pendrive.

mkusb can clone such live-only systems in a convenient and safe way. 'It wraps a safety belt around dd' and works with and in several linux distros.

Multiboot alternatives

If you still want a multiboot system, that boots in BIOS (legacy) mode and UEFI mode, you can try according to the following links and links from them,

One pendrive for all PC (Intel/AMD) computers - single-boot dual-boot multi-boot

wiki.archlinux.org/index.php/Multiboot_USB_drive

multibootusb.org/page_faq/#does-multibootusb-support-efi-or-uefi-booting

A fast USB 3 pendrive for persistent live systems

mkusb can also make persistent live drives from iso files of standard Ubuntu, Ubuntu family flavours, Debian and some linux distros based on Ubuntu and Debian.

It is a good idea to use a fast USB 3 pendrive (even if the computer has only USB 2 ports because the flash memory hardware is often limiting the speed). Otherwise the persistent live system will be slow. See the following links and links from them,

Try Ubuntu (Kubuntu, Lubuntu, Xubuntu, ...) before installing it

help.ubuntu.com/community/Installation/FromUSBStick#Notes_about_speed

BIOS and UEFI mode

The 64-bit versions of these systems (cloned live-only and persistent live made with mkusb) will boot in both BIOS alias legacy mode and in UEFI mode. Sometimes the system will find a better graphics driver in one of the boot modes (which you find out by testing a particular operating system in a particular computer).


Are some hard-drives incompatible with Linux?

All hard drives are compatible with Linux. The fact that you can successfully partition, format, and install Linux mean that the hard disk works. What your system seems to have a problem with is either installing or booting grub. Grub is not Linux, it is just a boot loader. It is possible that your hard disk has bad blocks, or a problematic SATA controller, but all of the evidence points to some problem with grub and the BIOS, which means you need to look at answers like:

How can I repair grub?
Go into your BIOS settings and make sure it is configured to boot from the hard drive and that any other potential boot devices are disabled (floppy disk etc. may appear in the BIOS, even if you do not have a floppy drive).
Install the latest Ubuntu LTS and just let it wipe the whole hard disk and do an automatic install. There are reports on the net of Novatech laptops failing to boot with older kernels which do then boot after updating.
There are also reports of grub1 failing to boot on some systems, so its worth trying grub2. Or try grub1 (grub legacy) if you have been failing with grub2.
Check your memory for errors
Check your hard drive for errors
Try installing another OS (Windows)
If you are using amd64 try i386 (or vice versa)
Boot from grub installed to a USB drive, see Ubuntu Wiki BootFromUSB
Try installing another boot loader instead of grub (syslinux or lilo, or even the DOS boot loader with NeoGRUB)
Report your problem on the Grub-devel mailing list. It may be possible to fix the source.

I came across reports of other Novatech laptop users having similar boot problems: one said his issue was fixed after a kernel update, another fixed it by installing LILO instead of GRUB. From what you describe, my guess is that if you install your /boot partition as ext2, and then install LILO, it will boot.


It would seem you installed vlc* from the videolan master ppa. Ocassionaly it will produce builds that complete but have no plugins, ie. worthless.

If you have synaptic installed or can install, open it up, search vlc & mark ALL the vlc packages for complete removal, there will be 5 or 6

(libvlc5; libvlccore5 ; vlc-data; vlc-nox; vlc-plugin-notify; vlc-plugin-pulse

Alternately try this, removing vlc-data should remove all

sudo apt-get purge vlc-data

When you get this all cleaned up & if desiring the newly named 1.2, (vlc-2.0), then use this ppa for a stable build, for 11.10 & 12.04 only

sudo add-apt-repository ppa:videolan/stable-daily

Lp page, - https://launchpad.net/~videolan/+archive/stable-daily


Ubuntu 19.04 - Lock screen shortcut doesn't work

In my case I was using lightdm and screen lock is disabled in it due security issues. Read more here

You can check you display manager with: sudo systemctl status display-manager

If you still want to lock your screen with lightdm - you can use dm-tool lock. Also you can add it to keyboard shortcut as command (e.g. Super+L).

Switching to gdm3 helped: sudo dpkg-reconfigure gdm3


The following command removes the ppa.

$ sudo add-apt-repository --remove ppa:PPANAME
$ sudo apt-get update


Powerbroker domain profile identical to local profile so no folder created

I just left out:

/opt/pbis/bin/config HomeDirTemplate %H/%U

and instead of creating a folder (or trying to and failing because it already exists) in /home/dan, it creates folders such as:

/home/local/domain/dan

Perfect actually! :)


Ubuntu 20.04 how to remove duplicate packages after upgrade

Those packages are duplicated because in Ubuntu 18.04 they were installed as snap packages, but in Ubuntu 20.04 they are installed as deb packages.
Just open the terminal and run the following commands to remove all duplicated packages:
sudo snap remove --purge gnome-calculator
sudo snap remove --purge gnome-characters
sudo snap remove --purge gnome-logs
sudo snap remove --purge gnome-system-monitor


How I can apply the same effect to multiple pictures at the same time by GIMP?

Script Fu

Script Fu is a script/macro language that can be used by GIMP users in order to apply any kind of effects/changes to images. More information about what is Script Fu can be found here: http://docs.gimp.org/en/gimp-concepts-script-fu.html

The good thing about these scripts is that they can be shared and used everywhere! If you've made your own script or you have found a ready script online that does the job for you, then you can make GIMP aware of it quite easily: Simply move it to one of your script-folders. These folders can be found and modified by going to Edit->Preferences->Folders(usually last item)->Scripts and they usually by default are ~/.gimp-v/scripts and /usr/share/gimp/v/scripts:

Once you have placed your script there, you will need to refresh the list with your scripts. This can be done using the menu: Filters->Script-Fu->Refresh Scripts. Any new script that you have placed inside the Script-Fu folder(s) can now be used. The script will now be available in one of your menus, provided that the script doesn't contain any syntax errors.

Now, you will be able to use your scripts directly on your images. But, gimp can be called through the command line with an argument a script-fu. This is very important for your occasion, as you don't want to repeat your actions.

After you follow the excellent (official) tutorial I linked to and you create the appropriate script-fu for your occasion, you then should call gimp with this script fu as an argument and apply it to all of your images. This will alter all of your images massively!

An example script is the following:

gimp -i -b '(batch-unsharp-mask "*.png" 5.0 0.5 0)' -b '(gimp-quit 0)'

It will run the batch-unsharp-mask filter to *.png (all the .png files in the current directory) with the arguments 5.0, 0.5 and 0. Then it will simply quit with exit code 0 (gimp-quit 0).


Dual boot - SSD + mSATA - GRUB partition placement

don't do any changes to existing SSD drive
you don't have to have swap partition
Use gparted to format the mSata drive according to your needs - just prepare the partitions
in Ubuntu installer go to advanced/manual partitioning and select the the mount place for root (/) and home (/home) on your newly created partitions
when asked by installer where to put grub, select the SSD drive and installer would handle that automatically


Is it Safe to Delete Files From /var/tmp?

Filesystem Hierarchy Standard
5.15 /var/tmp : Temporary files preserved between system reboots
5.15.1 Purpose
The /var/tmp directory is made available for programs that require temporary files or directories that are preserved between system reboots. Therefore, data stored in /var/tmp is more persistent than data in /tmp.
Files and directories located in /var/tmp must not be deleted when the system is booted. Although data stored in /var/tmp is typically deleted in a site-specific manner, it is recommended that deletions occur at a less frequent interval than /tmp.

Yes, you can remove all files in /var/tmp/.
But 18Gb is far too much. Before deleting these files do have a look at what it holds and see if you can find a culprit. Otherwise you will have it at 18Gb again soon.


Autologin to gnome-shell in Ubuntu 11.10

Go to "System Settings" and then "User Account". In there you can change the setting to automatic login.


Installed Ubuntu on previous Windows machine with partitioned drive

For future reference, if anyone gets on the same situation, I was able to retrieve most of my files with NTFS GetDataBack.


Which one is best js minifier used in Ubuntu

You can use the Closure Tools project. It is an effort by Google engineers to open source the tools used in many of Google's sites and web applications for use by the wider Web development community.

you can use it from:

Closure Tools — Google Developers

documentation could be found:

Closure Compiler Documentation - Closure Tools — Google Developers

If you want an Ubuntu application you can use yui-compressor.This is not the best option but it's probably the easiest. It's JavaScript/CSS minifier.

you can install it by:

sudo apt-get install yui-compressor

You can run yui-compressor myfile.js and it'll do all for you :)


How to efficiently switch between several terminal windows using the keyboard?

In linux almost every terminal support tab, for example in Ubuntu with default terminal you can press:

Ctrl + Shift + T or click File / Open Tab
and you can switch between them using Alt + $ {tab_number} (*eg. Alt + 1)

also you might want to take a look at terminator


On Ubuntu 20.04 accessing shared folder in Virtualbox Windows Guest causes guest to reboot

Install the latest version of Virtualbox...

sudo apt-get purge virtualbox virtualbox-ext-pack

sudo apt-get update

sudo apt-get install virtualbox-6.1

If you can't install virtualbox-6.1, then follow the instructions here to add the repo to your system, then retry the install.

Add the following line to your /etc/apt/sources.list. According to your distribution, replace <mydist> with 'focal', 'eoan', 'bionic', etc.

deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian <mydist> contrib

Then do...

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -

sudo apt-get update
sudo apt-get install virtualbox-6.1


Warning: Ensure you've got another Desktop environment installed before your remove Unity!

Then install the Synaptic Package Manager:

sudo apt-get install synaptic

then going to the dash:

Typing "Synaptic" Enter

Search for "Unity" in the filter
Then remove Unity
Again use filter
Re-Install Unity


Okay, I could not find a solution, so I simply removed (deleted) all the files beginning with
    gcj-4.4-jre-headless
 from the folder
    /var/lib/dpkg/info/
 . I don't know if that was the best idea, but it worked. Good luck for everyone who reads this.


How do I position widgets next to each other in Glade?

you can do that with a Box or with a Grid. Both are aviable from the Containers-Section of the Palette.


Setup my ssh server, can't connect remotely

Some routers have a problem traversing NAT when trying to connect to a server, using its external IP, but on the same LAN. It should work just fine from an outside network.


It sounds like your disk is broken ... take a backup of any important data, buy a new disk, or a new computer, if you have planed to replace it anyway.


It seems that something may be wrong with the system's ACPI table since none of the USB* devices are tied to a PCI bus.

On my laptop, when I plug in my USB keyboard, I can see the pci path 0000:00:1d.0 in dmesg output:

input: ... as /devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-2.3/6-2.3:1.0/input/input14

From there I can find the ACPI device name in /proc/acpi/wakeup, and echo it in to enable it:

USB0  S3 enabled  pci:000:00:1d.0

I would assume that since the mapping of pci bus to ACPI device is missing for your system, it won't be possible to get it working. You may need to start debugging the DSDT to get much further. http://acpi.sourceforge.net/dsdt/index.php


Error while drawing a clock using turtle module

Note that, penup does not take any arguments. So, I do not know what you are trying to do, but your code may be corrected as in the example below:

#!/usr/bin/python3
import turtle
wn=turtle.Screen()
te=turtle.Turtle()
te.shape("turtle")
te.penup()
te.setpos((0,250))
te.pendown()
te.right(-15)
for i in range(12):
  te.right(30)
  te.forward(100)
wn.mainloop()


How to "ping" from my ubuntu linux server to a PC with Windows 8?

Linux and Windows (and Mac, etc) all use the same command ping, however, there are some slight differences in the execution of the command. In Windows, you will need to do a ping -t to have a similar effect to the ping command in Linux, i.e. continuous pinging until CTRL-C is pressed.

If you are not getting a response from your Windows machine, that means that either the firewall is running and blocking ICMP requests, your network settings are incorrectly configured or there is no network route between your Linux and Windows server (assuming they are physically or wirelessly connected to each other).


- switch between tabs in current application

Thanks. Removing the global shortcut for tabbing through open windows of an application has fixed my tabbing through Firefox. Still doesn't work for gedit, but that's a fight for another day.


Display Mangers didn't load after login screen in Ubuntu 18.04

You have many display managers ..., - then you need to choose, which display manager you actually want and make this display manager active
with command as follows... don't forget to install xdm package :
First you have to disable the current running display-manager of gnome:

sudo systemctl stop gdm.service

Then ..., when xdm is installed, do this:

sudo systemctl start xdm.service
reboot


As DoR said in the a comment, you can hit F10 , then hit the arrow keys to select the Messaging Menu.


Ubuntu 20.04 reboots to black screen after installing Radeon AMD Pro drivers

I too have tried to Amd pro drivers. Got same issue. I went to safe mode to uninstall that one to boot into ubuntu. Got a feeling that it's hopeless, but after digging into a lot I found this:
$ sudo lshw -c video
  *-display
       description: VGA compatible controller
       product: HD Graphics 620
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 02
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:133 memory:c0000000-c0ffffff memory:b0000000-bfffffff ioport:5000(size=64) memory:c0000-dffff
  *-display
       description: Display controller
       product: Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / Radeon 520 Mobile]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 83
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi bus_master cap_list rom
       configuration: driver=radeon latency=0
       resources: irq:135 memory:a0000000-afffffff memory:c1400000-c143ffff ioport:4000(size=256) memory:c1440000-c145ffff

That means the required driver was already embedded in my system. When I tried to install AMD Pro it was sort of conflicting. The package installs, and uses DKMS to compile a new initrd image file.  Then, when I reboot the system, that new image causes a kernel panic.(Found after googling, Can't describe in depth).
You can alternatively try this:
$ sudo add-apt-repository ppa:oibaf/graphics-drivers
$ sudo apt update && sudo apt -y upgrade

In case you need to revert back to your original Ubuntu AMD Radeon drivers you can remove the PPA driver installation using the below commands:
$ sudo apt install ppa-purge
$ sudo ppa-purge ppa:oibaf/graphics-drivers


Ubuntu Server , Installed Hdd into another computer and now have no internet connection

To setup static IP, we need to edit the interfaces file

  sudo nano /etc/network/interfaces

The current entry would look like

auto eth0
iface eth0 inet dhcp

You will need you need to change this to:

auto eth0
iface eth0 inet static
   address 192.168.x.x
   netmask 255.255.255.0
   network 192.168.0.0
   gateway 192.168.0.1
   dns-nameservers 8.8.8.8

You will have to change the addresses around depending on your network.

Then restart networking using sudo service networking restart. If that gives you trouble reboot the machine.

If your router is using DHCP, you can also consider to configure the router to assign a particular static IP to the server.


I don't know about Win7 as I don't own one, but Ubuntu's Desktop Environment (=DE) "Unity" looks pretty nice but costs very much resources. What CPU, RAM, Graphics do you have? If they are too weak this could be the cause for the heat. Does everything run fluently or are there small "hangs" as if the pc is too busy? If this was the cause, you could try installing another DE such as xfce or lxde that needs less resources. Could also be that Ubuntu has different settings for power management, fan control etc., but I don't know about this. Greetings.


Does the "Sync Locally?" option in Ubuntu One, mean that it just uploads to the server?

It means the folder exists “in the cloud”, and if the option to sync locally is checked, then changes to the folder and its contents (new files, editions, deletions, etc) will be synced with that: that is, that changes elsewhere will be brought down to this computer, and that changes on this computer will be pushed up. Conversely, if the option is not selected, then local changes  will not by uploaded, and remote changes will not be downloaded.


Will Ubuntu allow me to play games like I do in Windows?

Simple answer: No. You can get some to run, but a lot more won't run, many will also run badly. If gaming is a priority for you, the easiest fix is to just dual boot into Windows. If you are really lucky, the handful of games you care about might run in Linux (e.g. Minecraft does).


How to change window opacity dynamically in Python and Quickly?

You can use the set_opacity() method of GtkWindow object.

It will expect a float, so you should do a type conversion before.

try:
    self.set_opacity(float(title))
except ValueError:
    pass  # Do something with the invalid value here.


Swap partition does not mount on restart

Is that the actual line you have in fstab for the swap partition? If it is replace "xxx" with the real UUID. You can get that by running

 sudo blkid

My swap line is

UUID=2188134d-a147-4db9-9b58-fe12f7b74a58 none swap sw 0 0

my blkid output

/dev/sda2: UUID="72cf9e50-f555-476e-a018-cec87a86d2bb" TYPE="ext4"
/dev/sda5: UUID="2188134d-a147-4db9-9b58-fe12f7b74a58" TYPE="swap"
/dev/sda6: UUID="14143c21-08e9-4d31-b083-f6efb11234fb" TYPE="ext4"
/dev/sda7: LABEL="1210" UUID="955bd082-58af-46fc-a72b-016c9d7a3150" TYPE="ext4"
/dev/sdb1: UUID="14ee47cc-54cb-4887-8773-fd53121efe10" TYPE="ext4"

Backup and edit the fstab file to change as necessary

sudo cp /etc/fstab /etc/fstab.bak && gksudo gedit /etc/fstab

It might also be worth checking that the UUID in /etc/initramfs-tools/conf.d/resume is correct.

cat /etc/initramfs-tools/conf.d/resume

This should match the UUID for the swap partition, if it is different then change the UUID

sudo cp /etc/initramfs-tools/conf.d/resume /etc/initramfs-tools/conf.d/resume.bak && gksudo gedit /etc/initramfs-tools/conf.d/resume


/boot/efi can't be mounted after kernel update Ubuntu 13.04

I just updated my Ubuntu 13.04 system to kernel 3.8.0-29 and I had no problem with this. My suspicion is that you're experiencing filesystem damage. This is common on systems that dual-boot with Windows 8 because of a Windows 8 feature called "fast startup." This feature essentially turns the shutdown operation into a suspend-to-disk operation. This works fine on a single-boot computer, but when the computer dual-boots with another OS, the result is dangerous filesystem problems, at least on any filesystem that's shared between OSes (including the EFI System Partition [ESP]). To fix this, boot to Windows and disable fast startup. Note that this feature is not the same as the fast boot option in your firmware; disabling this feature in the firmware does not disable it in Windows 8.

If you disable fast startup and the problem persists, then you could try doing a filesystem check on your ESP, as in dosfsck /dev/sda1. (The device file in Linux might be different, though. Use parted or GParted to find the FAT partition with a "boot flag" set, or use gdisk to find the partition with a type code of EF00.)

If the problem persists even after you disable fast boot and fix the filesystem, please try the following diagnostics:

grep efi /etc/fstab
sudo blkid

Compare the results -- the /etc/fstab file defines where partitions are mounted, and so searching it for efi should produce details on how your system is mounting the ESP. For instance, on my system, it shows the following:

$ grep efi /etc/fstab
# /boot/efi was on /dev/sda1 during installation
UUID=FFB3-46B6  /boot/efi   vfat    defaults    0   1

The blkid command produces information on all your computer's filesystems. You want to compare what it shows for your ESP (usually /dev/sda1, /dev/sda2, or /dev/sda3) to what's in /etc/fstab. For instance:

$ sudo blkid
/dev/sda1: SEC_TYPE="msdos" LABEL="ESP" UUID="FFB3-46B6" TYPE="vfat"
/dev/sda2: LABEL="Fred" UUID="421258c1-e9b1-4b1b-9dd7-60b82e75f8c3" TYPE="ext4"
/dev/sda3: UUID="9108d33b-855d-49ba-8b9e-90f981a597ea" TYPE="swap"

In this case, /dev/sda1 is the ESP -- it's a FAT (TYPE="vfat") filesystem, and its serial number matches what's in /etc/fstab (UUID="FFB3-46B6"), so all is in order. A mismatch of the serial numbers or some other detail might cause the problem you're encountering. If you need more help, please edit your post with this information and the exact error message you're seeing.


Lirc Configuration Dialog Not Coming Up After Install

Most of the functionality of lirc has been moved into the kernel on recent Ubuntu releases.

So, you need to uninstall lirc and make sure that ir-keytable is installed instead. Then, in terminal type man ir-keytable to get started.

In terminal...

sudo apt-get update
sudo apt-get purge lirc
sudo apt-get install ir-keytable

Plug in your remote dongle, and in terminal, type ir-keytable and this will give you the basic information you'll need to get started. Then use ir-keytable -t to get/review your scan codes. You'll save a keymap in /etc/rc_keymaps (you can get a prebuilt keymap file from /lib/udev/rc_keymaps/), and edit /etc/rc_maps.cfg if you need to.

Update:

In terminal...

sudo cp /lib/udev/rc_keymaps/rc6_mce /etc/rc_keymaps

If you Google ir-keytable you'll get plenty of how-to articles to help you. One good article is at http://madaboutbrighton.net/articles/2015/remote-control-media-player-without-lirc-using-ir-keymap


gCCG works flawlessly and is open source + native... Quirky controls from the start, but once you figure it all out you'll like it, and there are a lot of players.

We're trying to remedy all this at WTactics.org, but don't have a client for you yet... also, as mentioned, Cockatrice also works wonders.


Any programs to help tag/organize files?

Nautilus from gnome-team ppa has an extension for add/removing tags, and I've posted another python-extension for filter file/dirs by tags

How to search for files by tags?

https://bugzilla.gnome.org/show_bug.cgi?id=670163

https://bugzilla.gnome.org/show_bug.cgi?id=670643


You probably have some kind of program that locks the APT files. This could be:

Ubuntu software center installing something
You changing your software sources
The Software Update doing it's work

If you reboot the machine and issue that same command, what does happen?


Wanted: In-depth guide to virtualizing existing Windows 7 partition with VirtualBox

OK, found the best guide here: http://fds-team.de/cms/articles/2013-12/use-a-real-windows-7-partition-in-virtualbox-kvm-vmware-player-u.html (might not work on GPT installations of Windows)


First check to make sure there is an HDMI output listed and selected under Sound Settings.

If you don't see one, you'll need to install the proprietary drivers for your graphics card with the instructions found in this answer. Open a terminal by pressing Ctrl+Alt+T on your keyboard and copy and paste the commands in line by line.


KDE: set ScaleFactor for a given app instance?

I dont know a method to scale only a single window, but you can use the command xrandr.

First use the command without options to see the name of the output-device, then use the options --output and --scale.
Here an example:

mook@MookPC:~$ xrandr
Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767
VGA1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 410mm x 230mm
   1366x768      59.79*+
   1024x768      75.08    70.07    60.00
   832x624       74.55
   800x600       72.19    75.00    60.32    56.25
   640x480       75.00    72.81    66.67    60.00
   720x400       70.08
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

mook@MookPC:~$ xrandr --output VGA1 --scale 1.4x1.4
mook@MookPC:~$ xrandr --output VGA1 --scale 1.0x1.0

A restart is not required.


For this kind of advanced issues, I suggest to look into others Wine users reports : https://appdb.winehq.org/appview.php?appId=17


Why nslookup result always comes from server 127.0.0.1

By default Ubuntu does indeed cache DNS entries with Dnsmasq. Dnsmasq does a lookup when a DNS entry is not in its cache, which is why you'll always see the localhost (127.0.0.1) IP address  when doing a DNS lookup without specifying the nameserver.

In the manpage it's explained as follows:

  Dnsmasq accepts DNS queries and  either  answers  them  from  a  small,
  local,  cache  or  forwards  them  to a real, recursive, DNS server. It
  loads the contents of /etc/hosts so that local hostnames which  do  not
  appear  in  the global DNS can be resolved and also answers DNS queries
  for DHCP configured hosts.

This behaviour can be overridden by editing /etc/NetworkManager/NetworkManager.conf and changing dns=dnsmasq to #dns=dnsmasq, after which you'll need to restart the network-manager service (sudo service network-manager restart).

More information can be found in the community documentation and in the manpage.


How do i fix ubuntu if it crashes at start up?can i download version 12 anywhere?

You can download Ubuntu 12.04.4 here:
http://releases.ubuntu.com/precise/

It could be hardware related, I would try Alt + Ctrl + F2, login and type:

sudo apt-get install xserver-xorg-video-ati

Because, you might just need the ATI wrapper for Ubuntu, however it could be a lot of things, I don't know how you could have peacefully when through the installation without it though.

sudo apt-get update && sudo apt-get upgrade might help too.

or maybe bad dvds. I have had bad installs everytime I used the default cd burner in 12.04, I always had to use K3b.


Step by Step enable remote login to home ubuntu machine?

Now that you have verified the service works from the local network, you're ready to forward the ports from the router to go to the desired computer.
You can get (verify your computer's IP) the local IP address of your computer by running the following command.  The output will be similar to this example, of which I'll use for the example in these steps.
$ hostname -I
192.168.1.5

You want to forward the ssh port (port 22) in the router's configuration to the IP address of your server.
The Steps:

Ensure ssh is working by testing it from the local network.
Verify the Local IP address of your computer.  This will be the IP of the
Verify the Public IP address of your router (how it's seen from the outside).
Forward the ssh port 22 (the tcp protocol) to the local IP address of your computer.

With those steps, you can now log into your computer using the public IP of the router from outside your network.
Some details for conveniences
You can setup a DNS to point to your router's public IP address so that you can conveniently use the name for logging in rather than having to remember the IP address.
Static IP Versus Dynamic IP
Most home internet service providers charge a fee for Static IP addresses.  So it's likely that you may have a dynamic IP, which is subject to change from time to time.  If you have a dynamic IP and can't connect from remote, you have to check to ensure that you are trying to connect to the correct IP address of your router.
A static IP will not change without some type of conscience configuration and intentions.
If you have a dynamic IP it's possible to use a ddns service (Dynamic Domain Name System) to assign a name that will automatically change the name to point to the new dynamic IP when it changes.  There is a feature of most routers to configure it to use your DDNS service.
Trouble Shooting Alternatives
Internet Service Providers often blocks many common ports.  It's often to protect the user from hackers and exploits.  Sometimes it's to prevent the user from running certain services and to minimize bandwidth.
Whatever the purpose, you'll have to use an alternate port for your ssh server.  This can be done by adding or changing the port the ssh server will listen to.  You can do this by editing your /etc/ssh/sshd_config file.
Ubuntu uses port 1022 as an alternative when performing version upgrades from remote.  This provides for a means to login into a recovery session if you loose connection.  I used this same port in my example below.  You can set it for any port that isn't currently being used for something different.
After changing the listening port on the server, be sure to change the port forwarding configuration in your router to the port the ssh server is listening to.  Also be sure to test the new port configuration locally.
Change from:

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to

Change to:

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
Port 1022
# Use these options to restrict which interfaces/protocols sshd will bind to

After making sshd service configuration changes restart the sshd service with:
$ sudo systemctl restart sshd

The command to ssh into an alternate port:
(This command can be executed from any computer including the server itself for testing and logging into the port.)
$ ssh -p 1022 username@server.com

A website to test the way the ports are viewed from outside
You can verify your settings by connecting to this site:
http://www.canyouseeme.org.


How to quickly find the deepest subdirectory

locate command is the fastest
The locate command is your friend in this case:

$ time locate "/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*"
/mnt/clone/home/rick/.gradle/wrapper/dists/gradle-4.6-all/bcst21l2brirad8k2ben1letg/gradle-4.6/samples/userguide/multiproject/dependencies/java/services/personService/src/main/java/org/gradle/sample/services/PersonService.java
/mnt/clone/home/rick/.gradle/wrapper/dists/gradle-4.6-all/bcst21l2brirad8k2ben1letg/gradle-4.6/samples/userguide/multiproject/dependencies/java/services/personService/src/test/java/org/gradle/sample/services/PersonServiceTest.java
/mnt/clone/home/rick/.gradle/wrapper/dists/gradle-4.6-all/bcst21l2brirad8k2ben1letg/gradle-4.6/samples/userguide/multiproject/dependencies/javaWithCustomConf/services/personService/src/main/java/org/gradle/sample/services/PersonService.java
/mnt/clone/home/rick/.gradle/wrapper/dists/gradle-4.6-all/bcst21l2brirad8k2ben1letg/gradle-4.6/samples/userguide/multiproject/dependencies/javaWithCustomConf/services/personService/src/test/java/org/gradle/sample/services/PersonServiceTest.java

real    0m1.731s
user    0m1.653s
sys     0m0.072s

Stuff in enough /*/* until no results are displayed, then subtract one /* to get the deepest subdirectory level. The files in the deepest levels will also be display.
Note: On this machine there are four different paths returned. Each path contains one file.

Some details about locate
The database used by locate is updated daily by cron. If you installed an application or created new directories today you need update the database using:
sudo updatedb

In Ubuntu 19.10 the locate command is no longer installed by default. Hopefully it returns in 20.04 but in the meantime you need to install it with:
sudo apt install mlocate

To gain an appreciation of locate speed look at what it has indexed for instant retrieval:
$ locate -S

Database /var/lib/mlocate/mlocate.db:
    381,154 directories
    2,548,775 files
    213,049,136 bytes in file names
    92,287,412 bytes used to store database

Using a script
Comments point out how people won't know the starting point. I wrote a script that defaults to 50 level starting point and works backwards from there. You can override with a starting point of 6 to 126 subdirectory levels.
Script output:
$ time deepdir

Search point 50 levels deep: /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
Common path followed by unique sub-paths (deepest subdir 25 levels):
+- /mnt/clone/home/rick/.gradle/wrapper/dists/gradle-4.6-all/bcst21l2brirad8k2ben1letg/gradle-4.6/samples/userguide/multiproject/dependencies/
|--- /java/services/personService/src/main/java/org/gradle/sample/services/PersonService.java
|--- /java/services/personService/src/test/java/org/gradle/sample/services/PersonServiceTest.java
|--- /javaWithCustomConf/services/personService/src/main/java/org/gradle/sample/services/PersonService.java
|--- /javaWithCustomConf/services/personService/src/test/java/org/gradle/sample/services/PersonServiceTest.java

real    0m45.141s
user    0m44.552s
sys     0m0.588s

$ time deepdir 26

Search point 26 levels deep: /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
Common path followed by unique sub-paths (deepest subdir 25 levels):
  (... SNIP repeated parts ...)

real    0m6.123s
user    0m6.041s
sys     0m0.080s

The first time you run the script you don't know how deep the subdirectories go. Therefore the default of 50 levels will takes 43 seconds to run.
The second time you run the script pass the known count + 1 and it only takes 6 seconds to run.
After the second time, take the output line of /*/*.../* and copy it (less 1 set) to the clipboard as a parameter for calling locate or another command.

The bash script
#!/bin/bash

# NAME: deepdir
# PATH: $HOME/askubuntu/
# DESC: Answer for: https://askubuntu.com/questions/1187624/how-to-quickly-find-the-deepest-subdirectory/1187625?noredirect=1#comment1985731_1187625
# DATE: November 11, 2019.

StartLevel=50
[[ $1 != "" ]] && StartLevel="$1"
[[ $StartLevel -gt 126 ]] && { echo Max levels 126 ; exit 1 ; }
[[ $StartLevel -lt   6 ]] && { echo Min levels   6 ; exit 2 ; }

Big="/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*" # 33
Big="$Big/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*" # 31
Big="$Big/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*" # 31
Big="$Big/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*" # 31
                                                       # Total supported: 126

# If starting level populated it is too small.
Search="${Big:0:StartLevel*2}"
echo "Search point $StartLevel levels deep: $Search"
Count=$(locate "$Search" | wc -l)
[[ $Count -gt 0 ]] && { echo "Levels too small. $Count files found" ; exit 3 ; }

# Loop backwards to find first populated level, always more than 5
for (( l=StartLevel; l>5; l-- )) ; do
    Search="${Big:0:l*2}"
    Count=$(locate "$Search" | wc -l)
    [[ $Count -gt 0 ]] && break
done

Arr=( $(locate "$Search") )

# Enhancement using Q&A: Longest common prefix of two strings in bash
#                        https://stackoverflow.com/a/17475354/6929343

Common=\
"$(IFS=$'\n'; sed -e '$!{N;s/^\(.*\).*\n\1.*$/\1\n\1/;D;}' <<<"${Arr[*]}")"
Common="${Common%/*}/"
echo "Common path followed by unique sub-paths (deepest subdir $l levels):"
echo "+- $Common"
Len="${#Common}"

for p in "${Arr[@]}" ; do
    # echo "DEBUG: $p"
    Curr="$(dirname "$p")"
    [[ $Curr != "$Last" ]] && echo "|--- /${p:$Len}"
    Last="$Curr"
done

exit 0


Ubuntu GNOME 13.10 cannot change window border theme

To change to theme Adwaita, open a terminal and do:

gsettings set org.gnome.desktop.wm.preferences theme Adwaita

Source: How can you change the GTK Theme and Window Decorations separately in Unity?


Start the unity panel through the command line?

Type unity in terminal and it should start unity.


"pci=nomsi,noaer" in "/etc/default/grub" : any downside?

As stated here: http://redsymbol.net/linux-kernel-boot-parameters/2.6.28/

noaer: [PCIE] If the PCIEAER kernel config parameter is enabled, this kernel boot option can be used to disable the use of PCIE advanced error reporting.
nomsi: [MSI] If the PCI_MSI kernel config parameter is enabled, this kernel boot option can be used to disable the use of MSI interrupts system-wide.


How to download with arai2c with maximum speed?

uGet makes using aria2 much easier but you will not be able to get your download speed past your max internet speed regardless of the number of connections.


When you remount the filesystem you have to make sure that you mount it as Read-Write.

sudo mount -o rw [Partition] [Target directory]

for example:

sudo mount -o rw /dev/sdb2 /mnt/data


Trying to wipe the SD card

What is the output from this command, that you already tried?

sudo dd if=/dev/zero of=/dev/mmcblk0

Please edit your question to post the output. Indent four spaces to render the text as code. What happens if you unplug the card and plug it in again. Often you have to unplug + plug in again for a modfied partition table of memory cards to be recognized.

You can do the same thing but in a safer way with mkusb, wipe the card. It can also restore the card to a standard storage device. mkusb helps you identify the target device (in this case the card), 'wraps a safety belt around dd'. See these links

help.ubuntu.com/community/mkusb

mkusb/persistent

Analysis of the result

Your output from sudo dd if=/dev/zero of=/dev/mmcblk0

dd: writing to '/dev/mmcblk0': No space left on device
61831169+0 records in
61831168+0 records out
31657558016 bytes (32 GB, 29 GiB) copied, 9427,3 s, 3,4 MB/s

indicated that dd wrote to the drive, the SD card. I agreed with the comment by Elder Geek, that you should reboot the computer and check if the card is wiped: No partition table should be seen.

If successful, it would be possible to create a new partition table and file system.
Else (if there were still partitions), I think the card would be 'grid-locked' (read-only because it is failing), and in the next step it would be completely dead. See this link,

Pendrive lifetime
The card reader too might be bad, so it is a good idea to test the card with another card reader in the same or in another computer.

Conclusion

After reboot and further tests the partitions and files are still there. The conclusion is that the SD card is failing, 'grid-locked', which means in a read-only stage of the failing process.


Wifi stopped working Ubuntu 14.04, wireless card and networks still detected

Thanks for the comments - my machine doesn't have any wifi switch but I've resolved the issue the fat-handed way:

I learned that my wifi card doesn't always play nicely with the driver, got fed up and wiped everything clean, installing Ubuntu 16.04. Initially the wifi still did not work, but this time sudo /usr/sbin/rfkill unblock wifi did the trick. The reinstall was really quick and fixed some other problems too - my touchpad finally works.


How can I become the owner of a file/folder that root owns?

Open a terminal (CTRL+ALT+T). Now you are in your home.
sudo chown -R $USER:$USER Pictures and type your normal user password.


To see your SMB versions that are being used run the following command on the server:

sudo smbstatus

Example:

terrance@Intrepid:~$ sudo smbstatus

Samba version 4.3.11-Ubuntu
PID     Username      Group         Machine            Protocol Version
------------------------------------------------------------------------------
11898     nobody        nogroup       10.0.0.100   (ipv4:10.0.0.100:50612) SMB3_02

Service      pid     machine       Connected at
-------------------------------------------------------
IPC$         11898   10.0.0.100    Wed Jun 20 21:07:28 2018
storage      11898   10.0.0.100    Wed Jun 20 21:07:28 2018

No locked files

As we can see by the above, one of my Linux boxes is connecting using SMB3.0.2 protocol version.

Hope this helps!


awk can help:

awk '{ if ($1 == "PRODUCT5:") $8 = "$type2"; print }' input
mv output input

or sed

sed -i '/^PRODUCT5/s/$type$/$type2/' input


is /boot partition needed after OS is booted?

No, /boot isn't needed during normal system operation. In fact, it doesn't need to be mounted at all, since only the bootloader reads /boot, not Linux itself. You can add noauto to the /boot line in your /etc/fstab. There are even weird setups (or not-so-weird embedded setups, not running Ubuntu but this isn't distribution-specific) where Linux is booted from another operating system where the kernel isn't stored in a place that's accessible by Linux.

The times when you'll want to mount /boot are when you upgrade your kernel or your bootloader, or change their configuration.


Hard drive has only one Ubuntu partition, how do I install Windows to dual-boot?

I'm assuming you mean Windows 7.

Boot from a LiveCd/USB and use gparted to shrink your one partition and make space for Windows. Then install Windows to that space. Windows will overwrite grub so boot from LiveCD again, and reinstall grub, running sudo update-grub.


Aquaris E5 HD Ubuntu Edition - Ubuntu Updates

This bit of the devloper documentation says that it can automatically - this should mean that unlike on many android devices, you can apply updates to the system, and have the latest release (if there is a image available.....):

Upgrading Ubuntu
Upgrading automatically
After installing Ubuntu, upgrades to newly released images and apps
are automatically provided through Settings > Updates. Tip: You
can configure such updates to never install automatically in
Settings > Updates.

There is also documentation on how manually to flash images onto the device (meaning you could install the next release image even if it is not yet stable). You have to be careful here in case it 'bricks' it (stops it working - it become a useless brick :)


Laptop lid close doesn't suspend then the battery dies

Looking at the link you followed to lock the screen on lid close you need to follow these steps to have a regular suspend when the lid is closed.

Set Ubuntu Power Settings

From the Launcher select the cog for System Settings. Click the icon Power and this screen appears:

Look at the line When lid is closed and set the options as they appear above to Suspend.

Close the window.

Set systemd logind.conf settings

Invoke the Terminal by pressing Ctrl+Alt+T. Edit the systemd logind.conf file by typing:

gksu gedit /etc/systemd/logind.conf

Look for these two lines and change them to look like this:

HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend

You might have to change ignore or lock to read suspend. You might have to remove a leading #.

Save the file and quit gedit. After ensuring no applications (like word processor, spreadsheet, etc.) have files open type into the terminal:

sudo reboot

Voila! everything is reversed and your system will operate as you expect.


"cannot open display: :0" error when using sudo with any GTK app

For graphical applications use gksu:

  gksu gsmartcontrol

If it is not installed on your system you can get it via:

  apt-get install gksu


You can install Ubuntu One Indicator by opening the Terminal (Applications>Accessories> Terminal) and enter the following lines:

sudo add-apt-repository ppa:rye/ubuntuone-extras

sudo apt-get update && sudo apt-get install ubuntuone-indicator

Credit for the image: OMG! Ubuntu!

Currently the PPA is available for Lucid and Maverick users only.


How I can finish Installation of Ubuntu 14.04

The best way (if you ever do reinstall later) to do it is to make 2 EXT4 partitions* out of the unallocated space leaving 2X the amount of RAM in MB of unallocated space which you then use to make a linux-swap partition. Then go into the Partition Editor and choose one of the Drives as mount point / and the other as mount point /home and select Format for the / one and then choose the SWAP partition and make sure it's marked as mount point swap in the Edit Box.

*(This means then that if you ever reinstall Linux on these drives, you won't have to format your /home part of the Installation (But you will have to for '/'!))

PS: You may want to try making a NEW PARTITION TABLE on /dev/sda1 (Be warned: It completely wipes the HDD clean of partitions!), it's in the Device menu of GParted under 'Create Partition Table' (And it's also there on the bottom-right hand corner of the Installer).


How to remove kubuntu desktop environment and change to default unity desktop environment?

First logout of your KDE desktop and login to Unity desktop.

Then open terminal (Ctrl-Alt-T).

Then run this command:

sudo apt-get remove akonadi-facebook akregator amarok amarok-common amarok-utils apport-kde apturl-kde ark audiocd-kio bluedevil calligra-data calligra-libs colord-kde cryptsetup dolphin dragonplayer freespacenotifier gnupg-agent gnupg2 gpgsm gstreamer0.10-qapt gtk2-engines-oxygen gtk3-engines-oxygen gwenview ibus-qt4 kaccessible kaddressbook kamera kamoso kate kcalc kde-base-artwork kde-baseapps-bin kde-baseapps-data kde-config-gtk-style kde-config-tablet kde-config-telepathy-accounts kde-config-touchpad kde-style-oxygen kde-telepathy kde-telepathy-approver kde-telepathy-auth-handler kde-telepathy-contact-list kde-telepathy-data kde-telepathy-filetransfer-handler kde-telepathy-integration-module kde-telepathy-minimal kde-telepathy-send-file kde-telepathy-text-ui kde-wallpapers-default kde-window-manager kde-window-manager-common kde-workspace kde-workspace-bin kde-workspace-data kde-workspace-kgreet-plugins kde-zeroconf kdegames-card-data kdegames-data kdegraphics-strigi-analyzer kdemultimedia-kio-plugins kdenetwork-filesharing kdepasswd kdepim-kresources kdepim-strigi-plugins kdesudo kexi khelpcenter4 kinfocenter klipper kmag kmail kmenuedit kmix kmousetool knotes konsole kontact korganizer kpat kppp krdc krita krita-data ksnapshot ksysguard ksysguardd ksystemlog ktorrent ktorrent-data kubuntu-default-settings kubuntu-desktop kubuntu-docs kubuntu-firefox-installer kubuntu-netbook-default-settings kubuntu-notification-helper kubuntu-web-shortcuts kvkbd kwalletmanager libassuan0 libaudiocdplugins4 libbluedevil1 libcalendarsupport4 libchm1 libcln6 libdebconf-kde0 libepub0 libeventviews4 libfftw3-3 libgpgme++2 libgps20 libgrantlee-core0 libgtlcore0.8 libgtlfragment0.8 libibus-qt1 libincidenceeditorsng4 libindicate-qt1 libkateinterfaces4 libkblog4 libkcompactdisc4 libkdcraw-data libkdcraw21 libkdecorations4abi1 libkdegames6 libkdepim4 libkdepimdbusinterfaces4 libkdgantt2 libkephal4abi1 libkexiv2-11 libkexiv2-data libkipi-data libkipi9 libkleo4 libkmanagesieve4 libkonq-common libkonq5-templates libkonq5abi1 libkontactinterface4 libkpgp4 libkrossui4 libksane-data libksane0 libksba8 libkscreensaver5 libksgrd4 libksieve4 libksieveui4 libksignalplotter4 libktnef4 libktorrent-l10n libktorrent4 libktpchat0 libktpcommoninternalsprivate3 libkunitconversion4 libkwineffects1abi4 libkwinglutils1abi1 libkwinnvidiahack4 libkworkspace4abi2 liblastfm1 liblightdm-qt-2-0 libllvm3.0 libloudmouth1-0 libmailcommon4 libmailimporter4 libmessagecomposer4 libmessagecore4 libmessagelist4 libmessageviewer4 libmuonprivate1 libmygpo-qt1 libokularcore1abi1 libopenal-data libopenal1 libopenconnect2 libopenctl0.8 libopenjpeg2 libopenshiva0.8 libplasma-geolocation-interface4 libplasmaclock4abi3 libplasmagenericshell4 libpoppler-qt4-4 libprocesscore4abi1 libprocessui4a libqalculate5 libqalculate5-data libqca2-plugin-ossl libqgpgme1 libqimageblitz4 libqoauth1 libqtglib-2.0-0 libqtgstreamer-0.10-0 libqtgstreamerui-0.10-0 libqtscript4-core libqtscript4-gui libqtscript4-network libqtscript4-sql libqtscript4-uitools libqtscript4-xml libqtshiva0.1 libreoffice-kde libreoffice-style-oxygen libruby1.9.1 libsolidcontrol4abi2 libsolidcontrolifaces4abi2 libspnav0 libsyndication4 libtag-extras1 libtaskmanager4abi3 libtelepathy-logger-qt4-1 libtelepathy-qt4-2 libtemplateparser4 libweather-ion6 libyaml-0-2 libzip2 lightdm-kde-greeter muon muon-installer muon-notifier muon-updater okular okular-extra-backends oxygen-cursor-theme partitionmanager pinentry-gtk2 pinentry-qt4 plasma-dataengines-addons plasma-dataengines-workspace plasma-desktop plasma-netbook plasma-scriptengine-python plasma-widget-facebook plasma-widget-folderview plasma-widget-kimpanel plasma-widget-menubar plasma-widget-message-indicator plasma-widget-networkmanagement plasma-widget-telepathy-chat plasma-widget-telepathy-presence plasma-widgets-addons plasma-widgets-workspace plymouth-theme-kubuntu-logo plymouth-theme-kubuntu-text print-manager python-pyudev python3-pykde4 python3-pyqt4 python3-sip qapt-deb-installer quassel quassel-data rdesktop rekonq ruby ruby1.9.1 skanlite software-properties-kde systemsettings tasks-icons ubuntu-release-upgrader-qt usb-creator-kde userconfig

This will remove KDE completely and then you might want to run:

sudo apt-get autoremove

Thanks to: Psychocats Eliah Kagan for pointing it out.


if you're using VMware Workstation 11 on Ubuntu 15.04, the default vmnet network won't work unless you patch it. Here's a tutorial:

log in as root (e.g. sudo -s)
Enter your Root password.

Enter these commands:

curl http://pastie.org/pastes/9934018/download -o /tmp/vmnet-3.19.patch

cd /usr/lib/vmware/modules/source
tar -xf vmnet.tar
patch -p0 -i /tmp/vmnet-3.19.patch
mv vmnet.tar vmnet.tar.SAVED
tar -cf vmnet.tar vmnet-only
rm -r vmnet-only
vmware-modconfig --console --install-all

I've tested it for 3.19 kernel and it worked like a charm.

Source


How to enable my flashdrive while im in the BIOS Setup Utility

Finally got my Ubuntu. All I did was went back to my bios,instead of booting from my harddrve 1st boot,I let it boot from my flashdrive 2nd boot. I changed the order. Changed flashdrive to 1st boot,then harddrive to 2nd boot. Thats all it took. It took me a long time but I got Ubuntu now.


In the link you provided to download, you need to replace the REPLACE_ME_OS/REPLACE_ME_ARCH with the appropriate information.  Below that section you will find the following notes:

  Where REPLACE_ME_OS is one of “linux”, “darwin”, “windows” and
  REPLACE_ME_ARCH is one of “x64” or “x86” You also must replace “6.x.x”
  with the actual version.

So, your download with the wget would look like the following, assuming that you are running a 64 bit version of Ubuntu:

wget https://cli-assets.heroku.com/heroku-cli/channels/stable/heroku-cli-linux-x64.tar.gz -O heroku.tar.gz

Then all you should have to do is to continue the steps below:

tar -xvzf heroku.tar.gz

mkdir -p /usr/local/lib /usr/local/bin

mv heroku-cli-v6.13.19-6cd27b3-linux-x64 /usr/local/bin/heroku

ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku

Hope this helps!


PHP mail() function for sending basic email.

Link: http://www.php.net/manual/en/function.mail.php


how to figure out command to launch a program from terminal

On ubuntu you can use the handy bash-completion featuere to programmaticly list what commands are available to you as a user (provided you know what letters the command start with, in your case netbean it would be netb)

So open a terminal and then type the first couple letters of the application like so: netb

Then hit the tab key for a list of commands available to you

you should see the executable for neatbeans in there.


You need to boot from UEFI and that means that you go to your BIOS (press the correct key at the vendor splash screen) and pick the UEFI + USB option to boot from the boot options.

Mind that the USB might be wrongly created: UEFI is assumed for installation if the live session has a /lib/firmware/efi/  on it with the UEFI files in there.


What to do when Unity's Launcher gets stuck open?

It turns out that the Launcher is supposed to stay open on workspaces containing no windows. Two of my workspaces had maximised windows which Unity didn't seem to be noticing, and when I closed those and then re-opened them, the Launcher reverted to its correct auto-hide behaviour.

Perhaps one could also simply move the window to another workspace and back to get the Launcher unstuck--I did not think to try that.


In python, you could can get the icon with something like:

>>> from gi.repository import Gio
>>> Gio.content_type_get_icon('text/python')
<ThemedIcon object at 0xb5d61324 (GThemedIcon at 0xa372590)>


Nautilus does not launch in Ubuntu 19.04

In my 18.04 setup I had problems with tracker causing the same issue, nautilus not launching, then it worked by killing tracker, but now that did not work either.

What did work, was resetting tracker. I performed a hard reset, you might try a soft reset, maybe it could work too, I didn't test, since it got fixed by the hard reset. Sidenote: I disabled search in files.

tracker hard reset in terminal :

tracker reset -r

tracker soft reset :

tracker reset -e


Command-line equivalences of some tasks in Synaptic

Check a package's dependencies / dependent packages. (This can be done in Synaptic by viewing the properties of a package):

apt-cache depend 'package-name'
apt-cache rdepend 'package-name'

Browse available packages

apt-cache pkgnames
apt-cache search '.*'
apt-cache show 'package-name'

Search (in package names as well as the details/descriptions) for some key. (The search function at the top of synaptic)

apt-cache search pattern
apt-cache --names-only search pattern

Check if a package is installed or not

dpkg -l | grep package-name

The last one could not give the desired result, because when the terminal width is narrow the columns are truncated. Safer alternatives are

dpkg-query -Wf '${Package}\n' | grep pkg
dpkg --get-selections | grep pkg


When you use dpkg it leaves uncompleted jobs:

See the processes by ps -e.
Kill those using the installer with kill <PID>, then try to install again.


PHP 7 - Class 'Memcached' not found after upgrade to Ubuntu 17.10 artful

The answer is to upgrade to PHP 7.1.
The Ubuntu upgrade only does a partial upgrade of PHP from 7.0 to 7.1 when upgrading from 17.04 zesty to 17.10 artful.

After upgrading all your PHP modules to 7.1:

Stop and disable PHP 7.0 FPM

sudo systemctl stop php7.0-fpm.service
sudo systemctl disable php7.0-fpm.service

Start PHP 7.1 FPM

sudo systemctl start php7.1-fpm.service

Remember to also fix your web server.
For NGINX I had to change this line:

fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;

Then restart NGINX

sudo systemctl restart nginx.service


How to prevent terminal from killing process with ctrl+z

Have you tried using 'unset suspend' in ~/.vimrc or /etc/vimrc, or running vim with '-Z' (to disable suspend).


How & Where to install softwares that are not available in repositories/synaptic package manager?

You seem to want to install software that is not packaged in the repositories (or at least as a proper .deb) in the same location as packages that are in the repositories.  That's not a good idea; those locations are managed by the package management, and you should keep them clean from manual intervention as much as possible.

Software you install from source yourself is probably best installed under /usr/local/.  If you want to make it easy to update or remove such applications easily, I'd suggest you use checkinstall.  This might also work for some binary packages (depending on how they are packaged).

Most commercial software I would probably install under /opt/vendor or something like that, so that it can't conflict with package management and normal open source practices.

If you need to know where a package installed by APT puts its files, you can see that in Synaptic or with dpkg -L packagename.


Gvim doesn't show up in the nautilus context menu for .c and .h files

In your reply in the comments, you said you have created a custom launcher for GVim. In your custom desktop launcher, you neglected to include the MimeType keyword. The .desktop file is not only used to add applications to the desktop environment menu, but also to register applications with the MIME types that they can handle.

So to register GVim as a text editor with your desktop environment, your custom gvim.desktop file should contain at least the following:

[Desktop Entry]
Version=1.0
Name=GVim
Comment=Edit text files
Exec=gvim --remote-tab-silent %F
Icon=vim
Terminal=false
Type=Application
Categories=Utility;TextEditor;
MimeType=text/plain


On Ubuntu 16.04 LTS and 18.04 LTS you can install all needed files by:
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install libmysql-java


What shutdown timers with/without GUI are there available?

There are a couple of shutdown timers available on Launchpad that look interesting.

Easyshutdown - simply shuts down your PC

ComplexShutdown - it has much more options such as hibernate/suspend etc.


Can't copy my music from Rhythmbox to my iPhone

Try copying music from Nautilus (the file browser) to the iPhone instead, treating the iPhone like a drive.

If that doesn't work, please edit your question to update it with more information.


format = Pem file

To convert use :

openssl x509 -inform DER -in yourdownloaded.crt -out outcert.pem -text

System

sudo mkdir /usr/local/share/ca-certificates/extra
sudo cp root.cert.pem /usr/local/share/ca-
certificates/extra/root.cert.crt
sudo update-ca-certificates


wget or curl commands to download ubuntu fonts?

To install the Ubuntu Font Family manually using wget use the following single command by copying the entire command and pasting into a Terminal window:

wget http://font.ubuntu.com/download/ubuntu-font-family-0.83.zip && \
sudo mkdir -pv /usr/share/fonts/truetype/ubuntu-font-family && \
sudo unzip -j ubuntu-font-family-0.83.zip 'ubuntu-font-family-0.83/*.ttf' \
-d /usr/share/fonts/truetype/ubuntu-font-family && \
sudo fc-cache -f -v

Bear in mind that there is an Ubuntu Package for these fonts which can be installed by running the following command:

sudo apt-get install ttf-ubuntu-font-family

and perhaps this will be enough for you...


Try using the following nameservers: 8.8.8.8, 8.8.4.4
They are hosted by Google.

Open your connection settings, and apply these changes to all connections you use:

Select the connection and click Edit...
Go to IPv4 tab and change method from Automatic (DHCP) to Automatic (DHCP), Addresses only
Enter the both nameservers into DNS Server. Copy them as they are with comma.
Perform the same at the IPv6 tab
Save and try to access your website.


How to keep linux-cloud-tools-virtual in sync with my kernel?

You can (and probably should) do the opposite thing — install linux-image-generic (or sth. like that) to ensure that also the kernel is updated, like the cloud-tools; they'll be kept in sync by Ubuntu people. This will also allow you to get security updates — which you do want anyway in almost any case.

You also probably want to setup automatic package updates through unattended-upgrades.

The only thing left to you is to reboot the machine when the kernel is updated, unless you let unattended-upgrades do that for you.


Rhythmbox - How to get an iHeart radio station to play

Issue solved. Found this post: How to get streaming url from online streaming radio station. The error messages were spurious.

Essentially, you look at the page source and search on the word "stream". Then copy the link into the Rhythmbox URL field. In the case of the iHeart radio station, there were several "stream" links. Copied them one by one until I got the right one.


Why does my name resolution hit the DNS even with a hosts file entry?

The file /etc/nsswitch.conf will let you reconfigure the order of the name resolution. By default, the host file is the first, then the configured DNS. There could be more options.

The file /etc/hosts only lists IP addresses and hostnames (multiple names for one IP if you want)

The file /etc/resolv.conf will list the default search domains, and will also list in sequence the name servers to use.


What version of Ubuntu for MacBook Pro (Intel)?

I too have a Mactel, Core 2 Duo 2.4GHz triple-booting Ubuntu 13.04, OS X and Vista using rEFInd.

Look for Mac ISO in:
http://releases.ubuntu.com/raring/

Core 2 Duo should be able to use 64-bit linux.

You could also use UNetBootin for Mac to automatically download and create a live CD (pretty sure it can get you an ISO that works on a Mac.)
http://unetbootin.sourceforge.net/

Presumably your friend is not going to a single-install but is going to keep OS X on the machine as well (doesn't need much space, and highly recommended in case something goes funky with the Mac firmware.)

For instructions on how to do the installation see
https://help.ubuntu.com/community/MactelSupportTeam/AppleIntelInstallation

Pay attention to partitioning: Ubuntu needs an "msdos" type partition which is not the standard OS X uses.  Rather than create multiple partitions in OS X Disk Utility, I prefer to create "free space" and then use gparted from the Ubuntu LiveCD to format the appropriate partitions on final install of Ubuntu.  Actually if you're not triple-booting, you can probably just let the Ubuntu installer format the partition on its own.  The point is, if the instructions you are following have you creating a whole bunch of partitions in OS X Disk Utility...ignore that, you just need free space.

Note that the above and most install instructions mention using "rEFIt"; rEFInd is the newer fork.


According to Kaspersky they don't list that they have an anti virus program for Linux.  They do list thought Endpoint Security for Linux.  The only thing that they don't list Ubuntu 13.04 as an acceptable product.  See Kaspersky for more info.


No Internet Connection Following CodeReady Containers VM Setup

It did indeed turn out to be a DNS issue. This post by Markus Hansmair kindly explains the issue:

  This is where the subtle differences between Red Hat Linux and Ubuntu come into play. Both distributions use systemd and NetworkManager. But Ubuntu uses systemd-resolved for name resolution while Red Hat Linux uses dnsmasq.

So the dnsmasq setup that was created during CRC setup caused affected systemd-resolved. I followed Markus's advice and disabled systemd-resolved and removed the resolv.conf file. Now internet access and CRC are working.

It would be good if there was a way to run CRC on Ubuntu without having to disable systemd-resolved


Update-Manager stuck while installing package to upgrade from 13.10 to 14.04

I just ran into this problem and realized after waiting 3 hours that it was "frozen" because there was a hidden window that was asking me to confirm that I wanted to remove the obsolete packages that dist-packages found.  If you're experiencing this, click on the "Distribution Upgrade" Menu icon to check for hidden windows.


How does the linux kernel deal with drivers?

First some history.  In the earlier days of Linux, device drivers were indeed compiled directly into the kernel.  In fact, it's possible still to compile drivers directly in and many kernels may still have some very common drivers included this way.  The way it worked was the generic kernel shipped with the early distributions like SLS or Slackware had virtually every driver the kernel supported compiled directly into it so it would work on the widest possible variety of hardware possible.  Even then, it wasn't possible to put them all in because some of them are mutually incompatible.  Then, after you got your system installed, you would build your own kernel, carefully going through the configuration to make sure you included the correct drivers for everything your computer had.  Sometimes you had to manually edit header files in the driver to include support for oddball hardware - an Ethernet card that used a particular chipset used that chipset's drivers, but sometimes there were funny ways it was implemented.  Then you'd compile, install, and hopefully after a reboot you then had a custom kernel built for just your computer.  Lean and optimized.  In reality, you generally repeated this process several times including things you missed, adding support for a filesystem you forgot, or tweaking the settings in some way.  Rinse and repeat.

Those days are, thankfully, long past.  The kernel has, for a very long time, supported loadable modules.  These are kernel drivers compiled so as to become a type of shared library that can be loaded or unloaded on demand.  Now the way a kernel boots is you have the kernel file itself and a small compressed filesystem (look at initramfs on Wikipedia) that has in it all the kernel modules that kernel supports.  The kernel loads, it finds its initial filesystem and then it can start loading all the drivers it needs.

That little bit of history is skipping a lot of work and sweat along the way.  In between using all compiled-in drivers in one huge monolithic kernel and having a fully automated driver loading system we have today were all the steps along that path where we had modules that had to be explicitly loaded, semi-automatic loading for some, etc etc.

So, since modern kernels demand load the vast majority of the drivers they need, there are no significant amount of redundant hardware drivers taking up resources in the kernel of any modern Linux distribution.


You don't need to re-install your Windows. Just do as Windows say and run chkdsk


Gnome: Is there any way to hide/disable the location icon in the top bar?

Seems there is only way for now to hide all aggregateMenu icons: https://extensions.gnome.org/extension/351/icon-hider/


How to use external media in virtualbox windows installation

On the Oracle Virtualbox site  both 13.04 and 13.10 are on the same line at the very top. It says

  Ubuntu 13.04 ("Raring Ringtail") / 13.10 ("Saucy Salamander")

Click on the AMD64 link next to that to get the 13.10 64 bit version. Make sure you download the extension pack as well so that you will have the USB support as well. When you install Windows in VB, make sure you install the Guest Additions as well.


How to Uninstall Counter Strike Source and Steam on ubuntu 13.10?

This is technically a Steam question, not really an Ubuntu question, but here goes!

Since Steam is a game manager, all installs and uninstalls can be done directly inside the Steam itself. Here are the steps to uninstall a game:

Open Steam and click on the big 'Library' button at the top of the window (you will see it in-between 'Store' and 'Community').

On the left side of your window, there will now be a list of the games you have purchased through Steam (including Free-to-play games). Just to be thorough, let's make sure we are looking only at the games you have currently installed on your machine by switching what is displayed of your Steam Library. Let your mouse/cursor hover over the big Library button you clicked on before. A pop-up menu should appear right underneath the word Library - click where it says 'Installed'. You can get the same pop-up menu by clicking the button directly beneath the big "Library" as shown below:

Now find the title you want to uninstall from the list shown on the left side of the menu, and right-click on its name. Then click on 'Delete Local Content'.

You will then be asked to confirm the process. Once Steam has finished, your game has been uninstalled.

Now, regarding the deletion of all files "related to Counter Strike Source, so that next time if I install it, it wouldn't keep the settings from previous installation" - this is not how Steam works. Steam is a game manager. In Linux you can do anything, and certainly you can remove any trace of Counter-Strike Source from your hard drive, but that is not the same as uninstalling it. At the end of the day, if you don't uninstall through Steam itself, there will still be a reference to the game inside Steam, and you will still have to do the process we have just gone through above to 'Delete Local Content' even if it is just to remove the reference to the game from inside Steam. And unfortunately as far as game settings go, those aren't always just stored locally on your machine, they are sometimes also stored on Steam servers (particularly for save game files of a Single-Player game - but this is a good thing!). However, I have never noticed a multiplayer Valve game that actually does this. Any time I re-install Counter-Strike or Team Fortress I have to go through the process of reconfiguring controls and display settings so I think you are completely safe.


That is only available for xenial so either they stopped providing a debian installer or forgot to update their version.  From the website you can download a tar or binary.


Shoutcast
Shoutcast is a massive selection of individual radio stations (over 700 pages). There are so many stations that it is intimidating to even find one.
How to add Radio Stations to Rhythmbox?

Vist Shoutcast, find your favorite radio station, right click on it and select Save Link As, Save it in your music library.

Right click on .pls file you just downloaded and select Open with Rhythmbox.

Alternatively, instead of saving the .pls file just copy the link location, in Rhythmbox select Radios in side bar and click on add, enter the link there and save it.

3rd option is to open the .pls file in Gedit and copy the address from there and add it to Rhythmbox.

Alternative:
Or just install Guayadeque. Listen and browse the complete Shoutcast collection (Over 5,700 stations) and many other radio stations right from your desktop. It's available in Ubuntu Software Center.


What is UNIX and what is the relation of it with Linux

The complete answer, about difference between this:

http://en.wikipedia.org/wiki/Unix-like

Linux = Kernel
GNU = It's a project about Software Libre
Solaris = OS like Unix

:)


Why is Ubuntu 17.10 booting up with a garbled screen?

I have seen a couple of very similar posts such as this one

These suggest that you will want to be running in an xorg environment (as opposed to a wayland environment) and then

Install xdiagnose, by opening a terminal and entering

sudo apt update
sudo apt install xdiagnose

Start the xdiagnose package
Select the checkbox for "Disable Bootloader Graphics"
Click the "Apply" button at the bottom of the window
Reboot the computer.

To run in an xorg environment, please see this question


Try downloading the .deb file and installing it from that. Here is the link to it:

Download Dropbox

If that doesn't work, you could always try the terminal commands at the bottom of the page - I am used to them, so I just ran them first and faced no problems.

(BTW - when it says you have to restart nautilus, its better to just restart the system)


Add "client min protocol = NT1" to /etc/samba/smb.conf in [global] section

It is required to access NAS which only support SMB v1 with the new Samba v4.11.6 included in Ubuntu 20.04. Samba 4.11.x disables by default SMB v1.

You will probably need the fix for this bug to be published in main Ubuntu repository, as pointed by Opifex.


Ubuntu 10.04 LTS does not support the Intel 82579LM NIC as detailed here; instructions on downloading and installing the driver are provided there too. An expired bug report on this issue is here.


PackageKit database disk image malformed

The following did work:

sudo apt-get remove packagekit
sudo apt-get purge packagekit
sudo apt-get install ubuntu-software

Alternately you should be able to use the following instead:

sudo apt-get remove --purge packagekit
sudo apt-get install ubuntu-software

I had hoped to find a better solution.  I did find there's the pkcon command with the repair option, but the relies on packagekitd to be running to interact with the database.

I couldn't find any references online as to where the database was stored, or how to otherwise deal with the issue.  Most of the issues relating to PackageKit are regarding Fedora, RedHat or CentOS, so not as helpful.