Make password appear censored in bash script

Read command has an option to prevent input from showing when you type it.

echo "Enter the password: "
read -s password
#Print the password
echo $password


Yes, you will not be able to ping from the client to the server. This is because those two PCs are on two different networks (or subnets), and the "intermediate" PC is not configured to forward packets; in other words, the intermediate PC is not configured to act as a router, to route the packets between those networks.

Now, I haven't done this before, but I have an idea on how you would be able to do it, so this answer is not going to be a straight forward enter-these-commands answer, but more about explaining what should be done. You'll have to do some reading to get to what you want to do.

So, first of all, you'll need to enable IP forwarding. This can be done by putting the value "1" in a specific file. You'd do this by the following command:

echo 1 > /proc/sys/net/ipv4/ip_forward

This tells the PC that it will be forwarding packets. But from where to where? Which protocols to allow? What are the rules?

The answer to those questions will be done through the utility iptables. These are the rules that configure the firewall in Linux. So for example, you use iptables to indicate that you need NATing, or to restrict access to a subnet, or to forward packets from one interface to another. An iptables command looks like this:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

I don't really know what this command means, but I guess it means "do NATing when the output is eth0".

Now, this is the part where I don't know what commands will accomplish what you want to do, so you need to do some reading. I recommend carefully reading and understanding this: Internet/Connection Sharing, and you should focus on the Gateway set up section.


Go into a terminal and issue the following command in the directory where the bin file is,

chmod a+x name_of_file.bin

Then run it by writing

./name_of_file.bin

If you get a permission error and/or you're dealing with an installer that applies system-wide changes you might have to launch your application with root privileges:

 sudo ./name_of_file.bin


Ubuntu 20.04 fresh installation Microphone not working

Install pavucontrol: sudo apt install pavucontrol
Run it: pavucontrol
Open Input Devices tab and check if it is not muted

Install vokoscreen recorder: sudo apt install vokoscreen
Go to Microphone tab, enable Audio, check your recording audio device and try to record something with it

On vokoscreen's tab you have two options: Pulse and Alsa. Try if you could use either of them for audio recording.
To check if your microphone is working, use the next commands:
to enable microphone listening
pactl load-module module-loopback latency_msec=2

to disable microphone listening
pactl unload-module module-loopback

You could also run alsamixer and check if your Mic is not muted and has at least half of its volume. Use F6 keyboard button to switch to other audio adapter if you have more than one.


Adding a second keyboard layout in Kubuntu 18.04

After a lot of research I managed to overcome the problem by a somewhat bizarre solution. At least in my case the system seemed to be able to toggle between English and Greek after this approach.

I added a 3rd language in the Configure layout... (in my case Spanish)
Enable Spare layouts
Also (I am not sure this is necessary but I followed that step also) I installed the 3rd language to Regional Settings dialog.
After logout I was able to use the keyboard shortcut.

The funny thing is that I removed the 3rd language after that and it still works (I only kept English and Greek which was my initial intention).

Hope that this would be helpful to anyone facing a similar problem.


When you did the blank .is_audio_player file, the problem was you left the body of the document blank.

You've actually got to put .is_audio_player in the document. Just naming it .is_audio_player won't make any difference.

So just open the document in the Clip and type .is_audio_player.

Hope this helps!


How do you encrypt the entire Ubuntu Partition in a Dual Boot System?

There are multiple options to set up a partition configuration like this.

Note: I'm only providing the links to the appropriate pages because the procedure is quite long and also since most of the links are Ubuntu Wiki pages.

If a LVM already exists

This can be used if you already have partitions set up.

From Ubuntu Wiki:

  With the recipe...the Desktop CD can be used to install Ubuntu on a
  previously created (optionally encrypted) LVM.

Related Links/Sources:

Ubuntu Wiki - EncryptedFileSystemsViaUbiquity

Installation on a fresh HDD (no partitions or LVM)

This method will:

  Perform a minimal server install
  Create encrypted partition and copy minimal install to it
  Modify grub's menu.lst and fstab

This is like installing Ubuntu first and then encrypting the partitions.

Related Links/Sources:

Ubuntu Wiki - EncryptedFileSystemsOnIntrepid
svenfila.wordpress.com - Encrypt Root Partition Without Re-installing Linux

