How to install latest OpenJdk on Ubuntu?

If you want openJDK 1.7.0_40 for 32-bit Ubuntu then do as

wget http://www.java.net/download/jdk7u40/archive/b40/binaries/jdk-7u40-fcs-bin-b40-linux-i586-16_aug_2013.tar.gz

If you want openJDK 1.7.0_40 for a 64-bit Ubuntu then do as

wget http://www.java.net/download/jdk7u40/archive/b40/binaries/jdk-7u40-fcs-bin-b40-linux-x64-16_aug_2013.tar.gz

Then make a directory.

sudo mkdir -p /usr/lib/jvm

Then move the downloaded tar to above created directory with

sudo mv jdk-7u40-fcs-bin-b40-linux-i586-16_aug_2013.tar.gz /usr/lib/jvm

similarly you can move 64-bit also if you want.

Then cd that directory

cd /usr/lib/jvm

Then untar the archive with

32-Bit

  sudo  tar -xvf jdk-7u40-fcs-bin-b40-linux-i586-16_aug_2013.tar.gz

64-bit

  sudo  tar -xvf jdk-7u40-fcs-bin-b40-linux-x64-16_aug_2013.tar.gz

Then paste these line one by one , and these are for intimating Ubuntu that this is your default java and path of it.

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_40/bin/javac" 1
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_40/bin/java" 1

sudo update-alternatives --set "javac" "/usr/lib/jvm/jdk1.7.0_40/bin/javac"
sudo update-alternatives --set "java" "/usr/lib/jvm/jdk1.7.0_40/bin/java"

Then update your system profile , open it with

sudo gedit /etc/profile

then paste these lines

JAVA_HOME=/usr/lib/jvm/jdk1.7.0_40
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH

Now save & close.

Then reload your profile with

.  /etc/profile

Then we are done. check your java version.


move unallocated space between partitions

It is possible that the location of the linux-swap partition holds you from performing the resize.

I suggest trying the following:

Delete the linux-swap partition
Resize
Add linux-swap partition


Fresh ubuntu 13.04 install (from mini.iso), no GUI

The mini.iso does not install an X server.

At a minimum, you need sudo apt-get install xorg

Exactly what packages you need after that will depend on what was installed when you installed Kubuntu.

You may also need sudo apt-get install xserver-xorg lightdm.


You can find additional information on what a launcher is and how to create it from Help Ubuntu and from the GNOME Documentation.
Creating a custom launcher is easy. Right click anywhere on your desktop and select Create Launcher from the dropdown menu:

The following window lets you insert the command to be executed when you click on the launcher. Type in the command as you would execute it from a terminal.

Last not least here you are also able to set the icon used by clicking on it.


I just google your error "mount exited with exit code 13: $MFTMirr does not match $MFT (record 3)" and found this: http://wmarkito.wordpress.com/2010/12/29/how-to-fix-mftmirr-does-not-match-mft-record-0/

wich recomendds to use ntfsprogs sudo apt-get install ntfsprogs.

then on a terminal do

sudo ntfsfix /dev/partitionName

check it out...


Ubuntu 13.04 doesn't boot up once in a while

You might want to switch off the splash screen and display those boot progress text messages. Edit /etc/default/grub .There should be a line that says:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Change it to

GRUB_CMDLINE_LINUX_DEFAULT="nosplash"

Run

sudo update-grub

This won't fix anything, but it will help you determine what goes wrong during the boot process.
See also https://help.ubuntu.com/community/Grub2/Setup#Configuring_GRUB_2


Where does nload get the bandwidth data from?

I looked through the source code and it appears that the data mainly comes from /proc/net/dev Reference on GitHub

To look further, the data comes from the kernel rather than direct sources and will involve the heavy diving into this source tree to fully understand the process.


How can I remove a secondary IP address?

Turns out that even though dhcp was not enabled in /etc/network/interfaces, dhcpcd.service was still running and assigning an IP. I fixed this with

systemctl stop dhcpcd
systemctl disable dhcpcd

and rebooted. Secondary IP gone!


Add Desktop Environment to minimal install only cli?

Here is how you install a desktop on a minimum install or headless server.

First, run the following commands to install tasksel:

sudo apt update
sudo apt install tasksel

Run the following command to install a desktop:

sudo tasksel

Then, you can select your desired desktop environment. Choosing the "Ubuntu desktop" will install Gnome Shell which is the standard Ubuntu desktop on 18.04+. Do not select any of the "live cd" options.

Use the space bar to select or deselect a desktop and then use the tab key to select "OK" and then press Enter to install.

You can always run the sudo tasksel command in the future if you want to install another desktop environment.


Yes.

The PHP 5.4 and 5.3 tarballs are available here.


Replacement of Alt-F2 (Gnome2) in recent KDE

Yes. KDE has a replacement of it. It can also be accessed with the same shortcut - Alt-F2. This is called Krunner.

Here is a screenshot

How to Open Krunner
Krunner tip & tricks
Open files and folder with Krunner


Get details about the Connected WiFi Network

You can try nmcli d wifi which does not require sudo privilege. This gives some of the information you want, and lists all networks, but the connected one has an asterisk so you can use grep to get only the headers and the line you want like so:

$ nmcli d wifi | grep ^\*
*  SSID                    MODE   CHAN  RATE       SIGNAL  BARS  SECURITY
*  SKY5952D                Infra  11    54 Mbit/s  73      ▂▄▆_  WPA2


It looks like that /etc/fstab file is corrupted. So, try to fix it. If you have any other operating system installed or livecd of linux, then boot it and mount the root filesystem of ubuntu. Now open /etc/fstab file using a text editor. As your EFI partition is not mounting, find the line which contains "/boot/efi" at the middle. Now remove "UUID=...." but do not remove whitespaces. Replace that with /dev/sda1. Note that it you have replaced sda1 with the partition id of your efi partition. If you have one SSD or HDD, it should start with sda. If it still not working, replace sda1 with sda2 then sda3... in this pattern.


Wine 5.0.2 desktop launcher for programs

I tried your setup and it also didn't work for me at first. I got it to work by replacing 'wine' with /usr/bin/wine in the Exec= line. It worked for me after the change.


I see that simple installation of Eric package with sudo apt install eric was not enough. So I reported bug 1816671 about this.

Then I analyzed the error-log. It mentions No module named 'distutils.sysconfig'.
This python3 module came from python3-setuptools package.
So we need to install this package manually:

sudo apt install python3-setuptools

and then launch Eric and enjoy it.


List backup superblocks:

sudo dumpe2fs /dev/sda1 | grep -i backup

then use backup superblock, 32768 just an example, try several

sudo fsck -b 32768 /dev/sda1

One user could not get partition unmounted (may have needed swapoff), but used another live distro

Only the newer fdisk in 16.04 will correctly show gpt partitions. Use parted or gdisk.

sudo parted /dev/sda unit s print

sudo gdisk -l /dev/sda


Just hit the same issue after upgrading to VLC 2.2.1-5+b1 on Debian Testing, and solved it by installing the libqt5libqgtk2 package.

Recently Used is back in the file chooser and I'm once again a happy camper.


trading and charting platform for ubuntu 15.10

You can try the free open source version of Chart Geany
They provide Ubuntu packages too.


