Why does lsof show the same file descriptor for different processes?

That means these process can reach the same memory space.

Why would they want to reach a common memory space? The answer's simple -- to talk to each other!

In your case, dropbox is talking to gnome-panel, which provides the Dropbox status icon.

The libc manual has this to say:

  The major use of duplicating a file descriptor is to implement redirection of input or output: that is, to change the file or pipe that a particular file descriptor corresponds to.

The u flag simply means that the FD is read-write; w means write-only, r means read-only.


You're having a memory leak. Either you should check if the drivers aren't compatible with the new linux kernel or there is a program that you've recently installed that is hogging the system.
What I can suggest to you is to load back the basic graphics driver and check for possibilities if there where programs that you've recently installed is causing the issue or wait till an update fixes it (Driver update) or you can load back to the previous versions which didn't gave you this issue.


Is /etc/X11/xinit/xinitrc. supposed not to exist?

If you have the xinit package, the file you mention should be installed.

$ dpkg -L xinit | grep xinitrc
/etc/X11/xinit/xinitrc
$

If it's not, these commands ought to fix it:

sudo apt-get purge xinit
sudo apt-get install xinit


What is the purpose of filesystem.size on a LiveCD?

filesystem.size is needed when a LiveCD is used to perform installation.

Ubuntu Community Wiki Help has documented briefly in this page: LiveCDCustomization. Refer to the content under 8. Producing the CD image - Assembling the file system.

  Update the filesystem.size file, which is needed by the installer:

sudo su
printf $(du -sx --block-size=1 edit | cut -f1) > extract-cd/casper/filesystem.size
exit

Jump to the content by using Find in This Page... in the web browser: Press Ctrl+F and type filesystem.size as the keyword. That is all.


Use Google Open ID to automatically create accounts/login to Ubuntu

I found something here but it comes with a few warnings:

Never install a PPA just because someone tells you (including me) PPA's are one vector to get malware on your PC.  Use your own personal judgement!

That being said, a PPA with 1000s of users like PPA:Launchpad/TuxOnIce is a bit better then PPA:Maffia.It/BotNet with a couple of 100 users.
The technology looks sound, but I have my personal reservations on allowing internal machines on your internal network to be authenticated by an external server: too many vectors for a Man-in-the-middle Attack.
The PAM above is written in Python, an interpreted language with full source code available to the end-user, so harden not only the server but also the clients.
I could go on and on like this, but then it would sound more like consultancy (thus work)


Maintaining custom left/right audio balance (i.e. ratio) when changing volume level

You can increase or decrease the volume by dB which is a ratio, for example:

pactl -- set-sink-volume @DEFAULT_SINK@ +5dB

As far as I can see with

$ pactl list sinks | grep balance
        balance -0.50

the balance will remain constant while changing the volume by dB.

Here the relevant part of man pactl:

  set-sink-volume SINK VOLUME [VOLUME ...]
          Set  the volume of the specified sink (identified by its symbolic name or numerical
          index). VOLUME can be specified as an integer (e.g. 2000, 16384), a  linear  factor
          (e.g.  0.4,  1.100),  a  percentage  (e.g. 10%, 100%) or a decibel value (e.g. 0dB,
          20dB).


There is now only a single proxy setting that applies to all types of traffic.

This is by design and as a result of changes in the underlying libtorrent library. In Deluge 1.3 for simplicity, the other types are greyed-out to prevent any bugs.

Reference: 1.3.15 Release Notes


How to set default route with netplan, Ubuntu 18.04 server, 2 NIC

The issue is that networkd will bring up both networks, and both will have a default gateway set, and both will be at the same metric.

Netplan does not currently allow you to skip setting the route on one interface, but you can configure networkd separately to tell it to do this, by basing the config on what netplan has already generated.

I have copied the commands below. Here I am assuming that ens19 is the "secondary" interface for which you do not want a default gateway set -- note that to do this successfully, it also needs to happen before rebooting with the new interface (or you can copy part of the config, omit the MACAddress= line, etc. so that it's generic enough that a new interface will be matched).

sudo cp /run/systemd/network/10-netplan-ens19.network /etc/systemd/network
sudo vi /etc/systemd/network/10-netplan-ens19.network

Then add under [DHCP]:

UseRoutes=false            # if you don't want to apply any routes from DHCP

RouteMetric=200        # any number above 100 if you want the routes applied, but that they are less preferred.

If you don't have the file yet (ie. you have not attached the interface yet) then you could copy the contents of another interface set for DHCP, and remove MACAddress=.

In general, the file should look something like this:

[Match]
Name=interfacename

[Network]
DHCP=ipv4

[DHCP]
UseMTU=true
RouteMetric=200    # or UseRoutes=false, as you prefer.


Where can I find the 'build' command needed to build the environment for EDK 2?

The solution is to use

bash:~/src/edk2$ source edksetup.sh

bash:~/src/edk2$ build

The effect of export command inside edksetup.sh is not reflected in the main bash shell but rather in the sub-shell spawned for executing it. "source" directs it to run the script in current shell.


How to control fans on Gigabyte Z390 AORUS MASTER?

In latest motherboards you can manage fans in BIOS. If you can't find fan control in BIOS, take a look at firmare updates for your MB.


Alternative to running rmmod and modprobe at every boot

Add to /etc/modules, one module per line.


Yes.

Do ctrl+alt+fN where N is a number between 1 and 9 other than 7. For example: F2. It will drop you to text login. put in the username and password and at the prompt type "startx" (without the quotes). To get back to your main (default) login hit ctrl+alt+F7.


Why isn't my "Launchpad Registration" accomplishment showing up?


How do I prevent the Sleep button from locking the screen

You can remap the key using ~/.Xmodmap. Use xev (in a terminal) to find the offending keycode, then assign a different keysym, e.g. XF86WakeUp. Append this line to ~/.Xmodmap (create that file if it does not yet exist):

keycode 150 = XF86WakeUp

After logging out and logging in again your key should be mapped. If you don't want to log out, you can also use xmodmap ~/.Xmodmap to reload the key mappings.

Using xev to actually find the keycode of the key that you want to remap might be not so easy: if the key is already bound to an action (e.g. in the Gnome keyboard properties), xev does not show the keycode. As an example, this is the kind of xev output that you want to see:

KeyPress event, serial 41, synthetic NO, window 0x5800001,
    root 0xb3, subw 0x0, time 312883, (737,182), root:(946,647),
    state 0x0, keycode 180 (keysym 0x1008ff18, XF86HomePage), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

You can see the keycode (180) in the third line after the word "keycode". If you don't get such a block that starts with "KeyPress event", your key probably is already bound. You can try to use a non-Gnome desktop like LXDE or KDE and use xev there.


OK, I managed myself to do the same you did, but with some changes:

1) I installed the same utilities:

sudo apt-get install cgroup-bin cgroup-lite cgroup-tools cgroupfs-mount libcgroup1

2) I edited conf files like this:

/etc/init/cgroup-lite.conf

description "mount available cgroup filesystems"
author "Serge Hallyn <serge.hallyn@canonical.com>"

start on mounted MOUNTPOINT=/sys/fs/cgroup

pre-start script
test -x /bin/cgroups-mount || { stop; exit 0; }
test -d /sys/fs/cgroup || { stop; exit 0; }
/bin/cgroups-mount
cgconfigparser -l /etc/cgconfig.conf
end script

post-stop script
if [ -x /bin/cgroups-umount ]
then
    /bin/cgroups-umount
fi
end script

/etc/cgconfig.conf

# Since systemd is working well, this section may not be necessary.
# Uncomment if you need it
#
# mount {
# cpuacct = /cgroup/cpuacct;
# memory = /cgroup/memory;
# devices = /cgroup/devices;
# freezer = /cgroup/freezer;
# net_cls = /cgroup/net_cls;
# blkio = /cgroup/blkio;
# cpuset = /cgroup/cpuset;
# cpu = /cgroup/cpu;
# }

group limitcpu{
  cpu {
    cpu.shares = 400;
  }
}

group limitmem{
  memory {
    memory.limit_in_bytes = 512m;
  }
}

group limitio{
  blkio {
    blkio.throttle.read_bps_device = "252:0         2097152";
  }
}

group browsers {
    cpu {
#       Set the relative share of CPU resources equal to 25%
    cpu.shares = "256";
}
memory {
#       Allocate at most 512M of memory to tasks
        memory.limit_in_bytes = "512m";
#       Apply a soft limit of 512 MB to tasks
        memory.soft_limit_in_bytes = "384m";
    }
}

group media-players {
    cpu {
#       Set the relative share of CPU resources equal to 25%
        cpu.shares = "256";
    }
    memory {
#       Allocate at most 256M of memory to tasks
        memory.limit_in_bytes = "256m";
#       Apply a soft limit of 196 MB to tasks
        memory.soft_limit_in_bytes = "128m";
    }
}

cgconfigparser -l /etc/cgconfig.conf

And /etc/cgrules.conf

user:process                                         subsystems   group
[user]:/usr/lib/chromium-browser/chromium-browser   cpu,memory      browsers
[user]:/usr/bin/clementine                        cpu,memory     media-players

That is an example, use your username instead of [user]. You can add the applications you need to limit and define whether you want them to be CPU-, memory- or both limited.

I edited the GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="cgroup_enable=memory swapaccount=1"

Updating it:

sudo update-grub

3) And finally rebooting to apply changes.

And that is how I've got this working. Before this I was having frequent OOMs with multitasking - with chromium-browser, clementine, sublime-text and other applications using a lot of resources -, now they are running smoothly and I can multitask better.

I really hope this may help others.

Currently using Ubuntu 16.04 LTS with Intel Dual Core 2.6 Ghz and 4 Gb. RAM.


installing application on live Ubuntu off a dvd

Yes.  You have a real session when running Try Ubuntu.  The limitation is the drive size and the fact that every time you boot you will start over fresh.

The drive is a ram drive created from the available ram in your system.  If you have 8 gigs in your system. of course that would limit the drive size drastically.  When you subtract the amount of ram needed for actual system ram for applications you won't have much left.  That means you are very limited with how much you can download and install from the repositories.

Other than those two limitations, there isn't any significant difference between a full install and the Try session.

The try ubuntu option to browse around and get a feel for using Ubuntu.  Many useful programs and tools are installed in the environment by default.

With the limited amount of drive space you won't be able to install much more.  As per your comment, these are the steps to install vlc.

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install vlc


Kubuntu - Roccat keyboard does not work under GRUB and works partially in BIOS

Thanks for the answer, but I have already solved the problem (after contacting ROCCAT and MSI): it was a Z77 chipset problem.

Some manufacturers already solved the problem - f.x. ASRock.
MSI has developed a beta BIOS release.
BIOS beta, flashing instructions and whole discussion is available here:
http://forum-en.msi.com/index.php?topic=162249.0

Works perfect allowing you to enter the BIOS, navigate in the BIOS and navigate in the GRUB.


Failed to open a session for the virtual machine win-7

Shutdown all your VM's.

