Easiest way to update Apache, MySQL & PHP on VPS

Before you begin, you should know that ppas are not officially supported. ppas are provided by members of the community. As mentioned here, you should visit this link before you begin.

Although, it should be noted that this particular ppa is used by many people, if you Google "php5 ppa" you will see many tutorials reference this.

To install the newer versions and to add the ppa for php version 5.6 and mysql 5.6 and the newer version of apache as well, run the following commands and please post any errors:

sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo add-apt-repository ppa:ondrej/mysql-5.6
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5

For more info: visit here for info on the php5 ppa and a list of the packages added by the ppa

Also: visit here for more info on the mysql ppa and a full list of the added packages


Boot from rescue CD (or flash disk) and do Rescue Mode.

See https://help.ubuntu.com/lts/installation-guide/i386/rescue.html


Configure virtualmin with a local domain like virtualmin.local or something like virtualminlvm.com, the important part is add the domain-ip relation somewhere, you either can install a dns server like dnsmasq or simply add them to /etc/hosts file like

10.0.2.15    virtualmin.local
10.0.2.15    virtualminvm.com

Note that using .com (or other real tld) will hide the route to real site (if exists) from you.


blank screen on boot; can't reach login; 14.04

Issue an ls /etc/X11 whats the output?
Check who the owner is ls -al /etc/ | grep -a -e X11. If the third and fourth rows aren't root try chown'ing "/etc/X11" as root:root (Backup first)chown -R root:root /etc/X11.

Look in /usr/bin for Xorg. if it exists link to it and call your link X (make sure you put the link in /etc/X11).
Then issue a startx and see what happens.

If Xorg is missing try reinstalling X via apt-get remove --purge xserver-xorg&&apt-get install xserver-xorg, or you can try to reconfigure with dpkg-reconfigure xserver-xorg


Slow Wifi on Atheros AR9271 aka TL-WN722N

All right, looks like I found a solution:
I tried using laptop+TP-Link TL-WN722N with another router and suddenly the wifi stick was able to deliver the expected performance.

In the end I managed to narrow it down to a setting of my router called "WMM" (also called Wifi-Multi-Media or Wireless-Multimedia-Extensions or WME).

If I disable WMM in my router, the wifi stick delivers the expected 25 Mbits/sec that my internet connection is capable of.

However, please note that if you disable WMM/WME in your router settings your router will reduce its wifi speed to 54 Mbits/sec (IEEE 802.11g).

Summary:

On Windows the TP-Link TL-WN722N works as expected.

On Linux the TP-Link TL-WN722N only works correctly with IEEE 802.11g. If your TP-Link TL-WN722N is slow, you need to disable WMM or WME in your router settings.


Kubuntu 16.04.3: how to stop KDE from opening apps that were opened before I restarted/shutdown my machine?

It's pretty simple: System Settings > Startup & Shutdown > Desktop Session and use the settings in the image:


How to remount logical volumes again after using lvremove?

Restore deleted logical volumes from backup by following this answer to “How to recover logical volume deleted with lvremove”:

  Example:

  1 - I have removed my logical volume!

$ sudo lvremove /dev/vg1/debian.root

  2 - First thing to do is, look for the archive file at
  /etc/lvm/archive/vg1_(xxxxx).vg. I can do that, just looking the date
  that i have removed the logical volume!

$ sudo ls -l /etc/lvm/archive |more

  3- I found it!

-rw------- 1 root root 16255 Mar 20 14:29 vg1_00223-235991429.vg
-rw------- 1 root root 16665 Mar 20 16:49 vg1_00224-748876387.vg
-rw------- 1 root root 17074 Mar 20 16:49 vg1_00225-931666169.vg
-rw------- 1 root root 17482 Mar 20 16:50 vg1_00226-1238302012.vg
-rw------- 1 root root 18081 **Mar 20 21:57 vg1_00227-2048533959.vg**

  Date where i did the lvremove!!!...it was a minutes ago..

  4 - Let's see the file!

$ sudo head /etc/lvm/archive/vg1_00227-2048533959.vg
*# Generated by LVM2 version 2.02.95(2) (2012-03-06): Thu Mar 20 21:57:58 2014
contents = "Text Format Volume Group"
version = 1
description = **"Created *before* executing 'lvremove /dev/vg1/debian.root'"**
creation_host = "server"  # Linux server 3.8.0-35-generic #50-Ubuntu SMP Tue Dec 3 01:24:59 UTC 2013 x86_64
creation_time = 1395363478    # Thu Mar 20 21:57:58 2014*

  5 - Make a test before recover it!

$ sudo vgcfgrestore vg1 --test -f /etc/lvm/archive/vg1_00227-2048533959.vg
Test mode: Metadata will NOT be updated and volumes will not be
(de)activated.   **Restored volume group vg1**

  6 - Ok, now repeat the command line, without the (--test)

$ sudo vgcfgrestore vg1 -f /etc/lvm/archive/vg1_00227-2048533959.vg
**Restored volume group vg1**

  7 - Check it!

$ sudo lvscan |grep debian
ACTIVE            '/dev/vg1/debian.root' [7,81 GiB] inherit

  8 - If the logical was not active, do it!

$ sudo lvchange -a y /dev/vg1/debian.root


How do I restrict a specified SSH user to connect only from one IP or hostname?

See man sshd_config. There is possibility to add AllowUsers block where you can specify both user and host like this:

AllowUsers user@host # or IP

Of course you need to specify also other users you want to allow login from, if you have some.

Another solution (depends on bug fixes!)

As I think about it once more, there is possibility to modify your sshd_config like this:

Match Host !hostname
    DenyUsers user
Match Host hostname
    AllowUsers user

This would easily block all users except from user from hostname and from everywhere else it would block user.

BUT it doesn't work, because of few bugs reported upstream [1] [2]. But we got it promised it will get fixed in next release.

[1] https://bugzilla.mindrot.org/show_bug.cgi?id=1918
[2] https://bugzilla.mindrot.org/show_bug.cgi?id=2397


Fortinet SSL VPN Ubuntu 19.04 sha256sum self-signed host certificate

Run openfortivpn at the command line and it will show the sha256 digest of the certificate. man openfortivpn for the arguments.


You have a duplicate key in one of your JSON files, eg. something like this:

{
  "foo": 1,
  "bar": 2,
  "foo": 3
}


Symbolic Link Error with MySQL Cluster and Ubuntu 12.04

My Symlink is incorrect.

My symlink for mysql goes to "mysql-cluster-gpl-7.3.3-" but the version of mysql-cluster is mysql-cluster-gpl-7.3.5-linux- (not 7.3.5 vs 7.3.3)


I solved by opening alsamixer from the terminal and switching the Channel setting from 2ch to 6ch. It suddenly started working with no need to restart my pc.


I fixed this problem compiling gdigi from the source:

sudo git clone https://github.com/desowin/gdigi.git
cd gdigi
sudo make
./gdigi

Hope it works for you!


How to make a Lenovo Ideapad Z510 as dual boot?

If your computer comes with Windows 8.1 pre-installed, it will make use of the complete disk space.

The first thing you need to do, is create space for your Ubuntu installation. You can either use your Windows Disk Management (can be found in your computer management console) or you can use gparted. There are dedicated boot cd's you can download with gparted or you can launch it from a Linux LiveCD. Both ways give you an easy graphical interface in which you can resize (shrink) your Windows partition.

You download your preferred Linux Distro (Ubuntu Desktop 14.04 is a really nice option for beginners!). 64-bit versions are offered by defaut, but there are STILL some applications (e.g. skype) that really prefer 32-bit versions. So for absolute beginners, I still advise you to get the 32-bit version. You will read that a 32-bit can't use more than 4GB of RAM, but Ubuntu comes with PAE (Physical Address Extention) pre-installed, so it should see a lot more. Don't worry about this, your RAM will not go to waste. When you've got the ISO, is't always good to check the MD5sum of the file, to check for any errors before you start your installation. I can't remember when I had the last bad iso downloaded, but it's always a good habit to do so... Anyways, when you have the iso file, you can opt to write a DVD, or go over to http://pendrivelinux.net to download the Universal USB Installer and create your bootable USB key.

When all that is done, you're ready for your first dual-boot installation. Restart your computer, choose to boot from USB or CD, whichever you created, and follow easy install instructions. BE WARNED! Quite a few people here have complained that they lost their Windows after installing Ubuntu (or other Linux distros) because they didn't read or understand all the actions you go through before installing. Before you press the button Install Now, make sure you've chosen to install Ubuntu in the FREE SPACE, next to your Windows. So don't choose to use your whole disk ;) Should you not see this option, abort the installation and come back for help.

After the installation, you should be left with a working Windows and Ubuntu. After booting, you will see the bootloader GRUB pop up, offering you the choice between Ubuntu and Windows. If you don't like the default OS, you can manually change that later.

After all this, you should also consider running Ubuntu in a virtual machine. Especially when you have no experience with Ubuntu, it may be a bit easier to switch between an OS that you know and feel comfortable with and the OS you want to learn about. Windows 8.1 comes with Hyper-V, or you can opt to install VirtualBox or VMware Player for free. Personally, I prefer VirtualBox, but that's just me... Hyper-V works well too and doesn't require 3rd-party software, but it has few limitations that, at this point, you don't have to worry about. Most new computers these days are more than powerful enough for you to run at least 1 virtual machine. It saves you from doing risky things like resizing your partition and you'll be able to run both OS's at the same time. This also gives you the option to test or play around with network sharing, communication between your Windows and Linux, etc, which is pretty difficult to do in a dual-boot situation.


Documentation packages - where they are installed? [12.04, but probably applies to all debian-based distros]

Try the command dpkg-query -L libovpencv-doc  This will list the full path to the installed files.n  The file should be under /usr/share/doc/libopencv-doc.


From what I understand, no one has been able to crack the ZMTP protocol. So unfortunately you have no other options.

