How to chain make command with git clone?

An unattended build after a git clone makes not really sense. Most of the time you'll need to install additional libraries beforehand. Partially also configurations are necessary.

If after these adjustments, the project can be built, then you can automate the process, e.g. after a git pull using git hooks.

To use git hooks, place or link a script with the name post-merge in the .git/hooks folder of the project.

A simple post-merge script looks like this:

#!/bin/bash
./configure
make
sudo make install

I have two examples for you that I use myself. The scripts are not perfect. They are illustrative only.:

A post-merge git hook for the Atom editor

#!/bin/bash
#
# A post-merge git hook for
# https://github.com/atom/atom
#
# ln -s  [your_source_folder]/githooks/post-merge/post-merge_4_atom [your_source_folder]/atom/.git/hooks/post-merge
#

# Trap the INT signal (ctrl-c, for example)
trap trapint 2

packageConfig="package.json"

green="\e[0;32m"
red="\e[0;31m"
TOA="\e[0m" # Turn off character attributes

# Prints OK or FAILED! depending on previous command return value
function okfail () {
  if [ $? -gt 0 ]; then
    logError "There was an error. Aborting."
    return 1
  else
    logInfo "OK"
    return 0
  fi
}

function trapint {
  echo
  echo
  echo "$(basename "$0") SIGINT received"
  cleanup
}

function cleanup {
  echo "Cleaning up..."
  removeRelease
  echo "Bye."
  echo
  exit 1
}

function logInfo () {
  echo -e "${green}$1${TOA}"
}

function logError () {
  echo -e "${red}$1${TOA}"
}

function addRelease () {
  version=$(jshon -e 'version' < "package.json"  | tr -d "\"" | tr -d "\\\\")
  release=$(git log | grep -c "^commit")
  logInfo "Version: $version"
  logInfo "Release: $release"

  newVersion="$version-$release"

  if [ -f "$packageConfig" ]; then
    logInfo "Create backup file $packageConfig.bak"
    cp "$packageConfig" "$packageConfig.bak"
    okfail; [ $? -gt 0 ] && cleanup
    if [ -f "$packageConfig.bak" ]; then
      logInfo "Update $packageConfig with $newVersion"
      sed -i "s/\"version\" *: *\"$version\"/\"version\": \"$newVersion\"/g" "$packageConfig"
      okfail; [ $? -gt 0 ] && cleanup
    fi
  fi
}

function removeRelease () {
  if [ -f "$packageConfig.bak" ]; then
    logInfo "Restore file $packageConfig"
    mv "$packageConfig.bak" "$packageConfig"
    okfail
  fi
}

exec < /dev/tty

while true; do
  read -n 1 -p "Compile and install? [y/n]: " yn
  echo;
  case $yn in
    [Yy]* )

    break;;
    [Nn]* ) exit;;
    * ) echo "Please respond with [y]es or [n]o.";;
  esac
done

cd ~/src/atom

addRelease

echo -e "${green}compile${TOA}"
script/build

echo -e "${green}build debian packge${TOA}"
script/grunt mkdeb

removeRelease

echo -e "${green}You can find the deb package here: \"/tmp/atom-build\"${TOA}"
ls -la /tmp/atom-build

echo -e "${green}Please install with \"sudo dpkg -i /tmp/atom-build/[deb-package]\"${TOA}"

A post-merge script to configure, build and install via checkinstall

#!/bin/bash
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the version 2 of the GNU General Public License
#    as published by the Free Software Foundation
#
#    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., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#    Thanks to Felipe Eduardo Sanchez Diaz Duran <izto@asic-linux.com.mx>,
#    the author of checkinstall for the many ideas
#
#
# Trap the INT signal (ctrl-c, for example)
trap trapint 2

red="\e[0;31m"
green="\e[0;32m"
yellow="\e[0;33m"
TOA="\e[0m" # Turn off character attributes
bold="\e[0;1m"

# Enable alias expansion in command substitution
shopt -s expand_aliases

# Vefify that we have gettext available
gettext "Bye." &> /dev/null
if [ $? -gt 0 ]; then
  alias ck_gettext="echo -e"
else
  alias ck_gettext="gettext -s --"
fi

## echo with newline at the end
function echog() {
  local format="$1"
  shift
  printf -- "$(ck_gettext "$format")\n" "$@" >&2
}

## echo with NO newline at the end
function   echogn() {
  local format="$1"
  shift
  printf -- "$(ck_gettext "$format")" "$@" >&2
}

# Prints OK or FAILED! depending on previous command return value
function okfail () {
  if [ $? -gt 0 ]; then
    logError "There was an error. Aborting."
    return 1
  else
    logInfo "OK"
    return 0
  fi
}

function logInfo () {
  green="\e[0;32m"
  echog "${green}$1${TOA}"
}

function logWarn () {
  yellow="\e[0;33m"
  echog "${yellow}$1${TOA}"
}

function logError () {
  red="\e[0;31m"
  echog "${red}$1${TOA}"
}

function trapint {
  echo
  echo
  echog "$(basename "$0") SIGINT received"
  cleanup
}

function cleanup {
  echogn "Cleaning up..."
  okfail
  echog "Bye."
  echo
  exit 1
}

function writeDescriptionPak {
  if [ "$1" != "" ]
  then
    echo "$1" > description-pak
  fi
}

function logArchitecture {
  echog "\tArchitecture: ${green}$1${TOA}"
}

function logRequires {
  echog "\tRequires: ${green}$1${TOA}"
}

function logMaintainer {
  echog "\tMaintainer: ${green}$1${TOA}"
}

function logGroup {
  echog "\tGroup: ${green}$1${TOA}"
}

function logSummary {
  echog "\tSummary: ${green}$1${TOA}"
}

function logVersion {
  echog "\tVersion: ${green}$1${TOA}"
}

function logName {
  echog "\tName: ${green}$1${TOA}"
}

function logLicense {
  echog "\tLicense: ${green}$1${TOA}"
}

if [ "$(command -v checkinstall)" == "" ]
then
  logError "checkinstall not installed. Aborting."
  cleanup
fi

if [ "$(command -v jshon)" == "" ]
then
  logError "jshon not installed. Aborting."
  cleanup
fi

isGit="1"
if [ ! -d ".git" ]
then
  logWarn "No GIT project."
  isGit="0"
  #cleanup
fi

autogenParam=""
configureParam=""
checkinstallParam=""

projectBasename=$(basename "${PWD}")
configPath="$HOME/.config/postmergerc/$projectBasename"

# Found an old configuration
if [ -f ".git/hooks/postmergerc" ]
then
  exec < /dev/tty

  while true; do
    read -n 1 -p "Old configuration \".git/hooks/postmergerc\" found. Should I copy it to the new location.? [y/n]: " yn
    echo;
    case $yn in
      [Yy]* ) mv ".git/hooks/postmergerc" "$configPath";
        okfail; [ $? -gt 0 ] && exit 1
      break;;
      [Nn]* )
      break;;
      * ) echo "Please respond with [y]es or [n]o.";;
    esac
  done
fi

if [ ! -f "$configPath" ]
then
  logWarn "\"$configPath\" not found, create a default configuration."
  mkdir -p "$HOME/.config/postmergerc"
  echo -e "{\n \"autogen\": \"\",\n \"configure\": \"\",\n \"make\": \"\",\n \"checkinstall\": \"\"\n}" > "$configPath"
  okfail; [ $? -gt 0 ] && exit 1
else
  logInfo "\"$configPath\" found"

  autogenParam=$(jshon -e 'autogen' < "$configPath" | tr -d "\"" | tr -d "\\\\")
  if [ "$autogenParam" != "" ]; then echog "Additional parameters for ${bold}autogen${TOA}"; echog "\t${green}$autogenParam${TOA}"; fi

  configureParam=$(jshon -e 'configure' < "$configPath" | tr -d "\"" | tr -d "\\\\")
  if [ "$configureParam" != "" ]; then echog "Additional parameters for ${bold}configure${TOA}"; echog "\t${green}$configureParam${TOA}"; fi

  makeParam=$(jshon -e 'make' < "$configPath" | tr -d "\"" | tr -d "\\\\")
  if [ "$makeParam" != "" ]; then echog "Additional parameters for ${bold}make${TOA}"; echog "\t${green}$makeParam${TOA}"; fi

  checkinstallParam=$(jshon -e 'checkinstall' < "$configPath" | tr -d "\"" | tr -d "\\\\")
  if [ "$checkinstallParam" != "" ]; then echog "Additional parameters for ${bold}checkinstall${TOA}"; echog "\t${green}$checkinstallParam${TOA}"; fi
  echo
fi

# GIT
if [ "$isGit" == "1" ]
then
  source=$(git config --get remote.origin.url)
  #name=$(echo $source | gawk -F "/" '{print $5}' | sed -e 's/\.git$//')
  #name=$(git remote -v | head -n1 | awk '{print $2}' | sed -e 's,.*:\(.*/\)\?,,' -e 's/\.git$//')
  name=$(basename $(git config --get remote.$(git config --get branch.master.remote).url) .git)
  gitowner=$(echo "$source" | gawk -F "/" '{ print ( $(NF-1) ) }' | gawk -F ":" '{ print ( $(NF) ) }')
  #release=$(($(git rev-list HEAD --count)))
  release=$(git log | grep -c "^commit")

  responseGitHub=$(curl -s "https://api.github.com/search/repositories?q=+repo:$gitowner/$name")
  responseGitHubError=$(echo "$responseGitHub" | jshon -Q -e "errors")

  if [ "$responseGitHubError" == "" ]
  then
    isGitHub="true"
  else
    isGitHub="false"
  fi
fi

if [ "$(command -v easy_install)" != "" ]
then
  logWarn "The program \"easy_install\" from the package \"python-setuptools\" is installed. This can make problems with \"checkinstall\"."
fi

exec < /dev/tty

#while true; do
#  read -n 1 -p "Show diff? [y/n]: " yn
#  echo;
#  case $yn in
#    [Yy]* ) git diff HEAD^ HEAD;
#    break;;
#    [Nn]* )
#    break;;
#    * ) echo "Please respond with [y]es or [n]o.";;
#  esac
#done

while true; do
  read -n 1 -p "Compile and install $name? [y/n]: " yn
  echo;
  case $yn in
    [Yy]* )

    break;;
    [Nn]* ) exit;;
    * ) echo "Please respond with [y]es or [n]o.";;
  esac
done

if [ -f description-pak ]
then
  logWarn "Delete description-pak"
  if [ -w description-pak ]
  then
    rm description-pak
  else
    sudo rm description-pak
  fi
fi

if [ -f autogen.sh ]
then
  logInfo "Starting autogen.sh"
  ./autogen.sh "$autogenParam"
  okfail; [ $? -gt 0 ] && exit 1
fi

if [ -f autogen.sh ] && [ -f configure ]
then
  exec < /dev/tty

  while true; do
    read -n 1 -p "\"autogen.sh\" and \"configure\" found. Should I also run \"configure\"? [y/n]: " yn
    echo;
    case $yn in
      [Yy]* )  logInfo "Starting configure";
        ./configure "$configureParam"
        okfail; [ $? -gt 0 ] && exit 1
      break;;
      [Nn]* )
      break;;
      * ) echo "Please respond with [y]es or [n]o.";;
    esac
  done
elif [ -f configure ]
then
  logInfo "Starting configure"
  ./configure "$configureParam"
  okfail; [ $? -gt 0 ] && exit 1
fi

if [ -f "Makefile.PL" ]
then
    logInfo "Starting perl Makefile.PL"
    perl Makefile.PL
    okfail; [ $? -gt 0 ] && exit 1
