Ubuntu Wi-fi Hotspot with Web Authentication

Part-One

I have come across an Ubuntu hotspot app that allows you to provide wifi through Ubuntu so I hope this will help with that aspect of what you are looking for.

The article source is here http://www.webupd8.org/2013/06/how-to-set-up-wireless-hotspot-access.html

To install the ppa, execute the following commands

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install ap-hotspot

Now, in version 14.04, hostapd doesn't work properly so the following commands will downgrade hostapd and will use apt to hold the package, preventing automatic upgrades.

For 64bit

cd /tmp
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd

Or, for 32bit

cd /tmp
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_i386.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd

To start up and configure . . .

sudo ap-hotspot start

To reconfigure after installation . . .

sudo ap-hotspot configure

To stop the hotspot . . .

sudo ap-hotspot stop

and to restart . . .

sudo ap-hotspot restart

For a list of commands . . .

ap-hotspot

Part Two: Web based authentication

adapted from http://pepperspot.sourceforge.net/index.php?n=Doc.UserDocumentation

I have updated some of the commands to comply with the more current practice of using sudo.

First install the build modules

sudo apt-get install build-essential linux-headers-generic automake subversion libtool

To download and build the pepperspot source package; execute the following commands:

svn co svn://svn.code.sf.net/p/pepperspot/code/trunk pepperspot
cd pepperspot
autoreconf -f -i
./configure
make
sudo make install
sudo modprobe ipv6
sudo apt-get install radvd iptables libc6-dev quagga apache2 libapache2-mod-php5 libssl-dev freeradius

1.) Activate IPv6

First of all, be sure that IPv6 is activated on your kernel. If IPv6 is compiled as a module, type:

sudo modprobe ipv6

1.1) Stateless autoconfiguration

This is an example of the /etc/radvd.conf configuration file:

interface ath0
{
  AdvSendAdvert on;
  AdvIntervalOpt on;
  MinRtrAdvInterval 2;
  MaxRtrAdvInterval 6;
  prefix 2001:db8:1::/64
  {
    AdvOnLink on;
    AdvAutonomous on;
    AdvRouterAddr on;
    };

    RDNSS 2001:db8:2::1
    {
        AdvRDNSSPreference 8;
    AdvRDNSSOpen off;
    AdvRDNSSLifetime 30;
    };
};

Replace interface, prefix and RDNSS (DNS server information) lines with your own values, and launch radvd with:

sudo radvd -C /etc/radvd.conf

1.2) Addressing and Routing

A captive portal have to route packets of an authenticated user towards Internet. So the system must have IPv6 forwarding enabled. You can turn it on with:

echo "1" | sudo tee /proc/sys/net/ipv6/conf/all/forwarding

To keep this configuration persistent, you can use the following command:

echo 'net.ipv6.conf.all.forwarding=1' | sudo tee -a /etc/sysctl.conf

IPv6 forwarding will disable the IPv6 autoconfiguration, so network configuration (assign addresses and routes) can be set statically or dynamically with routing daemons. For the last ones procedure look at section 2.

If you want to use the static addressing and routing procedure, assuming that eth0 is the interface connected to the IPv6 network to Internet, type the following command and replace with your own value.

Assign address on wired interface:

sudo ip -6 addr add 2001:db8:1::1234/64 dev eth0

Add the default route configuration (replace with you route address value):

sudo route -A inet6 add default gw fe80::1:2:3:4 dev eth0

You can turn this configuration persistent insert the network configuration in your /etc/network/intefaces as you can see in this example:

auto eth0
iface eth0 inet6 static
        address 2001:db8:1::1234
        netmask 64
                gateway fe80::1:2:3:4
        pre-up modprobe ipv6      # to be sure that ipv6 is enabled before we turn up the interface

Note that you do not have to configure address on interface connected to the Access Point box (or the wireless interface if you use ones).

1.3) IPv4

The IPv4 configuration is more or less the same than IPv6, except that you don't need the advertise the client for network configuration. PepperSpot integrates a DHCP module to attribute an IPv4 address to remote clients. You can disable this module in the PepperSpot configuration if the wireless link already have a DHCP server, or if clients configuration is set statically. You need nevertheless to configure the interface linked to the IPv4 network.

In the same way, enable the IPv4 forwarding using the following commands:

echo "1" | sudo tee /proc/sys/net/ipv4/conf/all/forwarding
echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.conf

and configure the interface address and route (Replace with your parameters):

sudo ip addr add 192.168.0.1/24 dev eth1
sudo route add default gw 192.168.0.254 dev eth1

You can use the following block command to update your /etc/network/interfaces file:

echo 'auto eth1
iface eth1 inet static
    address 192.168.0.1
    netmask 24
    gateway 192.168.0.254' | sudo tee /etc/network/interfaces

1.4) Netfilter Support

PepperSpot will use some Netfilter's rules to proceed the communication between the client and Internet. So the system must support Netfilter. If it's not the case, modify the configuration of your kernel:

For IPv4, you need to enable the Nat, Mangle and tracking support;

For IPv6, you only need the basic support.

1.5) Notes

All services (Radius, web server, PepperSpot, ...) can be installed on systems which provide Wi-Fi access (Master mode). It can be an embedded device, or a system from scratch configured as an Access Point.

For this case, your Wi-Fi card must support the Master mode.

For example if you use wireless interface with madwifi driver, here is an example initialisation script:

#!/bin/bash

# Setting ath0 in Master mode
# Replace PepperSpot by your SSID

wlanconfig ath0 destroy
wlanconfig ath0 create wlandev wifi0 wlanmode ap
iwconfig ath0 essid "PepperSpot"
ifconfig ath0 up

2) Configure the Quagga routing suite

The Quagga routing suite implements some IPv4 and IPv6 routing protocols. This section describes the installation of the RIPng protocol to allow IPv6 routing. We assume that you have a delegated IPv6 prefix, and that you need to route the communication for this prefix. If it's not the case, you can skip this section.

The configuration of quagga is done by setting up some configuration files in the /etc/quagga directory, but the quagga suite integrates some cisco-like interfaces for each protocol to allow configuration on the fly and to view some routing information like routing table.

You can put IPv6 and IPv4 network configurations described before, in the routing protocol configuration. For each protocol you want, enable it in /etc/quagga/daemon .

We need to enable zebra, because it's the main routing module needed to use other protocol and configure interfaces. In our case, we only need to add RIPng too:

# This file tells the quagga package which daemons to start.
#
# Entries are in the format: <daemon>=(yes|no|priority)
#   0, "no"  = disabled
#   1, "yes" = highest priority
#   2 .. 10  = lower priorities
# Read /usr/share/doc/quagga/README.Debian for details.
#
# Sample configurations for these daemons can be found in
# /usr/share/doc/quagga/examples/.
#
# ATTENTION:
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group "quagga", else
# the daemon will not be started by /etc/init.d/quagga. The permissions should
# be u=rw,g=r,o=.
# When using "vtysh" such a config file is also needed. It should be owned by
# group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
#
zebra=yes
bgpd=no
ospfd=no
ospf6d=no
ripd=no
ripngd=yes
isisd=no

Now we have to create one configuration file for each daemon launched.

/etc/quagga/zebra.conf file:

!
! Zebra configuration saved from vty
!   2008/04/10 12:18:58
!
hostname MobSpot
password ***********
enable password *************
!
interface ath0
 ipv6 nd suppress-ra
!
interface eth0
 ipv6 address 2001:db8:1::1234/64
 ipv6 nd suppress-ra
!
interface eth1
 ip address 192.168.0.1/24
 ipv6 nd suppress-ra
!
interface eth2
 ipv6 nd suppress-ra
!
interface eth3
 ipv6 nd suppress-ra
!
interface lo
!
interface tun0
 ipv6 nd suppress-ra
!
interface wifi0
 ipv6 nd suppress-ra
!
ipv6 forwarding
!
!
line vty
!

In this file, we set up the static configuration of each interface linked to the service network (eth0 and eth1).

/etc/quagga/ripngd.conf file:

! -*- rip -*-
!
! RIPngd sample configuration file
!
! $Id: ripngd.conf.sample,v 1.1.1.1 2002/12/13 20:15:30 paul Exp $
!
hostname MobSpot
password ***********
enable password ************
!
! debug ripng events
! debug ripng packet
!
!
router ripng
network eth0
redistribute connected
redistribute static
route 2001:db8:1::/64
!
line vty
!

In this file, we configure the RIPng protocol, indicating that we are able to route packet for 2001:db8:1::/64 prefix on the eth0 interface.

For the both files, the first section will define the password for the configuration interfaces (vty). The enable password line indicate that a password is required to get the right to reconfigure the daemon. Don't forget the line vty line to enable this configuration interface.

For zebra configuration type:

sudo telnet 127.0.0.1 zebra

For RIPng configuration:

sudo telnet 127.0.0.1 ripngd

Note: After authentication (with the password line renseigned into configuration file), you will obtain a command line to configure the daemon. Type "?" to see available commands.

To finish, restart quagga daemons:

sudo /etc/init.d/quagga restart

Note: If you need to configure IPv4 routing, adapt this configuration to RIP daemon.

3) Apache configuration

PepperSpot needs to communicate with a Web Server installed on the same machine to allow clients to proceed authentication. The web server have to be configured for SSL, PHP and CGI.

Here is the configuration for Apache2 web server:

Generate a SSL certificate to guarantee the identity of the web server:

sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/key.pem

The second step is to load the Apache2-SSL module:

sudo a2enmod ssl

The web server need a virtual host to be reachable. Create the file /etc/apache2/sites-available/pepperspot with the following contents (Adapt to your needed configuration):

NameVirtualHost *:443

<VirtualHost *:443>
        ServerAdmin webmaster@pepperspot
        SSLEngine on
        SSLCertificateFile /etc/apache2/key.pem

        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                    # This directive allows us to have apache2s default start page
                    # in /apache2-default/, but still have / go to the right place
                RedirectMatch ^/$ /apache2-default/
        </Directory>

            # CGI - We need cgi support to communicate with PepperSpot
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>'

If you want to modify the name of the virtual host, don't forget that Apache needs to listen on both IPv6 and IPv4 address for dual stack mode, and on IPv4 or IPv6 interface regarding to the single mode you will choice.

Add in /etc/apache2/ports.conf to allow HTTPS listening (if not already present) with the following block code:

echo '<IfModule mod_ssl.c>
    Listen 443
</IfModule>' | sudo tee -a /etc/apache2/ports.conf

Finally, load the site:

sudo a2ensite pepperspot
sudo /etc/init.d/apache2 reload

4) FreeRadius Configuration

PepperSpot is able to communicate with a Radius Server over IPv4 or IPv6 protocol, regarding to the radius server address configuration in /etc/pepper.conf. Here is the configuration of FreeRadius Server. To have IPv6 support, you need a version of FreeRadius >= 2.0.

The FreeRadius configuration is complex, and the following describes only an elementary configuration to enable IPv6 support on FreeRadius, and an easy way to add some user accounts. If you want a better configuration, see the FreeRadius documentation.

