As it often happens, I jumped ahead to reinvent the wheel that already exists in smartmontools package. This package provides whole lot of diagnostic tools for hard-drives and SSDs (or in more technical terms, SCSI devices). In particular, smartctl command is what we're looking for:

$ sudo smartctl -A /dev/sda
[sudo] password for xieerqi:
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-65-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 18
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Runtime_Bad_Block       0x0000   000   000   000    Old_age   Offline      -       0
  9 Power_On_Hours          0x0000   100   100   000    Old_age   Offline      -       8080
 12 Power_Cycle_Count       0x0000   100   100   000    Old_age   Offline      -       1419
171 Avail_OP_Block_Count    0x0000   100   100   000    Old_age   Offline      -       40907856
174 Pwr_Cycle_Ct_Unplanned  0x0000   100   100   000    Old_age   Offline      -       78
195 Total_Prog_Failures     0x0000   100   100   000    Old_age   Offline      -       0
196 Total_Erase_Failures    0x0000   100   100   000    Old_age   Offline      -       0
197 Total_Unc_Read_Failures 0x0000   100   100   000    Old_age   Offline      -       0
208 Average_Erase_Count     0x0000   100   100   000    Old_age   Offline      -       179
210 SATA_CRC_Error_Count    0x0000   100   100   000    Old_age   Offline      -       0
224 In_Warranty             0x0000   100   100   000    Old_age   Offline      -       1
233 Remaining_Lifetime_Perc 0x0000   095   095   000    Old_age   Offline      -       95
241 Host_Writes_GiB         0x0000   100   100   000    Old_age   Offline      -       3133
242 Host_Reads_GiB          0x0000   100   100   000    Old_age   Offline      -       2745
249 Total_NAND_Prog_Ct_GiB  0x0000   100   100   000    Old_age   Offline      -       301548705

What you see above is list of attributes for my SSD. Of particular interest is attribute 241 (Host_Writes_GiB) and 242 (Host_Reads_GiB). These values are in GiB (which is a classical unit of measure in computer science in powers of 1024 bytes, in this case 1024^3, instead of  SI units of powers of 10).

On the low level, as far as I understand, this utility parses actual lifetime_write_kbytes file in /sys/fs folder. Particularly, in my example:

$ cat /sys/fs/ext4/sda1/lifetime_write_kbytes
4793857835

Of course, this is a command-line utility. If you don't have it installed (check via apt-cache policy smartmontools) then install it via sudo apt-get install smartmontools.  There is Gnome Disks Utility as GUI alternative and it comes with Ubuntu.

There are couple caveats however:

SMART information has to be provided by the device. If the device is fairly cheap and doesn't have such information, then it would require reinventing the wheel just like I originally wanted to do via monitoring /proc/diskstats file.
The specific attributes must be provided by the device. For instance, information on tnfd22 ssd found on smartmontools website doesn't provide such information.

There's also a bit of a problem: the resulting information shown is total history of reads/writes. Thus, you cannot extract reads/writes within last x number of days. At least it's not possible with smartctl or none of the tools I found thus far.  However, what you can do, is schedule a daily cron task  that will read /sys/fs/ext4/sda1/lifetime_write_kbytes and append the data with time stamp to a file. Later on, you can subtract differences to see how much was written in each day. For instance, contents of such command would be:

30 08 * * * bash -c '{ date; cat /sys/fs/ext4/sda1/lifetime_write_kbytes; echo ;} >> /home/user/my_disk_log.txt'


apt-get update errors immediately after yakkety update

Did you purge the squid-deb-proxy package or did you just remove it with apt? The latter does remove the package but not the entire configuration. Some parts of the configuration may still be active, you can remove them with sudo dpkg -P squid-deb-proxy.

The corresponding config files can be found in /etc/apt/apt.conf.d/.

You can regenerate your apt sources list at https://repogen.simplylinux.ch/ and then replace your default /etc/apt/sources.list. I would also make a copy of your /etc/apt/sources* for future references, and to possibly get an idea what went wrong there.


How to make Super-R active AND keep Super-L active? Bionic Beaver 18.04

I only know a way using an extra utility that is not included in the Ubuntu software sources. The utility is ksuperkey. It allows to remap modifier keys.

Install the utility and have the following command autostart when you log in. To this aim, you can create a .desktop file in your local .config/autostartfolder and supply the following command on the Exec= line.

Exec=sh -c "sleep 0.3 ; ksuperkey -e 'Super_R=Super_L'"

The "sleep" command introduced a small delay (0.3 ms) before running the command.

This remaps the Super Right key to the Super Left key, making it behave the same.

The full ./config/autostart/ksuperkey.desktop file may look as:

#!/usr/bin/env xdg-open
[Desktop Entry]
Categories=Utility;
Comment=Map right Super key to left Super key
Exec=sh -c "sleep 0.3 ; ksuperkey -e 'Super_R=Super_L'"
GenericName=Launcher
Icon=keyboard
Name=ksuperkey
StartupNotify=false
Type=Application
Version=1.0
X-GNOME-Autostart-enabled=true
Name[en_US]=ksuperkey.desktop


best place to learn ubuntu linux for a windows programmer newbie

I think Mono may lend itself to your existing strong skills:
Mono is...

  An open source, cross-platform, implementation of C# and the CLR that is binary compatible with Microsoft.NET

The essential parts of C/C++ development can be done with...

sudo apt-get install build-essential

The C compiler is cc and the c++ compiler is g++.
There are many great IDE's for C/C++. Codeblocks is one, eclipse, netbeans, anjuta.

Open your Package Manager and search for those things... mono, build-essential, ide's to try... Good starting hints?


Are you running the 64bit version of Ubuntu?

Then try installing 32bit pulseaudio (linking issues cause this incompatibility):

sudo apt-get install libpulse0:i386

Its important to mention that you need to quit SKYPE and start it again after executing that command otherwise PulseAudio will not be available in the list of devices


Failure to download "ttf-mscorefonts-installer". Not even reinstall works!

There is an issue with the sourceforge downloads (mirrors and redirects being slow and/or failing).
To workaround this you can grab the files manually from here for example:
https://sourceforge.net/projects/corefonts/files/the%20fonts/final/
and save them in the same directory (say mscorefonts).

The files are (from the installer):
Those files are in the Microsoft Windows self-installing format, and are named

andale32.exe, arial32.exe, arialb32.exe, comic32.exe, courie32.exe, georgi32.exe, impact32.exe, times32.exe, trebuc32.exe, verdan32.exe and webdin32.exe.

Make sure the package is purged and no remaining setup triggers are remaining:

sudo apt-get remove --purge ttf-mscorefonts-installer

Then in a terminal run:

sudo apt-get install ttf-mscorefonts-installer #(this will fail again most likely)
sudo dpkg-reconfigure ttf-mscorefonts-installer

That should give you a "graphical" interface in the terminal.
Then point to the directory with downloaded files like /home//Downloads/mscorefonts.

Make sure no deb files are in there, the seem to be picked up too and then it fails.

That fixed it for me.
I got a popup later for a post install action, I just let it run and it did not come back.
Please register at launchpad and mark yourself as affected to the bug:
https://bugs.launchpad.net/ubuntu/+source/msttcorefonts/+bug/1645253
so it will get more priority.
Thank you.


How to download dbgsym kernel for 15.10?

Try apt-get update and attempting to install again.

Looking at:
http://ddebs.ubuntu.com/pool/main/l/linux/

I see that particular dbgsym package is available as of today.


"By default, Nmap scans the most common 1,000 ports for each protocol. "

Try to specify -p4444


Remove language dialects from Thunderbird

I was able to resolve this by uninstalling the respective hunspell packages:

First I searched for all installed hunspell packages:

aptitude search hunspell|grep ^i

Which returned this list:

i   hunspell-de-at
i   hunspell-de-ch
iB  hunspell-de-de
i A hunspell-en-ca
i A hunspell-en-gb
i   hunspell-en-us
i A hunspell-en-za
i A libhunspell-1.3-0

Then I removed the unnecessary ones with:

sudo apt purge hunspell-de-at hunspell-de-ch hunspell-en-ca \
hunspell-en-gb hunspell-en-za

Note: A few redundancies still remain, which are caused by the fact that some packages install symlinks to other languages which then show up as duplicates in thunderbird. For example hunspell-de-de installs a symlink name de_BE.aff in /usr/share/hunspell which points to de_DE.aff. See https://launchpad.net/bugs/651586 (Thanks to Gunnar Hjalmarsson for pointing this out in the comments).


You COULD create your own xorg.conf by typing in a tty (not running gdm) the following:

X -configure

That will create a file called xorg.conf.new

To test the file type X -config xorg.conf.new

If you can load X and see the mouse and a good resolution then you can press CTRL+ALT+BACKSPACE to quit.

Copy then xorg.conf.new to the new location

cp xorg.conf.new /etc/X11/xorg.conf

Run startx to test.

Also the file does not exist since X.org does not needed anymore for some video cards (as i understand) only some Video cards have xorg.conf because of specific configurations (Like Nvidia and Ati). The rest of the X.org configuration options are in /usr/share/X11 like synaptics.

