why conky and docky doesn't start automatically at lubuntu

In Lubuntu 13.10, edit ~/.config/lxsession/Lubuntu/autostart. Add the appropriate commands on separate lines to the end of the existing file. If such a file doesn't exist, create it with Leafpad or nano.

Note that @ should not be present at the start of each line.


Gedit "Highlight Misspelled Words" enabled by default

No it can not be set as default.

That does not rule out that someone who knows how to decompile, reprogram and recompile the spell checker plugin for gedit can't make a setting for it, it is open source after all.  If it is indeed abandoned, then it is even more so free game.  Just give credit where due.  I would love to have this option, and setting a different language as default too.


20.04 display flickering with AMD Drivers

I also used the amd 5700xt TUF OC 8Gb with Ubuntu 20.04.
Using the terminal I installed all open variant, because of some
needed parts from AMDGPU-PRO packs (for example: OpenCL).
I have no problems with the Installation. I play in Steam (Linux) Dying_light, Doom, Dirt Rally 4 or the newer 2.0, with nearby 200 Fps. A great Vulkan Support from this Card.
I search a graphical xserver_app for amdgpu settings. The Adrenalin Software in MS Windows IS AWESOME. Here is the terminal command I used:
./amdgpu-pro-install -y --opencl=pal,legacy


First find out what your wireless kernel driver you use:

Run

sudo lshw -class network

Then look for "driver=xxxxx" e.g.

Now create a text-file called "reset_wireless.sh" with the following:

#!/bin/sh
service network-manager stop
modprobe -r brcm80211
modprobe brcm80211
service network-manager start

obviously change "brcm80211" with your driver.

Give it execute rights i.e.

chmod +x reset_wireless.sh

Now right-click and create a launcher on your desktop with the command:

gksudo reset_wireless.sh

Now when you awaken you can reset your wireless by double-clicking on the new launcher.

Automating

You can try the following to automate the above script on resume:

Move the file to a known location e.g.

sudo mv ~/resume_wireless.sh /var/local

Now create a new script:

#!/bin/sh
case "$1" in
        thaw|resume)
    /var/local/resume_wireless.sh
    /var/local/resume_wireless.sh
        ;;
        *)
        ;;
        esac
exit $?

save this script in the folder /etc/pm/sleep.d called 99wireless-resume and give it execute rights.

technique borrowed from here and here


bios not recognize internal drive as bootable after disconnecting and connecting back in

I had a similar thing occur with my Slackware installation. I was able to fix it by re-running the installation but skipping the actual filesystem install part. The install originally gave me the option of doing a UEFI or LILO install but I chose UEFI install because newer is better, right? Turns out, nope. LILO for me next time if the MB supports it.

With respect to Rod Smith, "Don't power on a computer with its boot disk(s) unplugged. Ever." appears to be a true answer but also one that I consider to be completely crazy. Who designs this stuff?


How to select only certain updates on Ubuntu Server 16.04?

-1- List updates

apt-get -s dist-upgrade
# -s: simulate, dont download and dont install

-2- Update manually the packages you want

apt-get install <packagename>
# will update installed package

Of course, dependencies will be updated or outdated...
You may run apt-get install -f at the end


Dual boot booting problems. Windows on UNEFI, Ubuntu on legacy

If you're dual-booting with another OS, the two OSes' boot modes should match. Most computers that ship with Windows 8 and later use UEFI to boot that OS, so this configuration dictates use of UEFI mode when installing and booting Ubuntu.

So you have to match both your installations.

Either renstall Ubuntu in UEFI mode or
Convert Ubuntu into UEFI mode

Note: Do not follow this procedure if your computer is already booting correctly. Use this procedure only if you believe you've accidentally installed Ubuntu in BIOS/CSM/legacy mode and you want it to boot in UEFI/UEFI mode.

Start Boot-Repair, click on "Advanced options", go to the "GRUB location" tab.

If you do not see a "Separate /boot/efi partition" line, this means that your PC does not have any UEFI partition. In this case, exit Boot-Repair, then create an UEFI partition (see the "Creating an UEFI partition" paragraph above).

If you see a "Separate /boot/efi partition" line, tick it then click the "Apply" button.

Set up your BIOS so that it boots the HDD in UEFI mode (see the ""Set up the BIOS in UEFI or Legacy mode" paragraph above). Source


This just happened to me, too.  I'm using Ubuntu 10.04.  I had a mouse, keyboard, and external USB hard drive plugged in.  Then, when I also plugged in my iPhone via USB, my computer froze.  When I rebooted, no USB devices were registering anything being connected to them:

$ lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

After unplugging all my USB devices (expect for my keyboard and mouse, which are low-power devices), I restarted my computer a couple of times.  Then, my USB devices started working again.

Once the USB devices started working again, lsusb gave me the following output:

$ lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 413c:2106 Dell Computer Corp.
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 0461:4d22 Primax Electronics, Ltd
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So, I suggest unplugging all USB devices and cycling your computer a couple of times.  The best way to do this is to log in to your computer remotely via ssh and enter the command sudo shutdown -r now.  Do this a few times.


Why are some apps like GMusicBrowser and LightLocker in Japanese instead of my computer's Spanish in Xubuntu?

I'm going to take a wild guess and assume that you had a problem similar to mine, when I installed xubuntu, I selected english but many things appeared in arabic, because I selected Lebanon from the installation wizard.

to fix this settings -> language & support, language for menus and windows spanish -> apply system wide

regional formats spanish -> apply


Where's the File System Directory in LUBUNTU 15.04

open terminal and type:

dolphin / which will open your root directory...

Also it is possible to navigate to var

dolphin /var/www but you wil have to use gksu or sudo to modify files here... so:

gksu dolphin /var/www

But I don't understand why you can't acces it directly trough dolphin. I don't use Lubuntu, maybe it's made that way...

Or navigate and copy with terminal using cd and cp.


How to view all current networks around me

You can run ifconfig -a to find a list of Ethernet/Wifi devices on your system. Examples of adapter names might be eth0, wlan0, wlp4s0, etc.

You can run sudo iwlist wlp4s0 scanning to get a list of WiFi networks. You may have to run this repeatedly to get a complete list of networks.

You can only find IP information for a network once you connect to it and communicate with the DHCP server on the network, assuming there is one which is typical, or have some other out-of-band source of information, such as talking to the system administrator of the network.

As far as connecting to networks, you probably want to use tools such as nmcli (NetworkManager command-line interface), iwconfig, and/or wpa_supplicant. Details of using each of those are quite long, so probably topics for separate answers.

EDIT: On the Raspberry Pi running Raspbian, you can run raspi-config to configure WiFi. This provides a menu-based configuration system that shouldn't require much explanation, The following link has more details if you need to manually tweak any connection details that aren't exposed in the menus of that tool: https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md


Dash search does not find all of my files

To fix this, run sudo updatedb in terminal. It will take a couple of minutes to finish but at the end you will have your x.pdf file show up in the dash without logging out, restarting unity or erasing the zeitgeist databases which will make you lose all you activity information.

Source: https://answers.launchpad.net/ubuntu/+source/unity/+question/195718

Another interesting question I found is Dash search gives no result.


Can't connect to the internet with static IP Ubuntu Server 18.04

I fixed it! I added another network adapter that was NAT and that solved the issue. @Thomas Ward sparked my mind with his comment. Many thanks


How to get indirect access on a file through script in linux

Try this procedure:

login as user1
save your command in script file, for example changeText.sh
make it executable:

  chmod 755 changeText.sh

set SUID (Set owner User ID up on execution) permission:

  chmod u+s changeText.sh

After this, changeTest.sh looks like:

      -rwsr-xr-x 1 user1 user1 xxxx nov 15  2014 /path/to/file/changeText.sh

SUID gives temporary permissions to a user to run a program/file with the permissions of the file owner rather that the user who runs it.

In other word, when user2 runs /path/to/file/changeText.sh will get file owner’s permissions and will change text in file text1, even if user2 has not write permission.

Here is a useful link.


HP Officejet 5740 wont run under Ubuntu 20.04

I did two things.
First I turned off printer browsing by changing the line in
/etc/cups/cups-browsed.conf to BrowseRemoteProtocols none .
Then I manually loaded a driver from the driver database.
One of these two actions [or both of them?] fixed the problem.


Can I answer 5 years later?
I was looking for a way to achieve the same and stumbled upon your question.
Here is how I did it:

Open Startup Applications
Select the App you want to conditionally open and click on edit
Add your condition to the command field

In my case, I wanted some apps to only automatically start on weekdays, so my command field went from this:
/usr/bin/teams %U

to this:
if [[ $(date +%u) -lt 6 ]]; then /usr/bin/teams %U; fi


How do I download a playlist with youtube-dl starting in the middle?

you can use the command in that way

youtube-dl --playlist-start=101 <URL>

this should do the trick

you can also use the -s to simulate the downloading to check you are doing it right

source : https://www.youtube.com/watch?v=URcb5LJqtMQ


Your /etc/default/grub has a stray ^Y in it:

=================== /etc/default/grub :

^Y
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

Just delete that line and you should be fine. You can use the following command to delete line 1 (since that's where the error is):

sed -i.bak 1d /etc/default/grub


"burn as file or burn content" Which should I choose?

Well it depends on what you want to do

If you want to unarchive the iso to files then select Burn Contents (creating a bootable ISO)
If you want to burn the iso file as a file then select Burn as file. This will copy the ISO file as whole to the CD.


I had this problem mine was because of monkeying around with plymouth
if you didn't monkeyed with plymouth then this should fix your problem

sudo gedit /etc/default/grub
And modify the line :

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
It to obtain this line :

GRUB_CMDLINE_LINUX_DEFAULT="acpi=noirq acpi=force apm=power_off quiet splash"
Then, save, close, and back in the terminal, execute :

sudo update-grub

have a nice day :)


Seems like this may be the same as https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1899206
If so, it will be fixed in Gnome 3.38.2


How to turn Ubuntu 14.04 Laptop into a Wireless access point?

On the network page in the Wireless section, you should see an option like 'Use as Hotspot' below. Like this.

Do you see that?


First of all, why did you run these commands? Anyway, the last one sets up the 11n_disable=1 option for the iwlwifi driver. Presumably this is what is breaking your system so, just open the file /etc/modprobe.d/iwlwifi.conf:

sudo gedit /etc/modprobe.d/iwlwifi.conf

Find this line:

options iwlwifi 11n_disable=1

And delete it. Then reboot (not needed but it is the simplest approach). Your WiFi settings should now be back to the way they were before you broke them. I am assuming that you did all this to try and solve another issue and suggest that you might want to post a new question explaining that issue and asking for help about that.


Black screen on a Dell inspiron 1501 with a Radeon Xpress 200M

I solved this today for my laptop containing the same Radeon Xpress 200M video chipset.

The trick is to force the radeon kernel driver to load early in the boot process.

Add 'radeon' to the file /etc/initramfs-tools/modules

Run update-initramfs -u  afterwards to update the initrd image for your kernel.


make*** No rule to make target 'obj_sky/neighbour-attr.o' contiki-cooja simulation error

This means that to compile your program you need some additional packages installed on your system. For example: As your code is written in the C programming language, you need to install gcc to compile it. Similarly, You may need gcc-msp430, msp430-libc, gcc-avr, binutils-avr etc packages.

To install these packages run the following apt command:

sudo apt-get install build-essential binutils-msp430 gcc-msp430 msp430-libc binutils-avr gcc-avr gdb-avr avr-libc avrdude openjdk-7-jdk openjdk-7-jre ant libncurses5-dev doxygen git

Source


Screenkey works well, although it shows a banner instead of a full virtual keyboard (and sometimes misses keys, but that may just be a bug):


It usually means that there is a problem with the server , not you. If the application you are downloading is from an 3rd party source, it would be worth the trouble to notify its maintainer. If it is from the official repositories you might want to try using another server. This can be done from the software center at edit --> software sources --> first tab on "download from"


Unity launcher autohide leaves "ghost" behind?

That happened to me too. Since I have an nvidia card I enabled proprietary drivers and now it works.

To do this, open the Software Sources via the Dash (or through System Settings) and hit the Additional Drivers tab.

If autohide doesn't work that means it simply doesn't work. I have to press Meta key to see it.


Virtual filesystem acting as a clone+difference of a master filesystem

To answer your questions (next time, please number them so it's easier to refer to them):

Should be possible
Does NOT sound like the easiest way
Yes, such a virtual FS does exist.

Your idea sounds like a good use case for an overlayfs. You can use your existing database FS as the "lower" filesystem, and a per-developer "diff" FS as the "upper" filesystem. Overlayfs allows using directories as "upper" and "lower" so you don't need to necessarily mount databases in different directories.

Then you'd need to configure each per-developer MySQL instance to use a different datadir.

By far the easiest way is to bite the bullet, equip your server with a say 1-TB hard drive, clone the database however many times you need for each developer, and either run a MySQL instance for each developer, or have one instance manage all the databases. The difference for the developers here is specifying a different port vs. a different database name. IMHO it'd be simpler to just have one MySQL instance, as it means less moving parts.

The factor to consider here is how long it'll take you to develop the overlayfs solution vs. how much a 1-TB hard drive costs for your particular server hardware. Your time has a cost; if you're looking at 3 days of work at (say) $50 an hour (being VERY conservative here) for a total of $1200, and the hard drive solution implies 2 hours of work plus maybe an overnight database sync which you can fire-and-forget, then you'd have a $1100 budget for a 1-TB hard drive. Plus maintenance for the big disk solution is easier since there are no "hacks" or trickery involved; it's just a DB server with a huge hard disk.

Of course, if your Ubuntu server lives in the cloud somewhere, the cost of that 1TB storage slice may be higher. Still, please do consider the cost/benefit analysis to make your decision; you may end up saving money and time in the long run :)


How to prevent gnome pop-ups when drive is (re)connected?

Go to Settings → Devices → Removable Media → check Never prompt or start programs on media insertion.


Update
With the release of OBS Studio 26.1 on 14th December 2020, virtual camera support has been added for Linux without the need of any external plugins.
You can install OBS Studio normally with your preferred method, both snap, and apt are fine.
Then you should install v4l2loopback, a kernel module for Linux. You can follow the instructions starting from #build to #install.
git clone https://github.com/umlaeute/v4l2loopback.git
cd v4l2loopback
make
sudo make install
sudo depmod -a

Once v4l2loopback is installed, you can launch OBS Studio (or restart if you already had it open) and it will detect the new kernel module automatically and be capable of outputting a virtual camera.
Previously
You can do so with OBS Studio (GitHub) on Linux by using the OBS Virtualcam plugin.

Does this plugin support other platforms?
For Linux, you can use the Video4Linux sink plugin for OBS Studio. Directions on how to configure it are available from that link.way to provide a similar plugin for macOS, but there is no ETA.

Linux version here:
https://github.com/CatxFish/obs-v4l2sink
On Windows I believe hosting a virtual camera is a native feature of OBS Studio, unfortunately for Linux, it requires installing a plugin.


I assume you're seeing this host% in documentation.  It stands for the shell prompt.  ("Shell" is the program that reads the commands you type; "prompt" is the little bit of text that this program displays on your screen to say that it's ready to read your next command.)