My poor friend is facing the same problem. :(


Is there software that can view .dwg files?

DraftSight. It doesn't cost money and they'll give you a nice .deb installer... but it's not open source or free software.

On the upside, it will also let you create and edit .dwg files.


grep a word/number between two specific characters

This will print the IP addresses only:

ping -c1 askubuntu.com | grep -Eo '([0-9]+\.){3}[0-9]+'

But if you want to resolve a hostname, it would be better to use some other tool, e.g. host, dig nslookup or alike:

dig +short askubuntu.com
# or
nslookup askubuntu.com | grep -Po "Address: \K.*"

See more solutions here.


If the partition is NTFS type (Windows), then you have to, first of all, install ntfs-3g driver through the Ubuntu Software Center, Synaptic or by typing the following line in the console (Applications->Accessories->Terminal):
sudo apt-get install ntfs-3g

If you haven't already, create the folder that will be used as mount point.
sudo mkdir /media/music (you can call it "music" or whatever you like)

Now you have all things set, you can start to follow this steps:

1. Get the info about the disk
Get the UUID of the partition, which is a serial key that identifies the disk.
sudo blkid

An example output line should look like this:

/dev/sda5: UUID="246699c0-1262-4d0d-94dd-6496b33467d4" TYPE="ext3"

2. Edit the fstab configuration file
This file contains a list of devices and their mounting rules (automatic, on demand, etc.). It is located at /etc/fstab
Open the text editor as super-user and edit the file:
gksudo gedit /etc/fstab

Check the output of the command used in the previous step and take notice on

partition TYPE (example: ext4);
UUID, provided by the blkid command;

and add the following line:
UUID=xxxxxxxx-xxx-xxx-xxx-xxxxxxxx /mount/point/ file-system defaults 0 0

UUID should be replaced with the serial key obtained with the blkid command
file-system should be replaced with the TYPE value.


libimobiledevice work on ubuntu but not in raspberry

To show information about a package, including its version, open the terminal and type:

apt-cache show package-name

Replace package-name in the above command with the name of your package. The problem is there is no package called libimobiledevice in the Ubuntu repositories, but there are a few packages with names that are similar to libimobiledevice (e.g. libimobiledevice4). To show these packages run the following command:

apt-cache search libimobiledevice*


How to install nautilus-terminal in ubuntu 13.04

Nautilus-terminal is not compatible with the version of Nautilus installed by default in Ubuntu 13.04.

From the link you provided:

  Compatibility with Nautilus:

  Nautilus Terminal 1.0 works with Nautilus 3.0 and 3.2
  Nautilus Terminal 0.7.1 and previous work only with Nautilus 2.2x and Nautilus 2.3x

The version of Nautilus available by default in Ubuntu 13.04 (Raring) is 3.6.3 (link)

You'll need to downgrade Nautilus (which could very well be a highly involved task due to dependencies) or use a separate terminal window.  For your purposes, tilda or guake may be a decent stand-in until Nautilus-terminal is updated to support Nautilus-3.6.x.

NOTE: I'd link to tilda and guake, but I don't have at least 10 reputation yet.

I hope that helps you out.

EDIT: Updated to add links for tilda and guake since reputation gain.


Unknown filesystem after fdisk partitioning

Changing the starting point of a partition, is effectively the same as removing or dding pages to the beginning of a book, leaving the reader (here the OS) without chance to know where the book originally started.

Restore the starting point to its original values, then check and mount the file system. If you don't remember the value for the starting point, yuo can try to scan the partition with Testdisk or photorec from a live session to see what they are able to recover - some dat might be lost though.

And next time only expand partitions in the back end (right end in gparted) NEVER from the starting point. If free space is before the partition, you will have to move the partition left into the free space in gparted, and the expand partition to the right.

And NEVER move / or /boot partition without checking up on the extra steps needed to regenerate boot-/grub-configuration.


How to stop wifi from reenabling after being disabled

This can be accomplished easily using nmcli.

Add the following line into /etc/rc.local prior to the exit 0 line:

nmcli nm wifi off

You can arbitrarily re-enable the wifi either through the network manager dropdown menu like you have been turning it off or by running the following command from cli:

nmcli nm wifi on

Commands placed in /etc/rc.local are ran automatically as root whenever your system boots up.

For more information on nmcli and its capabilities, simply run view the man page for it with man nmcli.


How to save the file name with current date and time?

The script below will allow you to right-click a file and choose the option timestamp from the scripts menu.

right click -> Scripts -> timestamp

the file is timed

How to use

Copy the script below into an empty file, safe it as timestamp (no extension) ìn ~/.local/share/nautilus/scripts. Create the directory if it doesn't exist yet.
Make the script executable. You might need to log out/in. Then the option should work.

The script inserts the time/date between the "body" of the name and the extension (any) if the extension is on the file. If not, it will add the time/date after the name.

The script

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

current = os.getenv(
    "NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
    ).replace("file://", "").replace("%20", " ").strip()

t = time.strftime("%H:%M:%S_%d-%m-%Y")

name = current.split("/")[-1]; path = current[:current.rfind("/")]
splitmark = name.rfind(".")
newname = name[:splitmark]+"_"+t+name[splitmark:] if splitmark != -1 else\
          name+"_"+t
newfile = os.path.join(path, newname)
shutil.move(current, newfile)

Note

The script uses python's shutil.move() which works equally on directories and files.


Running a jar file at boot with cron and seeing output

You cannot "run it in the foreground" at @reboot. You can capture STDOUT and STDERR in a log file (man bash see REDIRECTION).

You should be aware that the execution environment when @reboot stuff runs is even MORE restricted than the "normal" cron environment. Temporarily, add env | sort >/tmp/cronjob.env to the  beginning of your script (just after the shebang line (#!/bin/bash)), run it, then compare it with your usual environment's env | sort >/tmp/normal.env


Can I use the power button to shut down my computer gracefully on Ubuntu Minimal?

ACPI is the actual system responsible for handling such power related tasks. Without ACPI support (either software or hardware), you won't be able to listen to the power button event.

For Ubuntu installing the acpid  package should be sufficient. This provides the event daemon listening for events such as pressing a power button. It is installed on regular Ubuntu versions, but as you've installed a minimal version, it was omitted.

On a minimal/server installation, the installation can be performed on the command line like any other package:

sudo apt-get install acpid


How to update python from 2.7.3 to 2.7.4 on Ubuntu 12.04?

The versions of python2.7 available for each supported version of Ubuntu are listed on Launchpad. Only 2.7.3 is packaged on Ubuntu 12.04. If you want to use 2.7.4, there are several options:

Upgrade to Ubuntu 12.10, and then to 13.04, which includes 2.7.4.
Request a backport of the 2.7.4 package to 12.04.
Backport it yourself, either locally, or in your own PPA.
If there is a specific fix you need, request it be backported to 2.7.3 on 12.04.
Build and install from source (not really recommended though).


From the command line, you can run something like this:

tesseract $imageFile $hocr hocr  with version 3+ of tesseract.

$imageFile is the input, $hocr = HTML OCR file.

You can parse the file (e.g., with PHP) and get a box for each word.  This will help you get the coordinates of every word.

We use this method to make a custom search-able PDF ... We place the text on a page, then overlay the original image. This process can also be simplified with:  man hocr2pdf

We then use the classic and lightweight R&OS PDF to build the PDF on the fly with a custom script to rotate the image. I am attaching the updated function (with the updated "stream" function for "resume" support ... Accept-Ranges

class Mpdf extends Cezpdf
{

function addPngFromFile($file,$x,$y,$w=0,$h=0,$angle=0)
{
  // read in a png file, interpret it, then add to the system
  $error=0;
  $tmp = get_magic_quotes_runtime();
  set_magic_quotes_runtime(0);
  $fp = @fopen($file,'rb');
  if ($fp){
    $data='';
    while(!feof($fp)){
      $data .= fread($fp,1024);
    }
    fclose($fp);
  } else {
    $error = 1;
    $errormsg = 'trouble opening file: '.$file;
  }
  set_magic_quotes_runtime($tmp);

  if (!$error){
    $header = chr(137).chr(80).chr(78).chr(71).chr(13).chr(10).chr(26).chr(10);
    if (substr($data,0,8)!=$header){
      $error=1;
      $errormsg = 'this file does not have a valid header';
    }
  }

  if (!$error){
    // set pointer
    $p = 8;
    $len = strlen($data);
    // cycle through the file, identifying chunks
    $haveHeader=0;
    $info=array();
    $idata='';
    $pdata='';
    while ($p<$len){
      $chunkLen = $this->PRVT_getBytes($data,$p,4);
      $chunkType = substr($data,$p+4,4);

      switch($chunkType){
    case 'IHDR':
      // this is where all the file information comes from
      $info['width']=$this->PRVT_getBytes($data,$p+8,4);
      $info['height']=$this->PRVT_getBytes($data,$p+12,4);
      $info['bitDepth']=ord($data[$p+16]);
      $info['colorType']=ord($data[$p+17]);
      $info['compressionMethod']=ord($data[$p+18]);
      $info['filterMethod']=ord($data[$p+19]);
      $info['interlaceMethod']=ord($data[$p+20]);
      $haveHeader=1;
      if ($info['compressionMethod']!=0){
        $error=1;
        $errormsg = 'unsupported compression method';
      }
      if ($info['filterMethod']!=0){
        $error=1;
        $errormsg = 'unsupported filter method';
      }
      break;
    case 'PLTE':
      $pdata.=substr($data,$p+8,$chunkLen);
      break;
    case 'IDAT':
      $idata.=substr($data,$p+8,$chunkLen);
      break;
    case 'tRNS':
      //this chunk can only occur once and it must occur after the PLTE chunk and before IDAT chunk
      //print "tRNS found, color type = ".$info['colorType']."<BR>";
      $transparency = array();
      if ($info['colorType'] == 3) { // indexed color, rbg
      /* corresponding to entries in the plte chunk
      Alpha for palette index 0: 1 byte
      Alpha for palette index 1: 1 byte
      ...etc...
      */
        // there will be one entry for each palette entry. up until the last non-opaque entry.
        // set up an array, stretching over all palette entries which will be o (opaque) or 1 (transparent)
        $transparency['type']='indexed';
        $numPalette = strlen($pdata)/3;
        $trans=0;
        for ($i=$chunkLen;$i>=0;$i--){
          if (ord($data[$p+8+$i])==0){
        $trans=$i;
          }
        }
        $transparency['data'] = $trans;

      } elseif($info['colorType'] == 0) { // grayscale
      /* corresponding to entries in the plte chunk
      Gray: 2 bytes, range 0 .. (2^bitdepth)-1
      */
        $transparency['type']='indexed';
        $transparency['data'] = ord($data[$p+8+1]);

      } elseif($info['colorType'] == 2) { // truecolor
      /* corresponding to entries in the plte chunk
      Red: 2 bytes, range 0 .. (2^bitdepth)-1
      Green: 2 bytes, range 0 .. (2^bitdepth)-1
      Blue: 2 bytes, range 0 .. (2^bitdepth)-1
      */
        $transparency['r']=$this->PRVT_getBytes($data,$p+8,2); // r from truecolor
        $transparency['g']=$this->PRVT_getBytes($data,$p+10,2); // g from truecolor
        $transparency['b']=$this->PRVT_getBytes($data,$p+12,2); // b from truecolor

      } else {
      //unsupported transparency type
      }
      // KS End new code
      break;
    default:
      break;
      }

      $p += $chunkLen+12;
    }

    if(!$haveHeader){
      $error = 1;
      $errormsg = 'information header is missing';
    }
    if (isset($info['interlaceMethod']) && $info['interlaceMethod']){
      $error = 1;
      $errormsg = 'There appears to be no support for interlaced images in pdf.';
    }
  }

  if (!$error && $info['bitDepth'] > 8){
    $error = 1;
    $errormsg = 'only bit depth of 8 or less is supported';
  }

  if (!$error){
    if ($info['colorType']!=2 && $info['colorType']!=0 && $info['colorType']!=3){
      $error = 1;
      $errormsg = 'transparancey alpha channel not supported, transparency only supported for palette images.';
    } else {
      switch ($info['colorType']){
    case 3:
      $color = 'DeviceRGB';
      $ncolor=1;
      break;
    case 2:
      $color = 'DeviceRGB';
      $ncolor=3;
      break;
    case 0:
      $color = 'DeviceGray';
      $ncolor=1;
      break;
      }
    }
  }
  if ($error){
    $this->addMessage('PNG error - ('.$file.') '.$errormsg);
    return;
  }
  if ($w==0){
    $w=$h/$info['height']*$info['width'];
  }
  if ($h==0){
    $h=$w*$info['height']/$info['width'];
  }

  // so this image is ok... add it in.
  $this->numImages++;
  $im=$this->numImages;
  $label='I'.$im;
  $this->numObj++;
  $options = array('label'=>$label,'data'=>$idata,'bitsPerComponent'=>$info['bitDepth'],'pdata'=>$pdata
                      ,'iw'=>$info['width'],'ih'=>$info['height'],'type'=>'png','color'=>$color,'ncolor'=>$ncolor);
  if (isset($transparency)){
    $options['transparency']=$transparency;
  }

  $this->o_image($this->numObj,'new',$options);

    # $angle in degrees
    $this->objects[$this->currentContents]['c'].="\nq";
    $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$w)." 0 0 ".sprintf('%.3f',$h)." ".sprintf('%.3f',$x)." ".sprintf('%.3f',$y)." cm";

            {
            $this->objects[$this->currentContents]['c'].="\n"."%%angle $angle ";

            $a = deg2rad((float)$angle);
                $this->objects[$this->currentContents]['c'].="\n".sprintf('%.6f',cos($a))." ".sprintf('%.6f',sin($a))." ".sprintf('%.6f',-1*sin($a))." ".sprintf('%.6f',cos($a))." 0 0 cm";
            }

    $this->objects[$this->currentContents]['c'].="\n/".$label.' Do';
    $this->objects[$this->currentContents]['c'].="\nQ";

}

function stream($options=''){
  // setting the options allows the adjustment of the headers
  // values at the moment are:
  // 'Content-Disposition'=>'filename'  - sets the filename, though not too sure how well this will
  //        work as in my trial the browser seems to use the filename of the php file with .pdf on the end
  // 'Accept-Ranges'=>1 or 0 - if this is not set to 1, then this header is not included, off by default
  //    this header seems to have caused some problems despite tha fact that it is supposed to solve
  //    them, so I am leaving it off by default.
  // 'compress'=> 1 or 0 - apply content stream compression, this is on (1) by default
  if (!is_array($options)){
    $options=array();
  }
  if ( isset($options['compress']) && $options['compress']==0){
    $tmp = $this->output(1);
  } else {
    $tmp = $this->output();
  }
  header("Content-type: application/pdf");
  header("Content-Length: ".strlen(ltrim($tmp)));
  $fileName = (isset($options['Content-Disposition'])?$options['Content-Disposition']:'file.pdf');
  header("Content-Disposition: inline; filename=".$fileName);
  if (isset($options['Accept-Ranges']) && $options['Accept-Ranges']==1){
    header("Accept-Ranges: ".strlen(ltrim($tmp)));
  }
  echo ltrim($tmp);
}

}


If you disable wobbly windows, does that decrease GPU consumption?

Enabling freaky visual effects and eye candy eats computer hardware resources. Disabling them will make it seem that the computer is running a little bit faster. To prove it compare the different flavors of Ubuntu. The minimal desktop environment flavors of Ubuntu require less hardware resources than vanilla Ubuntu.

If the applications windows keep dimming to gray and then go back to normal again, it could be due to insufficient hardware resources because a Raspberry Pi or any new computer that is bigger than a Raspberry Pi can play YouTube videos properly. Try either running a more lightweight Ubuntu edition like Ubuntu MATE 16.04 or adding more RAM to your computer. Or wait another month and try Ubuntu MATE 18.04. Remove an existing RAM stick from your computer and take it with you when you shop for a new RAM stick to make sure that the new RAM stick is compatible with the existing RAM stick(s). Don't invest too much money in upgrading an old computer because new computers have become almost as cheap as new phones.


Why OpenCL is not default (14.04, nVidia 331)?

I don't exactly know why its happening or how somehow the problem is solved.

First of all, the nvidia-331-uvm is not activated from the start (god knows why). So let's activate it:

$ sudo modprobe nvidia-331-uvm
$ sudo mknod -m 666 /dev/nvidia-uvm c 249 0

Then if you do clinfo you'll have the same error about the ICD loader. Nonetheless, if you do it as root:

$ sudo clinfo

You'll get a good result (E: -30), and then you're also able to run the command as a non-root user. Long story short:

$ clinfo
I: ICD loader reports no usable platforms
$ sudo clinfo
E: -30
$ clinfo
E: -30
# then you run anything as non-root user

Then, also darktable -d opencl works well, or any opencl program ;).

UPDATE

I finally added the next lines in my /etc/rc.local file:

# begin opencl config
modprobe nvidia-331-uvm
mknod -m 666 /dev/nvidia-uvm c 249 0
clinfo
# end opencl config

Then everything works smoothly ;)


You can do this easily using Visual BCD Editor in Windows 7/8/10.

Map EFI System drive to Z: using

mountvol z: /s
Run Visual BCD Editor and select "Store","Backup store".
a)Click on browse icon in dialog and using the explorer window select
z: drive - now you have full access to EFI System Partition (ESP).

