Can I automatically send a particular application's window to the lowest z-position, when it loses focus?

What you ask is actually to allow a specific application's window to only appear either on first- or last position, z-wise.

When the gedit window (in this example) loses focus, it is sent to the last poition (z-wise, below the semi-transparent terminal window) instead of descending only one position:

Z- position of a window

While it can be done, we still have to overcome some serious complications; When the window is sent to the very last position, you will want to keep the z-order of all other windows. However, currently, there are no tools that can give us this z-order of windows. Both xdotool and wmctrl give us no information on this whatsoever.

What we can do however is to keep track of the focus history of (all) windows. Since a window descends one position if another window gets focus, we can conclude the z-order of windows if we run a background script to watch the focus history of windows.

The solution two small background scripts

The solution below exists of two small background scripts, to run simultaneously.

A script to keep track of the focus history: focus_history.py
A script to send the targeted application's window to the last position if it loses focus: set_z.py

Script 1

focus-history.py

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

rootdata = os.environ["HOME"]+"/.focus_history"
open(rootdata, "wt").write("This is an empty line")

def current_windows():
    try:
        return subprocess.check_output(["wmctrl", "-lp"]).decode("utf-8")
    except subprocess.CalledProcessError:
        pass

def convert_format(w_id):
    return w_id[:2]+(10-len(w_id))*"0"+w_id[2:]

def read_data():
    return open(rootdata).read().splitlines()

def get_top(wlist):
    try:
        top = convert_format(
            [l.split("#")[-1].strip() for l in subprocess.check_output(
                ["xprop", "-root"]
                ).decode("utf-8").splitlines() \
               if "_NET_ACTIVE_WINDOW(WINDOW)" in l][0])
        return [l for l in wlist if top in l][0]
    except IndexError:
        pass

if __name__ == "__main__":
    while True:
        time.sleep(1)
        wdata = current_windows()
        if wdata != None:
            wlist = wdata.splitlines()
            # get frontmost window (as in wmctrl -lG)
            top = get_top(wlist)
            oldlist = read_data()
            if not any([top == oldlist[0], top == None]):
                # clean up closed windows
                [oldlist.remove(l) for l in oldlist if not l.split()[0] in wdata]
                # remove possible other mentions of the active window
                [oldlist.remove(l) for l in oldlist if l.startswith(top.split()[0])]
                open(rootdata, "wt").write(("\n").join([top]+oldlist))

Script 2

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

# --- set the process name of your application below
proc = "gedit"
# ---

focus_hist = focus_history.rootdata

def get(val):
    try:
        return subprocess.check_output(val).decode("utf-8").strip()
    except subprocess.CalledProcessError:
        pass

def front_w():
    get_front = str(hex(int(get(["xdotool", "getactivewindow"]))))
    return get_front[:2]+(10-len(get_front))*"0"+get_front[2:]

while True:
    time.sleep(1)
    pid = get(["pgrep", proc])
    front1 = ""
    while pid:
        time.sleep(1)
        frontpid = get(["xdotool", "getactivewindow", "getwindowpid"])
        front2 = frontpid == pid
        if front2 != front1:
            if front2 == False:
                zdata = [l for l in open(focus_hist).read().splitlines()]
                wins = list(reversed([l.split()[0] for l in zdata if not pid in l]))
                for w in wins+[front_w()]:
                    cmd = ["xdotool", "windowraise", w]
                    subprocess.call(cmd)
        pid = get(["pgrep", proc])
        front1 = front2

How to set up

The script uses both wmctrl and xdotool

sudo apt-get install wmctrl xdotool

Copy script 1 into an empty file, save it (exactly!) as focus_history.py
Copy script 2 into an empty file, save it as set_z.py in the exact same directory as script 1.

In the head section of the script, in the line:

proc = "gedit"

replace "gedit" by the process name of your application (between quotes)
Test- run the script: Before opening any (additional) windows, start script 1 by the command:

python3 /path/to/focus_history.py & python3 /path/to/set_z.py

[The script will recognize windows that were focussed at least once. That will be the case if the script is run on log in]

As mentioned, the scripts should be in one and the same directory, on the same level.
Now start opening windows and see how it behaves. Your application should move to the (very) background if it loses focus.
If all works fine, add it to Startup Applications: Dash > Startup Applications > Add. Add the command:

/bin/bash -c "sleep 15 && python3 /path/to/focus_history.py & python3 /path/to/set_z.py"

Notes

the setup assumes you have a single window open of the targeted application. From your question, I understand that is the case.

Alternatively

Alternatively, you could set a shortcut key to raise a specific applications's window if it exists, as explained here.

That would require however to have another shortcut to go back to the first application's window,

Unless...,

You would setup one shortcut to toggle between two applications. That would however be out of the scope of this question...


Is there a way to hide files after compressed?

Encrypt the archive header as well with the -mhe=on argument to 7za. Note that this only works for producing .7z files. From man 7za:

  SWITCHES

        ⋮
        -mhe=on|off
               7z format only : enables or disables archive header encryption (Default : off)


Your problem is not related to UDP directly. The problem is that one of your cores is maxed and some application involved in your use of UDP cannot take advantage of more than one core. Your choices are to profile/optimize it to get it to do its job with the resources available or to redesign it to use multiple threads or multiple processes so that it can take advantage of the other cores.

Exactly how you do this depends on what's wrong with the code now. One possibility is if the code looks roughly like this:

while(1)
{
 do_udp_stuff(); // this is fairly simple
 do_other_stuff(); // this is complex
}

In this case, the solution is either to optimize the do_other_stuff or move it to a different thread.

Another possibility is if the code looks like this:

while(1)
{
 do_some_work_which_generates_a_UDP_Packet();
 send_udp_patch();
}
// or
while(1)
{
 receive_UDP_packet();
 process_UDP_packet();
}

In this case, the solution may be to have more than one thread doing the work that generates the UDP packet or processing the UDP packet.

Basically, you either have to reduce the amount of CPU you use per UDP packet or you need to increase your CPU utilization efficiency by distributing the work over the cores.


Keyboard Layouts Plugin forgets settings, unable find workaround

Well, the right answer is: There is a typo. It's not Q U ERTY, but Q W ERTY! I promise next time I'll ask at the morning, being fresh.

However, until I realized it's typo, I searched and experimented even more and I came up with a different, less hackish solution:

I found out there is a /etc/default/keyboard file with keyboard settings. If I edit it and then dare to touch Keyboard Layouts Plugin, my changes are preserved even after multiple restarts. No need for any hacks with setxkbmap.

I edited the file in a following way:

# Check /usr/share/doc/keyboard-configuration/README.Debian for
# documentation on what to do after having modified this file.

# The following variables describe your keyboard and can have the same
# values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options
# in /etc/X11/xorg.conf.

XKBMODEL="pc105"
XKBLAYOUT="cz,us"
XKBVARIANT="qwerty"
XKBOPTIONS="grp:alt_shift_toggle"

# If you don't want to use the XKB layout on the console, you can
# specify an alternative keymap.  Make sure it will be accessible
# before /usr is mounted.
# KMAP=/etc/console-setup/defkeymap.kmap.gz

This works. Hope it helps someone!

See also:

http://ubuntu.sabza.org/2006/10/13/xubuntu-easily-switch-keyboard-layout/
http://blog.ssokolow.com/archives/2011/12/24/getting-your-way-with-setxkbmap/


How can I configure logrotate without having `/etc/logrotate.d/rsyslog`?

You don't need the /etc/logrotate.d/rsyslog file to rotate logs. Any file that you create in the /etc/logrotate.d directory can be used to rotate logs. the files are usually created with root ownership and 644 permissions (rx-r--r--).

I do have a /etc/logrotate.d/rsyslog file on my 14.04 server and these are the contents.

/var/log/syslog
{
        rotate 7
        daily
        missingok
        notifempty
        delaycompress
        compress
        postrotate
                reload rsyslog >/dev/null 2>&1 || true
        endscript
}

/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
{
        rotate 4
        weekly
        missingok
        notifempty
        compress
        delaycompress
        sharedscripts
        postrotate
                reload rsyslog >/dev/null 2>&1 || true
        endscript
}

There may be no logs in your syslog file if it was created after rotation with the wrong permissions and ownership. mine are set to 640 permissions (rw-r-----) and syslog:adm as owner and group.


Try using the nouveux graphics driver.
If that doesn't work, use Ubuntu 2D when you login (press the Ubuntu logo to the right of your name).
If that doesn't work, use the command 'sudo apt-get install lubuntu-desktop' in Terminal and relog into Lubuntu, it is even more lightweight than Unity 2D so it may not flicker your screen.