If you look at a terminal window on your computer you'll probably see something like

my-computer-name%

on the last line, where "my-computer-name" is of course your computer's name.  This is prompting you (i.e., inviting you) to type a command.  So now you go and type ls and carriage return, and the shell prints some output.

Linux documentation typically uses host% to indicate the prompt ("host" is another name for "computer").

This host%  It's not meant to be typed: it just indicates that what follows in the document is to be typed.


how to fix mysql installation if I accidentally delete some file of mysql package

It turns out to another stupid mistake, the first one it to manually delete mysql configuration files. the second one is I didn't delete them all, there are 2 remaining soft link in

  /etc/systemd/system

which point to mysql service which is deleted by me. I guess apt try to make sure mysql service is inactive, when apt find mysql service file in

  /etc/systemd/system

apt will run it. But because they are pointed to invalid files so the operation will fail. after I delete them , apt work again.
I think systemctl disable may also work, but I didn't try it.


How to remove a faulty server connection from Nautilus?

The Nextcloud connection is saved in Online Accounts from Ubuntu.

If you remove the account from Settings -> Online Accounts, the faulty mount should go away.

You might need to restart.


You don't. You either burn the CUE/FLAC combination in a burner that can decode the FLAC data or you play it in something that understands what CUEs are (lots of players AFAIK).

A CUE/FLAC is very much like an audio CD. An audio CD is just linear PCM data with a CDA-formatted header that states where all the track boundaries are. In your case the audio data has been losslessly compressed into the FLAC and the CUE is the track information.

Converting to WAV only serves to undo the compression. You might need to do this to burn it to disk.

Splitting into separate tracks

If you want to split the main FLAC into separate tracks, you can use the tools from the shntool package as suggested in this blog:

cuebreakpoints filename.cue | shntool split -o flac filename.flac

You can also specify another output format instead of FLAC (option -o flac in the example).

