Can nagios3 automatically generate a network map?

Have you tried check_find_new_hosts plugin ? You can find how it works in the attached readme here.

usage:
check_find_new_hosts [-v+] [-x] [-s] /dir ip netmask contact

where:
dir is the directory containing the .cfg files (and .skip files if you want to skip certain hosts)
ip is an ip in the range you want to scan
netmask is an integer standing for the netmask eg:24 = 255.255.255.0
contact is the contact group you want new hosts found to answer to.

example:
./check_find_new_hosts -v /etc/nagios/network 192.168.10.129 25 domain-admins

when troubleshooting how this is working use -vv or -vvv from a command line
for more information consult the very very verbose help (may want to | less on a small screen):
./check_find_new_hosts -vvvh

----------------------------------------------------------------------------------------------------------------------------------------
check_find_new_hosts requires the following (that I know of):

1)  fping is installed at /usr/sbin/fping
2)  traceroute is installed at /usr/sbin/traceroute
3)  Nagios must parse a directory of cfg files, rather than implicitly listing the files eg:

    cfg_dir=/etc/nagios/hosts_hostgroups_and_services
    rather than:
    #cfg_file=/etc/nagios/contactgroups.cfg
    #cfg_file=/etc/nagios/contacts.cfg
    #cfg_file=/etc/nagios/dependencies.cfg
    #cfg_file=/etc/nagios/escalations.cfg
    #cfg_file=/etc/nagios/hostgroups.cfg
    ...
4)  the service generic_service must be defined (the following is what I use):

define service{
    name                generic-service ; The 'name' of this service template, referenced in other service definitions
    active_checks_enabled       1   ; Active service checks are enabled
    passive_checks_enabled      1   ; Passive service checks are enabled/accepted
    parallelize_check       1   ; Active service checks should be parallelized (disabling this can lead to major performance problems)
    obsess_over_service     1   ; We should obsess over this service (if necessary)
    check_freshness         0   ; Default is to NOT check service 'freshness'
    notifications_enabled       1   ; Service notifications are enabled
    event_handler_enabled       1   ; Service event handler is enabled
    flap_detection_enabled      1   ; Flap detection is enabled
    process_perf_data       1   ; Process performance data
    retain_status_information   1   ; Retain status information across program restarts
    retain_nonstatus_information    1   ; Retain non-status information across program restarts

    register            0   ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
    }

5)  the 24x7 time period should be defined

define timeperiod{
    timeperiod_name 24x7
    alias       24 Hours A Day, 7 Days A Week
    sunday      00:00-24:00
    monday      00:00-24:00
    tuesday     00:00-24:00
    wednesday   00:00-24:00
    thursday    00:00-24:00
    friday      00:00-24:00
    saturday    00:00-24:00
    }

6) a contact group is defined
7) the network that is being looked at can be pinged

----------------------------------------------------------------------------------------------------------------------------------------

This check would be installed as multiple commands(one for every subnet) and can then be added as a check to whatever host makes the most sense to have it on(I have it as a check on the Nagios host machine)