b)Click on EFI folder to expand - you will see "Boot", "Microsoft"
and "ubuntu" folders if you have Windows and Ubuntu installed.

c) You can delete "ubuntu" directory by selecting it and pressing
"Del" key.
In Visual BCD Editor click on loader entry "Ubuntu" to select it and then press "Del" key to delete.

After reboot Ubuntu boot option in UEFI boot menu will be completely gone.

Note:

You could alternatively use bcdedit.exe to delete EFI boot entry for Ubuntu and use command prompt to delete "ubuntu" folder from EFI System Partition (drive z:) if you feel more comfortable with commands.


tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

I had this issue and came to find I had two tmux binaries installed.
My suggestion for simplicity:

apt remove tmux
which tmux

If you have a response the 2nd time, rm it then reinstall


How can I sync RememberTheMilk to my Mozilla Thunderbird (or another application)?

Tasque  is a simple to-do application for GNOME that has Remember The Milk integration. It's very straight forward and syncs in the background, unlike GTG.


Do network drivers for Ubuntu 14.04 on Optiplex 7060 exist?

The answer is, yes, a driver exists, but currently only in source code form. Here is what I did:

Downloaded the driver sources from Intel here: https://downloadcenter.intel.com/download/22283/Ethernet-Intel-Ethernet-Adapter-Complete-Driver-Pack...

Updated to the most recent kernel backport packages with "sudo apt-get install --install-recommends linux-generic-lts-xenial"

Updated gcc to a more recent version with 'retpoline' support (https://lwn.net/Articles/744287/), to match the newer kernel packages (before I did this, I got the following error):

version magic '4.4.0-145-generic SMP mod_unload modversions ' should be '4.4.0-134-generic SMP mod_unload modversions retpoline'
insmod: ERROR: could not insert module ./e1000e.ko: Invalid module format

Built e1000e-3.4.0.2 from the Intel sources, put it onto the machine via USB stick, replaced the existing e1000e driver under /lib/modules, and added a line with 'e1000e' to /etc/modules.

Added to /etc/network/interfaces:

auto em1
iface em1 inet dhcp


How do I lauch sublime text 2 on ubuntu 12?

You can do it in Three ways.

way 1: Just to confirm finally that its installed to Ubuntu with dpkg

dpkg --get-selections | grep sublime-text

way 2: Open your terminal and type as

      sublime-text

it will open that.

way 3: Type as sublime-text in your Unity dash and you can open it.


Mouse and keyboard not working after upgrading to 11.10

It is very hard to answer this question as there is not a lot of information in your post, a better way would be to go into the forums and search there or post some more of your logs there. For example a recently started thread:
http://ubuntuforums.org/showthread.php?p=11446690
also you should try and unplug, wait and replug your keyboard to see if this helps.
This is not a solution but might be a way to get it work until you find out more. You should really find the appropriate logs to post for someone who has a clue about this.

An alternative way is to post a bug report or search the bug reports of ubuntu for workarounds.
You would find: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/807306
which shows something that might be relevant to your problem and is quite a good bugreport I think.


How do I just get the image, and get rid of the black columns on right and left in Shotwell?

From command line you can use this
convert {image} -bordercolor black -border 1x1 -fuzz 20% -trim +repage {new_image}

From the imagemagick manual: trim and the commandline options:

Trim, the 'Auto-Crop' Operator
The "-trim" operator is a very close relation to the highly versatile "-crop" operator discussed above. However instead of supplying an argument, this operator attempts to remove any borders or edges of an image which did does not change in color or transparency. In other words it removes the 'boring' bits surrounding an image.
Use a +repage to remove the virtual canvas page information if it is unwanted.


I have seen the same issue with my nvidia driver on my gateway. This happened when I updated the nvidia driver to the new driver as suggested by ubuntu. Try to "roll back" the driver to the original driver on first load. see if that helps.  This works on Ubuntu 11.10 I am not sure about server version.


Using Juju with private Openstack cloud deployment?

After deploying/bootstrapping, Juju will attempt to connect to the environment via the public address of the instances.  AFAIK, it gets this address straight from EC2 API's describe_instance(s) call.  In your environment, new instances spawn with an internal/private address and no public (floating) IP associated.  The result is a private address in both the private and public address fields of describe_instances.  After associating a floating IP to the instance, the public address field should now show the newly associated address.

Once its associated, Juju should be able to connect fine via SSH (just like you can).  So, you should be able to 'juju bootstrap', associate IP to bootstrap node, 'juju status'.  You'd need to also associate floating IPs to all other machines deployed.   One option is to add the '--auto_assign_floating_ip' to nova.conf, so that floating IP association happens automatically on instance spawn.

As for the proxy-to-apt issue, it would be great if Juju allowed users to customize the cloud-config that gets passed to new nodes for bootstrapping the Juju agents.  If it was possible, you can configure your apt proxies alongside the juju-specific cloud-config.  Since thats not currently supported, one option would be to publish a customized cloud image into Glance that contains a apt.conf for your environment, and set default-image-id in environments.yaml to that AMI ID.


I can't login to Ubuntu 20.04 - encrypted /home partition - SOLVED

Ok, I solved the issue :)
I've logged in to the system in a console hidden behind [Ctrl] + [Alt] + [F3]. Next I updated system and installed cryptsetup and ecryptfs-mount-private.
Next, I ran ecryptfs-mount-private command, provided a password to the encrypted /home partition and that's all.
After rebooting the partition was already mounted.


How do I digitally sign emails outgoing from different identities?

You assign the certificates to each email account by selecting the security option in Account Settings and then selecting proper certificates.

However, if both signing certificates have the same name (for example your name), you will not be able to use both because of this 7 year old and never fixed bug in Thunderbird:
https://bugzilla.mozilla.org/show_bug.cgi?id=278689


dist-upgrade is not an upgrade as you think it is. It handles the removal and addition of packages which apt-get upgrade doesn't. So if you run a sudo apt-get dist-upgrade on your 12.04 beta installation, all packages will be updated to the final 12.04 state. This is no different than running the updates once the final has been released.


RAID (mdadm) - File system relevant prior to building the array?

No, the filesystem is not relevant before creating the array.  mdadm does not "clobber" both drives, it just copies the contents of the primary to the secondary when mirroring.  If the primary already had an ext4 filesystem in it, then it will still look like it does, and after the resync, so will the second.  The new default mdadm metadata format of 1.2 is stored 4k from the start, so it will have overwritten and damaged the filesystem that was there before.  If you use format 1.0, which is stored at the end, then you can look at an individual disk and still use it without mdadm, though writing to it this way is a very bad idea because mdadm won't know what has changed if you put the drive back into the array.


How to use notification area (system tray) over indicators in Xubuntu?

This is rather simple. Just remove the indicator plugin from your panel and all bidirectional indicators become notification icons.