(You'll need to install the commands first: sudo apt-get install cuetools shntool)

Tagging FLAC CD images for use with players like foobar

FLAC also allows for embedding cuesheets via metaflac and compatible taggers. Players like foobar2000 and it's Linux equivalents (DeaDBeeF and Guayadeque) can parse and play files with such metadata. Importing a properly tagged cuesheet (along with other metadata like pictures), will also import tags like individual tracknames, tracknumbers, artist and album tags.

Excerpt from metaflac manpage:

--import-cuesheet-from=file
    Import  a cuesheet from a file.  Use '-' for stdin.  Only one
    FLAC file may be specified.  A seekpoint will  be  added  for
    each  index  point  in  the  cuesheet to the SEEKTABLE unless
    --no-cued-seekpoints is specified.

But this kind of file format is rather unknown and unsupported outside the "distributed CD backup community". Mostly due to the fact that you cannot rip CDs to images on Linux like EAC does on Windows. (With EAC doing something very odd in this case, as I later learned.)


Ubuntu 14.04 isn't show remote mount path

Try:

df -ah

-a for all, Ref: man df

or

mount -l

Ref: man mount


You can always download static builds and use them. This will solve your problem. However, I would recommend you to fix this dependency issue so you can use the latest ffmpeg version after apt-get update.


Run the following commands

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get upgrade

Then, install a driver like this

sudo apt-get install nvidia-370

Then reboot


Multiple ssh access types from a given user1/client to the same user2/server

I made it work, with two different key pairs (say, pair 1 for bzr and pair 2 for ssh login).
I added the corresponding lines in ~user2/.ssh/authorized_keys.
The private key 1 was stored in file id_rsa (which is read by default),
and the private key 2 was stored in file id_rsa_ssh.

Then, bzr was working normally, and for logging in I use

[user1@cl]$ ssh -i id_rsa_ssh user2@srv

which indicates using an alternative identity.


Can you change multiple dissimilar file names?

A small python script will do the renaming recursively:

#!/usr/bin/env python3
import os
import shutil
import sys

directory = sys.argv[1]

for root, dirs, files in os.walk(directory):
    for f in files:
        new_f = root+"/"+f.replace(" ", "_").lower()
        f = root+"/"+f
        if f != new_f:
            shutil.move(f, new_f)

where:

lower() will lower all possible capitals .
replace(" ", "_") will replace spaces by underscores.
if f != new_f will only rename the files if it is actually needed.
shutil.move(f, new_f) will actually rename the file.

How to use

Copy the script into an empty file
Save it as rename.py
Run it with the targeted directory as argument:

python3 /path/to/rename.py <directory>

Notes

Use quotes if the targeted directory includes spaces.
Mind that you will run into name clashes if the renamed file name already exists.

In case of possible name clashes

(If you already started renaming manually for example) Use the version below.

#!/usr/bin/env python3
import os
import shutil
import sys

directory = sys.argv[1]

for root, dirs, files in os.walk(directory):
    for f in files:
        renamed = f.replace(" ", "_").lower() ;new_f = root+"/"+renamed
        old_f = root+"/"+f
        if old_f != new_f:
            n = 1
            while os.path.exists(new_f):
                new_f = root+"/dupe_"+str(n)+"_"+renamed
                n = n+1
            shutil.move(old_f, new_f)

It will renane:

into:

EDIT

The script above will rename files. From a comment, I understand you'd like to rename the folders likewise. With just a few lines, that can be done:

#!/usr/bin/env python3
import os
import shutil
import sys

directory = sys.argv[1]

def name_edit(item, root):
    renamed = item.replace(" ", "_").lower() ;new_item = root+"/"+renamed
    old_item = root+"/"+item
    if old_item != new_item:
        n = 1
        while os.path.exists(new_item):
            new_item = root+"/dupe_"+str(n)+"_"+renamed
            n = n+1
        shutil.move(old_item, new_item)

for root, dirs, files in os.walk(directory):
    for item in files:
        name_edit(item, root)
    for item in dirs:
        name_edit(item, root)

Explanation

In the second script, the way files were renamed is converted to a function, to prevent writing the same code twice (running it on both files/folders). Subsequently, the script first renames the files, then the folders recursively:

#!/usr/bin/env python3
import os
import shutil
import sys

directory = sys.argv[1]

def name_edit(item, root):
    # in one command, both replace spaces and lower {possible} capitals
    renamed = item.replace(" ", "_").lower()
    # combine directory and (new) file- or folder name
    new_item = root+"/"+renamed
    # combine directory and (old) file- or folder name
    old_item = root+"/"+item
    # if the name was changed, check for possible existing dupes
    # and rename until the name is unique
    if old_item != new_item:
        n = 1
        while os.path.exists(new_item):
            new_item = root+"/dupe_"+str(n)+"_"+renamed
            n = n+1
        # if the file or folder name was changed, apply the change
        shutil.move(old_item, new_item)

for root, dirs, files in os.walk(directory):
    # use os.walk() to find files and folders recursively
    for item in files:
        name_edit(item, root)
    for item in dirs:
        name_edit(item, root)


Installed Spotify Linux preview, but how do I run it?

Go to the Terminal and type in spotify.

Hope this helps.


There are multiple things that you need to add information about.

What language did you download the subtitle in?
What video player are you using to play the movie?

Usually the operating system has little to do with what type of font your player outputs. So if your subtitle is in Arabic then your player needs to support that font.

I suggest you re-ask this question on superuser.com and please specify the extra information.

Cheers,
Gergely.


Is installing with Wubi on my computer safe?

Considering that you are running Windows 10 and the last version of Wubi said that it does not support anything higher than 7, I would say that it could be dangerous to install Ubuntu this way.
But hey, as long as you back everything up on your Windows partition and are willing to reinstall it all from scratch, I'd say give it a try!

Sometimes the best way to learn is to learn by experimentation.


Script or function to return how many days from now until a given date

Epoch time

In general, calculations on time are easiest if we first convert time into (Unix) epoch time (seconds from 1-1-1970). In python, we have tools to convert time into epoch time, and back into any date format we prefer.

We can simply set a format, like:

pattern = "%Y-%m-%d"

...and define today:

today = "2016-12-07"

and subsequently write a function to do the job:

def convert_toepoch(pattern, stamp):
    return int(time.mktime(time.strptime(stamp, pattern)))

Then the output of:

nowepoch = convert_toepoch(pattern, today)
print(nowepoch)

> 1481065200

...which is, as mentioned, the number of seconds since 1-1-1970

Calculating the days between two dates

If we do this on both today and our future date, subsequently calculate the difference:

#!/usr/bin/env python3
import time

# set our date pattern
pattern = "%Y-%m-%d"

def convert_toepoch(pattern, stamp):
    return int(time.mktime(time.strptime(stamp, pattern)))

# automatically get today's date
today = time.strftime(pattern); future = "2016-12-28"

nowepoch = convert_toepoch(pattern, today)
future_epoch = convert_toepoch(pattern, future)

print(int((future_epoch - nowepoch)/86400))

The output will be calculated by date, since we use the format %Y-%m-%d. Rounding on seconds would possibly give an incorrect date difference, if we are near 24 hrs for example.

Terminal version

#!/usr/bin/env python3
import time

# set our date pattern
pattern = "%Y-%m-%d"

def convert_toepoch(pattern, stamp):
    return int(time.mktime(time.strptime(stamp, pattern)))

# automatically get today's date
today = time.strftime(pattern)
# set future date
future = input("Please enter the future date (yyyy-mm-dd): ")
nowepoch = convert_toepoch(pattern, today)
future_epoch = convert_toepoch(pattern, future)
print(int((future_epoch - nowepoch)/86400))

...And the Zenity option

#!/usr/bin/env python3
import time
import subprocess

# set our date pattern
pattern = "%Y-%m-%d"

def convert_toepoch(pattern, stamp):
    return int(time.mktime(time.strptime(stamp, pattern)))

# automatically get today's date
today = time.strftime(pattern)
# set future date
try:
    future = subprocess.check_output(
        ["zenity", "--entry", "--text=Enter a date (yyyy-mm-dd)"]
        ).decode("utf-8").strip()
except subprocess.CalledProcessError:
    pass
else:
    nowepoch = convert_toepoch(pattern, today)
    future_epoch = convert_toepoch(pattern, future)
    subprocess.call(
        ["zenity", "--info",
         "--text="+str(int((future_epoch - nowepoch)/86400))
         ])

And just for fun...

A tiny application. Add it to a shortcut if you use it often.

The script:

#!/usr/bin/env python3
import time
import subprocess
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Pango, Gdk

class OrangDays(Gtk.Window):

    def __init__(self):

        self.pattern = "%Y-%m-%d"
        self.currdate = time.strftime(self.pattern)
        big_font = "Ubuntu bold 45"
        self.firstchar = True

        Gtk.Window.__init__(self, title="OrangeDays")
        maingrid = Gtk.Grid()
        maingrid.set_border_width(10)
        self.add(maingrid)

        datelabel = Gtk.Label("Enter date")
        maingrid.attach(datelabel, 0, 0, 1, 1)

        self.datentry = Gtk.Entry()
        self.datentry.set_max_width_chars(12)
        self.datentry.set_width_chars(12)
        self.datentry.set_placeholder_text("yyyy-mm-dd")
        maingrid.attach(self.datentry, 2, 0, 1, 1)

        sep1 = Gtk.Grid()
        sep1.set_border_width(10)
        maingrid.attach(sep1, 0, 1, 3, 1)

        buttongrid = Gtk.Grid()
        buttongrid.set_column_homogeneous(True)
        maingrid.attach(buttongrid, 0, 2, 3, 1)

        fakebutton = Gtk.Grid()
        buttongrid.attach(fakebutton, 0, 0, 1, 1)

        calcbutton = Gtk.Button("Calculate")
        calcbutton.connect("clicked", self.showtime)
        calcbutton.set_size_request(80,10)
        buttongrid.attach(calcbutton, 1, 0, 1, 1)

        fakebutton2 = Gtk.Grid()
        buttongrid.attach(fakebutton2, 2, 0, 1, 1)

        sep2 = Gtk.Grid()
        sep2.set_border_width(5)
        buttongrid.attach(sep2, 0, 1, 1, 1)

        self.span = Gtk.Label("0")
        self.span.modify_font(Pango.FontDescription(big_font))
        self.span.set_alignment(xalign=0.5, yalign=0.5)
        self.span.modify_fg(Gtk.StateFlags.NORMAL, Gdk.color_parse("#FF7F2A"))
        maingrid.attach(self.span, 0, 4, 100, 1)

        sep3 = Gtk.Grid()
        sep3.set_border_width(5)
        maingrid.attach(sep3, 0, 5, 1, 1)

        buttonbox = Gtk.Box()
        maingrid.attach(buttonbox, 0, 6, 3, 1)
        quitbutton = Gtk.Button("Quit")
        quitbutton.connect("clicked", Gtk.main_quit)
        quitbutton.set_size_request(80,10)
        buttonbox.pack_end(quitbutton, False, False, 0)

    def convert_toepoch(self, pattern, stamp):
        return int(time.mktime(time.strptime(stamp, self.pattern)))

    def showtime(self, button):
        otherday = self.datentry.get_text()
        try:
            nextepoch = self.convert_toepoch(self.pattern, otherday)
        except ValueError:
            self.span.set_text("?")
        else:
            todayepoch = self.convert_toepoch(self.pattern, self.currdate)
            days = str(int(round((nextepoch-todayepoch)/86400)))
            self.span.set_text(days)

def run_gui():
    window = OrangDays()
    window.connect("delete-event", Gtk.main_quit)
    window.set_resizable(True)
    window.show_all()
    Gtk.main()

run_gui()

Copy it into an empty file, save it as orangedays.py
Run it:

python3 /path/to/orangedays.py

To wrap it up

Use for the tiny application script above the following .desktop file:

[Desktop Entry]
Exec=/path/to/orangedays.py
Type=Application
Name=Orange Days
Icon=org.gnome.Calendar

Copy the code into an empty file, save it as orangedays.desktop in ~/.local/share/applications
In the line

Exec=/path/to/orangedays.py

set the actual path to the script...


Open the terminal and type:

sudo apt install hplip libqt5printsupport5
hp-setup --gui

If you have problems run the second command in interactive mode instead of GUI mode.

hp-setup --interactive


2 Ubuntu in booting options and windows8 how to remove one?

For a recent version of Ubuntu, you need to edit the grub2 menu files.  See the link to "Grub2 Revisited" in the response to question:

How can I edit my Grub bootloader entries (Hide, Rename, Remove)? Preferably doing it manually, and not with a program

The blog posting has a detailed set of instructions.


Found the issue:

Dovecot IMAP had not been configured to use the mbox mail format, which could simply be corrected by adding the following line to my /etc/dovecot/dovecot.conf:

mail_location = mbox:~/mail:INBOX=/var/mail/%u

In which the mail_location had not been specified previously.


Why does the separation of update and upgrade even exist?

An upgrade is not the only time you might need to apt-get update, and I do not want to upgrade each time I simply want to update the package lists.

An apt-get upgrade working well may depend on apt-get update being run not long ago, but then that is true of apt-get remove and apt-get install as well! Should all of these imply apt-get update? Of course not! As a simple matter of resource efficiency and design cleanness, if an operation is common to multiple other operations, it should be factored out.

Conversely, given that apt-get remove and apt-get install may also depend on apt-get update being recently run to successfully finish, does it make sense to apt-get upgrade for each run of apt-get update? No, again, since what I intend to do may well conflict with what apt-get upgrade will do.


Good news, I  haven't tested everything yet but i've managed to get this working in PlayOnlinux and start a game in 17.10.1:

Open PLayOnLinux and select 'Install a Program'.

Search for Steam and install it.

Make sure you untick 'Run Steam' before clicking finish.

Go back to PlayOnLinux click on the Steam icon and run it. Wait for it to finish updating.

You might get a message saying 'Steam crashed', click next and ignore it.

Log into Steam once has finished updating.

Steam will minimize once you are logged in. The 'Wine System Tray' will be open in a different window, find it and double click the Steam icon to open it.

Find Age of Empires on Steam and install it.

Once it has installed run it from Steam, it will install some stuff and then immediately crash.

Go back to PlayOnLinux select 'Tools' on the toolbar at the top and Select 'Manage Wine Versions'. Wait a few seconds for the list to populate. On the x86 tab select '3.3' and click the arrow to move it to the right side.

Back on PlayonLinux, select Steam and select Configure.

Click onto the arrow next to 'Wine version' and select 3.3.

Still on the configure menu go to the tab 'Install components' and install 'd3dx9' and 'vcrun6'.

Go back to the 'General' tab and select 'Make a new shortcut from this virtual drive'. Find 'AoK HD.exe' and select Next.

When it goes back to the shortcuts list, select 'I don't want to make another shortcut' and click next.

16.Download a copy of vcrun 2015 x86 from here. In the Miscellaneous tab of the configure menu select 'Run a Windows Executable (.exe) file in this virtual drive'.

Run your downloaded copy of VC redist 2015 and go through the setup.

Run the AoK HD.exe shortcut we added earlier.

This error might appear, ignore it and click OK.

The launcher for Age of Empires will open, but there will be no text on the buttons, click the first button anyway and the game will launch :D


Ubuntu Server running in Virtual Box - Network not connecting to Wifi bridged adapter

OK got it working using this mega helpful post:
http://christophermaier.name/blog/2010/09/01/host-only-networking-with-virtualbox
Note that only address 192.168.56.102 worked (not ending in .101 - must have caused a conflict with something else)


Solved the issue. I compiled it from these patched sources. As ath9k drivers come by default on 2.6.38 kernel, the directory /lib/modules/2.6.38-8-generic/kernel/net/wireless/ath should be removed. For compiling and installing this guide is usefull.


Debian's Depend: tag doesn't work with apt-get

Apt does not consider multiple versions of the same package. It chooses one (based on a combination of version numbers, pinning etc) and then it will either install that version or not install the package at all.

Aptitude will consider lower versions of the package but later upgrades will attempt to upgrade those lower versions which may result in your software getting inadvertantly removes.

So to the best of my knowlage there is no real way to do what you want. You either make the version number of your package higher than the one in the distro (possiblly by using an epoch), use a different package name or tell your users to set up pinning.


As you can see on netstat postgresql listen on 127.0.0.1 only. You must use 127.0.0.1 address in pgadmin configuration, or allow bind postgresql to "my ip".


Is there anyway to reproduce its behavior in a handy way?

Well, the handiest way is good old copy-and-paste! (see screenshot below)  Usually an HTTP/HTTPS proxy will not also do FTP/SOCKS, while a SOCKS proxy will handle everything. But if the "Apply to all protocols" setting worked for you before, no reason why it shouldn't now.


Connection blocking with iptables usually relies on fail2ban's ability to monitor log files and track failed authentication attempts. Fail2ban then supplies temporary rules to iptables for blocking connections to IP addresses associated with failed authentication attempts. The number of times and failed connection attempts are configurable, but my point is basically that while you could have iptables start logging to a file, it makes more sense to either check the log files fail2ban monitors directly, or ask iptables to display a list of current rules (since this will include temporarily blocked IP addresses and which rule they were associated with).

TL;DR try sudo iptables -S to list the current status. If any IP addresses are currently being blocked, you'll see them there instantly.

This DigitalOcean 'iptables basics' article is a helpful place to start learning more about essential commands.


Cannot increase disk space on VM using GParted

You have to remove sda2 partition before. It is impossible to resize a partition if there is no unallocated space just next to it. After resizing you can recreate the removed sda2.


In terminal type java -jar /path/to/your/minecraft.jar, or you can run this Minecraft launcher. I have used it myself and will vouch for its effectiveness. It even will give you a nice menu icon.


Install x11-utils

sudo apt install x11-utils

Identify keycode

xev | grep keycode

Press w key. You'll see the keycode. Assign empty value to the observed keycode.

xmodmap -e 'keycode here-your-keycode='

If you want to undo the action, run

xmodmap -e 'keycode here-your-keycode=w'

It's always good to save the current setting. To do so, run

xmodmap -pke > /path/to/file


My netbook volume + and volume - buttons stopped working after 12.04 update

Ok it sounds STRANGE but it worked :/

I booted into windows (from hybernating state) and keys and keys were also dead there.

I've rebooted windows normally and keys were back working.

I've rebooted Ubuntu and keys were also working there.

:/


Can I unhide the panel in Xfce using a key press rather than using mouse cursor hover to reveal it?

Take the following commands and bind them to separate Super-key combinations:

Commands for Xfce 4.12 through Xfce 4.14:

The following commands are now used to set the auto-hide properties:

xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -s 0
xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -s 1
xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior -s 2

Commands for Xfce 4.10:

xfconf-query -c xfce4-panel -p /panels/panel-0/autohide -s false
xfconf-query -c xfce4-panel -p /panels/panel-0/autohide -s true

Update: 12/09/2018: As mentioned in the comments, the above commands are no longer supported.

Command Values:

The value '0' is used for 'never' auto-hide. Value '1' is for 'intelligently' auto-hiding the panel, and '2' is used to set the value to 'always' auto-hide.

Setting the key-bindings:

This can be done by either selecting, Applications Menu → Settings → Keyboard → Application Shortcuts, or by running xfce4-keyboard-settings from the command line(Ctrl+Alt+t).

I've bound the first command to Super+u (to 'unhide' the panel). For the second command, I am binding Super+h (to 'hide' the panel).

As you can see in the commands above, the behavior is only changed on a single panel(In this case, panel-0 is being modified).

You may notice a slight delay while the panel changes state.

More details on the xfconf-query command can be found in the Xfce documentation or from this thread in the Xfce forum.


What makes LiveCDs, LiveDVDs, and LiveUSBs slow?

All this iso images contains a squashfs image of the file system. Bevor the start it will be copied into the RAM. In most cases this is the slowest part of booting a LiveCD.

SquashFS Image file for Ubuntu 14.04.1 64 Bit:
984MB

CD/DVD:
21,12 MB/s - Reading speed

USB 2.0:
32MB/s - Reading speed

It takes 04 minutes and 17 seconds to copy the squashfs file into the ram from a usb device. And it takes 06 minutes and 33 seconds to copy it from a cd/dvd.

Extracting of the squashfs File you can easy test by calling the following commands:

wget http://mirror.23media.de/ubuntu-releases/14.04.1/ubuntu-14.04.1-desktop-amd64.iso
unzip ubuntu-14.04.1-desktop-amd64.iso
unsquashfs casper/filesystem.squashfs


Wi-Fi access point not supplying IP addresses to clients

Via NetworkManager: Share Wireless connection with Wired Ethernet Port

However I can tell you how to do it if you want to configure everything manually. From your question it seems you have already started on this path.

1. How do I correctly configure a basic DHCP server and run it correctly

First of all pick and set a static IP address on the WiFi interface. Let's say it's wlan0 with address 192.168.44.1 with netmask 255.255.255.0 (i.e. /24). You need to either set it in NetworkManager for wlan0, or in /etc/network/interfaces:

auto wlan0
iface wlan0 inet static
    address 192.168.44.1
    netmask 255.255.255.0
    # Use a smaller MTU if you use VPN or PPPoE on your WAN
    # mtu 1400

If you set it in /etc/network/interfaces, you can bring the interface up with:

sudo ifup wlan0

Or bring it down:

sudo ifdown wlan0

Then install a DHCP server:

sudo apt-get install isc-dhcp-server

Edit /etc/dhcp/dhcpd.conf:

default-lease-time 600;
max-lease-time 7200;

option subnet-mask 255.255.255.0;
option broadcast-address 192.168.44.255;

# This is the IP address of our LAN interface
option routers 192.168.44.1;

# Set the DNS server you offer to the hosts here, or you can leave Google's:
option domain-name-servers 8.8.8.8;

# If you want to use a domain name, put it here:
#option domain-name "example.com";

# This is the pool of addresses which will be offered to the clients:
subnet 192.168.44.0 netmask 255.255.255.0 {
    range 192.168.44.100 192.168.44.200;
    # Use a smaller MTU if you use VPN or PPPoE on the router
    # option interface-mtu 1400;
}

Start it:

service isc-dhcp-server restart

2. Enable routing

You have 2 options:

echo 1 > /proc/sys/net/ipv4/ip_forward

or edit /etc/sysctl.conf and set net.ipv4.ip_forward=1 then run sysctl -p

3. Firewall settings

This is what you need to do:

block stuff coming from WAN that you don't want (optional but recommended)
allow traffic from the router to the WAN (nothing special)
allow replies from the WAN to traffic your router has sent (nothing special)
allow DHCP and ping traffic from the LAN interface (wlan0 in your case) so that hosts can connect to the router
allow traffic coming from the LAN and going through the WAN to be routed
through you
allow traffic coming from the WAN and going through the WAN and is a reply to traffic you routed to be routed through you
do NAT on the machine so that hosts from the LAN can access the Internet sharing your IP address

Allowing DHCP and ping traffic through the firewall is required only if you have changed the defaults in Ubuntu, otherwise it will just work. Otherwise basically the fix is:

sudo iptables -I INPUT -i wlan0 -p udp --dport 67:68 --sport 67:68 -j ACCEPT
sudo iptables -I INPUT -i wlan0 -p icmp --icmp-type 8 -j ACCEPT

(UDP ports 67 and 68 are for DHCP, the second command is ICMP type 8 a.k.a ping)

I don't know how much you now about the firewall so here is a brief intro.

You can inspect the firewall rules with:

sudo iptables -L -n -v --line-numbers

Packets will end up in 3 possible situations, which are called "chains":

INPUT is what comes from outside your machine to your machine (except the routed packets)
OUTPUT is what goes out from your machine (except the routed packets)
FORWARD is what comes/goes from/to your machine due to routing

Each chain can be in 2 modes:

policy ACCEPT means that unless there is a rule matching the packet and calling DROP, the packet will go through the chain
policy DROP means that unless there is a rule matching the packet and calling ACCEPT, the packet will be dropped by the chain

Normally you want:

OUTPUT to be in ACCEPT mode;
FORWARD to be in DROP mode and you add rules to allow traffic to go out from your LAN to the WAN, and also allow reply traffic to get through from WAN to LAN;
INPUT to be in DROP mode except for allowing DHCP and ping from LAN, allowing replies to traffic sent from the router to WAN and optionally opening ports for server applications (if you want to run a web server for instance).

Additionally you need to add a rule that does NAT. That is very simple, e.g. if eth0 is your WAN interface:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

You can list NAT rules with:

iptables -t nat -L -n -v --line-numbers

What exactly needs to be done to get there depends on how your system is already configured. Normally I create a script that wipes out all the existent rules and fills everything from scratch.

The full thing, heavily commented:

# Set the correct names of the interfaces here:
wan=eth0
lan=wlan0

# Wipe out the current firewall config:
iptables -t filter -F
iptables -t filter -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -t raw -F
iptables -t raw -X

# Set default policies for the chains in the filter table:
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

# INPUT (basic client)
# Allow loopback traffic (from us to us)
iptables -A INPUT -i lo -j ACCEPT
# Allow replies to traffic we have sent
iptables -A INPUT -m conntrack --ctstate related,established -j ACCEPT

# INPUT (router)
# Allow DHCP from LAN
iptables -I INPUT -i $lan -p udp --dport 67:68 --sport 67:68 -j ACCEPT
# Allow ping from LAN
iptables -I INPUT -i $lan -p icmp --icmp-type 8 -j ACCEPT

# FORWARD (router)
# Accept any traffic coming from LAN to route it
iptables -A FORWARD -i $lan -j ACCEPT
# Accept replies from WAN to traffic we routed from LAN
iptables -A FORWARD -i $wan -m state --state ESTABLISHED,RELATED -j ACCEPT

# NAT from LAN to WAN
iptables -t nat -A POSTROUTING -o $wan -j MASQUERADE

4. More about hostapd

You need to secure your network properly. It is important that WPA is set to 2 (WPA2) and that the pairwise algorithms use only CCMP (AES) and not TKIP (insecure). Also, use a complicated passphrase. Here is an example config /etc/hostapd/hostapd.conf:

interface=wlan0
driver=nl80211
country_code=US
ssid=Home
hw_mode=g
channel=7
wpa=2
wpa_passphrase=complicated
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0

What you will probably use differently is driver, ssid, maybe hw_mode, channel and of course wpa_passphrase. wpa_pairwise is actually not needed. Might be worth looking at https://wiki.gentoo.org/wiki/Hostapd (yeah a different distro but they usually have good examples).

5. Some extras

You might want to look into lowering your latency and QoS. Usually something like this helps, in the worst case it does not hurt and does not need tweaking:

ifconfig wlan0 txqueuelen 50
tc qdisc add dev wlan0 root sfq perturb 10
tc qdisc add dev eth0 root sfq perturb 10

6. IPv6

No clue :)