Now to test out if you have Direct Rendering do this:

glxinfo | grep -i "Direct Rendering" If it says YES then you can run several games. If it says NO then you might need more configuration. Also run glxgears to see how many FPS you have. If the glx commands are not there run sudo apt-get install mesa-utils

I can not guarantee that it will make it work for starcraft 2 (Remember you also need to have wine installed)


Okey. First mistake, you should have given a password while installing, if you have, enter that. If you haven't then follow me.

First enter grub boot menu

Press shift while booting to enter grub boot menu. then press e to edit the script.

Change kernel script to enter a root bash shell

After pressing e, you need to look at the second last line where it is written ro quiet splash $vt_handoff and change it to rw init=/bin/bash

Change your password

Okey once you've entered the bash shell (you will know that you can type commands when root@(none):~ $ is written) type passwd <YOUR USERNAME> and replace YOUR USERNAME with your usename.

It will ask you to enter a new UNIX password. Enter a password of your choice and now when you login, It will ask you for your password. Enter the password you chose and log in.

Download and Install updates and anything else you want! ;)

Now that you have your admin password, enter it when it asks you to authenticate and you can install whatever you want :)

NOTE

If you are not the admin of your account, then enter

  adduser (USERNAME) sudo

replace the (USERNAME) with your usename and you are an admin!

Please accept this answer if it worked for you.


Where do files ending with a ~ come from?

If you're using gedit to edit existing files, the default preference is to "Create a backup of files before saving". If you would like to change this default behavior, open gedit, then go up to the Menu bar and select Edit --> Preferences. Click on the Editor Tab, and Uncheck the box under File Saving in order to turn it off.

Another common ~ file creator is emacs - some would argue it's even more popular/common than gedit.


Kernel 4.15.0-48 causes Nvidia persistence daemon problem during boot

I had a similar issue needed to install nvidia-driver-390 after purging all the older drivers ...
sudo apt purge nvidia*
sudo apt install nvidia-driver-390
sudo apt install libnvidia-gl-390

have audio issues after but at least the system boots


How to not show minimized windows in GNOMEs activities overview?

The GNOME Shell extension called Hide minimized by danigm does this.
I found this on the answer to this question:
How do I hide minimised windows from Activities overview in GNOME 3?


The problem is that your java is not jdk but only jre. And it is installed a weird way.

Install java a normal way by

sudo apt-get install openjdk-7-jdk

and set

JAVA_HOME=/usr/lib/jvm/openjdk-7-jdk-amd64/


How can I install Cinnamon without the extra apps?

You have to start with installation of Cinnamon core metapackage with essential components by
sudo apt-get install cinnamon-core

If it is very big for you, then use
sudo apt-get install cinnamon-core --no-install-recommends

instead.


If you don't have a static ip adress you should enable dynamic DNS (for example with freedns.afraid.org). And you have to enable Port forwarding of Port 22 (or something else if you changed the port).

Than use the Dynamic DNS adress to connect with your server.

P.s. When using a FritzBox you can (and should) use AVM's MyFritz service as Dynamic DNS


$ sudo apt install curl

let it run and then:
$ curl --version

This shows up (mine is WSL2 on Windows 10 2004):
curl 7.58.0 (x86_64-pc-linux-gnu) **libcurl/7.58.0** **OpenSSL/1.1.1** zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL

libcurl (required to run curl) and OpenSSL is installed


How to add this unallocated space to ubuntu partition

From the running OS it doesn't work.
Boot from Ubuntu installation media.
Select Try Ubuntu without installing.
When on Live desktop open GParted.

Move sda3 to the left.
Move sda4 to the left.
Grow the size of sda4 (add the free space).
Grow the size of sda5 (add the free space).

Maybe you have to reinstall the Windows boot loader afterwards.
After having done this you have to reinstall the GRUB boot loader.
Maybe you also will have to edit the fstab file afterwards as well.
But all these additional things at least would be another question.

Note :

I tried to explain as simple as possible to make it easier for you to understand the general topic.


How do I list the contents of a package?

Use Synaptic Package Manager. Install it with

sudo apt-get install synaptic

Then go to Installed section, select a package then right-click to show its properties.

If you want to do it in Terminal, there is no need for Synaptic:

dpkg-query -L <package_name>

Package name is without .deb extension or version information (e.g. vlc, evince).


For what the output means see this answer. Note that mysql is probably not the cause of the problem. Linux by default overcommits memory and then when processes actually start to use it, it has to kill some other process to get some memory.

Often it chooses whatever is big and not much used. You can protect a process from being killed by doing

echo -1000 > /proc/999/oom_score_adj

where 999 is the process id. See man proc. The value is -1000 to +1000 to bias the oom killer (less likely to more likely), with -1000 = dont ever kill.

You should monitor process memory sizes, eg with top (type M to sort by memory).

The output is from the oom manager. php-fpm is probably part of apache. You can often configure apache to kill much reused threads that have grown too much; its a choice between faster cgi and less memory being wasted.

You can temporarily disable overcommitting memory with

sysctl vm.overcommit_memory=2

then you are more likely to have the memory-hogging process crash, instead of some random process being killed. It's not usually recommended as a permanent setting.


How to associate file extension (not file type) for a particular application?

Rename the file you have as _anything_.task (where _anything_ is something suitably descriptive.)

First you need to create an XML file with the extension information in it. (If you wish, copy the text below into a new text file and save it as task.xml.)

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/taskcouch">
<comment>TaskCoach File</comment>
<comment xml:lang="bg">Taskcoach</comment>
    <comment xml:lang="cs">Taskcoach</comment>
    <comment xml:lang="de">Taskcoach</comment>
    <comment xml:lang="es">Taskcoach</comment>
    <comment xml:lang="eu">Taskcoach</comment>
    <comment xml:lang="hu">Taskcoach</comment>
    <comment xml:lang="it">Taskcoach</comment>
    <comment xml:lang="ko">Taskcoach</comment>
    <comment xml:lang="nb">Taskcoach</comment>
    <comment xml:lang="nl">Taskcoach</comment>
    <comment xml:lang="nn">Taskcoach</comment>
    <comment xml:lang="sv">Taskcoach</comment>
    <comment xml:lang="uk">Taskcoach</comment>
    <comment xml:lang="vi">Taskcoach</comment>
<glob pattern="*.task"/>
<alias type="application/taskcoach"/>
</mime-type>
</mime-info>

You now need to save or copy this new file into the directory

~/.local/share/mime/packages for a per-user file association or
/usr/share/mime/packages for a system-wide file association.

Once that is done, run

update-mime-database [MIME-DIRECTORY]

where [MIME-DIRECTORY] is the previously chosen directory minus the /packages suffix. (Use sudo for the system-wide association.)

Now, open your file manager and right-click on anything.task and select taskcoach as the default program with the open with option in the context menu.

Job done. All .task files will now open with taskcoach!


The suggestion:

You could just create 2 partitions on your disk.

a small partition to hold /boot (unencrypted)
the rest of the disk, to be used as a physical volume for encryption.

I'd then configure encryption on the second partition and use LVM to created 2 volumes:
/dev/vg0/root and
/dev/vg0/swap

Advantages:

You don't have to worry about encrypting individual partitions.
Apart from /boot which holds your kernel, everything else is encrypted. Which protects you from someone rebooting your machine, entering a single user mode and modifying your OS to allow them to easily get your data from your encrypted home anyway.
You only enter the encryption key once per boot.
I know you said you're the only user but you could add separate passphrases (key slots) for other users if you had to.

As to the other part of your question: I don't remember if this method asks repeatedly for the password and I don't think this by itself would be a security risk, as long as there's a delay after an incorrect password is given (to thwart brute-force attacks).

How it's done:

I never use the GUI for installation and apparently you cannot use it to create an LVM on top of LUKS-encrypted block device.

The workaround I've tested:

Download the netboot ISO image for amd64 or i386 and burn it onto a CD.
When you boot from it, choose 'Install' from the menu
Answer a few basic questions, create a non-root user, and choose NOT to encrypt the home directory. This isn't what we want here.
When you get to the 'Partition disks' dialog, choose 'Manual'.
Create an empty partition table on the disk if you need to and then 2 primary partitions.first primary partition for /boot and make it 512MB. This is where
your kernel and initrd images will reside and will remain
unencrypted.second primary partition to cover the remaining
space and choose its type as 'physical volume for encryption'.

Proceed to Configure encrypted volumes, save the changes and encrypt /dev/sda2, choose a password and finish. At this point you'll have an encrypted volume sda2_crypt
Choose to use it as a physical volume for LVM

Proceed to configure the Logical Volume Manager. Create a volume group vg0 on /dev/mapper/sda2_crypt
Create 2 logical volumes within that group. swap - however large you need it to be (I chose 1GB)root - use the remaining space
At this stage, you should see the following configuration:

Choose an FS for your root logical volume and configure it to be mounted as / and  the swap LV to be used as swap space:

Write changes to disk and proceed with the installation.
Later on you'll be asked which packages to install (tasksel) and you can safely go with ubuntu-desktop
When asked where to install Grub to, I chose MBR since I don't have any other OSes on my machine.

And that's really one of the few reasons I always choose the netboot images. I don't want to be held back until the developers port the functionality that works perfectly well in a way that's pretty enough to be included in the GUI installer.


bluetooth is disabled on my ubuntu 14.04

Use hardware buttons to enable ...
Might be fn+F2 or F3 or F* depending on your laptop


The wise answer is to say : It's too soon to tell. Wayland is too young. Many bugs where a fix can slow down things.

The logic answer is to say : yes, it will be faster : there is another newer structure, fresh coding, direct help from the professionals... many things that xorg can't do without breaking everything.

Remember when ext4 went. It was a lot faster than ext3. There was a big bug and we lost almost all the performance. Nowaday ext4 is faster but not like when it came first.


To install VNC just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo apt-get update

This updates the package list for apt.

Then you'll need to install the Gnome components using Software Center:

Install via the software center

Or Using Terminal:

sudo apt-get install gnome-core

To install VNC server using Software Center:

Install via the software center

Or Using Terminal:

sudo apt-get install vnc4server

For more info just take a look at Complete VNC Server Setup.


Is java binding included in opencv ubuntu package?

Your version of OpenCV doesn't have Java bindings, they are available from version 2.4.4 - Java bindings didn't used to be included by default in OpenCV, but it now supports Java bindings;  - announcement.

Get OpenCV with desktop Java support


Is it safe to use gdebi instead of Ubuntu Software Center to install .deb files?

It should be just fine to use gdebi the way you are using it.

Both accomplish the same thing.  Gdebi does relate to internal apt-get to satisfy dependencies and install .debs.  It worked in previous versions of Ubuntu, it will work in Maverick.


How do you hotplug-enable new CPU and RAM in a virtual machine?

These can be enabled through the use of the /sys filesystem using root credentials.

For the CPU, you change the 0 to a 1 in to the appropriate file of the pattern: /sys/devices/system/cpu/cpu*/online.

For the RAM, you find the state in the files /sys/devices/system/memory/memory*/state and change the contents from offline to online.

The script below will turn all CPU and RAM online for you.

#!/bin/bash
# Based on script by William Lam - http://engineering.ucsb.edu/~duonglt/vmware/

