Is it still possible to install Ubuntu to an external harddrive with UEFI?

It actually is possible.

Before I continue, these instructions are meant for blank EFI System Partitions (ESP) and will probably overwrite existing files, or not work as expected. At least make backups!

Adding required partitions for different  platforms

Platforms: Legacy PC, UEFI-based Windows computer, Apple computer

Add an ESP to an existing installation with MBR

You need to follow these instructions from another installation or live media.

Install the grub-efi-amd64-bin package. This will only install the resources needed. It will not switch your existing MBR style installation to UEFI and turn things upside down.
Shrink your Ubuntu partition in GParted to make space for an ESP. Recommended sizes for ESPs range from 100 MB to 500 MB, but the files created by following these instructions here will not require more than 2 to 5 megabytes.

  Note: It shouldn't matter where your ESP is located on the disk and shrinking your Ubuntu partition by a few megabytes from the end should be quick and safe. Shrinking at the beginning is not safe. One caveat though, your ESP should be a primary partition and not be part of an extended partition or a logical volume, partition numbers from 1 to 4 are fine, numbers above indicate an extended partition on MBR partition tables.

Choose FAT32 as filesystem and set the boot flag.
Mount the ESP you just created and the root filesystem you shrunk:

mkdir -p /mnt/esp
mount $esp_device /mnt/esp
mkdir -p /mnt/rootfs
mount $root_device /mnt/rootfs

  Note: Replace $esp_device and $root_device with the appropriate devices e.g. /dev/sdb2 and /dev/sdb1. The mountpoints /mnt/esp and /mnt/rootfs are just examples chosen to work with the remaining part of this answer.

Install GRUB's EFI image and a minimal configuration file with:

grub-install --efi-directory /mnt/esp --boot-directory /mnt/rootfs/boot --target x86_64-efi --removable $device

  Note that $device is the whole device e.g. /dev/sdb, not a partition.

That's it, we are already done, but let me try to explain a few things.

The parameter --target x86_64-efi will ensure that UEFI images and modules will be installed to the given paths. --removable will install the UEFI image to the hardcoded path \EFI\BOOT\BOOT{arch}.EFI for removable media, instead of a distribution specific path. Your grub.cfg in /boot/grub/ should work with both boot methods and a new folder named x86_64-efi should now exist next to i386-pc.

For completeness, this is the command for non-removable media which writes and relies on NVRAM entries in the platform:

grub-install --efi-directory /mnt/esp --boot-directory /mnt/rootfs/boot --target x86_64-efi --bootloader-id "Ubuntu" $device

Proper UEFI installations include a line similar to the one below in /etc/fstab, but the setup is functional without and the UEFI image (similar to the MBR bootloader) is usually only written/updated during OS installation.

UUID=1234-567F /boot/efi vfat defaults 0 1

Adding an ESP or GRUB-BBP to an installation with GPT

Adding an ESP to a legacy installation on a GPT partitioned drive is very similar to the above:

Install the grub-efi-amd64-bin package.
Create a partition with a FAT32 filesystem similar to the instructions above by resizing the root partition and set the boot flag.
Mount the partitions and run the grub-install command from above that includes the --removable parameter.

This also works if you just want to boot your exisitng UEFI installation on another computer.

Creating a BIOS Bootable Partition (BBP) for GRUB is a bit different:

Install the grub-pc-bin package.
Create a partition similar to the instructions above by resizing the root partition and set the bios_grub flag. Choose no filesystem and leave it unformatted.
Edit the configuration file /etc/default/grub with administrative rights and add GRUB_DEVICE=/dev/sdb6 to the end. Replace /dev/sdb6 with the actual device name of your BBP. You can use the commandline editor nano to keep thing a simple.

Install the GRUB MBR image to the BBP with:

grub-install --boot-directory /mnt/test/boot/ --target i386-pc $device

You might want to remove or comment out the line in /etc/default/grub and add it to the actual installation.

Bonus: Add a partition for Macs on an installation with GPT

I found that the very new Mac (Mac Mini A1347 EMC 2840) I was testing with could boot from a standard FAT32 ESP, even from MBR! Anyways, here we go:

Install the grub-efi-amd64-bin, hfsprogs, mactel-boot and mactel-boot-logo (optional) packages. You need to enable the Universe repositories (How do I enable the "Universe" repository from the command line?) and add the current Mactel support PPA (see Mactel Support Community team for more details) to install all of them.
Create a partition with an HFS+ filesystem similar to the instructions above by resizing the root partition. This time we need a few megabytes more space, so double the size of the ESP if you had only 5 megabytes or less before. No flag is required.
Mount the partitions:

mkdir -p /mnt/esp-mac
mount $esp-mac_device /mnt/esp-mac
mkdir -p /mnt/rootfs
mount $root_device /mnt/rootfs

  Note: I chose $esp-mac_device and /mnt/esp-macto avoid conflicts.

Run the grub-install command that includes the --removable parameter:

grub-install --efi-directory /mnt/esp-mac --boot-directory /mnt/rootfs/boot --target x86_64-efi --removable $device

Finally setup up the partition the way a Mac expects it to be:

sudo hfs-bless /mnt/esp-mac/EFI/BOOT/bootx64.efi
sudo cp -v /mnt/esp-mac/EFI/BOOT/bootx64.efi /mnt/esp-mac/System/Library/CoreServices/boot.efi
sudo cp -v /mnt/esp-mac/EFI/BOOT/grub.cfg /mnt/esp-mac/System/Library/CoreServices/grub.cfg
sudo cp -v /usr/share/mactel-boot/SystemVersion.plist /mnt/esp-mac/System/Library/CoreServices/SystemVersion.plist
sudo cp -v /usr/share/mactel-boot-logo/ubuntu.icns /mnt/esp-mac/.VolumeIcon.icns
echo "Dummy kernel for booting" | sudo tee /mnt/esp-mac/mach_kernel

To boot Ubuntu from external media on a Mac you would now just need to press the option key ⌥ or Alt on Windows keyboards and select the right disk.

About partition flags, type codes and GUIDs

To be as accurate as possible, the boot flag isn't important to GRUB, by default GRUB searches for UUIDs to find the right filesystem to boot from. Setting the boot flag or the bios_grub flag in GParted usually sets a type (MBR) or GUID (GPT) for the partition.

The benefit of setting the correct type or GUID, besides having a properly working setup, is that these partitions will be hidden in the filemanager. The easiest way to check and change types and GUIDs is via Disks (gnome-disks).

Alternatively you could use parted or gdisk:

0xef is the type code for ESP in MBR for use with fdisk
ef00 is the abbreviated type code for ESP in GPT for use with gdisk
ef02 is the abbreviated type code for BBP in GPT for use with gdisk

Wikipedia has a big list of GUIDs for GPT.

Commandline equivalents in parted according to the manual are parted $device set partition esp on and parted $device set partition bios_grub on.


Remove metadata from Libreoffice Writer Documents

From LibreOffice:

User data can be viewed and cleared by going to File > Properties. Under the General tab you can click Reset to reset the general user data like total editing time and revision number. Also, uncheck the Apply user data checkbox on this screen. then click the Description and Custom Properties tabs and clear any data you don't want disseminated. On the Security tab, uncheck the Record changes checkbox if not already clear.

If you use the Versions feature, go to File > Versions and delete any older versions of the document that may be stored there.

Under Edit > Changes > Accept or reject, you can clear these if the recipient doesn't need them.

Just for Writer, under View > Hidden Paragraphs, check this feature to be sure all hidden paragraphs are visible.

Just for Calc, go to Format > Sheet and be sure there aren't any hidden sheets.


Please follow the steps which i used to run it.

sudo apt install qemu-kvm
sudo adduser $USER kvm
sudo chown -R $USER /dev/kvm
cd Android/Sdk/emulator
./emulator -avd Pixel_XL_API_28


You could try to use the apt-get command to install Renpy:

sudo apt-get install renpy

I hope this is going to help, at least it worked for me :)


sudo umask 0000 will fail because umask isn’t a program. It’s a shell built-in command that affects the current shell session. No sudo is needed or allowed, though sudo commands (and other user switching) don’t inherit the current umask. To set sudo to use a certain umask, another answer gives the solution (I modified it to use 0000 instead):

  For the sudo permissions, I executed sudo visudo and added the line Defaults umask = 0000 to the end.

Since the default Ubuntu umask is 0002 (except 0022 for root), setting it to 0000 will merely no longer block an application from giving write permission to everyone other than the file’s owner or group when creating a new file. The application then doesn’t have to give write permission to others when creating a file, but now it can.

It’s not recommended to set this globally for security reasons (perhaps in ~/.bashrc instead), but it’s not likely to cause issues other than bad security when badly-written applications don’t set the permissions properly when creating files.


Ubuntumate 16.04 running on Raspberry Pi:  There is no option to "run as root".  However, inputing "gksu caja" in the terminal does work to open a folder as root.


KVM or QEMU_KVM or QEMU_SYSTEM_x86_64 on Ubuntu 13.04

The commands you have at hand starts with kvm. Enter the same command but replace kvm with qemu-system-x86_64.

I'm not sure from which Ubuntu release (I haven't used KVM for a while), but the binary to run the program itself was switched hence the error. As far as I'm aware the syntax remains the same, though you can make sure of it with man qemu-system-x86_64.

Reference

http://www.linux-kvm.org/page/HOWTO1


Installed GNOME 3 and the default theme looks horrible, how can I change?

This is an issue with the accessibility themes in Gnome Shell. You can fix it by running

sudo apt-get remove gnome-accessibility-themes
sudo apt-get install gnome-themes-standard

then logging out and back in again.


create wifi hotspot in ubuntu-14.04 when connected to another wireless network

I did it with a second USB WIFI interface. Apparently you can use the same network card if both wireless connection are on the same channel or if the card support multiple connections.

I used this method:

Create WiFi hotspot on ubuntu

For ubuntu 16 it's straight forward, for ubuntu 14, you have to edit:

/etc/NetworkManager/system-connections/wifi-hotspot

and write hotspot mode manually since that option it's not available in the network-manager graphical interface for ubuntu 14.


can't install xp in virtualbox on ubuntu 14.04LTS?

You are booting From Network PXE. Just be sure that you already added your ISO to the CD controller, Go to settings -> storage -> CD/DVD Drive and coose your ISO.

Also be sure to make CD boot order is prior you can do it from settings -> System -> Boot order then uncheck Netwrok and Floppy and check CD/DVD and Hard Disk making CD as the first order


sudo iptables -A INPUT -i eth0 --proto tcp --dport 12345 -j ACCEPT

this will allow incoming traffic to the network interface eth0 for tcp port 12345.
You didn't specify if you were referring to tcp or udp.

You can list the rule with:

sudo iptables -L -n


all access to /mnt/ hangs ubuntu after a period

First I got some errors that I removed from the post:

Starting smb/cifs file and active directory server [ Fail ]

  Just remove the file /etc/init/samba-ad-dc.conf that seems to duplicate the start of the server!

It didn't solve my issue though.


Re your first question:

possibly you may be confusing that the webupd8 script is 0.5b. That is the version of the script - it doesnt refer to the java version.