For example, if you wanted to check the network 192.168.0.x (let's say your servers) and all you host and service definitions (at least all of them for this subnet) are in the directory /etc/nagios/network and the contact group you are using is "admins" you would need the following:

define command{
    command_name    check_find_new_hosts_servers
    command_line    /usr/lib/nagios/plugins/contrib/check_find_new_hosts -v /etc/nagios/network 192.168.0.0 24 admins
    }

if you also wanted to check 192.168.10.[129-255] (how about these are your domain controllers) with the contact group "domain-admins":

define command{
    command_name    check_find_new_hosts_domain
    command_line    /usr/lib/nagios/plugins/contrib/check_find_new_hosts -v /etc/nagios/network 192.168.10.129 25 domain-admins
    }

You would also need services defined to check these:

define service{
    use         generic-service
    host_name       main-server-router
    service_description FIND_NEW_HOSTS
    is_volatile     0
    check_period        24x7
    max_check_attempts  3
    normal_check_interval   5
    retry_check_interval    1
    contact_groups      admins
    notification_interval   120
    notification_period 24x7
    notification_options    c,r
    check_command       check_find_new_hosts_servers
    }

define service{
    use         generic-service
    host_name       main-domain-controller
    service_description FIND_NEW_HOSTS
    is_volatile     0
    check_period        24x7
    max_check_attempts  3
    normal_check_interval   5
    retry_check_interval    1
    contact_groups      domain-admins
    notification_interval   120
    notification_period 24x7
    notification_options    c,r
    check_command       check_find_new_hosts_domain
    }

----------------------------------------------------------------------------------------------------------------------------------------
once run it may generate the following files (so either run it and generate these files or steer away from them):
x.y.cfg where x.y is from the ip address of the host found: 192.168.15.32 would be put in 15.32.cfg
name.cfg where name is from the fdqn: freddy.mybuddy.com would be put in freddy.cfg
nagios_hostgroup_unknown.cfg (expects this file either to not exist or to contain 1 hostgroup):

define hostgroup {
    hostgroup_name      undefined
    alias           Non-Configured
    members         freddy,betsy,bob,...
    }

use "--nowrite --stdout" ( -xs ) as a command line option to write these to stdout instead of to files if you just want to test it or
use -vvx to show what it is doing but don't write any files and don't show the files on stdout


How do I get the calculator button on my Microsoft Keyboard to work in Kubuntu 18.04?

I installed gnome-calculator on Kubuntu 18.04 using sudo apt install gnome-calculator.

Unfortunately, my keyboard has just 101 keys and so I don't have a Calculator key. Instead, I'll use F7 to illustrate:

Right-click on the Menu icon in your panel (marked with an arrow in the image below). You'll see a context menu with some entries but the relevant one is Edit Applications …:

On opening Edit Applications …, you'll get the KDE Menu Editor. gnome-calculator is listed in the left pane under Utilities on my system. Left-click on it. Some details will now appear in the right pane:

Now, click on the Advanced tab above the right pane. You'll see Current shortcut key. In the field to its right, single left-click and then press the key (or key combination) you wish to use. I've pressed F7:

Click the Save button near the top left of the KDE Menu Editor window. Now, any time you press F7 (or whatever you've chosen), gnome-calculator will launch.
Note that if I press F7 repeatedly, I'll get several windows of gnome-calculator.
To fix that, I can modify the command (in the General tab of KDE Menu Editor) from just gnome-calculator to

wmctrl -ax gnome-calculator.Gnome-calculator || gnome-calculator
Now, anytime I press F7, if gnome-calculator is open, it'll be brought into focus. If it isn't open, it will be launched. (You'll need to install wmctrl on your system using sudo apt install wmctrl.)

By the way, Kubuntu's calculator is KCalc and is part of the default installation.


Download a JDK - Java Development Kit from Oracle for Windows.
Choose 32bit or 64bit like the same as you use in wine. Please use
version 7 of this JDK. The setup file first letters are jdk-7. The
version jdk-8xx will crash during installation.
Install it into your wine environment.
Download Java-Editor.
Install it to your wine environment by running the setup file
(JavaEditorxx.xxSetup.exe where xx.xx is the version you'd
downloaded). Java-Editor will recognize an installed JDK by itself.
If you like you may download and install additional tools from
Java-Editors webpage.

But I wonder why you'd need to use Java Editor when we can have better cross-platform IDEs like Netbeans, IDEA, jCreator or a text editor like vim.


Is it possible to have my desktop loaded before login?

well there is a option of auto login . so that when you switch on that pc it will login automatically .

For GUI you can configure it from system settings -> User accounts.

from Terminal do this

gksudo gedit /etc/lightdm/lightdm.conf

the you will get

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
autologin-user=username

There at the username , put your user name . then save and close it . to apply changes restart your system or relogin .

Hope that helps.


Screenshot Tools to Capture Scrolling Windows

If you're using Firefox you can use the dev console to capture a screeshot of an entire web page.  Use Shift+F2 to open the dev console.  The basic command for capturing an entire webpage looks like this:

screenshot fileName --fullpage

Which will save a screenshot of the entire webpage as fileName.png in your Downloads folder. This will be huge and some photo viewers can't handle it, but it has good quality.  If you'd rather copy the screenshot to your clipboard you can use this command:

screenshot --clipboard --fullpage

You can also set a delay (in seconds):

screenshot fileName --delay seconds --fullpage


How can I make apache run cgi files in all directories under ./www ?

The default apache2 configuration in Ubuntu will enable the ExecCGI option only for a specific directory below your main one (cgi-bin).  You can however add this option to any directory you like including your main one.

Find the Apache configuration for that site.  Look for the relevant <Directory> section which will either be in one of your virtual host config files, or if it's site-wide, it'll be in /etc/apache2/sites-available/default.  You can either edit it here, or put your new configuration into a separate file under /etc/apache2/conf.d/.

You'll need to add ExecCGI to your Options directive (or create a new Options parameter with +ExecCGI added).

Example for editing an existing Options directive:

<Directory /usr/home/joe/www>
    Options Indexes FollowSymLinks Includes ExecCGI
    Order allow,deny
    Allow from all
</Directory>

Example for creating a new Options directive for a directory that overrides the Apache-wide default one:

<Directory /usr/home/joe/www>
    Options +ExecCGI
</Directory>


I'm answering myself so that anyone interested may check this out:

actually it should be possible to have the nVidia 325.xx drivers on Ubuntu using the xorg-edgers repository (see https://launchpad.net/~xorg-edgers/+archive/ppa and http://www.linux.org/threads/nvidia-optimus-on-linux.4415/, the latter it's about Oz Unity , but it's an Ubuntu-derived distro having Ubuntu 13.04 at its core...).

As soon as I've got the aforementioned laptop under my hands I will try a dual boot and the xorg-edgers+bumblebee setup and let you know how it will end!

Any other answer (maybe also experiences of people which have tried to do such a feat with the 780M) are quite appreciated!


My system crashed in the middle of an upgrade and after reboot my kernel was hosed.  Because i'm lazy, I remember boot repair which i've used in the past to fix grub, it has an option to repair the kernel.

Boot from live cd and:

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


Transfer locale settings from my computer to a ssh

Your import file presumably looks something like this:

export LANG=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_PAPER="en_US.UTF-8"
export LC_NAME="en_US.UTF-8"
export LC_ADDRESS="en_US.UTF-8"
export LC_TELEPHONE="en_US.UTF-8"
export LC_MEASUREMENT="en_US.UTF-8"
export LC_IDENTIFICATION="en_US.UTF-8"
export LC_ALL=

first of all, that's not an executable, so you can't just run it. In any case, what you want to do is source it, not execute it (see here for details ont he various ways of executing/sourcing a file). So you want to do . import and not ./import.

As for scripting it, here's a simple way:

locale | sed 's/^/export /' > import
scp import blablabla@hehehe:~/AFolder
ssh blablabla@hehehe
. import


linux-headers-3.16.0-36-generic can`t be installed (15.04)

It will not install using apt-get since it is not listed as part of the 15.04 distribution. You can still manually download and install it.

You can download the package from here: http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-3.16.0-36_3.16.0-36.48_all.deb

You may need to install also linux-headers-3.16.0-36-generic_3.16.0-36.48_amd64.deb http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-3.16.0-36-generic_3.16.0-36.48_amd64.deb

Depends on the architecture, you might need the 386 version instead: http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-3.16.0-36-generic_3.16.0-36.48_i386.dep


What might cause xrandr to not detect my HDMI?

I, too, have a System76 laptop, and I think this can be solved by installing the System76 driver (which, for some reason, doesn't come preinstalled).

You can get the driver here.


I too use a laptop with an nVidia graphics card.

First update to the "experimental" 310 drivers from the repositories. They seem to do a much better job at auto detecting when a monitor is plugged in.

Second, in nvidia-settings, disable the secondary monitor, enable the primary monitor (built in one) and the save to xorg and restart X

restart lightdm

This should make it so that you can use your internal monitor only.

Now, with everything running on your internal monitor, install disper

apt-get install disper

This handy tool allows you to set up a few things without having to rely on nvidia-settings which seems to really confuse unity, and without directly having to use xrandr which can be a bit of a pain when your randomly changing monitors all the time.

Last few steps:

Test that you can get your second monitor to play nice by plugging it in. It should "just work" in Ubuntu by going to "Displays" and setting it up the way you want it. It's very important that "Displays" see two monitors and not 1 large monitor.

With everything working in unity on two monitors in "Displays" run

disper -s

That should turn off the second display and leave only your internal monitor running.

Now, finally, to make that work at the greeter, open /etc/lightdm/lightdm.conf

add or change:

display-setup-script=disper -s

For reference my /etc/lightdm/lightdm.conf:

[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter
xserver-command=/usr/local/bin/xswitcher.sh
display-setup-script=disper -s

Make sure not to copy the xserver-command, only use the display-setup-script line.

You should now be able to log in fine. The primary monitor will get the unity greeter, and once you log in unity should take over, and setup what ever you have configured in "Displays"

For me this means the greeter has the primary on, the secondary off, and then I log in and the primary is "right of" the secondary, with both displays on. I have gotten auto plug and unplug to work fine. The non-experimental drivers, or forcing twinview in nvidia-settings causes me much the same headache you describing.
`


Automatically create screen sessions to run tasks in parallel

Suppose you want to run scripts task1, task2, ..., task10, located in the current directory, in corresponding screen sessions session1, session2, ..., session10. Suppose further that, when each task ends, you want its session to continue with an interactive shell, so you will still be able to attach to it, view the task's output in it, and run further commands in it.

for i in {1..10}; do
    screen -dmS "session$i" sh -c "./task$i; exec bash"
done

This is the method jw013 describes there, but done repeatedly in a loop. Each session starts detached (-dm) and uses sh -c to run a script, then replaces itself with bash.

In the manual method you've been using, each session starts attached, and you detach from each one (except possibly the last) in order to create those that remain. But with the method shown here, nothing is attached yet, even though the scripts are all running. You can manage and attach to the sessions in the usual way. For example, screen -ls will list all of them, and screen -x session10 attaches to session10, the session running task10.

If you want each session to end immediately after the script runs (which is dissimilar to the results of what you're currently doing manually) then you can use just "./task$i" instead of sh -c "./task$i; exec bash":

for i in {1..10}; do
    screen -dmS "session$i" "./task$i"
done

Whichever way you use, you can run the whole for loop, as written, however you like: as a command in an interactive shell, or in a script, or in a shell function. The loop itself finishes almost immediately; no matter how long your tasks take to run, the loop completes once all the screen sessions are started.


It seems that the apt.conf has the larger size than it was expected. So please remove the apt.conf and rerun apt and the apt.conf will be recreated. If it still does not help, check your Internet connection and then open the terminal and type:

sudo apt-get purge apt
sudo apt-get install apt


How to solve simg2img error "Invalid sparse file format at header magi"?

Okay, so I figured out what the problem was. Turns out simg2img converts system.img to raw img, but RemixOS's system.img is already a raw image. So, I just had to mount the image as a loop device.


First thing first: Ubuntu won't fit on the CD, it is too large. You need a DVD to burn current Ubuntu image. After you have burned Ubuntu DVD, just insert it into DVD drive and restart your computer. After a minute you will be seeing some sort of welcome screen with two buttons: Install Ubuntu and Try Ubuntu. Choose the second one and that is it. See Ubuntu Documentation for more details.

PS

If your BIOS is set to boot from Hard Disk first (unlikely, but possible) then You should enter the boot menu by pressing Del, F11, F12 or other one (depends on your motherboard). In the boot menu, choose CD/DVD item to boot the computer from Ubuntu DVD.


An HDD is fast when read by dd, slow otherwise

I had shrinked the NTFS partition that was on that drive by 30%, created a second partition with btrfs and run fstrim on it. That immediately restored the speed.
Don't run fstrim on NTFS partition.


http://ubuntu-news.org/2020/01/23/ubuntu-19-04-disco-dingo-end-of-life-reached-on-january-23-2020/

https://lubuntu.me/lubuntu-19-04-end-of-life-and-current-support-statuses/

From the Lubuntu EOL message is

  Lubuntu 19.04 End of Life and Current Support Statuses

  Lubuntu 19.04 (Disco Dingo) will reach End of Life on Thursday, January 23, 2020. This means that after that date there will be no further security updates or bugfixes released. We highly recommend that you update to 19.10 as soon as possible if you are still running 19.04.
  After January 23rd, the only supported releases of Lubuntu will be
  18.04, with LXDE, and 19.10, with LXQt. All other releases of Lubuntu will be considered unsupported, and will no longer receive any further
  updates from the Lubuntu team.

  You can find instructions on how to upgrade your Lubuntu installation
  here at our manual page.

You'll also note later in the reference, the reason I'd suggest not returning to Lubuntu 18.04 LTS, ie.

  Note, due to the extensive changes required for the shift in desktop
  environments, the Lubuntu team does not support upgrading from 18.04
  or below to any greater release. Doing so will result in a broken
  system. If you are on 18.04 or below and would like to upgrade, please
  do a fresh install. The installation image can be obtained from our
  downloads page.

I would strongly recommend the upgrade to 19.10, providing a path to move to Lubuntu 20.04 LTS currently in development.


Simple architectural software for Ubuntu

Sweet Home 3D  should do it:

I have used this myself, and I can tell you that it's really nice!


How do I install drivers for Nvidia GeForce FX 5200 in 12.04?

The FX5200EP is a graphics card with Nvidia's GeForce FX 5200 chip.

The current "Additional Drivers" for Nvidia do not support the relatively old FX/5 series. Please see the below answer for complete instructions on how to install a compatible additional driver:

  Nvidia driver cannot be installed with jockey for old hardware


Saving an excel file on a windows shared folder using wine

I know this is an old thread, but I had the same problem and determined that it was because of a change I had made to my SAMBA configuration =.

I use a Mac to access files on a Linux server via SAMBA, and wanted to block the typical "dot" files that Mac creates (._something and .DS_STORE). So, I added a line to my smb.conf that would prevent those files from ever being created as follows:

veto files = /._*/.DS_Store/

When you open an Office file, it creates a temporary file in the location where you opened the file from, and that file starts with ._$

Since .$ will be matched by .* the file will be disallowed and you're operating without a temporary file. Remove the "veto files" entry (or remove the ._* portion), restart SMB, and you'll be fine.


Add the following line to /etc/modprobe.d/blacklist.conf.

blacklist amdgpu

As initramfs contains modprobe configuration, update the initramfs and reboot:

$ sudo update-initramfs -u

Check whether the driver blacklisted or not, the following command should output nothing.

$ lsmod | grep amdgpu


Check this one http://www.webupd8.org/2010/08/display-google-calendar-on-your-desktop.html


Okay, I fixed the problem using:
gksu lxappearance

then I set Adwaita as default theme for root user, everything works fine know.


How do I rename files in a directory one-by-one in a loop following a specific pattern set by me?

Here is the answer that works. I have tested it.

#!/bin/bash

find . -type f -name "* *" -exec bash -c 'mv "$0" "${0// /_}"' {} \;
for item in `ls | grep mod`
do
echo $item
var1=$(grep -o "mod[0-9]\{2\}lec[0-9]\{2\}" <<< "$item")  # extract the mod02lec03 part
echo "var1 is" $var1
var2=$(grep -o "[a-zA-Z -\_]*-mod" <<< "$item") # extract the string before it
#echo $var2
var2=${var2%"-mod"} #by using bash tricks,remove the mod suffix from the var2 string
echo "var2 is" $var2
var3=$var1-$var2  # Now reorder the strings
echo "var3 is var1-var2" $var3
cp_item=$item
mv "$cp_item" "$var3.mp4" # Now rename the strings and that should work
done
### Of course, this substitutes ' ' in the filename by '_' but then we can do       the reverse to get the original filenames with the spaces.


I figured out the answer. it turns out to be not Unison related, but has every thing to do with how the NAS is mounted on the local Linux machine.

In /etc/fstab, I used

//192.168.1.61/Volume_1 /mnt/nas cifs defaults   0   0

Now I am mounting using

//192.168.1.61/Volume_1 /mnt/nas cifs guest,rw,uid=1000,gid=1000,nounix,iocharset=utf8,file_mode=0644,dir_mode=0755 0 0

Unison is working smoothly now. The key is that the mounted uid and gid should match the uid and gid on the local machine, which is NOT the case when using the defaults option.
Therefore Unison was running into all kinds of permission related problems.

I hope this is helpful to others encountering similar problems.


several issues - looking for quick wipe of disk and install

Erasing the old OS is an unnecessary additional action for most users.
If you select the "Erase disk and install Ubuntu," the installer will do all the work for you.


I got a hint here: https://askubuntu.com/a/518825/34298

The script you want to call when the lid opens or closes has to be stored
in /etc/acpi/lid.sh.
Then there has to be created the correct file /etc/acpi/events/lm_lid with the content as follows:

event=button/lid.*
action=/etc/acpi/lid.sh

Reboot your system to let this take effect. Or maybe it is enough to restart your ACPI using

sudo /etc/init.d/acpid restart


Your system is more than capable of running ubuntu with all the 3d stuff. I have the same graphic card with an old celeron processor and less memory and everything works. I'd suggest you install the drivers for  your card:

sudo aptitude reinstall xserver-xorg-video-intel

Also, install driconf and mesa-utils and see if you have hardware 3d acceleration:

glxinfo | grep direct

should output "Yes" unles your card is not being detected

driconf

will help you tonfigure your graphics.


Command line method to find disk usage of camera mounted using gvfs

I did some poking around and discovered gvfs-info does what I need.

$ gvfs-info -f ~/.gvfs/gphoto2\ mount\ on\ usb%3A002,005/
attributes:
  filesystem::size: 16017719296
  filesystem::free: 4316299264
  filesystem::type: gphoto2
  filesystem::readonly: FALSE
  filesystem::use-preview: 1
  gvfs::backend: gphoto2

Interestingly, hitting Tab at the command line changed the above command into:

gvfs-info -f gphoto2://[usb:002,005]/

Which gave exactly the same information. I did a little experiment and found that plugging the camera into a different port gave a different address, but doing a ls of ~/.gvfs/ would find the camera.


Is it already possible to test Ubuntu for Android?

Not currently, it is for OEMs to install on their devices, not for the consumer.
When it is released, it shall be hacked on to these old devices.


Why doesn't Banshee have a dark toolbar like Rhythmbox does?

Banshee's toolbar looks different because its toolbar color is hard-coded.  This was initially coded in the days when it wasn't popular for gtk themes to set custom colors for the toolbar.  It was done to help the resize grip widgets (and possible other custom icons and widgets) blend in better with the toolbar.

Unfortunately, the custom toolbar makes Banshee stick out like a sore thumb with themes that do paint the toolbar.  There's an open bug report (mine, actually ;) ) for the issue.

Part of the problem can probably be found near line 214 of BaseClientWindow.cs.  I tried my limited C# abilities and couldn't come up with a fix.  If you can, I'm sure the Banshee devs would welcome a patch. :)


Meizu Pro 5 Ubuntu Edition OTA-11 - 2G/3G issue

I have been experiencing the same issues as you with my mobile data on my bq Aquaris E5 (which is also running OTA-11). I have raised this before here, under the following question Ubuntu Touch - Mobile Data becoming increasingly unusable I have not decided to flush the phone as yet, but can understand your thought process behind doing that. For me, my wife is on the same network and if I have no signal, she always has one on her Samsung S5. I get better coverage on 2G. I have also found that if I turn the phone to flight mode and then back again, the mobile data works for a bit and then seems to time out. If I go on to a webpage and then refresh it, the Internet seems to come on, like it is sleeping without any activity. However, if this is the case certain things do not seem to wake it up like new Telegram messages and such like.

Not possibly the answer you were looking for, but at least you know that you are not the only one with this issue. I will be raising this in Launchpad shortly.


Check for duplicate sources with this command (source):

S="/etc/apt/sources.list" ; S2="$S ${S}.d/*.list" ; grep -b "^deb`cat $S2 | grep -i "^deb[[:space:]]http" | sort | uniq -dc | sed -e 's;[[:space:]]\+[[:digit:]]\+[[:space:]]\+deb\(.\+$\);\1;g'`$" $S2

(You will set 2 error messages if /etc/apt/sources.list.d/ directory is empty. That's ok.)

If you see any red text lines on the output of this command -> then you have to edit the according file(s) and remove the duplicate entries.


copying files resulting from using grep into a new folder

Use xargs and the -t option of cp:

grep -inrl "Bioethik_Debatte" /var/cqp/upload/heideko/import_files | xargs cp -t bio_files/

If your files might have spaces in their names, then make everything null-delimited:

grep -inrlZ "Bioethik_Debatte" /var/cqp/upload/heideko/import_files | xargs -0 cp -t bio_files/


An inaccessible directory with a random name has appeared in my home directory

300MB of zero size files is few millions files in a single directory, it is gonna take time to remove

Since disc seems ok and nothing is blocking files try using mc (Midnight Commander)to delete KAzdyLisjm and skip directory scanning

this way You will at least see progress if any


Ubuntu install option "Install alongside Windows 7" is missing

Boot from ubuntu live cd, do a os-prober in terminal to see if windows7 is listed.

If yes, then you are safe. Just select install alongside windows option ,then install the bootloader in the harddrive, not in any partition.

If it doesn't detect ubuntu(which is your case for now), then there is a conflict in UEFI/EFI/Legacy bootloader. Probably ubuntu is reading the UEFI BIOS, while windows 7 was installed in LEGACY bios. A Simple solution to this problem is to just turnoff the UEFI bios from bios setup & then follow step 1.

Remember if you install ubuntu evenif ubuntu doesn't detect windows7, this could  completely destroy your windows7 partition.

Enjoy & don't forget to mark my answer as accepted :)


Terminal autocompletion 'tab' not working as intended?

To enable smart completion

Using sudo and your favorite editor, edit your /etc/bash.bashrc file.

Uncomment the following lines, by removing the # in the beginning of the lines:

#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi

Now you can use tab completion to power your way through commands.


Guayadeque has been updated and it is now possible to install it on Ubuntu 16.04 from a PPA (private repository) created by the author anonbeat.

In a terminal type:

sudo add-apt-repository ppa:anonbeat/guayadeque
sudo apt-get update
sudo apt-get install guayadeque

For details see: https://launchpad.net/~anonbeat/+archive/ubuntu/guayadeque


External Monitor (Lenovo) doesn't wake up after lock screen wake

I have the same problem with my Lenovo (docking station). Workaround is to go to displays and change settings (e.g. activate Mirroring) and then the external monitors wake up, but then I have to rearrange all my windows.

Would like to know the root case of this.


Nowhere. Linux does not use vendors drivers mostly: they are either compiled into kernel and provided out of the box, or as a package  for specific item. First install linux, then look what does not work and google for solution.
And do not delete Windows until you are familiar with Linux.


As Lucio said, only God knows, though you shouldn't expect to face any problems along the way.

If this is the first time you install Ubuntu, consider WUBI install, so you can get familiar with the installation process.


installing problem of chrome in ubuntu 16.04

If you downloaded the Chrome .deb file using a web browser, the location of the Chrome .deb file that you downloaded is saved in the download history of your web browser. Open Files file browser and browse to the directory that contains the Chrome .deb file that you downloaded and then double-click that .deb file to open it for installation in Ubuntu Software. Ubuntu Software will prompt you to authenticate with your user password in order to install Chrome.


Ubuntu 14.04 Desktop Sharing (VNC) encryptiom / auth problem

My response is probably very late for you, nevertheless it may help you if you haven't found another solution already.  The 100% vino compatible VNC client you can use is vinagre.  I am using it for years.  You can find it in the repos.  :)

p.s.  Vino is the name of the default VNC server in Ubuntu.


How to modify the colors of Ubuntu Panel?

It is possible that your theme is set to Radiance.

Click the cog on the top-right corner and go to System Settings > Appearance.

Change your theme to Ambiance.


This is how I've setup mail on our production machines. These are the criteria that we needed:

Email Accounts
Email Aliases (Forwarders)
IMAP, POP3, and SMTP

"Easy" (tl;dr)

First, I want to address what would appear to be the easiest solution.

sudo tasksel install mail-server

Several issues with this occurred when we tried this: First it installs Dovecot, which is fine for most, but we've deemed Courier to be the better of the two for our needs. Second, it utilizes Postfix which is great but we also need Exim as it's a more powerful MTA/SMTP server. Third, it installs MySQL - in the configuration I utilize we prefer flat files for configuration as it's one less breaking point. Think what would happen if MySQL crashed for some unknown reason. Otherwise the rest of the packages is pretty straight forward and easy to maintain for a small mail service (think 1-2 email domains total).

Our Configuration

Directory Structure

We stray slightly outside the path of normal configurations but it makes for easier management.

All of our mail is stored in /var/mail/virtual/<domain>/<user>/mail So for future examples I'll be using email@example.com, fwd@example.com, foo@example.com to represent an email address, a forwarder to go to example@gmail.com, and a bad address respectively. In the above example it would be /var/mail/virtual/example.com/email/mail.

I also maintain a list of all the domains on the server in /etc/valiases but more about that later.

Postfix

This is more or less the easy part of the setup. Just install the postfix package.

Exim

Install Exim with apt-get install exim4 exim4-base exim4-config exim4-daemon-heavy Once installed you'll need to edit the exim default configuration to replace or add the following values:

domainlist local_domains = @:localhost:dsearch;/etc/valiases:dsearch;/var/mail/virtual
daemon_smtp_ports = smtp : 587 : 465
MAIN_TLS_ENABLE = yes

(These lines will appear in different parts of the file, replace each accordingly)

Once that's complete rebuild the exim configuration with update-exim4.conf This concludes the changes required for Exim

Courier

Install Courier with courier-base this should install courier-authdaemon, courier-authlib*, courier-imap*, courier-pop*, courieruserinfo, courier-ssl

There honestly isn't much configuration outside the standard. You'll just need to create a user database.

Accounts

Exim and Courier check a few places to see if a login or an incoming email are valid. Exim checks if the domain is listed as a local hostname, or if the domain is in /var/mail/virtual or if the domain is in /etc/valiases.

Creating Email Accounts

I eventually created several tools to streamline this process - but adding a new user goes to the tune of:

mkdir -p /var/mail/virtual/example.com/email
chown -R mail.mail /var/mail/virtual/example.com/
maildirmake /var/mail/virtual/example.com/email/mail
chown -R mail.mail /var/mail/virtual/example.com/

Then add the address to courier userdb - so they can log in

userdb email@example.com set uid=8 gid=8 home=/var/mail/virtual/example.com/email mail=/var/mail/virtual/example.com/email/mail

Make sure to replace the values where appropriate. Also - uid and gid need to be the numerical user/group ids for the mail user.

userdbpw -md5 | userdb email@example.com set systempw

This will prompt you for a password, enter the one you wish to use for the account.

makeuserdb

Finally, generate the userdb hash/shadow files. Restart Courier and test if your changes work:

authtest email@example.com

Should produce something similar to

Authentication succeeded.

     Authenticated: email@example.com  (uid 8, gid 8)
    Home Directory: /var/mail/virtual/example.com/email
           Maildir: /var/mail/virtual/example.com/email/mail
             Quota: (none)
Encrypted Password: $1$LOLCATS$THISWILLBEAHASH.
Cleartext Password: (none)
           Options: (none)

If you see "Authentication FAILED: Operation not permitted" instead edit /etc/courier/authdaemonrc and add authuserdb to the authmodulelist line.

After all tests have been confirmed, restart the various services involved (courier-authdaemon, exim4), open the ports 143, 25, 586, 495, 110 and setup the accounts in your favorite mail client.

Creating email aliases

For each domain you should create a file in /etc/valiases (create if it doesn't exist) with at least the following line:

*: :fail: No user at this address.

What this says: If the incoming mail doesn't match any email account I have on file - then the mail should be failed and bounced with a message: "No user at this address". So all mail sent to say: foo@example.com would be bounced as a failure.

However, we have a few email address we wish to maintain elsewhere - say example@gmail.com - in order to do so we need to create /etc/valiases/example.com and the contents of the file should be as follows:

fwd: example@gmail.com
*: :fail: No user at this address.

That way, even though fwd@example.com doesn't match any email accounts on the server, it matches in the /etc/valiases file and the mail will be forwarded to example@gmail.com - However, foo@example.com will still fail with a "No user at this address" message.


Want to use windows and Ubuntu in single Partition

It is only possible if you install Ubuntu within windows 7 using wubi.
But windows 8 has locked boot loader so it is not possible . That's why ubuntu 13.04 has removed wubi.


The GNU Debugger - Package operation failed

It looks like you will have to remove gdb-msp430, as it can not be installed at the same time as regular gdb.  You also should file a bug report against that package because it either should state that it conflicts with gdb, and thus, gdb would be removed instead of giving this error, or it should be fixed so that it does not conflict.


I ended up having to rename ~/.kde, ~/.cache ~/.local and ~/.config.

mv ~/.kde ~/.kde.old
mv ~/.cache ~/.cache.old
mv ~/.local ~/.local.old
mv ~/.config ~/.config.old
shutdown -r now

Not sure exactly which one did the trick but I suspect it was .config.


How to maintain WPA connection on reboots when connecting from terminal?

Two options :

wicd

Use wicd-cli

sudo apt-get install wicd-cli
wicd-cli

wicd is a command line, menu driven (ncurses) configuration tool

Proper configuration

Normally you configure your wireless in /etc/wpa_supplicant/wpa_supplicant.confand /etc/network/interfaces

It varies a little depending on your wireless router. There is a great post on the Ubuntu Forums Wireless Security that goes through the various configurations (PSK, etc).

There is also the Ubuntu Wiki WPA page, but as you can see it could use a little love.

If you need assistance with configuration, we need a little more information about your network.


Since I upgraded to trusty, my mobile broadband card always asks for PIN

I had same problem once on my Lenovo ThinkPad x230 but in Release 12.04 LTS with TLP. I then did find a solution so I disabled the SIM pin code on the card, then it stopped asking again and again. I know that is not a proper solution but maybe a workaround.


dual boot: windows 8.1 boot failur,stuck with grub screen

I have a common problem, except my computer just refuses to boot into Ubuntu.

Disable Windows fast startup, then boot into windows using the live cd. Run the command bootrec/fixmbr and you should  be good to go.

This may be what you're looking for if you would like to know more:

Dual boot windows 8.1 stuck


You did not install the full LibreOffice suite. In particular you are missing libreoffice-gnome (and libreoffice-gtk, but that will be installed by libreoffice-gnome). In general, it is a good idea to do a full:

sudo apt-get install libreoffice

to get the full suite (even the Ubuntu default install contains only a partial installation).


Stop/start battery charging through software?

On Thinkpad devices, you can control the start and stop of the battery charging in Ubuntu. Run these commands in your terminal to install tp-smapi:

sudo apt-get install tp-smapi-dkms
sudo modprobe tp_smapi

Then write your desired charging thresholds (your own values) to the virtual files in /sys/devices/platform/smapi:

echo 10 | sudo tee /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 100 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh

In the above commands you can change the values 10 and 100 to any value. The first one will help you to choose at what level charging must start and the second value will let you choose at what level charging must stop.


What you may want can be achieved with openbox desktop environment plus tint2 panel, both of which you can get with sudo apt-get install openbox tint2 obmenu obconf feh . Bellow is the screenshot of my desktop with the appropriate configuration for both. In order to have fn key work, make sure you autostart gnome-settings-daemon in the openbox autostart file. Autostart entries and panel launchers are done with .desktop files, about which you can learn here. Bellow is my configuration

/home/username/.config/tint2/tint2rc file

# Tint2 config file
# Generated by tintwizard (http://code.google.com/p/tintwizard/)
# For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure

# Background definitions
# ID 1
rounded = 7
border_width = 2
background_color = #000000 60
border_color = #FFFFFF 16

# ID 2
rounded = 5
border_width = 0
background_color = #FFFFFF 40
border_color = #FFFFFF 48

# ID 3
rounded = 5
border_width = 0
background_color = #FFFFFF 16
border_color = #FFFFFF 68

# Panel
panel_items = LTSBC
panel_monitor = all
panel_position = bottom center horizontal
panel_size = 100% 35
panel_margin = 0 0
panel_padding = 7 0 7
panel_dock = 0
panel_dock = 0
wm_menu = 1
panel_layer = bottom
panel_background_id = 1

# Panel Autohide
autohide = 0
autohide_show_timeout = 0.3
autohide_hide_timeout = 2
autohide_height = 2
strut_policy = follow_size

# Taskbar
taskbar_mode = single_desktop
taskbar_padding = 2 3 2
taskbar_background_id = 0
taskbar_active_background_id = 0

# Tasks
urgent_nb_of_blink = 8
task_icon = 1
task_text = 0
task_centered = 1
task_maximum_size = 140 35
task_padding = 6 2
task_background_id = 3
task_active_background_id = 2
task_urgent_background_id = 2
task_iconified_background_id = 3
task_tooltip = 0

# Task Icons
task_icon_asb = 70 0 0
task_active_icon_asb = 100 0 0
task_urgent_icon_asb = 100 0 0
task_iconified_icon_asb = 70 0 0

# Fonts
task_font = sans 7
task_font_color = #FFFFFF 68
task_active_font_color = #FFFFFF 83
task_urgent_font_color = #FFFFFF 83
task_iconified_font_color = #FFFFFF 68
font_shadow = 0

# System Tray
systray = 1
systray_padding = 4 2 3
systray_sort = ascending
systray_background_id = 0
systray_icon_size = 35
systray_icon_asb = 70 0 0

# Clock
time1_format = %H:%M
time1_font = sans 8
time2_format = %A %d %B
time2_font = sans 6
clock_font_color = #FFFFFF 74
clock_padding = 1 0
clock_background_id = 0
clock_rclick_command = orage

# Tooltips
tooltip_padding = 2 2
tooltip_show_timeout = 0.7
tooltip_hide_timeout = 0.3
tooltip_background_id = 1
tooltip_font = sans 10
tooltip_font_color = #000000 80

# Mouse
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify

# Battery
battery = 1
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
battery_hide = 98
bat1_font = sans 8
bat2_font = sans 6
battery_font_color = #FFFFFF 74
battery_padding = 1 0
battery_background_id = 0

# Launchers
#
launcher_padding = 5 0 10
launcher_background_id = 9
launcher_icon_size = 45
launcher_item_app = /home/user/.config/autostart/chromium-browser.desktop
# launcher_item_app = /some/where/anotherapplication.desktop
launcher_item_app =  /home/user/.config/autostart/gnome-terminal.desktop
launcher_item_app = /usr/share/applications/gnome-alsamixer.desktop
# End of config

/home/username/.config/openbox/autostart file

# set background , use your own path to picture
feh --bg-fill /path/to/image &

# start tint2 panel
tint2 &

# start sound indicator thingy
gnome-sound-applet &

# start gnome-settings-daemon
gnome-settings-daemon &


How to turn off geany message window by default?

If I understand your question.. you want to hide this window:

Go to the MenuBar View -> Show Message Window and untick it.

Then close geany and open a file with the right click menu.

No more Message Window.

Hope this helps.


unable to log in after tinkering with drivers

You can easily fix it.

Press Ctrl+Alt+F1. login to console and run

sudo apt-get purge 'nvidia.*'

That will remove Nvidia drivers.

Then you can install some driver, like

sudo apt-get install nvidia-352

Then reboot

sudo reboot


I just understood something. "docker run" only starts a single container. But some projects use multiple containers for different services(like this one) and for them, docker-compose should be used. The problem was that the database was just in another container. So using "docker-compose up" solved the issue.

Although I now have another issue, which seems to need a peek inside the database. Does anyone know how I can log in to a database inside a container?


I believe that if the serial communication is successful it means that you installed the drivers (on the main page of clean flight).
So you have to install the drivers on the laptop if you did not do that yet.
The other reason i think it might be is that you have not uploaded the software inside the flight controller yet. You need to go on the Firmware Flasher and select the appropriate Firmware Then select No reboot sequence, Flash on connect and full chip erase. Then when you connect your drone make sure you are accessing the boot mode (could be a button or two pins where you need to put a wire to connect them).

if the laptop is running ubuntu try typing "hwinfo --short" It will output a list of all devices with names and ports connected.
The end of my list gives "/dev/ttyUSB0    Prolific PL2303 Serial port" and that is the device i have connected.

DOSBOX
So running your app in a DOSBox i would need to type "serial1 directserial realport:ttyUSB0" in the dosbox terminal to make the app able to connect to COM1.

WINE
But most likely you are running the app under WINE and you would have to make a ttyUSB0 redirect to a COM port.
wine does not support USB drivers, but if your device is being recognised as a serial device, and I think it is, then you need a symbolic link between com1 and /dev/usb and it must be in the folder ~/.wine/dosdevices

This will allow windows programs running under wine to see usb serial devices.

This should do it.

ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1

see
http://ubuntuforums.org/showthread.p...66#post4969966


How to change Ubuntu Studio from XFCE to Gnome?

Nowadays, the best method for choosing a desktop environment for Ubuntu Studio is the following:

Install the Ubuntu (for GNOME) or official Ubuntu flavor (Kubuntu, Lubuntu, Ubuntu Budgie, Ubuntu Kylin, Ubuntu MATE, Xubuntu) of your choice.
Install the Ubuntu Studio Installer
Run Ubuntu Studio Installer, and choose from the options presented. Follow the instructions.

This method automatically prepares your audio configuration for lowlatency audio work, even if you choose not to use it.


Can't ping outside in VM created by Multipass

I also couldn't ping outsite on multipass and tried to solve this problem but couldn't solve it.
So I uninstalled multipass.
sudo snap remove multipass

Then I installed multipass again.
sudo snap install multipass

Finally I could ping outside.


All our OS files will be in image format like ISO. Burning A data file is not equal to the burning an ISO. both are different.But you can burn any CD image will General install of Ubuntu which consists of Brasero.Instead of that as for the best ISO burner i vote for K3b.

you can get it installed by

sudo apt-get install k3b

Any software you can install but the procedure is common.All you need to do is simple Right-click at that ISO file then it will show in options with what software you'd like to burn the cd-image file.

hope that helps.


You can, there are various ways, one implies using a VirtualCD iso image that will let you jump to USB booting; another one implies creating a special virtual hard disk VMDK that point to you real external HDD (technically it is not booting from USB, it is booting from a VirtualHDD whose sectors are on the USB one).

But if you are up to configure Grub2, why on the hell you need a full mini distro? Just use a small 8MiB (also a 2Mib can be enought) with Grub2 and put on grub.cfg a menu to load OS from USB drive, all drives (fixed, internal, external, usb are seen by Grub2 in the same way).

Seach for grub2-install and parameters --boot-directory and --efi-directory (in case you want [U]EFI booting).

So inside VirtualBOX you only need a small Virtual Hard Disk (just for Grub2, no need of a working Linux) that will boot the Grub2 bootloader.

Beware, if you want to boot Windows from that external drive, better use de trick of creating a Virtual Hard disk that point to real external hard disk (the file is a vmdk)... do not forget to run VirtualBox in elevated (if host is Windows).

Search: VirtualBox Boot USB with wmdk virtual disk.

Hope i could help.


Will my partisions on my hard drive be removed if I choose "Erase disk"?

Yes, "Erase disk" will remove the partitions and file systems.
If I understand correctly, this is what you want.

But if, instead of installing Ubuntu you were to sell the computer, then "Erase disk" is not enough.
There are recovery tools, that can recover a fair part of the raw data from the memory cells and re-create files. So you should overwrite the whole drive or better, re-arrange the mapping between logical and physical memory locations. This remapping can be done with hdparm, and is more advanced.


Can an LXD client run a desktop environment?

From the LXD issue tracker:

  Short answer is "no". Containers don't have virtual graphic cards so there's nothing for them to render to.

  There are some alternatives though:

  Run Xephyr or similar on the host, then pass the X socket to the container and run things against that
  Run some kind of VNC/RDP based server in the container and connect to that from the host
  Give the container full access to your host's devices (GPU and terminal), this would let you have your desktop environment in a container with a mostly blank host


Switch to EN keyboard layout on Ubuntu login screen after each logout

I think you achieve that if you only have the us layout in /etc/default/keyboard.


Installing guest additions solved the same issue for me. You have to do it through terminal.

In the "Devices" menu click "Insert Guest Additions CD image" .
Hit Ctrl+Alt+F1 or Right Ctrl+F1 to open a virtual terminal. Then login with username and password.
Mount the guest additions cd and install the thing:

mkdir /tmp/cd
sudo mount /dev/sr0 /tmp/cd
sudo /tmp/cd/VBoxLinuxAdditions.run

After it is done, restart the virtual machine and it should work:

sudo reboot


Weird on screen keyboard appearing when pressing ctrl+alt+b

The way to solve the issue but keep fcitx:

sudo vim /usr/share/fcitx/addon/fcitx-vk.conf

add to the file

Enable=false

logout, login again


Error while trying installation using sudo apt-get install

This should be used as last resort. If you use this carelessly you can end up with a broken system. Please try the other answers first before doing this.

You can delete the lock file with the following command:

sudo rm /var/lib/apt/lists/lock

You may also need to delete the lock file in the cache directory

sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

After then, updates the package lists :

sudo apt-get update

Source


High end ubuntu for 7 inch instead of 10 inch tablet

According to the Ubuntu Tablet homepage, it will scale from 6.5" to 20".

"With unique multi-tasking productivity, secure sharing, and a beautiful interface which scales perfectly from 6.5” to 20” screens and beyond, Ubuntu releases new possibilities from the tablet, at work and at play."

Source: http://www.ubuntu.com/tablet


I solved the problem.

You just install playonlinux via Software Center.

Then search for SketchUp in playonlinux and just follow the installation procedure...


System no longer boots, gave up waiting for root device, (initramfs), /dev/mapper/gnome-root does not exist

I got it fixed!!!  For future generations so you don't have to go through the agonizing days and endless hours that I did:

Firstly, I was able to get the system to boot from the (initramfs) prompt by typing the following  (I used this forum page as a crutch):

cryptsetup luksOpen /dev/sda5 sda5_crypt
lvm vgchange -a y
exit

This got my system to boot properly.  Once booted, I modified /etc/crypttab to point to a different UUID than before.  I picked the UUID from my /etc/fstab.  Save the original UUID value.  You will need it in a few steps.  I then ran (from a terminal):

update-initramfs -k all -c

If you get a warning that looks like this or something similar:

WARNING: invalid line in /etc/crypttab

then go back to the beginning and instead of sda5_crypt, use what is in your crypttab.

I then rebooted.  This time I got the prompt for the passphrase!  But don't get too excited, because it didn't work.  I entered the right password about 7 times and it rejected them all.  It then went back to the (initramfs) prompt after about 90 seconds.

I repeated step one and got it booted again.  I then restored the original UUID value to the crypttab, and reran step two.  I then rebooted, and SUCCESS!


Do we have to write our own arpa/inet.h?

No, you do not have to write your own arpa/inet.h or netinet/in.h - they are provided by the libc6-dev package:

$ dpkg -L libc6-dev | grep 'arpa\|netinet'
/usr/include/arpa
/usr/include/arpa/nameser_compat.h
/usr/include/arpa/telnet.h
/usr/include/arpa/tftp.h
/usr/include/arpa/inet.h
/usr/include/arpa/nameser.h
/usr/include/arpa/ftp.h
/usr/include/netinet
/usr/include/netinet/igmp.h
/usr/include/netinet/in_systm.h
/usr/include/netinet/ip.h
/usr/include/netinet/tcp.h
/usr/include/netinet/if_fddi.h
/usr/include/netinet/ip_icmp.h
/usr/include/netinet/ip6.h
/usr/include/netinet/ether.h
/usr/include/netinet/if_tr.h
/usr/include/netinet/udp.h
/usr/include/netinet/if_ether.h
/usr/include/netinet/icmp6.h
/usr/include/netinet/in.h


Ubuntu 16.04 on Dell XPS suspend occasionally fails

I had the exact same problem. The solution is to create a file in /etc/pm/config.d/ with just one line:

SUSPEND_MODULES="brcmfmac"


HP rings a bell

Several HP computers with the same and similar age as your computer do not 'want to' boot via grub, if there is a GUID partition table, when accessed via USB. If there is an MSDOS partition table and the boot partition has a boot flag, it works. (Normally booting via grub should not bother about the partition table or boot flag.) My son and some friends have such computers, and I have tested and verified this behaviour more than once.

You can check the partition table with the following command

sudo parted -ls

Unfortunately dd_text_16.04-UEFI-n-BIOS_2017-05-07_intel-4-pendrive-7.8GB.img.xz has a GUID partition table.

Modell: SanDisk Extreme (scsi)
Disk /dev/sdd: 16,0GB
Sektorstorlek (logisk/fysisk): 512B/512B
Partitionstabell: gpt
Disk Flags:

Nummer  Början  Slut    Storlek  Filsystem       Namn  Flaggor
 1      1049kB  316MB   315MB    fat32                 startbar, esp
 2      316MB   317MB   1049kB                         bios_grub
 3      317MB   7262MB  6946MB   ext2            root
 4      7262MB  7799MB  537MB    linux-swap(v1)

Test

But I think it will work for you from the following image, dd_Lubuntu_16.04.2_amd64_persist-live_mkusb-12.1.4_7.8GB_msdos-pt.img.xz. It has the correct partition structure to boot also in 'middle-age HP computers'.

Modell: SanDisk Extreme (scsi)
Disk /dev/sdd: 16,0GB
Sektorstorlek (logisk/fysisk): 512B/512B
Partitionstabell: msdos
Disk Flags:

Nummer  Början  Slut    Storlek  Typ       Filsystem  Flaggor
 3      2097kB  130MB   128MB    primary   fat32      startbar
 4      130MB   1072MB  942MB    primary
 2      1072MB  6443MB  5372MB   extended             lba
 5      1073MB  6443MB  5371MB   logical   ext2
 1      6443MB  7799MB  1356MB   primary   ntfs

In linux you install from compressed image files with mkusb. In Windows you can use Win32 Disk Imager.

Final installation

I remember that you don't want a persistent live system, but if you test it and it works, you can create an MSDOS partition table with the relevant partitions and flags in your USB stick. gparted is a good tool for this purpose.

Then you can install Ubuntu into it with Ubuntu's standard installer. It is easiest, particularly in UEFI mode, if you disconnect (unplug) the internal drive.

Select 'Something else' at the partitioning window of the installer. The target USB stick will be seen as an internal drive, when booted from another USB stick, and the installer will install the EFI boot files into it. (Otherwise the EFI stuff will be written into the internal drive and you have to copy it manually, which is possible but tricky.)

Tweaks

This link describes some tweaks for the installed system.


How do you statically asign an IP to a commissioned machine in MAAS?

Identify the MAAS subnet you are using for the static IP.

maas maasadmin subnets read | jq '.[] | {id:.id,name:.name}' --compact-output

Find the system IDs of the server you want to assign a static IP address.

maas maasadmin nodes read | jq '.[] | {hostname:.hostname,system_id: .system_id, status:.status}' --compact-output

Identify the NIC of the machine that will receive the static assignment.

maas maasadmin interfaces read ${SYSTEM_ID} | jq '.[] | {iface_id:.id, name:.name, mac:.mac_address, vid:.vlan.vid, fabric:.vlan.fabric}' --compact-output

If the NIC already has an "auto" link, identify this link and delete it.  (The NIC should be in an un-configured state before going to the next step.)

maas maasadmin interfaces read ${SYSTEM_ID} | jq '.[] | .links[] | {link_id:.id, mode:.mode, ipaddr:.ip_address}' --compact-output

maas maasadmin interface unlink-subnet ${SYSTEM_ID} ${NIC_ID} id=${OLD_LINK_ID}

Assign the static IP address:

maas maasadmin interface link-subnet ${SYSTEM_ID} ${NIC_ID} mode=STATIC subnet=${SUBNET_ID} ip_address=${STATIC_IP}

A few extra notes:

machines should be in the "ready" state (after commissioning, before deployment) before running the process.
your MAAS DHCP settings may impact what IP addresses you can use for static. Specifically, you can't use a DHCP-owned address for static assignment.
for hosts with more than one NIC, you can identify the correct NIC using its MAC address from step #3.
take notice of the quoting ' and piping | for the jq command.  The pipes inside the quotes are intentional.

Thank you to Canonical Tech Support for their help with this solution.


I would change the encryption on the wifi router to WPA2-AES or WPA2 only and see if it improves. You are currently using TKIP and that usually causes issues with Ubuntu


Connection refused error for kube-dns pod

Could you please try below command :

kubectl apply -f https://github.com/coreos/flannel/blob/v0.8.0/Documentation/kube-flannel.yml -f https://github.com/coreos/flannel/blob/v0.8.0/Documentation/kube-flannel-rbac.yml

then try to list pods and check logs for kube-dns pod


Wakes from suspend immediately when bluetooth device disconnected

Could be kernel bug 200039. Removing the btusb module would help in that case (rmmod btusb). If that is the case you could indeed load/unload the kernel module via a sleep script, much as the one posted here.


Wireless cuts out on 14.04 Toshiba Satellite L655 S5078

There is one and only one driver in Ubuntu that will claim and drive your device. You can't arbitrarily decide to change the driver from rtl8192se to, for example, rtl8192ce. You can compile and replace your rtl8192se with a newer version of rtl8192se. However, newer is not always better.

Find out what driver you currently use:

lsmod | grep rtl

Find out more about your device:

lspci -nn | grep 0280

If, for example, the pci.id of your device is 10ec:8174, then you can see the alias here:

modinfo rtl8192se
<snip>
alias:          pci:v000010ECd00008174sv*sd*bc*sc*i*

One and only one driver in Ubuntu has that alias and therefor drives your device.

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

There are also some things to adjust on your computer. I recommend that your regulatory domain be set explicitly. Check yours:

sudo iw reg get

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

sudo iw reg set IS

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

gksudo gedit /etc/default/crda

Use nano or kate or leafpad if you don't have the text editor gedit. Change the last line to read:

REGDOMAIN=IS

Proofread carefully, save and close the text editor.

Next, I'd set IPv6 to Ignore in Network Manager: http://docs.fedoraproject.org/en-US/Fedora/18/html/Installation_Guide/images/netconfig/network-connections-ipv6-ignore.png  This example is for ethernet, but you want wireless.

If these changes are ineffective, there are some driver parameters we might try:

sudo -i
echo "options rtl8192se swenc=1 fwlps=0 swlps=1"  >  /etc/modprobe.d/rtl8192se.conf
reboot

Any improvement?


Phone not getting detected in DDMS in Ubuntu 12.04 - 32bit

When checked the vendorId and productId in windows, it shows 1c9e:9e18. But in ubuntu it shows 1c9e:9e08. So tried to switch to same vendorId/productId i.e 1c9e:9e18. For this, create a rule in /etc/usb_modeswitch.d/1c9e:9e08 and put the below contents in the file:

DefaultVendor=0x1c9e
DefaultProduct=0x9e08

TargetVendor=0x1c9e
TargetProduct=0x9e18

SierraMode=1
NoDriverLoading=1

Add below code to the file /lib/udev/rules.d/40-usb_modeswitch.rules

ATTR{idVendor}=="1c9e", ATTR{idProduct}=="9e08", RUN+="usb_modeswitch '%b/%k'"

once this is done, run :

sudo usb_modeswitch -v 0x1c9e -p 0x9e08 -S -R -W

Now adb will be able to recognise the phone.

For further reference you can go through the below link:
http://forum.xda-developers.com/showthread.php?t=1968465


Why is my cron script to dump a MySQL database not executed?

I assume you've added this as a crontab of your own user. The problem is thatcron has no way of authenticating to sudo so it can't run your command. The simplest way around that is to add the crontab to root's account instead:
sudo crontab -e

Then, add this line:
* * * * * mysqldump -h example.com -u username -ppassword dbname | gzip > db.zip

There's no need for a script for something so simple so you may as well add the command itself. Either way, you don't want to use sudo with it.

In response to your edit:
To rule out various possible complications, make inreadobase_backup.sh look like this:
#!/bin/sh
/usr/bin/mysqldump -h example.com -u username -ppassword dbname | /bin/gzip > /home/maximus/db.zip

Then, to capture any errors, redirect the error output of the script to a file by adding 2> file to your cron line:
*/5 * * * * /home/db_backups/inreadobase_backup.sh 2> /tmp/cron.error

You can then check /tmp/cron.error for more details.


Now you can install ncl through apt-get in Ubuntu 14.04. It has a bug though. Bug https://bugs.launchpad.net/ubuntu/+source/ncl/+bug/1329691 . You have to do some linking.

sudo apt-get install ncl-ncarg
sudo ln -s /usr/share/ncarg /usr/lib/ncarg

And you can start using ncl inside 14.04.


Duplicate sources warning found while updating

Edit sources.list and comment out the duplicate entry.

Edit sources.list:

sudo nano /etc/apt/sources.list

Place a # in front of the duplicate entry
Save:

CTRL + X, Y, ENTER
Update:

sudo apt-get update

Now try again.

Source


The right command-line tool for this job is find e.g.

find -iname '*.mp3' -type f -execdir cp -t /home/dan/Music/ -- {} +

The -iname test will match case-insensitively i.e. .MP3 as well as .mp3 - I'm not sure if that's important on NTFS filesystems. You could use -name instead.


Commands not working on xterm but work in ssh session

bash searches for the command you type (assuming the command is NOT an alias or a builtin and doesn't start with "/") in the directories listed in the colon-separated list contained in the PATH variable. echo $PATH to show it. I don't have irb installed, but reboot and shutdown are in the /sbin/ directory.

export PATH=$PATH:/sbin

will make reboot and shutdown visible.

You can find where irb is located by logging in with ssh, then

type -p irb

Add this directory to your PATH.

Check your terminal type (echo $TERM) in each environment, and see if $TERM affects your ~/.bashrc.


Ubuntu 16.04: SSH server connects locally, but refuses remote connections

Answer based on the discussion above.
For some routers, local loopback is handled differently for TCP and ICMP packets. Therefore, the router will respond to ping on the WAN address, but will not allow local network users to connect to port forward on WAN side.

To test the theory, nmap should be used to check the port is open, or the connection should be attempted from a remote address.

nmap -p 31415 -Pn your_internet_ip

or

go to http://canyouseeme.org and check from there (which is what the OP did).


If you can see your wifi's signal on your device's wifi menu, maybe is your device can get signal by your wifi hotspot but your device can't send data back to your wifi hotspot. Because the signal has been block down by your wall, so that is why you can connect to your WiFi hotspot in short secands when you and your WiFi hotspot in the same room.

I usually have same problem when I at my school.


Requested formats are incompatible for merge

This is not really a problem but actually an expected behavior for youtube-dl.

By default the current version youtube-dl will download the highest quality audio and the highest quality video streams available and then join these streams into a compatible container. Current choices of container are mkv, mp4, ogg, webm, flv. (I note that avi is also supported through the --recode-video option.)

If these 'best' streams are codecs that do not sit well in an mp4 container, for example, youtube-dl will pack them into an mkv container and issue the warning that you have seen. Mind you vlc, SMPlayer and friends will play back the resulting mkv file with no issues on a well configured Ubuntu system...

If however you are really keen to get the best quality video and the best quality video audio but only in an mp4 container (thus bypassing the mkv warning and subsequent Matrosk container output from youtube-dl) you can use something like the following:

youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]' URL

Obviously substituting the 'URL' value for the address of the youtube video you wish to download. Such a relatively complex command line can be placed permanently in the configuration file ~/.config/youtube-dl/config as follows:

-f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]'

With the above line placed in the youtube-dl config file the settings will become the default for youtube-dl and do not need to be given on the command line each time. (Easily bypassed if needed by passing the --ignore-config option on the command line).

Many, many variations of this command line are possible...

References:

youtube-dl Format Selection
youtube-dl Config File


I have written a script which prints stab_site polv brmu ankr in a file named filename if user enters  polv brmu ankr in the input.

However I didn't understand what you want to acheive with loop, so I've done nothing about it.

echo -n "##### INPUTS? #######"
read  inputs
text="stab_site "
name=filename
touch $name
echo $text$inputs >>$name


Using a PPA:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

and then

sudo apt-get install oracle-java8-set-default


libinput: How to map different Tappings to Buttons, TappingButtonMap has no effect

Besides the xorg.conf option in blunden's answer above,

Option "TappingButtonMap" "lmr"

you can also manually set it as

xinput set-prop $ID "libinput Tapping Button Mapping Enabled" 0, 1

for "lmr" or 1, 0, where $ID is the device id. Found the man pages of libinput, link.


How do I install Lubuntu without a USB or CDROM?

It sounds like[1] Lubuntu will be supported on Wubi in 12.04. If you're willing to wait 2 weeks, that sounds like the easiest solution.

[1] See http://ubuntu-with-wubi.blogspot.com/2012/01/wubi-will-support-lubuntu-in-release.html, http://www.omgubuntu.co.uk/2012/01/lubuntu-12-04-news-roundup/, https://bugs.launchpad.net/wubi/+bug/907524/comments/7. Theoretically, you could test a daily build of 12.04 right now if you wanted, though I don't know how stable it would be.

DO NOT INSTALL DAILY/BETA BUILDS UNLESS YOU KNOW WHAT YOU ARE DOING AND ARE OK WITH THE IDEA THAT YOUR SYSTEM COULD GO BONKERS OR DATA COULD BE ERASED.


How to setup overGrive with multiple accounts?

Answer

For now, one can not. Got a reply from developer Christiaan Diedricks on this:

  "Currently you cannot sync two accounts at the same time. Google does not allow this. You need to connect one account - sync, then connect the other and sync. This can be done in the trial version. We are working on making multiple accounts easier to manage."

Workaround

I found that I have installed a grive2 package some years ago. With this, from CLI, it can be done as described here:  https://askubuntu.com/a/530163

To automate grive2 syncing with Google Drive, one can use crontab

In terminal, open up user crontab for editing :

crontab -e

Enter the following line in crontab to have it sync every 15 minutes (replace username and google_drive with your username and folder you want to sync):

*/15 * * * * grive --path /home/username/google_drive/

Save your crontab file


Thanks for the info about order of options @bodhi.zazen and @LordNeckbeard. Apparently the libvpx encoder is a little more picky about that. When I added -threads option after -c:v libvpx, it visibly uses more cores according to top.

-threads 0 only uses 1 core, -threads 8 uses 2 cores, and -threads 16 uses 4 cores. I've tried using a higher number, but the encoder says more than 16 threads is not recommended, and doesn't use any more CPU. Encoding speed itself is about twice as fast now. Thanks again for the help!


Can't install Pinnacle Studios 14 on Ubuntu

The Wine status for Pinnacle Studio 14 is "Garbage". This usually means that no matter how much you're willing to battle, this is just never going to work under Wine.

You likely to have more luck under something like Virtualbox (with a virtualised install of Windows) but you might just do well to find an alternative application.


I don't understand why you are trying to compile a cross platform package that is an installer of Linux distributions to a partition or USB drive, when it would be much simpler to install an application that does the same thing as Rufus from the default Ubuntu repositories. Open the Ubuntu Software Center and search for UNetbootin and install it.
UNetbootin has been dropped from the Ubuntu 18.04 repositories. When I tested the built-in Startup Disk Creator application as a UNetbootin replacement app with a few non-*buntu live .iso images it worked in Ubuntu 18.04 every time.

If you want to install Rufus anyway (because Windows ISOs are supported by Rufus), you should read the README.txt file in the rufus-1.4.7 archive for information about how to compile it.


Use different desktop theme for Ubuntu Software Center

Why not change the background-color of Ubuntu Software Center to a darker one, (which I did as well - works perfectly fine). To do so, simply edit/modify itemview-background.png, see full path below and make sure to backup the untempered image-file:

/usr/share/software-center/ui/gtk3/art/itemview-background.png

Or change the color-value for [text+shadow argument] of the visible drawn text in USC to a darker one, see path below: (didn't looked deeper into it, but it is somewhere in softwarecenter.css and/or softwarecenter.highcontrastinverse.css)

/usr/share/software-center/ui/gtk3/css


You are using a crowded frequency (2.462) Use a less crowded frequency to fix the issue.

You have

3   APs on   Frequency:2.412 GHz (Channel 1)
1   APs on   Frequency:2.417 GHz (Channel 2)
3   APs on   Frequency:2.462 GHz (Channel 11)

Try channel 6 instead.

You need to change your router settings to broadcast on channel 6 instead of the current channel 11.


Oracle 12 C DB installation on Ubuntu 18.04 LTS

Please look at the following link for installing Oracle 12 DB on Ubuntu 18.04.

https://tutorialforlinux.com/2018/05/09/how-to-install-oracle-12c-r2-database-on-ubuntu-18-04-bionic-64bit-easy-guide/

I personally tried it out and I was able to install the DB, but the database wouldn't start. It appears to be self-deadlocked -- the stack trace shows it is waiting on __lll_lock_wait_private called from localtime

Then I followed the instructions on the following page:

https://etc.to/confluence/pages/viewpage.action?pageId=20480023

In particular, the following commands fix the hang issue:

cd $ORACLE_HOME/lib/stubs
rm libc*
cd ../../bin
./relink all

So, these steps work:

setup your environment as per the instructions on the webpage
runInstaller and only install the software, i.e. don't create the database
cleanup stubs and relink all as above
run dbca to create your database


I have an MP620 printer that stopped working on Ubuntu 13.04.
After some investigations I found out that CUPS did not have suport for BJNP.
I tried to install the support with

sudo apt-get install cups-backend-bjnp

After this, CUPS found the printer and the driver automatically.

before installing cups-backend-bjnp I followed the instructions from this post.


How do I deactivate dynamic contrast on a Dell XPS?

Reproduced on a Dell XPS 13[1], there seem to be a real problem stemming from a collision between the graphics drivers, constantly calling the screen's brightness auto-adjust and  causing the screen to flicker. See this bug report on another related issue (regarding broken functionality of function keys out of the box) that suggests a solution to the flickering problem as well;

The fix to both issues is offered by Kamal Mostafa from the Canonical Hardware Enablement Team as part of the Sputnik [2] Kernel PPA, while an independent earlier patch targets the function keys issue only (it is best, of course, to update with the former).

[1] I happen to own an XPS 13 model, and incidentally installed the 12.04 the day I got it... This is not a Sputnik machine, however (see [2]).

[2] The Sputnik project was Dell's effort to market a developer oriented edition of the Dell XPS 13 laptop, pre-installed with Ubuntu 12.04, and packed with developer-targeted goodies


Press Ctrl + Alt + F2. You will then see a new screen that looks like a full screen terminal. Then, you can type in your username and password. If you would like to return to the GUI, try typing the following command:

sudo service lightdm start

You also may want to check to see if you are booting into text mode by default. To do that, use the following commands in Terminal:

sudo nano /etc/default/grub

Find this line:

GRUB_CMDLINE_LINUX_DEFAULT="text"

If it says "text", please change it to "quiet splash".

If you made any changes, you need to update grub. You can do this with this command:

sudo update-grub

Reboot your computer and see if it works.


Execute a script after a VPN connection is started

Create a script in /etc/network/if-up.d, containing

#!/bin/sh

if [ "$IFACE" = "ppp0" ]; then
    ifconfig ppp0 mtu 777
fi

and make it executable.


Can't boot after update to 16.04 - BusyBox shell appears

As we discussed... get into the GRUB menu by holding down the LEFT SHIFT key immediately after selecting Ubuntu from the Windows boot manager. Then select the prior kernel and see if it boots. If yes, do some backups! Then try the 16.04 upgrade again (with Wubi, if you like). If that fails again, just do a standard Ubuntu reinstall/upgrade using a Ubuntu LiveCD that you've burned to a DVD. Cheers, Al


This copies the file from the path in i variable to the mentioned directory.

../../ means "two levels up".

$x/$y means move down to directory, which name is stored in the x variable, then move down to the directory from y variable.

But if $y directory doesn't exist, the file will be copied to $y file in the $x directory.

mv dir ../../$x$y/name moves dir to name located two levels up and two down $x$y -> name.


I was actually also interested in automatic USB mount on Ubuntu 18.04 for my "as good as newly installed" server.
I'm uncertain in which way you've installed USBmount or what version of it you're running, but I do know that a bug specific to USBmount has been fixed in the git (and there doesn't seem to be a 18.04 compatible version in apt.

If it's not a recent installation (maybe upgraded server from 16.04, where it did work or not from the github project page, I advise to backup your configuration and reinstall usbmount from the Github page.
The instructions for this can be found on the Github page, but my process was as following:

Backup and remove usbmount (in my case, I had a clean 18.04 install, so there was nothing to backup/remove)
git clone http://github.com/rbrito/usbmount.git
cd usbmount
sudo apt-get update && sudo apt-get install -y debhelper build-essential
sudo dpkg-buildpackage -us -uc -b
sudo dpkg -i usbmount_0.0.24_all.deb
^ Fails because of unmet dependencies use:
sudo apt --fix-broken install

After that, I formatted a usbdrive using:

sudo mkfs.vfat -n 'name_for_your_pendrive' /dev/sdy1

And when re-inserting the USBdrive, it automatically mounted.

Note: I must also add that any issues are better reported under the Github project.
Note2: If you think this answer was helpful, please comment on how to reload the settings, since I'm strugling with that at the moment. EDIT: changes seem to go into effect directly...
Note3: Make sure your BIOS is not set to boot from USB over boot from harddrive, since if you leave the drive in, it may attempt to boot from it.
Note4: Please first test it with a well supported format, before going on to NTFS, exfat or hfsplus.


This sounds like you simply downloaded mongodb tarball and installed it without all of the dependencies.

You should either download the deb file or setup apt to get the deb from the 10gen repos.  See here.

Your error is most likely due to the fact that you're missing the xulrunner package, which is part of the mozilla/firefox stuff.  Mongo uses the javascript engine that is part of firefox.

One note: due to the fact that mongo depends on xulrunner, xulrunner depends on lots of other things, be prepared to install lots of seemingly unnecessary packages to get mongo running.


Ubuntu w/ LibreOffice on a Tablet PC - does it have inking capabilities?

Libreoffice 4.0 Adds capabilities of importing ink annotations on MS Word and RTF documents. But, it doesn't yet support the pen devices very well. So, ability to read your ink annotations on LO is certain. But, you might want to try out if you can add and edit ink annotations on your device on LO.

https://wiki.documentfoundation.org/ReleaseNotes/4.0#Writer


The behavior you're observing is because su -c 'command' does not execute command in an interactive shell.

Since su doesn't appear to provide an option to do so, probably the cleanest way to do what you want is to move the NVM environment variables into a separate file, called nvm_envs say, and source that explicitly e.g.

su user -c '. ~/nvm_envs && echo $NVM_DIR'

If you want interactive bash shells to have the same environment, source the same file from your .bashrc file e.g.

if [ -r "$HOME/nvm_envs" ]; then
  . "$HOME/nvm_envs"
fi

(This is exactly how the default .profile file conditionally sources the user's env_vars file: you could use that file instead if you prefer.)


YAML is annoying on DNS addresses: [8.8.8.8,8.8.4.4]

network:
 version: 2
 ethernets: {}
 renderer: networkd
 ethernets:
  ens160:
  dhcp4: no
  addresses: [206.80.236.251/29]
  gateway4: 206.80.236.249
  nameservers:
    addresses: [8.8.8.8,8.8.4.4]

Make sure you are spacing correctly at exactly this stage :

nameserver

should be aligned with gateway & addresses while spacing


How do I upgrade KeePass2 to the newest version from the terminal?

Use the KeePass repository :

sudo apt-add-repository ppa:jtaylor/keepass
sudo apt-get update
sudo apt-get install keepass2

With this PPA KeePass will automatically be updated when you run sudo apt-get upgrade
(or when running the Update Manager).

Note that http://keepass.info/help/v2/setup.html is not recommending using any private ppa.


Notify-send won't show notification unless run with sudo

Maybe try to reinstall it with:
sudo apt-get purge notify-osd && sudo apt-get install notify-osd


$# is a special variable in bash, that expands to the number of arguments (positional parameters) i.e. $1, $2 ... passed to the script in question or the shell in case of argument directly passed to the shell e.g. in bash -c '...' .....

This is similar to argc in C.

Perhaps this will make it clear:

$ bash -c 'echo $#'
0

$ bash -c 'echo $#' _ x
1

$ bash -c 'echo $#' _ x y
2

$ bash -c 'echo $#' _ x y z
3

Note that, bash -c takes argument after the command following it starting from 0 ($0; technically, it's just bash's way of letting you set $0, not an argument really), so _ is used here just as a placeholder; actual arguments are x ($1), y ($2), and z ($3).

Similarly, in your script (assuming script.sh) if you have:

#!/usr/bin/env bash
echo "$#"

Then when you do:

./script.sh foo bar

the script will output 2; likewise,

./script.sh foo

will output 1.


How to see/change screen refresh rate or monitor frequency?

Compiz looked like it worked. But it didn't work.

So the solution to this is the following.

First we check available modes.
$ xrandr
1440x900       59.9+*   75.0
1280x1024      75.0     60.0

Then we pick the mode, including resolution and refresh rate.
$ xrandr -s 1440x900 -r 75

Or just the refresh rate
$ xrandr -r 75

Let's see if it worked
$ xrandr
1440x900       59.9+    75.0*
1280x1024      75.0     60.0

Alright. Then all you have to do is add the command to Startup Applications and be done.


How do I start screen with multiple splits directly from the command line?

For the specific case of window arrangements, there's a screen command to save them to a file: layout dump. From man screen:

layout dump [filename]

Write to a file the order of splits made in the current layout. This is
useful to recreate the order of  your  regions  used  in  your  current
layout.  Only  the  current  layout is recorded. While the order of the
regions are recorded, the sizes of  those  regions  and  which  windows
correspond  to  which regions are not. If no filename is specified, the
default is layout-dump, saved in the directory that the screen  process
was  started in. If the file already exists, layout dump will append to
that file. As an example:

           C-a : layout dump /home/user/.screenrc

will save or append the layout to the user's .screenrc file.

So, once you make the arrangement manually, press Ctrla:, then type layout dump /path/to/some/file. The layout will be saved to /path/to/some/file and you can then restore it in  a new session with:

screen -c /path/to/some/file


Can you play DVD movies (like those disks from a kiosk) in your system? If no, then you will probably need to install libdvdread and libdvdcss:

libdvdread provides the functionality that is required to access many DVDs. It parses IFO files, reads NAV-blocks, and performs CSS authentication and descrambling.

libdvdread probes for libdvdcss at runtime and if found, will use it to decrypt sections of the DVD as necessary

libdvdcss or libdvdcss2 is a free and open source software library for accessing and unscrambling DVDs encrypted with the Content Scramble System (CSS).

In terminal run:

sudo apt-get install libdvdread4

sudo /usr/share/doc/libdvdread4/install-css.sh

sudo apt-get install libdvdcss2


Cannot login using my Administrator account after installing Ubuntu 13.10

I had almost the same problem(I guess) since I do not know the exact system configurations pre and post installations I cannot say for sure, but for the similar problem I had I tried the boot-repair tool https://help.ubuntu.com/community/Boot-Repair turns out my hardrive was full. Give it a try.


Using ls command with a 'path' to display contents inside of a directory

A straightforward demonstration:

Absolute path:

andrew@ilium~$ ls -l ~/Documents/
total 204
-rw-r--r-- 1 andrew users 191413 Mar  7  2014 Claim-Form-1112.pdf
drwxr-xr-x 3 andrew users   4096 Sep 15 11:19 Nested
-rw-r--r-- 1 andrew users    498 Feb 27  2014 backspace_mutt
-rw-r--r-- 1 andrew users     59 Mar  7  2010 clock
-rw-r--r-- 1 andrew users    120 Jun 29  2015 daily
andrew@ilium~$

Relative path:

 andrew@ilium~$ cd Documents/Nested/
 andrew@ilium~/Documents/Nested$ ls -l ..
 total 204
 -rw-r--r-- 1 andrew users 191413 Mar  7  2014 Claim-Form-1112.pdf
 drwxr-xr-x 3 andrew users   4096 Sep 15 11:19 Nested
 -rw-r--r-- 1 andrew users    498 Feb 27  2014 backspace_mutt
 -rw-r--r-- 1 andrew users     59 Mar  7  2010 clock
 -rw-r--r-- 1 andrew users    120 Jun 29  2015 daily
 andrew@ilium~/Documents/Nested$

Relative path (2)

andrew@ilium~$ cd Documents/Nested/Nested_Further/
andrew@ilium~/Documents/Nested/Nested_Further$ ls -l ../../
total 204
-rw-r--r-- 1 andrew users 191413 Mar  7  2014 Claim-Form-1112.pdf
drwxr-xr-x 3 andrew users   4096 Sep 15 11:19 Nested
-rw-r--r-- 1 andrew users    498 Feb 27  2014 backspace_mutt
-rw-r--r-- 1 andrew users     59 Mar  7  2010 clock
-rw-r--r-- 1 andrew users    120 Jun 29  2015 daily
andrew@ilium~/Documents/Nested/Nested_Further$

Bonus 'Combo':

andrew@ilium~$ ls -l ~/Documents/Nested/Nested_Further/../../
total 204
-rw-r--r-- 1 andrew users 191413 Mar  7  2014 Claim-Form-1112.pdf
drwxr-xr-x 3 andrew users   4096 Sep 15 11:19 Nested
-rw-r--r-- 1 andrew users    498 Feb 27  2014 backspace_mutt
-rw-r--r-- 1 andrew users     59 Mar  7  2010 clock
-rw-r--r-- 1 andrew users    120 Jun 29  2015 daily
andrew@ilium~$

OK so the last one is a bit silly but you get the idea :)

Further Reading:

Absolute path vs relative path in Linux/Unix


Ubuntu will not install from a USB device on a Compaq machine with Windows 8.1

Your school's wifi is timing out when trying to download the 1.5 GB Ubuntu 17.10 .iso file. Depending on the speed of your internet connection downloading a file this large can take a long time. You need an internet connection that does not time out, for example at an internet cafe, and then save the Ubuntu .iso file locally to a disk or storage device. Then prepare the Ubuntu installation media like this: What is the proper way of creating installation media from Ubuntu iso?.


Network connection on an Acer Aspire 5253?

well, you may be using the desktop edition. in ultimate edition you will be having both drivers installed on it. i used ubuntu 10.04 desktop and ultimate edition.but only wireless driver is missing in desktop. wired connection  is working fine. in ultimate edition both are working fine.you have two solutions i think

simply change the version of ubuntu or install ultimate edition.

2.else install the driver for wired connection after downloading it from windows.
and then wireless driver can be installed by giving the following command in a terminal
sudo apt-get install driver
(here driver should be replaced with the name of the driver for ubuntu 10.10)
it will ask for administrator password. give it. after that it will connect to internet automatically(with the wired connection) and will install the drivers for you.


Failed install of 14.04 which has resulted in error: symbol 'grub_term_highlight_colour' not found

Several suggestions in bug report, none seem to work for everyone.

Ubuntu 14.04 Update breaks grub, resulting in "error: symbol 'grub_term_highlight_color' not found"

https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1289977

One choice:
You need to chroot &   use
dpkg-reconfigure grub-pc instead of grub-install directly, so that the system knows that it needs to run grub-install on that drive the next time grub is upgraded.
Or if UEFI:

dpkg-reconfigure grub-efi-amd64

Some find Boot-Repair works, others do not.


It sounds like you already had the Windows boot loader on one drive, and when you installed Ubuntu, chose to install grub to the same drive, and never put a boot loader on the second drive.  If you want to put the Windows boot loader back, you need to boot the Windows install cd, go into the recovery console and use the FIXMBR command.


Keyboard shortcut to switch to an application by name?

In the same System Settings window that Mechanical snail mentions, you can configure a new Custom Shortcut (two places up the tree from Global Shortcuts). Make it of type Command/URL with the following action:

xdotool windowactivate `xdotool search --name Vimperator | head -1`

Of course, change Vimperator to the name of the desired application.


"dpkg-deb: error: failed to read archive '/home/USER/linux': No such file or directory" on installing amdgpu drivers

I had the same problem. In my case, the problem was the directory path where amdgpu-install was had a space in it.  Renamed all the directories in the path to remove the spaces and it worked.


Ubuntu 13.04 Wireless network adapter won't work (ASUS USB-N53)

Have you tried installing the drivers from the manufacturer?

Asus:

http://www.asus.com/Networking/USBN53/#support_Download_5

ASUS USB-N53 Driver 1.0.12.2 for Linux


Fan not spinning after suspend in new kernels (Asus X453M)

This should work. Create /etc/pm/sleep.d/20_fancontrol with the following contents:

#!/bin/sh

case "${1}" in
    resume|thaw)
      /usr/sbin/service fancontrol restart
      ;;
esac


I had the same issue.
You need to verify the path where conjure-up is installed then run conjure-up --bootstrap-to <hostname> from there.

$ which conjure-up
/snap/bin/conjure-up
$ /snap/bin/conjure-up --bootstrap-to <hostname>


Seahorse
Seahorse is the passwordmanager used by default. Can you find your passwort there?


I can not install or remove apps After trying to install bumblebee and nvidia prime

The solution in post #4 of How do I uninstall this program (jetty) fixed this problem for me.


First, make sure that your system it set so that the grub menu shows during boot and for long enough that you have time to select which kernel to boot. Typically, I use GRUB_TIMEOUT=20.

Download all 5 files into some temporary directory. Then execute:

sudo dpkg -i *.deb

Then re-boot and during boot, select the test kernel.
If you are not using grub, then I don't know.

Eventually, you will want to delete the test kernel. To do so, you must be booted to another kernel, not the test version (i.e. you can not delete the currently running kernel). You can use the excellent utility from here, or do it manually. While I only ever use the server version of the utility, I'll show the manual method:

doug@s15:~$ dpkg -l | grep 4.17.0-1
ii  linux-headers-4.17.0-1                           4.17.0-1.2~lp1728244                       all          Header files related to Linux kernel version 4.17.0
ii  linux-headers-4.17.0-1-generic                   4.17.0-1.2~lp1728244                       amd64        Linux kernel headers for version 4.17.0 on 64 bit x86 SMP
ii  linux-image-unsigned-4.17.0-1-generic            4.17.0-1.2~lp1728244                       amd64        Linux kernel image for version 4.17.0 on 64 bit x86 SMP
ii  linux-modules-4.17.0-1-generic                   4.17.0-1.2~lp1728244                       amd64        Linux kernel extra modules for version 4.17.0 on 64 bit x86 SMP
ii  linux-modules-extra-4.17.0-1-generic             4.17.0-1.2~lp1728244                       amd64        Linux kernel extra modules for version 4.17.0 on 64 bit x86 SMP
doug@s15:~$
doug@s15:~$ sudo dpkg -P linux-modules-extra-4.17.0-1-generic linux-modules-4.17.0-1-generic linux-image-unsigned-4.17.0-1-generic linux-headers-4.17.0-1-generic linux-headers-4.17.0-1
(Reading database ... 1480661 files and directories currently installed.)
Removing linux-modules-extra-4.17.0-1-generic (4.17.0-1.2~lp1728244) ...
...[deleted a bunch of lines]...
rmdir: failed to remove '/lib/modules/4.17.0-1-generic': Directory not empty
...

Notice that I reversed the purge list, so as not to get into dependency issues.
The directory thing seems to occur with 4.17 kernels, but the directory has a sub-directory which I guess confuses things. However, on my system it is gone anyhow.


can I run a python script in ubuntu 12.04's from the graphical interface

In Windows, the file types are identified by the last 3 chars after the . However, in linux (and in Ubuntu) .py just helps us humans figure out what kind of file it is. You have to tell Ubuntu that the script you wrote is a python script and it should be run with a python interpreter. You can do this in two ways:

First you can call python followed by the name of the script. That is open a terminal and type:

python hellowworld.py

This will work.

Second, however, you want to use the GUI and run it by double clicking. To this you need a line in the script that tells Ubuntu that the next lines are to be interpreted as a python script. This first line is called the shabang line. For python it looks like:

#! /usr/bin/python

Note the #! at the beginning. The first two characters of your script must be those two followed by the rest of the line. So your script will look like:

#! /usr/bin/python

print"hello world"
vary = raw_input("Enter your Name")
print ("hey " + vary)

As you noted the script must be tagged as executable. To do that, right click on the script's icon and go to Properties>Permissions and check Allow executing file as program.

Now when you double click on the script it will show you a Window with the choices:

Run in terminal, Display, Cancel, Run

You can try Run in terminal. It will open a terminal and show you the prompt:

Enter your name

When you enter your name the terminal will close as the script completes. So you will never see "hey [your name]" as it will happen too fast for your eyes to catch it. You will have to modify the script so that it pauses and wait for you to dismiss it after you see the display.

Hope this helps


Script to install Ubuntu and same set of programs on several computers

Check out Diskless Remote Boot Linux and Clonezilla. The idea here being that you would install the Desired OS on a dedicated server with all the apps, clone it and then use DRBL to install the image via Clonezilla.

DRBL: http://drbl.org/
Article describing all this: www.linuxjournal.com/article/10884


Ubuntu is not booting after installing windows 8 in same machine?

Grab a Ubuntu LiveCd / USB and follow this guide:

http://www.webupd8.org/2009/12/how-to-recover-grub2-linux.html


Wired Connection Problem on a Lenovo Workstation e20

I encountered the same problem after upgrading to 12.04 LTS.

The following solution worked for me.

Open this file in a text editor as root:

/etc/network/interfaces

(One way to do that is gksu gedit /etc/network/interfaces.)

Add these lines to the file:

auto eth0
iface eth0 inet dhcp

Save the file and quit the text editor.

Now restart the network:

How to restart the networking service?


How to increase max open files limit on Ubuntu 18.04?

From the manual:

 -n     The maximum number of open file descriptors (most
        systems do not allow this value to be set)

systemd has an option for this:

$ more /etc/systemd/system.conf | grep NOFILE
#DefaultLimitNOFILE=

But this is also only for the graphical user settings. Remove the # and you can set it to 65536.

Comment from Daniel Fernández:

DefaultLimitNOFILE=65536

might also be needed in

/etc/systemd/user.conf


I accidentally turned on NICOLA-F style Backspace. Turning it down fixed the problem


What gaming resources for ubuntu(or gnu/linux in general) are there?

You should probably start here: https://help.ubuntu.com/community/Games

Also, does anyone need another game besides Minecraft?

Gotta add one more. Everything from Three Rings works great on Linux using the Sun JVM. Spiral Knights is getting some good press right now.


how to use ubuntu minimal images with kvm

Minimal images are a sub-type of cloud images and as such need to be initialized with uvtool as explained in this answer. However there are few critical details missing:

1) to download minimal images a special URL must specified in the --source option for uvt-simplestreams-libvirt:

 uvt-simplestreams-libvirt sync --source https://cloud-images.ubuntu.com/minimal/daily/ release=bionic arch=amd64

the above URL uses daily built minimal images which have all the updates already applied. If for some reason you want to start with unupdated vanilla release image, then use https://cloud-images.ubuntu.com/minimal/releases/ instead.

2) if you have other images downloaded (like from the default source for example) it may be necessary to specify a proper label filter when creating a minimal VM:

uvt-kvm create --memory 4096 --cpu 2 myminimalvm release=bionic arch=amd64 "label=minimal daily"

you may also need/want to use --ssh-public-key-file option depending on your ssh setup.
If you used release instead of daily image in the previous step, then adjust the label filter accordingly.

3) after the VM is created you should make sure that Cloudinit tool has finished its job:

uvt-kvm wait --insecure myminimalvm

(you may also need to use --ssh-private-key-file option depending on your ssh setup)

At this point the VM is ready to rock :) You can now operate it (start/stop, pause/resume etc) with standard libvirt tools including virt manager GUI.

Note however that if you open its console, you will see only the BIOS boot information (as described in the question) as minimal images don't output anything on the console nor start the login service. you can only access them via ssh: either with

uvt-kvm ssh --insecure myminimalvm  # again, --ssh-private-key-file may be needed

or directly with ssh after you figure VM's IP (with virt manager, or uvt-kvm ip myminimalvm and also it is usually in the output of uvt-kvm wait):

ssh ubuntu@ip.of.the.vm