# Bring CPUs online
for CPU_DIR in /sys/devices/system/cpu/cpu[0-9]*
do
    CPU=${CPU_DIR##*/}
    echo "Found cpu: '${CPU_DIR}' ..."
    CPU_STATE_FILE="${CPU_DIR}/online"
    if [ -f "${CPU_STATE_FILE}" ]; then
        if grep -qx 1 "${CPU_STATE_FILE}"; then
            echo -e "\t${CPU} already online"
        else
            echo -e "\t${CPU} is new cpu, onlining cpu ..."
            echo 1 > "${CPU_STATE_FILE}"
        fi
    else
        echo -e "\t${CPU} already configured prior to hot-add"
    fi
done

# Bring all new Memory online
for RAM in $(grep line /sys/devices/system/memory/*/state)
do
    echo "Found ram: ${RAM} ..."
    if [[ "${RAM}" == *":offline" ]]; then
        echo "Bringing online"
        echo $RAM | sed "s/:offline$//"|sed "s/^/echo online > /"|source /dev/stdin
    else
        echo "Already online"
    fi
done


I downloaded Ubuntu onto one of my HDD's and was then going to load it into a 4GB keyfob Any ideas on how to fix if possible? Tks

Did you run the installer already(booted into the flash drive and installed Ubuntu) / finish 'burning' to the usb drive you wanted the installer to be on?
From a close look at your screenshot you sent of the disk partitioning utility on Windows, you are just looking at the partitions of that specific device, in this case the USB you burned it onto. Your hard drive's files are still there--you're just looking at a different device and it's own partitions, which in this case, is a single partition containing the Ubuntu installer you need to boot from to install Ubuntu.
I would check the drives I have highlighted and make sure all the data/partitions you have on them hasn't been lost, just to be sure, but you're all good from a first glance. Windows seems to think that flash drive you have inserted is a CD, and there's a fix for that.
Assuming you've had a USB disk that got formatted as CDFS, you should be able to just reformat it to NTFS from Windows explorer, and if not, there are several tools you should be able to use to use to do the trick.


is there a use case for `apt-get install` without `update`?

apt-get update updates the lists of available packages and their version numbers.

The use case you are searching for could be: If you want to run apt-get install twice in a short time, you only need to run apt-get update once because the package lists are unlikely to have been changed in the meantime.


From man bash:

  When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and  executes  commands  from  the file  /etc/profile, if that file exists.  After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.  The --noprofile option may be used when the shell is started to inhibit this behavior.

and

  Bash attempts to determine when it is being run with its standard input connected to a network connection, as when executed by the remote shell daemon, usually  rshd,  or  the  secure  shell  daemon  sshd.   If  bash  determines it is being run in this fashion, it reads and executes commands from ~/.bashrc and ~/.bashrc, if these files exist and are readable.  It will not do this if invoked as sh.  The --norc option may be used to inhibit this  behavior,  and  the --rcfile option may be used to force another file to be read, but rshd does not generally invoke the shell with those options or allow them to be specified.

In other words, ~/.profile and ~/.bashrc will normally both be read when you start bash, so you can put it in either.

You can also use the source luke in either file to load the file luke where you would define all your Javan variables. See help . or help source for details.


I installed Ubuntu alongside Windows 7 and now I can't start Windows

Try running

sudo update-grub

in a terminal in Ubuntu and restart your computer. An option to boot Windows may then appear when you turn on your machine.


cv2.error: (-215) size.width>0 && size.height>0 in function imshow

The code waits too long to stop with if cv2.waitKey(100) & 0xff == ord('q'): so change the 100 to 10 as follows: if cv2.waitKey(10) & 0xff == ord('q'): After changing this line of code, your Python script will work perfectly in the terminal.
This link lists to a webpage with very short sample .avi videos that are perfect for testing your code. If you are running the script from the terminal the .avi video must be located in the current directory.
If steps 1 and 2 didn't work, as usual Anaconda is the culprit. Anaconda is basically a Windows/Mac program that is completely duplicated by packages in the default Ubuntu repositories except that Anaconda has problem finding any Python modules which weren't installed by Anaconda unless special configuration is done to tell Anaconda where the missing Python modules are located. Or you can give up and install OpenCV from the default Ubuntu repositories and stop messing with Anaconda.

sudo apt install python-opencv


This has been asked numerous times, each with a different title.

Follow these instructions (read all instructions first):

Press Ctrl+Alt+F1 and log in.
Execute these commands:

export DISPLAY=:0
ccsm

Press Ctrl+Alt+F7 (or Ctrl+Alt+F8 sometimes) to get back to the graphical display where there should be a CompizConfig Settings Manager window.
Enable the 'Ubuntu Unity Plugin'
Never disable this plugin again

source


Ubuntu running on a Acer Chromebook does not detect standard audio output, but does have HDMI out

From here (at the end of the page) , headphones works using alsamixer (look here ):
 press F6 to select 2nd device , move to "headphones" fader, press "m" to unmute.


Cannot open mailbox /var/mail/USER: Permission denied No mail for USER

The user fmaster is probably not in the mail group. You can run groups command to check in which groups you are.

To add fmaster to the group mail use the following command:

sudo adduser fmaster mail

And after run:

sudo chmod ug+rw /var/mail/fmaster


Help with reinstall Windows XP instead of Ubuntu

If you just set the BIOS to boot from CD rather than HDD (hard drive), it will start your Windows XP installer up for you. Once it has started, simply delete all partitions on the hard drive and create a single big one for the Windows XP install. That wipes Ubuntu completely, especially since it will also write Windows-specific contents to the hard drive's MBR (master boot record) -- the thing where the Ubuntu's boot up menu now lives.

The only possibly tricky part in all this is to find your BIOS settings. If you still have it, your motherboard's manual should tell you how to do it.

If not, restart your computer and on the first screen that comes up look for a line that says something along the lines of "Press  to enter setup..." or similar (common keys are Delete, F2, F12, Escape). That's what you want to do. Keep restarting the system until you find it. Hit Control-Alt-Delete if you missed it.

Once in the BIOS's setup, you look for something that is related to the boot order. Set it so that the CD comes before the hard drive, save your settings, and exit the setup. Your computer will restart itself and it will boot from CD, starting the Windows installer for you.

Good luck!


Installing landscape-server > ERROR landscape-setup superuser

The problem was that I removed the packages instead of purging them and that mess up with Landscape config files and database. So I've decided to do the manual installation that can be found here: LDS Manual Installation

This end up to be a more elegant and clean installation.


Libreoffice equivalent to MS Excel TABLE

LibreOffice Calc has a facility called Autofill.

Let's say you have a column with the header cell, A1, called Column A. Cell A2 has a001, cell A3 has a002, cell A4 has a003.

Select cells A2 downwards for as much as you need. Then Click on Edit, Fill, Series, to open a window which has the Autofill option.

Note that the filled cells you include in the selected area must have a pattern that Calc can recognize as some sort of pattern to autofill.


Error creating an .img file from an .ISO (MD5 verified)

Try:

hdiutil convert /path/imagefile.iso -format UDRW -o /path/convertedimage.dmg


Here is what I have noticed about such errors.

Your system program error is given a default title (like "SEGFAULT in package XXX") and sent, together with data that may be relevant, to Launchpad (bugs.launchpad.net). There, your error is counted, and the count contributes to what is called the "hotness" of the bug. The hotter the bug, the more effort is put into resolving it, presumably.

Launchpad is a Canonical-owned website dedicated to tracking and resolving bugs. If you notice the title of the bug, you may even be able to find it there and see what is being done about it. On the Launchpad site you can even click an icon to show that this bug affects you, making the bug even hotter.


Does it cause compatibility issues?

It should not, but it since less people use it, it is a little bit less well tested.

  Does it reduce the lifespan of my hardware?

No. This kernel is optimized for a lower latency (versus throughput). Running the -lowlatency will mostly change in which order the load will be handled, it will only change the load quantity by a small amount (because switching task is a load in itself).

Since the workload is mainly the same, I expect the wear to be mainly the same. It is perhaps a good idea to look at the temperature (of the CPU, HDD and mainboard) if you switch to the -lowlatency kernel, since it's possible that some power-saving features could be disable while using this kernel.

  ... but I am wondering if it has any downsides?

The -lowlatency kernel is somewhere between the -generic kernel and the real-time linux kernel.

According to this wikipedia article, real-time operating systems are optimized for the response time and not the throughput. The -lowlatency kernel will be able to switch to a task faster and more frequently than the -generic kernel.

The -lowlatency kernel is thus recommended for studio work, because you need the computer to respond as fast as possible at your requests (i.e: MIDI events and so on). The -generic kernel is for when you want to browse the internet, while the same computer is serving the files for the whole office.


How to change root password for mysql and phpmyadmin

You can change the mysql root password by logging in to the database directly (mysql -h your_host -u root)  then run

SET PASSWORD FOR root@localhost = PASSWORD('yourpassword');

phpmyadmin should use that password so not quite sure what you mean by "for both".

Make sure to set the new password into phpmyadmin's config.inc.php too, at line $cfg['Servers'][$i]['password'] = 'yourpassword';Otherwise, phpmyadmin may not work, echoing

Access denied for user 'user'@'localhost' (using password: YES)


Trying to dual boot 12.04 on Mac from DVD but rEFIt only gives "boot from osx" option. How to fix?

My understanding is that the standard Ubuntu install disc has problems booting on Macs. The easiest solution is to try a Mac-specific variant, which ironically only boots in BIOS mode. (Intel-based Macs use EFI firmware with a BIOS emulation layer, and Linux has long supported EFI booting.) The result will be an installation that will have to boot in BIOS mode unless and until you change that.

Another option is to force the issue by fiddling around with boot managers and boot loaders. It's possible that installing the ISO-9660 driver from rEFInd so that rEFIt can read it will do the trick; in theory, that should make Ubuntu's on-CD boot loader visible to rEFIt. (You could optionally replace rEFIt with rEFInd, too, but that's not required.) If this doesn't work, then forcing an EFI-mode boot is likely to be much more complicated, and I don't have step-by-step instructions handy.


I believe that this is what you want:

sh -c "cd /home/your_user_name/Linux\ Games/Cave\ Story && ./doukutsu"

or just only:

/home/your_user_name/Linux\ Games/Cave\ Story/doukutsu

where your_user_name is the name you have as a user in the system.

The your_cave_story_directory_here is actually meaning the folder where the unzipped game is.

Additionally you may want to read How to add programs to the launcher?


Finding URL to VirtualBox Ubuntu Apache2 server

There are a number of factors at play, mainly your Apache configuration and the network setup of your VM.

You are on the right track with the Apache setup, but I would use netstat to find the port your Apache is listening to:

gomo@wks120:~/$ sudo netstat -puant | grep apache | grep LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1577/apache2
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1577/apache2

This shows I have a process called apache2 with PID 1557 listening on port 80 and 443 on all interfaces (0.0.0.0).

For the network setup part, it depends on what type of networking you are using for your virtual machine (found in VirtualBox under each VM's Settings --> Network page. The most common options are either bridged or NAT.

Bridged means the VM will be granted access to the physical network your host computer is connected to. Things would work as if you plugged the VM onto the same switch your computer is plugged in to. You typically run virtualized servers this way.

NAT means a local network will be created just for your VMs. This is similar to how your average home router/wireless AP works: VMs can access outside networks (such as your LAN or the internet) but other computers can't reach your VMs.

All in all, set up bridged networking (restart the VM's network or the entire VM after changing this) and check your apache port. You should be able to connect without problems from your host machine.


Pulseaudio does not remember default sink

Problem

Personally, I have many sources and sinks and since upgrading to Xubuntu LTS 18.04.1, the selected default source and sink happened to be the wrong ones.

One can set the "fallback" output and input device in pavucontrol by means of a darkened check mark —which is not very clear to any user!!! This did not help much as these settings are temporarily of nature and are lost with every reboot.

Listing all available audio interfaces

$ pactl list sinks short
$ pactl list sources short

Test setting PulseAudio defaults

$ pactl set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo
$ pactl set-default-source alsa_input.pci-0000_00_1b.0.analog-stereo

Permanently setting the defaults

$ sudo gvim /etc/pulse/default.pa

### Make some devices default
set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo
set-default-source alsa_input.pci-0000_00_1b.0.analog-stereo


Running Minecraft on directly on top of the kernel frame buffer is not possible to my knowledge, nor would it be in the developers interest since they would have to implement a lot of stuff themselves that is being done for them in X11 (like input management, display device management, ...). I don't think they are interested in that...

As you have indicated in the comments your actual goal is to make Minecraft run faster by removing layers. While the idea of getting rid of the X11 server might sound good it would hardly improve your framerate compared to using non-composited X11! If your window manager doesn't use compositing X11 will basically just redirect all OpenGL calls (what Minecraft uses for rendering) directly to the graphics card.

How to disable compositing

Some things to note:

Compositing itself isn't necessarily bad for performance, just the way X11 does it sucks!
Disabling it will cause transparent surfaces to be filled with black instead of whatever is behind them.
Most desktops nowadays use compositing. In some of them (such as Ubuntu's default desktop Unity and GNOME Shell) you cannot disable compositing at all.

In Xubuntu/XFCE4:

Open the "Window manager tweaks"
Select the tab "Compositor"
Uncheck "Enable display compositing"

In Kubuntu/KDE4:

You can disable compositing at any time by pressing Alt+Shift+F12. In the window management settings there are also some options to disable compositing when a matching application is running. Note however that compositing is automatically disabled when a single application runs in fullscreen mode on one screen. (Source)


If you plan to hibernate you need 10-12GB swap. If not, 2-4GB swap should be sufficient unless you do really heavy computing.

A separate /boot partition is unnecessary. Many users that use a separate /boot partition run into problems later as they make it way too small and run out of space after a couple of kernel updates.

Create an 80-100GB partition for the Windows install. If you want a shared data partition also make that and format it ntfs. Leave the rest of the drive unallocated. When installing Ubuntu choose "use unallocated space" and let the installer partition it.

Since you are using Windows 7, I assume you are installing in Legacy/CSM mode. In Legacy mode, it is very important to install Windows first then Ubuntu for the following reasons:

Windows does not see non-windows OSs so the bootloader will not auto configure to boot linux. And manual configuration is very difficult.

Both systems will write their bootloader to the MBR. So we want Ubuntu's bootloader (grub) in the MBR when we are finished, because grub can see and boot Windows.


drivers for Samsung MBG4C eMmc harddrive

The drivers should be included with the standard linux kernel and there should be nothing to install.

Unlike windows, most drivers are included in the mainline kernel. You will notice you don't have to wait for "installing device drivers" every time you plug something into the USB port.

That is not to say that you will never need to install any firmware but that is usually only the case for a few very specific and sometimes unsupported wifi cards and or graphics cards etc.


The  command is

sudo chown roey:roey .Xauthority

1st roey is the user, 2nd is the group roey


Facebook photos don't appear on firefox and google chrome

Go to Account Settings > Security Settings > Secure Browsing and uncheck this option: "Browse Facebook on a secure connection (https) when possible". Then save changes and refresh Facebook.


/boot/map~ OK to delete when /boot/map does not exist?

This is almost certainly an unneeded file as the naming convention for the map files in /boot is as follows:

andrew@athens:~$ ls /boot | grep -E *map*
System.map-4.4.0-15-generic
System.map-4.4.0-22-generic

Test this on your own system, this is on Xenial Xerus 16.04. The file can be safely left in place but if you are at all worried simply back the file up for a few days:

sudo mv /boot/map~ /boot/map~_bak

and delete after a period of safe running. This is a very conservative approach...


Why one would use default Ubuntu kernel instead of latest stable kernel?

So the question you need to ask is 'Who decided "latest stable kernel" is 3.18?'. Wat that decided by The Kernel People or by Canonical? (the answer: the Kernel People).

  Why Ubuntu ships its own kernel instead of latest stable build?

The Ubuntu kernel configuration files need to be added, tested and tweaked to the new kernel. That will cost time and resources (the idea is that it is better spent on the next Ubuntu release). So the latest stable release according to the Ubuntu Kernel Team is currently 3.16.

Kernel/dev/extended stable and mainlinebuilds should be an interesting read.

Besides that:

We will get a kernel update every 6 months that is tested and stable so it is not a long wait (less if you assume the kernel release is not out on the day a new Ubuntu appears).

How many end-users do you believe are waiting for kernel 3.18? Unless you are a developer (and you will know how to upgrade the kernel; and you will know where to find an upgrade method) there should be hardly any need to upgrade your kernel. Yes, there are some interesting features in any new release but those are not to interesting for the mainstream users of Ubuntu.

And we will get those features in 3 months anyways.


Can I customize how often Ubuntu One syncs to the cloud?

You can do it manually, disconnecting from Ubuntu One service and reconnecting when you want the syncronization. With the Ubuntu One Indicator, mentioned also on previous answer, you can easily disconnect and connect, clicking on that indicator menu.


In a dockerized ubuntu instance how do I get nano to display/work right?

I've since switched terminals to the Windows Terminal from the Windows Store on a more recent release of Windows 10 (Build 19042, but 20H2 should work).
I'm also now using Docker Desktop with WSL2, which I wholly recommend..
Between these two changes, I rarely see any oddities now.


WiFi - Does not connect because of different MAC's

you could try:

sudo iwlist

to bring up a list of wifi points with their respective AP MAC addresses

then find the one with the best signal quality, and manually configure what network to connect to using:

sudo iwconfig wlan0 essid essidnamehere
sudo iwconfig wlan0 ap MACaddresshere

and to finish off,:

sudo dhclient wlan0

I had the same issue before, and doing the above seemed to help me stay connected when I found a new spot to work. The issue got fixed for me though through one of the recent updates on natty.


after installing ubuntu14.04 alongside windows 10 after few days windows not starting

Are you using GRUB? i.e you get a list of options to boot to .. Ubuntu .. Windows etc.

If you're at that point and windows is listed then the issue is probably with windows; as that menu just passes control over to the windows bootloader. So there's no issue with Linux.
The windows repair can be problematic at most times, like never finding a problem and just wanting to reboot. You might be able to boot into Safe mode to try find the issue. Just keep hitting SHIFT after you choose windows basically, it's a pain to get sometimes.

Be aware that if you repair or have to reinstall Windows it might overwrite grub so you'll only be able to boot windows until you reinstall GRUB again. Here's a link just in case


If you have real patience then you can achieve with pulse audio but you need to a huge process
http://www.webupd8.org/2013/03/install-pulseaudio-with-built-in-system.html


Create new, separate mybackup user accounts on the client and server
Lock the passwords with sudo passwd -l mybackup for these accounts to prevent direct login
Allow, via sudo, those new accounts to run a very specific /usr/bin/rsync/ --some-long-command /from/here /to/there command as root with NOPASSWD: in /etc/sudoers using sudo visudo
Create new passwordless SSH keys for the local to the remote host using sudo -u mybackup ssh-keygen
Add to sudo -u crontab -e on one or other end to run the remote rsync using ssh and the keys as the transport

This way the only command that can be run as root is the one that you have explicitly allowed, and the only remote user that can activate it is the holder of the other half of the installed ssh keypair, which because it also has the password locked can only be somebody with sudo access themselves, or the crontab you set up.


Permission denied error when using easy_install

You need to use sudo. Even if your logged in user has admin privileges, you need to use sudo for the command to have them. (Unless you are logged in as root, but you don't want ot do that)


You are opening that file in a folder owned by root! Hence you need root access to that file. Type this code in the terminal:

sudo -H gedit /etc/php5/apache2/php.ini

When the file opens edit the file and you can save it normally by pressing Ctrl+S


Firefox 34 - Black screen playing Adobe flash videos

The Flashblock add-on is incompatible with Firefox 34; remove the add-on.

The following might work (untested):

Start Firefox and press Alt+h to open the Help menu
Press t to select Troubleshooting Information
Click the button for Open Containing Folder (or Open Directory)
Create a folder (directory) named Chrome
Create a new file named userContent.css
Copy the following text into the new file:
/* Flash Block */
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("youtube.com"){
#theater-background { display:none !important;}
}
Save and close the file
Restart Firefox


How to debug why 'systemctl hibernate' works, but 'systemctl suspend-then-hibernate' not?

As on Ubuntu 20.04 (systemd 245) you have also to include the following line under the sleep section:
AllowSuspend=yes
AllowHibernation=yes
AllowSuspendThenHibernate=yes

Further are you sure that you want to go into hibernate state after 10 seconds in suspend state?


how do I create a subfolder with the Music folder, please?

Open nautilus, this is the usual GUI file manager shipped with Ubuntu. There navigate into your music folder and right click into the empty area.
There will a drop down menu pop up where you can choose to create a new folder, press that choose your name for that new folder and you're done. Do this as often as needed. This way when clicking on a file/folder symbol you as well get multiple options for that your selection.


Should I use 16.04 LTS for a dual-core Celeron?

Even though the Intel Celeron N2840 processor with 2,16 Ghz is not the fastest processor at all, the TOSHIBA SATELLITE C50-B-14Z notebook is absolutely ready to run fine with Ubuntu 16.04. Most important is that the machine has 4 GB RAM and this is enough for running Ubuntu 16.04 with the standard Unity desktop environment and every other available desktop environment.
When it runs with Windows 8.1, which was pre-installed, it will run with Ubuntu even better ...


I experienced the same problem on installing Field3D. It seems that the file name is libboost_thread.so instead of libboost_thread-mt.so. So it is a bug and should be handled by changing the term in the source file.

For field 3D, change buildSupport.py. Search for the -mt and remove. Then Scons runs through.

Also see this question on stackoverflow.


WSL: Is there a conditional to detect "Open Linux Shell Here" case?

I would change the ~/.bashrc enhancement to something like this:

CurrDir="$(pwd)"
if [[ "$CurrDir" == "$SystemDir" ]]
then
    cd /path/to/sensible-dir-name
Fi

Where $SystemDir is your System32 directory. Always remember how \ and / differ between Windows and Linux paths:

Bash script to convert Windows path to Linux path

Suggests using:

sed -e 's#^J:##' -e 's#\\#/#g'

That said in your instance you could probably hard-code the path.


Normally, it would be sufficient to just use ssh directly, for one-off implementation.

One-Off Operation

as long as yesh is super-user and you know the password for yesh, you can do the following to update over ssh.

ssh as yesh (assumes you have the password).

ssh yesh@myserver.com

Change to make script executable

Ubuntu> sudo chmod 755 /home/yesh/yesh_final_V1.sh

Scripted Operation

The author of the question commented that they wish to do this in scripted form.  To achieve this, you can use the "sshpass" functionality, which has to be present on the host computer.

sudo apt-get install sshpass

To use it, you may find the below bash script example useful:

function scripted_remote_operation {
    sshpass -f password.txt ssh -o StrictHostKeyChecking=no -t -t yesh@myserver.com -o StrictHostKeyChecking=no <<EOF
sudo chmod 755 /home/yesh/yesh_final_V1.sh
exit
EOF
}

This can be executed from the host computer as part of a script, automatically logging in, making the change as requested.  Unfortunately, this will require that the password requirement for users with admin privileges, be disabled (NOT RECOMMENDED).

For example, in the directory

/etc/sudoers.d

You could include the file

010_ubuntu-nopasswd

with the contents

root ALL=(ALL) NOPASSWD: ALL

This information is provided for clarity only.  It is absolutely not a good idea to disable the sudo password on a machine.

Possible Answer Without sudo on the remote machine

If the file is installed remotely with yesh as the owner, then the chmod operation can happen without elevated privileges, and the chown operation can be included in the same sshpass script.


When I type sudo -i nautilus, nautilus opens and shows an error

Let me preface my answer by saying it's best not to use sudo with nautilus! That being said, if you still want to, be really careful and ...

You may be able to drop the -i switch so that your command is sudo -H nautilus. This would prevent you from seeing the error you're seeing.

If you want to keep the -i switch:

Make sure that /root/.config/nautilus is a directory and not a file, and try running these two commands just to make sure permissions are correct.

sudo chown root:root /root/.config/nautilus
sudo chmod 755 /root/.config/nautilus

Note: those last two commands will only work in /root/.config/nautilus already exists

Now, try your command again.

If it still doesn't work:

Perhaps something has happened to the permissions on  the parent directory

sudo chown root:root /root/.config
sudo chmod 700 /root/.config


How can the "Save File" dialog window of Chrome to be set to focus when saving?

A recent update appears to have changed this behaviour back to what it was. :)

EDIT: I'm observing this behaviour in 39.0.2171.71 in Ubuntu 14.10.


Is there a good PS2 emulator for Ubuntu 13.10?

You have to use update before you install the software.

sudo apt-add-repository ppa:gregory-hainaut/pcsx2.official.ppa
sudo apt-get update && sudo apt-get install  pcsx2-unstable


If you have more than one computer, it is possible to install without physical media by booting over the network using PXE. It's not necessarily an easy process, but quite satisfying and good for learning if you're willing to see it through. Here are some of the references that I used (please excuse the sites, the other computer was an old MacBook):

http://hints.macworld.com/article.php?story=20100501044411838
https://wiki.koeln.ccc.de/index.php/Ubuntu_PXE_Install


Linux, yes. Containers are chroots, not VMs though, so you cannot run other incompatible operating systems. You need a VM to run Windows on top of Ubuntu or any other Linux.

As for other distributions on top of Ubuntu (or any other distribution running LXD), everything will generally work as long as you're wanting to run a compatible architecture (i386 on i386, or amd64 or i386 on amd64, for example). Anything which needs specific kernel features which may not be enabled in the host system, won't work inside the container, as it's not a VM.

If you need VMs, you'll need Openstack and similar to run VM images instead of LXC/LXD containers.


How to install Windows 10 alongside with ubuntu 14.04

It is NOT possible to install Windows on the same Partition with Ubuntu.

The things you CAN do however are:

Create a separate partition from unallocated space on the hard drive or shrink the ubuntu partition to get back unallocated space and then create a partition for windows.
or Install windows inside a Virtual Machine (Virtualbox or VMware) inside Ubuntu. This way you don't have to play with hard disk partitions.

Updating GRUB after installing Windows:

Installing windows will rewrite MBR n you would not get the GRUB bootloader screen to select which OS to boot into. For this see This.


"No gpg key set matching launchpad one found" when uploading app using Quickly

You need to add your OpenGPG key to launchpad, and your SSH key as well as your public key.

SSH: https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair

OpenGPG:
https://help.launchpad.net/YourAccount/ImportingYourPGPKey

Hopefully that should help :D


No,

there is no general activity log.

And it would not be easy to have one:

There are many places where files are affected. For a complete log, the logging would need to be implemented by the system level operations on files. But that would mean it would log many more irrelevant operations than useful operations.

Also, the log would contain lots of potentially private information, in file names, and in when something was done.

I do not expect it to be the case,
but there may be log stored by the specific application that was used to work with the files. (If you know which were used, add it to the question.)


Multi-boot -- How to safely delete a distro?

Thanks to the helpful comment from @oldfred, I checked more carefully, and found that Kubuntu was looking for the Manjaro swap partition. Apparently, that old swap partition was detected during the Kubuntu installation, and it was employed, instead of creating a swap file, which is usually done by default with new Ubuntu installations.

So the answer to my question is:

1 Disable Kubuntu's use of the swap partition

2 Create and enable a swap file

I was successful in both steps, following this tutorial:
https://www.linuxuprising.com/2018/08/how-to-use-swap-file-instead-of-swap.html

Afterwards, I deleted all the Manjaro partitions, and Kubuntu still boots up at least as fast as before.


Problem installing 16.04 on Mac: Created BIOS boot partition

First, the GParted message about the primary GPT data being corrupt but the backup being OK means that there's a SERIOUS problem with your partition table. FIX IT IMMEDIATELY!!!! If you don't know how to do this, consult my page on the subject and/or post another question. (You'll need to provide details, like the output of gdisk's p and v commands, if you expect any real help.) Continuing to use a computer with a damaged partition table more-or-less guarantees that you'll have serious trouble sooner or later -- and in this context, "serious trouble" could mean a complete loss of all the data on your computer! Note, however, that attempts to repair damaged partition tables can sometimes lead to even worse problems, so don't go mucking about randomly. Back up the whole disk and, if you don't know what you're doing, ask for help!

Second, now that you've installed rEFInd, you should be able to boot either OS X or Ubuntu from rEFInd. Since Ubuntu isn't launching, there's obviously a problem, but you've provided insufficient details for a proper diagnosis. Please run the Boot Info Script. This will generate a file called RESULTS.txt. Post that file to a pastebin site and post the URL to your document here. This will give us more details about your configuration, which may help with the diagnosis. Also, please describe what icon and description is associated with the Ubuntu/Linux option in rEFInd, and describe what happens when you try to launch it. If there are multiple Ubuntu or Linux options in rEFInd, try them all, and describe what happens for each one when it fails.

I recommend you add a comment to this answer and edit your original question to provide the new information.

EDIT:

It sounds like your Ubuntu boot problems are related to video drivers. There are numerous questions and answers on this site about "black screen" problems when booting Ubuntu, particularly in EFI mode. I recommend you search for them. You can probably overcome the issue by adding an appropriate keyword or two to the kernel's options, but what option will work depends on your hardware. In rEFInd, you can add options by hitting F2 or Insert twice, rather than Enter, when launching the boot/vmlinuz-* entry. If you find kernel options that work, you can then add them to the /boot/refind_linux.conf file to make them permanent. (If that file doesn't exist, the mkrlconf script that comes with rEFInd will create it, but you must run that script via sudo.)