Encrypting Full Disk (won't be able to install Windows)

When you install Ubuntu, there's a checkbox to Encrypt the new Ubuntu installation for security.

  This is good news not just for Ubuntu users, but for users of all
  GNU/Linux distributions that are downstream from Ubuntu. The above
  screenshots come from ubiquity, the simple graphical live CD installer
  that Canonical developed. Every distribution that uses ubiquity as an
  installer will soon also make it easy for users to use FDE. The
  up-and-coming distribution Linux Mint, for example, is based on
  Ubuntu, but there is currently no simple way to install it with disk
  encryption.

Related Links/Sources:

EFF - Privacy in Ubuntu 12.10


This script can't be executed at reboot: it needs a graphical environment. You need to log in first, to start a graphical environment where you can run zenity. Run the script from your session startup. See Adding programs to session startup in the Ubuntu community documentation.


after installation kubuntu some application launcher icon missing

I had the same problem, and it was because I installed ubuntu-desktop on my kubuntu. All icons for non "native" kubuntu applications were gone.

I fixed it by removing the ubuntu-desktop, unity and unity-greeter (How to remove ubuntu-desktop completely and retain gnome-shell?).

After logging in and out the icons were appearing again.


Start job is running for wait for network to be configured. Ubuntu server 18.04

Notes:

Undo your previous fixes. Return them to the original state.

You may be having a problem obtaining IPv4 addresses.

In setting up your VM, you set "Adapter 1 to NAT, Adapter 2 to Host-Only", and I'm not sure that's 100% correct... However, if you're getting the correct IP addresses then it's probably OK.

Try this in your /etc/netplan/50-cloud-init.yaml...
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: true
      optional: true
    enp0s8:
      dhcp4: true
      optional: true

In the terminal, run the following...

sudo netplan generate

sudo netplan apply

reboot


The key-word is ip-forwarding

To enable IPv4-forwarding on Server2, I think that is what you want to do, first check if it is enabled:

sysctl net.ipv4.ip_forward

If it has the value 0 it's disabled (default).

echo 1 > /proc/sys/net/ipv4/ip_forward

Enables it, but only for your current session (until reboot).

If you want to make this configuration permanent the best way to do it is using the file /etc/sysctl.conf where you can add a line containing

net.ipv4.ip_forward = 1

To enable the changes in that file, use:

sysctl -p /etc/sysctl.conf

Before you just copy commands, please try to understand them


16.04LTS breaks matplotlib in interactive mode

You can use plt.pause(1) instead of the last command.

import matplotlib.pyplot as plt

plt.ion()
plt.figure()
plt.scatter(1,2)

while True:
    plt.pause(1)

If you have a for loop with many plots you can use raw_input() after plt.pause(1), then the new plot will be shown after you press enter, for example.


How to control LightDM power saving preferences?

This is a confirmed bug:

https://bugs.launchpad.net/ubuntu-power-consumption/+bug/1245474
https://bugs.launchpad.net/ubuntu/+source/unity-greeter/+bug/1237372
and others

And bugs, generally, are off-topic here.

Anyway, I found the following workaround (comment #33 related to the bug #1245474) which works for me:

  [...]I've added a script to handle turning off the X dpms timeouts when the
  user logs in. Here are the three files that I've created. First, the
  config file:

  /etc/lightdm/lightdm.conf.d/50-dpms.conf

[SeatDefaults]
display-setup-script=/etc/lightdm/dpms-enable
session-setup-script=/etc/lightdm/dpms-disable

  Make sure the above is owned by root. Easiest is to create it with
  sudoedit.

  Next are the two scripts. These need to be owned by root and made
  executable (chmod +x).

  /etc/lightdm/dpms-enable

#!/bin/sh

(
    # This delay is required. Might be because the X server isn't
    # started yet.
    sleep 10

    # Set up a 5 minute timeout before powering off the display.
    xset dpms 0 0 300
) &

  /etc/lightdm/dpms-disable

#!/bin/sh

(
    # This delay is required. Might be because the X server isn't
    # started yet.
    sleep 10

    # Turn off X's handling of dpms timeout. Otherwise
    # gnome-settings-daemon and gnome-screensaver will fight over it.
    xset dpms 0 0 0
) &

  Given the above, I get monitor power-down at the login screen, and the
  dpms timeouts are set to zero for a user session, so the screensaver
  works properly.


When shutdown with my 13.04 with button it does not go off

Shutdown your PC with either sudo shutdown or sudo halt.


How can I install latest gnome default icons on ubuntu 17.04

Use this command

sudo apt install adwaita-icon-theme

or

sudo apt install adwaita-icon-theme-full

to get the latest gnome icon theme.


No Unity (desktop/sidebar) after uninstalling bluez

Gave up and reinstalled Ubuntu, nothing else seemed to work. At least a  tip can be to go into terminal (ctrl+alt+f1) and install gnome (followed these instructions http://www.enqlu.com/2014/03/how-to-install-gnome-shell-desktop-in-ubuntu-14-04-lts.html). Then log into gnome desktop and save your files (or even use it, everything seemed to work fine).

An even better tip would be to never run the command "sudo apt-get remove bluez" since it seems to break unity beyond repair (at least for someone with my limited knowledge).


Installing a new package from command line

You can install arduino IDE using apt:

sudo apt install arduino

but in repositories is very old version of this program so better is to download arduino IDE from official website arduino.cc, uncompress it and run install.sh which will install program and create icon.

After installation you will have probably problem with uploading code, so run this command:

sudo usermod -a -G dialout $USER

Then logout and login (or reboot) and try it again.

There is also tutorial for it on website of arduino arduino IDE installation


When using dual monitors, some software maximize only into the primary display?

This is a well-known bug. A fix is on its way.


Is it possible to 'export' an installed package

The easiest way is probably to install dpkg-repack (if it is not already) with:

  apt-get dpkg-repack

Here is the description of the package:
DPKG-REPACK creates a .deb file  out of a Debian  package that has already been installed on your system. If any changes have been made to the package while it was unpacked (ie, files in /etc modified), the new package will inherit the changes.

This  utility  can  make  it easy to copy packages from one computer to another, or to recreate packages that are installed on your system, but no longer available elsewhere.

dpkg-repack manual for usage.
Direct link to package

Note: If you have a crashed server, the --root option is very helpful for pulling the package from a mounted disk.


Try booting form the Ubuntu 13.04 CD.  Once it starts, choose try Ubuntu,

and once you get the desktop, search for disks in Dash.  When it comes up choose the right drive, and click on the little gears, and choose SMART Data and Tests.  Once the test is finished, see if there is any bad sectors.  If there is see the addition below.

Addition:

Well if the problem came back, then you may have bad sectors.  These are not that bad providing they are not that many.  But to try to fix them requires that the drive be wiped.  So I would suggest that you backup all your data, before attempting this.  To clear bad sectors, see my post.  Once you try that, and it still doesn't work, my suggestion at that point is to replace the drive.  If its still under warranty, you may contact the manufacturer, and get a replacement.


Trouble when installing 32-bit packages on a 64-bit system

Turns out that the issue originated from installing various PPAs, such as tikhonov-misc-precise. This installs slightly-more-updated packages for AMD64, which breaks :i386 packages which require an identical version.

Fixing:

Remove the PPAs
Install aptitude
Using aptitude, try to install the ia32-libs package - many packages will break.
Use the b key to find broken packages. At the bottom of the package details page in aptitude, available packages will be shown. If an older one is available - install it (using i).
When you're all done, only ubuntu-official packages should be installed, and you should be good to go.

I wish it weren't this complicated... recovering from a bad PPA seems to be quite a pain.


Find out whether network connection is full or half duplex

You can use mii-tool :

$ sudo mii-tool
eth0: negotiated 100baseTx-FD flow-control, link ok

'FD' is full duplex.  'HD' would represent half.  For those who haven't seen this, it's because it generally represents a network problem -- you should always see and expect full.

If you don't have mii-tool installed, it is in the net-tools package:

$ dpkg -S mii-tool
net-tools: /usr/share/man/man8/mii-tool.8.gz
net-tools: /sbin/mii-tool

I believe it is included with a base install, however.

In some cases, dmesg will be sufficient.
Identify your local interface and check dmesg:

$ dmesg | grep -i duplex
[   31.920900] e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: Rx/Tx


Creating Ubuntu Live CD with customized Unity launcher

I'm surprised nobody has answered this yet, it is done in a schema so you make an override and re-compile.

echo "[com.canonical.Unity.Launcher]
favorites=['firefox.desktop', 'nautilus-home.desktop', 'libreoffice-writer.desktop']" > /usr/share/glib-2.0/schemas/com.canonical.Unity.gschema.override

glib-compile-schemas /usr/share/glib-2.0/schemas/

You can probably edit the xml and re-compile for the same result but I've not managed to get this to work yet (trial and error is tedious when you're trying to make live cd/usbs).


I need to install Inkscape on an Ubuntu Server. Do I need to install x11?

According to the wiki Inkscape depends on GTK, which could depend on X11, but I am not sure. You could try running the following command to simulate installing it:

sudo apt-get install -s inkscape

See if it would pull down some X11 packages.


How long for 14.04 installation to repartition disk

If you already have unused partitions of a previous (botched) Ubuntu installation, you should choose “something else“ instead of “alongside” and use the pre-existing partition(s).

The duration of shrinking the Windows partition depends on the amount to shrink, the fill rate of its file systems, and the throughput of your hard drive. 30 h for <400 GB sounds a bit much though. If your machine has a disk activity light and it isn't constantly lit or blinking, you can abort without (further) damage.


Here's my own answer:

OK, so I figured it out, largely thanks to this extended thread on macforums

http://forums.macrumors.com/showthread.php?t=1329407

However, I'm going to offer a summarized version here. Whoever's responsible for the ubuntu page on this (the one I linked to in my OP) really should get it changed. Those instructions just don't work.

Here's what you need:

Download Ubuntu.iso
Download and install rEFIt from here http://refit.sourceforge.net
Download and install the app UNetbootin from here: http://unetbootin.sourceforge.net
A 4GB Flash Drive formatted to FAT32
free space on an internal or external disk to boot from and install too.

Create flash drive files:
Start up UNetbootin. Choose the ubuntu iso as the source and the flash drive as the destination. When that's finished you'll get a warning that the USB is not bootable on a mac. That's expected.

Create partitions on hard disk:
Open Disk Utility and choose the internal or external disk that you're going to use. Create a 2GB partition on it, formatted to FAT32. Create another partition (you can choose FAT32 for this too) the same size as you want your final install to be (I have a 750GB internal disk on my mac, so I gave ubuntu 100GB of that).

Get device names:
Open Terminal.app on your mac and copy/paste this command (you can type it, but there'll be some more complex commands later that you might want to cut and paste to avoid errors)

diskutil list

From the output, identify both the flash drive and the 2gb partition. They will have names such as /dev/disk1s1 and dev/disk0s4 for example. Make sure you pick the right name, or you could end up doing some damage.

Dismount devices:
Open Disk Utility.app, and click on the flash drive in the sidepanel. Hit the 'dismount' button in the taskbar above. Do the same for the 2gb internal partition.

Move files from flash drive to HD partition:
Copy and paste this into Terminal, but DO NOT press 'return':

sudo dd if=/dev/disk1s1 of=/dev/rdisk0s4

Change the device names to match those you found in step 3. The first device name is source (the flash drive), the second one is the destination (the 2gb fat partition on your internal disk). Notice that I've added an 'r' before 'disk' on the output device. That's deliberate and you should make sure you add it too, as it speeds up the copy process considerably.

Double check that line is correct, then when you're ready, press 'return' and enter your admin password (it'll be invisible when you type it).

Remove flash drive:
When that eventually completes, dismount and remove the flash drive. You don't need it anymore.

Fix partition tables:
Restart your mac with the option key held down. From the rEFIt menu, choose 'sync partition tables'. Confirm with 'y' and exit. Then choose 'restart' from the rEFImenu.

Start up ubuntu live CD:
You should now see the Penguin logo. Click on it to start the Ubunutu Live CD.


You can create a bash script:

#!/bin/bash

Mathematica -mesa

Don't forget to make the script executable and store it in the $PATH.


So in order to get your code work as you wish, you should do something like:

N=$1
for ((i=2;i<$#;((i=i+$N))))
do
  echo -n ${!i}" "
done

Note the ! before i.

Good luck :)


Make sure the displays can be recognized by your computer, you can do this by typing Ctrl+Alt+T to open a terminal and type:

xrandr

This should output some information about your displays. You can then setup your displays based on this. man xrandr in a terminal will help with this.

In my monitor setup:

xrandr --output DVI-I-1 --auto --orientation left --output DP-1 --auto --right-of DVI-I-1

Where the output DVI-I-1 is set to have left orientation, automatic resolution, and left of the output DP-1 which also has automatic resolution set.


I am afraid (or hope so?) that all the answers I found so far, searching for the same question, are simply off topic.

Because x86 tablets are NOT ARM devices, those should be regular PCs with some Intel CPU.
The only points to answer, should be how to get GRUB in, and whether certain hardware has its drivers.
The rest should be the same on tiny 7" x86 tablets, as on any standard desktop - with touch screen, which is just a kind of mouse.

So the partial answer is, NOT ubuntu-touch - do not search for images for ARM CPUs, when yours is Intel x86 (and 64-bit).
What is missing is "howto" make that device boot GRUB (perhaps 32-bit EFI?) on certain tablets, and install Ubuntu - "normal" PC Desktop version.

Well, and onscreen keyboard for touch devices, is part of  Ubuntu Desktop, its name is "Onboard". And light desktop environments (xfce4, Xubuntu) may be preferred on tiny devices, to avoid slowdown..


You have downloaded the wrong architecture for your system.

$ file /usr/local/java/jdk1.8.0_65/bin/java
/usr/local/java/jdk1.8.0_65/bin/java: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.7.0, BuildID[sha1]=4d4d0222e883a3bf4320256278c6c0bfe14a1c11, not stripped

says ARM aarch64

$ uname -a
Linux maurice-HP-ProBook-455-G1 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

says x86_64

You need Linux x64 and not Linux ARM.

Delete your Java installation

sudo rm -r /usr/local/java/jdk1.8.0_65

and install the right architecture...

To install Oracle Java

sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

To install OpenJDK

sudo apt-get install openjdk-8-jdk


Wireshark does not show any interface to capture packets

Even though you could run wireshark as root, it should be avoided.

Instead, try this:

sudo dpkg-reconfigure wireshark-common

Select YES to the question

Then add your user to newly created wireshark group with this

sudo adduser $USER wireshark

Finally log out, and log back in and you should be able to capture packets.


I am getting a Putty attempted incorrect protocol errors when I SSH into my server from Windows

Reformatted for ask from http://froebe.net/blog/2008/11/14/getting-xlib-putty-x11-proxy-wrong-authentication-protocol-attempted-i-have-the-answer/

As mentioned above, you can break your security by switching on ForwardX11Trusted yes in the /etc/ssh/sshd_config file on the server and restart sshd. The full solution is to temporarily transfer the authorization to the other account.

First, on your client get the key from your account (on windows this is for xming and might be in the xming configuration):

$ xauth list
aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc664c66cfec3c5c3d5b0efc4ee9d3ad

Next, log into your ssh/putty account and add the xming key (this might actually be in the configuration for putty).

$ xauth add aspc2o1/unix:10 MIT-MAGIC-COOKIE-1 bc664c66cfec3c5c3d5b0efc4ee9d3ad

Now you should be able to open up apps when you forward the X display over ssh.


wiFi detection problems after installing Ubuntu 16.04 LTS

Somehow the same issue. My wifi adapter is not detected within graphical session.

However, such a command succeed :

$ sudo iw dev wlp1s0 scan

Looks like it may be possible to connect using command line... :-|


You don't need Control+D:

mail -s "This is a test" myemail@domain.com - hit ENTER
Write eMail body text, when you're done, press ENTER.
Enter a single dot on the new line, press ENTER again to complete the body.
You're now asked to provide Cc: addresses, just skip this with ENTER

Voila, you're done.


9.517513---[end kernel panic - not syncing :vfs:unable to mount root fs on unkown block(0,0)

Burn that CD (LITERALLY) if not re-writable

Get a new one

Check the ISO Check sums from the Download Page, if they match then rewrite or else re download

Always download from official site only


Suspending computer and maintaining internet connection

A computer that is suspended isn't on the network and isn't visible to the network. One thing that you can do is configure your DHCP server to hand out automatic IP addresses that are outside the range of your static IPs.

For example, suppose that you have assigned static IP addresses between 192.168.1.1 and 192.168.1.10. Configure your DHCP server (possibly part of your router) to automatically assign IPs in the range 192.168.1.100 to 192.168.1.254. This way, you'll never have to worry about collisions.


Is There a Bluetooth File Transfer Application

Install Blueman. Once installed, right click on the Blueman icon in the notification area and select Local Services . . . , click on Transfer. Select your Incoming Folder (where you want transferred files to arrive). Make sure Accept files from trusted devices is checked.

Here is a complete manual on how to use Blueman: archlinux manual on Blueman


Ubuntu 18.04 slow boot - Delay before loading GRUB

I experienced a similar problem on my Lenovo X220 some weeks ago.

In my case, the problem was the default GRUB_TIMEOUT, which makes the system wait for 10 seconds before loading grub. You can check this answer for more info.
I managed to regain the usual boot speed by lowering GRUB_TIMEOUT to 1 second.

To achieve that, edit Grub's configuration file /etc/default/grub, and change the value of GRUB_TIMEOUT around line 8 and set it to 1:

Run sudo nano /etc/default/grub
Find the line (arround line 8) with GRUB_TIMEOUT=10 and change it to GRUB_TIMEOUT=1
Save changes and exit your editor
Run sudo update-grub
Reboot your machine

Then you should be enjoying a fast boot again.


Teeview-Binding to CouchDB not working with quickly (PyGtk + Glade)

I got it working now with a bit digging on http://www.pygtk.org/docs/pygtk/class-gtkliststore.html#method-gtkliststore--append! There were two faults in OpenDialog.py

1) in def load_titles:
You must append the title and text-values to the liststore-Object with adding the following line:

store.append([title, text])

2) in def get_selection:
To figure out the selected row, you have to return the title and text to the Main-Window (SuperTextWindow) by adding the following line in the else-branch:

return (title, text)

then the code works fine!

Note:
It would be nice if someone can host the code on this page or delete the whole question. Because this entry makes no sense if the code is not hosted here. I host this code via Dropbox but I don't want to do this forever...
If you want the new code from me with the two lines added, I can send it to you if requested.


Use GParted to wipe your SSD and format it as NTFS first and then install Windows.

Gparted runs live off a USB stick and has a very nice graphical interface for partitioning and formatting drives. Download GParted ISO, burn to bootable USB, and boot from USB.

My experience of Windows disk manager is that it's very limited. So I imagine that the Windows boot drive's partitioning function is also.


Everything on USB is digital.
"Analog Output" describes the output of the DAC.

Ubuntu's sound settings are the PulseAudio layer.


I want to modify linux kernel and make iso image of kernel

Well, not to be too self-serving, but you're going to be looking for a UNIX based utility that can do cloning and bare metal recovery.  The software company I work for does just that and you could use the free trial to do your clone.

http://www.storix.com/free-trial

It will package everything up nicely and allow you to go from physical to virtual.  Just make a Full System Backup of your Ubuntu system, make a recovery disk, attach the recovery disk to your VM, and boot.

-Rick


Systemd, start user level unit with sudo access

Ok, I have managed to fix the issue. It was not an issue to begin with, just my lack of knowledge about DBus sessions and how do they work. I hope that my answer will help someone.

When you will open terminal and execute systemctl --user command unit
everything will be fine, but when you will try to do under sudo or switch to another user using su command, you will fail with error that I had:

Failed to connect to bus: No such file or directory.

The problem is that systemctl to connect to user sessions uses dbus session address which is set in DBUS_SESSION_ADDRESS env variable.
When you do sudo or su you get a very limited environment, simply you are missing DBUS_SESSION_ADDRESS and other env variables.
So when you get similar errors, check your environment perhaps something important is missing.


Installed 14.04 and Nvidia Graphics card won't load

Not entirely sure how I fixed it the first time on this system, however I have learned a lot on this issue, and if anyone is having similar issues or symptoms, please feel free to PM me or do something to contact me, and I'll be glad to help (a bit).

I'll tell how I got my Nvidia drivers to work on my latest try.  Note that I haven't quite gotten my second monitor running off of integrated graphics to work yet, but because the Nvidia drivers are working, I'm thinking it shouldn't be too big of a hassle.

I've found that manual installs work best for installing nvidia drivers, so go to the geforce site and download the latest drivers.  By default, it'll most likely go into /Downloads, but if not, just know where it is.  Then, you'll want to press

ctrl + alt +F1-F6 (each is a different login)

And then sign in to your account.  Then, you'll want to use

sudo stop lightdm

(or)

sudo service lightdm stop

This shuts down the things that are using the GUI, so they can be updated.

Then run

chmod +x ~/* Folder that said driver is located in * / * Driver *

For example,

chmod +x ~/Downloads/NVIDIA-Linux-x86_64-343.13.run

Make SURE that you have the entire name of the driver, otherwise this will not work!  Caps do matter!

What you just did was make the file executable.  Next, you'll want to run the following command, changed of course like the example above to fit your directories/driver versions.

sudo sh ~/Downloads/NVIDIA-Linux-x86_64-343.13.run

For me, tabbing the rest of the NVIDIA-Linux-x86_64-343.13.run file does not work, but it is CRUCIAL THAT YOU DO THIS.  If nothing happens after you run the second command, check your caps and spelling to make sure they are right.  You have to go through the program using the keyboard to correctly install it.  For me it will tell me that something went wrong right off the bat, just keep going and see if it still works.  If it asks you to install 32 bit libraries, do so.  Some programs (like steam games) will not run unless you have these installed.

After all of the above has been done, one final command must be completed, or of course you could reboot.

  sudo start lightdm (or sudo service lightdm start)

Then, you'll do

  ctrl + alt+ F7-F9ish (F7 is usually default, some people have different F keys though)

This should have worked for most people, if not keep looking, there's always a fix.  If anyone knows something about getting virtual 7.1 audio to work, please message me somehow.  Thanks.  Hope I helped someone.

Edit:I've also heard x-swat repositories work better at times.  Not sure about that, but worth a try.

(Pro tip, whenever Nvidia related stuff goes wrong, watch this YouTube video.)


Open with Wine/Photoshop not working properly

The custom command should be possible in one string without needing a script.

The following custom command will launch photoshop via wine:

wine "c:\\program files\\adobe\\adobe photoshop cs2\\photoshop.exe" \"z:%f\"

The key part is the last part \"z:%f\

%f passes the filename selected.
Prefixing z: does the same as winepath -w for a file which you double-click.


Got this working!  Changed

option routers 192.168.1.1;

to

option routers 192.168.1.2;


According to other users, you should use the Intel firmware that is available from Ubuntu instead of downloading it from the Intel website to avoid problems.
To fix your problem you will need to reinstall the linux-firmware package. As your question is stated, it appears you are open to using a different computer to download the needed file.
You can download the needed file from here.
Then, transfer that file to your ~/Downloads directory on your Ubuntu computer.
Finally, make a backup of the existing firmware file (just in case) and reinstall the linux-firmware package by running the following commands:
mv /lib/firmware/iwlwifi-cc-a0-46.ucode ~/Downloads/iwlwifi-cc-a0-46.ucode-backup
sudo dpkg -i ~/Downloads/linux-firmware*deb

Run the following command to verify the new file exists:
ls /lib/firmware/iwlwifi-cc-a0-46.ucode

Save any unsaved work and reboot to apply the changes.


If you keep running into errors, boot-repair, has solved quite a few of these issues for me. Might not be the fix but is worth a chance in my opinion. If you're unfamiliar, from your live USB:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
boot-repair


I fixed Desktop Share Webex feature on newly installed 16.04 by this way:
https://askubuntu.com/a/363400

but i replaced 'openjdk-7-jre' to 'openjdk-8-jre' and 'icedtea-7-plugin' to 'icedtea-8-plugin'

There are still 'not found' files in the webex directory, and audio calls still does not work, but i don't need it (we use skype)


I need a root password to access my drives, how to install 13.04?

You downloaded ubuntu-13.04-desktop-i386.iso? Good. I'll asume you downloaded it on another computer running Windows, if not, comment. Now, do the following:

Grab an empty DVD or an USB stick and put it in the computer you downloaded it on.
If you use a DVD, follow the instructions here. If you use an USB, backup the files that are on it, format it (as FAT32), download UNetbootin and run it, click the round button next to the word ISO, click the ... button, choose the downloaded ISO, make sure the selected drive letter is the same as the one of the USB and then press OK. After it's done press Exit.
Boot from the DVD or USB from the crashed computer.

You can now try out Ubuntu or install it. Ubuntu 13.04 should not ask for root passwords when accessing drives.

Ubuntu is a great operating system, I don't think you will be dissapointed.
Good luck!


You've pretty much whittled yourself down to a network boot install then.  Here's a good resource.

Ubuntu Installation Guide about a TFTP installation

I'll let others expand on this answer if they like.


Proxy setting in terminal but my password consist '@'

@ is %40 when escaped. What happens if you use that instead of @?


ubuntu 14.04 VPN:  VPN plugin state changed: stopped (6)

This usually means you typed the wrong password (either the user password or the group password).

The hint is the last line of the debug log:

/usr/sbin/vpnc: noninteractive can't reuse password

Since you configured the vpn through network manager, the vpnc command is invoked non-interactively and it can't ask for a new password once it detects the one you supplied is wrong (hence the "can't reuse password" message).

To actually find this out, you might want to check within the first blocks of the debug, where you will be able to see the:

Config: Debug 3
Config: Script /usr/lib/NetworkManager/nm-vpnc-service-vpnc-helper
Config: Cisco UDP Encapsulation Port 0
Config: Local Port 0
Config: IKE DH Group dh2
Config: Perfect Forward Secrecy server
Config: IPSec ID MY-VPN
Config: IPSec gateway AA.BB.CC.DD
Config: Xauth username USER
Config: Vendor cisco
Config: Enable Single DES
Config: NAT Traversal Mode natt
Config: Xauth password PASSWORD
Config: IPSec secret SECRET

The last two lines contains the plaintext user password and the group shared secret.

I had the same problem and the first google hit was https://mail.gnome.org/archives/networkmanager-list/2009-June/msg00034.html, since the second one was this question and I was indeed using ubuntu 14.04, I thought it might help here.


ImportError: cannot import name GUdev, introspection typelib not found

I had the same error on Ubuntu 20 Lts
I installed kazam using ppa:
sudo apt-add-repository ppa:sylvain-pineau/kazam
sudo apt-get update
sudo apt-get install kazam

To fix it - uninstall kazam, ppa-reposotiroy, and install kazam from the standard Ubuntu repo:
sudo apt-get purge --auto-remove kazam
sudo apt-get install ppa-purge
sudo ppa-purge ppa:sylvain-pineau/kazam
sudo apt-get install kazam

Now it is working fine.


How to install a custom GTK3 Ubuntu theme without having to add a PPA?

You need to download .zip of the theme that you want to install. For example dark theme. Now extract this and you will get named folder.

Place that folder inisde of ~/.themes. and run the following command:

gsettings set org.gnome.desktop.interface gtk-theme "theme_name"

Here, theme_name should be name of your theme/folder.


Though it is highly discouraged, you CAN make it so you can login as root. To do this you must

sudo passwd root

Then enter a password for root (twice to confirm)
After this, you must unlock the root account.

sudo passwd -u root

This will allow root login.
To revert your changes you can lock the root account with

sudo passwd -l root

And that will
Prevent root login.
As I mentioned this is not good practice by any means. Just as other commenters have said, use sudo <command>
For root tasks. Or you can get a root session with

sudo -i

Or

sudo su


The fact that there's i++ suggests there was either bash or ksh shell in use,potentially awk or perl as well. In either case, we can use process substitution <(...) to feed output of xev to counting loop (although simple pipeline xev | while... could work just fine).

text processing tools:

Portably and for fewer key strokes we can use awk :

$ xev | awk '/ButtonPress/{print "ButtonPress",i++}'
ButtonPress 0
ButtonPress 1
ButtonPress 2
ButtonPress 3

perl version:

$ xev | perl -ne '/ButtonPress/ && printf("ButtonPress:%d\n",++$i)'
ButtonPress:1
ButtonPress:2
ButtonPress:3

Shells:

Here's what works in bash:

$ i=0; while IFS= read -r line; do [[ $line =~ ButtonPress ]] && { ((i++)); printf 'ButtonPress: %d\n' "$i";} ;done < <(xev)
ButtonPress: 1
ButtonPress: 2
ButtonPress: 3

In case you don't want spammy output of many lines, we can use printf to send control code to clear previous line and output only the running count (that is you'd only see integer value change on the line):

$ i=0; while IFS= read -r line; do [[ $line =~ ButtonPress ]] && { ((i++)); printf "\r%b" "\033[2K"; printf 'ButtonPress: %d' "$i";} ;done < <(xev)

Portably in POSIX shell:

$ xev | ( i=0; while IFS= read -r l; do case "$l" in  *ButtonPress*) i=$((i+1)) && printf 'ButtonPress:%d\n' "$i";;  esac ;done)
ButtonPress:1
ButtonPress:2
ButtonPress:3

basic utils:

For simple, quick, and dirty way we can hack this via cat -n with line count being printed on the left instead of right:

$ xev | grep --line-buffered 'ButtonPress' | cat -n
     1  ButtonPress event, serial 34, synthetic NO, window 0x4a00001,
     2  ButtonPress event, serial 34, synthetic NO, window 0x4a00001,
     3  ButtonPress event, serial 34, synthetic NO, window 0x4a00001,


Huawei E3131 modem shows as mass storage

With the help of Jos I could solve the problem. So I am posting it as an answer.

Plug the USB dongle to the computer.
Open the terminal and run dmesg.

It will show how the device has been detected. In my case it shows as a mass storage device.

Run lsusb to view the vendor and the product ID.

Then install libusb-xx if it is not on your system already.
Download tarball and follow the steps on the terminal. Goto the folder where the file was downloaded and run,

tar xjf libusb(your_version).tar.bz2
cd libusb(your_version)
sudo make install

Then Download latest usb_modeswitch tarball and install it.

tar usb-modeswitch(your_version).tar.bz2
cd usb-modeswitch(your_version)
sudo make install

Follow the same steps to download and install usb-modeswitch-data-(your_version).tar.bz2

tar usb-modeswitch-data-(your_version).tar.bz2
cd usb-modeswitch-data-(your_version)
sudo make install

After that run the below command

sudo usb_modeswitch -v 12d1 -p 14fe -M '55534243123456780000000000000011062000000100000000000000000000'

It will probably correct the problem and should start showing mobile broadband signal. lsusb command now shows the device as a modem.

Reference


Why can't I send emails from the command line to my gmail account

You must change the gmail security settings at https://myaccount.google.com/, by activating "Less secure app access". if "Less secure app access" is off, all emails that you send will be blocked by Google.

and next step, you can see at https://easyengine.io/tutorials/linux/ubuntu-postfix-gmail-smtp


Will it be safe to use python 2.7 on Ubuntu 18.04 after python 2 EOL?

Python 2.7 is still in main for 18.04 (and is the last LTS release to include it in main). There is ongoing effort to have it moved to universe, but that wasn't completed before 18.04 released. Thus, the same commitment that Canonical applies to other software in main (like the kernel, which has been maintained past upstream support, for example) will hold for Python. What's the difference between multiverse, universe, restricted and main?


problem with installing softwares on ubuntu 16.04 LTS

You are supposed to execute one more command, as follows:

sudo dpkg -i *.deb
sudo apt-get install -f


adobe-flashplugin works for Chromium but doesn't work for Firefox

Since adobe-flashplugin is no more supported by adobe the better solution is to use the pepper flash plugin for chromium :

sudo apt-get update
sudo apt-get install pepperflashplugin-nonfree

and then install the freshplayer plugin to adapt pepperflash for firefox :

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install freshplayerplugin

maybe you will have to activate the new plugin in firefox.

now you can remove adobe-flashplugin :

sudo apt-get remove adobe-flashplugin


Systemd, failed to start dcos-link-env.service

Look at this line:

>  ExecStartPre=/usr/bin/mkdir -p /etc/profile.d (code=exited, status=203/EXEC)

So this command is exiting with a failure code. Have you it run on the CLI as root to confirm it works as expected?

On Ubuntu 16.04, which mkdir shows that it this binary is located at /bin/mkdir, not /usr/bin/mkdir as you have.


While installing ftp vsftpd, tomcat7 error is coming

Looks like your tomcat7 installation is broken. Try to uninstall tomcat:

    sudo apt-get purge tomcat7

and then install tomcat7 again (if needed)

    sudo apt-get install tomcat7

If everything is ok, then you probably will be able to install vsftpd.

UPDATE:
Other suggestions:

Tomcat7 deb package is broken. Try to find and delete a tomcat7 deb package file from apt-get cache. It is located in /var/cache/apt/archives. Then run "purge" and "install" commands as i described before. On "sudo apt-get install tomcat7" - apt must download a new one.
Tomcat7 installation is broken. If apt-get totally refuse to work, you may force reinstall tomcat7 manually. Try this (but you must specify correct package name from your apt cache):

sudo dpkg -i --force-overwrite /var/cache/apt/archives/tomcat7_7.0.52-1ubuntu0.3_all.deb

if there is no tomcat7 package in /var/cache/apt/archives - then you should  run this:

    sudo apt-get install tomcat7

and then try to reinstall again.


Never mind, turns out one of the HDD has 8 bad sectors. I've swapped with new HDD and the problem is solved


Manipulate browser and OS identification by Firefox?

In Firefox, open the about:config page and search for useragent. You'll be presented with options to change the different parts that make up a user-agent string:

You can also use an extension like User Agent Switcher, which makes it easy to save a couple and switch between them.

Both of these methods work in Firefox 3.6 (10.10) and 4.0 (11.04).


I got it.

Just made hidden startup items to be visible from startup applications and I was able to deselect the auto running apps. Now the OS is booting faster.

Command:

sudo sed -i "s/NoDisplay=true/NoDisplay=false/g" /etc/xdg/autostart/*.desktop

This helped me to enable hidden items to be displayed.


Yes it is.   First you are going to want to use GParted to shrink the Ubuntu Partition and make the Windows partition bigger. GPARTED DOES WARN YOU THAT THERE IS A CHANCE OF DATA LOSS IF DONE INCORRECTLY.

First install UNetBootin on your ubuntu distro.

sudo add-apt-repository ppa:gezakovacs/ppa
sudo apt-get update
sudo apt-get install unetbootin

Then download GParted Live ISO. (Direct Link)

http://downloads.sourceforge.net/gparted/gparted-live-0.19.1-4-i486.iso

Now open UNetBootin.

Select DiskImage

Browse to where you put the disc image (.Iso)

Now select your USB

and click install  FILES WILL BE DELETED ON USB SO MAKE A BACK UP

Now once done boot up PC and go to boot manager and select USB (So just boot from usb)

then select LIVE or somthing like that.

Now it should boot up.

All you need to do now is take the Ubuntu Partition, click on shrink and shrink it down how u want. Then select the Windows Partition and you will be able to make it bigger!

And now your all done, when you get into ubuntu agian go ahead and format your usb and put all of your files you had before.

GoodLuck!


Fatal error: gl/glut.h: no such file or directory

On Ubuntu 13.10 this file is available in the freeglut3-dev package.

$ sudo apt-get install freeglut3-dev

You must also be aware that C++ and Ubuntu are both case-sensitive. The correct include line in your program is:

#include <GL/glut.h>

The upper-case "GL" is important.


As the VirtualBox manual says,

  In order to run other operating systems in virtual machines alongside your main operating system, Oracle VM VirtualBox needs to integrate very tightly into the system. To do this it installs a driver module called vboxdrv which does a lot of that work into the system kernel, which is the part of the operating system which controls your processor and physical hardware. Without this kernel module, you can still use the VirtualBox Manager to configure virtual machines, but they will not start.

So you need to install the vboxdrv driver, like the error message spells out, too. To do this, execute

modprobe vboxdrv

with root privileges. If you get errors, you might need to install some software that's necessary to build the kernel module, like the C compiler or some header files. You can find further information in the VirtualBox manual linked above.

In general, it's very often helpful to actually read the error messages ;) As in this example, they often spell out what's wrong ("The VirtualBox Linux kernel driver is either not loaded or not set up correctly."), sometimes even what you need to do ("Please reinstall virtualbox-dkms package and load the kernel module by...").

Also, please don't post error messages as images like screenshots. Those cannot be searched. So the next person who has this problem can't find this question by searching for, for example, "VERR_VM_DRIVER_NOT_INSTALLED". Please copy and paste the text into your question as actual text.

And finally, after I told you what you did wrong: Welcome to Ask Ubuntu ;)


How to run Ubuntu on new Dell XPS 15 7000 Series-7590

I made a github repo to fix all the issues for Ubuntu on Dell XPS 7590(Brightness, wifi, power consumption, suspend power consumption).

long story short,

CPU Issues: Ubuntu 19.04 or 19.10 are better because the kernel support newer processors better. But you can use Ubuntu 18.04 but kernel in that version doesn't support new processors which lead to high power consumption, so you will have to install PowerTop and other power management tools to reduce the power consumption. be aware that PowerTop disable intel module which case screen flickering in suspend mode(fixed this issue in my script).
WiFi: you can install killer wifi driver following bellow steps(killer wifi website).

sudo add-apt-repository ppa:canonical-hwe-team/backport-iwlwifi
sudo apt-get update
sudo apt-get install backport-iwlwifi-dkms
reboot

Brightness: you will have to use one of two methods:

Xrandr: just run in terminal window xrandr --output $(xrandr --listmonitors | awk '$1 == "0:" {print $4}') --brightness 0.6 to set the brightness to 60%, or change 0.6 to range from 0 to 1(0 to 100%). you will have to make a script to change it by fn keys(check the repo).
ICC color profile: check this source repo for instruction, or use my script which have the above two methods to choose from.


Can I access my account from a different computer?

You can connect to your account via ssh:

ssh username@serverip

where username is the name of your account and serverip is the IP of the university machine.


The video in your link plays in VLC media player. To install VLC open the terminal and type:

sudo apt-get install vlc

Open Firefox, go to the video link, and under where it says APPLE QUICKTIME click on the link that says: Select this  player.
A QuickTime video player tab will open in Firefox. Inside the dark empty space in the video player click on the link that says: Activate QuickTime.
A popup window will appear asking if you will Allow ... that video URL ... to run QuickTime?. Click the Allow Now button.
Click the play button in the video player to start playing the video. It will start playing for a few seconds and then stop.
Right-click inside the video player and from the context menu select Open with "VLC media player".
The video will open in VLC media player locally on your desktop, and start playing in VLC as a Network Stream. This particular video is more than two and a half hours long. It should play straight through in VLC media player from the beginning to the end without a break.


I had the same problem where I found your question while I searched for answers.  I never found and answer, but I did discover a resolution that worked.

I had prevously made manual changes to the password and shadow files rather than using the tools such as usermod and passwd.

There are other files that are associated with the account that affect the integrity of the user's configuration.

I fixed the user's configuration by backing up the home directory (saving it by a different name).  Then creating a temporary home directory by the user's name.

Then I use the account tools to remove the user and his home directory.  Then I created the user again.  Then I restored the user's home directory.  After that the /etc/gdm3/PostSession/Default script executed.

These are the commands:

$ cd /home
$ sudo mv ~user user.bak
$ sudo mkdir ~user
$ sudo deluser --remove-home user
$ sudo adduser user
$ sudo mv ~user ~user.del
$ sudo mv ~user.bak user

Note:
Replace name user with the name of the userID you're having problems with.
You can also delete the user.del directory when you finish.


dist-upgrade runs and completes but current kernel stays the same

Try installing packages linux-generic, linux-image-generic and linux-headers-generic. These metapackages depend on latest kernel and headers. The most recently issued kernel should start by default, and you can check GRUB menu additional options for another actually installed kernels.


How to access Windows 10 PC from Ubuntu 14.04 using Remote Acess Client like Remmina

I also was initially unable to connect to Windows 10 from Linux, but found a change to the Windows configuration and a reboot fixed it. There are actually several potential clients. You'll probably like remmina since it's friendly and GUI based, but I prefer the scripting friendly command line based xfreerdp because I can set it to reconnect as I prefer and include my credentials. Here's the command I use:

xfreerdp /u:'myusername@mydomain.com' /p:'mypassword' /sound:sys:alsa /size:1900x1050 /cert-ignore ignore certificate /v:192.168.0.1

See: https://ubuntuforums.org/showthread.php?t=2287213

With reference to: https://cyberarms.net/security-insig...e-desktop.aspx

I changed the registry key

\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp SecurityLayer

from DWORD Hex '2' to a value of '1'

This reduces the security resilience of the windows machine but allows older software to remote in.


Firefox browser opens but doesn't load any web pages

If you know the name of the file you want to download from a site, then wget is your friend. For example, if you want to download the latest tar.gz, the URL would be https://github.com/OSGeo/gdal/releases/download/v3.2.1/gdal-3.2.1.tar.gz, which you can call with wget:
wget "https://github.com/OSGeo/gdal/releases/download/v3.2.1/gdal-3.2.1.tar.gz" .

If you're not sure what the link is and you want to see a complete list to choose from via the command line, do this:

Download the web page (and hope it's not one of those fully JavaScript-composited things):

wget "https://gdal.org/download.html" -O site.html

List all links contained in the file:

cat site.html | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*"

You will see something like this:
https://gdal.orgdownload.html
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML
https://github.com/OSGeo/gdal/edit//master/gdal/doc/source/download.rst
http://schema.org/Article
https://github.com/OSGeo/gdal/releases/download/v3.2.1/gdal-3.2.1.tar.gz
https://github.com/OSGeo/gdal/blob/v3.2.1/gdal/NEWS
https://github.com/OSGeo/gdal/releases/download/v3.2.1/gdal-3.2.1.tar.gz.md5
https://github.com/OSGeo/gdal/releases/download/v3.2.0/gdal-3.2.0.tar.gz
https://github.com/OSGeo/gdal/blob/v3.2.0/gdal/NEWS
https://github.com/OSGeo/gdal/releases/download/v3.2.0/gdal-3.2.0.tar.gz.md5
https://github.com/OSGeo/gdal/releases/download/v3.1.4/gdal-3.1.4.tar.gz
https://github.com/OSGeo/gdal/blob/v3.1.4/gdal/NEWS
https://github.com/OSGeo/gdal/releases/download/v3.1.4/gdal-3.1.4.tar.gz.md5
https://github.com/OSGeo/gdal/releases/download/v3.1.3/gdal-3.1.3.tar.gz
https://github.com/OSGeo/gdal/blob/v3.1.3/gdal/NEWS
https://github.com/OSGeo/gdal/releases/download/v3.1.3/gdal-3.1.3.tar.gz.md5
https://github.com/OSGeo/gdal/releases/download/v3.1.2/gdal-3.1.2.tar.gz
https://github.com/OSGeo/gdal/blob/v3.1.2/gdal/NEWS
https://github.com/OSGeo/gdal/releases/download/v3.1.2/gdal-3.1.2.tar.gz.md5
https://github.com/OSGeo/gdal/releases/download/v3.1.1/gdal-3.1.1.tar.gz
https://github.com/OSGeo/gdal/blob/v3.1.1/gdal/NEWS
https://github.com/OSGeo/gdal/releases/download/v3.1.1/gdal-3.1.1.tar.gz.md5
https://github.com/OSGeo/gdal/releases/download/v3.1.0/gdal-3.1.0.tar.gz
https://github.com/OSGeo/gdal/blob/v3.1.0/gdal/NEWS
https://github.com/OSGeo/gdal/releases/download/v3.1.0/gdal-3.1.0.tar.gz.md5
...

Copy the link for the file you wish to download
Use wget:

wget "https://github.com/OSGeo/gdal/releases/download/v3.2.1/gdal-3.2.1.tar.gz" .

Hope this gives you what you're looking for.


Could not open file archive.ubuntu.com_ubuntu_dists_eoan-updates_restricted_cnf_Commands-amd64.xz

I have removed the restricted software sources from the list and done a update via sudo apt update then again added the restricted software sources to the list and again done another update and the error is gone.


Thinking about doing a fresh installation and need to keep Pytrainer data

Find the directory Pytrainer uses to save it's information at, and copy it all to another drive for safe keeping while you perform your format and reinstall of the dual OS.

I've never used the program but that's all I would do.


Difference between sh file.sh and file.sh

The script probably knows which shell it should be running in. The first line might be something like

#!/bin/bash

If you run it with sh, the first line (a.k.a. shebang) is ignored. A different shell tries to run the script, but does not understand it - it is like running Java code in Pascal. If you run it with the right shell, it should behave identically:

/bin/bash script.sh


16.04: Elantech touchpad not working on new laptop

I would suggest trying the libinput driver. It's much newer than evdev and synaptics and fixed some issues I had with the Elan touchpad on the computer I use. It also supports most of the hardware of other drivers supported, including some graphics tablets. Instructions:

Install the package xserver-xorg-input-libinput

sudo apt install xserver-xorg-input-libinput

Uninstall xserver-xorg-input-evdev

sudo apt remove xserver-xorg-input-evdev

Uninstall xserver-xorg-input-synaptics

sudo apt remove xserver-xorg-input-synaptics

Reboot and see if things work better.


Which software is used in Ubuntu for supporting Gill sans font Just like MS Office in Windows

Once the font was installed in Ubuntu any software will be able to use it. See the following question on how to install a font:

How do I install fonts?

Gillius, a "purified variation" of the Gill sans font from Arkandis Digital Foundry can even be installed from the Ubuntu Software Center:


How to bootstrap puppetmaster on lxc on Ubuntu?

The script:

#!/bin/bash

puppetmaster=puppetmaster
puppetmasterfqdn=puppetmaster.fqdn.name
puppetuser=adam
gitlocation=/home/puppet.git
puppetauth=`cat ~/.ssh/id_rsa.pub`
puppetip='10.0.3.90'
puppetgetewayip='10.0.3.1'

#mycodename=`lsb_release -c | perl -pe 's/^Codename:\s*(.*)$/$1/'`
mycodename=saucy

######################################

mydir="/var/lib/lxc/$puppetmaster/rootfs"

#lxc installation

sudo dpkg -s lxc>/dev/null
if [ $? -eq 0 ]; then
    echo "lxc already installed!"
else
    sudo apt-get --yes install lxc
fi

#Container creation

sudo lxc-ls | grep $puppetmaster >/dev/null

if [ $? -eq 0 ]; then
    echo "Container '$puppetmaster' already created!"
else
    sudo lxc-create -t ubuntu -n $puppetmaster -- -r $mycodename
fi

#Container's hostname

sudo grep $puppetmasterfqdn $mydir/etc/hostname >/dev/null
if [ $? -eq 0 ]; then
    echo "Puppet master's name is correctly set to FQDN!"
else
    echo $puppetmasterfqdn | sudo tee $mydir/etc/hostname >/dev/null
fi

host=`sudo grep -E ^127\.0\.1\.1 $mydir/etc/hosts`
if [ $? -eq 0 ]; then
    echo $host | grep "$puppetmasterfqdn" >/dev/null
    if [ $? -eq 0 ]; then
        echo "Puppet master's name is correctly set in hosts!"
    else
        sudo sed -i.old "s/^127\.0\.1\.1\s*/127.0.1.1 $puppetmasterfqdn /" $mydir/etc/hosts
    fi
else
    echo "127.0.1.1\t$puppetmasterfqdn" | sudo tee -a $mydir/etc/hosts >/dev/null
fi

#Montowanie puppet.git

sudo mkdir -p $mydir/mnt/puppet.git
sudo grep rootfs/mnt/puppet.git $mydir/../fstab >/dev/null
if [ $? -eq 0 ]; then
    echo "Puppet git repository is already mounted!"
else
    echo "$gitlocation $mydir/mnt/puppet.git none bind 0 0" | sudo tee -a $mydir/../fstab  >/dev/null
    sudo lxc-info -n $puppetmaster |grep RUNNING >/dev/null
    if [ $? -eq 0 ]; then
        sudo lxc-stop -n $puppetmaster
    fi
fi

#Network setup
sudo grep $puppetip $mydir/etc/network/interfaces >/dev/null
if [ $? -eq 0 ]; then
    echo "Static ip on the container is already set!"
else
    sudo sed -i "iface eth0 inet dhcp/iface eth0 inet static \naddress $puppetip\nnetmask 255.255.255.0\ngateway $puppetgetewayip/" $mydir/etc/network/interfaces
fi

#Container startup

sudo lxc-info -n $puppetmaster |grep RUNNING >/dev/null
if [ $? -eq 0 ]; then
    echo "Container is '$puppetmaster' already running!"
else
    sudo lxc-start -d -n $puppetmaster
    sleep 5
fi

#Learning the assigned dynamic IP. Static IP will be assigned later.

myip=`sudo lxc-info -n $puppetmaster -i | grep -oE "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"`
echo "puppetmaster IP = $myip"

#Preparing the puppet's configuration bare repository for cross-container mount

mount | grep $gitlocation >/dev/null
if [ $? -eq 0 ]; then
    echo "Mount point '$gitlocation' is already declared"
else
    sudo mount --bind $gitlocation $gitlocation
    sudo mount --make-unbindable $gitlocation $gitlocation
    sudo mount --make-shared $gitlocation $gitlocation
fi

#Puppet release.deb

if sudo [ -f $mydir/tmp/puppetdeb.deb ]; then
    echo "Puppet release deb already exists!"
else
    sudo wget -O $mydir/tmp/puppetdeb.deb http://apt.puppetlabs.com/puppetlabs-release-$mycodename.deb
fi

#Second stage script

sudo tee $mydir/tmp/bootstrap-puppetmaster-insider.sh >/dev/null <<EOT
#!/bin/bash

getent passwd $puppetuser >/dev/null
if [ \$? -eq 0 ]; then
    echo "user $puppetuser already exists"
else
    usermod -l $puppetuser -d /home/$puppetuser ubuntu
    groupmod -n $puppetuser ubuntu
    sudo mv /home/ubuntu /home/adam
fi

if [ -d /home/$puppetuser/.ssh ]; then
    echo "'.ssh' folder already exists"
    sudo chown $puppetuser:$puppetuser /home/$puppetuser/.ssh
else
    sudo mkdir -p /home/$puppetuser/.ssh
    sudo chown $puppetuser:$puppetuser /home/$puppetuser/.ssh
    sudo chmod 0700 /home/$puppetuser/.ssh
fi

id $puppetuser | grep sudo >/dev/null
if [ \$? -eq 0 ]; then
    echo "user $puppetuser already is a sudoer"
else
    sudo usermod -a -G sudo $puppetuser
fi

if [ -f /home/$puppetuser/.ssh/authorized_keys ]; then
    echo "File .ssh/authorized_keys already exists"
else
    sudo -u $puppetuser touch /home/$puppetuser/.ssh/authorized_keys
fi

sudo grep "$puppetauth" /home/$puppetuser/.ssh/authorized_keys >/dev/null

if [ \$? -eq 0 ]; then
    echo "proper key in authorized_keys already present"
else
    echo $puppetauth | sudo -u $puppetuser tee /home/$puppetuser/.ssh/authorized_keys >/dev/null
fi

sudo dpkg -s puppetlabs-release>/dev/null
if [ \$? -eq 0 ]; then
    echo "puppetlabs-release is already installed!"
else
    sudo dpkg -i /tmp/puppetdeb.deb
fi

sudo dpkg -s puppetmaster>/dev/null
if [ \$? -eq 0 ]; then
    echo "puppetlabsmaster is already installed!"
else
    sudo apt-get update
    sudo apt-get --yes install puppetmaster
fi

sudo dpkg -s git>/dev/null
if [ \$? -eq 0 ]; then
    echo "git already installed!"
else
    sudo apt-get --yes install git
    sudo -u $puppetuser git config --global push.default simple
fi

sudo puppet module list|grep  puppetlabs-puppetdb>/dev/null
if [ \$? -eq 0 ]; then
    echo "PuppetDB module already installed!"
else
    sudo puppet module install puppetlabs-puppetdb
fi

sudo puppet agent --test --server $puppetmasterfqdn

sudo puppet apply /tmp/puppetdb.pp

if [ -d /etc/puppet/.git ]; then
    echo "Git repository is already clonned!"
else
    if [ -d /etc/puppet.old ]; then
        sudo rm -r /etc/puppet.old
    fi
    sudo mv /etc/puppet /etc/puppet.old
    user=`whoami`
    sudo git clone /mnt/puppet.git /etc/puppet
    sudo chown -R $puppetuser:$puppetuser /etc/puppet
fi

grep "export LANG=C.UTF-8" /etc/default/puppetmaster >/dev/null
if [ \$? -eq 0 ]; then
    echo "UTF-8 is properly set"
else
    echo "export LANG=C.UTF-8" | sudo tee -a /etc/default/puppetmaster
    sudo service puppetmaster restart
fi

sudo chown -R $puppetuser:$puppetuser /home/$puppetuser

EOT

sudo tee $mydir/tmp/puppetdb.pp >/dev/null <<'EOT'
node puppetmaster {
  # Configure puppetdb and its underlying database
  class { 'puppetdb': database => 'embedded'}
  # Configure the puppet master to use puppetdb
  class { 'puppetdb::master::config': }
}
EOT

sudo chmod +x $mydir/tmp/bootstrap-puppetmaster-insider.sh

# Disabling use of DNS on ssh

sudo lxc-attach -n $puppetmaster -- bash -x "/tmp/bootstrap-puppetmaster-insider.sh"

tmp=$(sudo grep -E '^UseDNS' $mydir/etc/ssh/sshd_config)
if [ $? -eq 0 ]; then
    echo $tmp | grep UseDNS >/dev/null
    if [ $? -eq 0 ]; then
        echo "Puppet master's sshd is correctly configured to skip reverse DNS!"
    else
        sudo sed -i.old "s/^\s*UseDNS\s*.*$/UseDNS no/" $mydir/etc/ssh/sshd_config
    fi
else
    echo "UseDNS no" | sudo tee -a $mydir/etc/ssh/sshd_config >/dev/null
    sudo lxc-attach -n $puppetmaster -- service ssh restart
fi

tmp=$(sudo grep -E '^iface eth0 inet dhcp$' $mydir/etc/network/interfaces)
if [ $? -eq 0 ]; then
    sudo sed -i.old "s/iface eth0 inet dhcp/iface eth0 inet static\naddress $puppetip \nnetmask 255.255.255.0 \ngateway $puppetgetewayip/" $mydir/etc/network/interfaces
else
    tmp=$(sudo grep -E '^iface eth0 inet static$' $mydir/etc/ssh/sshd_config)
    if [ $? -eq 0 ]; then
        echo "Networking is already configured with static IP on $puppetmaster!"
    else
        echo "### Cannot configure static IP on $puppetmaster! Please configure networking manually."
    fi
fi

tmp=$(sudo grep -E '^iface eth0 inet static$' $mydir/etc/ssh/sshd_config)

echo "puppetmaster IP = $myip"


How to install programs into user directory without sudo

The deb file that is downloaded and installed when you run apt-get install  is basically a build of the source code with most options  already set. This includes the location where it would be installed, probably /usr/some_folder.

This means you cannot change this location by using a deb file. The only way to do this is to get the source code, modify it and then install it.


I answer my question. I needed to install the wetab's chrontel tiitoo driver from http://update.tiitoo.com/source/packages/ There is no .deb package, some manipulation of the .rpm package was needed.

I don't know if this driver will be helpful for another tablets, mine is an ekoore perl (a wetab/exopc clone)

Me respondo yo mismo. Tuve que instalar el driver de chrontel de http://update.tiitoo.com/source/packages/ No hay paquete .deb, tuve que manipular el .rpm

Mi tableta es una ekoore perl (el mismo hardware que la wetab o la exopc). No sé si este controlador servirá para otras tabletas


installation of ubuntu 12.04 starting but not getting completed

I would suggest:

Try installing the system once again but don't select to download updates during installation. You can do that later too. If this does not help:
As md5 hashes of iso are correct, I don't see anything else except burning the iso image again ( on another cd or pen drive, if you have one) and try installing then.

See if it helps.


You will possibly also have a Chrome .desktop file in ~/.local/share/applications. Probably when you type "chrome" in Dash, it will appear as well. Just remove the local one.

Another possibility, even more likely since it is called "Facebook", is that you have a (presumably local, in ~/.local/share/applications) .desktop file called Facebook, using Chrome. Webapps do leave a .desktop file.

When looking for the right .desktop file to remove, it is good to know that the filename of the .desktop file can be different from the name you see in Nautilus (and Dash/Unity!); if the file is in /usr/share/applications, or if it is executable and in ~/.local/share/applications, the displayed name is defined in the Name= line of the file, and is different from its actual filename.

Either which way, you must have mutiple occasions of desktop files, calling Chrome in their native command, That is: the command in the headsection of the desktop file (above the Actions= line). Look in both /usr/share/applications and ~/.local/share/applications for duplicates. If you are not sure you picked the right one to remove, open it with gedit, see what is in the line after Actions= If the defined shortcuts match the "right" version (New incognito window, New Window etc.), keep it. Another tip to identify: local .desktop files (in /usr/share/applications) show their icon if you make them executable. If you suspect a file, make it executable to see if the icon matches your "secundary" Chrome .desktop file.


Install ubuntu 16.04 on existing xubuntu 16.04 without losing data

Yes you can install it mount the previous partition on the same location uncheck format option.


Mapping and accessing all terminals in a LAN

Use caution that you're not trying to accomplish something nefarious with this question.

Finding the computers

1) If your computer has been connected to the network for a while, you can do an arp command. Read the man page with man arp Example:

arp -a

2) You can ping the broadcast address and see which machines reply. Keep in mind that this only works if the machine is online and is also not previously configured to ignore ping traffic. Usually the broadcast ends with .255. Find your address with ifconfig and then ping the broadcast.