Go to your /home/$user/.VirtualBox/ folder
Find the file VirtualBox.xml-prev
mv VirtualBox.xml VirtualBox.xml.bak
mv VirtualBox.xml-prev VirtualBox.xml

If this fails, you can reverse it with rm VirtualBox.xml && mv VirtualBox.xml.bak VirtualBox.xml

Try restarting VirtualBox

Other possible fixes:

sudo /etc/init.d/vboxdrv setup

or

sudo dpkg-reconfigure virtualbox-dkms


most likely it is because your 'maas' user is not a member of the libvirt group. Try adding the user with:

sudo adduser maas libvirtd

and see if that makes any difference. If not, it may well depend on what version of Ubuntu you are running and/or what version of MAAS you have installed, so please add these to the question!


stderr of terminal in red, even with sudo

This is because sudo command runs command in its own subshell, started by root. This means that your ~/.bashrc file is ignored. It also means that any environment variables defined in the parent shell (such as the LD_PRELOAD you are setting in ~/.bashrc) are not passed to the sudo shell. This is explained in man sudoers:

  By default, the env_reset option is enabled.  This causes commands to
  be  executed with a new, minimal environment.  On AIX (and Linux
  systems  without PAM), the environment is initialized with the
  contents of the  /etc/environment file.  The new environment contains
  the TERM, PATH,  HOME, MAIL, SHELL, LOGNAME, USER, USERNAME and SUDO_*
  variables in addition to variables from the invoking process
  permitted by the env_check  and env_keep options.  This is effectively
  a whitelist for environment  variables.

I couldn't get the env_keep option to work here, I don't know why. The best way I could find of passing the variable to sudo is to create a file (for example /path/to/foo) with this line:

LD_PRELOAD="/home/terdon/Setups/stderred/build/libstderred.so"

Then, run sudo visudo and add this line:

Defaults        env_file="/path/to/foo"

That will cause sudo to read /path/to/foo and add any variable definitions there to its environment.


How do I map SysReq to a key on my MacBook keyboard?

This is an easy task once you know how to do it.

1) Check the keycode of yours key. Run this program at terminal.

xev

At this example, the terminal shows that the keycode for my k is "45".

2) Change them as you like creating this file:
 gedit ~/.Xmodmap

It's contents should look like this example:

(Obs.: if I want to change my k I should use "keycode 45" as showed at step "1").

4) Logout and log back in or reboot or run this:

xmodmap ~/.Xmodmap

Hope you enjoy ;-)


If you're not certain about security considerations when running Apache, you probably don't want to install Apache from source. I'd recommend installing Apache with sudo apt-get install apache2 or through the Software Center.

Installing Apache with aptitude will automatically register Apache as a system service, which solves the problem of running Apache in a reasonably secure way, as long as your system configuration isn't highly customized.


Split partition with Ubuntu 13.04 and windows 7

From my experience:

Make a note of how much "stuff" you've installed on your hard drive. In GB

You should install Ubuntu, but stop when it tells you "Partition Disks"

Choose Manual Partition. YOU MUST UNMOUNT your drives.

Then from the list of partitions, select your HardDrive. It is usually as big as the advertized size.

Edit the size and make sure the size at least more than your current occupied space.

ie: 250/500 Gb, resize: 300 GB.

Then, after you follow its directions, it should let you save and create a separate partition.

Then, you change the new partition (probably called sd5) and create a split partition of around 4GB RAM. Just do the same as you did previously.

After you are done, you should have create 2 separate partitions.

You will use these partitions.

*Select the bigger partition that you created - NOT the one labeled ntsf. You want to edit it. Then change from "do not use" or what option there is to "ext2", "ext3", or "ext4". This is the first option from the editor. Save. *

Next, select the smallest partition that you created. It should be the last partition (ie sda6).

You want to edit it. Then change from "do not use" or what option to "swap". This is your "RAM". Not really, but it is recommended.

*MAKE SURE that all other partitions are unchanged and marked "do not use". *

Next save and continue. It will then ask if it can format the disks. You must format your 2 partitions. And that is where Ubuntu will install the OS.

Continue thus from.


Upgrading to Ubuntu Wiley unstable, I found this working as expected. The problem was that I was using Ubuntu 14 with Bluez 4.x

Any BlueZ version 5.x will allow the use of bluetoothctl. 4.x has been deprecated for a while. For more information about BlueZ and its use, check my questions and answers on stackoverflow.


How to move several folders using double wildcard?