fi

if [ -f "Makefile" ]
then
  optionRule=-1
  while [ "$optionRule" -ne "0" ]
  do
    makeRules=$(grep "^[a-zA-Z_\-]*:" Makefile | cut -d: -f1)
    ruleCount=0
    echog "[$ruleCount] continue with \"make\""

    for rule in $makeRules
    do
      ruleCount=$((ruleCount+1))
      if [ "$rule" == "install" ]
      then
        echogn "[$ruleCount] make $rule"
        echog " ${yellow}(this is a bad idea)${TOA}"
      else
        echog "[$ruleCount] make $rule"
      fi
    done
    logInfo "$ruleCount rules found"
    echogn "Make your choice or hit return to continue with \"make\": "
    read optionRule
    if [ -z "$optionRule" ]
    then
      optionRule=0
    else
      selectedRule=$(echo "$makeRules" | awk NR=="$optionRule")
      logInfo "Starting \"make $selectedRule\""
      make "$selectedRule"
    fi
  done

  logInfo "Starting make"
  if [ "$makeParam" == "" ]
  then
    make
  else
    make "$makeParam"
  fi
  okfail; [ $? -gt 0 ] && exit 1
fi

version=""
maintainer=""
license=""
requires=""
summary=""
group=""
architecture=""
sourceHtmlUrl=""

if [ "$isGitHub" == "true" ]
then
  sourceHtmlUrl=$(echo "$responseGitHub" | jshon -e "items" -e 0 -e "html_url")
fi

####################
# DEBIAN/CHANGELOG
####################
if [ -f "debian/changelog" ]
then
  echog "Search for information via ${bold}debian/changelog${TOA}"

  versionDebianChangelog=$(head -1 "debian/changelog" | gawk -F " " '{print $2}' |  tr -d "()")
  logVersion "$versionDebianChangelog"
  if [ "$version" == "" ]; then version=$versionDebianChangelog; fi
fi

####################
# DEBIAN/CONTROL
####################
if [ -f "debian/control" ]
then
  echog "Search for information via ${bold}debian/control${TOA}"

  architectureDebianControl=$(grep '^ *Architecture *' "debian/control" | gawk -F ":" '{print $2}' |  tr -d " ")
  logArchitecture "$architectureDebianControl"
  if [ "$architecture" == "" ]; then architecture=$architectureDebianControl; fi

  requiresDebianControl=$(grep '^ *Depends *' "debian/control" | gawk -F ":" '{print $2}' |  tr -d " ")
  logRequires "$requiresDebianControl"
  if [ "$requires" == "" ]; then requires=$requiresDebianControl; fi

  maintainerDebianControl=$(grep '^ *Maintainer *' "debian/control" | gawk -F ":" '{print $2}' | sed -e 's/^ *//' -e 's/ *$//')
  logMaintainer "$maintainerDebianControl"
  if [ "$maintainer" == "" ]; then maintainer=$maintainerDebianControl; fi

  groupDebianControl=$(grep '^ *Section *' "debian/control" | gawk -F ":" '{print $2}' | sed -e 's/^ *//' -e 's/ *$//')
  logGroup "$groupDebianControl"
  if [ "$group" == "" ]; then group=$groupDebianControl; fi

  summaryDebianControl=$(grep '^ *Description *' "debian/control" | gawk -F ":" '{print $2}' | sed -e 's/^ *//' -e 's/ *$//')
  logSummary "$summaryDebianControl"
  if [ "$summary" == "" ]
  then
    summary=$summaryDebianControl
    writeDescriptionPak "$summaryDebianControl"
  fi
fi

####################
# MAKEFILE
####################
if [ -f "Makefile" ]
then
  echog "Search for information via ${bold}Makefile${TOA}"

  versionMakefile=$(grep '^ *PACKAGE_VERSION *= *' Makefile | gawk -F "=" '{print $2}' |  tr -d " ")
  logVersion "$versionMakefile"
  if [ "$version" == "" ]; then version=$versionMakefile; fi
fi