4.1) IPv6 configuration

Modify the /etc/freeradius/radiusd.conf file to add the followings section:

# For authentication
listen {
        type = auth
#       ipaddr = *
        ipv6addr = ::1
        port = 0
#       interface = eth0
#       clients = per_socket_clients
}

# For accounting
listen {
        type = acct
#       ipaddr = *
        ipv6addr = ::1
        port = 0
#       interface = eth0
#       clients = per_socket_clients
}

With this configuration, replace ::1 for the field ipv6addr by the address in which FreeRadius must listen. port = 0 means that default Radius ports are used. If you specify * for ipv6addr, FreeRadius will listen on each IPv6 address configured on the system.

Now, you need to configure a FreeRadius client (called as NAS), typically the NAS is the captive portal.

Open the /etc/freeradius/clients.conf file and add the following lines:

client ::1 {      # here ::1 is the name of the client. Replace with your own value
    ipv6addr    = ::1
    secret  = testing123
    shortname   = localhost
    nastype     = other
}

If PepperSpot and FreeRadius are on different box, ipv6addr must be replace by the address with which PepperSpot and FreeRadius communicate. Modify the shortname too.

To restart FreeRadius:

sudo /etc/init.d/freeradius restart

4.2) IPv4 configuration

For IPv4 configuration of FreeRadius, replace the ipv6addr field with ipaddr, and fill it with the IPv4 address wanted.

4.3) Accounts

Finally, we need to create accounts in /etc/freeradius/users:

toto    Cleartext-Password := "totoilsaitpas"

ping6   Cleartext-Password := "pong6"

Restart FreeRadius:

sudo /etc/init.d/freeradius restart

5) PepperSpot configuration

Copy some configuration files:

sudo cp doc/pepper.conf /etc/
sudo cp doc/hotspotlogin.cgi /usr/lib/cgi-bin/
sudo chmod +x /usr/lib/cgi-bin/hotspotlogin.cgi

For IPv4:

sudo cp doc/pepper.iptables /etc/
sudo chmod +x /etc/pepper.iptables

For IPv6:

sudo cp doc/pepper.ip6tables /etc/
sudo chmod +x /etc/pepper.ip6tables

5.2) iptables

Modify the /etc/pepper.iptables and/or /etc/pepper.ip6tables scripts and adapt $INTIF (interface connected to the access point or the wireless interface), $EXTIF4 (interface connected to the IPv4 LAN) and $EXTIF6 (interface connected to the IPv6 LAN) values regarding to your configuration. Note that for dual stack configuration $EXTIF4 and $EXTIF6 could have the same value.

You can follow the rest of the setup from the pepperspot user documentation. http://pepperspot.sourceforge.net/index.php?n=Doc.UserDocumentation There is only one configuration section left.


Looks like the files to edit is now the ...syslinux/txt.cfg
Add the "persistent" on the Try line:
...
menu label ^Try Ubuntu without installing
kernel /casper/vmlinuz
append noprompt cdrom-detect/try-usb=true persistent file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash --

Also, assumes you have the casper-rw file or a partition labeled "casper-rw" properly formatted to use for writing things.


How can I increase time of working from my battery?

Since each of these would require an "answer" of their own, I will simply list them and leave to the reader to research them.

laptop-mode -- main feature is to spin down hdd, when not in use. (You may also need to stop using journaling in ext4 because there is a bug cause unnecessary hdd use when journaling is enabled.)
undervolting (slightly outdated, there might be a better resoruce now) http://openmindedbrain.info/09/05/2010/undervolting-in-ubuntu-10-04-lucid-lts/
Run powertop. This will give you the processes using the most interrupts/power and will also give you the number of watts/battery life you're currently looking at. This will also give you tips like decrease wifi transmit power.
Switch from compiz to metacity, or maybe an even lighter window manager.. such as openbox. (Should be able to do this on-the-fly)

laptop-mode will allow you turn these features on and off. It will require some slight scripting though and config file editing.
killing most "deamons" aren't going to save you as much power as you think. Using powertop will help you isolate any powerhungry processes and you can decide whether they are worth having around while mobile.

More things you can do with laptop-mode:
https://wiki.archlinux.org/index.php/Laptop_Mode_Tools


Upgrading to a new graphics card, any tips?

You do not need to do anything. Both adaters are supported by the same proprietary drivers.

Make sure that the latest proprietary driver is installed and replace the card.

In Ubuntu 16.04 it is nvidia-367.


Error : Unable to start the zeroconf: Permission denied

Permissions issue regarding installation with Ubuntu app store the fix is to reinstall with command-line permissions.

$ sudo apt install rclone barrier


How can I stop hv_utils from logging a message in kern.log + syslog 2000+ times a second? Kern.log 32G in size and syslog is 11G

The fix is relatively easy.
Edit settings of the desired virtual machine. Go to Integration Services and disable "Time Synchronization"


Fan is running constantly after installing ubuntu 16.04


Running Ubuntu 14.04 LTS as a media server, now I want to add Ubuntu TV

I don't think you can "install" Ubuntu TV on Ubuntu 14.04, it is more for TV manufacturer as far as I know. There was a solution for Ubuntu 12.04 as it is still proposed in wiki.ubuntu.com

Server or Desktop version doesn't really matter I think.

But if you want to transform your Ubuntu Server into a Media Center, Koki is a good choice. You can install Kodi on your Ubuntu Server without Desktop Environment. The procedure is well described (exemple).

You can also share media stored on your server and access them with Kodi installed on another computer. There are some simple techniques to do that such as Samba or NFS sharing, UPnP/DLNA server, etc.


How to run a script as soon as a network interface is created?

Functionality of running specific commands when an interface goes up/down is provided out of the box most *nix systems. However running a command when an interface is created might require some custom scripts.

One way to do this (not sure if it is the best way) would be to write custom script which periodically scans the output of ifconfig command and checks if it contains an entry for vboxnet0 and runs your custom command if an entry for vboxnet0 interface is found.


how can i create partitions on ubuntu 12.04 lts and GParted dont work

Boot into your LiveCD or LiveUSB that you used to install Ubuntu and use that partition editor. You may be running into issues if you are trying to edit a partition that is being used. By running GParted from the LiveUSB, you are freeing the volume that you are editing, so you shouldn't have any problems.

When you are done installing Windows, you will need to boot into the LiveCD/USB again to restore the Grub bootloader. Below is a link that will help you if you will need it:

http://www.howopensource.com/2012/05/reinstall-recover-grub-from-ubuntu-12-04-live-cd-usb/


After failed installation attempts with depreciated sound to text programs assembled by linux community a decade ago.

I stumbled upon to Mycroft AI. Looks promising. Community oriented organisation. Simple AI assistant for Linux with a real API.

Please post if there are any other options. whatever is still working and reasonable to use with a modern distro.


Terminal - Selecting commands I've entered using the keyboard

There is a set of shortcuts for terminal , and they are organized around the current cursor position.

You can use CtrlK shortcut to cut the text from cursor to end of line
CtrlU cuts from current position to beginning of line.
Paste with CtrlY

These two are pretty useful in particular when you want to either copy the command or its arguments.

If you are proficient with vim text editor, you can edit the command you want in a more powerful way by evoking vim with fc command.

For using the command outside the terminal, you might want to use xclip command (not installed by default) . For instance,

$ echo "some_command" | xclip -sel clip

Once you have xclip you can add the following function to your .bashrc file

to_clipboard() {
    xclip -sel clip <<<"$@"
}

What this does is it will copy whatever you put in front to clip board. You can use that in combination with the shortcuts above to cut test, paste it in front of the function, and it will be added to your clipboard. Small example

$ to_clipboard echo 'hello world'


My fan is DEAFENING - Please help, i googled and googled to no avail [VAIO Laptop]

most of the times the issues with netbooks/laptops is driver related, specifically video drivers. Please check if your drivers are installed properly.


Grep list for text with 2 numbers and 2 letters

Create a file like the following

~$ cat Patterns.txt
[0-9][0-9][A-F][A-F]
[0-9][A-F][0-9][A-F]
[0-9][A-F][A-F][0-9]
[A-F][A-F][0-9][0-9]
[A-F][0-9][A-F][0-9]
[A-F][0-9][0-9][A-F]
~$

This is the sample input

~$ cat HEX.txt
FFFF
08FF
F0AA
FF08
0F0F
F0F0
~$

And this is the sample output

~$ grep -f Patterns.txt HEX.txt
08FF
FF08
0F0F
F0F0

Explanation:

There can be only 6 possible combinations in your case

Number, Number, Letter, Letter
Number, Letter, Number, Letter
Number, Letter, Letter, Number
Letter, Letter, Number, Number
Letter, Number, Letter, Number
Letter, Number, Letter, Letter

We are storing all these combinations in Patterns.txt and asking grep to use those patterns to find values from HEX.txt


14.04 ThinkPad Edge volume buttons stopped working

I found a solution. Apparently, the values of some dconf keys were mixed up, see here. All I did was:

gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-up
gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-down
gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-mute

Works wonderful now. Thank you all for your help!


If you're running a HDD in your machine, just securely erase the files you don't want them to access before handing the system over. If you're running an SSD, this may be pointless! ...

shred -uzn3 <path to your file>

or if you have a folder full of files you want to shred (this will dig into all subdirectories as well):

find <path to your folder> -type f -exec shred -uzn3 '{}' \;

Breakdown of the switches used:

-u: truncate and remove file after overwriting
-z: add a final overwrite with zeros to hide shredding
-n 3: overwrite 3 times

The only way to prevent similar data recovery for files that were previously deleted would be to overwrite all of your empty disk space. If you want to do that, try the script below. Beware that this could take a long time if you have lots of free space. Also, this may not work as intended with an SSD! Place this script in your home directory and run it.

#!/bin/bash
# desc: When run, this script fills the partition on which it resides with random or
#   zero-filled files. Once filled all of the files generated are removed. Thus any
#   existing date in the free space is overwritten.
# WARNING: because of wear-leveling techniques used by SSDs this may not work
#   as expected with SSDs and some data may remain recoverable.

useRandom=0 #using random data is MUCH slower!
[ $useRandom -eq 1 ] && readDev=/dev/urandom || readDev=/dev/zero
prefix="wipe"
# if we started and killed the script before, pick up where we left off
i=$(ls -l ${prefix}_*.filler 2> /dev/null | wc -l) || i=0

echo "Filling this filesystem. This could take a while ..."
# start an infinite loop writing 2G files to disk
while :
do
    # write (another) 2G file; break loop when no space is left
    dd if=$readDev of=${prefix}_$i.filler bs=4M count=512 > /dev/null 2>&1 || break
    let $[i++]
    # calculate values for displaying progress
    completed=$(ls -l ${prefix}_*.filler | awk '{print  $5}' | paste -sd+ | bc)
    free=$(df -PB1 . | tail -n1 | awk '{print $4}')
    percent=$(echo "scale=2; 100 / (1 + $free / $completed)" | bc)
    # show progress
    echo "Progress: $(numfmt --to si <<< "$completed") (${percent}%)"
