Why do we add i386 architecture to dpkg?

You don't need to add the architecture to install the Skype package itself, but you do need it to install all the dependencies.

Also note that you don't need GDebi - the Software Centre is perfectly capable of handling deb files.


Apply LADSPA plugin to input (microphone)

To apply a LADSPA filter on our microphone input we need to combine the following:

Load a LADSPA plugin to a newly created sink (see this question)

pacmd load-module module-ladspa-sink sink_name=<yourname> master=<sinkname> plugin=<plugin> label=<label> control=<option1>,<option2>,[...]

Loopback the microphone input to this sink (see this question)

pacmd load-module module-loopback latency_msec=1

To record this filtered output we choose <name_of_ladspa_sink>.monitor as a recording source.


Short answer: add that line (without the colon) to your ~/.vimrc file

set background=dark

Yup, just edit the vi settings file with vi. Create it if it doesn't exist. You can also address syntax coloring individually. Add this to .vimrc:

hi Comment  term=none  ctermfg=magenta  guifg=Magenta

Vim also supports entire, ridiculously complex suites of syntax color schemes. This comes down to picking a scheme you like from, say vimninjas.com or vim.org, dropping the color scheme file (molokai.vim, say) into the ~/.vim/colors directory that you made just now, and adding this to .vimrc:

colorscheme molokai

Other programmer-friendly .vimrc settings I think you'll like:

set scrolloff=3
set incsearch
set hlsearch
hi IncSearch ctermfg=blue ctermbg=white

Those affect searching, and adjust the view when you move near the top or bottom edge. Add that last line BTW, only if you don't set a color scheme. Yet another thing: I usually find the answer to tricky Vim topics somewhere on vim.wikia.


Purple Screen on Boot NVIDIA 960 and no acces to recovery mode

Step 1 : Uninstall every currently installed NVIDIA software.

Highlight the Ubuntu entry in the GRUB boot menu and press the E key.
Add nouveau.modeset=0 to the end of the linux line - press F10 to boot.

On the login screen press Ctrl+Alt+F1 - enter your user name and your password - execute :

sudo apt-get purge nvidia*
sudo poweroff

Step 2 : Unplug the NVIDIA 650 GPU and plugin the NVIDIA 960 GPU.

Step 3 : Install the latest official NVIDIA drivers from the long-lived branch.

Highlight the Ubuntu entry in the GRUB boot menu and press the E key.
Add nouveau.modeset=0 to the end of the linux line - press F10 to boot.

On the login screen press Ctrl+Alt+F1 - enter your user name and your password - execute :

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


Where should I put a script to put my monitor into standby?

I use below script to turn off the screen after 1 minute of idleness.
Code doesn't belong to me, I just modified it to my needs

You need to install xprintidle

sudo apt install xprintidle
cd ~
mkdir myscripts
cd myscripts

copy and paste the below code into terminal to create a bash script

cat>turnoffscreen.sh<<'EOF'
#!/bin/sh
# Wanted trigger timeout in milliseconds.
IDLE_TIME=$((1*60*1000))
IDLE_WARN=$((((1*60*1000))-((10000))))
# Sequence to execute when timeout triggers.
trigger_cmd() {

   # put your code here, the below command just an example
   xset s blank ; sleep 1 ; xset s activate

}

sleep_time=$IDLE_TIME
triggered=false

# ceil() instead of floor()
while sleep $(((sleep_time+999)/1000)); do
    idle=$(xprintidle)

if [ $idle -ge $IDLE_WARN ]; then
    notify-send --icon=info "Turning off the screen ..."
    sleep 10
    idle_check=$(xprintidle)
       if [ $idle_check -ge $idle  ]; then
        if ! $triggered; then
                 trigger_cmd
                 triggered=true
                 sleep_time=$IDLE_TIME
        fi
     fi

    else

        triggered=false

        # Give 100 ms buffer to avoid frantic loops shortly before triggers.
        sleep_time=$((IDLE_TIME-idle+100))
    fi
done
EOF

then make it executable

chmod +x turnoffscreen.sh

Add it to startup applications list

gnome-session-properties


Open a terminal (you can open a terminal using ctrl+alt+T)
use the following command

sudo update-rc.d -f kdm remove

It will still boot and shutdown graphically but you can disables the splash screen in the grub using the following commands

gksu gedit /etc/default/grub

remove "quiet splash" from the GRUB_CMDLINE_LINUX_DEFAULT= entry
enter the following command to update your grub

sudo update-grub2

reboot


PHP extensions installed through apt are not working

I just tried this:

user@mybox:~$ lxc launch ubuntu:16.04 test
mybox:~$ lxc exec test /bin/bash
root@test:~# apt install php7.0-fpm php7.0-curl
root@test:~# php7.0 -i | grep -i curl
/etc/php/7.0/cli/conf.d/20-curl.ini,
curl
cURL support => enabled
cURL Information => 7.47.0