undefined reference to `GDALAllRegister'

According to this you don't have the build-essentials package installed. You solve this just running:

sudo apt-get install build-essential

I tried to run your code, but was hit with another problem due some headers dependencies:

gcc gdal.c
In file included from gdal.c:3:0:
/usr/include/gdal/gdal_priv.h:38:1: error: unknown type name ‘class’
 class GDALMajorObject;
 ^
/usr/include/gdal/gdal_priv.h:39:1: error: unknown type name ‘class’
 class GDALDataset;
 ^
/usr/include/gdal/gdal_priv.h:40:1: error: unknown type name ‘class’
 class GDALRasterBand;
 ^
/usr/include/gdal/gdal_priv.h:41:1: error: unknown type name ‘class’
 class GDALDriver;
 ^
/usr/include/gdal/gdal_priv.h:42:1: error: unknown type name ‘class’
 class GDALRasterAttributeTable;
 ^
/usr/include/gdal/gdal_priv.h:43:1: error: unknown type name ‘class’
 class GDALProxyDataset;
 ^
/usr/include/gdal/gdal_priv.h:44:1: error: unknown type name ‘class’
 class GDALProxyRasterBand;
 ^
/usr/include/gdal/gdal_priv.h:45:1: error: unknown type name ‘class’
 class GDALAsyncReader;
 ^
In file included from gdal.c:3:0:
/usr/include/gdal/gdal_priv.h:59:18: fatal error: vector: No such file or directory
 #include <vector>
                  ^
compilation terminated.


When I install software, I tend to do 1 of 2 things:

If the software is via a deb file, I just let it install where it defaults to.
If it's not, I tend to install stuff to the /opt/ dir (requires sudo-er privileges) and then add an appname.application file to /usr/share/applications so it shows up in dash.


How to fix Firefox dark theme for YouTube even dark theme is turned off?

From your screenshot it seems you're using Enhancer for YouTube™ Firefox add-on which is capable of overriding your theme only for YouTube.

To fix this, open preferences for the add-on, scroll down to Theme section and select "Theme by default".


How to reset Telegram unread message counter in KDE panel?

If you have muted chats on Telegram sometimes if the group's admin pins the message or a photo in a group even if you muted notifications for that group it will be shown in Telegram icon counter until you check that pinned message.

That is just standard behavior of Telegram so you won't miss any urgent or special notification update in a group or chat. It also might occur if somebody marks "@yournickname" in a chat.


Noob trying Ubuntu 16.04 - Compiz error after logging in

This is a known (and fixed) bug in 16.04, it will it fixed in 16.04.1.  But you can fix it now, don't worry :)

I did this:

boot with nomodeset (press E after grub is booted and add nomodeset after: quiet splash and press F10 (if I remember correctly) now change to a terminal with CTRL + ALT + F2 or something.

wget http://koti.kapsi.fi/~tjaalton/skl/build2/libllvm3.8_3.8-2ubuntu1.1_amd64.deb
sudo dpkg -i libllvm3.8_3.8-2ubuntu1.1_amd64.deb
sudo reboot.

Tested on my own system.


Installation and configuration of Java 3D in ubuntu

Go to NetBeans and open your project, then right click on the Libraries folder and select Add JAR/Folder.... In the menu that shows up navigate to /usr/share/java, select the j3d jars and click OK. Now try to recompile your project, the missing library errors should be gone.


Dual Monitor Nvidia GeForce GTX660 | Window Maximize

Have you checked under : Settings -> Devices -> Screen Display and check the setup that you have.
Also try the solution here in case it helps with your display issues, it certainly helped with mine:
Enable fractional scaling for Ubuntu 18.04


Dropbox indicator icon dissapears right after login

I have never experienced the problem you describe with the Dropbox applet. However, since the introduction of indicator applets in Unity I have experienced several other buggy applets that did not display correctly and in some cases covered adjacent applets. I would suggest that you uninstall all non-standard applets to make sure this is not the case for you.


Does window OS required to run Wine and Ubuntu?

You don't need Windows or a Windows license to use Wine. Still, not all Windows-software is usable with wine, as it works like a mediator between Linux and the software.

I don't know this Indiabulls thingy, but you could try it.

If Wine doesn't work, you could still run it in a virtual machine like VMware or VirtualBox. That would require a Windows license and is more inconvenient as it comes with more effort in daily use.


Why multiple versions of initrd.img? Can I remove them somehow?

There is special script named purge-old-kernels.
To use it you need to install single package and run the script:
sudo apt-get install byobu
sudo purge-old-kernels


Where in the debian source package do I specifiy where the program should be installed?

If there are files that need to be installed into your package but your standard make install won't do it, put the filenames and destinations into an install file. They are installed by dh_install.You should first check there is not a more specific tool to use. For example, documents should be in the docs file and not in this one.

This install file has one line per file installed, with the name of the file (relative to the top build directory) then a space then the installation directory (relative to the install directory). One example of where this is used is if a binary src/bar is left uninstalled; the install file might look like:

src/bar usr/bin

This means when this package is installed, there will be an executable command /usr/bin/bar.

Alternatively, this install can have the name of the file only without the installation directory when the relative directory path does not change. This format is usually used for a large package that splits the output of its build into multiple binary packages using package-1.install, package-2.install, etc.

So the only thing you need to do is to create a file named debian/my_package.install (replace my_package with the actual name of your package) with the following line:

path/to/your/program /opt/appname

Source


grub-install: error: will not proceed with blocklists  came up for me when upgrading to 20.04 from 19.10 on a Linode VM, solution was to ignore the error and run
grub-update

and ignore the grub-install error.  Seems to boot OK.


Uninstalling packages that are installed as dependencies of a metapackage is often harder. Because, autoremove doesn't remove the packages pulled by a metapackage - See this question for an explanation of why Why removing gnome-core does not remove all of it's dependencies?

However, removing this curated list of packages will get rid of plasma desktop mostly, if not completely.

sudo apt --purge autoremove plasma-desktop-data plasma-workspace kded5 libkf5plasma5 libkf5runner5 kactivities

It should not remove other KDE5 applications (as far I can check), but it does remove, you need to install that package later manually.


Why won't Gedit display Hebrew letters in documents, while LibreOffice works fine?

You need to set the encoding when you open the document. If you right click and choose open with gedit, gedit will display a prompt that lets you choose the encoding. But if you choose the wrong one, it doesn't give you an easy way through the menu to change it abd the prompt doesn't not always display again.

The best thing to do is use the File>Open dialog. In the lower left of the dialog, you'll see a Character Encoding option, which will say Auto Detected. Click the button to see a choice of encodings (there are 3 for Hebrew), be sure to click add after selecting the one you need, then choosing it again from the list on the right. Hebrews Windows and Hebrew Visual both worked, but Hebrew IBM did not.


Font rendering issue in GTK based applications, (Firefox, GIMP)?

The problem is: KDE has no support for "demi bold" (or semi bold) fonts, while GTK yes.

I was using a font that has a "demi bold" option, which was translated by KDE to bold.

This appears to be fixed since version 4.8, but not an option for Kubuntu users (mainly if you're using 12.04 LTS, as me).

First: on KDE Settings > Application Appearence > Fonts. Mark Anti-aliasing as enabled, click on Configure, UNcheck Exclude range, check Use subpixel, and select Slight for Hinting.

Then do one of the following steps:

Workaround 1: go to KDE Settings > Font Management and disable the semi bold and light variations from the font you're using.

Workaround 2: select a font with no semi bold and light variations, like Tahoma.


I just needed to be in the pwd for the DELETE command to work or put the exact path name.. thanks..


What is the proper way to change the DNS IP?

If you have typical connection setup with the network manager and DHCP, try the following:

Right click on the network manager icon in the panel and choose "Edit connections..."
Select your connection from the wired or wireless tab, choose "Edit"
(Enter your password if the connection is set as "system-wide available")
Choose IPv4 settings tab
Switch method to "Automatic (DHCP) addresses only"
Enter the name server you want in the box "Additional DNS servers" and press "Apply"

That should do the trick.


Where to troubleshoot wake-up from 'suspend'?

You should start from https://wiki.ubuntu.com/Kernel/Debugging, and more specifically:

Debugging Kernel Suspend -- Help debugging kernel suspend/resume problems
Debugging Kernel Hibernate -- Help debugging kernel hibernate/resume problems

Then probably you should submit a bug report. If you get confused or need help on what you did find you may ask here.

One thing may worth to try:

Switch to console tty1 using AltCtrlF1
Login & run

sudo pm-suspend

If it does suspend, try resume

Press power on
When you are back to tty1, AltCtrlF7 to go back to Desktop (tty7)

Second way to try, it works for me in XFCE/Mate 16.04 with nvidia proprietary driver.

After resume, switch to console tty1 using AltCtrlF1
Login
Search for any screen-saver or screen-locker

ps aux | grep -i -e saver -e locker

Example: light-locker, xscreensaver ...
Kill them

sudo kill <PID>

Check again with step 3

It fine, either they disappear or have different PID's (means they restarted)
Switch back to tty7, AltCtrlF7 to go back to Desktop


How to render a video with vp9 webm codec?

The easiest method using FFmpeg is to use something like the following:

ffmpeg -i input.mp4 \
       -c:v libvpx-vp9 -crf 30 -b:v 0 \
       -c:a libopus -b:a 96k \
       output.webm

This will output Constant Quality video and is a great choice if you are not fussed about file size. The recommended -crf setting is between 15-31 with lower numbers meaning better quality.

Much more detail is available on the FFmpeg trac site:

FFmpeg and VP9 Encoding Guide


Multi-touch on Asus X551C touchpad (Ubuntu 12.04)

try:

sudo dkms uninstall -m psmouse -v elantech-x551c

It helped for my touchpad. Already works


Does the TV Tuner Terratec T1 work well?

I doubt it works out of the box, though I've not tested it.

It looks like you'll need to download the drivers from here http://linux.terratec.de/tv_en.html

From the readme.txt file within the above download, there are some caveats:

8.  Known problems & limitations

    a.CPU architecture:

        Currently only x86 architecture is supported.

    b.USB support:

        Currently only USB2.0 is supported.

    c.Device VID/PID:

        0x048D/0x9005; 0x048D/0x9006.

    d.IR is supported and IRTable is named "af35irtbl.bin".

    e.Officially supported distributions:

        Linux Kernel - kernel 2.6.10 upward.


Epson Perfection V19 scanner unrecognized

You need to install also iscan-plugin-package

Download it from Epson drivers site.
You need to search your model, then click iscan-plugin-package, accept license and download a deb package that matches your architecture.

After you install it, all programs like iscan, xsane will recognize the scanner and scan.


Error when Installing From LiveCD - unable to find a medium containing a live file system”

What you are experiencing seems like that your computer doesn't read well your DVD.

when you boot from cd, you have an image that has an icon at the downside at center that is the symbol of a keyboard with a circle in white.

at this moment type any key (I do not remember well)

Afterwards you'll have a menu appearing asking you what you want to do.

Select : check disk for defects.

If it detects some troubles, then, check the integrity of your downloaded iso file (help can be found here : https://help.ubuntu.com/community/UbuntuHashes)

if everything is alright then burn it again at the slowest speed possible (it highers the burning quality in your medium)

if after this you still have trouble at the "check disk for defects" moment then your burning machine is not burning well : the burner or the brand/model of the dvd disk.

Hopes that helps you.

Best regards.


How to Install Ubuntu with FreeDOS already Installed

You don't need to do any disk partitioning before you install Ubuntu on a computer that comes with only FreeDOS preinstalled. The Ubuntu installer will take care of all the partitioning for you. If you choose the option in the Installation type window that says Erase disk and install Ubuntu, the Ubuntu installer will use the entire hard drive for Ubuntu and you won't need to do any manual partitioning.

The whole installation process from start to finish should take about a half hour. If the Ubuntu installer gets stuck for more than an hour in the middle of the installatiuon process, then you definitely have a problem installing Ubuntu. If you are installing Ubuntu on a computer that comes with only FreeDOS preinstalled, you can safely overwrite FreeDOS, as it no longer serves any purpose.

The error message that you got about graphics config has nothing to do with FreeDOS. If you have successfully installed Ubuntu, you should open the Additional Drivers utility and check if there are any proprietary graphics drivers available to be installed.


Both EasyTag and PuddleTag are available in the raring repos
http://projects.gnome.org/easytag/
http://puddletag.sourceforge.net/


How to change the dash icon in Unity 15.04 to a custom .png?

Just copy your launcher_bfb.png to /usr/share/unity/icons/. In your case(I am assuming that your png file located in /home/flatenken/Downloads/launcher_bfb.png), you must give this command:

sudo mv /home/flatenken/Downloads/launcher_bfb.png /usr/share/unity/icons/


Press Ctrl+Alt+T to open a terminal, then run one of the commands below:

HISTTIMEFORMAT="%d/%m/%y %T "  # for e.g. “29/02/99 23:59:59”
HISTTIMEFORMAT="%F %T "        # for e.g. “1999-02-29 23:59:59”

To make the change permanent for the current user run:

echo 'HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc  # or respectively
echo 'HISTTIMEFORMAT="%F %T "' >> ~/.bashrc
source ~/.bashrc

To test the effects run:

history

For more info see man bash or An A-Z Index of the Bash command line for Linux.

For commands that were run before HISTTIMEFORMAT was set, the current time will be saved as the timestamp. Commands run after HISTTIMEFORMAT was set will have the proper timestamp saved.


Setting up the AWS Tools for PowerShell Core on Linux

I believe they accidentally swapped the commands here:

  Next, run Install-Module as shown in the following command.

PS> Install-Module -Name AWSPowerShell.NetCore -AllowClobber

  It is not necessary to run this command as Administrator, unless you
  want to install the AWS Tools for PowerShell Core for all users of a
  computer. To do this, run the following command in a PowerShell
  session that you have started with sudo pwsh:

PS> Install-Module -Scope CurrentUser -Name AWSPowerShell.NetCore -Force

-Scope CurrentUser installs this for your user only, and doesn't need administrator privileges. Without that, it installs the module for all users, and does need privileges. See the Install-Modules documentation:

  When no scope is defined, or when the value of the Scope parameter
  is AllUsers, the module is installed to %systemdrive%:\Program
  Files\WindowsPowerShell\Modules. When the value of Scope is
  CurrentUser, the module is installed to
  $home\Documents\WindowsPowerShell\Modules.

To install without sudo, use -Scope CurrentUser. This is like --user for pip install, for example.


How to enable Discrete Graphics Card on Ubuntu 14.04

Don't know how and why, but after some tries I was able to install the proprietary AMD drivers and the AMD Catalyst Control Center successfully. However, only the drivers from fglrx-updates worked.
After several attempts (and reboots) I was able to configure the amd graphics (using the command amdconfig --adapter=all --initial) and now I can switch between the integrated and discrete video cards, which is quite awesome!
Finally I am able to use my AMD graphics on Ubuntu.


Software center freezes in Ubuntu 12.04, how can I fix it?

The software center does tend to freeze, especially on older or slower machines, just because it is so big. Try using Synaptic instead:

sudo apt-get install synaptic

It's a bit less newbie-friendly, but easy enough to find your way around and get done what you need to.


It does find it. The problem is that the file has a carriage return (\r) which causes the file name to be hidden by the terminal. To illustrate what I mean, compare these two commands:

printf "foobar\n"

and

printf "foo\rbar\n"

This is what each should print:

$ printf "foobar\n"
foobar
$ printf "foo\rbar\n"
bar

The second command is still printing the foo, but the \r causes the terminal to go back to the beginning of the line, so it is being overwritten. You can see it if you use od though:

$ printf "foo\rbar\n" | od -c
0000000   f   o   o  \r   b   a   r  \n
0000010

A similar thing is happening when you run your grep -R:

$ git clone https://github.com/yawlfoundation/yawl
$ cd yawl
$ grep -R  SchemaHandler . | grep YDataValidator
 }   }   return schema ;    .replaceAll("type=\"", "type=\"xs:"); xmlns:xs");pes, soonn) e;

At first glance, that results seems strange. Howe come a line that doesn't seem to contain the string YDataValidator is being returned by the grep YDataValidator? The answer is the \r. That line is actually from the YDataValidator.java file, but the file name is being obscured by the \r. You can see this more clearly if you tell grep to only print the matching string and a few characters around it:

$ grep -PRo '.{10}SchemaHandler.{10}' . | grep YDataVal
 * @a/org/yawlfoundation/yawl/schema/YDataValidator.java:d using a SchemaHandler.
./src/org/yawlfoundation/yawl/schema/YDataValidator.java:  private SchemaHandler handler;
./src/org/yawlfoundation/yawl/schema/YDataValidator.java:ler = new SchemaHandler(schema);
./src/org/yawlfoundation/yawl/schema/YDataValidator.java:          SchemaHandler handler =
./src/org/yawlfoundation/yawl/schema/YDataValidator.java:      new SchemaHandler(DOMUtil.g

Here, since there is no \r in the 10 characters immediately around any of the 5 instances of SchemaHandler in YDataValidator.java, the name is displayed correctly. Your original command returned the entire file (the whole file is just one line split by \r which don't define newlines in Linux), so you were seeing one long line which was being garbled because of the \r.

You can verify by running this:

$ grep SchemaHandler ./src/org/yawlfoundation/yawl/schema/YDataValidator.java
}   }   return schema ;    .replaceAll("type=\"", "type=\"xs:"); xmlns:xs");pes, soonn) e;

And then comparing the output to what you get if you replace all \r with newlines:

$ grep SchemaHandler ./src/org/yawlfoundation/yawl/schema/YDataValidator.java | tr '\r' '\n'
/*
 * Copyright (c) 2004-2012 The YAWL Foundation. All rights reserved.
 * The YAWL Foundation is a collaboration of individuals and
 * organisations who are committed to improving workflow technology.
 *
 * This file is part of YAWL. YAWL is free software: you can
 * redistribute it and/or modify it under the terms of the GNU Lesser
 * General Public License as published by the Free Software Foundation.
 *
 * YAWL is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
 * Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with YAWL. If not, see <http://www.gnu.org/licenses/>.
 */

package org.yawlfoundation.yawl.schema;

import org.jdom2.Element;
import org.yawlfoundation.yawl.elements.data.YVariable;
import org.yawlfoundation.yawl.exceptions.YDataValidationException;
import org.yawlfoundation.yawl.schema.internal.YInternalType;
import org.yawlfoundation.yawl.util.DOMUtil;
import org.yawlfoundation.yawl.util.JDOMUtil;
import org.yawlfoundation.yawl.util.StringUtil;

import javax.xml.XMLConstants;
import java.util.*;

/**
 * This class serves as a validation mechanism for the specification specific
 * schema and the instance data from either the net or a task. This is performed
 * by taking the data available at the various validation points and converting
 * it into conventional XML which is then validated using a SchemaHandler.
 *
 * @author Mike Fowler
 *         Date: 05-Jul-2006
 */
public class YDataValidator {

    // Object that performs the real validation on XML documents
    private SchemaHandler handler;

    /**
     * Constructs a new validator and handler. The
     * handler is not ready for use until validateSchema
     * has been called.
     * @param schema a W3C XML Schema
     */
    public YDataValidator(String schema) {
        this.handler = new SchemaHandler(schema);
    }

    /**
     * Compiles and determines the validity of the current schema
     * @return true if the schema compiled without error.
     */
    public boolean validateSchema() {
        return handler.compileSchema();
    }

    /**
     * Validates a single data variable
     *
     * @param variable to be validated
     * @param data XML representation of variable to be validated
     * @param source
     * @throws YDataValidationException if the data is not valid
     */
    public void validate(YVariable variable, Element data, String source)
            throws YDataValidationException {
        List<YVariable> vars = new ArrayList<YVariable>(1);
        vars.add(variable);
        validate(vars, data, source);
    }

    /**
     * Validates a collection of variables against the schema. This is achieved by
     * temporarily adding a schema element declaration for the data. This avoids
     * attempting to create a new schema containing only the relevant data types.
     *
     * @param vars variables to be validated
     * @param data XML representation fo the variables to be validated
     * @param source
     * @throws YDataValidationException if the data is not valid
     */
    public void validate(Collection vars, Element data, String source)
            throws YDataValidationException {
        try {
            String schema = ensurePrefixedSchema(handler.getSchema());
            org.w3c.dom.Document xsd = DOMUtil.getDocumentFromString(schema);
            String ns = XMLConstants.W3C_XML_SCHEMA_NS_URI;

            //need to determine the prefix for the schema namespace
            String prefix = ensureValidPrefix(xsd.lookupPrefix(ns));

            org.w3c.dom.Element element = xsd.createElementNS(ns, prefix + "element");
            element.setAttribute("name", data.getName());

            org.w3c.dom.Element complex = xsd.createElementNS(ns, prefix + "complexType");
            org.w3c.dom.Element sequence = xsd.createElementNS(ns, prefix + "sequence");

            ArrayList varList = new ArrayList(vars);
            Collections.sort(varList);               // sort on YParameter ordering value

            for (Object obj : varList) {
                YVariable var = (YVariable) obj;
                org.w3c.dom.Element child = xsd.createElementNS(ns, prefix + "element");
                child.setAttribute("name", var.getName());

                String type = var.getDataTypeName();
                if (XSDType.isBuiltInType(type)) {
                    type = prefix + type;
                }
                else if (YInternalType.isType(type)) {
                    type = prefix + type;
                    xsd.getDocumentElement().appendChild(DOMUtil.getDocumentFromString(
                            YInternalType.valueOf(type).getSchemaString()).getDocumentElement());
                }
                child.setAttribute("type", type);

                if (var.isOptional()) {
                    child.setAttribute("minOccurs", "0");
                }

                sequence.appendChild(child);
            }

            complex.appendChild(sequence);
            element.appendChild(complex);
            xsd.getDocumentElement().appendChild(element);

            SchemaHandler handler =
                          new SchemaHandler(DOMUtil.getXMLStringFragmentFromNode(xsd));

            if (! handler.compileSchema()) {
                throw new YDataValidationException(
                    handler.getSchema(),
                    data,
                    handler.getConcatenatedMessage(),
                    source,
                    "Problem with process model.  Failed to compile schema");
            }

            if (! handler.validate(JDOMUtil.elementToString(data))) {
                throw new YDataValidationException(
                    handler.getSchema(),
                    data,
                    handler.getConcatenatedMessage(),
                    source,
                    "Problem with process model.  Schema validation failed");
            }
        }
        catch (Exception e) {
            if (e instanceof YDataValidationException) throw (YDataValidationException) e;
        }
    }

    /**
     * @return String representation of the schema
     */
    public String getSchema() {
        return handler.getSchema();
    }

    /**
     * @return All error/warning messages relating to the last validation/compilation
     */
    public List<String> getMessages() {
        return handler.getMessages();
    }

    /**
     * @return the set of (first-level) type names defined in this schema
     */
    public Set<String> getPrimaryTypeNames() {
        return handler.getPrimaryTypeNames();
    }

    /**
     * Utility method to ensure the prefix is valid (enforces : and
     * defaults to xs:)
     *
     * @param prefix to validate
     * @return validated prefix
     */
    private String ensureValidPrefix(String prefix) {
        if (StringUtil.isNullOrEmpty(prefix)) {
            return "xs:";
        }
        else if (! prefix.endsWith(":")) {
            return prefix + ":";
        }
        return prefix;
    }

    /**
     * A schema may not have a valid prefix if a spec contains no complex types, so
     * this makes sure it gets one in that case
     * @param schema the schema string to check
     * @return a correctly (or defaultly) prefixed schema string
     */
    private String ensurePrefixedSchema(String schema) {
        if (!schema.contains(":schema")) {
            schema = schema.replaceFirst("schema xmlns", "schema xmlns:xs");
            schema = schema.replaceAll("<", "<xs:")
                           .replaceAll("<xs:/", "</xs:")
                           .replaceAll("type=\"", "type=\"xs:");
        }
        return schema ;
    }
}

Alternatively, you can pipe the output to a pager like less which will show the \r as ^M and can also help you identify the line you're after.


How to install WIjesekara Sinhala keyboard?

Sinhala Keyboard Ubuntu 20.04

Select Show Applications icon, (Lower Left corner).

Select Language Support.

Complete Install of Language Support.

Select Install/Remove Languages. Check the box next to Sinhala.

In Regional Format select Sinhala

Open Settings / Language and Region.

Click + sign.

Type sinhala at bottom of Add an Input Source, if not already shown.

Select Sinhala (Wijesekara).

Check Add upper right.

If you are also keeping the US keyboard select your current preference using the icon upper right next to the WiFi icon.


Try this: open terminal using Ctrl+Alt+T, or Ctrl+Alt+F1 and login

rm -rf .compiz-1

Ctrl+Alt+F7 #if you had used Ctrl+Alt+F1


How to install any theme using only comand-line?

First download a theme, of course, use wget followed by the URL of the theme you want to download and extract it, most are .tar.gz so

tar -xvzf path/to/theme.tar.gz

Then move the extracted folder,

sudo mv path/to/theme/folder /usr/share/themes

Then change the theme

gsettings set org.gnome.desktop.interface gtk-theme "Name of theme folder here"

Where "Name of theme folder here" is the name of the folder you just moved and that is it, for a bash script using only commands

#!/bin/bash
wget DOWNLOAD URL OF THEME HERE
tar -xvzf path/to/theme.tar.gz
sudo mv path/to/theme/folder /usr/share/themes
gsettings set org.gnome.desktop.interface gtk-theme "Name of theme folder here"

That is all.


Unable to install software in Ubuntu server 14.04.3 32bit

Easy fix: here's a sources.list file you can use. Comment out any repos you don't want to use. The following has all repos enabled. Also, the following is for the United States so change that accordingly.

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner


Ubuntu 20 : Ubuntu doesn't reconnect to WiFi unless I reboot

Rather the restarting Ubuntu, you can try just restarting the Wifi.
Right click on the WiFi icon at the top right-> turn off, then turn it back on again.
Does that help ?


This is a known issue Shortcut to activate synapse resets to Control-space every reboot and still pending. If you feel up to it, there is a patch.

Even if the shortcut is correctly saved in $HOME/.config/synapse/config.json, it won't works.


Ubuntu booting error: ehci-pci 0000:00:id.0: port 1 reset error -110

I had the same problem on a hp14 laptop.  It is finally solved by going to BIOS and change the setting "USB3.0 Configuration in Pre-OS" from "Auto" to "Enable".  I have no clue why this solves the problem.


Why is ThinkPad T590 slower on Ubuntu 18.04 compared to Windows 10?

You have a swap partition...on an SSD. I'm pretty sure this is something you shouldn't have or need. Try turning Swap 'oof' and see if that improves things...it will certainly prolong the life of your SSD


can't load shared library libXt.so.6 - although it can be located

According to the search on https://packages.ubuntu.com the libXt.so.6 is located in libxt6 package.

You can install it with

sudo apt install libxt6:i386

for 32-bit.


How to connect to a personal server on residential Internet service

You need to forward a port used by SSH (22) on your router so all traffic coming on that port from outside is redirected to your Ubuntu machine.

See this article: http://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/ or search for "forward port router".

Once you have port forwarding correctly configured, you'll be able to use your external IP address, or any DNS name configured to point to that IP address, to connect to your Ubuntu box from outside. The IP is the most robust way to do this. So, in your case, you need to replace (host) in (user)@(host) with your external IP address.

Also, as I said, getting proxy errors suggests that there's a proxy in the middle, which shouldn't be there. Which suggests that something is mis-configured.


How to go into a directory from an archive using the terminal?

Your question isn't very clear but if by "archive" you mean a compressed file (such as zip) then perhaps this answer will help?

How to mount a zip file as a file system?

After mounting the archive you would be able to cd into it.


Why does my laptop wifi not work after it wakes from suspend?

Terminal :

sudo ifdown wlan0 && sudo ifup wlan0

Solution 1:

sudo nano /path/to/script.sh

#!/bin/bash
sudo ifdown wlan0 && sudo ifup wlan0

crontab -e:

@reboot  /path/to/script


How to use Samsung SCX 3201 with XSane Image Scanner

to install the scanner, the package one downloads from HP/Samsung is uld_v1.00.36_00.91.tar.gz so if one opens a terminal (holding 3 keys down, the control and alt and t keys ..) and then copies the commands below; line by line; ).. so each line is separate ..)and pastes them into the terminal; and hit the ENTER key after each paste

(this assumes by default the downloaded package is saved to the Downloads folder)

cd Downloads

tar -zxvf uld_v1.00.36_00.91.tar.gz

cd uld

sudo ./install-scanner.sh

and that last command should get the scanner set up for you


User, Group and Other in the chmod command

There are not seven levels of authorization. There are basically three for each of user, group and others.
The number can go up to seven but it's just a sum of three levels.

4 = read acces
2 = write access
1 = allow to execute (for scripts and binaries)

Whatever you want to have from these permissions, add it up and you get a number.
Now do these for every of the three cases.

First digit = That's what is granted for the owner of the file
Second digit = Is what's granted for all members of the group of the
file
Third digit = What's granted for everyone, regardless of username or
group

Hint: It's a bit special for directories so if you understood it for files you should read into how it applies for directories...


Allowing processes that started through ssh to continue and log output in file

There is possibly multiple ways of achieving it, but here are some of essentials:
screen
screen allows to create virtual console, deattach it from your tty (CTRLA followed by CTRLD) and attach it back (screen -r) anytime you need.
nohup
nohup is a software which allows you to run command which will ignore any hangup signal and write output of command to nohup.out file in cwd. In practice running following command thought ssh and then logging out will keep process working nohup dd if=/dev/random of=/dev/null &.
tee
tee command in very simple usage works as a fork machine which write it's stdin to a file and to stdout simulateously. In your case that would be ls -alh | tee 'ls'. If you also want to write stderr to file append 2&>1 (which means "redirect stderr to stdout") to your base command.
By combining these solutions you should be able to achieve what you want.
You can also see similar answer: 8703001/1732775.


Fix for poor HD playback using ATI or NVidia graphics

I got it working just follow these steps.....

1 install mplayer

2 install smplayer frontend {in software center}

3 open smplayer

4 go to "OPTIONS" then "PREFRENCES" then "GENRAL"

5 if you have a nvidia card choose "OUTPUT DRIVER" and select "VDPAU" {for ATI or AMD choose xv (0 - ATI Radeon AVIVO video) I dont know if this will work as my card is nvidia but it should)

6 go to performance on the left hand side and set both local and streaming cache to 99999 (this may also fix dvd playback if you set that cache aswell}

7 check the box for "ALLOW HARD FRAME DROP" and set "LOOP FILTER" to skip only on HD

8 Set the "THREDS FOR DECODING OPTION TO THE NUMBER OF CORES YOUR CPU HAS IF YOU HAVE MORE THAN ONE CPU ADD UP ALL THE CORES FOR BEST PERFORMANCE"

9 Enjoy you HD movies again on ubuntu......

I have a pretty avrage machine heres my spec....

2x Pentium 4 ht 3 ghz

Stock dell power and motherboard

GFORCE 310 HDMI

24 inch full HD tv as a monitor

so any one with dule core cpu should have no problems getting this to work.

hope this helps someone out.


Ubuntu wont boot, Grub error, will boot repair mess with windows boot files?

I haven't heard of boot repair, but I might have a working solution for you.

Get a live USB and boot into the system.
Find out which partition is Ubuntu. You can do this via running disk utility (palimpsest in terminal). Then click on your harddisk and select your ubuntu partition. Write down the device, for example: "/dev/sda5".
Open a terminal (Ctrl + Alt + T) and mount the ubuntu partition:

sudo mount /dev/sda5 /mnt
Install grub on your ubuntu partition:

sudo grub-install --root-directory=/mnt /dev/sda

The command above assumes your hardrive device is /dev/sda, so it will install the grub bootloader on the harddrive. If everything goes well, grub will try to find all the operating systems located on your computer. After that you should be able to reboot and see a normal grub menu. Good luck!


Ubuntu 18.10 : How can I install a specific NVIDIA drivers version?

APT generally looks for and installs the latest stable version of any package. To achieve what you want, you have to remove the GPU Drivers PPA. But first remove all NVIDIA related software and reboot the operating system. Regarding the error message that the drivers aren't signed, boot into BIOS and disable Secure Boot in the UEFI settings. After having done this, perform these steps ...

If you have the original NVIDIA drivers installed : sudo nvidia-installer --uninstall
If you have the "Ubuntu drivers version" installed : sudo apt purge nvidia*
Reboot the operating system : sudo reboot
Remove the PPA : sudo add-apt-repository --remove ppa:graphics-drivers/ppa
Update the software sources : sudo apt update
Search for available drivers : sudo apt search nvidia*
Install the drivers of your choice - an example : sudo apt install nvidia-driver-390
Reboot the operating system : sudo reboot

What's important : you can only install and use drivers versions that support your GPU, of course.


What happend to SMART data (disk selftest option)

Select Dash the first option on the Launcher and type disks. Select the icon that appears.

The disks main screen looks like this:

Notice the "hamburger" menu in the top right corner. Select it to get a drop down menu where you can select the SMART screen shown below:

If you require further explanation please comment below.


You could use lsusb from a terminal.
For example:
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
Bus 001 Device 004: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 003: ID 2f68:0042 Hoksi Technology DURGOD Taurus K310
Bus 001 Device 002: ID 12d1:4321 Huawei Technologies Co., Ltd. UVC Camera
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

On the second line of the output this shows the bluetooth interface.


Confused about permission of group `www-data` for `/var/www/html'