Globs are not expanded inside quotes - you'd need something like
./*".txt)(1)(m"*

or
./*.txt")(1)("m*

or
./*.txt\)\(1\)\(m*


Grub Rescue Error while boot windows 7 laptop

You would need Linux installed to properly configure grub.  When you install Ubuntu grub will install a default configuration that will include all your Windows and Linux OSes that are installed.

If you don't have any installed (as per your reference to having reformatted the drive) the boot can't continue.

If you're having problems installing Ubuntu on your freshly formatted drive, we can try to identify this problem after you boot to the install disk.

If it's Windows 7 that you are trying to install you a forum relating to Windows such as http://superuser.com can walk you thought those steps, which should be basically the same... boot to the Windows Install disk and proceed from there.  Windows will install a different boot manager from Grub.


Is is possible to install Ubuntu on a computer with no OS

As it's a gaming rig, the key questions are "Will my games run under Linux, or do I need Windows?" and "Does Linux support my hardware (especially my graphics card)?" If you need Windows and have only one HDD in your system it's much easier to instal Windows first and then put Ubuntu on afterwards. There is plenty of help and advice about how to do this in the Ubuntu forums and elsewhere on the internet.

If you don't need Windows then go right ahead and instal from DVD or USB stick. This is what I did with my new build, which wasn't a gaming rig. I just went with Ubuntu's suggested options and all went fine.


How do I install Ubuntu on a computer that has a faulty version of Windows XP

If you only have 256 MB RAM I would use Lubuntu. This is a flavour of Ubuntu that uses the fewest resources. You may even want to try something else than Ubuntu.

256 MB RAM is really small. Even Windows XP (with all updates) would be really slow. Maybe you can try to upgrade it to 512 MB.

Also, some more information about your system would be nice.

To install it you'll have to use a CD or USB drive. I think a CD will be the best choice as older systems are usually not able to boot from USB.

You can download the ISO from the Lubuntu website and burn it on CD using ImgBurn (or another program that can burn ISO images). Don't just drop the ISO file itself on the CD as it will not be bootable that way.

Then you'll have to start your computer from the CD. This is usually done by pressing F2 or DEL just after you power on your computer.

Search for something called Boot Order and make sure CD is on top. Then save and exit. Your PC will now start from CD.

Just follow the on-screen instructions. If you have any questions you can leave a comment.

Ubuntu has an internet browse (Firefox) and a office suite (LibreOffice: including Word and Excel) built in.

LibreOffice is not the same as Microsoft Office, but you can view and edit Microsoft Office documents with it.

I think Ubuntu also has an email client built in (Evolution) but I'm not sure about that. If it hasn't you can always easily install it using the following command in the terminal or use Ubuntu's Software Center:

sudo apt-get install evolution

I think you'll get used to Ubuntu faster than you think, especially if you're only using internet, email and office.

You can backup your important files to an USB drive by choosing Try Ubuntu when you boot from your Ubuntu CD (do this before installing Ubuntu).

Ubuntu will start a live environment. Open a file manager and on the left you'll see all your hard disks. Click on Windows to open your Windows files (the name may be different, just try them all).

Your files will be in Documents and Settings/UserName. You can just drag them to your USB drive.


I can't get my snow leopard mac to boot from thumb drive

Do not boot straight from the drive. It would lead you right into a dead end. Use boot camp to partition your hard drive as if for windows, but just install Ubuntu to that partition. To make a proper thumb drive (in case you didn't make it properly), do the following: open disk utiltiy, locate your thumb drive, erase it to fat32, mount the fresh .iso file, drag the virtual drive for the .iso to the source, drag the now erased thumb drive to the destination, and click restore. Now, for booting into it, I don't know much from there because I went hackintosh with my Dell Latitude D620.


Ubuntu 18.04 Installer crashes on Dell XPS 15 9560

You are experiencing Bug #1751252.

There are two options to remedy this:

Option 1: Install a newer fixed version of ubiquity

Boot your 18.04 Live ISO
Select Try Ubuntu
Before you start the Ubiquity installer, open a Terminal window (CTRL-ALT-T)
Execute the following command in the Terminal to see which version of ubiquity you have

dpkg -l ubiquity

||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  ubiquity       18.04.14     amd64        Ubuntu live CD installer

If the version is 18.04.14, execute the following to update ubiquity

sudo apt update
sudo apt install ubiquity

Verify that ubiquity has been upgraded to version 18.04.14.1 (note the .1 at the end)

dpkg -l ubiquity

||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  ubiquity       18.04.14.1   amd64        Ubuntu live CD installer

Start the installer by clicking on the Ubiquity icon, and it should now allow you to proceed through the installation

Option 2: Apply a patch to ubiquity

Boot your 18.04 Live ISO
Select Try Ubuntu
Before you start the Ubiquity installer, open a Terminal window (CTRL-ALT-T)
Execute the following commands in the Terminal to download and apply the patch

cd ~/Downloads

wget https://code.launchpad.net/~azzar1/ubiquity/+git/ubiquity/+merge/345056/+preview-diff/831305/+files/preview.diff --output-document ubiquity.patch

sudo cp /usr/lib/ubiquity/ubiquity/misc.py /usr/lib/ubiquity/ubiquity/misc.py.original

sudo patch /usr/lib/ubiquity/ubiquity/misc.py ubiquity.patch

Start the installer by clicking on the Ubiquity icon, and it should now allow you to proceed through the installation


Installing newer driver to current kernel

It turns out to be it is highly unrecommended to upgrade kernel beyond what is provided by the Ubuntu repositories. And it is fairly simple to upgrade a single module with Backports. Backports are simply kernel modules provided by the Backports team of linux. Here you can find packages from various versions of the kernel and compile. Specifically, for the iwlwifi, here is a solution, which most likely also works for other modules. So far my wifi has been working without drops.


you need to use this:

 sudo -i
 grub-mkconfig
 update-grub2
 fsck.ex4 -b 8079
 efibootmgr /boot/initrd.img-3.19.0-15-generic

and it might work fine this way.


ubuntu 18.042LTS wont reboot without instillation software

I reset my cmos & that fixed my bios problem.
The plain Ubuntu boots from legacy which my pc doesn't like.
I then booted from UEFI Ubuntu which worked.
Setting efi as boot loader caused my pc to reboot to the Grub screen.
[code] I then set /boot  as the bootloader which solved the problem[/code]

Thanks Grabriella


Once it stutters I always got rid of this problem by killing/restarting pulseaudio.

sudo killall pulseaudio
sudo pulseaudio --system=1 --daemonize
Close and re-open chromium


What does each governor mean on my device?

CPU frequency and voltage scaling code in the Linux(TM) kernel

             L i n u x    C P U F r e q

          C P U F r e q   G o v e r n o r s

       - information for users and developers -

        Dominik Brodowski  <linux@brodo.de>
        some additions and corrections by Nico Golde <nico@ngolde.de>
    Rafael J. Wysocki <rafael.j.wysocki@intel.com>
       Viresh Kumar <viresh.kumar@linaro.org>

Clock scaling allows you to change the clock speed of the CPUs on the
fly. This is a nice method to save battery power, because the lower
the clock speed, the less power the CPU consumes.
Contents:

What is a CPUFreq Governor?

Governors In the Linux Kernel
2.1  Performance
2.2  Powersave
2.3  Userspace
2.4  Ondemand
2.5  Conservative
2.6  Schedutil

The Governor Interface in the CPUfreq Core

References

What Is A CPUFreq Governor?
==============================

Most cpufreq drivers (except the intel_pstate and longrun) or even most
cpu frequency scaling algorithms only allow the CPU frequency to be set
to predefined fixed values.  In order to offer dynamic frequency
scaling, the cpufreq core must be able to tell these drivers of a
"target frequency". So these specific drivers will be transformed to
offer a "->target/target_index/fast_switch()" call instead of the
"->setpolicy()" call. For set_policy drivers, all stays the same,
though.
How to decide what frequency within the CPUfreq policy should be used?
That's done using "cpufreq governors".
Basically, it's the following flow graph:
CPU can be set to switch independently   |     CPU can only be set
within specific "limits"       |       to specific frequencies
                             "CPUfreq policy"
    consists of frequency limits (policy->{min,max})
         and CPUfreq governor to be used
         /            \
        /              \
           /               the cpufreq governor decides
          /                (dynamically or statically)
         /                 what target_freq to set within
        /                  the limits of policy->{min,max}
       /                        \
      /                  \
Using the ->setpolicy call,      Using the ->target/target_index/fast_switch call,
    the limits and the            the frequency closest
     "policy" is set.             to target_freq is set.
                      It is assured that it
                      is within policy->{min,max}

Governors In the Linux Kernel
================================

2.1 Performance
The CPUfreq governor "performance" sets the CPU statically to the
highest frequency within the borders of scaling_min_freq and
scaling_max_freq.
2.2 Powersave
The CPUfreq governor "powersave" sets the CPU statically to the
lowest frequency within the borders of scaling_min_freq and
scaling_max_freq.
2.3 Userspace
The CPUfreq governor "userspace" allows the user, or any userspace
program running with UID "root", to set the CPU to a specific frequency
by making a sysfs file "scaling_setspeed" available in the CPU-device
directory.
2.4 Ondemand
The CPUfreq governor "ondemand" sets the CPU frequency depending on the
current system load. Load estimation is triggered by the scheduler
through the update_util_data->func hook; when triggered, cpufreq checks
the CPU-usage statistics over the last period and the governor sets the
CPU accordingly.  The CPU must have the capability to switch the
frequency very quickly.
Sysfs files:

sampling_rate:
Measured in uS (10^-6 seconds), this is how often you want the kernel
to look at the CPU usage and to make decisions on what to do about the
frequency.  Typically this is set to values of around '10000' or more.
It's default value is (cmp. with users-guide.txt): transition_latency

Be aware that transition latency is in ns and sampling_rate
is in us, so you get the same sysfs value by default.  Sampling rate
should always get adjusted considering the transition latency to set
the sampling rate 750 times as high as the transition latency in the
bash (as said, 1000 is default), do:

$ echo `$(($(cat cpuinfo_transition_latency) * 750 / 1000)) > ondemand/sampling_rate

sampling_rate_min:
The sampling rate is limited by the HW transition latency:
transition_latency * 100
Or by kernel restrictions:

If CONFIG_NO_HZ_COMMON is set, the limit is 10ms fixed.
If CONFIG_NO_HZ_COMMON is not set or nohz=off boot parameter is
used, the limits depend on the CONFIG_HZ option:
HZ=1000: min=20000us  (20ms)
HZ=250:  min=80000us  (80ms)
HZ=100:  min=200000us (200ms)

The highest value of kernel and HW latency restrictions is shown and
used as the minimum sampling rate.

up_threshold:
This defines what the average CPU usage between the samplings of
'sampling_rate' needs to be for the kernel to make a decision on
whether it should increase the frequency.  For example when it is set
to its default value of '95' it means that between the checking
intervals the CPU needs to be on average more than 95% in use to then
decide that the CPU frequency needs to be increased.

ignore_nice_load:
This parameter takes a value of '0' or '1'. When set to '0' (its
default), all processes are counted towards the 'cpu utilisation'
value.  When set to '1', the processes that are run with a 'nice'
value will not count (and thus be ignored) in the overall usage
calculation.  This is useful if you are running a CPU intensive
calculation on your laptop that you do not care how long it takes to
complete as you can 'nice' it and prevent it from taking part in the
deciding process of whether to increase your CPU frequency.

sampling_down_factor:
This parameter controls the rate at which the kernel makes a decision
on when to decrease the frequency while running at top speed. When set
to 1 (the default) decisions to reevaluate load are made at the same
interval regardless of current clock speed. But when set to greater
than 1 (e.g. 100) it acts as a multiplier for the scheduling interval
for reevaluating load when the CPU is at its top speed due to high
load. This improves performance by reducing the overhead of load
evaluation and helping the CPU stay at its top speed when truly busy,
rather than shifting back and forth in speed. This tunable has no
effect on behavior at lower speeds/lower CPU loads.

powersave_bias:
This parameter takes a value between 0 to 1000. It defines the
percentage (times 10) value of the target frequency that will be
shaved off of the target. For example, when set to 100 -- 10%, when
ondemand governor would have targeted 1000 MHz, it will target
1000 MHz - (10% of 1000 MHz) = 900 MHz instead. This is set to 0
(disabled) by default.
When AMD frequency sensitivity powersave bias driver --
drivers/cpufreq/amd_freq_sensitivity.c is loaded, this parameter
defines the workload frequency sensitivity threshold in which a lower
frequency is chosen instead of ondemand governor's original target.
The frequency sensitivity is a hardware reported (on AMD Family 16h
Processors and above) value between 0 to 100% that tells software how
the performance of the workload running on a CPU will change when
frequency changes. A workload with sensitivity of 0% (memory/IO-bound)
will not perform any better on higher core frequency, whereas a
workload with sensitivity of 100% (CPU-bound) will perform better
higher the frequency. When the driver is loaded, this is set to 400 by
default -- for CPUs running workloads with sensitivity value below
40%, a lower frequency is chosen. Unloading the driver or writing 0
will disable this feature.

2.5 Conservative
The CPUfreq governor "conservative", much like the "ondemand"
governor, sets the CPU frequency depending on the current usage.  It
differs in behaviour in that it gracefully increases and decreases the
CPU speed rather than jumping to max speed the moment there is any load
on the CPU. This behaviour is more suitable in a battery powered
environment.  The governor is tweaked in the same manner as the
"ondemand" governor through sysfs with the addition of:

freq_step:
This describes what percentage steps the cpu freq should be increased
and decreased smoothly by.  By default the cpu frequency will increase
in 5% chunks of your maximum cpu frequency.  You can change this value
to anywhere between 0 and 100 where '0' will effectively lock your CPU
at a speed regardless of its load whilst '100' will, in theory, make
it behave identically to the "ondemand" governor.

down_threshold:
Same as the 'up_threshold' found for the "ondemand" governor but for
the opposite direction.  For example when set to its default value of
'20' it means that if the CPU usage needs to be below 20% between
samples to have the frequency decreased.

sampling_down_factor:
Similar functionality as in "ondemand" governor.  But in
"conservative", it controls the rate at which the kernel makes a
decision on when to decrease the frequency while running in any speed.
Load for frequency increase is still evaluated every sampling rate.

2.6 Schedutil
The "schedutil" governor aims at better integration with the Linux
kernel scheduler.  Load estimation is achieved through the scheduler's
Per-Entity Load Tracking (PELT) mechanism, which also provides
information about the recent load [1].  This governor currently does
load based DVFS only for tasks managed by CFS. RT and DL scheduler tasks
are always run at the highest frequency.  Unlike all the other
governors, the code is located under the kernel/sched/ directory.
Sysfs files:

rate_limit_us:
This contains a value in microseconds. The governor waits for
rate_limit_us time before reevaluating the load again, after it has
evaluated the load once.

For an in-depth comparison with the other governors refer to [2].

The Governor Interface in the CPUfreq Core
=============================================

A new governor must register itself with the CPUfreq core using
"cpufreq_register_governor". The struct cpufreq_governor, which has to
be passed to that function, must contain the following values:
governor->name - A unique name for this governor.
governor->owner - .THIS_MODULE for the governor module (if appropriate).
plus a set of hooks to the functions implementing the governor's logic.
The CPUfreq governor may call the CPU processor driver using one of
these two functions:
int cpufreq_driver_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation);
int __cpufreq_driver_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation);
target_freq must be within policy->min and policy->max, of course.
What's the difference between these two functions? When your governor is
in a direct code path of a call to governor callbacks, like
governor->start(), the policy->rwsem is still held in the cpufreq core,
and there's no need to lock it again (in fact, this would cause a
deadlock). So use __cpufreq_driver_target only in these cases. In all
other cases (for example, when there's a "daemonized" function that
wakes up every second), use cpufreq_driver_target to take policy->rwsem
before the command is passed to the cpufreq driver.

References
=============

[1] Per-entity load tracking: https://lwn.net/Articles/531853/
[2] Improvements in CPU frequency management: https://lwn.net/Articles/682391/
source : https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt


I have solved this with a Boot-Repair disk (I put it on a USB flash-pen, but one can burn it on a disk if necessary). I had used the program mainly to repair the grub in linux, but it has an option to repair the MBR.

So, boot into the Boot Repair disk/usb, and check "Restore MBR" (instead of "Reinstall GRUB").

It works fine, the normal boot in Win7 is back in place.


Yep. 12.04 remains 700mb-cd size,you can copy installation files to it and boot to install(extract ISO image)


trouble pairing bluetooth headphones 16.04

See the bug report and use the a2dp.py file to switch it to the high quality A2DP audio.

A possible alternative using Blueman is to switch the headphones to the off profile, then disconnect, reconnect and switch to the A2DP profile


mysql statement in bash shell script does not work / syntax error

Your file names should be escaped with quotes - MySQL considers them strings, so your MySQL block should be:

LOAD DATA LOCAL INFILE '$RDDATEI'
  INTO TABLE bv_tmp_all FIELDS TERMINATED BY ';';
SELECT * FROM bv_tmp_all GROUP BY BAN
  INTO OUTFILE '$bv_out_distinct' FIELDS TERMINATED BY ';';
LOAD DATA LOCAL INFILE '$bv_out_distinct'
  INTO TABLE bv_tmp_distinct FIELDS TERMINATED BY ';';
UPDATE bv, bv_tmp_distinct
  SET bv.RD=bv_tmp_distinct.RD,bv.LEV21=bv_tmp_distinct.LEV21
  WHERE bv.BAN=bv_tmp_distinct.BAN;
SELECT * FROM bv_tmp_distinct
  WHERE BAN NOT IN (SELECT BAN FROM bv)
  INTO OUTFILE '$bv_out_load_new_bvs' FIELDS TERMINATED BY ';';
LOAD DATA LOCAL INFILE '$bv_out_load_new_bvs'
  INTO TABLE bv FIELDS TERMINATED BY ';';
TRUNCATE TABLE bv_tmp_distinct;
TRUNCATE TABLE bv_tmp_all;


Ubuntu book/pdf that could help learn the terminal

I'll go out on a limb, and suggest the Ubuntu manual.  I am assuming that you are running the stock distribution, and not a variant such as kubuntu, or xubuntu.

I did actually find a little annoying to find, having to navigate

--> Ubuntu.com
--> community
--> help and information
--> official documentation
--> 14.04 LTS
--> Desktop Guide

But also, the community wiki should be useful as well:

Commandline Howto
Commandline resources
Using the Terminal

Links from the most popular pages page.


apache2.service: Failed to run 'start' task: No space left on device

Your disk is full. You need to delete some files.


JAVA_HOME keeps being deleted despite i set it

I did those steps.

I went to

sudo nano /etc/environment

I added those

export JAVA_HOME="/usr/local/java/jdk1.8.0_171"
export ANT_HOME="/usr/local/ant"

export PATH=$ANT_HOME/bin:$PATH
export PATH=$JAVA_HOME/bin:$PATH

This sets globally.

But for terminal, it has to refresh this , for example when i open a new terminal.

So i also added bottom of my zsh configuration:

sudo nano ~/.zshrc

this

 source /etc/environment

and now it works.


You can install unattended-upgrades by typing the following commands:

sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades


No all motherboard has PCIe AER capable root complex. Also, I would check you don't have pci=noaer in your kernel boot argument.


If you wish to share a folder from linux to windows you need to use Samba.

The quickest way of achieving this is to right click on the folder select 'Properties > Share > "Share this Folder"' and Ubuntu should install the relevant files needed.


how to block torrent traffic on ubuntu server?

iptables -I FORWARD -p tcp -m iprange --src-range 192.168.1.2-192.168.1.100 --dport 1000:65010 -m time --timestart 05:00 --timestop 23:59 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun -j DROP
iptables -I FORWARD -p udp -m iprange --src-range 192.168.1.2-192.168.1.100 --dport 1000:65010 -m time --timestart 05:00 --timestop 23:59 --weekdays Mon,Tue,Wed,Thu,Fri,Sat,Sun -j DROP


Maximum brightness is not maximum brightness

did you try xrandr I had the opposite of your problem, my monitor was too bright and adjusted it using xrandr

xrandr --output VGA1 --gamma 0.7:0.7:0.7 --brightness 0.8

you need to replace VGA1 with your current output, and replace 0.8 and 0.7 by 1.5 for example. by default they are all set to 1.

I hope this helps.


The problema was that the /home/adminsitrador directory was an encrypted folder so when the user is logged in the folder it's decrypted and everything works but when the user it's logged off the folder it's encrypted and the cron can't access to that path, so I've changed the cron script and backup to another unencrypted folder and to root user and now everything it's working pretty well, thanks to all for your help !


How to set individual NTFS partitions permissions behaviour for each user account?

I think i have solution, here it is:
http://ubuntuforums.org/showthread.php?t=1678406:

  The second "0" in umask=0077 combined with uid=gid=1000 will do that.
  Automounting has nothing to do with something being disabled or invisible. The last 2 "7" in umask=0077 will do what you want. Everyone will see that there is a /media/VM mountpount but only you will be able to open the folder.
  Get rid of the "noauto" option.

If someone know other solutions, post also, so we could preserve the diversity of solutions.  :)


Deleting windows partitions: which one I can safely remove?

You definitely don't want to mess with /dev/sda2. That is used for booting up your system. It's how your EFI firmware knows where to hand off the boot process to the kernel.

As for /dev/sda3 and ~/sda9, those both look like they've either been partitioned in something that Ubuntu can't see (HIGHLY UNLIKELY), or they haven't been partitioned at all. They should be safe to add to the partitions that you want to create/extend.

I'm not sure what's in /dev/sda5, so I'm not sure what to tell you there. From it's size, it looks like it should be the Windows recovery console, but /dev/sda1 is already labelled as RE tools. I would look at mounting the partition, viewing what's on it, and maybe do some web searching based on what you find to figure out if it's safe to remove or not. It's probably Windows related, and safe to remove, since Ubuntu generally doesn't use NTFS unless you specify, but I would still proceed with caution.


I would recommend installing gnome-disk-utility , which allows you to add / remove partitions, format the partitions with a given filesystem, and change the volume label. Of course, for an SD card, you'll probably just want to format it (using FAT if you need Windows compatibility or Ext2 otherwise).

I don't think this application ships with Kubuntu by default, but it should be available in the repos. Install it with:

sudo apt-get update
sudo apt-get install gnome-disk-utility


.desktop file will not open in Google Chrome when launched from SpaceFm

1. Convert link files into launchers

The solution below offers the option to right- click the link (.desktop file) and choose > "Execute", which will run Google-Chrome to open the link. By editing SpaceFm's settings, you can run the link by double-click as well (see notes [3]).

Note that the solution automatically edits (only) new links on your desktop, to run the link specifically with Google-Chrome

What it is

A small background script checks once per two seconds for new .desktop files on your Desktop. If a relevant file is found, the file is edited from a Link file into an Application file. This is done by editing two lines inside the file:

The line:

Type=Link

is changed into:

Type=Application

The line:

URL=<link>

is changed into:

Exec=/usr/bin/google-chrome-stable <link>

In the test(s) I ran, this makes the link "openable" by right- click in SpaceFm: right-click > Open > Execute

The script

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

# --- define the (absolute) path to your desktop below
dr = "/absolute/path/to/your/desktop"
# edit (if necessary) the command to launch Google-Chrome
application = "/usr/bin/google-chrome-stable"

def find_relevant():
    return [f for f in os.listdir(dr) if f.endswith(".desktop")]

relevant1 = []

while True:
    time.sleep(2)
    relevant2 = [f for f in os.listdir(dr) if f.endswith(".desktop")]
    new = [f for f in relevant2 if not f in relevant1]
    if new:
        for f in new:
            f = dr+"/"+f
            rewrite = False
            lines = [l.strip() for l in open(f).readlines()]
            for i, l in enumerate(lines):
                if l.startswith("Type=Link"):
                    rewrite = True
                    lines[i] = "Type=Application"
                elif l.startswith("URL="):
                    lines[i] = l.replace("URL=", "Exec="+application+" ")
            if rewrite == True:
                print("rewrite")
                open(f, "wt").write(("\n").join(lines))
    relevant1 = relevant2

How to use

Copy the script into an empty file, save it as edit_links.py
In the head- section of your script, edit the path to your Desktop (as mentioned, use absolute path here)
Check the command to run Google-Chrome (also set in the head- section) by checking the first Exec= line in the google-chrome.desktop file: run

gedit /usr/share/applications/google-chrome.desktop

to read the file.
Test-run the script by the command:

python3 /path/to/edit_links.py

Open Google-Chrome, drag links on to your Desktop, test after a few seconds if it works fine.
If all works fine, add it to Startup Applications: Dash > Startup Applications > Add. Add the command:

python3 /path/to/edit_links.py

Note

The dragged .desktop file (link) needs to be on your Desktop at least one-two seconds to be found and edited, so if you move the links, at least leave them for a few seconds on your Desktop. :)
ll the script does is check for new .desktop files on your Desktop, it only reads/edits the file(s) if there are new files. This means nothing to your system.
By editing SpaceFm's settings, you can alsu run the "link" by double-click:

Convert your existing link files recursively

Additionally, as discussed in chat, a script to run a single time to convert the links in a directory recursively:

#!/usr/bin/env python3
import os
import sys

# --- define the (absolute) path to your desktop below
dr = sys.argv[1]
# edit (if necessary) the command to launch Google-Chrome
application = "/usr/bin/google-chrome-stable"

for root, dirs, files in os.walk(dr):
    for f in files:
        if f.endswith(".desktop"):
            f = root+"/"+f
            rewrite = False
            lines = [l.strip() for l in open(f).readlines()]
            for i, l in enumerate(lines):
                if l.startswith("Type=Link"):
                    rewrite = True
                    lines[i] = "Type=Application"
                elif l.startswith("URL="):
                    lines[i] = l.replace("URL=", "Exec="+application+" ")
            if rewrite == True:
                open(f, "wt").write(("\n").join(lines))

To use it, save it as convert_links.py, run it with the targeted directory as an argument:

python3 /path/to/convert_links.py <directory>

2. Convert links into cross-platform usable link files

As requested by OP, below a version of the (first) (background) script, converting the link files, created by dragging a link from the browser to the desktop, into cross-platform links. Usage is exactly as explained in the first section.

The script

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

# --- define the (absolute) path to your desktop below
dr = "/absolute/path/to/your/desktop"

out1 = ["", "", '", "", ""]

def find_relevant():
    return [f for f in os.listdir(dr) if f.endswith(".desktop")]

relevant1 = []

while True:
    time.sleep(2)
    relevant2 = [f for f in os.listdir(dr) if f.endswith(".desktop")]
    new = [f for f in relevant2 if not f in relevant1]
    if new:
        for f in new:
            f = dr+"/"+f
            rewrite = False
            lines = [l.strip() for l in open(f).readlines()]
            for i, l in enumerate(lines):
                if l.startswith("Type=Link"):
                    rewrite = True
                elif l.startswith("URL="):
                    url = 'window.location.href = "'+l.replace("URL=", "")+'"'
                    out1.append(url)
                elif l.startswith("Name="):
                    name = l.replace("Name=", "")
            if rewrite == True:
                open(f.replace(".desktop", ".html"), "wt").write(("\n").join(out1+out2))
                os.remove(f)
    relevant1 = relevant2

Version to convert your existing links in a recursive directory (single run)

#!/usr/bin/env python3
import os
import sys

dr = sys.argv[1]

out1 = ["", "", '", "", ""]

for root, dirs, files in os.walk(dr):
    for f in files:
        if f.endswith(".desktop"):
            f = root+"/"+f
            rewrite = False
            lines = [l.strip() for l in open(f).readlines()]
            for i, l in enumerate(lines):
                if l.startswith("Type=Link"):
                    rewrite = True
                elif l.startswith("URL="):
                    url = 'window.location.href = "'+l.replace("URL=", "")+'"'
                    out1.append(url)
                elif l.startswith("Name="):
                    name = l.replace("Name=", "")
            if rewrite == True:
                open(f.replace(".desktop", ".html"), "wt").write(("\n").join(out1+out2))
                os.remove(f)

To use it, save it as convert_links.py, run it with the targeted directory as an argument:

python3 /path/to/convert_links.py <directory>

Note

This version was based on this nice answer on Super User to create cross-platform links.


ubuntu 19.04 not detecting external monitors

I had the same issue with:

DELL XPS 9370
DELL TB16 Docking station
DELL UPD2516 Monitor

Monitor was not detected after upgrade from 18.10 to 19.04. Reboot did not fix it. After reconnect (cables) from Laptop to the Dockingstation and from the Dockingstation to the Monitor it worked again ... not sure if it was an issue of the Dockingstation, Monitor or of the Laptop.


How to make ts include year in prepended date?

From the manpage:

   The optional format parameter controls how the timestamp is formatted,
   as used by strftime(3). The default format is "%b %d %H:%M:%S". In
   addition to the regular strftime conversion specifications, "%.S" and
   "%.s" are like "%S" and "%s", but provide subsecond resolution (ie,
   "30.00001" and "1301682593.00001").

For example:

$ echo a  | ts '%F %T'
2014-12-06 23:16:02 a

For the particular format requested:

$ echo a  | ts '%Y %h %d %H:%M:%S'
2014 Dec 06 23:17:40 a

Consult man strftime for the various format specifiers available.


Could not display "/media/...".The location is not a folder

I had the exact same problem and ran the following command in terminal to fix it:

sudo chown user:user /media/user/

Just replace user with your username. Good luck!


Ubuntu 20.04 extremely slow - Zoom problem?

Consider installing another kernel. I've a Dell Latitude 3490 with i7 and my performance was poor after upgrade from 18.04 to 20.04.
Then I installed the liquorix kernel and it worked.
I could not understand why the default kernel led to a slow computer, but liquorix solved it (I'm using the 5.7.0-10.1-liquorix-amd64)


Video codec for making home videos smaller?

Example: H.264 video + stream copied audio in Matroska

ffmpeg -i input -c:v libx264 -crf 23 -preset medium -c:a copy output.mkv

Anything WMV is a joke. H.264 video via the encoder libx264 is your best bet right now. While H.265 looks good on paper the implementations just are not quite there yet for typical usage (unless your time is cheap because it is slow).

You basically only need to change -crf and -preset:

Use the highest -crf value that still gives an acceptable quality. Range is a log scale of 0-51. 0 is lossless (huge files). Around 18 is considered visually lossless. 23 is default.
Use the slowest preset you have patience for. They are: ultrafast, superfast, veryfast, faster, fast, medium [default], slow, slower, veryslow, placebo (ignore placebo; it's too slow for any potential significant advantage over veryslow).
Now use the same -crf and -preset for the rest of your batch of videos.

The audio is being stream copied instead of re-encoded because the vast majority of data will be video.

With all of that, I must point out that 25G is small and storage is cheap. If I were in this situation I'd probably just keep the original videos and not bother with re-encoding. Also, re-encoding may not help if the originals were encoded properly with a modern, efficient format.

Also see

FFmpeg Wiki: H.264 Video Encoding Guide


I managed to get it working. After I set permissions so that the user could create and delete files in the rebuilt ~/.local/share/Trash folder, tried logging out and logging back in. Now trashed files appear in my trash again.


Mulit-touch touchpad gestures Ubuntu 15.04

Unfortunately the xorg-input driver has three and four finger detection disabled.  In order to re-enable them you will have to patch the xserver-xorg-input-synaptics driver.

http://mangel312.blogspot.com/2015/02/enable-multitouch-on-dell-xps-13-9333.html


Is there a way that Unity can remember which terminal window had focus and was raised?

You can also use the Alt-` shortcut to switch between open windows of the same application.  It's not exactly a solution, but it might help you get back to your terminal faster. I typically use Alt-Tab to get to the terminal application and then switch to whatever window I need.

You could also use scale function to show all your windows and then click the window that you want.  By default, I believe the shortcut is Super-W, but it can be changed in the compiz settings manager under Window Management->Scale->Bindings->Initiate Window Picker for All Windows

Hope this helps!


How do I change the default locale in Ubuntu Server?

Run the command locale - it should show your current locale.

Generate the locales for french:

sudo locale-gen fr_FR
sudo locale-gen fr_FR.UTF-8

Also, try regenerating the supported locale list by running:

sudo dpkg-reconfigure locales

And update/change the current default locale:

sudo update-locale LANG=fr_FR.UTF-8

Update

Extra steps to try:

Try:

sudo update-locale LANG="fr_FR.UTF-8" LANGUAGE="fr_FR"
sudo dpkg-reconfigure locales

Perhaps adding LANG and LANGUAGE in /etc/environment could force a change. Try logout/login or rebooting.
locale will show your current locale for the current user. Perhaps it's worth checking out these files just to be sure no local language variables are set: ~/.profile ~/.bashrc ~/.bash_profile

More info:

https://help.ubuntu.com/community/Locale
https://serverfault.com/questions/228474/correctly-changing-default-locale-in-ubuntu-server-10-04-lts


20.04 - Screen problem (vertical green lines)

I'm still looking and I seem to have found a solution ... see this thread.
Fuzzy graphics after upgrading to Ubuntu 20.04
when using the code
sudo apt purge xserver-xorg-video-intel

At least it worked for me and I no longer have broken graphics on my multi-PGU machine.


Is there any GUI for server management for Ubuntu which is not web based?

In the Unix world if you want to do something, the fastest way is via command line. The programs and services are created for only one purpose, to do the job.
The servers are usually far away. If someone has a slow connection, the GUI might kill the whole connection, but using command line or web pages can overcome this problem.

Also if a GUI is developed, it can introduce more bugs, and the software gets immediately larger. Plus it has more dependencies (Qt, GTK, mono, vala, ...) and when these dependencies change, it might introduce even more problems.

A Web based management is better, because the web page can be rendered in any web browser. The code is nearly twice as small as for a GUI. If you want to manage your local server, you just open a browser on the desktop and open localhost.

If you want to try a very good home/small buisness server manager, try ebox (zentyal). It is in the official ubuntu repository. It sets up everything, and it is very nice.


Hibernation does not work in Ubuntu 15.04

The observation "it only turns the screen off for a small moment and immediately turns it on" suggests that it tries to hibernate, but is unsuccessful. The same thing happened with me due to some wake up event created by device.

Check the output of dmesg to find any logs related to pm. You can use this command to filter pm errors:

dmesg | tail -200 | grep pm

Have a close look at them, maybe one of them is the cause for hibernation not working. Hope this helps, do ask further if necessary.


Why does ssh's “password” prompt take so long to appear?

There are several things that can go wrong. Add -vvv to make ssh print a detailed trace of what it's doing, and see where it's pausing.

The problem could be on the client or on the server.

A common problem on the server is if you're connecting from a client for which reverse DNS lookups time out. (A “reverse DNS lookup” means getting back from the client machine's IP address to a host name. It isn't really useful for security, only slightly helpful to diagnose breakin attempts from log entries, but the default configuration does it anyway.) To turn off reverse DNS lookups, add UseDNS no to /etc/ssh/sshd_config (you need to be root on the server; remember to restart the SSH service afterwards).

Another thing that can go wrong is GSSAPI authentication timing out. If you don't know what that is, you're probably not relying on it; you can turn it off by adding the line GSSAPIAuthentication no to /etc/ssh/ssh_config or ~/.ssh/config (that's on the client side).


How to solve low performance on Ubuntu 15.10 with nVidia 650M, various drivers?

Generally you should use the drivers from the official Ubuntu repositories. But when there are problems with the drivers ... you can install the more current drivers from the GPU Drivers PPA.

Uninstall the currently installed NVIDIA drivers and remove the xorg-edgers PPA.

Open a terminal and execute :

sudo apt-get purge nvidia*
sudo apt-get install ppa-purge
sudo ppa-purge ppa:xorg-edgers/ppa
sudo reboot

You can install the latest official NVIDIA drivers that support GEFORCE GT 650M.

Open a terminal and execute :

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-358
sudo reboot


Your screenshot is cut off where it would show the 'Your Email' field that might be the cause for your error message. The complete 'Install – Step 5' screen looks like this:

(Source: codex.wordpress.org)

Site Title = Give your site a name. This can be changed again later.

Username = Enter the user name for your first admin user. This can be your e-mail address, but it does not have to. The username can't be changed later. And … don't name it the simple to guess 'admin'! Think of something more unique.

Password = Enter a real strong password. Mix of special characters is not that im portant. Password length is what makes it secure. Best would be 20+ characters long. The password can be changed later again.

Your Email = Enter your admin's e-mail address here. This is maybe the sport where a typo or something made it show the error message in your screenshot. The e-mail address can be changed later again.

Serach Engine Visibility = For new websites you might almost always check this option so Google & Co. won't start indexing your half-done page while you're still working on it.


Change the output from a background taks to notify-send

There are several ways you could do it. If you wanted everything in a single notification it would be as simple as:

notify-send "Summary" "$(command)"

Replacing command with echo "hello" or your karma command, or whatever.

You could also do one line per notification, if each test result were on a line, such as:

command | while read line; do notify-send "Summary" "$line"; done

Possibly with a sleep 1 in there to avoid flooding the notifications, although without some app to collect the notifications, that may be a bit difficult to follow. You could also use a similar command to collect together several lines before displaying the notification.


Difference between VGA compatible controller and 3D controller

It depends on the adapter firmware how it declares itself to PCI bus.

Some Nvidia laptop adapters declare themselves as a 3D controller.

That does not make any practical difference.

The reason for that is probably because in an Optimus dual graphics systems, the Nvidia chip is not a real adapter. It outputs through the Intel adapter anyway and does only hardware acceleration.

You can install a proprietary driver in System Settings -> Software & Updates -> Additional Drivers (nvidia-352), or in terminal:

sudo apt-get install nvidia-352

Both methods do the same. This will install the stable recommended driver.

If you need "the latest" drivers, you can install them by

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-361 nvidia-prime

at your own risk.


Logitech MX Keys brightness keys does not work

Newest versions of Solaar (I tested on 1.0.5) have pre-defined rules for these keys.
Also logiops works fine with mx keys with the following config:
{
  name: "MX Keys Wireless Keyboard";

  buttons: ({
    cid: 0x00c7;
    action = {
      type: "Keypress";
      keys: ["KEY_BRIGHTNESSDOWN"];
    };
  }, {
    cid: 0x00c8;
    action = {
      type: "Keypress";
      keys: ["KEY_BRIGHTNESSUP"];
    };
  });
},


Boot hangs when DVD reader is closed -- mount issue? [15.04]

When the kernel boots it runs in boot-time temporary file system that lives as a ramdisk known as initramfs or initrd, you can see the ramdisk images on your system in the folder /boot/.

This may be a particular quirk of your exact OS/driver configuration, but running sudo initramfs -u updates the most recent kernels boot image to  include any changes to the boot environment since it was last generated. Typically when installing a driver package apt will run this for you if it needs it, but it appears that some package did not or otherwise the image was corrupted.

It is possible that the CUDA drivers get loaded early on in the kernel, and the Debian package provided failed to update the image, or some other driver/package introduced the issue.


Ubuntu 14.04 not loading GUI - problems with startx

Sounds totally weird.
I would switch to runlevel 2 and purge chromium...reboot.
If the problem still occurs, again runlevel 2 and purge google-chrome.

Tell me/us what happened.


How to get the history of SSH connections with time?

The command, in a terminal window, journalctl /usr/sbin/sshd will show you log messages like (I am user walt, and just did a ssh localhost):

Feb 04 09:33:54 bat sshd[17129]: pam_ecryptfs: pam_sm_authenticate: /home/walt is already mounted
Feb 04 09:33:54 bat sshd[17129]: Accepted password for walt from 127.0.0.1 port 52642 ssh2
Feb 04 09:33:54 bat sshd[17129]: pam_unix(sshd:session): session opened for user walt by (uid=0)


Xubuntu 16.04 - simple scan not working with my scanner

I had the same problem with my Canon LiDE 25 only under Ubuntu 16.04 LTS with all its versions (Xubuntu, Kubuntu, Lubuntu, Ubuntu MATE) and

I finally found a solution by blacklisting the USB-ID. In fact, my scanner seemed to be detected as an HID device and not as a scanner and simple-scan returned a black page, or the scanner stopped during the scan, or the sensor didn't come back to its initial position.

So, I did the following:

In a terminal, type lsusb and find the USB-ID of your scanner (xxxx:xxxx). With my LiDE25, this command returned Bus 001 Device 007: ID 04a9:2220 Canon, Inc. CanoScan LIDE 25 so its USB-ID was 04a9:2220, for you, I think it will be 04a9:1909,
Edit the config file /etc/default/tlp with the command:

sudo nano /etc/default/tlp

and find the line (the 178th for me)

USB_BLACKLIST=

Add your USB-ID (Example for my LiDE 25):

USB_BLACKLIST=04a9:2220

so for you, it will certainly be

USB_BLACKLIST=04a9:1909

Save your file by pressing CTRL+O (the letter O, not zero)
Quit by pressing CTRL+X
Unplug your scanner and plug it in again without restarting your computer, you can try now.

This solution has worked for me; I hope it will for you.


Pycharm and other packages don't appear in the apt-cache search list

In Ubuntu Pycharm is only available to install as a snap package and is not in official Ubuntu repositories. So you can't find it using, apt or apt-cache, you have to use snap or gnome softwares GUI.

Simply use:

snap search pycharm


Middle-click and drag doesn't trigger auto scrolling

The function you describe is called 'autoscroll' and it's an option you can enable in Firefox. Check the preferences menu, it's in there.


Have Thunderbird run twice (2nd instance)

Try to create two profiles by running thunderbird -p.


How can I open a new window inside a script, ssh to a different user and run commands?

To open a new window inside a script you can use xterm as you have done. It's not recommended use the 'sudo' command inside a script.

So, instead of run the script First.sh with sudo inside, run:

sudo /usr/bin/tcsh

and remove sudo from minicomin the file First.sh.

It doesn't seem to be the case, but there are situations where adding the -hold option to the command xterm prevents the script to stop the execution.

1. If you can use ssh it's pretty straightforward.

ssh -t user@ip 'ifconfig eth0 10.120.140.3; ping -w20 10.120.140.1'

2) If you need to use minicom you should store your script in the destination to allow the execution.

sudo vi First.txt

Paste only the following lines:

ifconfig eth0 10.120.140.3
ping -w20 10.120.140.1

There were situations that minicon did not accepted shell scripts and adding a ! before solved the problem, as explained here

Then, open it's 'console-gui' and send to the destination:

sudo minicom -D /dev/ttyUSB0
send atz
send at

You should receive an answer 'OK' in the last two commands.

Then run your script with:

minicom -S First.txt


c++ boost library problem: cannot find -lboost_system ld returned 1 exit status

Make sure you understand the difference between header files and libraries.

Header files (like /usr/include/boost/filesystem.hpp) is what you use in your source code as part of your #include directive. The C++ preprocessor reads that file and adds a bunch of declarations to your program.

A library is a compiled collection of various functions, static data and other stuff. When you use parameter -lboost_system you tell the compiler "Compile my program and link it with library libboost_system".

Your linker complains that it can't find that library (/usr/bin/ld: cannot find -lboost_system). The likely reason is that script ./bootstrap.sh did not install boost in the proper directories.

From here on you have a couple of options.

If you want to stick to Boost-2014.10.tar.gz you are on your own.

I would recommend installing package libboost-dev. It will install whatever is the current version of boost for your system and will put all files in the proper places.

And finally: when you removed the #include line from your file it worked but only because your program does not use any functionality from boost::system. If you were to use any boost classes/functions you would get compile errors if you don't have proper headers included.


Getting Primay domain controller to work

The sysadmin is a hypothetical group, the *sys*tem *admin*istrators. It says "you prefer" so you could use any existing UNIX group that you want to provide access to the Domain. This becomes evident later when it says:

  ... user used to join the domain needs to be a member of the sysadmin group, as well as a member of the system admin group. The admin group allows sudo use.

So, the recommendation here is: use what you prefer, need, or feel like.

  And what implications will this have? will this mean that all unix user in this group would have domain admin status?

The users in this group will have Domain Administrator status, since: sysadmin (the group) = Domain Admins (the group)

  Here sysadmin is the username, not group correct? And example is the name of my workgroup set earlier. Sysadmin is the name of the user I would use to register machines and add new users to the unix/samba, right?

Yes. Yes. And again yes.

I reckon that the example can be a little confusing, but at very least is correct in all the steps. Is wrote like that since normally in the *NIX systems a user is member of a group with the same name:

permissions User   Group
-rw-r--r--  braiam braiam


Panel is missing in Ubuntu 14.04 with Pantheon

Yes, you no longer have the Ubuntu UI (called Unity), but the Pantheon UI.  And the Pantheon UI has no Unity-panel.  So what you see now is absolutely normal.

To revert back follow the steps in the link you used to install Pantheon in reverse order, then go here: How do I reinstall Unity? and your Unity-panel will re-appear!


Prevent files from losing focus in Nautilus?

Hit tab to restore focus to the file list. Then you should be able to navigate with the arrow keys.


Ubuntu 14.04 : How do you use mount.cifs, mount.nfs, they are not in the repositories any more?

The mount.cifs command is provided by cifs-utils and mount.nfs by nfs-common.

In general, when you're looking for a particular file and don't know which package provides it, you can search in the Ubuntu Repositories or in synaptic. Alternatively, you can use apt-file.

If it is not installed, install it with sudo apt-get install apt-file and then update its database with apt-file update. Once you've done that, you can easily search package contents:

$ apt-file search mount.cifs mount.nfs
cifs-utils: /sbin/mount.cifs
cifs-utils: /usr/share/man/man8/mount.cifs.8.gz
$ apt-file search mount.nfs
manpages-fr-extra: /usr/share/man/fr/man8/mount.nfs.8.gz
manpages-fr-extra: /usr/share/man/fr/man8/umount.nfs.8.gz
nfs-common: /sbin/mount.nfs
nfs-common: /sbin/mount.nfs4
nfs-common: /sbin/umount.nfs
nfs-common: /sbin/umount.nfs4
nfs-common: /usr/share/man/man8/mount.nfs.8.gz
nfs-common: /usr/share/man/man8/umount.nfs.8.gz


How/where to clone current 18.04 kernel (5.0.0-37-generic), specifically using Git

All kernel sources for Ubuntu 18.04 bionic can be found at https://kernel.ubuntu.com/git/ubuntu/ubuntu-bionic.git

The master branch contains the initial 4.15 kernel.

The hwe branch has the latest HWE kernel. It is 5.0 at the moment.

The hwe-edge has the next HWE 5.3 kernel.

There are some other branches that can also be checked out if needed.

You can get the latest HWE kernel by running:

git clone git://kernel.ubuntu.com/ubuntu/ubuntu-bionic.git
cd ubuntu-bionic
git checkout hwe

That will get the current HWE bionic that is the 5.0.0-37 kernel now.


Howto specify library location when compiling

There are two ways to pass configuration variables to ./configure, and it depends quite a bit on the specific project, so you have to check the documentation.

The first one is to use the --with... options that the author of the script have decided to provide. For example, xcircuit has to be configured like this in 14.04:

./configure --with-tcl --with-tk --with-tcllibs=/usr/lib/x86_64-linux-gnu/ --with-tklibs=/usr/lib/x86_64-linux-gnu/

The other way is passing an environment variable to the script (in configuration stage) or to the Makefile (in the compilation phase):

CPPFLAGS=-Wall ./configure

or

CPPLAGS=-Wall make

In summary, it's really up to how the author wrote the software. You should refer to the specific documentation, in you case, of libav.


To find these files, you can use these commands in a terminal:

locate settings.sol
locate mms.cfg

settings.sol is located at (where $USER is your username)

/home/$USER/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings.sol

mms.cfg seems not to exist...


Cannot write permissions NTFS partitions

Try changing your mounts in /etc/fstab from:

# /media/c was on /dev/sda2 during installation
UUID=64004A63004A3BF4 /media/c        ntfs    defaults,umask=007,gid=46 0       0
# /media/d was on /dev/sda3 during installation
UUID=01D19238D33F4D20 /media/d        ntfs    defaults,umask=007,gid=46 0       0

to:

# /media/c was on /dev/sda2 during installation
#UUID=64004A63004A3BF4 /media/c        ntfs    defaults 0       0
# /media/d was on /dev/sda3 during installation
UUID=01D19238D33F4D20 /media/d        ntfs    defaults 0       0

Note: I commented out the mounting of the C: drive because it's not a good idea to modify the C: partition from Ubuntu... Windows doesn't like it.

Then reboot Ubuntu.

If you must have the C: drive mounted, you'll need to do this in Windows:

open the Power control panel
click on change what the power buttons do
click on change options that are unavailable
uncheck fast start
close the Power control panel
open an administrative command prompt window
type powercfg /h off
type chkdsk /f c:
approve that chkdsk runs at next boot time
type chkdsk /f d: (if you'd like to check the D: drive)
reboot Windows


Media keys delayed and cause a CPU spike to 100% on Ubuntu 17.10 with Gnome

Gustavo, I answered a similar question and I think it might help you:

Original answer on https://askubuntu.com/a/1072160/867840 :

For some reason my Gnome freezes when using Fn keys, or when I try to use 2 keyboards.
A friend of mine pointed to me that it occurs when switching to a keyboard layout that has Scroll Lock enabled, so I disabled it in the X11 keyboard layout file for my language and it solved the problem.

The steps I followed are:

Opened the keyboard layout file for my language, in my case:

sudo nano /usr/share/X11/xkb/symbols/br
Commented the line:

modifier_map Mod3 { Scroll_Lock };
Logged out and logged in again.

These steps are specific for the Brazilian Portuguese ABNT2 Layout and may not work for other layouts, but it can help you find a similar solution.


I was having the same problem. To solve it, just delete the .steam/steam/appcache
 directory. You can do this from the terminal:

rm -Rf ~/.steam/steam/appcache

You have to run this every time you want to start steam until Valve fix this problem.


Virtualbox Kernel driver error: Kernel driver not installed (rc=-1908)

You need to have the build-essential packages installed to build the kernel modules. You can resolve this issue with just a couple of commands:
sudo apt update
sudo apt install build-essential

Then you can try your vboxconfig command again.


With the skills you listed you should look at getting involved with the Creating Evernote on Ubuntu for smartphones project


How do I disable the "Recent Files" feature in the Cinnamon desktop environment?

Nowadays you can pull up the menu, type 'privacy' and click on the 'privacy' icon that should appear. Turn off 'remember recently accessed files'.

The previous solution before this was introduced in the GUI was the below, which should now be redundant and left for curiosity only:

A simple hack to disable the feature:

Remove the file containing a list of Recent Files: rm ~/.local/share/recently-used.xbel
Create a new file that is completely empty: touch ~/.local/share/recently-used.xbel
Change the attribute of this file to "immutable", meaning that it "cannot be modified, it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute": sudo chattr +i ~/.local/share/recently-used.xbel
The (empty) file is now immutable, meaning that the "Recent Files" feature is for all intents and purposes disabled, as no new list of recent files can be created.

Alternately:

Create a folder named recently-used.xbel and set it read only.


Missing top and bottom panels in ubuntu 11.04

There was default Panel restore script Writen by PhrankDaChicken. You can find the full article from this -> blog
To use the PanelRestore script:

Download this PanelRestore.tar.gz
Extract it and run it by double clicking.
It will ask you what do you want to do dialbox like this:

Select "Restore default panel setting"
Never tested but hope it will help :)


Ok, I guess I failed to mention having had a previous version of crossover already installed, which turns out was important. Installing using the deb file installer, showed no errors, during install, which made me think it was irrelevant.
in any event, I did sudo apt-get purge crossover, then ran the binary generic shell installer, which then ran successfully, and now crossover is now installed.


More modern or more conventional version of Emacs

As far as I can see it is more or less the initiative behind the ErgoEmacs. Though it is not recommended to start using Emacs with it.

Personally I'd recommend customize Emacs to fit Your needs step-by-step. No one really knows what You want Emacs to be. But Emacs allows almost any kind of configuration. You can cast each of Your requirenments to a separate stackexchange question -- Ask Ubuntu, StackOverflow or SuperUser -- depending on the feature.


Brightness settings won't change on an HP dv7t-6100 CTO

Do you have acpi enabled? If so, do you have a /sys/class/backlight/ directory populated by folders named acpi_videoX, where X is some integer (normally 0 or 1)? If you do, check whether the brightness and/or actual_brightness files within those folders have their contents changed when you attempt to alter the brightness level. You might also consider installing the xbacklight package and checking whether it works to change your brightness settings.


This has been discussed here:

Does 'Ubuntu One Mobile' support Ogg Vorbis?


Is there a way to add page numbers in libreoffice writer?

The way I personally do it is two step process: insert header first, insert page number field. As the naming suggests that you open the Insert menu first, select Header with default style. Next come back to Insert , and with cursor blinking inside the header, select Fields and then Page Number

A bit faster way is through shortcuts : Alt+I, A, Enter. Alt+I,D,C. All that just performs what was described above, without using mouse


How can I download and extract an archive using a script (how can I reliably specify the file that was downloaded to a subsequent command)?

First make wget output to a temporary file. Have a look at mktemp, which lets you make a temporary file in a safe manner:

[~]$ filename=$(mktemp)
[~]$ echo $filename
/tmp/tmp.DglaA1x2Z0
[~]$ wget -O $filename www.example.com
--2017-12-29 22:15:28--  http://www.example.com/
Resolving www.example.com (www.example.com)... 93.184.216.34, 2606:2800:220:1:248:1893:25c8:1946
Connecting to www.example.com (www.example.com)|93.184.216.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1270 (1.2K) [text/html]
Saving to: ‘/tmp/tmp.DglaA1x2Z0’

100%[======================================>] 1,270       --.-K/s   in 0s

2017-12-29 22:15:30 (156 MB/s) - ‘/tmp/tmp.DglaA1x2Z0’ saved [1270/1270]

mktemp guarantees that the file name is unique, and that permissions are handled so that we don't end up writing to a file that is owned by some other user. The file is created by mktemp with safe permissions:

[~]$ ls -la $filename
-rw------- 1 vidarlo users 1270 Aug 10  2013 /tmp/tmp.DglaA1x2Z0

This way you will have a file name that is guaranteed not to be in use for anything, and you are certain you won't be subject to race conditions because another user tricks you into writing into a file with disastrous results.

Now that you have a file, with a determined filename, you can run file to determine what kind of archive it is:

[/tmp]$ file -i foo.tar
foo.tar: application/x-tar; charset=binary
[/tmp]$ file -i foo.7z
foo.7z: application/x-7z-compressed; charset=binary

This does not rely on what the remote server tells us. The server could tell you the extension - or not. A php script can serve a perfectly valid tar archive, without ever telling you that it's a tar archive.

In addition we save the content to a safe place, avoiding race conditions.

Supporting a large number of archive formats can become unwieldy using this approach, but it's certainly better than using simply the filename extension from the webserver giving us the archive.

Note that you should never parse ls, as it may have very many unintended consequences.


No "Additional Drivers" for Radeon 2100 under Ubuntu 12.04

Znarkus,

The X2100 Series of Radeon cards are supported under the Legacy drivers of the Catalyst proprietary drivers and that may or may not be currently under development for Precise (not certain).  Would suspect that the previous versions of the drivers might work, however not certain that the current versions of the Catalyst drivers will work for the X2100 series which may be why they are not being shown as found. The Legacy versions may not be under development for Precise as an alternative either and may not be given as an option. A developer may know differently though.

Your best bet may be to try to determine which version of the Catalyst Drivers was the last version to supply support for your card and try to install that driver manually from the source supplied by AMD. It is likely not to be as clean as a debian package from the sources though and would require reinstall every time the kernel is updated.

Another choice might be to buy a Video card, they are relatively inexpensive these days and you could get a slightly newer card that would have a driver available. Just another option though.

Good luck, hope this does help.


help with using the Unity Web API for my website

The code seems to work fine in Firefox. Please make sure your using Firefox for testing as it seems to be setup by default. Also, make sure that your allowing web apps.

When going to your example page, I got the "allow warning" and then the icon in the Unity area. I did not get the notification, but that is probably system settings.


How can I tell if I have downloaded 64 bit?

If the .iso file you downloaded has "amd64" in the name, it's 64 bit. If it has "i386" in the name, it's 32 bit.


Created bootable .iso on external USB HDD, how to get rid of it again?

If I'm not mistaken, the USB installer adds some files in the root folder of the USB disk and makes it bootable by adding some code in the Master Boot Record.

You can safely remove the files created by the USB installer using the Delete button.

You can restore (read: clear) the MBR (Master Boot Record) using the following command:

sudo dd if=/dev/zero of=/dev/sdX count=1 bs=512

/dev/sdX is your USB drive, if you run ls -l /dev/disk/by-label, you will labeled partitions, e.g.:

lrwxrwxrwx 1 root root 10 2011-03-04 22:58 ubuntu -> ../../sda1
lrwxrwxrwx 1 root root 10 2011-03-04 22:58 USBDRIVE -> ../../sdb1

Here, you can see that /dev/sdb is the external USB. If your partitions are not labeled, you could use sudo fdisk -l to get a list of partitions for each drive.

For relabeling the partition, you can use GParted, see How can I relabel my flash drive?.


Can't browse the internet nor ping a host, but dig works

I have found that  the problem lies in this file /etc/nsswitch.conf. In that file dns entry was missed. After adding that entry i am able to browse the sites.


OpenVPN does not start with the error Already running (PID file exists)

Did you read the error message? A Process ID file already exists. Usually this indicated that OpenVPN is already running. When you cleanly shut openVPN down it will remove this file.

If the laptop crashed, OpenVPN crashed or for some other reason this file did not get deleted then you can manually do that.

(In Other words: Make sure that OpenVPN really is not running, then remove the PID file You should find it in /var/run/openvpn/)


In order to run apt update or any command requiring superuser privileges, you need to run
sudo <program name>

If what you want is being able to execute such commands without entering the password, you have to edit the sudoers file (using visudo) adding the following directive:
newuser ALL=(ALL) NOPASSWD: ALL

In case you want to allow an entire group to execute sudo without asking for the password, you add (notice the % before the group name):
%yourgroup ALL=(ALL) NOPASSWD: ALL


For those -- like me -- wishing to get rid of this "pollution" in the user directory (apparently caused by a lightdm bug described in Why do I have so many .Xauthority.* files in my home directory?), an interim solution could be placing something like the following (executable) script file (which assumes you are the first user after root) into the /etc/cron.daily directory:

#!/bin/bash
USER="$(users | awk -F ' ' '{print $2}')"
ls /home/"$USER"/.Xauthority.* > /home/"$USER"/.Xauthority-Files.txt
NFILES="$(grep -c Xauthority /home/"$USER"/.Xauthority-Files.txt)"
LOG="/home/"$USER"/.Xauthority-Files.log"
echo -e "$(date +"%x %R"): "$NFILES" .Xauthority.* files deleted" >> "$LOG"
rm -f /home/"$USER"/.Xauthority.*
rm -f /home/"$USER"/.Xauthority-Files.txt
exit 0

NOTE: This updated script keeps a log file named ".Xauthority-Files.log" so that you can follow up if a recent update has put an end to this bug, and then remove the script when it's no longer needed.


Expr is not parsing the mathematical expression in Bash

[~]$ a=1;b=2
[~]$ expr $a+$b
1+2
[~]$ expr $a + $b
3
[~]$ expr $a * $b
expr: syntax error
[~]$ expr $a \* $b
2

From the man page:

ARG1 + ARG2
              arithmetic sum of ARG1 and ARG2

As we can see, you need a space between arguments and operator. In addition you have to escape operators that can be interpreted as globs in bash:

Beware that many operators need to be escaped  or  quoted  for  shells.


Can I make image of 'extended' partition using dd?

I agree with @ravery, that you should check that you are really trying to read from the correct device.

But there is another problem too. I tested your command in a test environment, and dd read only one kibibyte (1024 bytes) when I wanted it to make an image of an extended partition.

An obvious work-around is to make an image of the whole drive /dev/sdX, where X is the drive letter (for example a or b or c). But it means more work.

Another alternative is to look for the start and the size of the extended partition with the help of parted.

sudo parted /dev/sdX u MiB print

u MiB means that the unit is mibibytes. Use that block size also in dd and then use seek and count in dd to select the correct data to copy into the image.

seek= and count= are used like bs=. It is described in man dd. You can use bs=1M and then use the output from the parted command line for the values for seek and count.

sudo dd if=/dev/sdX bs=1M seek=Start count=Size | gzip -c > TOSHIBA_ExtPart.img.gz


How to remove the basic conky installed on ubuntu?

Hi you can remove it and all config files by typing this command:

"sudo apt-get --purge remove package name"

In this case, run the following command on terminal:

sudo apt-get --purge remove conky conky-all


How to get list of user accounts and access through root in Ubuntu terminal?

sudo -i will turn you into root and looking in /home/ is usually a good indication on who the system's real users are but you can do this account-wise by searching for users with uids over 1000 with:

awk -F: '$3 >= 1000 && $1 != "nobody" {print $1}' /etc/passwd

If you want all the system users, look in /etc/passwd.


GRUB shell appears after rebooting ubuntu, no problem after rebooting windows

Your configuration puts the GRUB binary (/boot/efi/EFI/ubuntu/grubx64.efi) on the MMC (/dev/mmcblk0) and the GRUB configuration file (/boot/grub/grub.cfg) on the SSD (/dev/sda). My GUESS (let me emphasize again: GUESS) is that Ubuntu is somehow doing something to make the SSD invisible to the firmware when the system reboots, but that Windows is not doing this.

You can test this hypothesis by installing an EFI shell binary (see here for pointers to some binaries), configuring GRUB to provide an option to launch it (see here for information on launching generic EFI binaries from GRUB), and launching the EFI shell both in conditions when the problem occurs and when it doesn't. If my hypothesis is correct, the SSD should show up in the device list when you do a cold boot but not when you reboot from Ubuntu. Unfortunately, the device list often scrolls off the top of the screen before you can read it. Putting a small FAT filesystem on the SSD will help you, since you can then check whether it's present or not. (It will show up as fs0:, fs1:, or some other filesystem device if it's visible.)

IF I'm right, several solutions or workarounds occur to me:

When using Ubuntu, shut down and restart rather than reboot. Presumably this is what you're doing now.
Repartition your devices so that you have a small (~500-1000 MiB) /boot partition on the MMC. You'll need to re-install GRUB once this is done. The result is that your grub.cfg file will be on the MMC, and everything should work correctly. This will require some partition-juggling, though, which can be scary if you're not familiar with such things. (Alternatively, you could re-install Ubuntu to have it set up this way from the start.)
Upgrade to Ubuntu 16.10. Since 16.10 uses a different kernel from 16.04, this might change the reboot behavior to work better with your firmware. This is not guaranteed to work, though; it's a both a shot in the dark and a long shot. (Once Ubuntu 16.04.2 is released, you could try it, since it will use the same kernel as 16.10.)
Research the handling of disks at shutdown (or maybe at startup) more, in the hopes of finding a kernel option that will modify whatever system calls are causing problems. For instance, there's the kernel's reboot= option (see here for documentation). This approach will take digging around in documentation files and experimenting with your boot loader configuration, and is NOT guaranteed to produce results.

Good luck!


gpg: Fatal: libgcrypt is too old (need 1.7.0, have 1.6.5)

I experienced an error very similar to this.
In my case, I had another version of libgcrypt installed in /usr/local/lib

user@computer:~$ gpg --version
gpg: Fatal: libgcrypt is too old (need 1.7.0, have 1.6.4)
user@computer:~$ sudo ldd /usr/bin/gpg
    linux-vdso.so.1 =>  (0x00007fff5b3b8000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f4f1f95d000)
    libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f4f1f74d000)
    libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f4f1f44b000)
    libgcrypt.so.20 => /usr/local/lib/libgcrypt.so.20 (0x00007f4f1f169000)
    libreadline.so.7 => /lib/x86_64-linux-gnu/libreadline.so.7 (0x00007f4f1ef1f000)
    libassuan.so.0 => /usr/local/lib/libassuan.so.0 (0x00007f4f1ed0a000)
    libgpg-error.so.0 => /usr/local/lib/libgpg-error.so.0 (0x00007f4f1eaf6000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4f1e72f000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4f1e426000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4f1e208000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4f1e004000)
    libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f4f1ddd9000)
    /lib64/ld-linux-x86-64.so.2 (0x0000564feff78000)
user@computer:~$ ls /usr/local/lib
libassuan.la        libgcrypt.so         libgpg-error.so.0       libksba.so.8.11.4
libassuan.so        libgcrypt.so.20      libgpg-error.so.0.17.0  libnpth.la
libassuan.so.0      libgcrypt.so.20.0.4  libksba.la              libnpth.so
libassuan.so.0.7.2  libgpg-error.la      libksba.so              libnpth.so.0
libgcrypt.la        libgpg-error.so      libksba.so.8            libnpth.so.0.0.5

I solved this problem by uninstalling the version of gnupg that I had previously manually installed

./configure
make
make uninstall


Remmina actually has a separate plugin for connecting to NX servers. You can get it by installing the remmina-plugin-nx package. Once you install that, you will have NX available in the Remmina connection dialog.

You may also want to try a separate program called qtnx. It's also available in the Software Center. It's a little simpler and seems to work better for me when connecting to NX servers.


Why does Ubuntu Desktop require geoip-database?

Used for locating peers in applications like bittorrent.

GeoIP databases will help enable you to identify the location, organization, connection speed, and user type of your Internet visitors. (for servers)

Can be used for Region, Country, City, Organisation, IP ISP and Netspeed.

Used for gathering user/client habits and traffic control.

It's also used for criminal investigation and fraud detection.

See WIKI.

Edit: I thought this was a general question. As indicated it is not, so for more specifics lets move on.

Geoip-database is the database used by a software framework which can be used to enable geospatial awareness in applications.

GPS: Position information from a Global Positioning System receiver (via gpsd and gypsy)

GSM: Position information from cellular network connection

Plazes: Position information from the Plazes Wi-Fi location service

Hostip: Position information based on IP address

Manual: User-provided position information such as:An online locator service (also known as location finder, store finder, or store locator, or similar) is a feature found on websites of businesses with multiple locations that allows visitors to the site to find locations of the business within proximity of an address or postal code or within a selected region.

Services such as Google Maps, MapQuest or Bing Maps allowing the user to see on a map where the particular location is found on a map.

The database is also used by GeoClue which is a modular geoinformation service built on top of the D-Bus messaging system. The goal of the Geoclue project is to make creating location-aware applications as simple as possible.

Just a little more info:

GeoIP is a C library that enables the user to find the country that any
 IP address or hostname originates from. It uses a file based database.

This database simply contains IP blocks as keys, and countries as values and
it should be more complete and accurate than using reverse DNS lookups.

This package contains the free GeoLiteCountry database.

Installation within Ubuntu:

/.
/usr
/usr/share
/usr/share/GeoIP
/usr/share/GeoIP/GeoIP.dat
/usr/share/GeoIP/GeoIPv6.dat
/usr/share/doc
/usr/share/doc/geoip-database
/usr/share/doc/geoip-database/changelog.Debian.gz
/usr/share/doc/geoip-database/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/geoip-database


''cURL is not installed on this server'' after updating to Ubuntu 20.04

The package curl contains the command line interface, basically the command curl. But WordPress (including its plugins) are developed in PHP, and PHP can't just use the command line version of cURL. PHP needs the corresponding extension for that.
In Ubuntu, several PHP extensions are packaged as their own packages, like php-mysql or php-imagick. In the case of cURL, that extension package would be php-curl. That's probably what you're missing.
As a side note: php-curl doesn't itself contain the PHP extension. This is provided by a package for the respective PHP version that php-curl depends on. So, if you install php-curl for example on Ubuntu 20.04, it will also install php7.4-curl, because Ubuntu 20.04 comes with PHP 7.4.


Can't remove Gmail calendar from previous Evolution installation

I purged Evolution and removed ~/.config/evolution/ and ~/.local/share/evolution/ and logged out and back in and the calendars were gone.


Unable to connect to mixed b/g/n wifi network on Ubuntu

The proprietary driver wl is generally not the preferred driver for your 14e4:4727 device. Let's remove it:

sudo apt-get purge bcmwl-kernel-source

And now we load the preferred driver:

sudo modprobe brcmsmac

It may take a reboot. Is there any improvement?


Export: Not a valid identifier (Cuda environment setup)

export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64\
                         ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

delete the "\" and blank space

export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}


The OP provided the solution in a comment:

  I've found the solution. I shouldn't have used the open source Xorg
  driver instead of the proprietary Nvidia driver that seems to work
  correctly.

–  user278680 May 11 at 16:42


Microsoft LifeCam Studio worked in 16.04, no longer working in Ubuntu 18.04

I also have a 045e:0772 Microsoft Corp. LifeCam Studio and it is VERY temperamental. I've tried them on a few computers, and they seem to be very sensitive to the USB ports they're plugged into (frequently failing in even Windows 10). It will, sometimes, trigger a USB reset of sorts, and everything connected to the same hub temporarily gets disconnected. Have you recently moved it from a USB2 to a USB3 port? I don't think it plays nice on newer ports.

I've found a firmware update for it, but it said it was already installed, and Microsoft's support pages are reeeeeeeal thin on the matter.

At the moment, my /etc/modprobe.d/uvcvideo.conf looks like this:

## fix bandwidth issue for lifecam studio/cinema
options uvcvideo quirks=0x80
## load loopback video devices for OBS
options v4l2loopback devices=4 video_nr="11,12,13,14" card_label="Loopback 1,Loopback 2,Loopback 3,Loopback 4"

... the latter two lines may not be relevant to you. I installed v4l2loopback kernel module to let me feed OBS back into things like Zoom.

To get anything even resembling a decent framerate in OBS, I have to select one of the emulated Video formats (in my case, YU12) and then it lets me up the framerate. Otherwise, it's limited to about 7.5fps :-/

Not much, but hope it helps.


How do I install Ubuntu on a SSD with HDD for data?

Install Linux to the SSD (100GB is much more room than needed) after configuring your machine's BIOS to set the SSD as sda and the HDD as sdb, and make the SSD (sda) the boot drive.

When the installation process comes to partition, set up both drives with the default filesystem ext4 - and swap goes at the back of the HDD as per normal. You can also revised that after installation ends with the Gparted utility of Ubuntu.

Leave about 10%-20% of the space on the SSD unallocated, for as the SSD ages, specific addresses will fail, and the SSD will automatically block those and replace them with addresses in the unallocated space. Also, this “Over-provisioning” boosts an SSD’s sustained write performance by allocating temporary space as discussed at http://www.tweaktown.com/reviews/5822/sandisk-x210-256gb-business-class-ssd-exploring-overprovisioning/index.html . The ext4 partition on the SSD should be about 80-90% of the total space, or 103GB-115GB, with about 13GB-25GB left unallocated, outside that partition.

After installation, modify the filesystem by editing /etc/fstab to put /tmp /var and /home on sdb along with swap, and add the ,noatime parameter to sda , then save and reboot.

The purpose of noatime is to disable timestamping of file reads which cuts down the number of I/O ops. Should a program need timestamping then remove noatime which in Ubuntu will default to relatime instead which keeps the timestamps more or less accurate with only a slight uptick in I/O.

A good detailed article on the subject can be found at https://wiki.debian.org/SSDOptimization and examples of what /etc/fstab should look like may be seen at https://wiki.archlinux.org/index.php/SSD#noatime_Mount_Flag and at http://forums.debian.net/viewtopic.php?f=16&t=76921