make sure there is a symlink from /etc/php/7.0/*/conf.d/20-curl.ini to /etc/php/7.0/mods-available/curl.ini


I believe Grub has become corrupted on my computer

Yep it seems that your grub has been corrupted.

First of all burn a live CD or USB and boot into it.

Once in, connect to the internet and download Boot Repair (Link at the bottom or enter commands below)

The commands you need from the website are as follows :

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

sudo apt-get install -y boot-repair && boot-repair

Enter these into the terminal and it will install Boot Repair.

This tool will help you reinstall grub, it is fairly simple to use but if you need help either consult the documentation (same link) or comment below and I'll see if I can help you out some more!

Hope this helps,

Ross

Boot Repair Link


Proprietary NVidia drivers with EFI on Mac, to prevent overheating

For me, booting Ubuntu in UEFI mode with the Nvidia drivers loaded, also always resulted in the well-known black screen when X was started.
That was until yesterday!
After running into some very promising info in another thread about installing Windows 7 in UEFI mode on a Mac. Folks over there struggled with Windows 7's required int 10h legacy support and found out that in order to work around that, one can perform an unattended installation (because display doesn't work during install). The crucial information to successfully boot Ubuntu in UEFI mode even with Nvidia drivers was that upon start of EFI boot (while handing over to grub), Apple's firmware does not actually activate the VGA card as PCI-E bus master. The Windows' guys explained how to circumvent this using an EFI shell which chainloads the Windows boot manager in order to at least run the setup in unattended mode. And here is the good news: it's easy to do this in GRUB!
In fact, I am right now typing this on a MacBook Pro 7,1 (mid-2010) running Ubuntu Vivid booted in UEFI mode (Xorg.0.log). However, it should be easy to run on or adapt this to any Linux distribution providing an EFI version of GRUB, e.g. Ubuntu 14.04.2 LTS.
~$ dmesg | grep -i efi
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.19.0-15-generic.efi.signed root=UUID=7843c644-e6f4-4d64-9317-0b854cb524f2 ro quiet splash intremap=off acpi_osi=! acpi_osi=Darwin nomodeset vt.handoff=7
[    0.000000] efi: EFI v1.10 by Apple
[    0.000000] efi:  ACPI=0xbf96a000  ACPI 2.0=0xbf96a014  SMBIOS=0xbf71a000

To cut the long story short, we have to set two PCI-E registers: one that enables bus-mastering on the video card and the other one enabling VGA support on the PCI-E bridge of the video card. So it has actually nothing to do with the Nvidia drivers and depending on the viewpoint, not even with Apple's outdated/crippled/you name it EFI implementation.
This is how I solved it. Of course, the kudo's go primarily to the guys on the MacRumors forum.
DISCLAIMER The following instructions are provided as is, without guarantees nor do I assume any liability. DO THIS AT YOUR OWN RISK!

Install Ubuntu in UEFI mode with the Nvidia drivers

I will not go into details here because there are lots of articles on the web showing you how to do this and end up with the nouveau drivers running your machine hot or with the black screen after installing the Nvidia drivers (e.g. www.rodsbooks.com/ubuntu-efi).
Please note however that the following instructions assume you have successfully installed and booted in UEFI mode. You can verify that by checking for existence of the directory /sys/firmware which is only created after booting in EFI mode.

Find the right PCI-E bus identifiers

We need both the IDs for the graphics card and the PCI-E bridge that it is connected to. Issue the following command in a shell:
~$ sudo lshw -businfo -class bridge -class display
pci@0000:00:00.0              bridge         MCP89 HOST Bridge
pci@0000:00:03.0              bridge         MCP89 LPC Bridge
pci@0000:00:0e.0              bridge         NVIDIA Corporation
pci@0000:00:15.0              bridge         NVIDIA Corporation
pci@0000:00:16.0              bridge         NVIDIA Corporation
pci@0000:00:17.0     >!!<     bridge         MCP89 PCI Express Bridge
pci@0000:04:00.0     >!!<     display        MCP89 GeForce 320M

Have a look at (1) the line saying display and (2) the line with bridge right before that display line. Write down the PCI-E bus ids (format XX:YY.Z) of the bridge device (here 00:17.0) and the display device (here 04:00.0) and remember which is which. Note: Those IDs may be different on your machine, depending on your Mac model and revision.

Create a GRUB script for setting the PCI-E registers during boot

Fire up a text editor with sudo nano /etc/grub.d/01_enable_vga.conf and copy/paste the content below. Make sure to paste all 4 lines into that file! Replace 00:17.0 with the PCI-E ID of your bridge device noted in step 2. Replace 04:00.0 with the PCI-E ID of your display device noted in step 2.
cat << EOF
setpci -s "00:17.0" 3e.b=8
setpci -s "04:00.0" 04.b=7
EOF

Finally, make the created file executable and update your grub config files using the following TWO commands.
~$ sudo chmod 755 /etc/grub.d/01_enable_vga.conf
~$ sudo update-grub

Reboot and check

If, after rebooting, the register values have been set to 8 (bridge device) and 7 (display device), everything went fine:
 ~$ sudo setpci -s "00:17.0" 3e.b
 08
 ~$ sudo setpci -s "04:00.0" 04.b
 07

Install Nvidia drivers and enjoy!

Use Ubuntu's Additional drivers GUI to install the Nvidia drivers. I recommend following this article on how to enable brightness controls because it doesn't work out of the box.


How to remove "?" icons from Unity programs list

The icon launchers are found at /usr/share/applications and has the extension .desktop, so all you need to do is remove them from there. For safety try to move them to other place instead of remove them.


Thank you for the help. I ended up just creating a new partition, opening the original disk image with 7 Zip and grabbing the documents I needed and starting again.


Sudo does not recognize my password anymore

Ok, fixed it, but I don't really know what caused it in the first place.

The issue was from a line in /etc/pam.d/common-session-noninteractive

It had

session [success=1 default=ignore] pam_succeed_if.so service in cron
quiet use_uid

And it appears that having this on two lines instead of one was breaking PAM completely.
I just changed it to

session [success=1 default=ignore] pam_succeed_if.so service in cron quiet use_uid

And now everything is back to normal.

I have to thank @AaronD for his comment as it pointed me to investigat PAM, which I found nothing wrong at first (looking at /etc/pam.d/sudo) but when I looked at /var/log/auth.log and noticed all the PAM errors I felt I was digging in the right direction.

The log entry looked like these :

Dec 28 15:43:33 srv12120 sudo: PAM (sudo) illegal module type: quiet
Dec 28 15:43:33 srv12120 sudo: PAM pam_parse: expecting return value; [...use_uid]
Dec 28 15:43:33 srv12120 sudo: PAM (sudo) no module name supplied

A little bit of googling gave me this forum post which gave me the solution highlighted above.


Ubuntu 20.x - Get a list and path of all configuration files that have been modified by user and keep track of changes moving forward

You have to try:

etckeeper for version control of /etc;
debsums to check the changes in /etc with sudo debsums --config --changed --silent


Timeout in a connection to a DHCP server

For setting DHCP client timeout from CLI read this.

You can also just configure DHCP clients configuration file. You can find the guide for that here. On my 12.04 the dhclient.conf  file that you need to edit is uder /etc/dhcp/

So from CLI open the file with this:

sudo nano /etc/dhcp/dhclient.conf

Scroll to the line where it says "#timeout 60;" and remove the "#" sign.
Change the number to set the timeout in seconds.
Press Ctrl + X to exit the editor and save the changes.

If you can't wait until the next reboot then to force Ubuntu to reacquire a new IP address from the DHCP server run:

sudo dhclient -r


installing application packages on ubuntu usb

The problem you're encountering is that by default the USB is loading the Ubuntu Install ISO as a CD which is Read-Only. This means that, yes, "Try Ubuntu" will load Ubuntu into RAM and everything done inside Ubuntu is deleted upon Shutdown of the PC. However, you can create a Bootable USB that does save your Files and Settings.

Simply follow the steps in the Below Guide and make sure to choose the "Stored in reserved extra space" option:

Create a Bootable USB Stick Using Ubuntu - Ubuntu.com


How can I easily install a newer version of python on Ubuntu 14.04 using apt-get without upgrading the entire OS?

Using the newest python version

It is not recommended to change the python version of your system (i.e. with apt-get update python), since many scripts rely on a specific version. You can brake your system and it may cause problems with future updates. Instead, you may want to have a look at virtual environments as answered here.

Using python 3

According to the Ubuntu 14.04.5 manifesto, python 3.4 is now included with trusty by default. You can use it with the command: python3 <path-to-some-optional-script>.

Replace the official repositories / Maintain packages

There is no such thing as the mentioned magical repository. However, there are Personal Package Archives instead, providing newer package version (also triggered by a apt-get update) and are maintained by the community. There is a question covering this topic on SE here.

You can also download .deb files with a newer version and use the tool gdebi to install them. However, you will need to take care of newer versions when using local .deb-files.


This seems working:

gsettings set org.gnome.desktop.background show-desktop-icons false


Time and Date not showing and the options are faded

You need to configure the date/time applet.

sudo dpkg-reconfigure --frontend noninteractive tzdata

And then get Unity to reload it.

sudo killall unity-panel-service


file name auto completion works for ls but not for vi

I guess your /etc/bash_completion.d/vi file got deleted . You should recreate it from e.g. the ls one.

See the GNU page on bash completion for more information, or this example.


Preventing deadly/fatal commands from being run

As I've said in the comments, knowing what you type is the best security.

Here's an example , that has been used in a related question

`base64 --decode <<< "cHJpbnRmICclcycgICdIZWxsbyBXb3JsZCcK"`

( and for completeness, you can use -d flag instead of --decode. Someone who tried editing my answer said -d is invalid, however it's very much valid, specified in the manual)

Do you know what this does ? It's a disguised printf '%s'  'Hello World'. Harmless , right? What if this was rm -rf / ? Blacklisting won't save you when something is disguised. Can you see this command put on a legitimate forum by a malicious user ? Because that does happen. And it doesn't have to be exactly that command - if you are new user and have no idea what you're doing, a malicious user could tell you remove python or some other key package, and that would fix whatever issue that has brought you to their blog or forum.

But sure, you could blacklist something via global function (because functions take precedence over commands or aliases) in /etc/bash.bashrc like this:

function rm{

if [ "$1" = "-rf" ] && [ "$2" = "/" ]
then
    echo "This command is bad juju"
else
    rm "$@"
fi

}

This is just an example. And very redundant one - rm -rf / on Ubuntu by default requires confirmation.

This is also not bulletproof. What if I as attacker use a different shell ? Your bashrc magic won't have power in dash shell , which comes with Ubuntu also by default

Also, are you going to write function to blacklist each and every single malicious command ?

Additional note: copying what appears to be "harmless" command can also be dangerous. See How can I protect myself from this kind of clipboard abuse? and Stephane Chazelas' answer on the subject.


Menu is not visible on ubuntu using VMwareWorkstation 10 on windows 8

Try this solution : go to settings >> display >> uncheck at 3D graphics: Accelerate 3D graphics.
I tried and it worked for me.


Installing MySQL 8 on Ubuntu 18.10 failing

Try aptitude show mysql-server (presuming third-party repositories been configured and apt-get update run).
In my similar case with Nginx (and now with MySQL installed from .deb), I noticed the correct new version at the top of output, while "Provided by" (much like as "to be installed", as seems to me) packages still showed much older version. Continuing with installation, I received the newest version I was looking for.
I'm, unfortunately, unable to check this on clean OS now..


Yes you can, first install this client

sudo apt-get install openvpn

Then change to its dir

cd /etc/openvpn

Download OpenVPN configuration files with command

sudo wget https://nordvpn.com/api/files/zip

In case you will get ERROR: The certificate ofnordvpn.com’ is not trusted., please installca-certificates` package with command

apt-get install ca-certificates

Extract config.zip with command

sudo unzip zip

Remove files which will be no longer used

sudo rm zip

To see the list of all available servers, simply enter ls -al command and it will print full configuration file list.

Choose a server which you would like to connect to.

Start OpenVPN with a chosen configuration by entering

sudo openvpn file name

(for example: sudo openvpn vpn_at_nordvpn_tcp.ovpn).

OpenVPN will ask you for credentials, so simply enter those in with your NordVPN account credentials.

You have successfully connected to VPN. To disconnect from the OpenVPN connection simply open terminal and type Ctrl + C command.

This is adapted from the NordVPN website, this seems the best way to do it but two alternatives are provided there, if you need something different.


First, your test.sh file should look like:

#!/bin/bash

touch /home/zach/test.txt

if you want it to be a bash script.

Second, be sure that this script has permissions of executing. To do so, run this command in terminal:

chmod +x /home/zach/test.sh

Third, be sure that you have permission to create new files in /home/zach.

Fourth, add your new cron job using crontab -e command.


Canon Pixma MX494 driver close enough for MX492?

Yes. In fact, after it is installed the driver describes itself as for the MX490 series.


I have also been unable to find on the net anything related to a real log, only comments like "Do you get any error messages when you start compiz from the console?"; (see also Troubleshooting#Checking for problems - Compiz Wiki).

My guess is that, if one wants error / warning messages from compiz - one has to 'kill' the compiz currently running in the background; and then start a new one which will run in the foreground - which can be achieved usually with a single

compiz --replace ccp

Since the above command is not started with a '&', it will thus run in foreground (not run as background process), and it will thus spit error /warning messages to stdout/err..

Note that "The ccp plugin is required for Compiz to interact with settings made in ccsm"

Hope this is not way off, :)
Cheers!


I Can't receive files via bluetooth on lxde

A bit late for an answer but just for the record :

First : install the package gnome-user-share you can do this from the terminal with sudo apt install gnome-user-share
Then : from the command line do

  gnome-file-share-properties

There : Allow receive files in downloads folder over bluetooth

I don't know why we need to do this, it looks like unity does not expect to receive files over bluetooth ...


You can use the following command in bash like so:

for i in `seq 0 60`; do
  echo `cat /proc/meminfo | grep Active: | sed 's/Active: //g'` >> usage.txt
  sleep 1m
done

This command will record the current memory use to a file named 'usage.txt' every minute for the duration of 1 hour.

If you wish, you can change the usage.txt part of the command to save under a different name. You can also change the sleep 1m command to alter the time between each entry and the '60' in the seq section at the top to change the number of entries to be recorded.

When you have finished making your entries, you will have a text file of entries that can be imported into a spreadsheet for easy comparison.

EDIT:
If you wish to also record the total memory with each entry, you can use the following commands:

for i in `seq 0 60`; do
  echo `cat /proc/meminfo | grep Active: | sed 's/Active: //g'`/`cat /proc/meminfo | grep MemTotal: | sed 's/MemTotal: //g'` >> usage.txt
  sleep 1m
done

These commands will instead record entries in the form of <active>/<total>


Try this:

exec sudo -i
fdisk -l
umount /dev/sdd?
fsck -y /dev/sdd?
dd if=/dev/sdd of=/dev/sdc bs=1M conv=noerror,sync

Change ? for the corresponding partition of /dev/sdd


How can I install modules of python in Ubuntu?

The preferred way to install Python packages in Ubuntu is to install them from the default Ubuntu repositories with apt.
For Python 3.x search for the Python packages in the terminal with the command:
apt search python3-<package>
Replace <package> by the name of the package that you are searching for, e.g. python3-ipython.
For Python 2.x search for the Python packages in the terminal with the command:
apt search python-<package>
Replace <package> by the name of the package that you are searching for, e.g. python-ipython.
If you can't find a Python package that you want to install with apt search, you can install it from PyPI, the official third-party software repository for Python, with pip (for Python 2.x) or pip3 (for Python 3.x).  pip integrates with virtualenv, doesn't do partial installs, can save package state for replaying, can install from non-egg sources, and can install from version control repositories.
Open the terminal and type:
for Python 3.x (python3 is installed by default in Ubuntu 18.04.)
sudo apt install python3-pip

for Python 2.x
sudo apt install python-pip

After a Python package has been installed by python3 -m pip install <package-name> or python -m pip install <package-name>, you can run the following command to check if it is installed:
pip freeze | grep package-name


one.ubuntu.com won't let me upload a large file (using firefox)

Some information elsewhere suggests that Firefox might have a 2Gb limit for POST. It might mean that it's causing a javascript error which is going unnoticed. Could you try with Chrome and let us know if that works for you?


Ubuntu One: Publish file option available in Firefox but not Chrome

There was a small problem yesterday which should be resolved now. If you log out of the site, and then log back in, it should reappear.


How to find out which partition is Ubuntu installed on?

In a terminal, run the command  df  and look at the output.  The column headed "Mounted On" will have a "/" against the partition that holds your root filesystem. This is where your system is installed.


How to install Python 3.5.1 on Ubuntu 16.04 LTS?

Python 3.5.1 is installed on Ubuntu 16.04 by default. You can verify that by running the command python3 --version in a terminal.

Now, IDLE for Python 3 is in the package idle3 and part of the default Python distribution but it's not installed on Ubuntu by default. You can do so with Software Center or your favourite package manager. On the command-line you can run:

sudo apt-get install idle3

If that gives you an error as you say in the comments, please edit your question with the "edit" link below it to include the error messages verbatim (and send me a message in the comments to notify me of the change), or ask a new question with the same information.


Install Fingerprint Driver 138a:0090 on Ubuntu 16.04 (ThinkPad T460s)

I just got the finger print reader (138a:0090) working on my Thinkpad T460p!

Might be a good idea to remove libpam-fprintd if you've alread installed it:
$sudo apt remove libpam-fprintd
Add the repo for libpam-fprintd which supports 138:0090
$sudo add-apt-repository -u ppa:3v1n0/libfprint-vfs0090
Install libpam-fprintd
$sudo apt install libpam-fprintd
Enroll your index finder using:
$fprintd-enroll -f "right-index-finger" "$USER"
Enroll all fingers:
$for finger in {left,right}-{thumb,{index,middle,ring,little}-finger}; do fprintd-enroll -f "$finger" "$USER"; done

See here for more info:
https://github.com/3v1n0/libfprint


Just use:

. /path/to/.test

or:

source /path/to/.test

Or, if you want to keep the output of . /path/to/.test in a variable ENV, then use:

ENV=$(. /path/to/.test)

So, please don't use spaces around the = in assignments.

And later, you can use $ENV variable something  like:

echo $ENV


The GitHub user TheAlphaNerd has written a simple Curses version of Breakout in Python, which you can download from here https://gist.githubusercontent.com/TheAlphaNerd/b3451c543de1ccb7b85d/raw/de65498536ed9a35cd9346a5bc395fc1d6258798/breakout.py

It only uses the Python standard libraries, and the file can be run from the command line without any installation by typing:

python <PATH TO FILE>/breakout.py


Adding new PPA is causing GPG error after apt-get update

The problem is that you have too many ppas.

Apt can only handle 40 keys in /etc/apt/trusted.gpg.d.

Delete some gpg keys and ppas.

See here for some more info.

EDIT

Because you have no /etc/apt/trusted.gpg.d directory, just run the following command to fix the issue:

sudo mkdir /etc/apt/trusted.gpg.d


sudo apt-get autoclean

remove sources.list file.and create new sources.list...

sudo rm /etc/apt/sources.list

Then, type in

sudo software-properties-gtk

This will open software-properties-gtk and a newsources.list will be created automatically.

Then change the server to US or to any other server of your choice. You must enable repositories from the new dialog in order to create new sources.list.

Tick all the boxes then click on Revert then click close.

Need to restore default repositories

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

(it is good practice to backup this file before installing to recover if such things happen)

Now install anything!


A bit late, but you may want to try Raptor (from code.google.com or github.com*)

You won't have a ppa but they provide .deb installers for 32 and 64 bit Ubuntu systems. Has a very nice and customizable interface and is regularly updated (has its own autoupdater which you can turn off if you want, of course)
Another option would be Eboard.
Last but not least, you can try Jin but you will need to install Oracle Java to solve an annoying sound problem with openjdk.

* The project has been moved to GitHub after the Google Code shutdown announcements.


Do programs in /bin or /usr/bin have to be invoked from a shell?

Do processes need a terminal ?

There are several things that you need to understand in order to answer this question:

/usr/bin and /bin contain executable files
A shell is an interface to the user - it executes commands or performs functions that user wants; it is like levers and switches on a machine - you pull lever, and machine does something
GNOME shell is GUI shell, bash is text-based shell. They are also processes, and can start new ones via fork() and exec() calls.

  Does any installed software have to run from a form of terminal?

No, not really. The very first process on the system, /sbin/init with PID 1 ( and that's systemd in your case), has no associated  controlling terminal. In fact, a daemon process does not have a controlling terminal. All processes on Linux are started via two syscalls - fork() and exec() - where you first create a "copy" of the original process, and then via exec() you run an executable, an applications in /bin and /usr/bin, or any other location you specify. Daemons can do exactly the same thing.

So in theory, I could make a daemon process that has no controlling terminal - no tty - and yet I could use fork() and then exec() to run something from /usr/bin. Of course, the command which I call has to be OK with that - some commands require having a controlling TTY in order to work.

In this question, it seems the big confusion is that shell is the same as tty, however they're different - tty designates a device (real or virtual), while shell - it's a process that interfaces with the user and the system to perform certain functions/actions.

Shell vs tty

Notice that the process name is -gnome-shell,2741. Gnome Shell is GUI shell, it is very different from typical text-based command interpreter such as bash or ksh.  You can start applications, files, windows, though you interact with it via shortcuts and mouse much more than with text-based shell.

The TTY you use /dev/pts/0 and /dev/tty2 are two different things entirely. Generally /dev/ttyXX indicates a console driver, and /dev/tty2 is a device file which is also associated with special TTY driver. /dev/tty[1-xx] usually denote virtual consoles, which can be accessed via Ctrl+Alt+F1-7. By default there are tty1 to tty7 open, with GUI on Ubuntu defaulting to tty7. On other distributions GUI may be on different tty, for instance if I recall correctly in Fedora it was tty1. Of course, there are ways to open more than 7 virtual consoles. See Why so many virtual consoles?

Every open tab and every new window of the terminal window you use within graphical shell - that will have  /dev/pts/x file associated. pts part stands for "pseudoterminal". These are involved with consoles that are implemented via software and don't represent real hardware, e.g. when you use terminal emulator or SSH connection.

It's also important to note that shells such as bash are not tty, the /dev/tty2 is a device which has driver associated behind it. /bin/bash is an executable file, and is executed as command itself. While there are processes in kernel that manage /dev/tty2 it is not a process; by contrast /bin/bash is a process that you can start. And this is in fact what happens when you open a terminal - your terminal window starts /bin/bash as process.

And of course, you can write to /dev/tty2 or /dev/pts/0 , if you have permission. For example, in order to use /dev/ttyUSB0 or /dev/ttyACM0 to write to Arduino or another embedded system, you have to belong to dialout group, which owns these special devices.  These two devices emulate serial console, so you can send data to the connected devices or program it. In case of special hardware devices like that, you also have to consider the speed or baud rate at which these devices read and send data.

See also

Do GUI based application execute shell commands in the background?
Why is a virtual terminal “virtual”, and what/why/where is the “real” terminal?
How to write to tty device
Do OS GUI's have a different shell than the command line interpreter?


You can tell grep to output additional lines of context around each matching line e.g.

grep -w "pattern" -A5 filename

for 5 lines of context after the match, or

grep -w "pattern" -B5 filename

for 5 lines of context before the match, or

grep -w "pattern" -C5 filename

for 5 lines each of before and after context. So in your case you could do

grep -w "pattern" -B1 filename | head -1

to find "pattern" and print a single preceding line of context, and then only print the context line using head. Other solutions using awk or sed instead of grep would be possible.


Need help installing Google Chrome and other applications

If you are using Ubuntu desktop, try and check this link below(14.04 version):

https://lecturesnippets.com/lesson/installing-google-chrome-in-ubuntu-14-04-desktop/

I would certainly recommend going to Software Center (Open the “Applications” menu. Ubuntu Software Center is at the bottom). then check for Chrome.

You can also try and open any browser (Firefox by default) and go to

https://google.com/chrome

You can follow the instructions there to install it (click the download button and go from there).

I hope this helps.


Unity won't load with proprietary drivers

Have a look at the bumblebee section in https://launchpad.net/~hybrid-graphics-linux

b) try bumblebee for simultaneously using the intel and nvidia cards:
sudo apt-get install git
# type password
git clone http://github.com/MrMEEE/bumblebee.git
cd bumblebee/
sudo ./install.sh
optirun glxgears
# check the speed and compare to running:
glxgears
# If you have google-chrome installed, you can try it with/without optirun and report the FPS values on the mailing list:
optirun google-chrome http://webglsamples.googlecode.com/hg/aquarium/aquarium.html


Music Manager that can properly see ID3 ratings tags and synchronize with Android

Amarok supports the FMPS_Rating tags which Nick B refers to (and has for a while I think). Settings > Configure Amarok > Collection > Write statistics to file.

If you examine those files with kid3, you'll see the tags. I've only recently begun using it.


How configure Distribute Virtual Router(DVR) on Neutron with JUJU?

Checking the issue. I discover that when I make a change on neutron-gateway charm the all neutron components at network node fail.

The right logs are stored at /var/log/upstar. Cheking the log neutron-openvswitch-agent.log I saw the following error:

Traceback (most recent call last):
  File "/usr/bin/neutron-openvswitch-agent", line 6, in
    from neutron.cmd.eventlet.plugins.ovs_neutron_agent import main
  File "/usr/lib/python2.7/dist-packages/neutron/cmd/eventlet/plugins/ovs_neutron_agent.py", line 16, in
    import neutron.plugins.ml2.drivers.openvswitch.agent.main as agent_main
  File "/usr/lib/python2.7/dist-packages/neutron/plugins/ml2/drivers/openvswitch/agent/main.py", line 24, in
    from neutron.common import config as common_config
  File "/usr/lib/python2.7/dist-packages/neutron/common/config.py", line 28, in
    from oslo_service import wsgi
  File "/usr/lib/python2.7/dist-packages/oslo_service/wsgi.py", line 29, in
    from paste import deploy
ImportError: cannot import name deploy

The solution was uninstall and install again paste and paste.deploy:
  $ pip uninstall paste
  $ pip install paste
  $ pip uninstall pastedeploy
  $ pip install pastedeploy


Glad to hear, that you are interessted in open alternatives.

Ubuntu is not problematic to install at all. I would install it on the SSD as dual boot on a partition of 30GB (maybe less, if you're just trying Ubuntu).

Just download the ISO image of Ubuntu or Kubuntu, burn it to CD-ROM and boot from it. You could use an USB stick to boot from, too. Therefore you could use the program "unetbootin" (it can download the latest image, write it to the USB stick and make it bootable).

The setup process is very self-explaining. In particular you just have to know how to partition a harddisk. I would set the "noatime" flag for your SSD, since it reduces harddisk access for read operations. But this is not necessary.

Once the system is set up, you can install new programs from the Ubuntu repository via Synaptics or via console per sudo apt-get install packagename.

You can make further optimizations for your SSD if you want.


Multiple keyboards with different layouts

It is possible to do this in the xorg config:

Section "InputClass"
  Identifier     "Keyboard Catch All"
  MatchUSBID     "058f:9410"
  Option         "XkbOptions" "caps:super,terminate:ctrl_alt_bksp"
EndSection

Section "InputClass"
  Identifier "Apple Keyboards"
  MatchUSBID     "05ac:0236"
  Option         "XkbOptions" "altwin:swap_lalt_lwin,caps:super"
EndSection

However, GDM has its own way of managing you keyboard settings that will overwrite these xorg settings. I have not found a solution that works well with GDM.


Bluetooth earbuds turning off after 5 minutes

I had the same problem and got it working finally
Reference:

Bluetooth profile locked to A2DP (high-quality audio sink) but cannot change to HFP/HSP (low-quality bidirectional headset)

https://itectec.com/ubuntu/ubuntu-failed-to-change-profile-to-headset_head_unit/

https://www.reddit.com/r/linuxquestions/comments/eg2q7v/bluetooth_earbuds_turning_off_after_5_minutes/fv3v8nk?utm_source=share&utm_medium=web2x&context=3
(u/ugurbor's comment)

https://wiki.archlinux.org/index.php/Bluetooth_headset#HFP_not_working_with_PulseAudio

And thanks to u/ugurbor who helped me even in inbox.
once it starts working, you have to execute the commands on boot as a script
ofono-phonesim -p 12345 /usr/share/phonesim/default.xml &
# sleep 0.05;
sudo service ofono restart;
# sleep 0.05;
~/ofono/test/enable-modem /phonesim;

enable the sleep if required, It works for me without sleep
Easiest way to test if it started working without waiting for 5 minutes to headsets power off is to check pavucontrol*, if HSP/HFP is available (If it says (unavailable) then your earbuds will turn off after sometime as usual.

IMPORTANT THINGS TO NOTE:

I am not sure these are all the steps required to make it work because I have tried a long time to fix it and succeded recently, I tried to replicate it on another laptop with linux mint and FAILED (It shows no modem).

So it would be REALLY APPRECIATED if someone makes a step by step process to get it working from scratch after fresh distro installation.

For some reason I could never make it work as a systemd service, even if the service works fine, the service started on boot fails (IDK) how and needs restart to work.
So I just
run the script with gnome-session-properties aka Startup Applications in gnome .

Since I couldn't replicate it on mint help on creating modem is appreciable since I don't exactly remember all the things (from beginning) I did which actually made it work.
This problems needs a step by step clear fix since lot of people face this. Maybe someone could make a script which can automate this because this is a pretty silly bug which annoys a lot


As first step install build-essential via

sudo apt-get install build-essential

and checkinstall via

sudo apt-get install checkinstall

More packages you're need

sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libcurl4-openssl-dev

After that

make

and

sudo checkinstall --pkgversion $(date +"%Y%m%d")

checkinstall needs a version, which is not automatically set in this case, therefore the parameter --pkgversion


Problems uninstalling Ubuntu, trying to put XP back on

There is no way you can fix your Grub Menu in case Ubuntu or MBR in case Windows without using a Bootable CD/DVD or Bootable USB.

Check this link if you want to fix using Ubuntu LiveCD/DVD: How to fix Grub Using Ubuntu Live CD/DVD
Check this link if you want to fix using Windows Bootable-CD/DVD:  How to fix MBR Using Windows Recovery CD/DVD

Boot from Windows, Then if you want to completely remove Ubuntu you have to delete partition in which Ubuntu is installed, in case it was installed in different partition. Or uninstall Using Wubi.

Hope you can understand with this very short description. Reply for further assistance.


Thousands of pam_unix log entries in logwatch

Go to the /etc/pam.d directory.
Open the file common-session-noninteractive in an editor.
Look for the following line:

session required pam_unix.so

Above this line, add the following:

session [success=1 default=ignore] pam_succeed_if.so service in cron quiet use_uid

Save the file and exit.
Restart crond using something like service cron restart or /etc/init.d/cron restart.

Source: http://languor.us/cron-pam-unix-cron-session-session-opened-closed-user-root-uid0


Looking for a music player that can filter by filename and play webm audio files

While there are some great Linux audio players (and I would encourage you to explore them) there is absolutely nothing to stop you running your old friend Foobar on Ubuntu using Wine. Run the following from a Terminal:

sudo apt-get install wine

And then download and install Foobar:

cd $HOME/Desktop
wget https://www.foobar2000.org/files/d392066748f9762853bd06ad67f175fe/foobar2000_v1.3.10.exe
wine foobar2000_v1.3.10.exe

And this will be enough to get Foobar running nicely on Ubuntu. Below is a screenshot of Foobar running on Trusty Tahr:

If you are interested in extending Foobar a little further you could also consider using the same process to install Foobar's Free Encoder Pack...


Use `chsh` to change shell

You can use chsh to change your default shell. Running this command will ask for complete path of the shell.

You can also run

chsh -s <path_to_shell>

to change the shell directly.

Change Terminator Preferences

You can also change the Terminator preferences directly.

Open Terminator.
Right Click on Terminator and select Preferences.
Go to Profiles > Command.
Check Run command as login shell, Run a custom command instead of my shell, and type in the address of the shell.

 - Close the dialog box.


For menulibre part you should reinstall it with its dependencies:

sudo apt-get update
sudo apt-get install --reinstall gir1.2-gmenu-3.0 gnome-menus libgnome-menu-3-0 menulibre

Then launch it with menulibre command or from Menu.


Go to Menu>Preferences->Desktop Session Settings, uncheck Network from the list, click OK, then reboot

For other double icons, they are due to package conflicts happened with multiple desktop environments


While the USB with your Windows OS is plugged in run this:

$ sudo update-grub

Grub will scan all the attached drives for OS installations and add them to the boot menu.

Now your Windows USB installation will appear in the boot menu when you start your computer.


(initramfs) /cow format specified as aufs and no support found

Press Enter and after that Ctrl + D, it made the magic in my case with a KDE neon 15.5 Live CD I created.


My ethernet connection is not working but it is detected by my computer

type

ifconfig

if you can see the line starts from eth0 or something similar

then type

dhclient eth0.

try

ping google.com

to check internet connection.


What's the software name to indicated key

I can't provide you with an answer to what software that guy uses. But I'd suggest you ask him.

Alternatives you might want to look into are: keymon https://github.com/scottkirkwood/key-mon

Or: screenkey with

sudo apt-get install screenkey

I hope that helps somehow.


The only way I see is to reinstall the system. Ubuntu doesn't support downgrades between versions of Ubuntu (downgrade of individual packages, yes) the same way Debian doesn't. You must do a backup of your system and reinstall everything again.


Freezes during or just after login on Dell XPS 15 9560

There are several how-tos available for running Ubuntu on this Dell XPS 15 9560.

To get rid of the freezing add these boot parameters during boot. Access the GRUB menu and press E, then add this text to the end of the line beginning with linux:

nouveau.modeset=0 acpi_osi=Linux acpi_rev_override=1

Press F10 to boot.

Now edit the file /etc/default/grub with root permission, for example using the command

sudoedit /etc/default/grub

In the file, edit the line beginning GRUB_CMDLINE_LINUX_DEFAULT so after your edit it says:

GRUB_CMDLINE_LINUX_DEFAULT="acpi_rev_override=1 acpi_osi=Linux nouveau.modeset=0 quiet splash"

Save the file and exit, and run

sudo update-grub


installing ubuntu on a partition with data

How do you want to install it? Using wubi installer or booting from a cd / usb ?

If you plan to use wubi, installing on the first partition should be fine. But if you want to install from a stick or usb, I recommend to create a new partition or to free one of them.


There seems to be a program called "cabal-debian" that converts a cabal file into a debian package (ala checkinstall) and allows you to install it via apt/dpkg. It's provided by the package "haskell-debian-utils". The manpage & description for it can be found at http://manpages.ubuntu.com/manpages/natty/man1/cabal-debian.1.html.

Looks like running "cabal-debian --debianize --ghc", then "dpkg -i" whatever debs come out will achieve what you want.


You have tu use pip for uninstalling, apt won't work in that case. If it's not in your $PATH you can search for it, maye it's this one:  -:$ python3 /usr/lib/python3/dist-packages/pip uninstall electrum


After a day and a half working on solving this problem, I finally found a turn around.

First I did a format of ubuntu (thanks to ubuntu this didnt take much time)

Rather than installing virtualbox from the ubuntu software centre, I downloaded a newer version from virtualbox.org. It in a .deb format and therefore was very easy to install

Next, I installed a guest vm with ubuntu, and managed to connect to the internet :)

I still have no clue why it initially did not work. Maybe the older version available on in the software centre has some kind of bug. However, I was not able to verify this.


nvidia-settings still present after driver uninstall

To remove the application only, perform sudo apt-get remove <package>.

Example: sudo apt-get remove nvidia-*

To remove the application and all configuration files, I suggest you perform sudo apt-get purge <package>.

Example: sudo apt-get purge nvidia-*


This thread is enlightening for the solution. You should either delete the contents of ~/.config/deluge/ipc/ manually or if the problem persists try to delete them after every reboot. One way to do this is to add this line:

rm /home/<<<your.username>>>/.config/deluge/ipc/

in /etc/rc.local, before the exit 0 line.


How to install squid-deb-proxy-client via preseed/early_command

To force the installer to use your proxy server, configure it using preseeding properly using the d-i mirror/http/proxy option, e.g.:

d-i mirror/http/proxy string http://ip-or-hostname-of-proxy:8000/

You don't really need the squid-deb-proxy-client package to use the Squid proxy. The only purpose of the -client package is that it can auto-discover the proxy servers in the network.


If you built nux on 12.10, please exec "unity-env" in shell.

Cmake check nux by pkg-config, but nux-4.0 is installed to ~/staging,
you needs to set PKG_CONFIG_PATH by "unity-env".

If you done it, pkg-config will display new nux version.

$ pkg-config --modversion nux-4.0
4.0.0


problem installing mysql-server - There is a MySQL server running

Please take a look at this link.
According to this answer

The solution could be removing the following symbolic link:

root@box{~}:la /etc/systemd/system/mysql.service
lrwxrwxrwx 1 root root 35 Feb  9 22:55 /etc/systemd/system/mysql.service -> /lib/systemd/system/mariadb.service

If you get the following error:
1524: Plugin 'unix_socket' is not loaded while connecting to the MySQL server

Try the answer from this link

Become root

sudo su

Stop MySQL, bypass authentication, connect as root

/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &
mysql -uroot

Use the administrative db

use mysql;

Reset the root password

update user set password=PASSWORD("mynewpassword") where User='root';

Reset authentication method

update user set plugin="mysql_native_password";

Exit the mysql console

quit;

Stop and start mysql related processes

/etc/init.d/mysql stop
kill -9 $(pgrep mysql)
/etc/init.d/mysql start

Exit su mode and try connecting to the mysql server


How do I keep my Broadcom wireless card connected?

I have the same hardware as you:

$ lspci -nn | grep 0280

05:00.0 Network controller [0280]: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller [14e4:4727] (rev 01)

It was a power management problem, solved by this short answer:

https://askubuntu.com/a/129634

No more flaky connection.


Why does it appear that my Linux file system is more fragile than my Windows file system?

It'll be a definite run [of a file system check] if I'm booting after letting the laptop runs out of battery.

On every mount, Ext3 will simply replay the journal, eliminating the need to do a full file system check. But really, please avoid a hard shut down of the system! It's not a good practice if your data is valuable. Instaed, let Ubuntu just shut down your system gracefully on a low battery.

To see if your file system will be checked on the next boot, run

dumpe2fs -h /dev/sda1 | grep -iE "(mount count|check|state)"

If you really need to hard shut down without taking the time to going through the shut down procedure, then at least shut down your file systems cleanly before pulling the power - e.g. by doing Alt + sysrq + REISUB (but use O instead of B to halt).

  Is it the case that the file system on my Linux partition (ext2/3) is more fragile than the file system on my windows partition (NTFS)?

No. I believe the Ext3 file system is very stable and very unlikely to break. The checks just make sure the structure is intact and that possibly corrupt blocks are being hidden (moved to lost+found) and that the files will be in a known consistent state.

  Is it the case that Windows checks for errors and solves them in the background?

It's not the right place to ask how Windows works, but I really prefer to know whether my file system can be recovered to a known state before my applications are allowed to start and write to the disk. Doing a check afterwards while applications are already writing, it can make things a lot worse.

Long story short: checking the file system before it goes "live" and writeable, is of your own benefit.

  Is it the case that Windows doesn't check for errors, and Ubuntu is just more vigilant in terms of file system health?

See above.

About Ext2

As became clear later in the comments, you appear to be using Ext2 still. That version does not feature any form of a journal, as psusi points out. The above does only apply to Ext3/4 and most other journaled file systems. Please avoid the use of such and old file systems if your data is valuable in the conditions of unclean shut downs. There's no reason to use it still for regular Ubuntu desktop installations.

Newer generation file systems

Additionally, I wanted to point out that a newer generation of file systems is starting to become more and more mainstream. For Ubuntu/Linux this is Btrfs, a design similar to ZFS. It will be way more intelligent in fixing corruptions and is self-healing on-line. However, it will not be able to do magic on pulling the power from a running system - there's still risk in losing data you wrote just before you pulled the plug.


Gnome shell: pressing the super key does not work

Okay. You might have locked your super button.

Try unlock it on your keyboard. It usually has two icons - a window key and a lock.

In my case, I have unlocked the super button by pressing

Right Fn + F12

Then everything is working perfectly.


Wifi drops after ~ 5 minutes with RTL8821AE

if wifi quits working again execute the commands given again (you must do this everytime there is a kernel update)

Thanks to @Rinzwind I've found a way to solve the problem, just follow this guide:

  Download rtlwifi_new from here on GitHub and extract it to
  Desktop (or to your desired folder).
  Open Terminal and change your directory to the folder where you extracted rtlwifi_new zip file (here , Desktop/rtlwifi_new-master)  by
  using the cd command, eg

cd Desktop/rtlwifi_new-master

  Now, run these commands in Terminal:

make clean
make
sudo make install

  If everything is alright, you will see the message Install rtlwifi SUCCESS. It means that rtlwifi has beeen installed successfully.
  Now, run this command:

sudo modprobe rtl8723be

  Amd run this command:

echo “options rtl8723be ant_sel=2” | sudo tee /etc/modprobe.d/rtl8723be.conf

Then reboot and choose your wifi network to connect.


How to install specific versions of Google Chrome / Chromium?

"The open-source Chromium continuous builds are archived at http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html  .". source: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/Z-UroWhOhX0


Answering my own question. It was signing issue that lead to such a performance hit. Not sure weather newer versions have some means to inform end users.

What I suspect is the samhain binary and the samhainrc/samhain_file were not signed properly or with the same key and that made samhain go crazy eating whole CPU.

Other than this there is no other reason why in one installation (some other guy did) it works and and new installation (which I did) does not.

It might help in some cases, but not all. I resigned it but the issue reappear.


How to copy one file to multiple filenames?

Combine cat (retrieves the contents of a file) with tee (writes the content away to the files specified in the arguments):

cat 1.ods | tee {jan,feb,mar}-{Rep,graph}.ods >/dev/null

Alternative using shell redirection:

tee {jan,feb,mar}-{Rep,graph}.ods >/dev/null < 1.ods

In both cases, > /dev/null is a redirection that discards the duplicated contents (tee writes its input to each parameter and standard output).


What is the difference between "Cloned MAC address" in "Edit Connection" GUI and ifconfig command?

Edit connection is actually nm-connection-editor applet, which probably calls ifconfig for you. With ifconfig method, you're changing MAC directly


How do I stop Ubuntu Precise freezing/hanging

Just wait, keep apt-get dist-upgradeing and hope things get better.

At least that's the only option I found available. And hey, they did get better. Still using 12.04 and now very rare to have a full freeze after a successful boot.


I deleted my desktop and everything froze. What did I do?

It's good that you did this with a Live USB or you'd have lost some data, almost certainly. Cleaning up after that would have been a huge waste of time.

First, you ran what's known as a fork bomb. A fork bomb is a simple, often obfuscated, command that will keep spawning new processes, folders, or files until it fills up disk space, eats CPU cycles, or consumes all the RAM. This results in the computer freezing because it has no more resources to give.

Second, you deleted your DE (desktop environment) which is what you see, it's the graphics that you interact with, the windows that you have open (sort of - there's a window manager but we'll skip that for now). Basically, you killed everything that you could click on.

It's good to learn. Use your favorite search engine before typing in commands into the terminal. Always, always know what the command does before pressing ENTER. I can not emphasize that enough. There are people who will intentionally mislead you. The terminal is a potentially powerful tool. It's your greatest tool in your toolbox but, like all tools, it must be wielding carefully.

If you'll tell us what the command was, for the fork bomb, we might be able to digest that and tell you exactly what it did and why. You seem like a curious sort so maybe you'd also like to learn that?

Edit:

You've now included the code for your fork bomb. I'll include this for the next person to come along. If you look at it and parse the logic, you can see that it's saying that so long as a condition exits (is true) then do something (make an enumerated directory) and, because there's nothing telling it to stop (a loop), it will keep on going until the resources are consumed, RAM is eaten up, or until there's just some sort of collision that makes things freeze up. (This could be all sorts of things like a memory leak but that's probably not a factor here.)

From the sounds of things, or from what I'm reading, it appears like you did a pretty good job. This is a clear warning for others, to not run your code (you should add that to your post with the edit function or someone else can if you want). It was creative. I don't think I've ever seen it done quite that way but the theory is pretty much the same with all of them. Again, for others, this can be hidden in obfuscated code or code you simply may not understand if you don't know how to parse Perl (as an example). This is a fine example of what not to do.

I dare say, you should finish installing it and have some more fun. Just keep good backups.


How to configure pkexec to not ask for password?

It's improper to say that: "It seems that on Ubuntu, calls to sudo from the GUI are somehow being intercepted by pkexec". pkexec doesn't have much in common with sudo. In contrast with sudo, pkexec does not grant root permission to an entire process, but rather allows a finer level of control of centralized system policy.

Now, if you want to run a GUI application without being asked by a password by pkexec, this is not difficult to be done. Let's take for example GParted. When you open it, you will see the following dialog window asking you by a password:

Click Details and the dialog window will look now like:

From here all you have to do is to open /usr/share/polkit-1/actions/com.ubuntu.pkexec.gparted.policy file using for example the following command:

gksu gedit /usr/share/polkit-1/actions/com.ubuntu.pkexec.gparted.policy

and change the following lines:

      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin</allow_active>

with the followings:

      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>

Save the file and close it. Next, when you will open GParted you will not be asked for a password anymore.


How can I install Chromium browser on a bootable USB?

Short answer: Yes you can install apps to the bootable usb.

Long answer: Installing applications require enough space for the programs to run, so if you have Ubuntu on a small bootable usb then it may not have enough space to install. Also any apps that you install to the bootable drive will be deleted as soon as you shutdown or reboot the computer. You may also need to download new updates even with a fresh install of ubuntu with "sudo apt-get upgrade"

The bootable live or "try" ubuntu is NOT ment for daily use


Vista won't boot. I don't have the installation disk with me, can I install Ubuntu to access my files even though vista won't boot?

I would boot to the live CD and back up the files from Vista onto a separate drive.  Then do a full Ubuntu install and try to forget Vista ever existed.


No option to install Lubuntu from USB on a Ubuntu system

I also have a ASUS EeePC 1000 and I have Lubuntu 14.04 installed.  For some reason the computer recognizes the flash drive as another hard drive.  When you start the computer, enter the BIOS.  Navigate to boot and then down to the hard drive.  You will notice that there is a plus sign there.  Click on the hard drive and you will see your flash drive.  Move it to the top, save your changes (F10 I believe), and continue with the boot.  Hopefully that will solve your problem.


upgrade to ubuntu 15.04 along with windows 7 without losing data

There are risks of loosing your data when upgrading Ubuntu from a version to an other.

The only way to resolve this problem is to backup your data before performing the upgrade. If you do not want to backup your data into USB stick or burn them on a CD/DVD then you can save the data directly on your Windows session without using an external memory because from Ubuntu you can access to your Windows session.


How to use amixer to change the volume in pulseaudio?

I use this:

mute/unmute:

amixer -q -D pulse set Master toggle

Raise volume:

amixer -q -D pulse set Master 5%+ unmute

Lower volume:

amixer -q -D pulse set Master 5%- unmute

-D pulse: to make sure we are using pulseaudio (optional)
unmute:   so we do not accidentally raise the volume in muted state and be surprised when unmuting


Ubuntu 17.10 autologin despite this uncheck in settings

I am wondering if you've given a password to the user. If not, please do that. If this is not the problem, then I will recommend doing a clean install of the OS again.

This is my personal opinion that you should move from Ubuntu 17.10 to some older version like Ubuntu 16.04.

I installed Ubuntu 17.10 only to delete it in 2 days. So many softwares are not available for this Ubuntu version. It is not a stable release. My display couldn't work properly in that OS. It was sometimes like this image: Image. So many flaws in that OS.


Wine won't install although I've never installed it before. (12.10)

Try installing Wine at Software Center by opening it (or Dash >> Software Center) and searching for wine.

Else, if it gives you some other error, try installing it on the terminal (Dash >> Terminal):

sudo apt-get install wine

If it gives you some error, please paste it on a comment. You could also update your system:

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

Or, maybe if you installed Wine previously by error, try:

sudo apt-get remove wine && sudo apt-get purge wine

(Before installing)

I hope you solve your problem and tell us soon!


Switch windows only in current workspace and display

I'm not sure about Unity or XFCE, but fully customizable desktop switching is one of the many reasons I choose to run KDE (Kubuntu).

In KDE to limit task switching to the current screen do the following:

Press Alt+F2 and type task switcher and then select Task Switcher from the drop-down list.
Inside the task switcher control panel's main tab there is a section called Filter windows by.
Select the check box for Virtual Desktops, Activities, and Screens, and select the Current activity option for each.
Press Apply, and verify things work as expected before closing.

Note:  You can also find "Task Switcher" by doing the following:

click on the Kick Off menu

-- Navigate to the Computer tab
click on the System Settings menu

-- Under the Workspace Appearance and Behavior section choose Window Behavior

Related: What is a activity in KDE and what can I do with it?


Is it possible to install 14.04 with 1gB flash stick?

There is network installation media available for download that should fit on that thumb drive.  You can download it here:

http://cdimage.ubuntu.com/netboot/14.04/

Basically this is a minimal image that you can put on a thumb drive, and then once you start the installation process it downloads the rest of the setup from the internet.

When you go to the URL above, just select your architecture (probably amd64) and then download the "mini.iso" file and use that image with unetbootin.  The installer is text based, but is pretty straight forward.  Hope this helps, :-)


Why is my shrink size so small for my SSD?

The text you shows indicate that the disk needs de-fragmentation, before you are able to shrink it.

Boot into windows and run disk defrag, and then try to shrink it again in disk management.


If you're having an issue e.g. Windows still boots first, not Ubuntu, then it is likely that you are still booting from your SSD drive (/dev/sda), not the drive with the migrated install on it (/dev/sdb).

Since you migrated to a different drive from the one you currently boot on, it is normal that Windows continues to boot. The Wubi migration script is intentionally limited as to where it can install Grub - for safety purposes (and to keep things simple). If you need to change the drive boot order or boot from a different disk, this has to be done separately.

For example, if you don't want the drive boot order, and instead you want Grub in /dev/sda you can boot the migrated install (it's always available on the bottom of the Wubi Grub menu after migrating) and then install Grub to /dev/sda:

sudo grub-install /dev/sda


Nvidia card on an ASUS ZenBook Flip 14 sometimes boots to a purple screen

There is an unsolved problem of another MX150 laptop that takes 10 minutes to boot in Windows.

There is a bug report filed against the ASUS Zenbook here:

intel-microcode on ASUS makes kernel stuck during loading initramfs on bionic-updates, bionic-security

Comment #47 seems to have the solution:

  For anyone having a similar problem, try booting with microcode
  updates off: add dis_ucode_ldr to the kernel command line (from GRUB
  if you cannot boot)

To do this use:

sudo -H gedit /etc/default/grub

Find the line containing quiet splash and make it read quiet splash dis_ucode_ldr whilst keeping everything else on the line the same.

Save the file and type:

sudo update-grub
reboot

Hopefully it all works fine now. If this is your situation make sure to subscribe to the bug report.


apt-get install isc-dhcp-server command is not working in ubuntu 14.04 server version

I tried installing the package isc-dchp-server, and it worked fine. I had problems with connecting to archive.ubuntu.com myself earlier, and that was related to ipv6.

This will keep ipv6 enabled, but ipv4 will be prioritized over ipv6: (taken from connecting to archive.ubuntu.com takes too long)

sudo nano /etc/gai.conf

Then uncomment this line, by removing the #:

#precedence ::ffff:0:0/96 100

Let me know how it works out for you!


Using a built-in Sierra EM7455 mobile broadband I only get a local IP

I have a 3rd gen X1 Carbon and WWAN(3G/LTE) works perfectly with 14.04. I actually work every day on LTE, as my company corporate network is very restricted. Modem is Sierra Wireless EM7345 4G LTE . I don't have a real solution for you, but 2 options to test come to my mind:

try live CD with 14.04
try dual boot with 16.04

If it works with 14.04 live CD - then there is an issue with 16.04. If it does not work, then try option 2).


How can I make the MT7601U Wireless Adapter work in Ubuntu?

Your dmesg clearly shows that the driver failed to load the required firmware. First, is the firmware present in the expected place?

ls /lib/firmware | grep mt76

We hope that you see:

mt7601u.bin

...among others. If it is not present, get a temporary working internet connection by ethernet, tethering or whatever means possible and do:

sudo apt update
sudo apt install --reinstall linux-firmware

Reboot. Now is your wireless working as expected?

If the firmware file is found from the command above, perhaps the permissions are incorrect. Check:

ls -al  /lib/firmware/mt7601u.bin

We hope you see:

-rw-r--r-- 1 root root 45412 Mar 19 12:37 /lib/firmware/mt7601u.bin

That is, readable by all and writable only by root. If that is not what you find, repair it:

sudo chmod 0644 /lib/firmware/mt7601u.bin

Reboot. Now is your wireless working as expected?

If the firmware file is found and has the correct permissions,perhaps it is corrupted. Check:

md5sum  /lib/firmware/mt7601u.bin

We hope you see:

696cedb8e76ecc0cda9f9b0d3972c64d  /lib/firmware/mt7601u.bin

If you see anything different, reinstall linux-firmware as above and reboot. If it is still not working, again show us in an edit:

dmesg | grep mt76


Trouble setting up a usb-serial HP Laserjet 6MP printer

Try adding the line

blacklist uss720

to /etc/modprobe.d/blacklist.conf.

This worked for me on Fedora 17 and 18, where the uss720 module caused me problems. Once I did this and rebooted, Fedora found my Laserjet6L and configured it automatically.


CTRL+ALT+F1 should give you a terminal where yon can log in to diagnose the problem. You can press CTRL+ALT+F7 (sometimes F8) to return to the GUI.

There are additional terminals in CTRL+ALT+F2, F3, etc...

I also find very useful to map CTRL+ESC to the system monitor, where I can kill a process quickly.

As SW01 said, you can also type ALT+F2 to execute one command. This will only work if gnome-panel is enabled (it works by default).

And fred.bear added than CTRL+ALT+T will open a new window with the default terminal.


Module cifs not found on NanoPi M3 Ubuntu Core 15.10 although cifs-utils installs correctly

I finally made it and will try to summarize my various 'repair' strategies now by what I think were the key operations:

Had to recompile the kernel with cifs module activated as described in http://wiki.friendlyarm.com/wiki/index.php/NanoPi_M3#Compile_Kernel_Modules on another host (installed Ubuntu Desktop in the same version on a VM) and then copied the generated missing files to the NanoPi.

After a reboot modprobe was able to find the cifs module and my mount procedure was successful.

Feel free to comment if you need some further explanations.


How to burn a region free DVD from a DVD movie locked to a specific region?

You could give "K9Copy - KDE tool to backup DVDs" a try.

It's very much capable of disassembling the individual streams, putting them back together (even customising the selection of audio/video tracks) and then burning it to a new disc.

It seems it's not even capable of putting a region code onto a blank DVD, so (ab)use that as a feature!

A sort of dedicated tutorial on how to do this is on this random blog. Comes down to:

Select DVD source.
Select "Rip and encode" as destination.
Select the elements you want to "rip". It's useful to leave out some unwanted streams/titles/chapters.
Select some encoding options, but just use "copy" to leave the contents of the streams untouched.
Once finished it will ask you to load a blank DVD to burn.


Popper

I would suggest popper as a good replacement as it can deal with POP & IMAP and multiple accounts popper is not in the Software Center you need to install it from a .deb package with can be downloded from there launchpad page here

Hope this helps


my Ubuntu 18.04 gets stuck on splash screen

The latest HWE kernel actually fixed this.


How can I make Chromium app windows count as "their own application" in the Unity launcher?

Making a new Chromium profile for the app works around the problem (this is specific to 11.04, 11.10 fixes this issue at the Unity-level.):

  To open a website as an app window, add --app=http://example.org to the launcher parameters for chromium. Making and using a new profile is as easy as adding --user-data-dir=/path/to/profile

As long as you put a different path to each web application they will be treated as separate applications.

Reference blog post
How do I put a web application on the Launcher?


Log out in Kubuntu puts me to a black srceen

I have found a solution after a lot of google srearch. CTRL-ALT-F1 puts me into a text console. So it can be system hang or bug with Xorg/kdm according to Joao Pinto(the person who commented on my question).

However there is a solution. In the file "/etc/kde4/kdm/kdmrc" if i uncomment the line "#Terminate-server = ture"
and restart the problem is gone. Very simple solution. Also an impossible one for a novice.

I have some question in my answer. Is this really a bug? Why that line is commented to create unreasonable suffering to the users ? very funny huh...


SSH "Connection Refused" when trying to access from the outside over a No-IP dynamic dns hostname

Since your local network works, but remote doesn't, you need to check your router settings.

Specifically, you need to enable port forwarding for port 22 (or another higher port and then configure the SSH server to listen on that port) from the outside to the server IP on the inside of the network.  This process varies from router to router, so you may have to look for a guide to set up port forwarding on your router.

As well, consider that a good portion of ISPs block port 22 inbound to residential IPs - not every ISP is okay with you running a server internally on a residential-class connection.


Unable to install any software or packges on ubuntu 13.10

You get this error because some other process is installing a program at the same time. Ubuntu is designed so that only one process can use the install sequence at the same time.

If you aren't installing more than one program at the same time then restart the computer and try again.


I also came across this issue after upgrading to Ubuntu 18.04, and after spending some time looking into the issue I found that after upgrade libreadline package was missing, so I installed libreadline package using

sudo apt-get install libreadline-dev

But this also didn't solve my problem. Then I figured out that it installed the upgraded version of the libreadline package i.e libreadline.so.7.0. As a workaround I created its symlink so I can continue my work with libreadline.so.6.

$ cd /lib/x86_64-linux-gnu/
$ sudo ln -s libreadline.so.7.0 libreadline.so.6

And this worked wonders and my problem with libreadline package was solved.


I think you are not re-installing but repairing or updating. Try and re - install. When the dialog box comes, chose "Some thing else" and then change the partitions and then start installing.

For Further help please see:

  https://help.ubuntu.com/community/Installation
  https://help.ubuntu.com/community/GraphicalInstall


The error message is telling you that there is a problem with one of your configuration files.  It is kind enough to provide the file in the error.  If you do not look at the file, and if you do not show us what line three in the file says,  there isn't much anybody can do.

You could use an editor such as nano or vim to look at the file, or you could have the terminal spit out the file contents using cat:

cat /etc/apt/sources.list.d/diesch-testing-precise.list

You may notice the issue and be able to fix it, but please edit your question to include the file entirely, or at least the third line.  Have you recently upgraded your system?  It may be easier to remove that repository, and re-add it now that you're on a new version.

sudo add-apt-repository -r ppa:diesch/testing # Remove repo
sudo add-apt-repository ppa:diesch/testing # Add repo

Another option is to stick with official Ubuntu repositories, and to limit the number of third party repositories that you use.  This will result in a more stable, standard system that others are familiar with to help you, and is the ideal setup for new and old users alike.  (No offense to all the hard work put in by Diesch and others.)


Unable to load dynamic library '/usr/lib/php/20151012/xsl.so'

The only way to fix this for me was to remove completely all php versions using

sudo apt-get purge php
sudo apt-get purge php7.0
sudo apt-get purge php7.1
sudo apt-get purge php7.2

After which I had to install it again including all the extensions I was using.

After that I had to disable the currently enabled php5.6 using sudo a2dismod php5 and after that enable php7 using sudo a2enmod php7.0.

After that I restarted my server using sudo service apache2 restart and gradually had to enable certain php modules that I needed.


How do I prevent one user in particular from accessing my home directory?

If you want to limit access to users outside of your group or any other user, the question is a duplicate of Restrict access to my home folder from another standard user account

Otherwise, if you want to restrict access to just one user, call it enemyuser, use ACL:

cd ~
setfacl -m u:enemyuser:000 .

...and just enemyuser will have the access to your home directory denied.

To check the effect:

[romano@pern:~] % chacl -l .
. [u::rwx,u:enemyuser:---,g::r-x,m::r-x,o::r-x]

To remove the ACL, you just say:

setfacl -x u:enemyuser .

The *acl commands used here are from the package acl, which should be installed by default (at least, I think).


How can I have nagios alerts emailed to my gmail?

First, install sSMTP, since in this instance postfix is overkill. Yes, this will remove postfix. Do we care? Not really.

sudo apt-get install ssmtp

Configure sSMTP by editing /etc/ssmtp/ssmtp.conf

#Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=yourusername@gmail.com
#I recommend setting this

mailhub=smtp.gmail.com:587

# Where will the mail seem to come from?
rewriteDomain=

#The full hostname
hostname=[some hostname here]
UseTLS=YES
UseSTARTTLS=YES
AuthMethod=LOGIN
AuthUser=yourusername@gmail.com
AuthPass=yourpassword

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
# This is optional if you're going to use revaliases - I didn't
FromLineOverride=YES

Now, we need to set permissions on /etc/ssmtp/ssmtp.conf to help (it isn't foolproof) protect your plaintext password.

sudo chown root:nagios /etc/ssmtp/ssmtp.conf
sudo chmod 640 /etc/ssmtp/ssmtp.conf

Restart nagios and you should be set.

sudo service nagios3 restart


SSH keys using gnome-keyring instead of ssh-add

What you are actually looking for is an ssh-agent. This is what remembers the fact that you successfully unlocked your key with a passphrase and keeps it unlocked while you are logged in. There are a few different implementations, gnome-keyring provides one, though for headless servers you can more easily either call ssh-agent directly in your .bashrc, or use keychain which is an app that wraps ssh-agent and makes life much easier.

Keychain should be available via sudo apt-get install keychain or on Fedora (dnf), CentOS (yum), or Arch (pacman). Once you have it installed you can add a line like eval $(keychain --eval) to your .bashrc and it will start and keep only 1 instance of ssh-agent running for your user. If you add a key name after the --eval it will load the named key(s) the first time you login by prompting you for your passphrase(s) right away and then keep them tucked away.

You can see what keys are loaded with ssh-add -l and you can add a key with ssh-add ~/.ssh/keyname which will prompt you just once for the passphrase and then store it until you logout or keychain is stopped/kill. You can add a kill command to .bash_logout if you are worried about keeping your keys unlocked after you disconnect.

See the very nice site with some excellent links to how OpenSSH works and good examples, https://www.funtoo.org/Keychain and enjoy not typing your passphrase repeatedly.


Noticeable performance drop after suspend on 19.04

Use sudo -H gedit /lib/systemd/system-sleep/custom-xhci_hcd
Copy these lines into the editor:
#!/bin/bash

# Original script was using /bin/sh but shellcheck reporting warnings.

# NAME: custom-xhci_hcd
# PATH: /lib/systemd/system-sleep
# CALL: Called from SystemD automatically
# DESC: Suspend broken for USB3.0 as of Oct 25/2018 various kernels all at once

# DATE: Oct 28 2018.

# NOTE: From comment #61 at: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/522998

TMPLIST=/tmp/xhci-dev-list

# Original script was: case "${1}" in hibernate|suspend)

case $1/$2 in
  pre/*)
    echo "$0: Going to $2..."
    echo -n '' > $TMPLIST
          for i in `ls /sys/bus/pci/drivers/xhci_hcd/ | egrep '[0-9a-z]+\:[0-9a-z]+\:.*$'`; do
              # Unbind xhci_hcd for first device XXXX:XX:XX.X:
               echo -n "$i" | tee /sys/bus/pci/drivers/xhci_hcd/unbind
           echo "$i" >> $TMPLIST
          done
        ;;
  post/*)
    echo "$0: Waking up from $2..."
    for i in `cat $TMPLIST`; do
              # Bind xhci_hcd for first device XXXX:XX:XX.X:
              echo -n "$i" | tee /sys/bus/pci/drivers/xhci_hcd/bind
    done
    rm $TMPLIST
        ;;
esac

Save the file and exit the editor. Then use:
sudo chmod a+x /lib/systemd/system-sleep/custom-xhci_hcd

After rebooting your suspend / resume issues will hopefully be resolved. If not let me know and I'll delete this answer.

NVMe M.2 "gum stick" SSD
These tiny SSD's pack a powerful punch but require special attention in regards to suspend/resume as per this bug report. Edit the file /etc/default/grub and search for this line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ... acpiphp.disable=1 pcie_aspm=force"

Don't add the ... but some place after the other parameters add acpiphp.disable=1. Do not add the acpi_aspm=force though unless adding the first option alone doesn't work.
Save the file and use sudo update-grub. Then reboot to test.


How to run a bash script while Ubuntu is starting up on tty

You can add a custom service to run your script at boot by following the steps below.
Firstly, run the following command in the terminal to create and edit a shell script file in your home directory:
nano ~/MyScript.sh

Secondly, copy and paste the following code into the editor, ( neofetch -L is just an example ) and save it by pressing Ctrl + X then press Y then press Enter :
#!/bin/bash

neofetch -L

Thirdly, make the shell script file executable by running the following command in the terminal:
chmod +x ~/MyScript.sh

Fourthly, create and edit a custom systemd service to run the shell script at boot by running the following command in the terminal:
sudo nano /etc/systemd/system/MyCustomService.service

Fifthly, copy and paste the following code into the editor, replace USERNAME with your username and save it by pressing Ctrl + X then press Y then press Enter :
[Unit]
Description=My Custom Service
Before=motd-news.service

[Service]
Type=oneshot
ExecStart=/home/USERNAME/MyScript.sh
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Sixthly, start the service by running the following command in the terminal:
sudo systemctl start MyCustomService

Seventhly, enable the service by running the following command in the terminal:
sudo systemctl enable MyCustomService

Finally, reboot your system.

If for any reason you want to undo this solution, please run the following commands in the terminal one after the other in the same sequence below:

sudo systemctl stop MyCustomService
sudo systemctl disable MyCustomService
sudo rm /etc/systemd/system/MyCustomService.service
rm ~/MyScript.sh

Notice:

neofetch must be installed on your system in order for the above example script to work. It can be installed like so:
sudo apt install neofetch

StandardOutput=journal+console will enable printing output from your script on screen.

You can change when the custom service starts executing during boot by specifying in the service file under [Unit] the Before= and After= system services so that your custom service will run after and / or before certain system services. Please refer to this answer to list the system services in the order they are run.

Becareful:
Test your script first and make sure it executes in a timely correct way to avoid delay or lock-up during boot.


how to convert time from 24H to 12H then subtract the two times

You can't simply subtract datetime objects like 01:00 and 05:39 in awk (although GNU awk has its own Time Functions that you could use to do it).

Having said that, formating a datetime difference as as datetime is somewhat questionable. Miller's builtin strptime/strftime implementations look like they will handle it - including correctly rolling over the day boundary.

Ex. given

$ cat file
Start End
00:00 05:39
01:31 06:02
00:48 06:24
23:46 04:50
00:05 05:12
00:06 05:04
00:04 05:10
00:10 05:10
00:00 04:51
00:10 05:33
23:41 04:15

then

$ mlr --pprint put -S '
    ${Total Run Time} = strftime(strptime(${End},"%H:%M") - 3600 - strptime(${Start},"%H:%M"),"%H:%M")
  ' file
Start End   Total Run Time
00:00 05:39 04:39
01:31 06:02 03:31
00:48 06:24 04:36
23:46 04:50 04:04
00:05 05:12 04:07
00:06 05:04 03:58
00:04 05:10 04:06
00:10 05:10 04:00
00:00 04:51 03:51
00:10 05:33 04:23
23:41 04:15 03:34


There are a few issues with what you're attempting. First of all, to set a variable's value, you can't have spaces around the =. Then, in order to capture the output of a command you need either backtics, or preferably $().

Finally, and most importantly, you should not parse ls, it is very hard to do well and extremely prone to errors. Your approach will break if your directory name contains a space for example. In the examples below, what is the 8th field?

 $ ls -l
 total 0
-rw-r--r-- 1 terdon terdon 0 Nov 11 14:59 file1
-rw-r--r-- 1 terdon terdon 0 Nov 11  2013 file2
-rw-r--r-- 1 terdon terdon 0 Nov 11 15:00 file 2
                                    -----
                                      |--------> 8th field

The file/directory name might be the 9th field, or it might be the 9th and 10th fields, or even more. Plus, the date format can change between locales. Basically, using ls for this is a horrible idea. Instead, use stat and sort by time:

$ cesta=$(stat --printf "%X\t%n\n" * | sort -nk1,1 | cut -f 2- | awk 'NR==2')
$ cd "$cesta"


how to exchange unusable space to ext4 in ubuntu 14.04 installer?

When starting the live session, choose "try Ubuntu". Then open GParted via Dash. GParted is a way better partitioning program than the one in the installer. It will give you great visual display and if something doesn't work, it will give you useful information about what doesn't work.

Please also notice that (if you have an HDD, so if you have an SSD, please ignore this paragraph) data on the outside of your HDD can be read and wrote way faster than on the inside, so you want to put your operating system on the outside and partitions with mainly data on them on the inside. Outside to inside is shown as left to right in partitioning programs such as GParted.

Your particular problem here is that you already have the maximum number of primary partitions. You need to delete at least one of them and create an extended partition in which you can place more partitions (logical partitions).


Installing Ubuntu GNOME dual boot on Sony VAIO Pro, EFI problems

Here's what I recommend you do, but I can make no guarantees that it will work:

Boot a Linux live CD.
Run Boot Repair again, but enter the Advanced setup area and select the option to restore backed-up files. When you tell it to complete this action, you should be back to where you were before (Windows should boot, but GRUB won't appear). Even if you can't boot Windows at this point, you can proceed at least through step #6 without risking anything.
Disable Secure Boot in your firmware.
Download the USB flash drive or CD-R version of my rEFInd boot manager and prepare a boot medium with it.
Boot to the rEFInd medium.
rEFInd should detect both Windows and Ubuntu, and both should boot. (There will probably be more than one Ubuntu entry. As long as one boots, you're fine, but it's possible that the GRUB option will fail.)
If both Windows and Ubuntu boot, download and install the Debian-package version of rEFInd.

At this point, rEFInd should appear when you reboot the computer. If not, then your firmware is broken, and you'll need to experiment with workarounds, as described here. You can also post back with more details if you run into such problems.


window buttons, notifications have all turned blue

I got the answer to this on the xfce forums.  The thread is here: https://forum.xfce.org/viewtopic.php?id=10406

There was a gtk override, and I had to rename a couple of files.


Develop a Snap package for project using SDL2

You're running into part of the security structure, which even in configure: devmode still prevents the snap from doing arbitrary operations on the system. I've been fooling around on the snappy-playpen github, (which has a gitter chatroom), but I am by no means an expert. If you are defining plugs for each of your apps/parts and are hooking them up to the ubuntu-core slots after snaping, then you've got some serious stuff to work through. If you haven't done that, keep working at it. Have you got your snapcraft.yaml up anywhere?

The snapd component of snappy is still under heavy development, and snapcraft itself as well. What is still manual today might be better automated soon. However, I would first suggest moving your project into the snappy-playpen repo and getting some help from the community team and snappy devs. There will be an online clinic upcoming this Tuesday, 21 June. Maybe look on G+ for more details if you're interested, it'll be streamed on Ubuntu On Air while it's happening.


Above this wildcard line:

%.o: %.c

add a specific rule for the particular file:

myfile.o: myfile.c
    gcc -c -o $@ $< -lgsl -lgslcblas -lm


Wifi keeps shutting down and asking for password, power management turns back on

After a few days of uninterrupted network connectivity it seems like WICD works well as a workaround and that the problem lies with network-manager.


Areas around windows and my desktop background show visual artifacts / distortions

I did not find out what actually caused the problem, but I've solved it by disabling Fading Windows under the Effects Menu using CompizConfig Settings Manager as suggested by darent.


The error and solution is located in the response.

Open katoolin.py in ATOM or your text editor of choice.
Change the line of code from "Sorry. This script requires sudo privileges" to ("Sorry. This script requires sudo privileges")
Save the document.

There will be other errors since the latest Katoolin code was written in Python2. Python3 has some slight difference.
You can get by this by installing Python2 on your ubuntu installation and use it to run katoolin.


Check power consumption of individual hardware components

Since the individual-component-power-usage monitoring circuitry is not designed into modern computers, you're left with:

Monitor system power usage with the device connected.

Monitor system power usage with the device disconnected.

Some devices (CPU, RAM, hardware buses, etc) can't be measured with this technique.


Dual Boot not working Ubuntu Grub on sdb3 while Windows 10 EFI on sda2

Open the terminal and edit the grub file:
sudo nano /etc/default/grub

Modify the file with this line: GRUB_DISABLE_OS_PROBER=false, save the changes and exit using
Ctrl+o followed by  Enter and Ctrl+x.
sudo update-grub

Then reboot.


How can I diagnose a NAS SMB login failure?

Since the question is about diagnostics, rather than the eventual solution, I'll describe the things I tried that got me closer to the solution (the updates within the question summarise most of it).

When reading the command output below, note that my NAS is called giles and the domain name is SUNNYDALE. My local username, and that on the box is jason. I set a test password of abcd for this.

Spoiler: it was the authentication method.

The problem was that the NAS drive only seems to work when NTLM authentication is used from Ubuntu; most utilities use NTLMv2 by default or some variant thereof. I was stymied by the fact that the initial tools I was using did not let me control this.

Keep the box awake

Most NAS enclosures put the drive to sleep after a period of inactivity. Normally this is a good thing, but during diagnostics it can cause spurious errors with name resolution or authentication depending on the tools used.

Disable the sleep-when-idle feature while you're debugging, or keep the web interface open in a browser and periodically refresh it to make sure it's up. Remember to re-enable it when you're done!

Make sure you can resolve it

First make sure you can resolve the NAS. Use nmblookup:

~ • nmblookup giles
192.168.1.114 giles<00>

If you're not seeing it, you might need to install the libnss-winbind package (ie. with sudo apt-get install libnss-winbind) and edit /etc/nsswitch.conf. Look for a line beginning with hosts: and place wins somewhere:

hosts:          files mdns4_minimal [NOTFOUND=return] dns wins mdns4

(Please note I'm no expert on these settings; record what the line was before in case you run in to trouble later.)

Use mount.cifs, not smbclient

I found that smbclient did not catch my problem because it does not allow you to fine-tune the authentication settings. The mount.cifs utility does, however. There are a few other details it gives you more control over, eg. the SMB protocol version used. This terminal session shows how you can try different domains and authentication methods:

~ • mkdir temp
~ • sudo mount.cifs //giles/jason ./temp -o username=jason,password=abcd,domain=SUNNYDALE
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
~ • sudo mount.cifs //giles/jason ./temp -o username=jason,password=abcd,domain=SUNNYDALE,sec=ntlmv2
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
~ • sudo mount.cifs //giles/jason ./temp -o username=jason,password=abcd,domain=SUNNYDALE,sec=ntlm
~ •

(That last command was successful.)

Note that you might get some spurious failures from mount.cifs though, eg.:

~ • sudo mount.cifs //giles/jason ./temp -o username=jason,password=abcd,domain=SMB
mount error: could not resolve address for giles: Unknown error
~ • sudo mount.cifs //giles/jason ./temp -o username=jason,password=abcd,domain=SMB
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

Sometimes I even got an authentication error on the first try but not the next. Try each command two or three times to be sure.

Override smb.conf settings/tool defaults

Be careful when debugging SMB problems that you're not relying on the defaults in either /etc/samba/smb.conf or mount.cifs (or whatever tool you're using). In particular, the workgroup (line starting workgroup =) and the authentication method (client ntlm auth = ... for example, with multiple lines for different protocols).

Note that in the mount.cifs terminal session above, I always specify the domain while changing the authentication method. Be scientific! Change one and only one thing each time. If it gets tedious, write a script!

Try different workgroups

As Ben Grimm points out, sometimes these boxes ignore the workgroup you give them. Try one of the following:

WORKGROUP
SMB

Find a Windows or OS X machine

This is a basic sanity check: if you can connect from a Windows or Mac machine, it should at least be possible (even if difficult) to connect from Ubuntu. If you can't connect from any other machine, go back to the start and try to configure things until you can.

In my case I didn't have a non-Linux machine to try with at first. Eventually I found an old XP VM (it was a backup of a machine from years ago). I realised that I could connect to the NAS just fine from it! This led me to my next tactic…

Wireshark

Wireshark is a program that inspects and dumps packets going through an interface on your computer. Once I realised that my XP VM could connect, it became a matter of figuring out what that machine was doing that my Ubuntu machine was not.

Wireshark only monitors interfaces on the computer it's run on. This means that you must run it on a machine that sits in between your test machines and the NAS box. I'm not going to give a full tutorial on routing etc. here, but it worked for me because I ran it on the machine hosting the XP VM, so all the packets were going through eth0 as far as Wireshark was concerned.

In my case, the XP VM had IP 192.168.1.111 and the NAS had IP 192.168.1.114. So the capture filter I used in Wireshark was:

(host 192.168.1.111) and (host 192.168.1.114)

Then I:

booted the XP VM
started the capture
in the XP VM I launched Explorer, entered \\giles\jason and hit enter
entered my credentials and the domain
once the share was opened, I switched back to Wireshark and stopped the capture.

At this point, I looked through the packets by using Edit > Find packet... and selecting the "by string" option. I just searched for my username and looked for the first successful authentication attempt. You can see which are unsuccessful by looking for STATUS_LOGON_FAILURE a few packets later.

What surprised me was the sheer number of attempts that XP was performing. It used the given username and domain name, sometimes it used WORKGROUP or SMB or even the client name as the domain, and it tried multiple authentication methods.

Funnily enough, I never even identified the successful attempt! This was the point at which I realised smbclient was not going to help, and went back to mount.cifs and used it much more scientifically.

A note about NTLM and Nautilus/GVFS

Finally, after figuring out what the problem was and successfully accessing the share via mount.cifs, I still couldn't get Nautilus to connect. The problem here is the Nautilus uses GVFS to mount SMB shares, and GVFS uses NTLMv2 by default.

You can change this system-wide by editing /etc/samba/smb.conf and adding:

   client ntlm auth = yes
   client ntlmv2 auth = no

I added this just below the workgroup = ... setting. However, this will force the change for all SMB shares GVFS tried to mount, which might make other shares inaccessible, so beware.

(For some reason mount.cifs complains about that first line, but testparm doesn't. Perhaps it can be removed, but I'm not game to try.)


Two proposed solutions:
Update Graphics Driver
Confirm that the graphics driver for your GPU is up-to-date.
Use the Proprietary NVIDIA Drivers
It appears to me that some users aren't able to use Blender with the Nouveau (open-source) driver for NVIDIA GPUs.
The solution may be to switch by using the official NVIDIA (proprietary) drivers instead.

For Nvidia there are open source (Nouveau) and closed source (by Nvidia) graphics drivers. Blender functions best with the closed source drivers as they are more optimized and complete.
- https://docs.blender.org/manual/en/latest/troubleshooting/gpu/linux/nvidia.html#drivers

There is an open source driver managed by a group of developers that are unrelated to NVIDIA, called Nouveau, and that driver doesn’t support Cuda.
Cuda only works with the proprietary driver...
- https://forums.developer.nvidia.com/t/can-cuda-operate-with-open-source-nvidia-driver-or-only-with-nvidia-proprietary-driver/48039

Ensure then when you try this, you're getting the latest version compatible with your GPU.
sudo add-apt-repository ppa:graphics-drivers
sudo apt install nvidia-460

Installs what appears to be the latest drivers for the GTX 1650, may require a restart after installation.
More info: https://www.nvidia.com/Download/driverResults.aspx/170134/en-us


Private messages should create another window and highlight it in a different color.

By default, these are the following colors and their meanings in IRSSI:

White - Part/Quit/Join
Bold White - Unread channel messages
Bold red/pink - Unread channel highlights or private messages

See the [Act: 2,3,4,5] text? Those numbers represent unread notifications.  2 is a private message, 3 is a ping in a channel, 4 is an unread message, and 5 is someone joining or leaving.

You can access them by cycling through with Ctrl+N or Ctrl+P, or by typing /window N, where N is the window number.


VPN allows you to access the internet in total anonymity and is therefore highly preferred by internet users all over the world.
Most of the VPN users have Windows as their OS, hence if in any case, they are required to use Linux, it is likely that they find it hard to configure VPN over it.
I am using USA VPN on ubuntu, and i realized that Confiugre PPTP VPN on ubuntu is not a difficult task, here i recomened you to check this easy setup hope it would helpful for you
PPTP VPN Setup On Ubuntu