done
# when no space is left, print out the 100% progress indicator and remove the zero-filled files
echo "Progress: $(ls -l ${prefix}_*.filler | awk '{print  $5}' | paste -sd+ | bc | numfmt --to si) (100.00%)"
echo "Finished filling partition! Cleaning up."
rm ${prefix}_*.filler

exit


Script Execution at user logout (non root user)

This is the step by step procedure of gnome_save_yourself method. Let's do a test.

Save following code as ~/Desktop/execute_script_on_shutdown.sh    (From http://www.linuxquestions.org/questions/linux-desktop-74/gnome-run-script-on-logout-724453/#post3560301)

#!/usr/bin/env python

#Author: Seamus Phelan

#This program runs a custom command/script just before gnome shuts
#down.  This is done the same way that gedit does it (listening for
#the 'save-yourself' event).  This is different to placing scipts
#in /etc/rc#.d/ as the script will be run before gnome exits.
#If the custom script/command fails with a non-zero return code, a
#popup dialog box will appear offering the chance to cancel logout
#
#Usage: 1 - change the command in the 'subprocess.call' in
#           function 'session_save_yourself' below to be what ever
#           you want to run at logout.
#       2 - Run this program at every gnome login (add via menu System
#           -> Preferences -> Session)
#
#

import sys
import subprocess
import datetime

import gnome
import gnome.ui
import gtk

class Namespace: pass
ns = Namespace()
ns.dialog = None

def main():
    prog = gnome.init ("gnome_save_yourself", "1.0", gnome.libgnome_module_info_get(), sys.argv, [])
    client = gnome.ui.master_client()
    #set up call back for when 'logout'/'Shutdown' button pressed
    client.connect("save-yourself", session_save_yourself)
    client.connect("shutdown-cancelled", shutdown_cancelled)

def session_save_yourself( *args):
        #Lets try to unmount all truecrypt volumes

    #execute shutdowwn script
    #########################################################################################
    retcode = subprocess.call("bash /home/totti/Desktop/shutdown_script.sh", shell=True)
    ##########################################################################################
    if retcode != 0:
        #command failed
        show_error_dialog()
    return True

def shutdown_cancelled( *args):
    if ns.dialog != None:
        ns.dialog.destroy()
    return True

def show_error_dialog():
    ns.dialog = gtk.Dialog("There was a problem running your pre-shutdown script",
                           None,
                           gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
                           ("There was a problem running your pre-shutdown script - continue logout", gtk.RESPONSE_ACCEPT))
    if ns.test_mode == True:
        response = ns.dialog.run()
        ns.dialog.destroy()
    else:
        #when in shutdown mode gnome will only allow you to open a window using master_client().save_any_dialog()
        #It also adds the 'Cancel logout' button
        gnome.ui.master_client().save_any_dialog(ns.dialog)

#Find out if we are in test mode???
if len(sys.argv) >=2 and sys.argv[1] == "test":
    ns.test_mode = True
else:
    ns.test_mode = False

if ns.test_mode == True:
    main()
    session_save_yourself()
else:
    main()
    gtk.main()

Make it executable:

chmod +x ~/Desktop/execute_script_on_shutdown.sh

Save the following as ~/Desktop/shutdown_script.sh

#!/usr/bin/bash
touch ~/Desktop/AAAAAAAAAAAAAAAAAAAAAAAAAAA

Execute the main script

bash ~/Desktop/execute_script_on_shutdown.sh

Now you feel the script wait for something

Log Out or shutdown your OS (Ubuntu)
Log in
Check for a file named AAAAAAAAAAAAAAAAAAAAAAAAAAA on your desktop.

ls -l ~/Desktop/AAAAAAAAAAAAAAAAAAAAAAAAAAA

If you see the file everything OK. Now you can edit the shutdown_script.sh to suit your need. Also remember to execute the execute_script_on_shutdown.sh on login (or make it auto executable on startup).


ERROR while downloading youtube videos from terminal

Please try the latest youtube-dl from http://rg3.github.com/youtube-dl/

Open a terminal by pressing (ctrl + alt + t ) and type or better copy and paste from here the rows below:

wget http://rg3.github.com/youtube-dl/download.html -o youtube-dl
chmod 700 youtube-dl
./youtube-dl  ...

if it works please fill a youtube-dl bug, open a terminal and type:

ubuntu-bug youtube-dl

Thanks


Chrome mistakenly downloads localhost/wordpress pages, but Firefox doesn't

This is likely due to a caching issue. Try clearing your browsers cache - then closing Chrome all together (Everything: all tabs and windows). This happens to me when I'm working on servers and make a change to either .htaccess or php module. I'll get the page download then my browser will remember that that.

Lastly restarting your Apache installation can help reset header information.


Add browseable = yes to the [share] block in smb.conf to allow Windows computers to successfully browse the share. It should fix your issue with clients being able to write but not read. After changing the config file, restart samba services:

sudo restart smbd
sudo restart nmbd


Cannot log in "your session lasted only 10 seconds"

It's VirtualBox that is the problem. Fix:

sudo apt-get remove virtualbox*

I also faced the same problem. I got the solution from the below thread. I solved it and my computer is working fine. Just remove and restart the computer. Good Luck.

Reference:
https://unix.stackexchange.com/questions/433644/linux-mint-18-3-cinnamon-cannot-start-a-session


How to make wireless working on HP Pavilion g6-2220?

Install synaptic from Ubuntu software center.

select and install bcmwl-kernel-source and bcmwl-sta-source . That should  install the Broadcom STA wireless driver. Hope it works!! :)


stop changing display brightness after adaptor removal

changing brightness is not an alert. kubuntu has 3 mood in energy saving. on ac, on batter, on low battery. when the you remove the ac and your battery is low it goes on the "on low battery" mood. so if in that mood your brightness is set to be high it will make you think it is an alert.


Installing autotools, autoconf on Ubuntu

To install autotools:

sudo apt-get install autotools-dev

To install autoconf

sudo apt-get install autoconf


Understanding DNS server in /etc/resolv.conf file

Your question is too fuzzy for me, but anyway I try to clarify some of the things.

As you know 192.168.122.62 is your server (VM) IP, and you should be sitting on 192.168.122.0/24 network.

If you run ifconfig -a on your host machine, I'm pretty sure you will get 192.168.122.1 as one of your interfaces IP address, it should be on a virtual interface created by your hypervisor, which can be VirtualBox for example.

At the same time I guess your virtual network is behind a NAT (Network address translation), and your host is acting as a router for your VMs.

And thats why when you lookup your resolve.conf you get your host IP, in fact your host, which is a router to your VM, is responsible of resolving DNS requests.

You can run ip r or route or netstat -nr on your VM to see your routing table.

It's been a long time that i'm not using dnsmasq, but if I remember corectly if you send a USR1 signal to it's process it will generates some log about cached addresses at its service status, something like this:

kill -USR1 `pidof dnsmasq`

If you want to run a DNS server: BIND9
To know more about dnsmasq which are listening on your host: Dnsmasq


Wifi card undetected after reboot on Ubuntu 18.04

Found it, I had to re-activate the pilot using the commands:

sudo rfkill list and sudo modprobe -r ideapad-laptop


This is normal if your CPU does not have hardware support for virtualization (Intel VT-x or AMD-v). Older 64-bit CPUs may not support this.

I'm quoting the below one from the Virtualbox forum moderator

  You can install 64bit guests on 32bit hosts, so the "bittedness" of
  the host is not the issue. The issue is that in VirtualBox, hardware
  support for virtualization (Intel VT-x or AMD-v) is required for
  certain VMs, which includes all 64bit VMs - regardless of the host.

  To enable 64bit guests, run through the following checklist :-

  Note your exact CPU model or part number, then go online and check its capabilities. The CPU must have 64bit capability and support
  either Intel or AMD virtualization technologies: VT-x or AMD-v.
  You usually need to enable VT-x/AMD-v in the host PC BIOS. You need to check with your PC manual or support forum to find out how to boot
  into the BIOS screen. This is probably not something we here at the
  VirtualBox forums can help you with. Once you get there you need to
  look for something buried in a menu, perhaps in the security category.
  The option may be called something like "Enable Virtualization
  Technology". If you see "Virtual Directed I/O" then that is a
  different thing. Remember to reboot your host PC after making BIOS
  changes - in this case a full restart from power off is required, just
  resuming from a hibernated state may not do the job.
  If (1) and (2) are already taken care of, then make sure that no other host apps are already using VT-x/AMD-v. The usual culprits are
  system level debuggers, other VM platforms, and some resident
  anti-virus applications. This has become a particular issue with 64bit
  Windows desktop and server hosts - especially Win8/Win2k12/Win10,
  since these may enable Microsoft's Hyper-v VM platform by default:
  this grabs ownership of VT-x and won't play nice with VirtualBox.
  When creating a VM, make sure you choose the 64-bit version of the guest OS template in  | General | Basic | Version, e.g.
  choose "Ubuntu (64 bit)" and not "Ubuntu" or "Ubuntu (32bit)". This
  has become more important since VirtualBox 4.3.x, because choosing the
  correct template also allows other modern processor features to be
  visible to the guest - it's not just about 64bit capability any more.


Automatically recreate partition if corrupt

Run fsck with a set of options that specify no user interaction. Test its return value to see whether it could repair the filesystem: the return value will be 0 if there were no errors, 1 if there were correctable errors, and a larger value if something bad happened. For example, with ext[234], run e2fsck -p.

e2fsck -p /dev/disk/by-label/logs
if [ $? -ge 1 ]; then
  mke2fs -L logs /dev/disk/by-label/logs
fi

If your running environment permits it, consider logging through the network instead (you need IP connectivity). Even Busybox can do it:

syslogd -R logserver
klogd

On the log server, listen on UDP port 514. You can just dump everything that comes in to a file, or you can add origin and date stamps on each line, or you can run syslog locally.


Jupiter seems to break multimonitor setup

I had the same problem and I solved it, but I do not remember which solution works.

Firstly try changing Jupiter settings:

  Jupiter → Video Displays → Both Displays (internal left)

I have a laptop on the left, but maybe for you it should be (internal right) and restart.

If that doesn't work, try this:

unity --reset

but after that, you have to set your Compiz settings one more time.


can't switch off system after creating new user account

How did you create the user? Command line useradd or the GUI?

If using the GUI, what type of user is it? Standard or Administrator?

Try to run the following command in a terminal:

id username

OR

groups username

You may need to add the user to adm and sudo group (usermod -a -G adm username) to be able to shutdown or reboot.

NOTE: If you want to understand why, check /etc/sudoers you see the following:

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL


TVHeadEnd on Pi saying "No input detected"

I am using Ubuntu 13.10 with tvheadend and vlc.
You probably use wrong plugin HTSP plugin. All that I have tried not showing the plugin in vlc Local Netword submenu exept plugin build #68. The problem with this plugin is that there is no sound on the HD channels because they are using AAC filter.
I downloaded them from here


Switch between Classic and new workspace windows (how do I)?

