Restart systemd unit on certain log output

I ended up writing a small wrapper script in Python that monitors the output and exits the process if the error line appears in its output.
#!/usr/bin/env python3

import subprocess
import atexit
import sys

ALL_PROCESSES = []

def exit_handler():
    for process in ALL_PROCESSES:
        process.kill()

def main():
    global ALL_PROCESSES
    process = subprocess.Popen(<what-to-execute>,
        stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
    ALL_PROCESSES.append(process)
    while True:
        nextline = process.stdout.readline()
        if nextline == '' and process.poll() is not None:
            break
        if 'error' in nextline.lower():
            sys.stderr.write('Error occured, stopping child: {}'.format(nextline))
            exit_handler()
            sys.exit(1)
        sys.stdout.write(nextline)
        sys.stdout.flush()

    output = process.communicate()[0]
    exitCode = process.returncode

    if (exitCode == 0):
        return output
    else:
        raise ProcessException(command, exitCode, output)

def execute(cmd):
    popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True)
    for stdout_line in iter(popen.stdout.readline, ""):
        yield stdout_line
    popen.stdout.close()
    return_code = popen.wait()
    if return_code:
        raise subprocess.CalledProcessError(return_code, cmd)

atexit.register(exit_handler)

if __name__ == '__main__':
    main()


How do I make Firefox use the new (local) version of Java?

Find where the new libpjp.so is installed from your new java update. You can do

find / -name "libpjp.so" 2>/dev/null

and it will show you all the libpjp.so files on the filesystem.
Create a plugins directory in your home directory's ~/.mozilla/ directory so you have ~/.mozilla/plugins.
Make a symlink in the plugins directory to the libpjp.so file and restart firefox.

Source: Oracle.com


No, you can not.

sudo basically enables one to impersonate other user (by default root) by providing the credential for the user who is running the sudo command (given the user running sudo is in the sudoers file with sufficient privilege).

At most, you can run specific commands with NOPASSWD parameter so that those commands while running with sudo won't require your password but in all other cases you can not use any other password rather than your account's one.


cant add account on gnome-online-accounts

It is an issue with the default NetworkManager configuration.

By default, NetworkManager won’t touch the default wired ethernet connection because it’s listed in /etc/network/interfaces. As a consequence, it thinks the system is “offline”. I think this is greying out the “add” buttons. (It also breaks Evolution.)

Performing the config changes listed in https://wiki.debian.org/NetworkManager in the section Enabling Interface Management causes both of these problems to be fixed.

This should probably be the default configuration.

Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818932


You can do the following sequences in terminal for this matter :

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

sudo sh -c 'echo "deb http://dl.google.com/linux/earth/deb/ stable main"/etc/apt/sources.list.d/google-earth.list'

sudo apt-get update

sudo apt-get install google-earth-stable

hope that works ;)


what-source (part of what-utils) returns package name two times

As the manpage says, what-source is a simple wrapper for apt-cache show | grep. The actual code is:

#!/bin/sh
# [....]
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

apt-cache show "$1" | grep "^Filename:" | sed -e "s:\(.*\)/\(.*\)/\(.*\)/\(.*\)/.*:\4:"

apt-cache show will show the description for each version of the software available in the repositories. For example:

$ apt-cache policy firefox
firefox:
  Installed: 38.0+build3-0ubuntu0.14.04.1
  Candidate: 38.0+build3-0ubuntu0.14.04.1
  Version table:
 *** 38.0+build3-0ubuntu0.14.04.1 0
        500 http://mirror.cse.iitk.ac.in/ubuntu/ trusty-security/main amd64 Packages
        500 http://mirror.cse.iitk.ac.in/ubuntu/ trusty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     28.0+build2-0ubuntu2 0
        500 http://mirror.cse.iitk.ac.in/ubuntu/ trusty/main amd64 Packages

There are two versions available in three repositories, and apt-cache will show descriptions of these two versions:

$ apt-cache show firefox | grep -i -e version -e filename
Version: 38.0+build3-0ubuntu0.14.04.1
Filename: pool/main/f/firefox/firefox_38.0+build3-0ubuntu0.14.04.1_amd64.deb
Version: 28.0+build2-0ubuntu2
Filename: pool/main/f/firefox/firefox_28.0+build2-0ubuntu2_amd64.deb

So, yes, the behaviour is perfectly normal.


Launch a program to run on a specific display

Some programs are smart enough to remember the last window position.
Many programs written for the X Window System accept a -geometry option; for example, xcalc -geometry +500+750 will start xcalc placing the window 500 pixels to right and 750 pixels down from the logical upper-left corner (which is +0+0). Other programs call this option --geometry (note then two hyphens). Read the documentation of the specific program.
Another option is to install wmctrl (sudo apt-get install wmctrl). wmctrl (Window Manager Control) allows sending requests to the window manager to perform certain actions, such as resizing or moving windows. You could then write a small script which starts the program and then uses wmctrl to move it where you want it to appear.


You might have either accidentally used "useradd" instead of "adduser" - which adds the user, but does not set up a profile for him/her - or you might be missing the "skeleton" files in /etc/skel which normally set up a default user account.