How do I check Ubuntu is using my AMD graphics or built-in intel?

Not all graphics adapters are shown as VGA.

You can run lspci -k | grep -EA3 'VGA|3D|Display' to see all adapters.

To find out which is in use, you can run glxinfo | grep OpenGL.


I installed the Chrome deb package from the terminal: sudo dpkg -i google-chrome-........deb
After you get an error i run : sudo apt-get install -f


Using KDE's Dolphin file manager dual view the Norton Commander way?

Currently the feature to quickly move between views  is not available.

See bug report @ https://bugs.kde.org/show_bug.cgi?id=171743.


How to disable console-kit-daemon in Xubuntu 12.10?

Please follow these steps to disable it:

Kill the console-kit-daemon process if it's still running. You can use pkill or kill command and use: $ps aux| grep console-kit-daemon to get the id of the process.
Remove the file /usr/share/dbus-1/system-services/org.freedesktop.ConsoleKit.service (or move it to some place where you could restore it, if necessary). If can't find this file here please use locate/find command to find this file.
Reboot and you will see that console-kit-daemon no longer automatically starts up.

If it doesn't work please feel free to ask or you may want to try removing this service from /etc/init.d/ folder if available or use service command to stop this service.


The easiest solution for a program that is not responding would be:

killall firefox