####################
# *.DOAP
####################
if [ -f "$name.doap" ]
then
  echog "Search for information via ${bold}$name.doap${TOA}"

  lengthMaintainerDoap=$(xpath -q -e "count(//maintainer)" "$name.doap" 2>/dev/null)
  for ((i = 1; i <= $lengthMaintainerDoap; i++)); do
    if [ "$maintainerDoap" == "" ]
    then
      maintainerDoap="$(xpath -q -e "//maintainer[$i]/foaf:Person/foaf:name/text()" "$name.doap")"
    else
      maintainerDoap="$maintainerDoap, $(xpath -q -e "//maintainer[$i]/foaf:Person/foaf:name/text()" "$name.doap")"
    fi
    maintainerDoap="$maintainerDoap ($(xpath -q -e "string(//maintainer[$i]/foaf:Person/foaf:mbox/@rdf:resource)" "$name.doap" 2>/dev/null | sed 's/^.*mailto:\(.*\)$/\1/'))"
  done
  logMaintainer "$maintainerDoap"
  if [ "$maintainer" == "" ]; then maintainer=$maintainerDoap; fi

  summaryDoap=$(xpath -q -e "*/shortdesc/text()" "$name.doap" | tr -d '\n')
  logSummary "$summaryDoap"
  if [ "$summary" == "" ]
  then
    summary=$summaryDoap
    writeDescriptionPak "$summaryDoap"
  fi
fi

####################
# *.SPEC
####################
if [ -f "$name.spec" ]
then
  echog "Search for information via ${bold}$name.spec${TOA}"

  licenseSpec=$(grep '^ *License *' "$name.spec" | gawk -F ":" '{print $2}' |  tr -d " ")
  logLicense "$licenseSpec"
  if [ "$license" == "" ]; then license=$licenseSpec; fi

  groupSpec=$(grep '^ *Group *' "$name.spec" | gawk -F ":" '{print $2}' |  tr -d " ")
  logGroup "$groupSpec"
  if [ "$group" == "" ]; then group=$groupSpec; fi

  summarySpec=$(grep '^ *Summary *' "$name.spec" | gawk -F ":" '{print $2}' | sed -e 's/^ *//' -e 's/ *$//')
  logSummary "$summarySpec"
  if [ "$summary" == "" ]
  then
    summary=$summarySpec
    writeDescriptionPak "$summarySpec"
  fi

  requiresSpec=$(grep '^ *Requires *' "$name.spec" | gawk -F ":" '{print $2}' |  tr -d " " | tr '\n' ',' | sed -e 's/^,*//' -e 's/,*$//')
  logRequires "$requiresSpec"
  if [ "$requires" == "" ]; then requires=$requiresSpec; fi
fi

####################
# SETUP.PY
####################
if [ -f "setup.py" ]
then
  if [ ! -x "setup.py" ]
  then
    echog "${red}setup.py is not executable. Aborting.${TOA}"
    exit 1
  else
    echog "Search for information via ${bold}setup.py${TOA}"

    maintainerSetupPy="$(./setup.py --author) ($(./setup.py --author-email))"
    logMaintainer "$maintainerSetupPy"
    if [ "$maintainer" == "" ]; then maintainer=$maintainerSetupPy; fi

    versionSetupPy=$(./setup.py --version)
    logVersion "$versionSetupPy"
    if [ "$version" == "" ]; then version=$versionSetupPy; fi

    licenseSetupPy=$(./setup.py --license)
    logLicense "$licenseSetupPy"
    if [ "$license" == "" ]; then license=$licenseSetupPy; fi

    requiresSetupPy=$(./setup.py --requires)
    logRequires "$requiresSetupPy"
    if [ "$requires" == "" ]; then requires=$requiresSetupPy; fi

    summarySetupPy=$(./setup.py --description)
    logSummary "$summarySetupPy"
    if [ "$summary" == "" ]
    then
      summary=$summarySetupPy
      writeDescriptionPak "$summarySetupPy"
    fi
  fi
fi

####################
# GITHUB API
####################
if [ "$isGitHub" == "true" ]
then
  echog "Search for information via ${bold}GitHub-API${TOA}"

  summaryGitHubApi=$(echo "$responseGitHub" | jshon -e "items" -e 0 -e "description" | sed -e 's/^"*//' -e 's/"*$//' | tr -d "\\\\")
  logSummary "$summaryGitHubApi"
  if [ "$summary" == "" ]
  then
    summary=$summaryGitHubApi
    writeDescriptionPak "$summaryGitHubApi"
  fi
fi

####################
# PATH
####################
firstParts=$(echo "$projectBasename" |  awk -F "-" '{ for (i=1; i<NF; i++) printf $i"-"}')
lastPart=$(echo "$projectBasename" | awk -F "-" '{ print $NF }')

if [[ ${lastPart:0:1} =~ ^[0-9] ]]
then
  versionPath=$lastPart
  namePath=${firstParts%?}
else
  versionPath=""
  namePath=$projectBasename
fi

echog "Search for information via ${bold}Path${TOA}"

logVersion "$versionPath"
if [ "$version" == "" ]; then version=$versionPath; fi

logName "$namePath"
if [ "$name" == "" ]; then name=$namePath; fi

####################
# Set standard values if nothing
####################

if [ "$version" == "" ] || [[ ${version:0:1} =~ ^[^0-9] ]]
then
  version="$(date +%Y%m%d)"
fi

if [ "$sourceHtmlUrl" == "" ]
then
  sourceHtmlUrl="$source"
fi

if [ "$name" == "" ]
then
  name=$projectBasename
fi
if [ "$name" == "" ]
then
  name=$(basename $(git config --get remote.$(git config --get branch.master.remote).url) .git)
fi

requires=$(echo "$requires" | tr ',' '\n' | sed 's/\([<<>>==].*\)/(\1)/' | sed -e $'s/((/(/g' | sed -e $'s/))/)/g')
requires=$(echo "$requires" | tr '\n' ',' | sed -e 's/^,*//' -e 's/,*$//')

if [ -f "setup.py" ]
then
  echo
  echog "Install with ${green}checkinstall ... python setup.py install${TOA}"
  sudo checkinstall --spec foo --maintainer \""$maintainer"\" --pkglicense \""$license"\" --pkgname \""$name"\" --pkgrelease \""$release"\" --pkgversion \""$version"\" --pkgsource \""$sourceHtmlUrl"\" --pkggroup \""$group"\" --requires \""$requires"\" --pkgarch \""$architecture"\" $(if [ "$checkinstallParam" != "" ]; then echo "$checkinstallParam"; fi) python setup.py install
else
  echo
  echog "Install with ${green}checkinstall ...${TOA}"
  sudo checkinstall --spec foo --maintainer \""$maintainer"\" --pkglicense \""$license"\" --pkgname \""$name"\" --pkgrelease \""$release"\" --pkgversion \""$version"\" --pkgsource \""$sourceHtmlUrl"\" --pkggroup \""$group"\" --requires \""$requires"\" --pkgarch \""$architecture"\" $(if [ "$checkinstallParam" != "" ]; then echo "$checkinstallParam"; fi)
fi


unresolved host / Upgrade 12 to 14 Ubuntu/ Net Connection fine through browser

Meybe is solution for you to change way how to resolve names.
Try following

In /etc/NetworkManager/NetworkManager.conf comment out the dns=dnsmasq

sudo nano /etc/NetworkManager/NetworkManager.conf

 [main]
plugins=ifupdown,keyfile,ofono
#dns=dnsmasq

no-auto-default=00:22:64:4E:6F:70,

[ifupdown]
managed=fals

and restart the NM service

sudo restart network-manager

With this /etc/resolv.conf is no longer dependant on resolvconf package and is updated based on the DNS entries of each connection in the Network Manager

Also you can add nameserver in /etc/resolv.conf. If you not set dns in NM per connection this will be used

sudo nano /etc/resolv.conf

nameserver 8.8.4.4
nameserver 8.8.8.8


I partially resolved this issue (polish characters are working)

I ran ibus-setup and manually selected polish on entry setup page


How to select the architecture to download?

Ubuntu download page defaults to 64-bit images. Most likely you just pressed download or pressed the wrong button:

If you change one menu, and click the other button, it will defaults to 64-bits.
If you don't trust that, you can verify the file sizes:
32 bits

64 bits

You can also use hotlink:

64 bits LTS: http://www.ubuntu.com/download/desktop/thank-you?release=lts&bits=64&distro=desktop&status=zeroc

32 bits LTS: http://www.ubuntu.com/download/desktop/thank-you?release=lts&bits=64&distro=desktop&status=zeroc

Or go directly to http://releases.ubuntu.com and download your image.


Asus Q302LA Wifi Problems: Intel Wireless 7260

You will probably need internet connection for installing the driver.

How much i know from our little chat, you have a Note 4 Android phone connected to your WiFi.

Try to set up USB Tethering on the phone and connect the phone to Ubuntu via USB cable, it should work out from the box for working internet connection.

Next step is on Ubuntu, go to System Settings->Software & Updates->Ubuntu Software Tab.

Check "Proprietary drivers for devices (restricted)"  and go to tab labeled "Additional Drivers" to check if there is a driver availible for your WiFi card.

Report back if solved or you need more info.

P.S.  if you are new to Ubuntu this guide is great for setting up a new system:

http://howtoubuntu.org/things-to-do-after-installing-ubuntu-14-04-trusty-tahr


How to set tag for nodes with multiple nics in MAAS?

At the moment MAAS does not support this ability. We are working towards this feature in MAAS 1.9, which will be released with Ubuntu 15.10.

MAAS 2.1 Supports Interface Tags - on the machine details page you can tag interfaces.


Support for the Nexus 10 was deprecated some time ago. If you want a current image to run on your device, you need to flash your device using the UBports server:

ubuntu-device-flash --server https://system-image.ubports.com touch --channel ubuntu-touch/rc-proposed

This will flash the current rc-proposed channel image onto your device.


zsh apt-get autocomplete doesn't work with fake root

Well, I have finally figured it out. Zsh completion engine caches several things, including the list of available packages returned by apt. Now my story seems clear: when autocomplete always suggested me packages from the fake root it was because first time I ran zsh in the fake root environment and the corresponding package list got into a cache.

If you want to override it (assuming you use oh-my-zsh) just add the following code into your .zshrc before calling oh-my-zsh:

if [[ check for fakeroot ]]; then
  export ZSH_CACHE_DIR=desired-cache-dir-name
fi

This separates completion caching between fake root and the base system and solves the problem from the post.


Bash "unexpected end of file" on line 11, there is no line 11

The shell metacharacter && expects a command afterwards, that would be run if the first command succeeds.

Thats why you are getting the error message.

For example you have sleep 1&& at the 10th line, now the shell will run sleep 1 and then if it succeeds (exit code 0) then (&&) will run the next command, which is not provided by you. So you would get a unexpected end of file error message.

Also i think you meant to use & instead of &&.

& will take a foreground process to the background so you can do some other stuffs on the foreground. Also that might no be a good idea with sleep command (depends on use case though) as sleep intends to pause the execution of command in the script or the terminal for the amount of time mentioned, if you take it to the background by adding & e.g. sleep 1& the next command will be run instantly as the order of execution will not be synchronized in this case.


Linux kernel 3 (> 2.6.38) has some power issues. This should be fixed soon, meanwhile there's a fix you can try: Fix power issue.

BTW, your laptop has hybrid graphics tecnology (ex: NVidia Optimus)?


"read access to unsupported AArch64 system register" when starting Ubuntu on qemu (ARM64)

Just upgrade your system.

Both AMD64 and ARM64 kernels start exactly as attempted in question using QEMU emulator version 3.1.0

Note that the command line is not exactly the same though, console=ttyS0 translates to console=ttyAMA0 on ARM. To really start subiquity, add -initrd initrd -cdrom bionic-server-arm64.iso

extract using isoinfo -R -x "/install/initrd.gz" -i bionic-server-arm64.iso >initrd (verify results - isoinfo will not fail verbosely)
loading from ISO will be slow, adding virtio & more cores may result in significant speedup
when adding a preseed file, note the cdrom mount location, e.g. file=/cdrom/preseed/example.seed


Garbage black text on white screen on a server

My guess would be some problem with the graphics driver used by the kernel. Try to boot with the nomodeset kernel parameter.


The line
gcc make linux-headers-`uname -r`

in step 1 of the installation instructions is not a command - it's a list of dependencies (packages) that you are meant to install before the following steps, i.e.
sudo apt install gcc make linux-headers-`uname -r`


Youtube-dl Question: How can I batch download files (while assigning different titles to output files)?

Use -o option:

youtube-dl -a batch_file \
 -o "%(title)s by %(uploader)s on %(upload_date)s in %(playlist)s.%(ext)s"

  -o, --output TEMPLATE

  Output filename template, see the "Output Template" for all the info

There are a lot of patterns you can use differentiate files from each other.

id (string): Video identifier
display_id (string): An alternative identifier for the video
timestamp (numeric): UNIX timestamp of the moment the video became available
duration (numeric): Length of the video in seconds
view_count (numeric): How many users have watched the video on the platform
like_count (numeric): Number of positive ratings of the video
...

https://www.mankier.com/1/youtube-dl#Output_Template


Unreadable font on Gmail since recent updates in Chromium

I had a similar issue with Google Chrome and Outlook.com (I know different site & slightly different browser, but the code should help). Adding this code to ~/.config/fontconfig/fonts.conf (it may need to be created) fixed the issue for me:

<match target="font" >
    <edit name="embeddedbitmap" mode="assign">
        <bool>false</bool>
    </edit>
</match>

This isn't original with me, but I cannot remember where I found the answer as it's been awhile (I just copied my file to here). All I remember is that my searches had to do with Calibri. Hope this helps.


Is your mobile an Android phone ? Android cannot connect to Ad-Hoc networks, only infastructure.

To create an Ad-Hoc connection, for network sharing, do this.

sudo apt-get install dnsmasq-base

sudo apt-get remove dnsmasq

Create a new wireless network using networkmanager, make sure it is an Ad-Hoc network and tick "Automatically connect if this network is in range".

In the ipv4 section, select "shared with other computers".

Now, from network manager menu, disable then enable networking (to restart network manager).

Now try connecting to it from another PC, running either Windows or Linux or Mac for that matter. Does that connect ?

This is how I do it and it works for me.

Here is the link I got the information from :

Internet connection sharing with Ubuntu


When your Mac boots up, hold down the Option key. This will enter the Mac's BIOS boot menu and you can choose your Macintosh HD from here.

EDIT:
Try this instead:
Open a terminal in Ubuntu and run sudo update-grub. Hopefully, this will add Mac OS to your GRUB menu and you'll be able to boot. If it doesn't, you most liekly chose to erase your disk and install Ubuntu, which means OS X is gone.


I guess it is a bug in file-roller.

I updated included file-roller version 3.28.0 to version 3.30.1 from 18.10 with the amd64 .deb file from here: https://ubuntu.pkgs.org/18.10/ubuntu-main-amd64/file-roller_3.30.1-1_amd64.deb.html

With the updated file-roller package .odt files can be opened again. This might not be the optimal way to install backports, but in this case it works without sideeffects.


I get an error when creating a VM on VirtualBox

9 days ago someone reported getting this error after upgrading Virtual Box from version 5.1 to 5.2. Their solution below:

I got this error after upgrading from Virtualbox 5.1 to 5.2, as installed on Ubuntu from the Virtualbox PPA. I solved it by purging config files for 5.1 as well as uninstalling virtualbox-dkms 5.1:

sudo dpkg --purge virtualbox-5.1
sudo dpkg --purge virtualbox-dkms

As you are running Kernel 4.10.0-xx you may be interested in this if you upgrade some day: virtualbox crash on kernel 4.13.0-26


Error: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit -.mount is masked

I had this error when GParted was open. After I closed it, the error vanished.


There is a open source project called AMDoverdriveCtrl on source forge

http://sourceforge.net/projects/amdovdrvctrl


How to find text and replace that line if exists with terminal otherwise just append line to end

You can do such replacements with awk.

awk '/^vm.swappiness/ {print "replacement"; found=1} !/^vm.swappiness/ {print $0} END {if (!found) {print "appended" }}' filename

The filename parameter at the end is the name of the text file that contains the lines.

The above command replaces any line that begins with wm.swappiness with replacement (modify to your need). Otherwise prints out the original lines.

If a replacement was made, it is remembered in the found variable. Thus if no replacement was made, the END block appends one line with the appended string (this should also be modified).

(Please note that I am not taking into account the permissions, this is solving only the replacement or append problem).


Error /usr/lib/i386-linux-gnu/colord/colord what does this mean?

It appears to be to do with printing, I don't think this is fundamental to the use of your system if you don't own a printer. If I were you I'd want to fix it though.

I would search it in google.

I found this, http://wilkiecat.wordpress.com/2012/04/28/colord-error-after-installing-ubuntu-12-04/

 sudo ldconfig
 sudo dpkg -r colord
 sudo apt-get check
 sudo apt-get update
 sudo apt-get upgrade --fix-missing


You can install the classic "Software Center", which "always" works OK :

$ sudo apt-get update && sudo apt-get install synaptic


problem in accessing wifi on ubuntu 16.04 with 4.10 kernel

Did you tried to restart your network-manager.
Here is the code for that

sudo service network-manager restart

If that doesn't work, then install the missing firmware with

cd /lib/firmware

sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/iwlwifi-7260-17.ucode

Then reboot into kernel 4.10

The iwlwifi-7260-17.ucode file is not in the linux-firmware package for 14.04


Edimax PS-1210 MFn & HP Photosmart C4180 Scanning Problem

scanner support by HP
Your photosmart all-in-one via CUPS is in-fact using the HPLIP driver from HP themselves. i.e. this is already installed in 12.04 by default.
Looking at the compatibility page for your printer:

http://hplipopensource.com/hplip-web/supported_devices/photosmart.html

Your printer is not supported by this driver for network printing.
There is a yes value for USB - that I'm afraid is the best that you can achieve with your printer.
scanner support via SANE
Looking at the SANE website:

http://www.sane-project.org/sane-mfgs.html#Z-HEWLETT-PACKARD

Your scanner part of this all-in-one is not in-fact directly supported through the SANE project.


Lenovo ThinkBook 15-IML fingerprint not working

I found this solution that was provided by Kai Heng-Feng. You can apply the test kernel published in comment #88 in https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1853277 . It appears to work for me only that am not able to run my Virtualbox VMs as DKMS is not installed.
To apply this kernel you should download it and then go to Download folder and write the following sentence on a terminal:
sudo dpkg -i linux-image-5.9.0-rc4+_5.9.0-rc4+-4_amd64.deb
Restart your computer, and enjoy your working touchpad!
I downloaded the linux-5.9-rc7 and recompiled it with kernel headers it compiled successfully with the exception of the DKMS for virtualbox. If you have no need for Virtualbox then it works fine.
Instruction for compiling ensure you have build-essentials installed

mkdir kernel; cd kernel;
wget the file
tar xvf linux-
cd linux-; make menuconfig
save the .config file
make -j 5 KDEB_PKGVERSION=1.ribalinux deb-pkg # wait because is gonna take a while
sudo dpkg -i ../linux-*.deb
the reboot into the new kernel

Have fun
NOTE: This was only tested on Lenovo Thinkbook IIL series. Maybe the permanent solution will come bundled with Ubuntu 21.04 or maybe 20.10 in the future.
PS


Ubuntu 18.04 on DELL XPS 15, Intel profile for display, NVIDIA for CUDA computation

One hacky way which works for me is starting ubuntu with the NVIDIA GTX 1050Ti enabled. Then run sudo prime-select intel and logout. Then log in again and run sudo prime-select nvidia. Now gnome is running on the intel device but your GPU is available for CUDA stuff. You can verify this by running nvidia-smi.


Software Center GUI consume too much memory. Is this a known bug or so-designed?

I suggest you report it to developers. Meanwhile if you you want an alternative, Deepin Software Centre is nice. Here's how to install it:

http://www.noobslab.com/2014/05/deepin-software-center-v32v3021.html

I also keep Synaptic nearby.

How to install:

Open terminal.

Type: "sudo apt-get install synaptic" without quotes.

Press enter, put in your root password.


How do I configure proxy on Ubuntu 14.04?

Go to Synaptic Package Manager(you can search it from the top left most icon if you are not able to find it)

Then click on Settings->Preferences.

Then go to Network, choose manual proxy configuration and then apply after you have setup the proxy settings. It will work for you.


attempt to read or write outside of disk hd0 ubuntu

This is probably a problem with your Grub installation.
Maybe a badly written file during a hard shutdown (i.e. turning PC off without a real shutdown).

You can try to force rewriting all grub files by reinstalling all Grub packages.
Don't remove them and reinstall them. If there is a problem while packages are uninstalled you may not be able to reboot again:

sudo apt-get install --reinstall $(dpkg -l | awk '{ print $2 }' | grep grub)
sudo update-grub

The command "dpkg -l | awk '{ print $2 }' | grep grub" lists your grub related packages. For exemple (on my system):

grub-common
grub-efi-amd64
grub-efi-amd64-bin
grub-efi-amd64-signed
grub-legacy-ec2
grub2-common


how to access ubuntu host from ubuntu guest

Change connection type in Networks setting of virtualbox to bridge mode, and you can access it by ip of the client os.


I'm not a specialist, but I encountered a similar problem with VMWare. The ARP command on the client showed different MAC addresses, almost at random it would seem.

I solved it by disabling the VMNet virtual adapters of the VMnet I was using in the host operating system. The "strange" MAC addresss was the MAC address of that virtual adapter. I can now make my virtual clients connect immediately to the internet, through my virtual server.

Hope it helps


Picture but no sound when connecting to a TV

You may need to open Sound Settings and tell it to use the headphones or lineout (depending on which you used).  An easy way to get to the Sound Settings is clicking on the volume indicator (top of the screen on the right hand side).  In sounds settings there will be a box named "Play sound through" that lists possible output methods.

Other possible problems include:

TV volume is muted or very low
Netbook volume is muted or very low
There is more than one audio in port and the one you chose does not go with the VGA video input (often TV makers will use visual indicators to show you which ports go with each other, on my TV there are boxes around ports that work together).

One thing to try is plugging in headphones.  If the headphones work, but the TV doesn't, then the problem is likely on the TV side.


Decrease default sizes on external monitor

Things on the external monitor are larger because the pixels on the screen are physically larger.

Most external desktop monitors have a pixel density of around 100 Pixels-Per-Inch (PPI). This means that one inch has 100 pixels going across it. This is pretty small, but many things go much smaller.

Your Galago has a 14.1 inch display running at 1920x1080. This translates to about 156 Pixels per inch. In order to cram more pixels into the same physical space (one inch), the pixels have to be much smaller -- around 50% in this case.

This is what makes everything smaller on the Galago and larger on the external monitor.

The problem lies with the differences between physical screen size and logical screen size. The physical size of the display is pretty simple to visualize; it's just the distance from one corner to the other. The Logical size is the actual screen resolution. So your Galago and a Bonobo Extreme both have the same logical screen size (since they both have the same resolution), despite having wildly different physical sizes.

It's similar to scaling up an image in Gimp, or zooming in in Firefox. The physical size of the image gets larger, while the logical size (the pixel dimensions of the image) stay the same.

Future versions of Ubuntu that use Mir will allow for resolution independence, where the size of objects on the screen aren't determined by the pixel density. They use special Grid Units (GU) to design an application. Then all of the Grid Units get turned into physical pixels by Mir. So this means that if a Grid Unit is an inch wide, and the Unity Launcher is one Grid Unit wide, then it will be one inch wide on both a high-density display (like your Galago's built-in display) and one inch wide on Low-Density Displays (like the external monitor).