Please do sudo userdel username (where username is the name of the account you're creating), then sudo adduser username and post the output here.  You SHOULD get something like the following:

me@banshee:~$ sudo adduser noob
Adding user `noob' ...
Adding new group `noob' (1005) ...
Adding new user `noob' (1005) with group `noob' ...
Creating home directory `/home/noob' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
Changing the user information for noob
Enter the new value, or press ENTER for the default
    Full Name []:
    Room Number []:
    Work Phone []:
    Home Phone []:
    Other []:
Is the information correct? [Y/n]

If you do all that and the user still does not get a full prompt, then you're missing some files from /etc/skel - please post back, and we can help further.  I think you just accidentally used useradd instead of adduser, though, which does not do ANY of the above stuff - it just creates a system account and that's it, no homedir, no nothing.


This is a strange problem you have.... By default, the xrdp session would be using the en-US keyboard layout....If en-us is the only keyboard layout you are using, you should have no keyboard issue whatever remote client you are using.
To configure a keyboard layout for xrdp, you can execute the following commands (run this command on the Console not in the xrdp console)

Step 1 : You go to the /etc/xrdp directory
Step 2 : you issue the command setxkbmap -layout <%your layout%> to define which keyboard map/layout to use
Step 3 : create a copy of the km-0409.ini file into the same directory.
Step 4 : Check that you have a backup of your file by typing the dir or ls command
Step 5 : update the file by issuing the following command sudo xrdp-genkeymap km-0409.ini

Now, to check which keyboard layout you have when connected to xrdp, if you are using the latest xrdp package, you can either user the GUI or the following command line
setxkbmap -query
if you are using an older version of the xrdp package, you will probably receive an error message... (something like extension not availale...)
Check the following link for step by step instruction of xrdp and xubuntu 16.10, this might solve your issue... (check this link)
Hope this help
Till next time
See ya


After installed SELinux system is stuck and not booting

Bad thing is Ubuntu is a bad choice for playing with SELinux — they pet Apparmor instead (which isn't up to SELinux' level with quite different approach, but that's another story).

The issue you've run into is easy to fix (that was good thing part):

During boot you'd need to get to GRUB's menu and edit kernel's parameter which enforces use of SELinux: selinux=1.
Unset it with …=0 (IOW, replacing 1 with 0) and proceed with booting then.

At this point the system should be successfully booted but it's not all done yet.

— It's time to put long-term fix. May be uninstall SELinux? :) It might still be not enough though. Checkout /etc/default/grub with an sudo …YourEditor… and if you'd see there

GRUB_CMDLINE_LINUX_DEFAULT="security=selinux selinux=1"

cut it down to empty string after assignment: …LT=""

then sudo update-grub to re-generate GRUB's config.


system settings not showing all settings

I found an answer on here, I was having the same issue. Try this:

sudo apt-get install ubuntu-desktop


You installed that from a PPA (n-muench/burg/ubuntu) that was intended for older versions of Ubuntu. It seems the PPA maintainer has not made an version for Trusty available in the PPA. Go to Launchpad.net and contact the PPA maintainer directly.


This is a known bug in Yakkety: https://bugs.launchpad.net/ubuntu/+source/phablet-tools/+bug/1625182

The Ubuntu SDK IDE and the associated tools like the Emulator are currently unsupported, but some users report it still works in Ubuntu 16.04 Xenial Xerus.

A good alternative to the emulator is using clickable to build the application in a docker container. With clickable --desktop, the app can be run on the desktop as well. This works on all versions of Ubuntu, as well as all other operating systems that support docker.


The easiest way is to copy the hidden folder ~/.mozilla to your new home folder. Or, if you boot the external one, just open Firefox and setup the online sync. Use the same account in the newly installed Ubuntu and everything will be in sync in a matter of seconds.


Using tar and rsync for high availability

I would recommend you to use rsync instead, it will allow you to do a live system to system real synchronization without the need of temporary files. It also provides the benefit of doing incremental updates when you need to update the clone.

I would exclude only: /proc/ /sys /dev /tmp /mnt
On the clone system you will need to make sure /etc/fstab and /boot/grub/grub.cfg are updated with the UUIDs of the clone systems partitions.

If you have a database like mysql you will need to be carefull and stop the DB before performing the copy.


Its all ipTables. I have a guide written on my blog about using Linux as a router and firewall. You will need to use NAT on the Ubuntu machine to change your internal IP's on to external. Just connect your modem to the wall then from modem to ubuntu machine with ethenet. Set the modem to bridged mode, which means all it does is forward traffic to your linux machine where the firewall and routing will be done.

NAT ipTables
Default Gateway for internal traffic must be set in routes

  https://www.kerneltalk.co.uk/?p=24

This link will take you to my blog. This describes setting up your ipTables to allow NAT. Then once you have done this you will need to open any ports for applications that you use regularly.

How are you dealing with wireless?


ubuntu 20.10 wifi connected but no internet connection. how to solve this

You need to install a driver for this adapter. Connect to the internet by other means and run:
sudo apt update
sudo apt install git dkms
git clone https://github.com/lwfinger/rtw88.git
sudo dkms add ./rtw88
sudo dkms install rtlwifi-new/0.6


Laptop display stopped working with correct resolution for no reason

This fixed it:

sudo apt-get install --reinstall linux-image-3.13.0

Turned out drivers stopped loading for display and some other devices. I noticed it and tried to reload the module

modprobe -r atl1c
modprobe atl1c

but it gave the following error

 modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/3.13.0-24-generic/modules.dep.bin'

I investigated that, and found this question with the solution

"Could not open moddep file '/lib/modules/3.XX-generic/modules.dep.bin'" when mounting using a loop

this solution also installed a pile of old kernels which I had to delete afterwards, but it worked


How do I create default folders for new users?

Yes.

Anything sitting in /etc/skel will be copied out to new user accounts. Old accounts aren't affected by changes to it.


How to fix GRUB menu not showing until I press Esc?

Couldn't comment @Fanta, but after turning off GRUB_TIMEOUT_STYLE setting I got another error, something about "Couldn't find hwmatch module".

I fixed it not by turning off the GRUB_TIMEOUT_STYLE setting, but setting it from hidden to menu

See more about that setting here in the GRUB manual on gnu.org.


How to install Redis-Server 6.0.1 in Ubuntu 20.04?

From the redis-server page:

Download, extract and compile Redis with (you have of course to install via apt the build-essential and wget packages):

wget http://download.redis.io/releases/redis-6.0.3.tar.gz
tar xzf redis-6.0.3.tar.gz
cd redis-6.0.3
make

The binaries that are now compiled are available in the src directory. Run Redis with:

src/redis-server

You can interact with Redis using the built-in client:

$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"


Ubuntu 13.04 is really slow on the window7

You may need to increase the RAM size of the virtual machine. Usually virtual machine is not as faster as it is installed on a seperate partition. And this case gets worse since you have installed a latest ubuntu version. You should allocate more memory for the VM.


Guide on upgrading Ubuntu 11.10 to 12.04 (troubleshoot queries)

Will old apps/tools/plugins remain updated or else I would be required to reinstall all of them?

All apps that still exist in the new version will get updated, no need to reinstall

  Will it erase user's old data files from disk?

All user data will be kept (although it is always a good idea to have a backup)

  Will it remove my Internet browsing history, cookies, password?

Everything that resides in your home directory will be kept

  What major changes are expected post upgrade, any precautions or back up to be done?

I am not aware of any major changes, although the UI is different. And (as stated above) it is always good to have a recent backup of important things - especially

everything in your home directory (don't forget the hidden files/directories)
everything in (and beneath) /etc, the directory for all system settings

Cited from Upgrade instructions for debian systems

  Before upgrading your system, it is strongly recommended that you make a full backup, or at least back up any data or configuration information you can't afford to lose. The upgrade tools and process are quite reliable, but a hardware failure in the middle of an upgrade could result in a severely damaged system.


How to make all windows appear in center of the screen when you start them up?

In CompizConfig Settings Manager go to:

Window Management -->Place windows.
Change Placement Mode from Smart to centered.

For me this fixes the problem in 11.04.


Snapd Auto-Refreshing libreoffice for the last 4 days

Edit:  I was able to abort the refresh ("snap abort 48").  Running snap refresh now returns All snaps up to date.  I have no idea what it was doing.
Edit:  Well after a reboot it is back.  Will remove and install with Apt tomorrow.  Thanks for the PPA.
Well, nothing is easy.  Aborted the auto-refresh, snap changes shows it as aborted.  sudo snap remove libreoffice returns an error: snap "libreoffice" has "auto-refresh" change in progress.  Yes, that is why I am trying to remove it.  Snap refresh still shows All snaps up to date.
Open the Ubuntu Software store and try to remove it from there, same error.  Tried updating it from the store, the Update button changes to Installing for about 3 seconds, then goes back to Update.
Did a bit of Googling and it seems there is no way to force the removal of a snap that has an auto-refresh in progress.
snap tasks on the ID for the task showed that it was doing the download, but stuck at 29.5 %.  I stopped and started snapd, and it finished!  Removing libreoffice now,I will reinstall using apt.


libqt4-gui is still available in Ubuntu 10.04 LTS. It's a "transitional package", which means it doesn't provide any files, and depends on the newly named packages. It exists primarily to ensure the newly named packages get installed when upgrading. But you should still be able to install it.

sudo apt-get update
sudp apt-get install libqt4-gui

If that doesn't work, please comment to indicate what happened.


installing windows alongside ubuntu. how to partition?

I did it this way. On the main drive (my SSD) I already had Ubuntu installed.

Ubuntu was on /dev/sda5 inside /dev/sda1 extended partition.
When I installed Windows 7, I either had space already unpartitioned on my SSD or I shrunk the extended partition and made unpartitioned space from the remainder.

There is one thing you should keep in mind, let the space you are going to use for the windows install be unpartitioned not already NTFS or anything else.

Boot from the USB/DVD windows installer, install to the unpartitioned space.
Windows will create (in my case) /dev/sda2 as its boot partition and /dev/sda3 as its file system partition.

After you are done installing windows, boot up from an Ubuntu live DVD/USB and in the terminal make sure to install grub (boot manager) again to /dev/sda1.

If you do it like this normally you should get a working dual-boot (at least for what I am running Ubuntu 18.04/Windows 7)


Where does Gunicorn come from in `service gunicorn restart`?


You can use screen or tmux to keep things running, while you are not connected to the server. See their man pages for more info. There is also byobu which may be of interest to you.


How to enable event MPM Apache 2.4 on Ubuntu 14.04 with thread safe PHP?

To disable event MPM, you can do sudo a2dismod mpm_event and after that to enable prefork, you should do sudo a2enmod mpm_prefork.

Finally restart apache:

sudo service apache2 restart


keyboard not respondiing after installing Ubuntu

Something in the power management scripting didn't work.  At this point Ubuntu is fully unloaded and it's safe to just push the power button to turn it off.


Does Banshee crash right after playing a song, or right after starting up? Try to disable all the plugins, then restart the application. Especially disable the iPod-support plugin. This plugin was the culprit for me when running Banshee on 10.10.


config.status: error: cannot find input file: `Makefile.in'

I believe apxs is included in apache2-dev . I suggest you do:

sudo apt-get install apache2-dev

After it and its dependencies are installed, try configure again. I got:

chili@T410:~/mod_wsgi-3.4$ ./configure
checking for apxs2... /usr/bin/apxs2
checking Apache version... 2.X
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: creating Makefile


Touchpad right click is not working - Ubuntu 14.04 on Dell inspiron 5548

Go to settings - Mouse & Touchpad

And change primary click to left /or right depending on what you want.


Open a Terminal and go to the directory where you downloaded HoNClient-3.4.3.sh and type:
chmod 777 ./HoNClient-3.4.3.sh

Then all you need to do is to start the program like this:
./HoNClient-3.4.3.sh

It should not be a problem of 32 vs 64 bits as both are included in this 2.3 GB file:

I tested the md5sum of HoNClient-3.4.3.sh:
$ md5sum ./HoNClient-3.4.3.sh
9aea6d7dc07c959deda9819b23b079b2  ./HoNClient-3.4.3.sh

Make sure that what you downloaded also have returns 9aea6d7dc07c959deda9819b23b079b2.
Finally I tested installation on 14.04 64 bits, maybe it's just the 32 bits which is broken. Try the same file on a 14.04 64 bits, it should just work.


How to enable multiple displays with Catalyst drivers in 13.04?

Just a quick sanity check, but that setting requires root... Did you open as root (w/like 'sudo amdcccle')? If not, this is required in order to change that setting.

Though if you didn't there is usually a pop-up that states "To make changes on this page Administrator access is required...." This pop-up has a check box "Do not show me this again". Given your "grayed out" symptoms, this seems like it would be the issue, and the do not show me again option may have been previously selected...

In ubuntu-gnome 13.04 (hate that name, as it is now an official distro, it should be Gnubuntu, following the alternate DE naming convention), a launcher is created for AMD CCC and AMD CCC (Administrative) but I couldn't get the latter to work until I installed gksu (which 13.04 excludes by default).


Allow different sources for each window w/ dynamic keyboard layout for new windows

While that feature is present with e.g. Unity or MATE, it seems to be missing in the GNOME desktop used by standard Ubuntu.


Adaptive software on Ubuntu for the blind?

Well I hope I'm not too late for being helpful here but Windows refugees looking into Linux need look no further than Ubuntu.
The first lesson you need is changing terminology, simply understand that the Windows Key or Start Key as we call is is now the Super Key.  So Super Key+Alt+S will start Orca Screen Reader on any version of Ubuntu Desktop since version 10 or 12 as far as I know.
This means that if you can get your BIOS or UEFI set up to boot from a USB first then you're half way done already.  If you don't have that setup you'll likely need a lot of luck or some sighted help.  Once you boot from the Ubuntu installation media then you can launch Orca as I mentioned above and it will speak to you throughout the installation process.  Furthermore this will inform Ubuntu that you are using the Orca Screen Reader and tell it to launch Orca automatically at the next restart.

So if you want to be on the cutting edge then you can just install normal Ubuntu Desktop and run with it.  You'll want to make sure you're jumping on an LTSB version though, the Long Term Servie Branch has all of the stable goodies to do pretty much anything you want anyways.

With respect to the other post in this thread, Vinux is pretty much the only viable option for already setup to work with blindness Linux flavors.  I used to do a lot of work with Sonar and the gang from there joined forces with Vinux, which I might add is based on Ubuntu 16 LTSB version.  The Vinux OS is a little more restrictive than I like, but it does work pretty good as far as ready to rock and roll right out of the box.

Another option is Talking Arch which is based on Arch Linux.  If you like to try new and crazy things just to see if you brick your PC then dive into Talking Arch without looking and enjoy the heck out of it!!!!
Here's a tip, read the Arch Linux installation tutorial like 30 times before jumping in though!!!

I'm blind and I've used both Linuxand Windows since Ubuntu version 8 I think so I can promise you between normal LTSB Linux Desktop an Vinux those are your 2 most stable, actually supported and fully functional options.
Also, ask Google about Orca Screen Reader, read up on it and make sure you understand how to use it and how to change settings for it.

HTH
Tiki


Is there a hdaps extension of gnome shell?

hdaps isn't anything to do with the user interface. Install hdapsd for protection.


how to access an shared forder with guest user

You could try the next smb.conf configuration:

[global]
    workgroup = WORKGROUP
    server string = %h server (Samba, Ubuntu)
    netbios name = UBUNTU-POWERSPEC
    log file = /var/log/samba/log.%m
    max log size = 10240
    security = user
    map to guest = Bad Password
    getwd cache = yes
    guest account = nobody
    usershare allow guests = Yes
    server signing = auto
    passdb backend = tdbsam
    local master = yes

    vfs objects = acl_xattr
    map acl inherit = yes
    store dos attributes = yes

    winbind nss info = template
    winbind enum users = Yes
    winbind enum groups = Yes
    winbind use default domain = yes

    client use spnego = yes
    client ntlmv2 auth = yes

    encrypt passwords = yes

    local master = No
    hide dot files = No
    allow insecure wide links = yes
    store dos attributes = yes

[sambashare]
    path = /home/user/sambashare
    comment = sambashare on Ubuntu
    directory mask = 0755
    create mode = 0777
    read only = no
    available = yes
    browseable = yes
    writable = yes
    guest ok = yes
    public = yes
    locking = no
    strict locking = no

As you can see, in [global] section you have guest account = nobody, usershare allow guests = Yes. In share's configuration you have guest ok = yes, public = yes, writable = yes and so on. Also make sure your share's folder has write permissions for anybody.


Installation of a package to a custom directory

A debian package needs to be compliant to the FHS, that clearly defines where to put data and where to install applications on any system. This clear structure makes administration easy and we all should stick to that.

In your case, when it comes to testing applications an installation to a custom directory may be desired. However there is no way to tell your package manager not to use the predefined file locations from an exisiting DEB package.

If you need an installation to another location you may need to compile your package from source, as you already pointed out. Alternatively, and if you need to use dpkg you will have to build your own private DEB where you can define other installation paths. If however the application relies on access to files located on a FHS-compliant path it may not run the way developers intended.

For installing testing versions of applications you may consider a chroot (or schroot) environment. The safest solution (though maybe overkill) for testing is installing applications in a virtual OS (e.g. through Virtual Box)


App indicator for software RAID running degraded?

Nope, make one :)
It sounds easy but once you get pass RAID 1 it gets complicated, fast.


