Package candidate/alternative for the python-pgsql package in 11.10

Debian developers suggest either python-psycopg2 or python-pygresql. They have removed the package from their distribution, as has Ubuntu. There might be some code changes required to use the new packages. You might ask the author of the script you intend to use to adjust his code to those packages.

Adapting davical-cmdlnut to psycopg2

There should be a pretty straight-forward translation between pyPgSQL and psycopg2. The different handling of quoting is perhaps the most difficult to do among these.

pyPgSQL.PgSQL.connect → psycopg2.connect
pyPgSQL.libpq.DatabaseError → psycopg2.DatabaseError
pyPgSQL.libpq.PgQuoteString(s) → psycopg2.extensions.adapt(s).getquoted()

Also note that psycopg2 developers advise strongy against the use of + to compose querys, which davical-cmdlnut does all over the place. That's the reason they have to do so much manual quoting, whereas psycopg2 would do all that automatically if parameters were passed their way.


Newbie, Unable to install scanner Software for Brother MFC L8850CDW?

Based on my experience, it's better to link the device to pc with an usb cable, at least the first time you install it.

I think that is enough to go here:

http://support.brother.com/g/b/downloadtop.aspx?c=us&lang=en&prod=mfcl8850cdw_us_eu_as

then select at STEP 1 "Linux", and then at STEP 2 "Linux (deb)". Click on "Search" and then download the driver, according to the version of your operating system (32bit or 64bit).

To check the version of your operating system, open the terminal, and write:

uname –m

If the answer is:

x86_64

then your system is a 64 bit system;
otherwise, if the answer is

i686

or

i386

your system is a 32 bit system.

Once you have downloaded the .deb file, just double-click on it and then install it.

Hope this helps.


Here's how you can recover your password. Boot into single user mode on your PC

Interrupt your PC as it boots by pressing the arrow keys
Select your OS and tap letter a on your key board.
Space and append 1 at the end of the rhgb quiet
Press enter and reboot and then type in passwd and you shall be prompted for a password.
Type in your new password and there you go. You have your new password succesfully set.
Now reboot and login with your new password.

Try that and let me know how it works out.


Kernel panic - possible due to IR reciever?

In Ubuntu, you can blacklist drivers from loading. If you do get a successful boot, you can use Terminal commands to add the IR driver (rc_core) to the blacklist:

Change to the configuration folder for modprobe (the driver loader).

cd /etc/modprobe.d
Switch to a root shell.

sudo su
Create a new blacklist file that blacklists the module.

echo 'blacklist rc_core' > blacklist-rc-core.conf

Upon reboot, the blacklist should be in effect and Ubuntu should no longer try to load the offending module.


GRUB loads Ubuntu installation from wrong SSD