(I have added this nVidia driver bug to Launchpad (bug reporting) for you:  https://bugs.launchpad.net/nvidia-drivers-ubuntu/+bug/245383)


How to remobe lubuntu 20.04 from ubuntu 20.04?

Unless you took note of all packages that were installed when you installed  lubuntu-desktop, it will be difficult to granularly remove any packages that were brought in during the installation of the package.
lubuntu-desktop is a meta-package. It depends on all packages that are considered an essential part of the lubuntu desktop. Thus, simply installing lubuntu-desktop will pull in all these packages, in so far they are not installed already. However, removing lubuntu-desktop will only remove the tiny package itself. Because most of the "main" application packages (e.g., the editor, system tools, ...) are marked as "manually installed", it is not possible to automatically remove them with apt autoremove after removing `lubuntu-desktop.
Precautions next time you want to install an additional desktop environment
Install using the sudo apt install command. That lists all packages that are going to be installed. Copy and paste the names of these packages to a text file. If you want to undo the installation, then just remove all these packages.
At this time, where you already removed the lubuntu-package
There is not a lot you can do yourself. If you run sudo apt install lubuntu-desktop again, only the packages that may have been removed by an sudo apt autoremove will be listed. Many of the packages still are installed.
You could look at all dependencies of lubuntu-desktop. However, these will also include packages that are also needed by your current desktop environment.
You could ask another user to see what packages lubuntu-desktop brings in. However, that list will depend on the desktop currently installed on the system of that other user, and on applications that user may have added or removed.
Removing applications followed by autoremove
What you can do, is manually remove applications you know came with Lubuntu (or eventually applications you do not seem to miss). A subsequent sudo apt autoremove will then automatically remove these dependencies (libraries etc.) that are not anymore required by other installed packages.
This way, you can go a large way in effectively removing the Lubuntu desktop up to the point that, as a user, you do not see traces anymore. However, there is no certainty that all packages effectively are gone. That is, from a practical viewpoint, not really a concern.
Boot screen: plymouth
Removing the packages plymouth-theme-lubuntu-logo and plymouth-theme-lubuntu-text will cause your boot screen appearance to revert to the original.


I can't figure out how systemd integrates on Ubuntu 16.04

The init.d scripts source some bash function from LSB  package

. /lib/lsb/init-functions

Which load other ones from other packages

# Include hooks from other packages in /lib/lsb/init-functions.d
for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null); do
    [ -r $hook ] && . $hook || true
done

Where systemd inject its own redirection

~$ dpkg -S /lib/lsb/init-functions.d/40-systemd
systemd: /lib/lsb/init-functions.d/40-systemd

Note: Found using strace /etc/init.d/.. status


Trying to create an alias in Ubuntu 12.10 but it’s not working

I finally found one suitable solution for this problem. if there is a ~/.bash_login file and its not empty then ~/.bashrc file is not automatically loaded when we open the shell. If we move that ~/.bash_login

mv ~/.bash_login ~/.bash_login_old

then ~/.bashrc file will be loaded and also it will load the ~/.bash_aliases file if the following lines are uncommented in the ~/.bashrc file.

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

One other solution I can think of is if you dont want to rename or delete your ~/.bash_login file then what you can do is when you are in the shell just type this command bash and it will load the ~/.bashrc file.


Can I change the name of the guake tab to show the current command?

I am not sure this works for guake, it works for most terminal emulators.
You can include an echo on your scripts to change the terminal title:

echo -ne "\033]0;your_title_here\007"


Resizing Ubuntu Partition, but the partitions are not adjacent

This can be solved mostly with GParted from a LiveCD:

You can temporarily disable the swap partition, which GParted should allow you to do through the partition context menu. Otherwise use sudo swapoff /dev/sda7.
Now you can delete the swap partition. This is safe, because (disabled) swap partitions hold no useful data.
Re-arrange and grow your partition(s) as you like, but leave some space for a new swap partition.
Create a new partition in the remaining unallocated space and format it as swap. Commit your changes.
Now you need to edit /etc/fstab to point to the newly created swap partition as described under https://askubuntu.com/a/166110/175814.

According to your current configuration, you need to change the UUID in the first column of the last line to what you get from blkid for /dev/sda6 (I don't want to transcribe the whole UUID from that image):

UUID=b42c...  none  swap  sw  0  0

It would be sensible to delete the second to last line (# swap was on…), because the statement in the comment is irrelevant now.


When you start Putty, go under the Bell tab and configure it the way you wish

Save your session ;)

For additional information see http://kb.site5.com/shell-access-ssh/putty-how-to-change-the-bell-style-and-settings/ or the PuTTy documentation of your choice.


Since you've also posted this question to Stack Overflow, the answer there might apply here too.


Ubuntu 12.04 LTS can't find my wireless card or the network after I shutdown and turn my system back on

Run echo b43 | sudo tee -a /etc/modules. That should make sure the b43 module gets autoloaded, and your wifi should work after shutdowns.


How do I update to Ubuntu 12.04 if update manager doesn't prompt it?

Make sure that all possible updates are installed using update-manager.

After that you can trigger the update-manager with the dist-upgrade option which should start it showing the upgrade option to 12.04.
Do it like this:

Press Alt+F2
Type "update-manager --dist-upgrade" and press enter

If that doesn't work it might be that all your repositories are already changed to the new distribution. You just need to finalize the installation:

Press Alt+F2
Type "gnome-terminal" and press enter
In the terminal window type "sudo apt-get update; sudo apt-get upgrade"
Enter your password when prompted
Accept the proposed update

Please let us know if one of these ways worked for you.


How to make changes in gconf-editor permanent

Open Startup Applications,

Press Add to add a new startup program, name it, and write into the command box

xterm -e gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close

press Save and it should work as this command will be executed every time you log in.


Installing GSL libraries in Ubuntu 16.04 via terminal

Try:

sudo apt-get install libgsl-dev

It should work on Ubuntu 18.04 as well.


You can use this link on Macromedia's site to give permissions to the site


how do i remove a frugal install from C:\

I tried this and failed as well, what you basically need to do is very simple. Just launch unetbootin and you'll get a prompt that says "Unetbootin is already installed. Uninstall?" Click yes and all linux files will be deleted.


Is using exFat (linux driver) for writing backups safe?

We use the same setup here at my workplace, CloneZilla to a USB or Windows shared file server. Works fine to ExFAT with no memorable errors.


Connect a folder to the server to share via Samba FROM THE TERMINAL

Connecting to Samba from the terminal command line

The file browser users a resource such as gio (or gvfs-mount) to mount the device.  The address you are seeing as a suggestion to put in can be put into this the gio commandline:

For Ubuntu 16.04 and earlier:

$ gfvs-mount "smb://[yourserver]/[yourshare]"

For Ubuntu 18.04 and later:

$ gio mount "smb://[yourserver]/[yourshare]"

You can access the share at:

/run/user/[your user ID]/gvfs

Connecting to the Samba share on computer boot

You can make it permanent by added this to the /etc/fstab file:

//servername/servershare /mysharedfolder cifs nofail,auto,uid=[username],gid=users,file_mode=0660,dir_mode=0775,iocharset=iso8859-15,credentials=/etc/smbpasswd 0 0

The /etc/smbpasswd file is a text file with this format:

username=[username]
password=[passsword]

The [name] is to be replaced with credential information.  Don't include the brackets.


Open the dash and type startup, it should show up.


TL;DR: Move sudo across the pipe  (|) to the at command itself.

You haven't really been running at as root.

You ran cat as root (sudo cat ...), and piped the output of cat to at, but you did not run the at command itself as root.

On many systems, some non-root users are permitted to run at jobs. However, if that's not what you want, your system is configured the way you like, and you intend to run this particular at job as root, then you can solve the problem by running at as root instead of cat. (Either way, you do not need to run cat as root in this situation.)

To do that, put sudo before at instead of cat:

cat << EOF | sudo at 'now + 1 minute'

Optional details:

Currently you have:

sudo cat << EOF | at 'now + 1 minute'
echo "hello"
EOF

That runs cat as root with sudo, passing echo "hello" to it (with here-document syntax). The cat command's standard output is piped to the command at 'now + 1 minute', which is not run as root. Therefore at attempts to schedule the job as the non-root user who ran it (you).

If you want the at job to run as root, you can fix this problem by changing it to:

cat << EOF | sudo at 'now + 1 minute'
echo "hello"
EOF

If you later configure a non-root user account that you're using to be permitted to run at jobs, then you would run neither command as root:

cat << EOF | at 'now + 1 minute'
echo "hello"
EOF


Python 3 error when running the print command

In Python3 print is a function:

print("Hello, World!")

Check:
http://docs.python.org/release/3.0.1/whatsnew/3.0.html


No. You'll have to call out to an external program.

$ echo 'l(10)' | bc -l
2.30258509299404568401


Ubuntu 14.04.2 desktop alongside windows 7: GRUB not shown until secure boot is disabled

When you installed Ubuntu in EFI mode with secure boot enabled you only can boot Ubuntu with secure boot enabled. You can solve your problem as described by following these instructions ->

First boot into Windows 7 OS and disable hibernation.
Open command prompt as administrator and execute:

powercfg /h off

Shutdown the machine (do NOT reboot) completely.

Reinstall the GRUB bootloader to your Ubuntu installation  in EFI mode.
Boot from the Ubuntu install media - then  open a terminal and execute:

sudo mount /dev/sda6 /mnt
sudo mount /dev/sda2 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sda
update-grub

Note : sda = disk | sda2 = efi partition | sda6 = system partition | (taken from pastebin output)

Boot into BIOS and change the boot order in UEFI settings.
Select Ubuntu to be the default operating system to boot.
Now you can select which system to boot from GRUB menu.

You can check the partitions with GParted - the tool is included in Ubuntu installation media.
I strongly recommend to not use any 3rd party tools as they may bring along issues later on !


Installing Windows 8 over 12.04, but getting "error: unknown filesystem"

You’ll need to get your Windows 7 or Windows Vista retail disc or
  download the free recovery media from NeoSmart.net

  Note: If you don’t have a retail disc with your computer, and instead
  you had to make a recovery media with your PC, don’t worry – you can
  download a Windows 7/Vista recovery disc that allows you to do the
  same thing with a retail disc – except reinstall Windows of course:
  see http://neosmart.net/blog/2009/windows-7-system-repair-discs/ for
  Windows 7 and
  http://neosmart.net/blog/2008/windows-vista-recovery-disc-download/
  for Windows Vista. It’s in ISO format that you can easily burn to a
  disc.

  Put the disc in, then as it comes up to the installation section (for
  retail discs), click “Repair my computer” then go and select your
  Windows installation, and from there select Command Prompt. For the
  recovery media discs you downloaded from NeoSmart – we’re not sure
  what the steps are, but it’s probably similar.

  Then you need to type:

  Note: execute one command at a time

  bootrec.exe /FixBoot

  bootrec.exe /FixMbr

  It takes less than a second. Reboot and it’ll boot into Windows
  automatically. Then go to Start menu, right click Computer and select
  Manage. Go to Disk Management from here, and delete the partitions
  related to Ubuntu. Once you’ve done this, extend the volume size of
  your Windows partition to take the remaining free space. To
  delete/extend volume size of a partition, you right click.

Source: http://blog.eukhost.com/webhosting/howto-remove-grub-loader-and-restore-windows-7-and-vista-bootloader/


You can download the theme from, and install it via gnome-tweak-tool. Detailed descriptions are present in the link.


Why are there different version numbers on X.org

My guess is you are confusing Xorg numbering and the numbering of the modules.

  Xorg version numbering has changed since xorg 7.0. Nowadays, Xorg is released with a version number (like 7.4). This release is composed of various modules which have their own version number (each module started at version "1.0" when Xorg 7.0 development cycle started). For instance, Xorg 7.3 was shipped with Xserver version v1.4, xf86-input-evdev v1.1.5, xf86-video-intel v2.1.1

https://wiki.debian.org/Xorg

and

http://who-t.blogspot.com/2009/10/x11r75-released-but-what-is-it.html

If that does not clarify your version numbers, update your question with version of Ubuntu and the specific packages you are asking about.


What do "Unamplified" and "100%" mean when describing "Output volume"?

You are seeing this because your sound card supports amplification beyond the normal range of the actual volume. Unamplified is the normal maximum, the next marker (100%) represents the maximum amplification that your sound card supports (ie how much your sound card can amplify sound on it's own), and the highest one (the unmarked end of the slider) is the amplification that is available from pulseaudio (on top of what your sound card supports).

The safest is Unamplified%, but 100% (the second marker) might also be safe depending on the volume of what you are playing and your speaker quality. If you are playing very low volume audio files, and you don't want to use normalization, you can use these features to your advantage.


How can I configure Tomcat 9 without apt-get installation?

Ports below 1024 can be opened only by root.

You can do one of three things:

Option 1 - Run tomcat as root

$ sudo sh startup.sh

Option 2 - Redirect port 80 to another port using iptables

With this option, you keep Tomcat running on a port above 1024 and use iptables to forward that port to Tomcat.  (e.g. 80 -> 8080)

$ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

Option 3 - Upgrade privileges to java applications

Either:

Change CAP_NET_BIND_SERVICE, e.g.

`$ sudo setcap CAP_NET_BIND_SERVICE=+eip /path/to/java`

Warning that will enable all java applications to open ports lower than 1024.

or use authbind

$ sudo apt install authbind
$ sudo touch /etc/authbind/byport/80
$ sudo chmod 777 /etc/authbind/byport/80


unable to mount hard drives in /etc/fstab

it appears to be a ntfs partition. change "vfat" to auto in your fstab entry.


Is there any hope of Remnant's monthly release proposal going active?

It's not at all apparent that attempting to release significant updates every month will improve Ubuntu's quality, and there's fear it will make Ubuntu's quality assurance worse as Ubuntu has a limited number of developers and testers.

My opinion is that it's not Canonical's decision alone because Ubuntu is a product of Canonical paid developers and community developers (in addition to all the work done by the many upstreams including Debian, GNOME, and so on). This would at least partly lie in the Technical Board's responsibility. Besides Mark Shuttleworth, the Technical Board has 3 Canonical employees and 3 members from the community.

It's a decision that would need widespread developer support which so far I've not seen. It will definitely be discussed among participants at the next Ubuntu Developer Summit in a few weeks but don't count on it happening any time soon.


Ubuntu 16.04 - Wireless adapter is timing out (rtl8192cu)

The support for your device has been added to the new kernel. Just use Ubuntu zesty.


upstart respawn with two child processes

I would "outsource" the work to a bash script:

start on runlevel [2345]
respawn

script
  exec /path/to/bash/script
end script

the script

#! /bin/bash -e

su - ubuntu -c "cd /opt/app; bin/widget" |& logger -t 'widget'

exit ${PIPESTATUS[0]}

The PIPESTATUS array in bash stores pipe return values, in this case we use the return value of the su command.


@user535733 : Thanks

Kernel packages are named linux-modules-kernel_version so:

To reinstall the current kernel

 sudo apt install --reinstall linux-modules-$(uname -r)

Or for example  in the usual case where the kernel is the generic version: linux-modules-<version-number>-generic :

 sudo apt install --reinstall linux-modules-5.4.0-26-generic


If you have nvidia card you should install the nvidia drivers , from your about screen you use the onboard graphics.

Also another idea is to install the new ubuntu lts version 20.04.
New kernel , maybe new drivers there is a chance will fix your problem.


Go to Settings -> Device -> Keyboard

Here you can view existing keyboard shortcuts and create custom ones.

If you want to see/modify which shortcut are already used (like lock screen), you would be able to watch a list, or you can scroll down until you see a + icon which allow you to create a custom shortcut.

Personally, I have a shortcut to open System Monitor (that's not a default package, use sudo apt install gnome-system-monitor to install it) using Ctrl+Alt+Insert (because Ctrl+Alt+Del is already used for disconnection), but you can do whatever you like. So just add the gnome-system-monitor command inside the command field when you create the shortcut.

Note: Win is called Super in the Linux language.


Lets try this temporary fix:

Open this file /etc/vmware-tools/tools.conf

sudo nano /etc/vmware-tools/tools.conf

Add the following lines to it:

[logging]
vmusr.level = error
vmsvc.level = error

Restart vmware services with:

sudo systemctl restart vmware

Restart mysql service:

sudo systemctl restart mysql

#OR --> for Ubuntu 14.04

sudo service mysql restart

Source:

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2036350


How to install Pentablet Divers for XP Pen Deco 01 on Ubuntu 18.04?

https://www.xp-pen.com/ask/detail/id/220/channel/66.html

Connect your XP-Pen product into computer
Open driver folder then click right button – Properties on Pentablet_Driver.sh.
Go to Permissions tab then make sure enable “Allow executing file as program” function.
Run terminal from the folder where is your downloaded extracted driver
Run: sudo ./Pentablet_Driver.sh

The command  "sudo ./Pentablet_Driver.sh" needs to be run in terminal everytime after pc or application restarts.


gnome-schedule was removed from Debian and Ubuntu because it's very old and hasn't been updated in years. The last supported version of Ubuntu to still have it available in the repositories is 14.04 LTS.

Ubuntu 15.10 is no longer supported.


How to redirect the output from desktop-entry

You can't do that directly since that command is executed directly, not via a shell, so I/O redirection doesn't work here.
But it should work to wrap it into a shell call, like this:
Exec=sh -c "mono --debug prg.exe arg1 > log.txt"

Be advised that while this is quite okay to do some debugging, if this is something more permanent, I'd move that into a shell script. Desktop files are not suitable for serious scripting.


Enable/press scroll lock at login screen

Add this command to start up:

xset led named "Scroll Lock"

To do so search for "Startup Applications Preferences" or run this in the terminal:

gnome-session-properties

Then add the start up command


How can I make a console window only appear if the command I'm running produces output?

You'd probably have to draw it out into a script where you could pipe the output to a variable, check if there's anything in that var and then echo it in an xterm if it has content.


Will Ubuntu be slow if I install it on external HDD (USB 3.0 and 1 TB WD 7200rpm)?

What I think is you should compare the interfaces instead of HDD itself, but why?
Most of the internal hard drives are 7200rpm and they're just slightly different in form of manufacture, however if we assume that we are talking about a good/normal 7200rpm hard drive then the only thing that matters here is the interface that we are using.
Here is a good comparison which helps you decide:

The theoretical maximums are as follows:
USB 1.1 = 1.5 MB/s
Firefire 400 = 50 MB/s
USB 2.0 = 60 MB/s
FireWire 800 = 100 MB/s
USB 3.0 = 625 MB/s
USB 3.1 = 1.21 GB/s
eSATA = 750 MB/s

So I guess it should be slightly slower.


How can I unbreak compiz so that unity will start?

This is not definitive, but I have had luck doing the following:

Log into Ubuntu 2D.
remove ~/.compiz-1 folder (~ being your /home/userid directory.  In Nautilus, show hidden folders that start with a "." by hitting "ctrl + h")
remove ~/.cache/compizconfig-1 folder
in a terminal (or probably with "alt + F2"), type unity --reset
this unity --reset never seems to fully complete at least for me, so I force close the terminal.
restart

Now free to log into Ubuntu (default 3D).  Everything seems back to normal in compiz and with Unity.


Looking for console program to generate tones

You can do this with the play command from the sox package, e.g.

for note in C C D D E E;
do
    play -n -c1 synth 1 sine $note;
done

which plays a 1-second sine wave for each of the notes in turn.

The man page for sox provides all of the options that can be used with the synth effect. It is very powerful if not the most user-friendly way to generate audio.


Nautilus has changed the mechanism of archive compression.

The list of dynamic libraries of ldd $(which nautilus) executable confirms this.
Here the most important line is below:

$ ldd /usr/bin/nautilus
...
    libarchive.so.13 => /usr/lib/x86_64-linux-gnu/libarchive.so.13
...

What is the name of its package?

$ dpkg -S /usr/lib/x86_64-linux-gnu/libarchive.so.13
libarchive13:amd64: /usr/lib/x86_64-linux-gnu/libarchive.so.13

What functionality this package (libarchive13) provides?

$ apt-cache show libarchive13
Package: libarchive13
...
Description-en: Multi-format archive and compression library (shared library)
Archive formats supported are:
 .
    * tar (read and write, including GNU extensions)
...
    * zip (read only, with some limitations, uses zlib)
...
    * 7zip (read and write, with some limitations)

Moreover as further proof - if we try to remove this package, it will remove many core applications from GNOME (Nautilus, File Roller, Evince, GNOME Control Center and others):

$ sudo apt-get purge libarchive13 --simulate
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  evince* file-roller* fwupd* gir1.2-rb-3.0* gir1.2-totem-1.0*
  gir1.2-totemplparser-1.0* gnome-control-center* gnome-software*
  gnome-software-plugin-snap* grilo-plugins-0.3-base* gvfs-backends*
  libappstream-glib8* libarchive13* libevdocument3-4* libevview3-3*
  libgnome-autoar-0-0* libgrilo-0.3-0* libgxps2* librhythmbox-core10*
  libtotem-plparser18* libtotem0* nautilus* rhythmbox*
  rhythmbox-plugin-alternative-toolbar* rhythmbox-plugins* totem*
  totem-plugins* ubuntu-desktop* ubuntu-software*
0 upgraded, 0 newly installed, 29 to remove and 53 not upgraded.

So the answer is: Nautilus 3.26 in Ubuntu 18.04 LTS does not use p7zip, it uses functions from libarchive13 package.


Linux screen program behaves strangely when moving cursor up and down while viewing a file

I've seen a similar issue on Cygwin, and one work-around is to resize your terminal window after starting screen.

I don't know why this happens, but screen misreads the number of lines in the terminal on startup.  If you re-size your terminal after that, the issue is corrected for that session.

In your screenshots the terminal is maximized.  Quit out of Vim and type the following:

tput lines

This will tell you the number of lines screen thinks you have...

Now reduce the terminal size and re-maximize it, then re-run the command:

tput lines

Are you getting the same answer?


awk: search for pattern stored in an array

Just use the array accessing afterwards, no need for the // as then the arr[1] will be taken as a Regex pattern, do:

if ( $0 ~ arr[1] ){ blah }

Example:

% awk 'BEGIN{a[1]="foo"} {if ($0 ~ /a[1]/) print "Matched"}' <<<'foobar'
% awk 'BEGIN{a[1]="foo"} {if ($0 ~ a[1]) print "Matched"}' <<<'foobar'
Matched


outgoing email filtering on ubuntu server 14.04

I believe this has already been answered on ServerFault https://serverfault.com/questions/126282/postfix-check-outgoing-mail-for-spam.

You can use spamassassin for outgoing as well as incoming filtering.  It can be used also for internal mail.  While it is commonly disable in both these cases, it is useful to know how to enable this functionality in case of spam outbreaks on your systems.

Other approaches used include throttling send rates, content and virus filtering, and authentication.  On Linux (Ubuntu) you can also limit the ability to send traffic on port 25 (SMTP) to postfix in the firewall.

Your firewall should allow only your authorized mail servers to send email to the internet.  These should have appropriate DNS setting such as rDNS and SPF records.  Your organization may also want to have DKIM and DMARC records for the mail domain.


Qt5 with Qt 4.7 on Ubuntu 13.04. How to install it both without conflicts?

It's not that simple. Look this guy reported a .bug

There is a program called  qtchooser but it's unreliable, I could not make it work.

What I did:

sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
sudo apt-get update
sudo apt-get upgrade

and then just remove qt5-default, it's about a few kbs of program, then you can easily switch back to qt5 installing qt5-default.

EDIT: I found an easier way to switch between qt4 and qt5 using environment variables

To switch to qt4

 export QTCHOOSER_RUNTOOL=qtconfig
 export QT_SELECT=4


Do sudo apt-get install systemd to get the "systemctl" command, then do sudo systemctl start docker Then do sudo systemctl start docker-lvm-plugin


Your output says that you are missing a file: libodbc.so.2: cannot open shared object file: No such file or directory
Let's use the http://packages.ubuntu.com website to solve this mystery, and to discover if an Ubuntu package provides this missing file.

On the Search bar at the top of the page, note that we're looking for the missing filename (libodbc.so.2) among package contents (not package names).

Sure enough, there it is: Try installing the libobdc1 package, which includes that missing file.
sudo apt install libobdc1


How to run an autostart application as root?

If you're running a graphical program, perhaps you should avoid sudo, as it can only ask you for your password via a terminal window, which is not good for graphical programs. (Unless you are launching said programs from a terminal.) I used to recommend gksu or gksudo, but sadly both programs have been discontinued, and are no longer available in recent versions of Ubutnu. You can instead use policykit to run the program as root using pkexec airvpn. That too requires a password, but can prompt for a password with a graphical pop-up window,and thus does not depend on the password being typed into a terminal.

If you don't want to enter your password every time, here are some tips on how to execute a program as root without typing your password.

setuid

If the airvpn executable is a binary file (as opposed to a text file), you should be able to use the chmod command to change the file permissions to activate the setuid mode, meaning it will always run as the user who owns it. (To make sure that user is root, run sudo chroot $(which airvpn).) This will not require a password, and will not require you to do any of the steps below. It will, however, require you to run the following command: sudo chmod u+s $(which airvpn). However, this trick does not work with text files (python programs, shell scripts, etc.). Also, if you ever update this file, you will probably have to do this again. And again the next time you update it. And again...

Make a sudo config file

BTW, sudo (and by extension gksudo and gksu, which both use the same configurations as sudo) and policykit (which can execute program as root using pkexec) can both be programmed to run a program without the need to enter a password. IDK how to do this with policykit, but I can teach you how to achieve this with sudo. Before you continue, you should have a root shell running in the background, just in case something goes wrong. (You may lose your ability to use sudo at all, see below). Create a text file in the /etc/sudoers.d directory. You can call it whatever you want, as long as it doesn't have a . character, and doesn't end with a ~ character.

Before I continue, I should warn you that you'll need to know the path to your airvpn executable. If you enter which airvpn into your terminal, it should tell you where this file is. Assuming it's /usr/bin/airvpn, you can type:

    %admin ALL = NOPASSWD:/usr/bin/airvpn

and save it in the /etc/sudoers.d directory. It's probably a good idea to use the chmod command to set the file permissions to 0440. You can do that by running (as root) chmod 0440 file, replacing "file" with the name of the newly-created file.

Now, open a new terminal, and test this new configuration by running sudo airvpn. (The reason the word "new" is in bold is because sudo might not ask you for a password if you've already executed a sudo command in an existing terminal, even if you haven't successfully configured sudo to avoid asking you for a password.) If you were able to do this in a new terminal, you've successfully made it possible to execute airvpn without a password. Now all you have to do is change your startup item to run sudo airvpn, and you'll be good to go. This will work regardless of whether the executable file is a binary file or a text file. Also, you should only need to do this once, regardless of how often you update this program.

Oh no! It didn't work, and now sudo gives me errors!

If something goes wrong, and you lose your ability to use sudo to execute anything as root, you can delete your newly-created file, and sudo should behave as it did before. (Remember when I advised you to keep a root shell running? You'll probably need it to delete that file. Of course, you could execute a root shell by running pkexec su, and then use that to delete the file. Or, if the root account has a password, su should do.)

gksudo replacement

Although gksudo may be dead, there is a way to make a similar replacement yourself. Step one, install the ssh-askpass package: sudo apt install ssh-askpass. Then, create a shell script (using whatever your favorite text editor is), with the following:

#!/bin/sh

export SUDO_ASKPASS=/usr/lib/ssh/x11-ssh-askpass
exec sudo "$@"

You can save it as gksudo. Now, you need to make that script executable, and copy it somewhere where you can execute it. You could combine the he install command will let you do both of those things at the same time: sudo install -o 0 -g 0 -m 0755 ./install /usr/local/sbin. (If you don't have a /usr/local/sbin directory, you might want to make one: sudo mkdir -p /usr/local/sbin.) You may also want to run rm install, so that you don't have a useless second copy lying around.

Now you can type gksudo airvpn, and you'll get a non-terminal prompt to type your password. You can re-use this to make an application launcher, a startup item, or whatever else. Since this script relies on sudo as a backend, any configurations you make to sudo will apply here, as well. Thus, this could become a fallback in case your sudo config fails - unless you can't do anything with sudo, in which case you're on your own. (So, for example, if your /etc/sudoers.d/* file gets deleted for whatever reason.)


Is it mandatory to install Java for the correct operation of Ubuntu / Xubuntu etc?

No it is not, and certainly not after a full install. I used Ubuntu for the past year without a need for Java until recently when I needed to install it for a Java programming course. Aside from that it never came up.

There are applications in the Software Centre that say they use Java, but I would assume if you install them the required Java libraries would be installed as dependancies.


Chromium installation error in Lubuntu 20.04

I had the same issue during an upgrade to Ubuntu 20.04. During the installation of the Chromium snap package, I would see this message:
INFO waiting for automatic snapd restart

And then the installation process was just doing nothing as that automatic restart never happened. So I unlocked progress in the installation process again by executing the expected restart manually:
sudo service snapd restart


Any version of Ubuntu will work. Although I would recommend 16.04 x64 LTS.

Keep in mind you might experience difficulties with the Wi-Fi chip and/or the iGPU.


How can Adobe Acrobat Reader be installed in Ubuntu 15.04?

Try out an old Canonical partner repo for Raring Ringtail. Works fine on 15.04 for Adobe Reader installation.

sudo add-apt-repository "deb http://archive.canonical.com/ raring partner"
sudo apt-get update
sudo apt-get install acroread libgtk2.0-0:i386 libnss3-1d:i386 libnspr4-0d:i386 lib32nss-mdns* libxml2:i386 libxslt1.1:i386 libstdc++6:i386

Adobe Reader 9 shouldn't be used though. It will not get any security updates anymore and might not be safe. Of course it's fine, if your pdf source is reliable. It's still recommended to find an alternative.


is there a list of keyboard shortcuts for the "Videos" app?

From Totem man pages:

KEYBINDINGS
       Global keybindings for Totem:

       a                 cycle between aspect ratios
       p                 toggle between play and pause
       Esc               exit full screen mode
       f                 toggle full screen
       h                 toggle display of on-screen controls
       0                 resize window to 50% original size
       1                 resize window to 100% original size
       2                 resize window to 200% original size
       r                 zoom in the video
       t                 zoom out the video
       d                 start and stop the telestrator (drawing) mode
       e                 erase the drawing
       Left-arrow        skip back 15 seconds
       Right-arrow       skip forward 60 seconds
       Shift+Left-arrow  skip back 5 seconds
       Shift+Right-arrow skip forward 15 seconds
       Ctrl+Left-arrow   skip back 3 minutes
       Ctrl+Right arrow  skip forward 10 minutes
       Up-arrow          increase volume by 8%
       Down-arrow        decrease volume by 8%
       b                 jump back to previous chapter/movie in playlist
       n                 jump to next chapter/movie in playlist
       q                 quit
       Ctrl+E            eject the playing optical media
       Ctrl+O            open a new file
       Ctrl+L            open a new URI
       F9                toggle display of the playlist
       m                 show the DVD menu
       c                 show the DVD chapter menu


Terminal's "Use custom default terminal size" property does not work

Your terminal starts in fullscreen mode because you set a size bigger than your current display.

Remember that the size here is not given in pixels but in characters.

The default size is 80x24, so if you tried to set up a 1920x1200 terminal this way you'll always get a fullscreen terminal window.

I'd suggest lower values to solve your problem, try first with 80x48 and slowly increase to see what fits your needs.


Try installing laptop mode tools with the following command:

sudo apt install laptop-mode-tools

Then open it up from your menu and toggle settings to your liking. That fixed my heat woes with my old dell. I also found this article helpful for tools besides laptop mode tools


How do I install the dpkg-dev package? Requires Ubuntu ISO

Use the online repositories instead of CD-ROMs

It's recommended to install packages from the official repositories available using the internet, rather than installing from (outdated) CD images.

Open /etc/apt/sources.list with your favourite text editor, e.g.

sudo gedit /etc/apt/sources.list # or vim / nano / joe - whatever you like

Comment out the lines starting with deb cdrom:. This means, prepending them with a # (hash). For example:

deb cdrom:[Kubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424)]/ dists/precise/main/binary-i386/
deb cdrom:[Kubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424)]/ dists/precise/restricted/binary-i386/

Becomes

# deb cdrom:[Kubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424)]/ dists/precise/main/binary-i386/
# deb cdrom:[Kubuntu 12.04 LTS _Precise Pangolin_ - Release amd64 (20120424)]/ dists/precise/restricted/binary-i386/

Check whether regular deb http://... or deb ftp://... are present in the file elsewhere. You should at least have some lines like

deb http://nl.archive.ubuntu.com/ubuntu/ precise main restricted
deb http://nl.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb http://security.ubuntu.com/ubuntu precise-security main restricted

Update the sources.

sudo apt-get update

Install the package:

sudo apt-get install dpkg-dev

Install updates (you probably have a lot outstanding now that you haven't accessed the repostories online).

sudo apt-get dist-upgrade # no, this won't upgrade to a new release

In case you still have issues locating the package, include the output of

apt-cache policy dpkg-dev

and

grep -vrE "(^#|^$)" /etc/apt/sources.list /etc/apt/sources.list.d/

in your question.


vim-clang-format: clang-format is not found

If you check what is contained in the package clang-format-6.0 (dpkg -L clang-format-6.0) you will find that it does not install clang-format into the /usr/bin directory. But you will find that it does install it to /usr/lib/llvm-6.0/bin instead.

One possible solution would be to add /usr/lib/llvm-6.0/bin to your PATH variable. Under this path clang-format is available. The command /usr/bin/clang-format-6.0 is just a symbolic link to it, so it should be equivalent to using clang-format-6.0. Why the package maintainer decided to not link /usr/bin/clang-format as well is not clear to me.

If you are unsure how to do that you may want to look it up here: https://help.ubuntu.com/community/EnvironmentVariables


Do not install the Nexus 5 image on your Nexus 5x. Those devices are fundamentally different and you won't end up with a usable system (you might even soft- or hard-brick your device). There's no completed Ubuntu Touch port for the Nexus 5x yet, and it's not being worked on at the moment. That being said, after the move to Halium that situation might change.


How to add programs to the launcher (search)?

I agree. It is complicated. You have 2 options.

ONE:

Install a program called 'Alacrity' or 'Main Menu' from the software center. It will create launchers as you desire. It is that "add to launcher" program you are looking for.

TWO:

You can create a .desktop file (same thing as a launcher), and place it here: ~/.local/share/applications

I believe the format for a .desktop file goes something like this:

[Desktop Entry]
Type = Application
Name = name-of-application
Comment = your-desired-comment
Exec = command to execute (ex. 'eclipse')
Icon = path-to-icon

More info about .desktop files can be found here: http://standards.freedesktop.org/desktop-entry-spec/latest/


When I am in profile set ubuntu server 18.04.1 an installation error occured

I have been having a similar experience with the Ubuntu Server 19.10 (19.10.1) AMD64 on an Intel NUC8i7BEH when trying to install from a bootable USB Flash Drive created with "Startup Disk Creator” on Ubuntu Desktop or with Rufus on Windows.

Originally, Ubuntu Server 18.04 LTS AMD64 (18.04.03) USB Flash Drive installer created with Windows “Rufus” and Ubuntu “Startup Disk Creator” was not detecting the M.2 SSD or loading/finding PCIe driver, I'm not sure. It would report "Probing for devices to install to failed".

I burnt Ubuntu Server 19.10 (19.10.1) AMD64 to a DVD and it didn't crash during the "Profile setup" stage.
During install, I updated to 19.10.2 and added OpenSSH package, when requested.
After restarting, it booted and I am able to SSH into it with PuTTY with user credentials!

For good measure, I burnt Ubuntu Server 18.04 LTS (18.04.03) to a DVD and had the same issues as I did with the USB Drive version of Ubuntu Server 18.04 LTS (18.04.03), so I'm sticking with 19.10.

Interestingly, Ubuntu Desktop 18.04.3 AMD64 did install properly via USB created with "Startup Disk Creator” on Ubuntu Desktop. Also, from the non-install "try" option, I was able to install Ubuntu Core (PC Dawson AMD64 m4 20180507-32).


How to print both from the command line as well as through CUPS?

I have the same problem, if you always add permissions to the file lp0, you must edit the printer rules:

$ gksudo gedit /lib/udev/rules.d/70-printers.rules

add [, MODE="0666"]

The file contains:

ACTION=="add", ... KERNELL="lp*" ... , MODE="0666"


green and blue horizontal lines on google chrome youtube videos

I had the same problem i solved by disabling the "Use Hardware Acceleration when available" in Settings/Advanced.
The problem is that the graphic card is not fully supported by Linux.


dpkg: error: duplicate file trigger interest for filename `/usr/lib/gio/modules' and package `libglib2.0-0:i386'

From a post I read on http://lists.debian.org/debian-dpkg/2012/06/msg00071.html
I could solve my problem by running:

 sed -n -e"s,/,\\\\\\\\/,g; s/:$(dpkg --print-architecture)$//p " \
       /var/lib/dpkg/triggers/File \
 | while read line; do
      sudo sed -i -e"/^$line$/d" /var/lib/dpkg/triggers/File
 done


At the log-in screen you should see a menu bar at the top. One of the icons (the accessibility man) allows you to open onboard without logging in.


Is the latest Ubuntu version, intel graphics compatible?

Running:

sudo add-apt-repository ppa:oibaf/graphics-drivers

will add the latest/optimised Intel drivers.

More info can be found here:

https://askubuntu.com/questions/692006/intel-graphics-for-ubuntu-15-10

Here:

https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers

and here:

https://launchpad.net/+help-soyuz/ppa-sources-list.html

NOTE: This as far as I know will work with Ubuntu 14.04.2 and later. It recommended you use it for 15.10 ONLY.


Ubuntu 16.04LTS Create Cron Job in cron.daily that will display the contents of auth.log to folder in every users home directory?

The following program will create a text file named daily-signin.txt in a directory named ulogs under all users home directory if you run this as root.

#!/bin/bash
path="/path/to/source/file";
for p in `cat "$path"`;
do
log=`cat /var/log/auth.log`;
mkdir -p /home/$p/ulogs/
echo "$log" >> /home/$p/ulogs/daily-signin.txt
done

Points to note

The file /path/to/source/file contains the list of users in your machine. If any new user created and you want to get the log file in that user's home directory as well, you have to add the new username in the source.txt file.
As this file is being created on another user's home directory, you will need to run this shell script with sudo privileges
If you are running this script as a cronjob, you may follow this link in order to get this done.


Unmet Dependencies - Error on /etc/kernel/postrm.d

the error message indicates a disk full error

is the key here: There seems to be not enough free disk space to install the unmet dependencies, and until these problems are not solved, the package system refuses to install new packages.

Free some space by moving files, emptying the trash and sudo apt clean, then repair the package system with sudo apt-get -f install and you should be good to go.

Old kernel images tend to eat up a lot of disk space, this question here shows how to remove them: How do I remove old kernel versions to clean up the boot menu?

If your boot partition is full and you're not able to remove old kernel images due to the unmet dependencies, this question can help:
Boot partition full, failing to delete old kernels. Broken packages


Killer 1535 and E2400 NIC Support in Ubuntu 16.04?

Here is a link from Killer's website: http://www.killernetworking.com/support/knowledge-base/17-linux/20-killer-wireless-ac-in-linux-ubuntu-debian It says, in part:

  Killer 1525 and 1535 use the ath10k driver which is included in the
  latest kernel updates.

It then gives instructions to download and install the board-specific firmware. There are many questions and accepted answers on this site about ath10k_pci and firmware. Although I haven't the device myself, I expect that the process is trivial.

The ethernet has a page as well: http://www.killernetworking.com/support/knowledge-base/17-linux/21-killer-e2400-in-linux-ubuntu-debian It shows how to amend the source code to add the device ID of 1969:e0a1. The device ID is covered by default in 16.04 and should work with no additional effort.

This answer applies to kernel version 4.4.xx and later.


How can I reorganize files by extension, and sort them into folders by category?

Python is whitespace sensitive, this means you have to indent code correctly; otherwise you'll get errors...

After an if block, you need to indent the code, you can use Tab to do this.

Your code should look like this:

#!/usr/bin/env python3

import os
import subprocess
import shutil

# --------------------------------------------------------
reorg_dir = "/media/ashwin/Work+Entertainment/Untitled Folder"
exclude = ()
remove_emptyfolders = True
# ---------------------------------------------------------

for root, dirs, files in os.walk(reorg_dir):
    for name in files:
        subject = root+"/"+name
        if name.startswith("."):
            extension = ".hidden_files"
        elif not "." in name:
            extension = ".without_extension"
        else:
            extension = name[name.rfind("."):]
        if not extension in exclude:
            if extension==".jpeg" or extension==".jpg" or extension==".JPG" or extension==".png" or extension==".PNG":
                new_dir = reorg_dir+"/Pictures"
            elif extension==".docx" or extension==".doc" or extension==".pdf" or extension==".xlsx" or extension==".ppt" or extension==".pptx":
                new_dir = reorg_dir+"/Documents"
            elif extension==".mp3" or extension==".MP3":
                new_dir = reorg_dir+"/Songs"
            elif extension==".mp4" or extension==".MP4" or extension==".avi" or extension==".AVI":
                new_dir = reorg_dir+"/Videos"
            elif extension==".db" or extension==".DB":
                new_dir = reorg_dir+"/Databases"
            elif extension=="*.*":
                new_dir = reorg_dir+"/Others"

        if not os.path.exists(new_dir):
                os.mkdir(new_dir)
            n = 1; name_orig = name
            while os.path.exists(new_dir+"/"+name):
                name = name_orig
                n = n+1
            newfile = new_dir+"/"+name
            shutil.move(subject, newfile)

def cleanup():
    filelist = []
    for root, dirs, files in os.walk(reorg_dir):
        for name in files:
            filelist.append(root+"/"+name)
    directories = [item[0] for item in os.walk(reorg_dir)]
    for dr in directories:
        matches = [item for item in filelist if dr in item]
        if len(matches) == 0:
            try:
                shutil.rmtree(dr)
            except FileNotFoundError:
                pass

if remove_emptyfolders == True:
    cleanup()


3g modem randomly disconnects on ubuntu 12.04

If the modem disappears from the Network Manager applet, once automatically disconnected:

  It usually happens due to poor signal strength or wrecked USB ports. Try plugging the 3g dongle to a USB port you've rarely used. Run sudo pkill modem-manager if you want to re-detect the dongle.

If the problem still exists:

  Try installing proprietary (manufacturer's) drivers which should come with your device.

By the way, mention the model of your dongle using lsusb command.


Can't get second monitor to work on 20.04 laptop

I have had a similar problem, too long a story for here, but just wanted to tell you that I have Nvidia driver version 450.80.02 and it is working fine now. I have a Dell G7.  Two external monitors, and this driver version is now working.
Not sure that helps you but it might.


Can I install Ubuntu 14.04 alongside 16.04?

Of course it is possible,  you can even install 2 same versions of Ubuntu alongside. You can follow the steps here just instead of Ubuntu you have your Xenial.

How can I install Ubuntu 'alongside' Lubuntu?

(kind of duplicite answer, but the question is specific due to Xenial, the person was not sure if existing guides fit his specific situation)


How to make AMI images of Ubuntu from instance-store, when Amazon requires Grub, but Ubuntu blocks it?

Per the documentation, the way forward in this situation is to start with an Ubuntu instance store backed AMI, and install the compatible version of grub, as detailed here:

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-instance-store-ami.html#ubuntu_instructions

Once you install the grub package and verify that you are utilizing GRUB legacy via grub --version you can continue with the remaining steps for creating Instance Store AMIs.

You can find a list of instance backed Ubuntu AMIs by region(and point release) here to base yours on:
https://cloud-images.ubuntu.com/locator/ec2/


Set web proxy using pac-file-url in lubuntu

Here a several ways to do this.

Network based configurations

DHCP

If you are using DHCP, you can set here an option configuring your clients.
For this specify in your dhcpd configuration:

option wpad-url  code 252 = text;
option wpad-url  "http://mywebserver/myconf.pac" ;

DNS

An alternate possibility is to use the DNS to specify the pac file.

See e.g. wikipedia

  Before fetching its first page, a web browser implementing this method sends the local DHCP server a DHCPINFORM query, and uses the URL from the WPAD option in the server's reply. If the DHCP server does not provide the desired information, DNS is used. If, for example, the network name of the user's computer is pc.department.branch.example.com, the browser will try the following URLs in turn until it finds a proxy configuration file within the domain of the client:

http://wpad.department.branch.example.com/wpad.dat
http://wpad.branch.example.com/wpad.dat
http://wpad.example.com/wpad.dat
http://wpad.com/wpad.dat (in incorrect implementations, see note in Security below)

(Note: These are examples and may not be live URLs.)

Notes:

The wpad.dat file may be an symbolic link to the file used in the DHCP configuration.
The DNS based resolution has normally a lower priority as the DHCP based resolution.

System / user based configurations

system (or user) based configuration via environment variable

To use the pac file for curl and other programs you can set the environment variable auto_proxy. E.g.:

 auto_proxy=http://myserver/myconf.pac

user based configuration for applications using gconf

For adding the autoconfig url to your gconf settings you can use the following command:

gconftool-2 --set /system/proxy/autoconfig_url \
    --type string  ${auto_proxy}

lxproxy Utility for Lubuntu

Please see the community wiki. Here is the ppa for lxproxy referenced.
Lxproxy claims to be a smlall gui to set a proxy server.

Application specific configuration

chromium

You may enforce that all chromium browser instances on a machine use
the autoconfig url.
Place a file (e.g. proxyConfig) below
/etc/chromium-browser/policies/managed/ with the following content

      {
          "ProxyMode": "pac_script",
          "ProxyPacUrl": "http://myserver/myconfig.pac",
     }

Note: Placing this file below /etc/chromium-browser/policies/recommended will make this setting a default. The user is able to change this setting afterwards in his own chromium configuration.

firefox

Edit the file /etc/firefox/syspref.js and add the following lines

 lockPref("network.proxy.autoconfig_url", "http://myserver/myconfig.pac");
 lockPref("network.proxy.type", 2);

Alternate way: Set this values as user preferences via about:config.

thunderbird

Edit the file /etc/thunderbird/syspref.js and add the following lines

 pref("network.proxy.autoconfig_url", "http://myserver/myconfig.pac");
 pref("network.proxy.type", 2);

Note: Due to bug #1081015 you can't lock down this setting. So it is
here only possible to set a default. Ensure that this values are note
overwritten by prefs.js in your active profile.


From the comments...

After playing around with vm.swappiness=80, we decided to try a newer kernel. We downloaded 5.5.6 from https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.5.6/, and so far the machine is working fine!

Ultimately, based on the user's normal apps, Firefox with 15 tabs, and an IDE, more RAM might very well be needed. Install RAM in matched pairs of equal type/size RAM to take advantage of memory interleaving. ie: 2 x 4G RAM, or 2 x 8G RAM.


How do I know which software downloads to trust?

All of the software on the Ubuntu Software Center is safe and is maintained / verified, reviewed / developed by known developers (either from Debian or Ubuntu) and that's the reason it is in the Ubuntu repositories.

More risky business is when installing applications from third-party sources which is done by adding the Personal Package Archive (PPA) to your system. After a PPA is added it is trusted by the system and any updated software from that PPA will be updated automatically. Well, if some developer goes rogue and makes a malicious software then that application will come in as an update, if the particular PPA was added. Hence, adding PPAs should be done cautiously.

Read more in the following excellent links.

Which Ubuntu repositories are totally safe and free from malware?
Are PPA's safe to add to my system and what are some "red flags" to watch out for?
Is there any guarantee that software from Launchpad PPAs is free from viruses and backdoor threats?

Case where the user compiles and installs using make/cmake

Generally some libraries, custom compilers and customized applications which are system build and parameter dependent (need configure) are installed that way. Hence, usually these softwares come from known developers, researchers, scientists, companies, GNU developers, etc...
However, exercise caution and use your experience while building softwares from source. Don't just blindly build any piece of code !


Compiled programs in 13.04 missing icons in launch bar (defaults to question mark)

gem@HAL9000:/usr/share/applications$ sudo vim minitube.desktop

And setting the line:

Icon=minitube

To:

Icon=/usr/share/icons/hicolor/scalable/apps/minitube.svg

Did the job perfectly!

Thanks @edwin !


Lenovo docking station won't turn on monitors on boot

I assume the thunderbolt was authorized properly (if not, try doing so, for example http://juho.tykkala.fi/Lenovo-Thunderbolt-3-dock-Linux ) and your problem is that the monitor is not "recognized" on start up. Have you tried to change the monitor's settings from "auto" to the port hdmi/dp where the monitor is connected?

Another thing is how the nvidia driver is setup, for example - load the the kernel modules as early as possible: https://devtalk.nvidia.com/default/topic/1068925/linux/prime-render-offloading-not-working-on-my-arch-linux-on-a-lenovo-laptop-with-xfce-xorg/ ( search for MODULES= ).

Two years ago I had similar problem and back then the workaround I came with was (instructions are for Arch Linux, but it should be something similar):

Create monitor configuration for both internal (lcd panel) and external (monitor):

$ sudo vim /etc/X11/xorg.conf.d/10-monitor.conf

Section "Monitor"
    Identifier  "DP1"
    Option      "Primary" "true"
    Option  "PreferredMode" "3840x2160_60.00"
    Option  "DPMS" "true"
EndSection

Section "Monitor"
    Identifier  "eDP1"
    Option      "LeftOf" "DP1"
    Option  "DPMS" "true"
EndSection

Create an executable file, so xinit run it on startup:

$ sudo vim /etc/X11/xinit/xinitrc.d/90-display.sh

#!/bin/sh
xrandr --output "eDP1" --off --output "DP1" --primary --auto
xrandr --output "eDP-1-1" --off --output "DP-1-1" --primary --auto

This will turn off the LCD panel. You can add explicit xrandr command to turn your external monitor "DP1" --on.

Let me know if you managed to solve your problem. Soon, I'll probably go though the same problem (X1 + 40AN0230EU + 4k monitor)


How to repair a corrupted FAT32 file system

Try typing the following command in the Linux terminal:

sudo dosfsck -w -r -l -a -v -t /dev/sdc1

sdc1 is usually your pen drive. You can find your pen drive by typing mount in terminal. It's somewhere inside. If that command takes too much time for you, avoid -t switch.

-w means write to disk immediately.
-r means to do disk check interactively (ask you what to do to when encountering errors). On newer versions of dosfsck this is the default.
-l means to list the filenames processed.
-a means automatically fix errors. Do not use it, if You want to have more control over fixing possible errors.
-v means verbose mode. Generates slightly more output.
-t means mark unreadable clusters as bad.

If you want to be sure not to lose your data, create a backup of the source device first.


How do I insert a text from variable at the certain line of a text file?

You call variables in sed with double quotes

sed -i -e "2i$var" bar


Youtube dl how to download all playlist devided into different foledrs?

#!/bin/bash
echo "Downloading playlist...(results.log)"
youtube-dl -j --flat-playlist "$1" | jq -r '.id' | sed 's_^_https://youtu.be/_' > results.log
num=1
total="$(wc -l < results.log)"
echo "Total videos: $total"
while [ "$num" -le "$total" ]; do
   echo "Processing video #$num Thank you for Patience"
   url="$(sed -n "$num"p results.log)"
   title=$(youtube-dl -f mp4 -o '%(id)s.%(ext)s' --print-json --no-warnings "$url" | jq -r .title)
   echo "Title is $title"
   title="$num. $title"
   fly='"'
   title=$fly"$title"$fly
   echo "New title is $title"
   echo "URL is $url"
   sleep 5
   file_name="$(youtube-dl --get-filename --simulate $url)"
   ext="${file_name##*.}"
   echo "ext is $ext"
   youtube-dl -f best --output  $num.$ext $url
   sleep 5
   mkdir "$title"
   mv $num.$ext ./"$title"
   echo "please wait"
   sleep 1
   num=$(( num+1 ))
done
#some Housekeeping !!
for i in *; do  mv "$i" "`echo $i | sed 's/"/ /'`" 2>/dev/null; done
for i in *; do  mv "$i" "`echo $i | sed 's/"/ /'`" 2>/dev/null; done
for i in *; do  mv "$i" "`echo $i | sed 's/  / /'`" 2>/dev/null; done

Get YouTube title while video downloading
How do I download with youtube-dl to get video title as filename
Comparison Ops (tldp.org)


Unable to boot in default user mode in ubuntu

Alright, first of all, that's not how you become root in ubuntu. To become root, you can either use the sudo command to execute root, or you can use sudo passwd which is how to set the password for the root account on ubuntu. Then, to become root, you use su and enter the password you set previously.

Did you edit anything in the fstab document?


Where are gnome-shell's UI javascript files on Ubuntu 20.04?

Answer compat:
Ubuntu 20.04.2
gnome-shell version: 3.36.4
display server: X.Org Server
Important note:
Making any mistake while altering gnome-shell's files can introduce a deadlock of your graphical session. Attempt it only if you are familiar with common methods of system recovery.
Also, executing changes in this answer will demand an additional workflow to handle gnome-shell updates with due caution, as explained below.
Modifying functionality
On Ubuntu 20.04, gnome-shell's javascript files are normally packaged up inside the file:
/usr/lib/gnome-shell/libgnome-shell.so

To override them, one needs to extract copies of the subject files, and ask Gnome to use the copies.
Below I provide an abstracted, task-agnostic walk-around. To see a similar procedure in action on a specific practical task, see this answer.
The to-be-modified file copies can be organized in an arbitrary location, in this walk-around I use the following location:
~/.gnome-shell-custom-overlays/

To enable this "customization platform", one needs to place the following line in ~/.profile:
export G_RESOURCE_OVERLAYS="/org/gnome/shell=$HOME/.gnome-shell-custom-overlays"

For this to take effect, logging out and logging back in is necessary.
A note on dependencies:
Before I got this procedure working on my machine, I already had the libgtk-3-dev package installed. It's for development / debugging, just like the resource overlays feature seems to be so. Therefore right now I cannot determine whether respecting the G_RESOURCE_OVERLAYS environment variable depends on the presence of this package or not... Just in case, be ready to install it.
Setting up subject files:
One can list the contents of libgnome-shell.so as follows:
gresource list /usr/lib/gnome-shell/libgnome-shell.so

The next step is extracting the to-be-modified file. Let's use an example where this file is located in gnome-shell's ui/  subdirectory.
mkdir ~/.gnome-shell-custom-overlays/ui

gresource extract /usr/lib/gnome-shell/libgnome-shell.so \
/org/gnome/shell/ui/fileName.js > ~/.gnome-shell-custom-overlays/ui/fileName.js

Tweaking:
To see the effect of tweaks on the customized file, reloading the gnome-shell after each edit seems to be necessary. It can be done quickly by issuing the r command through the Run command dialog (revealed by Alt+F2).
At this point you should have a working override which persists through reboots.
A note on recovery:
If a modification attempt goes wrong, it should be possible to switch to a virtual console environment (with e.g. Ctrl+Alt+F3). From there, commenting out the G_RESOURCE_OVERLAYS line in ~/.profile and subsequently rebooting should disengage the override and thus have the capacity to restore the system.
A note on using G_RESOURCE_OVERLAYS
It may be the case that this feature is aimed primarily at debugging and development, and perhaps not for permanent usage.
The system's stability may be impacted: when I first enabled this, I saw some previously not experienced weirdness with my sound settings, and some window-flickering. A few restarts of the gnome-shell and a (few?) reboot(s?) however solved it, and from the next day on I haven't experienced any further anomalies.
Furthermore, in the "Logs" app I can see that the event of using G_RESOURCE_OVERLAYS gets logged in the "security" section, so that's good to consider.
Regarding receiving system updates while using G_RESOURCE_OVERLAYS:
The following section is entirely speculation, I have no confirmation about whether any of this is valid; yet it may be useful to consider:
If and when gnome-shell receives an update, I see a chance that the customized gnome-shell files might lose their compatibility, and may even cause the desktop to break.
I believe in such case one could suspend using the G_RESOURCE_OVERLAYS feature through ~/.profile (as discussed in the recovery section), subsequently repeat extracting the subject files from the fresh libgnome-shell.so, and re-apply the modifications in a compatible manner.
In case an update causes such an event of incompatibility, I speculate some risk involving the desktop crashing already while the configuration stage of the updates are being executed; I can vision significant collateral damage inflicted on other systems in such a case. (I might be wrong.)
Nevertheless, for this reason, I would consider to let gnome-shell updates to be installed separate from other updates, so that the event could not interfere with the installation of other packages.
A layer of control, for stability:
To manage the aforementioned risks, one can put gnome-shell on hold status, that prevents its updates from installing, until one is ready to deal with them.
The procedure then looks like this:

hold gnome-shell: sudo apt-mark hold gnome-shell
live life in peace for however long
when gnome-shell has available updates, it will show up in the updates dialog, but its checkbox will be unchecked, therefore will not be installed

one should be able to go on like this until one is ready to perform the update
when ready to update, follow according to the next steps

run the updater, and let every update install, apart from gnome-shell's

reboot if necessary, and run the updater again, just to ensure that no other updates are available at the moment, apart from gnome-shell's

disable G_RESOURCE_OVERLAYS in ~/.profile, and restart gnome-shell

confirm that G_RESOURCE_OVERLAYS are indeed not used, by verifying the lack of UI customizations

unhold gnome-shell: sudo apt-mark unhold gnome-shell
run the updater and let gnome-shell update this time
re-enable G_RESOURCE_OVERLAYS in ~/.profile and restart gnome-shell

deal with any fallout of incompatibility, if necessary

this might involve disabling G_RESOURCE_OVERLAYS again (from a virtual console, if necessary), and re-establishing the overridden files with renewed, this time compatible modifications in them

having achieved a stable state again, put gnome-shell back on hold again

repeat the above procedure when new updates arrive

Compiling the modified files back into libgnome-shell.so
I reckon the risks around the updates can be avoided if one, instead of relying on the resource overlays feature permanently, compiles the modified files back into libgnome-shell.so (because then an update does not cause an event of incompatibility; instead it just rewrites libgnome-shell.so in one go).
However, unfortunately, this task seems to depend on a significant amount of Gnome- and/or Ubuntu-developer know-how; mere agility around code-editors does not seem to cut it.

The compiler, glib-compile-resources, requires an XML-formatted list of the resources to be compiled, and its output cannot be easily reattached to an existing .so ELF file.

source

At a guess, you are missing the C code used by the lower-level parts of
gnome-shell, which goes into the same library as the JavaScript
resources.
If you obtained gnome-shell by compiling it from source code (for
instance in jhbuild) [...]
If you obtained gnome-shell from a distribution like Debian, Ubuntu [...], you will need to apply your JavaScript changes as local changes
to that distribution's gnome-shell package, rebuild the gnome-shell
package with a local change to the version number, and install the new
package.

source
Compiling the entirety of gnome-shell from source is no small feature. Actually it has such an extensive impact, apparently with so many things that could go wrong with it, that I personally feel it puts the  reasonability of the choice in question.
Nevertheless, if you can share the actual steps of compiling gnome-shell in the context of Ubuntu successfully, please submit an answer.

References / literature:

Credit to Superuser Q/A
Gnome devs' reference
Gnome cookbook on Arch wiki


Yes and no. It depends on each app in particular. Y-ppa-manager shows correctly in GSC. Wine does not. I have currently Wine 1.8 installed, but GSC shows only Wine 1.6 available... to install. OpenJDK 9 comes preinstalled, and yet GSC won't recognize it, no listing of any version AT ALL. WPS Office shows correctly in GSC, but will not provide updates because there is no ppa for it. Make sure you always use the correct ppa! It should work. Most of the times.


Getting /usr/local/gcc-8.2/lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/lib/x86_64-linux-gnu/libjsoncpp.so.1), why?

Usually such essential libraries should not be placed in /usr/local/lib.
So you have to move problematic library out the way with command below
mkdir ~/from-usr-local
sudo mv /usr/local/gcc-8.2/lib64/libstdc++.so.6 ~/from-usr-local/

or move whole problematic folder out the way by
sudo mv /usr/local/gcc-8.2 ~/from-usr-local/

and retry.
Please note that all essential system-wide software is contained in the repositories. While having them in /usr/local will cause issues, as you already see. You can install all needed system stuff by using below command
sudo apt-get install cmake gcc gcc-8 build-essential --reinstall

and then retry running cmake. If issue persists - then carefully inspect the contents of /usr/local .


How to bulk extract bitrate data from videos and output them in a text file?

To screen:

find . -name "*.mkv" -print0 | xargs -0 -i{} sh -c " echo -n '{} ' && ffmpeg -i '{}' 2>&1 | sed -n -e 's/^.*bitrate: //p' "

To file result.txt:

find . -name "*.mkv" -print0 | xargs -0 -i{} sh -c " echo -n '{} ' && ffmpeg -i '{}' 2>&1 | sed -n -e 's/^.*bitrate: //p' " > result.txt

You will see in file result.txt:

somefile1.mkv 1788 kb/s
somefile2.mkv 1681 kb/s
...

Formatted output example:

find . -name "*.mkv" -print0 | xargs -0 -i{} sh -c " echo -n 'Filename: {}, Bitrate is: ' && ffmpeg -i '{}' 2>&1 | sed -n -e 's/^.*bitrate: //p' " > result.txt

You will see in file result.txt:

Filename: somefile1.mkv, Bitrate is: 1788 kb/s
Filename: somefile2.mkv, Bitrate is: 1681 kb/s
...


The biggest single problem people encounter when attempting to dual-boot Linux on an EFI-based computer (such as the vast majority of computers that shipped with Windows 8) is in enabling BIOS/CSM/legacy support in the firmware. To paraphrase Nancy Reagan, just say "no" to BIOS/CSM/legacy support!!! Enabling that support can help get past a hurdle early on, but it creates several new hurdles later. In the end, you need to figure out how to get Linux booted without that support, so enabling it just creates work. (There are exceptions to this rule, but they're rare, and must be discovered on a case-by-case basis through experimentation.) Note that disabling Secure Boot is sometimes necessary, so if you've done that, don't re-enable it -- at least, not yet.

That said, you've clearly made this early mistake, so you now have to correct it. To do so, you should first go into your firmware and disable BIOS/CSM/legacy support. (The details of how to do this vary from one machine to another, but you've probably changed it to begin with, so you might remember what you changed.)

With BIOS/CSM/legacy support disabled, you must then install an EFI-mode boot loader for Linux. There are several ways to do this, but the two easiest are:

Download the USB flash drive or CD-R version of my rEFInd boot manager, prepare a boot medium from it, and boot it. rEFInd should give you options to boot both Windows and Ubuntu. Test both to be sure you can boot both OSes. If you can, boot to Ubuntu and install the Debian-package version of rEFInd. This will set it up as your default boot manager, enabling you to boot either OS from rEFInd without the USB drive or CD-R. Note that this approach requires that Secure Boot be disabled, at least initially. (You can re-enable it later, but that may require jumping through some extra hoops.)
Re-run the Boot Repair utility from whatever Linux installation you can get booted (probably a live CD or USB drive). With BIOS/CSM/legacy support disabled, Linux should run in EFI mode, which should enable Boot Repair to use efibootmgr, which is required for a proper repair of your installation. With any luck, when you reboot GRUB will come up and give you the option to boot either Ubuntu or Windows. Unfortunately, you take more on faith with this approach -- usually it works, but sometimes it doesn't help, and on rare occasion it will make matters worse.

You may want to read my page on EFI-mode Linux installations to learn how to do it right for future installations, or should you decide to just scrap what you've got now and start again.


Grub keeps beeping (because keyboard does not work?)

If you want to disable the keyboard, then you have a few options:

Unplug it from the motherboard
Look for a BIOS setting (I don't know if you can, but it would make sense if you were able to disable an internal keyboard from BIOS)
Take it out and replace it


You need to make the xrandr commands run on startup.

Unfortunately, a lot of people have trouble making the commands permanent, so that they run on startup, but I'll show you how to do it the easy way:

Create a bash script, xrandr.sh for example, and place your xrandr commands into it. It should look something like this #!/bin/bash
xrandr --newmode "1920x1200_60.00"  193.16  1920 2048 2256 2592  1200 1201 1204 1242  -HSync +Vsync
xrandr --addmode VGA1 1920x1200_60.00
xrandr --output VGA1 --mode 1920x1200_60.00
Make the script executable with chmod +x xrandr.sh
Search for "Startup Applications" in the dash, run it, and add the script as a startup application.

The commands will now run every time you log into your account.

OR you can go the easy way and use a program that does the above for you. I created this program - which will work for you, since xrandr works with your setup.


Why is the file permission for /etc/shadow set to 600?

To prevent offline brute-force attacks.

Even though you can't reverse a hash, you can still try hashing every possible password until you find a match, and you can do millions of tries per second with good hardware and local access to the file.

If the file had 644 permissions, then anyone who logged in to your system, even in a guest session, would be able to copy this file off of your computer (whether to a USB stick or remotely via scp) and attempt an offline brute-force attack, without leaving any evidence of this on your computer.

Note that the permissions on Ubuntu are actually 640, not 600:

$ ls -l /etc/shadow
-rw-r----- 1 root shadow 1239 Jun 25 04:35 /etc/shadow

This doesn't matter much though, since there are still no permissions for others, and, by default, no one is in the shadow group.

Originally, hashes were stored in /etc/passwd (which is why it's called passwd), as back when Linux was created, cracking a hash, even the weak types used back then, was practically impossible. Eventually, though, processing power advanced to the point where cracking a hash, at least of a relatively weak password, became feasible.

Changing the permissions of /etc/passwd to 640 or 600 wouldn't work, as there are many legitimate reasons to be able to read /etc/passwd as a normal user (converting UIDs to usernames, getting a user's full name, phone number, etc), so hashes were moved to /etc/shadow, which was given 640 permissions. An x in place of the password hash field for a user in /etc/passwd is used to indicate that the hash for that user is stored in /etc/shadow instead.


How to have brackets completion in the terminal?

bash reads ~/.inputrc file, which allows binding certain keys to macros. In our case, we need macro that automatically types in "()" and Ctrl+b (which is move back one word ) shortcut.

Open the file with gedit or any other text editor and type in the following

 "\C-]":"()\C-b"

That will bind Ctrl + ] to do what you want. Now open terminal or call a new instance of the shell and test it out.

You can try binding it to any other keyboard short-cut, but there is only so much you can do.


How can I fix my WPA-EAP certificate problem?

I have the same issue here (UQAM), it should have a certificate but, it does not. When you connect for the first time, it wont set it properly so, you need to go to /etc/NetworkManager/system-connections and find your connection name, edit the file. You should see this line:

system-ca-certs=true

change it to

system-ca-certs=false

If the line does not exist, add it below the [802-1x] section.


My wireless card is stuck on channel -1 when I'm trying to use aireplay-ng

Finally got it. I had to patch the driver with the negative 1 patch. I was applying the patch incorrectly though. Patch syntax is patch -p(one) not patch -pl.


Is there a programmable way to tell if the screen is locked with the new Unity interface?

I looked through the packages mentioning unity (apt-cache search unity), ignoring anything with lib, lens, etc. in the name. unity-services caught the eye. One of the files in this package is /usr/share/upstart/sessions/unity-panel-service-lockscreen.conf, an Upstart job containing:
description "Backing Service for the Unity Panel"
author "Andrea Azzarone <andrea.azzarone@canonical.com>"

start on desktop-lock
stop on desktop-unlock

respawn
exec /usr/lib/unity/unity-panel-service --lockscreen-mode

As you may have guessed, this job is run when the screen is locked. This gives you a couple of options:
Check if the command in the exec line is running:
Check whether /usr/lib/unity/unity-panel-service is running with --lockscreen-mode option. Note that unity-panel-service is always running, but when you lock the screen, another instance is started with that option. So something like:
if pgrep -cf lockscreen-mode
then
    # do stuff
fi

pgrep -f searches the complete command line, so we can search for the option.
I think in this case the manpage of unity-panel-service is wrong or outdated. It says:

unity-panel-service takes no options.

Use an Upstart job
You can work off the above job configuration to write your Upstart job. Create a session job (say some-job) ~/.config/upstart/some-job.conf containing:
description "Some script to be run when screen gets locked"

start on desktop-lock
stop on desktop-unlock

script
    # do stuff
end script

A converse script with the start and stop events swapped can be used to run things when the screen is unlocked.


Accord to this from nmap devs;

Zenmap is not in the ubuntu repository anymore because is not
compatible pyhton3-gtk3 we have to wait until they use PyGObject who
replace pygtk and is compatible python3.
#1176


In /etc/samba/smb.conf on the server, check that the socket options line is:

   socket options = TCP_NODELAY

Note that adding SO_RCVBUF and SO_SNDBUF may speed things up for Linux<>Linux communication but can have some bad slowdowns for Windows or other OS that connect to the share.

As another troubleshooting step, try connecting to the share not by its name (netbios or DNS) but by its IP address (eg. 192.168.0.2).  If this works fine you have something going weird with name resolution, which is a black art (more here).


Upgrade or Fresh Install to Ubuntu 16.04 if I currently have Ubuntu 14.04

Because 14.04 is EOL (End of Life) there are special considerations:

Upgrade or fresh install?
The advantage of upgrading is that you get to keep your current
configuration as is. This is often desirable on production
environments which you want to keep as stable as possible. At the same
time, configuration applicable for older versions might not always
work with newer versions.
If you format partitions when installing a newer version, you have the
option to select a new file system, which might have benefits and
required features compared to the old one. The new installation also
gives you a clean platform to start building your system from; no old
configuration files and potential upgrade-related bugs.
Reinstalling is usually easier and faster, especially if you would
have to upgrade through several releases. It might also help you save
some bandwidth, if that is a concern.

That said if you were to do a clean install you might want to do it on a new partition and keep your old partition intact. This is helpful for migrating settings set many years ago on the old partition but unknown for the new partition. For example you may have custom scripts in /usr/local/bin or custom settings in /etc which you setup many years ago and then forgot about until the new installation isn't working properly.
If you want to upgrade you should consider cloning your old partition to the new partition and run the upgrade on the clone. Then if the upgrade fails, you can reclone, fix the error condition and run the upgrade again.
Please note an upgrade can take 40 minutes (in my case) to a few hours (reported by other users) depending on your system.
A few times a day, a few times a week, month and year I will change different system settings. Over the course of five years I forget all that I've changed. The advantage of upgrading is none get lost. The disadvantage of reinstalling is all get lost.


It's not a font error - it looks the pretty much the same in Safari on my Mac. The text is stylized with a  tag and the browser is doing its best to render the sans-serif font called in the CSS stylesheet. In Firefox, bring up the Inspector panel (Control-Shift-I) and you can see the HTML element properties for each section on the page.


Ubuntu 15.04. fills up root partition automatically quite quickly!

I have the same problem too.
And I also identified where all the disk space is going:
du -hs /var/lib/apt/lists/partial
152G    /var/lib/apt/lists/partial

It seems that there is a bug in apt: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1445239

And, the fix for it is manually installing apt 1.0.9.10 from here: https://launchpad.net/ubuntu/+source/apt/1.0.9.10ubuntu1/+build/7460103

Just install apt and libapt-pkg4.12


Depending on your PC, you would usually want to increase the memory as much as possibles in order for it to run smoothly. As for HDD, it a minimum of 20GB is enough. You can also set the number of cores. More info on this site: http://wiki.opencog.org/w/Setting_up_Ubuntu_in_VMWare_for_Noobs


How to see the actual memory and its properties (slot position, size, speed...)


possibility of concurrent p2p and AccessPoint modes in single wifi interface

Yes it is possible.

From the valid interface combination, its clear that we could make a maximum of two interfaces(total <= 2), in which, in our case we will choose the second combination - (AP and P2P-GO). But take care of the restriction, channels <= 1. We should use the same hardware channel in both hostapd and wpa_supplicant.

setting channel in wpa_supplicant for p2p mode :

p2p_oper_channel=11
(in hostapd.conf, the corresponding parameter is channel)

In some case, one more restriction will be there, ie BI must match. In that case, set beacon interval  to the same value in both hostapd.conf and wpa_supplicant.conf.

beacon_int=100

sometimes you need to specify the operation reg class also.

p2p_oper_reg_class=60


Error when updating from Ubuntu 13.04 to 13.10

You are using an old Ubuntu and no longer gets supported from Canonical. Open the Terminal using the key combination Ctrl+Alt+T and enter the command:

sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

It will replace all archive.ubuntu.com -> old-releases.ubuntu.com. This repository old-releases.ubuntu.com maintains packages for old Ubuntu versions.

And then enter the command

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

to fetch the new lists.

Finally, restart your ubuntu upgrade.

Note: Instating of using GUI, you can launch following commands one by one to get it to upgrade:

sudo apt-get install update-manager-core
sudo do-release-upgrade -d


Ubuntu Studio 20.04 Login doubling to a second login which won't allow a password entry, requiring reboot

I think you could try change your user's password to password which contains numbers only and verify if it works. Maybe your display manager's keyboard layout is wrong there.

You could also switch to different display manager without that behavior (or bug):

sudo apt install lightdm && sudo dpkg-reconfigure lightdm

or

sudo apt install gdm3 && sudo dpkg-reconfigure gdm3


Ubuntu for lenovo thinkpad Tablet 2 which one?

The Tablet 2 supports only 32-bit UEFI 2.3.1 OS--so you are stuck with Windows 8 or WinPE only.

Source is:

https://forums.lenovo.com/t5/ThinkPad-slate-tablets-Knowledge/How-to-get-to-a-BIOS-Boot-Menu-on-the-Tablet-2/ta-p/994207


How to make kodi as default media player

Kodi does not seem to be build for launching videos from the outside, but it is possible

As from the terminal you can launch a video by running

kodi /path/to/video

How to make it the default player :

Enable opening a video with KODI

You first have to configure the desktop application to be accept file as 'argument'. You have to edit /usr/share/applications/kodi.desktop, one way to do that is to open a terminal and enter :

sudo nano /usr/share/applications/kodi.desktop

find the line Exec=kodi and add %f so that you have

Exec=kodi %f

To save and exit press Ctrl+X then Y and finally Enter.

Now you can open a video with a right-click > Open With Other Application > View All Applications.

Make it default

To make it default you have to open the Properties of a video (right-click > Properties or Ctrl+I) go to the Open With section, then select Kodi and click Set as default.

You will have to do this last action for every file type of video (mp4, avi, mkv, ...).


How can I create a GIF out of a sequence of PNG files without the previous image appearing on the next frame?

I assume you're using http://www.imagemagick.org/. The -dispose command describes what is to be done with the frame after its delay (when the next frame is loaded). Info here: http://www.imagemagick.org/Usage/anim_basics/#dispose

-dispose previous

try:

convert -delay 5 -dispose previous -loop 0 Frame_7_00000*.png" animated.gif


Ubuntu cannot detect Windows 7 so I cannot dual-boot

From the screenshot,it was clearly shown that you accidentally deleted the previously installed Windows partition.

So exit the ubuntu installer and create new partitions for windows and Ubuntu using Gparted Partition Editor.

After that run the ubuntu installer then choose "something else" option and select the created ext4 partition for installing Ubuntu.And don't forget to create a swap partition of size which was double the RAM size(applicable for 1 or 2 GB RAM).


PDF file demands latest Acrobat, how can I read it?

Based on experience Foxit Reader is the best and most updated PDF reader for Ubuntu. You can get it here:
Foxit PDF Reader


Ubuntu Server 14.04 (Bridged VM) Cant connect to network

I had to flush VMware network adapters configurations..


Particular WiFi not detected in Ubuntu 12.04 - Dell Vostro 3560

Boot from the live CD and see if you can make a connection that way.

If wireless does work via the live CD, then you can try reconfiguring your network, or just copying over the network-manager config files:

Re-configuring the network:

Open a terminal and type

sudo dpkg-reconfigure network-manager

OR

Copying over the settings used by the liveCD:

Boot from a live CD, back up your old network settings, clear out any system connection file and copy over the ones from the live CD.

Open a terminal and type the following to become root:

sudo su

then backup,:

mv /media/<Name of your Ubuntu Partion>/etc/NetworkManager/NetworkManager.conf /media/<Name of your Ubuntu Partion>/etc/NetworkManager/NetworkManager.conf.broken

clear,:

rm /media/<Name of your Ubuntu Partion>/etc/NetworkManager/system-connections/*

and copy:

cp /etc/NetworkManager/NetworkManager.conf /media/<Name of your Ubuntu Partion>/etc/NetworkManager/NetworkManager.conf
cp /etc/NetworkManager/system-connections/* /media/<Name of your Ubuntu Partion>/etc/NetworkManager/system-connections/

Reboot the system without the live CD and you should be good to go.


What is the safest way to clean up /boot partition?

Command line method:
First check your kernel version, so you won't delete the in-use kernel image, running:
uname -r

Now run this command for a list of installed kernels:
dpkg --list 'linux-image*' | grep ^ii

and delete the kernels you don't want/need anymore by running this:
sudo apt-get remove linux-image-VERSION

Replace VERSION with the version of the kernel you want to remove.
When you're done removing the older kernels, you can run this to remove ever packages you won't need anymore:
sudo apt-get autoremove

And finally you can run this to update grub kernel list:
sudo update-grub


Problem while upgrding from 11.10 to 12.04

I think you should do a new installation by downloading a 12.04 issue from Ubuntu, burn it to a CD or if you have windows use LILI usb creator program (which is freely available) to create a USB bootable disk and do the installation