ifconfig
ping x.x.x.255

Running the Script

The real problem is the script. If you're an admin, you should already have this access. You must be a user on each machine that you want to execute the script on. That means that you must have your own account with proper credentials or you need to have a legitimate admin account on each machine, for service and maintenance. Provided that you've already written the script, you could then deploy it to all of your terminals and execute.


Partition Scheme for Dual boot on SSD with 16GB RAM

I have a very similar setup. My rule of thumb is to use 25 GB for root (Ubuntu system), around 45 GB for /home, and to set up a small swapfile on the system partition as well. I handle the swapfile with systemd-swap, because of the ample RAM with 16 GB, I have set it to have a default 128 MB swapfile which can grow to 512 MB if necessary.

It is not needed in 99% of computer use, but it helps to shut down something gracefully in case of a memory hog. You cannot hibernate, but this is generally more of a hassle than it is worth. My system starts up in less than 18 s according to systemd-analyze, that's good enough for me. For short interruptions, you can always use suspend instead of hibernate.

The rest is left to the Windows 10 partition. Depending on disk size and needs, the ratio of /home to Windows 10 can vary, but don't use less than 60 GB for the Windows 10 partition. This is for light Windows 10 usage with one or two essential programs and no games.

You don't strictly need a separate /home partition, but I find it very helpful to separate the system from the data at backup time and for migrations. Partition-based backups have clear separations if you want to set up a clean system, your personal data is not littered with system files.


