Screen Tearing and Horizontal Lines on Ubuntu 16.04 NVIDIA/Intel Graphics

UPDATE (July 2018):

Now using Ubuntu 18.04, I have the driver version 390 installed and kernel parameter nvidia-drm.modeset=1 added to the GRUB boot sequence.

I get no screen tearing and correct screen resolution while using the nvidia GPU.

It's possible to check that PRIME Synchronization is activated by running xrandr --verbose | grep "PRIME" and the output will show

PRIME Synchronization: 1

I haven't tested it yet, but apparently NVIDIA fixed the problem with the new "PRIME Sync" functionality, and it's described here.

So it's necessary to have the Linux kernel above v4.5 to use it, but all the requirements are outlined in the link above.

The NVIDIA developer also warned me that some problems popped up (which can be found here) and that maybe it's best to wait a bit until they're fixed.

And about the horizontal lines, I am still not sure. Maybe updating Ubuntu to 17.04 and fixing the GPU problems will help. I'll update the answer in regards to that if I find anything.


Ubuntu 14.04 desktop not finding Ubuntu phone (Ubuntu 15.04)

Ubuntu 14.04 can't detect bq "natively" cause of outdated libs. Maybe there is the same issue for meixu.

Add this ppa should works.

sudo add-apt-repository ppa:phablet-team/tools


How do I switch back from location bar to path bar?

While in location bar, try hitting 'esc'.


How to prevent the Power button to shutdown directly the system?

Check your /etc/systemd/logind.conf file. It should look like this:

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min

Uncomment the line that says #HandlePowerKey=poweroff and change the value to ignore.

Then restart the logind with the command: sudo restart systemd-logind or reboot your computer.

EDIT: how to create a new acpi handler
Create a new file in /etc/acpi/events/. The content of the file should be:

event=<acpi_event_code>
action=<script_to_call>

where <acpi_event_code> is the code you get using the acpi_listen tool and <script_to_call> is the full path to the script you wish to call when that event happens.

They must have changed something in 13.10 because it seems that I have too few files in my /etc/accpi/events folder compared to the 13.04.


where are the configuration file for setting login screen, grub background and other customizeables?

Ubuntu Tweak is a very nice and powerful tool to configure system settings.


Right-click it and select Properties, then click the Icon button and choose the one you want.


Ubuntu doesn’t recognize Wacom Bamboo Eraser

Well, I realized that the pen in Wacom Bamboo CTL-470K-RUPL simply doesn’t have an eraser. Bah, pity on me.


Grub2 can't find Windows on a dual boot system

Have you tried running sudo update-grub in terminal and see if grub can boot Windows partition?


It lives in:

/etc/samba/smb.conf

You can edit it with:

sudo nano /etc/samba/smb.conf


installing Ubuntu to New Disk
Assuming you want to boot 20.04 in UEFI mode and that there are no other OS on the computer

Start with Rufus set up as shown below.

Proceed with install Ubuntu until you get to Installation Type.

If you want a typical setup select Erase disk and install Ubuntu and then select Install Now.

If you want an encrypted installation, select the options shown below and then select Install Now:

Proceed with installation until complete.

In answer to your original questions: 1) No, 2) No, 3) No, 4) Open Software & Updates/Additional Drivers and select the Nvidia driver that best matches numerically, the latest driver for your GPU on the Nvidia driver site.


Upgrading to Gimp 2.8 PPA fails with "dpkg-deb error"?

You should have removed the GIMP Plugin Registry package before upgrading :

sudo apt-get remove gimp-plugin-registry

because the package hasn't been compiled with  GIMP 2.8 support.

Now , run the following:

sudo apt-get dist-upgrade

Source


winecfg no longer has Windows versions/compatibility modes below Windows XP?

Windows below XP is only supported in 32-bit prefixes which are created by setting the WINEARCH environment variable to win32, e.g.

env WINEARCH=win32 WINEPREFIX=$HOME/someprefixname winecfg