Where did QEMU come from in my Startup Disk Creator?

I tried installing MultiBootUSB 9.2.0 and found that QEMU no longer comes with the tool, you need to download it yourself.

I tried installing several versions of QEMU, qemu-system, qemu-kvm,

What finally worked was:

sudo apt-get install qemu-kvm qemu virt-manager virt-viewer libvirt-bin

My Startup Disk Creator now shows the "Test Disk" button.

For now I guess I will just have to run QEMU manually when working with mkusb, unless @sudodus comes up with something.


Your /etc/default/keyboard file looks different from default one. You miss the XKBMODEL field. See default file for reference:

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

You have to regenerate it by running
sudo dpkg-reconfigure keyboard-configuration

and then reboot.


This phone needs restoring from a PC or service center

You must be on kitkat (4.4.4) or earlier to flash Ubuntu Touch.  If you are on Lollipop (5.0 or 5.0.2) you will get this failure.  Fastboot flash the kitkat factory image first, then you will be able to successfully flash Ubuntu touch.


Ubuntu 18.04 freezes immediately after login. But it was successfully installed

The original answer is on superuser forum. The next command resolved my issue.

systemctl reboot --firmware-setup


nvidia-settings error after upgrade to 17.10

OK, so the answer (from Takkat's comment) is that the proprietary Nvidia drivers aren't supported on Wayland, which Ubuntu 17.10 now uses by default.  Choosing "Ubuntu on Xorg" from the login screen made everything work again for me - see this answer.


How many lenses can the Dash menu handle

In Ubuntu 11.10 and 12.04, there is no limit to the number of lenses that can be installed.  However, once the amount lens icons exceed the available width, it is not possible to see or select them with the mouse.  They can, however, be navigated to using the keyboard (TAB in 11.10, SHIFT + TAB in 12.04).  There is no horizontal scroll available in the lens bar.


Tried to download League of Legends with a guide but ended up destroying my computer

I don't have a clue why Unity would have been removed or corrupted. I can't really say that I know much about LOL, but something clearly happened to Unity along the way. The following steps should get Unity back up and running on your computer.

Press Ctrl+Alt+F2 to open a different virtual terminal console
Once in this console run

sudo apt-get update
sudo apt-get install --reinstall ubuntu-desktop
sudo apt-get install --reinstall unity
sudo reboot

The commands should reinstall Unity, fixing whatever is broken in you desktop environment. After reboot, you should be back in business.


Restore Windows loader after deleting partition

Your configuration is peculiar. It looks like you installed Windows 8.1 yourself in BIOS/CSM/legacy mode, then installed Ubuntu in EFI/UEFI mode. That's not a happy combination; it's almost always best to boot both OSes in the same mode (BIOS or EFI), not to mix modes. Broadly speaking, there are three ways to proceed:

Install a BIOS-mode Ubuntu boot loader -- This is likely to be the easiest way to fix your problem. The Boot Repair tool can probably do this, or you can install grub-pc and then do a sudo grub-install /dev/sda.
Convert to GPT and install an EFI-mode Windows boot loader -- See this blog post for the general procedure to do this. Note that when you're done with the Windows BIOS/MBR-to-EFI/GPT conversion, you may need to re-register GRUB with the firmware. Again, Boot Repair may be able to do the trick. If you go this route, I recommend you disable your CSM so as to avoid the extra complication in your boot path that's created by having it active. (This complication created your problem to begin with.)
Keep your mixed modes -- Many EFIs enable you to switch between BIOS-mode and EFI-mode booting by using their built-in boot managers (typically accessed by hitting Esc, Enter, or a function key early in the boot process, but details vary from one system to another). Alternatively, you could install my rEFInd boot manager in Ubuntu and edit its refind.conf file: Uncomment the scanfor line and ensure that hdbios is among the options. Then, when rEFInd comes up, you should be able to boot either Ubuntu or Windows. Either way you do it, this approach assumes that you've got a working Windows BIOS-mode boot loader. That may already be the case, but I can't be sure of that.

Getting any of these options to work is likely to require at least some trial-and-error experimentation because of system-to-system differences in how EFIs boot and because there may be unexpected quirks that might complicate your particular setup. Lots of things can go wrong when you reconfigure your boot loaders, so you may well end up posting back again with a follow-up question.

No matter which route you take, I recommend you download and prepare the USB flash drive or CD-R version of rEFInd. (You can get images for both from the rEFInd downloads page.) You should be able to use rEFInd to boot into Ubuntu no matter what the partition table looks like, so having rEFInd on an external medium can serve as an emergency boot tool if something goes wrong as you make your changes.

For more on why you've got a problem, see my page on the CSM. Note, however, that my page is written with a configuration in which Windows is in EFI mode and Ubuntu gets installed in BIOS mode in mind, since that's the more common error to make. Yours is the reverse of that. The basic principles are the same, though.


You can walk through Launchpad's instructions on generating and importing your key again to do so with a fresh key.  Your key is stored in the .gnupg subdirectory of your home directory.


I just checked and KeepassXC does not seem to have a field for that. You would have to navigate the filesystem and select the database file to open.
That is certainly strange, as I supposed it should not depend on the application but on the desktop manager...
but that's how it is.


@Thomas W.'s answer didn't work for me on Ubuntu 14.04. I had to use:

sudo dpkg -r opera-stable

And to remove the apt sources file added by Opera:

sudo rm -f /etc/apt/sources.list.d/opera-stable.list


Unable to install Ubuntu on a laptop with broken screen with second screen connected as alternative

I have a laptop with the build-in screen broken and I managed to change the display settings with the keyboard shortcut Super+P and continue with the installation of Ubuntu 20.4 through the external monitor(VGA)
I had to do this as the first thing and blindly when the installer stopped and required the user input for the next steps.
Below a picture, I hope it helps
Regards,


nautilus-like scripts with ubuntu budgie?

You have to install the FileManager Actions packages for Nemo by
sudo apt-get install nemo-extension-fma filemanager-actions

And then configure actions as shown in linked answer.


After new Ubuntu server installations sometimes Nano is highlighting text and sometimes it doesn't

Nano 2.5.3 cannot "guess" what is the language I code in. If I just execute nano and then paste in a script content, it will all be white (or the default general text color for the editor).

If I paste this command:

nano ~/ses.sh && chmod +x ~/ses.sh && bash ~/ses.sh && rm ~/ses.sh

Then the syntax will be highlighted accordingly to the file extension (in this case .sh).

Until a few minutes I didn't know that actually doing nano filename.extension (like nano ses.sh) is what making nano to use the specific styling. I didn't know it's associated but now I've learned that.

Note: If you used a similar script creation process and still didn't have the color it might be due to a bug or partial stuckage of your TTY (that is, in simple words, terminal window) and starting a new session should fix that.


You can do this by adding

export JAVA_HOME="/usr/lib/jvm/java-8-oracle"

to your .bashrc file.
You can do this by using the following steps:

press ctrl+alt+T to open a terminal
type gedit ~/.bashrc
add export JAVA_HOME="/usr/lib/jvm/java-8-oracle" ad the end of the file.
save the changes
type source ~/.bashrc to apply the changes to your current session.

The error message you got means that you don't have permissions to change the /etc/environment file. This should be possible, using sudo.


Upgrade from 11.10 to 12.04 failed; installing the upgrades; preparing libco

Try updating from the command line.

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


For the first problem you should simply open dconf-editor (maybe you should install it first), then go to org>gnome>shell and void the disabled-open-search-providers' string.

Otherwise, you can simply do in a terminal

gsettings set org.gnome.shell disabled-open-search-providers "[]"

For the second problem, there's already an answer (follow the links at the end of the answer to that question): Is it possible to customise the search engine buttons in GNOME Shell?


You may need to install the actual proprietary drivers for your Radeon card to get HDMI audio working properly. Also pavucontrol allows you to tweak the audio settings much better than the default volume control.

In a Terminal window type these commands:

cd /tmp && wget -O amd-driver-12-6-x86_64.run http://www2.ati.com/drivers/linux/amd-driver-installer-12-6-x86.x86_64.run
chmod +x amd-driver-12-6-x86_64.run
sudo sh amd-driver-12-6-x86_64.run

sudo aticonfig --initial -f

The last command will let you know if installation worked OK.


You can disable it, although this disables the security features that it offers or you can start the gnome keyring daemon when logging in.


After installing Ubuntu 12.10 desktop nothing displays after logging in

I also faced the very same problem on my old laptop. Unity 2D (12.04) worked well and Unity (since 12.10) is not working now. AFAIK, Unity is based on 3D graphic operations only and it MAY cause these problems.
Therefore, it seems to be related to my old graphics card. I didn't investigated further whether it could be solved by installing some newer drivers (Radeon R200 based) because I installed Gnome Classic (no effects) which works well.

sudo apt-get install gnome-session-fallback

Please take this as a hint. Maybe the problem is elsewhere.
You can also try installing 12.04 first to see if it works better.


Extract mbox file emails to file system with attachments

If you are confortable with python , sou can use , https://docs.python.org/3/library/mailbox.html .


how do i stop root from running a program

I believe as this is a case of stopping a bone headed user shoot them selves in the foot that there is no easy way to do this. with great power comes great responability, and it would probably be best if learnt not to use sudo -s quite so often.

that being said, i am going to wrap a bash script around thunderbird, that checks the user name using whoami or $SUDO_USER and then aborts if it is an administrator. its not a general solution, but it will help in this isolated case.


I am assuming that your network connection is what is not working and that your installation of Ubuntu is working. Your question is a little vague in this area.

If your network isn't working, check this out. It should help you to diagnose you problem.


This might have been ignored, but in case anyone comes across it and needs it:

sudo a2enmod php7.0

restart, it might have an error on restart, in which case

sudo a2dismod mpm_event

sudo a2enmod mpm_prefork

Then restart, fixed it for me


cups now says "job completed" but nothing is sent to printer; was working fine

This same sympton I have experienced with another Brother model DCP-T310.
First I tried installing the printer by installing the Brother's drivers from a .deb file (using Ubuntu 20.04). So CUPS would see the printer, if I would power if off, CUPS would notice that, but whenever sending a test page, the Job would appear as completed, but nothing was being printed in the end.
After some forums, I found that the .deb for the drivers is not enough. I finally solved it by using an installation tool from Brother, which is a bash script. Running that solved my problem. You can find it for the model DCP-T310 here, but I'm sure there will be a similar one for yours.
Hope this helps...


How does Unity work in multi-monitor configurations?
https://bugs.edge.launchpad.net/unity/+bug/661450

Check that out!


Why Landscape is not showing package information?

This is an expected limitation while the Landscape Openstack Autopilot is in Beta.  Upgrades cannot be performed and required reboots will not be listed on the machines that make up your Openstack infrastructure.

Until the feature is fully implemented, reboots and upgrades are disabled on these machines.

Other computers will be treated normally, including instances spawned in Openstack itself and registered with Landscape.


Cannot add PPA key in 18.04: NameError: name 'KUrl' is not defined

The problem appears to be with this chunk of code:

home = QDir.homePath()
if "SUDO_USER" in os.environ:
    home = os.path.expanduser("~%s" % os.environ["SUDO_USER"])
url = KUrl.fromPath(home)

I tested in a VM and this appears to be a bug with KUrl not existing, whatever it's supposed to be. I thought at first it might have something to do with running it from the terminal instead of the GUI method, but I tested those methods as well and still get the same error. Also, reading the code, I don't think it's possible that KUrl was defined anywhere or imported as a python module.

I took it upon myself to file this bug in the software-properties repository for Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/1795278

I suggest for the time being you use the apt-key add <file> command to add the key to your system.


Syncing Evolution without needing gmail?

Since you pay for email (somewhere), you can resolve the email part of this project by setting up IMAP mail clients on laptop & phone following the email host's IMAP configurations, to synchronize email. Don't know what those are, since you didn't specify the name of the email provider, but they will have a help file somewhere which specifies their IMAP requirements. You will have to abandon the Gmail app on your smartphone and replace it with another email client app, so start looking at smartphone mail clients which are IMAP capable, for there is no Evolution for smartphones.

If you don't set up your own server (helpful hints here) (and this can be set up in a cloud provider such as Amazon in AWS without your having to have a server in your living room scrreching at you 24x7), you will need to pay for a service to sync your calendar and contacts data to your Evolution. There are third party apps for calendars and contacts on Android; you need to explore those to see what they require for synchronization with Evolution (this applies if you have your own server for contacts and calendar sharing, too).

This guide is out of date, but it introduces the basic concepts. This independent guide might help.

If you're not the customer, your privacy (or the lack thereof) is the product; the corollary is you pay for privacy..


I accidentally xkilled the terminal that was running an upgrade, now what?


Black screen installing Ubuntu 16.04. How to fix?

I have had this occur two times: once on a headless device (Axiontek NA-330) and once on a "regular" server (SuperMicro). In both cases, I was able to ssh to the system (hope you added sshd to the initial install). I have reported this bug but no action has been taken.

The solution I have found is as follows:

systemctl enable console-getty.service
systemctl start console-getty.service

or, if it's a serial console

systemctl enable serial-getty@ttyS0.service (modify if your tty isn't 0)
systemctl start serial-getty@ttyS0.service

If using minicom you may need to do Ctrl+A+F to get a response.

Hopefully this helps someone else.


Expect script changing send of "\\" to just "\"

Tcl uses the \ character to escape things, like you used \r for the newline. If you want to send a single \ you either have to escape it with an other \, so it becomes \\ or you escape the string with braces {} which will prevent such special escapes. Your options are therefore:

send "copy running-config flash:\\\\startup-config"

or

send {copy running-config flash:\\startup-config}


Ubuntu crashes and shuts down under any heavy load

Well the answer was quite unexpected so i decided to shear it. It appears that the Aspire 5738 and a few others laptops of the similar versions, have bean tuned to work specifically with Win Vista. So after reading a shit ton of blog posts here is my suggestions:

Uninstall Ubuntu and reinstall windows, go to acer off page and download the update for bios. If your current version is lover then 1.34 this will resolve the problem up to the usable status, but your laptop is still gonna overheat so you still should clean it (as i did).

The more advanced steps appears to be to manually install latest VGA drivers, and make some additional holes for ventilation. I have not done neither of those and leave it up to you.


I guess you need to create the new mode first:- cvt 1920 1080 60 and then  xrandr --newmode <content after Modeline from cvt output>


Display NotifyOSD notification from a log file

You could try:

tail -f "$temp.snort.log" | xargs -d '\n' -L1 notify-send --

tail -f keeps the file open and prints new lines as they are added to the file. xargs then reads each line and runs notify-send on it. The -- signals end of options to notify-send, so that a line beginning with - isn't accidentally considered as an option.


USB devices will be accessible if you actually tell virtualbox to claim them. Just choose your device from the Devices menu:

If that still does not work you will have to install VirtualBox Guest Additions and you may have to add yourself to the vboxusers group:

sudo useradd -G vboxusers username


How to launch a terminal from script and another script to run in terminal

Run a non-interactive shell that runs your script and then replaces itself with an interactive bash shell.

gnome-terminal --working-directory="$HOME/randomdir" -x bash -c './randomscript; exec bash' &


Why are some songs available on 7digital.com not available in the Ubuntu One Music Store?

As you can read here: https://one.ubuntu.com/music/#toc_4 there are different regions for the U1 Music store. This is the actual situation, and I don't know if it will change soon or later.


put IFS=',' before for and remove tr command, this should split SERVER_SELECTION and INPUT will contains one ip at once.

IFS=','
for INPUT in $SERVER_SELECTION
do
    echo $INPUT
    <path to script> $INPUT       # call other script and use INPUT as parameter
    echo "middle of loop "
done
echo "end of loop"

IFS stands for "internal field separator". It is used by the shell to determine how to do word splitting, i. e. how to recognize word boundaries.


This sort of error will happen when the MySQL data directory is not readable by the MySQL user account. If you have moved your data directory or copied the MySQL database files from a different installation, you will need to update the permissions like so:
sudo chown -R mysql:mysql /var/lib/mysql

Be sure to replace /var/lib/mysql with the proper location of your MySQL data files if you have configured the system to use a different directory.


Try running recovery mode. If I am not wrong it must boot. (I made the same mistake years ago)

If I am wrong, Ubuntu Disc may help you repair this too.


Editing the path files for configuring make file

You will find complete install instructions for CUDA on the Ubuntu Community Wiki.

Specifically for your question you have to append two lines to a (hidden) file .bash_profile in your home directory. This is accomplished by the following commands

echo 'export PATH=$PATH:/opt/cuda/bin' >> ~/.bash_profile
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/cuda/lib:/opt/cuda/lib64' >> ~/.bash_profile

In both lines the >> is important to append to that file and not to overwrite it.

The text

  Update variables, and this on every boot:

is misleading. It should say

  Update the variables now (lines 1, 2) and automatically at every reboot (lines 3, 4).


How I can launch my browser and Nautilus using defaults Ubuntu 12.04 shortcut?

If you want to create a shortcut for opening Nautilus or your browser, open system settings, go to "Keyboard" and switch to the "Shortcuts" tab.

Select "Custom Shortcuts" and click the "Plus" (+) button, give it a name and put 'nautilus' in the command field. Then click "Apply".

In this case you will see a new shortcut called "Open Nautilus" that is disabled.  Click on "Disabled" and enter the shortcut you want.

This will work for your browser as well, you just have to know its command.


I found some links, that might help you.

https://mail.gnome.org/archives/gtk-app-devel-list/2008-October/msg00098.html

https://stackoverflow.com/questions/2027379/draw-lines-on-gtk-textview


Phpmyadmin: The mysqli extension is missing

You just need to type this command which will enable your extension mysqli and then restart your apache2 server. This will help your server to work:

sudo apt-get install php5-mysqlnd
sudo service apache2 restart


I had exactly the same problem and I had real trouble finding a solution. Eventually, I solved it by turning off Gnome's automatic window scaling. You can check your current setting with the following:

gsettings get org.gnome.desktop.interface scaling-factor

If this returns a value of uint32 0, then it means you have automatic scaling turned on. I found that setting this to a specific value (in my case 1) fixed the issue, which you can do using the following:

gsettings set org.gnome.desktop.interface scaling-factor 1

I discovered this by following this answer about scaling gnome's login screen. The problem seems to be caused by a mismatch between the login screen and desktop scaling factors.


How do I add a user to the "sudo" group?

sudo usermod -aG sudo <username>

The a is very important. Without it they'll be removed from all other groups. You will need to either restart your shell/terminal or log out and back in for this to take effect.

See also:

How can I add a new user as sudoer using the command line?


Upgrade to the specific php 7.1/7.2 from php 7.0 in Ubuntu 16.04

There is no official PHP 7.1 in the Ubuntu 16.04 repos.

If you want PHP 7.1, there is a version available in ppa:ondrej/php

You can install it like this:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
(optional) sudo apt-get remove php7.0
sudo apt-get install php7.1 (from comments)

Remember that this is not an official upgrade path.  The PPA is well known, and is relatively safe to use.

The PPA has co-installable packages (you can have multiple versions of PHP installed from that PPA). ~muru


How can I install Chromium browser in Live mode?

chromium-browser resides in the universe repository, which is not enabled in the live environment.

Edit /etc/apt/sources.list to include the universe repository and retry the installation.


Make sure the USB flash drive is removed from your computer, and reboot. If it boots up, it should be working.


Is this file a virus? It's jQuery and turned up in clam TK as a threat

jQuery is a script used by many different sites to make interactive web sites. You can find more information here:

http://jquery.com/

To make the file smaller, the script has been "minified". This means that there are no spaces, and each variable has been reduced to a single letter. It also means that it is not easy for a human to read the script, so it might look dubious to you.

If you browse the web much, you will soon encounter a new site that downloads this file again. If you just leave it where it is, your browser won't need to download it again each time a new site wants to use it.

Cheers,

James


APT problems after attempting to upgrade from Ubtuntu 17.04 to 18.04

At first undo what ever you have done before such as

You spelled bionic as bonic so:

undo

sudo sed -i 's/<whatever>/bonic/g' /etc/apt/sources.list

by running

sudo sed -i 's/bonic/<whatever>/g' /etc/apt/sources.list

Then

sudo apt update
sudo apt upgrade

and

sudo apt dist-upgrade

Open the Software & Updates settings in System Settings.

or

Press Alt+F2 and type

software-properties-gtk

Select the Updates tab

Set it to For long-term support versions if you are using 17.10.

Press Alt+F2 and type

update-manager -c

Update Manager should open up and tell you that Ubuntu 18.04 LTS is now available.


Can't add more than eight keyboard layouts

In Ubuntu 13.04 forget about gconftool-2 --get /desktop/gnome/peripherals/keyboard/kbd/layouts and use only this command:

gsettings get org.gnome.libgnomekbd.keyboard layouts
I updated the keyboard-layout-switch script for 4x4 keyboard layouts as follow:

#!/bin/bash

default_layout="['ro', 'gr', 'us\taltgr-intl', 'al']"
layout_two="['ba', 'de\tdeadgraveacute', 'ph', 'gb']"
layout_three="['de\tdeadgraveacute', 'al', 'ara', 'be']"
layout_four="['gb', 'be', 'ro', 'ara']"

current_layout=$(gsettings get org.gnome.libgnomekbd.keyboard layouts)

case $current_layout in
"$default_layout")
    new_layout="$layout_two"
    ;;
"$layout_two")
    new_layout="$layout_three"
    ;;