You are probably trying to ask about the way to move away from unity , back to classic gnome desktop.

If that is what you want to ask, you should log out from your user (from the "power" button at the top right of the screen) and log back in, after choosing "classic desktop" instead of "ubuntu".


Dash Home won't stop searching/ Can't search in Dash Home

I had this same problem. To fix it, I had to terminate the unity-scope-home and unity-scope-loader processes.

---Instructions---

First, get the process identification numbers for unity-scope-home and unity-scope-loader.

pidof unity-scope-home
pidof unity-scope-loader

Then, terminate the processes.

kill [PID for unity-scope-home]
kill [PID for unity-scope-loader]

And thats it. Searching should work now. Let me know if this works for you and good luck!


"undefined reference to `std::ios_base::Init::Init()" while compiling a hello world in netbeans

It is very strange. You need open "Project Properties" window and change
  Build|Linker|Tool from gcc to g++

Source: http://forums.netbeans.org/post-51209.html

p.s. I have no probs compiling code with g++, while I get same kind of errors trying with gcc.


My script only opens new terminals when the previous command's terminal is closed

Try adding an ampersand at the end of the lines to put processes into background.

#!/bin/bash
gnome-terminal -x /bin/bash haguichi -d &
cd /home/reed/StarMade
gnome-terminal -x java -jar StarMade.jar -force &
gnome-terminal -x ./StarMade-dedicated-server-linux.sh &


Is there any software for visual display of disk space?

My personal favorite is GNOME Disk Usage Analyzer (baobab):

You can install it with

sudo apt-get install baobab

Select any file from the table on the left side to move it to trash on right click.


unchecking show menubar by default in new terminals won't save

For gnome-shell users that want a workaround for this bug but want to preserve global menus in Unity then perhaps a better solution is to create a file /etc/X11/Xsession.d/81ubuntu-menu-proxy with the single line content:

[ "$DESKTOP_SESSION" != "ubuntu" ] && unset UBUNTU_MENUPROXY

http://shebang.brandonmintern.com/oneiric-upgrade-breaks-readline-alt-b-and-alt


Try to clear the personnel config in ~/.netbeans/ if it's not a fresh install. This may come from plugins too...


Make script executable from within script itself

Answer to your question
Of course that’s possible – but I’d not consider it good style. See below for a better solution.
If you run a shell and give it the script file as an argument it will execute it regardless of the absence of a shebang or any execution bit:
$ cat no_script
chmod +x /path/to/no_script
$ ls -l no_script
-rw-rw-r-- 1 dessert dessert 24 Jun 12 22:59 script
$ bash no_script
$ ls -l no_script
-rwxrwxr-x 1 dessert dessert 24 Jun 12 22:59 script

If the script is executed multiple times you probably don’t want to call chmod without any need every time, so just test for the file being not executable:

[ ! -x /path/to/script ] && chmod +x /path/to/script

As for your script, awk can do the whole thing in a single call:
#!/bin/bash
tune2fs -l /dev/sda1 | awk '/^Block count:/{a=$NF}/^Reserved block count:/{b=$NF}END{printf "%.1f%%\n", b/a*100}'

I removed the sudo because you don’t use it in a script – run the whole script as root instead.
Solution to your problem
I read from your question that you’re bothered by the two steps necessary to set up a script. Let’s write a script that helps with that:
#!/bin/bash
cat <&0 >"$1" &&
chmod +x "$1"

cat <&0 >"$1" makes cat read from stdin and write to the script file you give it as the first argument. Save this as e.g. makescript and make it executable with chmod +x /path/to/makescript. Now if you want to write a script, simply do it like that:
/path/to/makescript /path/to/new/script <<EOF … EOF

If you don’t want to type /path/to/makescript every time, define an alias like makescript=/path/to/makescript in your ~/.bash_aliases or ~/.bashrc or move it to a directory in your PATH.
Example run
$ echo -e '#!/bin/bash\ncat <&0 >"$1" &&\nchmod +x "$1"' >makescript
$ chmod +x makescript
$ ./makescript a_test_script <<EOF
> #!/bin/bash
> echo a script
> EOF
$ ls -l *script
-rwxrwxr-x 1 dessert dessert 26 Jun 13 12:44 a_test_script
-rwxrwxr-x 1 dessert dessert 43 Jun 13 12:44 makescript
$ ./a_test_script
a script

The sky is the limit.


I just faced the same issue. The window is non-resizable and its size does not depend on the resolution.

While it is not possible to use control + scroll wheel or other usual key combinations to change the font size and make the login screen small enough to fit, you can use the tab key to select the "Okay" button located underneath the semi-transparent warning text and press enter to validate the form. You must do that again on the following confirmation page.

If you don't touch anything on the page, the "Ok" button is actually already selected, so you should only have to press enter twice.

Hope that solves your issue.


How do I create a snap for a MonoGame application?

Here is the proper format:

https://gist.github.com/02f1566736b10e3796d148eb4084bb15

I was missing a '.', thanks to @didrocks in #snappy on freenode for clarifying what I needed to do.

Since the bug was unclear, I posted a bug report here:

https://bugs.launchpad.net/ubuntu/+source/snapcraft/+bug/1587455


How to prepare a disk on an EFI based PC for Ubuntu?

The most convenient and reliable way to prepare a disk is using the GNOME partition editor. GParted is included in the Ubuntu installation media, but in some cases it is better to use the original. When you boot from the Ubuntu install media and you already have a swap partition,
the partition is mounted. Partition swapoff and unmount unfortunately does not always work.

Use GParted from the Ubuntu installation media ... in case it does not work you can
download GParted from the project website and create a bootable DVD/USB media.

Boot from GParted Live media, once on the desktop GParted opens automatically.
Choose the disk you want to work on from the application menu on the top right.

Click on Device → Create Partition Table → Select gpt → Click Apply

Click on Partition → Create new Partition:
New size: about 500 MB - File system: fat32

Click on Partition → Create new Partition:
New size: amount of RAM - File system: linux-swap

Click on Partition → Create new Partition:
New size: minimum 20 GB - File system: ext4

Optionally create more partitions:

Click on Partition → Create new Partition:
New size: arbitrary - File system: arbitrary

These partitions can be used to store the personal data that are separated from the system. Use ext4 when Ubuntu or other Unix/Linux based systems are the only systems that need to access them. When you want to make the data accessible to Windows as well, choose ntfs or fat32.

Click on Apply after checking that everything is correct, wait until GParted completed the tasks.

Right-click the fat32 partition → Manage flags → Select boot and esp.

Now close GParted, shut down the computer, remove the GParted Live media.

Boot from Ubuntu installation media and select Try Ubuntu without installing.
On the desktop click Install Ubuntu and when asked, choose 'Something else'.

Select the ext4 partition you have created with GParted for Ubuntu before.
Select / as mount point and ext4 as file system ... start the installation.

Presentation : How to set up a disk and create new partitions with GParted

Example : Prepare the disk for the installation using an Ubuntu Live media

Additional information concerning swap : Community Help Wiki SwapFAQ

Note:

Doing it this way has one big advantage: You decide yourself about the whole partition layout and can prepare everything for eventual changes being made in the future. The partition sizes are suggestions, users of course shall choose them fitting to their needs. What first looks a bit complicated, is, once you have understood the systematic behind it and done it one time, easy.


You can use the ~/.ssh/config file for this.
I'll give you an example:

HOST <yourHost>
    HostName <IP or DNS of the Host>
    Port <port (just needed if other then the standard (22))>
    User <username to connect>
    IdentityFile <path to an private keyfile (optional) - you can use ~, also>

If you have more than one host just repeat this sections for every host...

to use it just type ssh <yourHost>.

Hope this helps!


I would advise running the following ...

