/etc/hosts file not being used before DNS server query

Turns out I am a massive buffoon;

The host command just seems to ignore the /etc/hosts file and perform queries against your configured DNS servers directly. If I ping www.somesite.com I am using my /etc/hosts file entry, and after installing wireshark I can see that chrome is too.

Hope that helps someone!


xrdp and xfce4 Ubuntu 14.04 slow refreshrate

This changes ll make little progress on this.

The performance can be increased by modifying the xrdp.ini file (backup process noted because backups are important).

Code:

sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.back && sudo nano /etc/xrdp/xrdp.ini

In the [globals] section, change max_bpp=24 and add the command to use compression as so:

    max_bpp=128
    use_compression=yes

and modify the [xrdp7] section by changing xserver_bpp=24:

xserverbpp=128


Is there any way to completely wipe Ubuntu?

There's no need to erase the old install prior to installing the new one. Just boot from the LiveCD of the new Ubuntu, choose manual partitioning and make sure you choose to format the root partition.

If you have your home directory on a separate partition, you may keep it, which will preserve your documents - but, as usual, making a backup of all your data is essential before re-installing.


If I try Ubuntu on a portable hard drive, will the HDD function as normal afterwards?

It wants to repartition and reformat the entire disk because the Live USB must be formatted as FAT in order to boot. If you want to do it back up your files first.


monitor memory usage of a single process in Ubuntu

Install sysstat package

Read man pidstat, look at option &  for example commands go to bottom of man page.

Ex. of nautilus, current id here as reported by ps is 2286, generating 120 reports 60 secs apart, outputting to a log in home folder