Try the "nomodeset" needed for Nvidia hardware. If you type Esc when the purple screen is frozen, do you get a text screen with errors?  Add the word in place of the "quiet splash" on the kernel boot line -- type "e" on the grub screen to edit the line, editing/booting instructions at bottom of screen.


video down loader just like free make video downloader

The easiest way would be to use one of the many firefox plugins.

One that you can try is... https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/?src=cb-dl-mostpopular


pip : AttributeError: module 'lib' has no attribute 'Cryptography_HAS_SSL_ST'

In my case, running

sudo apt install --reinstall python3-openssl

fixed this for me.


Is it ubuntu yet installed in your sistem?
If not:
You can divide the disk in FileSystem with your data and merge all the "useless" partition.
After that in the BIOS start the installer of linux and when the installer is in Section called "Installation type" select option "something else"
You choose the free space merged on windows. You can create the partition with "/" (root) mount point FileSystem ext4 and the second part is a ext4 "/home", if your system is modern you can't create the swap area.


I fixed it by booting into recovery mode and using the root shell prompt.
I than added back /etc/pam.d/common-u2f and added the line
auth sufficient pam_u2f.so authfile=/etc/u2f_mappings cue.


How to extend my root and home partitions when boot is in the way?

I would actually create a new partition in the unallocated space and mount that (at boot via /etc/fstab) at a convenient location. What's convenient for you depends on your use case.


I'd suggest using pkill, with the -f flag to match against the whole command:

pkill -f /var/appname.jar

Test first with

pgrep -af /var/appname.jar

From man pkill:

   -f, --full
          The pattern is normally only matched against the  process  name.
          When -f is set, the full command line is used.


Launch Thunderbird and navigate to the menu Tools → Add Ons, go to the Languages tab and make sure that you have enabled the German language package.


I'm not 100% sure of what all of your partitions do, but I can identify most of them:

/dev/sda1 -- This is your EFI System Partition (ESP), which is required to boot an EFI-based computer.
/dev/sda2 -- Based on the filesystem (NTFS), label (Recovery), and size (900MiB), I'd say this is part of your OEM Windows installation. It's probably a stripped-down Windows installation used for emergency recovery, but I'm not positive of that.
/dev/sda3 -- This is the Microsoft Reserved partition, which exists mainly to have some "scratch space" for use by Microsoft partitioning tools.
/dev/sda4 -- Based on the filesystem (NTFS), label (OS), and size (223GiB), this looks like your main Windows partition.
/dev/sda5 -- I don't know what this partition holds. You might want to try mounting it and examining its files for clues.
/dev/sda6 -- Given its name (New Volume) and the fact that it's almost empty, this looks like something you created yourself, but I can't be sure of that.
/dev/sda7 -- This is a BIOS Boot Partition. It's used in BIOS/CSM/legacy-mode boots via GRUB. Since your computer boots Windows in EFI mode, it shouldn't be necessary, although if you installed Linux in BIOS/CSM/legacy mode, you might be using it. You mentioned rEFInd, though, and if you're booting Linux via rEFInd, you almost certainly don't need this partition. If you can positively identify your Linux boot mode as EFI/UEFI, you can safely delete this partition. OTOH, it's only 1MiB in size, so there's really very little advantage to be had from deleting it.
/dev/sda8 -- This is your main (root, /) Ubuntu partition. It's got the wrong type code, though (an "msftdata flag," in GParted terminology). I recommend removing that "flag," since it will cause the partition to show up as an empty disk in some Windows tools, which will then give you the option to format the partition. If you mistakenly accept, you'll end up trashing your Ubuntu installation. See here for more on this subject.
/dev/sda9 -- This is your Linux swap space.
/dev/sda10 -- Based on the filesystem (NTFS), label (Restore), and size (20GiB), this partition probably holds restore images for Windows -- that is, it's either a backup location or is used instead of an external restore disc (probably the latter).

In any event, partitions 1-4, 10, and possibly 5 and/or 6 are all part of your original from-factory state. (Partition 10 probably had a lower number originally, though; it was probably renumbered when you resized your partitions to make room for Ubuntu.) Partitions 7-9 were created by your Ubuntu installation.


Try forcing the power profile to low, i have the same/similar issue and i think this solved it for me.
I got this from this bug report.

In case you can't open the link the suggestion that seems to work for me is:

  echo 'low' > '/sys/class/drm/card0/device/power_dpm_force_performance_level'

Should this work for you, it might be a good idea to make sure it is set to low on startup.

edit: I followed the instructions to update the firmware and now i think i have everything working even on the auto/balanced profile.

edit2: just froze on auto, will set to low and test for a while to see it low worked or i was just lucky.


How can I change mouse and touchpad settings?

Just type on the Dash: Mouse. Then select the option "Mouse and Touchpad". In the opened window, select the tab "Touchpad". There you can check the 2 finger scroll option and more.


It's running as a java process so you can use

killall java -9

(Warning! This command kills all java processes)

Source: Intellij support forum


dpkg removes empty directories, cleaning up after packages that you remove1. These .placeholder files that you see in the various cron-related directories are owned by the cron package. Of course, the cron package does not add any jobs to these directories. Therefore, by themselves, they'd be empty directories. However, other packages can drop files into these directories to activate cron jobs, either directly or by scripting.

What will happen when you purge all the installed packages which add cron jobs? Then dpkg will try to remove these now-empty directories to clean up. To prevent this, cron adds .placeholder files. sudo adds a README to /etc/sudoers.d.

Correspondingly, dpkg will not remove non-empty directories. If:

a directory was owned by some package, and
you added a file manually, or some package added a generated file, to that directory and then,
removed the first package,

dpkg will warn you that it is not removing that non-empty directory. For example:

$ dpkg -S /etc/php5
php5-cli, php5-json: /etc/php5
$ sudo apt-get remove --purge php5-cli
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
  php5-cli*
0 to upgrade, 0 to newly install, 1 to remove and 8 not to upgrade.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 479105 files and directories currently installed.)
Removing php5-cli (5.6.11+dfsg-1+deb.sury.org~trusty+1) ...
Purging configuration files for php5-cli (5.6.11+dfsg-1+deb.sury.org~trusty+1) ...
$ sudo apt-get remove --purge php5-json
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
  php5-json*
0 to upgrade, 0 to newly install, 1 to remove and 8 not to upgrade.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 479104 files and directories currently installed.)
Removing php5-json (1.3.7-1+deb.sury.org~trusty+1) ...
Purging configuration files for php5-json (1.3.7-1+deb.sury.org~trusty+1) ...
WARN: php5-common has been removed, you need to cleanup /etc/php5 yourself.
dpkg: warning: while removing php5-json, directory '/etc/php5/mods-available' not empty so not removed

Various PHP modules had programmatically added files to /etc/php5, so dpkg didn't remove that directory even though what appeared to be last package owning it was being purged.

To contrast, I re-installed php5-json, which brought in an updated version, where php5-common also now owns /etc/php5, where previously it added files programmatically:

$ dpkg -S /etc/php5
php5-json, php5-common: /etc/php5
$ sudo apt-get purge php5-{readline,common,mysql}
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'php5-mysql' is not installed, so not removed
The following packages will be REMOVED
  php5-common* php5-json* php5-readline*
0 to upgrade, 0 to newly install, 3 to remove and 8 not to upgrade.
After this operation, 1,336 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 479151 files and directories currently installed.)
Removing php5-json (1.3.7-1+deb.sury.org~trusty+1) ...
Purging configuration files for php5-json (1.3.7-1+deb.sury.org~trusty+1) ...
Removing php5-readline (5.6.11+dfsg-1+deb.sury.org~trusty+1) ...
Purging configuration files for php5-readline (5.6.11+dfsg-1+deb.sury.org~trusty+1) ...
Removing php5-common (5.6.13+dfsg-1+deb.sury.org~trusty+3) ...
Purging configuration files for php5-common (5.6.13+dfsg-1+deb.sury.org~trusty+3) ...
$ ls /etc/php5
ls: cannot access /etc/php5: No such file or directory

1 For the case of files in /etc, this happens when you purge packages.


Blank screen after resume from suspend on 18.04 on HP Elitebook 850 G5 (Intel HD graphics)

Solution:
Properly (click) blacklist amdgpu, even if you think you're not using it.
Explanation/story:
I thought I had properly tried the amdgpu blacklist fix, but apparently something went wrong. I didn't bother to double-check, since I didn't have an AMD video card.
However, when running gpu-manager, it said

Is amdgpu blacklisted? no
Is amdgpu loaded? yes

This got me somewhat confused so I get checked lspci output again, and sure enough:

01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Polaris12 (rev c3)

So yeah, I guess my graphics processing is still done by Intel HD Graphics, but the device that actually handles displaying those graphics is apparently made by AMD. This also explains why the issue was still present when booting in emergency mode: you're not loading your video card drivers, but you are using your display controller (and hence also its drivers).


Upgrade failed and stuck due to corrupted libc install

The problem was that I somehow accidentally set the server to use a very old kernel, even though more recent ones were installed. The solution was to reboot, and at the Grub boot screen, ensure the most recent kernel was selected, which for me was 3.13.

That allowed me to complete the upgrade by fixing the install of libc6 and running all other upgrades, including the installation of the standard Xenial kernel package, which got me to a 4.4 kernel.


The 'Export to Picasa Web' service will upload photos to Google+ Photos.

Once you enter your login details, when choosing to upload, you'll see your Google+ photo folders in the Album drop down.

Creating new albums works too.