Can I control which session I want to login at Grub loading?

As far as I know, Ubuntu runlevels 2-5 are the same. Just modify runlevel 3 or 4 to achieve your needs. In GRUB, add a new line to it with your newly created runlevel.

In /etc directory, there are rcX.d directories, which controls services on different runlevels. As I see, rc3.d contains the same links as rc2.d to services in /etc/init.d, so create a new GRUB entry and put "3" at the and of the line without quotes (this will start your system on runlevel 3). Start this, set up a different graphical environment. After restart, this entry should meet your needs, I think.


Wrong video card driver loaded by the system fater updates. Ubuntu 12.04

Refer this link:

https://help.ubuntu.com/community/BinaryDriverHowto/AMD

check with lsmod command, find what video card is loaded.


To re-enable the 7 and the & keys, run this:

xmodmap -e 'keycode 16=7 ampersand'


How to remove application in ufw app list Available applications?

From the article Firewall of Ubuntu documentation:

  Applications that open ports can include an ufw profile, which details
  the ports needed for the application to function properly. The
  profiles are kept in /etc/ufw/applications.d, and can be edited if
  the default ports have been changed.

I do not think the presence of these application profiles could be a problem in any way, but you can remove UFW's Apache profile by the command:

sudo rm -R /etc/ufw/applications.d/apache2*