and if this doesn't work

killall -9 firefox

and if this still doesn't work, reboot, nothing else will.

For other killall options, see this article on Wikipedia: Link


Installed the proprietary drivers (unable to relocate where I downloaded these from) and then edited alsamixer.

Using the USB direct to the PC and not to the Wireless Hub allowed me to select the headset USB receiver as the sound device and I was able to play sound from the headpiece.


Acer C720 connects to wireless network, but can't load webpages

I am paraphrasing the solution which is found in the link:

Delete /etc/resolv.conf

sudo apt-get remove --purge resolvconf

Restart the computer
Now the wireless Internet works. We can rebuild the file

sudo apt-get install resolvconf


7z command line with highest encryption: AES-256 + Encrypting the Filenames

It is possible to get AES 256 encryption with 7z and make the archive and filenames only visible with the use of a passphrase. I note that the vital 'passphrase' option is missing from your own command line.

An example, for which I have borrowed liberally from the man pages:

7z a \
  -t7z -m0=lzma2 -mx=9 -mfb=64 \
  -md=32m -ms=on -mhe=on -p'eat_my_shorts' \
   archive.7z dir1

A slightly more secure method is to actually leave the -p field blank, then 7z will prompt you to type a password before actually creating the archive.

Explanation:

Here is an explanation for those not well versed in the 7z command line:

a                   Add (dir1 to archive.7z)
-t7z                Use a 7z archive
-m0=lzma2           Use lzma2 method
-mx=9               Use the '9' level of compression = Ultra
-mfb=64             Use number of fast bytes for LZMA = 64
-md=32m             Use a dictionary size = 32 megabytes
-ms=on              Solid archive = on
-mhe=on             7z format only : enables or disables archive header encryption
-p{Password}        Add a password

Testing the archive:

The subsequent archive can be tested with the command 7z l -slt archive.7z which I demonstrate below:

andrew@illium~/test$ 7z l -slt archive.7z

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64)

Scanning the drive for archives:
1 file, 12919 bytes (13 KiB)

Listing archive: archive.7z

Enter password (will not be echoed):   <-------------
--
Path = archive.7z
Type = 7z
Physical Size = 12919
Headers Size = 247
Method = LZMA2:14 7zAES
Solid = -
Blocks = 1

----------
Path = dir1
Size = 0
Packed Size = 0
Modified = 2017-06-23 14:10:59
Attributes = D_ drwxr-xr-x
CRC =
Encrypted = -
Method =
Block =