The error is not Skype-related -- it has to do with Google Chrome. The 32-bit version of Chrome is no longer supported by Google and has been removed, thus you see an error accessing that repo.

This means Chrome no longer receives important security updates, and you should consider switching browsers (or using a 64-bit OS).

Edit: see this answer for more detailed info.


How can I dual boot Ubuntu and Windows 7 if I didn't create logical partitions?

There's no way to convert a partition from primary to logical while keeping the data, as far as I'm aware. So the question boils down to "how do I back up the data from a partition so I can restore it later to another partition and make Ubuntu to boot from that partition".

You'll need an Ubuntu LiveCD/USB and enough space on the Windows partition or somewhere else to store the backup of data. Boot from the LiveCD and mount both the Ubuntu partition and the partition where you're going to store the backup. Then make a backup with something like

sudo tar zcfv /media/my_backup_partition/myubuntu.tar.gz /media/Ubuntu

(the reason we need to use tar (and sudo) is to preserve permissions. If the backup partition supports Linux permissions you can just copy the files to a directory there)

Then you remove the partition, create an extended partition and logical partitions inside it. Mount the new Ubuntu partition and extract the backup:

sudo tar zxfv /media/my_backup_partition/myubuntu.tar.gz /media/new_ubuntu_partition

Then I think you'll need to edit etc/fstab on the new partition to account for the new filesystem UUID and device name (it'll likely be sda5 instead of sda1..4) or, alternatively, to use tune2fs to change the UUID to match the old one.

Then you'll need to re-install GRUB.

The point is - the whole Ubuntu install is just a bunch of files, you can do with them whatever you can do with files, there's nothing magical about them.


Is aircrack-ng compatible with Intel pro/wireless 3945abg

Yes, the intel 3945 card uses the iwl3945 driver that is included into kernel and it supports packet injection and monitoring mode that is used by aircrack-ng.

If you (somehow) don't have that driver installed run sudo apt-get install --reinstall linux-firmware


How To APT Install Newer Thunderbird Version & Have Launch Button For All Users

Here's one way:

Spin up a disposable container or VM. Manually install the correct version of TB.
Use the container to convert your Windows TB files to Linux.
Migrate your new Linux TB files onto your real system, which uses a different (apt- or Snap-packaged) version of TB with Gnome-shell compatibility baked in.


Unable to deploy Instance after finishing installation OpenStack on single node

I've fixed the problem by connecting to the Computing Module and:

Adding the following line at /etc/nova/nova.conf:

libvirt_type=qemu

And performing a restart of the Nova VM.

HTH


kernel panic error installing ubuntu 16.04 server in virtualbox 5.1.22 on windows 7

Is this the first time you've tried to run a VM on this machine?  My shot-in-the dark guess is that you haven't enabled the necessary BIOS settings on the host machine to allow VMs - or you have Hyper-V installed (which is sometimes installed along with other developer tools - like Docker or Visual Studio).  See this post: https://forums.virtualbox.org/viewtopic.php?f=6&t=57464

00:00:04.465388 HWACCM: No VT-x or AMD-V CPU extension found. Reason VERR_VMX_MSR_LOCKED_OR_DISABLED

  You need to make sure that you have enabled hardware virtualization in you bios.
  Also make sure you do not have Hyper-V installed on the host. If yo do you need to disable it.

I believe they found the above error message by checking the VBox.log file.
 http://www.virtualbox.org/manual/ch12.html#collect-debug-info

  Every time VirtualBox starts up a VM, a so-called "release log file" is created containing lots of information about the VM configuration and runtime events.
  The log file is called VBox.log and resides in the VM log file folder. Typically this will be a directory like this:

  $HOME/VirtualBox VMs/{machinename}/Logs

Checking the contents of that file will hopefully provide more information to point you in the right direction.


Why would Ubuntu treat NXDOMAIN as resolving to localhost?

It's DNS. The search domain setting is causing this:

$ cat /etc/resolv.conf
nameserver 127.0.0.53
options edns0
search localhost

A router tricked Ubuntu into expanding names with a search domain that receives special treatment from systemd-resolved and as such breaks expected behavior:

  The hostnames "localhost" and "localhost.localdomain" (as well as any hostname ending in ".localhost" or ".localhost.localdomain") are resolved to the IP addresses 127.0.0.1 and ::1.

Solution A: Reconfigure the router to send a more appropriate search domain

Solution B: disable automatic DNS configuration, e.g. in NetworkManager you can disable it just for either Ipv4 or IPv6 if the issue is limited to one. The corresponding option in the text config format is ignore-auto-dns.

# /etc/NetworkManager/system-connections/WLAN
# ..
[ipv6]
ignore-auto-dns=true
# ..

Not a solution: edit /etc/dhcp/dhclient.conf (this configuration cannot supersede IPv6 Router Advertisment DNSSL)


In TeamViewer 10 there is a option licence, with which you can accept the EULA.

$teamviewer license accept

You may need to restart teamviewer daemon with $teamviewer daemon restart.


In AcetoneISO with Lubuntu I get error: no xorrisfs found in /usr/bin

Open a terminal,Press Ctrl+Alt+T

Run it:

sudo -i
apt-get update
apt-get install xorriso libisoburn1 libjte1

And try acetoniso


apt-get update only for a specific repository

yes, apt-get can do that, and can do it in a nice way.

Append following to ~/.bash_funcs

update-repo() {
    for source in "$@"; do
        sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/${source}" \
        -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
    done
}

Append following to ~/.bashrc

if [ -f $HOME/.bash_funcs ]; then
.  $HOME/.bash_funcs
fi

Append following to ~/.bash_completion

# Debian user-defined completion                             -*- shell-script -*-

_ppa_lists(){
    local cur
    _init_completion || return

    COMPREPLY=( $( find /etc/apt/sources.list.d/ -name "*$cur*.list" \
-exec basename {} \; 2> /dev/null ) )
    return 0
} &&
complete -F _ppa_lists update-repo

Then source the files

. ~/.bashrc
. ~/.bash_completion

Done and start to fire it

update-repo <tab> <tab>

You can update a single ppa repository without having to update whole apt source, with implement of bash-completion.


Dual boot Windows8 and Ubuntu10.10 using 2 separate hard drives?

I have installed Windows 8 together with Ubuntu 11.10 on one hard drive in my laptop and it works fine, just as it did before with Windows 7.

My drive is partitioned like this:

Partition 1: Swap
Partition 2: Ubuntu
Partition 3: Home
Partition 4: Windows

This layout has already 4 primary partitions, so the Windows installer can't do its default 2 partition install. That default 2 partition installation of Windows might be why you can't setup a proper chainloader entry in grub for Windows easily. This has been an issue at least since Windows 7 I think. I remember that there is a workaround which involves copying some files from  Windows' boot partition to the root of the Windows partition or the boot folder, but you should instead reinstall Windows with only one partition. I just had to reinstall grub afterwards from the live CD with the following commands:

sudo mount $Ubuntu_Partition /mnt/
sudo grub-install --root-directory=/mnt/ /dev/sdX
sudo update-grub

$Ubuntu_Partition is your Ubuntu partition. If you have a boot partition you need to mount that too (to /mnt/boot).
sdX is the harddrive where Ubutntu is installed on. Use commands like fdisk -l to find out where Ubuntu is installed.

Back in Ubuntu run sudo update-grub again OS prober should have found something like "Windows Recovery Environment". That's my experience installing the Consumer Preview of Windows 8. Using a separate drive should not be any different, since the OS prober scans all attached drives, it just seems to have difficulties with the 2 partition default layout. So make sure you install Windows in one partition only.

Method 3 of the following guide might be the easiest way to achieve a one partition install:
http://www.mydigitallife.info/hack-to-remove-100-mb-system-reserved-partition-when-installing-windows-7/


Ubuntu 12.10 dual boot 2 of the same versions

you can use easyBCD to delete your old ubuntu bootloader

just download and install it
after finish open the application and go to "edit boot menu" and you
can see the bootloader exist in your pc
click your old (problem) ubuntu and delete it (make sure you delete
the right ubuntu)
save it and restart your PC

now if there is no problem your bootloader will only just 2 (your vista & your ubuntu)
Good luck


I am no  expert but I had a similar problem on my old laptop (Toshiba satellite). I found that I could connect to some net works but not others. All I did was reinstall, that seemed to work.

I have no idea if that will work but I recon it is worth a shot.


You can remove the tab space from multiple lines by selecting those lines and pressing Shift+tab. Shift+tab is used to give a reverse tab, i.e. tab in the opposite direction, so this should work almost wherever you want to reverse tab.


My distribution has no problem. The PSU had issues.

Hint for future visitors:

Make sure your PSU is from a recognized company and of excellent quality.


The command seems to be run as a script with no input, so it receives EOF at the prompt for confirmation. This causes apt-get to abort. If you can modify the script, use the -y option:

/bin/sh -c 'apt-get install -y aptitude'


cannot load kernel object file adadio.ko

Have you tried reinstalling the driver yet?
Download the adadio.tar.gz file and follow the steps from this manual, when you want to try this opportunity:
http://www.generalstandards.com/driver-manuals/adadio_linux_driver_user_manual.pdf

I have no experience with this ADADIO, but I googled this up for you. Hopefully I can help!


Well, for those who wants to follow my path here it is. I couldn't do apt remove ubuntu-desktop since it kept saying it isn't installed so I did apt remove gnome* then apt autoremove. It removed everything related to gnome, Ubuntu is restarting/working fine.
Before removing gnome my ram was at 1.2gb idle, now it's at 0.99gb (viewd in system monitor inside kde).

I just hope when upgrading ubuntu to 20 LTS it doesn't throw gnome at me again.


eBay mobile website on Ubuntu no longer supported

Try it again now. I had this issue before but for the last week or so I have been able to view ebay on both the default browser and the ebay app.


Ubuntu 18.04 Server - disable, uninstall, delete, erradicate ubuntu desktop!

At first change default runlevel to console login with

sudo systemctl set-default multi-user.target

and then remove desktop packages with apt-get (or aptitude):

sudo apt-get purge gdm3 lightdm ubuntu-desktop

other GNOME-related stuff may be removed with commands below (but be careful):

sudo apt-get purge $(dpkg -l | grep ^ii | grep -i GNOME | awk '{print $2}')
sudo apt-get purge $(dpkg -l | grep -i desktop | grep ^ii | awk '{print $2}')
sudo apt-get auto-remove


Now I saw your post. You can write in terminal:

echo 3 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness

Which will activate the maximum brightness of the backlights. It can take values from 0 to 3, so when you want to decrease it, you can just change the 3 with any other value within that interval.

As a long term solution you could try making your own script with that piece of code and attribute it to specific key combinations by accessing your Keyboard->Application Shortcuts menu and setting there to run the script.

Have a nice day!