"$layout_three")
    new_layout="$layout_four"
    ;;
*)
    new_layout="$default_layout"
    ;;
esac

gsettings set org.gnome.libgnomekbd.keyboard layouts "$new_layout"

exit 0

Generally, for nx4 keyboard layouts:

#!/bin/bash

default_layout="['...', '...', '...', '...']"
layout_two="['...', '...', '...', '...']"
layout_three="['...', '...', '...', '...']"
.
.
.
layout_n="['...', '...', '...', '...']"

current_layout=$(gsettings get org.gnome.libgnomekbd.keyboard layouts)

case $current_layout in
"$default_layout")
    new_layout="$layout_two"
    ;;
"$layout_two")
    new_layout="$layout_three"
    ;;
.
.
.
"$layout_n-1")
    new_layout="$layout_n"
    ;;
*)
    new_layout="$default_layout"
    ;;
esac

gsettings set org.gnome.libgnomekbd.keyboard layouts "$new_layout"

exit 0

In rest all things remains valid as in this answer.

Just an observation: look out that the Ctrl+L shortcut will not work with some keyboard layouts (like Arabic keyboard layout for example). So, you must pay attention when you choose the keyboard layouts and the shortcut.

Wish you success when typing!


Ubuntu 18.04 LTS won't boot after installing video drivers