Your only loss is:

the menu-like behavior
some incompatible, indicator-only items
some rare icon size changes


Cannot find Highlight tool in Adobe Reader or Okular

In Okular, you should press F6. then you will see a toolbar with different options for highlighting.


How can nautilus-open-terminal, the Nautilus context menu item, be installed on Ubuntu 16.04?

The following works according to the @d3pd:

sudo apt-get install libgconf2-dev libnautilus-extension-dev intltool
wget https://launchpadlibrarian.net/133550689/nautilus-open-terminal_0.20.orig.tar.xz
tar -xvf nautilus-open-terminal_0.20.orig.tar.xz
cd nautilus-open-terminal-0.20
./configure
make
sudo make install


Can I toggle between XBMC and my Ubuntu Desktop?

Open System Settings and go to Appearance > Behavior and active Enable workspaces

Open Kodi and press CTRL+ALT+↓. You will move to the lower left hand workspace. Kodi is still running at the upper left hand workspace. You can go back to Kodi by pressing CTRL+ALT+↑. There are 4 workspaces by default.


how to upgrade haskell-stack on ubuntu 16.04?

Ubuntu official repository has older version of the haskell-stack. Downlaod the latest one.
First remove stack

  sudo apt-get remove haskell-stack

then install using this which is the latest one

https://docs.haskellstack.org/en/stable/install_and_upgrade/#ubuntu


Disable Auto Adjust microphone in Skype for Linux Beta

As far as I know you can adjust the Mic on the top right corner (with the speaker). I am not using lubuntu (just plain ubuntu), so it may be slightly diffrent. But you should be able to adjust the mic settings under System Settings --> Sound --> Input.


I hope you haven't been hung up for 6 hours...

I had read that during Ubuntu 16.04 upgrade you need to press the Tab key to access hidden accept buttons to accept the EULA (End User License Agreement) for the MS TrueType Fonts. I guess this issue has been around for awhile as these user discuss in May 2014 on the  Ubuntu Forums: EULA Tab Key

When I upgraded I chose not to install 3rd party stuff to save time so I didn't see the screen and I can't describe it in detail.


How do you report a seriously outdated repository mirror?

From https://wiki.ubuntu.com/Mirrors#Communication

  if you have questions, email us at mirrors@ubuntu.com.

You could also try posting to the Mirrors mailing list at https://lists.ubuntu.com/mailman/listinfo/ubuntu-mirrors


You must put the whole thing on one line:

options mac80211 ieee80211_default_rc_algo=pid

And then reboot.

Confirm the parameter has taken effect:

cat /sys/module/mac80211/parameters/ieee80211_default_rc_algo


You cannot convert .exe to .deb. It's two completely different things. I don't think running it in Wine will work either. If the so-called support assistant is going to check the battery, it will need to access some things close to the hardware, which would be specific to Windows and your particular computer model.

You could run Windows in a virtual machine, but that wouldn't allow the program to check your battery.

What you really need to do is install Windows on a separate partition or something, which should allow the program to work.


Detect clipboard copy/paste event and modify clipboard contents

Credit goes to Kenn.
I modified the script to my requirements and added the function to detect clipboard copy event and modify its contents.
Source.
Remove Line Breaks when copying text from PDF (Linux)
This bash script removes line breaks when copying text from PDF. It works for both Primary Selection and Clipboard of Linux.
#!/bin/bash

# title: copy_without_linebreaks
# author: Glutanimate (github.com/glutanimate)
# modifier: Siddharth (github.com/SidMan2001)
# license: MIT license

# Parses currently selected text and removes
# newlines

while ./clipnotify;
do
  SelectedText="$(xsel)"
  CopiedText="$(xsel -b)"
  if [[ $SelectedText != *"file:///"* ]]; then
    ModifiedTextPrimary="$(echo "$SelectedText" | tr -s '\n' ' ')"
    echo -n "$ModifiedTextPrimary" | xsel -i
  fi
  if [[ $CopiedText != *"file:///"* ]]; then
    ModifiedTextClipboard="$(echo "$CopiedText" | tr -s '\n' ' '  )"
    echo -n "$ModifiedTextClipboard" | xsel -bi
  fi
done

Dependencies

xsel: sudo apt install xsel
clipnotify. You can use the pre-compiled clipnotify provided in the repository or compile yourself.
To compile clipnotify yourself
sudo apt install git build-essential libx11-dev libxtst-dev
git clone https://github.com/cdown/clipnotify.git
cd clipnotify
sudo make

To USE

Download this repository as zip or copy and paste the script in a text editor and save it as copy_without_linebreaks.sh.
Make sure that script and clipnotify (downloaded or precompiled) are in the same folder.
Open terminal in script's folder and set permission
chmod +x "copy_without_linebreaks.sh"
Double-click the script or run by entering in terminal :
.\copy_without_linebreaks.sh
Copy text in pdf and paste it anywhere. Lines breaks will be removed.


I solved the issues I had as described in my question. Following the directions from the following link http://orkultus.wordpress.com/2013/04/20/how-to-nvidia-319-12-drivers-in-ubuntu-based-systems-with-bumblebee/ and after that configuring the /etc/bumblebee/bumblebee.conf file like so:

## Section with nvidia driver specific options, only parsed if Driver=nvidia

[driver-nvidia]

# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia-331
PMMethod=auto
# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib/nvidia:/usr/lib32/nvidia-331
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib/nvidia-331/xorg,/usr/lib/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

After that i changed the /etc/bumblebee/xorg.conf.nvidia file

#"BusID PCI:01:00:0"

to

BusID "PCI:01:00:0"

After everything, how could something so small cost me so much time! I hope anyone learns from my experience :)


No, you can't prevent it from starting when you boot up the computer.


A "Kernel panic" error indicates there is a serious problem with your Linux kernel.

You can find more info on this here:

http://searchdatacenter.techtarget.com/definition/kernel-panic

This could be hardware or software but reinstalling Ubuntu will probably fix the problem.

If it doesn't then you likely have a hardware issue, probably with a section of your hard drive having been corrupted. As Windows is working fine, it is unlikely (though just about possible) to be a problem with anything else, like CPU or RAM.


How do I downgrade Gedit to a previous (3.10.4) Version in Ubuntu 16.04 LTS

The solution is quite complicated so make sure you read and proceed carefully. As preparation to this make sure you enabled all packet sources so your /etc/apt/sources.list looks like this and do an upgrade:

sudo apt-get update
sudo apt-get dist-upgrade
reboot

To install the old version:

Then as a first step, you need to remove the existing version of gedit. To do so run the following commands in your terminal (ctrl+alt+t):

# this installs the build dependencies
sudo apt-get build-dep gedit gedit-plugins
sudo apt-get install moreutils

# this uninstalls the 3.18.3 version of gedit, gedit-dev,
# gedit-plugins and gedit-common and should get rid of everything else
# installed for gedit
sudo apt-get remove gedit gedit-dev gedit-plugins gedit-common

Now prepare a directory to work in. For convenience we do that in our home directory.

# creating directory and switching to it
mkdir ~/gedit-downgrade
cd ~/gedit-downgrade

Next step is to create a wget-list file to make the download easier (you can copy and paste the whole field into your terminal). If you're not using a 64-bit system you might want to find the proper links for i386 here.

cat > wget-list << "EOF"
http://mirrors.kernel.org/ubuntu/pool/main/g/gedit/gedit-common_3.10.4-0ubuntu13_all.deb
http://mirrors.kernel.org/ubuntu/pool/main/g/gedit/gedit_3.10.4-0ubuntu13_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/main/g/gedit/gedit-dev_3.10.4-0ubuntu13_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-developer-plugins/gedit-developer-plugins_0.5.15-0ubuntu1_all.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-latex-plugin/gedit-latex-plugin_3.8.0-3build1_all.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-plugins/gedit-plugins_3.10.1-1ubuntu3_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-r-plugin/gedit-r-plugin_0.8.0.2-Gtk3-Python3-1ubuntu1_all.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-source-code-browser-plugin/gedit-source-code-browser-plugin_3.0.3-3_all.deb
http://mirrors.kernel.org/ubuntu/pool/universe/g/gedit-valencia-plugin/gedit-valencia-plugin_0.8.0-0ubuntu2_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/universe/r/rabbitvcs/rabbitvcs-gedit_0.16-1_all.deb
http://mirrors.kernel.org/ubuntu/pool/universe/s/supercollider/supercollider-gedit_3.6.6~repack-2-1build1_all.deb
EOF

Now you have that wget-list file, you can download everything in one go by typing wget -i wget-list, let the files download and then begin your installation.

Please follow below steps one by one and if you run into dependency errors simply do sudo apt-get remove <package-name> which reflects the package giving trouble, then install the dependencies by hand with sudo apt-get install <package-name> then do the dpkg line again. Do not, and I mean do not run sudo apt-get -f install while you're trying this installation: it will mess everything up.

Now, let's begin with the essential packages (tested and working on a clean 16.04 LTS installation):

# install gedit-common (essential needed)
sudo dpkg -i gedit-common_3.10.4-0ubuntu13_all.deb

# install gedit (essential needed)
sudo dpkg -i gedit_3.10.4-0ubuntu13_amd64.deb

# install gedit-dev (essential needed)
sudo dpkg -i gedit-dev_3.10.4-0ubuntu13_amd64.deb

# install gedit-plugins (essential needed)
# here are some steps needed follow them carefully

    # unpacking the .deb file
    sudo dpkg-deb -R gedit-plugins_3.10.1-1ubuntu3_amd64.deb tmp

    # editing tmp/DEBIAN/control:
    # change 'python3 (<< 3.5), python3 (>= 3.4~), python3.4' to 'python3 (>= 3.5~), python3.5'
    sed 's/python3 (<< 3\.5), python3 (>= 3\.4~), python3\.4/python3 (>= 3.5~), python3.5/' tmp/DEBIAN/control | sudo sponge tmp/DEBIAN/control

    # editing tmp/DEBIAN/postinst
    # change 'py3compile -p gedit-plugins /usr/lib/x86_64-linux-gnu/gedit/plugins -V 3.4' to
    # 'py3compile -p gedit-plugins /usr/lib/x86_64-linux-gnu/gedit/plugins -V 3.5'
    sed 's/3\.4/3.5/' tmp/DEBIAN/postinst | sudo sponge tmp/DEBIAN/postinst

    # packing a new .deb file
    sudo dpkg-deb -b tmp gedit-plugins_3.10.1-1ubuntu4_amd64.deb

    # changing ownership of the new .deb file replace username with your username
    sudo chown username:username gedit-plugins_3.10.1-1ubuntu4_amd64.deb

    # removing tmp
    sudo rm -rfv tmp

    # installing it
    sudo dpkg -i gedit-plugins_3.10.1-1ubuntu4_amd64.deb

The following packages are only optional and you should be able to install them easily, the dependencies to download are given and tested on a clean 16.04 LTS install like the above.

# install gedit-developer-plugins (optional)
sudo apt-get install python-pocket-lint
sudo dpkg -i gedit-developer-plugins_0.5.15-0ubuntu1_all.deb

# install gedit-latex-plugin (optional)
sudo apt-get install rubber
sudo dpkg -i gedit-latex-plugin_3.8.0-3build1_all.deb