To find which service is using HTTP|HTTPS ports 80|443 use this command:

sudo lsof -i -n -P +c 0 | grep ':80\|:443'

I don't know which version of Ubuntu is, but in 99% to remove Apache2 completely you should use:

sudo apt update
sudo apt remove --purge apache2*
sudo apt-get autoremove && sudo apt autoclean


Ubuntu joining a active directory domain

Try Likewise

  Likewise Open graphical desktop utility for joining hosts to Active
  Directory domains.

To install Likewise, just click on the image below:

Source:Ubuntu Apps


How to make a UEFI compatble ISO with grub-mkrescue?

mount Stick

sudo mount -t vfat /dev/sdX /mnt
Install another Grub2 to USB:

sudo grub-install --no-floppy --force --root-directory=/mnt /dev/sdX
Copy iso to stick

cp -v ~/live-cd.iso /mnt
Add following to /mnt/boot/grub/grub.cfg

set default="0"
set timeout=10

insmod fat
set iso_path=/live-cd.iso
loopback loop (${usb})${iso_path}
set root=(loop)
set bootopts="boot=casper iso-scan/filename=${iso_path} noprompt"

menuentry "Boot ISO from HDD/USB" {
linux (loop)/casper/vmlinuz $bootopts
initrd (loop)/casper/initrd.img
}