Ownership should be youruser:www-data
And youruser should be in www-data group

Permissions for folders 750, for files 640

This can be done by one command: chmod -R u=rwX,g=rX,o= /pathtofolder

If scripts used to create some files add group writable permission to needed folders(like smarty template cache)


Can't type the password while logging in the Non-Graphical interface (Ctrl+Alt+F3)

The comments have already provided the reason for not seeing what you type.

The Login incorrect response you are seeing is a result of typing information that doesn't match.

Since you are able to login the GUI without any problems, then you have a correct matching username and password.

To use the Ctrl+Alt+F# console terminal (a TTY Console) you'll have to put the exact information.  The username is case sensitive.

The Username you see on the GUI is a friendly name version.  It's almost never the same as your real Username.  While logged in the GUI use this to find the exact spelling of your real username.

First hit Ctrl+Alt+T.  From the terminal type in this:

$ whoami

It will show the exact spelling of your username.  Use that on the TTY console and carefully type in the password (which won't echo), then press ENTER.

If the username and password is exact, you will get a login prompt.


There is no sites-available/000-default.conf in /etc/apache2

The files in /etc/apache2/conf-available are files that an admin is free to create, rename, remove, fill in with proper content, etc.  If you have no 000-default.com, just create one.

You should then call

sudo a2ensite 000-default.conf

Caveats:

the virtualhosts coexist - from what I understood, you already have some non-standard configuration.  Beware virtualhosts conflicting with each other.  Chances are you may need a fresh install of apache2 including its configuration.
what files are finally loaded (included) as configs depends on some other config files, like /etc/apache2/apache2.conf with its include command (which then includes a specified file).  Include can also be called in an included file.

FYI, the 000-default.conf for apache2 (version 2.4.7) goes as follows:

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

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

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

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

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

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

And you are best to use the following commands to enable/disable a site rather than creating a site by creating a symlink (which you still can do, but well... its typically rely on helper scripts e.g. in order to avoid typos)

a2ensite 000-default
a2dissite 000-default

If some configs don't kick in, you can try:

sudo service apache2 reload

or even deeper config-reload happens on:

sudo service apache2 restart

Reload does keep some connection-related data in the memory, and both take a fraction of a second on a typical fresh installation.

EDIT: I added a note about four usefull commands: a2ensite, a2dissite, service apache2 restart/reload  and in the subsequent edit I re-organized the answer to better fit the question.


Faenza-Darkest icon theme is broken after upgrade to Ubuntu 19.04

Rename the file "folder-symbolic.svg" in "/usr/share/icons/Faenza-Dark/places/scalable" to "folder-symbolic.svg.old" or something like that and then it should work again. :)

