How can I check what kind of video card I have?

sudo lspci|grep VGA

shows me I have a:

01:00.0 VGA compatible controller: ATI Technologies Inc NI Whistler [AMD Radeon HD 6600M Series]

If you want even more information you can install mesa-utils . Besides the obvious things:

$ glxinfo|grep renderer
OpenGL renderer string: AMD Radeon 6600M and 6700M Series

$ glxinfo|grep vendor
server glx vendor string: ATI
client glx vendor string: ATI
OpenGL vendor string: ATI Technologies Inc.

It will show about 3 pages of information about the driver in use.


How can I permanently set cursor speed in GNOME 3?

I think these commands should do the trick:

echo '#!/bin/bash' | sudo tee /bin/cursorspeed
echo 'xinput set-prop 9 258 .3' | sudo tee -a /bin/cursorspeed
sudo chmod +x /bin/cursorspeed

Finally, search for the "startup applications" app.

Click add and fill in the name: cursorspeed, command: cursorspeed, and you can leave comment blank or add a comment.

Then, click close and it should apply next time you login automatically.

To explain, this creates a bash script named cursorspeed containing the command you use to set the mousespeed. Using startup applications, you can set the script to execute at startup.


What's the difference between the unity7 and x11 plugs in snaps

https://developer.ubuntu.com/en/snappy/guides/interfaces/ says:

unity7
Can access Unity7. Restricted because Unity 7 runs on X and requires access to various DBus services and this environment does not prevent eavesdropping or apps interfering with one another.
Usage: reserved Auto-Connect: yes
x11
Can access the X server. Restricted because X does not prevent eavesdropping or apps interfering with one another.
Usage: reserved Auto-Connect: yes

Looking at the code of the x11 interface and unity7 interface things get even clearer. x11 just gives you access to X, unity7 gives you much more than that: access to icons, themes, pango, ibus, accessibility, accounts and much much more functionality on the Unity7 desktop (but other desktop environments too).


Difference between free and available RAM

See man free
https://man7.org/linux/man-pages/man1/free.1.html :

free:   Unused memory (MemFree and SwapFree in /proc/meminfo)

available:
Estimation of how much memory is available for  starting  new
applications,  without  swapping. Unlike the data provided by
the cache or free fields, this field takes into account  page
cache  and also that not all reclaimable memory slabs will be
reclaimed  due  to  items  being  in  use  (MemAvailable   in
/proc/meminfo, available on kernels 3.14, emulated on kernels
2.6.27+, otherwise the same as free)


How to get Wifi working on Ubuntu 14.04 (Macbook Pro Retina 15 inch - 2014)

You need to install dkms and bcmwl-kernel-source.
Without internet connection
Both are located on the Ubuntu installation medium (possibly in different versions as reflected in the file names):
pool/main/d/dkms/dkms_2.2.0.3-1.1ubuntu5_all.deb
pool/restricted/b/bcmwl/bcmwl-kernel-source_6.30.223.141+bdcom-0ubuntu2_amd64.deb

Alternatively you can download the current versions:

Ask your friends to have them download the .deb files of the newest versions of the packages dkms and bcmwl-kernel-source. Both links lead to a list with the current versions of the respective package at the top for the right release (Trusty) and the right architecture (amd64).

Then copy these two files on your flash drive (1GB recommended).

Now, using the terminal, navigate to Desktop and type in this command:
sudo dpkg -i "drag one of the files here"

Then press enter. And click install if anything pops up. And you're done :)
With internet connection
If you can somehow establish a internet connection (e. g. through a wired ethernet connection), you just need to install those package normally:
sudo apt-get install dkms bcmwl-kernel-source


How to remove Ubuntu's automatic internet connection needs?

Popularity contest is disabled by default. You can check and disable it with:
dpkg-reconfigure popularity-contest

You can do ...
apt remove popularity-contest

to remove it too.
Disable apt-daily.service:
systemctl stop apt-daily.timer
systemctl disable apt-daily.timer
systemctl disable apt-daily.service
systemctl stop apt-daily-upgrade.timer
systemctl disable apt-daily-upgrade.timer
systemctl disable apt-daily-upgrade.service

One-liner from @muru <3:
systemctl disable --now apt-daily{,-upgrade}.{timer,service}

Disable unattended upgrade:
dpkg-reconfigure -plow unattended-upgrades

Update manager can only be stopped by removing it:
apt purge update-manager-core

You can NOT disable automatic update for snaps. You can set the period when it updates with snap set core refresh.schedule=<spec> but the system will ignore this is if it took too long to update snaps and that would be within 24 hours. This will remove anything snap related:
apt purge snapd ubuntu-core-launcher squashfs-tools

A less intrusive method would be to prevent connection to the server by adding a DENY to your firewall rules (or in the router).  To disable the systemd service would be ...
systemctl disable snapd.refresh.service

but that too seems to ignore the 24 hour period.

Regarding snaps:

The agreed semantics to be implemented are the following:

Refreshes may be scheduled at an arbitrary weekday and time within the month (e.g. second Tuesday between 1pm and 2pm).
Refreshes may be deferred for up to another month so that missed windows and re-scheduling may happen without strange side effects. For example, if it was scheduled for the first day, and then gets scheduled for the end of the month just before it happens, there may effectively be a two months window without refreshes.
If the system remains out-of-date after the two months window, the system will start attempting to refresh out of the window.
That maximum window is reset every time the system is refreshed, so out-of-band updates may performed at a convenient maintenance window.

So a window of 2 months is possible if you do not reboot.
I do disagree with your way of thinking though. Except for contest (and that one is not active) all of these are about fixing bugs and providing better content. You will make your system LESS secure by disabling these options.


How to enter ssh passphrase key once and for all

You want to use keychain.

The keychain program manages an instance of the key cache program ssh-agent. When ssh-agent is started, two environment variables are created to be eval'd. Normally when the shell is closed where ssh-agent has been started, those environment variables are lost. The keychain program keeps track of those variables across logins and provides shell scripts in the ~\.keychain directory.

There are several ways to run keychain, one method is manually from the command line. Each time you start the shell, use:

eval `keychain --eval`

This will find ssh-agent if it's running, and start it if it's not. Either way, using eval on keychain will set the necessary environment variables where you can add keys using:

ssh-add <private-keyfile>

If private-keyfile has a password, you will be prompted to enter that password during the execution of ssh-add, but as long as ssh-agent is running that will be the last time you need to enter the password for the private key.

Because the eval of keychain sets the SSH_AUTH_SOCK environment variable, any run of ssh will use the ssh-agent to accomplish the authentication.

Another suggestion is to add the keychain execution to your .bashrc file, as suggested in this StackExchange answer.

To terminate keychain just enter the command:

keychain --stop mine

or if you want to bring down all the instances of ssh-agent, enter the command:

keychain --stop all

Just a note, using services such as ssh-agent defeat the security of passworded private key files by storing those authenticated keys in memory. This is not safe, especially with memory side-channel attacks. If you're not interested in key security, the simpler solution is to remove the password on the private key as suggested by @vidarlo.


Error Ubuntu 11.10 despues de instalar [Error after installing Ubuntu 11.10]

En primer lugar, este sitio esta pensado para responder las preguntas una a una. Si tienes varias preguntas es mejor que las hagas por separado.

SMART es un sistema para predecir problemas con el disco duro. Lo más probable es que el disco duro en el que estas intentando instalar Ubuntu este dañado.

Para intentar solucionar el problema de WUBI lo mejor es que abras otra pregunta, e incluyas el archivo de registro que menciona el error.

First, this place work better if you ask one question at a time. If you have more questions it will be better if you ask them one by one.

SMART is hard disk problems prediction and monitoring system. The most likely problem is that this hard disk (where you are trying to install Ubuntu) is broken.

To be able to solve the WUBI problem, ask another question and include in it the contents of the log file indicated in the error message.


Why is my root folder for apache not changing?

<VirtualHost *:80>
    ServerName  extracurricular.com
    #serverAlias www.extracurricular.com
    ServerAdmin lleeoo66@extracurricular.com
    DocumentRoot /srv/www/extracurricular.com

    <Directory "/srv/www/extracurricular.com">
            Options FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            Allow from all
            DirectoryIndex index.php index.html index.htm
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    # Possible values are: debug, info, not ice, warn, error, crit, alert, emerg
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/extracurricular.com_access.log combined
</VirtualHost>


How to know what icon is being used in the dock?

Open synaptic.desktop file using the following command:

sudo -i gedit /usr/share/app-install/desktop/synaptic:synaptic.desktop

and change the line:

Icon=synaptic

with:

Icon=/path/to/new/icon

Save the file and close it. It does not matter what extension has icon (.svg, .png, etc), the important thing is that the path to the new icon (inclusive its extension) to be introduced correctly.

That should be enough.


Why my active window minimizes when I switch to next work space?

If you are using the numpad keys, which are different than the number keys above the keyboard (and to which the shortcut you tried to set actually likely refers), then what happens is this:

bottom right number on the numpad is 3, therefore ctrl+alt+3 will focus that window to the bottom right of the page.

following that pattern, 1 is bottom left corner, 7 is top left corner, 9 is top right, 8 is top half, 2 is bottom half, 5 is full screen, etc.

These shortcuts are viewable in the 'grid' section of the compiz settings manager.


Black screen instead of grub and then login screen GUI

On a computer with just Ubuntu installed (no other OS), GRUB elegantly hides its menu during the 10 sec timeout by default (unless you hit escape during the timeout), because in most cases, there's only one choice anyways and that way the user is less likely to be confused by the GRUB menu.
If you'd like to always see the GRUB menu, change the default:
sudo nano /etc/default/grub