Source: https://help.ubuntu.com/community/MakeALiveCD/DVD/BootableFlashFromHarddiskInstall#Appendix_2._How_to_Make_bootable_USB_flash

It may solve your problem


Where are files saved when created in a WSL terminal window?

Method 1
While in the Ubuntu terminal enter:
explorer.exe .

Note the . at the end. This will open a File Explorer window where you are at in Ubuntu.

Method 2
Open File Explorer in Windows the usual way:

Then at the top type:
\\wsl$\Ubuntu\home\<Your Ubuntu Username>

Source: https://winaero.com/blog/access-wsl-linux-files-file-explorer-windows-10/
Note: Text files created in Ubuntu uses different conventions for new lines as compared with Windows. If you edit these files using Windows tools they may not work as before in Ubuntu. Messing with Ubuntu system files via Windows Explorer may corrupt those files.
Warning
Do not change Linux files using Windows apps and tools
DO NOT, under ANY circumstances, access, create, and/or modify Linux files inside of your %LOCALAPPDATA% folder using Windows apps, tools, scripts, consoles, etc.
Opening > files using some Windows tools may read-lock the opened files > and/or folders, preventing updates to file contents and/or metadata, > essentially resulting in corrupted files/folders.
Creating/changing Linux files in your Appdata folder from Windows will likely result in data corruption and/or damage your Linux environment requiring you to uninstall & reinstall your distro!
Hope this helps