The trash icon is also wrong, so the best solution is to rename the complete "scalable" folder in "/usr/share/icons/Faenza-Dark/places/", so you don't need to rename every single icon that is not working.


Black screen after lid close, but only with NVIDIA drivers

I'm having the same issue in Ubuntu Gnome 17.04 with my Asus R558UQ. It's far from being a solution, but to me disabling the Secure Boot in BIOS/UEFI menu prevented the black screen from reappearing.

EDIT: This worked for me in Ubuntu 18.04.

DISCLAIMER : I didn't came up with this solution. It was an issue I've had problems with so long that I decided to save the answer as a PDF in my Google Driver so as not to loose it. And now I can't find the link, so I'm copypasting someone's else answer.

Hi all

How to solve the issues of suspending , hibernating and wakeup with nvidia-370.28 first step :
Just open this file
sudo gedit /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla and enable hibernation

...
[Disable hibernate by default in upower] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes

[Disable hibernate by default in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate ResultActive=yes

second step :
on /etc/default/grub :

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1 vga=0 rdblacklist=nouveau nouveau.modeset=0 "

third step :
sudo gedit /etc/initramfs-tools/modules and add the following modules

nvidia nvidia_modeset nvidia_uvm nvidia_drm

fourth step :
sudo update-initframs -k "yourkernel" -u

fifth step :
reboot and you are done .
Note : if are not on Ubuntu follow this:

PolicyKit Local Authority policy to enable suspend and hibernate for all users. Should be installed into /var/lib/polkit-1/localauthority/90-mandatory.d or /etc/polkit-1/localauthority/90-mandatory.d

file to edit under the directory mentionned : enable-suspend-and-hibernate.pkla copy this text and save and continue other steps

[Completely disable suspend and hibernate]

Identity=unix-user:* Action=org.freedesktop.upower.suspend;org.freedesktop.upower.hibernate;org.freedesktop.login1.s uspend*;org.freedesktop.login1.hibernate*
ResultAny=nyes ResultInactive=yes ResultActive=yes

regards Mounir

PS : I hope it works for you AMEN

For me, it not only prevented the black screen after hibernating but also solved the freezing when shutting down/restarting after hibernating using the Xorg drivers.
Hope it works for you too, let me know :) !