can't download and install updates on ubuntu 14.04.1 lts

You may want to try,

sudo apt-get dist-upgrade

and see what happens. It can be a quick fix sometimes.


How to update Ubuntu 14.04 to 16.04 without graphic card (nVidia) problems?

If you fear that your drivers will cause problems during your upgrade, I would consider:

Removing the nvidia proprietary drivers.
Upgrading your distro.
Installing the nvidia proprietary drivers.

If this yet again fails, you can get into your installation through recovery or using nomodeset during your bootup and removing the nvidia drivers and look for a solution.

Please let me know how you get on.


Online accounts in Ubuntu 12.10 not connecting

I am not sure what your specific problem is, it may be similar to mine or different.
I was able to fix my connection issues by removing all accounts (Ubuntu Online Accounts in Settings) , then signing out of all accounts (in all browsers) . After that I restarted the computer, and set everything up from scratch.
Then it worked again.

Hope this helps and will fix your problem.
If not, maybe someone else has a better suggestion.


Where can I get the 'Ubuntu Monospace' font?

Ubuntu Monospace comes preinstalled with Ubuntu 11.10 and it is the default terminal font.

If you want to install it on non-Ubuntu or pre-11.10 machines, download it from font.ubuntu.com!


I've created a new file in /etc/apt/apt.conf.d/, named 01proxy:

Acquire::http { Proxy "http://apt-proxy:3142"; };

where apt-proxy is the hostname of the proxy server. Been using this since 9.04, and It Works without any issues.


Can someone help me get Ubuntu touch on my Huawei Ascend y300?

Do you mean "Huawei Ascend G300"?

If so you might want to check this out: → https://wiki.ubuntu.com/Touch/Devices/u8815 .

If you do mean the "Y300" it still may give you some insight...

Hope this helps... Good Luck!


Can't locate installed software in Ubuntu 14.04

Padre itself is located in /usr/bin/padre however the *.desktop file is in /usr/share/perl5/auto/share/dist/Padre/padre.desktop . You can run the padre command in terminal  and pin the editor to the launcher once it comes up


How to filter data from txt using grep or sed?

Here's a couple of options.

KISS approach using two greps:

$ grep 'Auctions were started for' file | grep -o '\S*\.com'
wantit1.com
wantit2.com
wantit3.com
wantit4.com
sidefun.com
coffeetec.com
lifeout.com
new-fun-boys.com

More elegant:

$ perl -lne 'if (/"Auctions were started for (.*)"/) {print for split(/, | and /, $1)}' file
wantit1.com
wantit2.com
wantit3.com
wantit4.com
sidefun.com
coffeetec.com
lifeout.com
new-fun-boys.com


How to Run Windows 07 in Ubuntu using chroot?

You can't with chroot, in order to run Windows on Linux you would need to run a virtual machine using software like VirtualBox.  Please see Install windows 7 through virtual box


Can't connect to site hosted on Ubuntu Server VM

On the VM run:

sudo dhclient

That should make it run out and grab a fresh IP from the router.

I can't say why this has happened. Never had it happen to me.


Make that 28GB as extended(logical) partition you can't have 4 primary partitions. You already have System,C,HP tools as primary partitions so if you create 24GB primary you cannot create a swap partition. So make 28GB unallocated to extended partition and split it into 24 and 4 GB partitions and install ubuntu.

You cannot create a partition inside a primary partition, the partition should be converted into extended(logical) then split into partitions and all the split partitions will be logical partitions.

Also you can create swap partition anywhere you like.

I hope this helps


Package 'vim' has no installation candidate

The same problem occurred with me when I was trying yo install vim on my ubuntu 12.04.
I tried the following and it worked for me: -
sudo apt-get update
and after that
sudo apt-get install vim
After running these commands, it started working correctly.


Try to open a TTY by using Ctrl+Alt+F1 and login with your username and password. Restart LightDM by typing:

  sudo service lightdm restart

You should get in the login screen, where you have to choose Unity. When logged in with Unity session, you can use the terminal or return to the tty and delete the package by using:

  sudo apt-get remove --purge cairo-dock


I managed to fix the problem following heynnema's comment. The solution was to install gnome-nettool package.


Customize ubuntu (change logo and startup app)

If I understood your question correctly, you want to use Ubuntu in "kiosk" mode, where it boots straight to one single application.

This tutorial assumes that you want to use Chrome for the app, but you can easily adapt it to use your app instead.

  This tutorial assumes you’re starting with an Ubuntu desktop, all
  installed with working network and graphics. While we’re in
  graphical-land, you might as well go and install Chrome.

  I have tested this in a clean 14.04 install but be careful. Back up
  any important data before you commit.

sudo apt update
sudo apt install --no-install-recommends openbox pulseaudio
sudo usermod -a -G audio $USER

sudo install -b -m 755 /dev/stdin /opt/kiosk.sh << EOF
#!/bin/bash

xset -dpms
xset s off
openbox-session &
start-pulseaudio-x11

while true; do
    rm -rf ~/.{config,cache}/google-chrome/
    google-chrome --kiosk --no-first-run  'http://thepcspy.com'
done
EOF

sudo install -b -m 644 /dev/stdin /etc/init/kiosk.conf << EOF
start on (filesystem and stopped udevtrigger)
stop on runlevel [06]

emits starting-x
respawn

exec sudo -u $USER startx /etc/X11/Xsession /opt/kiosk.sh --
EOF

sudo dpkg-reconfigure x11-common  # select Anybody

echo manual | sudo tee /etc/init/lightdm.override  # disable desktop

sudo reboot

  This should boot you into a browser looking at my home page (use
  sudoedit /opt/kiosk.sh to change that), but broadly speaking, we’re
  done.

  If you ever need to get back into the desktop should be able to
  Control+Alt+F1 to get to a terminal, log in and then run:

  sudo stop kiosk  # if it's running sudo start lightdm
  If you run both
  at the same time (which should be possible but some people seem to be
  struggling), lightdm will probably start on VT8 (Control+Alt+F8 to
  switch).

Source: https://thepcspy.com/read/converting-ubuntu-desktop-to-kiosk/


Of course you can =) Actually trying Ubuntu in a virtualized environment is more than encouraged =)

Resources:

Info on how to install Ubuntu in VMware Player
Info on how to install Ubuntu in VMware Workstation (a little bit outdated)
A blog post with info on how to install Ubuntu 11.04 on VMware workstation 7


Where to find all the power saving options Windows 10 provides?

I'm afraid the developers don't want to create any utility for Ubuntu. However, you can find some tips to improve the battery life for instance this one How to improve battery life on Samsung 13.3” Series 7 Ultra (NP730U3E-S01AU)?


Install nvidia proprietary drivers 17.10 on laptop

Here is a useful link to install Nvidia drivers. I hope it helps:
http://www.linuxandubuntu.com/home/how-to-install-latest-nvidia-drivers-in-linux

It worked well for me. You can also check which driver you need for the card using

sudo ubuntu-drivers devices


vsftpd can't start with command allow_writeable_chroot=YES

It seems that you are using 12.04 LTS. You need to install vsftpd from The Frontier Group PPA:

  PPA description
  vsftpd 2.3.5 with the allow_writeable_chroot feature backported from
  vsftpd 3.

sudo add-apt-repository ppa:thefrontiergroup/vsftpd
sudo apt-get update
sudo apt-get install vsftpd


GitKraken Gtk-Message: Failed to load module "canberra-gtk-module"

As far I can understand - the messages about Canberra are just a warning.

And real problem caused by missed snapctl executable (last line of your console output).
This executable is provided by snapd package.

You can install it with:

sudo apt-get install snapd


Look in...
/lib/firmware/brcm

...and...
/usr/lib/firmware/brcm

Here are the commands I used, in case you need to adapt them to suit your needs.
cd /lib
sudo find . -name "*.hcd"
./firmware/brcm/BCM-0a5c-6410.hcd
./firmware/brcm/BCM-0bb4-0306.hcd

cd /usr
sudo find . -name "*.hcd"
./lib/firmware/brcm/BCM-0a5c-6410.hcd
./lib/firmware/brcm/BCM-0bb4-0306.hcd

In the past, I've had success placing the module in /lib/firmware/brcm, but it wouldn't hurt to also replace it in the /usr/lib/firmware/brcm as well, if you find it there. (Keep an eye out for sim-links to the module in these directories).
Regarding the second part of your question, I think you need to use the modprobe command after placing the file in the correct location and renaming it.

Remove the current Bluetooth module from the kernel (if it is loaded).
sudo modprobe -r btusb

Load the new/updated Bluetooth module into the kernel.
sudo modprobe btusb

I believe the kernel will automatically load the module subsequent reboots.


Just go on the download page again and just hit "Not now, take me to the download ›" when you are asked if you want to make a donation. :)

See the image bottom left for the link (http://www.ubuntu.com/download/desktop/questions?distro=desktop&bits=64&release=lts):

Alternatives

You can try the official BitTorrent seeds or use Zsync (for Windows). But using a download manager that can continue aborted downloads would be the easiest option.


Install AirDroid on your phone instead.

  With AirDroid, you can remotely access your phone or tablet‘s files,
  notifications, messages, camera, location and many other things on a
  computer, from anywhere.

  Works on Windows, Mac, Chromebook and Linux.

It will give you more or less the same functionality as a PC suite.


How to make the clock sync automatically after suspension of a Virtual Machine

I believe this is a function of the open-vm-tools package. On the guest VM:

sudo apt-get install open-vm-tools


How to run an infinite-loop with an if-else statment while the system is on

It is becoming more and more unclear what it is you actually want with the little information you have provided, there is no need to start a daemon if you just want a while true in a bash loop.

For here are two examples that should work just fine.

while :
do
  # loop infinitely
done

or

while true
do
   # loop infinitely
done


syslog: Failed start mount ZFS filesystems

That isn't a kernel message, that is a message from a systemd service that mounts ZFS file systems. Something like the following should stop it trying to do that:
systemctl disable zfs-mount
systemctl disable zfs-import-cache

Or you could just leave it as is, the message doesn't indicate an actual problem.


1)Since 2018 MikTeX offers also a version for Linux:
https://miktex.org/download

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D6BC243565B2087BC3F897C9277A7293F59E4889
echo "deb http://miktex.org/download/ubuntu bionic universe" | sudo tee /etc/apt/sources.list.d/miktex.list # Ubuntu 18.04 LTS (Bionic Beaver)
echo "deb http://miktex.org/download/ubuntu xenial universe" | sudo tee /etc/apt/sources.list.d/miktex.list # Ubuntu 16.04 LTS (Xenial Xerus)
sudo apt-get update
sudo apt-get install miktex
miktexsetup finish # for a private (for you only) TeX installation
# sudo miktexsetup --shared=yes finish # for a shared (system-wide) TeX installation
initexmf --set-config-value [MPM]AutoInstall=1 # if private (for enabling Autodownload)
# sudo initexmf --admin --set-config-value [MPM]AutoInstall=1 # if shared (for enabling Autodownload)