To install a graphics card that matches your computer's configuration, go to "Software & Update", select the "Additional Drivers" tab, select the driver listed in it, Apply Change, after finishing, reboot. computer


Are there easier ways to report about malfunctions experienced while using Ubuntu other than using particular bug trackers?

We really encourage you to use the bug tracker even if you aren't sure which package(s) the symptoms affect. A dedicated team will triage your bug report and assist in engaging the relevant upstream developers so that an appropriate fix can be developed, tested, and made available in an Ubuntu release.


How to update Ubuntu installation USB? Ubuntu not installing additional drivers only after Update

This problem was solved by using an older Ubuntu 17.10 (not 17.10.1) installation DVD.


How do I install the latest stable version of Thunderbird?

You can use the terminal to download and install it directly.

wget https://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/24.3.0/linux-i686/en-US/thunderbird-24.3.0.tar.bz2 -O- | sudo tar xj -C /opt && sudo ln -s /opt/thunderbird/thunderbird /usr/bin/thunderbird

Note that this will also create a link in /usr/bin/ so that you can launch Thunderbird from the terminal without specifying its folder. Modify the following parts of that command to suit your environment:

change en-US to your locale
Note that thunderbird-24.3.0.tar.bz2 is the  latest version. You can check from the Thunderbird web site.