sudo rm /var/cache/apt/archives/* -vf
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get autoremove -y

Let me know if any errors occur from the above.


How do I prevent iptables from loading on boot?

Flushing iptables rules / accept everything

You may skip this step since you mentioned in your question that you have flushed all the rules.

iptables -X &&
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

After flushing your iptables rules.

Run:

iptables-save > save-file
iptables-apply save-file


How to set Clang 9 as the default C++ compiler on Ubuntu 19.10?

Install clang version 9 from the default Ubuntu repositories in Ubuntu 19.10 and later.

sudo apt install clang-9

/usr/bin/c++ is actually a symbolic link to:

/etc/alternatives/c++

which in turn is also a symbolic link to:

/usr/bin/g++

so on Ubuntu c++ is g++ and g++ is g++ explicitly.

Set Clang 9 as the default C++ compiler using c++ so that build processes can still use g++ explicitly if they want to.

sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/c++ 40
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 60
sudo update-alternatives --config c++

After running sudo update-alternatives --config c++ a menu of c++ versions will appear and you will be asked to select the default c++ version as follows:

Press <enter> to keep the current choice[*], or type selection number:

Input a selection number from the menu and press Enter.

clang-9 can  also be installed in Ubuntu 18.04 if the bionic-proposed/universe repository ( deb http://XX.archive.ubuntu.com/ubuntu/ bionic-proposed universe ) is added to the Ubuntu 18.04 software sources. Replace XX in deb http://XX.archive.ubuntu.com/ubuntu/ bionic-proposed universe with your country code.


@Marco-Ceppi 's solution is already integrated into do-release-upgrade.

When you run do-release-upgrade it starts a screen session automatically. If your ssh session gets disconnected, you can resume the installation. All you have to do is open a new ssh session, and run do-release-upgrade again. It will reconnect to your previous installation.

A second risk, pointed out by @sepp2k is that your sshd server might need to be upgraded, and it could perhaps not restart correctly. Therefore the upgrade program runs a second deamon, at the port specified. You should check your network configuration to make sure you have access through this port, before resuming.

Good luck.

Moreover, the screen-session do-release-upgrade starts by itself is run under the root account, so if your own screen-session crashes, you will be able to recover by running sudo screen -x, if (for some reason) the command do-release-upgrade doesn't recover it by itself, which seems to be common.


How do I add artists to the Ubuntu One store?

7digital manages the catalogue of songs. As far as I know, past the branding and sales kickbacks, Canonical has very little to do with its running.

If you want something adding, you'll needed it added to 7digital's main catalogue. To do that you'll need to contact 7digital's business arm and work out a deal (where you can also get answers for your other sub-questions).

They have a separate contact page (and website for that matter) for business-related queries here:

http://about.7digital.net/Contacts


Is there a equivalent application to Everything search engine (Windows) on Ubuntu?

You can try tracker-search

It is available in the Software Center.

To install it, run the following command in a terminal:

sudo apt-get install tracker-gui

After installing it, search for Desktop Search in the dash and open it. You can then search for the files and folders in the search bar.


Does driver exist for Trendnet AC1200 Dual Band Wireless adapter for Ubuntu 14.04 64bit?

You can check with the following command in your terminal

sudo lshw -C network | grep driver


Not sure what fixed it, but it's working now.

I did ufw allow 5240 and reauthenticated after clearing cache and cookies, then the dashboard appeared normally. Checked the cookies and this time the csrf cookie has been set.


How to change button icon when button clicked, python quickly

Just use an Expander, that's what Update Manager is using here, too. It's drawing the arrows and taking care about to show and hide what's inside.


Change wallpaper automatically in ubuntu 13.10

Run these commands in a terminal:

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

Reference: http://www.howtogeek.com/howto/25549/how-to-create-a-wallpaper-slideshow-in-ubuntu/


Have 2 unknown smb network shares on my ubuntu machine

This could happen if you have connected to a network where someone else offers an open share called konichiwa. Your system runs an SMB client that sends out broadcast packets, basically asking around for SAMBA shares, much like your network card finds Wi-Fi networks to connect to. If a share is found, and if it allows guest access with no password, it will be mounted, and be accessible to you.
Keep in mind that this is their security problem, not yours. Whereas you can access their share, they will not be able to access your system.
The konichiwa share will be gone once you reboot, and then so will the Windows Network icon (which is a pool of all SAMBA shares that are currently available to you).


How to reenable Unity 3D after installing Bumblebee?

Bumblebee is pretty unstable right now, especially in 12.04.

Nvidia drivers a pretty solid, even if they aren't open sourced. I recommend sticking to the official driver. I installed Bumblebee on a 9800GT and it took out my whole xserver.

use

sudo apt-get autoremove --purge bumblebee bumblebee-nvidia nvidia-current

and download the official driver from nvidia:
http://www.nvidia.com/Download/index.aspx?lang=en-us


Can't connect VPN with OpenVPN on Network Manager Ubuntu 14.04 LTS

The issue is DNS settings so you can try this

CHANGING YOUR DNS SETTINGS ON
WINDOWS, MAC, ANDROID, IOS, LINUX

If it didn't work you can modify /etc/resolv.conf and add nameserver "DNSaddress"

But resolv.conf is a dynamic file so to add this line permanently:

sudo nano /etc/resolvconf/resolv.conf.d/tail

and add your DNS servers like this nameserver "DNSadress".

I hope this post could help others.

List item


Unable to connect to parsoid.wmflabs.org:8080

Solved. I removed # deb [arch=amd64] http://parsoid.wmflabs.org:8080/deb wmf-production main from /etc/apt/sources.list and now the warning has gone.


RStudio does not launch after installation

Not sure whether this is THE solution (and it's probably too late?) but it might be good to check the following fix I used for a similar issue on my Kubuntu 14.04 (the same happened with 15.10) where I couldn't launch RStudio neither from launcher nor from terminal.
If you have warning messages when starting R about language configuration (sorry I don't remember exactly what was the message as I solved it...) it might be the cause of non-starting RStudio.
The same problem of locale settings is visible when you use apt-get and you get "LC_ALL = (unset)".
I got it fixed very easily thanks to this post where it's explained how to edit the file environment. Using:

sudo nano /etc/environment

you add a line:

LC_ALL="en_GB.utf8"

and then reboot

(adapt "en_GB.utf8" with the language you want).

After a reboot RStudio could be launched from command line as well as KDE launcher.
... it just took me 48h to find it out :-/


How to identify devices connected to serial port

To find out information about your serial ports, you can run the following command:

dmesg | egrep --color 'serial|ttyS'

To report or set the configuration information associated with a serial port, you can run the following commands:

sudo apt-get update
sudo apt-get install setserial
setserial -g /dev/ttyS[0123]

More information about this: Site


Can't download a file keep getting this error ERROR 404: Not Found

You can't download it because such file does not exist, as you can see if you use any browser to access the link used in your command: http://bruteforce.gr/wp-content/uploads/kippo-graph-VERSION.tar.gz.

You can get the program you were looking for, Kippo-graph, here  instead:

Kippo-graph (0.9.3 version)  at sourceforge.
Kippo-graph (1.5.1 version), the latest version, at bruteforce.


How to disable light-locker in Xubuntu 14.04 via command line?

You can completely uninstall light-locker, and use xscreensaver. Despite being a bit ugly, it works well and I had never had any problems with it.

To uninstall light-locker, run:

sudo apt purge light-locker

Then install xscreensaver by running:

sudo apt install xscreensaver

After that, run xscreensaver from your menu and click OK if it asks you to enable the xscreensaver daemon.

To have xscreensaver start with your computer:

Run Session and Startup from your menu.
Select the Application Autostart tab.
Click Add.
On the pop-up window write the following:

Restart your computer. xscreensaver should be up and running.


Why doesn't Ubuntu have a strategy document?

Though not quite a "strategy" document, the About Ubuntu page covers many of the beliefs of Ubuntu, mainly the story, the philosophy, Licensing and Governance, Code of Conduct, Leadership Diversity, and the relationship with Debian and derivatives.


ppa:fkrull/deadsnakes-python2.7 is the latest version of python2.7

sudo add-apt-repository ppa:fkrull/deadsnakes-python2.7
sudo apt-get update
sudo apt-get upgrade

It will upgrade python to 2.7.10


How can an application installed via wine be enabled to access NTFS partitions automatically and quickly?

My guess is that NTFS are not automatically mounted as executable partitions.  You need to mount it as a "ntfs-3g" partition.  I'm not smart enough to know what the difference is, but changing it allowed me to better control file permissions (e.g. executable).

In your /etc/fstab:
     [partition] [/path/to/mount/] ntfs-3g defaults,auto,uid=1000,gid=home,umask=002 0 0

It's explained better at the Ubuntu Forums: Mount NTFS partitions...

Good luck!


I think you've made a bad assumption. With the drop_caches interface you can clear the caches that are managed by the kernel, but that doesn't reset all userspace processes back to their previous state.

The SQL server is probably caching some intermediate results, or maybe even the final result of the query, in its own memory. Or maybe it has dynamically adjusted its execution plan for the query based on statistics gathered during the first 2 runs.

You can partially compensate by restarting the daemon, but with a complex system like an SQL server, it's going to be really hard to exactly reproduce any previous state other than "freshly installed". Unless you snapshot the entire machine.


How to display free disk space in Lubuntu/LXDE?

In fact a good answer to what I was asking here for --  something in LXDE/Lubuntu that would permanently display free space as Xfce does in the panel -- is coming from the file browser which always displays free space in the lower part of the window: it's true for PCMan, Nautilus and Thunar. So simple, but I don't think there's something better in Lubuntu.

In pcmanfm:

In Thunar:


Does anyone know what this means when enabling unattended upgrades?

Seems your question is related to Debian, it's the configuration which defines which packages automatically are going to be upgrade.

Each package has some meta data, e.g:

Origin: Ubuntu
codename: Xenial
label: Security

it means packages that are from Ubuntu and specific to "xenial" with the label of "security" are going to be upgraded automatically.

For Ubuntu you should have something similar to:

Unattended-Upgrade::Allowed-Origins {
    // ${distro_id} and ${distro_codename} will be automatically expanded
    "${distro_id} stable";
    "${distro_id} ${distro_codename}-security";
    "${distro_id} ${distro_codename}-updates";
//  "${distro_id} ${distro_codename}-proposed-updates";
};

More info about configuration, if you're running Ubuntu follow this link and you should be fine.


"cannot create directory `JAVA': Permission denied " how to solve this issue?

Instead of mkdir JAVA use sudo mkdir JAVA, then enter your password.

That should fix it.

However, you only really need to use one command instead of these two or three.

cd /
cd usr
sudo mkdir JAVA

cd just changes the directory, no point in doing that. You can simply put the path of the file after mkdir, like so.

sudo mkdir /usr/JAVA


dpkg: error processing package php5-mysql (--configure):

This happened to me when i removed mysql-server and tried to reinstall.
The way i solved this was by running the following

sudo apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5 mysql-client-5.6 mysql-server-5.6
sudo apt-get autoremove
sudo apt-get autoclean

sudo rm -rf /etc/mysql

sudo apt-get install mysql-server mysql-common mysql-client

Link apparmor:

sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/usr.sbin.mysqld

sudo /etc/init.d/apparmor restart
Install MySQL 5.6:

sudo apt-get install mysql-server-5.6


Konica Minolta BizHub C220 driver problem avoids us to switch to Ubuntu

As i am new to Ubuntu and Linux. after a little search i solved the problem. In the printer web site admin console there is a page about ipp protocol information like this:

Printer URI
http://192.168.0.103/ipp
http://KMBT6C980D.home/ipp
ipp://192.168.0.103/ipp
ipp://KMBT6C980D.home/ipp

I just entered that info into printer utility. And now it works.


Maximizing window makes content disappear

Installing the PPA for nvidia and updating to the latest Nvidia driver has solved the problem.

In the terminal I typed: sudo apt-add-repository ppa:ubuntu-x-swat/x-updates

Then did an update sudo apt-get update and went to the Update Manager. Updated the Nvidia driver, rebooted. Tested. Everything works as it should.

I need to add that the same PPA also has Ati drivers. This might solve similar Ati problems.


After the install, you need to source the sa_config.sh file that is installed in the SQLAnywhere bin32/64 directory.  This will set up your path and environment variables so you can run scjview.
On Windows, everything should be properly setup by the install program, assuming you chose to install the tools and plugins during the setup process.  You may have to restart the emulator for it to pick up the environment changes though (I don't know a lot about Wine).


How do I open the dash when a fullscreen application has the focus? (12.10 13.04)

Actually, when you press the "super" key when a full screen application is in focus, the dash opens, but it can't gain "paint" focus, as the application is still at the top of the stack. But strangely, the dash has the keyboard focus.

As far as I know, there is no way to see the dash when a full screen application is working. Only way is to get out of full screen, and then press "windows" key to get the dash.


Can I install Ubuntu and Ubuntu-Mate at the same time?

yes, you can.
if you are asking about dual booting it won't cause any problem and it's a simple procedure. if you are looking for installing mate in your current ubuntu machine use mate ppa for ubuntu 15.10 or use there commands

sudo add-apt-repository ppa:ubuntu-mate-dev/wily-mate
sudo apt-get update
sudo apt-get install mate-desktop-environment-core


Wifi not working, Ubuntu 16 on HP Stream 13

It could be the hardware switch on your computer. It's labeled as WLAN and if it's off your computer will not be able to connect wireless to the internet. So switch it on and that should fix the problem.


What is the difference between running a shell installer inside the directory and outside?

You did not show error messages you are getting, but best guess is install.sh uses  other files in its directory/subdirectories using relative path. And when you run it from a directory one level higher, it has no idea where to find those files.


How do I change options in PAM configuration?

You press the spacebar to select/deselect options, and use the arrow keys to move up and down the list.


Handbrake-cli updated and now does not work

Yes. The repo version is broken. I found a comment from the author, I really can't remember where but he acknowledges the official version is no good.

Good news is that he's got a PPA that works well and works flawlessly on my system.

Here's the terminal stuff -

sudo apt-add-repository ppa:stebbins/handbrake-snapshots
sudo apt-get update
sudo apt-get upgrade

He said he'll get it fixed in due course, once he's figured out what went wrong.


Is there a text-based window switcher for Unity?

The fun part of "home made products" is always that you can make it pretty much exactly as you like. The possible downside is that you easily get carried away a bit by a project if it is nice to work on...

That might be the case with the script below :). While I would have preferred to add a detailed explanation on how it works "under the hood", this is a "ready to use" solution. Although I added some commentary lines, it is hard to give a simple inside explanation on the code. It seems however to be close to what you are looking for.

What it is

The script is a purely text-based solution to list all opened, "normal" application windows (and raise a chosen one), but it has a number of options:

list the windows, sorted by window name:

Run with the command:

python3 <script> -win

type the first character(s) of the sought window and press return to bring the window to front.
list the windows, sorted by application:

Run with the command:

python3 <script> -app

list the windows, sorted by workspace:

Run with the command:

python3 <script> -ws

As you can see, the displayed columns are: Window name, Application, Workspace. The pre- set sorted column is always the first one.

Fuzzy?

To select an item from the list, simply type the first character. If there are more items that meet the typed character(s) the arrow keys will only browse through the items that meet the typed characters:

Furthermore:

workspace indication
The current workspace is marked with a *: e.g. if you see 2*, it means the window is on workspace 2 and  workspace 2 is the current workspace. This works no matter how many workspaces you have.

The window size
of the slection window is set automatically to the window's (longest) name and the number of windows to be displayed, e.g.:

or:

How to use

The setup is pretty straightforward:

The script (definitely) needs wmctrl:

sudo apt-get install wmctrl

Then copy the script below into an empty file, save it as list_windows.py
Then Test- run it with the commands:

python3 /path/to/list_windows.py -app
python3 /path/to/list_windows.py -win
python3 /path/to/list_windows.py -ws

If all works fine, add one or more of the preferred commands to one or more shortcut keys: choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command

The script

(still "unpolished" code)

#!/usr/bin/env python3
import subprocess
import socket
import sys

arg = sys.argv[1]
# list (column) header titles and their (data) position in the produced window data list
cols = [["Workspace", -1], ["Application name", -2] , ["Window name", -3]]
# rearrange columns, depending on the chosen option
if arg == "-app":
    cols = [cols[1], cols[2], cols[0]]
elif arg == "-ws":
    cols = [cols[0], cols[2], cols[1]]
elif arg == "-win":
    cols = [cols[2], cols[1], cols[0]]
# extract headers, list positions, to be used in the zenity list
col1 = cols[0][0]; i1 = cols[0][1]
col2 = cols[1][0]; i2 = cols[1][1]
col3 = cols[2][0]; i3 = cols[2][1]
# just a helper function
get = lambda cmd: subprocess.check_output([
    "/bin/bash", "-c", cmd
    ]).decode("utf-8")
# analyse viewport data, to be able to calculate relative/absolute position of windows
# and current viewport
def get_spandata():
    xr = get("xrandr").split(); pos = xr.index("current")
    res = [int(xr[pos+1]), int(xr[pos+3].replace(",", "") )]
    spandata = get("wmctrl -d").split()
    span = [int(n) for n in spandata[3].split("x")]
    cols = int(span[0]/res[0]); rows = int(span[1]/res[1])
    curr_vector = [int(n) for n in spandata[5].split(",")]
    curr_viewport = int((curr_vector[1]/res[1])*cols + (curr_vector[0]/res[0])+1)
    return {"resolution": res, "n_columns": cols, "vector": curr_vector, "current_viewport": curr_viewport}

posdata = get_spandata()
vector = posdata["vector"]; cols = posdata["n_columns"]
res = posdata["resolution"]; currvp = posdata["current_viewport"]
# function to distinguish "normal" windows from other types (like the desktop etc)
def check_window(w_id):
    w_type = get("xprop -id "+w_id)
    if " _NET_WM_WINDOW_TYPE_NORMAL" in w_type:
        return True
    else:
        return False
# split windowdata by machine name
mach_name = socket.gethostname()
wlist = [[l.strip() for l in w.split(mach_name)] for w in get("wmctrl -lpG").splitlines()]
# split first section of window data
for i, w in enumerate(wlist):
    wlist[i][0] = wlist[i][0].split()
# filter only "real" windows
real_wlist = [w for w in wlist if check_window(w[0][0]) == True]
# adding the viewport to the window's data
for w in real_wlist:
    w.append(get("ps -p "+w[0][2]+" -o comm=").strip())
    loc_rel = [int(n) for n in w[0][3:5]]
    loc_abs = [loc_rel[0]+vector[0], loc_rel[1]+vector[1]]
    abs_viewport = int((loc_abs[1]/res[1])*cols + (loc_abs[0]/res[0])+1)
    abs_viewport = str(abs_viewport)+"*" if abs_viewport == currvp else str(abs_viewport)
    w.append(abs_viewport)
# set sorting rules
if arg == "-app":
    real_wlist.sort(key=lambda x: x[-2])
elif arg == "-ws":
    real_wlist.sort(key=lambda x: x[-1])
elif arg == "-win":
    real_wlist.sort(key=lambda x: x[-3])
# calculate width and height of the zenity window:
# height = 140px + 23px per line
h = str(140+(len(real_wlist)*23))
# width = 250px + 8px per character (of the longest window title)
w = str(250+(max([len(w[-3]) for w in real_wlist])*8))
# define the zenity window's content
cmd = "zenity --list --hide-column=4 --print-column=4 --title='Window list' "\
      "--width="+w+" --height="+h+" --column='"+col1+"' --column='"+col2+"' --column='"+col3+\
      "' --column='w_id' "+(" ").join([(" ").join([
          '"'+w[i1]+'"','"'+w[i2]+'"','"'+w[i3]+'"','"'+w[0][0]+'"'
          ]) for w in real_wlist])
# finally, call the window list
try:
    w_id = subprocess.check_output(["/bin/bash", "-c", cmd]).decode("utf-8").split("|")[0]
    subprocess.Popen(["wmctrl", "-ia", w_id])
except subprocess.CalledProcessError:
    pass


Ubuntu 17.10 won't accept correct password

If keyboard is a problem, you can try Onscreen keyboard.
You can also change keyboard layout, by clicking the upper bar icon.


add accented character to american keyboard

following the below posts and warnings in it.. proceed with your own..

remap Caps + L to dash
Keyboard (including on screen keyboard) doesn't work

you need to edit your symbols like below in the file /usr/share/X11/xkb/symbols/us after taking backup of the same..

key <AD06> {    [     z,    Z       ]   };
key <AD07> {    [     u,    U       ]   };
key <AD08> {    [     i,    I       ]   };
key <AD09> {    [     o,    O       ]   };
key <AD10> {    [     p,    P       ]   };
key <AD11> {    [ bracketleft,  braceleft, egrave, udiaeresis   ]   };
key <AD12> {    [ bracketright, braceright  ]   };

key <AC01> {    [     a,    A       ]   };
key <AC02> {    [     s,    S       ]   };
key <AC03> {    [     d,    D       ]   };
key <AC04> {    [     f,    F       ]   };
key <AC05> {    [     g,    G       ]   };
key <AC06> {    [     h,    H       ]   };
key <AC07> {    [     j,    J       ]   };
key <AC08> {    [     k,    K       ]   };
key <AC09> {    [     l,    L       ]   };
key <AC10> {    [ semicolon,    colon,  eacute, odiaeresis  ]   };
key <AC11> {    [ apostrophe,   quotedbl, agrave, adiaeresis    ]   };

key <AB01> {    [     y,    Y       ]   };

gnome-shell refresh with Alt+F2rEnter or Logout & Login may be required..not tested..

then you need to choose which key is for level3 from "gnome-tweaks" or via "dconf-editor" or via "command line"

Gnome-Tweaks way

Dconf-Editor way

Command line:

gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:ralt_switch']"


how to remove root login from login screen

In GDM

Edit /etc/gdm/custom.conf file and remove/comment out AllowRoot=true.

In KDM

Edit /etc/kde4/kdm/kdmrc file and change AllowRootLogin=true for AllowRootLogin=false.

In LightDM

This procedure disables the "Other" menu, so you can type the username root and login. You must edit /etc/lightdm/lightdm.conf and add greeter-show-manual-login=false. Then reboot.

To disable root login just type:

sudo passwd -dl root


It's possible that the Alsa PPA might have a fix. It's worth a try:

sudo add-apt-repository ppa:team-iquik/alsa && sudo apt-get update && sudo apt-get upgrade

It might work for you as you're using an older version.


Ubuntu 14.04 64(AMD) First time isntall FROZEN after login

Two things may be wrong.  With the second possibility usually you don't make it to the login screen, so I kind of doubt that's it, but a corrupt install remains a possibility.

This sort of sounds like a common Unity malfunction.  The forums are full of Ubuntu 14.04 users trying, usually in vain, to make Unity work.  If it'll let you, and it sounds like you may have to do it from the command prompt, you'll need to install another desktop/ interface.  If you're having this amount of trouble with Unity I'm not sure whether to try Gnome or not; it's the most popular alternative.

You can also avoid Unity by installing another flavor of Ubuntu.  The only difference is the interface.  There is no advantage in terms of learning Ubuntu from the books to using Unity; it doesn't resemble what is in the books on how to use Ubuntu. Try Kubuntu or Xubuntu.   There are also prepackaged versions like Zorin, which is free to try but costs $12.50 for full functionality; however, on systems old enough to not even get to square one with unity, the install often hangs.  You can install the trial version.  I just installed Ubuntu on a slightly older computer with an older processor and onboard graphics; the Zorin install hung, but Unity held up long enough to install the gnome desktop, which of course was the first thing I did.

The reason why Unity doesn't work appears to be incompatible video cards.  Much is often made of the drivers, but they don't seem to be the problem. There isn't any particular driver that causes issues nor driver solution that fixes them, and indeed most people who run into this problem can't fix it by changing drivers.  It is often suspected of being a video issue, and I was outright getting warnings that my graphics might not be able to do what I was doing so did I want to do it.  I found a warning that it is important to make the choice when offered not to use the option that may slow your graphics, or speed up your graphics but slow your computer, or whatever.  CPU resource intensive graphics features that you don't need, that might be resolved by a high powered gaming video card but most people running Ubuntu don't have that.

And what is more, gnome with the cairo dock LOOKS far nicer (with the low powered graphics option on Cairo dock).   I don't even know how what could have thought of that side-slide thing.

Now, mind you, half the world's video cards seem to be incompatible with Unity.  I actually read, within the past week, a blog by an organizational psychologist or something of the sort, thinking that the reason why the Unity desktop is having popularity issues is that it was developed in an isolated laboratory and users weren't consulted, as if they had been they wouldn't care, no matter how terrible Unity actually is.  I think the key is the part about an isolated laboratory.  They didn't use real world computers and have no clue that Unity doesn't work on them; rest of world of course didn't take long to discover that.

You could with Ubuntu 12 or 13 and see if you get the same problem; I believe they are both missing Unity.   I myself was able to log in, though my system would only stay usable for about 15 minutes.   And I had to constantly log out and do stuff in command line to get the graphics back.

Reading between the lines, you had another OS, or more than one OS, installed on this hard drive, and you wiped it and installed Ubuntu?

The boot loader may be confused. When this sort of thing happens to me I simply repeat the install, and I've never had it not clear up.

Also, now, it's only been a week since I last installed Ubuntu...  I'm pretty sure I did have to install it twice, it had Windows...   but do pay close attention and make sure that if it gives you the option, and it probably does, you do start completely fresh with a new boot loader, boot partition, everything, I mean, delete ALL the partitions that may have been there.  And if that's the first time you've tried that you might get to repeat it yet again.

That's been my experience, the last two times I've installed Ubuntu.  One had Windows installed on it and the other had two Linux OS's.

Dora


What command line to reliably traverse several directory levels

I would do something like this

#! /bin/bash

[[ -d "$1" ]] || { echo "$1 not a directory, exiting..."; exit 1; }

find "$1" -type f | while read F; do
  # do what you want with the "$F"
done

exit 0

and then invoke the script via ./my_script <directory>


I connect my iPhone 5 IOS 10.3.1 but my Ubuntu 16.04 doesn't seem to detect it

I have a new iPhone and have to use updated drivers from a ppa. Created mount point, pair phone, and mount with ifuse. I also then can drill down to /mnt/iPhone in Naulitus and see files.
sudo apt-get update
#ppa not required with 20.04 or newer
#sudo add-apt-repository ppa:martin-salbaba/ppa+libimobiledevice
sudo apt-get install ideviceinstaller libimobiledevice-utils ifuse libimobiledevice6  libplist3
sudo apt update
sudo apt upgrade
sudo mkdir /mnt/iPhone
sudo chown -R $USER:$USER /mnt/iPhone
sudo chmod -R a+rwX,o-w /mnt/iPhone

idevicepair pair
Info
ideviceinfo -d
ifuse /mnt/iPhone/
ls  /mnt/iPhone

to unmount:
fusermount -u /mnt/iPhone
idevicepair unpair
SUCCESS: Unpaired with device 78c......

See also & post #19:
https://bugs.launchpad.net/ubuntu/+source/libimobiledevice/+bug/1623666


Grant users access to directories on partition

You can mount the drive in /mnt or /media so all users can get to it. Then chown each of their directories to be owned by them and their group. To keep everyone else out chmod 770. And in your example I would drop the -R Just give the main directory no permissions for the world and no one but the user will be able to get in.

EX:
user john has folder in top level of drive called john and the drive is mounted at /mnt/drive

sudo chown john:john /mnt/drive/john

sudo chmod 770 /mnt/drive/john


How to ensure that all new users have the same profile settings as the current user?

Yeah use /etc/skel/. Anything you shove in there will be copied out to a new user profile when you create them.

The most meaningful way to use this in practice (for deep customisation) is to create a user, customise their account to how you want all the others to look and then copy things in that profile out to /etc/skel/.

One note: a lot of applications will create home directories on their first run. Because of that it's important you only run the things you want to customise under your template user account. Otherwise you'll end up contaminating things that don't need to be there.

Second note: You may need to update the template over time as default applications change. It's not a long process so as long as you spend 10 minutes testing a new profile each release upgrade, you should be fine.


How do I make named directories permanent in zsh and how do I edit them. Also what is the best place to look for documentation.

Set static named directories

Open up ~/.zshrc in your favorite editor and add the hash commands one after one like you did in your example, e. g.

hash -d foo=/etc
hash -d zshdoc=/usr/share/doc/zsh-common

and so on. The file .zshrc in your home directory will be loaded every time you start zsh.

Aliases

You can also put your alias definitions there, just the same way. However, it is more useful to put aliases in a separate file, e. g. ~/.zshaliases and then source this file from .zshrc. So, add this to .zshrc:

. ~/.zshaliases

and then add your alias definitions to ~/.zshaliases like this:

alias ll="ls -l"
alias la="ls -la"

These are just examples of course. The reason to put those aliases in a separate file is, that you can edit it with your favorite editor and then simply reload all aliases by issuing the command . ~/.zshaliases.

Documentation

Personally I like most the zshall manual page which you can open by running the command man zshall. It is very complete.

Other good sources for zsh documentation are:

http://zsh.sourceforge.net/Doc/Release/zsh_toc.html
http://www.zzapper.co.uk/zshtips.html
http://www.zsh.org/cgi-bin/mla/wilma/users (mailing list archive, to look for specific solutions others have asked for already)


Why there is a difference between the output of 'echo $VAR | wc -c' and 'echo ${#VAR}'?

It's the way echo works. Now do

echo koko

You get

georgek@georgek-HP-Pavilion-17-Notebook-PC:~$ echo koko
koko

But do echo -n koko and you get

georgek@georgek-HP-Pavilion-17-Notebook-PC:~$ echo -n koko
kokogeorgek@georgek-HP-Pavilion-17-Notebook-PC:~$

So wc is capturing the newline character too. Use

echo -n "${VAR}" | wc -c

To get the desired result. The echo command will add the newline character, so that gets counted too. To remove this and get the real count use the -n option.


Refreshing desktop screen using a command line

Go to terminal and
    type

  unity --replace

Press the Enter key


Different proxy servers to diferent networks

There's no simple way to do this in a GUI, I believe. However you can try to use a so called PAC (Proxy Auto Configuration) script. This works for programs that obey the proxy settings in Ubuntu or for programs that can be set independently to a proxy like Firefox. However you need to do a bit Javascript programming. Basically you can make the script to figure out to which network you're connected and let it select the appropriate proxy. A good site with useful information is here.


Get gmusicbrowser to play .m4a music files?

You probably installed the gstreamer 1.0 plugins, but gmusicbrowser is still using their 0.10 versions even on 14.04.

To properly play/decode MPEG-4 AAC you need to install the following packages:

sudo apt-get install gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly

Note: See this answer to know why they are named like this.


Install OpenMPI from repository with GCC instead of Intel

As it seems, the Intel mpicc.openmpi overwrote the official one from repository or one of its linked libraries.
Here is my output of a official install from repository:
  ~$ dpkg -S /usr/bin/mpicc.openmpi
  libopenmpi-dev: /usr/bin/mpicc.openmpi

  ~$ ldd /usr/bin/mpicc.openmpi
      linux-vdso.so.1 =>  (0x00007ffd785f4000)
      libopen-pal.so.13 => /usr/lib/libopen-pal.so.13 (0x00007ff1d848d000)
      libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff1d8270000)
      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff1d7ea6000)
      libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff1d7ca2000)
      librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff1d7a9a000)
      libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007ff1d7896000)
      libhwloc.so.5 => /usr/lib/x86_64-linux-gnu/libhwloc.so.5 (0x00007ff1d765c000)
      /lib64/ld-linux-x86-64.so.2 (0x000056499326f000)
      libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007ff1d7450000)
      libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007ff1d7246000)

It does not relay on those missing libraries.

To fix it you can reinstall libopenmpi:
  sudo apt-get install --reinstall openmpi-bin libopenmpi-dev

Also notice /usr/local/lib/libopen-pal.so.13. It's in /usr/local/lib/ folder so it has higher priority then official one in /usr/lib/, compatibility may be broken.
Check for all sub-versions using
  ls -l /usr/local/lib/libopen-pal.so.13*

then rename them, example
  sudo mv /usr/local/lib/libopen-pal.so.13 /usr/local/lib/libopen-pal.so.13.backup


Apt-get fails Errors were encountered while processing openafs-client

I've been using this Ubuntu machine for a long time. I believe that the openafs failure had to do with a repository that had been removed.
I used "sudo apt full-update" which resolved the problem.


How to block all the interrupts in linux

If use the following commands:

xmodmap -e "keycode 64 = "
xmodmap -e "keycode 108 = "

both Alt (left and right) will be disabled/blocked. In the same mode you can disable Tab, respectively F4:

xmodmap -e "keycode 23 = "
xmodmap -e "keycode 70 = "

To enable them back to their normal behavior, use:

xmodmap -e "keycode  64 = Alt_L Meta_L Alt_L Meta_L"
xmodmap -e "keycode 108 = Alt_R Meta_R Alt_R Meta_R"
xmodmap -e "keycode  23 = Tab ISO_Left_Tab Tab ISO_Left_Tab"
xmodmap -e "keycode  70 = F4 F4 F4 F4 F4 F4 XF86Switch_VT_4"

Use xmodmap -pke command to see all keycodes and their map assignment.


Why has lightdm-remote-session been removed from Ubuntu 15.04?

According to the publishing history it was deleted by Adam Conrad because it was "buggy and unmaintained", citing unresolved security bugs like 1158373 as evidence of this.


It's been a while since this was asked, but here's the solution that worked for me with VLC 3 from the same repository:

Tools > Preferences > Video > change the output field from Default to x11 video output (XCB).

Found it in a similar thread here.


Possible values for Autocleaninterval for APT::Periodic::AutocleanInterval "0";

I wanted to confirm how can i adjust it to make a monthly cleaning or daily should it be "30" or "1"

The option accepts days so of course it is 30. 1 would be arbitrary if it would not be 1 day since it could be 1 day, 1 week, 1 month, 1 year, 1 decade, 1 century.


How to resolve multiple hosts inside a NAT firewall

If you have two hosts behind the same NAT, they will resolve to the same IP address. There is no way around this; you only have one IP address and anyone coming from the outside needs to use this address.

If you want different traffic to go to your servers, you need to set port forwarding appropriately (for example port 80 to 192.168.1.2 and port 53 to 192.168.1.3). You set this in your router's NAT configuration. The only way I know to get connections to your NAT device to get routed to different local machines is to use different port numbers.


Installer hangs during installation at "select location" screen

A friend gave me a hand with this, and it appears that because I have an odd mouse (Cyborg RAT 3) it does not play well with any distro.

The solution just in case anyone finds themselves in this position is below, this also explains why I could not install 12.0.4 LTS as the mouse button was ignoring my clicks.

If you press the profile button on the mouse left click will start working once or twice then you need to press it again to get the left click back and so on.

Anyway to fix this, only works for the RAT3 Mouse do the following and reboot.

sudo nano /etc/X11/xorg.conf

then paste this at the end;

# RAT3 mouse
Section "InputClass"
Identifier "Mouse Remap"
MatchProduct "Saitek Cyborg R.A.T.3 Mouse"
MatchDevicePath "/dev/input/event*"
Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 0 0 0 13 14"
EndSection


Lubuntu 14.04 - No grub screen. Need to Ctrl Alt Del to reach grub

It is likely that your /etc/default/grub file contains these two lines:

GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true

Can't understand why they leave these options there, since they are deprecated in favor of GRUB_TIMEOUT_STYLE according to info -f grub -n 'Simple configuration'.

Commenting out these two options make the grub menu appears right away when booting (idea taken from here). This leads to another problem that initially I didn't have: after choosing the option from grub, the system hangs in a black screen. To solve this one, go back to /etc/default/grub and change the line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to:

GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"

Besides commenting out the two hidden timeout options mentioned, I also added GRUB_TIMEOUT_STYLE=hidden and set GRUB_TIMEOUT=2. This way the grub menu is hidden but if during the 2 seconds interval you press ESC you get the menu back. Otherwise you boot to your default option.

UPDATE:
You might leave quiet splash before nomodeset to keep the good looking boot process:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

The nomodeset introduced a new problem for me: can't control brightness anymore with fn keys. Once I figure a solution I'll update this.


After adding "greeter-show-manual-login=true" I can't log in

As far as I know, /etc/lightdm/lightdm.conf doesn't exist in Ubuntu 14.04 ! I tried

locate /etc/lightdm/lightdm.conf

in my Ubuntu 14.04 and this is what I got :-

/etc/init/lightdm.conf
/usr/share/doc/lightdm/lightdm.conf.gz
/usr/share/lightdm/lightdm.conf.d
/usr/share/lightdm/lightdm.conf.d/50-greeter-wrapper.conf
/usr/share/lightdm/lightdm.conf.d/50-guest-wrapper.conf
/usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
/usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
/usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf
/var/lib/dpkg/info/lightdm.conffiles
/var/lib/dpkg/info/lightdm.config

Therefore it is clear that /etc/lightdm/lightdm.conf doesn't exist. Well, I must add that it is not present there. Instead use /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf . Its content is same as that of /etc/lightdm/lightdm.conf as shown below:-

[SeatDefaults]
user-session=ubuntu

So remember:-

  The equivalent of /etc/lighdm/lightdm.conf in Ubuntu 14.04 is
  /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf .

Therefore you might edit your above command to :-

sudo sh -c 'echo "greeter-show-manual-login=true" >> /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf'

and it might work!


Dualboot help- windows stuck on windows loading when i try to boot it, ubuntu 13.10 works fine though

Reinstall grub

First of all you should be able to mount you' re Windows partition from Ubuntu to save you're data. To make you're Windows boot again I would boot the Windows recovery CD or the normal install CD and reinstall the Windows boot loader(there are instructions for all Windows versions just search in google). Then Windows should be bootable but you will have lost you're dual boot. Then reinstall then

Option 1: Find a bootable disk for reinstalling grub.

Option 2:Ubuntu and place the GRUB boot loader at the right place by clicking "something else" in the Ubuntu installation when it gets to partitioning and select the right place for the boot loader. Know you should be able to choose what you want to boot on start up.

Note 1: There are several instructions for the stuff above on the internet if you get stuck.

Note 2 :I'll maybe be able to give more help if you tell me which version of Windows you have.


I found a similar question here, but partition-growth centric.

Most important are the tools used. The drive must be unmounted, so to do this you could use a live CD.

Howtoforge hosts a howto, linked below:
"If you want to resize partitions on production systems, please back up your data before, because it is possible you lose all your data if you don't calculate the size of your new partition correctly (especially when shrinking a partition)!"

A link about sizing partitions directly follows that disclaimer.

all of the commands must be run as super user, so, when you boot from the Live Disk, open the terminal and just run

sudo su

NOTE: If by main OS you mean Windows, know that when you install windows it will override the grub bootloader, so you may need to reinstall a (good) nother bootloader to boot your other 2TB of Ubuntu.


How to change color of the active/inactive window?

It's not exactly what you've asked for, but nevertheless to distinguish between focussed and background windows you may use blur effect for background windows. To achieve that you may use a GNOME shell extension called Windows Blur Effects. You can change the desaturation, brightness and contrast of background windows using this extension.

 (screenshot source: extension's homepage at extensions.gnome.org)


I can see how that can happen, in the installer menu all the drives kind-of look the same. What you want to do is re-flash the USB stick with the ISO you want to install on to your computer. Using a boot repair on you USB stick will try to fix the OS you installed on to it by mistake. The easiest thing to do is re-flash the ISO to the USB drive and then install it to the SSD. I've been doing this sort of think for a while and I can see myself making the same mistake.

When you go to setup the drive partitions don't use the installer use GParted, it come with the Ubuntu Live ISO. The partition table you set up in GParted will be seen by the installer when you got to install the operating system. GParted is a really easy program to use and it's a lot more straight forward than the installer for drive partitioning. Since you said that you were having a problem telling the drives form one another, in GParted go to the file menu: View/Device Information, this will show you the model of the drive. Usually SSDs have SSD in the Model name and USBs have USB in the model name, so make sure that you see it says SSD. Also, make sure the size of the drive you have selected is close to the SSD's size. Drive sizes are usually rounded up, so the numbers you see in GParted will be a bit smaller than what the dive size is sold as. For example, a 3TB drive is really a 2.73TB drive when you look at in in GParted. To switch between drives in GParted use the drop-down menu at the right had conner of the window under the menu bar.

Once you find the SSD in GParted:

Create a partition table bay selecting the drive in the list next to Device Information. In file menu: Device/Create Partition Table, and create a gpt table.
Now create a EXT4 file-system. With the volume selected, go to file menu: Partition/Format To/Ext4.
To make these changes take effect click the green check mark underneath the partition menu bar option. Wait for you changes to be applied and then open the installer and follow it's prompts.

Back in the installer when you get to drive configuration. Select something else.

Make sure you SSD is selected and the installer should see your formatted drive. Select the area for the installer and assign it to be your root partition. This should also be your destination for GRUB. GRUB wants the /dev/sda, it doesn't need the specific partition (/dev/sda1).
Then continue trough the installer's prompts.


This is a bug, reproducable also in VM.
https://bugs.launchpad.net/ubuntu/+bug/1754328

If there will be a fix, they have to:
1. Either release a new DVD ISO
2. Apply the updates during the installation


How to circumvent full system update to install just 'build-essentials'?

Build Essentials packages is part of compiling tools: CompilingEasyHowTo

Thus, users strongly recommended to update and upgrade their distributions to minimize compiler/packager(installer) errors.

Hence the fact, even though you're do not planned to compile, you're need to be sure that your packagers and de-packagers is working right way.


My Ubuntu server has been infected by a virus kdevtmpfsi

Do a

chmod 000 /tmp/kdevtmpfsi

first. That will kill access to that file

From a user prompt if possible if that is not YOUR user:

sudo -u fabio
crontab -l

otherwise you only need the LAST line of these 2. If it is in there

crontab -e

to edit and remove that line. If not crontabs are stored in /var/spool/cron/crontabs/. There will be a fabio there. Nuke it all.

And it is not a virus. It is a miner that you probably installed yourself or installed as part of some piece of software. IF NOT consider your server compromised, format the disks and restore a backup. If you did please stick to regular and trusted sources.

edit: found some more about this.

Also related to this:

/tmp/zzz

That seems to be the bootstrap file. chmod that one too and nuke it after you verified you killed it or it killed itself.

The chmod removes permissions so the miner can not recreate the file nor write or read from it. Effectively killing it. THEN start hunting down the files. Nuke /tmp/* /var/tmp/* for anything with kinsing in the name plus the files listed above.

Try to execute deletes in ONE command so it does not get a chance to initialize itself.

Interesting topic on github about how to remove it.

It has been documented here. Redis is known to be easy hackable unless you set up a decent protection yourself.


Unfortunately there is no option in the Settings to achieve this.
But I know a workaround:

1.Right click on the Docky icon in the dock and go to Settings.
In Settings, choose Windows Dodge under Dock Configuration. Check Fade on Hide too.

2.Now Hit Alt+F2 , and open gconf-editor.

Navigate to /apps/docky-2/Docky/Interface/DockPreferences/Dock1/ and chnage the value of FadeOpacity to 1.

3.Restart Docky.


L2tp IPSEC PSK VPN client on (x)ubuntu 16.04

You can use

sudo add-apt-repository ppa:nm-l2tp/network-manager-l2tp
sudo apt-get update
sudo apt-get install network-manager-l2tp
sudo apt-get install network-manager-l2tp-gnome

To install the network manager l2tp that supports L2TP for ubuntu 16.04

Walkthrough for building from source: http://blog.z-proj.com/enabling-l2tp-over-ipsec-on-ubuntu-16-04/


The easiest way to automate this task would be the combination of MySQL Dumps and a cronjob. You can find a lot of information on this topic on this and other internet sites, but for the sake of completion:

Create a mysqldump.sh file

Which will contain the mysql dump command we will schedule in a cron job (replace user, password and path to match your environment):

mysqldump -u root -p<mysql_root_password> --all-databases | gzip > /desired/backup/folder/mysqldb_`date +%F`.sql.gz

Edit: If you want the script to store the backup in a remote location, just mount the corresponding device or share and use the mount path in the script.

Test the script

Ensure that the script has execution permissions:

chmod +x /path/to/mysqldump.sh

Execute the script:

sh /path/to/mysqldump.sh

And test it is working correctly (The backup file will be created in the specified backup folder).

Create and schedule a new cron job

In a command prompt type

sudo crontab -e

And add the following line at the bottom of the file:

30 23 * * * /path/to/mysqldump.sh

This will execute the script every day at 23:30.

Extend this simple script

There is literally loads of things you can do in order to improve this simple backup method:

Backing up to another system
Monitor disk space
Email reporting
...

So do not end here and experiment! :-)

Use backup-tools or cloud-based backup-services

Although the above method is one of the easiest and can be extended to suit your specific needs, it is worth mentioning that there are other alternatives:

backup-tools such as AutoMySQLBackup, an open-source application
which might ease the process of configuring Email-notification,
compression, encryption, rotation and type (e.g. incremental) of your
backups. As for Mai 2018, it is available for Ubuntu Server through
APT.
cloud-based backup-services such as BackupBird, myRepono, Bitcan,
etc. which might be interesting if you manage several
database-servers and want to centrally manage all their backups.

Please bare in mind that I'm not related in any way to any of the above mentioned solutions and services and I'm listing them only for reference, so use them at you own risk.

  Useful Links / References:

  Cron -> https://en.wikipedia.org/wiki/Cron

  MySQL Dump -> https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html


What does the "sudo" command do, and its usage mandatory?

If you run as root sudo is not necessary, if you run as normal user and want to do something which requires elevated privileges then you need it.

Beside the fact that you shouldn't run the whole time as root for various reasons, such as security etc. This is why the tor browser wont start when you run as root.

Sudo means "super user do" so you will only be root for that particular command. Sure the following commands containing sudo as long within a defined time-frame wont ask you for your password again, but there are ways to change that.


This actually is possible but i dont believe the feature is enabled in ubuntu yet, gtk has a backend called broadway which allows you to use any gtk application in a web browser how well this works i do not know but there are videos around demonstrating the technology.

But generally what everyone else has already said write a separate application.


Busybox v1.27.2 (ubuntu 1:1.27.2-2ubuntu3.2) built-in shell (ash) enter 'help' for a list of built-in commands

To repair your file system...

Either:

At the initramfs prompt:

type fsck -f /dev/mapper/ubuntu--vg-root

Or:

boot to a Ubuntu Live DVD/USB in "Try Ubuntu" mode
open the terminal app
type sudo fsck -f /dev/mapper/ubuntu--vg-root
type reboot