clone-ubuntu.sh Bash Script
Using clone-ubuntu.sh will quickly do what you want. Relevant code snippets to address your problem are included below but visit the link for the complete picture.
Clone like dd
Clone like dd but do it without rebooting into a Live USB. Virtual file systems are automatically skipped to save time and eliminate errors. The script can be rerun if need be (you are testing Ubuntu upgrades/updates for example) and is faster the second time:
rsync -haxAX --stats --delete --info=progress2 --info=name0 --inplace  \
      /* "$TargetMnt"                                                   \
      --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}

Update /etc/fstab
Using lsblk to ascertain source and target UUID's the changes are made automatically in the new clone:
# Update /etc/fstab on clone partition with clone's UUID
echo ""
echo "====================================================================="
echo "Making changes in: $TargetMnt/etc/fstab"
echo "        from UUID: $SourceUUID"
echo "          to UUID: $TargetUUID"
sed -i "s/$SourceUUID/$TargetUUID/g" "$TargetMnt"/etc/fstab

Update grub menu with new entries
Grub needs to know the correct UUID's and clone-ubuntu.sh automatically makes them for you:
# Update /boot/grub/grub.cfg on clone partition with clone's UUID
echo ""
echo "====================================================================="
echo "Making changes in: $TargetMnt/boot/grub/grub.cfg"
echo "        from UUID: $SourceUUID"
echo "          to UUID: $TargetUUID"
echo "Also change 'quiet splash' to 'nosplash' for environmental awareness"
echo "Suggest first time booting clone you make wallpaper unique"
sed -i "s/$SourceUUID/$TargetUUID/g" "$TargetMnt"/boot/grub/grub.cfg
sed -i "s/quiet splash/nosplash/g" "$TargetMnt"/boot/grub/grub.cfg

Summary
The relevant bash / shell commands are included so you can do the same steps manually for a successful clone that boots and operates as expected.


Zarafa doesnt provide packages for 11.10, but only for the Ubuntu LTS versions. The only way to run Zarafa on 11.10 would be to compile the packages yourself (that would be the opposite of easy).

For administrating your server you should take a look at Z-Admin (https://community.zarafa.com/pg/plugins/project/672/developer/zarq/zadmin) its an recently as final published web control panel from the Zarafa Community. There is also a pre built Ubuntu VMWare Image.


First time Ubuntu user looking fir a basic image editing software

Hey I also faced the same issue.
Polarr works fine for me. It should help you also.
You can download it from the Ubuntu Software or the polarr website.

https://www.polarr.co/editor/0

or use

sudo snap install polarr


Jdownloader

  JDownloader is open source, platform
  independent, and written completely in
  Java. It simplifies downloading files
  from One-Click-Hosters like
  Rapidshare.com or Megaupload.com - not
  only for users with a premium account
  but also for users who don't pay.

Here are really cool things about jdwonloader:

Completely Automates downloading
Scheduling downloads:  a rather nifty option whereby you can tell the program to, say, start downloading at 2 am in the morning or something like that.
Re-connects to defeat compulsory wait times
Supports a wide range of hosting services (and video sharing sites)
Captures multiple links on a webpage
Firefox integration: through the Flashgot Firefox extension. Jdownloader will provide the option to install this extension during its own installation process.

Installation

sudo add-apt-repository ppa:jd-team/jdownloader
sudo apt-get update
sudo apt-get install jdownloader


How do I get my Compiz window decorations back?

Seems you experience some instability with Compiz

Install Compiz Config Setting Manager (ccsm):

sudo apt-get install compizconfig-settings-manager

Open it. Preferences →  Profile & Backend tab: Reset to Defaults
Restart the session:

sudo restart lightdm

Now, to activate extra plugins, it's better to do that single plugin each time. In case you still facing same issue, switch to tty1 (terminal) Ctrl+Alt+F1 or open gnome-terminal then restart compiz:

compiz --replace --display :0 --sm-disable

To watch for errors.

libmetacity-private.so.0 has been updated to libmetacity-private.so.1 in ppa:eugenesan/ppa which I believe you are using from mentioned posts. Use Synaptic to force downgrade. or through CLI:

$ apt-cache policy libmetacity-private0a

libmetacity-private0a:
  Installed: 1:3.12.0-0~eugenesan~trusty5
  Candidate: 1:3.12.0-0~eugenesan~trusty5
  Version table:
 *** 1:3.12.0-0~eugenesan~trusty5 0
        500 http://ppa.launchpad.net/eugenesan/ppa/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     1:2.34.13-0ubuntu4 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

$ sudo apt-get install --reinstall libmetacity-private0a=1:2.34.13-0ubuntu4

It may fix decorator problem. BTW, that PPA brought many issues for you, why you are keep it on. Better to disable it when you don't need it, and make only selective upgrade from it.


Can mount SMB share using nautilus but not using smbclient

[1] Edit /etc/samba/smb.conf

[2] Place a # sign in front of smb ports = 445 so that it looks like this:

#smb ports = 445

This will make it to samba does not read that line and it will default to using ports 445 and 139.

[3] Restart the smbd service:

sudo service smbd restart

  SHouldn't I see my folders?

smbclient -L only lists the shares available on the server - and you have one named Public

  How should I mount this?

smbclient //192.168.0.3/Public

You will end up at a command prompt: smb: \>

Enter  ls to get a listing of the contents of Public and quit to close the connection.


How to get all the mac address from captured package?


System settings / Sound test fails to produce sound ubuntu 16.04

To solve the problem I used:

sudo apt-get remove unity-control-center

to remove the Unity Control Centre and then used:

sudo apt-get install unity-control-center

to reinstall it again.

After this process the "Sound Test" works perfectly.


What login manager does Lubuntu use and how can I configure it?

Lubuntu (since 18.10 with LXQt) uses SDDM.
Refer to the Lubuntu manual for some configuration options.
The manual page will tell you

There is no graphical application to do this currently.

(there is a means via KDE, but that will pull in a lot of KF5 & other Plasma components, which is why Lubuntu, which aims to be light (the L in LXQt) does not mention that).
The default wallpaper link (wall.png) can be found in
/usr/share/sddm/themes/lubuntu/
guiverc@d960-ubu2:/usr/share/sddm/themes/lubuntu$   file wall.png
wall.png: symbolic link to ../../../lubuntu/wallpapers/lubuntu-default-wallpaper.png

so you can just change that too :)


The dependency is not within the packet tracer. I guess you need to download "libpng12-0"
I had to download it to get it installed. I am new too so don't have much idea. I downloaded packet tracer 7.2.1 from Here


Where does software installer look for application icon

Ubuntu Software gets the metadata and icon from Appstream.

AppStream is a cross-distro XML format to provide metadata for software components and to assign unique identifiers to software.

How to get your package data into appstream


How to set gxmessage to run at login, and make exit codes trigger events

This is the answer I came up with all by myself, after hours and hours of research. Posted here in the hopes that it will help others who find themselves in a similar situation.

#!/bin/bash

# This script is to set terms of use for this computer and force logged in guest to accept terms.
# If done correctly, this script will log the user out in the event that the terms are not accepted.

gmessage -fg red -bg black "   This is a public terminal. Any use must be suitable for eyes of all ages. Failure to comply will result in your immediate removal from the property without any refund or discount." -center -title "Terms of Use" -default "Accept" -center -buttons "Accept":0,"Decline":1>/dev/null

case $? in
0)
gmessage "   Enjoy our public terminal. :)" -center -title "Thank you!" -buttons "I will!":2;;

1)
(killall -u super8guest);;

esac

case $? in

2)
gmessage "Click here when you are finished." -center -title "Cleanup" -buttons "Done":3;;

esac

case $? in

3)
(killall -u super8guest);;

esac

If anyone has ideas on how to pretty up the code, or ways to make it work better, please don't hesitate to share. I'm still learning.


Opera in 16-04 Missing Opera button to set preferences

The page you are looking at on the screen-shot is an old version of Opera with a totally different user interface.

The Opera version you are using does have a button in most desktop environments, but in Unity, which is what you are using, there are regular menus instead. Hover with the mouse over the title ("Getting started with Opera - Opera"), and the menus will be revealed.


If I get Ubuntu, can I still have Windows 7 on my HP Pavilion i5 DV6 Laptop?

You can use Wubi to install it or to make dual boot menu . Go to >>>  http://www.ubuntu.com/download/desktop/windows-installer


How can you tell the version of Ubuntu on a system in a .sh (bash) script?

Var=$(lsb_release -r)
echo "$Var"

Should do the trick.

For the numeric portion only add this:

NumOnly=$(cut -f2 <<< "$Var")
echo "$NumOnly"

The lsb-release variables file

/usr/bin/lsb_release is a Python script. It's a short script that serves as a good introduction to the python language. As others mentioned, a shorter way to get the version number only is with lsb_release -sr.

The /etc/lsb-release file defines environmental variables with the same information provided by the lsb_release -a command:

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"

You can include these environment variables at anytime using . /etc/lsb-release. To test in your terminal:

$ . /etc/lsb-release

$ echo $DISTRIB_RELEASE
16.04

$ echo $DISTRIB_DESCRIPTION
Ubuntu 16.04.6 LTS


Unable to change any config in Ubuntu 14.10

I would create a new user, and see if they have the same problem.   Just a guess here I think it may be a config issue.

Since it does not re-appear with a new user it's a config file somewhere.   I would google resetting (insertyourguihere) to defaults and see what that does.  If you had a highly customized desktop or something like that bear in mind you will lose your desktop tweaks and it will be back to where you started to build from.  Guessing one of the unity/gnome kidz may answer that better.....


Unable to find Remote Desktop icon in System->Preferences

In 12.04 it's called 'Desktop Sharing' if you're searching for it from the Ubuntu dash, or you can access the same setup dialog from a terminal by typing vino-preferences.


Data extraction from a text file using bash

You don't need a script for such a simple thing. You can use awk:

awk '$2 ~ "^[0-9][0-9]*$" { print $2 }' file.txt | head -n -1 | awk '{print}' ORS=',' | sed 's/,$/\n/'

Some explanations:

awk '$2 ~ "^[0-9][0-9]*$" { print $2 }' file.txt - print from the file.txt only the fields which are numbers.
head -n -1 - remove last line / last number.
awk '{print}' ORS=',' - concatenate all lines in one single line, each number separated by ,.
sed 's/,$/\n/' - replace last , with a newline character.

Or, shorter:

awk '$2 ~ "^[0-9][0-9]*$" { print $2 }' ORS=',' file.txt | sed 's/,[0-9]*,$/\n/'


Is it possible to start gnome-terminal always in fullscreen mode without menubar?

gnome-terminal --full-screen does what you want, although it is more keypresses than launching gnome-terminal and then pressing F11 to enter fullscreen mode.

You might, of course, create a wrapper binary called gt or whatever name you prefer:

#!/bin/sh
exec gnome-terminal --full-screen "$@"

Place it in your ~/bin directory and give it executable permissions.


How to backup a system with whole disk-encryption?

If you have whole-disk encryption, then just boot the system in the usual way, including unlocking the disk.  Then make a backup using say duplicity, using gpg so that it's encrypted on the destination machine.

There is not much point trying to backup the raw encrypted partition.


how to keep ubuntu on and unlocked while closing the laptop lid?

Go to System Setting -> Brightness and Lock and turn Lock off, turn the time delay of lock to Never just to be sure.


Sharing internet connection over Bluetooth from Desktop to Android

There is an option in the Windows smartphones since 5.1 edition of Windows mobile, that allows you to use your Desktop or laptop's Internet via USB, but can't able to find this option in Android (without wifi), of course you can use via wifi, but I am looking for similar sort of option either blue-tooth or USB means.

It is possible I believe so. Lets see , I am looking forward, fingers crossed. :)


NetBeans 8.1 not starting up on Ubuntu 16.04

I had the same problem when attempting to use Netbeans 8.1 with Java 9. If java -version says 1.9 you can downgrade to 1.8 something like this:

# Install Java 8 if you don't already have it.
sudo apt install openjdk-8-jdk

# Switch to Java 8
sudo update-alternatives --config java

# Attempt to run Netbeans again.
netbeans


Install Pepper Flash Plugin instead of Adobe Flash

sudo apt-get install pepperflashplugin-nonfree


Use mkusb to restore your USB drive

sudo add-apt-repository universe

(use above command only on Stock Ubuntu)

sudo add-apt-repository ppa:mkusb/ppa
sudo apt-get update
sudo apt-get install mkusb mkusb-nox usb-pack-efi
mkusb

All of these commands will install and start mkusb. It's a pretty intuitive utility. Make sure to read the complete Community Wiki of mkusb before diving into it

I read your previous question, and it's known to happen, and it has also happened to me in the past. Don't worry, your USB stick isn't lost


This should fix ugly fonts in Eclipse/Netbeans/Jetbrains:

sudo apt-get remove fonts-unfonts-core

Best,
M


Try these commands on terminal,

sudo rm -Rf /var/lib/apt/lists/*
sudo apt-get update


Is there a way to install Ubuntu (specifically with Gnome) and not get all of the software that comes along with it?

From the Ubuntu minimal CD installation we will be asked what we are going to install.

On booting the minimal ISO choose Install

Answer several question regarding locale, user, keyboard etc.
Select from a list what to install

We can choose a complete desktop environment from the list above but then all recommended packages for that DE will also be installed.

Selected nothing from above to reboot to a command line but with fully supported networking and package management. From there we can further fine-tune our individual installation (e.g. install just a minimal GNOME shell).


It seems you do not have lzma. Install it using this command

sudo apt install lzma-dev


If I boot Ubuntu from dvd on windows 7 will I have to keep changing the bios whenever I want to switch between OS's

You will boot to your main OS on hard drive if no bootable CD/DVD is present in the machine. You can also check order of booting devices in your BIOS. The boot sequence than tries them in the order specified there until it finds some bootable medium.


Configuring Kubuntu to avoid mouse moving off the right edge of the screen

I found an answer elsewhere. Just replace the top part of the xorg.conf with this. Basically placing the other screen disjointed removes the ability for the mouse to traverse edges:

Section "ServerLayout"
    Identifier     "aticonfig Layout"
    Screen      0  "aticonfig-Screen[0]-0" 0 0
    Screen         "aticonfig-Screen[1]-0" 2000 0
EndSection


How can I hide Desktop Icons with Ubuntu 20.04 without additional programs?

Search for extension app
Find Desktop Icons in the list of installed extensions
Turn off the toggle.

Done!


How to define the path to MPICH for SSH?

Your command does not work because the redirection of the output (>/>>) is not performed by sudo. There are several ways to solve this. For example:

You can use pipe (|) and performed by sudo tee command with --append option:

echo /home/mpiuser/mpich1/bin | sudo tee -a /etc/environment

Another approach is to run the entire command as sudo:

sudo bash -c 'echo /home/mpiuser/mpich1/bin >> /etc/environment'

In result the content of /etc/environment will looks something like:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
/home/mpiuser/mpich1/bin

References:

Cannot echo "hello" > x.txt even with sudo?
When using sudo with redirection, I get 'permission denied'
How do I use sudo to redirect output to a location I don't have permission to write to?

EDIT 1:

However I think this new line in /etc/environment will do nothing by itself. To have some meaning this "path" must be appended to the value of $PATH envvar.

Ubuntu Documentation says that:

  Variable expansion does not work in /etc/environment.

So to append /home/mpiuser/mpich1/bin to the value of $PATH, via single command, you can use this one:

cat /etc/environment | sed 's/\"$/:\/home\/mpiuser\/mpich1\/bin\"/' | sudo tee /etc/environment

Where: (1) cat /etc/environment will print the content of the file; (2) sed '...' will replace the last quote mark (") with :/home/mpiuser/mpich1/bin"; (3) sudo tee /etc/environment will rewrite the file.

In result the content of /etc/environment will looks something like:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/mpiuser/mpich1/bin"

Please, scroll to the end.

References:

linux + sed - replace only the right most side char of string

EDIT 2:

I did a little research and found few advices like this:

  However, if you need to set that environment variable for all users, I
  would still not recommend touching /etc/environment but creating a
  file with the file name ending in .sh in /etc/profile.d. The
  /etc/profile script and all scripts in /etc/profile.d are the
  global equivalent of each user's personal ~/.profile and executed as
  regular shell scripts by all shells during their initialization.

And this:

  Please avoid modifing system files. Instead you should place an
  executable script in /etc/profile.d (scripts in here got executed
  for every user) to change $PATH value.

According to these advises, let's suppose that you want to create a file named mpich-path.sh which is placed in the directory /etc/profile.d/. This can be done by the command:

echo 'export PATH="$PATH:/home/mpiuser/mpich1/bin"' | sudo tee /etc/profile.d/mpich-path.sh

In result the content of the new file /etc/profile.d/mpich-path.sh will looks like this:

export PATH="$PATH:/home/mpiuser/mpich1/bin"

Logout and login back into the system and type echo $PATH to check the result.

EDIT 3:

I don't know about the other steps in the manual that you have follow, but apart from step 11, step 10 also does not seem completely clear.

This part:

export PATH=/home/mpiuser/mpich1/bin:$PATH    # assigns a new value and exports the variable
export PATH                                   # exports the variable

must be:

PATH=/home/mpiuser/mpich1/bin:$PATH           # assigns a new value
export PATH                                   # exports the variable

or just:

export PATH=/home/mpiuser/mpich1/bin:$PATH    # assigns a new value and exports the variable

And it will produce the same result as step 11. So this part is unnecessary.

The new thing here is this part:

LD_LIBRARY_PATH="/home/mpiuser/mpich1/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH

But, maybe, it can be included into the file - /etc/profile.d/mpich-path.sh - who we created above.


mdadm: error opening /dev/md0: No such file or directory

after doing some more digging I found this error (a triple-entry for md0) in mdadm.conf.

# This configuration was auto-generated on Fri, 06 Mar 2020 22:24:51 -0800 by mkconf
ARRAY /dev/md0 metadata=1.2 name=nas:0 UUID=6e49ac17:91ff6793:a755436d:56c8a49c

ARRAY /dev/md0 level=raid1 num-devices=2 metadata=1.2 name=nas:0 UUID=6e49ac17:91ff6793:a755436d:56c8a49c
   devices=/dev/sda,/dev/sdb

ARRAY /dev/md0 level=raid1 num-devices=2 metadata=1.2 name=nas:0 UUID=6e49ac17:91ff6793:a755436d:56c8a49c
   devices=/dev/sda,/dev/sdb

so I modified it to

# This configuration was auto-generated on Fri, 06 Mar 2020 22:24:51 -0800 by mkconf
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=1.2 name=nas:0 UUID=6e49ac17:91ff6793:a755436d:56c8a49c
   devices=/dev/sda,/dev/sdb

and ran sudo update-initramfs -u and sudo mdadm --assemble --scan which resulted in:

mdadm: /dev/md0 has been started with 2 drives.

and now I go my drive back


HP Pavilion dv6 can't shutdown or reboot

I had this issue with my old dell on 10.04.

I found that I had to disable ACPI for the laptop to boot,
But in doing this is caused the video chip to fail to send the "safe to shutdown" signal, hence the laptop would just sit on the shutting down screen.

It wasn't hanging, it was just waiting.

I never actually found a solution, But upgrading to 11.04 fixed it.

So you could check to see what the system is trying to kill.
I'd say it will be the same thing.

Btw, What is the exact model of your laptop, as I am using the HP DV6-3079tx which is running fine.


Turned out to be a very simple fix.
The bash file was created on windows which caused it not to run. Created it locally and now it runs gin.


It is possible, but requires some knowledge. When you establish VPN connection, it basically changes your default gateway and all apps go through it. One way to overcome this is to have for example container (docker or LXD) which contains proxy and uses your original gateway and then you set firefox to use that proxy. Not trivial, but possible.


How to check whether dhcp is enabled or not in ubuntu 12.04

If you're looking for command line only, you can check for the presents of the dhclient process, using the ps command

ps ax | grep dhclient

In 12.04 the network configuration should be written out to /etc/network/interfaces so you can check that file for lines similar to:

auto eth0
iface eth0 inet dhcp

The Ubuntu documentation on networking may help you out too.


If you build your own computer you wouldn't get a UEFI, because there wouldn't be a operating system on it. But that's probably not what you meant.

You could buy a new hard drive for any computer and there wouldn't be a operating system on it, and therefor no UEFI.

This is a way to go around the UEFI problem.


Installing Xen Hypervisor on Ubuntu 14.04

dom0 really needs less then 4GB. During partitioning I recommend:

manual
root partition 4GB
no swap partition
leave the rest of the disk unpartitioned

Install the OS and then install XEN.

Add to /etc/default/grubthe following line:

GRUB_CMDLINE_XEN="dom0_mem=1024M,max:1024M dom0_max_vcpus=2"

Add a 512MB swap file in the local file system (e.g. /var/swap).

Partition the rest of the disk as you like. Ideally create another partition that fills up the disk, then use it as physical volume for LVM.


How to reduce initials of the console prompt

You can control the prompt in Bash (and Zsh) by setting the PS1 environment variable.
You may do this in your $HOME/.bashrc file, for example.
Example:
PS1='\u@\h:\w\$ '

or for your-user@pc use
PS1='\u@pc'

or go simple
PS1='$ '

Here's some of the magic tokens you can use.
\h : the hostname up to the first ‘.’
\H : the hostname
\u : your username
\t : time in 24hr format
\w : current working dir

You can apply colour codes too, should you wish.
EDIT: colour, bold etc.
ANSI escape sequences can be specified like \033[ then some numbers for bold and colours joined with ; then m and can be reset with \033[0m;
e.g. PS1='\033[31mxxx\033[0m ' would give you a red xxx as a prompt.
Very mini cheatsheet, replace 31 (Red) in the above with..

1;31 for bold red
1 for bold default colour
31;43 for red text (31) on yellow background (43). The second, background colour uses the same code as the foreground but +10
38;2;r;g;b where you replace r g and b with a value 0-255 for red green blue, e.g. 38;2;255;180;0 would set it to a nice orange

PS1='\033[31mxxx\033[0m ' would give you a red xxx as a prompt.
Please see an excellent answer at stackoverflow for a fuller list.


Mariadb not working just after install on Ubuntu 16.04

If you check mysql --version it should say something like:

mysql  Ver 15.1 Distrib 10.1.16-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Then you know you're indeed running mariaDB
then you can simply

sudo service mysql restart

and it should be all good!

Worth to lookup the file in /lib/systemd/system/mariadb.service to see that it uses mysqld.


$ find . -name '*.c' | grep 'stdlib.h'

This pipes the output (stdout)* from find to (stdin of)* grep 'stdlib.h' as text (ie the filenames are treated as text). grep does its usual thing and finds the matching lines in this text (any file names which themselves contain the pattern). The contents of the files are never read.

$ find . -name '*.c' | xargs grep 'stdlib.h'

This constructs a command grep 'stdlib.h' to which each result from find is an argument - so this will look for matches inside each file found by find (xargs can be thought of as turning its stdin into arguments to the given commands)*

Use -type f in your find command, or you will get errors from grep for matching directories. Also, if the filenames have spaces, xargs will screw up badly, so use the null separator by adding -print0 and xargs -0 for more reliable results:

find . -type f -name '*.c' -print0 | xargs -0 grep 'stdlib.h'

*added these extra explanatory points as suggested in comment by @cat


Where are packages downloaded by "apt-get download" stored?

If you are just downloading using apt-get the file is stored in the current directory.

From apt-get --help

download - Download the binary package into the current directory


How do I install programs in a Ubuntu 12.04 live cd or live usb?

If you have Internet connection you can download the soft that you want to and install it.
See the APT-GET guide.
If you shutdown the computer, this programs that you have been installed will not be the next time that you turn it. But there is a way to make a partition in the HDD or something like that (I never did that). See this question where are four answers about that.
If you don't have Internet connection there is another way to install soft. You have to download it from another computer to the USB and then install it to the off-line computer. See this answer.

Hope this helps.


Yes, Ubuntu will recognize your Windows install on the other drive and configure grub to boot it.  You can install grub to either drive ( there is a selector in the installer ), and it doesn't matter much as long as your bios is set to boot that drive.


What is the best laptop for ubuntu 11.10?

If I were you, I would select a computer from the Ubuntu Certified hardware page.

Then deselect the options that are not laptops. You will also find some feedback on Ubuntu Friendly.


Can't install git/perl on ubuntu 16.04 due to broken packages

I go with:

apt-get install -y --allow-downgrades perl-base=5.22.1-9

Seems to work.


Good answers so far, but I would also add that throwing a router in between your server and the rest of the internet probably isn't a bad idea unless you really have a compelling reason not to.  If nothing else it's like the door on your house/apartment/domicile/place-of-habitation -- it discourages people from wandering in and looking around, even if there is nothing for them to see.


I suggest:

sudo apt-get install xorg openbox

It is very light weight. Once installed, you can start the gui environment with

startx

and shut it down, returning to cli with

openbox --exit

But of course you can use other "desktop environment" metapackages instead of openbox and get a lot more bells and whistles, or alternately, there are other WMs like Openbox that have sufficient capabilities in and of themselves to be used as light weight DEs. They mostly have "box" in the name because they are derived from or inspired by Blackbox.

Added:

@sudodus Hi, nice to see another old nic from the other place. Yes, I should have mentioned fluxbox. I thought there were a bunch of SOMETHINGbox WMs, but I looked a bit & I guess it is just the 3. I'm going to try to insert a graph showing memory usage of some WMs. Lessee:

That doesn't show up for me. I'll leave the line. Maybe somebody can tell me what  I did wrong. Here is a link to the pic:

https://l3net.files.wordpress.com/2014/02/cmp-all4.png

The 3 'boxes are pretty similar. Blackbox isn't actively maintained, so that might be a concern. They're all pretty light. The pic only covers memory usage but I suspect the story on cpu load drive usage is similar. I'm guessing fluxbox probably has a few features Openbox doesn't. Both are in the repos.

You can try more than one at a time if you want, but you'll have to look up how to tell startx which to start. Probably in the startx man page. If you just install 1, you don't have to remember that; startx will do it for you.

I'd be careful NOT to install a "display manager" which would come with some of the more conventional "Desktop Environments" because it makes it a little harder to turn the GUI on and off. Still do-able if you really WANT a pretty graphical login screen but more trouble. As you can see from the pic, there are still lighter WMs, some of which ARE actively maintained, but the lighter ones can be more . . . not so much "challenging", let's say "awkward". Openbox and Fluxbox are more like conventional setups. I haven't tried all the lighter ones though. Might be a gem among them.

From a perspective of getting help with it, Openbox also has the advantage that a LOT of people use it as part of LXDE or Lubuntu. Fluxbox users on the other hand probably tend to be more sophisticated on average so maybe it evens out.


You have quite a serious problem.  The only official update server on your system seems to be the archive.canonical.com.  All other servers listed above have been placed there manually after the inital system installation.

The missing update server's name should be <country-code>.archive.ubuntu.com (for example us.archive.ubuntu.com) and it's not there.

You can try reconstructing /etc/apt/sources.list by following the instructions here for example or you can re-install your system.  There are several other places all over the internet where you can find similar instructions on how to reconstruct sources.list.


By increasing that mic volume meter in alsamixer we only turn on the soundcards loopback feature, that is it redirects the mic input to the sound output internally, this stream is not accessible for softwares. (AFAIK) (But it confirms that the hardware receives the sound.)

You should try to increase all Capture meters in alsamixer to the maximum and make sure they are not muted, after this make sure that in pavucontrol the correct device and port is selected, and the mic input is not muted there, then try recording.

If it still not works, then it is likely that the problem is somewhere lower in the driver.

What you could still try is installing a newer alsa, maybe this problem is solved in a newer version. Other than that there are some tweaking tools for alsa here. Docs for it here. With the hda-jack-retask thing you are able to change your microphone input to a line-in one (or similar things), but I don't know whether that will help.


How to increase connection numbers in wget?

wget -r -np -N [url] & wget -r -np -N [url] & wget -r -np -N [url] &
  wget -r -np -N [url]

Just repeat the wget -r -np -N [url] for as many threads as you need… Now given this isn’t pretty and there are surely better ways to do this but if you want something quick and dirty it should do the trick… Enjoy!
OR its better to do using following packages...

try axel. install axel
It is a fully fledged Command line based Downloader.
install axel and spawn download by axel -a -n [Num_of_Thread] link1 link2 link3 ... where '[Num_of_Thread]' is the number of parallel connections to create for each link you want to download.

-a just show an improved progress bar.

or you can use the aria2 :

aria2c -x 16 [url]
#          |
#          |
#          |
#          ----> the number of connections

http://aria2.sourceforge.net


Stop Ubuntuone-syncdaemon from running in background automatically

If you don't use Ubuntu One (Canonical's cloud service), you can just get rid of the entire suite by typing the following into the Terminal:

sudo apt-get purge ubuntuone-client

You can always get it again at a later point with all your files remaining if you want it back.


Segfault when scanning with Brother multifunction ADF scanner

I had the same problem and fixed it by following the advice from https://forums.linuxmint.com/viewtopic.php?f=51&t=329760, namely
sudo apt purge ippusbxd

More background here: https://bugs.launchpad.net/hplip/+bug/1871011
With that change, scanimage -h no longer gave the error message
scanimage: open of device brother4:bus2;dev1 failed: Invalid argument

And scanning with the ADF started working.
NB. It is odd that with my printer (MFC-L2750DW), the USB driver has the ADF options (after it starts working), but the Wifi driver does not.


How do I get back to nano after hitting Ctrl-Z if I have no shell prompt (in Matlab session)

If it's the only backgrounded process entering % followed by Return should return you to nano.

That said, fg should always work. Even when you have more than one job, it should bounce you back to the newest one.


Connect to WiFi network through Ubuntu terminal

Okay, I'm going to try and answer your question, even though there is no terminal output included in your question.

The command ifconfig wlan0 does not turn on your wireless card. It gives you information about your wlan0. To turn on your wireless card, you would enter ifconfig wlan0 up. Although, it's not always wlan0. To find out the name of your wireless card, type iwconfig, and look at the row that has some information in it, not 'no wireless extensions'.
To be able to run the commands ifconfig wlan0 up, iwconfig wlan0 essid WIFI_NETWORK_HERE key PASSWORD_HERE and dhclient wlan0, you need to be root. So, you have to put the word sudo before those commands (unless you're already logged in as root).
The password in the command iwconfig wlan0 essid name key password should be in hexadecimal. If you want to type the ASCII password, you would use iwconfig wlan0 essid name key s:password.
The command iwconfig wlan0 essid name key password only works with access points that use WEP as encryption. If the access point uses WPA/WPA2, you'll have to use another method to connect, found here: How do I connect to a WPA wifi network using the command line?

Also, might I ask, is there a reason why you're trying to connect to a WiFi network through command line? Unless you're experimenting of course.


How to Roll back newly applied LTS Maintenance Upgrade to the Previous Version

Note that the point releases of 10.04 are just roll-ups of the packages from the security and updates archives.  If you have been regularly applying the updates to your server (which is the recommended behaviour), you are probably already at the new point release.

If you have upgraded to a package that is causing you problems, you can downgrade a package.  You can discover what versions of a package are available with the following command:

apt-cache policy PACKAGE_NAME

Note the version numbers it lists for each archive.  You can install a specific version of a package with the following command:

sudo apt-get install PACKAGE_NAME=VERSION_NUMBER

You will be warned that you are downgrading the package.


I figured it out by my self.
Since I had stable internet I was able to use sudo apt-get install --reinstall ubuntu-desktop and reboot. Then I did all kinds of update, upgrade, dist-upgrade and install -f. After another reboot I followed the steps under Issues. An everything seems to be as before.


Setting up vnc server and no physical display : Ubuntu 16.04 LTS

Foremost, install x11vnc:

sudo apt install x11vnc -y

To create the password, run the following command (please do not use 12345678).

sudo x11vnc -storepasswd 12345678 /etc/x11vnc.pass

To secure the password, run the commands:

$ sudo chmod 744 /etc/x11vnc.pass
$ sudo chattr +i /etc/x11vnc.pass

Edit and append to the bottom of lightdm configuration file as such:

sudo vi /etc/lightdm/lightdm.conf

Add:

# vnc server configuration. This is one big line.

[SeatDefaults]
greeter-setup-script=/usr/bin/x11vnc -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -xkb -nowcr -repeat -rfbauth /etc/x11vnc.pass  -forever -bg -rfbport 5900 -scale 1270x710 -o /var/log/x11vnc.log

Restart lightdm

sudo service lightdm restart

Make sure x11vnc is running

pgrep x11vnc

From the connecting computer, do this,

sudo apt-get install xtightvncviewer -y
vncviewer

Enter the IP Address of x11vnc server and connect.

Please do not use 12345678 as password.


Use keyup to have xdotool "release" your custom hotkey before simulating hitting the Home key, as in:
xdotool keyup ctrl+Left key Home

Without the "keyup", your custom shortcut key may/will still be in effect while xdotool is hitting Home.


HP CP2025 prints off center, how do I fix it?

I have the same problem with both of my Brother printers:  HL-5370DW and MFC-6490CW.

This issue is acknowledged in the Brother FAQ, but as of yet no resolution:

http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/faq_prn.html#f00107

which suggests that the issue is not printer specific.


Please advise which partitions I can delete

As mikewhatever said, only dev/sda3 seems to be linux related. If you don't have any important data on the drive it would be easier and quicker to just install ubuntu over the existing operating systems.

If you don't have a bootable disk/usb, boot into one of the working operating systems and burn one.

If you have a bootable usb or disk, just boot off of it, install Ubuntu and make sure to check the "Erase disk and install Ubuntu" option.

If you do want to save some of the data just copy it over to a flash drive or external hard drive.


Locked out of Ubuntu 14.04 account after moving /home to a different partition

Boot into recovery mode and you can edit /etc/fstab from the command prompt.


Getting internet browsing history from shell

Example for Firefox:

The history can be found in a database table in places.sqlite in SQLite format 3:

$ file ~/.mozilla/firefox/rsbxl7fx.default/places.sqlite
~/.mozilla/firefox/rsbxl7fx.default/places.sqlite: SQLite 3.x database, user version 26

rsbxl7fx.default

Depending on your profile

To view the history you need to install sqlite3:

sudo apt-get install sqlite3

Start sqlite3 with

sqlite3 ~/.mozilla/firefox/rsbxl7fx.default/places.sqlite

and list eg. all tables:

sqlite> .tables
moz_anno_attributes  moz_favicons         moz_items_annos
moz_annos            moz_historyvisits    moz_keywords
moz_bookmarks        moz_hosts            moz_places
moz_bookmarks_roots  moz_inputhistory

Or the history with:

sqlite> SELECT datetime(a.visit_date/1000000,'unixepoch') AS visit_date, b.url FROM moz_historyvisits AS a JOIN moz_places AS b ON a.place_id=b.id WHERE 1 ORDER BY a.visit_date ASC;

Example for Chrome:

The History is a binary file in SQLite format 3:

$ file ~/.config/google-chrome-beta/Default/History
.config/google-chrome-beta/Default/History: SQLite 3.x database

google-chrome-beta

Depending on your version of Chrome
Default

Depending on your profile

To query the database, Chrome must be completely closed. Or you have to  create a copy of the file and use that copy.

To view the history you need to install sqlite3:

sudo apt-get install sqlite3

Start sqlite3 with

sqlite3 ~/.config/google-chrome-beta/Default/History

and list eg. all tables:

sqlite> .tables
downloads             meta                  urls
downloads_url_chains  segment_usage         visit_source
keyword_search_terms  segments              visits

or to see all URLs:

sqlite> SELECT * FROM urls WHERE 1;

For all examples; alternatively, a GUI may be used:

sqlitebrowser

sudo apt-get install sqlitebrowser

and start with:

sqlitebrowser ~/.config/google-chrome-beta/Default/History
sqlitebrowser ~/.mozilla/firefox/rsbxl7fx.default/places.sqlite

sqliteman

sudo apt-get install sqliteman

and start with:

sqliteman ~/.config/google-chrome-beta/Default/History
sqliteman ~/.mozilla/firefox/rsbxl7fx.default/places.sqlite


12.04.2 is the prefered OS on this Laptop as it supports all the Hardware and UEFI boot.ASUS themself ship their Laptops with this Version.

12.10 works fine, but so will 12.04.2 as both use the same kernel.

13.04 with kernel 3.8 is full of bugs and not a good Option at all ( on any machine ) .

Grub commandline Settings to try for this machine :

make FN-Keys work :  "acpi_osi=" or "acpi_osi=Linux"

save power for GPU : "pcie_aspm=force"

for kernel 3.8+ : "acpi_osi=!Windows 2012"


How to configure version control for Qt?

Version Control System (VCS), Revision Control or Source Control are software systems used to track changes in files, usually used in software development.

How it works

Usually the files are hosted in a repository (a directory tree for each project). A developer A writes a software system and uses VCS to track the file changes. A developer B wants to add a new feature to the software system or fix a found bug. A common development process goes like this:

Developer B will want to get the sources in order to work on them
Developer B works on new features on his copy of the repository
Developer B commits his work locally
Developer B completes his job and commits the changes back to the remote (original) repository

Note this is one way of doing things, there can be various ways such as:

Working a one man project (solo) and keeping the repositories locally.
Working in a group project with a central remote repository
Various other flavors

For Bazaar you can check the documentation here and decide what works for you.

Do I Have Bazzar in my System?

You can check if Bazaar is installed in your system by issuing the following in terminal which bzr, if Bazaar is installed you will get: /usr/bin/bzr else you will have to install it with sudo apt-get install bzr

Potential Suspect

From the screenshots you provided it seems that you do not have QT development framework installed in your system (qmake is absent). You can get the Qt framework from the official site or through the Software Center (search for qt-sdk), it will yield the following:

or sudo apt-get install qt-sdk, additionally you can install the documentation.


Boot from live media (e.g. an Ubuntu installation USB stick), mount your root filesystem and move your .bashrc away for the moment, then reboot into your normal system.
Personally I always set a root password so I am able to recover from exactly this situation. I don't usually work with the root account, but it's there in case I need it (usually when I did something really stupid).
Judging from the error message, you might have run into this problem:
Ubuntu 20.04 Failed to Set MokListRT: Invalid Parameter


Ubuntu 16.04 (and later)

Sigil is in official repositories for Ubuntu 16.04, so you can install it without adding any 3rd party PPA:

sudo apt-get install sigil


How to make KDE Applications' Toolbars Dark in Ubuntu?

If you are planning on customizing the toolbar colors, you can always try to modify your theme.
In the terminal, you can run:
sudo nautilus

This will allow you to get root privileges for your file explorer.
In /usr/share/themes and /usr/share/icons there are themes and icons to give you an example of how to make your own.
I recommend copying these files and editing them to see their effects.
Don't forget to use the Unity Tweak Tool to try out the changes you've made.
If you don't like your changes, you can always revert back to the original with the tweak tool.
Good luck!


Regarding your mistake of changing the permissions in /usr, there are no easy way to recover. There are some hints in the answer to this questions though:

How can I recover from chmod -R a-wrx / command?

To track down what is eating space, you can use `du':

  Summarize disk usage of each FILE, recursively for directories.

Start in the file system root and dig your way down.

cd
sudo du -d 1 2>/dev/null | sort -nrk 1

Arguments:

-d 1, du will only show next level of directories and their total size
2>/dev/null, redirect stderr to /dev/null, basically hide errors
|, pipe output to program `sort'
-nrk 1, sort numerical (n), reverse (r), sort on first "column" (k 1)

This will give you output in the line of:

$ sudo du -d 1 2>/dev/null | sort -nrk 1
5423982 .
3037236 ./usr
1113212 ./var
640304  ./home
411632  ./lib
93828   ./opt
92402   ./boot
13008   ./etc
11660   ./sbin
9440    ./bin
1076    ./run

This tells you that the biggest "space thief" is /usr, go to that directory and repeat your steps to find the biggest thief in that directory.


Create a new pair of ssh key before deploy charm

Would it be possible to have the install hook generate some new keys if the charm config value that store the keys are not set?

That way the first unit of the service that gets deployed runs the install hook, notices that the config value is empty, generates new keys, and stores the key in the charm config.

The second unit that is deployed during the install hook looks at the charm config and get the key info that the first unit created.


How do you set the default speaker on Ubuntu 20.04 focal

Maybe running this command with sudo could work?


This may help you.
This is in accordance with the newer version of Ubuntu and life.
This is Master PDF Editor. You can use it crop, add some stuff, etc.

Example:
This is before

This is after ctrl + k


You don't need to make any monetary subscription to access the Ubuntu One music store.  All you need is a free Ubuntu One account (of course, if you want to purchase any songs on the store you'll need a credit card).

The range of music available will depend on where in the world you're located.  The range should be pretty good if you are in the US, UK or most of Europe.  Outside of those regions the range is a lot smaller, lacking most of the content from major labels.

The subscription music streaming plan is separate from the music store, and lets you stream any music you place in your Ubuntu One storage to a mobile phone.  It can stream songs you've bought from the music store, but can just as easily stream songs you've ripped from CDs locally.

Looking at it from the other end, while you can stream purchased music using the subscription plan, the subscription is not necessary to enjoy the purchased music on the desktop (or any other system you copy the purchased music to: the purchases are DRM free).


Delete Ubuntu to free up space for computer restart properly

There are several things you can do. There is no need to immediately jump into a reinstall. You can (now that you're in the command prompt) delete the various directories which are full of photos and other un-needed files. To do so you'll need to navigate to those directories and run the delete command.

This falls under the classification of "Basic Bash" but you'll mainly be using cd, ls, and rm. For the example we'll assume you've placed the Photographic content in your "Pictures" directory.

cd ~/Pictures
ls
rm *.jpg

That will go into the Pictures directory, show a list of all the files, then it will delete all jpg files - the last part of the command will very depending on your file formats. If you wanted to delete all files in that directory just use an * if you wanted to delete all files and sub-folders you'll need to use rm -r * Be very careful when using the rm command it's permanent

If you are feeling a little more impatient you can just remove the entire Pictures directory like so:

cd ~
rm -rf Pictures

At any time you can check the diskspace you have available on your machine by typing df -h which will print out relevant diskspace information. Once you've cleaned space off you can run several other commands to help clear up diskspace:

sudo apt-get clean

Which will clear your package cache and free up additional diskspace.

Issue a restart of your computer and everything should come back up. If not you'll likely have some corrupt configurations on your machine and need to reinstall packages.


I've figured it out myself: you should use

mpd_music_dir = "/home/sunqingyao/Music"

instead of

mpd_music_dir = /home/sunqingyao/Music

The quotation marks mustn't be omitted.


How to install Unison 2.40 on Ubuntu 16.04 xenial (to resolve "Fatal error: Received unexpected header")

I found a deb file here, which is for trusty, but aparently works anyway, downloaded the 64 bit version and used

sudo dpkg --install ./unison-gtk_2.40.102-2ubuntu1_amd64.deb

to install. Based on ridgy's answer I use unison-2.40-gtk to invoke unison for synching with my RaspberryPis


I can't start a session after powering down in middle of a Ubuntu 16.04 Upgrade

First I suggest fixing whatever hardware issue caused the computer to shut down before.  If it's a clogged fan then clean it out.  Do not attempt to repair your Ubuntu installation before you do this.  You already have a damaged installation, if a shutdown occurs during repair it may render the system unrepairable (if it isn't already)

I would then suggest trying to boot your computer from an external Ubuntu DVD of the same version that your system was before the attempted update.  Once this is done, the first thing you need to then do is make a backup image of your hard drive.  It's important when trying to repair a broken system to make a baseline you can go back to in case repairs do not go well.

Then, finally, to make the repairs you can mount the affected partition, chroot to it, and then see if apt can finish the upgrade.

Here is step by step what I would do.  In this I'm assuming you know enough about your computer to know (or find out) what partition(s) Linux is on and have a basic understanding of tools like apt and dd.  If this isn't the case, then attempting this may be beyond your current knowledge and it may be beneficial to get outside help.  There are too many variables to try and give every command you should do to fix things explicitly.

Step by step, I would:

Fix the hardware problem.  If whatever caused the shutdown in the first place can't be fixed, attempting to repair the installation is more dangerous than leaving it in it's current state of brokenness.
Download and burn a live DVD of the same version of Ubuntu you were using before the attempted upgrade.
Boot off that DVD and make an image of your hard drive.  As stated above, it's important to have a baseline you can go back to if anything fails.  You will need an external drive large enough to hold a compressed image of your drive.  If you don't have one, then this is great incentive to get one.  If your hard drive is /dev/sda, then once you are booted into the live DVD and have a terminal you can:

$ sudo dd if=/dev/sda bs=1024k | gzip -c > sda.img.gz

Adjust as needed for what device your hard drive is.
Once you have a backup, try and mount your Linux installation so that it can be chroot'ed into.  Some Linux installations have separate partitions for /boot, /home, etc.  If you do then they all need to be mounted.  For example, if /boot is /dev/sda1 and root is /dev/sda2, then:

$ sudo mount /dev/sda2 /mnt
$ sudo mount /dev/sda1 /mnt/boot
$ sudo mount --bind /dev /mnt/dev
$ sudo chroot /mnt
# mount -t proc proc /proc
# mount -t sysfs sys /sys
# mount -t devpts devpts /dev/pts

Again, adjust for the particulars of your installation.  Linux may be on a different partition.  There may be no /boot.  There may be a separate /home partition.  Whatever the case is, mount root under /mnt, then everything else as /mnt/whatever until you chroot.
Once you are chroot'ed into your Linux partition, you are essentially live on your old installation.  The following may be enough to get you back up and running:

$ update-initramfs -k all -c
$ update-grub

That will update the boot system and may be enough to get you bootable again.  However, you still want to go on to
Use dpkg to reconfigure your installed packages and apt to complete the upgrade:

$ dpkg --configure -a
$ apt update
$ apt upgrade

This will have dpkg try and fix whatever is currently broken in your packages, then gets apt to update your repositories and then finish the upgrade.

The above is, I think, your best bet for getting up and running in a partially automatic way.  Usually apt is pretty good at fixing anything it's left undone if it's been interrupted before.  If this doesn't work, then your system is likely beyond the means of being helped by a person answering a question here, and will need the personal attention of someone with a deeper knowledge of Linux in general and Debian-esque distributions in particular.


Are Unity desktop environment and device convergence tied together?

The reason Canonical is scrapping Mir and Unity 8 is cutting costs. According to rumors, canonical lost 300 million pounds last year. Neither the phones nor the desktop has been making any profit and the desktop can be continued with Gnome 3, which will be a lot cheaper for the company. And apart from all personal preference, any desktop environment, compositor and display server could be used to make the most usable open source desktop in the world, as Mark put it.

Unity 8 was tightly integrated with Mir, it's whole point was to make convergence easy and beautiful. So if you want to discontinue Mir (in a time were systemd and pulse audio are finally accepted, this is probably the most hated piece of code on gods green earth) and you rip it all out of Unity 8, you end up with a useless brick and a lot of work is needed to make if function again. That would still be costly, so you'd have to scrap both of them. Then what would happen with Ubuntu Touch? It is built both on Unity 8 and Mir, so it would be fairly useless without them and it would loose its main selling point: Convergence.

Convergence has been the one reason why canonical started Mir, Snaps and the transition to Qt in Unity 8. And if you want to get convergence between phone and desktop, you have to push on both ends. So scrapping the phones and keeping Unity 8 and Mir does not make sense, Scrapping Mir and phones and rebasing Unity 8 to Wayland would be costly. So this decision had to be made.

Nevertheless Unity 7 will live on with 16.04 at least until 2021 and might even stay in the official repositories after that. Unity 8, now called Yunit, will be continued in a joint effort by UBports and yunit.io; UBports will also continue to support Ubuntu Touch, so not everything will be lost.

Now let's all take a moment to thank Mark Shuttleworth and the team at Canonical for all the amazing work they have done. We should not forget that they always have and will continue to provide all of us with a great free and open source operating system.


How to check if TRIM is working for an encrypted volume?

There is a way to test it answered at unix.stackexchange.com by frostschutz (this answer is his merit so thanks him), copied below:

"Create a test file: (not random on purpose)

# yes | dd iflag=fullblock bs=1M count=1 of=trim.test

Get the address: (exact command may have to differ depending on filefrag version)

# filefrag -s -v trim.test
File size of trim.test is 1048576 (256 blocks, blocksize 4096)
 ext logical physical expected length flags
   0       0    34048             256 eof
trim.test: 1 extent found

Get the device:

# df trim.test
/dev/mapper/something  32896880 11722824  20838512   37% /

With this set up, you have a file trim.test filles with yes-pattern on /dev/mapper/something at address 34048 with length of 256 blocks of 4096 bytes.

Reading that from the device directly should produce the yes-pattern:

# dd bs=4096 skip=34048 count=256 if=/dev/mapper/something | hexdump -C
00000000  79 0a 79 0a 79 0a 79 0a  79 0a 79 0a 79 0a 79 0a  |y.y.y.y.y.y.y.y.|
*
00100000

If TRIM is enabled, this pattern should change when you delete the file. Note that caches need to be dropped also, otherwise dd will not re-read the data from disk.

# rm trim.test
# sync
# fstrim -v /mount/point/ # when not using 'discard' mount option
# echo 1 > /proc/sys/vm/drop_caches
# dd bs=4096 skip=34048 count=256 if=/dev/mapper/something | hexdump -C

On most SSD that would result in a zero pattern:

00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00100000

If encryption is involved, you will see a random pattern instead:

00000000  1f c9 55 7d 07 15 00 d1  4a 1c 41 1a 43 84 15 c0  |..U}....J.A.C...|
00000010  24 35 37 fe 05 f7 43 93  1e f4 3c cc d8 83 44 ad  |$57...C...<...D.|
00000020  46 80 c2 26 13 06 dc 20  7e 22 e4 94 21 7c 8b 2c  |F..&... ~"..!|.,|

That's because physically trimmed, the crypto layer reads zeroes and decrypts those zeroes to "random" data.

If the yes-pattern persists, most likely no trimming has been done."

This is my automated script:

#!/bin/bash
#
# This script is provided "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.
#
# License GPL2
#
# by desgua 2014/04/29

function CLEAN {
cd "$pasta"
[ -f test-trim-by-desgua ] && rm test-trim-by-desgua && echo "Temp file removed"
echo "Goodbye"
exit 0
}

trap 'echo ; echo "Aborted." ; CLEAN; echo ; exit 0' INT HUP

if [[ "$(echo $USER)" != "root" ]]; then

read -n 1 -p 'Become root? [Y/n]' a
    if [[ $a == "Y" || $a == "y" || $a == "" ]]; then
        sudo $0 $1
        exit 0
    else
        echo "
        This script needs root privilege.
        "
        exit 1

    fi

fi

name=$(echo $0 | sed 's/.*\///')
if [ $# -ne 1 ]; then

echo "
Usage: $name /folder/to/test/

"
exit 1
fi

pasta=$1

read -n 1 -p 'Use fstrim? [y/N]' a
if [[ $a == "Y" || $a == "y" ]]; then
    fs=1
fi

method=
while [[ "$method" != "1" && "$method" != "2" ]]; do
read -n 1 -s -p 'Choose a method:
[1] hdparm (will fail in LUKS on LVM)
[2] filefrag (warning: you may have to force quit - close the terminal - in some cases of success trim if you see an output that never ends)
' method
done

function SDATEST {
disk=$(fdisk -l | grep /dev/sda)
if [ "$disk" == "" ]; then
echo "
fdisk did not found /dev/sda
"
exit 1
fi
}

function TEST {
echo "Entrying /" ; echo
cd $pasta
echo "Creating the file test-trim-by-desgua at $pasta" ; echo
dd if=/dev/urandom of=test-trim-by-desgua count=10 bs=512k
echo "Syncing and sleeping 2 seconds." ; echo
sync
sleep 2

hdparm --fibmap test-trim-by-desgua
lbab=$(hdparm --fibmap test-trim-by-desgua | tail -n1 | awk '{ print $2 }')

echo "As you can see, the file was created and its LBA begins at $lbab" ; echo

echo "Syncing and sleeping 2 seconds." ; echo
sync
sleep 2

echo "Removing file test-trim-by-desgua" ; echo
rm test-trim-by-desgua

trap 'echo ; echo ; echo "Aborted." ; echo ; exit 0' INT
echo "Syncing and sleeping 2 seconds." ; echo
sync
sleep 2

if [[ "$fs" == "1" ]]; then
    echo "fstrim $pasta && sleep 2" ; echo
    fstrim $pasta
    sleep 2
fi

echo "This is readed from sector $lbab: "
hdparm --read-sector $lbab /dev/sda

pass=$(hdparm --read-sector $lbab /dev/sda | grep "0000 0000 0000 0000")

if [[ $pass == "" ]]; then
    echo "
Trim failed...
You should see only 0000 0000 0000 0000 ...
"
else
    echo "Success!!!"
fi
exit 0

}

function LUKSTEST {
# Reference: https://unix.stackexchange.com/questions/85865/trim-with-lvm-and-dm-crypt#
echo 1 > /proc/sys/vm/drop_caches
cd $pasta
echo "Creating a \"yes\" file."
yes | dd iflag=fullblock bs=1M count=1 of=test-trim-by-desgua

#position=`filefrag -s -v test-trim-by-desgua | grep "eof" | awk '{ print $3 }'`
position=`filefrag -s -v test-trim-by-desgua | grep "eof" | sed 's| ||g ; s|.*255:|| ; s|\.\..*||'`
[[ "$position" == "" ]] && echo "Could not find the position of the file. Are you on a LUKS on LVM?" && CLEAN;

device=`df test-trim-by-desgua | grep "dev/" | awk '{ print $1 }'`

yes=`dd bs=4096 skip=$position count=256 if=$device | hexdump -C`

echo "In the next line you should see a pattern like:
00000000  79 0a 79 0a 79 0a 79 0a  79 0a 79 0a 79 0a 79 0a  |y.y.y.y.y.y.y.y.|
$yes
"

if [[ "`echo "$yes" | grep "y.y.y"`" == "" ]]; then
    echo "The pattern could not be checked. Something went wrong. Exiting."
    CLEAN;
else
    echo "Pattern confirmed."
fi

echo "Removing the temp file."
rm test-trim-by-desgua

echo "Syncing."
sync
sleep 1

if [[ "$fs" == "1" ]]; then
    echo "fstrim -v $pasta && sleep 2" ; echo
    fstrim -v $pasta
    sleep 2
fi

# Drop cache
echo 1 > /proc/sys/vm/drop_caches

echo "In the next line you should **NOT** see a yes pattern like:
00000000  79 0a 79 0a 79 0a 79 0a  79 0a 79 0a 79 0a 79 0a  |y.y.y.y.y.y.y.y.|
If you see, then trim is not working:
`dd bs=4096 skip=$position count=256 if=$device | hexdump -C`"

yes=`dd bs=4096 skip=$position count=256 if=$device | hexdump -C`
if [[ "`echo "$yes" | grep "y.y.y"`" != "" ]]; then
    echo "TRIM not working."
else
    echo "TRIM is working!"
fi
CLEAN;
}

if [[ "$method" == "1" ]]; then
    SDATEST;
    TEST;
elif [[ "$method" == "2" ]]; then
    LUKSTEST;
fi
exit 0


How to scroll up in ubuntu server terminal?

There's a Limit scrollback to option in Menu bar -> Edit -> Profile Preferences -> Scrolling. Uncheck the checkbox for unlimited scrollbar.


Ubuntu 18.04 can't connect to printer via SAMBA

I don't know how to answer your question, because I had the same problem, I've just solved it, however I've not clear how I managed to do it.

First of all, I'm working with VMs. I think it should work with your systems, but who knows...

Well, as far as I know it was supposed to be  an issue / bug with cups in Ubuntu 18.04 LTS. It's supposed to be fixed in new version of cups, as you may read at the end of the posts. So, what I did, after a lot of reading and touching here and there was installing the las version of cups in one of my Ubuntu 18.04.

Here I was, with cups 2.2.7-1ubuntu2.3. And it works!. I tried to do the same in other VM with Ubuntu.. but I found something weird, there was no entry in the repositories for cups 2.2.7-1ubuntu2.3. There were only the 2.2 versión... so I couldn't update :(. However, I tried to do all the steps just in case it worked, and It did!

The difference between the two systems is the kernel version. The one with cups updated to 2.2.7-1ubuntu2.3 has a 4.15.0.-29 kernel. The other one a 46.

Try to update you cups, just in case. I hope it will help you.


You can look at System --> Administrator --> Log File Viewer, Under "dmseg" file to see if something with the authentication process is wrong

Some more experienced people will suggest to harvest the power of terminal by doing something like :

cat /var/log/* | grep network-manager > network-manager-output.txt

I hope you can find a solution to your problem


Trouble installing python command, and "whereis python" command returns multiple paths

Try running sudo apt get update then run sudo apt install python


USB 2.0 and NIC not recognized on a ASUS M5A97 Pro

A firmware update to 0810 Beta (2011/10/11) via EZ Flash seems to solve the problem. The keyboard is running, the mouse still not, but this seems to be a bluetooth issue:

Keyboard/Mouse not recognised during installation

Thanks so far.


ImportError: No module named 'defer' from aptdaemon

Check if you installed defer for different python versions. If i remember correctly, you can either use pip2 install defer or pip3 install defer


Layout switching while button is pressed in 13.10

Still didn't find any answer, so i'm using Caps Lock button to switch layouts. One button lets make it faster than two. It's not ideal but may be a workaround.


Really need g77 on Ubuntu 12.04, can't install

This has been tested on 12.04, and 13.04.  I beleive its version 3.4.  To install, first you need to download either the 32bit, or 64bit g77.  Once downloaded, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, navigate to the location where the files where downloaded (probably the downloads folder), and run the command(s) below:

For 32bit

tar -xzvf g77_x86_debian_and_ubuntu.tar.gz
cd  g77_x86_debian_and_ubuntu
chmod +x ./install.sh
./install.sh

For 64bit

tar -xzvf g77_x64_debian_and_ubuntu.tar.gz
cd  g77_x64_debian_and_ubuntu
chmod +x ./install.sh
./install.sh

Source:sanjeev kumar


Color the regular expression in same file

I've written a script for that:
#!/usr/bin/env perl
use Getopt::Std;
use strict;
use Term::ANSIColor;

my %opts;
getopts('himc:l:',\%opts);
if ($opts{h}) {
    print<<EoF;
DESCRIPTION

$0 will highlight the given pattern in color.

USAGE

$0 [OPTIONS] -l PATTERN FILE

If FILE is omitted, it reads from STDIN.

-c : comma separated list of colors
-h : print this help and exit
-l : comma separated list of search patterns (can be regular expressions)
-m : only print matching lines (grep-like)
-s : makes the search case sensitive

EoF
    exit(0);
}

my $case_sensitive=$opts{s}||undef;
my $only_matching=$opts{m}||undef;
my @color=('bold red','bold blue', 'bold yellow', 'bold green',
           'bold magenta', 'bold cyan', 'yellow on_magenta',
           'bright_white on_red', 'bright_yellow on_red', 'white on_black');
## user provided color
if ($opts{c}) {
    @color=split(/,/,$opts{c});
}
## read patterns
my @patterns;
if ($opts{l}) {
    @patterns=split(/,/,$opts{l});
} else {
    die("Need a pattern to search for (-l)\n");
}

# Setting $| to non-zero forces a flush right away and after
# every write or print on the currently selected output channel.
$|=1;

while (<>) {
    my $matched;
    for (my $c=0; $c<=$#patterns; $c++) {
    if ($case_sensitive) {
        if (/$patterns[$c]/) {
        s/($patterns[$c])/color("$color[$c]").$1.color("reset")/ge && $matched++;
        }
    } else {
        if (/$patterns[$c]/i) {
        s/($patterns[$c])/color("$color[$c]").$1.color("reset")/ige && $matched++;
        }
    }
    }
    ## Skip non-matching lines
    if ($only_matching) {
        next unless $matched;
    }

    print STDOUT;
}

Save the file as ~/bin/color, make it executable (chmod 755 ~/bin/color) and then run it, giving it a comma-separated list of patterns to color:

So, to color the lines of your input file, you could just use the script above, redirect the output to a new file and then rename the original:


Assuming you are using Unity, you could restart it by going to a virtual terminal (Ctrl-Alt-F1), logging in with username and password, then typing unity.


Show Applications not scrolling after upgrade to Ubuntu 20.04 from 18.04 (via 19.10)

This solution may be a temporary fix.
What you can do is go to Settings, go to Appearance go to Submenu Dock and switch the position from Left or Right to Bottom.
Now the applications menu will shift to the bottom right. Click on that and now you will find application scrolling.
This worked for me when I unintentionally changed this setting.
Hope this will solve your problem.


I had the same problem when i updated to 11.04 beta.
I have a 22'' Samsung monitor which was detected correctly up unti 10.10.

My problem was solved by creating an xorg.conf file manually:

sudo Xorg -configure

When i rebooted, the monitor was detected fine.


Why does the window title say "gnome-calculator" and not Calculator?

Might be a regression since in 16.04 it appears to be "Calculator"

This change probably is caused by some kind of localization problems. I checked out the code for gnome-calculator on Github:

https://github.com/GNOME/gnome-calculator/blob/bbb3f2afc64ffa45d90d73571cedd51df5c2d27b/src/gnome-calculator.vala#L80

This line is:

current_window.set_title (_("Calculator"));

This means the title should be "Calculator" unless the "get text" library returns an alternative string name. I walked the git history back that hasn't changed in ages although the code has had the damn variable names renamed about 5 times in the last year.


I know you probably did this, but on the machine that you are trying to connect to, does netstat -a give you something like this:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 *:ssh                   *:*                     LISTEN
tcp        0      0 192.168.1.30:ssh        192.168.1.72:46480      ESTABLISHED
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN

At least one of the lines should show something like *:ssh for ssh connections to be established to that machine.

If not, then sshd needs to be started...


How can I change my graphics card power profile?

This article should provide you all the information you need to fix this issue:

Power saving with free Radeon (ATI) driver

You can also change your CPU power profile while you are at it:

Ubuntu, CPU Scaling, Battery life and You


How to access MySql on Windows from Ubuntu?

Of course you can, you just need a few things set up correctly first:

Install the MySQL Query Browser and Administrator These are both graphical tools that you can use to manage your mysql databases, no matter where they are.
On Windows you need to make sure the machine is available over the network via a name or fixed address so your Ubuntu machine can see it correctly.
Make sure you add permissions to access the database from non-localhost. In MySQL the default permissions are localhost only and you need to turn on the '.*' permissions for either root (if your managing it totally) or a user with the permissions you need.
Use the MySQL Admin you installed to test the connection by attempting to log into the machine's fixed ip or name with the username and password you've set up in the permissions.

You can also use openoffice.org's database to connect to mysql databases. And it really doesn't matter that MySQL is running on Windows or Ubuntu, the concerns are the same.


You are likely missing the line for this in the interfaces file. Open /etc/network/interfaces and check if there is a line for eth0 If not add the following:

auto eth0
iface eth0 inet dhcp

This will add the eth0 interface - and use DHCP on boot and wakeup.

If you're still not getting DHCP response you may also need to add dhcp back into defaults:

sudo update-rc.d dhcp3-server defaults


A lot of my file system space has disappeared. Where is it?

I wonder that all the time, "where'd all the space go?" GNOME disk usage analyzer (baobab) usually works great for seeing what's big & what's where, but normally it's run as your user, and it sounds like there's hidden files that you can't see, you could try running baobab as root (sudo baobab) and then take a look?

Or your filesystem(s) could need fsck maybe the free space count is wrong or something.

Or maybe your / or home filesystem is on a very small partition that is almost full, while another partition has gigs and gigs of free space? I think the "low space" warning only comes up for / and/or your home?


How can I reset the defaults settings in Unity?

Just delete the configuration files/folders of unity in your home folder,. seems like .unity or .local/share/unity

and probably the the unity gconf setting. Search in .gconf folder.


What Editor has NO Syntax Highlighting and can copy&paste text in GTK interfaces?

You could try pastebinit, you'll get a link to open the json file in your browser:

sudo apt-get install pastebinit
cat data.json | pastebinit -b http://paste.ubuntu.com


If you added the PPA from the command line, you should be able to find (and re-run) the command with history | grep add-apt-repository.

But there are no "default PPA settings".  They are personal package archives; the default is no PPAs, so it's unlikely removing one would cause your symptom "unable to download any app from app center."

If you need to replace your default main source settings (e.g. /etc/apt/sources.list), this online tool can generate the files for you: http://repogen.simplylinux.ch/


Check your pre-installed or available Python packages with apt-cache policy …

Examples:

% apt-cache policy python
python:
  Installed: 2.7.9-1
  Candidate: 2.7.9-1
  Version table:
 *** 2.7.9-1 0
        500 http://de.archive.ubuntu.com/ubuntu/ vivid/main i386 Packages
        100 /var/lib/dpkg/status

% apt-cache policy python3
python3:
  Installed: 3.4.3-1
  Candidate: 3.4.3-1
  Version table:
 *** 3.4.3-1 0
        500 http://de.archive.ubuntu.com/ubuntu/ vivid/main i386 Packages
        100 /var/lib/dpkg/status

To remove your manually make install installed Python interpreter, follow the steps below.

First try make uninstall in your unzipped source folder. If that works, than stop here.

If not, follow the next steps

Download and unzip the archive again
Start the usual compilation steps again without make install

./configure
make

Install checkinstall

sudo apt-get install checkinstall

Install python again with checklinstall, yes, I'm sure. ;)

sudo checkinstall

checkinstall creates a deb package that can be easily removed.
After that, you will see a message like To remove the package use …, do that.


NordVPN does not install in Ubuntu 18.04.02 LTS

Manually add the repository by going to the software & updates app, then click on Other Software and add either of the following lines depending on your system architecture:

deb [arch=amd64] http://repo.nordvpn.com/deb/nordvpn/debian stable main
deb [arch=i386 ] http://repo.nordvpn.com/deb/nordvpn/debian stable main

Open your terminal and run:

$ sudo apt update

You may most likely encounter a GPG error of NO_PUBKEY, copy the following code to the terminal and run:

sudo wget https://repo.nordvpn.com/gpg/nordvpn_public.asc -O - | sudo apt-key add -

This would fix the error.

Finally, run:

$ sudo apt install nordvpn

Tada!

You can also check other answers here:
https://askubuntu.com/a/1230982/1068121


Ubuntu 18.10 on Lenovo Ideapad 330-15ICH missing battery indicator/management

Apparently, the problem is caused by kernels between 4.16 and 4.19. ubuntu 16.04.6 works (kernel 4.15), and so does Ubuntu 18.04, but only if you install from 18.04.0 or 18.04.1 (their kernel is also 4.15), but neither Ubuntu 18.04.2 nor Ubuntu 18.10 work (kernel 4.18). These problems have been fixed in kernel 5.0. Solutions:

Either you use versions with kernel 4.15 (Ubuntu 16.04.6 / 18.04). This kernel has some small issues with the touchpad, though.
Or you install Ubuntu 18.04 and, afterwards, enable the LTSEnablementStack

sudo apt install --install-recommends linux-generic-hwe-18.04-edge xserver-xorg-hwe-18.04

https://wiki.ubuntu.com/Kernel/LTSEnablementStack

linux-generic-hwe-18.04-edge is necessary if you want to install kernel 5.0

Don't forget to enable the NVIDIA drivers in 'Software & Updates' -> 'Additional Drivers'


How to adjust the appearance of the Unity in 12.10?

You can go into Tweak Tool and changes borders and fonts and what not.  It's not at all difficult but it's lacking on the options.  Be careful with what you put on there...I put on cairo dock and it led to a gpu fault that took two hours to get rid of.  I'm a noob (in the highest degree-used to be a Windows disciple) and I had an easy time fiddling with the options.  Have fun! Ubuntu is a good stable platform that I'm kicking myself for not discovering earlier.


From /usr/share/doc/virtualenvwrapper/README.Debian:

In contrast to the information in
/usr/share/doc/virtualenvwrapper/en/html/index.html this package installs
virtualenvwrapper.sh as /etc/bash_completion.d/virtualenvwrapper.

Virtualenvwrapper is enabled if you install the package bash-completion and
enable bash completion support in /etc/bash.bashrc or your ~/.bashrc.

If you only want to use virtualenvwrapper you may just add

 source /etc/bash_completion.d/virtualenvwrapper

to your ~/.bashrc.

Yes, it's a bit hard to find :D


What are the steps for configuring gitosis?

apt-get install gitosis

a. The gitosis repo directory is: /srv/gitosis

b. The gitosis user is auto created and named: gitosis
Init gitosis with your public key:

sudo -H -u git gitosis-init < id_rsa.pub
Now you can clone to your local repo:

git clone gitosis@[SERVER]:gitosis-admin.git


One solution is to use a bash function which runs different commands based on the file type to extract it.
One good function that I'm aware is the one bellow. Put it in your .bashrc and then use it like ex file.
# ex - archive extractor
# usage: ex <file>
ex ()
{
  if [ -f $1 ] ; then
    case $1 in
      *.tar.bz2)   tar xjf $1   ;;
      *.tar.gz)    tar xzf $1   ;;
      *.bz2)       bunzip2 $1   ;;
      *.rar)       unrar x $1   ;;
      *.gz)        gunzip $1    ;;
      *.tar)       tar xf $1    ;;
      *.tbz2)      tar xjf $1   ;;
      *.tgz)       tar xzf $1   ;;
      *.zip)       unzip $1     ;;
      *.Z)         uncompress $1;;
      *.7z)        7z x $1      ;;
      *)           echo "'$1' cannot be extracted via ex()" ;;
    esac
  else
    echo "'$1' is not a valid file"
  fi
}

You have to install these packages for this function to work correctly:
$ sudo apt install tar bzip2 gzip unrar gunzip unzip p7zip-full

I originally saw it couple of days ago on this video, but found it by searching at this gist.


What are the significant differences between tracepath and traceroute?

How do traceroute and tracepath perform a similar function, differently?
Both programs essentially do one thing: send and receive certain IP packets.
A program can use the normal sockets API to do this, or it can manipulate the raw packets from the interface. The sockets API does not require root privileges, because it is fairly secure. There are mechanisms builtin to prevent one program from accessing IP packets that another program made.
Tracepath uses the sockets API for all it's functionality. Traceroute manipulates raw packages for some of its functionality.
What does traceroute do, which requires root privileges, that tracepath doesn't?
It manipulates raw packages.
To manipulate raw packets, you need root privileges because by doing this, you bypass the security mechanisms of the sockets API. You gain access to communications of all other processes and users using that interface. Just think about what a virus could do if it could manipulate raw packages.
Are there scenarios where one should prefer tracepath over traceroute, or vice-versa?

One advanced command available in Traceroute is the ability to run a
network trace using IPv4 or IPv6 protocol. It is also possible to
choose between ICMP, TCP or UDP data formats for a probe. Traceroute
can choose specific source routings for the probe and choose what port
to send from. It can set limits on the minimum and maximum TTL to
accept from an outbound probe. IN addition, Traceroute can show the
wait time for response pings as well as set how many packets are send
in each probe and how many probes to send. Some of these commands may
not be supported by networking hardware along the path, which could
terminate the probe before it reaches its target destination.

sources:
1
2
3


using a router plugged in to ubuntu pc to connect wirelessly to another modem/router

Strictly speaking this is not Ubuntu related :)

You should be able to use your old router as a bridge repeater .
There is a lot of documentation on the net, for instance:

What is Bridging Mode in Wi-Fi Networking?
http://compnetworking.about.com/cs/wirelessproducts/f/apbridgingmode.htm

How to Extend Your Wi-Fi Network With an Old Router
http://lifehacker.com/how-to-extend-your-wi-fi-network-with-an-old-router-915783308

edit:
You will notice a speed decrease as when bridged you will use twice the bandwidth.


Data recovery fantom external hard drive 6 TB ( two 3TB drives on raid 0)

You can set up RAID 0 with mdadm. For example, I made it visible in both Windows and Ubuntu using --build command:

# mknod /dev/md1 b 9 1
# sudo mdadm --build --verbose --chunk=64K /dev/md1 --level=0 --raid-devices=2 /dev/sdh /dev/sdi

Do not use --create command, because it will destroy your array. And remember that you should build array on every system startup. Also, set chunk size according to your array chunk size, else results will be unpredictable.

OK, mdadm is the software application and is placed inside the package of the same name. To 'enable' it you should install it:

sudo apt-get install mdadm

Chunk size is the size of the blocks on which data are divided to fit on both RAID drives. You can retrieve it from your Fantom storage settings.

And, the last: you can build your array during installation, then install Ubuntu, reboot and it should work! At least, if you have only 2 internal drives... Because drive order can change if you have > 2 drives. I'm suffering from this effect. But I found solution: run the command before mount -a runs. This should be done by runlevel injection.

But you do not need to do this, because you just have to build array once, retrieve the data and put the drives back, right? And when array is built, there will be nodes:

$ ls -l /dev/md1*
brw-rw---- 1 root disk   9, 1 sept. 10 05:30 /dev/md1
brw-rw---- 1 root disk 259, 0 sept. 10 05:30 /dev/md1p1
brw-rw---- 1 root disk 259, 1 sept. 10 05:48 /dev/md1p2


I noticed that when I had only 2 partitions, one for Windows and one for Linux, and had all my Movies/Music/etc. on the windows partition, the Windows Check Disk would render those files unplayable in Linux.

My solution  was to make THREE partitions, the first one for Windows, the one in the middle as a shared NTFS drive that both Windows and Linux can access, and the last partition on the drive I put Linux onto.

Having all these partitions means that when you boot to windows and it checks the disk for errors, windows will check only it's own partition, leaving the rest alone. With all the movies/etc. on another partition, they are left alone.

Hope this helps!


`sudo apt-get update` returns connection errors with some repositories, and can't update

The repository at fault is the packages.ros.org one, with an "Unable to Connect" error.  This in turn points to ftp.osuosl.org from the DNS lookups I just ran.  It also is 'working' from what I can tell.

It's possible your system is not able to reach those servers, either because there's network filtering somewhere along the lines that're blocking the access, or there's intermittent network issues, or your ISP is blocking access.  If all other repositories are working, then you'll have to debug connectivity between you and that repository server.

It looks to me though like that's the only repository giving you issues.  If the issues do not resolve then you will need to try and reach out to those who maintain the repository (sorry, I don't know who they are), and try and resolve the issues there.  There's not much we can really do from here, though.


USB device connecting and disconnecting repeatedly

This looks suspiciously similar like a broken USB cable or port. I can say that for sure because I'm using such: every time I'm touching a cable of my USB hub, I see in /var/log/syslog a wall of those messages about (dis) connection, and increasing device number; and the connected mouse resets its sensitivity.

Just for the record, here's an example of mine log:

Aug 20 17:22:38 constantine-N61Ja kernel: [55857.366422] usb 4-1.1: USB disconnect, device number 25
Aug 20 17:22:38 constantine-N61Ja kernel: [55857.366428] usb 4-1.1.2: USB disconnect, device number 26
Aug 20 17:22:38 constantine-N61Ja kernel: [55857.366730] usb 4-1.1.3: USB disconnect, device number 27
Aug 20 17:22:39 constantine-N61Ja kernel: [55857.690545] usb 4-1.1: new high-speed USB device number 28 using ehci-pci
Aug 20 17:22:39 constantine-N61Ja kernel: [55857.774736] hub 4-1.1:1.0: USB hub found
Aug 20 17:22:39 constantine-N61Ja kernel: [55857.774788] hub 4-1.1:1.0: 4 ports detected
Aug 20 17:22:39 constantine-N61Ja kernel: [55858.043972] usb 4-1.1.2: new low-speed USB device number 29 using ehci-pci
Aug 20 17:22:39 constantine-N61Ja kernel: [55858.142289] input: HID 192f:0716 as /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1.2/4-1.1.2:1.0/0003:192F:0716.0019/input/input49
Aug 20 17:22:39 constantine-N61Ja kernel: [55858.142518] hid-generic 0003:192F:0716.0019: input,hidraw0: USB HID v1.11 Mouse [HID 192f:0716] on usb-0000:00:1d.0-1.1.2/input0
Aug 20 17:22:39 constantine-N61Ja kernel: [55858.207327] usb 4-1.1.3: new low-speed USB device number 30 using ehci-pci
Aug 20 17:22:39 constantine-N61Ja kernel: [55858.320867] input:   USB Keyboard as /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1.3/4-1.1.3:1.0/0003:04D9:1702.001A/input/input50
Aug 20 17:22:39 constantine-N61Ja kernel: [55858.374364] hid-generic 0003:04D9:1702.001A: input,hidraw1: USB HID v1.10 Keyboard [  USB Keyboard] on usb-0000:00:1d.0-1.1.3/input0
Aug 20 17:22:39 constantine-N61Ja kernel: [55858.391406] input:   USB Keyboard as /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1.3/4-1.1.3:1.1/0003:04D9:1702.001B/input/input51
Aug 20 17:22:39 constantine-N61Ja kernel: [55858.444140] hid-generic 0003:04D9:1702.001B: input,hidraw2: USB HID v1.10 Device [  USB Keyboard] on usb-0000:00:1d.0-1.1.3/input1


Can you launch xterm? I've seen this issue before and what I had to do is to reinstall the terminal. If you can launch xterm you can do:

sudo apt-get remove --purge gnome-terminal
sudo apt-get install gnome-terminal

Does TTY work? Can you access terminal through pressing Ctrl+Alt+F5?


Do I have to use "eject" in terminal to load a cd/dvd (on Sony Vaio with eject button)

Are you sure it's broken? Neither my DVD or Bluray eject buttons work if anything has their contents open (read: Nautilus viewing files, Totem playing something from it).

I find clicking the eject icon in Nautilus usually works if the button doesn't.

If you find that only using the eject command works perhaps you could just write a little launcher that runs gksu eject /dev/sr... so ejecting is just a double-click away. Or if you're using Unity, create a launcher for ejecting (if there isn't one already - I'm not a Unity user so I'm not sure).


realtek 0bda:8171 RTL8188SU driver update

There is no evidence that I am aware of that the driver included by default in kernel version 4.4.0-xx is outdated, nor that instability can be rectified by installing a different, maybe older, maybe newer driver. Moreover, I know of no driver that actually compiles and installs.

Instability is sometimes caused by problems in the router such as auto channel select and others.

Please check the settings in the router. WPA2-AES is preferred; not any WPA and WPA2 mixed mode and certainly not TKIP. Second, if your router is capable of N speeds, you may have better connectivity with a channel width of 20 MHz in the 2.4 GHz band instead of automatic 20/40 MHz, although it is likely to affect N speeds. I also have better luck with a fixed channel, either 1, 6 or 11, rather than automatic channel selection. Also, be certain the router is not set to use N speeds only; auto B, G and N is preferred. After making these changes, reboot the router.

Next, I recommend that your regulatory domain be set explicitly. Check yours:

sudo iw reg get

If you get 00, that is a one-size-maybe-fits-all setting. Find yours here: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 Then set it temporarily:

sudo iw reg set IS

Of course, substitute your country code if not Iceland. Set it permanently:

sudo nano /etc/default/crda

Change the last line to read:

REGDOMAIN=IS

Proofread carefully, save and close the text editor.

You might also turn off power saving in Network Manager. From the terminal:

sudo sed -i 's/3/2/' /etc/NetworkManager/conf.d/*

Reboot the computer and tell us if there is any improvement.


I have the same issue. I had to enter the BIOS and do nothing then exit the BIOS (which automatically reboots) then Ubuntu starts.


/var/www owned by my user, cant send files to trash

PARTIAL SOLUTION

I tested here, and had the same problem.

You need to create a .Trash-1000(*) in the highest folder in this filesystem. In my case, it was /

so I ran sudo mkdir /.Trash-1000 and chown user:user /.Trash-1000. Nautilus no longer complains, and it sends the files to the Trash folder.

However ... They dont show up in my trash (via GUI). I just know they are there because I went and checked

(*) actually, its .Trash-UID , where the UID can be found using the command id


According to me u want to download ubuntu along side windows on the same disk on which u installed windows.

If you want to install ubuntu in separate disk then choose the last option (The Last option is "Something else")

After choosing this you should choose the Drive in which you want to install the ubuntu and make three parts of that

1.First alot memory of about 15-20gb(My personal recommendation you can choose less also but it should not be less than 10 gb.Mount it as /

2.Now give this about 10 gb of space and mount it as Swap area.

3.Give the left over memory to second partition and mount it as /home .

After this just simply install ubuntu.

After installing ubuntu you will notice that after rebooting it u will either be directed to Ubuntu or windows (You will not be asked your choice).

If you boot into ubuntu directly then just run a command in Terminal

sudo update-grub

If you directly boot into windows then use BOOTREPAIR.After running this your problem will be solved.

BootRepair can also be used if you directly boot into Ubuntu


Prevent wi-fi to turn off when laptop's lid is closed

There is a tool missing in the default setup named GNOME Tweaks. This option sets the one you want to disable. The suspend is what kills the wifi.

Command line method:

Do nothing when on battery:

gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action blank

Do nothing when on power:

gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action blank


I managed to find the issue and resolve it. I looked in /var/log/syslog to find cron complaining about formatting errors / invalid characters.

cat -v /etc/crontab

showed there were some non-printing characters in the file which I then removed, and it works just fine.

Thanks for your help @Rinzwind.


Docker Ubuntu Openssh server - I figured out how to make it not exit, but I don't understand what is going on

Let's  break this down:

You're working with a Dockerfile
You're using the CMD instruction
First, let's read https://docs.docker.com/engine/reference/builder/#cmd
Looking at the format of your usage of CMD, docker refers to that as the 'shell' form
"If you use the shell form of the CMD, then the  will execute in /bin/sh -c" - which tells you whatever you supplied will be interpreted by /bin/sh
2.4 In linux, reading the man page for sh: $ man sh and searching for exec you'd find:

 exec [command arg ...]
        Unless command is omitted, the shell process is replaced with the specified program (which must be a real program, not a shell

builtin or function).  Any redirections on the exec
command are marked as permanent, so that they are not undone when the exec command finishes.

What is not clear here is how this affects the container.
To help with that, see the answers to this question: https://stackoverflow.com/q/32255814/831750

Since you have supplied a parameter to exec, eg "$@", it will be interpreted by exec as the 'command' part. So what is "$@"
A simple google search for: "$@" which would likely give you a result such as https://stackoverflow.com/questions/9994295/what-does-mean-in-a-shell-script/9995322 in which it is explained that

$@ is all of the parameters passed to the script

Or from the man pages under the section titled "Special Parameters", with a subsection on @

 @            Expands to the positional parameters, starting from one.  When the expansion occurs within double-quotes, each positional parameter expands as a separate argument.  If there
              are no positional parameters, the expansion of @ generates zero arguments, even when @ is double-quoted.  What this basically means, for example, is if $1 is “abc” and $2 is
              “def ghi”, then "$@" expands to the two arguments:
                    "abc" "def ghi"

I hope that not only gives you an answer to the "$@" question, but to somewhat show you how to go about breaking down a question like this for yourself.
Have fun :-D


libpng15.so.15, cannot open shared object file

OK, it seems that Blender seeks this library inside /usr/lib instead of /usr/local/lib. The answer is trivial: make there symbolic link:

sudo ln -s /usr/local/lib/libpng15.so /usr/lib

Else, you can change prefix while ./configure your libpng.so:

./configure --prefix=/usr

Thus make install will install libpng15.so direct into /usr/lib.


For some reason it was only named as "php", so I couldn' track it down with the version number.

Then it was simply as

sudo apt-get purge php


I don't know what fogger or a fogapp is, but there are some things you possibly should or shouldn't do:

The scripts in a debian package should not do anything to user-specific files. If the user decides to simply uninstall, and re-install, to try and solve some problem, this "solution" would result in all of those fogapps they had, no longer being accessible.
You can add TryExec to the desktop files, which the system will check for and hide the launcher from view, if the app is not installed.

How are these "fogapps" started exactly? If you tell me, I can update the answer to provide an example.


Desktop will not load. 14.04. problem with libstdc++.so.6

In such case you need to download libstdc++6 package manually and install it:

wget http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.8/libstdc++6_4.8.4-2ubuntu1~14.04.4_i386.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.8/libstdc++6_4.8.4-2ubuntu1~14.04.4_amd64.deb
sudo dpkg -i --force-all libstdc++6_4.8.4-2ubuntu1~14.04.4_i386.deb
sudo dpkg -i --force-all libstdc++6_4.8.4-2ubuntu1~14.04.4_amd64.deb

Then continue as usual

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install -f


Mouse text selection to paste buffer using middle click

Configuration

Following these instructions and this answer and this document:

Do not execute the script shown in the question.
Edit /usr/share/X11/xorg.conf.d/10-evdev.conf.
Append the following lines:
Section "InputClass"
    Identifier  "Marble Mouse"
    MatchProduct "Logitech USB Trackball"
    MatchIsPointer "on"
    MatchDevicePath "/dev/input/event*"
    Driver "evdev"
    Option "ButtonMapping" "1 9 3 4 5 6 7 8 2"
    Option "EmulateWheel" "true"
    Option "EmulateWheelButton" "8"
    Option "ZAxisMapping" "4 5"
    Option "XAxisMapping" "6 7"
    Option "Emulate3Buttons" "true"
EndSection

Save and restart X.

Restart X

Enable Ctrl-Alt-Backspace to restart X as follows:

echo setxkbmap -option terminate:ctrl_alt_bksp >> ~/.xprofile
chmod +x ~/.xprofile
~/.xprofile

This:

Sets the small left button as the wheel activator (click and hold to scroll).
Sets the small left button as the "back button" (click, no scroll).
Sets the small right button as middle-click to paste.
Enables horizontal and vertical scrolling.
Disables both large buttons as chord-click.

Addendum

After rebooting restarting X, I found the scrolling no longer worked, possibly due to an upgrade. If this happens to you, try:

Remove the following files (I moved mine to ~/.):
/usr/share/X11/xorg.conf.d/50-vmmouse.conf
/usr/share/X11/xorg.conf.d/50-marblemouse.conf
/usr/share/X11/xorg.conf.d/11-evdev-quirks.conf

Remove any additional mouse input device settings from:
/etc/X11/xorg.conf

Verification

Verify the settings using (where 8 is the device number; yours will likely vary):

xinput get-button-map 8