# install gedit-r-plugin (optional but needs gedit-plugins)
sudo dpkg -i gedit-r-plugin_0.8.0.2-Gtk3-Python3-1ubuntu1_all.deb

# install gedit-source-code-browser-plugin (optional)
sudo apt-get install ctags
sudo dpkg -i gedit-source-code-browser-plugin_3.0.3-3_all.deb

# install gedit-valencia-plugin (optional)

    # unpacking .deb file
    sudo dpkg-deb -R gedit-valencia-plugin_0.8.0-0ubuntu2_amd64.deb tmp

    # edit tmp/DEBIAN/control
    # change 'libvala-0.28-0 (>= 0.15.1)' to 'libvala-0.30-0 (>= 0.15.1)'
    # change 'libvte-2.90-9 (>= 1:0.27.2)' to 'libvte-2.91-0 (>= 0.27.2)'
    sed -e 's/libvala-0\.28-0 (>= 0\.15\.1)/libvala-0.30-0 (>= 0.15.1)/' -e 's/libvte-2\.90-9 (>= 1:0\.27\.2)/libvte-2.91-0 (>= 0.27.2)/' tmp/DEBIAN/control | sudo sponge tmp/DEBIAN/control

    # packing a new .deb file
    sudo dpkg-deb -b tmp gedit-valencia-plugin_0.8.0-0ubuntu3_amd64.deb

    # changing ownership of the new .deb file replace username with your username
    sudo chown username:username gedit-valencia-plugin_0.8.0-0ubuntu3_amd64.deb

    # removing tmp
    sudo rm -rfv tmp

    # installing it
    sudo dpkg -i gedit-valencia-plugin_0.8.0-0ubuntu3_amd64.deb

# install rabbitvcs-gedit (optional)
sudo apt-get install rabbitvcs-core
sudo dpkg -i rabbitvcs-gedit_0.16-1_all.deb

# install supercollider-gedit (optional)
sudo apt-get install supercollider-language
sudo dpkg -i supercollider-gedit_3.6.6~repack-2-1build1_all.deb

Now you have to make sure the packages won't be changed when you run an update, so ensure only to state the packages you have installed:

# now protecting this all from upgrading
sudo apt-mark hold gedit-common gedit gedit-dev gedit-developer-plugin gedit-latex-plugin gedit-plugins gedit-r-plugin gedit-source-code-browser-plugin gedit-valencia-plugin rabbitvcs-gedit supercollider-gedit

To reverse the whole process do:

# removing protection from upgrades
sudo apt-mark unhold gedit-common gedit gedit-dev gedit-developer-plugin gedit-latex-plugin gedit-plugins gedit-r-plugin gedit-source-code-browser-plugin gedit-valencia-plugin rabbitvcs-gedit supercollider-gedit

# simply do an upgrade
sudo apt-get update
sudo apt-get dist-upgrade

Is there a script to do it?:

Yes I made even a script to automate the whole process, you can get it here or by:

wget https://github.com/Videonauth/gdowngrade/blob/master/gdowngrade.sh

Then to run it:

chmod 755 ./gdowngrade.sh
sudo ./gdowngrade.sh

This will create a custom file for you called gupgrade.shwhich allows you to reverse the whole process by simply:

sudo ./gupgrade.sh


There is no keynavrc file for keynav in the home folder

This question was solved by the OP:

  You should find a sample .keynavrc already installed on your local system at /usr/share/doc/keynav/keynavrc

  Alternatively, you can find one online at:

  https://raw.githubusercontent.com/jordansissel/keynav/master/examples/keynavrc.jordan

  Copy the text. Open Gedit and paste the text. Save it as .keynavrc in
  your home directory (don't forget the " . " before the name

  You can edit it to use the arrow keys as per this question answered by
  hugoheden. logout and login

  It also helps to put keynav in your startup apps


grub entry for slackware from another drive

Lilo is a Windows type boot loader. So may be easier to chain load to the MBR or PBR of your other drive.

This is a partition boot entry. But note that drive you boot from is always hd0 in grub, but drive order can otherwise vary.

How to add a GRUB2 menu entry for booting installed Ubuntu on a USB drive?

menuentry "Install on sda (When from sdc) Chainboot" {
set root=(hd1)
chainloader +1
}

menuentry "Install on sdb (from sdc) Chainboot" {
set root=(hd2)
chainloader +1
}

menuentry "Chainload Other Systems Grub Menu on sdc1" {
set root=(hd2,1)
chainloader +1
}

menuentry " " {
set root=
}

menuentry "System restart" {
echo "System rebooting..."
    insmod reboot
reboot
}

menuentry "System shutdown" {
echo "System shutting down..."
    insmod halt
halt
}

Correct entry to turn off os-prober

Turn off prober

gksudo gedit /etc/default/grub

Add this line

GRUB_DISABLE_OS_PROBER=true

update grub menu after any change

sudo update-grub

If using LVM you make be able to get os-prober to work if you add the lvm drivers in Ubuntu and manually mount the encrypted partition (so it is unencrypted) when os-prober runs.

sudo apt-get update && sudo apt-get install lvm2 cryptsetup

If other steps to mount & unencrypt needed they are here, just you do not need all the resize instructions:
https://help.ubuntu.com/community/ResizeEncryptedPartitions


At this moment I'm using Libroffice 3.5.0 with Ubuntu 11.10 and have follow this guide and the changes doesn't take effect.

That because the configurations are in this folder

  ~/.config/libreoffice/3/user/config

and not the old one:

  ~/.libreoffice/3/user/config

I also changed the file from i.uve.a.ene because in his version only shows 8 columns and not 10. From his work I've remove some colors and keep the Ubuntu and Chart. This is the final aspect of the colors in the main menu.


Dual boot options disappeared and now just boots straight into Ubuntu

You can try downloading and burning http://sourceforge.net/projects/boot-repair-cd/files/
 on the CD, then boot that CD and something like this will show up:

Click Recommended repair and it will repair your grub menu options.

Read this: https://help.ubuntu.com/community/Boot-Repair


VPN connection DNS server order reversed

What should happen is that the VPN client proces should register the VPN nameserver address with resolvconf under the record name IFACE.CLIENT where IFACE is the name of the VPN network interface (e.g., tun0) and CLIENT is the name of the VPN client program; and the file /etc/resolvconf/interface-order should include a glob pattern matching this record name at an appropriately high priority: after loopback interfaces lo* but before the LAN interfaces such as eth*. In the factory-shipped interface-order file the tun* and tap* patterns are at the right position in the order.

If you are using a third party VPN client program then it may not support this, in which case you will have either to hack the latter program's scripts or adopt some workaround such as putting an address on a dns-nameservers line in /etc/network/interfaces (if ifup is used) or writing a custom resolvconf update script.


What is the mediawiki install path on Ubuntu when you install it from the Repos?


Ubuntu 16.04 login screen in loop after installing AMD radeon driver

At Login Screen

ALT + CTRL + F2

type your username and password. Create a new user.

sudo adduser username

new password for the user.

ALT + CTRL + F7

login from new user you created.If worked you need to delete all the files related to your login in your home dir.

like .gconf , .gnome, .gnome2 and so on if not imp.

And will work like a charm


How to automate the mounting of a Samba shared directory ith each reboot (fstab already created)

You have to be sure that the network is available when you try to mount the cifs share. So you should use the _netdev option in your fstab file.

From the man-pages of the mount command:

  _netdev:
    The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).


Installing Windows 7 over Ubuntu, partition problem

What you're attempting is similar to trying to pick out the engine of a car while it is running.

To install another operating system: Make sure to boot the new (other OS) installation media and handle the re-partitioning from there.


I installed Ubuntu on a separate hard drive but now my computer boots differently

Two options can be done

1.restoring windows bootloader.

2.restoring grub for linux.

1->put a windows cd or bootable usb and go into recovery option then find cmd and type the following:-

bootrec.exe

this will automatically repair your boot manager

2->put ubuntu cd or usb and reinstall it.


Ubuntu XPS13 Sputnik boot order and Bios configuration?

In retrospect it was potentially three difficult questions to answer – whilst in the panic stage of system down.  I will try my best to answer them should anyone from the future stumble across this.

These are the steps I followed…

Download and install Parted Magic with UNetbootin as it has a lot of good tools in one place.
Ran the USB disk with Parted Magic on, by changing the boot order in BIOS.
Ran TestDisk to scan the partitions and report errors.
Ran Clonezilla to back-up partitions to an external drive and then repair the Superblock issues.
Changed boot disk with GParted to Sda3 the main partition (listed above).
Used Lilo to detected and repair the boot loader (Grub2).
This got me to a Ubuntu boot window. However despite going through the long list of Ubuntu images, with their different kernal versions, I ended  in Kernal Panic on each and everyone of them. I do vaguely, remember one of these worked the previous time I got in this mess.

I then wiped all the disk with partitions, and installed Ubuntu 16.04. I can confirm that Dell XPS 13 Project Sputnik 1st Edition works very well on the new OS and would recommend to all would be early adopters.

All the saved files from the external drive have been copied after setting their permission to chmod 777.

Over & out!


Apple Alu keyboard Hungarian layout 0 and í swapped

I figured it out:

To get the keycodes to override the command is xmodmap -pke.

And in order to fix the swapped keys you have to insert these two lines in the ~/.Xmodmap file:

keycode 49 = iacute Iacute backslash bar less greater
keycode 94 = 0 section doublelowquotemark rightdoublequotemark notsign notsign grave asciitilde

To apply the settings launch the command

xmodmap ~/.Xmodmap

And you're done.


regular expressions / pattern matching on ubuntu command line

While similar, the wildcard patterns that you’re referring to are not regular expressions; they are glob patterns and in this context, shell patterns. They are expanded by the shell itself – not by commands such as ls, cp, etc. Just to clarify, these commands are not actually “bash utilities”; they are programs that can be executed by any shell.

When a command is typed in a shell, the shell parses the tokens (words) and one of the things it does is expand glob patterns into appropriate filenames. In the most common case, these filenames are then provided by the shell as a list of arguments for the command being invoked.

Standardisation

These shell patterns have been standardised for Unix-like operating systems in the POSIX
specification: Pattern Matching Notation.

Some shells (Bash and the Korn shell) go further and extend these patterns to implement extended globs. For more information, see the relevant section on Greg's Wiki.