2) But on Linux I would recommend texlive:

  sudo apt-get install texlive

(there are several different commands, because some download just the minimal version texlive-base and if needed the texlive download more packages, others prefer initally to download the full verison texlive-full)

3) Theoretically you could use Wine (Windows for Linux), but I would not recommed it: https://tex.stackexchange.com/questions/415287/texniccenter-in-wine-on-linux


How can I find whether I am a sudo user or not

It's just your regular password.

The password to run commands with sudo is your password, not a separate password. It is the same password that:

you came up with and typed in when you installed Ubuntu or created your account
you type in on the login screen (unless you have automatic login)
you type in to unlock the screen

When you're asked for your password in a terminal, it is normal that nothing is shown while you are typing it. To enter your password for the sudo command, type it in and press Enter.

If you enter your password correctly and you are an administrator--which on Ubuntu means a user who is allowed to perform actions as the root user through sudo and polkit--then the command will run. (Non-administrators can be permitted to run certain commands with sudo too, but this is not set up by default.)
If you enter your password correctly but you are not an administrator and aren't allowed to run the command as root with sudo, you'll get an error:

username is not in the sudoers file.  This incident will be reported.

("Reported" just means written to a log file. Attempting to run a command with sudo on your own computer that your user account isn't set up to be allowed to run is harmless, and the scary "This incident will be reported" thing can be ignored.)

To see if you're set up to sudo to root, check if you're in the sudo group.

Another way to find out if your user account is an administrator and allowed to run commands as root with sudo is to check if it's a member of the sudo group. To list all the groups you're in, run:

groups

Users are usually in their own group (named the same as their username) and several other groups. If you're an administrator the output of groups will look something like:

username adm cdrom sudo dip plugdev lpadmin sambashare

If you're not an administrator it will look something like this (i.e., it will not contain sudo):

username adm cdrom dip plugdev lpadmin sambashare

If you only have one user account and it's been removed from the sudo group, see How do I add myself back as a sudo user? This is not a very common situation, though.

For more detailed information, you can ask sudo about your abilities.

A third way to find out if you're an administrator is to run sudo -l. You'll have to enter your password. Then:

Non-administrators who aren't set up to run any commands with sudo will see the message

Sorry, user username may not run sudo on host.

where username is your username and host is the hostname (computer name) of your Ubuntu system.
Administrators (i.e., members of the sudo group) will see some information ending in the lines:

User username may run the following commands on host:
(ALL : ALL) ALL
Users who are set up to run some commands as root but not all commands will see output documenting their abilities. (See man 5 sudoers for technical details.)

Further Reading

RootSudo (in the Ubuntu help wiki -- I highly recommend reading this, to understand sudo in Ubuntu)
The manpage for sudo, which you can read by running the command man sudo, or online.
sudo and Superuser on Wikipedia
Ask Ubuntu's tag wiki for sudo
How to NOT become a root user? Are administrators root?
How to know whether am the administrator of my Ubuntu?
How can I add a new user as sudoer using the command line?


docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~)

containerd and containerd.io are 2 different packages.
Try dpkg -l containerd* and you should see both packages.
$ dpkg -l containerd*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Architecture Description
+++-==============-==============-============-======================================
ii  containerd     1.3.3-0ubuntu2 amd64        daemon to control runC
rc  containerd.io  1.2.13-2       amd64        An open and reliable container runtime
$

If containerd not there, go ahead and install it with sudo apt install containerd.
Let me know if this helps.


Ip camera direct ethernet connection to lubuntu, while wifi internet

Ok, thanks for your responses. The issue I was running into was that I was trying to set the ethernet address using the gui interface and network manager, but in Ubuntu/lubuntu 18.04, you now have to use Netplan to configure networks. Once I followed these instructions, How to setup a static IP on Ubuntu Server 18.04, it took a minute to set it up and have the udoo recognize the connection.


After rotating the screen to clockwise (portrait mode), the mouse, touch screen calibration is lost

If the calibration goes wrong also after reboot, I would say this looks like a bug.
I sometimes have problems with my mouse pointer when changing video modes, switching to terminal mode (Ctrl+Alt+F1) and back to graphical mode (Ctrl+Alt+F7) resets my mouse in those cases. Maybe this will also reset your calibration.


Virtualbox kubernetes network access internet issue

Looks like you have multiple issues here.  I suspect they also start prior to initializing your cluster, as Kubernetes can't connect to the internet to download what it needs.

destroy the current VM, and create a new one (recommend Bridged networking).
verify the VM has network connectivity.
install docker on the VM.
enable the docker service (looks like you also missed this step) with: sudo systemctl enable docker (or as appropriate for your OS)
verify the vm has network connectivity.
proceed with kubernetes installation and cluster initialization.

I suspect you also don't want your pod-network-cidr to specify the same network as your VMs, or otherwise play with the HostNetwork setting.


root-system-bin package installation for root login

No, it's a numerical analysis application. Its package description:

Description-en: Numerical data analysis framework - general applications
 The ROOT system provides a set of OO frameworks with all the
 functionality needed to handle and analyze large amounts of data
 efficiently.
 .
 With the data defined as a set of objects, specialized storage methods
 can give direct access to the separate attributes of the selected
 objects, without having to touch the bulk of the data. Included are
 histogramming methods in 1, 2 and 3 dimensions, curve fitting, function
 evaluation, minimization, graphics and visualization classes to allow the
 easy creation of an analysis system that can query and process the data
 interactively or in batch mode.
 .
 The command language, the scripting (or macro) language, and the
 programming language are all C++, thanks to the built-in CINT C++
 interpreter. This interpreter removes the time consuming compile/link
 cycle, allowing for fast prototyping of the macros, and providing a
 good environment to learn C++. If more performance is needed, the
 interactively developed macros can be compiled using a C++ compiler.
 .
 The system has been designed in such a way that it can query its
 databases in parallel on MPP machines or on clusters of workstations
 or high-end PCs. ROOT is an open system that can be dynamically
 extended by linking external libraries. This makes ROOT a premier
 platform on which to build data acquisition, simulation and data
 analysis systems.

More here: http://root.cern.ch

If you want to enable root login, you should search the site:

How to enable root login?


How do I disable unnecessary services without uninstalling them in Ubuntu 15.10?

Yes, because you are using Ubuntu 15.10, you can now use systemd to disable these unwanted services.

You have two options: disable & mask.

OPTION ONE:

When you mask a service, you prevent any user or service from starting this service by creating a symlink to /dev/null.

To mask a service:

For example to completely disable apport, run the following command:

sudo systemctl stop apport
sudo systemctl mask apport
systemctl status apport

If successful, the last command should return the following:

● apport.service
   Loaded: masked (/dev/null)
   Active: inactive (dead)

OPTION TWO:

When you disable a service, you prevent the service from loading automatically at boot time.

However, the service may still start if called by another service when disabled and you can still start the service up by explicitly calling the service.

To disable a service:

To prevent apport from starting at boot, run the following command:

sudo systemctl stop apport
sudo systemctl disable apport
systemctl status apport

Run the following command for a more complete list and use grep to narrow the results:

systemctl status -a


In a comment I pointed you to What is the thing in KDE that override my locale settings, but you let us know that the file ~/.kde/env/setlocale.sh is not present on your machine.

I still think this problem is related to Kubuntu/KDE somehow. The locale output includes the locale name en_DE.UTF-8, which does not exist, and that's the reason for the error message.

So I'd advise you to go to Kubuntu's language settings GUI. Probably you have stated English as language and Germany as country, which unfortunately leads Kubuntu to set this non-existing locale. Try for instance to change the country to Denmark, and then relogin. Hopefully that will set the locale en_DK.UTF-8 (which exists) instead.

The issue has been reported as bug #1322968.


It has to do with security and permissions on accessing your system.
And no, you have a lot more users than just your own user. There is "root", "daemon","bin", "games", "nobody", and "list".
Do a more /etc/passwd for a list of users on your system. You will see lots of lines with "/usr/sbin/nologin". That means those can not be used as a normal user with a login like your own user can. The third column is the user ID. All user IDs below 1000 are pseudo users. Your 1st sudo user (the one that installed the system) has 1000 by default.
Basically user syslog is allowed to use the /var/log/ directory that is set as a directory owned by root. To not have to compromise permissions on the directory (i.e., lower the permissions so other users can use it), this user was created.
The same is done with the user for Apache and MySQL (you will see a www-data user and group and a MySQL user and group when you install these), but it is used for loads of things. There is a group "dialout" that is used to access devices to externals. Users get added to this group to allow the user to use these devices. Otherwise you will get a permission denied error. It works two ways: denying a user access means removing that user from the group.


14.04 on Macbook Pro connecting to wireless

So I wasn't able to actually solve the problem, I just re-installed from the same install disk, re-followed the steps from link '1' in my original post and it seems to work fine now.

From user Wild Man at that link:

  Please do:

sudo apt-get update
sudo apt-get install firmware-b43-installer

  Reboot

This seemed to work fine. I think the problem arose from me using the second set of steps Wild Man posted to use without an internet connection. The above steps are meant to be followed while connected via a wired connection.


E: dpkg was interrupted... run 'sudo dpkg --configure -a'

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

This error is actually telling you exactly what is wrong: dpkg was interrupted as a result the package was not configured correctly.

Run the command it tells you to sudo dpkg --configure -a and it should be able to correct itself.

If it doesn't try running sudo apt-get install -f (to fix broken packages) and then try running sudo dpkg --configure -a again.

Just make sure you have internet access available so that you can download any dependencies.

These instructions may not work if by upgrade you meant apt-get dist-upgrade if you were trying to do a distribution upgrade (e. g. 11.10 → 12.04) then you will need to edit your question to reflect that.


I'm trying to install rails and I think I just broke my Ubuntu installation, any help?

Plan A:

Running:

sudo apt-get update

Then:

sudo apt-get install -f

Installing any unmet dependencies, and possibly then doing a restart should fix it.

Plan B:

Otherwise you should edit the file with:

sudo nano /etc/apt/sources.list.d/passenger.list

Once more and remove the line you added, then save the file and run:

sudo apt-get update

And the error should be gone (although a restart may also be necessary for the error to go away as I often find this is necessary even after the problem itself is fixed).

Plan C:

And finally if all of that failed, delete the file. As this file will be owned by root, you will need to use sudo to raise your privileges in order to delete it:

sudo rm /etc/apt/sources.list.d/passenger.list

The file should now have been removed, so run:

sudo apt-get update