Further to the setting of the javac version.

I suspect you need to explicitly give the path of the javac compiler

i.e.

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-6.31-oracle/bin/javac" 1

followed by:

sudo update-alternatives --config javac

With regards to setting up the java chrome plugin.

The master question:

How do I install Oracle JDK 6?

includes this information - since your folder structure is slightly different your link command should be:

ln -s /usr/lib/jvm/java-6.31-oracle/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/


Windows randomly stop accepting input from bluetooth keyboard

Are you sure this has nothing to do with synergys tendancy to crash frequently? When I used synergy it would crash almost daily and I had to issue another terminal command to start it up again.

Edit: Addition --

Can you check /var/log/syslog at the time the keyboard cuts out (as best as you can) for any messages that are bluetooth related or keyboard/input, or any error messages at all between when the keyboard worked and when it didn't. Copy paste any interesting or curious log messages to your original question.


Keyboard Layouts missing in Keyboard Layout --Precise upgrade

The Keyboard Layout window inexplicably won't allow you to choose more than 4 layouts. However, you can fire up gconf-editor and navigate to /desktop/gnome/peripherals/kbd/layouts and manually add as many layouts as you like.

I don't understand the arbitrary limit in the GUI, though.


How to install Broadcom wireless drivers offline?

You need to install wireless driver.

Insert your Ubuntu installation disk or a flash drive and copy these files from the installation disk to your Home directory:

pool/main/d/dkms/dkms_XXXXX.deb
pool/restricted/b/bcmwl/bcmwl-kernel-source_XXXXX.deb

Then run the following in terminal:

sudo dpkg -i *.deb

If you have UEFI BIOS, you need to disable Secure Boot to load the driver.

18.04 update:

The solution won't work on 18.04, because build-essential and its dependencies are not installed by default. The dpkg command will complain that dependencies are not installed.

You can manually find the required packages on the installation media ("pool" directory sorted by alphabet) and install them the same way as the dkms package. I hope nothing is missing there.


I'm not the world's greatest, but this has saved my bacon more than once.

http://sourceforge.net/projects/boot-repair-cd/


Mounting and accessing Western Digital's MyCloud NAS

AFP is Apple File Protocol which, along with Samba, is natively supported by the WD NAS server. You can also use smbfs or cifs on your Linux box and mount the shares permanently (see here) or you can use NFS. NFS, particularly udp, offers better performance but poorer security. I use NFS because file ownership and permissions are an important issue to me and they are not fully supported in smbfs/cifs.

I have just posted a how-to to set up NFS between a Linux client running 14.04 and a WD Own Cloud NAS server - see here.


You fixing a corrupted HDD Partition with:

sudo ntfsfix /dev/sdb2

This is link for you

if you not install ntfsfix, you can install with command:

sudo apt-get install ntfsfix


Everything seems fine, but "Mount is denied because the NTFS volume is already exclusively opened."

You need to power down Windows. Opening an NTFS partition that went into hibernate will result in the error you're received.


How do I connect to the internet with a "Huwaei Ec1260" modem?

For Ubuntu 10.04 (skip this step for Ubuntu 10.10): install usb-modeswitch

sudo apt-get install usb-modeswitch

Right Click on the NetworkManager icon from the panel notification area > Edit Connections.

Mobile Broadband > Add.

You will get a New Mobile Broadband Connection Dialog. (Reliance-Huawei is autodetected)

Forward > Country List: India

Forward > Choose your Provider: Reliance

Enter the username and password (provided by your network provider: Reliance).

Apply.
Click on the NetworkManager icon and select the Mobile Broadband connection.


Sending keyboard commands to Ubuntu through Python. Remote for my Blackberry

EDIT 2:

I though I would share this, should someone look for something similar and happen upon this.

The easiest way I found to send the keystrokes through Python is by installing xdotool which is a unix based scripting tool, wich is pretty awesome. It supports all the multimedia keys. Including the context menu a.k.a "Menu".

So what did I need it for?
I built a remote for my ubuntu since my Compro Remote stopped working.