Not a "Is there a way to set this speed without this workaround?" – answer. But perhaps some help. You might found a solution by @RickGreen-Turbo 's comment-link, but add some.

To identify mouse use:

$ xinput list
# or
$ xinput --list --short

    # Should give you something like:
    ⎡ Virtual core pointer                      id=2    [master pointer  (3)]
    ⎜   ↳ Virtual core XTEST pointer            id=4    [slave  pointer  (2)]
    ⎜   ↳ Logitech USB-PS/2 Optical Mouse       id=8    [slave  pointer  (2)]
    ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
        ↳ Virtual core XTEST keyboard           id=5    [slave  keyboard (3)]
        ↳ Power Button                          id=6    [slave  keyboard (3)]
        ↳ Power Button                          id=7    [slave  keyboard (3)]
        ↳ AT Translated Set 2 keyboard          id=9    [slave  keyboard (3)]
        ↳ HP WMI hotkeys                        id=10   [slave  keyboard (3)]

In your case it might be something like Logitech USB Trackball.

To list current settings say:

xinput --list-props [<id_number> | "String Identifier"]

E.g. (in my case):

$ xinput --list-props 8
Or
$ xinput --list-props "Logitech USB-PS/2 Optical Mouse"

Not sure about this, but my guess is, that id could change between boots. As stated here:

  "The id is a number in the range 0-128 that uniquely identifies the device.
  It is assigned to the device when it is initialized by the server."

So in a script, when modifying, use the string variant. (Perhaps this is what is wrong with your old configuration?)

It yields (for me):
    Device 'Logitech USB-PS/2 Optical Mouse':
        Device Enabled (132):   1
        Coordinate Transformation Matrix (134): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (261): 0
        Device Accel Constant Deceleration (262):   1.000000
        Device Accel Adaptive Deceleration (263):   1.000000
        Device Accel Velocity Scaling (264):    10.000000
        Device Product ID (251):    1133, 49181
        Device Node (252):  "/dev/input/event3"
        Evdev Axis Inversion (265): 0, 0
        Evdev Axes Swap (267):  0
        Axis Labels (268):  "Rel X" (142), "Rel Y" (143), "Rel Vert Wheel" (260)
        Button Labels (269):    "Button Left" (135), "Button Middle" (136), "Button Right" (137), "Button Wheel Up" (138), "Button Wheel Down" (139), "Button Horiz Wheel Left" (140), "Button Horiz Wheel Right" (141), "Button Side" (255), "Button Extra" (256), "Button Forward" (257), "Button Back" (258), "Button Task" (259), "Button Unknown" (254), "Button Unknown" (254), "Button Unknown" (254), "Button Unknown" (254)
        Evdev Middle Button Emulation (270):    0
        Evdev Middle Button Timeout (271):  50
        Evdev Third Button Emulation (272): 0
        Evdev Third Button Emulation Timeout (273): 1000
        Evdev Third Button Emulation Button (274):  3
        Evdev Third Button Emulation Threshold (275):   20
        Evdev Wheel Emulation (276):    0
        Evdev Wheel Emulation Axes (277):   0, 0, 4, 5
        Evdev Wheel Emulation Inertia (278):    10
        Evdev Wheel Emulation Timeout (279):    200
        Evdev Wheel Emulation Button (280): 4
        Evdev Drag Lock Buttons (281):  0

Find the values you want to change and add them to start-up script.

For testing e.g.:

$ xinput --set-prop 8 "Device Accel Velocity Scaling" 50
$ xinput --set-prop 8 "Device Accel Constant Deceleration" 1.5

The (related) properties:

Device Accel Adaptive Deceleration
Device Accel Constant Deceleration
Device Accel Profile
Device Accel Velocity Scaling

are documented here. (Look around the same page for more information if you want.)

Add hack that works for your mouse in a file and save it to e.g. ~/.bin/my_mouse_hack

e.g:

#!/bin/bash
xinput --set-prop "Logitech USB Trackball" "Device Accel Velocity Scaling" 75
xinput --set-prop "Logitech USB Trackball" "Device Accel Constant Deceleration" 1.5

Make it executable:

$ chmod 700 ~/.bin/my_mouse_hack

Now: To set this to run at start-up. Add this to .bash_profile as stated here. (I'm in the middle of a load of work, coding, compiling etc. so I won't test this now. But I'll do later and update answer.)

Or add it to by choosing "Add" in (If you use GNOME):

Alt+F2 gnome-session-properties Enter.

Or by X11 config or similar.

EDIT 1: suspend quirk

See you have some problems with resume after suspend.

When the computer goes into or resumes suspend/hibernate mode it runs scripts located in /etc/pm/sleep.d and /usr/lib/pm-utils/sleep.d. man pm-action.

When going down scripts are run with argument suspend or hibernate, when resuming the argument is resume and thaw respectively – that is: in your script $1 is either of the four.

Scripts, aka "hooks", in these directories are, AFAIK, categorized in two blocks.

/usr/lib/pm-utils/sleep.d  Distribution / package provided hooks
/etc/pm/sleep.d            Administrator provided hooks

Also; if you want to disable a script that reside in /usr/lib/pm-utils/sleep.d create an empty file in /etc/pm/sleep.d with the same name and don't make it executable.

A last file to mention is /var/log/pm-suspend.log. This file has information about last suspend/hibernate and resume/thaw – and by convention is a good place to add your own logging. It also is a good place to look for errors. If a script fails, it should be logged here.

A simple script 01_test:

#!/bin/bash

ts=$(date)

case "$1" in
"hibernate"|"suspend")
    printf "; %s: going down by \`%s'\n" "$ts" "$1" >> /var/log/pm-suspend.log
    ;;
"resume"|"thaw")
    printf "; %s: waking up by \`%s'\n" "$ts" "$1" >> /var/log/pm-suspend.log
    ;;
esac

Then

$ sudo chmod 755 /etc/pm/sleep.d/01_test

Suspend and wake up, cat log and see:

$ cat /var/log/pm-suspend.log
; Sun Jan 13 06:38:14 CET 2013: going down by `suspend'.
...
; Sun Jan 13 06:38:19 CET 2013: waking up by `resume'.

OK. That works. Now what you want is to set mouse by xset etc. It would be tempting to believe that a simple line like

xset m 14/1 1

In a script in /etc/pm/sleep.d would suffice, but if you try (no harm by trying), you'll see some error in the log file. There is at least two issues. 1: xset require a display 2: root most likely does not have an Xsession.

To resolve this one could specify a user environment etc. by adding a line like this instead:

su YOUR_USERNAME -c "xset -display :0 m 14/1 1"

but as this is a global script one would presumably do it a bit more complex. This script check for users that are logged in and have an :0 display, check if they have an executable file in /home/user/bin/ named .resume that is executable; if so executes it 01_user_resume:

#!/bin/bash

# Time(stamp)
ts=$(date)
# Log file
log="/var/log/pm-suspend.log"
# Array of Users
#   Users (finger/who/w ... etc)
#   Having Xsession (:0)
#   Unique
declare -a users=($(/usr/bin/finger | \
        /bin/grep ':0'| \
        /bin/grep -o '^\w*' | \
        /usr/bin/uniq))
# Array of scritps to look for (using array as it is easy to extend)
declare -a user_scripts_resume=(".resume")

# Run resume script fo all users with X session
run_user_scripts_resume()
{
    local user  # Each user
    local home  # Users home
    local scr   # Script to check for and run
    for user in "${users[@]}"; do
        printf ";; For User: %s.\n" "$user" >> "$log"
        # Identify users home directory
        home=$(/usr/bin/getent passwd "$user" | cut -d: -f6)
        # If user has a file called $HOME/bin/<sctipt> and it is
        # executable then run it
        for scr in "${user_scripts_resume[@]}"; do
            if [ -f "$home/bin/$scr" ] && [ -x "$home/bin/$scr" ]; then
                printf ";;   Executing: $home/bin/$scr\n" >> "$log"
                # DISPLAY is needed by e.g. xset
                /bin/su "$user" -c "export DISPLAY=:0; $home/bin/.resume"
            fi
        done
    done
}

case "$1" in
"hibernate"|"suspend")
    printf "; %s: going down by \`%s'.\n" "$ts" "$1" >> "$log"
# Nothing to do
    ;;
"resume"|"thaw")
    printf "; %s: waking up by \`%s'.\n" "$ts" "$1" >> "$log"
    printf "; Executing User resume scripts.\n" >> "$log"
    run_user_scripts_resume
    ;;
esac

So:

Add that script to a file in /etc/pm/sleep.d/01_user_resume.
Make it executable: sudo chmod 755 /etc/pm/sleep.d/01_user_resume

In your home directory create the file bin/.resume - and add e.g. (err see Edit 2 below):

#!bin/bash

sleep 3  # See note on EDIT 2: below
xset m 15/1 1

Make it executable: chmod 700 bin/.resume

Or, better, use same script for boot and resume – aka re-run the script you used to set mouse on boot.

Suspend and resume. Check if settings has changed by:

xset q
# or
xset q | grep -A 1 Pointer

EDIT 2: Mouse move

Testing this it seems like there is yet another problem. The xset q | grep -A 1 Pointer command reveals that the settings are changed, problem is that once the mouse is used - it reverts. For me this was fixed by adding sleep 1 before xset in the .resume script. You might want to use a longer sleep time to be sure.

Changed so that script was last executed, according to the log file, but this did not help - probably because the scripts seems to be executed in sub-shells - so some process from an earlier script might get executed after last script is executed.


I fixed this by creating a new virtual environment

A new virtual environment can be created by:

python3 -m venv /tmp/newvenv

Then I checked if pip works ok in the new virtual environment:

cd /tmp/newvenv/bin
./pip3

This gave me the normal message as in the following:

Usage:
  pip  [options]

Commands:

install                     Install packages.

download                    Download packages.

...

However, pip3 still has failed.

    pip3

This still gave me the error message.