And now the error should be gone.


It appears that GRUB was not installed when you installed ubuntu to your hard disk. You should be able to fix by using Boot-Repair, follow the instructions Link here>  https://help.ubuntu.com/community/Boot-Repair   After using Boot-Repair it will give you the option of which Operating system you would like to use, Ubuntu or Windows :-) Just follow directions on Link that I posted.  Be patient it might seem as tho the operation has frozen, but let it work it's Magic and you Will be HAPPY :-)    Don't forget to reboot :-)


Can't install Ubuntu, stuck on "Updates and Other Software"

https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1766978

It's to do with this bug here.

When the installer got stuck, I opened Disks and mounted/unmounted the Windows partition a few times until it got to the next screen. Had to manually set up partitions because Ubuntu didn't detect Windows but it's all installed now.


Can I redistribute a custom Ubuntu-based distro for a profit?

Any redistribution of modified versions of Ubuntu must be approved, certified or provided by Canonical if you are going to associate it with the Trademarks. Otherwise you must remove and replace the Trademarks and will need to recompile the source code to create your own binaries. This does not affect your rights under any open source licence applicable to any of the components of Ubuntu. If you need us to approve, certify or provide modified versions for redistribution you will require a licence agreement from Canonical, for which you may be required to pay. For further information, please contact us (as set out below).


I have the same problem in Ubuntu 20.04 (with kernel 5.11.12). I have something that works for me everytime I want to use the bluetooth:

Turn the bluetooth on on that setting's screen you are showing (eventhough it still says that its off, just click on the 'on' toggle on the top right corner).
While its on, run the commands you just said:

sudo rmmod btusb
sleep 1
sudo modprobe btusb

Then I can start to see all the available bluetooth devices and connect to them (I use a playstation 3 controller via bluetooth and haven't had a problem with the connection)
The downside is that everytime I turn the bluetooth off or restart the computer, I have to repeat the steps 1 and 2. I'm still looking for a more stable solution.
I also tried blueman but it didn't solve the issue.
I hope we can find a more permanent solution soon.


In the command you provided there is a space character missing between nano and the following path. Use:

sudo nano /etc/apache2/mods-enabled/dir.conf

sudo is a command that takes another command as an argument. In this case that other command should be nano however if there was no space between the two, shell would try to execute dir.conf from nano/etc/apache2/mods-enabled/ directory. As it does not exist, shell returns an error about the non-existing command.


ubuntu 14.10 multiple Simultaneous independent remote (desktop like ) connections

Here are the things worked for me.. (success using this tute  http://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04 and kudose for Charles Tassell for right directions and advice)

What I did is as follows,

(1) run sudo apt-get update && sudo apt-get upgrade

(2)run sudo apt-get install gnome-core xfce4 vnc4server

(3)then add users (vncserver/unix)

sudo adduser test1

(you will have to fill details afterwards for the user, I have added 3 users (test1, test2, test3 etc for vnc server)

(4)Then you have to switch users one by one and run vncserver and add password for vncuser login (I have three vnc users, so that i had to repeat this for all three user test 1, test2, test3)

su - test1

then run

vncserver

out put will be like this prompting for a vnc password..

You will require a password to access your desktops.

Password:
Verify:

xauth:  file /home/test1/.Xauthority does not exist
New 'server1:1 (test1)' desktop is server1:1
Creating default startup script /home/test1/.vnc/xstartup
Starting applications specified in /home/test1/.vnc/xstartup
Log file is /home/test1/.vnc/server1:1.log

(5) Important : you will have to replace /home/test1/.vnc/xstartup content with below (Else you will not get the desktop, instead you will stuck with blank screen without user interfaces or menus )

vim /home/test1/.vnc/xstartup

and add

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &

(6) startup script for the vncserver was created using "Further I will make the startup script for the vncserver like this" section of this tute

sudo vim /etc/init.d/vncserver

and add below content..

#!/bin/bash

unset VNCSERVERARGS
VNCSERVERS=""
[ -f /etc/vncserver/vncservers.conf ] && . /etc/vncserver/vncservers.conf
prog=$"VNC server"
start() {
 . /lib/lsb/init-functions
 REQ_USER=$2
 echo -n $"Starting $prog: "
 ulimit -S -c 0 >/dev/null 2>&1
 RETVAL=0
 for display in ${VNCSERVERS}
 do
 export USER="${display##*:}"
 if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then
 echo -n "${display} "
 unset BASH_ENV ENV
 DISP="${display%%:*}"
 export VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
 su ${USER} -c "cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS}"
 fi
 done
}
stop() {
 . /lib/lsb/init-functions
 REQ_USER=$2
 echo -n $"Shutting down VNCServer: "
 for display in ${VNCSERVERS}
 do
 export USER="${display##*:}"
 if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then
 echo -n "${display} "
 unset BASH_ENV ENV
 export USER="${display##*:}"
 su ${USER} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
 fi
 done
 echo -e "\n"
 echo "VNCServer Stopped"
}
case "$1" in
start)
start $@
;;
stop)
stop $@
;;
restart|reload)
stop $@
sleep 3
start $@
;;
condrestart)
if [ -f /var/lock/subsys/vncserver ]; then
stop $@
sleep 3
start $@
fi
;;
status)
status Xvnc
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac

to make it an executable run the following..

chmod +x /etc/init.d/vncserver

(7) To make vnc desktop sessions allocated for users at start up automatically, create following script in /etc/vncserver

sudo mkdir -p /etc/vncserver
sudo vim /etc/vncserver/vncservers.conf

add this in vncservers.conf (this is because i have my users as test1, test2, test3 change it according to )

VNCSERVERS="3:test3 2:test2 1:test1"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"
VNCSERVERARGS[3]="-geometry 1024x768"

(8) Then run

sudo `update-rc.d vncserver defaults 99`

(9) reboot server (you are almost done by now) step 10 and the rest is how to login part

(10)download http://www.realvnc.com/download/viewer/

enter servername/ipaddress and session id
for example my server is 172.16.70.17 and if i use 172.16.70.17:2 it will login to test2 user desktop.. and 172.16.70.17:3 will login to test3 user desktop like wise

make sure encryption to be selected "Prefer off"

Then you can access your desktop and applications in this manner..


Openstack fails to install, caused by JUJU

Autopilot is not ready for Juju 2.0 and MAAS 2.0 until Juju is out of beta. If you would like to try Autopilot please use Trusty (14.04) and our 'openstack-install' application.


how to install driver for atheros ar8161 in ubuntu 11.10

Go to system settings > Aditional drivers. This is a utility that helps you find available open source drivers for your installed hardware. This may help.


External monitor support for Sandy Bridge integrated graphics

There should be no error with the intel cpu built-in card, but if you wish to use the nVidia instead, use "bbswitch" and if your graphic card is optimus, you should use "bumblebee" too


I used to have similar issue. At some moment I found out that my touchpad wasn't working. I tried toggle it on/off, reboot, update. Running cat /proc/bus/input/devices showed no touchpad devices.

After a while accidentally I toggled touchpad to enabled (Fn + Fx) on the lock screen after reboot and it started working.

I'm not sure what it was, but you can try it. Now running cat /proc/bus/input/devices shows my touchpad.


How to insert "tab" character in Qt Creator

How the tab key is handled in C++ code is configured in the settings for C++ (Tools>Options>C++). I can not check the exact place right now, but there is box with different options on how to handle tabs in there.

You can have tab indent the line whenever it is pressed or do not use it to indent at all or have it indent only when hit in the leading whitespace of a line.


Will the 12.04.1 ISO appear on the Ubuntu website?

The website has been updated to show you are downloading the 12.04.1 ISO (see red box below):

The ISOs, torrents, etc. are all are explicitly named ubuntu-12.04.1-..., if you wish to confirm that you are downloading 12.04.1:

Remember that anything named 12.04 is 12.04, not 12.04.1!


Try the widget called Event Calendar link.

For installation and setup, refer to its github page

It does the job


How can I copy the content of a text file and paste it to another starting at a certain line?

The easiest tool here might be sed. To insert b.txt into a.txt after the 5th line , you could write:

sed '5r b.txt' a.txt

sed reads the file specifiied as argument (a.txt) line by line. All lines get reproduced in the output just as they appeared in the input, unless they get altered by a command.

The 5 is an address (line number) at which the following command shall be executed. The command we use is r, which takes a file name as argument (here b.txt), reads it completely and inserts it into the output after the current line.

As it stands above, this sed command line will only print the output to the terminal, without writing to any files. You can either redirect it to a new file (not any of the input files!) using Bash's output redirection:

sed '5r b.txt' a.txt > c.txt

Or you can directly modify the outer input file a.txt by using sed's -i (for "in-place") switch. If you write it as -i.bak, it will make a backup copy of the original input file with the suffix .bak first:

sed -i '5r b.txt' a.txt

An example:

$ cat a.txt
January
February
March
April
May
October
November
December

$ cat b.txt
June
July
August
September

$ sed '5r b.txt' a.txt
January
February
March
April
May
June
July
August
September
October
November
December


Gparted resize of an extended partition  fails with error "can't have overlapping partitions".

The last post of this thread http://ubuntuforums.org/showthread.php?t=1980664 solved the problem for me.

  When looking at the dialog box for "resize/move dev/sda2" there is an option to change the alignment from MiB to Cylinder - click to change it and... Voilà! To resize my sda1 (windows), I had to switch back to MiB.


How do I reset my installation of Ubuntu on Windows?

You can reset Ubuntu from settings, just find it in the start menu, right-click to go to App settings, then press the reset button.


Is there a way to recover a file that I have deleted but is still open somewhere?

I don't know whether there are any text editors which keep the file opened while you are editing it. Normally (i.e. in Emacs), the file is read into a buffer in RAM and then the file is closed. You edit only in RAM. When you save the buffer, the file is opened, written, and closed again. You can use ps auxw | grep your_editor to find the PID of your editor, then lsof -p your_PID to see the files that are still open.

On the other hand, if the file is still in the buffer of your editor, you can just save it.

But that was not your question, so let's pretend you are using cat as your editor, and the file is really still open:

% cat >the_file.txt
Hello world!
^Z
zsh: suspended  cat > the_file.txt
% rm the_file.txt
% ls -l the_file.txt
ls: cannot access the_file.txt: No such file or directory

You can use lsof -n to see all opened files and grep to search for your filename.

% lsof -n | grep the_file.txt
cat  2145  elmicha  1w  REG  9,1  13 108003357 /home/elmicha/tmp/the_file.txt (deleted)

In the second column you can see the PID of your cat command. You can change into the corresponding directory in the /proc filesystem, and into the fd (file descriptor) subdirectory:

% cd /proc/2145/fd
% ls -l
total 0
lrwx------ 1 elmicha elmicha 64 2012-11-07 00:22 0 -> /dev/pts/4
l-wx------ 1 elmicha elmicha 64 2012-11-07 00:22 1 -> /home/elmicha/tmp/the_file.txt (deleted)
lr-x------ 1 elmicha elmicha 64 2012-11-07 00:22 15 -> /proc/4501/auxv
lrwx------ 1 elmicha elmicha 64 2012-11-07 00:22 2 -> /dev/pts/4

Now you can just copy the "file" 1 to another file:

% cp 1 ~/tmp/the_old_file.txt

And see, it's there:

% cat ~/tmp/the_old_file.txt
Hello world!


Blacked out GUIs after logging in, can't use the system properly

Here's how I managed to fix the issue:

I noticed that unity --reset fixed the issue but also froze my laptop in the process.
So I searched for workarounds related to unity and found the following fix (askubuntu.com/a/377460/937306) which I will repost here

Reset compiz settings:
dconf reset -f /org/compiz/

Then restart Unity:
setsid unity

Using XTerm (an alternative to the Terminal which can be searched on the unity launcher dash) helped a lot. I must also mention I had nvidia driver issues which I resolved later by following How can I uninstall a nvidia driver completely ?   and   How do I install the Nvidia drivers?


What's the RGB values for Ubuntu's default terminal (Unity)?

Open the Ubuntu default terminal, right-click it's title bar and select Always On Top to keep it easily accessible for a screenshot.  Then open GIMP.  You can install GIMP by typing this into a terminal:  sudo apt install gimp
In GIMP, go to File->Create->Screenshot
Select Take a screenshot of a single window and include window decoration
Set the Delay to 2-5 seconds
Click the Snap button.
After the Delay time, your mouse pointer will become a Plus-Sign/Cross.  Click the Terminal window with this cross.
A screenshot of the window will then open up in GIMP.
You can then use the color picker tool to click on any color in the screenshot, which sets the foreground color.  You will see thee foreground color box change color as you click different colors.  You can then click on the foreground color rectangle and it will open a window with your RGB values for that color.
If you are having a hard time picking the color of the fonts, you can zoom in and out in GIMP the + and - keys, or you can do the usual CRTL+mouse-wheel up/down.

The terminal background color is:  R=48, G=10, B=36

The terminal white font is:  R=255, G=255, B=255


Is it safe to change the system python3 to point to python3.4 on Ubuntu 12.04?

If you do that

python3.4 will not find modules installed in places like /usr/lib/python3.2/. That includes all modules installed by the package manager.
modules containing binary libs compiles against Python 2.3 will likely not work without recompiling.

That means that almost all programs from the official repositories needing Python3 will stop working.


how to make ps show child processes that are listed at htop?

I found about LWP being the threads of a process, so I did this:

ps -A |grep nautilus #get the pid ex.: 3343
ps -L -p 3343 -o pid,nice,lwp,comm

-L option will show the threads!

So This will show all its threads, so you can ex. renice not only the process pid but also each thread! just use the value at LWP column as the pid to work at, like in:

renice -n 10 -p `ps -L -p 3343 -o lwp --no-headers |tr '\n' ' '`


Run the following command in a terminal:

xinput list

You will get an output that looks like this:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=12   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Sleep Button                              id=9    [slave  keyboard (3)]
    ↳ Laptop_Integrated_Webcam_1.3M             id=10   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=11   [slave  keyboard (3)]
    ↳ Dell WMI hotkeys                          id=13   [slave  keyboard (3)]

It displays all the input devices connected. Note that they all have an id.
Since 12 is the id for my touchpad, running the following command will disable it.

xinput set-prop 12 "Device Enabled" 0


What is the path and command of mounted folder when I "connect to server"?

Its unclear if you are using NFS or SSHFS they are not the same afaik.
I few hints: try using full paths instead of wildcards like ~
that can be different depending on the user the command is executed with
so use full paths like /home/username/
eg. if my username is sub on the machine called fastspace and would like
to mount my remote home directory to a local folder in my home called mnt:

cd ~ ; sshfs fastspace:/home/sub mnt/

this is for SSHFS, for NFS you need something like

mount fastspace:/home/sub /home/sub/mnt


Unable to update PHP 5.6.x release on a Ubuntu 14.04 Vagrant Box

Check your apt sources. You should have this file:

/etc/apt/sources.list.d/ondrej-php-trusty.list

If you don't, add it like this:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade

If you have any broken dependencies, check this post for more details.

If you end up following that, just note that where they suggest you use the ln -sfn command to switch php versions, you should really be using:

update-alternatives --config php


dpkg: error processing package libgl1-mesa-glx:i386 (--configure)

We can solve this issue by running the following:
dpkg --force-depends --purge libgl1-mesa-glx
sudo apt-get -f install

At this point only unity was still "broken".
Afterwards, to fix that, run:
dpkg --force-depends --purge unity
sudo apt-get -f install


Ubuntu 20.04 LTS freezing about every 10-15 seconds

yes Ubuntu 20.04 hangs freeze although I have 8 GB of Ram and i7

I could temporary fix this issue in my side, by expanding swap partition from 2 GB to 16 GB

I am not sure but I think there is problem in Ubuntu 20.04 memory management, here in my side it keep consuming memory, then when both memory and swap are full, the computer start to freeze and hang

the solution steps are:

1- check the amount of swap you have

grep SwapTotal /proc/meminfo

2-turn off the swap process

sudo swapoff -a

3-resize the swap(in my case i expand it to 16 gb)

sudo dd if=/dev/zero of=/swapfile bs=1G count=16

4- attach the swap to partition

sudo mkswap /swapfile

5- activate swap(enable it)

sudo swapon /swapfile

6- see the new swap size

grep SwapTotal /proc/meminfo

done

references

Bogdan Cornianu (thanks man)
https://bogdancornianu.com/change-swap-size-in-ubuntu/


Sudo apt-get update command is getting error

Try:

sudo rm -vf /var/lib/apt/lists/*

sudo apt-get update

or:

sudo rm /var/lib/apt/lists/* -vf

sudo apt-get update

If it still doesn't work, try to change your Download from server in Softwares and Updates of Ubuntu. May be give Main Server a try.

One reason can be a proxy blocking compression .gz files which can cause apt-get update to return the mismatch.

I hope it helps.


Monitor disk usage changes to infer download speed

Coreutils are well suited to this kind of thing. Here is a quick solution that will also save the dates and times.

$ echo -e "$(date)\t$(df | awk '$1 == "/dev/sda1" {print $2}')" > df_1
<wait a while>
$ echo -e "$(date)\t$(df | awk '$1 == "/dev/sda1" {print $2}')" > df_2
$ echo "$(( $(awk '{print $2}' FS='\t' df_2) - $(awk '{print $2}' FS='\t' df_1) )) K increase from $(awk '{print $1}' FS='\t' df_1) to $(awk '{print $1}' FS='\t' df_2)"
12 K increase from Wed Nov 20 21:22:07 EST 2013 to Wed Nov 20 21:23:13 EST 2013

I'm not sure if you need this, but to explain what it does:

Firstly, save the current date and time (date), and "used" disk space (awk '$1 == "/dev/sda1" {print $2}') into the file df_1. You might need to substitute your specific file system instead of /dev/sda1. Use df alone to get a list.
Secondly, repeat at a later date.
Finally, print out the difference between the "used" disk space $((...)), which was stored in the first field of each file, and print out the dates (from the second field).


How to run a single command multiple times while changing one word in the command each time it is run?

Use this if you want to take each line at a time from the file insert.txt as pattern to search in file.txt, this will output only the lines from file.txt that matches the line in consideration from insert.txt.

#!/bin/bash
while IFS= read -r word1; do
       grep -- "$word1" file.txt | grep "word2" | grep "word3"
done < insert.txt

Here -- is given to indicate the end of grep's options, otherwise the patterns staring with - will not work.

On the other hand, run the following if you want to use all the lines of insert.txt as pattern for searching in file.txt at once, this will match all the lines of file.txt that matches any of the lines of insert.txt:

grep -Ff insert.txt file.txt | grep "word2" | grep "word3"


Here's a one-liner to do it. Open a terminal and paste this:

dconf write /org/gnome/desktop/wm/preferences/resize-with-right-button true

No need to install ccsm.


ACPI or other event for (physical) screen rotation on ThinkPad X220

I found this on the thinkpads forum. Relevant part of the script in the link:

rotation="$(xrandr -q --verbose | grep 'connected' | egrep -o  '\)
(normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')"


Holding "Backspace" deletes only one character

Go to unity-control-center keyboard and make sure keyboard repeat is enabled

or use gsettings to change value:

gsettings set org.gnome.desktop.peripherals.keyboard repeat true


Can not open text files on desktop via doubleclick

Had the same problem. On each file that is on the desktop, I removed "allow running the file as a program" After that, it worked properly. Sorry for bad English.


How to highlight active workspace switcher's workspace name?

To get gnome classic I followed something like this http://www.omgubuntu.co.uk/2011/12/how-to-make-ubuntu-11-10-look-and-feel-like-gnome-2/

OK I fixed it, I installed gnome-tweak-tool and in the themes option switched to a theme (Adwaita) that has a similar look to ambiance (which is the one I like) and with that theme the workspace highlighting works.


Basically when you delete a file ("empty the trash") the index entry to the file is deleted, but the file information is not scrubbed off the disk.  As explained in this Ubuntu wiki page:

  This is because in Unix file systems, files are indexed by a number,
  called the inode, and each inode has several attributes associated
  with it, like permissions, name, etc. When you delete a file, what
  really happens is the inode is unlinked from the filename, but if some
  other program is using the file, it still has a link open to the OS,
  and will continue to be updated. A file is not really deleted until
  all links have been removed (even then, the data is still on the disk,
  but not indexed in anyway and thus very hard to recover).


This:

cat /etc/nginx/sites-enabled/default| sed -e 's/^[ \t]*//' > /etc/nginx/sites-enabled/default

truncates the file because the > redirection is resolved first; i.e. the file is truncated before cat and sed are run (and cat reads an empty file).

Also the command strips leading spaces and tabulations.

If that's what you want, just use the in place option of sed (and to drop the useless cat):

sed -ie 's/^[ \t]*//' /etc/nginx/sites-enabled/default

If you want to remove only leading spaces, use this command instead:

sed -ie 's/^ *//' /etc/nginx/sites-enabled/default

Also it looks like you want to process only the first line.

If that's the case, prepend a 1 to the s command; i.e.:

sed -ie '1s/^[ \t]*//' /etc/nginx/sites-enabled/default

to strip leading spaces and tabulations from the first line and

sed -ie '1s/^ *//' /etc/nginx/sites-enabled/default

to remove only leading spaces from the first line.