Something is broken

Kubuntu 11.10 / KDE 4.7 / Amarok 2.4.3 - 2.5.0

I can't get the Amarok to play the CD's. And same thing seems to be with other users: http://www.kubuntuforums.net/showthread.php?56320-Playing-CDs-in-Amarok.

With the Bangarang (2.1) the CD'a play if i use the Xine Phonon backend. The Xine backend has been deprecated and removed from the Ubuntu repositories. I'm using the Xine Phonon backend from the Natty - phonon-backend-xine_4.7.0really4.4.4-0ubuntu3_i386.deb.

How i play the CD's

I'm using the cdtool.

:~$ apt-cache show cdtool

Description: text-based audio CD player and CD-ROM control commands
 cdtool contains cdplay, cdeject, cdstop, cdpause, and several other
 programs for playing audio CDs and controlling a CD-ROM drive from
 the command line and in a quick and scriptable way.
 .
 cdown reads track info and queries a CDDB database for info on
 the current CD. cdctrl is a command line utility for controlling a
 CD-ROM drive interactively and from scripts. cdir keeps track of the
 contents of different CDs using a workman-compatible database.

.

man cdtool

NAME
       cdtool - play and catalog audio CDROMs on CDROM drive(s)

SYNOPSIS
       cdeject   [-[0..9]|-d device]  [-V|-?|-h]
       cdclose   [-[0..9]|-d device]  [-V|-?|-h]
       cdir -n   [-[0..9]|-d device]  [-r|-s|-t|-V|-?|-h]
       cdinfo    [-[0..9]|-d device]  [-a|-r|-s|-t|-v|-V|-?|-h]
       cdpause   [-[0..9]|-d device]  [-V|-?|-h]
       cdplay    [-[0..9]|-d device]  [start [stop]
       cdplay    [-[0..9]|-d device]  [+|- number]
       cdplay    [-[0..9]|-d device]  [start|stop|resume|eject|close|info|dir]
       cdplay    [-[0..9]|-d device]  [-V|-?|-h]
       cdstop    [-[0..9]|-d device]  [-V|-?|-h]
       cdvolume  [-[0..9]|-d device]  [-V|-?|-h|level]
       cdshuffle [-[0..9]|-d device]  [-V|-?|-h]

DESCRIPTION
       The cdeject command ejects the current compact disc.

       The cdclose command closes the CDROM tray.

       The  cdir  command  lists information about the currently loaded audio
       compact disc.  In particular, it lists the lengths of all tracks...

That is: Alt+F2 and cdplay, cdstop, ...


Ubuntu normally allow you to easily connect to wireless networks by just clicking the name of the network you'd like to use, but most wifi cards need a proprietary driver to work. So check on the top bar if you have a notification to install additional drivers or go to the "System Settings" > "Additional Drivers" to see if you need to install a proprietary driver for your wifi card.

If new drivers have to be downloaded, you'll need a wired connection to the internet before being able to use your wireless connection.

If no drivers is needed you will be able to see a wireless icon on you top bar of your desktop, so just click on it to see the available wifi networks around you, if you can't see your network, click on "More networks" and if your network is hidden, click on "Connect to Hidden Wireless Network..." and give the information it will ask you.

This answer is an adapted transcription of the following YouTube video: http://www.youtube.com/watch?v=NJvB97cmrWk


Here is an hidden hint about openjdk-6-jre working without problem with minecraft
(see comments) :

Minecraft in jdk 1.7.0_u2 x64


Booting a Sony Vaio computer running Windows 8.1 in Ubuntu from a USB drive

To boot a Sony VAIO from a USB stick you need to:

Shut down Windows.
Insert an Ubuntu LiveUSB
Turn the laptop on using the "ASSIST" button (not the power button).

Select boot from external drive.

Then follow Ubuntu installation manuals.


Where can I find a PDF of the documentation for JUJU?

There is an amazing website for documenting JuJu which is jujucharms.com.

If you want a PDF, then you can read  this PDF.


Grab Handles by Three-Finger Tap not working after upgrade to 12.04

This is not a real answer but a workaround. Here is what i did:

reenable middle-click with synaptiks from software center
assign a keyboard-shortcut to grab handles with ccsm

Kind of disappointing though, since it worked out of the box on 11.10


Can ping the website with domain name but can't browse them , why?

I've searched many topics for this problem and I finally resolve the problem , the problem was the size of MTU packets of my Wlan card
I reduce it to 1200 ( previous size was 1500 ) with sudo ifconfig wlp2s0 mtu 1200
 command ( wlp2s0 is my wireless card) and the problem was solved


How to enable Disabled third party sources from command line after upgrade

I manage my sources manually from cli using a regular text editor like vim or nano.

The main sources.list is located here:

/etc/apt/sources.list

and most third party sources are at:

/etc/apt/sources.list.d/

you can simply use a text editor to edit and enable them (uncomment):

sudo nano /etc/apt/sources.list.d/sample-sources.list

there should be lines like:

# deb http://ppa-url.com/ubuntu trusty main

you should uncomment them (remove #):

deb http://ppa-url.com/ubuntu trusty main

then the save the edited file and run sudo apt update.


Is it safe to have no `/home` partition?

Personally, I don't have a "technical" answer to give you and I don't think that there is one (e.g. like say, separate partitions offer greater performance), but I have always been using separate partitions for my /home folder and the main reason is the one you mention: keeping my customization and settings intact after a clean install. Especially with KDE plasma, which is full of customization and personal settings, I wouldn't want to spend two days setting the environment up, every time I did a fresh install. I can see why that might be the cause of future problems, but I weigh the pros and cons and I always choose to use a separate /home. Additionally, as izx mentioned here :

  The biggest pro, in my opinion, is that you can easily install a
  newer Ubuntu version (or any Linux distro for your architecture,
  really), without losing most of your custom settings, configurations,
  downloads, etc., since such a step usually involves wiping out the
  existing system/boot partitions. You simply choose to preserve your
  /home in the partitioner during install, and you're set.
  It is also
  possible to do this with /home on your / partition, but is a little
  more complicated. It also makes resizing/migrating to a larger home
  partition easier, if you ever need more space.
  It isn't going to
  affect the speed of file access much, UNLESS you tend to have lots
  and lots of small files in your home directory. e.g., if you are a
  developer, or you have lots of sources lying around. That MAY affect
  overall file access speed on the entire partition with some
  filesystems. In that case, go for a separate /home.
  There aren't any
  risks to making a separate home partition.

Another good reason is if, for some reason, you wanted to use a different disk for your /home folder. So to wrap it up, it's more a matter of choice and what you want to do with your system. I think it's safe to say, that it's perfectly fine to leave as it is with one big partition.


Delete the parent directory (non-empty) if a specific child directory is empty

The script below will do exactly as you describe, it:

lists the folders inside a directory
Looks inside each of the folders for a folder named "Recording"

If it exists and is empty, it deletes its superior folder
if it does not exist, it also deletes its superior folder
files on the first level inside A will not be deleted.

In an image:

A
|
|--------123456
|       |
|       |----Recording
|       |----a.txt
|       |----b.txt
|
|
|--------635623
|       |----Recording
|                   |
|                   |-------a.mp3
|       |----a.txt
|       |----b.txt
|
|
|--------123456
|       |----Recording
|       |----a.txt
|       |----b.txt
|
|--------Monkey.txt

will result in:

A
|
|
|--------635623
|       |----Recording
|                   |
|                   |-------a.mp3
|       |----a.txt
|       |----b.txt
|
|
|--------Monkey.txt

The script

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

dr = sys.argv[1]

def path(*args):
    return os.path.join(*args)

for d in os.listdir(dr):
    try:
        if not os.listdir(path(dr, d, "Recording")):
            shutil.rmtree(path(dr,d))
    except FileNotFoundError:
        shutil.rmtree(path(dr,d))
    except NotADirectoryError:
        pass

To use

Copy the script into an empty file, save it as delete_empty.py
Run it with the (full!) directory (containinf your subdirs, A in your example) as argument by the command:

python3 /path/to/delete_empty.py /path/to/directory

That's it.

Explanation

Feeding the content of your folder "A" to the script,

os.listdir(dr)

will list its subdirectories (and files). Then:

if not os.listdir(path(dr, d, "Recording"))

will try to list the content of each of the (sub)folders, which will raise an error if the item is a file:

except NotADirectoryError
    pass

or if the folder "Recording" does not exist at all:

FileNotFoundError
    shutil.rmtree(path(dr,d))

If the folder "Recording" exists and is empty, the superior folder is removed:

if not os.listdir(path(dr, d, "Recording")):
    shutil.rmtree(path(dr,d))

EDIT

Additionally, as requested in comments, a version that will check for multiple subdirs (names).

In case the directory contains any of the listed (un- empty) subdirs, the directory is kept. Else it will be deleted.

To use

Copy the script into an empty file, save it as delete_empty.py
Run it with the (full!) directory (containing your subdirs, A in your example) and the names of subdirs as arguments by the command:

python3 /path/to/delete_empty.py /path/to/directory <subdir1> <subdir2> <subdir3>

That's it.

The script

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

dr = sys.argv[1]; matches = sys.argv[2:]

def path(*args):
    return os.path.join(*args)

for d in os.listdir(dr):
    # delete directory *unless* either one of the listed subdirs has files
    keep = False
    # check for each of the listed subdirs(names)
    for name in matches:
        try:
            if os.listdir(path(dr, d, name)):
                keep = True
                break
        except NotADirectoryError:
            # if the item is not a dir, no use for other names to check
            keep = True
            break
        except FileNotFoundError:
            # if the name (subdir) does not exist, check for the next
            pass
    if not keep:
        # if there is no reason to keep --> delete
        shutil.rmtree(path(dr,d))

Note

Please first run on a test directory to make sure it does exactly what you want.


Where to place my local website starting with the 2.4.7 version of apache2?

The apache2 version that was published when the Ubuntu 14.04 release was made is 2.4.7 and starting with this version it seems that, for security reasons, the new root directory for the server is:

/var/www/html

So, from now on, this is where you must place the files for your (local) website. You should not have this problem again with the future updates.

Anyway, if you want to change this directory with another one, you have to modify (as root) the following line from /etc/apache2/sites-available/000-default.conf file (sudo nano /etc/apache2/sites-available/000-default.conf):

DocumentRoot /var/www/html

to

DocumentRoot /path/to/another/directory

After this, for the new changes to take effect, you have to restart the apache server using the following command:

sudo service apache2 restart


Wifi keep disconnecting every 5 min on Dell Inspiron15r

That happens to me, but I don't get it often. Just click on the wifi icon at the top left side of the gray bar. Click on disconnect then connect to the desired wifi. It usually works.


Disable auto-mount of *only* Camera SDCard on USB connection

Let's say your device is /dev/sdb1. Using lsusb get the ID of your device (it will be something like 0651:1722 or whatever)

Create a script called script.sh in /lib/udev (you may have to use sudo while creating the file) and put the following lines in it:

#!/bin/bash

udisks --unmount /dev/sdb1
udisks --detach /dev/sdb

Save it and make it executable with:

  chmod +x /lib/udev/script.sh

Make a udev rule file called 100-unmount-SDcard.rules in /etc/udev/rules.d/  (again you should use sudo to create this file) and populate it with:

ACTION=="add", ATTRS{idVendor}=="<your-id>", ATTRS{idProduct}=="<your-id>", RUN+="/lib/udev/script.sh"

Save the file and run:

  sudo udevadm control --reload-rules

For more options see Prevent a specific USB device from auto-mounting


How can I find out if I am running Unity 3d or 2d?

Unity 2D is not a default in 11.04 - it will be in 11.10.  Until then, the 11.04 live CD will come with two choices - Unity 3D or Gnome 2.  If you see the "launcher-bar" on the left hand side of the screen, you are running Unity using the open-source ATI driver.

You can switch between the two types by logging out and choosing the "Session" type at the bottom of the screen.

If you wish to try Unity 2D look here.


ThinkPad T420s docking station: no sound on external speakers

The solution is to add line

options snd-hda-intel model=thinkpad

to the /etc/modprobe.d/alsa-base.conf.

After that you have to reload alsa:

killall pulseaudio
sudo alsa force-reload
pulseaudio -D

This can be applicable on other thinkpad laptops.

You can also try different models (see HdaIntelSoundHowto at help.ubuntu.com).

If this method doesn't help you can to try to debug hda-intel using HDA Analyzer.
For example for my laptop I could use:

/usr/local/bin/hda-verb /dev/snd/hwC0D0 0x01c SET_PIN_WIDGET_CONTROL 0x40

to enable sound on external speakers. But it is not very good solution since you have to do it manually each time you plug external speakers.

hda-verb program can be downloaded from ftp://ftp.suse.com/pub/people/tiwai/misc/hda-verb-0.3.tar.gz.


I have this problem as well. Sometimes the tools window is inside another screen.
Shortcut:
Ctrl + B
Try the following.

under the Windows tab click Single Window Mode
if the tools window isn't inside the main window, use the Windows tab  again and click Dockable dialogs  → Tool options.

If the tools and layer box didn't go inside your main gimp window  try toggling the Single Window Mode. This helps sometimes.


It turned out that the solution was to put the following lines in my .emacs startup file:

(autoload 'gnuserv-start "gnuserv-compat"
         "Allow this Emacs process to be a server for client   processes."
         t)
(gnuserv-start)
(setq gnuserv-frame (selected-frame))

Then 'gnuclient filename &' opens 'filename' right into the main emacs buffer. Strange that 'emacsclient' no longer works, but... there you have it.


It could also be that root:root owns your .bash_history (ROOT SHOULDN'T BE THE OWNER, YOUR USER SHOULD BE THE OWNER!), in that case you need to:
$ chown user:user .bash_history

This apparently could happen magically when you do sudo bash a lot!


GNOME 3.26 - Clicking one window brings another in the foreground (Ubuntu 17.10)

I was puzzled by the same behavior in Fedora 27 / GNOME 3.26.

I found that GNOME 3.26 introduced a new feature which implicitly groups tiled windows and raises the entire group when one receives focus:

  Tiled windows that are not complementary sizes are not in the same    T-Group
  When resizing, they join a T-Group if their borders match
  Resizing to screen borders change to maximized
  Keyboard tiling always join T-Groups
  When raising a window in a T-Group, the entire group is raised as    well

Unfortunately, this grouping behavior is implicit, and the only way to break grouping in 3.26 is:

  It is still possible to break tiled windows grouping by simply
  untiling the window with the keyboard or by grabbing and resizing or
  moving the window with the cursor.

However, this means you have to give up the convenience of tiling if you don't want windows to be grouped.

This new feature is an annoyance for my workflow as well, at least there is a todo item listed on the feature page that is slated for GNOME 3.28:

  Implement explicit group activation

-- UPDATE --

Per this comment in GNOME's bugzilla it appears that this behavior will be reverted in the next stable release.


Gradle using terminal with Android Studio install on Ubuntu 12.04

This worked for me...

In .bashrc, I have

export PATH=${PATH}:~/.gradle/wrapper/dists/gradle-2.1-all/27drb4udbjf4k88eh2ffdc0n55/gradle-2.1/bin

Restart terminal, then test which gradle


Well as I guessed you formatted the Hard drive as FAT, which in fact does not allow you file sizes above 4 GB, so either you chop up the data you want to archive, or format it to something more suitable.

If you not need to access this HDD on a Windows machine you could simply go for formatting the drive as ext4 (Linux format). Gparted allows you to do this with ease.

As well what could be the cause of errors are typos. so make sure you recheck the paths you typed in.

If you need indeed to access this drive in a Windows machine you can use exFAT or ntfs. For mounting it then in Linux you need to install exfat-fuse and ntfs-3g by:

sudo apt-get install exfat* ntfs*

Then you should be able to use bigger file sizes and still mount your drive onto your server.

So to mount use the usual you would use with a FAT drive. The sdX should match your actual drive letters.

sudo mkdir -p /mnt/external
sudo mount /dev/sdX /mnt/external

If that really does not suffice then explicitly define the file-system

sudo mount -t ntfs /dev/sdX /mnt/external


Applications stop responding 5 minutes after starting desktop session on Ubuntu 16.04

To solve my problem, I had to install new nvidia drivers. The applications stop freezing and I can shut down normally.


Unable to boot from system or access desktop

To check/repair the file system on your Ubuntu partition...

boot to the GRUB menu
choose Advanced Options
choose Recovery mode
choose Root access
at the # prompt, type sudo fsck -f /dev/mapper/mint--vg-root or sudo fsck -f /
repeat the fsck command if there were errors
type reboot

If for some reason you can't do the above...

boot to a Ubuntu Live DVD/USB
start gparted and determine which /dev/sdaX is your Ubuntu EXT4 partition
quit gparted
open a terminal window
type sudo fsck -f /dev/mapper/mint--vg-root or sudo fsck -f /dev/sdaX # replacing X with the number you found earlier
repeat the fsck command if there were errors
type reboot


Ubuntu 19.04 stuck at boot after installing legacy nvidia 340 driver

Well. Found a temporary fix.  I turn on my laptop and after the bios screen and before Ubuntu logo. I kept pressing [ ESC ] multiple times  until it shows me Ubuntu logo and splash screen. Then quickly press [ ALT + F2 and then F1 quickly ] it will work


Bluetooth problems on 13.04 (dont see bt-devices)

Regarding your output:

Your first command shows that the bluetooth daemon is running. (bluetooth start/running) If you want to relaunch the daemon in verbose mode first stop the running daemon (sudo service bluetooth stop) then try to launch the daemon with root privileges (sudo bluetoothd -d -n) because the D-bus policy (/etc/dbus-1/system.d/bluetooth.conf) only allows for the root to own the service. (So update your output appropriately.)

But it is likely that if there is a problem with the daemon it would be logged in one of the /var/log/syslog files.

Regarding the problem ( I cant get it to see (or be seen by) other devices):

Did you allow visibility in your devices? Like here.


How can I configure SMPlayer to work with my keyboard media keys?

You may need to disable the multimedia shortcuts in the Ubuntu settings. Otherwise SMPlayer won't receive the press events for those keys.


Trying to install wine on 14.04, have tried removing all wine related but still no joy

First try setting the architecture:

dpkg --add-architecture

Then purge and add the ppa again.

sudo apt-get install ppa-purge && sudo add-apt-repository ppa:ubuntu-wine/ppa && sudo apt-get update

And now try installing the dependency

sudo apt-get install wine1.7

For more information, please visit Configuring Architecture.

Hope it helps.


dpkg: error processing package samba-libs:amd64 (--configure)

This is a known bug and is being worked on. Add yourself to the affected users list on this page:

https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1581679


Why do I have to boot into Windows 10 and restart before Ubuntu will boot?

Disable Fast Startup. If it's enabled, your computer doesn't fully shut down. Instead, it logs you out and then goes into hibernation. Restarts aren't affected by it so Ubuntu boots successfully.


apt gives “Unstable CLI Interface” warning

apt is for the terminal and gives beautiful output while apt-get and apt-cache are for scripts and give stable, parsable output. The script equivalent of your apt show command therefore is:
apt-cache show $PACKAGE_NAME >pack_info.txt

Now to answer your questions one by one:

What do we exactly mean by Stable CLI Interface?

apt's output is not well usable in scripts. For example, apt install (compared to apt-get install) displays a progress bar that's useless for scripts and can throw errors when the output is parsed. apt show firefox shows a hint for an additional record, which is also totally useless in a script, you want it to simply output every record there – that's what apt-cache show firefox does. Let's see what man apt has to say about that:

The apt(8) commandline is designed as an end-user tool and it may
change behavior between versions. While it
tries not to break backward compatibility this is not guaranteed either if a change seems beneficial for
interactive use.
All features of apt(8) are available in dedicated APT tools like apt-get(8) and apt-cache(8) as well.  apt(8)
just changes the default value of some options (see apt.conf(5) and specifically the Binary scope). So you
should prefer using these commands (potentially with some additional options enabled) in your scripts as they
keep backward compatibility as much as possible.

How to safely and error-free use such commands in scripts?

Just use apt-get or apt-cache respectively instead of plain apt. :) See this answer for a list of equivalents.

Is there a way to only and only redirect STDOUT of apt show to a file?

You did that correctly already: >file or 1>file redirects stdout, 2>file redirects stderr and &>file redirects both to file.


Can't login to Ubuntu 16.04 after upgrade

I was in the same situation as you.

I did not reinstall nvidia drivers but remove it.

sudo apt-get purge nvidia*

And it worked.


What does the error "r8188eu not depends mac80211" mean?

This is likely due to the fact that you need a specially patched version of hostapd to run with rtl8188eu driver.

You can use the one at https://github.com/lwfinger/rtl8188eu

sudo apt-get remove hostapd
sudo apt-get install git
cd /tmp
git clone git@github.com:lwfinger/rtl8188eu.git
cd rtl8188eu/hostapd-0.8/hostapd
cp defconfig .config
make
sudo make install

If it still doesn't work, you need to add the following line in /etc/hostapd.conf or /etc/hostapd/hostapd.conf

driver=rtl871xdrv


You don't configure timezones on the server itself. To quote the answer from the question you linked:

  The setting for timezone is related to the user's login profile

The screenshot you posted shows various account profiles and settings. Your user profile accessible by clicking your user name in the top right (just beside logout). Timezone and API keys are configured there.


How do I get drivers for a WD MyBook Essential to make it run on Ubuntu(12.10)

Out of the box .. this device is intended for use on Windows (most variants). There are also instructions for use with Mac ('re-format drive'):

Western Digital > MyBook Essential > User Manual

It has a feature (Virtual CD) that allows Windows to (auto) load drivers and utilities, to add to the "Windows experience". These are potentially a nuisance, unless you are only using the drive with Windows PCs.

Instructions to remove 'VCD', etc. (from vendor's website)

How to remove (disable / hide) the Virtual CD (VCD) for Windows or Mac OSX on a WD My Book or WD My Passport

Note: These instructions need to be run on Windows or Mac, and will not run on (Ubuntu) Linux.

Possible alternative: (for the adventurous ..)

Removing SmartWare from Western Digital My Book Essential USB Hard Drive


Touchpad enable/disable problem in 16.04

This looks like a xorg-synaptics glitch.

A way to solve it is to install libinput. It will replace synaptics

Run

sudo apt-get install xserver-xorg-input-libinput

and reboot.

You can see this Q&A for some more details.

Note: You will not be able to use GUI touchpad settings, because Ubuntu with unity DE does not fully support libinput yet. But you can use CLI for touchpad settings.

Tapping is disabled by default in libinput. You can enable it.


Maybe it is the proprietary graphics drivers are causing the problem, try to reinstall the operating system. I had the same problem and then I switched to open source graphic drivers already included in the ubuntu operating system.


Ubuntu 14.04 on VirtualBox in Windows 7 runs at 100% CPU and very slowly

These symptoms (especially inability to select more than 1 CPU) witness that Hardware Virtualization is not turned on.

To turn it on, you need to go into BIOS/EFI. The setting is located under Advanced Settings/Configuration → CPU Configuration → Intel Virtualization Technology. See also
How do I enable hardware virtualization technology (VT-x) for use in Virtualbox?

Also, you need to install Guest Additions for your system to function properly.

And if none of the above did work, you have to submit a bugreport.


Grub not showing in Lubuntu-OpenELEC dual boot

Try holding shift while booting up, this is the solution I see everywhere. OR if you don't care about data (or you could get a liveboot and copy files from your home directory to a thumb drive), just reinstall ubuntu beside WinXP and copy your /boot dir to a data disk in case this were to happen again, then you would have a quite handy liveboot disk and an extra /boot partition to copy/ use to fix broken files
good luck fixing your grub installation


Is it possible to add the Chrome Task Manager to the Chrome Unity quicklist?

I'm not sure you can start it with task manager window opened. But if it's possible, it must be with the "--webui-task-manager" switch.

Open this file for editing:

gedit ~/.local/share/applications/google-chrome.desktop

Find the text below:

X-Ayatana-Desktop-Shortcuts=[your quicklist option groups]

Change it to:

X-Ayatana-Desktop-Shortcuts=[your quicklist option groups];TaskManager

Then add at the very bottom:

 [TaskManager Shortcut Group]
 Name=Task Manager
 Exec=google-chrome --webui-task-manager
 TargetEnvironment=Unity

Save and close.


Creating distinct duplicates of applications in Gnome3

Ended up just putting the different windows of Terminator in workspaces 3, 4, and 5 and toggling between the workspaces as described here, making the toggling between them fast as shown here.


UBUNTU Desktop 15.04/15.10 with the SAME x86 window manager (identical) for ARM/ODROID XU4

first i assume you are talking about DEs (desktop environments) and not window manager, since MATE is a full desktop environment and not a window manager.
(to explain it a simple way: window manager are just responsible for the frames around your applications... like Compiz, Metacity, Marco, etc.)

as you pointed out you need a ARM-build for a ARM-CPU, x86-build for a 32bit-CPU and so on...

usual a SBC (single board conmputer) has not enough "graphical power" to run a DE which needs 3D-acceleration like Unity (the default ubuntu DE) or GNOME 3.x.
for sure your ARM board may have enough power to run a ubuntu-system (so there is the possibility to provide a MATE-built), but that don't have to mean also the default or every other packaged graphical desktop environment!

maybe i am wrong and you can try to install unity afterwards with the command sudo apt-get install unity, but i'm pretty sure that won't work and you will mess up your system.
first backup your files and expect you have to reinstall ubuntu!!! -- don't blame me that i haven't warned you!


Nautilus won't launch in Ubuntu 15.04. What should I do?

After killing all nautilus proccesses, the problem is fixed for me:

$ killall nautilus

It is not a great soution either but it is easier than reboot :)


Can’t boot after motherboard replacement

I disabled secure boot (dont know if it made any difference) and changed SATA operation from RAID to AHCI in BIOS and xubuntu is starting again.


How to minimize PyBitmessage to the system tray?

Currently, you can click the application indicator of PyBitmessage and will see an option to show/hide the application:

Closing the window by clicking on the red X will always quit PyBitmessage. If you think PyBitmessage should behave differently, you should open a bug report in the bug tracker.


How to make calendar points to Sunday as first day of the week in Ubuntu 18.04

A similar question was asked here: Monday as first day in Gnome-Shell (instead of Sunday).

Use sudo -H gedit /usr/share/i18n/locales/en_GB.
Edit the value of first_weekday to 1.
Save the file, restart the system.

There is a second variable: first_workday that is set to 2. Some calendar's may refer to this variable but I would initially leave it unchanged unless further tweaking is needed.

Essentially you will make your GB locale look like the US locale:

$ cat /usr/share/i18n/locales/en_GB | grep week -A1
week    7;19971130;4
first_weekday 2
first_workday 2

$ cat /usr/share/i18n/locales/en_US | grep week -A1
week    7;19971130;7
first_weekday   1
first_workday   2

I don't know what the week variable does so would leave it unchanged at first.


Adding myself to the user group "audio" solved my problem. I determined this was the problem when

sudo aplay -l

returned results about the audio card, but

aplay -l

returned nothing.

Command to run:

sudo useradd -aG audio your_username

You have to log out to get the change working.


gedit and ssh "ImportError: No module named 'cairo'"

Try

sudo apt-get install python-cairo

or

sudo apt-get install python3-cairo


Adobe Flash Player Installation in Ubuntu 18.04; E: Malformed entry

The command you executed is incorrect.

First, run the following command to remove the malformed entry:

sudo sed -i 's/deb.*partner//g' /etc/apt/sources.list

Next, run the following command to add the partner repository:

sudo add-apt-repository "deb http://archive.canonical.com/ubuntu $(lsb_release -sc) partner"

You can see here that your entry was missing ubuntu and a blank space before $(lsb_release -sc)

Additionally, you will need to enable the multiverse repository. Run the following command:

sudo add-apt-repository multiverse

The following will install all of the flash player plugins for all the different browsers you may use:

sudo apt update
sudo apt install adobe-flash-properties-gtk adobe-flashplugin browser-plugin-freshplayer-pepperflash pepperflashplugin-nonfree


How do I enable Ubuntu (using full disk encryption) to call LUKSsupend before sleeping/suspending to RAM?

Sorry to state the obvious, but have you tried adding a script containing the cryptsetup luksSuspend/luksResume commands to the /usr/lib/pm-utils/sleep.d? If so what happened?

It would seem logical to me, to call stop/start the cryptdisks and cryptdisks_early services on hibernate/resume too.  Would calling cryptdisks_stop and cryptdisks_start within a script in pm-utils/sleep.d do the trick? I assume this would have the same result as calling cryptsetup luksSuspend directly.


What editor can I use as a simple vi/vim alternative?

If you are looking for an alternative editor, you are not alone. Basically life is too short to learn vi and I say this being a software developer for a living. However you should learn how to exit it because it's a problem for one out of 20k programmers. Also performing some basic append/insert operation might be worth learning, because on some stubborn servers you won't find any other editor.

Now, the answer to your question is probably nano.

If you are running some automated build script, using git or running other commands, they might open vim without you wanting it. You can prevent this by running the following before proceeding:

export EDITOR=nano


Synaptic wants to remove a lot of packages when I try to upgrade a program

You need to use backports or compile the programs yourself. Because libraries used in Ubuntu are upgraded each version, you can't just install programs compiled for 16.04 to 14.04. you can use backports because they are compiled against your 14.04 libraries but if your programs do not exist in backports repositories then you have to compile them yourself.

This is because programs in 16.04 repositories are compiled against newer libraries which ship with 16.04 and does not exist in your 14.04 distribution. To be able to use new programs compiled against newer libraries, apt-get wants to replace old libraries with new ones. But you are saying that you do not want to upgrade your old libraries.

So, to avoid this. You must either upgrade to 16.04 (upgrades all libraries at once) or compile newer versions of the programs in your 14.04 system manually. This way the programs you wan't will be compiled against your old version libraries, so you hopefully will not need to upgrade them (unless programs do not compile because they do not support those old versions anymore!)

If you choose the compile option, you can follow these instructions

In my opinion you should upgrade to 16.04. Because you can not stay in 14.04 forever anyway. It will eventually become obsolete. Have a look at some alternatives You may like Ubuntu MATE desktop perhaps, it looks more old-fashioned.


Random mac-address every time I turn on my laptop

You could add the following as root's cron job to run @reboot. For cron how to see the community wiki

Note: You may have to alter the python script as i have not test it

#!/usr/bin/python
# the mac generating function is based from
#http://www.centos.org/docs/5/html/5.2/Virtualization/sect-Virtualization-Tips_and_tricks-Generating_a_new_unique_MAC_address.html
#
# Changes MAC address and Hostname using random values
# NOTE: This script must be called as root
# In case of adding it as cron job, it must be in root's cron jobs!
import random
import subprocess

mac = generate_mac()
hostname = generate_hostname()
proc = subprocess.Popen("/bin/hostname", shell=True, stdout=subprocess.PIPE)
old_hostname = subprocess.stdout.read()
interface = "eth0"
bring_if_down = "ifconfig {iface} down".format(iface=interface)
bring_if_up = "ifconfig {iface} up".format(iface=interface)
change_mc = "ifconfig {iface} hw ether".format(iface=interface)
change_hostname = "hostname {hostn}".format(hostn=hostname)

def generate_mac():
    mac = [
        random.randint(0x00, 0x7f),
        random.randint(0x00, 0x7f),
        random.randint(0x00, 0x7f),
        random.randint(0x00, 0x7f),
        random.randint(0x00, 0xff),
        random.randint(0x00, 0xff) ]
    return ':'.join(map(lambda x: "%02x" % x, mac))

def generate_hostname():

    _result = ""
    for x in range(8):
        _result += (random.choice("abcdefghijklmnopqrstuvwxyz"))

    return _result

def do_change():
    # bring interface down
    subprocess.Popen(bring_if_down)
    # change MAC address
    subprocess.Popen(change_mc)
    # change the host name
    subprocess.Popen(change_hostname)
    old_host = open("/etc/hostname", "r").read()
    with open("/etc/hostname", "r") as infile:
        data = []
        for line in infile.readlines():
            data.append(line.replace(old_hostname, hostname))

    with open("/etc/hostname", "w") as outfile:
        for line in data:
            outfile.write(line)

    # brin interface up
    subprocess.Popen(bring_if_up )

def main():
    do_change()

if __name__ == '__main__':
    main()


Vundle (plugin for Vim) configuration problem

You are mixing the system-wide configuration with user configuration.
The manual of Vundle suggests adding a script to “your .vimrc”, i.e. ~/.vimrc, particularly adding a link to ~/.vim/bundle/Vundle.vim. Both these files reside in a user’s home directory (~) and do not affect other users.
However, if you put the script (including the link to a user’s home directory!) to the system-wide Vim configuration /etc/vim/vimrc, you must

either place the file Vundle.vim to a location that is valid system-wide (e.g. /opt, /etc/vim) and provide the path in /etc/vim/vimrc
or ensure that the file ~/.vim/bundle/Vundle.vim exists for any user, including root.

The home directory (~) for root is /root. So if the file /root/.vim/bundle/Vundle.vim does not exist on your machine, Vim cannot load it when processing your /etc/vim/vimrc as the root user.

I got these errors while running .vimrc:
# vim vimrc

This is likely not related to opening the vimrc file specifically, the problem impacts launching Vim as such because Vim reads its configuration files during that. It should happen even if you issue a plain vim command without any file.
By the way, be aware of each character of a filename. vimrc does not equal .vimrc, these are different files.


It seems that the disk had GPT table before but later it was converted to MSDOS with windows. However windows doesn't delete the backup gpt table and linux can see it, creating confusion whether the disk is msdos or gpt.

If Ubuntu sees the drive as GPT, it probably won't be able to find any partitions on it so it'll only see a blank disk

Use fixparts and it will safely delete the backup table without any data loss. Only open it with fixparts and it will offer to do it for you, something like:

sudo fixparts /dev/sda

fixparts has a version for windows too. You can find it here

SOURCE


Thanks to @Mark Kirby's comment under the question above and to the posts here (especially post 6), I have found the solution: the needed Decibel package is a 1.06 (not 1.08) version made for Xenial and available as a deb, which needs as a dependency gstreamer0.10-plugins-ugly 0.10 also available as a deb, which instead needs libx264-146.

If version 1.08 version is installed, remove it (sudo apt remove decibel-audio-player), then, in the following order, download and install, preferably using gdebi-gtk:

libx264-146
gstreamer0.10-plugins-ugly 0.10
decibel-audio-player 1.06

Also,gstreamer0.10-alsa is needed if not already installed:

sudo apt install gstreamer0.10-alsa

To be able to add CD play/access to the file manager menu, two optional packages are also needed:

sudo apt install cd-discid python-cddb


Dual boot Ubuntu 16.04/Windows 10 no longer booting

It looks as if this question has been resolved in the comments.

  Yes it turned out that I had installed Ubuntu in legacy mode :( Very well nothing to do but reinstall it then I guess. Thanks for the help! – Johan


How to Build report from mysqlcheck output

This simple script is getting the mysqlcheck result and checking the output for "Repairing Tables". As this string only comes when the table is damaged.

If exist then it sends an email to the desired address.

#!/bin/bash

result=`mysqlcheck --user=myuser --password=mypass --auto-repair dbname;`

if [[ $result == *"Repairing tables"* ]]; then

  echo $result | mailx -s 'email subject'  username@example.com

fi


It appears the issue is arising from the User Agent Overrider addon (version 0.2.3). I am able to restore normal functionality simply by clicking its menu icon (a quick enable/disable toggle switch) and reloading the Youtube tab.


Does unattended-upgrades work in a guest account?

Unattended upgrades will work with guests (or any user), as they do not require a user to be logged in to run.

For more information there is a good Ubuntu community help page: https://help.ubuntu.com/community/AutomaticSecurityUpdates#Using_the_.22unattended-upgrades.22_package

It explains about how unattended-upgrades is invoked from cron and the various configuration options that can be set.


This means that you have several openjdk's installed but not Oracle Java. You can choose between those with sudo update-alternatives --config javac.

But to install oracle java, you should follow this guide.

If you want you can uninstall openjdk before installing oracle java with sudo apt-get remove openjdk-6-jre default-jre default-jre-headless or/and follow this to uninstall openjdk7.

If you want you can keep them as well, but it is up to what you want. Openjdk is fine as well.

Hope it was clear enough. Be well.


Able to ping sites using Ubuntu 20.04 but not access via 'atp-get' or browser

Well, ultimately this turned out to be a router issue. Doh. Swapped routers and no more problem.


Ubuntu Server 14.04.2 LTS File Sharing Permissions

SETGID was the answer I was looking for.  I opted to avoid the ACL approach as most reading I did indicated it was overkill for my purposes.

First step was to go to create a new group to hold my users:

sudo groupadd MyNewGroup

Then add my users to it:

sudo usermod -aG MyNewGroup userA
sudo usermod -aG MyNewGroup userB
sudo usermod -aG MyNewGroup debian-transmission

Assign ownership to the folder and all its child folders:

sudo chown -R userA:MyNewGroup /mnt/ParentFolder

Add permissions as needed to all existing files:

chmod -R 770 /mnt/ParentFolder

And this was the part eluding me, set the GID so that all new files are owned by the group:

chmod g+s /mnt/ParentFolder

All new files created in directories set like this will allow anyone in the group to have the permissions you have set.


I'm grateful to you, That's why I want to help you now!

Ok, answering your Question you have to know 5 things...

The Ubuntu new packages can be installed in old versions of Ubuntu.
The Ubuntu old packages can be installed in new versions of Ubuntu.
But you may have to correct the depenedencies.
With a same distro is not necessary the Equivalency.
networkctl is a internal feature of the package systemd

Knowing it, now i will explain to you how you can install networkctl in ubuntu 14.04

Step number 1 (Safe Method) Build dependencies

download a livecd of ubuntu that correspond to your installed ubuntu architecture and version, Note: have to be the exact version, no variants, example: if your installed version is 14.04.2 i386, you have to download the version 14.04.2 i386 live cd, for build the dependencies of the package that contains networkctl WITHOUT AFFECTING YOUR INSTALLED UBUNTU, you can find all ubuntu versions here:

Ubuntu Livecd - Old releases

Run the live cd, and when you are in the desktop, is time to connect internet, and go to this page in your browser:

Systemd package that contains networkctl

In the bellow part, click in the architecture that match with your livecd architecture, for example i386 or amd64.
In the next part find where say: "You can download the requested file from the pool/main/s/systemd/ subdirectory at: " then now click in the link that say "security.ubuntu.com/ubuntu"
A .deb package will be downloaded, will be like systemd_x-x_x.deb
Now is time to build the dependencies(not compile), only fetch or download, for it you will need the package gdebi-core, for it type this command without quotes "gedit /etc/apt/sources.list", and now copy all lines in any file to backup your sources.list and now erase all lines and paste this text without quotes "deb http://cz.archive.ubuntu.com/ubuntu trusty main"
Now save the file sources.list, and now is time to install gdebi-core, using these commands:

sudo apt-get update
sudo apt-get install gdebi-core
After the installation of all success correctly, is time to start to find or fetch the dependencies for the package systemd, for it use this command without quotes "gdebi /path_of_the_downloaded_systemd_deb_file/yoursystemd_downloaded.deb" and after it, gdebi-core will check the dependencies of the package, and will be installed, but not configured if some dependency are not satisfaced.
Now if you see Dependency is not satisfiable: Some_Dependience, then is time to find it dependency, you can search the dependency name in google for example: "some_ddependecy-someversion" and add launchpad.net at the ends with a space like this: "some_depend-some_version launchpad.net", and you will find the dependency, if the version and name match, is time to download it from launchpad or from other sources that you know are confiable, and install it dependencie, you will need do it too for the sub dependencies of a dependecy of the package systemd, graphicaly like a tree explainded:

systemd:
--somedepend1
----subdepend1 of somedepend1
----subdepend2 of somedepend1
--somedepend2
----subdepend1 of somedepend2
----subdepend2 of somedepend2

and you will need to use the same command for the depends and sub depends example "gdebi somedepend" and "gdebi subdepend_of_somedepend"

After all dependency are installed, is time to reinstall de package systemd, to resume te configuration, you will see a message that says a info of the package, and gdebi will ask you to continue Y/N, and lets type "y" letter without quotes, and the package will installed correctly.
The finish!, is time to copy all deb packages that you already download(systemd, and all deb files of dependencies), and paste it in your local disk where are installed your ubuntu, for example: "/home/ubuntu/Downloads/your_custom_name_for_the_dir_package", and after it, is time to reboot and eject the livecd, and now install all packages in your ubuntu installation, use this command to install:

dpkg -R -i /home/ubuntu/Downloads/your_custom_name_for_the_dir_package

Note: Here are a various sites of repositories where you can find the dependencies of the package, or a exact systemd package for trusty without updates.

http://pkgs.org
http://packages.ubuntu.com
http://launchpad.net
https://packages.debian.org

Note2: If some package or dependency, are broken(have compatibility problems), you can solve it using these commands:

dpkg-deb -R somedepend.deb /home/youruser/some_path_to_extract

And modify the control file located in debian dir inside a extracted package and, modify the depends to fix problems, for example, versions, or names if are you obtaining depends from diferents distributions like (debian, fedora) etc.

And use the command to rebuild the package:

dpkg-deb -b /home/youruser/some_path_to_extract somedepend.deb

And reinstall the fixed dependency!.

FINISH!!

I suggest not install packages from a high distant versions like for example: Trusty and Cosmic, because will be so much more difficult, i recommend install any package from the next version... in this case Xenial that is the next of Trusty.

Maybe this method is so tedious, but unfortunately after the end of the support to ubuntu trusty, the packages only can obtained manually, and not at all in oficial sources. Good Luck


Need to solve problems with not fully installed packages

Run the following:

wget http://mirrors.kernel.org/ubuntu/pool/main/p/perl/perl-base_5.22.1-9_amd64.deb
sudo dpkg -i --force-all perl-base_5.22.2-3_amd64.deb
sudo apt-get update


How to get watchman build from RC releases?

It seems that there is a tool needed for running:

$ ./autogen.sh && ./configure && make

We need libtool for that job. To install libtool:

$ sudo apt-get update
$ sudo apt-get install libtool

If make throws warnings: $ ./configure --enable-lenient to not have warnings yield a compilation error.


How does one create a ~/tmp that cleans up automatically on boot and/or on Cron?

Why not use the standard /tmp directory?

Either directly or via a symbolic link from your home directory.

ln -s /tmp ~

The symbolic link ~/tmp will behave like a directory and its content will be deleted at [re]boot.


Using older Desktop environment for newer distro's

GNOME2 used GTK2.
Most of GTK2 is EOL, the only parts of it still maintained are the parts used by gimp which hasn't completed it's port to GTK3.
Lubuntu used LXDE which used GTK2, however Lubuntu switched to Qt5 & LXQt with Lubuntu 18.10
Ubuntu-MATE & the MATE desktop switched to GTK3 so long ago I can't recall which release (15.10 maybe, if not 16.04)
Xubuntu uses XFCE, which had fully ported to GTK3 by Xubuntu 19.10.
GTK2 is dead, or probably more accurately on life-support, so GNOME2 is not possible, or at least not advisable (security-wise, with very large portions of it abandon-ware)


Problems with Netflix in new Google Chrome

Try disabling/enabling the hardware acceleration in Settings /Advanced Settings in Chrome.

See if it's happening in Firefox.

You could also try this:
http://itsfoss.com/netflix-ubuntu-1404-desktop-app/


How to rsync that excludes .git/ folder but still keep the .git/config file?

Found the answer here
The idea is include .git/config and exclude .git/*
rsync -chazP  --include '.git/config'  --exclude '.git/*'  "$FROM/" "$TO/"
#     .       include must go first   .                    .        .

View detail and run it here


Ubuntu, Windows dual boot: Windows will not start

You can try to start your Windows-Install-CD or -DVD. There you'll find an option to repair your installation. Windows creates a new boot file and afterwards your Windows should start again.

Usually there are problems when someone uses hard drive encryption which comes with Windows. But from what I heard this happens mostly in Vista.


Not sure if this will help, but if you can connect to the network but not internet you should try adding a names servers.

Try adding the Google nameservers to the bottom of the config file in /etc/hosts

nameserver 8.8.8.8
nameserver 8.8.4.4

Make sure to restart your computer or reset network connection by running the commands below

ifdown lo
ifup lo


Setting terminal window's title: wmctrl versus xdotool

We can see that at the very least xdotool getactivewindow getwindowname works as intended.

$ wmctrl -r :ACTIVE: -N "Test1"
$ xdotool getactivewindow getwindowname
Test1
$ xdotool getactivewindow set_window --name Test2
$ xdotool getactivewindow getwindowname
Test2

So let's go deeper. We can list properties of window using xprop -id <id> command. For window with name set by wmctrl it gives:

_NET_WM_OPAQUE_REGION(CARDINAL) = 0, 0, 1920, 995
_NET_STARTUP_ID(UTF8_STRING) = "brisk-menu-2514-mariusz-HP-Pavilion-Notebook-mate-terminal-1_TIME1314631"
WM_WINDOW_ROLE(STRING) = "mate-terminal-window-4442-66103825-1563868224"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 79691784, 79691785
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x4c00007
WM_CLIENT_LEADER(WINDOW): window id # 0x4c00001
_NET_WM_PID(CARDINAL) = 4442
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "mariusz-HP-Pavilion-Notebook"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        program specified minimum size: 345 by 141
        program specified resize increment: 9 by 20
        program specified base size: 16 by 30
        window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "mate-terminal", "Mate-terminal"
_NET_WM_ICON_NAME(UTF8_STRING) = "Terminal"
_NET_WM_NAME(UTF8_STRING) = "Test1"

And for for window with name set by xdotool it gives:

_NET_WM_OPAQUE_REGION(CARDINAL) = 0, 0, 1920, 995
_NET_STARTUP_ID(UTF8_STRING) = "brisk-menu-2514-mariusz-HP-Pavilion-Notebook-mate-terminal-1_TIME1314631"
WM_WINDOW_ROLE(STRING) = "mate-terminal-window-4442-66103825-1563868224"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 79691784, 79691785
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x4c00007
WM_CLIENT_LEADER(WINDOW): window id # 0x4c00001
_NET_WM_PID(CARDINAL) = 4442
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "mariusz-HP-Pavilion-Notebook"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        program specified minimum size: 345 by 141
        program specified resize increment: 9 by 20
        program specified base size: 16 by 30
        window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "mate-terminal", "Mate-terminal"
_NET_WM_ICON_NAME(UTF8_STRING) = "Terminal"
_NET_WM_NAME(STRING) = "Test2"

And we can see that in both cases _NET_WM_NAME is set correctly. What is _NET_WM_NAME? It's an extension for x11 (link, link)

  _NET_WM_NAME

  _NET_WM_NAME, UTF8_STRING

  The Client SHOULD set this to the title of the window in UTF-8 encoding. If set, the Window Manager should use this in preference to
  WM_NAME.

So x11 applications should prefer this property over WM_NAME. Let's display both of these properties. I've taken C code from here:

#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <stdio.h>
#include <stdlib.h>

#define MAXSTR 1000

Display *display;
unsigned long window;
unsigned char *prop;

void check_status(int status, unsigned long window)
{
    if (status == BadWindow) {
        printf("window id # 0x%lx does not exists!", window);
        exit(1);
    }

    if (status != Success) {
        printf("XGetWindowProperty failed!");
        exit(2);
    }
}

unsigned char* get_string_property(char* property_name)
{
    Atom actual_type, filter_atom;
    int actual_format, status;
    unsigned long nitems, bytes_after;

    filter_atom = XInternAtom(display, property_name, True);
    status = XGetWindowProperty(display, window, filter_atom, 0, MAXSTR, False, AnyPropertyType,
                                &actual_type, &actual_format, &nitems, &bytes_after, &prop);
    check_status(status, window);
    return prop;
}

unsigned long get_long_property(char* property_name)
{
    get_string_property(property_name);
    unsigned long long_property = prop[0] + (prop[1]<<8) + (prop[2]<<16) + (prop[3]<<24);
    return long_property;
}

int main(int argc, char** argv)
{
    char *display_name = NULL;  // could be the value of $DISPLAY

    display = XOpenDisplay(display_name);
    if (display == NULL) {
        fprintf (stderr, "%s:  unable to open display '%s'\n", argv[0], XDisplayName (display_name));
    }
    int screen = XDefaultScreen(display);
    window = RootWindow(display, screen);

    window = get_long_property("_NET_ACTIVE_WINDOW");

    printf("_NET_WM_PID: %lu\n", get_long_property("_NET_WM_PID"));
    printf("WM_CLASS: %s\n", get_string_property("WM_CLASS"));
    printf("_NET_WM_NAME: %s\n", get_string_property("_NET_WM_NAME"));
    printf("WM_NAME: %s\n", get_string_property("WM_NAME"));

    XCloseDisplay(display);
    return 0;
}

Only added a printf("WM_NAME: %s\n", get_string_property("WM_NAME")); line. Running:

$ gcc test.c -o test -lX11
$ wmctrl -r :ACTIVE: -N "Test1"
$ ./test
_NET_WM_PID: 4442
WM_CLASS: mate-terminal
_NET_WM_NAME: Test1
WM_NAME: (null)
$ xdotool getactivewindow set_window --name Test2
$ ./test
_NET_WM_PID: 4442
WM_CLASS: mate-terminal
_NET_WM_NAME: Test2
WM_NAME: Test2

So the conclusion is: xdotool sets both _NET_WM_NAME and WN_NAME but only search by WM_NAME and wmctrl sets only _NET_WM_NAME.


Ubuntu Variant / Linux Distros which uses least system resources (RAM, CPU)?

Of all the official Ubuntu variants, Lubuntu is the most lightweight, which is to say that it uses the least CPU, RAM, and disk space.

This is followed by Xubuntu, which is less lightweight than Lubuntu but more lightweight than Ubuntu and its other official variants.

There is a saying that "you don't run an operating system, you run applications." You can further reduce (or increase) your system's resource footprint by making choices about what applications to run. For example, AbiWord will take up fewer resources than LibreOffice Writer. AbiWord and Gnumeric are installed instead of LibreOffice Writer and LibreOffice Calc, on Lubuntu.

Given your system's specifications, however, you should be able to run vanilla Ubuntu or any official Ubuntu variant. Depending on your netbook' video card, you might have to run Unity 2D (i.e., without graphics acceleration) in Ubuntu, or dial down / turn off visual effects in Kubuntu.


"Software updates available," but I can't install them

I would recomend to clean your packages and run an update by the terminal.
first:

sudo apt-get clean

and than I have a nice code  for you- I ran it since 6 years, started an my 12.04 and now at (still) 16.04 LTS and be very happy with it:

sudo apt-get -y update; sudo apt-get -y upgrade; sudo apt-get -y autoremove

to explane:

 -y:         says "yes" to the question "are you shure you want..."
 update:     prepares the system packages upgrade
 upgrade:    does the packages update (no deleting or installing of new packages)
 autoremove: removes packages what are no longer needed
 ;         : compared to && it will do the following command even the first command would not execute completely


ssh/authorized_keys with a hostname in the 'from' directive

If you want to use a fqdn in your authorized_keys file, you will need to ensure that the source ip address reverse-resolves to the desired hostname.  When sshd receives a connection from somewhere else, the only information it has is the ip address; it can only figure out the hostname by performing a reverse DNS query.

Since you're using a dynamic hostname, it is pretty much guaranteed that the ip address from which you are connecting will never resolve to the desired name. Instead, as you have seen, the address will resolve to some sort of static name that is specific to that address.

Your best bet is to either (a) just use an ip address and come up with some mechanism for keeping it up-to-date, or (b) don't rely on information about the originating address as part of your authentication. Instead, use a purpose-specific ssh key or some other solution.


'PRIME Profiles' tab missing in NVIDIA X Server Settings (Ubuntu 16.04)

Install nvidia-361 in terminal or in GUI, reboot, and PRIME will appear.

It works only with NVIDIA proprietary drivers.


How do I blacklist the gallium ATI driver?

1) Backup the blacklist file:

sudo cp /etc/modprobe.d/blacklist.conf /etc/modprobe.d/blacklist.bak

2) Edit it:

gksu gedit /etc/modprobe.d/blacklist.conf

2) Add this:

blacklist gallium-nouveau
blacklist gallium-i915
blacklist gallium-i965
blacklist gallium-radeon
blacklist gallium-r600
blacklist gallium-svga
blacklist gallium

3) Save and reboot.

4) Make sure it works:

lsmod | grep gallium

References:
 Prevent a Linux kernel module from auto loading
 Gallium How To


error "grub-mkconfig: You must run this as root"

Just solved it:
in Ubuntu this command does not work:

su -i

instead, I used

sudo -i

After that I exported these paths:

export PATH=/usr/sbin:/usr/bin:/sbin:/bin

then

update-grub


How to disable the disk write cache in Ubuntu 13.10?

Disabling write caching will increase the number of writes to the system. As you can see in the link below

http://ubuntuhandbook.org/index.php/2014/01/disable-disk-caching-prevent-data-loss/

Write caching basically caches the data before the OS can write to the device, any then writes it together. It makes the system fast since you have less number of writes to the device, however it is risky since a power failure will result in the loss of the cached data.

You have turned off the write-cache hence all your writes are directly being written to the drive and thus you have high write througput.


How do I make sure my IM client is using the right SSL certificate?

It really comes down to; who do you really trust? I personally would create my own self-signed certificate and would simply use that one. This is because I Know I created it and I was not relying on a third-party that could be or will be compromised. So then you would just need to trust yourself;)


How to easily make an alias command permanent?

There is no bash builtin to add permanent aliases. Such aliases are created by adding them to a configuration file that is sourced by interactive shells, as you've done with .bashrc.

But you might consider modifying your palias() implementation by making it put the aliases in a separate file. I think this may be considered an improvement, for six reasons:

The file that is mostly edited automatically can be separate from the file that is mostly edited manually. If you need to see what has happened--out of curiosity, or to investigate a problem--this separation may be helpful. (Or if the function is accidentally called many times, creating a large number of unnecessary lines, the damage will be somewhat more contained.)
By putting the individual, automatically generated alias definitions elsewhere than .bashrc, you create a system that "works behind the scenes," which is often what people want when they look for a dedicated builtin to perform a task.
.bashrc is already usually quite complicated. It will be easier to read and modify for unrelated purposes if it's not filled with many user-defined automatically appended aliases.
Simple implementations of palias() -- including what you've written and what I'm about to recommend -- will create bad lines if the file they're appending to is not already newline-terminated (or blank). Normally text editors do this for you but it's possible to accidentally end a text file without a newline, in which case palias() will create a munged-together line that may or may not be correct, and which either way would be very difficult to read. By putting aliases in a separate file that you rarely, or at least less frequently, edit manually, you decrease the risk of this.
If you ever expand your palias() implementation to read the existing contents of its target file, for example, to give useful warnings, it may be much easier to do so if can be assumed to consist entirely of alias definitions. (Or, for more sophisticated parsing: entirely of alias definitions and lines assumed to be wrong.)
It is already widely suggested (though admittedly not as any sort of strong admonition) to put new aliases in a separate file: .bash_aliases

See How do I create a permanent Bash alias? for more information about places to put aliases.

Default .bashrc files in Ubuntu contain the code:

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

Thus if you create .bash_aliases, it will be used. The command to define the palias() function can then be:

palias() { echo "alias $1='$2'" >> ~/.bash_aliases; }

That command should still go in .bashrc, but the aliases it creates will be placed in .bash_aliases.

More sophisticated implementations are possible. You could:

Run the definition as well as adding it, so it's immediately usable. This is suggested in osirisgothra's answer. I'd use:

palias() { echo "alias $1='$2'" >> ~/.bash_aliases; alias "$1=$2"; }

Check to ensure .bash_aliases is nonexistent, empty, or newline-terminated, and if it is nonempty but not newline-terminated, append a newline prior to the alias definition.

palias() {
    local target=~/.bash_aliases
    [[ -f "$target" && -n $(tail -c1 "$target") ]] && echo >> "$target"
    echo "alias $1='$2'" >> "$target"
}

See Gilles's answer to Add missing newlines in multiple files for details on detecting missing newlines with tail.
Check and warn about defining an alias that has already been defined in .bash_aliases.

Ploutox suggested that idea. But I do not recommend using grep $1 ~/.bash_aliases or similar, because it will produce frequent false positives, anytime $1 matches any part of another alias's definition, and occasional false negatives. The matter is further complicated by how some valid bash aliases, taken as regular expressions, match more than themselves--+ and . actually get used in command and alias names--and a few don't match even themselves.
grep "alias $1=" is better but mitigates the problem only partially. A leading ^ in the pattern would pretty well match only the leading alias name of a definition, but not address the problem of regexp metacharacters in $1, while using grep -F would strip all metacharacters of their special meaning but in doing so prevent ^ from being used.

greping .bashrc in this way is even worse than .bash_aliases, as there's an essentially unlimited variety of text that may be part of that file, mostly outside any alias definitions.

If you want to check for aliases that are defined in the current shell, whether or not they're written in .bash_aliases (or anywhere), you can use alias "$1" (or run alias with no arguments and match, carefully, against its output). Credit goes to muru for this idea. It does have the disadvantage that if you define an alias with alias to test it out and then make it permanent with palias, you'll get a warning even though it was not yet permanent and everything is fine.

To check new permanent aliases against the contents of .bash_aliases, you could do something like this:

palias() {
    local target=~/.bash_aliases

    if grep -Pqs '^[ \t]*alias[ \t]+\Q'"$1"'\E\=' "$target"; then
        printf "%s: %s: warning: defining \`%s' again in %s\n" \
                    "$0" "$FUNCNAME" "$1" "$target" >&2
    fi

    echo "alias $1='$2'" >> "$target"
}

That seems to work well, though I suspect there are more elegant ways. (Arguably [ \t]* should be removed, if you take leading whitespace before alias as a suggestion that it is part of a multiline alias definition.) It will malfunction if \E appears in $1, but shell metacharacters and quoting characters like \ aren't valid in alias names, so you won't need to give that as input.
Ideally, on any wrong input, any user-facing function you call would perform no operation except printing a useful error message. But by the nature of palias(), at least unless you're prepared to make its definition far more sophisticated (see below), the burden of reasonable input already falls mostly on the user. You can write non-aliases and alias definition syntax errors to .bash_aliases with this function, and while that's probably acceptable given the way you'll be using palias(), choking on \E is minor in comparison.

More seriously, alias name1='def1' name2='def2' ... is perfectly good syntax for the alias command, but I haven't tried to parse out alias definitions given as subsequent arguments to alias in .bash_aliases, as I believe correctly determining where the first non-quoted blank occurs would be non-trivial.

Therefore, if you use the above palias() implementation and also sometimes manually define aliases in .bash_aliases (or whatever file you use as $target), you should define just one alias per alias ... line if you want to have reliable warning behavior.
It will also fail to recognize alias definitions to the right of a ; or other connectives, for example to chain separate alias commands on the same line, but it seems unlikely you'd want to do that in .bash_aliases.
Parse $1 to ensure it is a valid name for an alias.
Parse $2 to attempt to figure out if it is a plausible body for an alias, and if it is not, then warn, fail, or (where applicable) quote it properly. For example, what happens if a ' character appears in $2?
Do a simpler version of that instead, just checking for and addressing ' in $2.

But you likely don't want to bother with any of that. You know how your function works, its limitations, and how to use it properly. I see four options for you that are at the same time reasonably good and pretty simple:

Just keep using what you have now.
Use an implementation as above, putting the aliases in .bash_aliases instead of .bashrc.
Make a third file for automatically added aliases, and source that file separately (either in .bashrc or .bash_alises.
Don't use a palias() function at all, and just manually add aliases by editing .bash_aliases or .bashrc.


Multiple Workspace rows in XFCE without xfce-panel?

It's possible to manually set the _NET_DESKTOP_LAYOUT property using the xprop command.

For example, to get 4 columns x 2 rows, issue this:

xprop -root -f _NET_DESKTOP_LAYOUT 32cccc -set _NET_DESKTOP_LAYOUT 0,4,2,0

And to change the number of workspaces/desktops to 8:

xprop -root -f _NET_NUMBER_OF_DESKTOPS 32c -set _NET_NUMBER_OF_DESKTOPS 8

Further information regarding the _NET_DESKTOP_LAYOUT property (among others) can be found here


Ubuntu 17.10 and Samsung SCX-4624F Scanner not working

It turned out that in SANE 1.0.27 released in May 2017 had some USB fix disabled (printer/scanner with USB 2.0 has problems with USB 3.0 port).

It is possible to enable the fix with the new environment variable SANE_USB_WORKAROUND=1. After I added it to the .bashrc, Simple Scan started to work correctly.


Alt+Shift+Esc will bring you back to the last minimized window.
That keyboard combination switches you through the windows in a reversed order. Your minimized window is last in the list, so will be recalled. This works only on a per-desktop base. So if you already moved to another desktop, you will need to switch back to the desktop where the hidden window resides.
If you use the regular window switcher instead of the application switcher, then Alt+Shift+Tab will do the same thing, across desktops if the window switcher is set to list windows on all desktops.


In case someone is still looking for an answer, you can use yum groupinstall on RHEL based distros as follows:

yum -y groupinstall "Base" --installroot=/your/path/ --releasever=6

"Base" for minimal centos installation


VESA: SUMO driver instead of being the ones I installed (fgrlx-updates) ubuntu 13.04 64-bit IGP (HD 6xxxG)

Found it, I was completely overloaded with information and pretty lost, which is why I have not been careful.

Anyway who are still in difficulty here is the answer:

what-is-the-correct-way-to-install-ati-catalyst-video-drivers


I was instructed by Skype customer service to do following:

Go to Options -> Privacy and set "Keep chat history for.." to Disable History, then sign out & sign in.
Go to $HOME/.Skype/my_skype_name/ and delete only main.db. Sign out & Sign in.

It worked.


How do I make the Caps Lock key a third Shift key?

Expanding on @Zacharee1 answer:

make a backup with cp /usr/share/X11/xkb/symbols/pc ~/pckeybak

then edit with gksu gedit /usr/share/X11/xkb/symbols/pc or your favorite editor.

Find the line (22) that says:

key <CAPS> {   [ Caps_Lock     ]   };

and change it to

key <CAPS> {   [ Shift_L       ]   };

and the line (36) that says:

modifier_map Lock   { Caps_Lock };

and change it to

//modifier_map Lock   { Caps_Lock }; (which should comment it out in effect disabling the locking)

Testing indicates that the Num Lock still works as expected. Further testing indicates that the keyboard indicator lights appear to be a bit dyslexic in 16.04 on even an unmodified system. Scroll Lock indicator on at login but Scroll lock off and Num Lock light off, but Num lock on. Tapping the left Ctrl key  seems to resolve this behaviour and I'm not sure if it's related to my use of a KVM switch (which is possible)

Note: Further testing shows that the NumLock indicator light is flaky even without a KVM switch and has to be tapped twice to get back in sync with NumLock If you always leave it on you can ignore the light or if it bothers you you can tap it twice to get it back in sync. Why this occurs is likely a basis for a new question...

Another simple solution to your original problem would be to simply obtain an inexpensive US keyboard and use the US keyboard mapping.

Sources: @Zacharee1 answer and analysis of /usr/share/X11/xkb/symbols/pc and trial and error testing


How come Xorg refuses to generate an xorg.conf file for me?

The vmware graphics driver (vmwgfx) is an external add on driver by VMWare, not one supported by core X.org.  Xorg -configure really is only valid for the core official drivers.


Preventing access to directories on apache server

If you want to use CSS or image files in your website then you must allow visitors to access them. If the visitor's browser cannot download a CSS file then it cannot apply the CSS to the page. If it cannot download an image then it cannot display it. That is not a security risk but the way the web works.

An entirely different question is whether you allow visitors to browse the folders, ie. to discover what files exist in them. This is controlled by the DirectoryIndex and Options [+|-]Indexes directives in the Apache configuration. If you set Options -Indexes for your CSS and image folders then a visitor browsing to the CSS or image folder will not see the list of files, but receive a "permission denied" error page instead. So visitors will only be able to access files they know are there, for example because your web page contains links to them, which is normally exactly what you want.


Problems with video and playback on 4K monitor and R9 R270 AMD. Ubuntu 14.04

I ended up upgrading and re-installing Ubuntu 14.10. As soon as I did this the video acceleration in YouTube and Flash worked a treat. I have now upgraded further to 15.04, and this version also works well for video playback on 4K.

My recommendation based on my experience is that you should install the AMD Proprietary drivers as doing this caused me all sorts of problems. It is not straightforward removing these drivers and getting your system back to a working condition either.


ISO Files Are Being Classified As Text Files Under Kubuntu 17.10

If you really are sure that those are iso files, and you know where you got them from, mount them and check out for errors.

sudo mkdir /media/iso0

sudo mkdir /media/iso1

sudo mount -o loop path/to/iso/file/YOUR_ISO_FILE0.ISO /media/iso0

sudo mount -o loop path/to/iso/file/YOUR_ISO_FILE1.ISO /media/iso1

if you got no errors then those are iso files, check what's inside them in the folder /media/iso0 and /media/iso1

if there are errors, Kubuntu is right.


How to increase resize margins for windows in Ambiance theme for Ubuntu 14.04 LTS

You will need to edit /usr/share/themes/Ambiance/gtk-3.0/apps/unity.css file. Find -UnityDecoration-input-extents line and change 10px to something larger.

If you have gtk-3.20 folder then you need to edit /usr/share/themes/Ambiance/gtk-3.20/apps/unity.css file. In case you update your ubuntu version.


Is there a way to restore/format an iPod under Linux?

While Banshee and amaroK offer the possibilty to load songs onto the iPod there is, as far as I know, no option to restore or format these things.

However: The iPod Touch has a restore function in the settings menu and I think my iPod classic had one of those too. I can't check anymore though, since it's been broken for some time.

If it's really just about getting rid of the duplicate songs you could just delete those with any of the mentioned linux programs.


I just tried and everything is working fine

OS : lubuntu 19.04
playonlinux + ms-office 2010

But - these are the steps i followed:

Use Muon (builtin with lubuntu) to install playonlinux (this automatically installs wine for you)
add i386 architecture  [this is imp for msoffice 2010]
then install wine32

Then proceed to install your ms office.  [from directory or from mounted iso]

It will do a few intermediate installations [fonts, dotnet bla bla] and also a few error screens. Just wait. At the end choose "Do not send any bugs as feedback" [as mentioned on playonlinux and wine pages]

That is it.

Also i want to write a few lines why people still use MS office when libreoffice is available.

Many job places use MS-office / outlook as corporate policy. So, those folks want to do some work at home [possibly without/ with internet], and they need outlook with all the emails; with PST archives.
MS word for preparing reports or updating reports that were already developed in a specific format. Tables, diagrams etc won't work that well in other software

enjoy 19.04. No worries for another year!


Problem with gconf-editor no button_layout key

Kindly elaborate your question. Mentioning your type of Ubuntu, version of Gnome if not unity if you are using it to get button layout and where you are trying to search button_layout>

or else if not possible atleast a snap shot

For GNOME SHELL.

Basically it should have been, desktop>gnome>shell
And you have to change the "Arrangement of buttons in titlebar" in shell


Problem solved, I did:

sudo apt-get install xbmc-mediaportal-pvr

then restarted xbmc


The getting involved page on unity.ubuntu.com has an initial set of instructions to get started.

It looks like you've already branched the code. You can just edit it with whatever editor you prefer (the unity folks don't have a specific IDE, it's just personal preference). After you've made the change you want you can do a bzr commit and then you need to build Unity to test it:

How do I build Unity from source?

You don't have to follow the part of the instructions where you pull unity from Launchpad, you've already done that.

After you've fixed what you want you can submit the branch to Launchpad if you want the Unity folks to integrate it.

We have a page full of bitesize bugs for people who are just getting started if they want to tackle something small to get used to the codebase.

IRC Logs from a tutorial session.
How to contact the Unity team.

If you have specific questions about parts of the unity code just ask them as new questions and tag them with unity and Unity developers will look at them, it will be useful to start building up a bunch of questions and answers about the Unity codebase!


How do I print labels using a Brother QL700?

For printing labels I have found gLabels downloadable from the Ubuntu Software Center invaluable.

It is quite straightforward to set up and easy to incorporate CSV address lists.

I also us it to generate business cards incorporating graphics.

You can either use the inbuilt lists of standard labels or design specific formats as required.


Why do I have to download a .deb file to update some already installed programs?

Programs are only upgraded automatically if you installed them via

sudo apt-get install <program>

or the Software Center.

If you install if from another source (.deb, .tar.gz, etc.), you'll need to manage updates yourself.

Sometimes, you can find a PPA for the software which updates as long as the PPA maintainer updates it.


How to install Ubuntu on a different drive from Windows8?

If you want to install Ubuntu in the free space on the HDD, you should first create a new swap partition in the free space you made on the HDD - Most people recommend making the swap the same size as your RAM.

Then, create a new ext4 partition in the rest of the free space, and use that for /. (If you want a separate /home partition for user data, you need to create two ext4 partitions - one for / and one for /home - you probably don't need that unless you want to install multiple linux distributions).

For the bootloader - you should choose the device from which your computer is booting, most likeley the SSD (You can check this under "boot priority" in the BIOS / Set-up).

Note that it's a good idea to always have a backup anyway, even just in case of possible hardware failure. If you want to be entirely sure, you can unplug or remove the SSD while installing, so nothing goes wrong even if you make a mistake, and then run update-grub or grub-install (or by using a tool like Boot-repair) from ubuntu to set up the dual boot menu after installing and re-adding the ssd.


How can I apply the packaging for libvirt to build a package out of a git version?

Yes, you can use packaging files from the distribution (Ubuntu/Debian).

Create a source archive from your repository, and rename it correctly.

<packagename>_<version>.orig.tar.gz

The root folder inside the archive should be <packagename>-<version> which contain the whole source tree.

Then extract it.
Download Debian packaging file .debian.tar.zx from:

https://packages.ubuntu.com/bionic/libvirt-bin

Extract it and put debian folder inside <packagename>-<version> folder from the previous step.
Open terminal in <packagename>-<version> folder then build Debian source package.

# if needed
dch
debuild clean
# build source package only
debuild -S

Upload it to PPA that will build binary packages for you.


Verify the current Google Chrome installation's integrity

Well, the easiest method of verifying a deb is via apt

See How secure is the apt-get install command against man in the middle attacks and the Securing Debian Manual for details.

This does not help you, however, if you did not install the package via apt.

It then depends on how the .deb was packaged. If it was "properly" packaged it should include md5sums of the files

Look in /var/lib/dpkg/info/google-chrome.md5sums I am not sure of the exact file name here.

You can also use the -V or dpkg --verify options

dpkg --verify google-chrome

-V, --verify [package-name...]
          Verifies  the  integrity  of  package-name  or  all  packages if
          omitted, by comparing information from the installed paths  with
          the database metadata.

          The output format is selectable with the --verify-format option,
          which by default uses the rpm format, but that might  change  in
          the  future,  and  as  such programs parsing this command output
          should be explicit about the format they expect.

Man page

If you installed a compromised package and the person was good, or the person who packaged the .deb did not follow standard protocols, you really can not verify the package as the md5sums will be good (in the first case) or missing (in the second case).

This is an example of why you should not install packages outside of the ubuntu repositories (use Chromium) and why I advise people who package follow the packaging guidelines. Although the guidelines are a hassle, they are important.


Have x11vnc automatically start in Ubuntu 16.04 server without someone first logging in at the server physically

Try adding the -create option to x11vnc.  The command over ssh I use is:

ssh -t -L 5900:localhost:5900 192.168.1.131 "sudo x11vnc -localhost -create -auth guess  -display :0"

so I don't even need to have a service x11vnc running.

The ssh command maps the remote 5900 to the local port 5900, so the x11 server and viewer both think they are running locally on port 5900.  A viewer command I use when invoking the above ssh command, explicitly uses localhost:5900 (the other options are just for performance).

xtightvncviewer -encodings RRE -bgr233 localhost::5900

Assuming no password on the vnc server, the above will use the current username for the server, and ask for its password.  If you have a different user on the server, include it in front of the IP with an @ sign.  e.g. user@192...


It will just delete the cache and nothing else. You can continue to use google-chrome as before.

You can go a step further and install applications like BleachBit. sudo apt-get install bleachbit Recently my disk was full and hence I need a clean up. You can select the folders you feel need to be cleaned.


Cannot change vncserver default geometry

I needed to make a $HOME/.vncrc file with this entry: $geometry = "1400x850";

Details can be found in the documentation here:

/usr/share/doc/vnc4server/examples/vnc.conf.gz


Why is my cpu maxing out on 1 out of the 4 cores?

You may have installed too many services/daemons  such as rtp streaming which will add unneeded stress on CPU by keeping connections established "is usually my problem" make a condensed list of needed packages such as
Cockpit
Clvm
Lvm2
Ect...


From Wikipedia:

  sudo  is a program for Unix-like
  computer operating systems that allows users to run programs with the
  security privileges of another user (normally the superuser, or
  root). Its name is a concatenation of "su" (substitute user) and
  "do", or take action.

  Unlike the su command, users typically supply their own password to
  sudo rather than the root password. After authentication, and if the
  /usr/local/etc/sudoers (sometimes found at /etc/sudoers) configuration
  file permits the user access, then the system will invoke the
  requested command. The sudoers configuration file enables a huge
  amount of configurability, including but not limited to: enabling root
  commands only from the invoking terminal; not requiring a password for
  certain commands; requiring a password per user or group; requiring
  re-entry of a password every time or never requiring a password at all
  for a particular command line. It can also be configured to permit
  passing arguments or multiple commands, and even supports commands
  with regular expressions.

Its a temporary one-time command with superuser (administrator) privileges without direct root login.


Changing keyboard button in Ubuntu 20.04

Yes, this is possible with the basic x-server tool xkbcomp.
First get your current keyboard layout with xkbcomp $DISPLAY ~/.config.xkb. Then open the .config.xkb file with some editor, say vscode. You can see the file consists of 5 blocks(keycodes, types, compatibility, symbols, geometry):
xkb_keymap {
xkb_keycodes "..." {...};
xkb_types "..." {...};
xkb_compatibility "..." {...};
xkb_symbols "..." {...};
xkb_geometry "..." {...};
}

In the xkb_types block, add:
type "newType" {
    modifiers= Shift+Alt;
    map[Shift]= Level2;
    map[Alt]= Level3;
    level_name[Level1]= "Base";
    level_name[Level2]= "Shift";
    level_name[Level3]= "Alt";
};

In the xkb_symbols block, find the following  sub-block:
key <AD12> {         [    bracketright,      braceright ] };

And change the sub-block to:
key <AD12> {                 type= "newType",
    symbols[Group1]= [              bracketright,      braceright, bracketleft],
    actions[Group1]= [      NoAction(),      NoAction(),   RedirectKey(keycode=<AD11>, clearmods=Alt) ]
 };

Finally, to make it into effect, run xkbcomp ~/.config.xkb $DISPLAY, and see if it satisfies your requirement. If necessary, set it to automatically run at startup.
For more information on xkbcomp, see https://wiki.archlinux.org/index.php/X_keyboard_extension.


Nothing happen after a command mount -t (worked before)

had to use the following NFS command to make it work

192.168.1.2:/volume1/Films /home/user/Films nfs defaults,user,auto,noatime,intr 0 0


bind9 DNS works predictably for OSX machines but not for Windows machines

Hmm ... baffling ... I have found a way around this problem. I still don't understand the original issue but it went away when I did the following:

I had set the DNS server on each machine that I was using to test from because I didn't want to upset the 'Super User' who was hitting the internet with full force this morning. By super user I mean my wife.

Anyway, when she wandered away from her machine I set the DNS server on the router and removed references to it from all local machines and restarted everything.

Now it works. And my wife never even noticed me bringing the network down for a bit. All round good result I say!


I could confirm this problem on my side.
According to what Engineer77 suggested, killall nautilus could restore the correct font size, I added below line to ~/.profile
(sleep 5; killall nautilus) &

This kills nautilus after 5 seconds when you logged in , works fine for me.


What is the difference between dhcp3-server and isc-dhcp-server packages?

Based on these links:

https://launchpad.net/ubuntu/+source/isc-dhcp

dhcp3-client: ISC DHCP server (transitional package)
dhcp3-common: ISC DHCP common files (transitional package)
dhcp3-dev: ISC DHCP development files (transitional package)
dhcp3-relay: ISC DHCP relay (transitional package)
dhcp3-server: ISC DHCP server **(transitional package)**
isc-dhcp-client: ISC DHCP client
isc-dhcp-client-dbg: ISC DHCP client (debugging symbols)
isc-dhcp-client-udeb: ISC DHCP Client for debian-installer
isc-dhcp-common: common files used by all the isc-dhcp* packages
isc-dhcp-dev: API for accessing and modifying the DHCP server and client state
isc-dhcp-relay: ISC DHCP relay daemon
isc-dhcp-relay-dbg: DHCP relay daemon (debugging symbols)
**isc-dhcp-server: ISC DHCP server for automatic IP address assignment**
isc-dhcp-server-dbg: ISC DHCP server for automatic IP address assignment (debug)
isc-dhcp-server-ldap: DHCP server able to use LDAP as backend

https://bugs.launchpad.net/ubuntu/+source/ltsp/+bug/934014

ltsp-server still Suggests and ltsp-server-standalone still Recommends the old DHCP3 server. Those dependencies need to be upgraded to instead use isc-dhcp-server.

http://packages.debian.org/search?keywords=dhcp3-server

squeeze (stable) (net): ISC DHCP server (transitional package)
4.1.1-P1-15+squeeze8 [security]: all
also provided by: isc-dhcp-server

it seems that isc-dhcp-server is newer, and replaces dhcp3


How do I enable my wireless card? (Dell Inspiron 9400 with Ubuntu 12.10)

The following command should work (if you have an ethernet connection):

sudo apt-get install firmware-b43-installer

Open the terminal, run the above code and reboot your computer.


Note: all commands should be done from sudo

First, reduce size of your root volume to make some room for a snapshot volume

Boot from Live CD
fdisk -l to see name of your device.

Device       Start       End   Sectors   Size Type
/dev/sda1     2048   1050623   1048576   512M EFI System
/dev/sda2  1050624   2050047    999424   488M Linux filesystem
/dev/sda3  2050048 500117503 498067456 237.5G Linux filesystem

/dev/sda3 in my case
cryptsetup luksOpen /dev/sda3 crypt1 to decrypt your volume
vgscan --mknodes to find all volume groups

Reading all physical volumes. This may take a while...
Found volume group "ubuntu-vg" using metadata type lvm2

vgchange -ay to activate all your volume groups

2 logical volume(s) in volume group "ubuntu-vg" now active

lvreduce -r -L -20G /dev/ubuntu-vg/root to reduce size of your root volume by 20 Gb. This may take a while (it took ~4 min for me).
That space will later be used to create LVM snapshots.
vgs to see that you actually got 20G of free space

VG           #PV   #LV   #SN   Attr     VSize     VFree
ubuntu-vg     1      2     0   wz--n-   230.44g   20.01g

reboot and remove Live CD

Create a snapshot (i.e., activate "experimentation" mode)

Now whenever you want to do something risky with your system, run the following command

lvcreate -s -n snap -L 20G /dev/ubuntu-vg/root
Note: /dev/ubuntu-vg/root is a logical volume that you want to have a snapshot of
lvs to see that the volume has been created

LV     VG            Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
root   ubuntu-vg     owi-aos--- 201.59g
snap   ubuntu-vg     swi-a-s---  20.00g      root   0.00
swap_1 ubuntu-vg     -wi-ao----  15.90g

The snapshot is active from the moment you run lvcreate. You can now start experimenting with new things.

Scenario #1: You want to revert changes

lvconvert --merge /dev/mapper/ubuntu--vg-snap

Logical volume ubuntu-vg/root contains a filesystem in use.
Can't merge over open origin volume.
Merging of snapshot ubuntu-vg/snap will occur on next activation of ubuntu-vg/root.

reboot

Scenario #2: You want to persist changes

lvremove /dev/mapper/ubuntu--vg-snap

In Conclusion

You basically have to run lvcreate to start the process and then either run lvconvert --merge or lvremove to end it.

Keep in mind that when the snapshot is active, due to Copy-On-Write strategy all the changes are saved to those 20Gb of space (or whatever value you set).
One way of checking the remaining capacity is to look at Data% column of lvs command.


How much hard drive space should I allocate to Ubuntu?

Just set the disk to dynamic and choose about 100GB, then the drive will grow as you need it to but not larger then 100GB and it will stay small and only expand as you add more applications.

For example if your install size is 10GB then that will be the actual size of the disk but it will be able to grow as needed up to 100GB or whatever you set the limit at.

Dynamic hard drive space is explained in the last image.


Take a "snapshot" of the window arrangement and restore it

The script below can be used to get the current window positions of all "normal" windows (run with the argument -get), or restore the last window arrangement (run with the argument -restore).

As explained here, using wmctrl i.c.w. Unity has some issues. If it is satisfying in your situation is to decide.

How to use

The script uses wmctrl:

sudo apt-get install wmctrl

Then:

Copy the script into an empty file, save it as window_arrange.py
Run it by:

python3 /path/to/window_arrange.py -get

to "record" the current window arrangement, and

python3 /path/to/window_arrange.py -restore

to restore the last "recorded" window arrangement

The script:

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

wfile = os.environ["HOME"]+"/.windowlist"
arg = sys.argv[1]

def get(command):
    return subprocess.check_output(["/bin/bash", "-c", command]).decode("utf-8")

def check_window(w_id):
    w_type = get("xprop -id "+w_id)
    if " _NET_WM_WINDOW_TYPE_NORMAL" in w_type:
        return True
    else:
        return False

def read_windows():
    w_list =  [l.split()[:6] for l in get("wmctrl -lG").splitlines()]
    relevant = [(" ").join(w) for w in w_list if check_window(w[0]) == True]
    with open(wfile, "wt") as out:
        for item in relevant:
            out.write(item+"\n")

def restore_windows():
    try:
        wlist = [l.split() for l in open(wfile).read().splitlines()]
    except FileNotFoundError:
        pass
    else:
        for w in wlist:
            try:
                cmd = "wmctrl -ir "+w[0]+" -e 0,"+(",").join(w[2:])
                subprocess.Popen(["/bin/bash", "-c", cmd])
            except:
                pass

if arg == "-restore":
    restore_windows()
elif arg == "-get":
    read_windows()


you can use bash expression $(command) for command substitution as below within your command and format the date bar on your expectations.

exiftool -exififd:dateTimeOriginal="$(date + "%y:%m:%d") 00" test.jpg


Reinstall ubuntu to SSD without any changes to home portion in HDD

The safest way would be to Install ubuntu to the SSD, then create your mount points and edit /etc/fstab to auto mount them.

first install ubuntu to the 32 GB SSD, use all space with /, swap, and EFI par titions.

Next use gparted to get the UUID of the partitions on the HDD. Click the partition, then in the pull down menu Information. record the UUID's

First mount home partition.
sudo mount /dev/sdb# /home
change # to the partition number for your home partition

Next, create the mount points for the two data partitions.
sudo mkdir /path/to/mount

Last, edit etc/fstab to add automount entries.
for each partition you need to add a line in the following format:

UUID    mount point   file system type  options dump   pass

Thus you would add three lines like this:

UUID=(IDofHomePart)  /home          ext4   defaults  0  2
UUID=(IDofDataPart1) /path/to/mount ext4   defaults  0  2
UUID=(IDofDataPArt2) /path/to/mount ext4   defaults  0  2

then reboot


How do I delete multiple lines in nano without affecting the clipboard?

nano of course can delete blocks, see this article

use CTRL+Shift+6 to mark the beginning of your block
move cursor with arrow keys to end of your block, the text will be highlighted.
use CTRL+K to cut/delete block.

To paste the block to another place, move cursor to the position and the use CTRL+U. You can paste the block as often as you want to.


Why does the sequence matter in the execution of these bash commands?

The time command in your pipeline is not the /usr/bin/time binary, but the bash time built-in. Compare man time with help time. The error you see is bash failing to parse time's argument. This must either be present or be a newline. It is a newline in your first example but absent in the second.

On the other hand, if you were to run

ls;date;'time'

or

ls;'time';date

where the quotes around 'time' revoke its status as a reserved word, then bash has no problems parsing the line. It now parses three commands in a list, which it will execute in sequence, and /usr/bin/time will report a usage error in either case.

Addendum

It was observed that though time ; date yields an error, time ; ; date does not. The likely explanation is that time ; is interpreted by bash as equivalent to time <newline>. The expression time ; ; date is then parsed as the list of time ; and date.

This is consistent with the observation that time ; and time ; ; are legal as well, the second being parsed as the singleton list containing time ; followed by the optional semicolon allowed after lists.

So another way of explaining why time ; date yields the error bash: syntax error near unexpected token 'date' is that time consumes the semicolon separating it from date. It can only do that because time is a bash reserved word.


First thing to point out, there is no 16.04 version on the site it only gives PPA for up to 14.04, you must use a PPA for your version of Ubuntu.

I found a 16.04 version on git hub, here are the instructions

wget "https://github.com/ugcoder/avro/releases/download/v2.0/avro_2.0-1_all.deb"
sudo dpkg -i avro_2.0-1_all.deb

To resolve any missing dependencies

sudo apt-get install -fy

Go to System Settings -> Language Support from Unity Launcher
Look at the Keyboard input method system
Select IBus and close the window.

I believe that you need to restart IBus to make everything work fine. Try the following command:

ibus restart

Now go to System Settings -> Keyboard -> Text Entry.
Search and add Avro Phonetic as input source. That's all.


TeamViewer only runs when GUI has been started

I have this issue too and found that it may be with the program itself. My solution was to use a program available in Ubuntu called gDevilspie.

You will have to set up two rules in the program to hide the main window and contact list.

Here is how I set up TeamViewer

here are the settings I used:

For TeamViewer:

application_name equals Computers & Contacts
window_name      equals Computers & Contacts

the screen shot shows the actions for that window

For TeamViewer2:

application_name equals TeamViewer
window_name      equals TeamViewer

The actions I used for this rule are:
close

This for the way my TeamViewer is setup .. this will close the main window and leave it sitting in my tray running.

Now even though it is in the tray running ... If I want to view it I cannot click on the icon and choose Show TeamViewer or it will just open and close again. I have to stop gDevilspie to open / view the program .. just keep that in mind


If you remove all of the partitions from the unused drive it should be obvious in the installation which drive to install Ubuntu to. You could also disconnect the drive with windows during the installation and configure the dual boot once Ubuntu is installed.


Is there a scanner for scanning unused files in my system?

I'd recommend using the

find -name [filename]

This does not delete the files but the find command will help find the directory tree(s) of the files you are looking for.


How to confirm that isc-dhcp service works in Ubuntu server 16.04?

check your config file

#Global Directives
authoritatives;

That should say:

#Global Directives
authoritative;

Remove the "s" at the end.