Nehuen


You could use something like this:

#!/bin/sh
# $0 is the script name, $1 id the first ARG, $2 is second...
NAME="$1"
mxmlc $NAME.as
flashplayerdebugger $NAME.swf


How to install Ubuntu 18.04 without GRUB?

As suggested, removing the Windows drive then installing Ubuntu on the secondary drive is the way to go.

After installing Ubuntu, put the Windows drive back in and change the boot order in the BIOS to whichever drive/OS you want to boot first. Then you can boot into the secondary drive/OS using the BIOS boot menu.


Dual-booting Ubuntu 14.04 with Win 7 on a RAID 0

Ok I think I can answer your question. The partition should not be unallocated. If you use Gparted, go to the program and right click on the unallocated button. Click "new". You will see a drop down menu. Select ntfs. I hope this helps.


It was probably WUBI, but that only works (atm) with a Win7 installation or prior, according to the documentation:

https://wiki.ubuntu.com/WubiGuide

If your mom's PC doesn't have a CD/DVD Drive, then it's probably the best way installing with an USB-Stick, see documentation here:

http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows


My Appearance theme briefly changes itself


Is there software available to benchmark networking equipment?

For general throughput testing, I've used iperf (sudo apt-get install iperf).

You start a server on one machine (using iperf -s) and run the client on another machine on the other side of the network. You get a throughput like so:

oli@bert:~$ iperf -c tim
------------------------------------------------------------
Client connecting to tim, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.4 port 39402 connected with 192.168.0.5 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.04 GBytes    895 Mbits/sec


How to Open (.sps,.csv and .sav) with SPSS as default application?

So the right entry for .sav is application/x-spss-sav=blabla.desktop

Simply add it to ~/.local/share/applications/mimeapps.list

so....closed


.php file not execute outside /home/USER/public_html folder

Finally Solved!

In ubuntu 16.04 you just need to decleare AddType into /etc/apache2/sites-available/000-default.conf and also in /etc/apache2/sites-available/default-ssl.conf.

AddType application/x-httpd-php .php


Batch downloading files with the date in the file name

I assume one of your files is  https://www.url.com/2017-11-16.png and only the date changes. You could use Bash Brace Expansion to compute the dates and download the files in one run:

wget https://www.url.com/{2016..2017}-{01..02}-{01..02}.png

However, this will not work for very many URLs like in your case because there's a limit to the length of a terminal command. An alternative is a for loop:

for i in {2016..2017}-{01..02}-{01..02}; do
  wget https://www.url.com/$i.png
done

But you'll still get dates like 2017-02-31 with this approach. To only get actual dates we need date like in this script taken from here:

#!/bin/bash
startdate=2017-11-14
enddate=2017-11-16
d=
n=0
until [ "$d" = "$enddate" ]; do
  d=$(date -d "$startdate + $n days" +%Y-%m-%d)
  wget https://www.url.com/$d.png
  ((n++))
done

Adjust startdate and enddate to your exact needs. If you need to change the date format to e.g. 20171116, do so in both those variables and the date command, in this example it would be +%Y%m%d.


Unable to run Java, IcedTea on Ubuntu 12.04 LTS in Chrome or Firefox

Well, this test seems not to work for me either. I get a screen like this:

but all other Java web applications are working fine. So maybe the test is broken, not the IcedTea. Try this test instead: Java Tester.


Workspace Switcher icon is not valid in Mac Lion Theme

I think the problem is your icon theme doesn't have a dedicated icon for workspace-switcher. Hence, it is using a weird icon. We can possibly solve this problem by copying the default icon theme's icon for workspace-switcher and pasting it into your current icon theme.

Try the following command:

cp /usr/share/icons/unity-icon-theme/apps/48/workspace-switcher.png ~/.icons/Mac-Lion-Icons/apps/scalable

and

cp /usr/share/icons/unity-icon-theme/apps/48/workspace-switcher.png ~/.icons/Mac-Lion-Icons/apps/48/

Hopefully, that will solve your problem.


Rename directory using find returns odd error

In your example, a subshell will execute for every match, which can be quite resource-demanding. A better approach would be to pipe the result to rename.
$ find -depth -type d \
 -name 'foo*' -print0 | rename -0 -d 's!^foo!bar!'

Reading filenames from file handle (GLOB(0x5594a9a71a48))
./fooone/footwo/foothree renamed as ./fooone/footwo/barthree
./fooone/footwo renamed as ./fooone/bartwo
./fooone renamed as ./barone


Ubuntu 16.04 Mouse flickering while hovering window border

I found the problem. For some reason I had a dual screen that I noticed when I went to the Workspace Switcher. So I went to System Settings, then to Displays and I turned the other display off which was called Unknown Display. This left me with Built-in Display after I applied the changes by hitting the Apply button.


Lightdm doesn't show wallpaper/background and colors are wrong

The problem has a far easier solution than what I first looked for:

In the login screen, open the Accessibility menu – one of the icons in the top right corner – and disable High Contrast mode. So it's not a bug, it's accidentally for example hitting the shortcut key to enable the High Contrast mode.

It's made more confusing by the fact/bug that it's not really well working as a high contrast mode since the mode does not fit well to the Ubuntu's / unity-greeter's default background. Another confusing element is the disappearance of the user background, which feels like a bug while actually it's probably designed to force correct high contrast text if some original Lightdm default background would be used instead of the Ubuntu background.


From the website

  Last.fm Radio will remain free on the Last.fm website in the US, UK and Germany and for the US and UK users of Xbox Live and Windows Mobile 7 phones. We’ll also continue to offer radio for free via the Last.fm desktop app.

Roughly translated it means you can only listen to last.fm by either going to their website, using their official desktop client, or becoming a subscriber (which will allow you to use third party apps and on mobile phones). The desktop client is available in the Software Center for free (Screenshot below). Just search for "last.fm"