(replace nano with gedit if you'd like a GUI, or with vi if you can remember how to use that). Look for:
 GRUB_TIMEOUT_STYLE=hidden

and change that into
 GRUB_TIMEOUT_STYLE=menu

Next, update the GRUB config in the boot area:
 sudo update-grub

You will now see the menu every time you boot. More info in the manual pages.


Users, user management, and privilges are discussed at https://msdn.microsoft.com/en-us/commandline/wsl/user_support

Although the user you are running as is "root" I do not believe the user has administrative rights on windows, not sure about the bash environment, but I personally would change names. I am surprised ubuntu did not set up a non-root user as part of the install.

From that site, run the following commands on the correct OS:

"username" is the user you want to run ubuntu as, change as necessary.

From Ubuntu (root shell)

passwd username

From WINDOWS (cmd) run:

C:\> ubuntu config --default-user username

I am not sure about access to windows files from ubuntu, it may or may not work once you change users, but, as explained in the link, access is kept separate and windows permissions are not the same as ubuntu permissions.

If it works you should see your windows files in Ubuntu at /mnt/c/ , so Documents and such should be at /mnt/c/Users/your_windows_user/Documents/ and such.

If it is not working, ask a separate question and provide details with any error messages you get.


Is there a way to accept dhcp response from a specific vendor (not ip)?

Set static ip and gateway for the Machine

We can set the static ip by the following steps

  sudo nano /etc/network/interfaces

copy the following lines and paste to the file

auto enp0s3
iface enp0s8 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1

Or

Assign IP address based on MAC in server

We can assign the ip based mac address from the following file

if we use isc-dhcp-server package

   sudo nano /etc/dhcp/dhcpd.conf


Ubuntu BCM43142 (14e4:4365) wireless drivers broadcom

A current proprietary driver that works with that specific card is wl, see here. You should be able to install it from ubuntu adding multiverse packages.


Second Problem: Are you sure you have the correct passwords for other wifi networks. Depending upon the wireless security the number of characters is different. e.g. if it is a WPA ,its 8-63 characters and unless you enter those many characters, the option to connect will be grayed out.

Problem One: Please post more info, regarding which site you are unable to connect. Also please copy paste the following commands and paste the output. To open the terminal , you can press Ctrl + Alt + t

Suppose you are not able to browse google.com, enter following commands

route
ping -c 5 www.google.com

And post back the results.


Use sudo in combination with libnss_switch

Since nss_wrapper relies on LD_PRELOAD you cannot use it with sudo.  The dynamic linker ignores LD_PRELOAD for set-user-ID executables like sudo (you would have the same issue with something like su).

See the description of "Secure-execution mode" in the ld.so manual for more information.


Under Tools -> Options -> Language Settings -> Complex Text Layout, there is a drop-down box to select the type of numeral.  There is even an option called "Hindi."  However, this is not Devanagari.  Instead, Wikipedia calls these numbers Eastern Arabic numerals.

It seems strange that the list is limited to two types of numerals.  I suggest filing an enhancement request to add Devanagari numerals to the list (and perhaps other numerals as well).  Then it should do everything you are asking.

There is also an entry called "System" in the list.  So I tried setting my system to use Devanagari numerals.  However this did not affect LibreOffice.  As explained in the documentation, this only chooses between Arabic and Hindi.


mysqld: Can't read dir of '/etc/mysql/conf.d/' (OS errno 2 - No such file or directory)

Open a terminal window and create the directory mentioned in the error message using mkdir with p option.
sudo mkdir -p /etc/mysql/conf.d/

p option will create parent directories as well, in case they don't exist.
Create a new file mysql.cnf in the above said directory and add [mysql]. That can be done using tee as well.
echo "[mysql]" | sudo tee /etc/mysql/conf.d/mysql.cnf

Finally try re-configuring packages using
sudo dpkg --configure -a

Note: A special thanks to Orphans for confirming the applicability of the answer in comments.


I tried to let CUPS not listen to port on the configure file, but CUPS stop working.

Finally, I copied my own printers and rename it with 0 as initial number. So they are at the top of the list.

This can fix it temporally.


Disable Computer from booting into gnome

You can remove GDM from the startup process.
Here are a couple of methods:

http://cviorel.easyblog.ro/2008/07/02/enabledisable-gdm-in-ubuntu/
https://serverfault.com/questions/137776/disable-gdm-in-ubuntu-10-04


How do I permanently disable my touchscreen on Sony VAIO

One option would be to have the xinput disable 9 command run automatically at every boot.

You can do this with the Startup Applications app installed by default in Ubuntu.
Open the app and click the Add button to add a new Startup program.

Set the Name field as anything you like. (e.g. Disable Touchscreen)
Set the Command field as xinput disable 9.
The Comment field can be left blank.

Once you have this done simply click Add and it will take effect next time you reboot.

Note: This will only run once you have logged into the user account from which you created it. If there are other  accounts that you need to disable the touchscreen for you can repeat this process for each user account or you can follow the instructions here to enable it for every user.


Since source disk is buffered and destination disk is also buffered, it is normal that peak buffer usage exceeds the file size.  If you use mv then source disk cache should be dropped immediately after file deletion.

Storage type would not affect disk cache much, the file system you choose will.


Answer of user305136 taken from the question:

  Sometimes you ask and find the solution the next day. In the case
  someone has the same trouble as I had, here are my config files that
  now work. I replaced the Windowsserver with SERVER and the domain with
  DOMAIN.LOCAL

krb5.conf:
[logging]
default = FILE:/var/log/krb5.log
[libdefaults]
ticket_lifetime = 24000
clock_skew = 300
default_realm = DOMAIN.LOCAL
dns_lookup_realm = true
dns_lookup_kdc = true

[realms]
DOMAIN.LOCAL = {
kdc = SERVER.DOMAIN.LOCAL:88
admin_server = SERVER.DOMAIN.LOCAL
default_domain = DOMAIN.LOCAL
}

[domain_realm]
.domain.local = DOMAIN.LOCAL
domain.local = DOMAIN.LOCAL
.DOMAIN.LOCAL = DOMAIN.LOCAL
DOMAIN.LOCAL = DOMAIN.LOCAL

smb.conf:
[global]
security = ADS
realm = DOMAIN.LOCAL
workgroup = DOMAIN
idmap config * : range = 10000-20000
server string = Linuxserver
winbind enum users = yes
winbind enum groups = yes
winbind cache time = 10
winbind use default domain = yes
winbind nested groups = yes
template homedir = /home/%U
template shell = /bin/bash
client use spnego = yes
ntlm auth = yes
lanman auth = no
client ntlmv2 auth = yes
encrypt passwords = yes
restrict anonymous = 2
domain master = no
local master = no
preferred master = no
os level = 0
map to guest = bad user
guest account = nobody
unix extensions = yes
valid users = @domänen-benutzer
[homes]
comment = Userdirectory
browseable = no
valid users = %S, DOMAIN.LOCAL\%S
writeable = yes
create mode = 0600
directory mode = 0700
[home]
comment = Userdata
path = /data/home/%U
browsable = no
valid users = %U
writeable = yes
create mode = 0600
directory mode = 0700
[Data]
comment = Data
path = /data/H
writeable = yes
valid users = @domänen-benutzer
create mode = 0660
directory mode = 770

  It's working now.


problem with edubuntu on ubuntu 16.04LTS remove educational desktop

Run the following:

sudo apt-get remove --purge edubuntu*
sudo apt-get autoremove
sudo apt-get install ubuntu-desktop # if you were previously running unity
sudo apt-get install gnome # if you were previously running gnome


How can I create a shortcut that acts as a tally

Maybe you can use emacs with org-mode. It's much more powerful than just simple manage your tasks, but might be worth to dig into.


As suggested by in the comments I obviously hadn't searched enough... :)

In my example above:

nano /etc/udev/rules.d/70-persistent-net.rules

Enter something along the following, complete with the right MACs in the right place:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:b5:dd:d5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:b5:dd:cb", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:b5:dd:c1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

Give your server a reboot and you should see something like the following:

eth0      Link encap:Ethernet  HWaddr 00:0c:29:b5:dd:d5
          inet addr:192.168.30.117  Bcast:192.168.30.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feb5:ddd5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:21 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1260 (1.2 KB)  TX bytes:468 (468.0 B)

eth1      Link encap:Ethernet  HWaddr 00:0c:29:b5:dd:cb
          inet addr:192.168.20.117  Bcast:192.168.20.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feb5:ddcb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:21 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1260 (1.2 KB)  TX bytes:468 (468.0 B)

eth2      Link encap:Ethernet  HWaddr 00:0c:29:b5:dd:c1
          inet addr:192.168.10.117  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feb5:ddc1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:1728 (1.7 KB)


I was facing the same problem with firefox as default web browser , made chrome my default browser and it worked . try changing your default web browser .


courier-authlib: s_connect() failed: No such file or directory

Finally I figured out what's going wrong after playing with the strace command.

The service courier-authdaemon, part of courier-imap package, wasn't launched automatically at startup for some reason.

To definitively fix this problem, execute the following:

Define the courier-authdaemon service to run at startup: sudo systemctl enable courier-authdaemon.
Start the courier-authdaemon service for the current session with sudo service courier-authdaemon start, or if you want you can just restart your server with sudo reboot.

After enabling the courier-authdaemon service, you can check that everything is OK by using the authtest command:
sudo authtest <login> <pwd>.

You should have an output like:

    Authentication succeeded.

     Authenticated: <login>  (system username: <login>)
    Home Directory: /home/<login>
           Maildir: (none)
             Quota: (none)
Encrypted Password: <hidden>
Cleartext Password: <hidden>
           Options: (none)

I used these resources to solve my problem:

Courier-IMAP (Official Home)
[Courier-imap] Authdaemon error
courier-authdaemon not starting on boot on Xenial Xerus

So now I can continue to follow the GitLab tutorial.


Installing a specific version of VLC from a PPA

Open terminal and run: (for 14.04)

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install vlc vlc-plugin-*


What happens when I connect to a remote host via ssh?

SSH is short for secure shell. Its a program which allows you to access the terminal for a remote machine as though you were physically connected to it.

thot.cs.pitt.edu is the domain name of the machine you're connecting to. Its like google.com; just less memorable in your case.

The commands you execute are running on the remote machine. You cant run gedit, for example, because ssh only allows text transmission, and gedit is obviously a graphical editor. (NB, nano is a friendly command line text editor).

To access local files on the remote machine, you should look at the scp command (secure copy)


This exact question with the same error was asked a year ago. The solution is to create a symlink to python to fix the issue:

So check where the link /usr/bin/python is pointing to:

$ ls -la /usr/bin/python
lrwxrwxrwx 1 root root 9 Jan 24  2017 /usr/bin/python -> python2.7
It should point to python2, not to any python3 executable. If it points to python3 then do the following (man ln):

$ sudo rm -f /usr/bin/python
$ sudo ln -s /usr/bin/python2.7 /usr/bin/python

After that, the apt-get/apt will start to work again.

Error when trying sudo apt-get update - Python related?
Error in the post shows:

sh 1: /usr/lib/cnf-update-db: not found
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Succes 'if /usr/bin/test -w /var/lib/command-not-found -a -e /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code


Ubuntu 19.10 Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

In addition to mysql client you need to install also mysql server.

I've added info from Ubuntu mysql

Installation

To install MySQL, run the following command from a terminal prompt:

sudo apt install mysql-server

Once the installation is complete, the MySQL server should be started automatically. You can run the following command from a terminal prompt to check whether the MySQL server is running:

sudo netstat -tap | grep mysql

When you run this command, you should see the following line or something similar:

tcp        0      0 localhost:mysql         *:*                LISTEN      2556/mysqld

If the server is not running correctly, you can type the following command to start it:

sudo systemctl restart mysql.service

Configuration

You can edit the /etc/mysql/my.cnf file to configure the basic settings -- log file, port number, etc. For example, to configure MySQL to listen for connections from network hosts, change the bind-address directive to the server's IP address:

bind-address            = 192.168.0.5

Replace 192.168.0.5 with the appropriate address.

After making a change to /etc/mysql/my.cnf the MySQL daemon will need to be restarted:

sudo systemctl restart mysql.service


How can I share NTFS drive between Ubuntu PC

first of all you have to download samba package from command line by this command apt-get install samba then you can go cd /etc/samba.smb.conf an write the following line [sharefile]
path = /home/name of folder
browseable = yes
public = yes
writable = yes
read only = no
guest ok = yes
force create mask = 0755
force directory mask = 0755

save the file and then restar snmbd and nambd file you can get the sharing file or right click on file sharing file go into share tab and do the GUI and ......
hope it can be useful for you


Cannot transfer file due to "Filesystem does not support symbolic links" error

If the copying is done in some shell terminal (i.e. bash), then cp can be explicitly told to copy the file that a link points to with --dereference, instead of the link itself. The default behavior of cp is to copy files by following their links, but many graphical file browsers seem to have a default behavior of attempting to copy links and generally perserving most attributes.

man cp

-a, --archive
       same as -dR --preserve=all

-d     same as --no-dereference --preserve=links

-L, --dereference
       always follow symbolic links in SOURCE

Example

touch SomeFile.txt
echo "some content" > someFile.txt
ln -s -T someFile.txt someLink
echo "Some content for the test file." > someLink
mkdir someDirectory
ln -s -T someDirectory someDirLink

The fact that someLink is a link, is shown by the l flag in the first position of the listing output (and `d' designates a directory).

ls -l

    drwxrwxr-x. 2 user group 4096 Aug 17 17:17 someDirectory
    lrwxrwxrwx. 1 user group   13 Aug 17 17:17 someDirLink -> someDirectory
    -rw-rw-r--. 1 user group   32 Aug 17 17:01 someFile.txt
    lrwxrwxrwx. 1 user group   12 Aug 17 17:12 someLink -> someFile.txt

The file contains the content, and the link points to the file, but can be used in nearly any manner the file could be. (Note the link file size vs the text file size: 32 Bytes vs 12 Bytes.)

cat someFile.txt

    Some content for the test file.

cat someLink

    Some content for the test file.

First, copying the link to a directory. Then copying the file to the directory, through the link. (The below also shows that directory links work in a similar manner to file links.):

cp -a someLink someDirLink/newCopy
cp -L someLink someDirectory/newCopy.txt
ll -l someDirLink/

    lrwxrwxrwx. 1 user group 12 Aug 17 17:12 newCopy -> someFile.txt
    -rw-rw-r--. 1 user group 32 Aug 17 17:36 newCopy.txt

Caution

Links can be made to point to a full path or a relative path. Since this example used a linking based on the relative path of the target being in the same directory as the link being created, the link was broken when it was copied to a new directory.

cat someDirLink/newCopy

    cat: someDirLink/newCopy: No such file or directory

cat someDirLink/newCopy.txt

    Some content for the test file.


How can I automatically exit vim via a bash command in a .sh file?

One solution that comes to my mind is doing:

id=$(ps -A | grep vim | awk '{print $1}')

to get pid(s) of the running vim program(s) and then kill it with:

kill $id

of course you need to save your work first and then do this. I'm not sure how your program saves what is has done!


Ubuntu 14.04 lts have asus tp500l touchpad not working

check this maybe can help you with your problem

http://linuxsagas.digitaleagle.net/2013/05/28/ubuntu-13-04-and-the-fight-for-the-mouse/


Ubuntu touch will not overwrite a custom recovery.
There is a recovery file provided with the developer preview although I am not sure what it does and I'd recommend not using it.


I get pixel perfect scrolling in native apps, but not chrome or LibreOffice, is it possible to get it?

Regarding your first question, I don't know. As you have stated, there are libraries in Linux which support pixel perfect scrolling, so I suppose it is up to the developers to decide to use them.

As to your second question, the only browser in Linux that I've come across that supports true smooth scrolling is Epiphany (sometimes called "Web").


Try installing form terminal(ctrl+Alt+T):

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak


How do I move a file to its parent's parent directory?

One way would be
mv B/A/C.txt B/

Or
cd B/A/
mv C.txt ..


Autosave is not possible without chaging the source code i.e graphically . Officially Okular has not provided this. check this out:

https://docs.kde.org/trunk5/en/kdegraphics/okular/okular.pdf

When adding an annotation to a pdf file,

Annotations are saved internally by Okular.
You can export the annotated document using File -> Export As -> Document Archive

So if we close the file, and open it again in Okular, we can still see our annotations added last time. But if we open the file in another application , we can't see the annotations we added in Okular. This may be because it is .okular extension!

But sometimes it doesn't save automatically.Don't know why!

For other formats (and PDF itself), there's still the option to export annotatated documents in .okular format (File -> Export As -> Document Archive) and share them with other Okular users.

Actually, automatic internal storage is disabled in some cases, and you need to save to PDF every time you make a change. But there are warnings and a "Save or discard changes?" prompt in place for that.

The library we use to deal with PDF files, doesn't support modifying encrypted PDF files yet. If you open such a file, the "Save As" menu entry is grayed out and you are warned that you can only export as .okular file.


How can I make the file manager toolbar buttons smaller?

You can change them by using Unity  tweak tool  or unity tweak tool.  After installing them at tweak tab you can do that.


How to resolve "Something wicked happened resolving 'your_proxy: 800'"?

You set a proxy for apt in your system. Probably you'll find it in a file in /etc/apt. You can use grep to find the entry:

sudo grep -r your_host /etc/apt

If it doesn't find anything check the environment variable http_proxy.

However according to the error message the proxy is set to the host your_proxy and port 800. But your system fails to resolve this hostname. So check the hostname for typos or other errors and try to use the correct setting. If you use the correct version, your proxy will work.


Live CD asks for a username and password

The default username is ubuntu, and the password is blank on an Ubuntu LiveCD.

Brent posted the following over on Serverault:

If the username "ubuntu" with an empty password doesn't work, you may be able to add a new user to the system as follows.

Press Ctrl+Alt+F1 and run this command:

sudo adduser username

Meanwhile in some other Ubuntu-Based Distros (especially official ones), the username goes by their distro name (e.g: Xubuntu='xubuntu', Lubuntu='lubuntu' etc) though you can also find the username of it on some distros by looking at the upper-left hand corner.


Automatic syncing USB HD drive to local HD (different computers)

A vague answer would be to use rsync to sync to and from your HDD to a selected file structure on your systems. I typically just use rsync to push changes from my server to backup HDDs, but (without trying this on my own) I can't see why you couldn't rsync to and from the drive. This, however probably wouldn't be something you would do automagically. Just have a script you could call when you want to sync up the drive. You could go hog wild and write a script to listen for when you plug in that specific HDD and then kick off the rsync scripts if you really wanted.

rsync on wikipedia
Basic rsync tutorial


No login appearing, only drum sound and lowercase

I had this problem recently.  While in tty check to see what themes are installed:  "apt list --installed | grep themes."  Purge all themes not relevant.

Gnome should be using gdm, which is the Gnome Display Manager.  (See if it's installed and running.)


I was able to solve the problem by updating the file /etc/systemd/logind.conf to include the following:

HandleLidSwitch=ignore


video drivers not working ubuntu. 800x600 only resolution

I am referring to this answer from my other answers. I had a login loop issue as mentioned here. It seems you are also encountering a different issue due to nvidia drivers and this could fix your issue.

First uninstall the currently installed NVIDIA drivers.Boot the computer, when the GRUB menu appears ...

Highlight the Ubuntu menu entry and press the E key.Add nouveau.modeset=0 to the end of the linux line. Press F10 to boot the Ubuntu operating system.

When the login screen appears press Ctrl + Alt + F1 .Enter your user name and the password, then execute :

sudo apt-get purge nvidia*
sudo reboot

Now install the latest official stable NVIDIA drivers.Boot the computer, when the GRUB menu appears ...

Highlight the Ubuntu menu entry and press the E key.Add nouveau.modeset=0 to the end of the linux line. Press F10 to boot the Ubuntu operating system.

When the login screen appears press Ctrl + Alt + F1. Enter your user name and the password, then execute :

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-361
sudo reboot

Note : Maybe it is explicitly necessary to select the NVIDIA adapter in BIOS.

In case you have installed the nvidia driver from their site then uninstall it as per that instructions.Uninstall that driver by running, as root, sh ./NVIDIA-Linux-x86_64-361.28.run and follow the on screen instructions.

Note : The solution I have provide has been tested on Ubuntu 14.04 LTS and Ubuntu 15.10 for two Nvidia GPUs


How can ı change xterm to terminal window

If the font is too small in an xterm, you can press Control and the right mouse button, a menu will show up and will allow you to select a larger font size.


Origin doesn't install at all on Ubuntu 16.04

Installed both versions of 64 bit Origin and 32 bit origin on Linux mint today, following these instructions:

https://www.pcsteps.com/5110-install-origin-linux-mint-ubuntu-wine/

The 32 bit version played the 32 bit games, but the 64 bit games like Titanfall and star wars battlefront does not load at all.

I think it is a driver issue.... Check that you have a compatible driver from Nvidia or whatever card manufacturer u have...


You should try the aircrack drivers.
See https://github.com/aircrack-ng/rtl8812au
git clone https://github.com/aircrack-ng/rtl8812au.git
cd rtl8812au
sudo make dkms_install


You need Ubuntu 14.04 LTS for ARM-32 or for ARM-64 depending on HP's choice of processor for the notebook. (Ask HP, as I can't find that on their website and report back in the comments if it's 64 bit or 32 bit)


Black screen with x cursor on secondary monitor

I was able to get the secondary and a third monitor recognized with the nouveau driver.


Can ghex show raw hex bytes on /dev/sdb?

I sincerely hope for you that that was a USB stick because what you just did is extremely dangerous!
As this is a block device, you cannot "just" ghex this on a multi-user multi-tasking OS.  It's just not possible, even when the disk is unmounted and not any more after the disk has been ejected...
Anyway, If you really, really want to have a more or less safe look at the MBR, execute the following command:
Warning:dd is the abbreviation of Disk Destroyer!
dd if=/dev/sdX of=~/home/Documents/MBR.HEX bs=512 count=1
ghex ~/home/Documents/MBR.HEX

Where X stands for the disk containing your boot record.
If you want the unsafe version, don't come crying afterwards, download a single-user single-tasking OS like FreeDOS, boot that and use a tool like Hex51a and run that and you can do anything you want, including totally unsafe things!
>:-)


Whatsapp Web QR code not loading on Chrome/Firefox on Ubuntu 14.04

If you are behind a proxy, it helps to remove the socks proxy configuration.

To do this in Ubuntu 16.04 (and if I remember correctly is exactly the same in Ubuntu 14.04), just go to "System Settings" -> "Network" -> "Proxy", and delete (left in blank) the socks server line and left port in 0.

You don't need to apply this -system wide-, just in the user you want to authenticate in Whatsapp Web.

Once you are done with Whatsapp Web Authentication, you can restore your previous socks proxy settings.


Its not a failed hdd.

Add "Linux snd-powermac.blacklist=yes" without quotes as an argument in yaboot and see if that solves it. Look at the following links for additional help.

https://wiki.ubuntu.com/PowerPCKnownIssues
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1066435


System freezes on the splash screen after 14.04 update

Upon further investigation I was able to trace it down to libticalcs2-11 which was unable to update because of a unmet dependency, which made the whole upgrade process to stop, which made the system reboot with half of the new packages installed and the rest of the old ones, causing the driver issues. After removing the library and running a apt-get -f install, I was able to get it to work again.


Unfortunately at this time the music lens only supports Rhythmbox and Banshee. When 13.04 is released the music lens will support

Audacious

Clementine

Guayadeque

Banshee

gMusicBrowser

Musique

and

Rhythmbox

For more information please refer to http://www.omgubuntu.co.uk/2013/02/100-scopes-list-ubuntu-13-04


How do I make Firefox run shell commands on application protocols?

You said you wanted to skip the shell script part. Basically you can execute the content of every shell skript like this:

bash -c "contents of shell script in one line"

In your case it would look like this:

bash -c "xchat --existing --url=\"%s\""

Since xchat is an executable independet of bash you should be able to start xchat directly:

/usr/bin/xchat --existing --url="%s"

Use which xchat to find out where xchat is installed on your system and replace the /usr/bin part if it is installed somewhere else.


Someone Accidentally Made Unity and Top Bar too big. Help!

Go to System Settings - Appearance - Look and in the bottom-right corner is a slider for changing the Launcher icon size. Drag the marker either direction to increase or decrease the icon size on the Unity launcher.

Look here for details : How-to-geek


Moving files from source to destination in categories

I suggest making the directories before trying to move the files, not after. Also, skip checking for the directory's existence, just use

mkdir -p

Also I don't think you need all those complex conditionals, although simplicity is in the mind of the beholder I guess. To me, something like the following seems simpler.

#!/bin/bash

# repeats until you enter a valid directory
while [ ! -d "$DESTINATION_ANY_VALID_FORM" ]; do
      read -p "Enter destination directory:" DESTINATION_ANY_VALID_FORM
done

# canonicalizes directory name into a standard form
DESTINATION="$(readlink -f "$DESTINATION_ANY_VALID_FORM")"

# same deal for source
while [ ! -d "$SOURCE_ANY_VALID_FORM" ]; do
      read -p "Enter source directory:" SOURCE_ANY_VALID_FORM
done

SOURCE="$(readlink -f "$SOURCE_ANY_VALID_FORM")"

# makes the directories you want if they don't exist already -
# conditionals aren't needed.
mkdir -p $DESTINATION/A-F
mkdir -p $DESTINATION/G-L
mkdir -p $DESTINATION/M-R
mkdir -p $DESTINATION/S-Z
mkdir -p $DESTINATION/#

# And then move the files any way you want. There must eleventy-twelve ways.
# I was wrong thinking wildcards would be easy.
# That is actually kind of hard.
# The following is easy to write and understand, but there are more efficient ways.

ls -w1 "$SOURCE" | grep ^[a-f,A-F] | while read FILE ; do
       mv --verbose --backup --target-directory="$DESTINATION/A-F" "$SOURCE/$FILE"
done

ls -w1 "$SOURCE" | grep ^[g-l,G-L] | while read FILE ; do
       mv --verbose --backup --target-directory="$DESTINATION/G-L" "$SOURCE/$FILE"
done

ls -w1 "$SOURCE" | grep ^[m-r,M-R] | while read FILE ; do
       mv --verbose --backup --target-directory="$DESTINATION/M-R" "$SOURCE/$FILE"
done

ls -w1 "$SOURCE" | grep ^[s-z,S-Z] | while read FILE ; do
       mv --verbose --backup --target-directory="$DESTINATION/S-Z" "$SOURCE/$FILE"
done

ls -w1 "$SOURCE" | grep ^[0-9] | while read FILE ; do
       mv --verbose --backup --target-directory="$DESTINATION/#" "$SOURCE/$FILE"
done

paste-bin version: https://paste.ubuntu.com/24540558/


You have to click onto Disabled with your mouse at first, then press Ctrl+i.


Nexus 4 ubuntu touch - No internet connection while cellurar data only enabled

Took me a minute, but here you go:

cd /usr/share/ofono/scripts/
./deactivate-context
./set-context-property 0 Protocol ip
./activate-context
ifconig

ifconfig is just to verify you got an IP. The default protocol is set to ipv6 and doesn't jive with the t mobile network. Happy trails!

Now to get gps and navigation working..


Is the power-cog supposed to turn blue when updates are available?

No, the power cog stays the same. You will be notified that updates are available by the Update Manager icon appearing in the launcher. If you want to customise it further, see this post.

For the mail icon, William's comment is correct. Thunderbird has to already be running for it to notify you by changing the icon to blue.


Gnome 3 standard brightness control with external monitor

your point no. 2 is somehow possible by creating gnome-shell-extension

Otherwise, can I hook into the default brightness control to run my
own script after Gnome's finishes?

tested with gnome-shell --version 3.38.1
the content of the extension.js file is below.
notice the 12th line,
Util.spawnCommandLine("bash /home/admin/extmonbri.sh");

change the path of the script in above line in place of "/home/admin/extmonbri.sh" with path of your script.
/home/admin/extmonbri.sh file contents
#!/bin/bash
notify-send 'script is working, make your script as you need it'

extension.js file contents
const Util = imports.misc.util;

function init () {}

let ORIGINAL = imports.ui.status.brightness.Indicator.prototype._sync;

function _externalMonitorBrightness () {
        let visible = this._proxy.Brightness >= 0;
        this._item.visible = visible;
        if (visible)
            this._changeSlider(this._proxy.Brightness / 100.0);
            Util.spawnCommandLine("bash /home/admin/extmonbri.sh");
    }

function enable () {
imports.ui.status.brightness.Indicator.prototype._sync = _externalMonitorBrightness;
}

function disable () {
imports.ui.status.brightness.Indicator.prototype._sync = ORIGINAL;
}

from the source file, https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/master/js/ui/status/brightness.js,
Idea: we overwrite the ORIGINAL function _sync from above source file with our custom one to run our script in our gnome-shell-extension.
when you press the BrightnessKey the script runs,

when you change the brightness slider by tapping or scrolling, the script runs


Add (and install) the layout it is using but move the wanted layout to top on the keyboard layouts list (System settings -> Keyboard Layout -> Layouts). Reboot. Logout. Login checking that the wanted layout is selected in the login screen. Reboot and test if working.

https://askubuntu.com/a/329625/182024


Trying to use extra space on a dynamically allocated VM

That's a fairly normal problem to run into. What I would do is temporarily delete the swap partition and "extended partition". Then gparted can use the un-allocated space to add to the first partition.

First, close whatever it is you have running that needs 20gb swap space. (I'm curious as to what that is)

Then, you have to turn swap off:

sudo swapoff -a

(Yes, gparted has a "swapoff" feature, but I've never trusted it, could just be me)

Once swap is off, start gparted and delete the swap partition and "extended partition". When those are deleted, you can right click on /dev/sda1 and select "resize/move". Take up all but the space you need for swap, then create a new partition for swap, and once created right click and select "Format to" and select linux-swap. No need for the "extended partition" part of the process.

Once there, you need to turn swap back on. On my test system, "swapon -a" didn't work, so:

sudo swapon /dev/sda2

Hope this helps!


As already mentioned in the two comments, you do not need to install your own make program, unless you are looking for a particular version or brand. Most of the tools you need to build your programs are already in the main distribution.

Since you do not have internet access from your Ubuntu installation, and I assume that you are downloading your programs from another computer, you need to search for the correct .deb package in the Ubuntu repositories. Since I do not know your system version, I cannot give you a link.

However, if you insist on using the make that you have on your computer, you can either just double-click on the file and then extract the archive, or open a terminal (Ctrl-Alt-T) and type

cd /host/Linux/Make/
tar xzf make-3.81.tar.gz


Have you tried changing the repository to the 'Main server'?
Whenever you change it and close, it will prompt you to reload. That should restore the defaults.

If that does not work, here is a copy of mine:

deb http://archive.ubuntu.com/ubuntu xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial restricted universe main multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial-updates restricted universe main multiverse
deb http://archive.ubuntu.com/ubuntu xenial universe
deb http://archive.ubuntu.com/ubuntu xenial-updates universe
deb http://archive.ubuntu.com/ubuntu xenial multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial-security restricted universe main multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security universe
deb http://archive.ubuntu.com/ubuntu xenial-security multiverse
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner


First off, your computer was not hacked. You would know if it was hacked, trust me.

At the very worst, some bot was snooping around and failed to do something.

Do note that random uploading/downloading is very common and many services/browsers/softwares do it. I recommend not getting worried.

However, you should add some security methods. I recommend the following:

Keep only the default repos and necessary third party repos. This'll cut down on the chances of a "security update" being a virus update.
Perform all security updates you can
VNC is insecure by itself. Secure it by using a SSH tunnel. Instructions are available all over the web.


The interface eth0 is up, so the underlying device is found. There no IP address associated to this interface.

Assign an ip address manually:

$ sudo ifconfig eth0 w.x.y.z

Or contact the DHCP server, if it exists, and let it provides an ip address for the interface:

$ sudo dhclient -v eth0

If something goes wrong, dhclient will print error messages. They should be used to troubleshoot.

----

If the system just booted, then there could be a missing configuration or a mistake in interfaces configuration.

In order to fix issues of interfaces setting at boot or If you would like to make the settings persistent over the reboot:

man interfaces
edit /etc/network/interfaces file


You have to install the development libraries:

sudo apt-get install libncurses5-dev

and please don't use sudo apt-get install libncurses* or do you need all this packages?

libncurses5 - shared libraries for terminal handling
libncurses5-dbg - debugging/profiling libraries for ncurses
libncurses5-dev - developer's libraries for ncurses
libncursesw5 - shared libraries for terminal handling (wide character support)
libncursesw5-dbg - debugging/profiling libraries for ncursesw
libncursesw5-dev - developer's libraries for ncursesw
libncurses-gst - Ncurses bindings for GNU Smalltalk
libncursesada-dbg - Ada binding to the ncurses text interface library: debug symbols
libncursesada-doc - Ada binding to the ncurses text interface library: documentation
libncursesada3 - Ada binding to the ncurses text interface library: shared library
libncursesada3-dev - Ada binding to the ncurses text interface library: development

Probably not.


You can save the command substitution in a variable first, which will let you keep the exit code:

output=$(bash main.sh)
exit_code=$?

some-command "$output"
(exit "$exit_code") # now $? will have exit status of the script

Example:

$ foo=$(echo bar; false)
$ ret=$?
$ echo $ret
1


HDMI sound disappears after suspend on Ubuntu 16.04

It was happening in my New Omen X  Laptop

Finding a kernel mod in the link below solved this.  However it was more serious as my Sound Card was Not being shown at all.

But here is the fix in case it helps others just the same ...
https://ubuntuforums.org/showthread.php?t=2401273&p=13801685#post13801685,
Post #7


Trying to get unetbootin to write a Windows ISO on latest version of Ubuntu

With the information given, I guess the reason your system did not detect your Bootable Windows USB at the start might be because of the software you have used to make a bootable USB. The software was unable to create the required boot files while writing the Windows to your USB

And I found it really weird that a software took 12 hours, to make a Bootable Windows USB.

My suggestion would be to use a different alternatives of the software. You can find few alternatives here.

And also, do remember to change the boot order of your system from your BIOS. You can find more information about it here

Hope this helps :)

PS:- Please share more information about the software you have used in the question. It will be help people give a better answer to your question.


If I turn on the UEFI, will my BIOS mode installed operating systems be damaged in any way?

It won't be a problem if you turn on the UEFI BIOS. If you decide to switch back to the legacy BIOS, just follow this guide.


The discrepancy you are finding between the 2 is a matter of scales. There are many scales used to measure computer storage. For example:

Gibibytes: Gibi 2^30 - 1 Gibibyte = 1,073,741,824 bytes

Gigabytes: df -h print sizes in powers of 1024 however, drive manufacturers refer to capacities using powers of 1000 df -H will provide information in that scale as well. See the examples below:

me@zippy-64bit:~$ df -H /dev/sda2
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       113G   11G   97G  11% /
me@zippy-64bit:~$ df -h /dev/sda2
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       106G   11G   90G  11% /

As you can see above and below capacity depends not only on how you ask but also depends on who you are and who you ask.

Consider this: from nautilus properties as a regular user I get this:

You'll note that the Nautilus properties output doesn't agree with either of the df outputs. The clue is (some contents unreadable) but even if you were root there's no guarantee of a match as the method used to calculate usage can vary as evidenced by the output of df vs. du for example. My best advice is to keep an eye on the Use% in your df output as that will always be accurate regardless of the scale in use.


Based on the information available in your question this can be a very broad range of things. I am going to list the ones that come to mind!

You have selected a custom system font file that does not adhere to standards. Solution: revert to the default system font or find another without bugs.
The font file is corrupt. This is not likely since you say it occurs from time to time. Solution: Replace it with an original fetched online. Rebuild font caches.
There is a version conflict in the chain of libraries that are responsible for rendering your fonts. Solution: sudo update; sudo upgrade; sudo reboot; usually does the trick. Also if you have a lot of PPAs installed, I would disable them together with software installed from them temporarily to see if the problem goes away.
One of the font rendering libraries has a bug. This could manifest itself as some glyphs not being rendered properly like in your screen-shot. Solution: Reinstall font rendering packages.
The font rendering library's cache is corrupt. Font rendering is an expensive/slow operation and it is customary to use caches of rendered bitmaps that are dynamically managed at run-time to speed this up. Should the memory or disk-space required for this cache not have sufficient security privileges, run out space, become corrupted due to hardware faults then this would make font rendering look ugly. Solution: Rebuild font caches with this: sudo fc-cache -srv; fc-cache -rv
Hardware accelerated font rendering will rely on both the GPU and its driver. The GPU driver may have a bug or you are having hardware problems with your GPU that manifest themselves as errors in font rendering. Typically GPUs will start malfunctioning "a little" when they are under stress, overheat or in some cases when they don't receive enough power from the PSU. Solution: make sure your system is not overheating. Make sure your PSU is scaled to handle your GPU. There are utilities that can help you stress-test your GPU to see if this produces your problem.
Memory chips have faults that manifest as memory corruptions. If this is the case you may also experience instability. If a memory chip gets just one bit wrong every 4 days this can manifest itself as really hard to track errors. Solution: run memtest86 or similar memory testing tools to verify that your chips are fine.
Individual applications may have bugs that manifest themselves like your screen-shot. Especially applications that are text and font intense such as web-browsers. I have seen this myself in Firefox. At one time all letters were exchanged for small filled boxes. Solution: restart app or system if it happens seldom. Update software version if it happens often.
Firmware bugs is a reality, especially in low end hardware. Also bugs in firmware are often masked over in the WINDOWS drivers. For Linux users this means we get to keep the firmware bugs for free. Solution: If you got your computer for cheaps, or it is from a vendor not known for it's focus on stability/Linux support then maybe you should start saving for a new system.

Hope at least some of this was of use. I really had a great time writing it!


How to recover files from a DVD with command line method?

from this source

get the path of your DVD with blkid

#example:
blkid
/dev/sda1: UUID="4ea68146-163e-4ce6-aeda-4cc2d338c2ed" TYPE="ext4"
/dev/sdb1: UUID="e1977a53-b9f4-4c96-9251-84af259d06b4" TYPE="swap"
/dev/sdb5: UUID="a85b1b95-c5ce-4557-9ca4-503b1a9ddcc8" TYPE="ext4"
/dev/sdb6: UUID="c71a7601-04b8-4808-8f7b-ec967ac967ba" TYPE="ext4"
/dev/sr0: LABEL="Disc" TYPE="udf"

sdaand sdbare Hard Disk. /dev/sr0 is the DVD

then to acces the DVD content, use foremost
(Install it with sudo apt-get install foremost)

List the content of the DVD (even the erased one):

sudo foremost -w /dev/sr0
Processing: /dev/sr0
|********************************************|

Result is available with:

sudo cat ~/output/audit.txt | more

Foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick Mikus
Audit File

Foremost started at Tue Jun 14 23:25:18 2016
Invocation: foremost -w /dev/sr0
Output directory: /home/yourlogon/output
Configuration file: /etc/foremost.conf
------------------------------------------------------------------
File: /dev/sr0
Start: Tue Jun 14 23:25:18 2016
Length: 4 GB (4573593600 bytes)

Num  Name (bs=512)         Size  File Offset     Comment

0:        1152.jpg         2 MB          589824
1:        7168.jpg         2 MB         3670016
2:       13292.jpg         2 MB         6805504
3:       19368.jpg         2 MB         9916416
4:       24808.jpg         2 MB        12701696
5:       30464.jpg         2 MB        15597568
6:       35132.jpg         2 MB        17987584
7:       40868.jpg         2 MB        20924416
8:       46916.jpg         2 MB        24020992
...

To recover all data

sudo foremost all /dev/sr0
Processing: /dev/sr0
|********************************************|

everything is then available in ~/output/

And to make files available sudo chmod -R 777 ~/output/


Application for viewing installed Documentation in Ubuntu 12.04

There is  tool which view manpages in browser, it is called doccentral. You can install it with the following command:

    sudo apt-get install doc-central

Then open a terminal and type doccentral  package-name, for example

    doccentral python

Which brings you to your default browser with Contents such as this.


Error in running Ubuntu from my USB. My windows is corrupted

To restore the Windows Vista bootloader, you must first boot off your Windows Vista installation DVD.

If you have one of the many OEM computers that didn't come with a Vista installation disk, you can get the same effect with a Vista recovery disk, which you can download  or create from another Vista/7 computer (see this page and this tutorial).

When you get to the Regional settings, select your Location/Keyboard setting then click next.

On the next page you must click on "Repair your computer."

On the next page, if it finds your Windows Vista installation, make sure it is UNSELECTED before clicking next.

Then click on "Command prompt". From there, type in the folowing:

bootrec.exe /fixboot

bootrec.exe /fixmbr

Now close the two windows and click "Restart."

Take out your Vista DVD and hopefully, you will be left with your Windows Vista Bootloader.

If you dont want also to restore Ubuntu

Boot into the Ubuntu 12.04 Live CD and click "Try Ubuntu without installing":

After the desktop is loaded, we need to mount the root partition so that we grant the live cd user read/write permissions on your system files and folders. Let's first identify the partition where Ubuntu is installed with this command:

sudo fdisk -l

Note: The Terminal can be started by pressing   CTRL+ALT+T.

The Ubuntu partition we will work on will be labeled with the word "Linux" as shown in the screenshot given below:

Run now this sequence of commands to mount the root partition:

sudo mkdir -p /media/ubuntu

sudo mount /dev/sda1 /media/ubuntu

Then you need to mount these system folders to use them on your current desktop environment:

sudo mount --bind /dev /media/ubuntu/dev

sudo mount --bind /proc /media/ubuntu/proc

sudo mount --bind /sys /media/ubuntu/sys

Now chroot into your hard drive with this command:

sudo chroot /media/ubuntu

You have now read/write permissions on your root partition. To install GRUB2, you need to use one of these two commands:

grub-install /dev/sda

or

grub-install --root-directory=/media/ubuntu /dev/sda

Note: the "sudo" is not required since you are logged in as root now. Also keep /dev/sda as is.

If the installation is successful, you will get these outputs:

root@ubuntu:/# grub-install /dev/sda

  Installation finished. No error reported.

Update GRUB2 with this command:

update-grub

Now Remove the Ubuntu installation CD and reboot your system to see if the GRUB2 boot menu is restored or not.


How to convert a .pdf file into a folder of images?

OK well, I did some more research and although tohuwawohu's method does work, I found it easier to use a program called pdftoppm to achieve what I wanted done. Since I am pretty much a layperson when it comes to using command line apps, I will do my best to explain how I got this to work for me.

Navigate to the folder containing the .pdf you wish to edit and open a terminal there. I did this by using the sample command:

cd ~/Documents/PDF

Let's say the file I want to edit is called Sample.pdf  What I want to do is use pdftoppm to create image files of each page of the .pdf.  Several formats can be chosen (see the man pages link above) but I prefer to use .png.  The basic command looks like this:

pdftoppm -FORMAT FILENAME.pdf PREFIX

or in the example above:

pdftoppm -png Sample.pdf Sample

This command creates an image file of each page in the same folder as the original .pdf file with names like Sample-01.png, Sample-02.png and so on.  I have tried it with the .png and .jpeg extensions successfully. .jpg is apparently not supported.
Then I just use Archive Manager by selecting all the newly-created image files, right-clicking, and choosing "Compress" from the context menu.  I then choose the archive format I prefer (in this case .cbz or Comic Book Zip) and create the new archive.
Now I have a shiny new .cbz file called Sample.cbz which I can then view with my Comix reader!

Hopefully what I have posted above makes enough sense that someone else can learn from it. If I need to change it in any way please let me know.


How can I add the current CPU usage to my menu bar as a percentage?

There is no need to add any extra repository, just install indicator-multiload from the default repos:

sudo apt install indicator-multiload

Then start it manually the first time by searching for "system load indicator" in the dashboard.

Right click the indicator for preferences.


Why app is still in use despite you have already deleted it

Programs get loaded into RAM and operate from there (because RAM is faster than hard drives and other storage types). You have uninstalled the app from disk when you did sudo apt purge indicator-multiboard, but have not stopped the copy actually loaded in RAM. Once you exit the application, it will be gone from RAM ( although IIRC some cache may remain in swap, which will be gone once those parts of RAM need to be freed up by the system )

If the application indicator-multiboard doesn't have an exit or quit button, you may consider killing the process via pkill -f indicator-multiboard or to be safer - find out its actual PID via pgrep -f indicator-multiboard | xargs ps -p and then use the PID you find in kill command. Of course a simple reboot will have similar effect (on server it's not always possible to reboot, but on desktop it's more than acceptable).

Side note: deleting app from hard drive ( or any file for that matter ) is like removing book from catalog in the library - actual book is still on the shelf until librarian ( the system ) decides to put something else on that shelf and mark it in the catalog.

See also:

Linkers and Loaders, Linux Journal
How is rm -rf / able to delete all files in the system?


Uninstall completely Oracle VM with steps in question https://askubuntu.com/a/703750/632766 (source) add autopurge when the terminal suggest you to do it. And reinstall from terminal.

Steps are:

sudo apt-get remove --purge virtualbox When the terminal suggest run autopurge, copy, paste and run it.
Run

sudo rm ~/"VirtualBox VMs" -Rf

sudo rm ~/.config/VirtualBox/ -Rf

Install again sudo apt-get install virtualbox
To open VM search in Menu>Accessories> Virtual Box


Ubuntu Software Center fails on every captcha I try

This is a duplicate of "I can't register to Ubuntu one. The captcha images are not authorizing my input although I'm sure I have it right"

I posted an answer there, but I don't have the rep to close this one.


Possible/viable to make a btrfs RAID between SSD and HDD?

Possible... But not desirable.

Each medium has its strengths. The Linux filesystem makes things so simple to split up that you can very easily assign things to the right places by bind-mounting and SymLinking so that if you need extra speed, or you need more space on a partition, you can make it happen.

Trying to tie two different disk mechanisms together using RAID will result in:

the SSD's superb seek time becoming diluted by the mechanical disk's
dodgy transfer times
half the stability (RAID0 is twice as vulnerable to complete failure)
and you'll (technically) only be able to bind in 16GB in that one RAID0 array so you'll still need to reassign and cross-mount things around.

It might be fun to test it out... But I don't think it's a viable long-term platform.


Can you check if secure boot is disabled? If it is enabled it will block all software that 'isn't trusted by the system manufacturer'. And it would be likely that a Linux USB is seen as possible harmful software.


Eclipse 4 with Oracle JDK7 on 12.04 x64?

What you can do is downloading the Eclipse software on the Eclipse website (eclipse.org). The whole program is contained in the archive you download. After downloading this, you can unpack it and put the folder you get on a portable device.

For Java 7, you can do the same thing. Downloading the JDK7 from the Oracle website and install it on the same portable device as Eclipse. Once you do that, you should tell Eclipse that you want to use this JDK for your coding activities.

But I recognize that you will have to update it manually.


Why artificially change access/modification times with touch -am?

Well one of the wikipedia examples states that it's useful with the make command. Make is a program used to execute Makefiles which contain a build script for any source code and if you run the command, it stored the current Makefile's modification time inside the directory.
Now say that you want to rebuild the source for whatever reason. if you were to run make again it would tell you that there's nothing to do, since it has been run already. So you can run touch -m "source.file" to simulate a file modification. Running make a third time would then recognize the change and rebuild the source code.
Another example would be to force a backup. If you're running a backup utility that for example backs up files based on when they have been modified. You could force the program to back up (or exclude from the backup) a file by changing it's modification time.

create the false impression about the age of a file
for example for use in backup schemes. You might want to not update a backup with a newer one since they're identical, or since the changes are irrelevant compared to the expense of updating a backup on, say, a slow line to a remote host. To achieve this, you have the simple option of marking the backup file with a newer timestamp, not faking but declaring that the validity timestamp of that file is now a different one.
The impression about the age of the file is now indeed false, but its meaning is real and legitimate.

Answer from this question where you can find even more examples


Copy from guest Ubuntu terminal in virual machine to Microsoft Word on host windows

Use your mouse to select the text in the terminal.
Right-click in the terminal and choose 'Copy'.
Then paste the text from the clipboard in Word (Right-click 'Paste').

Does this help you?


Ubuntu newbie needs network and routing help

I assume the drobo is DHCP querying for getting its IP address, which the server doesn't service as it's on the "wrong" interface.
You can configure your server's DHCP server to offer addresses on that interface as well, but probably it needs to be a different network for the drobo+server link. Your server would then also need to act as gateway between the two networks, if other hosts on the first network need to "see" the drobo or vice versa.


Server randomly hangs, with the only way out a forced reboot

It was XFCE's built in power management. It was suspending the server after 30 minutes, rendering it inaccessible

Switched to LXDE and no further problems

Also need to forcibly disable hibernate and sleep services:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

(Source: https://wiki.debian.org/Suspend)


Eduroam on Aquaris E4.5 (Ubuntu edition)

Here is my solution to the problem. Follow the instructions on http://www.danbishop.org/2015/02/21/add-eduroam-or-any-other-802-1x-wireless-network-to-ubuntu-phone/. My modified eduroam profile will be created like this:

printf "[ipv6]\nmethod=auto\n\n[connection]\nid=eduroam\nuuid=89feacc0-bf73-48b1-92bf-3fb57b735c89\ntype=802-11-wireless\n\n[802-11-wireless]\nssid=eduroam\nsecurity=802-11-wireless-security\n\n[802-1x]\neap=ttls;\nidentity=<YourID>\nanonymous-identity=anonymous@uni-greifswald.de\nca-cert=/etc/ssl/certs/Deutsche_Telekom_Root_CA_2.pem\nphase2-auth=pap\npassword=<YourPassword>\n\n[ipv4]\nmethod=auto\n\n[802-11-wireless-security]\nkey-mgmt=wpa-eap\n" > eduroam

Final command was:

sudo chown -R root:root /etc/NetworkManager/system-connections/eduroam

Restart the phone and then it should work.


How to skip unzipping a file that already exists?

Use the -n switch. From the unzip man page:

  -n     never overwrite existing files.  If a file already exists, skip the extraction of that file without prompting.  By
                default  unzip  queries  before extracting any file that already exists; the user may choose to overwrite only the
                current file, overwrite all files, skip extraction of the current file, skip extraction of all existing files,  or
                rename the current file.


How to get Opera work correctly with Privoxy?

It's definitely not an issue with Opera. It's a problem with Privoxy. My Privoxy logfile in /var/log/privoxy/logfile mumbles about "Fatal error: can't bind to 192.168.2.3:8118: Cannot assign requested address".

It's caused by this bug: privoxy not start at boot - karmic.

A workaround is available, which delays the startup of Privoxy. Quoted from https://bugs.launchpad.net/ubuntu/+source/privoxy/+bug/427625/comments/17:

  Further workaround suggestions: rename /etc/rc2.d/S?0privoxy to /etc/rc2.d/S99privoxy. If even that doesn't work, then edit /etc/init.d/privoxy and replace the do_start function with the following:
((begins))
do_start()
{
 # Return
 # 0 if daemon has been started
 # 1 if daemon was already running
 # 2 if daemon could not be started
 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
  || return 1
 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
  $DAEMON_ARGS \
  && return 0
 # Add code here, if necessary, that waits for the process to be ready
 # to handle requests from services started subsequently which depend
 # on this one. As a last resort, sleep for some time.
        sleep 1
 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
  $DAEMON_ARGS \
  || return 2
}
((ends))


AppArmor genprof problem for apache2 on Ubuntu 18

You dont need to aa-genprof apache2. Apparmor profile is avalible as libapache2-mod-apparmor. Please follow the below github document.

git hub document

1) You need apache2 profile libapache2-mod-apparmor.

apt install libapache2-mod-apparmor

2) Enable it

aa-enforce /etc/apparmor.d/usr.sbin.apache2

If you are getting error like aa-enforce not found. int apparmor-utils

apt-get install apparmor-utils

3) To configure your appache, I followed the below:

a2enmod mpm_prefork
a2enmod apparmor
service apache2 restart

You can find my old answer in server fault:

https://serverfault.com/questions/932410/enabling-apparmor-for-apache2-in-ubuntu-18-04


Can ubuntu run all types of files, .rar, .zip, etc

Run like? you would like to unzip a file? If this is what you are looking for then yes, it can. In fact you don't have to install anything, if it is missing for example .rar package it will prompt you then if you want to install it and it will do the rest of the job automaticaly.


Missing panel icons at top right in GNOME3

If it isn't running already, run 'gnome-panel' from terminal (or logoff and log back in in your gnome session).

Alt + rightclick (on some pc's Super+Alt+rightclick) on the panel where you want the icons and add the Indicator Applet Complete.

That should do it.


Many a times, when HTTP is used for update and sometimes mirrors may change, therefore this problem may occur. You will have to remove downloaded repository information from the /var/lib/apt/lists/ directory. To remove the information, open the terminal and type

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

Once, the files is removed, you can continue with the update using the command

sudo apt update


Cannot execute script outside of home directory

baAmong the options you can pass to mount or write in fstab there is an exec flag. Remounting your drive with that option should help.

(If this is a bash script, you can probably also do /bin/bash /data/nameOfScript, but you'll run into the next problems soon, I guess.)


The file only seemed to be stored in RAM. All attempts to find it on disk returned nothing. Here's what I did for partial recovery:

Find out PID and write it down

ps -ef | grep gedit

Use it to dump memory of process

sudo gcore 12345

Use vim and search for keywords you remember

sudo vim core.12345

The entire file will be fragmented, can be quite big and is littered with parts you have deleted already. Since I was not programming, but wrote an actual text, I was able to find the individual fragments and recover a large part of the text.

Ironically, after I went through all of this work and wanted to close the gedit instance it asked me if I want to save the Untitled Document 1 - which I did.


Why is this package not shown in Synaptic Package Manager

any2djvu is a command and not a package. Synaptice/USC you search for packages.
The answer to your questions is also on the manpage:

natty (1) any2djvu.1.gz
Provided by: **djvulibre-bin_3.5.23-3ubuntu2_i386**

SEE ALSO: The entire djvu suite, eg djvu(1), djview(1), and djvuserver(1).

You need to search for djvu in synaptic. Most likely want your want is the djvulibre package.


You need nethogs I think.

sudo apt-get install nethogs

then run

sudo nethogs $device

or if you use wlan, then

sudo nethogs wlan0

Also check out iftop and netstat and vnstat. All are very important programs for network monitoring, but all have a different purpose.

nethogs shows current network usage by processes (program names)

iftop shows current network usage by connections (IPs/hosts)

netstat shows the connections by state (this doesn't show bandwith usage, but shows everything else about a connection.)

vnstat is a traffic monitor, e.g for keeping yourself in your data plan or later analysis.

Just install them, and look in their manuals.


How do I do a Chrome offline installation?

You can install Google Chrome offline by going to the download page and download the .deb file that is matching your Linux version (32bit or 64bit).

After download you can open the window of that folder and just double-click the downloaded file.

Alternatively, after saving the file to a local directory you should open a terminal (Ctrl+Alt+T) and change to that directory. You should then execute the command:

  sudo dpkg -i <filename>

Where <filename> is the name of the downlaoded file.


No Internet (Ethernet r8169 driver) after suspend

Work-around for 14.04:

Create the following Bourne shell script in /etc/pm/sleep.d:

MYNAME=$0

restart_ethernet() {
   /usr/bin/logger $MYNAME 'restart_ethernet(r8169) BEGIN'
   /sbin/modprobe -v -r r8169
   /sbin/modprobe -v r8169
   /usr/bin/logger $MYNAME 'restart_ethernet(r8169) END'
}

/usr/bin/logger $MYNAME 'case=[' ${1} ']'
case "${1}" in
   hibernate|suspend) ;;
   resume|thaw) restart_ethernet;;
esac

That should force the r8169 driver to resume Ethernet service after resuming from suspend.

Make sure that the script is executable (chmod +x).


How to fix one virtual desktop to my second monitor with KDE?

I'm actually running KDE 4.9.4 atop ArchLinux, but it shouldn't matter. Since KDE treats the screen as one (mostly), switching Virtual Desktops will switch them on all screens. However, there's a handy "On all Desktops" button in every window titlebar (near the app logo, you enable/disable that in SystemSettings->WindowDecorations->ConfigureButtons). Click that, and your application will remain there even if you switch the desktops. It's a workaround, but it works.


passing file from bash script to gnuplot script

If I understand correctly, you want the graph to show up on the display and then have a copy in the PDF file /dev/shm/TT.pdf.

I see two problems here:

The instruction for the plot --- you store the file name in filename, so ypu should just say

plot filename  using 1:2 w points title "tests"

without the <"...  things.
If you want the pdf file you should add a replot after the change of terminal and output file (double check you can write in the destination directory).

I have created a file data.dat and the file file.gnuplot:

set xlabel "start"
set ylabel "Delay"
set autoscale
set style line 1 lt 1 lw 3 pt 3 linecolor rgb "red"
plot filename   using 1:2 w points title "tests"
set terminal postscript portrait enhanced mono dashed lw 1 'Helvetica' 14
set output 'TT.pdf'
replot
pause -1

And calling it with:

gnuplot -e "filename='data.dat'" file.gnuplot

I have the output:

...and the corresponding TT.pdf file.

By the way, instead of the pause at the end, I find much better to add

set terminal wxt persist

at the start, and remove the pause. The script will finish naturally and the window with the graph will stay put until you dismiss it.


How can I get lines where a specific word is repeated exactly N times?

In perl, replace this with itself case-insensitively and count the number of replacements:

$ perl -ne 's/(this)/$1/ig == 3 && print' <<EOF
How to get This line that this word repeated 3 times in THIS line?
But not this line which is THIS word repeated 2 times.
And I will get This line with this here and This one
A test line with four this and This another THIS and last this
EOF
How to get This line that this word repeated 3 times in THIS line?
And I will get This line with this here and This one

Using a count of matches instead:

perl -ne 'my $c = () = /this/ig; $c == 3 && print'

If you have GNU awk, a very simple way:

gawk -F'this' -v IGNORECASE=1 'NF == 4'

The number of fields will be one more than the number of separators.


To be able to resize/move partitions, the partitions must not be in use.

Boot from a liveCD or liveUSB, make sure no partition is mounted then launch Gparted and create the necessary partition.

After installing Windows you'll have to recreate Grub. The easiest way is to boot again from the live USB, install boot-repair with sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update followed by sudo apt-get install -y boot-repair && boot-repair and do a recommended repair.


Why there's no USB support in VirtualBox Ubuntu edition?

The USB code in VirtualBox is not open-source.The ubuntu repository is the open version,so the open source edition of VirtualBox doesn't have USB function.It's easy enough to install the full one from virtualbox's website.


Suddenly not able to access resources on VPN network in Ubuntu 18.04?

I had similar problem a couple months ago.  My vpn would not work.  I deleted all vpn config files and then downloaded them again, had to reboot machine two or three times till everything worked again.


Ubuntu 16.04 : Gnome Ubuntu Software Doesn't Open At All

You can install the classic 'Package Manager' : sudo apt-get install synaptic

If no visible launcher, please start synaptic with : synaptic-pkexec


can't install Ubuntu on Lenovo Yoga 3 Pro

You should install Ubuntu 14.10 instead of 14.04. See my guide.


The most complete recording, editing, and audio mixer software is Ardour. This software is based on Jack rather than PulseAudio sound server.
Ardour
can be installed from the Software Center but it will likely better be integrated in the Ubuntu Studio flavour of Ubuntu.
If it is only a single or few LADSPA plugins we can also integrate them to the default Pulseaudio server:

How can I apply a LADSPA plugin to a PulseAudio stream?

For editing (but not for real-time effects) we may have a look at Audacity  which also nicely integrates additionally installed LADSPA plugins.


Just installed Ubuntu 18.04 can't get remote

I've also had trouble with remote session on 18.04 and am still looking for a usable solution.  It was possible to get a remote access once the ~/.xsession was modified to contain the following one line:
env -u SESSION_MANAGER -u DBUS_SESSION_BUS_ADDRESS xfce4-session

The first two of the following three step process is required every time the system is booted.  The third step is the step that makes a successful remote connection and, it is possible time after time until next system boot:
1. Start a remote desktop connection, selecting the Xvnc protocol (it results in a moveable mouse but the screen is grey)
2. Using a putty session (or any other telnet), find the recently started xfce4-session process and kill it.
3. Start a remote desktop connection, selecting the Xorg protocol.

At first, I disabled the firewall (ufw).
Later, I enabled the firewall then immediately put in the necessary rules allowing my LAN to access the remote Xubuntu system using port 3389.


Switched Automatic mount for my only partition with a boot

Seems like you have added a mount configuration for your USB drive in /etc/fstab which tries to mount the stick during boot now and fails after 90 seconds or so as the device is not found.

Once you get into the recovery terminal, you should be able to edit /etc/fstab (e.g. using the command nano /etc/fstab - sudo should not be required as the recovery shell is running as root).

Simply locate the line containing /mnt/Generic_usb12342345356324... (or whatever your not found mountpoint is) and remove it, or if you are unsure, comment it out by adding a # at the beginning of that line.

Then reboot. It should no longer look for that partition if you did everything right.


Help following instructions (stuck at editing a file)

The file ./build-scripts/androidbuild.sh is in the source code folder of libSDL.

Look here and download the source code archive

E.G.:

wget https://libsdl.org/release/SDL2-2.0.3.tar.gz
tar xf SDL2-2.0.3.tar.gz
cd SDL2-2.0.3

After that you can see the folder build-scripts

./build-scripts/androidbuild.sh


How do I print the last 5 fields in awk?

You need to loop through the fields:

bash-4.3$ awk '{for(i=6;i<=NF;i++) printf $i" "; print ""}' input_file.txt
f6 f7 f8 f9 f10
c6 c7 c8 c9 c10

Or you can make fields equal to Null string:

bash-4.3$ awk '{for(i=1;i<=5;i++) $i="";print}' input_file.txt
     f6 f7 f8 f9 f10
     c6 c7 c8 c9 c10

Or use substring of the whole line , to print all characters from where field 6 begins (credit to https://stackoverflow.com/a/12900372/3701431):

bash-4.3$ awk '{print substr($0,index($0,$6))}' input_file.txt
f6 f7 f8 f9 f10
c6 c7 c8 c9 c10

or simply use cut command:

bash-4.3$ cut -d " " -f6-10  input_file.txt
f6 f7 f8 f9 f10
c6 c7 c8 c9 c10

Python can do that too:

bash-4.3$ python -c 'import sys;fields=[" ".join(line.strip().split()[5:]) for line in sys.stdin];print "\n".join(fields)' < input_file.txt
f6 f7 f8 f9 f10
c6 c7 c8 c9 c10

or alternatively:

$ python -c "import sys;print '\n'.join(map(lambda x:' '.join(x.split()[5:]),sys.stdin.readlines()))" < input_file.txt
f6 f7 f8 f9 f10
c6 c7 c8 c9 c10

Or with Ruby:

bash-4.3$ ruby -ne 'print $_.split()[5..10].join(" ");print "\n"' < input_file.txt
f6 f7 f8 f9 f10
c6 c7 c8 c9 c10

Bash + xargs can do it too, although a bit more convoluted:

bash-4.3$ cat input_file.txt | xargs -L 1 bash -c 'arr=($@);for i in $(seq 5 10);do printf "%s " ${arr[$i]} ; done; echo' sh
f6 f7 f8 f9 f10
c6 c7 c8 c9 c10


Appending a line to a file in the cat command?

You can leverage cat's ability to read from stdin combined with it's ability to read multiple files to achieve this.

~$ cat file.txt
Hello from file.txt

~$ echo "My final line" | cat file.txt -
Hello from file.txt
My final line

You can also prepend a line, as such:

~$ echo "My final line" | cat - file.txt
My final line
Hello from file.txt

Note that you are not limited to a single line. cat will read from stdin until it reaches EOF. You can pass the output from curl, for example, to prepend or append to the output of cat.

~$ curl -s http://perdu.com | cat file.txt -
Hello from file.txt
<title>Vous Etes Perdu ?</title>
Perdu sur l'Internet ?

Pas de panique, on va vous aider

    * <----- vous &ecirc;tes ici


It would be useful to receive some more specific information in order to answer properly. In what environment you are seeing this struct file object? Searching for struct file object in Google only points to this question.

But generally, a file descriptor in Unix-like operating systems can be created with the library function open which will use the kernel's system calls. The file descriptor can be released and deallocated with a call to library function close which will, again, use appropriate system calls and ensures that no resources will leak.


Video output gets stuck on dev/sda1 clean

Run on terminal. In SSH edit the file "/etc/default/grub". Example:

sudo vi /etc/default/grub

Change the line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
sudo update-grub2

Reboot

You can do the same from recovery mode > root shell


The fact that you are experiencing this problem is a bug, and can be reported.

Try removing LibreOffice completely:

sudo apt-get remove libreoffice-common libreoffice-core libreoffice-ogltrans libreoffice-base-core libreoffice-calc libreoffice-draw libreoffice-emailmerge libreoffice-gnome libreoffice-gtk libreoffice-impress libreoffice-math libreoffice-pdfimport libreoffice-presentation-minimizer libreoffice-presenter-console libreoffice-writer mythes-en-us python-uno openoffice.org-debian-menus libreoffice-help-en-gb libreoffice-help-en-us libreoffice-help-zh-cn

Then check that everything seems to be working normally:

sudo apt-get install -f

Try installing SL (it's a small joke package that's harmless):

sudo apt-get install sl

This solution is based on this discussion.


Paid applications in the Software Centre were introduced in Ubuntu 10.10, so you cannot get them from 10.04.


Seems the old sound is not there any longer, I could not find it in all of *.ogg, *.wav files.

You can change the sound yourself:

cd /usr/share/sounds/ubuntu/stereo/
sudo cp desktop-login.ogg desktop-login.ogg.sav
sudo cp ~/Downloads/desired-sound.ogg desktop-login.ogg


What is the difference between "Redirection" and "Pipe"?

Pipe is used to pass output to another program or utility.

Redirect is used to pass output to either a file or stream.

Example: thing1 > thing2 vs thing1 | thing2

thing1 > thing2

Your shell will run the program named thing1
Everything that thing1 outputs will be placed in a file called thing2.  (Note - if thing2 exists, it will be overwritten)

If you want to pass the output from program thing1 to a program called thing2, you could do the following:

thing1 > temp_file && thing2 < temp_file

which would

run program named thing1
save the output into a file named temp_file
run program named thing2, pretending that the person at the keyboard typed the contents of temp_file as the input.

However, that's clunky, so they made pipes as a simpler way to do that. thing1 | thing2 does the same thing as thing1 > temp_file && thing2 < temp_file

EDIT to provide more details to question in comment:

If > tried to be both "pass to program" and "write to file", it could cause problems in both directions.

First example: You are trying to write to a file.  There already exists a file with that name that you wish to overwrite.  However, the file is executable.  Presumably, it would try to execute this file, passing the input.  You'd have to do something like write the output to a new filename, then rename the file.

Second example: As Florian Diesch pointed out, what if there's another command elsewhere in the system with the same name (that is in the execute path).  If you intended to make a file with that name in your current folder, you'd be stuck.

Thirdly: if you mis-type a command, it wouldn't warn you that the command doesn't exist.  Right now, if you type ls | gerp log.txt it will tell you bash: gerp: command not found.  If > meant both, it would simply create a new file for you (then warn it doesn't know what to do with log.txt).


frequent abnormal shutdowns/system crashes

Did you get a chance to run a update after installation?  There is a known problem with Everpad, plus others, that is fixed with an update.
https://github.com/nvbn/everpad/issues/35


That depends whether you are also willing to bump PHP version to latest (5.4).  If the answer is yes, then I would suggest to follow:

How do I install latest PHP in supported Ubuntu versions (like 5.4.x in Ubuntu 12.04)?

which doesn't include suhosin patch anymore, because suhosin is upstream-dead.

Also newer Ubuntu releases (those which contain php5 >= 5.4.0) doesn't include suhosin anymore.

But be warned that generally the problems you might have with suhosin won't go away and usually indicate some deeper problem withing the PHP (like memory leak, etc.).


Connecting Ubuntu Gnome 16.04 to Microsoft Designer Mouse via Bluetooth

I too have the MS designer KB and mouse and have been struggling to get them working until I found this nugget which led me to my solution:

You can use /usr/bin/btmon to observe bluetooth traffic in a terminal"
    $ sudo /usr/bin/btmon

The settings in my /var/lib/bluetooth/0C:8B:FD:A3:A7:81/C9:DE:3D:0B:5D:AA/info file did not correlate to the info given above so I wondered why? Both devices work fine with a Win10 installation so it cannot be hardware.

Playing with /etc/bluetooth/main.conf I have ended up with these changes to the supplied default settings:

ControllerMode = dual
FastConnectable = true
AutoEnable=true

I believe it was the "FastConnectable" set to true that did the trick.

Restart the bluetooth daemon:

$ sudo systemctl restart bluetooth

Then launch the bluetooth settings window from the panel and I was able to pair and connect first the mouse and then the keyboard.

Both of which are finally now working as I type this.

Here are the settings for the controller:

# cat /var/lib/bluetooth/0C:8B:FD:A3:A7:81/settings
[General]
Discoverable=true
DiscoverableTimeout=0

Here are the settings from the device info files:

# cat /var/lib/bluetooth/0C:8B:FD:A3:A7:81/C9:DE:3D:0B:5D:AA/info
Name=Designer Mouse
Appearance=0x03c2
AddressType=static
SupportedTechnologies=LE;
Trusted=true
Blocked=false
Services=00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;

[IdentityResolvingKey]
Key=FD8B335D5C060F854D176DB83B8D30C2

[LocalSignatureKey]
Key=46E81FBAC8BF9D08E2D0EB4E2B18BDD9
Counter=0
Authenticated=false

[LongTermKey]
Key=4654312509FC03FE50E4F4733939F465
Authenticated=0
EncSize=16
EDiv=48958
Rand=16834402867800600456

[DeviceID]
Source=2
Vendor=1118
Product=2053
Version=272

[ConnectionParameters]
MinInterval=6
MaxInterval=6
Latency=60
Timeout=300

# cat /var/lib/bluetooth/0C:8B:FD:A3:A7:81/F6:E0:5B:DF:78:BC/info
[General]
Name=Designer Keyboard
Appearance=0x03c1
AddressType=static
SupportedTechnologies=LE;
Trusted=true
Blocked=false
Services=00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;

[ConnectionParameters]
MinInterval=12
MaxInterval=12
Latency=30
Timeout=300

[IdentityResolvingKey]
Key=4F6C4BBD104ADD361420130F8EDAC946

[LocalSignatureKey]
Key=0EC3A10834025CD3297D8E45EAD7EB00
Counter=0
Authenticated=true

[LongTermKey]
Key=AF3871A1D67F898120814603BF8C77D3
Authenticated=1
EncSize=16
EDiv=16328
Rand=4879611362371170586

Thanks everyone!


HTTPS App on Ubuntu fails to connect to HTTPS web app on Windows

It was resolved.

  Ran openssl s_client -connect [HOST]:[PORT]
  the output showed that the cert did not have the root and intermediate certs
  added the missing certs , so Ubuntu could verify the issuer


How to get a process exit status from another shell session?

Use strace as follows:

sudo strace -e trace=none -e signal=none -q -p $PID

Neither system calls nor signals are of interest here, so we tell strace to ignore them with the -e expressions and supress a status message with -q. strace attaches to the process with PID $PID, waits for it to exit normally and outputs its exit status like this:

+++ exited with 0 +++

A simple if expression to call any type of notification could be:

if sudo strace -e trace=none -e signal=none -q -p $PID |& grep -q ' 0 '; then
  echo yeah
else
  echo nope
fi

Example run

# in terminal 1
$ (echo $BASHPID;sleep 10;true)
8807
# in terminal 2
$ if sudo strace -e{trace,signal}=none -qp8807|&grep -q ' 0 ';then echo yeah;else echo nope;fi
yeah

# in terminal 1
$ (echo $BASHPID;sleep 10;false)
12285
# in terminal 2
$ if sudo strace -e{trace,signal}=none -qp12285|&grep -q ' 0 ';then echo yeah;else echo nope;fi
nope

Most of the credit goes to this answer on U&L, please leave an upvote there if you find this useful.


Windows won't boot after unsuccessful Ubuntu install

Some advice -

You might want to try and use Boot Repair. Check this topic -
Won't dual boot---goes straight to Ubuntu

The UEFI could also be causing you some problems -
https://help.ubuntu.com/community/UEFI

Hope this helps somewhat.


Why are img files provided for mkusb persistent but only iso file are allowed?

Explanation

mkusb-dus can create boot drives from iso files and [compressed] image files

file.iso
file.img
file.img.gz
file.img.xz

by cloning (and there is a special case to extract windows.iso files). The shellscript dus-live is used for that purpose.
Persistent live drives can be created by dus-persistent from iso files.
"But the very detailed explantions I find for how to create a persistent OS on the USB all have links to download mostly img files"

I would explain it like this: Any system can be cloned to an image file (which in turn can be compressed). Those are links to image files of persistent live systems, which can be cloned by dus-live.

The reason to create such images is that if the computer running an installed Ubuntu system in UEFI mode, it will not be possible to install and use the package grub-pc to make the target persistent live drive bootable in BIOS mode (because there is a conflict with grub-efi). But in a persistent live Ubuntu, both grub-pc and grub-efi can be installed alongside each other.
So it is possible to create systems that boot also in BIOS mode from a persistent live system running in UEFI mode. And if you have a fast internet connection, it is convenient to download a compressed image file and clone it.
The manual

man dus

may add details to this explanation.

Edit 1: bugfix to make mkusb explain and help solve this issue

Thinking twice about your question, I realize that this is confusing. So I have started to improve the code in the menu part, the shellscript dus.  Thanks for asking this question. It helps me improve mkusb :-)

Since you are a coder, I want to explain what I am doing. It is not uploaded yet, but I am modifying the function p_persistent which prepares for the call to the shellscript dus-persistent. The version number will be updated to 12.1.3.

There is output, a zenity window and red text to the console window. The variable src_orig is reset to zero length.

I am also adding code to skip to cloning (calling the function p_live) in the main section of dus (near the end of the shellscript file), if dus is called with a file name as parameter, and the file extension is not iso.

if [ "$source" == "" ]
then
 p_starter
elif [ "${source/.iso}.iso" != "$source" ]
then
 p_live
else
 p_install
fi

Edit 2: mkusb 12.1.3 is uploaded

I hope that the new version, mkusb 12.1.3, will make things less confusing. It is uploaded to ppa:mkusb/unstable and to phillw.net. Please try it and report back :-)


Open the terminal and type:

sudo newusers /tmp/userlist.txt

In the userlist.txt file, each line should contain user data in the following syntax:

username:password:User ID:Group ID:Comments:Userhome directory:User shell

Since the userlist.txt file contains users' passwords, it should not be stored in a human readable form after you have finished creating the new users. My advice is to store the userlist.txt in a file that is encrypted with a strong password, and then after you have stored the encrypted userlist.txt file securely, to delete the original userlist.txt file from the /tmp directory so that nobody can read the user passwords as plain text.

For more information about the syntax of the newusers command type:

man newusers

In the man results for newusers the GECOS field is also known as the comment field for a user.

Check /etc/passwd file to see if the new users are created. The easy way to do it is to show a list of only the users' names (There is less unnecessary information to read that way.) using the command:

cut -d: -f1 /etc/passwd


\d{3,6} is being parsed by Bash as d3 d6. This means it's being passed to egrep as two arguments, which means it's trying to open the second one as a file, because that's grep's syntax.

grep [OPTIONS] PATTERN [FILE...]

The solution is simple. Stop Bash interfering and quote your regex:

... | egrep '\d{3,6}'