Enter your password to confirm the action.

Source: installing thunderbird linux.


How do I get a shell window in GUI from TTY1?

Aside from the 5 other TTYs running (TTY2-TT6), you need to use a terminal multiplexer like screen or tmux to get multiple shells in a single TTY. Given your package management problems, installing either might be difficult. You can, of course, try to launch a terminal emulator in the GUI:

DISPLAY=:0 xterm
DISPLAY=:0 gnome-terminal
DISPLAY=:0 x-terminal-emulator


I can't install mysql on 14.04: "Unable to set password for the MySQL root user"

The "Unable to set password" message is a bit misleading. Essentially, it just means something went wrong when trying to set the password—which can be as generic as MySQL not running.

Run systemctl status mysql.service to find out if MySQL started up sucessfully. If it didn't, run sudo journalctl -xn and/or check the contents of /var/log/mysql/error.log to find out more about what's preventing it from starting.

Note that sudo apt-get purge mysql-server-5.5 will not remove config and data files. If one of them is botched, the only way to rectify this is to:

sudo apt-get purge mysql-server-5.5
sudo rm -R /etc/mysql
sudo rm -R /var/lib/mysql
sudo apt-get install mysql-server

Important: Don't do this if you have data in your MySQL installation, as this will ERASE all your MySQL data. On a fresh install, you've got nothing to lose. Otherwise, make sure you know what you're doing.


Using busybox's find to delete recursively some files

You seem to be using Busybox find, not GNU find. While Busybox find is supposed to support -delete, the version with Ubuntu doesn't seem to.

$ busybox find --help
BusyBox v1.21.1 (Ubuntu 1:1.21.0-1ubuntu1) multi-call binary.

Usage: find [PATH]... [OPTIONS] [ACTIONS]

Search for files and perform actions on them.
First failed action stops processing of current file.
Defaults: PATH is current directory, action is '-print'

    -follow     Follow symlinks
    -xdev       Don't descend directories on other filesystems
    -maxdepth N Descend at most N levels. -maxdepth 0 applies
            actions to command line arguments only
    -mindepth N Don't act on first N levels
    -depth      Act on directory *after* traversing it

Actions:
    ( ACTIONS ) Group actions for -o / -a
    ! ACT       Invert ACT's success/failure
    ACT1 [-a] ACT2  If ACT1 fails, stop, else do ACT2
    ACT1 -o ACT2    If ACT1 succeeds, stop, else do ACT2
            Note: -a has higher priority than -o
    -name PATTERN   Match file name (w/o directory name) to PATTERN
    -iname PATTERN  Case insensitive -name
    -path PATTERN   Match path to PATTERN
    -ipath PATTERN  Case insensitive -path
    -regex PATTERN  Match path to regex PATTERN
    -type X     File type is X (one of: f,d,l,b,c,...)
    -perm MASK  At least one mask bit (+MASK), all bits (-MASK),
            or exactly MASK bits are set in file's mode
    -mtime DAYS mtime is greater than (+N), less than (-N),
            or exactly N days in the past
    -mmin MINS  mtime is greater than (+N), less than (-N),
            or exactly N minutes in the past
    -newer FILE mtime is more recent than FILE's
    -inum N     File has inode number N
    -user NAME/ID   File is owned by given user
    -group NAME/ID  File is owned by given group
    -size N[bck]    File size is N (c:bytes,k:kbytes,b:512 bytes(def.))
            +/-N: file size is bigger/smaller than N
    -links N    Number of links is greater than (+N), less than (-N),
            or exactly N
    -prune      If current file is directory, don't descend into it
If none of the following actions is specified, -print is assumed
    -print      Print file name
    -print0     Print file name, NUL terminated
    -exec CMD ARG ; Run CMD with all instances of {} replaced by
            file name. Fails if CMD exits with nonzero

I don't know why you are using Busybox find, but try using /usr/bin/find instead. Or -exec rm {} + (no support for -execdir either) or the xargs solution that Rinzwind suggests.


Correct way of systemd for OpenVPN client on 16.04 Server?

Regarding the "openvpn@myvpn.service" part of your question, another example: I have an OpenVPN configuration file named /etc/openvpn/Germany.conf so I start the openvpn daemon with systemctl start openvpn@Germany.service. This is my default config, so it goes into /etc/default/openvpn.

In case my german gateway is down, I have another configuration file /etc/openvpn/Netherlands.conf and to use that I call systemctl start openvpn@Netherlands.service

Regarding the Restart setting, this probably goes into the [Service] section of /etc/systemd/system/multi-user.target.wants/openvpn.service though I haven't tested that myself.

Note: The above assumes that you use the Ubuntu package via apt-get install openvpn. I'm not sure what happens when you compile the stuff yourself? Also: Why would you do that?


To make a charm that uses ansible it is not required that you use the ansible template. you can just create a charm with the default template and add the ansible layer. How to do this can be found in this post. Make sure you are using the snap package of charm and remove the apt-package.

sudo apt-get purge charm
sudo snap install charm
charm create ansi

Now your charm will be created and you can start writing your code for the charm.


The first thing you install is the region-controller/cluster-controller. You have to tell the controller the address it should give to the nodes to tell them how to reach the cluster-controller.

So in many (simple) cases the address will just be the address of the server you are setting up right now.


I've got 32 bit Ubuntu 12.04 running on a Mini in dual boot config.  The mini is from mid 2011 or so.  Mountain Lion is on the Mac side.  I use Ubuntu to serve regions on OSGrid. I actually installed the 32 bit version by mistake and intend to upgrade it to the 64 bit version real soon now.


shortcut to automatically paste a specific string in terminal

I could show you a way, but it is not exactly what you might need.

First install xsel
Let's say the file which contains the password is named password.txt and is located in you home folder. Do the following, before entering the command that requires the password xsel --clipboard < ~/password.txt.
Now the password is in your clipboard and you can paste it using Ctrl + Shift + V.

You might find it boring to enter this command; you can then create an alias for it by editing .bashrc


How do I add Ubuntu Music store to Rhythmbox?

If you installed the plug in from the Ubuntu software center then go into Rhythmbox's preferences and the plugins and see if the Ubuntu one music store is enabled there.


Random WiFi disconnects on TP-LINK TL-WN821N

I see a few wireless access points that are on the same channel, so I would change the wifi router to channel 9 and see if wifi improves.  You could also go into Network Manager settings for your connection and disable IPv6


Display brightness problem on ThinkPad X1 Carbon 2015 (3rd Gen)

Intermediate self-resolution. My ThinkPad X1 Carbon (3rd Gen) now displays maximum (not minimum) brightness.

From the previous procedure, I deleted the entry in /etc/rc.local beginning with echo 167 > .... This made sense.

No other settings were changed.

Brightness control still does not work, but the current situation is far better than being permanently stuck on minimum brightness.

Still, is there any solution to make brightness control in ThinkPad X1 Carbon 2015 (3rd Gen)?


I had the same same problem and fixed it by:

Uninstalling nicotine-plus
Deleting the .nicotine folder (notice the .) from my home directory
Reinstalling nicotine-plus again

And voilà, it's running again!


How to resize disc after permanently disabling swap

To get rid of the swap partition, use GParted.
Boot from the Ubuntu installation media.
Select Try Ubuntu without installing.

On Live desktop open GParted - delete the swap partition.
Grow the Ubuntu partition, just add the unallocated space.


How to capture disk usage percentage of a partition as an integer?

I'd use...

df --output=pcent /mount/point | tr -dc '0-9'

Not sure if sed is faster, but I can't ever remember the sed values.


If I understand exactly what you miss, I hope that my repo on GitHub can solve your problem.

Ciao,Andrea


Installed ubuntu 13.04. Later format windows 7 from recovery partition

Ubuntu did not ruin your recovery partition, but your Master Boot Record is messed up. Basically, when you formatted Windows, you also formatted your whole computer. Windows did not think to update the MBR, so your computer still thinks it needs to use GRUB as a bootloader. Here's what you can do to fix that:

Boot into a Windows Recovery Disk
Choose to use the Recovery Console
Type fixmbr, then type Enter
Reboot when finished
Profit! You can now boot into Windows!


empty jockey install proprietory nvidia after bumblebee on 13.04

how do I fix the additional drivers tab?

You don't fix the additional drivers tab. It is showing what is supposed to show: nothing. Bumblebee is a free driver, jockey will show you proprietary. If Bumblebee drivers works fine using nouveau drivers, why try to install the proprietary?

  after having installed Bumblebee, which is the way to install Nvidia drivers? (as the Bumblebee site mentions something on specific packages)

The only packages you have to install are:

bumblebee virtualgl linux-headers-generic

None of them are the proprietary Nvidia drivers. Nowhere in the Bumblebee site nor the Ubuntu installation guide mentions having to install proprietary drivers. If you follow the guide and install bumblebee as intended, no problems will arise:

sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get update
sudo apt-get install bumblebee virtualgl linux-headers-generic

After that, you only need to reboot and use optirun when an application that has heavy GPU demands require (ie. a game, firefox, etc.).


not able to configure exchange mail in evolution

You can use Davmail - it's Exchange <--> IMAP/Carddav/Caldav connector. Then connect using any IMAP compatible email client, for example, Thunderbird.
See more: http://davmail.sourceforge.net/


Windows needs to have write access to the first partition on the disk and that partition has to be a primary one. So if you have non-windows first partition then Windows will fail to install.


JuJu / Landscape OpenStack Install - No network listing for Open vSwitch

Please see the following for the official word on the Openstack "Autopilot" offering in the Landscape tool:

https://insights.ubuntu.com/2014/11/06/putting-your-openstack-on-autopilot/

Specifically, Here is the text from Canonical:

  Thanks for your interest in Ubuntu OpenStack. Canonical has sunsetted
  OpenStack Autopilot and replaced it with conjure-up. We welcome you to
  visit our OpenStack product page to find an Ubuntu OpenStack solution
  that meets your needs.


19.10: A swap problem related to crypttab and updating

I am running Ubuntu 19.10 with encrypted swap too and I've run into the same issue as well.
I don't know a full remedy for this but for now I have disabled the encrypted swap mount as follows (NOTE - these steps worked for me, but may not work for you; adjust as needed!):

In Grub, boot through Advanced options, choose the previous kernel/initramfs version. In my case it was 5.3.0-40-generic (the new one that has broken things is 5.3.0-42-generic)
Remove swap mount lines from /etc/crypttab and /etc/fstab
Run cryptsetup remove /dev/mapper/cryptswap1 to disable encrypted swap
In /boot directory, backup old initrd.img file.
Create new file using update-initramfs -c -k 5.3.0-42-generic
Update GRUB config with update-grub and reboot

Another option is to resort to the previous kernel/initramfs bundle if they work for you as I did through Advanced options in GRUB menu. This will require manual selection during bootup but may be a good enough option if you don't reboot too often.

Hope this helps.


Full screen video tearing in firefox Ubuntu 19.10

I moved from Mint to Ubuntu 20.10 just couple of days ago. So not exactly the same circumstances but... I also faced annoying tearing when I watched full-screened Youtube videos in Firefox. My desktop's specs are pretty common I'd say - intel core i7 processor with UHD630 gpu. I tried a lot including most common advice that is to set Firefox's config option layers.acceleration.force-enabled to true. Unfortunately, this alone doesn't solve the issue. After quite a research I found bunch of Firefox's config options that finally solved the issue.

Open up about:config
Set layers.acceleration.force-enabled = true
Set layers.force-active = true
Add mozilla.widget.use-argb-visuals and set it to false
Restart Firefox

Now I can watch videos without an issue.
However, I don't understand why Cannonical doesn't do something with it, because it seems the issue is there for years. I use most generic hw and the issue is there right out of the box.
Hope this helps you as well.


Anything you install via apt-get or the Software Center from the original sources is safe to use, as it is tested and verified by a lot of people, including the Ubuntu team.


Thanks for all the input everyone -- is actually quite simple just using the dconf editor, as was used in the link posted by @Mogli.

In org/gnome/nautilus/desktop/font, one moves the slider that says "use default value" to the off position, then type in "sans bold" at the custom value:

As one can see, the text below the icons goes bold immediately:

Edit: with time I have found that one should actually use just "bold" at Custom Value, as this ensures the font you use in the gnome-shell.css file is definitely used on the desktop. I found this out upon changing the font to something else, and noticed that the font on the desktop did not change with it when using the "sans bold" value.


The only problem I can see is that if you were  to edit a huge photograph or play a memory hungry game, there may be a lot of disk  activity.

If that would be a problem for you, you can easily adjust the swap file in gparted available from the Software Centre.


multiline command chunks in bash history into multiple lines

I am using GNU bash, version 5.0.3(1)-release on Ubuntu 19.10. I checked and confirmed the issue described in your question exists.

I then solved it using the following steps. After that I exited bash multiple times and confirmed the problem is solved on my system. Multi-line commands are saved to the ~/.bash_history file, retrieved and executed correctly.

Solution:

Please edit your ~/.bashrc file or create it if it does not exist.

Copy and paste the following three lines into it and save it:

shopt -s cmdhist
shopt -s lithist
HISTTIMEFORMAT='%F %T '

From bash man-pages:

  cmdhist:

  If set, bash attempts to save all lines of  a  multiple-line  command
  in  the  same history entry.  This allows easy re-editing of
  multi-line commands.

  lithist:

  If set, and the cmdhist option is enabled, multi-line commands are
  saved to the history with embedded newlines rather than using
  semicolon separators where possible.

However, cmdhist and lithist are useful while the shell is still open and working from memory. When you exit the shell, the commands are saved into the ~/.bash_history file as single lines without any indication as to where a multi-line command starts or ends and then the working memory is cleared. When you run the shell again these lines in the bash history file (including the multi-line commands) will be read one line at a time and each line will be treated and loaded to working memory as a single command even though it could be a part of a multi-line command because the ~/.bash_history file will look like this:

nano .bashrc
exit
history
for i in {1..10}
do
echo $i
done
cat .bash_history
exit
history
awk '
{ print $1}' <<<'first last'
history
exit

Hence the need for HISTTIMEFORMAT which will act as a delimiter to separate each command from an other based on its timestamp, be it a single line or a multi-line command. So the ~/.bash_history file will look like this:

nano .bashrc
#1581635697
exit
#1581635709
history
#1581635729
for i in {1..10}
do
echo $i
done
#1581635743
cat .bash_history
#1581635757
exit
#1581635773
history
#1581635794
awk '
{ print $1}' <<<'first last'
#1581635801
history
#1581635808
exit

From bash man-pages:

  HISTTIMEFORMAT:

  If this variable is set and not null, its value is used as a format string for strftime(3) to print the time stamp associated
  with  each  history  entry displayed by the history builtin. If this
  variable is set, time stamps are  written to the  history file so they
  may be preserved across shell sessions.  This uses the history comment
  character to distinguish timestamps from other history lines.

From now on multi-line commands will be retrieved, treated and loaded into working memory as a whole (without breaking them into single lines and treating each line as a separate command) and the history command output will look like this (even after restarting bash):

raffa@Laptop:~$ history
   1  2020-02-14 05:25:19 nano .bashrc
   2  2020-02-14 05:25:38 exit
   3  2020-02-14 05:25:50 history
   4  2020-02-14 05:27:50 for i in {1..10}
do
echo $i
done
   5  2020-02-14 05:28:05 cat .bash_history
   6  2020-02-14 05:28:14 exit
   7  2020-02-14 05:28:27 history
   8  2020-02-14 05:28:55 awk '
{ print $1}' <<<'first last'
   9  2020-02-14 05:29:06 history
  10  2020-02-14 05:29:16 exit
  11  2020-02-14 05:29:27 history

And multi-line commands will be correctly retrieved, displayed and executed after exit.

Notice:

You will need to restart your current session of bash after editing and saving the ~/.bashrc file to activate the changes.
If your current ~/.bash_history file or bash working memory already contain history lines with formatting errors, you might need to delete (Please back up first) your current bash history by running history -w; history -c in the terminal which will permanently delete all your current bash history.

Best of luck


How do I uninstall a font installed using gnome-font-viewer?

It turns out even though I ran it as root, it just installed it in $HOME/.local/share/fonts/somefont.ttf (but owned by root), not system-wide (as I had expected).


this solved it for me

Compiling linuxtv fails when applying patch

you need to edit the diff file and remove a particular patch, since the underlying driver code isn't on the filesystem.


How to in/decrease the volume of a specific application by command?

Setting volume from cli

The command:

amixer -q -D pulse sset Master 30%

is one I found always working so far. To completely dim:

amixer -q -D pulse sset Master off

Switch back on:

amixer -q -D pulse sset Master on

Setting volume per application

Not sure if you want different sound volumes for different applications at the same time, or you'd like to set the volume, depending on what application is in front.

If the latter is the case, take a look here. It includes a script, dimming sound depending on the active window. Can easily be made to set a specific volume.

To find more information on how to do it per application at the same time see the answers to this question, as provided by @muru.


Try this at cli after login,

sudo service lightdm start

If it solves your issues. Open a terminal to edit the file /etc/X11/default-display-manager as

sudo gedit /etc/X11/default-display-manager

Add the following line there,

/usr/bin/lightdm

or

/usr/sbin/lightdm

after this lightdm should start normally on reboot and bring you to the logon screen as usual.


Install ubuntu goes blank hp envy m7 touchsmart

looks like your laptop came with locked bios
have a look at this https://help.ubuntu.com/community/UEFI


Unable to boot after upgrading from Ubuntu 18.04 to 20.04

I had the same problem and the only fix I could find was to reinstall Ubuntu 20.04 from a live CD. Download Ubuntu 20.04, burn it to a CD or flash drive and boot from it. Then take a back up of everything and install the OS. The live CD will detect that Ubuntu is already installed and will show you three options Reinstall, install alongside current OS, remove everything and install. Choose Reinstall. If it is possible, the installer will do that otherwise, the installer will inform you of the problem and will ask what to do. Choose as per your situation.


UI program to open .p12 certificates from iOS in ubuntu

In Ubuntu you can use gcr-viewer (you should open it with a console like gcr-viewer certificate.p12 as the GUI doesn't have an Open command).

A good program to show, edit and generate certificate is KeyStore Explorer. It's free and Open Source under the GNU GPL.


Open your Terminal and enter the following command or open your favorite text editor with root privilege:

sudoedit /usr/share/glib-2.0/schemas/com.canonical.Unity.gschema.xml

Look for <key type="b" name="integrated-menus">. Under this, replace false with true in the <default> tag.

Finally, run:

sudo glib-compile-schemas /usr/share/glib-2.0/schemas/