How does it work?
It leverages Apache, Bootstrap, PHP, Redis, Python and finally xdotools (Boy that's a mouthfull). I created a mini website which I access through my WIFI with remote buttons which when clicked sends the command in the background to the PHP  Script running on Apache.

This PHP script then saves the command and values in Redis which is polled constantly by Python. Once Python picks the command up. It checks it in the dictionary of commands and sends the appropiate command line to xdotool. Xdotool then runs the Media Keys or starts Rhythmbox or XBMC or pauses and plays. Whatever. So far it's working like a charm.

Head on over to Github

I am putting a github repositry together for this. I hope this helps someone, somewhere

Installation instructions etc. to follow in said Github page.

Web The Black Mote Github Page


How to activate and use F-keys (F1, F2, etc..) on a Mac Book Pro Laptop-Keyboard in Gnome-Shell 3.2?

I figured it out myself! I simply need to use the fnkey, in combination with F1, F2, F3keys ..

Reason: Fkeys (Function-keys) are primarily assigned on a Mac for Volume, Brightness, Keyboard-Illumination etc.., therefore "fn" enables the secondary assigned functions of those keys in Ubuntu.

Thank you for asking though GalmWing!


How make my Logitech Quickcam e3500 work?

As you stated in your question:

This problem was caused by my USB hub. I tried the camera without the hub and all worked fine. I can still crash the webcam/v4l2 sometimes but a reboot clears that. Annoying but at least I know that the camera works


wifi on Dell XPS 9560 is unstable and drops frequently

In my many years of experience with wireless issues involving several different Linux distributions, I never saw scan results with 107 (!!) visible access points!

In the interest of security and privacy, the wireless script that you ran redacts the MAC addresses in every instance. You are connected to ‘nmguest’, redacted as AC1. AC1 has a signal strength of 63/100. There are other instances of nmguest that are evidently physically closer because they have a higher signal strength; for example, the instance redacted as AC45 has a signal strength of 74/100.

I suggest that you run:

sudo iwlist scan

Make a note of the MAC address of the instance with the highest signal strength and  use Network Manager to bind to it like this:

The MAC address should be entered in the BSSID space in Network Manager. That should bind to the strongest instance of nmguest as well as prevent dropping as the wireless searches for a better connection from among several instances with the same name.

Save and close Network Manager. Tell us if there is any improvement.


sshfs user@host:/remote_directory /local_directory

will help to connect remote directory to local dir


Below is what I managed to build in the end, stitching together various scraps and hints I could find plus some "original research" of my own. I consider it very rough and downright ugly in places, but I need some solution, and it seems to work for now. Fingers crossed...

   PLEASE NOTE you should also consider hardening your Linux for security,
which is absolutely not covered by the presented script!

#!/bin/bash
if [ $# -ne 0 ]; then
    echo "USAGE: mkkiosk.sh"
    echo "Create new user 'kiosk' and configure LightDM to auto-login this user to a X session running only Chrome"
    echo "in --kiosk mode."
    exit 1
fi

set -x; set -e
date

# Try to make current user (admin/...) prefer 'ubuntu' to 'kiosk' for session type.
# TODO: currently doesn't seem to work, lightdm still suggests 'kiosk' session and requires manual clicking to change.
cat > ~/.dmrc << EOF
[Desktop]
Session=ubuntu
EOF

# Auto-create user 'kiosk'.
# http://askubuntu.com/a/321943/111779
# NOTE: auto-login is enabled later (autologin-user)
getent group kiosk || (
    sudo su -c "groupadd kiosk"
    sudo su -c "useradd kiosk -s /bin/bash -m -g kiosk"
)

# Install Chrome
# http://askubuntu.com/a/510186/111779
# TODO: somehow pin Chrome version? reportedly, cmdline flags are
# unofficial and can change; OTOH, security updates... though in kiosk, we show
# only one webpage; but admin user also may use Chrome.
grep chrome /etc/apt/sources.list.d/google-chrome.list >&/dev/null || (
    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
        sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
    sudo apt-get update && sudo apt-get install -y --no-install-recommends \
        google-chrome-stable
)

# https://wiki.archlinux.org/index.php/Display_manager#Session_configuration
#
# - For Chrome flags, see:
#   - http://peter.sh/experiments/chromium-command-line-switches/
#     (via http://askubuntu.com/a/423632/111779)
# - TryExec:
#   not sure what it does, but apparently must be just binary name if present.
#   (see: https://www.virtualbox.org/svn/vbox/trunk/src/VBox/Additions/linux/lightdm-greeter/liblightdm-gobject-1.5.0/session.c)
#   TODO: test if we can remove TryExec
# - IMPORTANT NOTE: If below settings are invalid, the session may just
#   silently disappear as a choice in LightDM. You can then try to confirm this
#   by looking in /var/log/lightdm/seat0-greeter.log for message "Ignoring
#   sesion kiosk".
sudo bash -c 'cat > /usr/share/xsessions/kiosk.desktop' << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Kiosk
Comment=Start a Chrome-based kiosk session
Exec=/usr/bin/google-chrome --kiosk --window-size=1281,1025 --window-position=0,0 --no-first-run --incognito --no-default-browser-check --disable-translate http://stackoverflow.com
TryExec=/usr/bin/google-chrome
Icon=google-chrome
EOF
sudo -u kiosk bash -c 'cat > ~kiosk/.dmrc' << EOF
[Desktop]
Session=kiosk
EOF
# See LightDM "help" in: /usr/share/doc/lightdm/lightdm.conf.gz
sudo bash -c 'cat > /usr/share/lightdm/lightdm.conf.d/99-kiosk.conf' << EOF
[Seat:*]
user-session=kiosk
EOF
# Setting below options in only 99-kiosk.conf doesn't seem enough (conflicts on autologin-user).
sudo bash -c 'cat > /etc/lightdm/lightdm.conf' << EOF
[Seat:*]
autologin-guest=false
autologin-user=kiosk
autologin-user-timeout=0
EOF

echo "Done."

To get back to "normal user", press Alt-F4 to close Chrome; LightDM will show, where you can login to your "normal" admin/root/... (super-)user. To get back to "kiosk", run:

sudo killall lightdm

TODO: didn't disable screensaver yet (or did it?).
Also, no warranty, it may shoot off your leg, eat your homework, etc, etc.


Deluge is controllable by gui, web, and console.

To setup remote access to a deluge server see the thinclient guide.

deluge-console

deluge-gtk

deluge-web


How to install Ubuntu in a toshiba a A-45 satellite laptop?

Make sure that you have burned the Ubuntu disc at the slowest speed possible, this reduces disc failure.

Once you have done that, insert the disc and restart the laptop, look for the option to edit the boot options and selecting to boot from the CD/DVD.

Make sure that you save the boot options, once the PC restarts then the disc should be identified.

If you are successful installing Ubuntu that way, then make sure you alter the boot menu again so it goes from CD/DVD back to the hard drive.


That is a bad mess.

I think you should create three users: one for day-to-day use (lets call this user, one for the web server (usually one is created when you install Apache, usually called www-data) and one for the FTP server (call this ftp), all with accompanying groups of the same name.
Add user to both www-data and ftp groups. chown the web directory to be owned by user:www-data, and make it setgid and setuid (chmod ug+s). Do the same for the FTP upload directory, but with user:ftp.
If the FTP upload and Wordpress media directory are the same, make a third group with all three users in it (call it upload, and chown the directory user:upload.
The web server is usually running as www-data, unless they deliberately went and changed it. You will have to configure the FTP server (usually vsftpd) to run as the ftp user.
Make sure all the relevant directories are setgid so that they inherit group permissions. You can make the setuid as well. (Only the directories, note!)
Restrict day to day stuff to user. Make sure www-data does not have write permissions where it has no business having them.

Beyond this, I am not really qualified to give security advice.


Bash script that opens multiple netcat instances and exits them

That's because gnome-terminal is "clever". When you fire up gnome-terminal, it will determine if another instance of gnome-terminal is already running.

If no, it creates a new gnome-terminal process and spawns a window.
If yes, it will simply cause that existing gnome-terminal process to spawn a new window.

Therefore, all gnome-terminal windows run as a single process, with a single PID.

You can easily check this by opening up several gnome-terminal windows, then get their PIDs by issuing xprop _NET_WM_PID somewhere and click inside them. You will see the PID is the same for all windows.

So what happens in your script?

You're capturing the PIDs of the gnome-terminal instances you launch alright, but the problem is, those PIDs exist only for the fraction of a second. These processes only cause the existing gnome-terminal process to spawn a new window, then terminate.

So if you already have an active gnome-terminal process when executing your script (which I assume), the PIDs you collect don't exist anymore when you try to kill them. If you don't (say, you execute that script from an xterm or some other terminal emulator), the first PID you collect will indeed be "correct". The following PIDs you collect will be "incorrect". Once you enter your killing loop, the first iteration would kill all gnome-terminal windows, and the following ones would output errors, because those PIDs don't exist anymore.

So, how to solve this?

Well, off the bat I can think of two ways.

If you don't insist on using gnome-terminal, use some other terminal emulator instead which doesn't behave in this way. xterm for example spawns a separate process for each window. If you use xterm rather than gnome-terminal in your script, it should work. Easy & clean.
If you do insist on using gnome-terminal, the way to kill a specific gnome-terminal window would be to kill the process that's running inside that specific window. As soon as you terminate that process, that window will close. But since you are using that -e option, this process will be netcat $ipaddress $port first, then afterwards bash, and it is hard to get the PIDs. You can't easily collect them as you are currently doing with $!. You could try something like killall netcat or killall bash, but clearly that will also terminate all other netcat or bash instances, which you probably don't want. You could possibly grep over some cleverly designed ps call to try and find the exact PIDs you want to kill, but that's shaky and error-prone. Honestly, I'd just go for solution 1.

Two minor comments on your script:

Line 10: It should be port=0, not $port=0.
Line 13: It should be processarray+=("$!"), not processarray+=  ("$!").

Hope that helps.

Edit: Oh, I just found the --disable-factory option for gnome-terminal, which causes it to not re-use existing processes. Here's your fixed script:

#!/bin/bash

ipaddress=$1
port=$2
processarray=()
echo "netcat command set to ip: $ipaddress and port: $port"
if [ -z "$ipaddress" ]; then
    echo "No ip address entered"
fi
if [ -z "$port" ]; then
    echo "No port entered default set to 0"
    port=0
fi
for i in {0..9}; do
    gnome-terminal --disable-factory -e "bash -c \"netcat $ipaddress $port; exec bash\"" & processarray+=("$!")
done

sleep 10;
for i in "${processarray[@]}"; do
    kill "$i"
done


How do I turn off backlight of keyboard?

Press Fn + Space to turn off the backlight


Looking for a mouse with a couple extra buttons for programming to copy/paste

Do you look for a trackball ?

Here is something of Logitech which works with Ubuntu.

http://nxadm.wordpress.com/2012/03/01/logitech-wireless-trackball-m570-on-ubuntu/

Is this what you look for ?

Logitech announced weeks ago, that they support Linux.


when I move a photo to /usr/share/backgrounds/ with terminal it becomes unreadable non root user

It seems you do not have the privileges to open that file.
https://en.wikipedia.org/wiki/Chmod#Command_line_examples

 chmod 777 /usr/share/backgrounds/starfish.jpg

oh... you probably need to run it as sudo.


The link to Ubuntu Friendly in the accepted answer is broken because the Ubuntu Friendly website was decommissioned five years ago. The official Ubuntu certified hardware information is currently available at Component catalog | Ubuntu.


Can't start an application from the launcher, but can from dash and rightcliking

Have you got it set to only display on one monitor (assuming you have more than one)?

I had the same issue, as soon as I selected it to display on both monitors under Display Settings, it stopped happening.

Hope this helps.


To use iwlwifi backports you could sudo apt-get install git build-essential
git clone https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git
cd backport-iwlwifi
make defconfig-iwlwifi-public
sed -i 's/CPTCFG_IWLMVM_VENDOR_CMDS=y/# CPTCFG_IWLMVM_VENDOR_CMDS is not set/' .config
make -j4
sudo make install
After a reboot check dmesg | grep iwl to see if at least one version of firmware is loaded, you can find the firmware, if needed at https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/

Update for January 2020
The package backport-iwlwifi-dkms is in the Bionic repos and is very similar to the above, this will automatically build new drivers when a newer kernel is installed.  There is also a PPA that will have a newer version than what is in the repo, to install this do
sudo add-apt-repository ppa:canonical-hwe-team/backport-iwlwifi
sudo apt-get update
sudo apt install backport-iwlwifi-dkms
Reboot


Using "normal" Ubuntu on convertible with multitouch and so on

Depends on what device you're looking to get, hardware support will differ. I can tell you that my Acer Aspire laptop with a touchscreen works perfectly on Ubuntu and its derivatives. You could always boot from a live cd/usb to see how it works on your laptop.

https://wiki.ubuntu.com/Touchscreen


Decrypt home folder on login, not on boot

It sounds like you've got full system encryption, probably with dm-crypt / cryptsetup, since encrypting just your home (with eCryptFS) would boot the computer first and then ask you for your login passphrase.

If that's what's going on, you could remove the full system encryption to have the computer boot on it's own. It might be easier & quicker & safer to first backup your data and just re-install with no full system encryption, only encrypting your home folder.


Configuring compose key via command line

I used xmodmap. Add the following to ~/.Xmodmap:

keycode 108 = Alt_R
keysym Alt_R = Multi_key


12.04 stopped recognizing Windows partitions after update

To Repair Windows 7 boot from Windows 7 DVD:

Click on the Repair your computer link on the bottom-left of the Install Windows window.

This link will begin the Windows 7 System Recovery Options which contains several useful diagnostic and repair tools, one of which is Startup Repair.

Click on the Startup Repair link from list of recovery tools in System Recovery Options.

As you can see, several other diagnostic and recovery tools are available in the Windows 7 System Recovery Options including System Restore, System Image Recovery, Windows Memory Diagnostic, and Command Prompt.

Startup Repair will now attempt to repair whatever problems it found with Windows 7 files. No user intervention is required during this step.

Click the Finish button once you see the Restart your computer to complete the repairs window to restart your PC and start Windows 7 normally.


Ubuntu desktop installation problem, a lot of error messages

Check out this Squashfs Errors community help page. This might help you to resolve the issue.

Here is the gist of the fix provided.

  Temporary Workarounds

  Some users have reported that adding the ide=nodma or acpi=off allowed
  them to work around this issue (which proved to be bad memory
  modules). You might want to give that a try

  Successful boot was achieved by adding "all_generic_ide" to the grub
  boot line for the live CD.

  You can add those lines to the grub entry, either in the grub.conf
  file or either entering letter 'e' on the grub menu and after editing
  Control+x to boot:

  Add to the grub line:

all_generic_ide pci=nommconf

  Add to the kernel line:

ide=nodma acpi=off


How to find all the files with setuid bit set?

For packages installed...
sudo find / -perm -4000 -type f -exec ls -l {} \; > /tmp/files_with_setuid.txt

-perm -4000 is the permission for setuid. -perm -u=s can also be used.
-type f for only files; remove if directories need to be included
ls -l show it as a long list
and it is stored into the file /tmp/files_with_setuid.txt

You will get a couple of error notices from /proc and /run. 1st couple of files ...
more /tmp/files_with_setuid.txt
-rwsr-xr-x 1 root root 43088 sep 16  2020 /snap/core18/1997/bin/mount
-rwsr-xr-x 1 root root 64424 jun 28  2019 /snap/core18/1997/bin/ping
-rwsr-xr-x 1 root root 44664 mrt 22  2019 /snap/core18/1997/bin/su
-rwsr-xr-x 1 root root 26696 sep 16  2020 /snap/core18/1997/bin/umount
-rwsr-xr-x 1 root root 76496 mrt 22  2019 /snap/core18/1997/usr/bin/chfn
-rwsr-xr-x 1 root root 44528 mrt 22  2019 /snap/core18/1997/usr/bin/chsh
...

Script (found it on SO) to download every package and check for setuid:
PKG=$(apt-cache search . | cut -f 1 -d ' ');
echo $PKG | xargs apt-get download;
F=(`find *.deb`); for i in ${F[@]};
do dpkg -c $i | cut -c 4- | grep ^s | cut -c 4- | cut -f 2 -d '.';
done | tee suid_root;

It does not install packages, only downloads them ... so you still do need plenty of disk space.


I've fixed the original answer (and I've tested it this time):

mkdir -p ~/bin/
echo '#!/bin/sh' > ~/bin/run_linx_program
echo '$1 "`wine winepath -u "$2"`"' >> ~/bin/run_linx_program
chmod a+x ~/bin/run_linx_program

I forgot that ! gets interpreted inside "s. I should have used 's. ! starts a history substitution match and that wasn't what I was going for.


How do I make a Chromium application shortcut that works properly while not on the desktop?

The proper place to put .desktop shortcuts is in $HOME/.local/share/applications. I always put my Chromium shortcuts there (actually I was pretty sure they were already there by default).

  I'm sort of a neat freak and don't like keeping things on my desktop

That's a good habit and you shouldn't be forced to keep shortcuts on it.


I suggest you to follow the documentation from the official tutorials.ubuntu.com

And then ask us if you have any issue while installing.


How to edit the Applications Menu in GNOME 3?

You can use Menu Editor (menulibre)

With Menu Editor, you can easily add, remove, and rearrange launchers, directories, and separators.  Powered by Python 3 and Gtk 3, it is the complete toolbox for editing menus in Linux.  It was developed to support every popular Gtk desktop environment, and has been verified to support Cinnamon, GNOME, LXDE, MATE, Unity, and XFCE.

It is already in the official Ubuntu repositories,
and you can install it by opening a terminal with Ctrl+Alt+T and typing:

sudo apt install menulibre

or if you prefer a GUI way, click Menu Editor  to auto-open Software Center
and click Install to install it.

After installation you can find it under All Settings

Gnome, Xfce, and Unity settings integration. The above image is from XFCE.

Frequently Asked Questions
MenuLibre does not start. It displays “MenuLibre cannot be run as root.”


Cannot install phpmyadmin on ubuntu 14.04 LTS

You can check xampp. It will install all of them. It is also available for ubuntu.

Download .run file and install it like this

chmod 755 xampp-linux-*-installer.run
sudo ./xampp-linux-*-installer.run

After this, you can run this like this.

sudo /opt/lampp/lampp start

And to stop

sudo /opt/lampp/lampp stop

This will run its command line tool. It also has its graphical tool. It can be run like this.

cd /opt/lampp
sudo ./manager-linux.run (or manager-linux-x64.run)


Installing Ubuntu upgrade side by side with old version

Upgrading to 11.04 means getting rid of Ubuntu 10.04.

But you can have both versions side by side,this is can be easily done by installing Ubuntu 11.04 on a different partition.


Mount:

Nautilus > Go > Enter location > smb://192.168.0.123

Then can find the shared folder in /$XDG_RUNTIME_DIR/gvfs (ref: EvanChen link  askubuntu.com/a/33513/372607)

Specifically on my 16.04

~$ cd /$XDG_RUNTIME_DIR/gvfs
//run/user/1000/gvfs$ ls
smb-share:server=192.168.0.123,share=pac

//run/user/1000/gvfs$ cd smb-share:server=192.168.0.123,share=pac
//run/user/1000/gvfs/smb-share:server=192.168.0.123,share=pac$ pwd
//run/user/1000/gvfs/smb-share:server=192.168.0.123,share=pac

Then make a softlink from home folder:
    $ cd ~
    $ ln -s //run/user/1000/gvfs/smb-share:server=192.168.0.123,share=pac pac

Now cd pac and done, can browse the network shared folder from command line.


login after hibernation flashes desktop briefly

Workaround: for me using Wayland as suggested instead of Xorg resolves the issue.

  On the login screen, you should be able to select "Ubuntu on Wayland" by clicking on the settings icon, next to the login button.

18.04: How to get Wayland back after upgrade to 18.04?


You cannot use root with phpMyAdmin. You will need to create a separate account in the database with all privileges, and use that for phpMyAdmin. – Matigo 2 days ago
I followed the procedure from the tutorial at https://phoenixnap.com/kb/how-to-create-mariadb-user-grant-privileges to setup a new user and everything works good now as Matigo suggested.


What is the "fontconfig" folder in my home directory? May I delete it?

In order to fix the bug involving LibreOffice choosing incorrect font weight, a workaround of creating a fontconfig folder in Home folder during upgrading process was introduced. By right, once the upgrading is over, the folder should be cleaned up but hasn't been done.

I am not sure if there is any bug report filed for this. So, feel free to file one if necessary.

And you can safely delete the folder. The only purpose of the folder was to fix the bug during upgrading and was supposed to be cleaned up anyway.


That appears to be harmless; on my server that happens when it checks for updates

Apr 28 05:33:59 SlowerThanInfinity pkexec: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Apr 28 05:33:59 SlowerThanInfinity pkexec[24809]: [redacted]: Executing command [USER=root] [TTY=unknown] [CWD=/home/[redacted]] [COMMAND=/usr/lib/update-notifier/package-system-locked]

If you look at what the script does, it is associated with
 unattended-upgrades

#!/bin/sh
# check if package system is locked
# return 0 if unlocked, 2 if locked, 1 on error
set -e

for f in /var/lib/dpkg/lock /var/cache/apt/archives/lock \
    /var/lib/apt/lists/lock /run/unattended-upgrades.lock; do
    [ -e $f ] || continue

    # fuser succeeds if there is at least one user
    if fuser $f; then
        exit 2
    fi
done

exit 0

So I doubt this closed your applications unless that happened as a result of something that got installed by unattended-upgrades, you could check /var/log/apt to see if anything did.


How can I set up Eclipse to work with a Quickly program?

So I to got interested in this after seeing your question, after a bit of goggling with out any interesting results I decided to try my self and see if i could figure something out. This is more of a workaround then an actual solution.

I started by creating a test project using quickly:

quickly create ubuntu-application foo

Then i launched eclipse and created a new python project and imported the quickly project folder. Right-cklick on project->import

Then I added the quickly-project path to the eclipse project: Right-click on project->properties

go to PyDev - PYTHONPATH-> add source folder, and select the root map of quickly project

(This is not necessary but it removes those annoying read markings that complains about not finding imports)

So now the only thing left is to be able to launch the project from eclipse. To do that click on the run-menu at the top of eclipse->External tools->External tools configuration

Right-click Program and select "New" Name it something like Run

For location enter the path to quickly executeble (/usr/bin/quickly)
For working directory click on "browse workspace" and select the root foolder of the quickly project
For arguments typ run
Go to the tab common and under "Display in favorite menu" select External Tools

Create a new one and name it something like design, the only thing to change in this one would be to type "design" instead of "run" under argument.

Now you can Run or launch glade to change design from the dropdown menu I'm trying to show on the last picture.

For the python question I would suggest that use Python3 because Ubuntu is aiming to only include python3 in Ubuntu 12.10 and forward. (https://wiki.ubuntu.com/Python/3)

As for setting up python in eclipse: when you create a new pydev project, you should see an option to select python grammar version and interpreter. If you cant find the right python version under interpreter click on "Click here to configure an interpeter not listed"

In the new window click new and give it a name, then click on browse to /usr/bin and select the python version you like to add for example python3.2mu, then click apply and ok. now you should be able to select that version from the create new project window

Hope this helps you


Ubuntu does not load open source video driver

Problem is solved by reinstalling a fresh ubuntu raring. (still do not know the cause though.)


Problem installing printer Canon Pixima 5150

Open the terminal and use these lines:

Check if you have gdebi installed:

which gdebi

if not, then:

sudo apt install gdebi-core gdebi

Add the Ubuntu Trusty Extra Packages Repo

sudo su

If Got “User is Not in Sudoers file” then Look: Solution

echo 'deb http://cz.archive.ubuntu.com/ubuntu trusty main universe'
> /etc/apt/sources.list.d/extra.list

$ apt update

Install packages:

sudo apt install libpng12-0 libpango1.0-0

..
4. Extract the Canon package in the /tmp directory

Install the package with

cd /tmp/cnijfilter*deb/packages

if 32-bit system:

sudo gdebi ./*i386.deb

if 64-bit system

sudo gdebi ./*amd64.deb

Installing Canon MG5150 Printer Driver

cd /tmp/cnijfilter*deb

sudo ./install.sh

You can be asked to connect or turn on the printer:

Finally, go to settings, to Add a Printer

It should be recognized and installed:


How can I get read/write access to NFS share of Synology NAS?

NFSv2/3 handles permissions solely based on UID and GID. File permissions on the server are matched against user- and group ids on client. That is why NFSv<4 is by design insecure in environments where users have root access to the client machines; UID spoofing is trivial in that case.

Note that NFSv4 offers client and user authentication via Kerberos5. If authentication with username and password is needed, it is although often much easier to resort to Samba (SMB/CIFS) instead of setting up a Kerberos, even in pure Linux environments.

To at least prevent escalation of root privileges, NFS shares are exported by default with the option root_squash, which will map all client request coming from root (uid=0, gid=0) to anonuid and anongid. This behavior can be overridden with no_root_squash, granting root access to the export.

Here, we see another drawback. To function properly, NFS basically requires you to have the same UID/GID on all machines. The files you want to access belong to 1026 and have permissions 755. You're user on the client has uid=1000. The GIDs don't match either, so you get world permissions only. Hence no write access.

To resolve this, you could do one of multiple things:

On the NAS, change the owner of the files to 1000. You would maybe need to create that particular account. How this will affect other services, I cannot tell.
Change the UID of your local user to 1026.
Since you are the only one accessing the files on the server, you can make the server pretend that all request come from the proper UID.
For that, NFS has the option all_squash. It tells the server to map all request to the anonymous user, specified by anonuid,anongid.

Add the optionss all_squash,anonuid=1026,anongid=100 to the export in /etc/exports.

Be cautious though, since this will make anyone mounting the export effectively the owner of those files!

If you share your network with people and their clients whom you not trust completely not to make mischief with your files, you really should look into a method of filesharing that offers authentication. In my opinion, Samba is the easiest way to achieve that.


How to make executable bin files accessible to Gnome?

They are not the same one.

The Alt-F2 prompt will autocomplete and execute anything that is in the PATH environment variable. This means that to be able to execute your files in ~/bin from there, you just need to set up the PATH variable in your ~/.bashrc file, adding the ~/bin path to it:

# just add this line to your bashrc
PATH=~/bin:${PATH}

However, the search bar that you get when pressing Super is a completely different thing. To get an application showing up there you must add it to the menu, using the alacarte program, check out the explanation in this question: Adding custom applications to Gnome launcher


How to thumbnail/preview doc, docx, odt and other document files in dolphin?

KDE thumbnails

The KDE applications can show a thumbnail for a file if there is a thumb creator plugin installed for the file type.

For the documents (odt, ods, doc, docx) the thumbnailers are distributed from the Calligra project: https://www.calligra.org .

Ubuntu repositories

Few picks from the Ubuntu 16.04

words_msword_thumbnail.desktop -> http://packages.ubuntu.com/xenial/calligrawords-common

sheets_ods_thumbnail.desktop -> http://packages.ubuntu.com/xenial/calligrasheets

These are for the KDE4. They won't work with the Dolphin build with the KDE Frameworks 5 (KF5).

A workaround is to install the dolphin4: http://packages.ubuntu.com/xenial/dolphin4

or use the Konqueror file manager: http://packages.ubuntu.com/xenial/konqueror .

Older - Dolphin/Dolphin4/Konqueror: https://www.kubuntuforums.net/showthread.php?69160-Dolphin-Video-amp-Pdf-Files-Preview

Backports

Kubuntu developers are distributing backports through a PPA: http://kubuntu.org/news/

I'm not sure if they have the KF5 Calligra.


No Unity, launcher and dash on Ubuntu 13.04 within VirtualBox4.2.12 after enabel 3D Acceleration

Well, probably the problem is in Unity's desktop environement, try installing another one... GNOME 3 is probably one of the best ones out there... To install it,

Press ctrl+alt+T
Then Type the following commands:

sudo add-apt-repository ppa:gnome3-team/gnome3
sudo apt-get update
sudo apt-get install gnome-shell

Then logout of your account, and click on the little Ubuntu icon right next to your login username, and select GNOME 3...
That should do, if you still have problems with performance, check for the resources you're giving to your virtual computer, (Ram, etc...)
Many people have problems with Ubuntu 13.04, so don't worry, the Ubuntu team should fix those errors soon...


USB install will not work with i386 or amd64 iso

You have two good choices:

Create a Bootable USB stick with Ubuntu [1,2]
Get a Bootable External DVD drive with USB Connector and use the Live DVD.


I just ran into the same problem.

After doing some researching and getting nowhere, I tried to ignore the fact that the process is marked as a package manager, and the install proceeded to complete as usual.

I am really not sure what this process does, but It did not stop running the apt-get install that the script runs for the dependencies... (or any other instance of apt-get running by itself).


unable to login into recently created administrative user account

No directory, logging in with HOME=/

This shows you haven't create a home for the newly created user.
I suppose you use useradd command without -d option:

man useradd

   -d, --home HOME_DIR
       The new user will be created using HOME_DIR as the value for the
       user's login directory. The default is to append the LOGIN name to
       BASE_DIR and use that as the login directory name. The directory
       HOME_DIR does not have to exist but will not be created if it is
       missing.

The directory will not be created if it is missing.

So it's better to not use useradd, use adduser instead.

  E: could not get lock /var/lib/dpkg/lock - open (11: resource
  temporarily unavailable) E: unable to lock the administrative
  directory (/var/lib/dpkg), is another process using it?

Now this error means that there is another process using dpkd. So to solve this

either wait to end that process(mainly this raise when you open
software center and trying to install from terminal),
Kill the old process by searching for it using ps aux | grep dpkg then kill -9 PID
or you can remove the lock file

sudo rm /var/lib/dpkg/lock
sudo rm /var/cache/apt/archives/lock


You can stop downloading a file from wget just by pressing ctrl + c in the terminal.

And to continue the stopped download, just type the following in the same directory where you were downloading the file:

wget -c <your download url>

For more information about the wget, type following in the terminal:

wget -h

or

man wget


"Files  is ready" prompt on Ubuntu 18.04

You may use a GNOME Shell extensions called "NoAnnoyance" to remove the "Files  is Ready" notification. It also puts the newly launched window into focus.

Other similar extensions:

'Window Is Ready' Notification Remover
Focus my window.
another NoAnnoyance (for newer versions of GNOME Shell)


Why is the Edit button greyed out in Network Manager?

One quick work-around is to invoke the connection editor manually from the command line:

nm-connection-editor

You'll get the same familiar edit screen.  Worked for me.


how can I get the UbuntuOne panel icon starting in the background via my .bashrc

Try starting the application with nohup

nohup /usr/bin/ubuntuone-indicator &

You should now be able to close the terminal.

Assuming that works, IMO, you want to add that command do a script which then runs at login rather then adding it to .bashrc

Add your script or command to Startup applications


How to make sure apt-get has the latest version of Software

First: Monit version in Natty repositories is 1:5.2.1-1 (so not so old).

apt-get installs packages from Ubuntu repositories. After a release, the version of all packages remain constant (except security updates). More info: https://wiki.ubuntu.com/StableReleaseUpdates

If you want newest applications, you can:

use backports -- https://help.ubuntu.com/community/UbuntuBackports (only some packages/programs)
find a PPA with newer version (if exists)
find another Ubuntu/Debian repository/packages -- some developers make their own packages/repositories for Ubuntu with newest versions of their software
download source and compile new version yourself -- https://help.ubuntu.com/community/CompilingEasyHowTo


errors coming after installing Ubuntu 14.10 64 bit from a usb stick

Powering off a running Ubuntu (or Windows or any PC) with the power switch or reset button can often lead to corrupted filesystems, OS's, and data loss, it's a terrible habit.

On Linux you can often use the "Magic SysRq" codes, like REISUB, to have the kernel more safely reboot a misbehaving system.

https://en.wikipedia.org/wiki/Magic_SysRq_key
http://www.thegeekstuff.com/2008/12/safe-reboot-of-linux-using-magic-sysrq-key/

You use them by pressing ALT+SysRq+letter
Or maybe CTRL+ALT+SysRq+letter
Or possibly including the Fn key on laptops, it can get complicated so practice to see what works for yours before needing it

That's if they've been enabled, sometimes they're not by default. This enables them:

echo "1" > /proc/sys/kernel/sysrq

I don't know about the earlier network path can't find error, maybe googling it could have found a solution, or maybe the upgrade just didn't work, doing a fresh install of the version you want should be more reliable than trying an upgrade from an old version.


Create PDF with 100 pages, only 6 of them in color

Not knowing what they technically need, it's hard to answer this definitively, but I assume there is some page-level colouration hint that they're looking at that Acrobat Pro can handle selectively (can it?)

So my first suggestion is to Ask them what they need. This is always worthwhile when dealing with printers. They may even handle it for you, especially for a longer print run.

But you might be able to export one version in black and white, one in colour and then combine select pages into a mixed document. This assumes the underlying library respects the page-level hints. There are several tools you can try for this: pdfchain or pdfshuffler for GUI options and pdftk or pdfunite for command line or scripted options. Try a couple of these and see.

But yeah, failing all that, ask Bookmundo to fix it for you.


Installing VirtualBox "Your system has UEFI Secure Boot enabled." message

This is because you have the Enable EFI option enabled in the settings for that virtual machine:

You can either change the setting in VirtualBox or you an use the right arrow and enter to select "OK"


Last step installing Ubuntu in VMware takes long time

it's done.

ShutDown guest
Virtual Machine Setting, remove the autoinst (both in sata and floppy disk)
Start the guest

Ta-DA!


Acer 7551g - hibernation and suspending don't work

I justed tested the Alpha of 11.04, and suspend/resume is working perfectly :) now just need to wait for the official release so everything is nice and stable.


First install the package PulseAudio Volume Control.

sudo apt install pavucontrol

Then open it, you see Output Devices Tab.

My case, this computer doesn't have a lineout cable plugged in, for now.
And when you want to change between a headset and line-out speakers by keyboard, you can set global shortcuts on the System Settings.

Two new shortcuts 'line' and 'headphone'
To switch Lineout

 pactl set-sink-port *sinknumber* analog-output-lineout

To Headphones

pactl set-sink-port *sinknumber* analog-output-headphones

The sinknumber is shown by the command on the terminal (Ctrl + Alt + T).

pactl list sinks | egrep -A2 "Port|Sink"

Then it tells where the analog outputs are.

Sink #0
    State: RUNNING
    Name: alsa_output.usb-VIA_Technologies_Inc._NFJ_USB_Audio-00.iec958-stereo
--
    Ports:
        iec958-stereo-output: Digital Output (S/PDIF) (priority: 0)
    Active Port: iec958-stereo-output
    Formats:
        pcm
--
Sink #1
    State: RUNNING
    Name: alsa_output.pci-0000_00_1b.0.analog-stereo
--
    Ports:
        analog-output-lineout: Line Out (priority: 9900, not available)
        analog-output-speaker: Speakers (priority: 10000, not available)
--
    Active Port: analog-output-lineout
    Formats:

My case it is on Sink #1 and I set the shortcut command for lineout:

 pactl set-sink-port 1 analog-output-lineout


gnome-panel doesn't work correctly with separate x screens

Use dconf load, not dconf reload. Try dconf help to see the available commands. dconf dump is the inverse of dconf load.

So in this regard, if you backed up and modified your dconf settings with:

dconf dump / > settings.txt

You can modify them on file using any text editor, and then populate them into ~/.config/dconf/user by:

dconf load / < settingsModified.txt


Cannot update to 17.10: not enough free space on /boot

You could try using a different version of an Ubuntu emergency disk to run GParted. That said, if an Ubuntu live CD is failing to boot, I'd be reluctant to upgrade the machine to that version -- it sounds like there might be a bug that would cause the entire system to become useless. Instead, I'd stick with the older, and known-working, Ubuntu version for a while.

If you press ahead, then you could try creating a new /boot partition, rather than resize the existing one. After you create the new /boot partition, you'll need to copy the existing partition's files to the new one and modify /etc/fstab to point to the new partition rather than the old one. If your current /boot comes before your root (/) partition (or LVM physical volume), then creating a new /boot after the root (/) partition or LVM is likely to be much safer and faster than trying to move the front of the root (/) partition or LVM. This advice won't help you with your immediate problem, but it's best to avoid moving the start point of any partition, if possible.

A variant on the above advice is to use another disk -- perhaps even a USB flash drive -- to hold /boot. This might be a temporary measure until you get things up and running again; or if you add a new disk permanently, there's likely to be little or no reason not to make this placement permanent.

FWIW, this is a known bug in Ubuntu. Unfortunately, a bug fix (which has been released) can affect only future installations, not existing ones.


These wiki instructions go over how to backport the necessary apparmor changes.


Is a keyring necessary for programs to store passwords?

Why is necessary?

GNOME Keyring is a daemon application designed to take care of the
user's security credentials, such as user names and passwords. The
sensitive data is encrypted and stored in a keyring file in the user's
home folder. The default keyring uses the login password for
encryption, so users don't need to remember yet another password.

Source: http://en.wikipedia.org/wiki/GNOME_Keyring.
How to disable?
You can use next command in terminal:
sudo chmod -x /usr/bin/gnome-keyring

After this, Chrome, Firefox and others can still save passwords without the keyring, but these are vulnerable.
If you want to re-enable, use +x instead -x in the same command.


Major problem with Nvidia after a release upgrade, 12.04 to 14.04. Can't access terminal to fix it!

Use this little how-to to have GRUB boot your machine to single user mode (runlevel 1).

Then you should be able to access system logs to understand why your server freezes at boot.

But please tell me you still have a way to revert machine to 12.04 !


Can I use drivers from an older ubuntu on a newer release?

I don't see why it should be a problem. As long the current kernel is backward-compatible with the kernel used in 6.10, you should be fine.

Here's a guide on how to add repos from an older Ubuntu release onto the current version


How to disable everytime checking of universe repo?

This is a common bug on ubuntu 12.04.

Workaround:

Since the affected repositories are the unchanging distribution repositories, one approach to circumventing this problem is to run the following commands immediately before running sudo apt-get update. Be sure to adjust them for the name of the archive site you use as well as the name of the release you are using. Not everyone will need all four commands--see the comments at the end of the commands. Don't use them for the development release.

sudo touch
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages
`sudo touch
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_universe_binary-i386_Packages

If you have enabled Ubuntu Universe`
`sudo touch
/var/lib/apt/list/us.archive.ubuntu.com_ubuntu_dists_precise_main_source_Sources

If you have enabled sources`
`sudo touch
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_universe_source_Sources

If you have enabled both Universe and sources`

These commands tell the system that these files are up-to-date by updating the time on the archive files. Don't run these commands on other repositories, or after the bug is fixed.

Even after the problem is fixed, it may make sense to consider how to reduce bandwidth when running apt-get if you run it regularly and have either a slow or an expensive Internet connection.

It may make sense to run the update less often or, equivalently,
choose a repository that is updated less often the main ones.
Many include the "source" repositories in their list of software
sources. This is useful for doing apt-get source packagename, but
that may be sort of old-fashioned.

Unless you get source every day, you might consider removing the
source setting, and enable it again and do an update only when you
want to download some source. The source of various packages is
always changing so the index to be downloaded is always changing,
too.

Another workaround is to update only the interested Index file:

Most of the time, we update package list to add a PPA. so this is a workaround for that

Create a file as /etc/apt/apt.conf.d/99mysettings and
put this line in the file. Apt::Get::List-Cleanup 'false';.

How ? : Type these  in a terminal sudo gedit /etc/apt/apt.conf.d/99mysettings.

Explanation: It causes apt-get not to delete the index files which are already downloaded.
Disable the repositories which you do not like to update now. You can go here  to see how you can disable repositories .
Then run apt-get update command in a terminal. wait till it ends.
Finally again enable all repositories  which you have disabled a few minutes ago. You have now updated PPA index with all previous indexes.

Another Option is to switch to a mirror instead of using us.archive.ubuntu.com

There are many mirrors which doesn't update the index regularly( probable once in a week).I solved the problem by switching to that particular mirror.

you can locate a mirror near you and see if that helps.

Hope this will help.

Source: Here


Please try a temporary driver parameter:

sudo modprobe -r ath9k
sudo modprobe ath9k blink=1

If it works as expected, make it persistent with:

gksudo gedit /etc/modprobe.d/ath9k.conf

Add a single line:

options ath9k blink=1

Proofread, save and close gedit. You should be all set.


How to remove the web browser default application?

The solution is  to either rename or delete

sudo rm /usr/share/applications/webbrowser-app.desktop


difference between /dev/input/mouse0 and /dev/input/mice

The Linux Input Subsystem userspace API documentation answers your questions. In general, all files in /dev/input/ are provided by event handlers that distribute device events to userspace.

What are /dev/input/mouse0 and /dev/input/mice?

From the introduction (important parts highlighted by me)

  1.3.1.3. mousedev

  mousedev is a hack to make legacy programs that use mouse input work. It takes events from either mice or
  digitizers/tablets and makes a PS/2-style (a la /dev/psaux) mouse
  device available to the userland.

  Mousedev devices in /dev/input (as shown above) are:

crw-r--r--   1 root     root      13,  32 Mar 28 22:45 mouse0
crw-r--r--   1 root     root      13,  33 Mar 29 00:41 mouse1
crw-r--r--   1 root     root      13,  34 Mar 29 00:41 mouse2
crw-r--r--   1 root     root      13,  35 Apr  1 10:50 mouse3 ...
...
crw-r--r--   1 root     root      13,  62 Apr  1 10:50 mouse30
crw-r--r--   1 root     root      13,  63 Apr  1 10:50 mice

  Each mouse
  device is assigned to a single mouse or digitizer, except the last one
  - mice. This single character device is shared by all mice and digitizers, and even if none are connected, the device is present.
  This is useful for hotplugging USB mice, so that older programs that
  do not handle hotplug can open the device even when no mice are
  present.
  [...]

  Mousedev will generate either PS/2, ImPS/2 (Microsoft IntelliMouse) or ExplorerPS/2 (IntelliMouse Explorer) protocols, depending on what the program reading the data wishes. You can set GPM and X to any of these. You’ll need ImPS/2 if you want to make use of a wheel on a USB mouse and ExplorerPS/2 if you want to use extra (up to 5) buttons.

...this could also be reason why you don't see mouse wheel events. Since it is "a hack" for legacy programs, you shouldn't use it if you don't have to.

How can I read all mouse information [...]?

Use the corresponding /dev/input/eventX file which is provided by evdev (the event handler, not to be confused with the xorg-driver evdev). That's what your second code snippet obviously does.

...but what about the priority problem?

There is no priority problem. According to 2.2. Event codes:

  SYN_REPORT:

  Used to synchronize and separate events into packets of
  input data changes occurring at the same moment in time. For example,
  motion of a mouse may set the REL_X and REL_Y values for one motion,
  then emit a SYN_REPORT. The next motion will emit more REL_X and REL_Y
  values and send another SYN_REPORT.

Because all consecutive events until a SYN_REPORT event can be considered to have happened at the same time, the order in which they are reported doesn't matter.

For example (using this program I found on github):

time:1528290186.256449  type:EV_REL     code:REL_X      value:-1
time:1528290186.256449  type:EV_REL     code:REL_Y      value:1
time:1528290186.256449  type:EV_SYN     code:SYN_REPORT value:0
time:1528290186.264460  type:EV_REL     code:REL_Y      value:1
time:1528290186.264460  type:EV_REL     code:REL_WHEEL  value:-1
time:1528290186.264460  type:EV_SYN     code:SYN_REPORT value:0

As you can see, not only are concurrent events separated by SYN_REPORT events, they also have the same time stamp.

By the way, you can also use evtest to see the events generated by a device. You can find its source code here if you are interested in how it works.


Just leave all of them installed for now, and remove those that you don't need with Synaptic afterwards (you will be able to see their "Status" in Synaptic).

Example screenshot (thanks @htorque !) of Synaptic showing the obsolete packages category:


What is the difference between Ctrl-z and Ctrl-c in the terminal?

If we leave edge cases to one side, the difference is simple. Control+C aborts the application almost immediately while Control+Z shunts it into the background, suspended.

The shell send different signals to the underlying applications on these combinations:

Control+C (control character intr) sends SIGINT which will interrupt the application. Usually causing it to abort, but this is up to the application to decide.
Control+Z (control character susp) sends SIGTSTP to a foreground application, effectively putting it in the background, suspended. This is useful if you need to break out of something like an editor to go and grab some data you needed. You can go back into the application by running fg (or %x where x is the job number as shown in jobs).

We can test this by running nano TEST, then pressing Control+Z and then running ps aux | grep TEST. This will show us the nano process is still running:

oli     3278  0.0  0.0  14492  3160 pts/4    T    13:59   0:00 nano TEST

Further, we can see (from that T, which is in the status column) that the process has been stopped. So it's still alive, but it's not running... It can be resumed.

Some applications will crash if they have ongoing external processes (like a web request) that might timeout while they're asleep.


Problem with booting Ubuntu 12.04LTS 64bit

With a downloaded image on a CD/DVD it is possible to get errors that would cause this problem.

You can try a new download (bittorrent is more reliable) and perhaps install from a USB instead.

I think this is similar to your problem, and it has happened to me that I had to do a new download.


My problem is very same to your problem, and I solved it this way:.

pressed Ctrl+Alt+F1
sudo rm /home/<username>/.Xauthority
sudo apt-get install --reinstall xorg && sudo reboot.

In this step you may see the following packages have unmet dependencies. If you see this issue, do a:  sudo apt-get clean && sudo apt-get -f install, then issue sudo apt-get install --reinstall xorg again.
sudo reboot


Package mc is not available, but is referred to by another package (i386)

I check source in https://mirror.yandex.ru/ubuntu/dists/focal/universe/
and not find package mc in
https://mirror.yandex.ru/ubuntu/dists/focal/universe/binary-i386/Packages.gz

but find in
https://mirror.yandex.ru/ubuntu/dists/focal/universe/binary-amd64/Packages.gz

This means that this package is not available for x86 architecture, but is available for x64.
if need install ''mc'', need download from https://launchpad.net
cd /tmp/
sudo apt remove mc-data
wget http://launchpadlibrarian.net/448485168/mc-data_4.8.23-1_all.deb
wget http://launchpadlibrarian.net/448485186/mc_4.8.23-1_i386.deb
sudo dpkg -i mc-data_4.8.23-1_all.deb
sudo dpkg -i mc_4.8.23-1_i386.deb

We can now run ''mc'', but we can not run ''apt full-upgrade'' , because this command install newer ''mc-data'' and removed incompatible with him ''mc''.


Why System hangs while saving in libre office for some time?

This question has been asked in other forums.  It seems that there are a variety of causes and solutions.  Some things I would suggest:

Be sure to save in .ods format, not .xls or .xlsx
Try resetting your LibreOffice profile.
Apache OpenOffice may be faster than LibreOffice on some systems.

Some things to keep in mind:

Large documents with complex formatting will take longer to save.
Even small documents will take a few seconds to save because the file must be zipped up first.  Notice how small the file size is, which is a result of zipping.

Check out these links:

http://en.libreofficeforum.org/node/502
https://ask.libreoffice.org/en/question/32972/why-the-super-slow-saves-in-calc/
https://ask.libreoffice.org/en/question/154/why-is-calc-so-much-slower-at-openingsaving-files-than-ms-office-win7-x64/
https://forum.openoffice.org/en/forum/viewtopic.php?f=9&t=63170


Install vulkan driver for fglrx AMD graphics

Fglrx is no more maintained, this driver is abandoned, so it never (I think) get any update.
AMD only maintaining FirePro driver and embedded device but not for desktop/mobile.

For desktop/mobile GPU they preparing new closed source driver called AMD GPU-PRO with Vulkan support.
They also developing open source amdgpu but for they not add Vulkan support for it (but should coming in some time).

Also other open drivers like radeon or radeonSI not get Vulkan support. So only solution if you want have Vulkan is change driver to amd gpu-pro. Ofc if you have supported GPU. Here you have supported gpu list:

http://support.amd.com/en-us/kb-articles/Pages/AMD-Radeon-GPU-PRO-Linux-Beta-Driver%e2%80%93Release-Notes.aspx


To install binary version you need to get many dependencies manually:

cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu52_52.1-3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/x/xerces-c2/libxerces-c28_2.8.0+deb1-3build1_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/a/allegro4.2/liballegro4.2_4.2.2-3_amd64.deb

sudo apt-get install ./libicu52_52.1-3_amd64.deb
sudo apt-get install ./libxerces-c28_2.8.0+deb1-3build1_amd64.deb
sudo apt-get install ./liballegro4.2_4.2.2-3_amd64.deb

and then install the game:

wget http://www.headoverheels2.com/descargas/headoverheels_1.0.1-1_amd64.deb
sudo apt-get install ./headoverheels_1.0.1-1_amd64.deb

Launch it with headoverheels command.


i want to run this script when my ac-adapter is unplugged or the
  ac-adapter gets plugged in

There's a couple of ways. I've written a script specifically for that purpose , which uses on_ac_power script that comes with Ubuntu by default. This method simply uses infinite while loop to constantly poll the return of on_ac_power. Starting this script is done using Startup Applications app which launches commands when user logs into Gnome or Unity.

Another approach is via ACPI events. As shown on Arch Wiki , you can place a script into /etc/acpi folder that will perform checks for the presence of a specific AC adapter in /sys/class/backlight folder, and change a specific value in a file accordingly.


This solution worked for me. Enter this line in the terminal.

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/DialogsUseHeader':<0>}"

And buttons are back on the bottom of the dialog.


Cannot get to install screen via USB - Surface Pro 4

I was finally able to disable secure boot (I never had to disable this before).  My UEFI was freezing whenever I tried to make any changes, but after waiting 10 min or so then rebooting the settings finally stuck and I was able to boot the USB.  Hope this helps someone.


You reminded me about winexe:

Download the tarball from the project page at http://sourceforge.net/projects/winexe/

wget "http://downloads.sourceforge.net/project/winexe/winexe-1.00.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fwinexe%2F&ts=1377024055&use_mirror=hivelocity"

I'm using a hot link for illustrative propose.

Untar the file:

tar zxf winexe*.tar.gz
cd winexe*

Configure it:

./autogen.sh
./configure

Make it:

make

Then you can either install it, or running it with ./winexe:

./winexe  -U "Administrator" //some-pc 'shutdown.exe'

It follows the same syntax as psexec Microsoft tool.


Online Accounts Flickr unable to connect - Ubuntu 18.4

Ok, I checked in some forums and I found a solution for this, it's still not clear for me how this fixed it, but it did.
Just ran the command : /usr/lib/gnome-online-accounts/goa-daemon --replace
And now I can create new flickr account on online accounts.


screen switches the terminal emulator to the so-called "alternate screen" mode, in which no scrollback is provided by the terminal emulator. Instead, screen offers its own methods (via keyboard) to scroll back.

It is a false assumption from you to run screen and be able to use the regular scrollbar at the same time, and even if you make it happen via hacks (such as resetting the terminal emulator, hence leaving the alternate screen), the scrollback contents are sure not what you expect. You should either refrain from using screen, or get familiar with the keyboard-based scrolling mechanism it provides.

screen and/or vim asks the terminal emulator to emit different sequences for keypresses than the default, and Reset even reverts this, so the generated sequences no longer match the expectation.


KDE: false detection of "switch to external screen"

In the System Settings -> Background Services -> Startup and Shutdown.

I unticked KScreen 2, this stops it from starting automatically.


sort of related to your other question, but FWIW, changleog is here :

http://bazaar.launchpad.net/~unity-team/unity/trunk/view/head:/ChangeLog


Dual boot problem after upgrading to 16.04

I have two suggestions, neither of which is guaranteed to work:

Run Boot Repair -- This tool can fix many boot problems more-or-less automatically. If you run it, be sure to run it from your working Ubuntu install or from an emergency disk booted in the same way (that is, in EFI mode, if your output is any indication). The down side to this approach is that, on rare occasion, it actually makes matters worse. Such problems are rare, but you should be prepared for the possibility.
Install my rEFInd boot manager -- This program can sometimes boot Windows when GRUB can't, and is therefore worth trying. You can do this in relative safety by trying the USB flash drive or CD-R image before installing it to your hard disk; however, this will require that you disable Secure Boot, at least temporarily, if it's currently enabled. Also, if Secure Boot is active, rEFInd will require you to register a key when it first boots. In this case, I also recommend you install the Debian-package version, not the PPA, because of a bug in Ubuntu 16.04 that affects the way the PPA handles Secure Boot.

Your problem could be caused by an accidental deletion of the Windows boot loader. If that's the case, neither of the above solutions will work, and the only repair options involve using a Windows recovery disk or restoring the EFI System Partition's (ESP's) files from a backup. You can check for the relevant files in Ubuntu by typing:

sudo ls /boot/efi/EFI/Microsoft/Boot

There should be several files in that directory, including bootmgfw.efi (the main boot loader) and a number of others. If that file is not present, I recommend you investigate this detail further before you attempt either the Boot Repair or the rEFInd fix.


Given the post you linked contains a snippet containing email@email.com and the matching key is not found, make sure you adjusted the editor configuration to match your actual mail address. Even better, provide your key's fingerprint instead to prevent using the wrong key if somebody created a key matching your user ID.


You can always use something like clonezilla to backup your ubuntu installed software. Another option is to generate a list of the software like this....

aptitude search -F '%100p' '~i!~M' > my-styff

copy it to a flash drive and/or email it to yourself. Saves lots of space as long as you are talking about standard install stuff.


Taking screenshots of yakuake sessions in another session

ok, got it, by using qdbus:

#/bin/bash

# clear first old screenshots
rm screenshot_*.png

# helper from https://github.com/aplatanado/yakuake-session
function yakuake_showwindow() {
    local wid=$(wmctrl -xl | grep -iF 'yakuake.yakuake' | head -n1 | cut -d' ' -f1)
    if [[ -z "$wid" ]]; then
        qdbus org.kde.yakuake /yakuake/window toggleWindowState > /dev/null
    else
        wmctrl -i -a $wid
    fi
}

# make sure yakuake is visible
yakuake_showwindow

# caputer all sessions
s=0
for x in `qdbus org.kde.yakuake /yakuake/sessions terminalIdList | sed -e 's/,/ /g'`; do
    let "s++"
    #echo $s $x
    qdbus org.kde.yakuake /yakuake/sessions raiseSession $x;
    import -window root -resize 1920x1080  screenshot_$s.png
done


You can add pam_mount.so to your /etc/pam.d/lightdm or /etc/pam.d/gdm or whatever display manager you use. Configure pam_mount.so in /etc/security/pam_mount.conf.xml with content for example:

<volume options="nobrl,file_mode=0600,user=%(USER),uid=%(USERUID),gid=%(USERGID)"
        fstype="cifs"
        server="servername"
        path="home$/%(USER)"
        mountpoint="/home/%(USER)">
        <sgrp>Student</sgrp>
</volume>

In my case it was a cifs remote filesystem, that is mounted if the user is in the group "Student".

To execute loginscripts I use pam_exec.so in the coresponding pam-file (/etc/pam.d/*), notice, they will be execute with root-priviledges.


Irremovable folder after wiping free space with bleach bit

I am guessing you are using a version of BleachBit older than version 1.2, right?  If so, there are maybe a million empty files in this folder.

You are deleting this folder correctly, you just need to wait much longer because deleting files is slow on Linux.

You can watch the progress using the command df -i, which shows inodes usage.

BleachBit 1.2, release a year ago, prevents this problem, but Ubuntu does not update BleachBit except with updates of Ubuntu. (For example, Ubuntu 14.04 will update to BleachBit 1.6, but Ubuntu 13.10 will never have BleachBit 1.6.) You can download the latest version (1.6) from BleachBit.sourceforge.net.


Ubuntu server crashes while uploading large files

Guiverc's comment is correct.  There were several blown capacitors on the board; readily visible with bulged tops and dried goo on them.  I swapped the motherboard from a 745 desktop (all caps good) into the tower and all of the above issues disappeared.


Activities overview current workspace only

Probably there is confusion in terminology. In Gnome Shell, different workspaces are not necessarily put on a different screen. By default, Gnome Shell shows the activities of the current workspace only. You can switch to different workspaces in the activities overview using the desktop icons to the right. Thus, the activities you see do belong to a single workspace, even if some of the windows are positioned on the second monitor.
Gnome does not put separate workspaces on separate monitors. By default, a second monitor is an extension of the first workspace. When you switch workspaces, the next workspaces are shown on your primary monitor. The extended space of your first workspace remains visible on the second monitor.
There is no obvious way to change this behavior, except for using Gnome Shell extensions if available. There actually is currently an extension that does what you are looking for: Current screen only on window switcher by mmai aims to show only the windows (of the current workspace) on the current monitor in the overview.
Just for information, there is also a well known gnome Shell extension, Multi Monitors Add-On by spin83 that allows the launcher to appear on any of the monitors, so switching between workspaces on the secondary monitor also becomes possible.


The program rtmpdump should be able to handle this as well:

install:

sudo apt-get install rtmpdump

save file:

rtmpdump -r rtsp://real2.infn.it/webcast/2012-esploratori-invisibile/esploratori-dell-invisibile.rm -o myfile.rm


How to connect to a CISCO VPN through UFW

I can't believe it : I solved it !

These are the lines I added in /etc/ufw/before.rules :

-A ufw-before-input -s xxx.xxx.xxx.xxx -p esp -j ACCEPT
-A ufw-before-input -s xxx.xxx.xxx.xxx -p udp -m multiport --sports isakmp,10000 -j ACCEPT
-A ufw-before-input -i wlan0 -j ACCEPT
-A ufw-before-output -d xxx.xxx.xxx.xxx -p esp -j ACCEPT
-A ufw-before-output -d xxx.xxx.xxx.xxx -p udp -m multiport --sports isakmp,10000 -j ACCEPT
-A ufw-before-output -o wlan0 -j ACCEPT

In my previous attempts, I made two mistakes :

I copied some code from LibreOffice Writer to gedit and didn't notice that two dashes were replaced by a long dash using the autocorrection system.
While firestarter needed to allow access (both as input and as output) to the "tun+" interface, ufw need this access to be allowed to the interface I use to contact the VPN server (wlan0 in my case).


How to reduce the size of all gnome-shell icons?

To configure the layout of the application icons in the GNOME Shell, you have to modify /usr/share/gnome-shell/theme/gnome-shell.css. Note that the contents of this file may vary as it is dependent on the particular theme that you are using. In the case of the Dark Glass theme, here are the modifications necessary to reduce the size and layout of the displayed icons by 50% in Applications Overview.

.icon-grid {
    spacing: 18px;                       /* was 36px */
    -shell-grid-item-size: 35px;         /* was 70px */
}

.all-app .icon-grid {
    -shell-grid-item-size: 59px;         /* was 118px */
}

.all-app .overview-icon {
    icon-size: 48px;                     /* was 96px */
}

Read more here.


Dnat prerouting does not work on Ubuntu 14.04

Problem solved changing the ethernet card. I really think there was something wrong with the old one.


How to execute a sudo script with double click

You can make a conditional to relaunch the script as root if it's launched as a normal user.

To shutdown the computer:

#!/bin/bash

if [[ $USER == "eka" ]]; then       # If the script is ran as "eka" then...
    sudo $0                         # relaunch it as "root".
    exit 0                          # Once it finishes, exit gracefully.
elif [[ $USER != "root" ]]; then    # If the user is not "eka" nor "root" then...
    exit 0                          # Once it finishes, exit gracefully.
fi                                  # End if.

shutdown -h +30;
read -p "Press any key to continue... " -n1 -s

Simplified version:

#!/bin/bash

[[ $USER == "eka" ]] && { sudo $0; exit 0; }
[[ $USER != "root" ]] && exit 0

shutdown -h +30;

Very simplified version (not recommended):

#!/bin/bash

sudo $0          # Relaunch script as root (even if it's already running as root)
shutdown -h +30; # Shutdown the computer in 30 seconds.

To suspend the computer:

#!/bin/bash

if [[ $USER == "eka" ]]; then                 # If the script is ran as "eka":
    gnome-screensaver-command -a                  # Lock computer.
else                                          # Else:
    sudo -u eka gnome-screensaver-command -a      # Once it finishes, exit gracefully.
fi                                            # End if.

Simplified version:

#!/bin/bash

[[ $USER != "eka" ]] && { sudo -u eka gnome-screensaver-command -a; exit 0; }

Very simplified version:

#!/bin/bash

sudo -u eka gnome-screensaver-command -a

Note: $0 is a variable that holds the full path to the script.


Installing Gnome Software center for Ubuntu 18.04 on Chromebook

There is no need to change your desktop environment to do this. Just open a terminal and run

sudo apt install gnome-software

You will find a launcher named Software in your application menu in the System-category.


Launcher icon differences in pixels between monitors usign same resolution

It's probably a difference in PPI (pixels per inch) between the monitors.  There's something going on between the EDID PPI, the actual PPI, and possibly a resolution translation with your other monitor.  For example if you have to change screen dynamics to make the display fit the whole screen, it might get shrunk or stretched to do so.

You would have to compare both screens running in their native resolutions, and take into account the real PPI: Doing so would probably more closely give the results that you expect to see.


You can use xargs for this purpose like this:
for i in {1..100} ; do
  echo ' -o /dev/null http://example.com/foo -:'
done | xargs curl -s

Please, note that xargs will not produce a command larger than 2,088,616 characters in my system. You can determine this maximum length in your system by running xargs --show-limits in your system.


How to make read-only file system writable?

If a filesystem has been mounted read-only, chmod will not work since it's a write operation too.

Try remounting it read-write:

sudo mount -o remount,rw '/media/SGTL MSCN'

If the device has a write lock on it (like SD memory cards), you need to turn it off. Hardware locks cannot be disabled by software. Note that the write lock on SD memory cards is located from the sight you see the letters near the up left corner and it looks like a very small switch.

Some filesystem drivers may also not support write operations, this is the case with the older NTFS module supported by Linux. For NTFS filesystems, be sure to use the ntfs-3g driver which should be picked automatically nowadays. If not, you can force the driver with something like:

sudo mount -t ntfs-3g -o uid=$(id -u) /dev/sdb1 /mnt/

(where /dev/sdb1 has to be substituted for your block device and /mnt/ for your destination)


Package operation failed E: Sub-process /usr/bin/dpkg returned an error code (1)

Months ago I added the immutable attribute to apt-daily.timer.

For some reason, software updater decided it did not like that.

After removing the attribute, software updater now works. ?


As far as I know this is not configurable for the new window switcher which is part of Unity in 11.10.

Personally I fix this by disabling the shortcuts for the new integrated switcher and using a different window switcher.  There are at least 4 other window/application switcher plugins in Compiz and most (or all?) of the other switchers can be configured to either show all windows or only those on the current workspace.

You can edit the Compiz configuration when you install compizconfig-settings-manager & run "CompizConfig Settings Manager".

An additional advantage is that these alternative switchers actually work and show all application windows (including those of Java apps and some legacy apps, which for some reason aren't shown by the Unity switcher).


Where can I obtain Ubuntu Software and Server CDs and a manual

Alas, Ubuntu no longer distribute free CDs, see :

http://www.ubuntu.com/shipit

However, you may find some assistance with physical media from someone in the Ubuntu Nigeria community

http://www.nairaland.com/11508/ubuntu-linux/72

I don't believe there has ever been "official" printed manuals for Ubuntu, aside from commercially produced books, but learning to use the man and info utilities will be useful, as will the community documentation available at

https://wiki.ubuntu.com/


Find out the application under the mouse

Using xdotool

First make sure xdotool is available on your system:

sudo apt-get install xdotool

The following command will print the process name of the window currently in focus:

cat "/proc/$(xdotool getwindowpid "$(xdotool getwindowfocus)")/comm"

To give yourself more time to focus the window / click on it you can prepend a small sleep duration:

sleep 5 && cat "/proc/$(xdotool getwindowpid "$(xdotool getwindowfocus)")/comm"

The process name should be displayed after a short amount of time.

Using wininfo

Wininfo is a graphical utility that displays various information on windows and their properties, including the PID (process ID) associated with the window:

wininfo should be available in the official repositories:

sudo apt-get install wininfo

Having determined the PID of the window you can then look up the process name associated with it. There are various ways to do this, e.g. by looking at /proc:

$ cat /proc/17002/comm
gnome-terminal

This would be the process name associated with the PID 17002.

A more elegant way that allows inspecting the process tree context, as suggested by @Rmano:

$ pstree -a -s -l -p -u 17002
init,1
  └─lightdm,1900
      └─lightdm,3202 --session-child 12 19
          └─lxsession,3307,glutanimate -s LXDE -e LXDE
              └─openbox,3362 --config-file /home/glutanimate/.config/openbox/lxde-rc.xml
                  └─gnome-terminal,17002
                      ├─bash,1841
                      ├─bash,2332
                      ├─bash,2424
                      │   └─pstree,2484 -a -s -l -p -u 17002
                      ├─gnome-pty-helpe,1840
                      ├─{gnome-terminal},1835
                      ├─{gnome-terminal},1836
                      ├─{gnome-terminal},1842
                      └─{gnome-terminal},2269

Of course you can also combine pstree with the xdotool option above (thanks to @rubo77 for pointing this out!):

sleep 2; pstree -spaul $(xdotool getwindowpid "$(xdotool getwindowfocus)")

Sources:

https://unix.stackexchange.com/q/38867/29245

http://www.linuxquestions.org/questions/debian-26/how-to-find-the-process-associated-with-a-top-level-x-window-907125/

https://superuser.com/q/632979/170160


An alternate method to install the Guest additions is to use the Ubuntu repository versions, log into the VM to install the following packages:

sudo apt-get install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11

Finally restart the VM to complete the installation.


Make owner of newly create files AND folders www-data instead of superuser/admin

Answer to Question #1: Recursive chown

A recursive chown will let you set ownership and group to what you want for /var/www/....  This is the command you should use:

sudo chown -R www-data:www-data /var/www/

With that, every file and folder will be set as such inside there with those ownership permissions.

Half-Answer to Question #2: setgid bit

If you want default group ownership on files, set the setgid bit on the /var/www/html folder.  New files should then be created with that group as stated on the folder.

sudo chmod g+s /var/www/html

You'll need to set write permissions, though, if any user OTHER than www-data is writing to the directories, and doing so can open you to a security hole or two if you're not careful.

You end up with permissions being $USER:www-data; to change the owner you then use a chown as indicated in method #1 (that said, in a proper setup you should rely on group permissions, not user owner permissions, for access to the web files).

PHP Wordpress Duplicator Problem

The problem with permissions is the user/group PHP runs as needs write and read and likely +x on the directory to edit the dir structure and such.

PHP runs as www-data by default in Ubuntu installs which use the default configurations.  Ideally, your steps above would make the issue fixed, as you're stuck with the Duplicator Plugin being a PHP plugin.

Ideally you should also check the documentation for the Duplicator Plugin to verify what permissions it needs to run and work.


Firefox blocks my nvidia drivers MOZ_GLX_IGNORE_BLACKLIST

I don't know why the driver is on the blacklist, but you can do what's suggested: try running MOZ_GLX_IGNORE_BLACKLIST=1 firefox.

If this works, you can modify the .desktop file /usr/share/applications/firefox.desktop and change the line

Exec=firefox %u`

to

Exec=env MOZ_GLX_IGNORE_BLACKLIST=1 firefox %u


unmet dependencies for synaptics touchpad driver

A good way to solve these problems is to use aptitude.

sudo apt-get install aptitude
sudo aptitude update
sudo aptitude install xserver-xorg-input-synaptics

Now several ways to solve the problem will be proposed by aptitude:

Choose the solution that uninstalls the least packets. Write down what packages are removed. Install the packages again if needed.


How do I make plugins work in rhythmbox 2.99.1?

Plugins in newer versions of Rhythmbox can often activated through the Tool's menu option.

Pictures paint a thousand words...

Lets enable a plugin - Hover you mouse at the top-panel and click Rhythmbox to show the menu

Click the Plugins menu and find your plugin.  Tick the checkbox to enable the plugin

Close the window and then move your mouse back to the top-panel and click Rhythmbox again

Under the tools menu you will see options such as the Equalizer.

Since you mentioned the Coverart Browser plugin...

Enable the plugin in the same way as the Equalizer plugin above.

You will then see a new source which you can click on to reveal the coverart-browser


How to create a VNC server such that each user can have access using its own user/password combination

You can use X11VNC for that. I don't know if there's any particular reason why you have to use VNC, but if you just want a remote desktop solution over SSH, you may want to have a look at http://x2go.com, which is an NX-based solution to provide just that. It has some nice features, such as PulseAudio forwarding. It's very fast too – even over slow connections.


It looks like you are working on outdated repository packages for some reason (I've installed it locally, all the correct versioned dependencies are available).

There are a number of reasons* why this may be the case, but try the following:

sudo apt-get update
sudo apt-get -f install

* Reasons for outdated repository packages/info:

You haven't pulled the latest package list (see sudo apt-get
update to do this)
The repository mirror is out of date - ie it
should have sync'd from the main ubuntu repositories, but for
whatever reason, that sync didn't happen/happened halfway through an
update/failed to complete for some reason.

This issue is out of your control (you can't fix the repository), but you can change which mirror your install points to - check out this thread:

How do I change mirrors in Ubuntu Server from regional to main?

Then retry the two original steps above -


HDMI1 Disconnected Plasma TV xrandr Ubuntu 14.04lts

I had a similar problem. I solved it temporary by connecting the screen during startup and with some luck it works.


This is not possible in the current version of Unity.

It is possible to resize the launcher.


Thin clients video in LTSP changed when adding a new video card to the server

Disable Compiz and reboot everything.

Source


How can I recover /home/owner directory from opt folder back to /?

Check if /home is still present:

 ls /home

If it doesn't exists then you should move folder with this command:

sudo mv /opt/home /home

If /home exists you should move user folder:

sudo mv /opt/home/owner /home/owner

sudo give you superuser grant. Be careful using it, you could mess your system


How can I start VirtualBox with an image of Kali Linux?

Firstly, you should extract the image file. It's still a 7z file.

7z x Kali-Linux-2.0.0-vbox-amd64.7z

Then VirtualBox should recognize the extracted file (should be an ova file, based on Neil's answer).

If 7z is not installed, run sudo apt-get install p7zip-full first before running the above file.


Piping command output to an Empathy chat window

Do you want to paste this automatically or manually? If you just want to do it manually, you can do this:

program_that_outputs_weather_info | xclip

and then just paste using Ctrl-V.


I fixed this by re-installing kwalletmanager and then running

  kwalletmanager5

in a terminal


Try the Maliit onscreen keyboard, try this install method, go to this website.


How to get nginx with spdy on Ubuntu without having to compile it?

Ubuntu's nginx-full, nginx-core and nginx-extras packages comes with the compiler flag --with-http_spdy_module. Other builds, -light and -naxsi doesn't. The below still applies if you want to compile the version from upstream.

Ok, first of all:

The ngx_http_spdy_module module provides experimental support for SPDY. Currently, draft 3.1 of SPDY protocol is implemented.
This module is not built by default, it should be enabled with the --with-http_spdy_module configuration parameter.

So, as you can see, is difficult that somebody will provide nginx with some characteristics that will likely not work well (I didn't). In those cases you really only solution (which is easy nonetheless) compile from sources. In an nutshell you can create your own version of nginx using:
apt-get source nginx
cd nginx*
editor debian/rules

Here you look for the line config.status.full: config.env.full and append along all the configure options --with-http_spdy_module. Save your file.
sudo apt-get build-dep nginx
sudo apt-get install dpkg-dev
dpkg-buildpackage

Done, your deb ready for installation is there. You can create a PPA that do this stuff for you too. As you can see you take more time looking for a repository than compiling it yourself.


There should be a file /etc/sysctl.conf where you can put these settings to be automatically applied on boot.  In fact, looking at my generic version now, line 26 is the commented-out statement

# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

I suggest you look for this line and uncomment it, or add it if you cannot find it.  Then, this setting should apply on each boot.  To make it apply for the current session, as you've already discovered, you'll need to use something like the command you mentioned in your question.