(By the way, thanks for ordering a Galago! I work for System76, and it's always fun to see our stuff in the wild!)


I had the same symptoms with my Android phone, trying to import from it.

In file explorer, I could see that the device was mounted as a disk. I ejected it (unmounted, leaving it physically connected), and from there, shotwell was able to import my pics.


ubuntu server Execute python script via crontab

Your test environment ("manually tested the script") and the cron environment differ in many ways. Some of these differences cause your python script to fail (I hope you meant #!/usr/bin/python, Case Counts!).

Add this to your crontab for a couple of minutes, then remove it:

*  *  *   *   *     (echo "=== set ===";set;echo "===env ==="; env | sort;echo "=== alias ===";alias) >cron.environment

Also, in your test envionment, do:

echo "=== set ===";set;echo "===env ==="; env | sort;echo "=== alias ===";alias) >test.environment

Read/diff each file (less {cron,test}.environment;diff {cron,test}.environment).

Read man 5 crontab to see how to alter cron's environment.

Remember, cron isn't bash, but bash wrapper scripts make up fo that.


System freezes after logging in after one failed attempt

Turns out this is a known bug.

The "Purple Screen of Death" occurs when GNOME fails to launch and this commonly occurs due to the reason in the OP.

A fix would be to switch to a different desktop environment as the problem only occurs with GNOME.

https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1766137


Server auto-installed Decnet during dist-upgrade

I can confirm this issue.

I upgraded from Natty to Oneiric. And during the upgrade I got the ncurse-based configuration wizard, which suggests to skip configuration (which I did). After the next reboot my ethernet based network was broken, too.

I fixed my system like this:

# apt-get remove dnet-common libdnet
# rm /etc/init.d/decnet

To bring the ethernet up again: (without rebooting)

# dhclient3 eth0

I assume that an obscure network library which was upgraded caused this. For example libroar1 depends on libdnet. Perhaps some upgraded package started to depend on dnet-common in oneiric, when previously it was only recommended - or something like that.


Move all files with a certain extension from different subdirectories

The simplest solution would be with find:
find . -type f -name "*.txt" -exec mv {} /destination \;

You’ll want to be careful about files with the same name, though, as this will overwrite them. If you want to keep all files intact, use this:
find . -type f -name "*.txt" -exec mv -n {} /destination \;

This should do what you’re looking for.


I had a problem similar to this where my front USB ports wouldn't detect anything except a mouse... It turned out I Needed to turn of USB legacy support in the BIOS.  Another thing to look at is that the cable is plugged into the motherboard, its easy to knock a cable loose inside your case.  Have these ports ever worked, like with other OS's or is this the first time you've ever tried to use them?

Hope this helps.


Real Time Audio Spectrum Analyser for Ubuntu

You can use real-time Audio input Analyzer with built-in Spectrograms and Widgets online: http://friture.org/


How to set keyboard shortcut for "switch user" in Xubuntu?

I checked with the source code of the 'actions button' plugin built in to the xfce4-panel  and the switch user mechanism uses gdmflexiserver, while most of the other actions use parameters to xfce4-session-logout.

The source was fetched with apt-get source xfce4-panel; the information was in  ~/xfce4-panel-4.10.0/plugins/actions/actions.c:

case ACTION_TYPE_SWITCH_USER:
      succeed = g_spawn_command_line_async ("gdmflexiserver", &error);
      break;

You will find the executable at /usr/lib/lightdm/lightdm/gdmflexiserver, which is actually just a script:

#!/bin/sh
#
# Copyright (C) 2011 Canonical Ltd
# Author: Michael Terry <michael.terry@canonical.com>
#
# 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, version 3 of the License.
#
# See http://www.gnu.org/copyleft/gpl.html for the full text of the license.

if [ -z "$XDG_SEAT_PATH" ]; then
      # something went wrong
      exit 1
fi

dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.DisplayManager $XDG_SEAT_PATH org.freedesktop.DisplayManager.Seat.SwitchToGreeter

It isn't in $PATH, so if you use it in a script, you will need to specify the absolute path. I am not sure whether it takes any other switches, but will add some further information if so.

Useful commands for scripts can also be found in the manpage for xfce4-session-logout, although the switch user action is not mentioned there, as it uses a different utility called gdmflexiserver.


Additional drivers for my NVIDIA 680GTX not showing up in the additional drivers tool

sudo apt-get install nvidia-current

EDIT:

Or

sudo apt-get install nvidia-313-updates as suggested by @GM-Script-Writer-62850 in the comments.

This will install the latest NVidia drivers. After that you can select from the Additional Drivers list.


Apt upgrade error: distro-info-data breaks distro-info

The problem appears to have been that apt was still tuned into "Xenial" (16.04) sources for everything, when I needed "Bionic" (18.04). I ask about this problem specifically and eventually find a fix here:
Apt: Can't upgrade packages, and system still showing 16.04 / Xenial sources, after upgrade to 18.04 / Bionic


You need to link the libstdc++ library used by Matlab with the one installed in the system.

At the terminal type the following:

  sudo ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19 /usr/local/Matlab/R2015a/sys/os/glnxa64/libstdc++.so.6

You may need to adjust the path to take into account where Matlab is installed in your system. This solved the problem for me.


To put your files in a /home is just a convention. You can store your files wherever you want. If you want to use some space in root make a directory there and set the permissions that match the permissions of your other files in your home directory. You can even make a symbolic link to your home directory. For instance:

sudo mkdir /mydata
sudo chown myusername:myusername /mydata
ln -s /mydata ~/mydata

Put whatever you want in that folder. You will have a folder mydata in your home directory which will point to the mydata folder in the root. Change the name mydata to whatever you like. In the last command ln you don't need to use the same name twice. You can also do it like this

ln -s /mydata ~/linktomydata

The ~ represents your home directory. So you can also write

ln -s /mydata /home/<username>/linktomydata

where you put your username instead of <username>.


Hibernation using systemctl and getting it working in tough cases
For me, pm-hibernate always fails. After some tweaks, I was able to hibernate using the interface of systemd (init system in 16.04 and above). I also managed to get it working on 17.04 with a swap file. This case study may be useful for others with problems.
First try:
sudo systemctl hibernate

If that fails, begin troubleshooting: in the hibernate state (HTD or ACPI S4) the machine state is written to disk so that no power is needed to preserve it. The state is written either to a swap partition or to a swap file. Note: if using Btrfs DO NOT attempt to use a swap file as this may cause filesystem corruption
Your swap partition or swap file may need to be the same size as RAM to allow hibernation, but there is a good chance you will be able to hibernate if it is at least 2/5 the size of RAM, according to the Arch wiki page, so try other steps first before increasing swap size.
If your problem is that you get a clean boot instead of the expected resume, at a minimum you most likely need to set a boot parameter to find the disk image
Find your swap partition:
grep swap /etc/fstab

for me this returns (partial output)
# swap was on /dev/mmcblk0p3 during installation

where /dev/mmcblk0p3 is the partition to specify
Add a boot parameter:
sudoedit /etc/default/grub

To the line starting GRUB_CMDLINE_LINUX_DEFAULT add resume=/dev/YourSwapPartition to the section in quotes (replace with the the partition you identified earlier). Using my example:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=/dev/mmcblk0p3"

Any time you change this file, you must run sudo update-grub or the changes will have no effect.
Now you need to reboot. Then you can try to hibernate, by issuing the command:
sudo systemctl hibernate

To resume, press the power button and the system will boot.
If you still have problems, start debugging.
I include my case below as an example, but detailed information on debugging S states can be found in this blog and also this one.
Set some more boot parameters to capture more information. Remove quiet and splash and add initcall_debug and no_console_suspend which will cause init system calls to be printed to the console so you can watch what is going wrong. I set this:
GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/mmcblk0p3 no_console_suspend initcall_debug"

Which helped me see what was going wrong on resume from hibernation. You can also try using dmesg.
In my case, after resume I lost WiFi, and the kernel clearly was upset as most commands (for example reading anything from /sys, reloading modules or any systemctl command) would not work - the process would appear to start and just hang (all this would be returned to normal after reboot of course). Watching the system very slowly shut down and reading all the debug messages, I noticed that there were a lot of problems with "brcm", so I guessed my Broadcom wireless driver module was to blame. Sure enough I adjusted my hibernation procedure to unload the module first:
sudo modprobe -r brcmfmac
sudo systemctl hibernate

on resume I reinsert the module
sudo modprobe brcmfmac

And everything worked perfectly. I also have to blacklist the btsdio module which seems to be incompatible with brcmfmac

Update: Hibernation using a swap file on 17.04.
Once again with help from the Arch wiki page and some additional tinkering, I managed to get hibernation to work on 17.04 with a swap file. This required an additional boot parameter, resume_offset=n where n is the first number under physical_offset in the output of sudo filefrag -v /swapfile:
$ sudo filefrag -v /swapfile
Filesystem type is: ef53
File size of /swapfile is 1425873920 (348114 blocks of 4096 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..   32767:      34816..     67583:  32768:
   1:    32768..   63487:      67584..     98303:  30720:
   ....

Therefore, the additional boot parameter in my case is resume_offset=34816. You still need to set a boot parameter for the partition to resume from. This will be the root partition (or whatever partition your swap file is located on) My parameters are now:
GRUB_CMDLINE_LINUX_DEFAULT="no_console_suspend initcall_debug resume=/dev/mmcblk1p2 resume_offset=34816"

Where /dev/mmcblk1p2 is my root partition (yours is more likely to be something like /dev/sda2).
During resume I saw the image loading successfully, but in my case (just an example - YMMVAPD) then some more drivers (i2c_designware) threw some errors and I got a complete system freeze on resume. Hibernation works if I unload those modules in addition to brcmfmac, but the system quickly becomes unusable without those modules. I therefore made a sort of script to unload the buggy modules and immediately reinsert them on resume:
# remove buggy modules
modprobe -r brcmfmac i2c_designware_platform i2c_designware_core &&
# hibernate
echo disk > /sys/power/state
# reinsert
modprobe i2c_designware_core i2c_designware_platform brcmfmac

When I want to hibernate, I run sudo bash script. This works great.

TL;DR
Use systemd, set a boot parameter for resume from swap, identify buggy drivers and unload them before initiating hibernation. If the system can't work for long without those modules or you need to unload several, it may be easier to use a simple script to initiate hibernation.


It sounds like you might be experiencing an X freeze. Details on how to troubleshoot these types of freezes are available at https://wiki.ubuntu.com/X/Troubleshooting/Freeze.

See also: How do I report a bug?


Does any one knows what does mean : ERROR No matching node is available in Juju

After a long number reinstallation from scratch, it seems that juju does not like caching so it s recommanded if you plan to destroy the env and start from scratch to clean your cache !!!
if you get stuck just try it !!! hopefully will work for you :-)


Rule 9 in your INPUT chain jumps to ufw-reject-input, which in turn rejects the packet.

If you want your additions to function with ufw, I suggest reading the documentation shown by man ufw-framework.

You can probably achieve what you want by creating a /etc/ufw/before.rules file with content like:

*filter
-A ufw-before-input -p tcp --dport 1723 -m mac --mac-source 00:11:22:33:44:55 -j ACCEPT


Ubuntu 14.04 Phone emulator lock screen

I'm guessing it is like the question above and might be phablet or 0000 (zero, zero, zero, zero).


How to give a specific user access only to a specific folder and its contents?

Changing the ownership to a designated user will not change the users default home directory specified in passwd file. Anyhow, You may achieve this in different ways. But to make it simpler do this by opening up a terminal;

Firstly make a back-up of your /etc/passwd file doing below;

sudo cp /etc/passwd /etc/passwd.back

Once done, edit the file (either with vi or nano), I prefer nano which is pretty easy;

sudo EDITOR=nano vipw /etc/passwd

Locate the created user. A line should reflect as below assuming the user is andrew;

andrew:x:1001:1001:andrew:/home/andrew:/bin/sh

Replace /home/andrew with /var/www/sitename.com & save the file by hitting CTRL+O then enter to save & then CTRL+X to exit. This will direct the user to specified directory. Login as the user and see whether it points to **/var/www/sitename.com by also checking for any permission issues. If permission issue persists, then add the user to the www-data group by doing below;

sudo adduser andrew www-data

EDIT: regarding the comment, I just had a quick search and found some more detail. Well, you may edit vsftpd.conf file located in /etc/ directory

sudo nano /etc/vsftpd.conf

un-comment (remove only the # if its there at the beginning) the following line;

chroot_local_user=YES

Note: Just to be safe, make a back-up of the configuration file before you make any changes to it.

sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.back

Source: vsftpd.conf on Ubuntu

Hope it helps!


Is it possible to install Ubuntu in a USB device?

You can just point the installer to your usb drive and it should work. Exactly the same as a normal install.

Notice that you can also create a live usb with persistence that can be used as an installer and to store your files and install packages.


update Kernel after failed upgrade because full /boot partition

Your system is missing the linux-image-generic package and probably also linux-generic which depends on the former. You should reinstall it using the command:

sudo apt install linux-generic

The packages linux-image-generic and linux-image-4.4.0-127-generic (the currently latest version) should be included automatically to be installed by APT.


I've had the same problem, which also doesn't seem fixable by previous answers; this appears to be a simple case that OpenJDK 10 on Ubuntu cannot run the current version of Minecraft with the 1.6.89-j Launcher.

Luckily, OpenJDK 8 is still available in the Universe repository, and if your system has been upgraded to Ubuntu 18.04 then it will probably already be installed. If not, install the openjdk-8-jre package.

Try starting the Launcher/game with /usr/lib/jvm/java-8-openjdk-amd64/bin/java instead of just java.

Unfortunately OpenJDK 8 will soon reach end-of-life for support, so you need to be aware of that.

Additionally the openjdk-11 packages offered by Ubuntu actually contain OpenJDK 10 at the moment, and are intended to silently upgrade to the real OpenJDK 11 when that is released.

See https://lists.ubuntu.com/archives/ubuntu-release/2018-February/004275.html for more information on the versions and support periods.


Screen resolution got zoomed after installing nvidia driver

I had a similar or maybe the same problem in Ubuntu Mate 16.04. It appeared that the Nvidia driver I installed for my Quadro card changed the dpi settings of my laptop screen from 96*96 to 140*140. The 140*140 DPI setting made everything look slightly zoomed/too big and blurry.

What worked for me was adding the DPI setting to the xorg.conf file:

Open the etc/x11/xorg.conf file with nano by typing this in your console:

sudo nano /etc/X11/xorg.conf

It's a good idea to make a backup of this file first before changing anything.
Look for the line that says: Section "Monitor".
Add the following rule into that section: Option "DPI"   "96 x 96" so that it looks a bit like this example:

Section "Monitor"
    Identifier     "Monitor0"
    Option "DPI"   "96 x 96"
EndSection

You can change the DPI value if you need a different DPI setting instead.
Save ctrl+o and close ctrl+x the xorg.conf file in nano.
Reboot Ubuntu

Your monitor should now use the proper DPI setting and your desktop should look sharp and normal again.

Reference used: https://bugs.launchpad.net/ubuntu-mate/+bug/1612068


How to make shared partition on dual boot between Windows 10 & Ubuntu 14.04

(I don't have reputation to comment so..)

I had installed windows 8.1 on drive C:. I then installed ubuntu 15.10 on drive D:. Now, all the ntfs partition including C: is visible and accessible to Ubuntu but drive D: is no longer ntfs and hence not visible to windows. If this fits your needs, I will explain steps of doing so.


Create a PDF with specific page ranges of multiple PDF files?

You can use pdfseparate command to split all pages of pdfs into single page pdf. The following command will create last_page-first_page pdfs where their name will be out_<pageNumber>:

pdfseparate -f <first_page> -l <last_page> <file_name>.pdf out_%d.pdf

Apply the process to both pdf using different output name for each input pdf, so you don't overwrite previously created single page pdfs. Then you can use pdfunite for merging selected pages into a single one pdf:

pdfunite <ordered list of pdf> <output_filename>.pdf


How to install Open Office alongside Libre Office?

I just posted an answer to the same issue in this SO thread. Basically, before installing OpenOffice, one should remove symlinks to soffice that LibreOffice created, and then force install of dekstop-integration packages.


Mu ubuntu stuck at installing vmware tools. please wait

Startup the Ubuntu guest without installing vmware-tools. You should now see the standard Unity desktop.

If you don't have it push Ctrl+Alt+F1 to get to tty1 and after updating and installing build-essential and linux-headers-$(uname -r) continue with option 1) or 2), you don't have to open a terminal, just type the commands.

First, you need to update and upgrade and install build-essential and the latest linux-headers in the Ubuntu guest, in your case Ubuntu-13.04. Do it by running the following in a terminal (Ctrl+Alt+t opens the terminal):

sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade

This upgrades Ubuntu to the latest packages and the latest regular kernel.

When prompted for a password, enter your Ubuntu admin user password.

Note: For security reasons, the typed password is not displayed. You do not need to enter your password again for the next five minutes.

sudo apt-get install build-essential linux-headers-$(uname -r)

Now try installing vmware-tools regularly.

If this doesn't work there are two options:

1) Install vmware-tools via command line:

In the Ubuntu guest, run these commands (In the terminal):

sudo mkdir /mnt/cdrom

sudo mount /dev/cdrom /mnt/cdrom or sudo mount /dev/sr0 /mnt/cdrom

The file name of the VMware Tools bundle varies depending on your version of the VMware product. Run this command to find the exact name:

ls /mnt/cdrom

tar xzvf /mnt/cdrom/VMwareTools-x.x.x-xxxx.tar.gz -C /tmp/

Note: x.x.x-xxxx is the version discovered in the previous step.

cd /tmp/vmware-tools-distrib/and nowsudo ./vmware-install.pl -d

Note: The -d switch assumes that you want to accept the defaults. If you do not use -d, press Return to accept each default or supply your own answers.

Run this command to reboot the virtual machine after the installation completes:

sudo reboot

After reboot vmware-tools should be working.

2) The Open Virtual Machine Tools (open-vm-tools) are the open source implementation of VMware Tools. They are a set of guest operating system virtualization components that enhance performance and user experience of virtual machines.

Install open-vm-tools:

sudo apt-get install open-vm-tools open-vm-dkms open-vm-toolkit

sudo reboot

After reboot open-vm-tools should be working.


You must upgrade to 12.04.5, 12.04.4 went EOL aug 8th, try apt-get dist-upgrade


How do I install alsa-lib from launchpad?

alsa-lib_1.0.28-1 is in the package libasound2_1.0.28-1, a shared library for ALSA applications.

To install open a terminal and install with:

sudo apt-get install libasound2

Explanation:

On this page, we read:

  alsa-lib package in Ubuntu
  libasound2: shared library for ALSA applications
  libasound2-data: Configuration files and profiles for ALSA drivers
  libasound2-dbg: debugging symbols for libasound2
  libasound2-dev: shared library for ALSA applications -- development files
  libasound2-doc: documentation for user-space ALSA application programming
  libasound2-udeb: shared library for ALSA applications (udeb)

Or we can start a search and count two and two together.:

apt-file search alsa-lib


How to remove "Ubuntu Help" and "About This Computer" from shutdown menu? (indicator-session applet)

Build from source, same method as https://askubuntu.com/a/421451/44179 (I have tested this in Ubuntu 14.04, but it should work for 13.10 too)

Install build prerequisites

sudo apt-get build-dep indicator-session

Download source

apt-get source indicator-session

Comment non-needed menu section create_admin_section, using /*,*/ and //:

/*
static GMenuModel *
create_admin_section (void)
{
  return NULL;
  GMenu * menu;

  menu = g_menu_new ();
  g_menu_append (menu, _("About This Computer"), "indicator.about");
          g_menu_append (menu, _("Ubuntu Help"), "indicator.help");
  return G_MENU_MODEL (menu);
}
*/

...

  if (profile == PROFILE_DESKTOP)
    {
      //sections[n++] = create_admin_section ();
      sections[n++] = create_settings_section (self);

...

  if (sections & SECTION_ADMIN)
    {
      //rebuild_section (desktop->submenu, 0, create_admin_section());
    }

Build and install

cd ./indicator-session-12.10.5+14.04.20140311.1/
mkdir build
cd build/
cmake ..
make

sudo make install


It looks like the version of nginx you are trying to install is not compatible with your version of Ubuntu.

Specifically, it needs the version of libssl1.0.0 and init-system-helpers from xenial or higher but you have trusty or lower.

I would guess you are getting it from a third party repository so you can get a more recent version, but you need to ensure that it's backported to your Ubuntu version (ie, find one specifically compiled to work with the packages in your version of Ubuntu).  Otherwise, you either can't use it, or you'd have to start upgrading parts of your Ubuntu to a newer version.


What does a hash sign (#) at the end of the directory path in a Bash prompt mean?

It sounds like you were given a root shell.  A root shell is typically indicated with a hash sign (#) as opposed to a user shell which is usually indicated with a dollar sign ($).

Whether or not there is a directory name or user name as well depends on the particular shell in use, as a root shell could look like any of the following:

#
/#
/dir#
username:/dir#
username@hostname:/dir#

The last of the above examples is the default prompt in Bash in Ubuntu.  The first is the default in the dash shell.  Try it with /bin/sh.  Of course this is configurable in both.

To open a root shell, the shortcut is:

sudo -i

This opens the root user's configured shell as a login shell, which will usually be bash.  It's a shortcut to sudo su -.  If you want to open a different shell as root, without modifying the root user's configured shell, you can use the long-winded:

sudo su -s /bin/sh -

Replace /bin/sh with the shell you want to open.


My .jar file run with terminal but not by "clicking"' on it

You have to enable it to be executable. You can do that one time in terminal by giving it for example 755 permissions by

chmod 755 /path/javafile.jar

or

chmod +x /path/javafile.jar

Same you can do from the GUI by open the file properties, switch to the permission tab and set the check-mark as shown in the screen-shot.


Xserver error "(EE) module ABI major version(6) doesn't match the server's version(8)"

OK So you broke X, will will have to re install the system

You will need your live DVD/USB,or you have to make one.

Boot the live medium and choose install Ubuntu

If you see an option to upgrade Ubuntu 14.04 to 14.04 (or someting like this UPGRADE is the important word) (at the top) use this to re install

If not, that's OK choose something else

Highlight your current Ubuntu installation and set its mount point to /

THIS IS THE IMPORTANT BIT There is a little box that says format on the drive make sure you UNTICK this box (eg format is disabled)

Then install, this will re install all the system files (including X) but will not change your /home folder of user details.

Reboot when it is finished

Here is the documentation on this


Ubuntu installer cannot recognize my os while dual booting

Please run a live cd of Ubuntu and install boot-repair.
Open the terminal and copy and paste the following command:

sudo add-apt-repository -y ppa:yannubuntu/boot-repair && sudo apt-get update

After successfully adding and updating the repository type the following command:

sudo apt-get install -y boot-repair && boot-repair


You need to change the boot order in your motherboard's BIOS settings in order to boot from your optical media drive containing the Ubuntu disc.

This is not actually a feature of Ubuntu, but part of your motherboard's firmware (BIOS).  Interfaces for BIOS are not consistent in the industry, even among hardware from the same manufacturer, so you may need to consult the manual that came with your computer to find out the exact process for your system.

Generally, a splash screen will display briefly when you first power on your computer that will indicate which key to hold down during boot to enter "setup" or "options".  The key is often: ESC, DEL, or a function key like F1, F2, F11, or F12, etc.

Once you have gotten into the BIOS menu, you will need to elevate your optical drive's boot priority above all other bootable drives -- again this process is not consistent between devices so you may need to consult with the documentation from the hardware (motherboard) manufacturer.


One IP address, Two Websites, on Two Machines - Need details

Suggestions:

Checked that server1(example.com) can lookup and get a correct dns record for myhost01.example.com?

Do your servers have one public IP each and a internal one each? Or is it like the linked question that you have one IP?

Do i smell a cheap router that have one IP, runs nat and port forwarding on the mentioned ports?

It is often so with cheap routers that they have issues with combining nat and portforwarding using external addresses to reach other internal machines. Some also fail this on purpose as it is bad practice to send all your internal load thought your gateway/nat router.

Both dns records (myhost1.example.com and example.com) points to the same public IP?

yes, and that is intentional and correct, but what happens?

When the Apache instance wanna lookup where to do the proxy connection it will be told the external IP of myhost01.example.com that is pointing back to the router that might fail the connection. Lets assume it does.

We found one possible error, how do we work around it?

As the external IP from the dns will not help server1 to find the local IP to go over the local network do we need a way to do it, luckily does it exist many ways to Rome.

One way would be to use the local IP of server2 in the ProxyPass.
Another way would be to simply override your dns answers. That can be done on server1 that serves as the proxy. Edit the file /etc/hosts. Some more info about the hosts file can you read here.
A 3rd way would be to make extra dns records for your local servers. Eg a entry named eg. local2.example.com pointing to 192.168.0.7.

Note. If you wondered, it is fully possible to have more public IP's and run them on a little subnet eg. that will also be serving as the interconnection. Thought it is not very recommended to do so.

Disclaimer

This answer is based on an experienced guess, as complete configuration, Apache logs and errors are lacking from the answer. Feel free to improve.


Ubuntu 18.04 black screen after succesful login on Virtual Box

I have a similar issue with 20.04 on virtual box 6.1 but it's not occasional, it occurs every time after login. It started this morning and affects 2 separate VMs - ubuntu 20.04 so I suspect it's an update on the host.

Until I find a real fix, there are 2 ways around that worked for me

1- change the display adapter from VMSVGA to VBoxSVGA in the VM settings
OR
2- at login, changed from X11 to Wayland (when you click on your name, there a "setting" icon that appears on the bottom right that lets you choose between "Ubuntu" or "Ubuntu on Wayland", at least on 20.04)


Ubuntu Studio 19.10 uses Xfce as it's desktop manager. I have a Ryzen 5 3400G and I had to turn off the compositor in the system settings application, or install gnome or KDE plasma. AMD is late to the party with current drivers for the 19.10

Hope that helps


How to install matlab if I already have a Windows version?

If you have already a copy of MATLAB, then you could follow these steps to install on your Ubuntu machine (assuming you have a downloaded copy).

First make a mount point, which is just a folder. For example:

mkdir /media/mathworks

Then mount the downloaded ISO to that directory. For this example,
the ISO is in the home folder under the downloads folder and the ISO
is called matlab.iso(if you have downloaded on to the same system):

mount -t iso9660 -o loop ~/downloads/matlab.iso /media/mathworks

Now you can navigate there and run the installer as if it were a
copy of the DVD, for example:

cd /media/mathworks
./install


This is a duplicate. Take a look at Install Ubuntu to usb drive and boot it to Uefi and Bios system.   The gist is bug 1173457, installer puts grub in the wrong place, sda.  The fix is to copy the sda EFI partition's files to the USB's EFI, then copy the UEF's /EFI/ubuntu/grubx64.efi and /EFI/ubuntu/shimx64.efi to /EFI/Boot and rename /EFI/Boot/grubx64.efi to /EFI/Boot/bootx64.efi.  Then use efibootmgr to reorder the boot entries on the hard disk to put USB first, Windows second, (or Windows first, and use the EFI menu (some function key at power up to select boot device).


How can I simultaneously play Spotify audio through my headphone-out while VLC plays audio through HDMI?

You can install and use Pulseaudio Volume Control. Go to the Ubuntu Software Centre and search for pavucontrol:

Or use the following command in your cli:

sudo apt-get install pavucontrol

Now start pavucontrol from the Ubuntu Dash (not the sound icon):

And select the desired output device under playback:

Happy listening!


I have 4 GB ram.. what should be the perfect swap partition size?

You are supposed to have your swap set at a minimum of equal your ram (4gb) but it's recommended to set it at double (8gb).


service --status-all takes too long... what are alternatives?

If you already know that this depends on the version of Ubuntu, why not just check the version instead?

case $(lsb_release -sc) in
trusty)
    fpm_service=php5-fpm
    ;;
xenial)
    fpm_service=php7.0-fpm
    ;;
artful)
    fpm_service=php7.1-fpm
    ;;
esac

Alternately, you could test for the service files in /etc/init.d (since all current FPM packages provide an /etc/init.d script):

find /etc/init.d/ -type f -iname '*-fpm' -printf "%P\n"


Sudo is for users that have been put on the Sudoers list; in other words, users that have been granted limited administration rights. This allows people to modify otherwise restricted things, without direct root access, and allows for effective logging of such actions.

The sudo password is your password. For example,

[sudo] password for bowser:

I would then type my password.


With DosBox open, type:

config -writeconf /home/user/dosbox.conf (or whatever) then exit Dosbox.

Open dosbox.conf and add (the [autoexec] is at the bottom):

[autoexec]

mount c /home/user/path/to/folder

I assume you can do the same for just about any command, it seems to be basically a batch file that is ran at launch.

http://www.ubuntugeek.com/howto-auto-mount-a-drive-in-dosbox.html


Got solution :

ashish@ashishk:~/chef-repo/.chef$ vim /etc/sysctl.conf

# Ignore Directed pings
net.ipv4.icmp_echo_ignore_all = 1

made it 0 it worked


have you tried to check if the graphic card driver is updated?

Go to System settings -> Hardware -> Additional drivers. Check if there is something to update. You can also update via terminal. Check this post.

If it doesn't work and you still have the problem, try  this post.


What word processor can manage left and right pages separately?

I don't know any current extension for LO or OO with such implementation, though you can try Scribus, which is desktop publishing software and should meet your requirements. But then again, I'm not sure whether you'll find it easy to manage or not :P


There is no such thing as dual ownership in Linux.
You will need to either put both users in one group and add access rights for the group, or allow all users (=others) to access the files.

To set the rights for newly created files, you can use Access Control Lists (acl) to modify (-m) the default (-d) access rights:

setfacl -d -m g:groupname:rwx /path/to/servers

I would actualy not use rwx but rwX, meaning folders can be executed (7), and files will not (6).

You could also allow "others" to access all files:

setfacl -d -m o::rwX /path/to/servers

Default means, all new files and directories will gain these rights. This does not affect files already in place.


I used these commands to fix everything and it worked. So, here are the steps:

Press Ctrl + Alt + F1
Login with your username and password
Run this command:

sudo apt-get install --reinstall ubuntu-desktop

Then restart the system writing this:

sudo shutdown -r now

That would be all.

I'm not a programmer, and it's the first time I write here, so, in case something is wrong, feel free to correct or improve my message if you're an expert.

Thanks.


The landscape-client charm is a subordinate application.  I can't find docs in the latest Juju (2.x), but it's the same concept as the Juju 1.25 Subordinate Service documentation.  Charms like these do not get units assigned to them, but rather relate to other applications in your model.

In your case, you need to relate landscape-client to apache2, then when you add new apache2 units, landscape-client will be installed and configured in the same way each time.

See the landscape-client juju charm entry for more information on how to use it.


Why do my files and folders from home/user appear on the desktop after last update?

I deleted the directory Desktop and made a new empty one. Then I edited .config/user-dirs.dirs:

XDG_DESKTOP_DIR="$HOME/Desktop"

Rebooted and this solved the problem.


Funny TTY/Terminal behavior when sudo-ing as a user?

bash should be set for the shell for the user for the arrow keys to work.  To find out what shell they are using, type in the following from a terminal window while logged in as the user:

echo $SHELL

if it is not bash, the following will add the shell variable to the user:

sudo usermod -s /bin/bash <username>

Hope that helps.


I have found the solution months ago but i saw this question of mine so i said let's answer it so, people like me that couldn't find the answer until going through all that trouble, could easily find out how to solve it...
Well first of all let me introduce you to protocol's codes in ns2.
A protocol has been created with 2 main files(there is some protocols with only one file too but i'm talking about the most of them) in ns2 that one of them has .cc type that contains the protocol's name(like AODV.cc) for definition and the other one has the .h type for declaration and it also contains the protocols name(like AODV.h).

There could be other files including the protocol but the main is protocolname.cc.

We need to change/add some functions in the protocolname.cc so we could simulate our own protocol.

For example :
We need to use clustering for our protocol :
AODV.h :

public:
    AODV();
    void CLUSTERING();
    ...

AODV.cc :

void AODV::CLUSTERING(){
    if(current_){
         while(numberofNodes){
               // Selecting clusters
         }
    }
}

Now we know how the mechanism of ns2 works.so let's get started with sleep nodes.
First of all there is 4 functions in ns2 for turning a node to 'off', 'on', 'sleep', 'idle'.
The difference between these are not so big.
As you know the 'off' function turns a node to off but it still broadcasts something based on your protocol.

$ns_ at 7.0 "$node(2) off"

And you can turn it on like :

$ns_ at 7.0 "$node(2) on"

The base is :

$simulator at $time "$Node_($number) off"

I don't know how to set a node to sleep in scenario.tcl but you can do that in your protocol's codes.
Now, to set a node to sleep we could do several things...

setting nodes to sleep from energy model
setting nodes to sleep from wireless physics

First we'll try energymodel.cc and if it didn't work we'll use the other one.
To set a node to sleep from energymodel.cc we can use this code in void Mac802_11::recv function in ns-2.35/mac/mac-802_11.cc :

if(index_ == myNode){
    EnergyModel *em = netif_->node()->energy_model();
    if (em && em->sleep()) {
        em->set_node_sleep(1);
        //em->set_node_state(EnergyModel::INROUTE);
    }
}

Replace myNode with the number of the interface you want to set it to off.
If you are not using MultiInterface for your simulation so the number of interfaces will be equal to the number of your nodes.

example :
Normal :

            node ---- > interface ----> channel

MultiInterface :

                         ---- > interface[0] -----|
                        |                          ---------|
                        |                                   v
            node -------|---- > interface[1] --------- > channel
                        |                                   ^
                        |                         ----------|
                         ---- > interface[2] -----|

Open a terminal and cd to your ns2 directory, for example if you have ns-allinone-2.35, cd to /ns-allinone-2.35/ns-2.35/ and now type make and inter.
After it finished try to simulate your scenario.tcl.
Now if your simulation start and you see the nam file, when the nodes get the first packet, the shape of them must change from balck circle to black circle blue hexagon.
From then on the nodes must not send or receive any data packet.
If this way didn't work now it's the time to use the other option.
Go to /ns-2.35/mac/ and open wireless-phy.cc.
You'll see that at the end of the file it contains our 4 function that we need.
we can simply use those function on the wireless-phy.cc to set a node to sleep or off by just calling those functions.But we may need to use them in another layer like in mac.
To use those functions in mac-802_11.cc simply use the below code anywhere you want in mac-802_11.cc and add wireless-phy.cc to your mac headers:

 #include "wireless-phy.h" // at the header of mac-802_11.cc

 /*
  * Use the below code in any function you want in mac
  */
 Phy *p;
 p=netif_;
 ((WirelessPhy *)p)->node_sleep();

And to use another one of those 4 function just change the function's name like ->node_sleep(); to ->node_wakeup();.


I found that there's already a bug reported for this:
https://bugs.launchpad.net/ubuntu/+source/gnome-activity-journal/+bug/638217

You can try to run zeitgeist-daemon --replace


Access folders with sudo priviliges via Nautilius-Connect to remote server

Obviously running Nautilus as your local root account (with sudo, gksu, etc) isn't going to give you root access on the server.

The problem is that the SFTP server within OpenSSH (which is what Nautilus is connecting to) doesn't support commands like sudo — it's not a shell environment. What you're asking for simple isn't possible through the standard mechanisms.

However you are not without options. I'm not sure how familiar with SSH you are but you can tunnel ports back across a connection so you could connect normally, run a simple FTP server as root and tunnel all that back to your computer over SSH. Sounds horrible but it's fairly simple.

On the server, run:

# newer Ubuntu installs:
sudo apt-get install python-pyftpdlib

# older Ubuntu installs
sudo apt-get install python-pip
sudo pip install pyftpdlib

Then from your computer, just run a short SSH command:

# If you installed with pip
ssh -tL localhost:2121:localhost:2121 -L localhost:21212:localhost:21212 user@server "sudo python -m pyftpdlib -i localhost -w -p 2121 -r 21212-21212 -d /"

# If you installed with apt-get (and pyftpdlib is pre-1.3, true in 13.10)
ssh -tL localhost:2121:localhost:2121 -L localhost:21212:localhost:21212 user@server "sudo python -m pyftpdlib.ftpserver -i localhost -w -p 2121 -r 21212-21212 -d /"

And then in Nautilus (on your computer), connect to ftp://localhost:2121. The magic of SSH will forward that over to the FTP server running as root.

There are other protocols (I've spent a while looking for a better one) but FTP is the easiest to get up and running thanks in large part to pyftpdlib. You could do similar things with webdav et al, I'm sure... It would just be a lot more hacking around.


This also affects me, but I have a workaround. It only crashes when cells containing formulas are copied/pasted, so you can copy and paste values the cells of interest to another location in calc (i.e. Edit:"paste special" and uncheck "paste all" and "formulas" and check "Numbers"). Then the table can be copied and pasted into writer.


Wi-fi interferes with other devices when connected?

I resolved the problem today :D

For some reason, the Broadcom proprietary driver of my wireless card, doesn't work properly causing the interference described above. If you have a Broadcom integrated wireless card in your laptop and you notice this issue (I've got an HP Pavilion DV6), launching Jockey from terminal typing

jockey-gtk

and disabling the proprietary driver, will do the trick. After that, be sure to reboot as suggested! Ubuntu integrated drivers will be used instead of the proprietary ones.

I hope it may be useful in the future :)


Xorg crashed and all apps killed after waking up from suspend?

I had the error

Xorg crashed with signal 7
Error: [Errno 21] Is a directory: '/proc/driver/nvidia/gpus/0000:01:00.0'

I found this was Bug #1763645 "Xorg crashed with signal 7", a duplicate of Bug #1760450 "[nvidia] Xorg crashed with signal 7 in _dl_fixup() from _dl_runtime_resolve_xsavec() called from nvidia_drv.so".

What worked for me (driver 390) was in the comments:

Add scsi_mod.scan=sync to /etc/default/grub like this:

GRUB_CMDLINE_LINUX_DEFAULT="scsi_mod.scan=sync"

No resuming from suspend crashes yet.


Proxy settings for TeamViewer10 in UBUNTU 14.04

The best solution I found is to follow this steps :

Stop Teamviewer by sudo teamviewer --daemon stop
Add the following line :

[int32] Proxy_Type = 2

in Teamviewer config file at /etc/teamviewer/global.conf
Restart Teamviewer by sudo teamviewer --daemon start

It will force Teamviewer proxy settings to be on manual option by default, then the input will be writable. This way you don't have the AES salt problem.

Hope it will work for you.


18:04 Lost desktop icon(s) after sudo apt-get upgrade

It is a bit difficult to name exact package name with icons.
So I provide single long command to reinstall all icons-related packages:

sudo apt install --reinstall $(dpkg -l | grep -i icon | grep ^ii | awk '{print $2}')

In the command above:

dpkg -l | grep -i icon | grep ^ii | awk '{print $2}' is a long pipe with:

dpkg -l shows the list of all packages;
grep -i icon shows all text lines with icons;
grep ^ii shows only installed packages;
awk '{print $2}' shows package names;

sudo apt install --reinstall $(...) is used to reinstall packages from the output of $(...) command.

You can consult man-pages - man dpkg, man apt, man grep, man awk for details about used commands.


ibus(unicode vietnamese) not working with skype

Some snap apps (Slack, Skype, Rocket.Chat+, Telegram) from Ubuntu Software seems can't type Vietnamese by ibus, while other may (Viber, Postman, PHP Storm, Chromium).
I reported this issue at https://bugs.launchpad.net/ubuntu/+source/ibus-unikey/+bug/1803270
Following Olivier Tilloy (osomon), maybe these apps (the snap apps can't type Vietnamese) do not use the desktop helper.

A temporary solution is download Skype deb packet from Skype official website and you can type Vietnamese in this by ibus.


I am running Ubuntu 12.10 on a IBM lenovo thinkpad r51 (non pae cpu) How do I install 13.04 from live dvd

Ubuntu 13.04 needs PAE. There is a potential workaround at Ubuntu Forums


How do I create a new logical partition from unallocated space?

You can resize the expended partition so it occupies all the space which is currently unallocated and then create an NTFS partition inside the extended partition. Since only the end of the extended partition need to be moved, the existing partitions inside it can be kept and also the operation will be quite fast.

I second the suggestion of brunopereira81 to use gparted for that.


Ubuntu installations are not displayed when Windows 10 is installed

Basic procedure that I personally would use

1   Boot the Ubuntu Live CD.

2   Press Ctrl-Alt-F1

3   sudo mount /dev/sda1 /mnt

4   sudo mount --bind /dev /mnt/dev

5   sudo mount --bind /proc /mnt/proc

6   sudo mount --bind /sys /mnt/sys

7 sudo chroot /mnt

8  sudo grub-install /dev/sda1


How do I get amilo-rfkill support on a non-pae laptop? (a.k.a. where to get 3.5 kernels for oneiric)

A couple of things:

Non-PAE (aka generic i386) kernels are available until Precise, but not for Quantal
Just because a driver is in the kernel (source) tree does not mean it is included in a specific build of the kernel (that depends on the kernel configuration for that build)
amilo-rfkill is available in the PAE i386 kernel 3.4/3.5 mainline builds for Quantal, as part of the linux-image-extra package.

But it is not available in the Ubuntu kernel team's previous non-PAE builds of the 3.3/3.4 kernels.
Unfortunately, if you have no PAE support it looks like you must build the kernel (or at least that module) yourself...


Windows 10 not booting in dual boot with Ubuntu

I will suggest using the boot-repair module. Maybe it can fix your thing if there is lone booting problem.
more info here
boot-repair


How to install Midori browser on Ubuntu using PPA?

Open terminal by pressing Ctrl+Alt+T and run the following commands,

sudo apt-add-repository ppa:midori/ppa
sudo apt-get update
sudo apt-get install midori


I ended up starting over with a fresh CentOS i386 vm, and in the process of getting this running there found that the binary needs libstdc++5. Back on Ubuntu, installing that via sudo apt-get install libstdc++5:i386 seems to have done the trick.


Having done a lot of research into these devices, I had a pretty good idea what I'd find if I looked into this one.  The manufacturer of this product openly supports LINUX for other devices they sell, but not for this one.  In other words, it is extremely unlikely this device will ever be supported for linux.  If you do as much research as I have, you will also learn that fewer than 1 in 20 such devices are linux compatible, and those that are can be quite expensive.

My advice to you is that unless your VGA monitor is extremely large or valuable, that  you purchase a new monitor with an HDMI input, as it is very likely that unless your laptop is in fact a tiny little netbook or something, it actually does have an HDMI output port on it.  In case you don't know what HDMI looks like, it looks very much like a USB port.

If you would do us the courtesy of giving us the model number of your laptop, I'm sure one of us can find the time to determine the actually connectivity of your laptop, such as whether it has HDMI or perhaps some other sort of video connector such as "displayport".


After installing SELinux, I was locked out of Ubuntu 18.10. Log in screen never appeared. What am i missing here? How to properly install SELinux?

SELinux is not fully supported in Ubuntu as they focus on apparmor and as already said by other people, it will probably require to adjust the policy.

But if you want to give it a try, you need to install an actual policy, here I see that you installed selinux-policy-dummy which is described as:

  Empty Security-Enhanced Linux policy (dummy package)

  This package is used to satisfy package dependencies, but does not
  contain an actual SELinux policy. This package should be installed
  if the system administrator is developing a custom SELinux policy.

You probably want to install selinux-policy-default instead, this package contains an actual policy, the system should boot a bit further. You also might want to check in /etc/selinux/config that the mode is set to permissive, that will make SELinux only log denials.

Edit: Also, try to install selinux-basic instead of selinuxpackage, the later is ubuntu specific and not maintained for years


Will using ubuntu from a external hdd give me same performance as using ubuntu from internal hard drive?

SATA 3.0 has 6.0Gb/s transfer speeds. The Wikipedia page also shows comparisons to other buses (ie: SATA vs USB).  Thunderbolt 2/3 and USB 3.1/3.2 appear faster, but I believe USB is half duplex, while SATA is full.  Additionally, it seems the packets, or how USB communicates, is less efficient for disks than those of a SATA connection.
The SSD is capable of using multiple PCI lanes to connect, and I think the PCI bus is closer to the CPU or has higher priority, though I'm having a hard time finding any evidence to support this.
Reasons why to use SATA over USB are discussed in more detail in this post.

Alongside these reasons, you could use your external hdd to store non-system files, such as media or other data you'd want to carry over to your next machine.  Keep all of the system data on the internal HDD and when you switch computers, all of your personal data and files can be easily taken with you.


It sounds to me like when you installed KDE you let it switch your default Desktop Manager from LightDM to KDM. KDM would have been removed when you uninstalled KDE, because of this you get a black screen at bootup. You will need to switch back to LightDM as your default Desktop Manager.

Steps:

In terminal type "sudo dpkg-reconfigure lightdm".
In terminal type "sudo reboot".

Notes:

If you don't have LightDM installed for some reason then you can install it by typing in terminal "sudo apt-get install lightdm".

EDIT #1:

In response to your edit regarding how you installed/removed KDE I believe the problem was that you used aptitude when removing instead of apt-get remove. Aptitude removes packages using a list generated during the install but you didn't use aptitude during the install, apt doesn't use a pre-generated list. It's likely something you need got accidentally removed because of this. I would suggest installing lightdm & ubuntu-desktop again as this will re-install any missing dependencies. In terminal type sudo apt-get install --reinstall ubuntu-desktop and then sudo apt-get install --reinstall lightdm.


Attempting to install php-zip - getting libzip4 dependancy (>=1.0) error even though I have 1.0.1 installed

To install libzip4, you have to add the Ubuntu repositories to your apt source list.  This can be done by

sudo apt-add-repository main
sudo apt-add-repository restricted
sudo apt-add-repository universe
sudo apt-add-repository multiverse

Here you find some examples.


The command seems to correct except for some space indents. All the parameters are passed correctly. Only parameters that is found missing is the time (-t) parameter. The correct command for the same will be:

redshift -l 36.47:-6.20 -t 6400:4400 -g 0.8 -m vidmode -v


Gparted: move extended partition on the left

You can't move the partitions that are mounted (the ones with the key icon), and you can't unmount the system you are running.  You can unmount the swap drive, but that's not enough.  So, you need to boot Linux from a cd or usb drive, then run gparted.  The original Ubuntu disk will work, just don't install, but use the feature to try it out without making changes (ie, live CD).

Once you run gparted from another disk, you will want to resize sda3, the container for the logical drives, by selecting resize, and dragging it all the way to the left. Then, do the same for sda5, so it fills the partition.  Finally, click the chekbox icon to apply the changes, and be prepared to wait a few hours, as resizing the partition to the left requires moving all the data.  If you had left space at the end, then it would have been much quicker to resize to the right.

Make sure you do not turn off the power while this is happening.  A power outage could be disastrous, so if you have a desktop, a UPS is a good thing to have.  If you were to have a power outage, you might be able to cancel the operation.

If you have a laptop, make sure the battery is charged, and leave it plugged in.


What do these two screens mean and how to remove them?

The right side two boxes are the Workspace No.1 and Workspace No.2 from Top to Bottom..
Your firefox window is on Workspace No.1, for example If you have another window opened on Workpsace No.1, you can move any one window to Workspace No.2 via keyboard shortcut or simply dragging and dropping it to No.2.
When you move one window to No.2, Workspace No.3 will be created automatically.
If you don't wish to use Workspaces and willing to have only Workspace No.1
Install gnome-tweaks with the below command
sudo apt install gnome-tweaks

go to Workspaces tab and select Static Workspaces and choose Number of Workspaces to 1

Same thing can be achieved with out installing gnome-tweaks by command line way..


here is ubuntu help page for mounting usb drives. I have an external hardrive which has 2 ntfs and 1 ext3 partition I have entered the configuration on /etc/fstab so that it mounts on boot time. You can do this if you do not usually move your external drive. There is another mounting utility for automount, you can install it with

sudo apt-get install usbmount


can't install Ubuntu 14.04 - black screen - Samsung RV-411

Try to install and do not pick the install proprietary drivers...like disconnect your internet while installing.  It does not take long.  Try again.  There is nothing to salvage and you wiped win7 anyway and have nothing.    The instructions are quite complex.  Just start where it says universal usb installer and install.

Another option if this does not work.
Install 14.04 and then do and distribution upgrade.
It should prompt you for that when you click on updates.


Can Ubuntu provide an IDE for C, C++ programming?

Edit:
In addition to my answer below, I'd like to add point out that the Netbeans C++ edition is a very nice IDE too. At the time when I wrote my answer, I haven't considered looking at this because I only knew it from Java development, and for this I use Jetbrains IDEA. A bit later I tried Netbeans for a C++ project and it turned out to be very helpful and intuitive.

For the first part of your question about installing on a Win7 machine, please read on the official ubuntu. It is explained how you can create a dual system with Windows and Ubuntu.
For your second question: Yes, Ubuntu and Linux in general is excellent for C/C++ development. You have several choices if you want an IDE instead of a simple editor. I personally like Eclipse with C++ support, but you have several other choices

Code::Blocks is a very nice C++ IDE
Qt Creator which can be used for development in general and not only for Qt applications
Anjuta is another one I tried long time ago which was quite nice..

Please find a long list of available IDE's here (although it's in German, you surly can read this).
Please note that especially Eclipse, Code::Blocks and QT Creator is not restricted to Ubuntu. You can try them in Windows too!


What do i need to use to encrypt my usb hdd?

As Jeremy Stein pointed out, you can use the Disk Utility tool under the System -> Administration menus. When you select the Create Partition option, check the Encrypt Underlying Device box in the dialog box that is displayed:

This will create the partition on top of a LUKS encrypted space. The downside is that it appears to create it encrypted with AES128, and there doesn't seem to be an obvious way to change that. If AES128 is insufficient, then you'll need to create the LUKS partition manually, doing something similar to what
https://help.ubuntu.com/community/EncryptedFilesystemsOnRemovableStorage
 recommends.


Desktop internet shortcut opens as text file

I don't have a good solution, but I have a solution. You see, the desktop entry specification does not determine the viewer or mime type for a link. A link can be an image, a document, whatever, and the correct viewer will be chosen based on what the file is. And so it happens that this link opens with an editor (and not a browser). You have two options.

However, here is a little change that will result in the correct behavior, although it is ugly. Modify the  desktop entry like this:

[Desktop Entry]
Encoding=UTF-8
Name=Learning Python
Type=Application
Exec=xdg-open http://proquestcombo.safaribooksonline.com/book/programming/python/9780596805395
Icon=text-html
MimeType=text/html
Name[en_US]=Learning Python

It will look the same, but it will be an application launcher. Just remember to set the permissions to execute in that case!


Ubuntu doesn't recognize thunderbolt port on my Mac Mini

I have used a 2011 Mac Mini with that very same adaptor you speak of.  This adaptor exhibited this problem on bootup every time.  Switching to HDMI solved the problem, but you can also try these:

Unplug and replug the adaptor after bootup.
Purchase a different brand/model adaptor, especially if the one you have is old/cheapo (note: this isn't as likely to work).


POX requires Python 2.7 which can be installed in all currently supported versions of Ubuntu by the following command:

sudo apt install python2.7

Optionally you can also install pip for Python 2.7 with sudo apt install python-pip. If you need to install Java separately, the command to install the compatible Java version is sudo apt install openjdk-8-jdk

To start the python2.7 interpreter from the terminal type python

For more information visit the SDN Hub Pox Controller Tutorial.


How do I add a search function to gnome classic (fallback) panel?

I somehow managed to add the Search for Files option to my Places menu. I'm not sure exactly which step I took to make this work, but I'll tell you exactly what I did:

Install Main Menu via the Software Centre.
Install GNOME Desktop Utilities via the Software Centre.
Open your Home Folder and click: Bookmarks -> Add Bookmark. This will add a Bookmark to your 'Home Folder'.
Click 'Edit Bookmarks...' and click on the new 'Home Folder' bookmark.
Type "Search" as the name, and set the location to gnome-search-tool, instead of /home/user/.

Now after following those steps I suddenly find a Search For Files... option in my Places menu. I haven't restarted the computer yet so I don't know if it will remain after a boot, but if it does then we are in business!

Also, I did install the MATE desktop in Ubuntu, but since this is Gnome Classic "No Effects" that I am running, I doubt MATE would have any effect.

Edit: The Search for Files... option is still there after a reboot!

Edit: The following link will take you to my post on this topic at the Ubuntu Forums, where I have attached an image showing that I now have the Search for Files option:

http://ubuntuforums.org/showthread.php?p=12161664#post12161664