Path = dir1/200px-Aum_calligraphy.svg.png
Size = 12663
Packed Size = 12672
Modified = 2015-05-06 07:29:23
Attributes = A_ -rw-r--r--
CRC = 77BD9922
Encrypted = +                    <-------------
Method = LZMA2:14 7zAES:19       <-------------
Block = 0

andrew@illium~/test$

Note the call for a password as well as the notation that gives the encryption as 7zAES:19 aka AES-256 (I have arrowed these points for the sake of clarity).

Caveats:

Note that in the man pages there is a specific warning against using 7z for archival purposes under Linux:

DO NOT USE the 7-zip format for backup purpose on Linux/Unix because :
- 7-zip does not store the owner/group of the file.

Note as well some limitations and work arounds given in the man pages in regards to the backing up of directories under Linux....


Ubuntu with only CLI image... No more GUI

It sounds like what you are asking for is the Ubuntu Server

http://www.ubuntu.com/server

However, if you do want cli only, I'm inclined to recommend you to Debian.


ubuntu upgrade wants administrative password

What it wants is the password for root on the server. If you want to test this theory out then open a terminal and run sudo passwd root then enter a new password for root. Next time you try the upgrade enter the password you just set.
The methods described by user58201 should work as well, but didn't exactly answer your question.


How do I recover data from a partition I resized with GParted?

if that window or other than linux os .. just delete the partition and format to what kind of partition you love to have.. but if that linux partition emmm .. read this http://gparted.sourceforge.net/display-doc.php?name=help-manual


If /dev/sda refers to the stick you are going to use, it has an empty partition table. It cannot be mounted, the error is to be expected. Use fdisk to make a partition on the device with n p 1 Return Return w q, then mkfs.ext4 /dev/sda1 to format this partition.

Afterwards, your system should be able to mount automatically without issues.


zsh doesn't open vim or gvim until terminal is closed

Was due to the following line in my .vimrc: set shell=zsh\ -i

I have to set the shell in interactive mode to make sure .zprofile is loaded, otherwise the additions to $PATH aren't set and so I cannot use certain commands from inside gVim.

So unfortunately I either have to:

Use a different editor from the terminal
Don't set vim's shell as interactive


How can I record an OpenGL game in Ubuntu?

GLC is well-suited for this purpose. Unfortunately it is not packaged in the archives. However, I have put it (and its dependencies) in a PPA:

  ppa:george-edison55/glc  (Click here for instructions on using PPAs.)

You can add the PPA to your system using the following commands:

sudo apt-add-repository ppa:george-edison55/glc
sudo apt-get update

Then you can install GLC with:

sudo apt-get install glc

Once the tool is installed, you can begin recording an application by running:

glc-capture -o /tmp/capture.glc <application>

This will immediately start the application. You can start and stop the recording in-game by pressing the keyboard shortcut Shift + F8.

When you are done, you will end up with a file /tmp/capture.glc that contains the data captured by the tool. You can immediately playback the recording with:

glc-play /tmp/capture.glc

If you wish to convert the recording to a video, you can do so with:

glc-play /tmp/capture.glc -y 1 -o - | mencoder -demuxer y4m - \
    -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=3000 -o /tmp/capture.avi

This will create an MP4 file named /tmp/capture.avi with a bitrate of 3,000 Kbps.

Sources:

http://www.dedoimedo.com/computers/glc.html
https://github.com/nullkey/glc/wiki/Install


How can I set the CPU frequency to always stay at its maximum?

Here is another method. If you want to attempt this suggestion, undo any changes caused by cpufreq and intel pstate settings. Also, disable any governor settings

Install TLP - a tool whose main purpose is power management. It has a lot more features though like configuring cpu frequencies.

sudo add-apt-repository ppa:linrunner/tlp;
 sudo apt-get update;
  sudo apt-get install tlp tlp-rdw

sudo gedit /etc/default/tlp

Find these lines

CPU_SCALING_MIN_FREQ_ON_AC=0

CPU_SCALING_MAX_FREQ_ON_AC=0

CPU_SCALING_MIN_FREQ_ON_BAT=0

CPU_SCALING_MAX_FREQ_ON_BAT=0

Change the 0's all to 2500000 where this is the frequency in khz which = 2.5ghz.

Save and now monitor your cpu freq.

More info and sources: http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html#installation

http://linrunner.de/en/tlp/docs/tlp-configuration.html#scaling

http://linrunner.de/en/tlp/docs/tlp-faq.html#scaling


Which tool to crop a portion of the screen?

On Gnome Shell (17.10+)

To use the built-in gnome-screenshot capability (by default):

Ctrl + PrintScreen to copy a screenshot of the whole Desktop.
Ctrl + Alt + PrintScreen to copy a screenshot of the current active Window.
Ctrl + Shift + PrintScreen to copy a screenshot of an area you select with your Mouse.

On Unity

To use the built-in Screenshot capability:

PrintScreen to copy a screenshot of the whole Desktop.
Alt + PrintScreen to copy a screenshot of the current active Window.
Shift + PrintScreen to copy a screenshot of an area you select with your Mouse.


Key remapping reversal coupled to built-in device disconnection

Workaround:
Disable webcam as in: (my webcam is not faulty)
https://superuser.com/questions/982265/how-to-disable-a-specific-faulty-laptop-webcam-in-ubuntu
Load change at startup: (already had this in ubuntu 19)
[Desktop Entry]
Name=SwapKeySpa
Exec=xmodmap -e "keycode 94 = less greater"
Terminal=false
Type=Application

save file as .config/autostart/keyswap.desktop


What's the best way to configure the containers to have an IP directly on the LAN

Creating a bridge is a pretty simple process.

A key points to be aware of:

Your NIC needs to be run in promiscuous mode for the bridge to work, promiscuous mode isn't supported on many wifi nic's, hence there's no way to make this work on many wifi NICs (check support for promiscuous mode if you need it).

Edit /etc/network/interfaces

Add:
# Bridge for LXC containers
auto br0
iface br0 inet dhcp
  bridge_ports eth0
  bridge_stp off
  bridge_fd 0
  bridge_maxwait 0

sudo service networking restart

Configure network in LXC config as:
lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up
lxc.network.ipv4 = 10.0.2.215/24
lxc.network.name = eth0

lxc-start -n <CN>


Is it possible to send and receive a file from ubuntu to windows without apps like samba etc?

I have found WinSCP to be the best tool for a Windows desktop or server interacting with a Linux environment.

You need to install ssh on the Linux environment first for WinSCP to work.


In short: add the user Everyone to the file created in windows (or the whole folder), with the requested operation mode (read, write, execute..) at the security tab.
Sometimes when it comes to web apps or shares, the Anonymous user credentials also need to be added.

If you would like to make files accessible by unknown users, you need to set appropriate credentials on the folders and files created by that system.
Those credentials stick to files and folders when moving from one system to another, and translated accordingly when it comes to windows-linux.

Just like in linux when you use chown/chmod to set owners and access type for "other" users, you need to do the same for every file created by windows, as it is not the default credential for new files unless you decide it to be so (inherited by folder or filesystem credentials for example).
This is done by default security reasons by windows (default security policy).


Installing Ubuntu 13.04 problem with formatting drive

I finally figured this out. The problem was simple: the firmware that shipped with the motherboard was very out of date, and didn't play nice with the SSD. I followed the instructions here: http://lists.centos.org/pipermail/centos/2012-October/129427.html

I'll copy the important part here for anyone who finds this. Note, if you have this motherboard, you can use the 9211_8i (a PCI card) updates. I assume they have the same chipset

9211_8i_Package_P14_IR_IT_Firmware_BIOS_for_MSDOS_Windows\Firmware\HBA_9211_8i_IR\2118ir.bin
and
9211_8i_Package_P14_IR_IT_Firmware_BIOS_for_MSDOS_Windows\sasbios_rel\mptsas2.rom

flashed using
Installer_P14_for_Linux\sas2flash_linux_i686_x86-64_rel\sas2flash

(the linux package3 doesn't include the firmware, so you need to
download the windows package too).  the IR firmware supports raid while
the IT firmware is just a jbod HBA.  my cards were already "IR" even
though I'm not using that feature, so I saw no reason to force the
restricted firmware on them.

to flash it after you collect the files you need:

 # chmod +x sas2flash
 # ./sas2flash -b mptsas2.rom
 .....
 # ./sas2flash -fwall 2118ir.bin
 ....


As I can see in your question, you are using Apache 2.4.7, but your httpd.conf use Apache 2.2 directive.

According to Apache 2.4 manual:

  Access control

  In 2.2, access control based on client hostname, IP address, and other
  characteristics of client requests was done using the directives
  Order, Allow, Deny, and Satisfy.

  In 2.4, such access control is done in the same way as other
  authorization checks, using the new module mod_authz_host. The old
  access control idioms should be replaced by the new authentication
  mechanisms, although for compatibility with old configurations, the
  new module mod_access_compat is provided.

Try this changes:

<Directory "/opt/lampp/apache2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Allow and deny directive controls which hosts can or can't access an area of the server, Require tests whether an authenticated user is authorized according to a particular authorization provider and the specified restrictions. Require all granted means access is allowed unconditionally, let see Beyond just authorization

Update after reading configuration file:

Your default configuration file is right. The problem is wrong shebang in perl script.

Try this:

  #!/usr/bin/perl

Also:

  chmod +x /opt/lampp/cgi-bin/yourScript.pl

Here is a useful link about file permission problem

Second update

Change http content header:

  print "Content-type:text/html\n";

This header is read by apache.

You apache is running as daemon user, check if each directory in script path are readable.


Logitech presenter R800 set-up problem on Ubuntu 18.04 LTS (64-bit)

If the Logitech Presenter uses the Logitech Unifying USB receiver, open the Ubuntu Software app and install Solaar.

You can also Google "Solaar" for more info.

note: you'll have to do the initial setup of the dongle in Windows, using the Logitech Unifying Software.


How to set display scale to be 150% in Ubuntu 18.04 LTS?


Ubuntu 16.04: external USB DVD Drive us not recognised and can’t be mounted

Please try

sudo lshw -C disk

that should list all drives including your optical drive - with "logical name".


I'm probably slightly fuzzy on this one as it's been a while, but the boot sequence goes a little like this:
Power on and POST->BIOS Boot Device->MBR on boot device->Boot sector->OS.

So basically, your computer powers on and your BIOS is set to look toward a device for booting (Hard disk, CD-ROM, USB etc.) and it looks for the MBR at the beginning of the disk. The MBR then instructs the computer to look at the location of the disk with further boot information. This is the /boot partition in Linux where GRUB resides. The GRUB config files contain info for where the / mount point is and where the initial files are to start loading the kernel, and it will contain the location of windows installations and how to load them, too. You might want to check the GRUB config files in /boot to see where they point because they may just point to that second loading screen.


Is there a way to organize applications in GNOME Shell's Applications menu?

You can install alacarte, which shows up as an app called "Main Menu". You can create your own menus, drag apps (menu items) into them, then uncheck the normal menus / items, and only your custom menus will show up as the categories in the applications pane.


Ctrl-Alt-T launches a different terminal than that from the launcher

It seems you have Terminator (2nd pic) installed in your system (a different terminal emulator than the system one)

If you don't want to use it, a quick solution would be to uninstall it

sudo apt purge terminator

It'll restore your ctrl+alt+t shortcut back to the default one.

Update:
If you don't want to uninstall, follow these steps to restore your default terminal.

sudo update-alternatives --config x-terminal-emulator

you'll get this result.

This is the list of terminal emulators in your system. See for me default terminal is Terminator ( number 0 ) and it has a * next to it.

you have to choose which terminal you want to select as default.

Type the desired list number, Press enter, now it should restore your default terminal.


When you run commands with script -c, they are run in a noninteractive shell:
$ script ../output.txt -c 'echo "\$0 = $0 ; FLAGS = $-"'
Script started, file is ../output.txt
$0 = bash ; FLAGS = hBc
Script done, file is ../output.txt

The flags are different from the normal interactive shell (note the presence of the i flag):
$ echo "\$0 = $0 ; FLAGS = $-"
$0 = -bash ; FLAGS = himBHs

Although noninteractive, non-login shells read your ~/.bashrc, they likely processes it differently. In particular, the default ~/.bashrc that would have been copied from /etc/skel when your account was created starts with:
# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

meaning that any conda related content that you added at the end of your ~/.bashrc will not get executed (and sourcing ~/.bashrc again won't help).
I don't know much about conda, but assuming it is capable of being run in such a shell, then one possible workaround would be the following:

remove the conda related portion of your ~/.bashrc to a separate file

source that file from your ~/.bashrc to keep the existing behavior for your interactive shell

source that file (instead of ~/.bashrc) first in your script -c ' ... ' command


Wifi connection across different networks | returning from supended mode

Try the following

make

/etc/systemd/system/net-resume.service

and write

[Unit]
Description=Restart networkmanager at resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
Type=oneshot
ExecStart=/bin/net-resume
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target

Next you check which driver you use (Tell me if you do not know where the name of the drive is written in the result of the command)

lspci

Then make

/bin/net-resume

and write

#!/bin/sh
modprobe -r [your kernel driver]
modprobe [your kernel driver]
systemctl restart network-manager.service

And give the permission to execute

chmod +x /bin/net-resume

Finally you enable the service

systemctl enable net-resume.service


Distorted sound with bluetooth speaker in Ubuntu 16.04

Go to Sound Settings, select your Bluetooth audio device and check that the device is set to A2DP not HSP/HFP (which is mono and has very low quality).

Edit: If Bluetooth audio stops working after you do that in 16.04 you need to apply the following workaround: https://askubuntu.com/a/817926/40581


How to Connect iPad to ubuntu 12.04 via Wifi or Cable (without jailbreak)

FileApp from the iPad app store works with ftp over wifi to upload stuff from a laptop to the iPad.


Unity is a shell for Gnome. Unless you've setup automatic login, then Unity does not automatically start. Do you mean that you don't want to start the display manager, and get a commandline interface instead? In that case, simply remove lightdm and gdm. You can just reinstall it later if you want to.


How do I disable Ktorrent from autostarting on login?

When you close ktorrent, it's still running in the system tray.
If you have "restore previous session" enabled in the System "Startup and Shutdown" settings, KTorrent will be re-started in windowed mode, even if it was minimized to the tray when shut down.

To prevent KTorrent from starting, either

close it by right clicking on it's tray entry and press "Quit".

disabling "restore previous session" in System Settings


Install Ubuntu alongside Windows with one USB flash drive

Although it pretty much never happens that the installation fails, the only way I could think of is making a recovery partition. I did a quick search for you and found this.


Encrypted Home folder is still accessible with another distro

I might be resurrecting the dead, but I guess a late answer is better than no answer.

The way ecryptfs works is that the actual files are encrypted with a proper key, however this key is then stored encrypted by your user password in a file 'wrapped-passphrase' in the ~/.ecryptfs directory.

Although I'm no crypto expert, this does seem to suggest that your password is replaced by a mere 6 character password, so I would suggest to replace it with something strong.

While i'm not aware of the actual encryption scheme used in encryptfs, this doesn't have to mean that your 6-character key can actually be brute-forced. The key derivation method could be made prohibitively expensive as this only has to be done once for the correct password (by requiring thousands of decryption cycles for example), but doesn't impact the performance of the actual decryption of the files as this can be done with the longer secure key, once it is decrypted.


Really you have multiple choices:

First of all you can try a bigger Cd capacity(there are 800 MB CD's)

You can try The Network installation or Install directly from Internet.

Please check this https://help.ubuntu.com/community/Installation#Alternate_Installation

Here is a list alternate installations so read and choose the one that helps you


To migrate the configuration files you just have to migrate your home folder, it includes all the user specific application configurations, and since both Ubuntu and Fedora use Gnome per default this should work rather well.

Migrating the installed applications without reinstalling them from Fedora is a profoundly bad idea. Time and effort needed left aside, it will likely result in a very suboptimal, unstable system. Just don't do it, reinstall the apps from Fedora.

(Reasons start with different file system trees and configuration methods between distributions, and probably won't stop with differing file and library versions within individual software packages.)


BQ Ubuntu Phone - How do I set media to save on a Micro SD storage card?

You can set where to save the media from the camera like pivtures and videos.
Just go to the camera and down there is an option "SD" where you can select to save to SD card, external card. Down to left.


VMware workstation 10 on Ubuntu 14.04.04 - Virtual Network error

I had the same issue, but none from other suggestions in this forum worked for me apart from installing the latest version of VMware player. The sequence of commands is as follows:

Uninstall current version: sudo vmware-installer -u vmware-player
Download the latest version of VMware Workstation Player (freeware for non-commercial use).
Change mode of the installation file that you downloaded: chmod +x VMware-Player-*.bundle
Install vmware player: sudo ./VMware-Player-*.bundle


How long before Ubuntu One downloads music purchases

Normally, it should happen fairly quickly. If it takes more than a few minutes then it is likely the song didn't get queued for download to the Ubuntu One server, and a support request should be filed. It may also take slightly longer during an Ubuntu release, as some servers get bandwidth throttled to make additional bandwidth available for the large number of downloads of Ubuntu that will happen during the release.


You'll have to setup an effective user and or effective group as part of you mount options.  Make sure the user or group has the type of access you want to provide for for that share.

You can also specify the type of file mask you want to be associated with the files and folders that user creates.

This is an example to add to your options:

uid=[username/ID],gid=[groupname/ID),file_mode=0660,dir_mode=0775

So you would effectively have:

//192.168.2.49/nasdata /home/NASDATA cifs username=nilli,password=xxx,uid=[username/ID],gid=[groupname/ID),file_mode=0660,dir_mode=0775 0 0

Change the bracket [entry] to either the desired username/groupname or uid/gid.