Get process id you want to track, many ways, a couple below - (start process/app

find in list

ps axu

If you know the name then this works fine, current example of nautilus

ps axu |grep nautilus |grep -v grep

Then in a terminal, (replacing your process # after -p

pidstat -r -p 2286 60 120 > naut-mem.log

If desired just minimize terminal while pidstat is running

If you plan on outputting to same log file several times & want it appended to then use >> instead of > in command


Solution (?)

Check mplayer's man page.
Now this may sound trivial and silly, but mplayer is a featureful  piece of software.

For example, there is this (for DVD):

-dvd-speed <factor or speed in KB/s> (DVD only)
              Try  to limit DVD speed (default: 0, no change).  DVD base speed
              is about 1350KB/s, so a 8x  drive  can  read  at  speeds  up  to
              10800KB/s.   Slower speeds make the drive more quiet, for watchâ
              ing DVDs 2700KB/s should be quiet and fast enough.  MPlayer  reâ
              sets the speed to the drive default value on close.  Values less
              than 100 mean multiples of 1350KB/s, i.e. -dvd-speed  8  selects
              10800KB/s.
              NOTE:  You  need  write  access  to the DVD device to change the
              speed.

And then the same for CDDA:

-cdda <option1:option2> (CDDA only)
              This option can be used to tune the CD Audio reading feature  of
              MPlayer.

              Available options are:

                 speed=<value>
                      Set CD spin speed.

Workarounds

You could try mplayer and cache the video file.
But don't do this, as this would eat up all the memory you have.
You could just rip or read in the disc before watching it.
If the noise bothers you even at this period, reading the disc gives you the option to specify read speed. If I recall correctly, K3B had this option included.
Get an external HDD or DVD. HDD is a better investment.
You can store enough movies for your lifetime on a HDD nowadays.

Disclaimer
I have no DVD or CD drive connected, so I could not test these out.


12.04 LTS won't boot. No boot option. Installed along side vista 64 ultimate

You can try to repair GRUB.

To do this, boot from any Live CD and open a terminal.
Mount the partition with your installed Ubuntu by entering

sudo mount /dev/sda? /mnt

Important: replace the '?' with the partition where you installed Ubuntu!
If you don't know which partition this is, open gparted and look for it.
Include the directory with important device information

sudo mount -o bind /dev /mnt/dev

and /sys

sudo mount -o bind /sys /mnt/sys

and the interface data

sudo mount -t proc /proc /mnt/proc

Now change into the mounted system:

sudo chroot /mnt /bin/bash

Then you can install GRUB by typing

grub-install /dev/sda

and

update-grub

If you get Errors with the last step, just mention it in a comment.
Exit the terminal with exit.

Hope this is helpful for you.


Try this :
#!/usr/bin/env bash
Servers_list=/opt/servers_list
for Host in $(< $Servers_list )
do
  echo "Installing package on $Host"
  ssh "${Host}" "echo 'mysql-server-5.7 mysql-server/root_password password your_password' | debconf-set-selections && \
    echo 'mysql-server-5.7 mysql-server/root_password_again password your_password' | debconf-set-selections && \
    apt-get update && \
    apt-get -y install apache2 apache2-doc apache2-utils mysql-server"
done

If you have a lot of server you should consider using a tool like ansible or puppet.
Edit :

Backslash (\) are used for readability.  They allow to continue the command on a next line.
AND (&&) operator is used to exec many command on the same line.  If one fail the next is not executed.
debconf-set-selections is used to preset configs.  In this case : password.  You can find more information on it inside the man page by typing : man debconf-set-selections inside terminal.


Reusing flickr Ubuntu account with flickrapi

Looks like I have managed to find a way after all.

The correct version to be used is the version from the sources. The version shipped with Ubuntu 13.04 is too old and it uses previous flickr auth API. The 2.0-beta from hg uses the new oauth API.

The problem was that the token provided in the FlickrAPI constructor was not passed to the internal OAuthFlickrInterface. To workaround this problem I needed to simply call:

flickr = flickrapi.FlickrAPI(
                             # args same as before
                            )
flickr.token_valid()

if this method returns True we can make sure:

rsp = flickr.test.login()

This will perform an API call to check the token, but before doing so it will pass the token object to OAuthFlickrInterface as a side effect.

I can now use flickrapi with my Ubuntu Flickr account!


Network is disabled every time I reboot Ubuntu 16.04 LTS webserver

I don't recommend Network Manager for a server because it requires a desktop environment and a graphical interface. These take resources away from the server. As well, servers are often run headless; that is, without a monitor and then no desktop environment or graphical interface is possible.

I recommend that you set up a static IP address so that you can ssh and ftp into the server. Be certain to select an address outside of the pool used for DHCP in the router.

I suggest that you amend the file /etc/network/interfaces to read something like this:

auto lo
iface lo inet loopback

auto enp3s0f2
iface enp3s0f2 inet static
address 192.168.1.125
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 192.168.1.1

Of course, substitute your relevant details here. Either remove or at least temporarily stop Network Manager:

sudo service network-manager stop

Restart the interface:

sudo ifdown enp3s0f2 && sudo ifup -v  enp3s0f2

Check:

ping -c3 8.8.8.8
ping -c3 www.ubuntu.com

If you get ping returns, you're all set.


Typed

dpkg -l | grep costume

which returned

ii  costume-quest       0~20130507-0ubuntu1      i386       Halloween adventure [...]

and removed it using

apt-get purge costume-quest

(note that
    costume-quest
returned an "unknown command" message)


Everytime, I need to install OS and some applications. Is there any way to install ubuntu with all the applications in single installation?

You can use:

dpkg --get-selections

Which will output all the packages you have installed. You can save this file like this:

sudo dpkg --get-selections > mypackages.txt

Later you can restore the package list by doing:

sudo dpkg --set-selections < mypackages.txt
sudo apt install -f

Note, however there are some caveats to this:

The list of packages contains everything, not just packages you have installed yourself.
This could be a problem if you run this command on an older version, such as 18.04.1 and then restore the package list on something like 18.04.2 where some packages may have been replaced or changed names.
This will almost certainly cause a problem if going from one major release of Ubuntu like 16.04 to another major release like 18.04 since they will contain drastically different package lists.
Some of this can be resolved by eventually doing a sudo apt install ubuntu-desktop after everything to "force" all the default Ubuntu packages to be installed.

Note: If anyone reading this knows how to get a list of packages only installed by the user and not the system, please edit this answer.


DNS configuration is reset by a network manager

If you are using dhcp client, then every time you acquire new IP from the DHCP server, Network Manger will update /etc/resolv.conf with DNS from the server.
You an avoid this by editing config file in
/etc/sysconfig/network-scripts/ifcfg-ethXXX

where ethXXX is the name of your network device
you can manually add DNS of you liking like this
DNS1=1.2.3.4
DNS2=1.2.3.5


Mount win share access after 18.04 update in mate

Having a look at the help.ubuntu.com pages may help
https://help.ubuntu.com/stable/ubuntu-help/nautilus-connect.html

See 'Windows Share' section


How to adjust screen brightness in Ubuntu 14.04?

Manually changing brightness

Remember that on Linux/Unix everything is a file. Brightness value is also stored in a file. Open a command line ( aka Terminal) by pressing Ctrl+Alt+T, or by searching 'terminal' application in the dash. Then execute these commands:cd /sys/class/backlight/. cd is basically used for navigating through directories. And under backlight for me there is folder acpi_video0, but for you it may be different. Use ls command to find out what folder name it is. cd to that folder as well. So for example, I would do as show in picture

OK, so by now you have navigated to the folder which contains your brightness settings. Inside there is brightness file and max_brightness file.

cat max_brightness will tell you the maximum brightness that you can set on the screen. brightness is the actual file  that controls brightness. You can change it from 0 to whatever number is in max_brightness.

See the number 7 after I did cat max_brightness ? This is my maximum brightness value, so it means i can change brightness from 0 to 7.

Now we can edit brightness file to actually change screen brightness. We will need some text editor command. I prefer using command line text editor nano. So I would do

sudo nano brightness

It will ask you for your password. Enter it, and you will see a screen something like this:

Do you see where is my cursor? right after the number. That's what i mean when i said, don't hit enter. This file has to have only that one line, no other. You can use left/right keys to move cursor, and backspace or del keys to delete old number, and then type new. Remember, that you can only go from whatever number was in max_brightness file to 0.

When you wrote new number, press Ctrl+X, it will ask if you want to "Save modified buffer". Press Y. Then it will asks what name of the file to write. Just press enter, we do not want to change name of this file. Done. At this point your brightness should change.

Small note on the side: The problem with graphic text editor like gedit, is that it tries to create a backup for every file, and brightness file and that folder has permissions such that only root can modify it, so it won't let gedit to change that file or create backup, even with gksudo - i tried

Script version:
This script opens my brightness file with nano editor. Make necessary adjustments for your system, as some folder names may be different.

#!/bin/mksh
printf " \n Entering file to change brightness in 3 seconds\n remember - no new line after number.  ";
sleep 3;
sudo nano /sys/class/backlight/acpi_video0/brightness


Your approach with sudo tee is fine. A nice consequence of using sudo tee is that the executed command before the pipe will not run as root. That's useful if you just need the output of a program, which does not require root privileges.

If you don't care about the output of the program used before the pipe (echo 1 in this case), redirect stdout to /dev/null:

echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null

The above is equivalent to sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward' with the difference that echo 1 is run as root.

If you need to append to a privileged file, you can either use sh -c 'echo 127.0.0.1 local.host >> /etc/hosts' or:

echo 127.0.0.1 local.host | sudo tee -a /etc/hosts

Note the -a which is shorthand for --append.


How do I add an icon to an executable file

Create a "Application_name.desktop" file using gedit or any other text editor with contents
[Desktop Entry]
Name=Application name
Exec=path-to-executable
Icon=path-to-icon
Terminal=false
Type=Application
put it in ~/.local/share/applications
For complete documentation checkout https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles


You can specify what version to use when mounting, by adding e.g. vers=3.0 to the mount in /etc/fstab. I just wrote an explanation about mounting with different versions here: CIFS mount get dropped Ubuntu VM using VMWare.


Here is a simple Python program to turn the wifi on at 00:00 and then back off at 06:00 :
import os
import time
from datetime import datetime
import sys

while(1):
    now = datetime.now()
    if now.hour == 0:
        print("Starting Wifi...\n")
        os.system("nmcli radio wifi on")
    if now.hour == 6:
        print("Turning Wifi off...\n")
        os.system("nmcli radio wifi off")
        sys.exit()
    time.sleep(60)

Just save this as a .py file, and then add it to the startup services on your Linux system so that it starts in the background when the computer is started and keeps running. The script will automatically terminate after it Turns the wifi off at 06:00 ± 1 min.
NOTE: The script checks the current hour every 1 min, so the actual time when the Wifi connection is tripped or restarted may get delayed by 1min, if you want it to check it faster, you can change the time.sleep(60) to let's say time.sleep(30) to make it check time every 30 seconds.

UPDATE: (To turn off at 05:50), use the following, you can tweak the hour and the seconds to your liking in the line if now.hour == 5 and now.minute >= 50: of the code below:
import os
import time
from datetime import datetime
import sys

while(1):
    now = datetime.now()
    if now.hour == 0:
        print("Starting Wifi...\n")
        os.system("nmcli radio wifi on")
    if now.hour == 5 and now.minute >= 50:
        print("Turning Wifi off...\n")
        os.system("nmcli radio wifi off")
        sys.exit()
    time.sleep(60)

Adding the Script to STartup Apps

Check your Python version by the which command in terminal, for Python2 use: which python2, for python3 use which python3. Copy the location of the python.

In your Ubuntu's Applications list, look for Startup Applications and run it.
Add a new App by selecting "Add"
Give your startup service a name, and type the command to execute. For me, since my Python version is 3, located at /usr/local/bin/python3 with python program at /Desktop/wifi.py, I use the following in the command : /usr/local/bin/python3 /Desktop/wifi.py
Next, simply add the service.

UPDATE: a program that displays messages only once. Added Feature: if wifi is turned off accidentally during the time when the program expects it to be on, the program will automatically restart the wifi. So the program will also be checking the internet connection and prevent wifi from being turned off between the turn on and the turn off times.
import os
import time
from datetime import datetime
import sys
import urllib.request

def connect(host='http://google.com'):
    try:
        urllib.request.urlopen(host) #Python 3.x
        return 1
    except:
        return 0
preWifi = 0
while(1):
    now = datetime.now()
    wifi = connect()
    if wifi == 1 and wifi != preWifi:
        print('Wifi On.')
    if now.hour == 0 and wifi != 1:
        print("Starting Wifi...\t | Time", now, "\n")
        os.system("nmcli radio wifi on")
        print("Reconnecting...please stand by.\t | Time =", now, "\n")
        while(not connect()):
            time.sleep(0.5)
    if now.hour == 5 and now.minute == 50 and wifi == 1:
        print("Turning Wifi off...\t | Time", now, "\n")
        os.system("nmcli radio wifi off")
        sys.exit()
    preWifi = wifi
    time.sleep(1)

Hope this works perfectly! :D

To completely turn off messages, just save the program with a .pyw extension instead of .py.


How to report a corrupt package on a specific apt repository?

As far as I'm aware there is no designated area for broken repositories. To report a broken repository I would recommend just posting it as a bug using the below site.

https://bugs.launchpad.net/


Unable to boot from Ubuntu 20.04.02 live usb

I highly recommend Universal USB
Installer instead of Rufus.
I had the same issue with my personal computer, tested many solutions that didn't work, and finally that software solved it.


Boot fails After installing Windows 10 over Ubuntu 16.04

Boot-Repair

Everytime when my Bootloader gets corrupted, in general with the help of microsoft, i boot the system with a 1gb usb stick containing a Lubuntu version. Than i follow the instructions here Boot Repair

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

In general the default settings work fine.

I hope this helps you somehow.


SSH Key with user and root with shell script

There are two ways you could do this:

One key: ssh directly from localhost to root@remote

Generate a new keypair if you haven't already.

ssh-keygen -t dsa -f ~/.ssh/id_dsa -N ""

Copy the public key into the root account of the remote machine:

ssh user@remote sudo -i bash -c "mkdir -p .ssh && cat >> .ssh/authorized_keys" < ~/.ssh/id_rsa.pub

(You will need to enter one or two passwords.)

Test to see if it worked:

ssh root@remote.host

Two keys: ssh to user@remote using your local key, then ssh to root@remote using the user's key on the remote

Log in to the remote machine as the user

ssh user@remote.host

Create a key pair on the remote machine (follow step 1 above)
Copy the key into root's account:

sudo -i bash -c "mkdir -p .ssh && cat >> .ssh/authorized_keys" < ~/.ssh/id_rsa.pub

As user on remote, test it:

ssh root@localhost

(No password required)

Log out and attempt both hops from your home machine:

ssh user@remote.host ssh root@localhost

If that works, now you can block root login attempts from external IPs.

Issues

If the tests fail:

You may need to check /etc/ssh/sshd_config on the remote host to ensure you have a line with no # comment:

PubkeyAuthentication yes

and either:

PermitRootLogin without-password

or:

PermitRootLogin yes

If you do need to change any lines, restart the ssh server afterwards:

sudo -i service ssh restart

You may need to set a password for root on the remote machine (even if you don't intend to use it!):

sudo -i passwd

That is not really desirable, but could be helpful for debugging.

To disable the root password again, run:

sudo passwd -l root


Ubuntu 12.04.1 LTS USB not being detected after formatting with Startup Disk Creator

No, it's not toast.  Startup disk creator is very particular about the partition table, and the partition table written by the manufacturers is often inconsistent with Linux.  Another symptom is that Disk Utility and Gparted are not able to delete the partition table.

You can repair the device by erasing the partition table with dd:

dd if=/dev/zero of=/dev/sdX bs=512 count=1

Change sdX to the correct device which in your example above will be sdb.  Do not get it wrong because the target device will be made completely blank in the blink of an eye. There will be nothing visible on the device after you run this command.

You can then create a new partition table with disk utility or Gparted and create a FAT partition that boot disk creator (and linux utilities in general) will be happy with.

A possible explanation for the inconsistent treatment of partition tables can be found in the Linux cfdisk manual page (cfdisk is a text based utility for manipulating disk partition tables):

  DOS 6.x WARNING

   The DOS 6.x FORMAT command looks for some information in the first sec‐
   tor of the data area of the partition, and treats this  information  as
   more  reliable than the information in the partition table.  DOS FORMAT
   expects DOS FDISK to clear the first 512 bytes of the data  area  of  a
   partition  whenever a size change occurs.  DOS FORMAT will look at this
   extra information even if the /U flag is given -- we  consider  this  a
   bug in DOS FORMAT and DOS FDISK.

Partitioning and formatting tools that may be based on DOS versions or use the same logic for making partitions that are used by the OEMs may therefore be setting Linux users up for this problem.  The main USB sticks I've had problems with are the good branded ones (eg. Verbatim) that include so-called backup or synchronisation software for Windows based machines.


How to print in Black and White for Canon Printers

As outlined in this blogpost. I tested this on Canon MP280 using Ubuntu 12.04.

Click System –> Administration –> Printing.
Now right click on your printer and select Properties.
Now select Job Options
Now scroll down to the bottom.
At the bottom you will see a text box . In that text box add CNGrayscale and click on Add button .
Once you click add there will appear another text box right above the first text box . So in the second text box add "TRUE” and click on apply.

Thats all , now your printer will print in Grayscale mode . In case you want to print in color mode just change the TRUE to FALSE .

EDIT,
In the 12.04.1 precise, these options are difficult to find.

You have to run the application "system-config-printer" in terminal or Alt-F2. Then you will always print in grayscale. No options are available in the menu.  I am using mp280series_3.4-1. To print in colour you will have to run system-config-printer again.


The FindKDE4Internal.cmake file is in the kdelibs5-dev package. Just install that and you should be go.


Why doesn't unity dash respect the gnome Main Menu entries?

Yes, this was due to a bug in Unity. When you get the latest version of the package unity-place-applications (version 0.2.40-0ubuntu1) this should work. The package hit the main archive last night and should be available in local mirrors shortly.


USB Wireless adapter driver, tplink T2uhp ac600 (mt7610?)

A quick hack of a fix is
sudo sed -i 's/0105/010b/' /lib/modules/$(uname -r)/kernel/drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0u.ko
sudo depmod -a
Reboot
This will replace an existing entry in the module alias file
For now do sudo apt install --reinstall linux-modules-extra-$(uname -r)
Reboot
then try sudo modprobe mt76x0u then do echo 2357 010b | sudo tee /sys/bus/usb/drivers/mt76x0u/new_id
See if it works
Lets try a udev rule
sudo touch /etc/udev/rules.d/98-wifi.rules
gedit admin:///etc/udev/rules.d/98-wifi.rules
Paste this into the file
ACTION=="add", ATTRS{idVendor}=="2357", ATTRS{idProduct}=="010b", RUN+="/sbin/modprobe mt76x0u" RUN+="/bin/sh -c 'echo 2357 010b > /sys/bus/usb/drivers/mt76x0u/new_id'"
Reboot and see if it works


Is it possible to have two virtual consoles open in a single screen?

You'd need a tool that allows screen splitting like tmux to do that.Tmux is available on the repositories, and as per the manpage you can use % to split the screen vertically and " to split it horizontally


Problems with eclipse mars 2 in ubuntu 16.04

This is a Bug but here is an answer almost cover this bug

Goto eclipse directory (/opt/eclipse).
append --launcher.GTK_version 2 to eclipse.ini
Save and run eclipse using terminal or the original directory

  Note: if you create a launcher before and open it will not detect GTK according my previous Question


How do I make Windows 7 the default OS instead of ubuntu?

Run this: sudo apt-get install startupmanager. Then you can launch startupmanager which gives you a GUI to change many settings, including default OS to boot.


Ubuntu 14.04 LTS user accounts log-in - How?

Go to the Settings screen by pressing the gear icon in the top right of your screen:

then click System Settings:

User Accounts: This is were you can create a new user account. Once there, you will need to "Unlock" the user account screen to get administrator rights. Then you can add, edit and delete accounts. You will also be able to change the "auto-login" feature there.
Mouse & Touchpad: There you will be able to customize the mouse settings for the current logged in user (to change another users settings, simply log into their account and make the changes there).


How to watch tv or listen to radio on Meizu Pro 5?

I am not too sure about TV, but I would imagine it is possible. However, I know you can listern. To the radio fine on Ubuntu Touch. The two apps that come to mund are URadio and Local Radio (I think it is called). They can be downloaded from the Ubuntu Store. The local radio is only for UK stations though so may be URadio would be better for you in Denmark.


Apache2 not working in Ubuntu 14.04: won't restart, unknown job

It sounds a bit like some apache binaries might be missing.

sudo apt-get purge apache2*

that will remove all apache2 packages, then

sudo apt-get install apache2

As long as there are no errors through any of that then that should be fine. If you want to check apache is listening

sudo netstat -anop | grep apache

You should see apache listening on port 80. You can also check the status of apache2 by doing

sudo service apache2 status


I have made a workaround that is a script that helps to configure your session.

Download it here.
Make it executable and run from terminal ./session.config

You can view the code of script ( https://www.dropbox.com/s/w1btmead93q6hze/session.config?dl=0 ), there are explanations in each part. It will create a startup script which will move to each viewport and open the specified application.

Also you can run it whenever you want just press Alt + F2 and paste ~/.sessionconf.

Removing

To remove any changes made by my script just delete this files:

~/session.config
~/sessionconf
~/sessionconf.bak
~/.config/autostart/sessionconf.desktop

Or run this at terminal:

rm ~/session.config ; rm ~/sessionconf ; rm ~/sessionconf.bak ; rm ~/.config/autostart/sessionconf.desktop


How to format a filesystem hdd(not partition) from ext4 to ntfs

You can always resize or format your partition except when you are using it / have it mounted.

So to resize or format the root partition you have to use an ubuntu installation media like an usb stick and boot from that. This way the root partition is not in use. Run from there gparted and resize or reformat your partition.


Front audio port doesn't produce any sound

https://frdmtoplay.com/gigabyte-front-panel-audio-with-linux/

cut and paste below into a file called audio.sh

usage="usage: sh audio.sh s|h"

in=$(pacmd list-sink-inputs 2>&1 | egrep index: | sed 's/.*: //')

speaker=7

headphone=8

test x"$1" = xs && {

out=$speaker

}

test x"$1" = xh && {

out=$headphone

}

test x"$1" = x && {

echo "$usage"

exit 1

}

pacmd move-sink-input $in $out


You should consider installing jupiter

You can select power modes with it, which control the way power is used, it really keeps the temperature down. It also really saves out battery.

  open terminal and do this.

  add the repository

  sudo add-apt-repository ppa:webupd8team/jupiter

  update

  sudo apt-get update

  install jupiter

  sudo apt-get install jupiter

  and to other people reading this and are using an Asus EEPC netbook,
  install this asswell

  sudo apt-get install jupiter-support-eee

Have a nice day :)


For wireless network, your connection may be not very stable. The interval of reconnecting may be set as a long time. You should check your wireless device, for me that is AR9485 using ath9k drivers. Try to create /etc/modprobe.d/ath9k.conf, add  "options ath9k nohwcrypt=1" into it and reboot.

WPA/WPA2 mixed mode has a very bad reputation here. Causes a lot of authentication problems. So whether it helps or not, keep the encryption to WPA2-only. This is one of the very few things I can recommend with confidence. see http://ubuntuforums.org/showthread.php?t=2080238

I suffered much from it recently. I think the best thing to do is get a better network connection. The connection quality talks much than your adjusting your own settings. Try to tolerate it.


How do I prepare for Dual Boot Windows7 & Ubuntu

Disclaimer: I am not a Ubuntu expert!
However, it looks like GParted might be what you are looking for according to this set-up guide:

We're going to use GParted, the Linux-based uber-tool for all things hard drive. You could grab the Live CD if you felt like it, but since you've already downloaded an Ubuntu installer, you can simply boot a "live," no-risk session of Ubuntu from your CD or USB stick and run GParted from there. Once you're inside Ubuntu, head to the System menu in the upper left when you get to a desktop, then choose the Administration menu and GParted under it.


Cannot use both headphone ports on Dell XPS L502X at the same time

Try this link.
Its a link to an ubuntu forums post giving the solution to a similar problem.

EDIT:

Though I would recommend going through the links to solve the problem but as the person below asked me to put the instructions in the post itself, so here we go:

Find your sound card model using this:

cat /proc/asound/card0/codec#* | grep Codec

For me this outputs:

Codec: IDT 92HD73C1X5

The file /usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz lists the sound card models with available modprobe modules to use.

zless /usr/share/doc/alsa-base/driver/HD-Audio-Models.txt.gz

The full model number wasn't in there, because the model has been wildcarded. I searched for:

92HD73

Now put:

options snd-hda-intel model=dell-eq

or:

options snd-hda-intel model=dell-m6

into the file:

/etc/modprobe.d/alsa-base.conf

Now which line to put in the file will depend on the model of your laptop. In short, its the former line to put for dell studio 15xx models and latter for studio 17xx as indicated in this thread on ubuntu forums


Install python 3.7 with the 3.5 version already installed on ubuntu 16.04

First we need to double check what are the currents installed version using the following commands
python --version  and/or python3 --version

The we make sure that the latest version of Debian is installed before the python installation.

A simple apt-get update and apt-get dist-upgrade followed by rebooting the computer will do.

Then, in order to verify the key signature of the python tar file we need to install DirMngr if it's not already installed:

sudo apt-get install  dirmngr

After that we can retrieve the OpenPGP Public Keys from the python downnload page and pass it out to the following command line:

gpg --recv-key AA65421D

and use it to verify the downloaded version

gpg --verify Python-3.6.4.tar.xz.asc

(3.6.4  can be changed for the specific version downloaded from python website)

From here, we copy our tar file to src folder

sudo cp ~/Downloads//Python-3.6.4.tar.xz /usr/src/

And we cd to the src folder and we untar the archive

cd /usr/src/ && sudo tar -xf Python-3.6.4.tar.xz

The following dependencies may be needed before compiling

sudo apt-get install build-essential checkinstall zlib1g zlib1g-dev openssl
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
sudo apt-get build-dep python3.5

The next step is to configure and install using altinstall to avoid versions conflict and to break program already running with the previous python version

sudo ./configure
sudo make altinstall

To run the 3.7 version you can simply use python3.7 to launch the interpreter and to install the equivalent ipython you can use this command

python3.7 -m pip install ipython


Posting images on internet just by pasting link

This seems to be a limitation of the GTK+. You can't force its file selector to do something it just can't currently do. Any applications that use the GTK+ file selector widget are going to have the same problems.

However applications that use the Qt equivalent (and therefore all KDE applications and many others), can open directly from HTTP links. I have tested this in Kate.

I'm not sure what solution you want here. You could probably spend some time hacking this into the relevant GTK library so that it functions like this in the future. You could then submit that upstream and it'd eventually be the default (if accepted).

But the quicker route for this is either:

Using an application that uses QT (or another framework that does this)
Find another workflow.

In the context a browser, no browsers that I have tested (including GTK and Qt widget based ones) were capable of opening a remote URI for a file selection.

As mentioned earlier, Qt is technically capable of this but in Rekonq (the Qt browser I tested) it seemed limited to local files only. This may be something that could be worked on. For the GTK+ browsers (most of them) work needs to be done at on GTK before they'll work.

In short, fixing this in the browser isn't going to be practical for anybody.

That said you might be able to create a FUSE-based filesystem that read from the clipboard and provided a fake filesystem that contained one file (which then streamed data from the URL using something like the python-requests library).

You could then just select that file in the browser and it'd work like any other file.

This isn't a small project (hence the lack of code) but it would be quite achievable to somebody with a little bit of Python experience.


Creating A Shortcut to Open Terminal & Run A Command

Yes, this can be done.

Install xbindkeys:

sudo apt-get install xbindkeys

And create the config file:

touch .xbindkeysrc

And now edit the file:

gedit .xbindkeysrc

Add this to the file:

"gnome-terminal -e 'sudo apt-get upgrade'"
Control+1

Save the file.

Now you need to add xbindkeys to "Startup Application".  That is addressed near the bottom of this answer on remapping keys.

The only problem with this solution is, if there aren't any prompts, the terminal will only stay open long enough to get your password and ask if you want to run the upgrade.  I don't know of a way to keep the terminal open, but maybe someone else will.


Make link open target file, not file at link location

This is due to the semantics of symbolic links.
While you can't change the way symbolic links are handled,
you can use a Link-type desktop file instead.
Make a text file in ~/Desktop called e.g. file.tex.desktop
with these contents:
[Desktop Entry]
Name=file.tex
Type=Link
URL=file:///home/myname/some/path/file.tex

This will open the path
/home/myname/some/path/file.tex

with the default text editor in the working directory
/home/myname/some/path/

regardless of the location of the desktop file.
You will need to adjust the Name and URL values
to be suitable, but everything else can stay the same.
Here's an actual working example:
[Desktop Entry]
Name=Link to utf8test.tex
Type=Link
URL=file:///usr/share/texlive/texmf-dist/tex/latex/base/utf8test.tex

Note that the URL must be a proper file:// URL.
Some file managers will assist you in generating these files
if you'd rather not do it by hand.
Related:

Is it possible to create a 'shortcut link' instead of 'symbolic link' to a folder?

How do I create an shortcut to a folder(not a symlink) in Ubuntu 18.04 like shortcuts in windows

https://unix.stackexchange.com/questions/310618/is-it-possible-to-create-a-soft-link-on-my-desktop-which-opens-with-the-target-p


How to set graphics & resolution on Frozen-Bubble?

There does not seem to be multiple resolutions available for Frozen Bubble. Even if you use the --fullscreen switch, the resolution will not increase. Instead the game will be displayed in the same resolution on a black background.

At least I couldn't find a switch or method to change the resolution.


I think that you are confused in this sense. First, if you want keep enabled only main and universe repositories, check your /etc/apt/sources.list to look something like this:

##
## ...comments...
##
deb http://extras.ubuntu.com/ubuntu raring main
deb-src http://extras.ubuntu.com/ubuntu raring main
deb http://archive.ubuntu.com/ubuntu raring main universe
deb http://security.ubuntu.com/ubuntu/ raring-security universe main
deb http://archive.ubuntu.com/ubuntu raring-updates universe main

Then, from terminal, run the following command:

sudo apt-get update

to resynchronize the package index files from their sources.

After all of these are done, if you still have doubts that a certain package is from proprietary sources, you can check with the following command:

apt-cache madison package_name

For example:

$ apt-cache madison firefox
   firefox | 23.0+build2-0ubuntu0.13.04.1 | http://security.ubuntu.com/ubuntu/ raring-security/main amd64 Packages
   firefox | 23.0+build2-0ubuntu0.13.04.1 | http://archive.ubuntu.com/ubuntu/ raring-updates/main amd64 Packages
   firefox | 20.0+build1-0ubuntu2 | http://archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
$ apt-cache madison wallch
    wallch | 3.01-0ubuntu2 | http://archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages


How do I enable wifi channels 12-14 when traveling outside the United States?

I'm not entirely sure, but I think the CRDA (Central Regulatory Domain Agent) should change itself based on your localization in system.

To change it manually use:

  % iw reg set <country code here, e.g. JP>

Read this for more info.


Overheating laptop dual Ati GPU HD4200 and discrete HD5400

Well the HD4200 is not supported with the proprietary Catalyst drivers (only Legacy drivers are available with no new X.org support). So you should try to disable the onboard graphics, and install the current Catalyst drivers for the HD5400.


I launched "synaptic" which told me how to fix it.

  sudo dpkg --configure -a


rsync copies files from working directory in addition to the requested ones

Original code was

DRYRUN="-n"
DRYRUN=""
...

rsync "${DRYRUN}" -avushi --stats --progress --log-file="${LOGFILE}"
 /media/dataspace/data/webcasts/ "${MOUNT}${DESTDIR}"

Working code is

DRYRUN=1      ## for testing rsync without any file transfers
DRYRUN=0    ## for live run
...
if (( ${DRYRUN} ))
then
  rsync -n -avushi --stats --progress --log-file="${LOGFILE2}" /media/dataspace"${DESTDIR2}"/ "${MOUNT}${DESTDIR2}"
else
  rsync    -avushi --stats --progress --log-file="${LOGFILE2}" /media/dataspace"${DESTDIR2}"/ "${MOUNT}${DESTDIR2}"
fi

"We have met the enemy, and he is us!" - Walt Kelly (Pogo comic strip)

I found it!  Invisible doesn't mean it's not there.

I don't quite understand what happened, but, by putting "${DRYRUN}" in the rsync command line it made the first argument to rsync "".  Apparently that got
interpreted as PWD instead of as an error.  So the command was transfer ""
and my real source to my real destination because rsync accepts multiple
sources.

The remaining question is why does rsync think that "" means current directory instead of interpreting it as a syntax error?


How to find only 'permission granted' files

One certainly could filter out the permission denied errors with 2> /dev/null redirection, as it is an output from error stream.

find -name "*.config" -perm /u+rw 2> /dev/null

But also a good idea is to exclude those directories that give you problems with -path /some/dir/*pattern -prune -o -print.

 find /  -path "./proc*" -prune -o -name "*.config"  -print 2> /dev/null

It's also should be possible to exclude multiple directories with logical OR operator -o and grouping into \( ... \) brackets

find / -maxdepth 1 \( -not -path /etc* \) -o \( -not -path /var* \) -o \( -not -path /proc* \) -o \( -perm /u+rw -name "*.config" \)


How to fully replace Windows8 with Ubuntu on Acer Iconiq w700?

Download Ubuntu and copy it to an USB stick.
For detailed tutorial see: https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-windows#0

Start from your USB stick and follow the installation process. There you can choose »erase disk and install Ubuntu«.
Take a look here: https://tutorials.ubuntu.com/tutorial/tutorial-install-ubuntu-desktop#0


I have Ubuntu 12.04LTS installed, how do I upgrade to 12.10 using a DVD?

If you're okay upgrading over the internet via WiFi then you should be able to just go to the software updater and upgrade! If you cannot see an upgrade option you may need to go into settings and change "Notify me of a new Ubuntu version" to "For any new version".

To upgrading using a DVD, just boot into the DVD and there should be an option to upgrade the current installation.

Before you upgrade you may want to check that your hardware can run Unity 3D as Unity 2D isn't included in 12.10 and you will be forced to use Unity 3D which would run unbearably slowly! Plus, you would probably want to back up all your data just in case anything goes wrong!


Searching a application name returns "sorry no match" in Ubuntu 14.04

Accidentally changed settings?

It could be that you accidentally changed the default search settings in Dash. I would check two things first:

run:

gsettings get com.canonical.Unity.Lenses home-lens-default-view

This should return a list, in which applications should appear, like:

['applications.scope', 'files.scope']

If not, you can set it to default by the command:

gsettings set com.canonical.Unity.Lenses home-lens-default-view "['applications.scope', 'files.scope']"

The applications Lens might be disabled for some reason, to check:

gsettings get com.canonical.Unity.Lenses disabled-scopes

It should return:

@as []

If not, reset it by:

gsettings set com.canonical.Unity.Lenses disabled-scopes "[]"

If that doesn't work

If all fails, as an alternative, you can reset the Unity configuration as described here:

You'll need Unity Tweak Tool:

sudo apt-get install unity-tweak-tool

Run the command:

unity-tweak-tool --reset-unity


Try first with sudo apt-get autoremove. This will remove the unnecessary dependencies.

Then in /usr/share/applications just delete the corresponding .desktop file for the uninstalled application. If you still see the icon on the launcher, just right click it and press unlock from launcher.


Open a terminal (xterm is fine) and execute  cd ~  to browse your home directory; after that execute pwd to print the directory's name.
Execute sudo chown YOURUSERNAME FILE to change the file owner of a file and be able to edit it; use chmod +x FILE to make a binary file executable.


The problem is that java -version does not seem to be writing to stdout

rhand@server:/tmp$ /usr/bin/java -version > t.log
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.04.1)
OpenJDK Client VM (build 19.0-b09, mixed mode, sharing)

The solution would be to use this command:

/usr/bin/java -version 2> /tmp/j.log


Boot repair error - GRUB is still absent. Please try again

Your Boot Repair output indicates that you booted the computer with Secure Boot disabled. Thus, there's no need to install the signed versions of the Linux kernel, which is what the linux-signed-generic package would install, unless of course you intend to enable Secure Boot. If so, you should be able to add linux-headers-generic to work around the problem. That's referenced on line 55 of your bash session. (Knowing to interpret and handle such messages is an important skill.)

Thus, I suggest you try again, but this time either omit the linux-signed-generic package from the apt-get install command or add linux-headers-generic. If you try the latter, be aware that you might conceivably end up with some other broken dependency, in which case you should read the output for a specified dependent package and add it to the list.

An alternative approach is to use my rEFInd boot manager:

Download the USB flash drive or CD-R version of rEFInd. Download links for both appear on the rEFInd downloads page.
Prepare a boot medium from the file you download.
Boot it as if it were an OS installer. The rEFInd menu should appear.
Boot to Ubuntu.
In Ubuntu, install (or re-install) a boot loader. Two options are likely to be easy:

Typing sudo grub-install followed by update-grub should re-install GRUB; however, it sounds as if the GRUB package may not be installed already. If so, you'll need to first do a sudo apt-get install grub-efi. This might create the sort of dependency issues you're reporting, though.
You can install the Debian package or PPA version of rEFInd to install it to your hard disk. It will then take over as your boot manager; you'll no longer need GRUB.


How to Kill and Alternate X session via cli

I've noticed that the kill command doesn't always work the first time.  Also there are times when it'll work, but just have a delayed response.

In the case of killing a login session, it most likely takes time for all the processes to die or be killed.  So I wrote a script that checks and follows up with subsequent kills that has always succeeded to log out the desired X session.

#!/bin/bash

results=1
while [[ $results > 0 ]]
do
    sudo kill -9 25745
    results=$?
    echo -ne "Response:$results..."
    sleep 20
done


Execute script in sh mode instead of bash in Shell

Put this line at the beginning of the file:

#!/bin/sh

or:

#!/bin/dash


This is known as Predictable Network Interface naming and is part of systemd, to which Ubuntu has been transitioning as of version 15.04.

In case you decide to revert back to the other version of naming:

How to rename network interface in 15.10?


Getting an error on Live USB boot: "(initramfs) Unable to find a medium containing a live file system"

Having the same problem, on the same mobo, all I can suggest is contacting gigabyte support (which I've done, and am waiting for a response from). However, I'm not that hopeful of a useful answer, given that after submitting the ticket, they showed me a page highlighting the OS support being Windows only (though they also give some guidance on the same support list for using Linux, advising 3rd-party drivers).

Maybe we can hope for a BIOS upgrade. I didn't put an optical drive is the computer, so I'll have to burn the disk on my other computer, then take the drive out and transplant it, and so on... a real drag.

I'm also trying each non-USB3.0 (as I know there are reasons that wouldn't work) socket. So far I've tried the two front-panel ones that I have.

I'll update here if I either get anywhere with that, or get a useful response from support.

UPDATE: So, I managed to get it to boot from optical with working networking and USB! The same trick might work to get the USB stick to boot, given as it's probably the wonky USB that causes that problem. In BIOS Setup, make sure the IOMMU controller is set to off, and when GRUB comes up, edit the boot commands, and add the following to the kernel parameters: iommu=soft

I got this from the Ubuntu forums, at http://ubuntuforums.org/showthread.php?t=2114055&page=2


Command line file rename with date and time

If your photo is named file.jpg and you want to back it up to a file named after the date, then run:

cp file.jpg "$(date '+%Y%m%d%H%M').jpg"

If the back-up files go in a different directory:

cp file.jpg "/path/to/backups/$(date '+%Y%m%d%H%M').jpg"

If, instead of backing it up, you wanted to rename the file, then use mv in place of cp:

mv file.jpg "$(date '+%Y%m%d%H%M').jpg"


It seems that you are trying to mount a disk instead of a partition on the disk, which is not possible. fdisk -l should list partitions such as /dev/sda1 or /dev/sda2. Mount those instead; they should work. If there are no partitions, you have not formatted your disk; use GParted or another program to do so. In addition, your usb drive should not be /dev/sda, as /dev/sda is usually the device that contains the root filesystem.
In response to your further questions, no, you do not need to create new partitions every time you use a hard drive; once they are created, they can be used by any computer that can read the filesystem the drive is formatted with. Linux can read ext3/4, xfs, jfs, btrfs, fat, ntfs (after installing ntfs-3g), and others. Unless you specified the size of your partition, the partition should take up all the space on the drive. If your partition does not take up the whole drive, the rest of the space is unallocated and cannot be accessed until it is assigned to a partition.


Network Information for Theft Prevention

There is many information that you could send in this case:

Public IP
Result of nmap, there's always "Tim's iPhone", "Herbert Müller-Desktop", "mrbrown.companyxy.net" if I make a quick scan in public networks
VOIP Configuration of the router
Username/ Password of the WAN connection of the router
Webcam picture ;)

There is a funny video from a hacker's conference, about a stolen pc from a hacker. The thief was caught because of the information the hacker collected by his remote.

In your case, i'd rather connect to one of my machines, whenever the notebook is turned on, so you can do what you want with your notebook, once connected:

ssh yourhomedesktop -R 2222:localhost:22

Now you can login to your notebook from yourhomedesktop like:

ssh localhost -p 2222


libreoffice not starting(with no errors!)

Does LibreOffice still show up in the processes?

This happened to me in multiple programs, and the UI just wouldn't launch.
But when I ran ps aux, it would show up.

In that case, I had to kill the process, and then when I tried to run it again, it would run perfectly.


Error printing with Canon ir1435 Idle - Filter failed

We need to create the following link

ln -s /opt/cel/bin/sicgsfilter /bin/sicgsfilter

It seems the driver didn't make it.


PowerXpress error with Driver Catalyst. How can I fix it?

What I did was copy the /usr/lib/fglrx folder to /usr/lib64/fglrx:

sudo cp /usr/lib/fglrx /usr/lib64/fglrx

After restarting the XServer I was able to open AMD Control Panel and choose between dGPU and iGPU.


How to remove unity and unity 2d and install KDE in Ubuntu 12.10 64 bit

You must install kubuntu-desktop witch installs KDE desktop and related packages needed.

do this by

sudo apt-get install kubuntu-desktop

You can leave unity by itself if you like, but if you want to remove them, you can totaly remove it by

sudo apt-get purge unity unity-2d


Ubuntu 17.10 WiFi is excruciatingly slow (Lenovo W540 Laptop, iwlwifi driver)

Hit the same issue with my W540 under Ubuntu 16.04, disabling 802.11n networking fixed it for me.

Add this to end of /etc/modprobe.d/iwlwifi.conf and restart:

options iwlwifi 11n_disable=1

Hope it helps!


I assume you are using Apache 2.4.

You have to create a virtual host for every server in directory /etc/apache2/sites-enabled.

A sample file looks like:

<VirtualHost *:80>
   ServerName server1.com

   <Directory "/any-path/server1">
      Require all granted
   </Directory>

   DocumentRoot /any-path/server1

</VirtualHost>

Save this as s1.conf and make a second one s2.conf. Note that apache 2.4 requires the file extension to be .conf.

Make the directories:

mkdir /any-path/server1
mkdir /any-path/server2

Copy the default index.html:

cp /var/www/html/index.html /any-path/server1
cp /var/www/html/index.html /any-path/server2

Modify them, so you can see which server you are accessing:

nano /any-path/server1/index.html
nano /any-path/server2/index.html

If you now run service apache2 restart, then both sites should become active.

You can test that by adding entries to your /etc/hosts file:

192.168.12.165  server1.com
192.168.12.165  server2.com

But replace the IP address with the IP address of the server.

Then point your browser to www.server1.com and www.server2.com.

Note: Normally you would create your .conf files in /etc/apache2/sites-available and enable/disable them using a2ensite and a2dissite, but for testing it is easier to create them in /etc/apache2/sites-enabled.


No.
Yours to decide. I am not telling, advising or ordering you what to get. Totally yours to decide upon. I took 3 months to decide on my new machine checking pages online  ;)

  If this isn't the right forum for the discussion on Ubuntu-compatible devices, would you be able to recommend where to discuss it?

Your Ubuntu Local Community team will know: http://loco.ubuntu.com/


Troubleshoot Python script to update Dynamic DNS with NameCheap (Script from Help Ubuntu)

I needed to add

#!/usr/bin/python

To the top of the Script and remove python from crontab entry


Try to install winusb to create bootable windows usb from ubuntu.Run the following commands on terminal to install winusb,

sudo add-apt-repository ppa:colingille/freshlight
sudo apt-get update
sudo apt-get install winusb


On the github page of Bootstrap Studio, they have clearly given the steps to install it

Installation
The script is available on npm. To install it:
npm install -g bstudio
This will create a global bstudio command which you can call from the
terminal.


I need a Canon Pixma Ip1800 driver for Ubuntu 14.04 32bit

I would recommend you to try this deb file: http://ppa.launchpad.net/michael-gruz/canon/ubuntu/pool/main/c/cnijfilter-common-3.50/cnijfilter-common_3.50-2ubuntu4_i386.deb

It is from the Autor of the last solutionfiles michael-gruz.


LIbreoffice Impress Change back into Slide edit mode

Select Preview->Normal over the top menu:


How to set the timeout for sudo asking for password?

This is not directly possible from sudo itself, but it is possible with some hackish technique.

sudo_timeout.sh :

#!/bin/bash

timeout=10 #seconds

set -m

echoerr() { echo "$@" 1>&2; }

keep_eye_on() {
    pid=$1
    time_passed=0
    while kill -0 $pid &> /dev/null; do
        sleep 1
        let time_passed=time_passed+1
        if [ $time_passed -ge $timeout ]; then
            echoerr "Timeout reached."
            kill -9 $pid
            exit 1
        fi
    done
}

if [ -z "$1" ]; then
    echoerr "Please specify a process to run!"
    exit 1
fi;

sudo $@ &
pid=$!

keep_eye_on $pid &
while true; do
    if kill -0 $pid &> /dev/null; then
        fg sudo > /dev/null; [ $? == 1 ] && break;
    else
        break
    fi
done

The timeout variable holds the timeout in seconds to wait prior killing the sudo process that is asking for password.

Usage:

./sudo_timeout.sh <command>

Example:

./sudo_timeout.sh ls -al

In case the timeout is reached you get:

alex@MaD-pc:~$ ./sudo_timeout.sh ls -al
[sudo] password for alex: Timeout reached.
./sudo_timeout.sh: line 34: 14583 Killed                  sudo $@

In case you type in your password prior the timeout, then the command executes normally.

Disclaimer: The above is tested with simple commands like ls and nano, both with and without arguments, but I cannot guarantee that it will work in every case because I haven't thoroughly tested it, it's just something I came up with.


Start & Stop internet connexion without broking Network Manager

I'd be looking at nmcli for toggling network connectivity. You can do that globally through:

nmcli n enable false  # turns it all off
nmcli n enable true   # turns it all back on


Nvcc -v fails but CUDA 7.0 installed and nvcc present

After I added the following to the theanorc file:

[cuda]
root = /usr/local/cuda-7.0

CUDA started working as expected. CUDA samples run correctly and Theano tests also run as expected, using the GPU.

nvcc -V also works and produces the following:

Nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Mon_Feb_16_22:59:02_CST_2015
Cuda compilation tools, release 7.0, V7.0.27

This stumped me for a while. Note that the V must be uppercase. I was using nvcc -v, which produces an error.


Lubuntu 18.04.3: cannot lower screen resolution

I've found a solution here: https://ubuntuforums.org/showthread.php?t=2428469

I hope this will be useful to everybody with a similar problem to mine.


Post installation issues Ubuntu 18.04-Dell inspiron 7559

I have had the same issues on the same computer, and trust me I can understand what you are going through. I am actually quite new to Linux, so will try to explain my installation procedure that worked for me in detail, however be careful while following these instructions because i am still new to the system, and tried this procedure using trial and error. I think the actual problem for these errors are, because we are using the instruction from blogs that were created for the older versions, and haven't been updated properly since then. OK, so I will help you through the update process for the current versions (date: 27/Nov/2018). I will be explaining in detail about installing the Linux 18.04 LTS on the Dell 7559 PC with NVIDIA 960M and Intel i7 - inlet HD graphics 530.

Step 1: First make sure how you want to go along installing the system.

  1.As a stand alone operating system 2.Dual boot with windows (in case dual boot-use windows to make a partition for Ubuntu - around 30gb). 3.Make a boot-able USB drive containing the Ubuntu OS.

Step 2: Start your PC and press F2 during Boot, and disable secure boot* (very important - as the secure boot wont let Ubuntu install it's drivers), it advised to use UEFI over Legacy since it is more smooth and easy to access.
Should I install Ubuntu as UEFI or Legacy?
Is it safe to disable Secure Boot?

Step 3: Boot using the boot able USB ( press F12 during boot to access the USB drive).

Step 4:Once on the Grub menu page go to the "install Ubuntu" option and press e. Now you have accessed the boot parameters,here find the command/line where "quiet splash"

  (linux           /boot/vmlinuz-4.15.0-20-generic root=UUID=6500f497e670-460c-977b-8fad43155f12 r0 quiet splash $vt_handoff) ,

add nomodeset before quiet splashit

  (linux           /boot/vmlinuz-4.15.0-20-generic root=UUID=6500f497e670-460c-977b-8fad43155f12 r0 nomodeset quiet splash $vt_handoff).

Now press Ctrl X or F10 to boot grub from the updated boot
parameters.

Step 5: Now you have entered the installation GUI for Ubuntu, here follow the prompts, but is is advised not to connect to the WiFi to update, that can be done later. In the installation menu opt for Something else- to partition the hard drive by yourself. (Dual Boot: If you are going to dual boot with windows then,  use the partition made from Step 1: )

  Now, here you would have to divide the partition into four parts.

  Let the first partition be around 10gb-20gb (this amount of memory is required if you are going to use the system as machine learning environment to install the CUDA file, or else file allocation can be performed manually) for the Ubuntu files drivers and programs. Choose system type as ext4 and mount point /.
  Now allocate around 250MB for EFI Partition (system type)
  Finally allocate the remaining memory for /home
  (note-make sure the windows partition is not tampered with!)*
  Continue Installation and reboot once the installation is over.

Step 6: After the Reboot make sure you boot into the UEFI boot option ubuntu, press Esc or Shiftduring boot to enter grub, once in the grub menu follow Step 4. (note-failing to do as mentioned in this step, will cause the system to hang, or get into a login loop, after the login into the Linux system is attempted)

Step 7: Once you have entered the system, open terminal and run commands sudo apt-get update and sudo apt-get upgrade. Once these two steps have been performed go to software-update application to perform auto-update by the Ubuntu system.

  Now to update the grub boot parameters permanently to solve brightness and other issues, we have to enter the grub file located at /etc/default/grub and edit it using: sudo nano /etc/default/grub

    here edit the parameters to GRUB_CMDLINE_LINUX="acpi_backlight=vendor acpi_osi=" once done -Ctrl o Ctrl x (if you want to disable nvidia drivers loading permanently in the initial steps then follow - How do I set 'nomodeset' after I've already installed Ubuntu?)

      sudo update-grub

Step 8: Type sudo reboot in the terminal. During reboot repeat Step 6.
Now the system is setup, but is not yet ready  to use Nvidia. To start using Nvidia we would have to first install the propriety driver using:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

  Now, do not update graphic drivers via the terminal, instead search for Software & Updates in the Ubuntu GUI. here go to the additional drivers tab. Here you will find the set of NVIDIA drivers for your system. select the nvidia-drivers-415 i think that one is the latest. (Make sure that you do not select or keep selection in Using X.Org X server - selection) The Additional drivers Tab in software & updates (image for reference)
  The installation will take a while once the installation is complete, reboot the system.
  Now it isn't necessary to perform Step 6, the Ubuntu Os should boot properly and without any error.
  If you have added nomodeset parameters to Grub, remove it in this step and keep the quiet splash parameter alone.(or else nvidia driver wont load)
  Once you have completed the login, enter the Ubuntu desktop, search for the NVIDIA Xserver application, to monitior the nvidia GPU.

For further assistance on the NVIDIA GPU (960M) - Xserver and installation verification watch - https://www.youtube.com/watch?v=CezzY3DGi4U

  (Note:
  1. Many installation guides require you to change the parameters in /etc/default/grub to - GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"or  GRUB_CMDLINE_LINUX_DEFAULT="nomodeset i915_bpo.nomodeset=1 quiet splash", this is to stop the GPU drivers from loading, hence this should be disabled.
    2.Further if you don't want to keep repeating Step 6, you can update grub to the above parameters GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"- but only till the Nvidia drivers are installed, after which you will have to update grub to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to boot via the NVIDIA graphic driver )


Ubuntu 14.04 - HP Stream 11 touchpad stopped working after system update

I am having a similar issue. For now, when you boot, you can hold down the shift key and it should show you the grub bootloader menu. Go to advanced options and choose the older kernel, it will boot and you will be back to normal, as if you hadn't updated. You can set grub to default to that kernel by editing /etc/default/grub


Stuck on the last step of Ubuntu installation

I had similar problems with last Ubuntus, I think you need repair your grub. For this is simplest way to use existing live-CD/USB-stick and follow these instructions

It is a bit tedious, but has worked for me.


Known viruses refers to the number of viruses in the clamav signature database (ie. viruses that it can scan for or knows about).

ClamAV scanned 337081 files in your 59238 directories & found 0 infected files (using the 6752421 viruses it knows about that were looked for)   This is a good result :)


I had the same problem. Upgrading Pinta to a newer version today solved it for me.

sudo apt-get update
sudo apt-get install pinta


Ubuntu 19.04 systemd-analyze blame returns Bootup not finished

For my Ubuntu 18.04 machine, I was experiencing the same problem. Running a quick systemctl reveals that Plymouth (Ubuntu's silly little splash screen) was the one process that had a active status of ACTIVATING, which seems to block the boot process from finishing.

Disabling plymouth seems to fix the problem for me. Also, it allows to see which processes are running long wait jobs if you are trying to profile your start time.


Openoffice calc - Find out monthly growth based on yearly growth

its more a mathematical question:

so over m months you want to multiply your value x by factor f. This can be written as follows (c = coefficient per month):

f * x = c*c*...*c*x
f * x = c^m * x
f     = c^m
c     = m-based root of f

so in your example you can calculate it as:

c     = 11-based root of 2

But - this is not a mathematical Q & A, i guess this topic will be closed soon ;)


the old version python 2.7 is persisting after upgrading to 3.7

The python package is the package for Python 2.x versions. Python 3's package information is in python3. To view its version info, you can do the same syntax; python3 --version.

I recommend against uninstalling Python 3. Even though you never explicitly said you were going to, I'm forewarning you, it is a bad thing to do.


How to enable DHT in Ktorrent in ubuntu 16.04

As of 2019-02-23, KTorrent allows to enable DHT, as Rinzwind pointed out, under

  Settings → Preferences → BitTorrent

The setting for this is called Use DHT to get additional peers.


You should be trying to run cmake in ~/Downloads/libmodman-2.0.1/

Then once you have done that as the INSTALL file says, run make, make test and then sudo make install.

So that is:

cd ~/Downloads/libmodman-2.0.1/
cmake ./
make
make test
sudo make install


How do I clear or remove unused files, as in hard drive directorys

There is also a good cleaning tool that I use myself, it's called Ubuntu Tweak, great tool. To install it, do:

sudo add-apt-repository ppa:tualatrix/ppa

This will download the PPA repository, then you can go into Ubuntu Software Center and let Software Center do all the magic. Or you can do it all by command line (which is what I prefer) and use these commands after the PPA is loaded in your repository:

sudo apt-get update
sudo apt-get install ubuntu-tweak

Open the Dash and type Ubuntu Tweak then open Ubuntu Tweak with a click.


Warning: the method below is overkill, do not use it if unsure. The reinstallation of Ubuntu 18.04 LTS is simpler, more reproducible and faster.

At first enable Source Code repositories from Software & Updates (software-properties-gtk), then get build-dependencies:

sudo apt-get build-dep pcl sphinx
sudo apt-get install devscripts build-essential libvtk6-dev libvtk6-qt-dev \
python-all python-setuptools python-six python-docutils python-jinja2 \
python-pytest python-mock python-babel python-alabaster python-imagesize \
python-html5lib python-enum34 python-typing \
python-is-python2

cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/main/p/python-urllib3/python-urllib3_1.22-1ubuntu0.18.04.1_all.deb
sudo apt-get install ./python-urllib3_1.22-1ubuntu0.18.04.1_all.deb

wget http://archive.ubuntu.com/ubuntu/pool/main/r/requests/python-requests_2.18.4-2ubuntu0.1_all.deb
sudo apt-get install ./python-requests_2.18.4-2ubuntu0.1_all.deb

then download PCL source code from 18.04 LTS and compile it:

cd ~/Downloads
# Sphinx dependency
wget http://archive.ubuntu.com/ubuntu/pool/main/s/sphinx/sphinx_1.6.7.orig.tar.gz
tar -xf  sphinx_1.6.7.orig.tar.gz
cd Sphinx-1.6.7/
wget http://archive.ubuntu.com/ubuntu/pool/main/s/sphinx/sphinx_1.6.7-1ubuntu1.debian.tar.xz
tar -xf sphinx_1.6.7-1ubuntu1.debian.tar.xz

DEB_BUILD_OPTIONS=nocheck debuild -i -us -uc -b
sudo python setup.py install

# PCL itself
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pcl/pcl_1.8.1+dfsg1.orig.tar.gz
tar -xf pcl_1.8.1+dfsg1.orig.tar.gz
cd pcl-pcl-1.8.1/
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pcl/pcl_1.8.1+dfsg1-2ubuntu2.debian.tar.xz
tar -xf pcl_1.8.1+dfsg1-2ubuntu2.debian.tar.xz

dpkg-buildpackage -b --no-sign -d
sudo apt-get install ./../*pcl*.deb


Indicator systemtray: only showing icons on laptop display?

Not a complete answer yet; but somehow a workaround, although not a real good one: I found that when I use the "Display" settings and first disable my two external monitors, and then re-enable them ... one of the external monitors will have the "icon section" in the top bar. But unfortunately this doesn't survive a reboot.

Today, the owner (?) of the tool came back on my email that I send to him prior asking this question.

Turns out, the answer is super easy, so according to Глеб Головачев

Use the "floating mode": press the middle mouse button on the indicator.

or in terminal:

gsettings set net.launchpad.indicator.systemtray tray-is-static false

I pressed the middle mouse button on the indicator "dropwdown" button; and yes, the icons in the middle of the bar disappear!


Raspberry Pi static IP & DHCP Server Ubuntu 18.04

This is my currently working netplan file.  I've managed also to set the WiFi as the default internet connection  which is what I want in order to use the eth0 connection for the DHCP server (once that's installed).

    network:
    # wifi connection
    version: 2
    renderer: NetworkManager
    wifis:
            wlan0:
                    dhcp4: true
                    dhcp6: true
                    access-points:
                            "SSID-Name":
                                    password: "password"

    #LAN connection for ipv4 DHCP server
    version: 2
    renderer: NetworkManager
    ethernets:
            eth0:
                    dhcp4: no
                    addresses:
                            - 10.0.0.1/24
                    nameservers:
                            addresses: [8.8.8.8,4.4.4.4]

    # LAN connection ipv6 - using for DHCP Server
    version: 2
    renderer: NetworkManager
    ethernets:
            eth0:
                    dhcp6: no
                    addresses:
                         - 2001:1::1/64
                    nameservers:
                            addresses: [8.8.8.8,4.4.4.4]

I also opted to set NetworkManager as the renderer because I plan to use the GUI on this Pi so will be able to see at a glance what the WiFi status is.


ubuntu 13.04 does not work after Windows8 update

It looks like your GRUB file (grubx64.efi) is missing from the ESP; or perhaps Boot Repair isn't finding it for some reason (I've heard of this happening on occasion). You've also got a number of errors relating to your ESP; summarizing a few of them:

mkdir: cannot create directory '/boot/efi/EFI/ubuntu': Input/output error
[  382.544276] FAT-fs (sda2): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[  382.544283] FAT-fs (sda2): Filesystem has been set read-only
Error: no grub*.efi generated. Please report this message to boot.repair@gmail.com

Overall, it looks like the filesystem on /dev/sda2 is damaged. You should repair this. In Linux, the dosfsck utility can do the job, as in sudo dosfsck /dev/sda2. If that doesn't work, you should back up all the files, use mkdosfs (or GParted) to create a fresh FAT32 filesystem on /dev/sda2, and restore the files to the filesystem. You may also need to change the UUID= value in /etc/fstab to refer to the partition by the new "UUID" value if you re-create it.

This type of problem can be caused by the Windows "fast startup" feature, which might as well be called the "don't play nice with other OSs" feature. Basically, instead of shutting down properly, Windows uses a suspend-to-disk type of feature. This leaves its filesystems in an inconsistent state, which can then cause filesystem damage if anything but Windows is booted next. You should disable this feature to make it safe to dual-boot with Linux; however, be aware that this will result in longer Windows boot times. In fact, you might want to do this before using dosfsck on the ESP, or run dosfsck again after disabling the fast startup feature, just to be on the safe side.

Once you've fixed the filesystem and disabled Windows' fast startup, you'll be left with the issue of getting booting to work normally. It appears that your GRUB file has been removed. Running Boot Repair again will probably fix this; however, I'm not a fan of Boot Repair. It takes a rather heavy-handed approach that can cause further problems down the road. If you run Boot Repair, open the Advanced Options and uncheck the "Backup and Rename EFI Files" option. This will rein in Boot Repair's overzealous changes. If the result doesn't boot, though, you may have one of the rare computers that actually needs this type of hackish workaround, so you may need to run it again without disabling this feature.

Another option is to try my rEFInd boot manager. You can try booting with the CD-R or USB flash drive image. Chances are that will boot successfully even as your computer is right now (damaged ESP and all). If it works and you like rEFInd, you can install the Debian package; but do this only after disabling Windows' fast boot feature and repairing the damage to the ESP's filesystem.


Disclaimer

This is not a PAM module. All it really does is automate typing the password and pressing enter. As such you should be REALLY CAREFUL when you plug in a USB stick. Your password will be typed into whatever application has focus, and then the enter key will be sent. This could be really bad if, say, the active window is a chat client. These scripts are made available as is, and before implementation you should probably add extra security measures. For example, one security measure I actually use that is not implemented here is to write the encrypted password to unused space before the first partition on my USB stick (with dd). Perhaps checking to see if we're on a login screen would be another security measure that should be implemented. Use this at your own risk! By using or tweaking any information/code provided below, you assume all responsibility for securing your own implementation.

The Hack

I was faced with this same problem and created my own workaround hack. I'm using this on Ubuntu 16.04 with lightdm (which is the default). It will enter credentials ANYTIME a usb "key" is inserted, so BE CAREFUL when plugging in your USB stick when the screen is not locked!

How I made it work...

When a USB stick is authorized to be used for authentication, various information from the USB stick is used as a password that is in turn used to encrypt your password. This encrypted password is then stored somewhere on the computer.

Next, a udev rule is written that watches for USB storage devices to be added to the system. When a USB storage device is added, the device path is written to a named pipe that is watched by a helper script.

Finally, the helper script that reads from the named pipe checks to see if the inserted USB has an associated, encrypted password entry. If it does,  the encrypted password is decrypted and automatically typed wherever the focus is followed by the return key. It is important that the helper script be separate from the udev script because the scope in which the udev script runs prevents us from being able to use the xdotool as needed.

The Scripts

Insert the USB you want to use to log in. Copy the following script to an empty file and run* once:
*Be aware that this script will create the path /etc/usbauth and it will install xdotool on your system.

#!/bin/bash
# This is the a script for authorizing USB devices as logon devices

# run as root
if [ "$(whoami)" != root ]; then
    sudo $0 $@
    exit
fi

# Install the xdotool if it's not already installed
(
    [ "$(which xdotool)" == "" ] && apt install -y xdotool
) &

encryptedPasswordStorage="/etc/usbauth" # path where encrypted passwords are stored

# if path does not exist create it and make sure permissions are set correctly
[ ! -d "$encryptedPasswordStorage" ] && mkdir -p "$encryptedPasswordStorage"
chown root:root $encryptedPasswordStorage
chmod 700 $encryptedPasswordStorage

# Get a list of attached USB storage devices
usbDevices=$(ls -l /dev/disk/by-uuid/ | grep -oP "/sd[a-z][0-9]?" | sort | awk '{print "/dev" $1}' | while read part; do [ "$(udevadm info -q all -n $part | grep "E: ID_BUS" | cut -f2 -d=)" == "usb" ] && echo $part; done)
# Iterate over this list and display partitions
while read device
do
    info="$(udevadm info -q all -n $device)"
    vendor=$(echo "$info" | grep "E: ID_VENDOR_ID=" | cut -f2 -d=)
    model=$(echo "$info" | grep "E: ID_MODEL_ID=" | cut -f2 -d=)
    sn=$(echo "$info" | grep "E: ID_SERIAL_SHORT=" | cut -f2 -d=)
    uuid=$(echo "$info" | grep "E: ID_FS_UUID=" | cut -f2 -d=)
    label=$(echo "$info" | grep "E: ID_FS_LABEL=" | cut -f2 -d=)
    key="$vendor$model$sn$uuid"
    checksum=$(echo -n "$key" | sha256sum | cut -f1 -d' ')

    keyList[$[++i]]="$key"  # used as an encryption key for encrypting account password
    labelList[$i]="$label"
    checksumList[$i]="$checksum"

    printf "%5s %-9s %-15s %s\n" "[$i]" $device "$label" $sn

done<<<"$usbDevices"

# Ask user which attached device should be used for authentication
echo ""
read -p "Enter the number of the device to authorize: " selection
read -sp "Enter your login password: " pwd
key=${keyList[$selection]}
encpwd=$(gpg2 --output - -a -c --passphrase "$key" --batch --cipher-algo AES256 --digest-algo SHA512<<< "$pwd")

# Save the encrypted password to the system
encPwdFile="$encryptedPasswordStorage/${labelList[$selection]}_${checksumList[$selection]}"
echo -e "$encpwd" > "$encPwdFile"
chmod 600 "$encPwdFile"
echo ""

* From here on out, create/edit all files as root or with sudo *

Next create the file /etc/usbauth/udev.sh with the following contents

#!/bin/bash
# This script watches for USB storage devices. As they are plugged in, this script
# sends the path of these devices to a named pipe that is watched by our helper
# script.
# This script is intended to be called by udev. Add the following rule
#   file path: /etc/udev/rules.d/80-USB.rules
#   file contents: ACTION=="add",KERNEL=="sd[a-z]*",RUN+="[path to this script]"

encryptedPasswordStorage="/etc/usbauth" # path where encrypted passwords are stored
namedPipe="/tmp/usb-auth"   # named pipe used for notification of added USB storage devices

[ -e "$namedPipe" ] && echo "$DEVNAME" > "$namedPipe"

We need to create a udev rule as well. Create /etc/udev/rules.d/80-USB.rules with the following content.

ACTION=="add",KERNEL=="sd[a-z]*",RUN+="/etc/usbauth/udev.sh"

Now, create one last file, /etc/usbauth/lightdm.sh with the following content.

#!/bin/sh
# this is the helper script that reads devices that are added and automates typing
# the password if an authorized stick is plugged in.

(
encryptedPasswordStorage="/etc/usbauth" # path where encrypted passwords are stored
namedPipe="/tmp/usb-auth"   # named pipe used for notification of added USB storage devices
rm "$namedPipe"; mkfifo "$namedPipe"    # create the named pipe
while true;do   # this infinite loop helps to ensure that we're always watching for the next device
    while read device # when a device is read ...
    do
        # gather information about the device that was read
        info="$(udevadm info -q all -n $device)"
        vendor=$(echo "$info" | grep "E: ID_VENDOR_ID=" | cut -f2 -d=)
        model=$(echo "$info" | grep "E: ID_MODEL_ID=" | cut -f2 -d=)
        sn=$(echo "$info" | grep "E: ID_SERIAL_SHORT=" | cut -f2 -d=)
        uuid=$(echo "$info" | grep "E: ID_FS_UUID=" | cut -f2 -d=)
        key="$vendor$model$sn$uuid"
        checksum=$(echo -n "$key" | sha256sum | cut -f1 -d' ')

        # check to see if this device has an associted encrypted password file
        encpwdFile="$(find $encryptedPasswordStorage -type f | grep "$checksum")"
        echo "$key:checksum --> $encpwdFile" > /tmp/encfile

        # if it does, decrypt the password, type it on the screen and press [Enter]
        if [ -e "$encpwdFile" ]; then
            pwd=$(gpg2 -a -d --passphrase "$key" --batch --output - < $encpwdFile)
            echo "$pwd" > /tmp/pwd
            xdotool type "$pwd"
            sleep .5
            xdotool key Return
        fi
    done < "$namedPipe"
done
) &

This script must be called when lightdm starts. To do that, edit /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf. Under [Seat:*] add

greeter-setup-script=/etc/usbauth/lightdm.sh

So for example, my /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf file looks like

[Seat:*]
greeter-session=unity-greeter
greeter-setup-script=/etc/usbauth/lightdm.sh

I haven't created a script for managing USB devices that have been added, but you will find all of them listed in /etc/usbauth. Each encrypted password file in this folder begins with a partition label name followed by an underscore and the sha256 hash of the key used to encrypt the password. Simply deleting the encrypted password file is sufficient for removing the USB as an authentication device.

Be aware that if you reformat your USB storage device, the UUID will change and you won't be able to log in with that device again until you add it again as a key which can be done by simply re-running the first script provided in this post. I have incorporated UUID because plenty of the cheap storage devices coming out of China these days do not have the serial number configured. Also when you're using an SD card, its worth noting that the serial number you see is actually coming from the SD card reader on most systems these days. Hence if you're using SD cards, the serial number is going to be the same for every SD card you mount even if the serial numbers of the SD cards themselves are actually different.


Should be the default --- anyway, you can play with all the settings for focusing and raising windows with dconf-editor (sudo apt-get install dconf-editor if you don't have it) and navigating to org.gnome.desktop.wm.preferences:

(disclaimer: this is with the gnome that come with Trusty. I hope they've not removed the configurability).


That animation is not a loading one, so there is no relationship between how many dots are light up and the status of any action (weather is starting or stopping Ubuntu).

The behaviour of Firefox that you describe doesn't imply that Ubuntu didn't shut down correctly. It can mean that Ubuntu killed (is the term used) Firefox without letting it to do a proper shutdown (just FF shutdown, not Ubuntu).

Firefox recover feature is explained here.


How to install network-manager without internet access?

You don't need NetworkManager to connect to a network. Assuming you're using automatic configuration (probably you are) you just need to sudo dhclient eth0 to get an IP address (replace eth0 with your network device if that's the case).


Having a command input problem in Ubuntu 18.04 WSL

Since you're on WSL, anything you download on your browser would be stored in the following directory. Dragging and dropping the path from windows will in fact not work as your normal drives are under /mnt:

/mnt/c/Users/<your-username>/Downloads/

and excecuting your above commands should work, however you can download, untar and install Emojicode all at once with the following command sequence:

wget https://github.com/emojicode/emojicode/releases/download/v0.5.4/Emojicode-0.5.4-Linux-x86_64.tar.gz -O emojicode.tar.gz \
&& tar -xzf emojicode.tar.gz && rm emojicode.tar.gz \
&& cd Emojicode-0.5.4-Linux-x86_64 && ./install.sh \
&& cd .. && rm -r Emojicode-0.5.4-Linux-x86_64

wget downloads the tar file -> saves it as emojicode.tar.gz
tar uncompresses emojicode.tar.gz -> Emojicode-0.5.4-Linux-x86_64
then we cd into the new folder and run install.sh to install emojicode
finally we cd .. to go back to the parent directory and use rm to remove the folder we've extracted the emojicode source to because we don't need it anymore


18.04 ffmpeg: Play mp4 on fake webcam, "Conversion Failed!"

I ran into the exact same issue a while ago.

In short, you need to update the driver from the latest sources at https://github.com/umlaeute/v4l2loopback and recompile the module.

Don't forget to remove the stock v4l2loopback_dkms driver!

For more information on the topic, look for instance at:
https://github.com/umlaeute/v4l2loopback/issues/247


Duel Boot Ubuntu / Win 7 on Tablet, How?

Depends on if your system is very old (say 10 years) or 5 years. If 5 years , then follow the steps below.

I had a dualboot of ubuntu 12.04 with win vista . If you have a recovery partition in your windows laptop or destop, then choose to shrin your disk after defragmentation and set aside space for your ubuntu. dont format it now and have that partition as RAW .

then , try to install ubuntu by inserting your disk and restarting system . When partitioning , dont disturb your C: drive because, in future , if there is a problem with windows and want to use recovery partition it will erase boot info.

So , install in the space whatever windows was willing to share , inside that allocated space, have three to four imp. partitions - boot (1 gb), swap (2 gb) , home (3 gb) , (usr - 5 gb) etc. according to how want to have partitions and install the system.

Am facing tiny problem with this sort of installation wherein , from the boot menu, if i choose ubuntu to login directly , am seeing a blac screen . so , all the time , am going to recovery mode and then boot normally from there . You may also get this problem licely but there are worcarounds , I believe , mostly if your graphics card is slow or old i suppose .... Asc second opinion from more experts if you want to as I myself need help here.


The simplest way is to use chown:

sudo chown -R testuser:testuser /var/www/test/public_html

This will make the user & group testuser the owner of the file. IF YOU ARE USING A DIFFERENT USERNAME (run whoami or look before the @ of your terminal promp, or be lazy and replace testuser with $USER), use that username instead. For instance user Flora colossus may have the username groot, in which case you would run sudo chown -R groot:groot... . If in doubt use the manual pages linked below.

or to use chmod (read and use carefully):

sudo chmod -R 777 /var/www/test/public_html

Which will allow read-write-execute permissions for the owner, group, and any other users. The execute bit is required for directories to work, files can get by with 666 permissions (strictly speaking most files shouldnt need the execute permission, but this is least likely to break stuff and does not require find etc). chmod is much more difficult to 'undo' if needed that the other options.

Here are manual pages on chown and chmod (these can also be found by running man chown and man chmod.)

I should add you can give groups of users write access as well (examples  here and here).

Also beware giving global write access with the chmod command if you have not as trustworthy users/scripts running on the server etc - I recommend changing the group or the user permissions instead. If using chmod please read up on this and understand what it is doing.


Starting multiple applications using a shell script

Add an & at the end of each line in the .sh file.

e.g.

#!/bin/bash

/usr/bin/firefox &
/usr/bin/thunderbird &
/usr/bin/pidgin &
exit 0


Ubuntu Server Virtualization on Redhat Linux

Ubuntu will work fine in a virtual machine. The host OS is irrelevant.

If by 'admin rights' you mean using the root user, that's a separate issue. Ubuntu installs with the root user not being someone you can log in as directly. To run commands with root privileges, you would use the sudo command as your regular user, who is in the sudo group.

You can configure the system such that you can log in as root, if necessary, by using sudo to gain a root shell, and then change the password for the root user.


Sync specific folder between two Ubuntu machines when connected to the same LAN

[Answering my own question as I found a nice way to do this]

Use unison tool developed by Benjamin Pierce at U Penn.

Let us assume you have two directories,

/home/user/Documents/dirA/ and /home/user/Documents/dirB/

To synchronize these two, you may use:

~$unison -ui text /home/user/Documents/dirA/ /home/user/Documents/dirB/

In output, unison will display each and every directory and file that is different in the two directories you have asked to sync. It will recommend to additively synchronize (replicate missing file in both locations) on the initial run, then create and maintain a synchronization tree on your machine, and on subsequent runs it will implement true synchronization (i.e., if you delete a file from .../dirA, it will get deleted from .../dirB as well. You can also compare each and every change and optionally choose to forward or reverse synchronize between the two directories.

Optionally, to launch graphical interface, simply remove the -ui text option from your command, although I find the cli simpler and faster to use.

More on this: Unison tutorial at Unison user documentation.


Looks like a problem with your intel gfx card drivers, go to this link and download the u12.04-downgrade.tar and follow the steps listed on the website.

But before you do that i would like to make sure you don't have any drivers installed.
Here's how to do it:

System Settings > Software & Updates > Additional Drivers tab

Tell me what you see.


The DVD is mounted at /dev/sr0 You can check if the DVD is mounted there by opening the Disks application. If the DVD is mounted, you can browse the files from the DVD content's folder in the /mnt directory. The DVD content's folder in the /mnt directory has an emblem of a DVD disk superimposed on the folder icon it to help you identify it.

Alternatively if the DVD is mounted you can also browse the files on it by right-clicking the DVD's icon in the Launcher and selecting Open from the context menu.

Also see this answer.


Prevent option popup when launching a bash application

See "Edit" > "Preferences" > "Tab behaviour" (or press alt-e and n)


You problem is that the GRUB entry in your MBR is no longer working. To work around this, you must use boot-repair. To do so:

Press Ctrl+Alt+T to open Terminal
Type sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update, then press Enter
Wait for it do finish. Do not close Terminal.
Type sudo apt-get install -y boot-repair && (boot-repair &), then press Enter
Wait for boot-repair to pop up. Do not close Terminal.
Choose the "Recommended Repair"
Do what you are told. Once boot-repair is done, you can restart your computer.
Profit!


Unable to set Terminator as default Terminal in Ubuntu with Cinnamon Desktop

Please enter the following in a terminal :
gsettings set org.gnome.desktop.default-applications.terminal exec /usr/bin/terminator

gsettings set org.gnome.desktop.default-applications.terminal exec-arg "-x"

You might have to enter the following line as well
gsettings set org.cinnamon.desktop.default-applications.terminal exec /usr/bin/terminator


I do not see the "Allow Launch" option in Ubuntu 19.10

I don't see an exec directory. I have found that if you don't include a valid exec directory the Ubuntu won't let you make it executable and thus won't show the "Allow Launch" option.

the exec field is supposed to point to the script that runs your application (a .sh file usually)

for example:

[Desktop Entry]
Name=Android Studio
Exec=/directorytoyourapp/runscriptofyourapp.sh
Comment=Development Enviroment for Android APK
Terminal=false
Icon=/whateveraddresstoyouricon/icon.png
Type=Application


Where to get the Glade catalog for vte-2.91 in Ubuntu 20.04?

Search using packages.ubuntu.com and apt-file on local machine gives no results for vte-2.91.xml.
So actual way to fix is to get this package directly from 18.04 LTS repository. It may break something, so be careful.
Download and install with:
cd ~/Downloads
wget -c http://archive.ubuntu.com/ubuntu/pool/main/v/vte2.91/libvte-2.91-dev_0.52.2-1ubuntu1~18.04.2_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/main/v/vte2.91/libvte-2.91-0_0.52.2-1ubuntu1~18.04.2_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/main/v/vte2.91/libvte-2.91-common_0.52.2-1ubuntu1~18.04.2_all.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/main/v/vte2.91/gir1.2-vte-2.91_0.52.2-1ubuntu1~18.04.2_amd64.deb

sudo apt-get install ./libvte-2.91-dev_0.52.2-1ubuntu1~18.04.2_amd64.deb ./libvte-2.91-0_0.52.2-1ubuntu1~18.04.2_amd64.deb ./libvte-2.91-common_0.52.2-1ubuntu1~18.04.2_all.deb ./gir1.2-vte-2.91_0.52.2-1ubuntu1~18.04.2_amd64.deb

Then check:

$ dpkg -S vte-2.91.xml
libvte-2.91-dev:amd64: /usr/share/glade/catalogs/vte-2.91.xml

And finally versions with:
cat <<EOF | sudo tee /etc/apt/preferences.d/pin-vte
Package: gir1.2-vte-2.91
Pin: version 0.52.2-1ubuntu1~18.04.2
Pin-Priority: 1337

Package: libvte-2.91-0
Pin: version 0.52.2-1ubuntu1~18.04.2
Pin-Priority: 1337

Package: libvte-2.91-common
Pin: version 0.52.2-1ubuntu1~18.04.2
Pin-Priority: 1337

Package: libvte-2.91-dev
Pin: version 0.52.2-1ubuntu1~18.04.2
Pin-Priority: 1337
EOF

Note: to revert the changes remove pin file with sudo rm /etc/apt/preferences.d/pin-vte and upgrade the packages by sudo apt-get update && sudo apt-get dist-upgrade.


How can I remove ALL grub2 files and reinstall them? In other words, reset grub2?

its /etc not /ect , looks like a typo.

if you wanted to restore grub to defaults then just backup your grub files , purge the grub package and reinstall it.


What is the easiest way to resolve apt-get BADSIG GPG errors?

Here's the (easiest) solution:

Type the following commands in the Terminal:

$ sudo -i
# apt-get clean
# cd /var/lib/apt
# mv lists lists.old
# mkdir -p lists/partial
# apt-get clean
# apt-get update

Credits: ubuntugeek.com

Edit:

If the error occurs again (maybe after a few days/months), open Nautilus as root > navigate to var/lib/apt > delete the "lists.old" folder > then open the "lists" folder and delete the "partial" folder. Now, execute the aforementioned commands again.


When adding a repository can I add an auto enter command in the terminal?

Yes you can. The command is of the form:

sudo  apt-add-repository -y repository

where repository is the name of the repository you wish to add. The -y switch performs the same function as in apt-get assuming "yes" to all queries.

Sources:

@steeldrivers comment

man apt-add-repository


Try the following setting changes in dconf-editor (works on 18.04)

gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM
gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode FIXED
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 64
gsettings set org.gnome.shell.extensions.dash-to-dock unity-backlit-items true

The property you want to modify to keep the dock only as big as its contents is the extend-height. Set it to false

Source
https://linuxconfig.org/how-to-customize-dock-panel-on-ubuntu-18-04-bionic-beaver-linux


Change colours in Gnome shell for top dialogs in 18.04

System Icon's theming Can be achieved with below content in your gnome-shell.css file

.system-menu-action {
  -st-icon-style: symbolic;
  color: blue;
  background-color: yellow;
  border-radius: 32px;
  /* wish we could do 50% */
  padding: 13px;
  border: 1px solid #c5cbd0; }
  .system-menu-action:hover, .system-menu-action:focus {
    background-color: green;
    color: #3D3D3D;
    border: none;
    padding: 14px; }
  .system-menu-action:active {
    background-color: rgba(61, 61, 61, 0.2);
    color: #3D3D3D; }
  .system-menu-action > StIcon {
    icon-size: 16px; }

Concentrate on blue, yellow & green lines in above content.

Concentrate on "green" line in below content.

.popup-menu-icon {
  color:green;
  icon-size: 1.09em; }

And then follow this post for other two icon colors out of 4 green icons.
https://askubuntu.com/a/1177608/739431


I am not aware of a solution at the level of the keyboard map, but probably you could achieve what you want using the X automation tool xdotool.
Setup

Install xdotool with the command sudo apt install xdotool.

Then create a very small script with the following content. A script is a small text file with the "Execute" file permission enabled. You could create this file in a folder "macros" somewhere under your home folder. For the purpose of this example, I will assume you are storing macros in a folder macros in the hidden folder .local in your home folder (so it is never in your way during your daily work).

So create that folder first with your file manager or with the command mkdir ~/.local/macros.

Then create the script macros and open it in your text editor with the command gedit ~/.local/macros/send_alt_a

Put following content in that file:
#!/usr/bin/xdotool
keyup KP_Separator
key Alt+a

Save and close the file.

Make the script executable by editing its properties using your file manager, or with the command: chmod +x ~/.local/macros/send_alt_a

Now assign the macro to the keyboard shortcut Numeric keypad '.' using "Keyboard Shortcuts" in "Settings" (provide the full path name to the script in the "Add Custom Shortcut" dialog if the script is not in a folder that is within the search path (as for ~/.local/macros/).

Comments on the script

You may need to introduce a little delay in the script for it to work (reliably). If needed, insert a command such as sleep 0.2 on the second (or perhaps better as the third line). This causes a delay of 0.2 seconds before the script is continued.

The command keyup KP_Separator simulates a release of the hotkey used to trigger the macro. That avoids any interference that could happen when you physically have the key pressed while the script simulates pressing another keyboard combination. The full list of key names xdotool understands is available from freedesktop.org. Since this is a single key (no modifier), the command may actually not be needed.

I assume that the Keyboard Settings dialog of Gnome Shell will, in assigning keyboard shortcuts, differentiate between the '.' on the normal and numerical keypads. If it doesn't, try sxhkd or xbindkeys.


What permissions would change if I change umask to 027 from 022?

The 027 umask setting means that the owning group would be allowed to read the newly-created files as well. This moves the permission granting model a little further from dealing with permission bits and bases it on group ownership.

This will create directories with permission 750.

Please check this great article 027 umask — a compromise between security and simplicity.


It is to prevent user from iterating over two or three passwords every time the mandatory password change happens. This is a risk because this favorite user's password may be already known to the evil guy.