I see what you speak about. I had an issue like this: I installed Chromium from software center and could not uninstall it. The thing is that it was a snap package (don't ask me why) so you can't remove it with apt or dkpg
The solution to your problem is

sudo snap remove chromium


Compile AMD athlon-xp 32 bit kernel in intel 64 bit machine

Compile 32bit kernel on 64bit machine I followed this thread and tuned march and tuned gcc flags to athlon-xp.


How do I navigate to folders with spaces in their names? I get "no such file or directory" when I try

Go inside the /opt directory via terminal and then run below command,

k@k-Ubuntu:~$ cd /opt
k@k-Ubuntu:/opt$ cd "Sublime Text 2"

As the folder you want to connect has spaces in the name, you must surround the name with quotes in order for the Shell to read it correctly (as one name). In other case it will read only the Sublime and this doesn’t exist.

Another way to avoid this issue, is to use Tab Completion. This is a feature that will help you to auto-fill weird names and/or long names. Read here about Tab Completion and learn it. It is very useful(in Ubuntu is pre-installed).

A third way for names with spaces is the backslash \ . Above command with quotes could be

cd Sublime\ Text\ 2/

the backslash followed by a space explicitly denotes a space.

A suggestion could be: Do not create folders in Linux with space in name. Prefer something like
Sublime-Text-2 or Sublime_Text_2


Why is `gitlab user` listed in the list of users at login?

As it seems you've got Ubuntu server with some software/users installed on it, which you don't need to keep, and have no idea if there are any additional back doors to this machine.

The preferred solution (assuming that you have physical access to the server) is:

Backup every data which might be needed in the future
Perform fresh install of the machine (Instructions how to Install Ubuntu)
Copy back the to the fresh installed machine - the data you need

And you'll have a fresh Ubuntu machine, which holds only your username, without any backdoors, unknown software installed

BTW if you are only looking for a way where no one will be able to login using gitlab user:

The first thing you can do is change the shell used by gitlab to be /usr/sbin/nologin

You can do it as root:

chsh -s /usr/sbin/nologin gitlab


If in a previous update or current version wifi was working then probably you mess with software & update center, you should leave that repositories default or what you checked to uncheck them, run apt update; apt upgrade but make sure you connected to the internet while doing this, you can use USB or Bluetooth tethering. and restart pc for 1-2 times.


18.04 issues with X1 Carbon: alsamixer config + Microphone issues: What does "pacmd" do here?

What is module-alsa-source?
module-alsa-source is a PulseAudio module that provides a recording source for devices supported by the Advanced Linux Sound Architecture (ALSA). Usually this is taken care of automatically by another PulseAudio module called module-udev-detect which relies on the device manager for the kernel udev which in turn relies on the device support by the running kernel along with device firmware available on the system. In most cases your input devices will be supported and this automatic detection goes flawlessly and your input devices are correctly detected, identified and used. However, in rare cases ( as with any other automated device detection process ) the detection fails and you need to manually identify and specify the input device using module-alsa-source followed by the device ID / index that you can get from ALSA aware applications like arecord -l. The first number after hw: is the ID / index of the card and the second is the ID / index of the device on that card. The need for this manual procedure is temporary in most cases and your device will most likely get automatically detected when support for it is added to future kernels and you update your kernel. Meanwhile, there is nothing wrong with manually configuring partially supported devices like yours as long as it works.
How to make it persist after reboot?
You can make it persist after reboot by editing the global PulseAudio configuration file /etc/pulse/default.pa and adding the command at the end of the file without pacmd like so:
load-module module-alsa-source device=hw:0,6


In order to hack on a piece of software, you should not use the binary distribution, but the source distribution. For packages in Ubuntu, you can use apt-get source packagename. For instance, in order to get the source code for GEdit, you'll do apt-get source gedit. For PPAs that might not work, but you'll get the source from their Launchpad.net page.

You shouldn't really care too much about individual files that comes with a package, because that's what the package system is for, but if you do want to list all the files that were installed with a package, you can use dpkg -L packagename. In your case, that should be dpkg -L brackets.

None of those commands require root permissions, so you should not prefix them with sudo.


Ubuntu 14.04, lost grub2 and partition during Windows 10 upgrade

Thanks, oldfred. Testdisk ended up working.

In a nutshell, I looked at my deleted files (see image in OP) and changed the types for the Linux items marked "D" to "P" for both. Then, selected "write". (Thinking that would ADD those to the other partitions.)

After restarting, the computer said "grub rescue", same as when I was doing the Windows 10 installation. Installed the Boot-Repair-Disk, and it reinstalled my grub2 menu and recognized my Ubuntu partition, but no Windows to boot into.

Went back in with testdisk and changed the types on all of the deleted partitions, except Linux swap. The top one got an "*", the next 3 got a "P" and the Linux Swap kept the "D" (because of the rule that only 4 partitions can be marked as primary).

My thought was that the 3 top deleted items, must be my Windows 7 partitions and I'll take Windows 7 back over losing my Ubuntu partition.

Did a restart, inserted the Boot-Repair-Disk, ran "recommended repair", did a restart, and my grub was up and running with both Ubuntu and Windows, but it was Windows 10, instead of 7.

So, it all seems to be working again, but with an upgraded Windows.


How to view folders with a large amount of files?

I'd suggest splitting the files into separate subfolders using the command line before proceeding to view your files. Its unlikely that you will be able to productively view and browse the images until you reduce the file count per folder.

For example you can split the files by date. If there is a date stamp in the file, you can use a command like

cd /images-dir
mkdir 20150401
mv *20150401* 20150401

The cd command will take you to your image directory. The mkdir is to create a subfolder. The mv command is to perform the actual file move operation.


What process is responsible for media keys in Unity?

For me this works with PulseAudio:

# volume control
bindsym XF86AudioLowerVolume exec /usr/bin/pactl set-sink-volume @DEFAULT_SINK@ -- '-5%'
bindsym XF86AudioRaiseVolume exec /usr/bin/pactl set-sink-volume @DEFAULT_SINK@ '+5%'
bindsym XF86AudioMute exec /usr/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle


This certainly sounds like an issue caused by sharing your $HOME. I can't really tell you which file is the problem since I can't reproduce, but here are some tips.

You can use strace to trace what a program does when it is run. For example, on my system, it shows me that it accesses the following files from my home directory:

$ strace gnome-terminal 2>&1| grep -oP '/home/terdon/.*(?=")'
/home/terdon/.config/gtk-3.0/settings.ini
/home/terdon/.config/gtk-3.0/gtk.css
/home/terdon/.local/share/themes/Default/gtk-3.18/gtk-keys.css
/home/terdon/.local/share/themes/Default/gtk-3.16/gtk-keys.css
/home/terdon/.local/share/themes/Default/gtk-3.14/gtk-keys.css
/home/terdon/.local/share/themes/Default/gtk-3.0/gtk-keys.css
/home/terdon/.themes/Default/gtk-3.18/gtk-keys.css
/home/terdon/.themes/Default/gtk-3.16/gtk-keys.css
/home/terdon/.themes/Default/gtk-3.14/gtk-keys.css
/home/terdon/.themes/Default/gtk-3.0/gtk-keys.css

I don't really see which one of these could be causing the issue though. However, I'm not running Ubuntu so your output might be more useful.


As you determined, sudo apt update will offer to fix this for you.

With apt-get, you need to specify the corresponding option:

sudo apt-get update --allow-releaseinfo-change


Cannot find my Windows bootloader screen

Boot windows installation disk the there was a windows repair option before you go into the installation,select it.
After selecting windows repair option,it will take you to the next screen.In that screen select the command prompt option
Then run the below commands,on it.

bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd

Atlast restart your pc.


Ubuntu 12.04 vs Ubuntu 14.04 login after blank screen

Press Ctrl+Alt+F3 and login into the shell.
Now run

ls -lah

If in the output the line

-rw-------  1 root root   53 Nov 29 10:19` .Xauthority

then you need to run

chown "$USER:" .Xauthority

and try logging in.
Else, do

ls -ld /tmp

Check for the first 10 letters in the left: they should read exactly so: drwxrwxrwt.

drwxrwxrwt 15 root root 4096 Nov 30 04:17 /tmp

Else, you need to run

sudo chmod 1777 /tmp

and check again.
If not both, I'd recommend you either

dpkg-reconfigure lightdm

or uninstall, reinstall it.

Now press Alt+→ until you reach the login screen again, and restart.


What language(s) can I use in LibreOffice for macro scripting?

I think this page answers your question. In summary, you can use the following:

LibreOffice Basic
JavaScript
BeanShell
Python

But you can't write/edit Python scripts from LibreOffice IDE, just to run scripts.


Command not found trying python script for bash

os.system() starts a shell, executes the command, and closes that shell. Your cd's effect is lost. Change directory with Python itself:

os.chdir("Downloads/smartgit")
subprocess.call(["bin/smargit.sh"])

Better yet, which chdir at all? Why not directly call the script:

smartgit_path = os.path.expanduser("~/Download/smartgit/bin/smartgit.sh")
subprocess.call([smartgit_path])


Making global variables persistent in bash shell

You can make it persistent by adding it to your ~/.bashrc file. This file is called every time you start an interactive bash shell.


PHP-OpenCloud with OpenStack installed Locally

Yes it will work with Private openstack as well but you'll want to call use OpenCloud\OpenStack; rather than use OpenCloud\Rackspace;


Sounds you've got the correct files on your system.

"update grub" is an Ubuntu specific script, which invokes grub-mkconfig. I can't help you with that...
But you can try without the script. grub-mkconfig will start from /etc/default/grub to make your system boot. While booting grub looks to the grub.cfg file to find other OS'es.

first backup your boot file:

sudo cp /boot/grub/grub.cfg  /boot/grub/grub.cfg.backup

Then run:

sudo grub-mkconfig -o /boot/grub/grub.cfg

And see how that goes...

I'm not working on a ubuntu machine but my grub-mkconfig is located in the /bin folder not sbin like your error output suggests. You can find out by running this code

which grub-mkconfig


Is there a way to copy a Windows program from an external HDD into WINE?

Is there a way to move or copy this program from my Windows HDD into WINE?

Sure, you can copy the files to your WINE. WINE is a directory in your /home/$USER so you can copy files to that and see them in an explorer in WINE.

Mind though: copying it into WINE does NOT mean you can use that software. That depends on what the software is. Even if you did have the installation media it does not guarantee to work in WINE either.

Would it be an option to create an ISO from the external HDD and create a virtualbox VDI so you can use it virtually? Like https://www.intowindows.com/how-to-boot-and-install-from-iso-in-virtualbox/ That would also enable your software inside the container.


Is this any help? http://www.arsgeek.com/2006/09/19/ubuntu-tricks-how-to-generate-a-list-of-installed-packages-and-use-it-to-reinstall-packages/. What it explains is how to get Ubuntu on your laptop too give you a file listing what's installed, and then to use that list on another PC to install the exact same software. I may have misunderstood your question though! Update: this example might be even easier using the tool APTonCD: http://www.ubuntugeek.com/create-backup-of-all-installed-packages-using-aptoncd-in-ubuntu.html

Update 8th May: If I understand then, you have Ubuntu installed on the external hard disc of your laptop, and you want to tote this around to your friends and install Ubuntu from the portable HDD on to their PCs.


Wanting to install ati driver for duel graphics AMD8 with radeon 6470

I have now solved this I think
I downloaded via Additional Hardware Drivers applet it gave ne error in install but the temperature has dropped significantly from 62 to 44 dont ask me why..Evidently some of the install went ok anyway...
I also now tweaked   Cataylst.


When will Wayland support restarting the shell by command?

In an Xorg session one can restart GNOME shell without losing application state as applications are running against a separate server (X). But unlike Xorg in case of a Wayland session GNOME shell is not separate from the Wayland server.

So there isn't any way to restart GNOME shell in Wayland without losing application state as the display server also goes down. It's similar to restarting X server in an Xorg session.

That is the reason why this shell restart option is disabled in Wayland (recall that usually the key sequence to kill the X server is also disabled by default in the Xorg session)  and there will probably never be any non-destructive way to restart GNOME shell in Wayland.

You may see this GNOME bug report for details.


Help with Xbox One Controller and Bluetooth

First, make sure you have the Bluetooth-enabled version of the Xbox One controller. Inside the battery compartment there should be a label with a model number on it, the Bluetooth-enabled model says "MODEL 1708".

It sounds like you've already tried setting disable_ertm. That's always worked for me, here's what I do:

> sudo su
# echo 1 > /sys/module/bluetooth/parameters/disable_ertm
# exit
> cat /sys/module/bluetooth/parameters/disable_ertm
Y

Restarting the Bluetooth service (sudo systemctl restart bluetooth) isn't necessary but shouldn't hurt. Rebooting will reset disable_ertm to N.

To connect, turn on the gamepad by pressing and holding the Xbox button until it lights up. Then, press and hold the Sync button (it's near the micro USB port) until the Xbox button starts blinking rapidly.

In Ubuntu, open the Bluetooth Devices list and click Search to start searching for devices. The device should show up as "Xbox Wireless Controller". Right-click and select "Human Interface Device Service (HID)" under "Connect". This sometimes fails, you'll see the signal strength info pop up and then disappear. If this happens, try selecting "Human Interface Device Service (HID)" again, it generally succeeds on the second try.

If the Xbox button stops blinking before you can connect, remove the device from Bluetooth Devices and try again.


It is likely that the postgresql package name isn't exactly postgresql

The following command will catch more patterns of postgresql:

apt-get --purge remove postgresql\*

Note: You should make sure that PostgreSQL isn't running.

The following command should return nothing:

ps -C postgres


How can I get window thumbnails when hovering over unity bar application icons?

Be sure to install both compizconfig-settings-manager (CompizConfig
Settings Manager or CCSM) and compiz-plugins-extra. You can do this
from Ubuntu Software Centre.
Open CCSM > Extras > Enable Window Previews (turn this on) > Taskbar
Shows Only Windows Of Current Viewport (uncheck).

This will do as you wish.


As user158707 pointed out, all I needed to use was Fn+Shift+a numpad key. Or simply turn on numlock and then just use Fn+a numpad key


You can not use autorun directory from Ubuntu. If you want to use Ubuntu and use the CD you have 2 possible options (the 2nd is the easiest):

WINE and open the CD from WINE. Problem: you need to setup the CD to work with WINE. And the application you want to use might not work with WINE. You can check the WINE AppDB upfront to see if it is even possible to use that program ou want.
virtualBox. This requires a copy of Windows and you need to install Windows in a VBox. The CD will then autorun like from a normal Windows (since you install a normal Windows).

The other option is to forget about the Windows CD and focus on something from Ubuntu itself. There is a lot of educational stuff in our repositories and I doubt it really matters to a 5 year old what it is as long as it is fun and colourful ;-)


Fractional scaling on ubuntu 19.04 doesn't seem to work well

Fractional scaling is an experimental feature that works only when you are using the Wayland display server. If you performed a standard install of Ubuntu 19.04, you are using Xorg, the legacy display server. This is why fractional scaling does not work.


Really annoying big font in VMWare Fusion 7

I got the same problem on my IMac Retina and here is how I fixed it:
go to "Virtual Machine", "settings", "Display", then check box "Use full resolution for Retina dislay"

Everything turns beautiful...  Enjoy!


how to get background sound work in recordmydesktop

I have a one liner script to capture screen. It can capture both mike and desktop voice.

It's not very good, but I hope it serves the purpose.

 avconv -f   pulse -i default -f x11grab -r 15 -s $(xdpyinfo  | grep dimensions | awk -F ' ' ' { print $2 } ' ) -i :0.0+0,0 -acodec libmp3lame -vcodec libx264  $(date +"%m%d%Y_%H%M%S_$HOSTNAME")_screencast.mp4


External hard-drive is "clicking" when idle

As I have written before I received my USB 3.0 enclosure today and experienced the same issue with a drive which has been operating fine in another enclosure for quite some time. I have 4 partitions on that drive: one swap, one NTFS and two EXT4. The first EXT4 partition has Ubuntu installed on it, the second was a fresh formatted partition and only the second one caused the drive activity. After some experimenting I looked into iotop and saw a process being active on the partition. It turned out to be the journaling process for that drive and after some minutes in idle the drive completely stopped activity. I have transfered 50 GB to the drive and it's silent again after the copy job finished. I believe it just had to build the journal or finish some other maintenance activity after the partition was formatted. I also tried a regular micro USB cable when the drive was busy in idle state with the same result, so it's not a USB 3.0 issue.


Resolution of the login screen is wrong on a second monitor

The login screen in 11.10 uses the default X behaviour for multi-monitors.  In most cases this is mirroring, but various drivers can behave incorrectly (e.g. incorrect resolutions or not working second monitors).  We have this in 11.10 as the original solution of managing the monitors like the session does had more problems.

This feature is planned to be revisited for 12.04 to make the experience better.  The desired behaviour is the monitors run at their native resolutions, have the background correctly scaled/cropped and a user can log in from any available monitor.


I had the same problem for very long time.Here's how I solved it:

(Follow the steps serially)

1. For gtk3 programs such as rhythmbox and online accounts:

First you need to enter proxy settings in network settings (along with authentication):

Then apply system wide.

2. For apt,software center etc

edit the file /etc/apt/apt.conf

And then replace all the existing text by the following lines

Acquire::http::proxy "http://username:password@host:port/";
Acquire::ftp::proxy "ftp://username:password@host:port/";
Acquire::https::proxy "https://username:password@host:port/";

3. Environment variables

edit the file /etc/environment

And then add the following lines after PATH="something here"

http_proxy=http://username:password@host:port/
ftp_proxy=ftp://username:password@host:port/
https_proxy=https://username:password@host:port/

That's all..


Problem with deleting Windows-partition on Ubuntu

The partition really should be deleted if you deleted in GParted. But there's still a GRUB entry, which starts the Windows boot loader, which can't find Windows any more.

UEFI: UEFI should be starting GRUB in order to boot Ubuntu. If it doesn so, remove every "windowsy" thing from the EFI partition. The EFI partition is mounted at /boot/efi. Look for a directory like /boot/efi/EFI/Windows.

Legacy BIOS: Note that most Windows installations keep their boot loader in a separate 100 MB partition. Delete this partition too, if it's still there.

Afterwards run sudo update-grub to remove the Windows boot loader from GRUB.


How to prevent the deployment process from accessing DNS server?

RTFM helped. From Debian's preseed example:

# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain

# If you want to force a hostname, regardless of what either the DHCP
# server returns or what the reverse DNS entry for the IP is, uncomment
# and adjust the following line.
#d-i netcfg/hostname string somehost

Which means that netcfg/get_hostname is irrelevant: its only purpose is to prevent the installer from asking the question in the first place.

Indeed, when I set the value of netcfg/hostname, both /etc/hostname and /etc/hosts contain the values specified in the preseed, ignoring the DNS PTR record.


$ kcmshell5 breezestyleconfig

Or, alternatively, go to System Settings > Application Style > Widget Style > Configure


Error when formatting the Hadoop filesystem

Hadoop cannot create /usr/local/hadoop-datastore/hadoop/dfs/name/current directory.

Try running this:

sudo bin/hadoop namenode -format

Running Hadoop executable using sudo.I'm not sure, but I think it didn't work for me when I installed Hadoop. If so do this:

sudo su

then:

bin/hadoop namenode -format


Which is the more tested repository: backports or proposed?

As was nicely explained in the answer there

What is the difference between security, updates, proposed and backports in /etc/apt/apt.conf.d/50unattended-upgrades?

both repositories have a different purpose. So in terms of stability we would compare apples with pears.

Shortly:

Packages eligible for an upgrade will have to go to proposed for testing. Only if they don't fail they will eventually move to the major repositories where updates will be presented to all users.
Stable packages from later releases will sometimes be made available to a previous release in backports. They likely are not thoroughly tested with the older release. These packages will often not be made available in the major repositories but if they do they will have to survive testing in proposed first.


Extreme Tux Racer is in Official Ubuntu Repository.

You can install it without difficult compilations by:

sudo apt-get install extremetuxracer


Bluetooth adapter not found in Ubuntu 16.04

I had the same problem. In my case I think it was a bug of my old installed version of unity control center, or some missing dependencies.
Resolved easily updating unity-control-center:

    sudo apt-get install unity-control-center

Hope it may help.


I'd also say a backup of the whole system is not necessary. /home and maybe /etc should be enough. And if you also backup the package-selection you are up and running quite fast after a disaster.

For Back In Time I wrote a user-callback script which will place all necessary infos in your home before creating a new snapshot. Install Back In Time from Software Centre and configure it to backup /home/<YOUR_USER>. If you want to backup /etc configure an other Back In Time profile with Back In Time (root) because only root has full access to /etc. Than copy the script below to ~/.config/backintime/user-callback and make it executable with chmod 755 ~/.config/backintime/user-callback

#!/bin/sh
#    Copyright (c) 2012-2014 Germar Reitze
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License along
#    with this program; if not, write to the Free Software Foundation, Inc.,
#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

# backup selection of apt-get
# Take a look at
# https://github.com/bit-team/backintime/wiki/FAQ#how-to-backup-debian-ubuntu-package-selection
# https://github.com/bit-team/backintime/wiki/FAQ#how-to-restore-debian-ubuntu-package-selection

profile_id="$1"
profile_name="$2"
reason="$3"
errorcode="$4"
DST="$HOME/.apt-backup"

case $reason in
    1) #on process begin
       mkdir -p $DST
       dpkg --get-selections > $DST/package.list
       apt-mark showauto > $DST/pkg_auto.list
       apt-mark showmanual > $DST/pkg_manual.list
       rm -f $DST/sources.list.d/*
       cp -aR /etc/apt/sources.list* $DST/
       apt-key exportall > $DST/repo.keys
       ;;
esac

After a disaster you need to follow these steps:

install Debian/Ubuntu on your new hard drive as usual
install backintime-qt4 from our PPA

sudo add-apt-repository ppa:bit-team/stable
sudo apt-get update
sudo apt-get install backintime-qt4

connect your external drive with the snapshots
start Back In Time. It will ask you if you want to restore your config. Sure you want! Back In Time should find your snapshots automatically. Just select the one from which you want to restore the config and click Ok.
restore your home
recreate your /etc/apt/sources.list if you had something special in there. If your Debian/Ubuntu version changed don't just copy them from ~/.apt-backup/sources.list
copy your repositories with

sudo cp ~/.apt-backup/sources.list.d/* /etc/apt/sources.list.d/

restore apt-keys for your PPA's with

sudo apt-key add ~/.apt-backup/repo.keys

install and update dselect with

sudo apt-get install dselect
sudo dselect update install

make some "housecleaning" in ~/.apt-backup/package.list. For example you don't want to install the old kernel again. So run

sed -e "/^linux-\(image\|headers\)/d" -i ~/.apt-backup/package.list

install your old packages again with

sudo apt-get update
sudo dpkg --set-selections < ~/.apt-backup/package.list
sudo apt-get dselect-upgrade

restore package selection with

sudo apt-mark auto $(cat ~/.apt-backup/pkg_auto.list)
sudo apt-mark manual $(cat ~/.apt-backup/pkg_manual.list)

I'm member of BIT Dev-Team


bash: /usr/bin/java: No such file or directory

This is because there are some 32-bit libraries missing in your Ubuntu 64-bit. Run:

apt-get install libc6-i386

you can refer to this Stack Overflow post for more information


Is there a BIOS option to enable/disable it?

Do you know (e.g. from the specs) if the digitizer is connected via PCI or USB? In the first case you can use lspci to see if it shows up, in the second case, try lsusb. Both tools support the -v option for more verbose output. Yet another tool to list the hardware that is detected in your system is lshw.

Does it show up in the file /var/log/Xorg.0.log, as mentioned in the forum thread you refer to?


RTFM: The manpage for top is a long read but eventually things became clear.

I'm now using this:

top -bn 1 |grep "Cpu(s)" | awk '{print "user: " $2+$6 "% syst: " $4+$12+$14+$16 "% wait: " $10 "% idle: "$8"%   Total: " $2+$4+$6+$8+$10+$12+$14+$16 "%"}'

Unfortunately it hardly ever perfectly totals at 100%

@boson:~ $ top -bn 1 |grep "Cpu(s)" | awk '{print "user: " $2+$6 "% syst: " $4+$12+$14+$16 "% wait: " $10 "% idle: "$8"%   Total: " $2+$4+$6+$8+$10+$12+$14+$16 "%"}'
user: 1.2% syst: 0.7% wait: 0.8% idle: 97.4%   Total: 100.1%
@boson:~ $

An alternative would be to install the sysstat package and use mpstat thusly:

@boson:~ $ mpstat | tail -1 | awk {'print "user: " $4+$5 "% syst: " $6+$8+$9+$10+$11+$12 "% wait: " $7 "% idle: " $13 "%   Total: " $4+$5+$6+$7+$8+$9+$10+$11+$12+$13 "%"}'
user: 1.18% syst: 0.66% wait: 0.76% idle: 97.39%   Total: 99.99%
@boson:~ $


How do I save my new resolution setting with xrandr?

You have several choices but perhaps the easiest is to place your command exactly as you have given above in your $HOME/.xprofile file. From here it will be executed every time you login.

By default this file does not exist in Ubuntu and so may need to be created manually and then be made executable. The following commands will do this:

touch $HOME/.xprofile
chmod +x $HOME/.xprofile

Note the 2 small shortcomings of this method:

.xprofile is accessed occurs fairly late in the startup process so you may see some initial screen resolution resizing
This is a 'per user' setting and may need to be repeated for other users on your system

If you wish to delve deeper there are a few other choices available in the reference link below, but this is still the safest and easiest.

References:

Setting xrandr changes persistently


How can I export the "available software to download" to a file?

Open a terminal and type the following:

sudo apt update
apt list --upgradable > ~/downloadable.txt

The list of software available to download will be saved to a file named downloadable.txt in your home folder.

You can ignore the following warning in this case...

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.


Does the console working? Pressing ctrl+alt+F1 is showing you tty? If that is working you can start log in there and type startx. If that fail you can try sudo apt-get install --reinstall ubuntu-desktop


"dev/sda1: clean, ..." This message appears after I startup my laptop, then it won't continue booting

I have had this problem occur a few times, and every time it was ODDLY Nvidia's fault - yes COUNTER-INTUITIVELY

If in Ubuntu after a long painful reboot run:

sudo apt-get purge nvidia*

or if locked try Ubuntu's awesome way of troubleshooting and try:
Ctrl+Alt+F1 through F7 to get to "TTY1-7" and run the same thing.
Reboot for good measure, and re-install Nvidia's Proprietary Drivers.

I hope I helped, Mark


Ubuntu 16.04 correct way to specify a directory / folder using terminal chown to recursively change ownership / permissions

I would suggest you first cd /opt and then run sudo chown -R username:group ./lammp .

The reason for that is simple:  if you by accident add space between / and opt when running sudo chown -R username:group /opt/lammp , that'll be bad. In fact this is a common error we see on Ask Ubuntu a lot - new users do this mistake by accident and as a result their system becomes extremely difficult to recover. Thus , cd first, chown second


sudo apt-get install repo

means that you tell your system to see if there is a package called repo and install it if it can find it. Since there is no package repo the notice you get is

E: Unable to locate package repo

So this is normal!


Recent dist-upgrade 15.04 volume up/down, lock screen, launch terminal not working

This is sorted. I ran gnome-settings-daemon and restarted. Bob's your Uncle!


My system won't boot after install of 12.10

I was able to get it to boot by setting my bios to use only legacy boot instead of UEFI. Then I reinstalled.


Upgrading to 12.04 would be a good idea (it wasn't available when you asked the question originally).

After 11.10 was released, the developers acknowledged the Software Centre was starting up a lot slower than it had previously. Startup time of the Software Centre was significantly improved, ready for the 12.04 release.

Of course startup time is only part of the overall story, but I think it would be worth you trying.

For more details:

https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/876210
https://wiki.ubuntu.com/SoftwareCenter/UDSPreciseSessionNotes


Building you own cloud with Ubuntu : http://www.ubuntu.com/cloud/build-a-cloud

as I have searched and found a very good link about private cloud with Ubuntu.

Cloud setup with Ubuntu.pdf

This a PDF document which will explains you step by step process on setup.

Must read links to understand it in a better
       -    http://www.networkcomputing.com/private-cloud-tech-center/five-steps-to-building-a-private-cloud/240004192

http://www.itworld.com/answers/topic/cloud-computing/question/how-can-i-build-private-cloud

Ubuntu Official cloud setup


How do I get a CPU frequency scaling monitor on 12.04?

In Ubuntu 12.04, you will want to use indicators.  Here are some good ones to replace the functionality that you had before.  :)

CPUFreq

This applet will allow you to scale your processor to its supported frequencies.

sudo apt-get install indicator-cpufreq

If you want to be able to monitor the other aspects of your computer from the panel, have a look at this page on Ask Ubuntu.  There are several indicator here that, when combined, will provide the on demand information you're looking for.

In addition to this, you should also try going to the Ubuntu Software Center and searching for indicator.  Ubuntu no longer uses Gnome applets.  So, if you install any Gnome applets on your system, they will be benign.  Sorry.  :(  Install indicators instead.


How do I log myself out of a frozen nx-based session?

In NX session administrator you can try to remove the session files and start a new session. Anyways, if you ssh to the machine and restart NXServer, next time you login you'll have a new clean session. (sudo /usr/NX/bin/nxserver --restart)


tmpfs is a temporary file system used for quick acces on some files. For more information, look at this: tmpfs or here: tmpfs-ArchWiki


16.04 installing GNOME, getting "Unable to correct problems, you have held broken packages"

I've encountered this issue only once before, and I solved it with the command sudo apt-get clean && sudo apt-get autoclean && sudo apt-get autoremove && sudo apt-get update --fix-missing && sudo apt-get upgrade


preferred location for web app files, outside of /var/www

You can put them in your home folder (i.e. /home/user/www) and change the Directory and DocumentRoot directive in your Apache config. If you do it this way only the user 'user' will be able to see the files but of course you still need the user 'root' to run the apache daemon not 'user'.


Can Ubuntu Unity be made as snappy as Xubuntu?

Obviously you computer struggles a little with full Unity.

Try Ubuntu 2D (click the gear icon on the login screen). It's almost the same, and a snappier on lesser hardware.


Can't install libglew-dev because libcheese and libclutter don't have the required versions

I tried to install libglew-dev and I had the same problem. I had to include the following packages to install it

sudo apt-get install  libglew-dev libcheese7 libcheese-gtk23 libclutter-gst-2.0-0 libcogl15 libclutter-gtk-1.0-0 libclutter-1.0-0  xserver-xorg-input-all

It will include then all the required packages.


TP-Link Archer T9E in Ubuntu Server 14.04

This adapter is based on BCM4360 chip. It is supported by the proprietary Broadcom driver (wl).

Source

But Tp-Link is known for changing the hardware in their products without changing the brand name, just a revision. They may release a completely new product with the same name.


fre:ac works on my Ubuntu 18.04 system.
I did not succeed with rythmbox, Amarok, asunder, audacious and sound juicer for getting mp3 files from my audio CD.


Sometimes, when an application does not fully install, you need to fix the broken dependency chain. To resolve your issues, run:

sudo apt-get install -f

and Apt will attempt to fix all recent installation issues.


No logout/power-off option in Unity's power cog menu

If you get this:

(Clean Install, added gnome-panel, gnome-shell, and gnome-system-tools)

What actually works is pressing Ctrl+Alt+Del and then choosing Log out.


Type the following in terminal:

sudo dpkg --clear-avail

You need to edit the file and remove the offensive characters manually. Make a backup of the existing file.

sudo cp /var/lib/dpkg/status /var/lib/dpkg/status.bad

gksudo gedit /var/lib/dpkg/status

Go to line 60773, 60774 and 64482. The problem seems to be that the underscore has become at some point an illegal character in Debian package names. Edit the offending lines, change all underscores to tildes(~) will solve your problem.


Ubuntu Installation: Reinstalling Ubuntu and keep files from previous installation

First, try and be safe. You don't want to loose any of your data. Try this...

Boot the computer.

If the GRUB menu doesn't normally automatically appear for you, hold down the LEFT SHIFT KEY at boot time.

Choose ADVANCED OPTIONS from the GRUB menu, and select the prior kernel, and see if you can boot properly to 14.04.

If you can boot into 14.04, backup your important files to an external disk or USB flash drive.

Then bring up Software Updater and try the 16.04 upgrade again.

Let us know how you do. Cheers, Al


How to configure a blacklist in Squid 3?

http_access statements are evaluated sequentially for each request and once matched the evaluation stops. Thus http_access allow db-auth should be placed after http_access deny blacklist. This way, the blacklist is enforced and then the authentication takes place.


Can I run Ubuntu 12.04.5 with 3.8 kernel and still have kernel security updates?

No, you can not both use an old unsupported kernel and have security updates for that kernel. No kernel updates means no kernel security updates. From https://wiki.ubuntu.com/1204_HWE_EOL:

  Starting Aug 8, 2014 systems running 12.04.2 HWE, 12.04.3 HWE, or
  12.04.4 HWE will no longer receive software updates for the kernel and, if you're running it, the graphics stack.

According to the kernel release schedule, 3.8 is already unsupported, so if you want an older kernel with security updates you will need to downgrade to Ubuntu 12.04.1 and the 3.2 kernel:


Thanks for the question.

I would go with pxeboot, if you are going to do this often.

Here is the documentation.

https://help.ubuntu.com/community/PXEInstallMultiDistro

If not.

I would see if the server has a Remote Management Port, or Console connection. Then get someone to burn and insert the Ubuntu CD or USB. Then connect over this to do the install.


How do I install plesk from downloaded file in Ubuntu

First you must allow the file to be executed:

chmod +x parallels_installer_v3.12.0_build120601.16_os_Ubuntu_10.04_i386

Then you can run the installer.


How can I repair casper-rw file system file in LiveUSB

This seems to be a common issue and has been going for some time. Using the ubuntu-11.04-desktop-i386.iso I am still having issues with this.
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/125702

The way I have mounted the casper-rw file is doing the following.

Mount your USB key
sudo fsck -y -t ext3 /media/[drive]/casper-rw

Some users, including myself, are still reporting issues even after doing this so ymmv.

You might want to start backing up your loop file and keeping it only as large as you need.
Before doing this resize make sure you back it up but here are the basics.

Boot without using persistent or use another system
Insert and mount your device that contains the loop file
dd if=/dev/zero bs=1M count=1024 >> casper-rw

Where 1024 is larger than your current used

resize2fs casper-rw

Using this method you should be able to keep your loop files only as large as needed, have some backups and if all else fails be able to fsck them.