Then I decided to copy working versions of pip to the home directory. For the below two steps (#3 and #4) you may want to keep backup copies.

I have overwritten pip and pip-9.0.1.dist-info from the virtual environment to home directory:

cp -r /tmp/newvenv/lib/python3.5/site-packages/pip ~/.local/lib/python3.5/site-packages/
cp -r /tmp/newvenv/lib/python3.5/site-packages/pip-9.0.1.dist-info ~/.local/lib/python3.5/site-packages/

I also copied the following two files:

cp /tmp/newvenv/lib/python3.5/site-packages/pkg_resources/__init__.py ~/.local/lib/python3.5/site-packages/pkg_resources/
cp /tmp/newvenv/lib/python3.5/site-packages/pkg_resources/py31compat.py ~/.local/lib/python3.5/site-packages/pkg_resources/

After these steps pip3 is working ok in my case.


Lenovo X1 Carbon is not charging battery even if plugged into AC

Looks like the problems was in power adaptor I bought in some shady shop over the Internet. After switching back to original power supply problem dissolved.


Application menu only on maximised windows?

I agree with you, and there's a quick FIX:

echo "export UBUNTU_MENUPROXY=" | sudo tee /etc/X11/Xsession.d/81ubuntumenuproxy

BTW, there's a BUG submited to Launchpad about this.


kernel is spewing ata link up messages every second

You may have Aggressive Link Power Management enabled. This puts the SATA host bus adapter into a low-power state during periods of inactivity.
The per-host policy setting is in:
/sys/class/scsi_host/host*/link_power_management_policy

so to disable ALPM for say host0, try:
echo max_performance | sudo tee /sys/class/scsi_host/host0/link_power_management_policy

..you may need to apply this to all the host devices to see if this helps.


That's purely “by accident”. Missing dependencies only start to cause problems once you try to

use their functionality or
install, upgrade, or remove packages via Apt and its front-ends (like Synaptic).


How to visualize Indic characters in Ubuntu minimum installation from base image?

Install the packages for Noto Fonts. The package fonts-noto-core covers common unicode characters.
sudo apt install fonts-noto-core

If you need more unicode characters, run apt search noto, and install the package you would need. Alternatively, use synaptic to find the appropriate package.


If you are running a version of Ubuntu with a GUI, try entering http://localhost into the address bar of your web browser. This should show the default configuration page for Apache2. If it doesnt, then run sudo systemctl apache2 start, then try your browser again. If you don't have a GUI on the local machine, access it by entering http://(server IP address) into the address bar of another machine, but otherwise the process is the same.


I was encouraged to turn my comments into an answer by Beqa Arabuli and fossfreedom. I posted the solution first in the comments, but bigbadonk420 just put a similar answer. Nevertheless, because it was my idea initially it is legitimate to put another answer here.

It is most likely not an Ubuntu problem as you have changed browsers, reinstalled the OS and done everything that could reasonably be done. The fact that your ping to profile.ak.fbcdn.net is idle means that your are not resolving the address at all (the ping is not being silently blocked as I can ping it successfully). This means that it is probably a dns related issue; you can resolve facebook.com, but not all its content delivery networks (cdns).

That is why other internet sites are fine, but facebook is affected; there must be some kind of misconfiguration in your isp's dns records, or they are blocking the Facebook cdn for some reason. If they are using a transparent proxy perhaps the facebook cdns are getting swept up with that. Anyway, it is impossible to know the exact reason without contacting your isp.

However, the best thing to do is to try an alternative dns; there are several alternatives, but probably the best is Google dns. More information is available from here; you need to set your primary dns as 8.8.8.8 and your secondary as 8.8.4.4 in your Ubuntu network settings and then reboot. You must make sure that your dns is not automatically being set to your original isp's dns. There are more instructions here relating to the setup of Google dns, but it is straightforward and should allow you to solve your problem without contacting your isp.

Go to network-manager > select your connection > click edit and then select the ipv4 tab (if you are on ipv4 as most people are). The screenshot is below: change automatic dhcp to automatic (DHCP) addresses only and enter the dns details in the box provided:


To understand the behaviour of script when running over SSH

The command after the pipe symbol gzip -c >  /sql/mybackup.sql.gz is running on your local machine.

You should use

/usr/bin/ssh -p 82001 user@remotehost  "mysqldump -u db_user -pSomePass mydb |  gzip -c >  /sql/mybackup.sql.gz"

Example:

% ssh user@host "echo remote" | echo local
local
user@host's password:

% ssh user@host "echo remote | echo local"
user@host's password:


Is there a gnote lens for unity available?

Instead of looking for Gnote-lens, you can place Gnote icon on the system tray at the right-top of your desktop and use it the way you use Tomboy by following the trick from this site:

http://www.irrational.net/2012/04/27/moving-from-tomboy-to-gnote/

I tried that, and happy to use it.


Instead of executing the command directly in cron better create sample script and source there your .bashrc or .bash_profile to set variables like ORACLE_BASE, PATH, ORACLE_SID:

#!/bin/bash
source ~/.bashrc
/u01/app/oracle/product/11.2.0/dbhome_1/bin/expdp user/pass schemas=schema directory=directory dumpfile=expdpbakup.dmp logfile=expdplog.log

and add in cron:

0 9 * * * /path/to/the/script.sh


Open PCManFM.  Choose Edit->Preferences.  Navigate to the bottom and set your View Mode.


If you're using bash, there's no need to invoke an external command such as cut for this: you can use the shell's built-in parameter expansion functions.

For example to remove the longest trailing string starting with / from variable str='1000/1.0' and assign the result to variable str1

str1="${str%%/*}"

So

$ str='1000/1.0'
$ str1="${str%/*}"
$ echo "$str1"
1000

See the excellent BashFAQ/073


OS drive failure and RAID5 mdadm question

If you've already assembled the array successfully then the remaining steps need not be feared.


Replacing Windows XP completely to Ubuntu (booting issues)

On windows I will suggest you to use universal-usb-installer to create a bootable USB with Ubuntu .

Once you have created bootable usb with it, boot with it.

Select you USB stick in boot option upon start-up  by pressing F12(key may be different).
Alternatively you can change your boot order from BIOS setup.


Can't use netbook (samsung nc10) touchpad after lubuntu update (12.04)

My samsung N145 touchpad had improved a little from updating to 12.04 on lubuntu though I still need to use synclient to get the tap to click to stop going off as it does...
Have you tried installing the samsung support repo? If not it is worth a go.
You can get the repository for extra samsung support
here


Ubuntu 18.04.2 LTS | Reboot and select proper boot device or insert boot media while trying to dual boot

I changed the boot order from the BIOS to boot to the HDD than the usb stick then it booted to Ubuntu and re installed everything. After the restart I removed the usb stick and GNU GRUB was there to choose from windows or Ubuntu.


I found the answer, the problem lays within the monitor itself.

Apparently the HDMI cable didn't make contact with the ground. solved this after attaching a VGA cable while the HDMI was still connected. As soon as the VGA cable made ground the HDMI image appeared (without the VGA actually connected, ground was enough)


computer is in password lock mode/ in black bios screen? 12.04 64 bit

Here is a link that may help it will allow you to reset your password. password reset


It is possible if Windows mount was done with another uid/gid. Please check your /etc/fstab according to the ArchWiki instructions.

Basically, your mount line should looks like that:

UUID=01CD2ABB65E17DE0 /media/Windows ntfs-3g uid=user,gid=users,dmask=022,fmask=133 0 0

where user is your $USER and users is your group (probably $USER also).


can't complete the installation . please help

I had a similar problem. The issue was that the wifi speed was just too slow, because the Linux driver for my wifi card was not great. You should try two things.

If available your best bet would be to hook into a wired Ethernet connection for the install. If still experiencing problems. Don't update or install 3rd party software during installation. Once Ubuntu is installed you will be able to go to System settings to install proprietary drivers for your card.
If you don't have an Ethernet connection available, try the install without updates or 3rd party software. Then run updates after installing proprietary drivers from system settings -> software and updates -> additional drivers


Macs can't boot multi-catalog CD images, that's why there's a separate 64-bit Mac ISO.

If you're running on an actual Mac made by Apple (not a Hackintosh), grab the 64-bit Mac version.

Link:
What is different about the Mac ISO image?


sudo is used for running command line utilities whereas gksudo is used for running graphical utilities.

While you can run the other with both these commands, it is not advisable to do so. Since lshw is a command line utility, it will work best with sudo.

Also, in the link that you've mentioned, one of the person has posted the use of --.

it tells the app to stop reading options. Without it, gksudo will treat any argument starting with a - as an option to gksudo. When it encounters --, all arguments following will no longer be treated as options to gksudo, and just passed on to the child process.


How to restore plymouth to its original state?

To restore plymouth I had to install Super Boot Loader and install the proprietary driver fix the program offered and then undo the fix (applying and undoing the fix are automated actions that can be done with the click of a button). After that I installed boor-repair and it provided a fresh installation of grub2. With grub restored to its original state, plymouth was fixed.


BIOS freezes when trying to boot from Ubuntu 18.04 LTS live-usb

With BIOS based systems grub does not use Boot flag. But some BIOS must assume Windows and will not boot without some partition having a boot flag on a primary partition. Windows requires a boot flag on a primary NTFS formatted partition to boot.

Live installer in BIOS mode is FAT32 (normally) and needs boot flag on that partition. Some tools (like dd) when used to create live installer, use different methods to create live installer and then it may not look like standard partitions. Not sure which versions, create which type of view from gparted or partition lists.


How to bind "Switch User" in Xubuntu 18.04?

And the answer was:

dm-tool switch-to-greeter

So, to properly bind this sort of stuff, goto Applications > Keyboard > Application shortcuts, from which Add+, and type in the new command (don't forget to remove the old one).

Continuing on this topic, I recently found one addition - Suspand, which also trips on xflock4 and gives a black screen. Although this is a rough solution, but sudo apt remove light-locker solved the case (and don't forget to remove it from Start-up.


Get the warning when upgrade mysql 5.7 to 8.0 on bionic!

This is a cosmetic warning essentially complaining that a script is using the apt-key command and that in the future the command might change so scripts shouldn't be using it since it's designed for humans to use.


Mouse wheel scroll events persist after hitting meta key

Mouse events and keyboard events are independent.  In addition, the mouse wheel triggers multiple events, not a single event with a range.  You can think of this like a physical mousewheel that has click stops.  Each stop is a single event.  This is why a keyboard key does not cancel a mouse event and why continuing to scroll on your trackpad fires multiple events.


How do I recover my data (e-mail, documents, etc.) after reinstalling Ubuntu?

you simply reinstalled OS or did you format any partitions like ./ or /home? if so you you might have erased all the data you had if you didn't backed it up either. And it's also good if you used the same alias for username, if on previous OS you were Jimmy1 you should've stayed Jimmy1 not to become Jimmy13 or any other username info, because in this way you might have messed it up too.


My computer refuses to use my NVIDIA driver

Unfortunately if your using a mobile nVidia on a laptop (the "m" after the graphic card name) it usually means it's an "Optimus" nVidia card. Optimus is an nVidia technology used on laptop for saving energy: the concept at its core is that when you're not using accelerated applications the integrated non-accelerated video chip (usually an Intel graphic card) is used, while the nVidia GPU is turned on only when necessary.

Problem is that nVidia still does not really support Optimus technology on Linux: simply installing the nVidia drivers as you tried to do won't work because of the hardware architecture of this "hybrid" nVidia cards.

One thing you can do is use Bumblebee which enables Optimus support on laptops (see https://wiki.ubuntu.com/Bumblebee) and should help with dual-monitor configuration (see http://blog.linuxacademy.com/linux/ubuntu-bumblebee-optimus-and-multi-monitor-support/)


Tomboy does not actually have a code for detecting theme changes. Its icon changes automatically because there is a Tomboy icon both in the ubuntu-icon-dark icon theme (used by Ambiance) and in the ubuntu-icon-light icon theme (used by Radiance). That's the recommended way.


If it helps anybody: I re-installed Ubuntu and now it works properly.

It's using the nvidia-driver-418 (not 435 as before). I didn't change anything, Ubuntu chose this automatically now.