How to check if I'm using GRUB-EFI or GRUB-PC?

See this question to determine how your computer was booted:

How can I tell if my system was booted as EFI/UEFI or BIOS?

This isn't quite the same as the question you asked, which is why I'm not marking your question as a duplicate. Ordinarily, the boot method (BIOS vs. EFI) determines which version of GRUB was the last one to boot the computer. (If you have other boot loaders installed, of course, you could have booted through one of them; this approach won't distinguish between, say, EFI-mode GRUB and EFI-mode ELILO.)

You can check to see which version of the GRUB package is installed by using your package manager, as in:

dpkg -l | grep grub | grep ii

Boot loaders like GRUB are unusual, though, in that installing the package is distinct from inserting the boot loader into the boot process. Normally, you install the Debian package and then use its files to insert the boot loader into the boot process; but the latter can be done without a package, and a package can be installed without the boot process being altered. In fact, in your case you might have both the BIOS and EFI versions of GRUB available as boot options.

The simplest way to check to see what's accessible as boot options is to use the Boot Info Script. This script will produce a file called RESULTS.txt that will report what boot loaders are available; however, it requires some knowledge to interpret the output. BIOS-mode boot loaders show up something like this, near the top of the output:

============================= Boot Info Summary: ===============================

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 40
    of the same hard drive for core.img, but core.img can not be found at this
    location.

EFI-mode boot loaders are stored as files on the EFI System Partition (ESP). These files will show up in the output something like this:

sda1:     __________________________________________________________________________

    File system:       vfat
    Boot sector type:  FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:
    Boot files:        /EFI/Boot/bootx64.efi /EFI/ubuntu/MokManager.efi
                       /EFI/ubuntu/fwupx64.efi /EFI/ubuntu/grubx64.efi
                       /EFI/ubuntu/shimx64.efi
                       /EFI/Microsoft/Boot/bootmgfw.efi
                       /EFI/Microsoft/Boot/bootx64.efi

Note in particular the /EFI/ubuntu/grubx64.efi file, which is GRUB. (/EFI/ubuntu/shimx64.efi handles Secure Boot, and other files, especially in /EFI/ubuntu, can be relevant, too.) If you're using an EFI boot loader other than GRUB, it may show up somewhere, too.

In addition, EFI-mode boot loaders are normally referenced by entries stored in NVRAM, which the Boot Info Script will identify via runs of efibootmgr:

=================== efibootmgr -v
BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0000,0002,2001,2003,2002
Boot0000* ubuntu    HD(1,GPT,249432ce-52fe-4533-b029-ba6c1a901382,0x800,0x100000)/File(EFIubuntushimx64.efi)
Boot0001* EFI Network 0 for IPv4 (68-F7-28-DA-88-B8)    PciRoot(0x0)/Pci(0x2,0x4)/Pci(0x0,0x0)/MAC(68f728da88b8,0)/IPv4(0.0.0.0:0<->0.0.0.0:0,0,0)RC
Boot0002* Windows Boot Manager  HD(1,GPT,249432ce-52fe-4533-b029-ba6c1a901382,0x800,0x100000)/File(EFIMicrosoftBootbootmgfw.efi)RC
Boot0003* EFI Network 0 for IPv6 (68-F7-28-DA-88-B8)    PciRoot(0x0)/Pci(0x2,0x4)/Pci(0x0,0x0)/MAC(68f728da88b8,0)/IPv6([::]:<->[::]:,0,0)RC
Boot0004* EFI USB Device (Generic Flash Disk)   PciRoot(0x0)/Pci(0x12,0x0)/USB(0,0)/USB(0,0)/HD(1,MBR,0x4294967218,0x800,0x1f6a800)RC
Boot2001* EFI USB Device    RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC

Note that efibootmgr is usable only from an EFI-mode boot, so if you booted in BIOS mode, you won't see this output, even if an EFI boot loader is available. Also, some EFIs are buggy and forget or ignore EFI boot entries, but they can usually still be booted in EFI mode by using various ugly workarounds.

Anyhow, the efibootmgr output looks scary and complex, but the key points are:

If GRUB is properly configured, a Boot#### entry should point to it. In the case of Ubuntu, it should be called ubuntu, so look for an ubuntu entry -- Boot0000 in this case. (The number could be any hexadecimal value.)
BootOrder shows the order in which boot entries are tried. In this case, 0000 is first, which means that the Boot0000 entry (ubuntu) will be tried first.

The point of all this is that you might have both BIOS-mode and EFI-mode versions of GRUB available for use by the firmware. If so, both will show up in the Boot Info Script output, and it will be hard to tell which one will actually be used. For that, checking your current boot mode is the best approach. Occasionally, confusion can occur, or you might switch from one boot mode to another. Removing redundant boot loaders can help avoid confusion, but this can be risky -- particularly removing a BIOS-mode boot loader from an MBR, since this requires use of dd, which can easily trash your disk if you make a mistake. It's generally best to leave unused boot loaders accessible to the firmware rather than risk such disasters.


Is there a simple text editor (like gedit) with options to make text bold?

If you want a text editor, there is no such a thing as bold.

Plain text is plain text. The bold, italic, colored thing you see in a programming editor like gedit, geany, kate, etc. is syntactic highlight, added by the editor to facilitate the reading and writing of programs or whatever --- it is not stored with the text.

Now, you can leverage this to see bold in the gedit. For example, if you save your file like a markdown (extension .md), you will see this:

...using the same syntax you use in Ask Ubuntu to make pretty questions and answers. You can then have a lot of tools to pretty print them, like for example pandoc.

Otherwise, you are looking for a word processor, which is another kind of beast completely. You have a partial list here; I heard very good reviews of Ted but never tried it.


Why does my laptop think my battery is dead?

You can tell Ubuntu to ignore it by opening gconf-editor, then go to /apps/gnome-power.manager/actions/critical_battery and change it to nothing.


How to live boot ubuntu with ubuntu as host OS without usb?

Wubi's home page  has not been updated in five years, and it points to a non-existent URL at Ubuntu.com . I don't see any support for 18.04 there or at its Launchpad page. I suggest you use a LiveDVD instead.


Difference between Medibuntu end Multiverse repository?

Most of the packages in Medibuntu are now obsolete, but the main difference between it and Multiverse is that Medibuntu contains packages that are legally tricky or not child friendly (for example there is a system monitor application that claims to show a person undressing - I've never used it so I have no clue).

It was once the case that you needed Medibuntu for adding support for many proprietary formats, and for playing some DVDs etc, and even for Adobe Acrobat Reader. However, most of these have been moved into either the Partner repository or the Multiverse.

As for the FFMPEG libraries, they are essentially the same libraries with different compilation options for legal reasons. Medibuntu's version should not be necessary any longer.


Lubuntu, panel items are not arranged in proper way

If that is the total contents of your panel then you need to add a "Task Bar(Window List)" from your Panel Preferences. This is the applet that will show your current windows. When you set it to the panel, check the box under the "Stretch" collumn. This will push everything to either side of it to the edge of your screen.


Both Software Center and Synaptic Package manager won't download packages

try to install that software Labyrinth or whatever the name using Terminal sudo apt-get install .... (name of software instead of dots) and see where you get, paste the code from Terminal here if it won't work, if you need clean up follow this thread after clean up install it again, if you didn't succeed last time. You can also download it from launchpad if you really need it that much, there's even newer version available.


weird change of owner for user home dir when installing vettle

Thanks @IlluminAce for the answer:

  This seems to be a common complaint; if the veetle installation script
  is run as root, then ownership of your home directory is changed as
  you describe. Apparently, Veetle should only be installed as your
  user, not root.


Trying to change PulseAudio application sink/source from command line

Other than canging the default sink we can move a sink input or a source output to another sink or source using pactl (or pacmd).

  move-sink-input ID SINK
  Move the specified playback stream (identified by its  numerical index) to the specified sink (identified by its symbolic name or numerical index).

  move-source-output ID SOURCE
  Move the specified recording stream (identified by its numericalindex)  to the specified source (identified by its symbolic name or numerical index).

To list existing streams we can issue

pactl list sink-inputs
pactl list source-outputs

These can then be moved by index to another location given by index (or name), e.g.

pactl move-sink-input 5 1

Also see How to change pulseaudio sink with  "pacmd set-default-sink" during playback? for using pacmd.


Linux equivalents of Windows / DOS terms

Windows and Linux have very different partition naming conventions.

First C: Drive is not a whole disk drive but just one partition. In Linux, drives are often referred to as /dev/sda, /dev/sdb etc. The partitions inside the drives are indicated by the numbered suffix, such as /dev/sda1. /dev/sda2 etc.

Second, the partitioned need to be mounted before they can be used in Linux. The place where they are mounted are called mount points. A special mount point is /, or the root of the file system. This mount point is reserved for Ubuntu system partition, the rough equivalent of Windows C:\

Third, other non-system partitions can be mounted anywhere as in a folder or sub-folder. For example, if you have a partition for music files, you could mount it in your home folder like /home/[userID]/Music.

Fourth, if your C:\ partition has a name, Ubuntu will try to use that name to mount that partition. If not, you can make Ubuntu mount it folder that you name. For example, you can create a folder /media/OldStinkyC_Drive and mount your C:\ partition there! Note, unlike Windows everything in Ubuntu is case sensitive.

Here is a reference of DOS to Linux commands:

http://www.yolinux.com/TUTORIALS/unix_for_dos_users.html

Hope this helps


How I remove grub text in ubuntu3 version?

I don't know if you have solved this question, but even though it's a bit late, I have been playing with Grub Customizer which allows you to edit most parts of the Grub system.


Ubuntu Touch - clearing down notifications on restart

This has been raised as a defect and awaiting a fix under https://bugs.launchpad.net/ubuntu/+source/indicator-messages/+bug/1388189
Thanks to pomsky for providing the details.


Issue with "ServerName" upon Boot or Restart of Apache2

Edit this file:

sudo vim /etc/apache2/httpd.conf

And put this line in there:

ServerName localhost

Apache is throwing the error as it doesn't, by default, have a ServerName configured.


Ceate a yes/no dialog box to verify user entries

You can include newlines in a double quoted string which also expands variables:

dialog --title "Verification" \
--yesno "Please verify your entered information:
Install SSL : $InstallSSL
Domain Name : $DomainName" 7 60


New installation with invalid signatures: NODATA 1 NODATA 2 error

I would suggest reverting to other country's server instead of the main archive.ubuntu.com, which is probably throttled:


Unable to change thresholds for low and critical battery

I did not identify anything wrong with what you did.
Even so, try gsettings set org.gnome.settings-daemon.plugins.power use-time-for-policy false, and rebooting.
Or sudo systemctl restart upower.service should preform the same as rebooting.
As a workaround, there are two relevant files in /sys/class/power_supply/BAT0 (this location may change depending on the computer, you can easily find it with locate BAT0 assuming your is BAT0).
Check the values in energy_full (the same as in variable POWER_SUPPLY_ENERGY_FULL of file uevent) and in alarm.
The ratio gives you the percentage for an alarm, in my case alarm/energy_full=5%.
You can set it to 10% by calculating target=10%*energy_full, and using that number in echo <target> | sudo tee /sys/class/power_supply/BAT0/alarm.
YMMV.
In the meantime, please post the brand/model of your computer and Ubuntu version.
Related:

How to change critically low battery value?
Laptop not shutting down on low power
Difference between dconf power settings and Upower.conf?

Related to .../BAT0/...:

https://www.reddit.com/r/Ubuntu/comments/9l5nkv/need_solution_to_handle_low_battery_protocol_with/
https://unix.stackexchange.com/questions/84437/how-do-i-make-my-laptop-sleep-when-it-reaches-some-low-battery-threshold
https://linrunner.de/tlp/index.html


Create a desktop shortcut for a terminal comand

[Desktop Entry]
Version=1.0
Name=Shortcut-Test
Comment=No comment for now
Exec=sudo mount xxxx xxxxx
Terminal=true
Type=Application
Categories=Utility;Application;

Should do the trick/ forgot to set Terminal to true to have the password asked


How to export env variables as another user

use env:

su - myUser -c "env myVar=\"$toto\" scriptThatNeedsMyVar.sh"

Assuming, of course, that scriptThatNeedsMyVar.sh is executable, and findable in myUser's PATH, and begins with #!/bin/sh.


Unity3D doesn't work on an Acer Aspire One XG5 with Intel graphics

Please Let Me Ask solved the problem in a comment:

  I fixed it by going to Linux Mint and checking the package manager for openGL files and I went to Ubuntu to apply installation of missing files!!!!!!!!!!!

– Please let me ask May 8 '12 at 16:00


Maybe you should try a tool like "Sound Switcher Indicator" first to make sure it is really a driver issue and not a problem caused through choosing the wrong output source? ;-)

https://yktoo.com/en/software/indicator-sound-switcher

Onboard sound with digital and anolog out, maybe a graphic card with a digital audio out too, this can be very confusing. The tool is very handy to get a quick overview which output source is active at the moment.


You can use xrandr to add custom resolution to the problem.
Typing $ xrandr on terminal will provide you some details about your current display.
$ cvt 1024 768 if you want to add a resolution configuration for 1024x768.
which will give you an output something like this.

# 1024×768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz
Modeline "1024x768_60.00" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync

Now create a new modeline

$ xrandr --newmode <Modeline>

Copy the modeline of the previous output to the place mode line

$ xrandr --newmode "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync

Now you need to add the above mode using the following command

$ xrandr --addmode VGA1 1024x768_60.00

here for VGA1 you have to use what ever that was there for $ xrandr output

$ xrandr --output VGA1 --mode 1024x768_60.00

Now your resolution should be fixed but this will just long last for your current session. To make it work every time you login you need to create a bash file for it and then add it to startup app list.

Tell me if you need more help.


Switch between apps with keyboard only (not ALT+TAB or SUPER+)

You could use the compiz 'scale' plugin with

'scale window title filter'
'scale addon' -> window title (need the 'text' plugin enabled in order to work)

Once activated (meta+w by default), typing part of the title will filter the ones you want, arrows to select.

A very detailed how-to for the installation of the plugin can be found here: How do I enable the "Scale Window Title Filter" in Compiz on 12.04?

The how-to is for Ubuntu 12.04, but nothing has changed for 12.10.


System installation is stalled on Compaq Presario R3000

You can't install Ubuntu on a Compaq Presario R3000 because it doesn't meet the minimum systems requirements for installing Ubuntu. There is only one currently supported *buntu iso file that meets the minimum systems requirements for installing it on a Compaq Presario R3000 and that is Lubuntu 14.04 32-bit. Lubuntu 14.04 desktop requires a Pentium II or Celeron system with at least 128MB of RAM and at least 5GB of disk space.
Every other currently supported *buntu iso file requires at least 512MB RAM and some of them require more RAM than that. Lubuntu 14.04 is similar in look and feel to Windows XP, so it looks like it could be a good replacement for Windows XP, but Lubuntu 14.10, 15.04, 15.10 and 16.04 require at least 512MB RAM too.
When Lubuntu 14.04 reaches end of life in April, 2017, the Ubuntu Minimal CD will still be compatible with your hardware, if you select the command line install. The command line install of the Ubuntu Minimal CD installs nothing but the core packages required to run Ubuntu text-only from a text-only console.
After booting the Ubuntu Minimal CD, follow these instructions:

You need a wired Ethernet connection.
At the "boot:" prompt, press the Enter key.
Select "Command Line Install".
Select your language and country.
Select your keyboard layout.
Specify hostname for your system (for use on the network).
Choose your archive mirror for downloading the base system from.
Partitioning - Most will simply want Guided - use entire disk.
Updates - Select No Automatic Updates.
Let it install GRUB onto the disk.
Other than that, just answer the questions as you are asked.

When the installation is complete, it will reboot to a text-only console. Login to the console with your username and password, and then run these commands:
sudo apt-get install lightdm xorg fluxbox eterm hsetroot xloadimage fbautostart fbdesk fbpager wm-icons
sudo reboot

Update: The fbdesk package has been discontinued in Ubuntu 16.04, so instead of fbdesk just install wm-icons.
The reason why I recommend the optional add-ons to fluxbox that appear after fluxbox in the above apt-get install command is to provide additional functionality to fluxbox window manager while keeping the systems resources usage low.
This will give you a very basic desktop experience, so that you can continue to use Ubuntu on your laptop for years to come. By "basic desktop experience" I mean that you get to use the mouse, instead of only the keyboard, use menus for selecting things, and if you want to use applications you will have to install them yourself.


You have a list of VirtualBox networking modes in its Documentation.

The one you need on both systems is Internal networking. You have to give it a name, you can create several networks in this mode. VirtualBox will connect all guests in the same internal network, so names must match on both virtual machines. The default should work right out-of-the-box.

The server needs an Internal networking with the same name and another one which connects to the world, in your case NAT.

Now the guest server should be able to connect to the internet through the NAT interface.

Give IPs to the machines

In order to the client and the server reach each other, their interfaces must be configured in the same network. You can do it manually (static addresses) or configuring a DHCP server in the server machine.

These are the steps to do it manually:

root@server:~# ifconfig eth0 192.168.1.1 netmask 255.255.255.0
root@client:~# ifconfig eth0 192.168.1.5 netmask 255.255.255.0

You can set any IP you want, but they must be in the same network. Here, eth0 in the server machine refers to the Internal interface, if you set interface 1 as Internal and 2 as NAT, the above commands will work fine.

Now you should be able to ping each other, but packets from the client machine won't be able to travel through the server machine yet, only to the server.

Note: These changes will be lost at next reboot, to make the changes permanent you have to edit and configure /etc/network/interfaces. If you are configuring the client with GUI from the desktop, skip the CLI configuration.

Configure forwarding

You need to configure forwarding. You could simply do

root@server:~# echo 1 > /proc/sys/net/ipv4/ip_forward

but this would only work until you reboot the machine. You need to edit /etc/sysctl.conf and uncomment #net.ipv4.ip_forward=1
 so it looks like:

# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1

This will configure the server machine to forward packets (at next reboot).

Enable masquerading

This will configure the server to do IP masquerading.

root@server:~# modprobe iptable_nat
root@server:~# iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
root@server:~# iptables -A FORWARD -i eth0 -j ACCEPT

Take care about eth0 and eth1, here the 2nd line must be -o NAT_interface and the 3rd line -i Internal_interface.

Configure the client to go through the server

This setting should have been already set, either in the GUI assistant or by editing /etc/network/interfaces/. Just in case it is not applied, add the default route through the server machine:

root@client:~# route add default gw 192.168.1.1

Configure DNS

Now you should be able to communicate from the client machine, but if you configured the IP addresses manually, you still need to provide the DNS servers so you can resolve names.

Edit /etc/resolv.conf and add the servers you like:

nameserver 4.2.2.1
nameserver 4.2.2.2
nameserver 8.8.8.8
nameserver 8.8.4.4

If you configured DHCP in the server machine, you should have already told the DHCP server which DNS servers to use (if not, do it now).

Again, if you configured the client with a GUI assistant, just make sure the DNS are valid and skip this section.


Using paths in a .desktop file
The issue is that Startup Applications creates a .desktop file in ~/.config/autostart
In a .desktop file, you cannot use relative- or variable paths like ~. Use absolute paths instead:
/bin/bash /absolute/path/to/process_monitor.sh docky


What is the loopback device and how do I use it?

The loopback device is a special, virtual network interface that your computer uses to communicate with itself. It is used mainly for diagnostics and troubleshooting, and to connect to servers running on the local machine.

The Purpose of Loopback

When a network interface is disconnected--for example, when an Ethernet port is unplugged or Wi-Fi is turned off or not associated with an access point--no communication on that interface is possible, not even communication between your computer and itself. The loopback interface does not represent any actual hardware, but exists so applications running on your computer can always connect to servers on the same machine.

This is important for troubleshooting (it can be compared to looking in a mirror). The loopback device is sometimes explained as purely a diagnostic tool. But it is also helpful when a server offering a resource you need is running on your own machine.

For example, if you run a web server, you have all your web documents and could examine them file by file. You may be able to load the files in your browser too, though with server-side active content, it won't work the way it does when someone accesses it normally.

So if you want to experience the same site others do, the best course is usually to connect to your own server. The loopback interface facilitates that.

Addresses on Loopback

For IPv4, the loopback interface is assigned all the IPs in the 127.0.0.0/8 address block. That is, 127.0.0.1 through 127.255.255.254 all represent your computer. For most purposes, though, it is only necessary to use one IP address, and that is 127.0.0.1. This IP has the hostname of localhost mapped to it.

Thus, to log in as bob via SSH to the SSH server running on your own machine, you would use:

ssh bob@localhost

Like other network adapters, the loopback device shows up in the output of ifconfig. Its name is lo.

ek@Del:~$ ifconfig lo
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:50121 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50121 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4381349 (4.3 MB)  TX bytes:4381349 (4.3 MB)

An Example: CUPS

One common, production (i.e., not just diagnostic) use of localhost on Ubuntu is to perform advanced printer configuration. In a web browser, go to:

http://localhost:631

CUPS runs a web server on port 631, and this can be used to configure printing, regardless of what GUI you are running (or even if you are not running a GUI at all).

If you try connecting to http://127.0.0.1:631, this will work too. However, if you try to connect to http://127.0.0.2, it will not. All the 127.*.*.* addresses identify your computer on the loopback interface, but a server program can decide to bind just to a specific IP address.

A Notable Difference from Windows

If you come from a Windows background, you might expect loopback to itself be a synonym of localhost (and thus to be able to ping loopback, connect to servers on loopback, and so forth). That behavior is peculiar to Windows.

But you can add any name including loopback to your /etc/hosts file, with 127.0.0.1 as its address, and it will act like localhost.

Other Meanings of "Loopback"

The general concept of loopback is a mechanism through which a message or signal ends up (or loops) back to where it started.

So there are a few other ways loopback is use in Ubuntu that should not be confused with the loopback device in networking.

Loop Mounts

To mount a disk image in Ubuntu, you could run:

sudo mount -o loop image.iso /media/label

This is usually called a loop device (and not a loopback device), but the term loopback file interface is occasionally used.

This has nothing to do with the loopback device in networking.

Sound

Pulseaudio and other sound systems provide a mechanism to "connect" line-in to line-out, so that audio input is echoed back to your speakers/headphones. Pulseaudio's loopback module facilitates this.

Here, it is correct to use the term loopback, but like loop mounts, this also has nothing to do with the loopback device in networking. (And nothing to do with loop mounts, either.)

Further Reading

TLDP, "The Loopback Interface"
How is the loopback device implemented?


Can't drag windows to another workspace on Ubuntu 16.04

I have the same problem.

I can solve it from the CompizConfig Settings Manager and check the Edge Flip Pointer from the Desktop Wall settings, but now it will flip to next workspace just when you move the mouse.

The Edge Flip Move is a confirmed bug on Ubuntu 16.04 https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1577328?comments=all


This isn't answer, but might be a workaround.  I have similar problem with my MacBook Pro, only it is on the built-in display.  It goes away if I:

Plug in an external monitor
Boot/come out of suspend with the power cable disconnected.  I can then connect the power and there is no flicker.

My similar post


Change lock screen background through command line

For me (Ubuntu 15.10 with default Unity) it is working nicely with the following command:

One time necessary:

gsettings set com.canonical.unity-greeter draw-user-backgrounds false

For change picture:

gsettings set com.canonical.unity-greeter background '/path/filename_of_picture.png'

Changed the lock screen immediately. - like Serg mentioned above. In Ubuntu 15.10 (Unity) lightdm is there by default, so just the above mentioned command needed.

Tested with:

xdg-screensaver lock

command which immediately locks the computer.

I just tried in terminal (not from background, like cron), but I am pretty sure it works that way as well.


I think you might just be looking for

ping -c1 -W1 google.com >/dev/null && command

That will execute command only if the ping was successful.


I think it is possible with ebtables, see:

http://ebtables.netfilter.org/examples/example5.html

However you might have trouble getting the setup to be realistic (i.e. to behave like a network link that offers a rate equal to your throughput cap). This really depends on your requirements.

The average throughput will indeed be capped if you measure it over long periods (e.g. seconds), but if you do throttling in software the machine might process packets in bursts (meaning that you will have a processing delay a.k.a latency for each packet, and this delay might vary wildly between different packets). The effect is that for short time scales your throughput will be sometimes much higher than the cap, for others much lower. Only the averaged throughput over long periods will match the cap.

It is possible to lower the processing delay with some crazy optimizations, similar to those used in high-frequency trading, but it is very difficult and you will have to buy expensive hardware (e.g. racked servers) to get them working reliably.

If I were you, instead of spending money on the server, I would get a cheap managed switch (~$100). For instance SG-200s support rate limiting, see "Traffic Shaping" in the manual at page 174 https://www.cisco.com/c/dam/en/us/td/docs/switches/lan/csbss/sg200/administration_guide/78-19562.pdf These switches support rate limiting implemented in hardware and ideally should introduce a packet processing delay that is much smaller than what you get from a software box emulating the switch. You can also rest assured that it works correctly; anything you try to emulate in software needs to be tested and benchmarked carefully.

If you have very strict requirements, you might want to know that the cheap switches usually implement packet queuing using a method called WRR (weighted round robin). There is a more accurate rate limiting method called SRR (shaped round robin), for which the delay variations are even lower; however the price of those switches (certain Catalyst models) is usually above $1-2,000 because the chips run at a much higher clock frequency. Also, the fact that you have only one class of traffic might reduce the gap between them. The implementation difference between WRR and SRR is described here http://www.cisco.com/c/en/us/products/collateral/switches/catalyst-3560-e-series-switches/prod_qas0900aecd805bacc7.html (see Q. What is the difference between WRR and SRR in shared mode?)

(Of course there are other brands/models of managed switches that offer rate limiting; I'm not promoting anything, I'm just telling you about these because that's what I know about. Other brands/models most likely implement very similar mechanisms for rate limiting that might work just fine :) ).


How do I know which partition my Ubuntu installation is on?

i recommend that you use gparted to get an overview over your partitions.
look at the mountpoints, and especially at a partition mounted at /.

alternatively you can use the mount command but the output is somewhat less visual.


How do you rename files from one incrementing pattern to another?

Using the perl-based rename utility:

$ rename -n 's/^(\d+)/sprintf "%02d", $1-47/e' *.mkv
rename(048. banana.mkv, 01. banana.mkv)
rename(049. apple.mkv, 02. apple.mkv)
rename(050. mango.mkv, 03. mango.mkv)
rename(051. pear.mkv, 04. pear.mkv)
rename(052. grape.mkv, 05. grape.mkv)

The trick here is the e modifier on the s/pattern/replacement/ substitution - which lets you evaluate the replacement string as a perl expression - including arithmetic $1-47 and padded formating via sprintf. Remove the -n when you are satisfied that it is doing the right thing.

If you only have a shell, then:

$ for f in *.mkv; do
    n="${f%%.*}"
    printf -v newf '%02d.%s' "$((10#$n-47))" "${f#*.}"
    echo mv -- "$f" "$newf"
  done
mv -- 048. banana.mkv 01. banana.mkv
mv -- 049. apple.mkv 02. apple.mkv
mv -- 050. mango.mkv 03. mango.mkv
mv -- 051. pear.mkv 04. pear.mkv
mv -- 052. grape.mkv 05. grape.mkv

Remove the echo once you are happy that it's doing the right thing.

With zsh and zmv

% autoload zmv
% setopt expanded_glob
%
% zmv -n '(*[0-9])(*.mkv)' '${(l:2::0:)$(( $1-47 ))}$2'
mv -- '048. banana.mkv' '01. banana.mkv'
mv -- '049. apple.mkv' '02. apple.mkv'
mv -- '050. mango.mkv' '03. mango.mkv'
mv -- '051. pear.mkv' '04. pear.mkv'
mv -- '052. grape.mkv' '05. grape.mkv'

In this case, the number formating is done using the l (letter ell) expansion modifier - from man zshexpn:

   l:expr::string1::string2:
          Pad the resulting words on the left.  Each word  will  be  trun‐
          cated if required and placed in a field expr characters wide.

As with rename, remove the -n to actually change the names.


Yes. You can use xsel  tool (a command-line tool to access X clipboard and selection buffers). To install it from terminal, use the following command:

sudo apt-get install xsel

Then, using the following:

<command> | xsel -b

will copy the output of <command>  to the clipboard which can be pasted after with Ctrl + V.

For example:

echo -n "string" | xsel -b

or, simple:

xsel -b <<< "string"

will copy to the clipboard the string string (I used -n argument for echo to suppress the trailing newline).

If you want to copy the text from a file named file_name from the current working directory:

cat file_name | xsel -b

or, simple:

xsel -b < file_name


Headphone volume controlling internal speakers

Yesterday, I found a workaround. I simply installed Alsamixergui (An interface for Alsa), and the program saved my config (headphone volume) to my next boot. This do not resolve the problem, but at least reduce the pain in every boot.


How to make a clean re-install over a same release version?

Options from the live CD
When reinstalling on a system having only Ubuntu installed we have four options from the installer:

Reinstall Ubuntu:
this will keep your settings and your home as much as possible. This means you will still have your personal files from HOME, and the settings from your applications there but you may have to reinstall applications you had installed before. It may also be that some setting from your root directory will be kept which in case of a broken installation may not be what we want (but it may be worth to try before we have to start from scratch).
Install alongside:
this will create a dual-boot with your previous installation (which may be quite confusing from the resulting boot menu).
Erase Ubuntu and reinstall:
all of your data will be deleted. The hard drive(s) and all partitions on it will be deleted, reformatted and used for a new installation. In this case we need backups to be able to restore our personal data.
Something else:
this option lets you fine tune your partition, and will also let you define partitions to use for special purposes in your new installation.

Something else but keep HOME
As soon as the partitioner gparted opens it's window we are able to inspect the exiting partitions on our drive to select which ones to use for the new installation.
By default all used partitions are marked as "do not use the partition". After having selected a partition we may press "Change..." to edit this. The following window lets us define how to use the selected partition:

Use as: choose the filesystem your existing HOME was on
Mount point: choose the mount point /home for your HOME partition

do not tick "format" to prevent from formatting (and deleting) your existing data

repeat the above for mount points \, \swap or any other partitions you want to reuse.

only tick format on those partitions you really want to delete

Reuse an existing HOME partition
In case we had installed without choosing the mount point of our existing HOME we will create a new /home/ directory filled with default values for the newly created user.
If we then need to reuse the old HOME partition we have to make sure to mount it on boot. The steps are similar to how I outlined in my answer to the following question but without the copying bits:

Move home folder to second drive

Basically, you need to edit your /etc/fstab to mount the existing partition as /home. You also should delete (or better rename to be able to undo) the newly created empty /home of your new installation before you can use the previous HOME partition on the next reboot.

To avoid doing this when a user is logged in it is better to perform the above from a live session.

The advantage of keeping your old HOME partition is that all your data and all your application setting will be preserved.
But this also may be disadvantageous in case your broken installation came from bad user settings. These of course will then also be restored.


408 error in browser using Google or openid on some networks in Ubuntu

Ok, I finally solved the problem using plain old dumb luck and persistence.

I have lost the link, but via many searches I came on a path to a Russian web site (translated to English by Google) where people had similar problems with a range of TP-Link routers, the same brand as my ISP provided to me.

The solution was to lower the MTU from it's default 1500 to 1400. Maybe higher will work, but for today I am a believer in "Don't fix what isn't broken"

I hope this helps some one else :-)


After updating Ubuntu to 13.04, the port just started working. lsusb gives the same results as before, but now i can connect to that port.

I know this is not a real answer, as it does not fix the problem from the original question as-is, but upgrading works.


There are a lot of reasons that can make a connection fail, even using keepalives and things like that; so you should think about a mechanism to restart it automatically.

What I would do is:

set up your SSH endpoint so that you can log in with a key in password-less mode: How can I set up password-less SSH login?
Prepare a script that do the connection in an infinite loop --- restarting if failing; use "keepalive" nonetheless;
launch it at boot: How do I get a program to start up at boot?

Notice that probably you will need to use su -c (or sudo) to run the ssh as your user --- commands in /etc/rc.local are run as root. (Thanks @muru).


Ubuntu 16.04.2 in Virtual Box does not start

I had the same issue on Windows 10 host when I installed Docker it automatically enabled Hyper-V and the Ubuntu Guest Os beahved exactly like you describe, nothing helped but disabling Hyper-V in Windows 10 host settings - Win+R ->OptionalFeatures.exe -> uncheck Hyper-V


Unable to edit /etc/apt/sources.list file

Use the terminal text editor program nano instead of gedit to edit /etc/apt/sources.list. Open the terminal and type:

sudo nano /etc/apt/sources.list

The instructions for using nano are always displayed at the bottom of the page. Use the keyboard combination Ctrl + O and after that press Enter to save the file to its current location. Use the keyboard combination Ctrl + X to exit nano.

You can also use the terminal program vim to edit text files, but nano is easier to use.


What are the default settings in debconf's configuration?

One way is to open the debconf template database /var/cache/debconf/templates.dat with your favourite text editor and search for the entries of the package debconf (debconf/frontend and debconf/priority). The entries have the property Default which specifies the default value.


Which one consume less battery in Ubuntu (generally Linux) Ethernet cable or Wireless?

If you'd like to experiment for yourlself, you're free to compare the power consumption rates between the two adaptors. I'd suggest running on AC-only (remove the battery) and using one of the techniques in this question:

How do I monitor power consumption?

The process would be fairly simple. Switch to wireless, leave it tracking for a set period of time. Something meaningful like an hour might be worthwhile. Then switch to wired and repeat.

As I mention in my comments, hardware can vary hugely. My ethernet card might use twice as much power as yours. My wireless card might use even more. Who knows until we've all experimented?


Is there any help why Steam doesn't load up?

You're having documented problems with the AMD drivers.  You can start it by running this from the terminal:

$ LD_PRELOAD='/usr/$LIB/libstdc++.so.6' DISPLAY=:0 steam

You can also make a script and desktop launcher using these steps:

Edit a startup file (steam.sh):

$ gedit ~/bin/steam.sh

Add this content and save the file:

#!/bin/bash
export LD_PRELOAD='/usr/$LIB/libstdc++.so.6'
steam

Create the launcher:

$ sudo apt install gnome-panel
$ gnome-desktop-item-edit --create-new ~/Desktop

For the new launcher use:

Type       Application
Name       My Steam
Command    (Click the browse button and browse to the `steam.sh` script.)
Commen     My Customized Steam Launcher

Click OK

Now copy or move the new launcher from your ~/Desktop to ~/.local/share/applicatons/

Now you will have two launchers in your Ubuntu Dash Search.  When you run the new one, it will surface as the first one in the list.  The broken one will scroll off after a few launches.


It seems I solved the problem thanks to https://ubuntuforums.org/showthread.php?t=1957680 by appending this to /etc/network/interfaces:
Code:

auto enp0s25
iface enp0s25 inet dhcp


This looks like a firewall is locking the ping.

I supose you are using Ubuntu 12.04.

By default, ubuntu has no firewall configured, but you can try to stop it.

sudo ufw disable

You can try to stop iptables

sudo service iptables stop

It will stop the service. Try if you can conect now. To start it again.

sudo service iptables start

Or maybe can be a virtual machine issue. When I was making an own lab on virtual box from Windows, I couldnt ping from my virtual machines to windows. I didn't fix this issue.

Source: How do I turn off the firewall in Ubuntu 12.04?


I am new to Linux. Is it always this slow when moving files?

RAM vs swap

Setting vm.swappiness=10 is wrong wrong wrong for 4G RAM with an i3. This is why your file copies fail. Set it back to 60 now... and we may change it more later.
Set drive caching and I/O Scheduling back to default.
free -h and grep -i swap /etc/fstab show me 4G RAM and a 2G /swapfile. The /swapfile is probably too small for your system, so we'll make it twice the size, like this:

Bigger /swapfile

Warning: Be careful. Improper use of the dd command can cause file loss. Best to copy/paste.

free -h                   # confirm 4G RAM and 2G swap
sudo swapoff -a           # turn off swap
sudo rm -i /swapfile      # remove old /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

sudo chmod 600 /swapfile  # set proper file protections
sudo mkswap /swapfile     # init /swapfile
sudo swapon /swapfile     # turn on swap
free -h                   # confirm 4G RAM and 4G swap
reboot                    # reboot and verify operation

Update #1:

Although the larger swap file helped, it didn't entirely fix the problem. User swapped out HDD for SSD, and it's all working ok now. Maybe some bad blocks on the HDD?

Update #2:

To bad block your old HDD...

Note: do NOT abort a bad block scan!

Note: do NOT bad block a SSD

Note: backup your important files FIRST!

Note: this will take many hours

Note: you may have a pending HDD failure

Boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode.

In terminal...

sudo fdisk -l # identify all "Linux Filesystem" partitions

sudo e2fsck -fcky /dev/sdXX # read-only test

or

sudo e2fsck -fccky /dev/sdXX # non-destructive read/write test (recommended)

The -k is important, because it saves the previous bad block table, and adds any new bad blocks to that table. Without -k, you loose all of the prior bad block information.

The -fccky parameter...

   -f    Force checking even if the file system seems clean.

   -c    This option causes e2fsck to use badblocks(8) program  to  do  a
         read-only  scan  of  the device in order to find any bad blocks.
         If any bad blocks are found, they are added  to  the  bad  block
         inode  to  prevent them from being allocated to a file or direc‐
         tory.  If this option is specified twice,  then  the  bad  block
         scan will be done using a non-destructive read-write test.

   -k    When combined with the -c option, any existing bad blocks in the
         bad blocks list are preserved, and any new bad blocks  found  by
         running  badblocks(8)  will  be added to the existing bad blocks
         list.

   -y    Assume  an answer of `yes' to all questions; allows e2fsck to be
         used non-interactively.  This option may not be specified at the
         same time as the -n or -p options.


How to install Ubuntu touch on LG E617G Optimus L5

At the moment it is only working with the following devices:

https://wiki.ubuntu.com/Touch/Devices

I'm sorry, hope it helped solve your doubt.


I did a trial install of 18.04 Beta Lubuntu on a system with an encrypted home.  This system has separate / and /home partitions, so I was doing a "Something Else" install, formatting and installing to /, and not touching /home.

Every other time I've done this (with older versions of the installer) on the screen where you put in your username, at the bottom 3 options appeared, one of which was "encrypt your home directory" or words to that effect.  This option was always ticked and grayed out (because the installer knew that the home directory was encrypted).  This didn't happen this install - the option was not offered at all- and when the install was complete, I couldn't log in.

To fix this, I had to reboot, switch to a terminal login (Ctrl+Alt+F1), and install ecryptfs-utils.  Another reboot and I could log in.

There was another user on the same PC with a different encrypted home. I could never manage to log in that account.  I finally deleted the user, re-added them with encrypted home, and reloaded their home directory from backup.

This was all quite a hassle and I probably won't be encrypting home directories any more.


how to grep for the line with multiple keywords and make it into csv

Would this works for you :

cmd param | grep 'foo1\|foo5\|foo7' | tr '\n' ',' | sed 's/,$//'

tr '\n' ',' replace every line return with a ','
sed 's/,$//' remove the last character if it's a ','

And if you want to put it in a csv file you can add an '\n' at the end of the line then redirect it to a csv file :

cmd param | grep 'foo1\|foo5\|foo7' | tr '\n' ',' | sed 's/,\?$/\n/' >> file.csv

sed 's/,\?$/\n/' Will remove the last char if it is a ',' and add an '\n'
>> is used to add at the end of your csv file without removing what is already inside


Virtual Machine with dedicated Mouse, keyboard, monitor

Alternatively you can connect one extra monitor, one extra keyboard and one extra mouse directly to your host. HDMI cable can be easily more than 20 meters long, active USB extensions are also available.

In VirtualBox manager go to Settings -> USB -> Add new USB Filter (it is a small image with a "+" sign) and add the keyboard and mouse, so that they do not interfere with the host. Probably you will have to install VirtualBox Extension Pack - make sure to install it yourself so as not to violate "Personal Use Agreement" :-)

When you start a virtual machine, make it run on the dedicated monitor in full-screen mode.

To put it in autostart, create a command from the list of virtual machines by right-click -> Create Shortcut on Desktop.

Negative side of this solution is that you can also work on that machine as it is an extension of your desktop.


Why I can't login without a password in my encrypted account?

The act of encrypting also implies you have to abide by the rules set for encrypting. One of those rules is: NO automatic login. Your password is required to unwrap the mount pass phrase used to decrypt your home.

If you want automatic login: remove the encryption.

  I don't see the "Asked on Login" option, so this menu has presumably changed since 13.04.

No, it is as intended: encryption does not allow automatic login.

  I have an encrypted disk, and I get asked for a password before reaching the login prompt, then again to log in.

Password is asked for every encrypted partition. Do you have both / and /home encrypted? If so have a look at this how to.


Compiled package and dependency management

The better way to do that is to update Squid package itself with a new upstream version, using Debian package management system.

You can also remove Squid package and its configuration by typing in a terminal:

sudo apt-get purge squid

As is, it will not remove any dependency in a automatic way.


I'm not sure if this is the official method but what is now working to write a file to the target system is:
 late-commands:
    - echo test5 > /target/etc/test5.conf

I had tried that before and it didn't work but I can only assume there was some other error I missed that caused it to fail on that test.
Using curtin in-target --target=/target -- cmd as part of late-commands works for running commands.
I haven't managed to get any of the other methods (e.g. cloud-init-per, write_files) to work. This solves my immediate need however.


How do I switch Control and Alt/Option on Mac keyboard?

I just installed Debian on a mid-2012 MacBook Pro and encountered the same problem after looking around for a while. I am very new to this whole Linux business and StackExchange, so bear with me. If you are not familiar with MacBook keyboard like myself, you can use xev to find out their names, keycode, etc.

My keyboard has a similar setup:

[fn] [ control ] [alt/option] [⌘ command] [space] [⌘ command] [alt/option]

Using xev, this is equivalent to:

[fn] [Control_L] [  Alt_L   ] [ Super_L ] [space] [ Super_R ] [  Alt_R  ]

Under /usr/share/X11/xkb/symbols/, you can modify the mapping on different levels, for this answer, I'll just stick with pc.txt. In it, you'll find something like:

key <LFSH> {    [ Shift_L       ]   };
key <LCTL> {    [ Control_L     ]   };
key <LWIN> {    [ Super_L       ]   };
...
key <RTSH> {    [ Shift_R       ]   };
key <RCTL> {    [ Control_R     ]   };
key <RWIN> {    [ Super_R       ]   };
key <MENU> {    [ Menu          ]   };
...
key <ALT>  {    [ NoSymbol, Alt_L   ]   };
include "altwin(meta_alt)"

Then I just swap Alt_L and Super_L, then save, reboot.


You need to install pip3.

sudo apt-get install python3-pip should do it.

Then use pip3 -V


You can check which devices NetworkManager manages with

nmcli d

If your ethernet connection shows up as unmanaged, you should check if /etc/NetworkManager/NetworkManager.conf has your ethernet connection managed = false. This should be true otherwise NetworkManager will ignore this device.

Otherwise you can check network manager says "device not managed".


Not able to extract files to the icons folder

Extract them to your Home folder .icons folder instead, note that the folder is hidden.

If it's not there create it.

Now answering your question, the error is telling you exactly why you can't you don't have permissions. The folder is owned by root, you're not root and you don't have to be for this, you can extarct them to any folder in your Home folder, then use gksu nautilusto move the to the usr/share/icons folder.


Lock screen when XScreenSaver is installed

If you want to manually lock the screen with the keyboard combination CTRL+ALT+L then you will need to run the following to repoint the old gnome-screensaver lock to xscreensaver

sudo ln -s /usr/bin/xscreensaver-command /usr/bin/gnome-screensaver-command

Linked Question:

How can I change or install screensavers?


Partition advice, how can I stop running out of space on "/" partition?

Here are some ways to reduce the space taken up by packages:

Remove your auto removable packages:
go to System -> Administration -> Synaptic Package Manager. Click the 'Status' button in the bottom left. Click the Installed (auto removable) filter. Click on one of the packages and press Ctrl-a to select them all. Next right click on one of the packages and click 'Mark for Removal'. Then click the Apply button in the toolbar.
Delete your cached packages:
in Synaptic, click Settings->Preferences and click the 'Files' tab. Click the button that says 'Delete Cached Package Files'.
Set it so that packages are deleted once installed:
in Synaptic, click Settings->Preferences and click the 'Files' tab. Click the radio button that says 'Delete downloaded packages after installation'.

You could create a bash script to automate these tasks:

#!/bin/sh
#~/clean.sh
apt-get autoremove
rm /var/cache/apt/archives/*.deb

This could be run with this command:

sudo ~/clean.sh

Diagnosing where the space has gone:

Go to Applications -> Accessories -> Disk Usage Analyser.

Click the 'scan filesystem' button:

This should give you a breakdown of what space is being used and where:

Separating parts of the filesystem to different drives/partitions:

It is possible to put parts of the filesystem (such as /var or /usr) onto a separate  partition on a different drive. The process would be the same as separating yout /home partition, which you have already done.

These tutorials: http://www.psychocats.net/ubuntu/separatehome and http://www.psychocats.net/ubuntu/mountlinux should give you the necessary information for this.


How Do I accept an Agreement in Terminal?

When a screen like that comes up, not just for accepting license agreements, you can use the Tab key to navigate between the different options and the Space bar to make a selection.


How can I integrate nightingale with the Unity sound menu?

This cannot be done without patching nightingale. I recommend trying to contact the devs, or add a ticket to nightingale's bug tracker :)


It seems like you have a bad sources list configuration.

Using the following command:

gksu gedit /etc/apt/sources.list

allows you to edit the sources list file.  Find the line that points to the bisigi PPA and edit it so that it looks exactly as below:

deb http://ppa.launchpad.net/bisigi/ppa/ubuntu natty main
deb-src http://ppa.launchpad.net/bisigi/ppa/ubuntu natty main

Save the file and exit.


HP Pavilion G6 Won't Suspend with Ubuntu 14.04

Try updating to an upstream kernel, I'm on 3.15rc2 on trusty and it's working now where it wasn't before.

https://wiki.ubuntu.com/Kernel/MainlineBuilds


You take help from apache on-line documentation.

here is actual steps to enable userdir directives :

Configuration

Step1 # enable userdir module

sudo a2enmod userdir

Step2 # Setting the default file path with UserDir

sudo echo 'UserDir public_html'  >> /etc/apache2/conf.d/userdir.conf

Step 3 # reload/restart apache to for effect changes made. apache will read userdir.conf because apache.conf already have entry of Include conf.d/

sudo /etc/init.d/apache2 reload

Testing

Now apache will read html files from publi_html directory in users home directory. so let create that and test.

Note: assuming that you are log-in using test user

mkdir public_html

then create test html page

echo 'Test Page' >> public_html/index.html

Test

curl http://localhost/~test/


printing every nth string of characters to new file

It would be convenient for you to read about the cut command.
Specifically what you require is something like:
cut -c 7,14,21,28 test > result


You could try this:

mv ~/.steam/steam/* ~/.local/share/Steam/
rmdir ~/.steam/steam
ln -s ../.local/share/Steam ~/.steam/steam
rm -rf ~/.steam/bin

Which is essentially doing what the steam executable is trying to do, but failing.


You have a pretty fundamental mis-understanding of how scp works.

Assuming "local" is where you want the file to end up, and "remote" is where the file is now, do this:

scp user@remote:/path/to/file.name ~

~ can be replaced with where ever you want the file to go on local.

DO NOT ssh to remote first. When you ssh to remote then run that command you are effectively copy the file from remote to remote, which is not what you want.

Do what you are doing, but skip step 1. Run the scp from bash/terminal on your local machine, don't ssh to remote first.

(deleting my other answer as it is no longer relevant)


Connect to a VPN with a password from the commandline

I can suggest couple of options

sshpass (Caution: I haven't tried myself, and it is not secure if someone is looking over your shoulder or goes through your history)

sshpass -p vpnpassword <your command>

It works with SSH connection, give it a try.

A more practical and somewhat safer approach. Take a look at expect, which installation in Ubuntu is as easy as

sudo apt-get install expect

Write a wrapper script, use expect inside your bash script

expect <<- DONE
expect "<put here what you see in your password prompt> "
send "<vpn password>\n"
interact
DONE


fonts.conf - use Droid fonts where possible

Ok, i replaced 'Droid' with 'Droid Sans', 'Droid Serif', etc., and it worked:

vic@wic:~/Documents$ fc-match sans
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
DroidSans.ttf: "Droid Sans" "Regular"
vic@wic:~/Documents$ fc-match serif
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
DroidSerif-Regular.ttf: "Droid Serif" "Regular"
vic@wic:~/Documents$ fc-match sans-serif
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
DroidSans.ttf: "Droid Sans" "Regular"
vic@wic:~/Documents$ fc-match mono
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
vic@wic:~/Documents$

Then i added more patterns to the file, and now fonts are replaced in browser:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Droid Serif</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Droid Sans</family>
    </prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer>
      <family>Droid Sans</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Liberation Mono</family>
    </prefer>
  </alias>

  <!-- Replace Arial, Times New Roman, Verdana and Courier New -->
  <!-- with their counterparts. Strong binding used to override -->
  <!-- distribution defaults -->
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Arial</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Dorid Sans</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Times New Roman</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Droid Serif</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Verdana</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Droid Sans</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Helvetica</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Droid Sans</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Courier New</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Liberation Mono</string>
    </edit>
  </match>
  <match target="pattern" name="family">
    <test name="family" qual="any">
      <string>Courier</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Liberation Mono</string>
    </edit>
  </match>

  <match target="font">
  <edit mode="assign" name="rgba">
   <const>none</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintmedium</const>
  </edit>
 </match>
 <dir>~/.fonts</dir>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
</fontconfig>


How to delete a row when all columns are less than one

To exclude rows where all (numeric) column values are less than 1, print those for which at least one column has a value greater than or equal to one:

$ awk '{for(i=2;i<=NF;i++) if($i >= 1){print; next}}' file
a  0.34  3.03  1.92
b  1.35  1.34  0.63
c  0.66  2.32  1.01
d  0.23  2.07  0.22

or

perl -alne 'shift @F; print if grep { $_ >= 1 } @F' file

or (more expressively, using any from the List::Util module)

perl -MList::Util=any -alne 'shift @F; print if any { $_ >= 1 } @F' file

Your proposed R command (posted in comments) was close: it fails, I think, because you didn't exclude the first (non-numeric) column ex.

> dat = read.table("file")
>
> dat
  V1   V2   V3   V4
1  a 0.34 3.03 1.92
2  b 1.35 1.34 0.63
3  c 0.66 2.32 1.01
4  d 0.23 2.07 0.22
5  e 0.34 0.47 0.55
>
> dat[!apply(dat, 1, function(x) all(x < 1)), ]
  V1   V2   V3   V4
1  a 0.34 3.03 1.92
2  b 1.35 1.34 0.63
3  c 0.66 2.32 1.01
4  d 0.23 2.07 0.22
5  e 0.34 0.47 0.55
>

but

> dat[!apply(dat[,-1], 1, function(x) all(x < 1)), ]
  V1   V2   V3   V4
1  a 0.34 3.03 1.92
2  b 1.35 1.34 0.63
3  c 0.66 2.32 1.01
4  d 0.23 2.07 0.22
>


Unmet dependencies error when installing wine

Hi and welcome to Ask Ubuntu, Carter.
To fix this problem, I recommend installing Synaptic Package Manager. This is a tool that allows you to fix and diagnose problems with your packages graphically.  Download Synaptic
 How to use Synaptic Package Manager (Documentation)

From there, you are able to find broken packages. It should look something like this:

How to fix broken packages with Synaptic

Good luck.


Have you tried this answer posted by Bruno Pereira?
Can I blacklist an appindicator?

To not load an applet just prevent it from running.

If the indicator is coded in to the application and the application does not give you an option to remove the indicator from the panel you wont be able to omit it, you cannot omit an application indicator that is build in to the code and has no option to disable it, for that you need source code changes either made by you or you can suggest them to the app developer, which is the last case will be depend on which applications your are referring to.

There are no specific guidelines explaining if and application should or should not have an inductor applet, only what an indicator applet should do.

You can still remove the system applets made by gnome for you system or if the application it self uses an external applet to be used as a indicator.

To remove one of the gnome / unity indicators that are visible by default open the terminal and run this command to show all the applications that can be loaded at start up

cd /etc/xdg/autostart/ && ls
Identify the applet that you want to prevent from loading and edit it with your favorite text editor, ie:

sudo nano nm-applet.desktop
Locate the line with these contents

NoDisplay=true
and change it to

NoDisplay=false
Save and close the terminal.

Click the cog weel in the top right corner of the screen next to your username and select Startup Applications..., now you will see the application that you just edited the .desktop file and you can disable it.

The applet wont load on next boot

After enabling or disabling and applet following the steps above you will see that each .desktop that you modify will create it's own .desktop file in your ~/.config/autostart folder.

If an applet indicator that you want to disable does not show on your startup list you need to use the method above, else there will be a .desktop file inside ~/.config/autostart that can be edited with the described method and will then be possible to enabled/disabled in the startup applications.


Why does update-notifier contains system-crash-notification?

I had this same problem of error dialogs appearing at launch of the desktop.

I used krunner to show system activity (ctrl+esc on my Kubuntu). Then I found the "system-crash-notification" process and worked my way up the process tree using "jump to parent" from the right-click  menu. For me it was lightdm at the top of the tree. So I tried re-installing lightdm (sudo apt-get install --reinstall lightdm lightdm-kde-greeter) which completed but didn't fix the error.

Then I checked the lightdm logs in /var/log/lightdm/ and the x-0-greeter.log showed some IBus errors. Vague recollection on IBus suggested these were fine though.

So, instead I use apt-file search system-crash-notification to find the package responsible and see if I could dump it. Turns out that a dependency of update-notifier wasn't installed so I purged update-notifier (in aptitude, but you can do it using sudo apt-get remove --purge update-notifier update-notifier-kde).

That solved it and now on rebooting there are no error notification dialogs. That might not be the best way to fix this but it worked and the system is running stable.


openjdk-8-jdk Error: Could not find or load main class

You need to compile the code first:

javac table.java

this will create the file table.class. This is the executable program, which you can run like so:

java table

(without the .class extension)


Missing Operating System Error When Rebooting from USB Drive

My suggestion is to try to create the live-usb by the cat or dd command.

Plug in your USB-Stick or card reader with the card you wish to write to and:

sudo cat /path/to/ubuntu-*.iso > /dev/USB_raw_device_node

or

sudo dd if=/path/to/ubuntu-*.iso of=/dev/sdX

To find out, what the X in sdX represents in your case, run the sudo fdisk -l command.


Is booting to Ubuntu 16.04 LTS through Legacy boot mode from safe?

This is going to be a bit longer, so I am unable to post it as a comment.

You have three drives attached to your system.The first drive sda has two partitions, sda1 is a Microsoft reserved partition, maybe a leftover from a former Windows-installation on the drive. sda2 is a NTFS-partition, data-storage.
The drive has a GPT-partition-table.

On your second drive sdb your recent Windows is installed in UEFI-mode, ESP-partition sdb1 is on this drive. GPT-partition-table.

On your third drive sdcyou just installed Ubuntu, but in legacy-mode, this is the point creating your headache. You should have installed in UEFI-mode.
The drive has MBR-partition-table.

You should convert this drive from MBR to GPT, you can use Gparted to do that.
Then install Ubuntu again, but install in UEFI-mode. You have to boot the installer in UEFI-mode to do that, how you boot is how it installs.
Grub will be installed on the ESP-partition off the internal drive. By default Grub will be installed on the ESP of sda. This fact leads to the next issue.

The ESP-partition should be on the first drive sda, but just right now it is on the second drive sdb. That may lead to boot-problems.
I don't know if it is possible to change the drives in your laptop, that would solve this issue. If the second drive is an external drive too, then you have to leave it as it is.

Before doing all that you may try the suggested repair by running Boot-repair again (click recommended repair-button) and see if it works properly.
I have my doubts...

I found this and that leads me to another idea.
You want to install in UEFI-mode, but you don't want your Windows-drive to be affected in any way. You may try this:

Detach the Windows-drive from the Laptop. Install Ubuntu on the external drive in UEFI-mode. Create ESP-partition on this drive during install (ca.500MB FAT, boot-flag). After install finished reattach the Windows-drive.
Boot to external drive to start Ubuntu, run sudo update-grub, so the OS-prober can find Windows and creates Grub-menu-entry. Set boot-order in UEFI-BIOS to external drive. In the case the external drive is not attached you would have to change boot-order to Windows-drive.

No warranty, I can't test that due to missing equipment. But here you can see that I am not the first with this idea...


LDAP - benefits and challenges instead of local user management

In a LAN with 1 or more servers, and a bunch of workstation, you can log on to any of them provided you have been granted access, that comes from LDAP.
It provides 1 place to manage users - not running around and create the same user on all the various boxes, thereby ensuring a uniform spelling of Names - and securing that all the needed groups the user belongs to are there, no-matter on which computer the user is logging in.  So Ease of Use!
One place to backup all the users, with all their rights and groups!


The biblatex-mla is packaged for Ubuntu and contained in texlive-bibtex-extra package.
You have to install it with:
sudo apt-get install texlive-bibtex-extra

Then register mla.bst locally by:
mkdir -p ~/texmf/bibtex/bst/
cd ~/texmf/bibtex/bst/
wget http://tug.ctan.org/tex-archive/biblio/bibtex/contrib/mla/mla.bst
texhash ~/texmf

and then compile your file by xelatex / pdflatex and bibtex as you have planned.


Which partition should I install on on a Dell XPS 13?

OEM is the partition that stores the bootmanager of windows 7. This drive enables you to boot from restore partition. (This occurs when you insert recovery disk)

You are correct you should not delete sda2 or sda3.

Thing I would recommend.

Create the restore disk if not done already.
Delete sda4. Right click and create a new extended partition. A extended partition is a wrapper to many logical partition.
Inside that extended partition create a partition that will be used as SWAP partition.
Create another partition to install ubuntu. With / as mount point.
Rest place you can create more partition in ntfs. That will be accessible to both OS.

NOTE: According to screenshot you are installing GRUB in sdb, make sure its correct

Here is the partition scheme of mine (dell xps 15)


Assuming the read is just for interactivity, try saving the output inside the bash command:

gnome-terminal -x bash -c "print1.py | tee log.txt; read -n1" &


How to ask for a newer software version?

Generally It's rare for software to be updated between major releases except where it fixes a security problem or significant bug.  But if enough people want it or the changes are significant enough it may be possible.

The correct procedure is to report a bug against the package on Launchpad.

For gthumb the link would be here

Include as much detail as you can.

However if you look here you will see that 3.2.10.11 has been uploaded so it may appear in the next version of Ubuntu.


xbindkeys scripts to toggle WiFi and Bluetooth devices ON/OFF

Toggle: (<id> is 2 as example asus-wlan)

if [ $(cat /sys/class/rfkill/rfkill2/soft) -eq 1 ]; then rfkill unblock 2; else rfkill block 2; fi

(<id> is 3: asus-bluetooth)

if [ $(cat /sys/class/rfkill/rfkill3/soft) -eq 1 ]; then rfkill unblock 3; else rfkill block 3; fi

To see device list (first number to the left is the device id):

rfkill list

Turn off:

rfkill block <id>

Turn on:

rfkill unblock <id>

Update: This worked for me well with Ubuntu 12.04 (dell-wifi). Now with Ubuntu 14.04 it doesn't. A quick alternative for WiFi is the CLI of networkmanager

if [ $(nmcli nm wifi | grep -c enabled) -eq 1 ]; then nmcli nm wifi off; else nmcli nm wifi on; fi;


Very slow, intermittent WiFi speeds with 14.04 and Intel PRO/Wireless 5100 AGN [Shiloh]

I don't know how much relevant this may be, still an Ubuntu newbie, but I had similar problems with my Ralink 5362 card.

The only thing it seemed to work was the following:

There is a bug in the Debian Avahi daemon in Ubuntu. And to resolve this you need to edit the following file /etc/nsswitch.conf as follows.

Type the following in the command line

sudo -H gedit  /etc/nsswitch.conf

This will open the nsswitch.conf file in the text editor. Then simply change the following line

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

to the below line and save the file.

hosts:          files dns

Reset your internet connection or probably restart your system and your wireless connection should be back on top speed. This worked for me at least.


Empty additional drivers tab after installing nvidia-319 and problem with nvidia-settings

Try installing:

sudo apt-get install nvidia-current

It should help.

Edit:

Try:

sudo apt-get remove --purge nvidia-319-updates
sudo apt-get remove --purge nvidia-settings-319-updates
sudo apt-add-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-331

and reboot


Installing mysql-server-5.6 fails on a strange error

Use these steps:

Backup your stuff IMPORTANT:

sudo -i mysqldump --lock-all-tables --all-databases --events --ignore-table=mysql.event > dump.sql

Then use the steps below, one command at a time

sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable
sudo invoke-rc.d apparmor restart
sudo replace log_slow_queries slow_query_log_file -- /etc/mysql/conf.d/mysqld_slow_log.cnf
sudo bash -c 'echo "slow_query_log = 1" >> /etc/mysql/conf.d/mysqld_slow_log.cnf'
sudo apt-get purge --assume-yes mysql-server mysql-server-5.5 mysql-server-core-5.5 mysql-client mysql-client-5.5 mysql-client-core-5.5
sudo apt-get update
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get install --assume-yes mysql-server-5.6 mysql-client-5.6

Restore:

mysql -u root -p < dump.sql

Source:

https://serverpilot.io/community/articles/how-to-upgrade-mysql-5.5-to-5.6-on-ubuntu-14.04.html

https://www.digitalocean.com/community/questions/upgrade-mysql-5-5-to-5-6-ubuntu-14-04


Will my OS be formatted if I partition my home directory in recovery mode?

Asumming the root partition (/ partition) is installed on a separate  partition, the answer is no, you should be fine to go! Just to make sure take a look at the fstab file with the command: cat /etc/fstab just to give you a example you should look for something like:

 /dev/sda1 /
/dev/sda2 /home

or

UUID=a /

UUID=b /home

where a is not equal to b.


Can not connect Huawei e3372 modem on Ubuntu 15.10. Please help

I first had to switch from mass storage to network mode (Ubuntu 16.04)

add the following to /etc/usb_modeswitch.conf

 # Huawei E353 (3.se) and others
 TargetVendor=0x12d1
 TargetProductList="14db,14dc"
 HuaweiNewMode=1
 NoDriverLoading=1

then run the actual modeswitching command

sudo usb_modeswitch -v 12d1 -p 1f01 -c /etc/usb_modeswitch.conf

I sometimes have to run the modeswitch several times


Fn keys not working in Microsoft ergonomic keyboard behind KVM switch

You need to press 'F lock' key at the left of function keys to enable them


How to find all empty files and folders in a specific directory including files which just look empty but are not?

From man find

    -empty File is empty and is either a regular file or a directory.

So to find both empty files and directories it is sufficient to do

find ~/lists -empty

To indicate the type, you could use the %y output format specifier

          %y     File's type (like in ls -l), U=unknown type (shouldn't happen)

e.g.

find ~/lists -empty -printf '%y %p\n'

or make use of an external program like ls, which includes a --classify option

    -F, --classify
          append indicator (one of */=>@|) to entries

i.e.

find ~/lists -empty -exec ls -Fd {} \;

If your definition of 'empty' is expanded to include files containing only whitespace characters, then it becomes more complicated - and more computationally intensive, since now you need to actually open at least any non-empty files and examine their contents. The most efficient way I can think of off the top of my head would be something like

find ~/list \( -empty -o \( -type f -a ! -exec grep -qm1 '[^[:blank:]]' {} \; \) \) -exec ls -Fd {} \;

(either empty, OR a file AND grep does not detect at least one non-blank character). Likely there is a better way though.


THIS semi-related "fix" resolved my stuck-in-640x480 problem: Messed up my 12.04 graphics: Falsely installed NVidia drivers on HD Graphics ("apt-get remove" intel, reboot). I'm still scanning the forum seas for a definitively helpful resolution to "Nvidia Can't Do Unity 3D" situation (which lead me to a bunch of Nvidia driver fixes that not only didn't work, but they broke my display).


18.04 Ubuntu LiveUSB completely resets after reboot

LiveUSBs of Ubuntu and its flavours do not have persistence; when you reboot, all those installs are gone, because when you boot from a LiveUSB, it creates a virtual space in memory, extracts all the OS files into that virtual space, and runs in memory.

Why? Well, until recently, USB flash drives didn't have a lot of room, so squashing all the files together into one compressed file which sits on the flash drive, and extracting those files into memory which pretends it's a drive makes sense. Also, USB flash drives break a lot more than other drives, so minimizing how much and how often you write back to the USB flash drive helps preserve it.

It's not like you are running from an internal drive, where changes to the Ubuntu filesystem and apps you add, are preserved on that drive. You are running in something similar to a ramdrive and when the system shuts down, what's in memory does not return to the LiveUSB. Normally.

You can create persistence easily in a LiveUSB using the current version of the Rufus app when you make a LiveUSB of Ubuntu version 19.10 in Windows. Rufus allows you to easily transcend the 4GB barrier mentioned elsewhere in this thread. There are (more complex) Linux-based methods (more info) as well.


How do I install ubuntu 20.04 LTS without a wired ethernet connection?

In my experience, all the wireless cards I have tried recently will connect using Ubuntu. However in the unlikely event that the one you have doesn't work with Ubuntu you can get a usb ethernet adaptor which should say on the box that it is Linux compatible.
You could check the card in your computer here.

Some cards under Linux have an issue that they disconnect after a while, requiring a reboot to connect again. I found the usb one I have doesn't do this but the internal one in my laptop does.


How to add ODD to "Devices" in File System?

You have to have the drive mounted, in order to show up in the side panel.

The best way to to have the drive auto mount that way you don't have to mount it every time.  To have drives mount automatically, see this Post.


How can I make this window & application time- track script produce sorted output?

Same script, but producing sorted reports, either ascending or descending

I edited the script to produce sorted reports, either ascending or descending, to be set in the head of the script.

The sorting is done on both the order of the applications, as well as their windows (in the sublists per application).

The script

#!/usr/bin/env python3
import subprocess
import time
import os
from operator import itemgetter

# -- set update/round time (seconds)
period = 5
# -- set sorting order. up = most used first, use either "up" or "down"
order = "up"

# don change anything below
home = os.environ["HOME"]
logdir = home+"/.usagelogs"

def currtime(tformat=None):
    return time.strftime("%Y_%m_%d_%H_%M_%S") if tformat == "file"\
           else time.strftime("%Y-%m-%d %H:%M:%S")

try:
    os.mkdir(logdir)
except FileExistsError:
    pass

# path to your logfile
log = logdir+"/"+currtime("file")+".txt"; startt = currtime()

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

def time_format(s):
    # convert time format from seconds to h:m:s
    m, s = divmod(s, 60); h, m = divmod(m, 60)
    return "%d:%02d:%02d" % (h, m, s)

def summarize():
    with open(log, "wt" ) as report:
        totaltime = sum([it[2] for it in winlist]) # total time
        report.write("")
        alldata = []
        for app in applist:
            appdata = []; windata = []
            apptime = sum([it[2] for it in winlist if it[0] == app])
            appperc = round(100*apptime/totaltime)
            for d in [app, apptime, appperc]:
                appdata.append(d)
            wins = [r for r in winlist if r[0] == app]
            for w in wins:
                wperc = str(round(100*w[2]/totaltime))
                windata.append([w[1], w[2], wperc])
            windata = sorted(windata, key=itemgetter(1))
            windata = windata[::-1] if order == "up" else windata
            appdata.append(windata); alldata.append(appdata)
        alldata = sorted(alldata, key = itemgetter(1))
        alldata = alldata[::-1] if order == "up" else alldata
        for item in alldata:
            app = item[0]; apptime = item[1]; appperc = item[2]
            report.write(
                ("-"*60)+"\n"+app+"\n"+time_format(apptime)\
                +" ("+str(appperc)+"%)\n"+("-"*60)+"\n"
                )
            for w in item[3]:
                wname = w[0]; time = w[1]; perc = w[2]
                report.write(
                    "   "+time_format(time)+" ("+perc+"%)"\
                    +(6-len(perc))*" "+wname+"\n"
                    )
        report.write(
            "\n"+"="*60+"\nstarted: "+startt+"\t"+"updated: "\
            +currtime()+"\n"+"="*60
            )

t = 0; applist = []; winlist = []

while True:
    time.sleep(period)
    frpid = get(["xdotool", "getactivewindow", "getwindowpid"])
    frname = get(["xdotool", "getactivewindow", "getwindowname"])
    app = get([
        "ps", "-p", frpid, "-o", "comm="
        ]) if frpid != None else "Unknown"
    # fix a few names
    if "gnome-terminal" in app:
        app = "gnome-terminal"
    elif app == "soffice.bin":
        app = "libreoffice"
    # add app to list
    if not app in applist:
        applist.append(app)
    checklist = [item[1] for item in winlist]
    if not frname in checklist:
        winlist.append([app, frname, 1*period])
    else:
        winlist[checklist.index(frname)][
            2] = winlist[checklist.index(frname)][2]+1*period
    if t == 60/period:
        summarize()
        t = 0
    else:
        t += 1

It produces output like:

------------------------------------------------------------
firefox
0:08:25 (97%)
------------------------------------------------------------
   0:06:50 (79%)    Sort by percentage of use in a python script - Ask Ubuntu - Mozilla Firefox
   0:01:30 (17%)    scripts - Is there software which time- tracks window & application usage? - Ask Ubuntu - Mozilla Firefox
   0:00:05 (1%)     Ask Ubuntu General Room | chat.stackexchange.com - Mozilla Firefox
------------------------------------------------------------
gedit
0:00:10 (2%)
------------------------------------------------------------
   0:00:10 (2%)     2017_02_15_20_47_10.txt (~/.usagelogs) - gedit
------------------------------------------------------------
zenity
0:00:05 (1%)
------------------------------------------------------------
   0:00:05 (1%)     Paste snippets

============================================================
started: 2017-02-15 20:58:19    updated: 2017-02-15 21:07:03
============================================================

To use

The script needs xdotool to get the window's information

sudo apt-get install xdotool

Copy the script into an empty file, save it as window_logs.py
Test- run the script: tart the script by the command (from a terminal):

python3 /path/to/window_logs.py

After one minute, the script creates a log file with the first results in ~/.usagelogs. The file is time- stamped with the creation date & time. The file is updated once per minute.

At the bottom of the file, you can see both the start- time and the time-stamp of the latest edit. This way you can always see what is the file's time span.

If the script restarts, a new file with a new (start-) time stamp is created.
If all works fine, add to Startup Applications: Dash > Startup Applications > Add. Add the command:

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

Reverse sorting order

To reverse the sorting order, simply change the argument in the head of the script:

# -- set sorting order. up = most used first, use either "up" or "down"
order = "up"

NB Please read the Notes and More notes sections in the linked answer!


Ubuntu not showing up in boot menu after first installation

Disable SecureBoot.

Change boot mode to Legacy/CSM from UEFI.

Change Boot order so that your HDD (i.e. Toshiba in your case) becomes the first one.  Try these options and revert if not successful.

Regards.


How can I get the full screen space in a video?

I had the same problem - it might have to do with the video card acceleration. Go to Tools, Preferences and then Video.

Uncheck the box about accelerated video output, under Display.


sudo does not work in GUI after upgrade to 13.10

I found the solution here

https://bugs.launchpad.net/ubuntu/+source/policykit-desktop-privileges/+bug/1240336/comments/19

sudo pam-auth-update --force


How can i fix the GTK hightlighted contex menues problems?

It is a theme problem so to fix it you can do two things:

Report a bug to the creator of the theme and wait for a fix.
Edit manually .css files in /usr/share/themes/THEME_NAME and try to fix the problem.


How make scanner function of Canon MG5250 work? (MG5200 series)

I just delved into the packages, they do provide a sane module for canon multi-function scanners. And the second package does contain the right files.

Firs thing though, cd dpkg -i is complete rubbish, that's not a valid command and would never work no matter what. I'm editing it out of the other answer so other people aren't confused by it.

I would get you to list the sane backends, but sane is very poorly designed and can't be bothered to include diagnostic functionality. The only thing to try is redownload the scanner package from canon, extract the files and double click on the common i386 package followed by the mg i386 package and install them via the software center.

Use scanimage from the command line to confirm if it's now working scanimage -L and if not, restart the computer and check again.


i think you may be missing the cryptsetup utility.

Run sudo apt install cryptsetup and try it again.


What methods are there to restore a deleted theme? file:///usr/share/sddm//themes/breeze/Main.qml:No such file or directory

The search on packages.ubuntu.com gives me the package name - sddm-theme-breeze which contains /usr/share/sddm/themes/breeze/Main.qml file.

You need to reinstall it with:

sudo apt-get install --reinstall sddm-theme-breeze


When will Firefox have pixel-perfect scrolling in Ubuntu?

First, as a little background for those who don't know what pixel-perfect scrolling means. (I didn't know myself, but I did some research and want to share that here.) Usually when you scroll on a touchpad (right edge or two-finger) or a tablet device, what happens is that the X server intercepts those signals and translates them to normal mouse wheel scrolling events. While this is a straightforward, legacy-safe way to implement it and works with all applications, it doesn't provide the kind of "smooth" user experience you may know from, for example, Android tablets or smartphones. (Source: Jussi Pakkanen's development blog)

Now there has been some effort on Canonical's side to ameliorate this situation. With Canonical's uTouch gesture stack combined with an X server with an up-to-date libXi (XINPUT client interface), smooth scrolling becomes possible, if the application supports it.

In fact, smooth scrolling was patched into Chromium using OIF Grail Library (formerly utouch-grail) and OIF Frame Library (formerly utouch-frame) about one and a half years ago. However, as far as I can see this was more of a proof-of-concept. Find more information here:

Issue #9773024 on Chromium Code Reviews
ChromiumTouch on UbuntuWiki

Now, as for the question itself: When will this make its way into Firefox? I can't give a definitive answer - in fact I suspect there is none - but I can speculate. An implementation of a gesture-recognizer in Firefox in terms of the previously mentioned technology stack would have to be implemented either (a) by the Canonical people who develop that technology stack, (then submit it to upstream Firefox as they did for Chromium), or (b) by the Firefox dev team itself.

I guess the Firefox dev team would only do such a thing if this framework became a widely adopted standard, which so far is not the case. You might ask at the MozillaZine forums, but I suspect if you mention uTouch or Open Input Framework they won't know what the hell you're talking about ;)

A better option would be to address the Canonical people who develop that technology, specifically, the Canonical MultiTouch project group. Browsing their site gives the impression that the project has been somewhat dormant (at least, low-activity) for something like a year. My guess -and this is but a wild guess- would be that with Canonical now working on Mir as a replacement for X, their focus may have somewhat shifted. That is, the development of these libraries interacting with X and providing multitouch features and the like, will probably be integrated in a somewhat more streamlined way into Mir.

So to sum it up, I would bet as much: you won't see such a feature in Firefox until Mir is actually deployed on Ubuntu. Mir is to replace X sometime after Ubuntu 14.04 "Trusty Tahr", so look forward to that. Now there's certainly no guarantee this will work as soon as Mir makes its way into Ubuntu. I am not involved with Mir development and I can't say where their priorities lie. However, since Canonical is quite concerned with human-computer-interaction and is even targetting tablets and smartphones now, I believe you will see such features implemented rather sooner than later. :)


I have in the past with my HP Scanjet [mine is a flatbed scanner], however I was using 12.04 at the time. I used SimpleScan [built into Ubuntu] for this. I think it just worked, but you may need to find drivers somewhere for it on the internet, likely the Epson website.
I hope this helps you make it work.


Failed to start Open vSwitch Forwarding Unit

In order for EAL to work, you must first bind a NIC to it using dpdk-devbind command before restarting the daemon, otherwise, the daemon fails. However, this breaks your internet connection and not necessary if you don't have traffic from outside. But this was the only way I could fix the error.


Why have gvfs mount points in 13.10 changed to the user id rather than the user name as in 13.04

According to the changelog this change was not included in Ubuntu but upstream. I looked at the gitlog of gvfs upstream but didn't found the exact commit that made this changes.

Upstream changelog: https://git.gnome.org/browse/gvfs/log/
NEWS file: https://git.gnome.org/browse/gvfs/tree/NEWS


Ubuntu 15.10 assumes BIOS clock is set to UTC time regardless of UTC=no in /etc/default/rcS

As @muru explained on Clock time is off on dual boot and according to the Arch Wiki:

  You can set the hardware clock time standard through the command line.
  You can check what you have set to use by:

$ timedatectl | grep local

  The hardware clock can be queried and set with the timedatectl
  command. To change the hardware clock time standard to localtime, use:

# timedatectl set-local-rtc 1

  If you want to revert to the hardware clock being in UTC, do:

# timedatectl set-local-rtc 0

We can make Windows to use UTC but sometimes we have few Windows and only one Ubuntu for our multi boot setup. In this case preferable option is to force one Ubuntu to use 'Local' time rather than changing all Windows settings one by one.

Tested this method on Ubuntu 16.04 LTS Xenial and it's working without any issue.


Media keys not passing after upgrade to 16.04

Why it happens?

The reason is the file /lib/udev/rules.d/51-these-are-not-joysticks-rm.rules, which was added to the Debian package on January 2016 as requested in Debian bug #714399 and released as version 1.4.9-1.

Wait, this is Ubuntu, not Debian! — Yes, but the Ubuntu package is based on the debian one.

However, it was later discovered that multimedia keys from Microsoft keyboard got disabled. I suspect this happened because of some change in udev or in the kernel between Ubuntu 15.10 and 16.04. I know this because I wrote that file and it worked fine in 15.10, but the bug only happened in 16.04.

Today (August), I finally updated the repository with the fix (even though the fix was proposed in May). This fix will be added to the Debian and Ubuntu packages sometime in the future.

Want to learn even more about it? Look at the udev-joystick-blacklist project on GitHub. (Disclaimer: I created that project.)

How to fix it?

Option 1 (the lazy one)

Just wait until an update to the joystick package is released.

Option 2 (the non-gamer one)

You can just remove that blacklist file:

sudo rm /lib/udev/rules.d/51-these-are-not-joysticks-rm.rules

Whenever the package gets updated or reinstalled, the file should be recreated.

Option 3 (the gamer one)

You can manually update that file with a new version from the repository. However, pay attention to updates to the joystick package. I'm not sure if any update will just overwrite the file, or if the update will ask for the user to merge the file.


Desktop under Ubuntu server 14.04.2 doesn't work

Answered in Comments by OP:

  For who has the same problem than me, the solution was removing nvidia drivers


It seems it is an error with the anaconda installer, reported here :

https://github.com/ContinuumIO/anaconda-issues/issues/11148

The suggested fix is to manually create the ~/.conda folder before running the installer. The GitHub issues indicates this is fixed but I had the same error today installing miniconda3.

EDIT
One of the maintainers indicated that the miniconda installer will be updated within 1-2 weeks. The Anaconda installer is already fixed.


Is there any virtual 7.1 or 5.1 surround sound software for Ubuntu?

Yes it depends on your hardware - if your machine is capable of highdefinition sound reproduction it is part of the sound driver.

Open Sound Settings:

Go to Configuration, pull-down Profile for the wanted controller!

Now select the wanted Surround output.
Turn up the volume, and enjoy!
Happy Ubunting ;-)


No touchpad after 15.10 software update?

The bug is reported here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1549354

As stated in the bug report, the only current fix is to use the 4.2.0-27-generic kernel.

As explained in this question, the easiest way to accomplish this is to hold down shift when booting and select the previous kernel in grub.

From my own personal experience, I found that holding down shift on my Toshiba Chromebook 2 isn't sufficient. Instead, I have to tap it repeatedly from the moment my computer is turned on in order to be sent to the grub menu. From there, it seems like my keyboard won't respond at the grub menu half the time, so I have to hold down the power button and repeat as necessary. I've successfully gone through this annoying cycle three times in testing, so I can say that it should work for you eventually.

(Alternatively, you could try changing the default grub selection as outlined here, but that seems like an unnecessary hassle to me, as I assume the bug will get fixed eventually.)

If for some reason you don't still have the 4.2.0.27 kernel, you'll need to use the command:

sudo apt-get install linux-image-4.2.0.27-generic linux-headers-4.2.0.27-generic

I'll change my answer when the bug gets fixed, but for now this is the best solution I've found.

(Note: By confirming that the bug affects you on lauchpad, it should increase the chances of the bug getting addressed.)


Increase scrollbar width (Ubuntu Studio 14.10)

According to this thread: http://lists.kde.org/?l=kde&m=117313789128261 it is a Style-thing under "Application Appearance" in 'System Settings'. Here you can configure the 'Widget style' by using the button after the name of the 'Widget style'. Then you can change the width under the 'Scrollbars'-tab (with the standard Oxygen 'Widget style').


I appears that they've removed the capability, perhaps because of security reasons. But you can do this:

First get the current dbus session

export DBUS_SESSION_BUS_ADDRESS=`cat /proc/$(pidof kded4)/environ | tr '\0' '\n' | grep DBUS_SESSION_BUS_ADDRESS | cut -d '=' -f2-`

Then call quit to kscreenlock:

qdbus | grep kscreenlocker | sed 's/org.kde.//' | xargs kquitapp


Ubuntu Server 12.10 No GUI Headless Boot and/or Reboot

I have the same problem. when I first installed Ubuntu 12 server edition, there was no problem but after a month it will not boot without monitor and keyboard.

What I did is to check the BIOS and change the boot options from 'do not boot with errors to boot with errors'

After that my server can boot headless with no monitor or keyboard attached. It seems that the BIOS will not allow booting if there is an error such as no monitor or no keyboard. By allowing the server to ignore any errors, it will boot.


Where are installed the binaries of Texlive?

I'm afraid that this is because it goes to /usr/share, but in any case, look for it with

locate texlive |more

(The |morebit is necessary because you'll get too many hits).


Pointing Grub Rescue to the correct .mod

In my experience, GRUB can be very difficult to repair once things go "off the rails." You might want to consider using one of the several EFI-based alternatives instead. Most of them require at least some manual configuration, but that's likely to be easier than fixing GRUB. My own rEFInd requires no ongoing maintenance, so if it works initially, it should require little or no attention thereafter. (You can test it via a USB flash drive or CD-R before installing it to your hard disk, if you like.)


How I can restart all the programs configuration?

Inside your Home folder there's a .config folder some software puts their configuration files there, also in your Home folder there are several hidden folders look for the correct ones and delete them.


Wireless problem when turned off on Windows 7

phy0: Wireless LAN
  Soft blocked: no
  Hard blocked: yes

Reading the above, I would suspect that the shortcut you use in Windows shuts off the wireless at the hardware level (or in the BIOS) so that Ubuntu cannot control it.

The fact that you cannot click on the "Enable wireless" option tends to confirm this. The fact that you can use it if you don't shut it off in Windows also tend to confirm that this is the case.

Is there a reason that you need to shut is down?  If it's just to disconnect it, can you just disconnect the wireless inside of Windows instead of shutting it off?  If so can Ubuntu use it then?
I would suspect that if the first answer is yes the second one will be as well.