Some programs still use last.fm's old API, which allowed anyone to listen to it anywhere.


HDMI audio to Samsung TV not working Ubuntu 14.04

Somehow KDE phonon settings don't show the needed HDMI output.
The latest pavucontrol will show much more outputs with addition of plugged in/unplugged prefixes. Just select plugged in one.


How to properly handle 4K resolutions on Kubuntu 16.04?

Tomorrow a new Kubuntu version will be released, with improvements in HiDPI management.

If I were you, I would try your setup with the new version.


Permission problems when installing MATLAB R2013b

Try to run the MATLAB installer via terminal using root privileges aka sudo.

Go into the MATLAB directory via terminal.
Change install file into an executable one by running

sudo chmod +x install
Now run the installer ,

sudo ./install


update on ubuntu 14.04 "E: Some index files failed to download. They have been ignored, or old ones used instead."

The below line is not a valid PPA line, so delete it or put # symbol before it in /etc/apt/sources.list file (you can edit it with sudo -H gedit /etc/apt/sources.list):

deb http: //ppa.launchpad.net trusty/main i386 Packages

And also remove the Not found PPA's:

sudo add-apt-repository -r ppa:marlin-devs/marlin-daily
sudo add-apt-repository -r ppa:tiheum/equinox

Now run the sudo apt-get update command.


How to Install vaio-control-center from source?

this how
download the file

$ wget http://downloads.sourceforge.net/project/vaio-control-ce/vaio-control-center-0.1.tar.bz2
enter code here

you have to install qt4-qmake

$ sudo apt-get install libqt4-dev qt4-qmake cmake r-base-dev libcurl4-gnutls-dev

& install g++

$ sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
$ sudo add-apt-repository ppa:jerzy-kozera/zeal-ppa
$ sudo apt-get update
$ sudo apt-get install build-essential g++

for the compilation
then

$ tar -xvf vaio-control-center-0.1.tar.bz2
$ cd vaio-control-center-0.1
$ /usr/lib/i386-linux-gnu/qt4/bin/qmake -o Makefile vaio-control-center.pro
$ make
$ ./run

you will get this another error you need to post that error in stackoverflow.com tag c++ & qt see what they can do


Error installing phpDocumentor on Ubuntu 14.04

Actually, there is bug related to unzipping downloadable contents with pear. To solve this issue, use --nocompress option after install.

Try this:

sudo pear install --nocompress phpdoc/phpDocumentor

another site advise to simply extract pear downloaded file and run upgrade with extracted result. See here for further details.

note:

this will download phpDocumentor uncompressed source (approx. 67 MBytes)

sources:

https://bugs.php.net/bug.php?id=67075


How can I set default terminal used in Unity?

For 12.04 and newer

gconf is now deprecated - http://en.wikipedia.org/wiki/GConf - and gsettings can be used in its place.

gsettings set org.gnome.desktop.default-applications.terminal exec 'terminal'

Where terminal is the command you would use to open it from the terminal.


How do I recursively zip all subfolders in a directory?

try with command I have tried in the image , hope thats gonna help you.

For removing you just can add an extra line that

rm -rf $i