(taken from https://superuser.com/a/864922/298426)


Here's the easiest way to install Plex Media Server on Ubuntu 18.04 and newer (I just happened to do this last week):

DON'T download anything manually.

Run the command sudo snap install plexmediaserver. That snap is maintained, tested, and regularly updated by the Plex developers

Snaps are deliberately sandboxed, so Plex cannot access most of your system. Your movies/music/books must be located in either:

A subdirectory of /home/your_username, or
A subdirectory of /media

Example of creating a subdirectory and mounting a movie-filled partition to that subdirectory:
 sudo mkdir /media/movies
 sudo mount /dev/sdx2 /media/movies

Open a web browser to:

http://localhost:32400 (your local machine), or
http://<ip_address>:32400 (different machine on your LAN)

After the first local login, subsequent logins to Plex can use the web service at http://plex.tv

Use the Plex Web Interface to locate and scan the media libraries that you mounted in Step #3.


Where is Wacom Settings on Kubuntu 16.04?

I managed to switch buttons 2 and 3 (linux defaults have always been an issue) by running this:

xsetwacom --set "Wacom Intuos3 6x8 Pen stylus" "Button" "2" "+3"
xsetwacom --set "Wacom Intuos3 6x8 Pen stylus" "Button" "3" "+2"

(however on my last bootup they've ceased working again... sigh)


The speed at which you burn the disc should depend on the quality of your burner (hardware) and the disc itself. If your hardware and discs are relatively new, feel free to use the highest speed that both are rated for. For example, if your hardware is capable of burning at 52x for CD-Rs and 32x for CD-RWs, and you have a CD-R rated for 40x, take the lowest of the 2 (52x and 40x) and burn at that speed (40x). If you have reason to be concerned about the quality of the CD, you can always burn at a lower speed to be safer. And if you run into any problems while using the burned CD, you can try burning it again at a lower speed. To my knowledge, there can be no disadvantage to burning a disc at a lower speed (except that it will take more time); nonetheless, with modern hardware, media, and software, there is practically no reason to ever burn CDs at very low speeds like 1x, 2x, and 4x.

Regarding the software, if you meant imgburn, that should work just fine. It's a popular image burner with good reviews.


How can I change the cursor in vim depending if I'm in insert mode or normal mode?

Two different options are listed here:

https://stackoverflow.com/questions/34251566/how-can-i-change-the-cursor-style-in-vim-depending-if-im-in-insert-mode-or-norm
https://stackoverflow.com/questions/6488683/how-do-i-change-the-vim-cursor-in-insert-normal-mode

.vimrc files with good comments will help you too, e.g. https://github.com/thoughtbot/dotfiles/blob/master/vimrc


sound module not loading/ pulseaudio not answering, audio only as root

As suggested in https://wiki.ubuntuusers.de/PulseAudio/ and many other pulse-audio troubleshooting guides, the solution was to change

; autospawn = yes

into

autospawn = no

in the /etc/pulse/client.conf file. I have tried that before posting, but have overlooked the semi-colon. Removing it was enough to solve my problem.


You have to compile the driver.

Download the latest Linux driver from Realtek. Choose the Linux driver for kernel 2.6.35 and above.

Install a few dependencies

sudo apt-get install build-essential

Extract all files. In a terminal, execute the following commands:

cd into the extracted directory
make
sudo make install
sudo modprobe rtl8192se

Wifi should be working now. In order to keep the wifi working after a reboot, add one line with "rtl8192se" to the /etc/modules file.

gksudo gedit /etc/modules

Modified from http://michael-peeters.blogspot.com/2011/10/fixing-rtl8191se-wifi-under-ubuntu-1110.html


How can I reset $PATH to its default value in Ubuntu?

The answer to your question is:

PATH=$(getconf PATH)

and works on any POSIX compliant system.  The selected answer is the correct way to augment the path without obliterating prior existing content.  If you use bash, you might consider:

PATH+=:$mynewdir


Selecting a number does not always return a Chinese character with ibus pinyin

TL;DR: rm ~/.cache/ibus/libpinyin/*

Long answer:

I have similar problem except my problem is not able to return any Chinese character in next column >.

The first thing I do is run watch -n 3 -d 'ps auxww|tac'  to compare what's the difference between the output when success(first column) and failure(next column) occur.

I quickly noticed that /usr/lib/ibus/ibus-engine-libpinyin --ibus still running on success but disappear on failure.

That means /usr/lib/ibus/ibus-engine-libpinyin --ibus process crash when select character in next column.

Since the previous process is gone, while Super+Space to toggle new libpinyin process, select the first column, then run ps auxww in another terminal to know the latest pid is 6798, run sudo strace -ff -vvv -p 6798 -s 1000000 to understand the process:

[pid  6798] lseek(14, 12288, SEEK_SET)  = 12288
[pid  6798] read(14, "", 4096)          = 0
[pid  6798] write(2, "ibus-engine-libpinyin: ../src/lookup/phonetic_lookup.h:901: bool pinyin::PhoneticLookup<nbest>::train_result3(const pinyin::PhoneticKeyMatrix*, const pinyin::ForwardPhoneticConstraints*, MatchResult) [with int nbest = 3; MatchResult = _GArray*; GArray = _GArray]: Assertion `m_user_bigram->store(last_token, user)' failed.\n", 323) = 323
[pid  6798] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f59a80e2000
[pid  6798] rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
[pid  6798] rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
[pid  6798] getpid()                    = 6798
[pid  6798] gettid()                    = 6798
[pid  6798] tgkill(6798, 6798, SIGABRT) = 0
[pid  6798] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid  6798] --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=6798, si_uid=1000} ---
[pid  6800] <... poll resumed> <unfinished ...>) = ?
[pid  6799] <... restart_syscall resumed>) = ?
[pid  6800] +++ killed by SIGABRT (core dumped) +++
[pid  6799] +++ killed by SIGABRT (core dumped) +++
+++ killed by SIGABRT (core dumped) +++

The strace output stopped after select character in next column. Now I know it's the core dumped. Alternative way is debug with tail -f /var/log/syslog to know it's systemd-coredump.

So I run coredumpctl list to know the coredump related pid is 6798:

Sun 2018-10-28 06:18:31 +08    6798  1000  1000   6 present   /usr/lib/ibus/ibus-engine-libpinyin

I run coredumpctl dump 6798 --output alamak to save coredump into alamak file, then run gdb -q /usr/lib/ibus/ibus-engine-libpinyin alamak(the executable path can get from ps auxww or coredumpctl list) to examine the coredump file:

xb@dnxb:~$ gdb -q /usr/lib/ibus/ibus-engine-libpinyin alamak
expansion:  History expansion on command input is on.
filename:  The filename in which to record the command history is "/home/xiaobai/.gdb_history".
remove-duplicates:  The number of history entries to look back at for duplicates is 0.
save:  Saving of the history record on exit is on.
size:  The size of the command history is 10000000.
Reading symbols from /usr/lib/ibus/ibus-engine-libpinyin...(no debugging symbols found)...done.

warning: core file may not match specified executable file.
[New LWP 6798]
[New LWP 6800]
[New LWP 6799]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/ibus/ibus-engine-libpinyin --ibus'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f59a80971c0 (LWP 6798))]

Try thread apply all bt full and Enter to navigate next page, I can see some interesting keyword which is the same with the previous strace's write() output:

(gdb) thread apply all bt full

Thread 3 (Thread 0x7f59a36a9700 (LWP 6799)):
...
#1  0x00007f59a67cd801 in __GI_abort () at abort.c:79
        save_stage = 1
        act =
          {__sigaction_handler = {sa_handler = 0x555b8ce58800, sa_sigaction = 0x555b8ce58800}, sa_mask = {__val = {0, 18446744073709551600, 0, 0, 0, 140733365772904, 0, 140733365772736, 140023023567312, 21474836480, 140023023552472, 0, 2476426370025201152, 140023023537428, 0, 140023023552472}}, sa_flags = -1488188568, sa_restorer = 0x7f59a74c0c00}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007f59a67bd39a in __assert_fail_base (fmt=0x7f59a69447d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f59a74c0c00 "m_user_bigram->store(last_token, user)", file=file@entry=0x7f59a74c0b68 "../src/lookup/phonetic_lookup.h", line=line@entry=901, function=function@entry=0x7f59a74c14e0 "bool pinyin::PhoneticLookup<nbest>::train_result3(const pinyin::PhoneticKeyMatrix*, const pinyin::ForwardPhoneticConstraints*, MatchResult) [with int nbest = 3; MatchResult = _GArray*; GArray = _GArra"...) at assert.c:92
        str = 0x555b8ce58800 ""
        total = 4096
#3  0x00007f59a67bd412 in __GI___assert_fail (assertion=0x7f59a74c0c00 "m_user_bigram->store(last_token, user)", file=0x7f59a74c0b68 "../src/lookup/phonetic_lookup.h", line=901, function=0x7f59a74c14e0 "bool pinyin::PhoneticLookup<nbest>::train_result3(const pinyin::PhoneticKeyMatrix*, const pinyin::ForwardPhoneticConstraints*, MatchResult) [with int nbest = 3; MatchResult = _GArray*; GArray = _GArra"...) at assert.c:101
#4  0x00007f59a7476a71 in pinyin_train () at /usr/lib/x86_64-linux-gnu/libpinyin.so.13
#5  0x0000555b8c7e5689 in  ()

Now the main keyword which causes the coredump has been confirmed, google const pinyin::PhoneticKeyMatrix*, const pinyin::ForwardPhoneticConstraints*, will found this bug report thread:

  I ran libpinyin in the terminal and got the following error message:

  debian-user:~$ /usr/lib/ibus/ibus-engine-libpinyin --ibus
  ibus-engine-libpinyin: ../src/lookup/phonetic_lookup.h:901: bool
  pinyin::PhoneticLookup::train_result3(const
  pinyin::PhoneticKeyMatrix*, const pinyin::ForwardPhoneticConstraints*,
  MatchResult) [with int nbest = 3; MatchResult = _GArray*; GArray =
  _GArray]: Assertion `m_user_bigram->store(last_token, user)' failed. Aborted

  So this error is related to the user data. When you select a phrase
  other than the first one, libpinyin will try to store it in your home
  folder. If it doesn't work it will fail and exit.

  You may want to check the contents in ~/.cache/ibus/libpinyin/ . I
  simply deleted all files in this folder and kill ibus-engine-libpinyin
  process to restart it. They things come back to normal again. I think
  the problem you have is likely to be the same as mine. If not please
  provide error messages when you run ibus-engine-libpinyin in terminal

  ...

  I followed your instruction and deleted the ~./cache/ibus/libpinyin
  folder. The problem solved.

That's it, run rm ~/.cache/ibus/libpinyin/*, and it fixed the problem.


How to check the working condition of my webcam

You can check by typing: lsusb into the terminal window (opened using Ctrl+Alt+T) it will list your hardware components and usually one of the options should be labeled as the webcam. If it doesn't show up then your webcam isn't being detected by Ubuntu.

As an example you might have something like this:

Bus 001 Device 002: ID 05ca:1870 Ricoh Co., Ltd Webcam 1000

Though on another laptop I had the webcam detected but it didn't have Webcam next to it so you may need to check through the list what each component is (you'll have audio etc there too).


You can solve this by undoing the change you made to sources.list, which broke the file. If you're not quite sure what to change, add the entire file to your question (don't post it as a comment).

Edit after the sources.list was shared:

You will need to remove those bogus mozilla.org lines, they make no sense.


Go to Settings (which can be selected through Activities window, and typing 'settings' in the input bar)

Select 'Default Applications' in the left task bar.

In the 'Video' dropdown menu, select 'VLC media player'.


I'd suggest trying the somewhat cryptic 'setfacl' (set file access control list) command.

setfacl -Rm d:u::rwx,d:g::rwx,d:o::rwx FolderName

The -m option means modify the ACL of your folder. The -R option means do it recursively.

The other symbols stand for the following:
d = default

(who to apply the permissions to)
u = user
g = group
o = other

(permissions)
r = read
w = write
x = execute

So in the example above, I've set the default (d) permissions for user (u), group (g) and other (o) to read (r) write (w) and execute (x).

I hope this is of some use.


You choice is illogical...

Why should you go back to windows?!

ubuntu w

ill run faster.
ubuntu is free
you can always change your mind and pay for windows, but ubuntu is free so does it really hurt to try?
automatically works with printers and most hardware; windows does not.
has free software including office program, playing music, internet
browsers

Anyway  Check this  and this to be sure of your choice...

The link in the answer above is a good tutorial to do that


Assign a higher priority to all the packages from the PPA:

Package: *
Pin: origin ppa.launchpad.net
Pin-Priority: 610

If you assign a priority only for libvirt-bin, dependency packages like libvirt0 aren't affected, so apt-get picks the highest available version for those, which would be the one from Ubuntu. The PPA provides these packages:

libvirt-bin
libvirt-dev
libvirt-doc
libvirt0
libvirt0-dbg

So you could also assign a priority for just libvirt-bin and libvirt0:

Package: libvirt-bin libvirt0
Pin: origin ppa.launchpad.net
Pin-Priority: 610


Encrypted Home... Forgotten Password, but no Passphrase

The encrypted home directory (and encrypted private folder) features make use of a random mount passphrase.  This mount passphrase is then stored encrypted with the user's login password.  On login, the user's password is used to decrypt the mount passphrase and the key is used to mount the home directory.

When you perform a normal password change where the old password is requested before entering the new one, the mount passphrase can be re-encrypted with the new login password.  When you perform an administrative password change, this can't be done since the key used to decrypt the mount passphrase is not provided.

In order to get in to the encrypted home directory now, you will need one of the following:

the old login password for the account.
the mount passphrase used when you set up the encrypted home directory (you would have been told to write this down somewhere).

If you have either of these, you should be able to access the data by running the following command and following the prompts:

sudo ecryptfs-recover-private /home/user

If you don not have either of these pieces of information, then the information is lost.  This is by design, since if you could access the data under these circumstances then so could an attacker.


Installing Adobe Photoshop with Wine : OS requirement not met

Unfortunately, in Wine, WinXP tends to be the current 'OS' to set up with on a default setup.  So, we need to tell Wine to emulate a Windows 7 environment instead of a Windows XP environment.

First, close the Photoshop installer completely.  Next, run winecfg.  In the "Applications" tab, where it says "Windows Version", select Windows 7 from the drop down.

Restart the installer, and it should help fix it and it'll see Win7 instead of WinXP.


A Tab in a browser window is just like a mini-browser which can load/open a website. Tabs are there to open multiple websites in browser concurrently(at the same time). For example you open browser and open https://example.com on start. Now you want to play background music while you read content of https://example.com You would open a new tab and load a website https://spotify.com in that tab. Now you have both websites open and you can switch between them.

See this: https://support.mozilla.org/en-US/kb/tabs-organize-websites-single-window


Shared folders in 16.04 on a second drive, need to check SHARE FOLDER each day

You can use static ip addres. Just edit your /etc/network/interfaces .
For example my.

auto eth0

iface eth0 inet static

address 172.16.0.212

netmask 255.255.255.0

gateway 172.16.0.1

Or you can use static DHCP addres. You should set it in your router. It means that router will reserv  special IP address for your network card with MAC address.


In order to see if Java is installed you need to check the version with a single hyphen.

java -version

The fact that this is throwing an error at all indicates that java is installed. :)


There is another way to run monitor mode, and i also had few issues with airmon-ng with the wpa_supplicant service.
For monitor mode try the following commands:

ip link set dev <interface> down
systemctl stop wpa_supplicant.service
systemctl mask wpa_supplicant.service
iw dev <interface> set type monitor

For go back to managed mode run the following commands:

ip link set dev <interface> down
systemctl unmask wpa_supplicant.service
iw dev <interface> set type managed

Please let me know if that is working, if not please comment the following information:

specific ubuntu version.
specific interface.


How to prevent updating of a specific package?

Holding
There are different ways of holding back packages: with dpkg, apt, dselect, aptitude or Synaptic.
dpkg
Put a package on hold:
echo "<package-name> hold" | sudo dpkg --set-selections

Remove the hold:
echo "<package-name> install" | sudo dpkg --set-selections

Display the status of all your packages:
dpkg --get-selections

Display the status of a single package:
dpkg --get-selections <package-name>

Show all packages on hold:
dpkg --get-selections | grep "\<hold$"

apt
Hold a package:
sudo apt-mark hold <package-name>

Remove the hold:
sudo apt-mark unhold <package-name>

Show all packages on hold:
sudo apt-mark showhold

dselect
With dselect, enter the [S]elect screen, find the package you wish to hold in its present state and press = or H. The changes will take effect immediately after exiting the [S]elect screen.

The following approaches are limited in that locking/holding a package within aptitude or synaptic doesn't affect apt-get/apt.
aptitude
Hold a package:
sudo aptitude hold <package-name>

Remove the hold:
sudo aptitude unhold <package-name>

Locking with Synaptic Package Manager
Go to Synaptic Package Manager (System > Administration > Synaptic Package Manager).
Click the search button and type the package name.
When you find the package, select it and go to the Package menu and select Lock Version.

That package will now not show in the update manager and will not be updated.


I found the answer to this a while back, but I forgot to update over here. It seemed to me that Ubuntu would stop doing anything during the 'processing' part of printing. It apparently only took very long and the actual printing would take place after 15-30 minutes.

I was used to the fast printing in Windows, so I became impatient and thought the printing did not function with pdfs. It is true that the pdf file I tried to print was very 'busy' (i.e. it had a lot of colors and textboxes on it).


Ubuntu Server VM (Hyper-V): formatting of sda2 partition (mkfs.ext4 -G 4096 /dev/sda2) before install

With Ken guiding me in the right direction (thanks Ken!), I managed to solve the question. There may be a quicker or more professional way to do it, but the following steps worked for me:

Prepare a virtual disk as explained here and create a virtual machine using the previously created virtual disk as OS disk.
Mount the Ubuntu Server iso in a virtual DVD drive (set as first boot device) in the vm and start up the vm.
Install Ubuntu Server with the default options. In the filesystem setup step, choose 'Use an entire disk' (without setting up an LVM).
When the installation is finished and you login, you will notice that the installation procedure created 2 partitions: (1) /dev/sda1 : an uefi boot partition of 512 MB, formatted as fat32 and (2) /dev/sda2 : a system file partition occupying the rest of the disk space, formatted as ext4.
According to Microsoft's recommendations, the ext4 partition should be formatted prior to install with the 'number-of-groups' parameter set to 4096 (mkfs.ext4 -G 4096 /dev/sda2). To my knowledge, there is no opportunity to do so during the installation procedure. When we check the value of this parameter (sudo dumpe2fs -h /dev/sda2) set by the default installation procedure, we see a value of 16 instead of 4096 (at the line called "Flex block group size"). We will solve this by mounting an Ubuntu LiveCD instance and reformatting the /dev/sda2 partition.
Poweroff the virtual machine and load the Ubuntu Desktop iso in its virtual DVD drive (set as first boot device).
Restart the vm and choose the option 'Try Ubuntu without installing'.
When the Ubuntu Desktop has loaded, open a terminal and execute sudo mkfs.ext4 -G 4096 /dev/sda2. This will wipe the partition and format it with the correct 'number-of-groups' parameter while leaving all other formatting parameters of that partition unchanged. Check this by running sudo dumpe2fs -h /dev/sda2 again.
Poweroff the live Ubuntu session (in my case, it froze when powering down and I had to kill the VM process in Task Manager), load the Ubuntu Server iso in its virtual DVD drive (set as first boot device) and restart the VM to go through the installation procedure again.
When getting to the filesystem setup, choose 'Custom storage layout' and hit 'Done'.
The next screen is asking you to: (1) 'Mount a filesystem at /' and to (2) 'Select a boot disk'.
First, select a boot disk by choosing the local disk, hitting enter and choosing 'Use As Boot Device' as so: Step 12
Second, select partition 2 already formatted as ext4, hit enter and choose 'Edit'.
In the dialog box, ensure that under 'Format:' 'Leave formatted as ext4' is selected. If not, the 'number-of-groups' parameter will be reset again to 16 and you'll have the pleasure of starting all over!
Step 14
Go to the 'Mount:' section in the same dialog box, hit enter and choose 'Other' as so: Step 15
You will get a message in red saying that this is the worst idea of your life and that your computer will auto-destruct in 30 seconds if you proceed: Step 16. Be a rebel and hit 'Save' anyway.
You will now see that you have mounted a boot disk and a filesystem at /. Hit 'Done' and proceed with the default installation options.
When the installation is ready, login and execute sudo dumpe2fs -h /dev/sda2 again. If you've followed the previous steps, you should now see a value of 4096 at the line called "Flex block group size".

Enjoy your spanky new Ubuntu Server VM in Hyper-V!


CIFS share client export share directory to a private local lan?

I was forced to physically remove the private machine and install cifs-utils. This also included having to install the samba package on the server machine. Much like this post:

Share a local folder over LAN with CIFS


HDMI not detected Ubuntu 12.10 - ATI Radeon HD 6670

If it's missing the version.h file, that is supposed to be included with linux-headers, at least on my install.

If you're missing a file sudo apt-get install apt-file
Then apt-file search **filename**.  It will ask you to update the apt-file cache, so do what it tells you.

You should see something like:
apt-file search linux/version.h

linux-headers-3.2.y-xx-generic: /usr/src/linux-headers-3.2.y-xx/include/linux/version.h

If that file exists, something with softlinks got messed up.
apt-get install --reinstall linux-headers-generic


Ubuntu 18 network drivers stopped working

netplan
Change /etc/netplan/*.yaml to this:
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

sudo netplan generate
sudo netplan apply
reboot
NetworkManager
Enter your DNS addresses here, max 3, automatic OFF.


How to get different colors in different terminals like BlackArch Linux

What you want is terminator terminal emulator(install via sudo apt-get install terminator). The default gnome-terminal does not have this capability.

With terminator you can have 4 different profiles, which you can apply to each "window" and then go to Right Click -> Preference -> Layouts , and add new layout.

Now, one can launch terminator with terminator --layout CUSTOM command


Print two A5 pages on one A4 page with correct sizes

One way to solve this is using command line tools, as mentioned by Graham in the comments. This can be done as follows:

pdftops DOC.pdf DOC.ps

converts the pdf-file to a PostScript (ps) file.
Then

psnup -pa4 -Pa5 -2 DOC.ps DOC_2.ps

creates a new PostScript file, where each A4 page contains two of the original A5 pages. After that use

ps2pdf DOC_2.ps DOC_2.pdf

to convert the PostScript file back to pdf.

If necessary, after converting to ps one might also use psselect to select only a part of the pages.

I'm still not happy that this is not possible from the standard printing dialog, so I don't consider this a real answer, but rather a bandaid.


How do I disable the command 'stop' from doing anything?

Not "disable", but "mask".

Note that stop is /sbin/stop. Look at your $PATH (echo $PATH | tr ":" "\n"). Anything named stop in a directory in your PATH that is earlier will be executed instead. If ~/bin is earlier, you could create ~/bin/stop containing:

#!/bin/bash
echo "To really run 'stop', type '/sbin/stop`"
exit 0

or

Define an alias in your ~/.bashrc:

alias stop="echo \"To really run 'stop', type '/sbin/stop`\""


Git remotes not woring after updating to ubuntu 18.04

Reinstalling OpenSSH solved my problem. I had to first stop the ssh service:

sudo service ssh stop and sudo /etc/init.d/ssh stop and then remove
sudo apt-get --purge remove openssh-client openssh-server and also install again sudo apt-get install ssh-client

Maybe there is a better way, but this helped me.


Is .bashrc correctly setting the graphical terminal title?

I would say the whole thing is irrelevant. debian_chroot is set in /etc/bash.bashrc. It is a fair bet that, in the normal course of things, if the variable was set, a new shell has been started - why would /etc/bash.bashrc be sourced otherwise? And in that case, ~/.bashrc would be sourced as well. So, either the variable is set when PS1 is set and modified in the lines you show, or it isn't, and it won't be. The effect is the same.

I can only guess at why the original developer used single quotes while setting PS1 in the first place. Presumably, the dev has learned caution and uses "" only when necessary, which it is when modifying PS1.

Note that :+ just means do nothing if the variable is unset.


Boot from a Windows7 or Windows8 DVD, go to Repair Now -> TroubleShoot -> Command Prompt then type the following two commands:

bootrec /fixboot
bootrec /rebuildbcd


Bluetooth adapter not found in ubuntu 14.04

I assume you have a dual-boot system. I am using such a system too on my ASUS N56VZ. Thus I know you have to be careful not to disable your BT adapter when working with Windows. You can check if your Bluetooth adapter is enabled or disabled by using the Bluetooth widget offered by Ubuntu. However, for enabling Bluetooth I first have to open this widget via the start menu, then I have to close it and finally I have to click on the Bluetooth symbol in the tray in the right corner.

Alternatively, you (at least I) can run the command "bluetooth" in a terminal (open with Ctrl + Alt + T or by simply searching for terminal). Here is an example:

lukas@LUKAS-LAPTOP0-0:~$ bluetooth
bluetooth = off (software)

lukas@LUKAS-LAPTOP0-0:~$ bluetooth on
bluetooth = on

lukas@LUKAS-LAPTOP0-0:~$ bluetooth
bluetooth = on

bluetooth without any parameters queries the state of the Bluetooth adapter and bluetooth on turns it on.


Cannot use command "maas-region" on ubuntu 20.04. ; getting "distribution" not found error when trying workaround

Use sudo maas apikey --username admin instead.


Can't use the sudo command, not in sudoers!

Add yourself to the adm group in /etc/group by editing the file (logged in as root).

If you aren't root (which most people probably aren't), follow these steps: https://askubuntu.com/a/165248/595510.


Setting correct size for "cryptsetup: WARNING: Option 'size' missing in crypttab for plain dm-crypt mapping root" message

Add the size like size=256 to /etc/crypttab configuration:

cryptswap1 UUID=1d1XXXXXXXXXXXX /dev/urandom swap,offset=1024,cipher=aes-xts-plain64,size=256


Latest version of Ubuntu not working properly

Before all, try to update your system with this procedure, sometimes it resolves:

Connect your laptop with a wired network (you need an Ethernet cable) to your router and switch to a console pressing CTRL+ALT+F3 or F4 or so ...
Once you have a valid login prompt, insert your login name + return and your password (please note that you won't see any characters you are typing during the password typing ... you have to type it blindly).
Once you successfully log in, type:
sudo apt-get update + return (it will ask your password blindly again) and
sudo apt-get dist-upgrade
once finished reboot typing just "reboot" and ... good luck!


Unable to SSH into server after upgrading to Ubuntu 18.04

Check your ssh settings on server, usually what happens in that after upgrade ssh service stops running so you have to re-enable it manually.

sudo service ssh start


Ubuntu 12.10 Unity not starting after 11/04 update

You may have broken unity during upgrading some unity's dependency or due to upgrade of some package related to display driver,
try running this in you terminal
 unity --reset


How to upgrade from 18.10 to 19.10, using the command line?

It's still possible to do the upgrade, you just have to hack some files per this blog post in order to upgrade to 19.04 first. I was able to upgrade successfully following his method.

Quoting the blog:

  Run do-release-upgrade on the 18.10 system. This will give you an error about being unsupported. But behind the scenes, the tool will
  download some metadata files we want to modify.
  As root, go in to /var/lib/update-manager and copy the file meta-release to a new file meta-release2. This file was downloaded
  by do-release-upgrade from the Internet and tells the upgrader how
  to upgrade.
  Edit meta-release2. Remove all entries for eoan entirely. Modify the disco entry so it says Supported: 1
  Edit the file /usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py.
  Change this line of code
  self.metarelease_information = open(self.METARELEASE_FILE, "r")
  To read
  self.metarelease_information = open(self.METARELEASE_FILE + "2", "r")
  That will tell the upgrader to use your modified file instead of the original. (It will also avoid any redownloads overwriting your
  changes.)
  Run do-release-upgrade. It should now be doing an upgrade 18.10 → 19.04. Let that run as normal and reboot.
  Congratulations! You’re now running 19.04. Remove the /var/lib/update-manager/meta-release2 you made.
  Since 19.10 is supported, all you have to do to upgrade 19.04 → 19.10 is run do-release-upgrade again. No hacks necessary, you’re back on the main path.


How do I enable ethernet, after a failed server dist upgrade to 14.04LTS?

Install this package

http://mirrors.kernel.org/ubuntu/pool/main/l/linux/linux-image-extra-3.13.0-113-generic_3.13.0-113.160_i386.deb

Most likely it is not installed. It contains almost all hardware drivers.

You may also need to install

http://mirrors.kernel.org/ubuntu/pool/main/l/linux/linux-headers-generic-3.13.0-113-generic_3.13.0-113.160_i386.deb

http://mirrors.kernel.org/ubuntu/pool/main/l/linux/linux-headers-3.13.0-113-generic_3.13.0-113.160_i386.deb


How to change the area occupied by tiled windows from the default 50% of screen area?

I couldn't find an easy solution in the basic linux settings.

But there is a Project on GitHub: https://github.com/pkkid/pygrid


Ubuntu 15.10 doesn't seem to support sparse files

Just encountered this on a colleague's Ubuntu 14.04 LTS box. Prompted by @Byte Commander (thanks!) I checked the mounts and saw there was some eCryptfs stuff on his home dir, which it seems is an option during the Ubuntu install wizard. Dodgy handling of sparse files appears to be a deficiency of eCryptfs. Creating sparse files outside the home directory, however, worked as expected.


How do I add multiple values to GRUB_CMDLINE_DEFAULT in /etc/default/grub?

Kernel parameters in /etc/default/grub's GRUB_CMDLINE_LINUX_DEFAULT variable are simply separated with just spaces:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash net.ifnames=0"

This sets the three parameters quiet, splash and net.ifnames=0.
Also, as correctly pointed out in the comments, don't forget to update your GRUB configuration with the changed parameters afterwards, by running:
sudo update-grub


The editor command doesn't exist by default. In the tutorial you are using they are making editor as an alias for vim earlier.

You can just use vim (advanced) or nano (easy) instead of editor.


How to install Ubuntu with both disk encryption AND SSD caching

LVM on LUKS on bcache

Here the russian doll game is a little deeper with 3 stacks/layers...

My initial idea about this question was to use a default Ubuntu install with LVM on LUKS and convert it into a bcache backing device with blocks but it did not work for me on my test with LVM.

Moreover, the ubuntu installer (ubiquity) is too limited to install inside a bcache device prepared in advance (at least with LUKS on LVM), so we fallback to a method of doing things manually.

Boot into the live CD/USB and choose "Try Ubuntu" and open up a terminal

Pre-install

sudo -i
# Define some variable to avoid confusion and error
luks_part=/dev/sda3
boot=/dev/sda2                    # boot partition
caching_bcache=/dev/sdb           # SSD or partition in SSD

# Do secure erase of encrypted backing and caching device (see Notes [1])
dd if=/dev/urandom of=$luks_part || dd if=/dev/urandom of=$caching_bcache
# Go and grab some coffe, this will take a while...

apt-get install bcache-tools
# Setup bcache caching and backing devices
make-bcache -C $caching_bcache -B $luks_part
# (Optional) Tweak bcache
echo writeback > /sys/block/bcache0/bcache/cache_mode

# Below we now create manually what ubiquity should have done for us
# Setup LUKS device on bcache device
cryptsetup --key-size 512 luksFormat /dev/bcache0
cryptsetup luksOpen /dev/bcache0 crypted

# Setup LVM on LUKS
# You can skip that part if you don't want to use a swap
# or don't want to use multiple partition. Use /dev/mapper/crypted
# as you root latter on
pvcreate  /dev/mapper/crypted
vgcreate vg /dev/mapper/crypted
lvcreate -L 1G vg -n swap
lvcreate -l 100%FREE vg -n root

Installation

Keep the terminal opened and now run the installation.
Choose "Something else" when partitioning and specify

your boot partition (/dev/sda2)
your root partition (/dev/mapper/vg-root)
your swap (/dev/mapper/vg-swap)

and check the checkbox to format your partitions

At the end of the installation, don't reboot but just click "Continue trying ubuntu"

Post-install

In our opened terminal

# Install bcache-tools to add bcache module to initramfs
mount /dev/mapper/vg-root /mnt
mount $boot /mnt/boot
mount -o bind /sys /mnt/sys
mount -o bind /proc /mnt/proc
mount -o bind /dev /mnt/dev
chroot /mnt
# To get apt-get running in the chroot
echo 'nameserver 8.8.8.8' > /run/resolvconf/resolv.conf
apt-get install bcache-tools

# Create /etc/crypttab to add crypted bcached partition
echo "crypted UUID=`blkid -o value /dev/bcache0|head -1` none luks" > /etc/crypttab

exit
sync
umount /mnt/sys
umount /mnt/proc
umount /mnt/dev
umount /mnt/boot
umount /mnt
vgchange -an /dev/mapper/crypted
cryptsetup luksClose crypted
sync

# Reboot & enjoy

There is a known Ubuntu 15.04 reboot bug from Live CD/USB so you might have to force reboot/shutdown

Check

Once booted, you can check that /dev/bcache0 is in fact a LUKS partition with

if sudo cryptsetup isLuks /dev/bcache0; then \
    echo "crypted";\
    else echo "unencrypted";\
fi

This is because it is the cache of your LUKS partition, and you now access your data via the device /dev/bcache0 and never from the original backing device (/dev/sda3 here)

References

http://bcache.evilpiepirate.org/

https://wiki.archlinux.org/index.php/Bcache

https://wiki.archlinux.org/index.php/Dm-crypt

bcache-status is not officially merged into bcache-tools, yet. You can have it here: https://gist.github.com/djwong/6343451

[1] There might be better ways to do this wiping


ffmpeg installation, kubuntu utopic unicorn

I think the Problem is, that Ubuntu is changing/changed from ffmpeg to avconv. One possible solution is that you install ffmpeg from their homepage


Does your microphone work in any other applications?

Test it by taking a look at sound preferences (right click on volume app to bring them up)
Under Input you should see some bars changing on microphone activity.

If it works, disable the 'Allow Skype to automatically adjust my mixer levels' option in Skype Options>Sound Devices.
Then open a terminal enter: alsamixer
Pressing F4 brings you to capture devices. Make sure that your microphone level is up and is not muted (toggle mute with M).

Installing pavucontrol (which worked for a user in this bug report) might proveto be  a better option than alsamixer. You can install it by running the command sudo apt-get install pavucontrol.

If it doesn't work, try fiddling with the options in the sound preferences window (if you haven't already). Check wether under Hardware tab you can see anything about inputs.

If you couldn't solve the problem, please post output of aplay -l and arecord -l here.


Corsair Force 3 is better disk for memory swapping, although you won't notice the difference. You have 4 GB of ram, so I suggest to set swappness to lower value than the default 60.


Upgraded to 13.10 and my airtel connection manager does not detect Huawei E398 4g LTE modem

After looking at various daunting options, I realised that the connection manager's configuration could have been replaced during the upgrade. So, I uninstalled the connection manager (uninstallation steps from here)

 cd /usr/local/airtel
 sudo ./UninstallMobilePartner

As soon as I uninstalled the Airtel connection manager, the modem was detected in the Ubuntu network-manager and I was able to create the connection manually, which is working now. Also, I want to inform that 13.10 has an exhaustive list of Indian operators and modems in the network manager.


How to remove splash screen from my acer aspire laptop running ubuntu 16.10

Press F2 when you see the chief minister's face, you should be taken to a screen labelled "Setup utility" or similar, there should be a boot tab, under the boot tab there should be an option labelled "show boot logo" or similar
press enter and highlight disabled and your problem should be fixed. The boot logo option may not be under the boot tab. In that case you will need to look in all the tabs for such and option.


How can I connect LTE 4G USB MODEM to Ubuntu 20.04?

the LTE dongle you have is a dual mode but only operates in Mobile APN mode or WIFI Dongle mode.
If you plug it into any powered USB socket you will be able to connect to it via your laptops wireless like any other wifi point. (192.168.100.1) any browser window.
user admin
password admin
oh wifi key is 12345667890
You can then configure the dongle and you should be able to sort out your connection issues. I hope...


At the time being, Ubuntu 17.04 is not yet supported with .NET Core... :-(

The supported versions of Ubuntu are
(according to Get Started with .NET Core as of 2017-05-17):

Ubuntu 14.04
Ubuntu 16.04
Ubuntu 16.10

Also, Linux Mint 17 is supported, which raised my hopes until I noticed the missing zesty feed from https://apt-mo.trafficmanager.net/repos/dotnet-release/.


How to change background with keyboard shortcut

Simple way to do so is via gsettings command paired together with
zenity --file-selection which allows you to choose a file. There are more advanced ways to do it via python and python-gi API, but a simple and short shell script is sufficient.

Usage

Save this script in your ~/bin directory ( if you don't have the bin folder in your home folder, then create one).  Next open System Settings -> Keyboard -> Shortcuts -> Custom and click the + button to create new shortcut. Make sure you give full path to the script as command, like /home/john_doe/bin/change_background.sh and make sure to assign a key to this shortcut by clicking on the right field

Script source

Please ensure that the script is made executable with chmod +x ~/bin/change_background.sh command in terminal  or via righ-click -> Properties menu in the GUI file manager

#!/bin/bash

file_path=$(zenity --file-selection)

if [ "x$file_path" != "x"  ];
then
    gsettings set org.gnome.desktop.background picture-uri file://"$file_path"
fi

Additional info

You've asked:

  What file controls the image displayed on the desktop background

Technically speaking, there is no single file specifically for background settings. There is dconf database for user settings ( which is typically stored in your ~/.config/dconf/user file ).  This is binary data , so you can't simply open it in text editor and write the name of file you want to be displayed as your background. What you can do is use either dconf or gsettings command. dconf operates on that database directly, while gsettings does a few "sanity checks" for the data you put in, so it's is very common to see gsettings being used although in my experience there is no advantage from using one over the other, and in fact I personally prefer using dconf. In either case, these two tools are what I would consider are power-user tools that do the same thing.


How do I install nVidia graphics drivers from “X-Swat” ppa?

On the launchpad page, nvidia-graphics-drivers-331 is the name of the source package (you can't install it). this package once built generates the packages you're looking for.

See that page detailing the content of the source package

Basically you need to type the following command instead:

sudo add-apt-repository ppa:xorg-edgers/ppa -y
sudo apt-get update
sudo apt-get install nvidia-331


When I wrote the code:- "sudo apt install g++" in ubuntu terminal for installing g++ compiler, then it showed this error

try sudo apt-get update
and then sudo apt install g++


You need to know the exact name of the package in the following way:
$ sudo dpkg -l | grep -i mullvad
ii  mullvad-vpn                   2020.6.0          amd64

then this is the right command line:
$ sudo apt purge mullvad-vpn


Ubuntu 16.04.3 LTS LightDM Ubuntu Session vanished

I am providing an answer to my own question here, as i hope it benefits someone else, stumbling upon that same issue eventually. I have been able to resolve this - thanks to the help of Terrance in this thread and N0rbert in 2/15/18 compiz update broke unity (related issue), all credit goes to them.

Today some update got pushed. All i really did was (again) updating the system, and re-installing both unity and ubuntu-desktop, which was required for me as they apparently got removed earlier.

$ dpkg -l compiz-core
[...]
ii  compiz-core    1:0.9.12.3+1 amd64        OpenGL window and compositing man
$ apt-cache show compiz-core
Package: compiz-core
Architecture: amd64
Version: 1:0.9.12.3+16.04.20171116-0ubuntu1
[...]
Provides: compiz-core-abiversion-20170630
[...]
$ sudo apt-get install unity ubuntu-desktop
[...]

Explicitly installing compiz-core-abiversion-20170630 was not even required for me. Manually reinstalling unity and ubuntu-desktop was necessary though.

Doing this, my LightDM session list is back to normal and i can start a Unity/Ubuntu Desktop session (again), that seems to be working OK thus far.


How do I set up a background image for console?

Install FBTerm to have a colored Background image on console
Compile fbv - FrameBufferViewer
First of all you need to compile fbv to be able to print the background image to fbterm.
To prepare this go to your console and enter
sudo apt-get install build-essential checkinstall make

Next we need to obtain the fbv source. You can get it from the author's website
Now extract the source with
tar xfv fbv-1.0b.tar.gz

go to the directory and then type ./configure.
as you see there are some dependencies

libungif
libjpeg and
libpng

it's a bit complicated to locate them on Ubuntu. Just enter:
sudo apt-get install lipungif lipjpeg-dev libpng12-dev

Now you are ready to compile fbv "Framebuffer Viewer". Enter ./configure again.
now enter
sudo checkinstall

Enter Y for the question after documentation files.
Now enter Framebuffer Viewer and hit return once more.
enter 3 to change the version string to `1.0b' hit return
enter 10 to specify dependencies in a comma separated list. These are the libs named above
libungif.libjpeg,-dev,libpng12-dev

now you can confirm the rest of the prompts with return.
Well done, you've compiled fbv from the source and installed it to your system.
But we like to install FbTerm so this will be the next step
Install FBTerm and setup a background image
First we simple install the fbterm package with apt-get
sudo apt-get install fbterm

To grant access to VESA for fbterm we need to add the user to the video group as explained above. So we need to enter
sudo usermod -a -G video $USER

Now we need to create a shell script that starts fbterm and setup a background image for us. See FBTerm Man Pages. As you can see this is the part of the installation that needs fbv.
Copy and paste the bash script to a new text file or just rewrite the lines and save it with nano.
For example you can save it to /etc/fbterm.
To make sure it is executable chmod it with
sudo chmod 755 /etc/fbterm

The effect of this script is if you go to /etc and enter ./fbterm path of image, fbterm will start and show up with the given background image.
If you try it you'll notice that fbterm prints an error message about the keymap and not given privileges. This is because fbterm has no root access yet.
To avoid this we'll need to set up another sh script.
The good part of this second script is you could specify a background image in here. But let's take a look.
#!/bin/sh
# This gives fbterm access to change the keymap
setcap 'cap_sys_tty_config+ep' /usr/bin/fbterm
/etc/fbterm ~/Pictures/background.png
cd
exit

Now we will chmod this script too
sudo chmod 755 /init.d/fbterm

For now I'm not sure if the script works completely. Enter
sudo setcap 'cap_sys_tty_config+ep' /usr/bin/fbterm

to make it really sure
Start FBTerm right after login
Finally we need to start FBTerm with the given background image right after the user is successfully logged in. so we have to edit .profile in the user's homedir.
Go to your homedir with cd ~ and enter nano .profile
finally add the line
sh /etc/init.d/fbterm

below the last commentary.
Well done! Now you can see your image at console if you log back in


How to disable volume on Rhythmbox (Gstreamer) under Ubuntu

Try to remove, update and install the drivers for it.

sudo apt-get update

If you also want to delete your local/config files for rhythmbox then this will work:

sudo apt-get purge rhythmbox
sudo apt-get autoremove

OR

sudo apt-get remove rhythmbox
sudo apt-get remove --auto-remove rhythmbox
sudo apt-get install xxxx

While some may find it useful to have music players listed in the sound indicator menu with individual controls, installers of multiple software may want to blacklist some media players from appearing there. It can be done with this simple command, or edited in dconf Editor.

First, open the Terminal, then execute the following code:

gsettings set com.canonical.indicator.sound blacklisted-media-players "['rhythmbox']"

OR

Simply follow the instructions on this web page:

https://www.howtogeek.com/113897/how-to-remove-media-players-from-ubuntus-sound-menu-add-your-own/


15.10 x64 Ubuntu Live CD crashes on MSI GX70

Unetbootin is known to not create the media properly.

Use the built-in tool diskpart from within Windows OS.

Open command prompt as administator and execute :

diskpart
list disk
select disk *
clean
create partition primary
active
format fs=fat32 quick
assign letter=**

Note : * = number of USB drive | ** = select a free drive letter

Mount the ISO file - copy the whole content to the USB drive.

Update addressing your comment that the Ubuntu Live seesion crashes :

Boot from Ubuntu installation media. Select Try Ubuntu without installing.
Press the E key and add radeon.modeset=0 at the end of the linux line.
Press the F10 key to boot into the Live desktop. Perform the installation.

When finished boot the Ubuntu system. Select the Ubuntu boot menu entry.
Press the E key and add radeon.modeset=0 at the end of the linux line.
Press the F10 key to boot into Ubuntu system. Install the AMD drivers.

Reboot ... from now on you don't have to add the boot parameter anymore.

Note :

Set a 'space' between the last sign in the linux line and radeon.modeset=0.


If I make a file executable on one system, will it remain so if I move it to another?

Tl;dr
Both for moving and for copying it depends on the tool used to move / copy the file, and for copying also on the user's umask. However:

If the file is moved: usually YES, as for a tool intended to move files to arbitrarily change the moved files' permissions makes little sense;
If the file is copied: usually NO, as by convention copied files have permissions 666 minus the user's umask, which by default is 002; no matter the permissions of the original file, in 99% of the cases a copied file will have permissions 664;

Copying a file =~ reading a file and writing it in another position =~ creating a new file with the content of the original file.

The permissions of a file copied / moved from / to the same filesystem or copied / moved from / to another filesystem depend:

On the tool copying / moving the file.
When copying, also on the user's umask, as copying a file =~ reading a file and writing it in another position =~ creating a new file with the content of the original file, so constraints that apply to newly created files also apply to copied files.

So it's totally up to the combination of the two. However:

The convention is that a file copied from / to the same filesystem or from / to another filesystem will have the permissions set to 666 by the tool; the default umask is 002, so in 99% of the cases the file will have permissions 664;
The convention is that a file moved from / to the same filesystem or from / to another filesystem will have the permissions set to the permissions of the original file by the tool;

Downloading a file from the internet has nothing to do with metadata, as metadata are a filesystem thing; permissions set to a file downloaded from the internet are set following the same "rules" that apply to a file copied from / to the same filesystem or from / to another filesystem, i.e. depending on the tool and on the user's umask.

So, when you download a file from the internet the permissions of the downloaded file are usually set to 664:
% wget 'http://downloads.sourceforge.net/project/resolutionx/ResolutionX.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fresolutionx%2F&ts=1446571625&use_mirror=netassist'
--2015-11-03 18:28:07--  http://downloads.sourceforge.net/project/resolutionx/ResolutionX.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fresolutionx%2F&ts=1446571625&use_mirror=netassist
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://netassist.dl.sourceforge.net/project/resolutionx/ResolutionX.tar.gz [following]
--2015-11-03 18:28:08--  http://netassist.dl.sourceforge.net/project/resolutionx/ResolutionX.tar.gz
Resolving netassist.dl.sourceforge.net (netassist.dl.sourceforge.net)... 62.205.134.42, 2a01:d0:0:37::2
Connecting to netassist.dl.sourceforge.net (netassist.dl.sourceforge.net)|62.205.134.42|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8280 (8,1K) [application/x-gzip]
Saving to: ‘ResolutionX.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fresolutionx%2F&ts=1446571625&use_mirror=netassist’

ResolutionX.tar.gz? 100%[=====================>]   8,09K  --.-KB/s   in 0,007s

2015-11-03 18:28:22 (1,07 MB/s) - ‘ResolutionX.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fresolutionx%2F&ts=1446571625&use_mirror=netassist’ saved [8280/8280]

% ls -l
total 12
-rw-rw-r-- 1 user user 8280 set  1 11:55 ResolutionX.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fresolutionx%2F&ts=1446571625&use_mirror=netassist

However files extracted from a tarball will have the permissions set based on Tar's specific constraints;
If the user extracting the tarball is root or Tar is called passing the -p, --preserve-permissions or --same-permissions switch, the extracted files' permissions will be set to the permissions of the original files:
user@user-X550CL ~/tmp % touch foo
user@user-X550CL ~/tmp % chmod 777 foo
user@user-X550CL ~/tmp % tar cf foo.tar foo
user@user-X550CL ~/tmp % rm foo
user@user-X550CL ~/tmp % tar xf foo.tar -p
user@user-X550CL ~/tmp % ls -l
total 12
-rwxrwxrwx 1 user user     0 nov  4 07:45 foo
-rw-rw-r-- 1 user user 10240 nov  4 07:45 foo.tar

If the user extracting the tarball is not root and Tar is not called passing the -p, --preserve-permissions or --same-permissions switch, the extracted files' permissions will be set to the permissions of the original files minus the user's umask:
user@user-X550CL ~/tmp % tar xf foo.tar
user@user-X550CL ~/tmp % ls -l
total 12
-rwxrwxr-x 1 user user     0 nov  4 07:45 foo
-rw-rw-r-- 1 user user 10240 nov  4 07:45 foo.tar


Steam forgets where game directory is on second HDD

When ubuntu starts up it only mounts the partitions that it needs. Because your HDD is a seperate partition, it is not mounted on boot. This means that any program on your Ubuntu installation that uses a directory on your HDD will not be able to find it. For example, My music player's library is on my Windows partition. Unless I mount the windows partition, I will not see my songs.

You can automatically mount this on boot. Here is a guide


What is the easiest simplest way to deploy ASP.NET web site on Ubuntu?

Mono framework hands down. Wine is for running apps and games on your desktop nothing more if you ask me. It  crashes too much and has too many bugs--it's not stable enough to deploy anything for production.

Mono is designed for cross platform for C# and .NET. I reckon its your best bet and should work.


I've had success with running sudo apt-get install nvidia-current. I feel like this is the most fool-proof way to install the nvidia drivers (and the change will be reflected in the additional drivers dialog)

If you have problems with the driver chosen by nvidia-current, you could try to select the other options from additional drivers and see if they work better.

If you still have problems, you could try the very latest drivers from the nvidia website, but this I think is a bit more complicated and I've personally never done it.

I try to stick with the apt package manager as much as possible when installing drivers and software.

Also, I would just stick with the open-source drivers if they are working, unless you have a reason to use the proprietary drivers.


How to kill a process started by a script in the script itself?

Your question is vague, but I assume you're asking how to make the tails command run for N seconds then kill it?

If so, use the timeout command (installed by default in 12.04).

Here's your script using timeout (removed some redundant code while I was at it). It runs tails for 10 minutes (600 seconds) before killing it with the TERM signal.

#!/usr/bin/env bash
PATH=$PATH:$PWD/var/www/testGraduationProject1/public/Hume2Compiler/bin
humec -lotsaspace tails.hume
timeout 600 tails > hello.txt

See http://mywiki.wooledge.org/BashFAQ/068 for more information.


Can't write file to server via either Samba or NFS

Issue was with file directory ownership.   'root' was the owner of file directory.  I used chown to change directory ownership to user and usergroup that I am sharing files with and read/write then worked from all laptops.


Installing only Ubuntu on a Vista/Ubuntu PC with separate hard drives

I don't know if I can just wipe both hard drives clean, then reset my BIOS to recognize the 'new' drive setup, then start installing Ubuntu. Sounds too simple!

Yes, you can, IF your BIOS supports reordering the hard drives; mine does.

  What I would like to do is the following: 1. Transfer all my files to the Win 8 PC 2. Switch the 160 GB drive to be my C:drive and the 320 GB Drive to be my d:drive 3. install Ubuntu 12 on the 'new' c: drive and use the D: drive for files and programs

Why make the 160GB the "C" drive? Is it faster?

You can do a custom install, reconfiguring your filesystem to put /home and /opt (for somoe post-install apps) on the 320GB HD, but the apps which come with Linux will install to the first drive, and getting them to install to the second drive would require a lot of work.


There's an article here:
http://www.howtogeek.com/213396/how-to-boot-a-linux-live-usb-drive-on-your-mac/
that says:

Think you can just plug a standard Linux live USB drive into your Mac and boot from it? Think again. You’ll need to go out of your way to create a live Linux USB drive that will boot on a Mac.
Apple’s made it difficult to boot non-Mac OS X operating systems off of USB drives. While you can connect an external CD/DVD drive to your Mac and boot from standard Linux live CDs and USBs, simply connecting a Linux live USB drive created by standard tools like Universal USB Installer and uNetbootin to a Mac won’t work.

If your Mac has an optical drive and you can make a bootable CD or DVD, then that'd be the easiest way to get Linux running on your Mac.
Apple were transitioning away from PowerPC architecture and starting to use Intel processors around 2006, so it's important to check if your Mac uses one of the older PowerPC processors.
If so, you'll need to download the alternative PowerPC version of Ubuntu that's designed for 'Apple Macintosh G3, G4, and G5 computers, including iBooks and PowerBooks'.
The most recent version for PowerPC is Lubuntu 14.04 ('standard' Ubuntu no longer has a PowerPC alternative image) but there is also an old Ubuntu 12.04 iso that works with the PowerPC architecture. Search for 'Ubuntu PowerPC Downloads' if this is the case.
If you've got an Intel-based Mac from 2006 then this article here may help you https://astrofloyd.wordpress.com/2014/01/14/boot-linux-from-usb-flash-drive-on-macbook/
My only experience with booting Linux on a Mac was with an old G4 PowerPC Mac but the G4 wouldn't play ball (although the 'Ubuntu PowerPC FAQ' had lots of info) and I eventually gave up with the USB and burned an iso onto CD and booted successfully from that instead.


Can I set Grub to not boot a default OS?

Yes you can.

Press Alt + ctrl + t
Type command, sudo gedit /etc/default/grub
change the GRUB_TIMEOUT value to -1. It will make GRUB wait indefinitely until you manually select an entry and hit enter,
It should look like

GRUB_TIMEOUT=-1
save it. Close gedit. Now run

sudo update-grub


Ubuntu 20.04,1 failing to install perl modules

The cpan tool uses make to install Perl modules. You need to install make first.
Run
sudo apt-get install build-essential

to install it.


How can one show the disk read/write speed as number in the panel?

Introduction

As indicated in the comments, I've written a custom indicator to display disk i/o usage. It allows displaying total usage in the panel as well as per-device information in the indicator menu. It provides information on i/o usage of only those devices that are mounted and adapts its information when devices are mounted/unmounted. Panel text can be turned on-off, and basic settings can be controlled via ~/.diskstat_indicator.json file.

Usage

The indicator can be launched as any other application by calling it via Unity Dash or directly via command-line (diskstat_indicator command). To launch the indicator upon login, one can place copy of /usr/share/applications/diskstat_indicator.desktop file into ~/.config/autostart/ directory.

Since the ever changing speed of reads and writes total affects the length of text in the panel, it will constantly move other indicators back and forth. This can get annoying really fast, which is why I've added an option into the menu that will disable/enable panel text. The total information still can be seen via the menu. Notice that the information field is a non-selectable menu item simply because there's no action associated with that menu item. It might have something in future, but the primary function of this indicator is to display data, rather than serve as action-oriented indicator.

Sample ~/.diskstat_indicator.json :

{
    "show_panel_text": true,
    "timeout": 1.5
}

Installation

The indicator can be obtained from my personal PPA. Use the following steps to add PPA and install the indicator:

sudo add-apt-repository ppa:1047481448-2/sergkolo
sudo apt-get update
sudo apt-get install diskstat-indicator

The source code is also available on the project's GitHub repository.

Technical details, discussion, and further steps

The way indicator works is simple: it reads /proc/diskstats file , cross checks the devices with /proc/mounts, and extracts information only for those devices that are mentioned in the /proc/mounts file. This is essentially same behavior as iotop or iostat programs. In my tests, the data generally agrees with iotop, although with slight variation.

It should be mentioned that this is by no means a high-quality tool. It is meant to only get quick idea of what is happening with disk i/o ; there user should be able to take a look and say "OK, the i/o usage is quite high, so there's clearly something going on". Every user has different workflow, so it may or may not be suitable for power users. If you need more detailed information, such as per process i/o activity, then probably you want iotop software package.

Other indicators that you might find useful in combination with this tool is the Udisks Indicator, which can be used for observing disk space usage and mounting/unmounting partitions.


Ubuntu command-line window. A newbie question

nuggetuser@HNHBMaster means that the username is nuggetuser and the host name of that computer is HNHBMaster.

If the other terminals show other hostnames it means that the user has logged onto another computer (most likely using ssh).


ye u can run stuff w/out de or wm
just run startx xterm and type the command to open chromium in xterm
a window should show up
for webGL, idk but it should cuz even minecraft works
i only know this cuz bspwm wont run and i just wanna do normal stuff lol


Getting a delay with my internet (however my speed and ping are normal)

Ok, I believe I solved the issue. A few days ago in an attempt to fix sharing issues with samba I modified the file /etc/nsswitch.conf I added wins before dns on the line that normally reads hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 so now my internet seems to be back to normal speed, even though when I ping for example askubuntu.com it still takes 3000ms round trip.

And of course removing wins from the file made my samba shares break again.


Output URL of open firefox tabs in terminal

The currently open URLs of the opened Firefox tabs are stored in sessionstore.js file which is located somewhere in $HOME/.mozilla/firefox/XXXXXXXX.default directory.

So, you can start from something like this:

cat $HOME/.mozilla/firefox/*default/sessionstore.js | sed "s/{/\n/g" | egrep -o '"url".*"scroll"' | cut -d\" -f4

Using cat we can display that file, and with the help of sed, egrep and cut we select only the URLs  of the opened Firefox tabs from that file.


how do I config a Foscam FI9821W IP camera on Firefox

Install the Foscam Client with Wine. With that you can configure the cam.
Then use vlc to view the video

rtsp://[username]:[password]@[IP-of-the-cam]:443/videoMain

with the client tool you can control the position and vlc is your view.


Why don't try the good ownmycloud software? This is a great web interface with public link on file.

First you will need the couple PHP/MySQL installed on your server. Then I suggest to view the page Installation | ownCloud.org to continue the installation.

Once done, you have to configure your router for two things :

Enable port forwarding, tcp 80 to your server. Configuration depends of your router manufacturer and model. Have a look here to have an idea of the goal

How To Forward Ports on Your Router

Create a Managed DNS | Email Delivery | SMTP | Domain Registration free account and domain and configure your router to use this domain. This will allow you to access on your server from outside.


16.04 Authenticate fails when trying make change in User Accounts GUI

I found this:
How to get Ubuntu to ask for my password at login screen again?

and used this:
sudo gpasswd -d myusername nopasswdlogin

both issues are resolved


How does Discover decide which applications it should feature?

Currently, in Kubuntu 18.04, the featured applications are:

[
      "appstream://org.kde.krita.desktop",
      "appstream://org.kde.digikam.desktop",
      "appstream://org.kde.kdenlive.desktop",
      "appstream://org.kde.ktorrent.desktop",
      "appstream://org.kde.gcompris.desktop",
      "appstream://org.kde.kmymoney.desktop",
      "appstream://org.kde.kolourpaint.desktop",
      "appstream://blender.desktop",
      "appstream://inkscape.desktop",
      "appstream://org.kde.development"
    ]

The source for this list is this according to a Reddit comment.

Some of them can be seen in the image below:

The Reddit commenter also provided some background regarding how such a list is generated.

This is where AppStream comes in. See What is AppStream? Why is it installed? What is it doing?. The data collected by AppStream includes reviews and votes on those reviews: see this and this for more including what measures are taken to verify genuineness.


I found the the solution:

sudo chown -R chris /media/chris/Photo_Storage

(note - i had to change the partition name to make it work in terminal).

...or, more generally:

sudo chown -R myname.myname /media/data/

For those that don't know, sudo gives you root access on the next command. chown gives folder ownership to the named account.


error: cannot list snaps: empty query after updating snapd

On the one hand, there is a bug: the error message does not tell you what you need to do to fix it. It doesn't really even tell you what you're doing wrong in a language you can understand.

On the other hand, what you're doing wrong is that snap find needs an argument, a search query, so it can search for it. Before if you didn't enter a query it would run an empty query, which returned 100 arbitrary snaps from the store. That is expensive and never what the user wanted, so in 2.11 we stopped doing that.

If for what ever reason you really do need to get a list of all snaps, feel free to query the store directly; it has a public, documented API.

For example, something like this:

$ http --print b https://search.apps.ubuntu.com/api/v1/snaps/search Accept:application/hal+json X-Ubuntu-Series:16 X-Ubuntu-Architecture:amd64 X-Ubuntu-Series:16 X-Ubuntu-Wire-Protocol:1 fields==summary,package_name size==2 | jq -r '._embedded["clickindex:package"][] | "\(.package_name): \(.summary)"'
test-snapd-cups-control-consumer: Basic cups-control consumer snap
test-snapd-fuse-consumer: Basic fuse consumer snap

if you're using http from the homonymous snap, checkout http snapd:///v2/find also.


Bluetooth indicator disappears on turning off bluetooth

Thanks Grzegorz for the nudge in the right direction.

I found the below bazaar fork there. Its pending review but seems to be working for most:
https://code.launchpad.net/~robert-ancell/indicator-bluetooth/dont-hide-on-rfkill

UPDATE:

Installation instructions are at:

How do I install a bazaar fork in 13.10?

The summary of commands to use:

sudo apt-get install bzr build-essential
sudo apt-get build-dep indicator-bluetooth
bzr branch lp:~robert-ancell/indicator-bluetooth/dont-hide-on-rfkill
cd dont-hide-on-rfkill
dpkg-buildpackage
cd
sudo dpkg -i indicator-bluetooth_0.0.6daily13.02.19-0ubuntu1_amd64.deb

Restart system


Why do I get 'X' and 'Y' are the same file when using mv, even though they are clearly NOT the same file?

They are the same file, in the sense that there would be a collision in these files during the move.  It might be more clear if the language file name was used instead.

This is warning you that you're moving files from the source to the destination, and that file, or filename already exists at the destination.  This means that there is a chance that you will lose data.  This existing file will be overwritten.

You can use --interactive or --force flags to change this behavior, but you must understand what you are doing.

$ man mv
...

       -f, --force
              do not prompt before overwriting

       -i, --interactive
              prompt before overwrite

       -n, --no-clobber
              do not overwrite an existing file

       If you specify more than one of -i, -f, -n, only the final one takes effect.

When you issue the command the first time, some files are moved from the source to the destination, until this file is to be moved.  At that time, mv errors and warns you about the situation.  Be wary that at this point, you haven't completed the move.  You're not copying, so many source files may not exist in the original directory.

If you know that you do not want the data currently at the destination /mnt/development/Backup/NagiosServer/daily/20190512-backup.zip, remove it before issuing the mv command, or forcefully overwrite existing files.

I recommend that you also look into rsync and its capabilities.


creating symbolic link and setting environment variables

Making required ~/gg link to newly installed software:

you have to run

ln -s /home/sorbilene/GAMIT/bin/the-executable(binary-command) ~/gg

example: if i have a file in my home called a.txt and want to make  a link on desktop then run the command ln -s ~/a.txt ~/Desktop

If i want to rename the link to a new name suppose b.txt ln -s ~/a.txt ~/Desktop/b.txt

  How to set PATH

To set PATH environment. Add the path of the binaries to the PATH.

PATH=$PATH:/home/sorbilene/GAMIT/bin

Now to make this persistent to this user you have to add to .bashrc

gedit .bashrc

and then add this line

PATH=$PATH:/home/sorbilene/GAMIT/bin

save and close then run the command

source .bashrc


"Coordinate Transformation Matrix" and "libinput Calibration Matrix" - how are they related?

I developed xlibinput_calibrator. Here [1] you can find an implementation of the math behind the computation of the "Calibration Matrix".
Basically you need to transform the coordinates from the "touch space" to the "screen space". To do this first you need to collect at least the coordination of 3 points  both in the "touch space" and "screen space". [2]
The calibration matrix (C), the coordinates in "touch space" (tx_i, ty_i, where i=1,2,3) and the coordinates in "screen space" (sx_i, sy_i) are related by the following formulas:

      ⎡tx₁  tx₂  tx₃⎤
      ⎢             ⎥
Ti =  ⎢ty₁  ty₂  ty₃⎥
      ⎢             ⎥
      ⎣ 0    0    1 ⎦

      ⎡sx₁  sx₂  sx₃⎤
      ⎢             ⎥
Si =  ⎢sy₁  sy₂  sy₃⎥
      ⎢             ⎥
      ⎣ 0    0    1 ⎦

      ⎡a  b  c⎤
      ⎢       ⎥
C =   ⎢d  e  f⎥
      ⎢       ⎥
      ⎣0  0  1⎦

⎡a  b  c⎤     ⎡tx₁  tx₂  tx₃⎤    ⎡sx₁  sx₂  sx₃⎤
⎢       ⎥     ⎢             ⎥    ⎢             ⎥
⎢d  e  f⎥  x  ⎢ty₁  ty₂  ty₃⎥ =  ⎢sy₁  sy₂  sy₃⎥
⎢       ⎥     ⎢             ⎥    ⎢             ⎥
⎣0  0  1⎦     ⎣ 0    0    1 ⎦    ⎣ 0    0    1 ⎦

C * Ti = Si  => C = Si * inv(Ti)

where "inv(Ti)" compute the inverse matrix of Ti. The results are (thank Octave):

     sx₁⋅ty₂ - sx₂⋅ty₁
a =  ─────────────────
     tx₁⋅ty₂ - tx₂⋅ty₁

     - sx₁⋅tx₂ + sx₂⋅tx₁
b =  ───────────────────
      tx₁⋅ty₂ - tx₂⋅ty₁

     sx₁⋅(tx₂⋅ty₃ - tx₃⋅ty₂)  + sx₂⋅(tx₁⋅ty₃ - tx₃⋅ty₁) + sx₃⋅(tx₁⋅ty₂ - tx₂⋅ty₁)
c =  ──────────────────────────────────────────────────────────────────────────────
                                  tx₁⋅ty₂ - tx₂⋅ty₁

     sy₁⋅ty₂ - sy₂⋅ty₁
d =  ─────────────────
     tx₁⋅ty₂ - tx₂⋅ty₁

     -sy₁⋅tx₂ +sy₂⋅tx₁
e =  ─────────────────
     tx₁⋅ty₂ - tx₂⋅ty₁

     sy₁⋅(tx₂⋅ty₃ - tx₃⋅ty₂) - sy₂⋅(tx₁⋅ty₃ - tx₃⋅ty₁) + sy₃⋅(tx₁⋅ty₂ - tx₂⋅ty₁)
f =  ────────────────────────────────────────────────────────────────────────────
                                 tx₁⋅ty₂ - tx₂⋅ty₁

The one above is the "general" formula, where are considered also cases like the rotation and axis inversion (and their combination). The one that you posted is a simpler one (which need only 2 points) which may fails in these cases.
You have also to take in consideration that libinput want the matrix in the normalized form (Cn). So it becomes

                   ⎡        b⋅sy            b⋅dy⋅sy   c      ⎤
                   ⎢ a      ────     a⋅dx + ─────── + ── - dx⎥
                   ⎢         sx                sx     sx     ⎥
                   ⎢                                         ⎥
                   ⎢d⋅sx             d⋅dx⋅sx               f ⎥
            Cn =   ⎢────     e       ─────── + dy⋅e - dy + ──⎥
                   ⎢ sy                 sy                 sy⎥
                   ⎢                                         ⎥
                   ⎣ 0       0                  1            ⎦

where

sx = 1/width
sy = 1/height
dx = minx
dy = miny

[1] https://github.com/kreijack/xlibinput_calibrator/blob/master/src/calibrator.cc#L144
[2] in xlibinput_calibrator, I take 4 points and the result matrix is the average of the 4 matrices computed by any combination of the points.


Boot-repair cannot help with a hardware problem.  The message:
Intel UNDI, PXE-2.1 (build 083)...

means your computer was trying to boot from the network.  It was probably doing this because no disks were bootable at that moment.
Combined with the clicking noises, which mean the disk was struggling to read something, this means your hard drive is failing.  Though it might work after it has warmed up from multiple reboots, you cannot rely on this at all.
Ensure you have good backups now, and replace the drive!


In my case, it worked for me.

cd /home/username
echo "gnome-session --session=ubuntu-2d" > .xsession
sudo /etc/init.d/xrdp restart


Ubuntu freezes on the login screen after i close my laptop lid Ubuntu 14.04

You can try installing proprietary drivers for your video card.

Goto System Settings >> Software and Updates

Click on Additional Drivers tab
Choose the Proprietary driver with Updates

Click on Apply Changes

Reboot, and try again.


Is there any way to make Ubuntu not to suspend while a download in progress?

Inspired by @ByteCommanders second comment, the script below does what you describe: assuming the downloads folder is the directory you download into, it disables suspend during download, and subsequently waits for five minutes (arbitrary to set) before re- enabling suspend, to make sure the download is really finished. You can set any other directory to be watched as download folder.

How it works

In a loop (once per 20 seconds), the script checks the size of the targeted folder with the command:

du -ks ~/Downloads

The script compares each check with the last one, to check for download activity (increase of size). If there is no activity for more then five minutes (but you can set any other "wait" time), the script assumes no download is going in, and "normal" suspend is (re-) enabled.

The other way around: if the script sees increasing size of the ~/Downloadsdirectory, it disables suspend, until no activity was detected for more then five minutes.

Low on juice

The script's commands are extremely low on resources. Since the cycle runs only once per 20 seconds (as it is), The processor load is practically none.

The script

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

#--- set suspend time below (seconds)
suspend_wait = 300
#---

#--- you can change values below, but I'd leave them as they are
speed_limit = 0      # set a minimum speed (kb/sec) to be considered a download activity
looptime = 20        # time interval between checks
download_wait = 300  # time (seconds) to wait after the last download activity before suspend is re- activated
#---

t = 0
key = ["gsettings", "get", "org.gnome.settings-daemon.plugins.power", "sleep-inactive-ac-timeout", "set"]

set_suspend = key[0]+" "+key[-1]+" "+(" ").join(key[2:4])
get_suspend = (" ").join(key[0:4])

def get_size():
    return int(subprocess.check_output(["/bin/bash", "-c", cmd]).decode("utf-8").split()[0])

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

check_1 = int(get("du -ks ~/Downloads").split()[0])

while True:
    time.sleep(looptime)
    try:
        check_2 = int(get("du -ks ~/Downloads").split()[0])
    except subprocess.CalledProcessError:
        pass
    speed = int((check_2 - check_1)/looptime)
    # check current suspend setting
    suspend = get(get_suspend).strip()
    if speed > speed_limit:
        # check/set disable suspend if necessary
        if suspend != "0":
            subprocess.Popen(["/bin/bash", "-c", set_suspend+" 0"])
        t = 0
    else:
        if all([t > download_wait/looptime, suspend != str(download_wait)]):
            # check/enable suspend if necessary
            subprocess.Popen(["/bin/bash", "-c", set_suspend+" "+str(suspend_wait)])
    check_1 = check_2
    t = t+1

How to use

Copy the script below into an empty file, save it as no_suspend.py
In the head section of the script, set the desired "normal" suspend time (since the script will re- enable suspend):

#--- set suspend time below (seconds)
suspend_wait = 300
#---

If you want, you can set other values:

#--- you can change values below, but I'd leave them as they are
speed_limit = 0      # set a minimum speed (kb/sec) to be considered a download activity
looptime = 20        # time interval between checks
download_wait = 300  # time (seconds) to wait after the last download activity before suspend is re- activated
#---

Test- run the script with the command:

python3 /path/to/no_suspend.py

If all works fine, add it to your startup applications: Dash > Startup Applications > add the command:

python3 /path/to/no_suspend.py


I had an alternative solution to the problem I had above. When I ssh from another computer to my office computer where the anaconda is installed, everything works well. I can install all the packages in anaconda from the other computer. Sounds crazy but I am now working in this way. Does anyone have an answer for this problem?


Installing curl on Ubuntu 18.04 uninstall libcurl3

curl binary is linked only with newest libcurl4.
You need to:

apt install libcurl4 libcurl4-openssl-dev curl

to have all the newest. I suggest to compile curl manually if you want to be linked with "libcurl3 libcurl-openssl1.0-dev"


this will show what is consuming space on /boot

du -k /boot

issue this command to delete old unused kernel releases which will free up space on /boot

dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge


Failed upgrade to 17.10; can I copy /home contents to external drive before re-install?

Yes you can, but it would not be wise as you seem to have compiz and unity problems as well and these could be profile- or system-related, so the safest bet is to:

cp --recursive --preserve=timestamps /home/szYourUser /media/backup/szYourUser

reinstall and copy only your documents, videos, music, ... folders back and be done with it.

For important individual applications, you can restore individual hidden config files, but I would definitely not restore the entire /home unless you know exactly where the trouble is coming from and exclude those config files...


You're probably not connecting to the ISP side of the modem.  You need to contact your ISP to find out what the WAN side of the modem is addressed as.  Connect to that IP, and it should go to your router as it should.


Which loaded kernel modules are unused and should I disable them?

Most modules are automatically loaded only because the corresponding hardware was detected
lsmod shows you the currently loaded modules, as (excerpt):

Module                  Size  Used by
...
psmouse                87692  0
bluetooth             180104  7 bnep
parport                46562  3 lp,parport_pc,ppdev
serio_raw              13211  0
snd_ens1371            25747  4
gameport               19693  1 snd_ens1371
snd_ac97_codec        134826  1 snd_ens1371
joydev                 17693  0
...

However, just because Used is 0 for a particular module does not mean it is not in use!
Note that the kernel autoloads modules based on the hardware detected, except for the modules listed in /etc/modules, which are "force"-loaded.
Removal/blacklisting will disable hardware; no real need on modern systems with more than 512MB of RAM
So if you remove or blacklist any of these modules beware: that piece of hardware may no longer work. e.g. if I remove/blacklist parport, my parallel port won't work, which is OK if I never use it. The same goes for bluetooth ,etc.
The kernel modules take up relatively little memory on a modern PC, so the only time I'd recommend this kind of manual "optimization" is on embedded systems, etc. with little RAM.

For Disabling the modules
From a later comment by OP, It seems that, he wanted to know the loaded unused modules names to disable them from auto loading in the boot time. It can be achieved by blacklisting them.

A good help can be found from this answer
Also see this question How to blacklist kernel modules?


Can I automatically turn on my hotspot when ethernet is plugged in?

Use nmcli d|grep -E "^eth0"|grep connected to judge if cable is connected.

Write a script like

AP=0
while :; do
    if nmcli d|grep -E "^eth0"|grep connected ; then
        if [[ AP -eq 0 ]]; then
            # bring hotspot up
            AP=1
        fi
    else
        if [[ AP -eq 1 ]]; then
            # turn hotspot off
            AP=0
        fi
    fi
    sleep 2
done


Windows 8 and Ubuntu 12.10 Dual Boot Problem

Have you got Grub or another loader installed? Do you see the grub menu (with the missing Windows entry) every time you boot? If no, install grub. If yes, you'll have to have a poke around to see why it isn't detecting the Windows boot loader. The first point of call could be running grub-update.


How do I transfer videos from a Kodak Playsport video camera to my computer?

What is your problem exactly? You may not have the proper codecs installed, try installing the W32 codecs
sudo apt-get install w32codecs
As for the video editor, try Pitivi. It's a very simple video editor, for general use.
Good luck. :)


On my Lubuntu 16.04 machine, I tried the snap package installastion, the script installation (which basically adds a PPA and installs from it) and the standalone installation from tarball. The snap package didn’t install, both the other installations left me with version 7.0.92 as you describe. In the case of the PPA, you can trust the system to provide you with the latest version the PPA owner – https://www.heroku.com in this case – provides. As even the tarball version doesn’t provide the obviously current version 7.0.93 (yet), I assume the new version has just not been made available via tarballs and the PPA yet, but probably will be shortly. If you installed heroku with the script, your usual package updates covers heroku as well. You don’t need to do anything special to receive updates for the package, and the version the PPA provides is probably fine.


Samba local copy speed & 'insufficient disk space'

It will be nasty workaround:
create file /usr/local/bin/dfree_Drive.sh

#!/bin/bash
df | egrep '/media/drive[0-9]+$' | awk '{total+=$2; avail+=$4; print $0} END{print total, avail}'

and make it executable. Then in share section of your samba configuration add:

    dfree command = /usr/local/bin/dfree_Drive.sh

This solution is nasty, because it lies to client about capacity of shared volume. But as far as I know there is no way to make samba aware of capacity of specific folder (in contrast to volume).


How do I enable tap to click on my Ubuntu 20.04?

I hope you have solved your problem already. Just for future reference:

Start the Terminal by the Overview:
Press Win/Super and type terminal and hit Enter.

Then type this into the terminal:
gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true


Delete the cached copy /home/test/.juju/environments/maas.jenv, then make sure /home/test/.juju/environments.yaml has the right MAAS API key, and try again.


I am running Ubuntu 12.04, though the following command did the trick for me:

sudo apt-get install chromium-codecs-ffmpeg-extra


Preventing NetworkManager from bring certain network interfaces 'up' by default

Please do:

gksudo gedit /etc/rc.local

Right above exit 0 add the following:

ifconfig wlan0 down

Proofread carefully, save and close gedit. Now the computer will boot with wlan0 down. If you later need to use it, take down wlan1 and bring up wlan0:

sudo ifconfig wlan1 down
sudo ifconfig wlan0 up


Trying to move files to restricted folders

Use mv command like this

mv /path/to/YOUR_FILE /home/irshad/.local/share/Steam/Backups/

If your file name or directory name has a space in its name quote its path:

mv "/path/to/YOUR FILEorDIRECTORY" "/home/irshad/.local/share/Steam/MY Backups/"


How can I uniqely record every new command I use, and possibly timestamp it?

How to successfully experiment with changing these settings in .bashrc

Before experimenting: Save your current .bash_history to another file with cp.
While experimenting with what works: rm ~/.bash_history after you change .bashrc with history control parameters, otherwise the combo of old and new entries may give you weird results.

e.g., all entries before timestamps were enabled will show the same current date/time!

Once you find something that works, DO NOT rm any more!!
Note also that any changes to .bashrc are reflected only when you exit and then instantiate a new terminal/shell.

Increasing history size and eliminating duplicates

Add these lines to your ~/.bashrc:

export HISTCONTROL=erasedups
export HISTSIZE=10000
History size is set to 10000, duplicates are automatically eliminated so it's plenty of space :)

Timestamping

Time can be set easily by adding another line of the form export HISTTIMEFORMAT="%F %T", this will display the time/date before each line when using history

Example:

izx@preciseunity:~$ history
1  2012-06-01 07:16:22 rm ~/.bash_history
2  2012-06-01 07:16:23 exit
3  2012-06-01 07:16:27 ls
4  2012-06-01 07:16:31 test
5  2012-06-01 07:16:34 ls /etc
6  2012-06-01 07:16:36 down
7  2012-06-01 07:16:37 up
8  2012-06-01 07:16:40 hustory
9  2012-06-01 07:16:48 history

Note that because duplicates are eliminated, the time shown for a command is the latest (newest) time it was last executed.
You can customize the HISTTIMEFORMAT to your choice/locale based on strftime


Live USB won't boot properly on Asus EEE PC 1201HAB

do you see black screen after boot-up ?
If yes, then just login use command --> login <user-name>
Then it will ask for password, so enter your password.

And then you will see terminal. Now type startx.

And everything works well you will see the GUI.


You are counting fields backwards from the last one, assuming the number is always the same. However that is not true. One example, there may be more:

doug@s18:~$ top -b -n 2 | grep Cpu
%Cpu(s): 98.9 us,  1.1 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu(s):100.0 us,  0.0 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st

Notice in the 2nd printing there are only 16 fields instead of 17, because the normal space between the : and the first digit of the "us" load isn't there having been taken up by the "1", and therefore the referencing would be wrong.

Looking in more detail, I'll add the field number below (remember, the default field delimiters are space and tab):

%Cpu(s): 98.9 us,  1.1 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
1        2    3    4   5    6   7    8   9    10  11   12  13   14  15   16  17
.
%Cpu(s):100.0 us,  0.0 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
1             2    3   4    5   6    7   8    9   10   11  12   13  14   15  16

Indeed, the output running your command gives an incorrect answer sometimes (running it in a loop,where the real load is always 100%):

CPU Load: 100.00
CPU Load:   0.00
CPU Load:   0.00
CPU Load: 100.00
CPU Load:   0.00
CPU Load:   0.00

This hack seems to fix this issue:

top -b -n 2 | grep Cpu | sed 's/:/ /g' | awk '{printf "CPU Load:%7.2f\n", $(NF-13) + $(NF-15)}' | sed -n '2 p'

I do not know if this was your issue or not, nor if it is the only issue.


No boot device found press any key to reboot machine - dual boot Windows and Ubuntu

You wrote:

  After that I created a partition using parted /dev/sda set 1 bios_grub on

The command you specified did not create a partition; instead, it marked your existing first partition as a BIOS Boot Partition, which GRUB uses by writing part of itself directly to the partition, without using a filesystem. Thus, when you re-installed GRUB, you trashed your existing first partition! That partition was probably either your EFI System Partition (ESP), where your EFI boot loaders go, or perhaps some other Windows-specific boot partition.

There's a slim chance that you can overcome this problem by resetting the type code on your first partition and using dosfsck or some other filesystem-recovery tool on it; but you may need to re-create the partition's contents from scratch. This is possible, but tricky. I don't have a URL handy to a procedure, but try a Web search on terms like "fixing damaged EFI System Partition." The ESP is basically a FAT partition that holds EFI boot loaders, which are ordinary files, so the recovery procedure will involve laying down a fresh FAT filesystem and restoring the files by copying them from another source or using a Windows recovery tool.

As a meta-comment, installing Linux in BIOS/CSM/legacy mode to a computer that already has Windows running in EFI/UEFI mode is doing things the hard way, at best. It's much better to install both OSes in the same mode, as described in this page I wrote. If you hadn't trashed your ESP, it would be relatively simple to add an EFI boot loader for Linux to the ESP to work around your initial problem, but now you've got to restore your Windows boot loader, and possibly adjust your boot loader NVRAM entries.

Good luck!


How to make crtl+alt+T to take you to a specific directory?

Here's possibly what you want. Works for me perfectly

First you need to install (other similar programs available too)  xbindkeys

sudo apt-get install xbindkeys

Then create a default configuration file with

xbindkeys --defaults

(Prints the default configuration file)

So to create a configuration files with default values run

xbindkeys --default > $HOME/.xbindkeysrc

Using ctrl+alt+T is not recommended in this case, since it is already in use. Find a unique key combination to use. I personally chose ctrl+shift + aring

You may want to use the following command to see exact names of the keys used

xbindkeys -k

After running the command, you need to hit the key combination. You will see an output similar to this

m:0x5 + c:34
  Control+Shift + aring

Then edit the configuration file you created with an editor of your choice

vim .xbindkeysrc

You will see that the only lines that are not commented out are

"xbindkeys_show"
  control+shift + q

That's one existing key combination

Add the following lines below the above mentioned lines

"gnome-terminal --working-directory=/home/$USER/Desktop"
   control+shift + aring

(If you used different keys, add those instead of control+shift + aring)

The file around that area should be looking something like this

# Examples of commands:

"xbindkeys_show"
   control+shift + q

"gnome-terminal --working-directory=/home/$USER/Desktop"
   control+shift + aring

# set directly keycode (here control + f with my keyboard)
#"xterm"
#  c:41 + m:0x4

Save the file. After saving, you need to run the following command to activate key shortcuts for the session

xbindkeys

Now with the combination you set you should be able to open gnome-terminal to Desktop directory

Note! Using xbindkeys is explained very well and in more detail here

How can I change what keys on my keyboard do? (How can I create custom keyboard commands/shortcuts?)

See Seth's excellent answer on that


Screenlet project is deprecated since 2008.

http://screenlets.org is dead.

You could want to look at Conky, a program that allows you to write desklets, or at the Cinnamon Desktop Environment, a Linux Mint initiative based on Gnome that have a built-in screenlet management.


Look into MusicBrainz Picard - especially the audio fingerprinting part.

Short excerpt from the documentation:

  use the Scan toolbar button to lookup files using their AcoustID, which is a unique finger-print associated with each recording.


:0 is the X11 display, if you have several screens or displays it will list them :0,:1, :2, etc...

:0 is your desktop.


Title bars no longer responsive to GTK themes

Restarting lightdm fixes this in the short term. I don't know the cause, and it happens almost every time the display is changed. Perhaps this is a bug in Unity Tweak Tool.


This happened due to not restarting after upgrade.

I had similar problem but doesn't lock the screen rather it switches other screens in background, and it has labeled as tty1,tt2..., etc.

In my case there were 6 ttys opened and whenever I was doing alt + left arrow, it was switching to different ttys which are processes running in background and it also has login tty, kernel bootinfo tty, driver running tty.

It doesn't show only lock screen but when you switch again then you get your original chrome-screen back.

this may be the bug but after a restart, it works as we intended.
hope this helps your answer.