The total command can be as

 for i in ~/sandbox/*; do zip -r "$i".zip "$i"; rm -rf "$i"; done

The command which deletes Folders after verifying successful Zip creation.

for i in ~/sandbox/*; do zip -r "$i".zip "$i" && rm -rf "$i"; done

Thank you @evilsoup for noticing.
hope that helps.


Intermittent video glitches - Ubuntu 14.04

Run:

sudo apt-get install --install-recommends linux-generic-lts-utopic \
xserver-xorg-lts-utopic libqt5gui5 libgles1-mesa-lts-utopic \
libgles2-mesa-lts-utopic libgl1-mesa-glx-lts-utopic \
libgl1-mesa-glx-lts-utopic:i386 libglapi-mesa-lts-utopic:i386 \
libegl1-mesa-drivers-lts-utopic

This will install the newer version of the kernel, X.org display server, and associated drivers found in Ubuntu 15.04.  These versions are installed by default when using an Ubuntu 14.04.2 or higher version CD.  For more information, see: https://wiki.ubuntu.com/Kernel/LTSEnablementStack


Can only see partial partition in dual boot

Are the E: and F: partitions also NTFS?
In Windows, in an administrative command window, type:
chkdsk /f E:
chkdsk /f F:
Reboot to Ubuntu and retry accessing these partitions.
Update #1:
I'm not sure why you can read one dynamic NTFS partition, but not the other two. The good news is that you don't appear to have much data on an of D:/E:/F:, so backup any data, and then remove the partitions, and recreate them as BASIC NTFS partitions, and then you should be able to access them via Ubuntu.
I deleted all the partitions and created new partitions. Now it is working perfectly fine.


How do I prepare my Ubuntu SSD for a windows install after it has been reformated?

It has NOTHING to do with your SSD retaining something from old install. Since you have formatted the drive the usable data on it is gone period. From what i get, its the old bootloaders and their redundant entries which you have encountered.

Firstly, do take note of what disk you boot from in your bios.

Next, to correct your bootloader your should run(from an ubuntu installation),

sudo grub-install /dev/sda
sudo update-grub

replace /dev/sda with your disk

If you want to remove grub completely with windows bootloader you must run startup repair in windows or install easybcd and crrect it from there


From the debug we made I can only guess the missing thing is to setup APN type as DUN (or default, dun) on your phone. Let me know how it goes.


This is actually related to bash, rather than just the sed command.

You can understand it better by looking at this example:

~ $ front="front"
~ $ echo "front" | sed "s/$front/back/"
back
~ $ echo "front" | sed 's/$front/back/'
front

Double quotes evaluate the expression inside, whereas single quotes preserve the literal value of each character. More info here: https://stackoverflow.com/questions/6697753/difference-between-single-and-double-quotes-in-bash


My Firewall script is blocking nginx Rtmp Client connection

Move this rule:
# Allow any related traffic coming back to the server in. i moved it here to drop the attacker current connectivety as you told me
#
$IPTABLES -A INPUT -i $EXTIF -s $UNIVERSE -d $EXTIP1 -m state --state ESTABLISHED,RELATED -j ACCEPT

To way earlier, say after the ICMP stuff.
Add a new rule ACCEPTing your port 1935 stuff immediately after that. You didn't specify tcp or udp. I'll do tcp:
$IPTABLES -A INPUT -i $EXTIF -p tcp --dport 1935 -m state --state NEW -j ACCEPT

This will let anybody try to make a new connection to your 1935 port. If you want to prevent people on the bad guy list then put this new rule in between the bad guy check and the conn limit check, like so:
#allow TcpPorts
$IPTABLES -A INPUT -i $EXTIF -m recent --update --hitcount 1 --seconds 432000 --name BADGUY_CONN -j DROP
$IPTABLES -A INPUT -i $EXTIF -p tcp --dport 1935 -m state --state NEW -j ACCEPT
$IPTABLES -A INPUT -i $EXTIF -d $EXTIP1 -p tcp -m connlimit --connlimit-above $EXTIMESENTER -j add-to-connlimit-list

Note 1: untested.


Are the HISTSIZE and HISTFILESIZE generic or specific to .bash_history

HISTFILE and HISTFILESIZE are bash specific (some other shells might also support the same/similar environment variables e.g. zsh supports HISTFILE and uses SAVEHIST instead of HISTFILESIZE) and dictates bash's interactive history, by default; it would not work for psql CLI's history.

Look out for any such specific directive that psql provides, and that you can set on any startup configuration file, or via an environment variable, or may be via command line.


Select Command not working while run shell scripts on remote machine

If you tell bash to read commands from stdin, which is what the -s option does, and then redirect its stdin, you cannot provide input via stdin any longer.

You should it as a normal script:

ssh root@192.168.1.116 bash /root/BackupShellScript/remote.sh

And source /usr/local/etc/BackupShellScript/configuration.conf from your script, instead of hacking your way around with cat and process substitution.


Recently bumped into similar issue (Hotkeys respond lag, updating notification area player lags, Wi-Fi icon update slow, etc), looks like you need to run
/usr/lib/notification-daemon/notification-daemon
because for some reason it's not launching automatically.
The error is caused by libnotify trying to connect, see e.g.
https://bugs.archlinux.org/task/24052
In my case, I was running Unity, and I ran unity-settings-daemon --debug -r to diagnose; it was getting stuck emitting this message every time:

(unity-settings-daemon:3474363): libnotify-WARNING **: 01:12:15.195: Failed to connect to proxy


Port forwarding is so easy when you select NAT network in Virtualbox.

Host and Guest IP are assigned as base machine and VirtualBox IP respectively, so as in ports.


Free ISO Burner application uses up all the space on the disk when trying to burn the Ubuntu iso on a DVD

Your Ubuntu iso should not take up all the space on the DVD. It is possible that the program you used to burn the iso, Free ISO Burner, got to the last stage of the disk burning where it says something like Finalizing... and then tried to eject the disk automatically and failed, possibly due to some hardware issue with the optical drive. So Free ISO Burner started burning all over again and that's why it filled up the disk.

To solve this you have to watch the application when the disk is being burned, and when you get to the end close the application with the mouse and eject the DVD manually. I also recommend that instead of Free ISO Burner you use Windows Disc Image Burner for Windows 7/8/10 or Infra Recorder as ubuntu.com recommends at How to burn a DVD on Windows. The disk burning speed for most disk burning applications is set to Maximum by default. For burning an iso you should always set the disk burning speed to Minimum. Also you should watch the disk burning process carefully, and when you get to the end after the finalizing, you should close the application manually before it starts all over again.

If this seems nerve-wracking to you, there is another way to do it - you can write the Ubuntu to a USB flash drive of 2GB size or larger using an application called Rufus.  For Ubuntu 18.04 and later the USB flash drive should be 4GB or larger. For step-by-step instructions for how to create a bootable Ubuntu live USB for installing Ubuntu see this answer.


The sudo apt-get install nvidia-prime part of the linked answer installed an incompatible video driver.

I resolved this by:

booting into the advanced options from the grub menu,
selecting the first recovery mode option,
selecting the start networking option,
selecting the command prompt as root option

From the command prompt, I entered apt-get install nvidia-current
and installed compatible nvidia drivers.

This solution, or similar for different video cards, may help others with video driver problems.


Block Internet access and LAN Access for an endpoint at the gateway level through iptables

Nothing comes in or goes out.

iptables -A INPUT -j DROP -d IPADDRESS_of_client
iptables -A OUTPUT -j DROP -d IPADDRESS_of_client

iptables -A INPUT -j DROP -s IPADDRESS_of_client
iptables -A OUTPUT -j DROP -s IPADDRESS_of_client

/etc/init.d/iptables save

Some info below :
-A, --append
 -j, --jump target
-d, --destination


Problems with making a lamp database in ubuntu

The issue is the folder permission. Check the folder and file permissions of the application folder.As well as verify the path too.


Need Help For Completely Transfer in Ubuntu

Try Gimp.

GIMP is an advanced picture editor. You can use it to edit, enhance,
and retouch photos and scans, create drawings, and make your own
images. It has a large collection of professional-level editing tools
and filters, similar to the ones you might find in Photoshop. Numerous
fine-control settings and features like layers, paths, masks, and
scripting give you total control over your images.
Many image file formats are supported, including JPEG, Photoshop
(.psd), and Paint Shop Pro (.psp) files. It can also be used to scan
and print photos.

To install click Gimp
Source:Ubuntu Apps


Ubuntu, Windows both lag while running apps, playing videos, opening files stored on HDD

This is not because of Ubuntu or windows, it's because your HDD has some bad sectors, try to run a HDD test app like HDD Scan 3.3 to test it, then after you find the bad sectors use and app Like HDD Regenerator(free) to fix it.

if the bad sector is unrepairable, you can try to cut the part of HDD that has it, Make it unallocated.

If all the above doesn't help you fix your problem you have to buy a new HDD!

Note: I recommend using Hiren's BootCD for this Hiren's BootCD


enable auto-completion of apt-get for non-privileged user?

The function have() is defined in /etc/bash_completion, so it is not possible to execute /etc/bash_completion.d/apt in isolation.

I think you would need to run the command

. /etc/bash_completion

and it will then execute all the completion scripts in the /etc/bash_completion.d directory.

However, I'm not sure why you would need to do this anyway.  On my systems (natty and oneiric) completion for apt-get already works with or without sudo.


This can be caused by the adwaita-icon-theme package getting overwritten or otherwise altered.

Installing the latest version (as of the time of writing, 3.18.0-2ubuntu3.1 for Xenial) by running the below command may solve the problem:

sudo apt install --reinstall adwaita-icon-theme=3.18.0-2ubuntu3.1


How do I switch from linux-generic to linux-virtual?

No need to install linux-virtual anymore because it has the same dependencies as linux-generic except the package linux-firmware (compare these: http://packages.ubuntu.com/xenial/linux-virtual, http://packages.ubuntu.com/xenial/linux-generic). Also, see the answer here linux-image-virtual packages empty in 14.04 trusty?. But if you want to use it so that you have less packages installed then do this:

sudo apt-get install linux-virtual (you've already done that)
sudo apt-get autoremove --purge linux-generic
sudo apt-get remove --purge linux-firmware
sudo update-grub

The main packages linux-image-VERSION-generic and linux-headers-VERSION-generic will be the same.


trouble installing 16.04-system installation

Did you turn off all the extra ppas you might have added before the upgrade?  Did you remove the hold on the packages which are "held"?
For example:

sudo apt-mark unhold package_name

see How to prevent updating of a specific package? for other package managers.

Yes assuming dbus is the first package to unhold.


GParted accidentally deleted my /dev/sdb partition

What I did wrong

First mistake was using FAT32 and assuming you could save larger files. FAT32 does not have a journal, to make recovery/repair easier and cannot save files over 4GB. It may say you saved it but only first 4GB saved.

When gparted said it worked but did not show it, you should have immediately stopped an investigated why. May have needed chkdsk which is really slow on FAT32 as no journal.

Why this happened

Not sure, usually gparted works, but often better to use Windows tools for Windows & Linux tools for Linux. Then you do not blame Linux for corrupting a Windows file system.

How can I recover my data (I'm willing to open a hex editor and pick through it by hand)

You probably should use ddrescue or similar tools to image drive. Then you can use photorec which is part of testdisk to scan drive for anything that looks like a file. Since only one partition, you then could just try resetting partition table and see if chkdsk or dosfsck works.

How do I prevent this in the future?

I now like gpt as it has backup partition table over MBR(msdos), but Windows only boots in UEFI mode from gpt. Ubuntu can be UEFI or BIOS boot from gpt. I would suggest reinstalling Ubuntu rather than moving Windows. You then could move /home & data into new install easily before deleting old install. If you want a data partition for sharing data use NTFS.


Bash error when trying to execute a file

If all the permissions of the file are ok, as they seem to be, it might be because your partition is mounted with the noexec flag.

To check this: type mount and check if it is the case. You should see something like:

/dev/sdd1 on /media/banana type vfat (rw,noexec,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,shortname=mixed,errors=remount-ro)

(see the noexec there?)

Remount your partition with the noexec flag as so:

sudo mount -o remount,exec /media/banana

(you'll have to adapt the banana part to your case). And check that it worked by issuing mount again:

/dev/sdd1 on /media/banana type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,shortname=mixed,errors=remount-ro)

(no more noexec here!).

If that was your problem, you'll have to figure out the partition was mounted with the noexec flag in the first place.


Terminal is sort of supposed to be like that.

You can change the colour it appears as in the Edit menu, look for Profile Preferences.

The ~ represents the directory you are currently in. The ~ means that it is in your home directory. If you change the the directory the terminal is in:

cd ~/Desktop

Change to directory /home/USERNAME/Desktop

You will get:

If you were then to run ls, you will get the contents of the ~/Desktop folder, not including hidden files (starting with ., and ending with ~)

The other bit is in the format:

USERNAME@HOSTNAME

As you can see above, my username is wmobbs, and the computer's hostname is whm2.

You can find what the computer's hostname is by running:

cat /etc/hostname

Which will give the contents of the /etc/hostname file.

wmobbs@whm2:~$ cat /etc/hostname
whm2
wmobbs@whm2:~$

So the complete formula for it is:

USERNAME@HOSTNAME:/PATH/TO/DIRECTORY$

If you want to get dynamic colouring, like in the the above screenshot, change these lines:

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=no

in the ~/.bashrc file to:

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes

You should be abke to get rid of it by changing it to no, or comment it out by adding a # at the beginning.


Prompt not working when logged in as specific user

This happens if you created the user with the command

    useradd

You then need to create the users home directory and copy the files from /etc/skel into it. They are .bash_logout .bashrc  and .profile

If you use

    adduser

this is all done automatically.


Unable to login as root from the login screen even though I have a root account

Caveat: Don't do this unless you have a good reason

I store my home directory in lvm and occasionally need to unmount it to perform maintenance. It's much more convenient to login as root in those circumstances, as I can look up documentation online and browse the web while waiting for fsck.

By default, Ubuntu's greeter LightDM no longer supports logging in with an arbitrary username as it did in the past.

But this is still Linux, and we can configure this. Edit /etc/lightdm/lightdm.conf with root privileges and add this line:

[SeatDefaults]
greeter-show-manual-login=true

Reboot, and you can now login as any user by username including root.


How is a cubic root done in gnome-calculator?

The n-th root is calculated when you put a subscript number before the square root sign.

₃√27

To enter subscript numbers with the keyboard hold down Alt while entering the number.

E.g.

Go to Advanced mode
Press Alt while typing 3
Press √

and so on


Can't ssh or console to the guest using ubuntu-vm-builder

Though I still need to learn to do it via console, If you have a Workstation I would suggest installing virt-manager and connecting it to you KVM server and installing your guest through it, This is what i did and it was near painless, you will need the ISO of whichever your trying to install on the Server.

I did this on a Intel Dual core 2.0ghz with 4gb ram

To this day that VM is running my Website


Are there anywhere instructions explaining how to troubleshoot sound problems on the Ubuntu desktops?

Yes, there are: https://wiki.ubuntu.com/DebuggingSoundProblems

The first step on a current (10.04) distribution should be to run:

ubuntu-bug audio

in a terminal or after pressing Alt+F2.


Get ffmpeg

avconv and the counterfeit "ffmpeg" from Libav are buggy. Get a recent ffmpeg build. You have 4 main options:

Download a static build. Easy and fast, but can't be customized and does not support non-free stuff such as some encoders. Non-interfering with the system.
Compile. You can follow a copy & paste step-by-step guide. It will not interfere with the system.
Use a PPA (for Trusty users).
Upgrade to Ubuntu Vivid 15.04 or newer. Vivid contains ffmpeg 2.5.8 from FFmpeg. However, FFmpeg development is so active that you may still want to use a static build or compile.

Usage of static build

After you download and extract it you can use it like this (assuming it's in the Downloads directory in your home).

Include the full path:

/home/user/Downloads/ffmpeg -i …

or

~/Downloads/ffmpeg -i …

Or navigate to the directory containing ffmpeg and run:

./ffmpeg -i …

Or move it to a directory in your PATH. The ~/bin directory is one such location (assuming the same user will be executing ffmpeg).

Make a directory named bin in your home directory.
Move the ffmpeg binary to ~/bin.
Either run source ~/.profile, or simply log out then log in.
Now just run ffmpeg command in any terminal and it should just work.


How to parse/filter "last" command for displaying logins of a specific date in Ubuntu 14.04?

last offers the following options for that:

-s, --since time
              Display  the  state of logins since the specified time.  This is useful, e.g., to easily determine who was logged in at a particular time.
              The option is often combined with --until.
-t, --until time
              Display the state of logins until the specified time.
-p, --present time
              Display the users who were present at the specified time.  This is like using the options --since and --until together with the same time.

About the time format, the manpage says:

The options that take the time argument understand the following formats:

       YYYYMMDDhhmmss
       YYYY-MM-DD hh:mm:ss
       YYYY-MM-DD hh:mm      (seconds will be set to 00)
       YYYY-MM-DD            (time will be set to 00:00:00)
       hh:mm:ss              (date will be set to today)
       hh:mm                 (date will be set to today, seconds to 00)
       now
       yesterday             (time is set to 00:00:00)
       today                 (time is set to 00:00:00)
       tomorrow              (time is set to 00:00:00)
       +5min
       -5days

Here some examples:

last -s 2017-08-04           # from 2017-08-04 until today
last -s yesterday -t -120min # from yesterday until two hours ago
last -s -4days -t -2days     # from four days ago until two days ago
last -p 2017-08-04           # users present at 2017-08-04 00:00:00

Read more about last and its options on the manpage.


According to Ubuntu documentation, System Requirements are

Ubuntu Desktop Edition

512 MiB RAM (system memory)
5 GB of hard-drive space

Ubuntu Server (CLI) Installation

128 MiB of system memory (RAM)
1 GB of disk space

Lightweight GUI alternative (Xubuntu and Lubuntu)

512 MiB of system memory (RAM)
5 GB of disk space

Ubuntu Netbook Edition

386 MiB of system memory (RAM)
4 GB of disk space


How to remove Ubuntu and recover Windows after removing Windows in the first place?

Boot Gparted live disk,and then delete the Ubuntu partition.It will create an unallocated space,create a new ntfs partition from that unallocated space.

Now boot windows installation disk to install windows on the created ntfs partition by selecting the custom option during installation.

Note: Before deleting the ubuntu partition,make a backup of important datas.


How to make full domain controller with active directory?

you will have to follow the ubuntu server guide here

install dhcp,dns,ldap,kerberos and samba


How to make Samba require a password to access a printer?

I had a similar problem recently and the linked post in the singular comment above didn't actually answer the question posed here (setting up Windows with Samba authenticated printer shares, NOT the other way around).  I wanted to only allow authenticated access to printers shared from Linux.  In addition, I'm running Ubuntu Server LTS, which means command-line only access (via SSH in my case) so most tutorials/guides I'm finding show the Ubuntu GUI and are therefore useless to me.

The [printers] section with the option printable = yes defines the mapping to CUPS.  Setting browseable = no prevents this option from being displayed in printer lists.  It's the actual printer spool for print jobs, so that makes sense.  However, by default, anyone with a correctly configured printer setup pointed at and can access the Samba server has implicit access to print without privileges (i.e. anonymous access).  To force authenticated access to the print spooler, I used the valid users = bob, joe, mary option.

Windows looks for the print$ share name for printers.  The associated section [print$] declares browseable = yes, which grants anyone who connects to the Samba server the ability to see the available printers.  Even though guest ok = no is the default, Samba still allows what I consider to be anonymous access to any printer.  To force authentication, I used the valid users = bob, joe, mary option.  If you want to hide printers from being seen in the first place from unauthenticated users, you can try using browseable = no and then use the include = /etc/samba/print.%U.conf option to change browseable = yes for specific users as per this Unix StackExchange post:

https://unix.stackexchange.com/questions/245785/show-specific-samba-shares-only-to-some-users

Bringing it all together, /etc/samba/smb.conf now looks like:

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700
   valid users = bob, joe, mary

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
   valid users = bob, joe, mary

One side effect of requiring authentication that I ran into on Windows was that attempting to double-click on a printer to Open it (the default verb on Windows) as an unrecognized user caused an "Access Denied" message box to appear but was never prompted for credentials.  Windows was probably passing along that user's logged in Windows credentials in that instance.  Fortunately, right-clicking and selecting the "Connect..." option prompted for credentials.  After connecting successfully, I was able to Open the printer, which asked me to manually set up my printer drivers since I don't attempt to deliver those via Samba and is beyond the scope of the answer to this question.  Then I successfully printed a test page and all was well.


Save on webpage with command line like in google chrome

Thank you all for your suggestions!

What I need was --no-directories parameter to wget. Then I get one directory with all files I need (html file, images, css files).

Sorry, the question wasn't well formulated.


Ok, I went to NVIDIA X Server settings and selected the screen with the problem. On the "controls" tab I changed the "Color Space" from "RGB" to "YCbCr444" and it stopped the problems.


Unsuspend process that was not launched from terminal

You can run

kill -SIGCONT [pid]

or

killall -SIGCONT [process name]

to resume the process[es] with the specified PID or process name.


Possible things that can prevent execution of files are:

Security modules
mount options
binary files for a different architecture

Security modules

Things like AppArmor or SELinux can prevent executables from paths. This would be logged in the system logs I guess.

Mount options

Determine the filesystem where the binary is stored (I use df -T ./file_name and use the first column) and check mount | grep /dev/md2 to see if the noexec option is included

Architecture incompability

I use ldd ts3server_linux_x86 which might respond with

        not a dynamic executable

when the file isn't compatible with your system. My shell would respond with

zsh: no such file or directory: ./ts3server_linux_x86

if I try to execute a incompatible binary. Also like in this answer you can check with file ./file_name what architecture the binary was created at.


How can I take a screenshot of the login screen?

This blog might be helpful:
http://ptspts.blogspot.com/2010/02/how-to-create-screen-shot-of-gdm-login.html

Install ImageMagick for the image file format conversion below:

sudo apt-get install imagemagick

Create a helper script:

echo 'DISPLAY=:0 XAUTHORITY=/var/lib/gdm/:0.Xauth xwd -root' >/tmp/shot.sh

Make sure your login screen is active (log out or reboot the machine, and wait until you see the login screen).
Log in in text mode (by pressing Ctrl-Alt-F1), or using SSH.
Create the screen shot by running

sudo bash /tmp/shot.sh >/tmp/shot.xwd

You can log in now (by pressing Ctrl-AltF7 first to get back to the GDM login screen).
Convert the screen shot to JPEG and/or PNG:

convert -quality 50 /tmp/shot.xwd /tmp/shot.jpg
convert /tmp/shot.xwd /tmp/shot.png

View the screen shot in your favourite image viewer.


Cisco VPN connection using CertStore as in Windows

I am not sure about the use of certificates but I use Cisco vpns for connecting to work and I just import the .pcf files into netowrk-manager and the connection works.
Perhaps you can try that.

Else you may try installing the Cisco VPN client from cisco for Linux. Here's the tutorial for that. http://blog.bitengine.ca/?p=107


Hp elitebook 840 G3 Keyboard backlight not detected

Turn the backlight on or off
If your notebook computer has a backlit keyboard, press the F9, F5 or F4 (depending on your model) key on the keyboard to turn the light on or off. It might be necessary to press the Fn (function) key at the same time.
Look carefully on the keys· if a backlight icon is not on the F9, F5 or F4 key, then look for the backlit-key on the row of function keys.
Good luck!
Source: https://support.hp.com/in-en/document/c01612362


You can use nmcli and cron to bringing up connection at specific time.

First you create connection using Network-Manager.

Then start terminal to test some things

list all NM connections: nmcli con
start connection: nmcli con up id ConnectionName
down connection: nmcli con down id ConnectionName

If work, setup cron to trigger connection

sudo crontab -e

at the end add

45 10 * * * nmcli con up id bdc

this will trigger command every day at 10 h and 45 min.
In cron you can specify min, hour, day, month ...
Also you can start connectio every min

* * * * * nmcli con up id bdc

More example how to setup time in cron can find here


12.04 sudo testparm -s smb.conf.master >smb.conf fails on permsissions

Try this:

sudo bash

Then:

testparm -s smb.conf.master > smb.conf

It worked for me.


It has to be for security reasons, so a guest won't be able to  somehow "hack" the system and gain administrator rights, making changes which will break the OS.

What if a "guest" knows some kind of security hole and somehow logs in without knowing the password of root or another privileged user and log in using su? Then he/she may even run a rm -rf --no-preserve-root / and ruin the whole system!


Yep. You’ll want that i386-pc instance.
sudo grub-install -d /media/{DEVICE_GUID}/usr/lib/grub/i386-pc/ /dev/nvme0n1

This will install Grub on the device specified


Mine does appear, you have to wait a few seconds until the page is fully loaded.

However as I already fetch the ddl, you can wget it directly.

wget http://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/9505/wps-office_11.1.0.9505.XA_amd64.deb
sudo dpkg -i wps-office_11.1.0.9505.XA_amd64.deb

If you running 16.04 and later (which you should anyway), chances are you have snappy. Luckily wps also available in snap.

sudo snap install wps-office


Attempted to use Ubuntu to resize partitions, lost Windows 7

I'm guessing you ruined your windows MBR which can quite easily be fixed using your windows 7 CD, after which grub will be gone.


What GPARTED alternatives are available?

Popular terminal-based partition tools are:

parted
fdisk
cfdisk
sfdisk

BTW, to list it I just typed apropos partition. It's really handy command.


How to run Ubuntu 13.04 on an External Hard Drive?

In your case, GRUB is installed on internal HDD, and it's files are on external. It is BAD. You have to install GRUB on external HDD and Windows MBR on internal. Then set up GRUB entry in Windows. Here are the steps:

Plug external HDD, boot from it into Ubuntu and run command:

sudo grub-install /dev/sdb

where /dev/sdb is your external hard drive.
Unplug external HDD (for safety), reboot and run Windows installation DVD or Windows Repair CD. You can make one while you have Windows loaded.
Open command prompt and run:

bootrec /fixmbr

Other instructions recommend also run bootrec /fixboot, but in my case it just clears BCD store (so I cannot boot anywhere), so you should run it only if you have problems with booting into Windows.
Plug external HDD and boot into Windows. From there, run EasyBCD and set up GRUB entry for your external HDD. This should be easy. If not, there is instruction.

After this, you can boot from both internal and external HDDs. Other way is to move /boot partition onto your internal HDD and use GRUB, but it is a little bit more complicated solution.


Realtek RTL8723BE Card Wifi hard blocked after waking up from suspend in Ubuntu

On 16.04, I see this after suspend too. But I don't need to reboot. I can just reload the kernel module (driver):

sudo modprobe -rv r8723bs && sudo modprobe -v r8723bs

Not required to restart network-manager or nm-applet.

I use kernel 4.14.7 & 4.15.7 on a Lenovo ideapad 100S.

Newer kernels can be found in mainline ppa, eg:
https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15.7/


Same problem. Using Ubuntu 11.10 with gnome shell on Asus 1225B netbook. I have another Laptop with Ubuntu 11.10 Unity where this problem does NOT occur. So I think this is a gnome shell issue.

I use a bunch of configuration tools on my netbook, I guess that one of them is also able to change the shortcut configuration, but has the default one saved, so maybe you reset the shortcut configuration using this tool to change login sound or whatever. I have my netbook for a few days so I was not able to check this.