How to get dialog box input directed to a variable?

:D I can't explain it!!! If you can understand what they are saying in Advanced Bash-Scripting Guide: Chapter 20. I/O Redirection, write a new answer and I will give you 50rep:

exec 3>&1;
result=$(dialog --inputbox test 0 0 2>&1 1>&3);
exitcode=$?;
exec 3>&-;
echo $result $exitcode;

  Reference: Dialog in bash is not grabbing variables correctly

^ answer from @Sneetsher (Jul 4, 2014)

As requested, I will try to explain what this snippet is doing line by line.

Note that I will simplify it by omitting all the ; semicolons at the line ends, because they're not necessary if we write one command per line.

I/O - Streams:

First, you need to understand the communication streams. There are 10 streams, numbered from 0 to 9:

Stream 0 ("STDIN"):
"Standard input", the default input stream to read data from the keyboard.
Stream 1 ("STDOUT"):
"Standard output", the default output stream used to show normal text in the terminal.
Stream 2 ("STDERR"):
"Standard error", the default output stream used to display errors or other text for special purposes in the terminal.
Streams 3-9:
Additional, freely usable streams. They're not used by default and do not exist until something attempts to use them.

Note that all "streams" are internally represented by file descriptors in /dev/fd (which is a symbolic link to /proc/self/fd which contains another symbolic link for every stream... it's a bit complicated and not important for their behaviour, so I stop here.). The standard streams also have /dev/stdin, /dev/stdout and /dev/stderr (which are symbolic links again, etc...).

The script:

exec 3>&1

The Bash built-in exec can be used to apply a stream redirection to the shell, that means it affects all following commands. For more info, run help exec in your terminal.

In this special case, the stream 3 gets redirected to stream 1 (STDOUT), that means everything we send to stream 3 later will appear in our terminal as if it was normally printed to STDOUT.
result=$(dialog --inputbox test 0 0 2>&1 1>&3)

This line consists of many parts and syntactical structures:

result=$(...)
This structure executes the command in the brackets and assigns the output (STDOUT) to the bash variable result. It's readable through $result. All this is described somehow in the veeeery looong man bash.
dialog --inputbox TEXT HEIGHT WIDTH
This command shows a TUI box with the given TEXT, a text input field and two buttons OK and CANCEL. If OK gets selected, the command exits with status 0 and prints the entered text to STDERR, if CANCEL gets selected, it will exit with code 1 and print nothing. For more info, read man dialog.
2>&1 1>&3
These are two redirection commands. They will be interpreted from right to left:

1>&3 redirects the command's stream 1 (STDOUT) to the custom stream 3.

2>&1 redirects afterwards the command's stream 2 (STDERR) to stream 1 (STDOUT).

That means that everything the command prints to STDOUT now appears in stream 3, while everything that was intended to show up on STDERR now gets redirected to STDOUT.

So the entire line displays a text prompt (on STDOUT, which got redirected to stream 3, which the shell again redirects back to STDOUT in the end - see the exec 3>&1 command) and assigns the entered data (returned through STDERR, then redirected to STDOUT) to the Bash variable result.
exitcode=$?

This code retrieves the previously executed command's exit code (here from dialog) through the reserved Bash variable $? (always holds the last exit code) and simply stores it in our own Bash variable exitcode. It can be read through $exitcode again. You can search for more info on this in man bash, but that might take a while...
exec 3>&-

The Bash built-in exec can be used to apply a stream redirection to the shell, that means it affects all following commands. For more info, run help exec in your terminal.

In this special case, the stream 3 gets redirected to "stream -", which just means it should be closed. Data sent to stream 3 will not get redirected anywhere any more from now on.
echo $result $exitcode

This simple echo command (more info on man echo) just prints the content of the two Bash variables result and exitcode to the STDOUT. As we have no explicit or implicit stream redirections here any more, they will really appear on STDOUT and therefore simply get displayed in the terminal. What a miracle! ;-)

Summary:

First, we set the shell up to redirect everything we send to the custom stream 3 back to STDOUT, so that it shows up in our terminal.

Then we run the dialog command, redirect its original STDOUT to our custom stream 3, because it needs to get displayed in the end, but we temporarily need to use the STDOUT stream for something else.
We redirect the original STDERR of the command, where the dialogue window's user input gets returned, to STDOUT afterwards.
Now we can capture the STDOUT (which holds the redirected data from STDERR) and store it in our variable $result. It contains the wanted user input now!

We also want the dialog command's exit code, which shows us whether OK or CANCEL was clicked. This value is presented in the reserved Bash variable $? and we just copy it to our own variable $exitcode.

After that we close stream 3 again, as we don't need it any more, to stop further redirections of it.

Finally, we normally output the contents of both variables $result (the user input of the dialogue window) and $exitcode (0 for OK, 1 for CANCEL) to the terminal.


How to check if a software version exists for my Ubuntu release?

The Launchpad page for apt means exactly what it says. The latest version of apt from the default Ubuntu 16.04 repositories is 1.2.19 which you can verify from the terminal using the command:

apt-cache policy apt

The results of apt-cache policy apt also show the other two non-proposed versions of apt (1.2.10ubuntu1 and 1.2.15ubuntu0.2) and the version of apt that is currently used is marked  as Installed and also marked by asterisks.

apt 1.2.20 is a proposed update that has not been released yet. The other two versions of apt in the list are old versions.


Is there a lightweight tool to crop images quickly?

Gthumb is a nice image viewing/editing tool with simple editing tools like cropping.

Instructions for cropping in gThumb 3.2.8

Open your image in gThumb

Open the Edit sidebar by pressing e or clicking on the easel in the top-right corner of the window

In the sidebar click on Crop and then crop the image as you desire

Once finished press Enter or Crop. Then, in the Edit sidebar press Save to overwrite the original file or Save As to save to a new image file.


How to fully install Ubuntu on USB Flashdrive?

Full Install to USB

11.10 is too old, Latest LTS, (Long Term Service), release is 18.04.

Full installs are more stable and secure than persistent installs, but not as quick to make. They are better at utilizing disk space as no fixed size casper-rw file or partition is required. They are not very good for use of installing Ubuntu.

Following is a step by step how to install 18.04 on a 16GB flash drive with options for separate Home partition and Windows compatible data partition:

Create a live USB or DVD using SDC, UNetbootin, mkusb, etc.
Turn off and unplug the computer. (See note at bottom)
Unplug the power cable from the hard drive or unplug the hard drive from the laptop.
Plug the computer back in.
Insert the flash drive.
Insert the Live USB or Live DVD.
Start the computer, the USB/DVD should boot.
Select language.
Select install Ubuntu.
Select Keyboard layout
Select "Continue".
Select installation type and "Download updates while installing Ubuntu" and Select "Install third-party software ...", (optional).
Select "Continue".
At "Installation type" select "Something else". (Full disk encryption is now working with flash drives).
Select "Continue".
Confirm target device is correct.
Select "New Partition Table".
Click Continue on the drop down.

(Optional FAT32 data partition for use on Windows machine)

Click "Free space" and "+".
Make "Size..." about 2000 MB.
Select "Primary".
Location = "Beginning of this space".
"Use as:" = "FAT32 file system".
"Mount point" =  "/windows".
Select "OK"

(Non Optional Root Partition)

Click "free space" and then "+".
Select "Primary", "Size ..." = 4500 to 6000 MB, "Beginning of this space", Ext4, and Mount point = "/" then OK.

(Optional home partition)

Click "free space" and then "+".
Select "Primary", "New partition size ..." = 1000 to 6000 MB, Beginning of this space, Ext2, and Mount point = "/home" then OK.

(Optional swap space, allows hibernation)

Click "free space" and then "+".
Select "Primary", "New partition size ..." = remaining space, (1000 to 2000 megabytes, or same size as RAM), Beginning of this space and "Use as" = "swap area" then OK.

(Important)

Confirm "Device for boot loader installation" points to the root of the USB drive. Default should be OK if HDD was unplugged.
Click "Install Now".
Select your location.
Select "Continue".
Insert your name, computer name, username, password and select if you want to log in automatically or require a password.cscameron
Select "Continue".
Wait until install is complete.
Turn off computer and plug in the HDD.
Replace the computer's cover.

Note:
You may omit disabling the hard drive if after partitioning you choose to install grub to the root of the USB drive you are installing Ubuntu to, (ie sdb not sdb1). Be cautious, many people have overwritten the HDD MBR as default location for boot loader is sda, any items in the internal drive's grub will be added to the USB's grub.
You may do an update-grub later.


I am also getting this issue with Intel integrated graphics on my Dell XPS 13 after upgrading to 16.04 LTS.

Let's see if we can fix this together.  Can you copy-pasta the output of the following terminal commands:

sudo su
*password for super user*
lshw -c video

Tell me what you get and if it's similar to my trouble maybe my solution attempt will work for you.

UPDATE:
I use Intel Integrated graphics for my machine so I think I have a solution. I will update by the end of the day, but it seems to be working fine with dual display at work.  I did the following:

sudo su
*password for su*
apt-get install --reinstall xserver-xorg-video-intel
dpkg-reconfigure xserver-xorg
apt autoremove

UPDATE: The above stopped my screen from flickering until I opened google chrome, or chromium.  I believe this may be related to gpu optimization in chrome and chromium.  I will look into this more and clean up this update when I have narrowed the problem down.

Final UPDATE: I pushed a short bash file to my github page that definitively solves this problem for intel integrated graphics users. You can download it and run it from
https://github.com/0xSteve/Ubuntu-16.04-LTS-Bug-Fixes-for-Dell-XPS-13

If my answer helped you please give me an up vote and help me make better posts in the future by commenting.


Ubuntu 17.10 Nvidia Drivers, black screen loop?

This sounds similar to an issue I was having, which I answered over in this thread

It seems that the Ubuntu update switched me to a low-latency kernel, which did not automatically update my kernel headers installation like other kernel upgrades have, and the nvidia binary packages require the kernel headers to be present. Try the following:

sudo apt purge 'nvidia-*'
sudo apt install linux-headers-$(uname -r)
sudo apt install nvidia-384

Note that I did prevent gdm from using Wayland prior to trying anything, and from what I understand Wayland won't currently work with the nvidia binaries, so I'd advise ensuring it's disabled in /etc/gdm3/custom.conf by uncommenting the line #WaylandEnable=false.


First I had to reconnect to the internet using the following steps:

List all network devices with ifconfig -a (in my case it was wlo1)
Turn device on sudo ifconfig wlo1 up
Manually use device to scan wifi sudo iwlist wlo1 scanning saw my wifi Prk
Associate device with wifi sudo iwconfig wlo1 essid Prk
Give device an IP sudo dhclient wlo1

Then I reinstalled network-manager which seemed to revert the broken settings:

sudo apt-get install network-manager


Use Steam's In-Home Streaming across VPN (OpenVPN)?

I got it working with OpenVPN (using TAP) after a lot of work. No luck with TUN, I believe it cannot work with TUN since there is no UDP broadcast possible with it (which apparently Steam In-home Streaming uses to detect peers).

I run the OpenVPN server on my router, a Archer C7 V2 running OpenWRT (Barrier Breaker).

Below is the server config file I use. Modification is necessary, where should be clear:

client-to-client
persist-key
persist-tun
tls-server
ca /etc/openvpn/ca.crt
cert /etc/openvpn/erb-router-c7.crt
dev tap_mypvn
dh /etc/openvpn/dh2048.pem
keepalive 10 120
key /etc/openvpn/erb-router-c7.key
log /tmp/openvpn.log
mode server
port 1194
proto udp
route-gateway dhcp
server 10.8.0.0 255.255.255.0
status /var/log/openvpn_status.log
topology subnet
verb 3
push topology subnet
push route-gateway dhcp
push persist-key
push persist-tun

Here is my client config (The host machine running Windows, a similar config is used on the client machine running Ubuntu):

client
float

dev tap
proto udp
remote YOUR_HOSTNAME_OR_IP_HERE 1194

log "C:/Program Files/OpenVPN/config/log.txt"
verb 3

resolv-retry infinite
nobind

persist-key
persist-tun

remote-cert-tls server
ca "C:/Program Files/OpenVPN/config/ca.crt"
cert "C:/Program Files/OpenVPN/config/erb-main-7.crt"
key "C:/Program Files/OpenVPN/config/erb-main-7.key"

I've done so much with the OpenWRT config that I'm not sure if this is all that is required for someone to replicate my success. But the short version it: Use TAP and not TUN, make sure your VPN clients can talk to each other by specifying the client-to-client parameter in the server config. In OpenWRT I've also set up the network interface and the firewall as specified in the OpenWRT wiki for OpenVPN.

If you have any questions, I'll do my best to answer them.

Edit, on request:

/etc/config/network

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option ula_prefix 'fd0f:252f:ed29::/48'

config interface 'lan'
    option force_link '1'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ip6assign '60'
    option _orig_ifname 'eth1 wlan0 wlan1'
    option _orig_bridge 'true'
    option ifname 'eth1 tap_myvpn'

config interface 'wan'
    option ifname 'eth0'
    option proto 'dhcp'

config interface 'wan6'
    option ifname '@wan'
    option proto 'dhcpv6'

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'switch0'
    option vlan '1'
    option ports '0 2 3 4 5'

config switch_vlan
    option device 'switch0'
    option vlan '2'
    option ports '1 6'

config interface 'vpn0'
    option ifname 'tun0'
    option proto 'none'
    option auto '1'

Selected part from /etc/config/firewall, may not provide entire context but I don't want my entire firewall file to be known. Please inform me of eventual redundancy and mistakes:

config rule
        option name 'Allow-OpenVPN-Inbound'
        option target 'ACCEPT'
        option src '*'
        option proto 'udp'
        option dest_port '1194'

config zone
        option name 'vpn'
        option masq '1'
        option input 'ACCEPT'
        option forward 'ACCEPT'
        option output 'ACCEPT'
        option network 'vpn0'

config forwarding
        option dest 'lan'
        option src 'vpn'

config forwarding
        option dest 'wan'
        option src 'vpn'

config forwarding
        option dest 'vpn'
        option src 'lan'


How can I tell the Ubuntu installer to use another partition?

As pointed out, that part of the installer does not detect partitions.

Also, if you are going to install Ubuntu onto an empty partition, it is best to leave it unformatted, so that when the installer looks for free space, it will prefer the empty partition, instead of reporting all partitions as in use.

You can delete the "D:" partition from the Windows Disk Manager.


unsure of owncloud mysql password and database

The ownCloud installation requires access to a database such as MySQL on the server it is running on, in your case this is your PC.

When you install MySQL, you become the MySQL root and have to create a new database, which you give the name and password to be used by ownCloud.

This should get you started:

sudo apt-get install mysql-server

As far as I remember, this will let you set a password for your MySQL root user. Then log on to MySQL like so:

mysql -u root -p

Which will ask you for the password you've given in the first step. On the MySQL prompt, create a database (I named it owncloud) and switch to using it

CREATE DATABASE owncloud;
USE owncloud;

Then create a user and password to access the owncloud database and exit MySQL:

GRANT ALL PRIVILEGES ON owncloud.* TO myocuser@localhost IDENTIFIED BY 'mysupersecretpassword';
EXIT

Using this example, the user and password for the MySQL database you have to enter at the ownCloud installation are myocuser and mysupersecretpassword, respectively (which you should change for your installation, of course).


Ubuntu 18 ans 20 freeze and restart randomly

Note how your syslog did NOT log any normal shutdown activity warning before the 0713 restart. It didn't terminate the network connection. It didn't unmount the disks. It didn't progress through the systemd targets, finally reaching shutdown.target.
That's conclusive. It means the trigger did not come from Ubuntu.
Therefore the cause is likely hardware. "Random freezing and restarts" are classic symptoms of hardware failure.
Were the issue overheating, I would expect to see log entries showing CPU throttling or other heat-related warnings. None in the log. However, speculation about hardware troubleshooting is outside the scope of AskUbuntu.
Advice: Take it to a different hardware shop, and leave it there until they experience the same unexplained restart. Alternately, swap out components yourself --one at a time-- until the problem ceases. The last component you swapped was the problem.


Sound not working on ubuntu 20.04. I just see Dummy output in sound settings

I found a fix. Run the following command.
echo "options snd-hda-intel dmic_detect=0" | sudo tee -a /etc/modprobe.d/alsa-base.conf

Now, reload alsa and reboot.
sudo killall pulseaudio
sudo alsa force-reload
sudo reboot


how Install GCC-5-arm-linux-gnueabihf on ubuntu 20.04

You have to download the needed package manually with
cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5-cross/gcc-5-arm-linux-gnueabihf_5.5.0-12ubuntu1cross1_amd64.deb
sudo apt-get install ./gcc-5-arm-linux-gnueabihf_5.5.0-12ubuntu1cross1_amd64.deb

wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5-cross/gcc-5-multilib-arm-linux-gnueabihf_5.5.0-12ubuntu1cross1_amd64.deb
sudo apt-get install ./gcc-5-multilib-arm-linux-gnueabihf_5.5.0-12ubuntu1cross1_amd64.deb

wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-5-cross/gcc-5-arm-linux-gnueabihf-base_5.5.0-12ubuntu1cross1_amd64.deb
sudo apt-get install ./gcc-5-arm-linux-gnueabihf-base_5.5.0-12ubuntu1cross1_amd64.deb


device shows up in lsusb + adb but not in ifconfig

Adb works over USB, it doesn't set up a networking interface. ifconfig only shows networking interfaces.

If you want to run commands or copy files between Ubuntu and the Android phone, use the adb command:

adb shell ls /system
adb push myfile /data/data/myapp.example.com/

Some Android devices can appear as a USB storage device, I don't know if this includes yours. You may also try adbfs (not packaged for Ubuntu, as far as I know, so you'd need to compile it yourself).

If you want to establish a network connection, for example to use the Android phone as a gateway to the Internet (this is known as tethering), tell adb to establish a PPP connection over USB. The PPP interface will appear as a network interface in ifconfig. Here's a quick-and-dirty tethering script that tries to guess the right network interface on the Android device; run it as root and at your own risk (it wasn't design to be robust in weird setups).

# Interface with the default route on the Android device.
android_gw_if=$(adb shell ip route list 0.0.0.0/0 | sed -n -e 's/^.* dev  *\([^ ]*\).*/\1/p' -e 'T' -e 'q')
adb ppp "shell:pppd nodetach noauth noipdefault /dev/tty" nodetach noauth noipdefault notty 192.168.254.2:192.168.254.1
adb shell "echo 1 >/proc/sys/net/ipv4/ip_forward"
adb shell "iptables -P FORWARD ACCEPT"
adb shell "iptables -t nat -I POSTROUTING -s 192.168.254.2 -j MASQUERADE -o $android_gw_if"
sleep 1 # give the ppp connection time to establish itself
route add -net default gw 192.168.254.1


Cannot open qcreator qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""

I've been having this error message when running an app built with Qt installed from sources (so this was due to the way I have installed Qt).
A quick
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms

will transform the error above into qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms", so this is not a complete solution.
In my case the solution was to install xorg and xorg-dev - and other packages for that matter. Then reinstall Qt from sources.
These are all the packages that I have installed (on ubuntu 20.04):
sudo apt install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev   \
                 libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev                \
                 libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev                    \
                 libxcb-xinerama0-dev libxkbcommon-dev libxkbcommon-x11-dev libclang-dev                                            \
                 freeglut3-dev mesa-utils libdrm-dev libgles2-mesa-dev                                                              \
                 binutils g++ cmake g++ mesa-common-dev build-essential libglew-dev libglm-dev                                      \
                 make g++ pkg-config libgl1-mesa-dev libxcb1-dev libfontconfig1-dev libxkbcommon-x11-dev python libgtk-3-dev        \
                 build-essential default-jre openjdk-8-jdk-headless android-sdk android-sdk-platform-23 libc6-i386                  \
                 libdrm-dev libgles2-mesa-dev libzc-dev libxcb-sync-dev libsmartcols-dev libicecc-dev libpthread-workqueue-dev      \
                 libgstreamer1.0-dev libgcrypt20-dev libqt5gui5-gles qca-qt5-2-utils xorg xorg-dev

Mind you that default-jre openjdk-8-jdk-headless android-sdk android-sdk-platform-23 and possibly libc6-i386 too, are only required if you need to build android projects.
And this is how I installed Qt from sources:
export QT_VERSION=5.15.1
export QT5BINDIR=/usr/local/Qt-$QT_VERSION/bin
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/qt5/lib
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms
export QT_QPA_FONTDIR=/usr/lib/x86_64-linux-gnu/qt5/lib/fonts

cd ~/Downloads/qt/qt-everywhere-src-$QT_VERSION/
sed -i 's/python /python3 /' qtdeclarative/qtdeclarative.pro \
           qtdeclarative/src/3rdparty/masm/masm.pri

./configure     -opensource -confirm-license    \
                -sysconfdir /etc/xdg            \
                -dbus-linked                    \
                -system-harfbuzz                \
                -nomake examples                \
                -no-rpath                       \
                -skip qtwebengine

make -j4
sudo make -j4 install
echo "Adding environment variables"
PATH=/usr/local/Qt-$QT_VERSION/bin:$PATH
export PATH

ldd /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/*.so

A major source of documentation is Beyond Linux® From Scratch (System V Edition) - Qt-5.15.1
.


Can you restore ubuntu to a "clean slate" via command line?

Not really, no. I always just go for the fresh install option, things tend to go wrong upgrading to a new release from an existing system. I imagine there's something drastic you could do with dpkg, but I wouldn't go down that rabbit hole.


Is there any program where you can take notes on a PDF and export those as pointers to the original document?

Well, you may try FoxitReader (I use it on daily basis without any problem), they offer a free version with multiple features.

As described in their website

  Small, fast, and feature-rich PDF viewer that allows you to open, view, and print any PDF file. Unlike other free readers, it enables you to create PDFs, participate in a shared review, and more. Now available with ConnectedPDF technology.


TL;DR: You can extract the whole archive with tar xf.
As Rinzwind mentioned, bunzip2 unfortunately refuses to operate on symbolic links. The output of file revealed that your .bz2 file is a symlink rather than a regular file.
How you should go about decompressing the file depends on specifically what you want to do. Considering the particular file you are operating on, it's likely that your bunzip2 command wouldn't have done quite what you wanted anyway, and that you should extract it with tar instead.
If you want to unpack the tar archive itself
Your .tar.bz2 file is a tar archive that is bzip2-compressed. You've asked just how to uncompress the file, which you can do (see below). But if you do that, the result will be an uncompressed archive, whose contents you'd then likely want to extract.
The tar command, which creates and extracts tar archives, can handle compression itself. You can extract the files from this compressed archive the same way you would for an uncompressed tar archive, because tar automatically detects and handles compression:
tar xf linux-source-4.15.0.tar.bz2

You might want to extract the file as your own non-root user, which you can do if you put it somewhere you have write permissions. If this is what you want, I suggest going to the destination and extracting it by giving its full path. For that file, this might be:
tar xf /usr/srclinux-source-4.15.0.tar.bz2

If you want tar to list each file as it extracts it, add the v option:
tar xvf linux-source-4.15.0.tar.bz2

If, for some reason, you wanted to tell tar explicitly that the archive you're extracting is bzip2-compressed, you could do so by adding the j option:
tar xvjf linux-source-4.15.0.tar.bz2

(You can use the v and j options regardless of whether the path that follows the f option is absolute or relative.)
If you want to create a decompressed copy of the file
If you want to decompress the file and place the result in the current directory, you can use bzcat -d and redirect the result:
bzcat -d linux-source-4.15.0.tar.bz2 >linux-source-4.15.0.tar

If you want to replace the target with a decompressed file
If you want to decompress the target of the symlink, replacing it with the original (uncompressed) file, then you can use realpath to dereference the symlink. In this case, I strongly doubt you want that, but here's what it looks like, for future reference:
bunzip2 "$(realpath linux-source-4.15.0.tar.bz2)"

Or just find the target and pass it to bunzip2, since you should definitely check what the target of a symlink is before performing an operation that removes it and replaces it with something else (in case you're mistaken and the target isn't what/where you think it is). To find the target, you can run that realpath command by itself:
realpath linux-source-4.15.0.tar.bz2

Of course, you can also inspect files with ls -l, file, and readlink to find out if they are symlinks and what their direct target is.


Mount a Win8 Phone as Share on Ubuntu 12.10

I don't own any wp devices. So this answer goes in kind of assumption and internet research. Anyone wants to correct any information, please do so.

Windows Phone 8 only Support MTP and has no Native Mass Storage Support. But you said, it is not even detected on Windows 8 , that is a bit confusing.

However, since Windows phone uses MTP, so only we need update the MTP library.

While searching on internet, I found out a blog that talks about it, and he can mount it. But on Mac . You can look here

So, for ubuntu, I would suggest to give a try to updated GVFS with MTP support. The article was written for Android 4.0+ devices which doesn't support Mass storage but only support MTP. You can have a look and instruction here. They talk about updating the MTP library.

But, interesting thing is, they have added a note on Feb 13, 2013. with a list of devices that are supported  in the unstable PPA.  And Lumia 920 is there. So it might be possible, it will be working with 620. If not you have to wait.

So I would suggest,

add ppa ppa:langdalepl/gvfs-mtp & install all available update.
Reboot, unlock your device and connect. See if it is now on Nautilus.
If not, add this unstable ppa ppa:webupd8team/unstable & avail the updates. There should be one update, libmtp. Install, reboot and retry.
The downgrade info is there on webup8 site. Remove unstable ppa first and then gvfs-mtp


You can "dd from smaller SD-card to Bigger" but you will end up with the same partitions, e.g. disk space, as on the smaller SD card. Eventually you can create a new partition on the bigger SD card ending up with two partitions.

What you should do is to format the bigger SD card with full capacity and copy over the files form the smaller SD card.


Please hook up the ethernet temporarily and do:

    sudo apt-get install linux-firmware-nonfree
    sudo modprobe -r b43
    sudo modprobe b43

You should be all set


No you can not share a swap partition (or a swap file) between different active hosts. Linux' paging is not programmed in a way that expects that the swap partition is accessed concurrently from different systems.


How to install Ubuntu on a Non-Ubuntu Linux without USB/CD?

You need UNetBootin: This is a program used to make Live USBs, but it has an option to install the live system directly in your hard drive.

Install Unetbootin:

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

and download the Ubuntu ISO. Run the program, select the ISO and then select your hard drive. When you reboot, it will ask if you want to boot the normal OS or the Live Ubuntu. Select the second option. You will be able to install Ubuntu from there.


What qualifies an application as frequently used?

Basic answer

Simply put, the Most Frequently Used scope sorts applications by the number of times you've launched them. That is to say, if you've launched Firefox 1000 times, and Chromium 999 times, Firefox will be listed first. Even if you haven't launched Firefox in months and months.

Technical answer

Simply put, the Most Frequently Used scope is a wrapper that searches a Zeitgeist.Index of installed applications with a result type of MostPopularSubjects. Zeitgeist measures this popularity with the zeitgeist-datahub daemon, which notices and updates its statistics each time you launch an application. You can look at the relevant lens code here, and the API documentation for Zeitgeist here.

Having looked at the current Zeitgeist code, it appears MostPopularSubjects is a simple sort by number of accesses. Additionally, given the same number of application accesses, the applications are sorted by newest first. It's a little more complex than this, but the SQL generated for a Most Frequently Used request is more-or-less:

SELECT
  subj_id,
  MAX(timestamp) as timestamp,
  COUNT(subj_id) as num_events
FROM
  event_view
GROUP BY
  subj_id
ORDER BY
  num_events DESC
  timestamp DESC

Isn't open source beautiful?


Installing 2 versions of Ubuntu on same hard drive?

As @bodhi.zazen said installing different versions of Ubuntu/Kubuntu/Windows/whatever is fine. Most Linux distributions also install the GRUB bootloader so your dual boot will (functionally) stay the same no matter what you install.

How to install Ubuntu alongside the other version:

Select the Something else option and click Next
The partition manager will open:
Select the partition you want to resize (ideally the one with the most free space)
Click on the Change... button (Ändern... in the screenshot)

The partition editing dialog will open:
Enter the new size for that partiton next to the New size in Megabytes text(Neue Paritionsgröße in Megabyte in the screenshot)
DO NOT TOUCH THE REMAINING OPTIONS! (Unless you know what you are doing...)
Confirm by clicking OK

The partition manager will now show some free space
Select the free space and click Add... (Hinzufügen... in the screenshot)

The Create partition dialog will open:
DO NOT CHANGE ANY OPTIONS! (Unless you know what you are doing...)
Close the dialog by clicking OK

Review the new partition dialog and click Install now(Jetzt installieren in the screenshot)


Build binary deb package from python source

Python is an interpreted scripting language. You don't just distribute the intermediate .pyc files because they're compiled for your system and won't make sense elsewhere. You distribute the source and that's compiled on the fly.

That's not to say you can't just distribute .pyc files. PEP 3147 allows this and sets out a structure but it does come at a cost and I'm not even sure it would stop you regenerating the source (via various introspection methods) - but this is not what Quickly is designed for; it's not going to help you build a package like this.

If you're trying to distribute a closed source application there are things like py2exe (Windows only) and bbfreeze (all) but none of them are perfect or completely irreversible. You can look at obfuscation methods if you want to further protect your source.


Samba config GUI doesn't show after entering password

Should run Samba from Terminal.

$ gksu system-config-samba

If returns error message with last line similar to this:

  SystemError: could not open configuration file '/etc/libuser.conf': No such file or directory

Create the missing file:

$ sudo touch /etc/libuser.conf

and run Samba again

$ gksu system-config-samba

Thanks Morbius1 for solution ubuntuforum.


It clearly depends on which Java version you might want to develop on. Please see this link for the differences between Java 6 and Java 7. Some sites suggest java 6 because it is considered to be more stable than 7. Please note that anything you can do with java version 6, you can do with 7 too.

If I were in your shoes, I would use the OpenJDK 7, but be sure to download the SDK and not the runtime if you want to be able to do software development with. I do not know if it is 100% compliant with the Oracle version of Java, however it should be enough to cover most developer's needs.


Remove update notification in Unity indicator after xubuntu-desktop installation (12.04)

I don't know if this is a solution or just a workaround to your problem , but you can disable the update-notifier from startup applications. I think you will not receive anymore update-notifications then.

Open a terminal and give this command

sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' -i /etc/xdg/autostart/update-notifier.desktop

Then try to disable it from startup applications and see if your problem solved.

OR

take a look inside /etc/xdg/lxsession and see if is something there related to update-notifier


Thanks to a suggestion provide by user @KnudLarsen I was able to boot Ubuntu 14.04 and start X server. The key is to pay attention to what Ubuntu is reporting here -

/usr/bin/X : error while loading shared libraries : libimf.so cannot open shared object file: No such file or directory

@KnudLarsen then mentioned in a comment that make a copy of libimf.so to /usr/lib and maybe X can find it at that point.

I googled his response and I found a similar posting here:

Symbolic link to libimf.so

Which is exactly what I did. I created a symbolic link of libimf.so  in the following way

ln -sf /opt/intel/composer_xe_2013_sp1.3.174/compiler/lib/intel64/libimf.so /usr/lib64/libimf.so

Then I ran startunity again

sudo startx $(which unity)

It complained of more Intel .so libraries missing. Sequentially I symlinked all of those and finally I was able to boot into X windows.

At the moment I do not know what caused this outage. One thing I do know is that I manually installed the libGLew*.so packages and it seems the installer installed those under /usr/lib64.


how to install lxterminal 0.2.0-1 (vivid) in Lubuntu 14.04

Please visit https://launchpad.net/~lubuntu-dev/+archive/ubuntu/lubuntu-daily. Here you'll find a collection of ppas (Personal Package Archives) provided by Lubuntu's development team. If you need to know more about ppas, you can look at What are PPAs and how do I use them?. You may also want to know about how to remove a ppa: How can PPAs be removed?.

Now to the specifics ...

The first link I provided offers an Overview of published packages along with a filter: in your case, you'd filter for "Trusty". You'll see that 62 packages are available for Trusty. One of them is lxterminal.

Let's assume you go ahead and install this ppa:

sudo add-apt-repository ppa:lubuntu-dev/lubuntu-daily

You'll then need to run

sudo apt-get update

to update your software sources.

At the next step,

sudo apt-get upgrade

all the existing software on your system will be upgraded to the version offered by the daily ppa, not just lxterminal!

If you really want only lxterminal, you'll need to do a bit more work. You'll need to issue commands preventing upgrading of anything else. And that's covered here: Is it possible to only allow specific packages updates from a PPA.

By the way, since you've mentioned "vivid" in the title of your question, you can run a filter using vivid instead of trusty. As of today, both trusty and vivid have the same version of lxterminal, AFAICT.


How to make rsync delete files in the destination folder that has been deleted in the source with shell glob?

the delete-before should work where you are sync'ing folders, rather than individual files.
if you tried:
rsync -av /var/log/dir2/  /tmp/dest --delete-before

I would suspect that this would work the way you intend.


Can't login Unity Game Engine on Ubuntu 16.04 LTS

Download http://download.unity3d.com/download_unity/linux/unity-editor-5.4.0b18+20160524_amd64.deb open deb in a deb installer, and Unity3D will work as intended.


Ubuntu 18.04 Application menu not showing after clicking

You have to activate "hot corners" with gnome-tweak-tools.

It worked for me.

I found this solution here : https://extensions.gnome.org/extension/6/applications-menu/


For now, the contacts are still backended to CouchDB. This will stop being the case over the next few months (this should get updated when that happens).

What you need to do is determine the right endpoint for your couchdb instance on the server, and then query that using the couchdb REST API. As all these requests need to be OAuth-signed, it's not trivial to do; there is Roman's tool that will put the credentials into environment variables you can use to build URLs for curl or wget, there is a helper u1oauthrequest (part of the old ubuntuone-couch) that gets your credentials from the keyring, signs the given URL, and prints the result. There is a little script I just threw together from scripts used by people on my team.

If you save the latter in a file called u1couch-backup.py, you can then call it via

python u1couch-backup.py

and it should print out the information about your contacts database. If you want to get the list of documents you'd do

python u1couch-backup.py /contacts/_all_docs

and if you want the actual documents and not just the ids and revnos you'd do

python u1couch-backup.py /contacts/_all_docs?include_docs=true

The whole thing is quite unreliable to be honest so you might need to retry a couple of times, or retry at a less-busy time, which is why we flagged it for EOL over a year ago. The move to u1db should make this quite a lot better (soon!), at which point I'll update this answer.


Your Broadcom 4311 requires firmware that is not installed by default in a new install. Please get a temporary wired ethernet connection, open a terminal and do:

sudo apt-get install linux-firmware-nonfree

Detach the ethernet, reboot and you should be all set.


Count Number of Lines the begin with date and timestamp

now=$( date +%s )
one_hour_ago=$( date -d "now - 1 hour" +%s )
count=0
while read -ra words; do
    timestamp=$( date -d "${words[@]:0:3}" +%s )
    if (( $one_hour_ago <= $timestamp && $timestamp <= $now )); then
        (( count ++ ))
    fi
done < filename
echo $count


In fact you can't and this is unfair to make a comparison or whatever decision using xrdp.

Indeed xrdp is just an open source implementation of the Microsoft RDP protocol, and frankly it's still not mature enough to be stable.

Moreover, every Desktop Environment has its own problem with xrdp, even unity.
Problems range from keyboard layout differences , no window decoration, no language switching, no top panel in Unity and many other problems.

So in couple of words, to have a fair and logical comparison you should work on a physical system running those environments.

Personally, I have more than 4 years of experience using xrdp and other protocols and for bad till now, it doesn't get stable in some way.

PS: I advise you to take a look at X11RDP


muon package manager can't find packages

ok, at last I found the answer which is very tricky:

I had used the KDE default browser "rekonq" to test public proxies. To do this I had had to change the proxy settings inside the browser app. And than after the trial I just put the browser aside and forgot about it.

BUT! rekonq changes the system settings if you change the proxy. And this change remained in the system and caused my problem. Very hard to find out what happened. I think it's generally a very bad idea, that the browser changes system settings.


Favorite icon for Franz is missing on Ubuntu 17.10

It seems the icon-path provided in the .desktop file associated to Franz is wrong or not understood by the shell.

To fix this first copy franz.desktop file from /usr/share/applications/ to ~/.local/share/applications/.

Then open the copied file, and provide a full path to a correct icon file (preferably SVG or PNG) to the Icon= line, so that it looks like

Icon=/path/to/icon-for-franz.png

Tip: Look for a franz.png file in /usr/share/icons/hicolor/1024x1024/apps/. If it exists and is not corrupted, you can set

Icon=/usr/share/icons/hicolor/1024x1024/apps/franz.png


Any CA Cert trusted by default on ubuntu?

Spend a few minutes to explore I found this question:
Become a trusted Certificate Authority in Ubuntu

and its answer contains what I'm looking for, essentially:

cat /usr/share/doc/ca-certificates/README.Debian

How certificates will be accepted into the ca-certificates package

Get it included into Mozilla's trust store.
File a bug against ca-certificates stating this fact.
....

And I can find the list here:
https://wiki.mozilla.org/CA:IncludedCAs


You want Ctrl and not Alt. This

ctrl+shift+U then 2014enter

is giving me —. Note that the output depends on your locale settings.


Is there a way to toggle Do Not Disturb from the commandline?

Thanks to @UnKNOWn, I found this command and with a little tweaking, I was able to create a script to toggle Do Not Disturb mode. Here is the GitHub repo to the script. I set a keyboard shortcut in the settings to make it usable.
Edit: For anyone not wanting to deal with a script, you can simply use Super + V to open up the notifications menu and press space to toggle DND. Realized this the day after, but I hope the script helps haha.


Add line numbers if certain pattern matched

Not sure if this is exactly what you want (you didn't provide the requestd examples yet), but here's an attempt to solve it with a small Python script. It reads data from standard input and prints them t standard output, inserting an index number in hexadecimal notation in each line that starts with "INIT ":

#! /usr/bin/env python3
import sys

i = 0 if len(sys.argv) == 1 else int(sys.argv[1])
while True:
    line = sys.stdin.readline()
    if not line:
        break
    if line.startswith("INIT "):
        print(line[:5] + hex(i)[2:] + line[4:], end="")
        i += 1
    else:
        print(line, end="")

I saved the script above as numberinit.py and made it executable using chmod +x numberinit.py.

You are supposed to run it in one of these two ways:

./numberinit.py < INPUTFILE
./numberinit.py STARTINDEX < INPUTFILE

INPUTFILE is the file you want to read and the optional STARTINDEX parameter lets you specify the first index to use, default is 0.

Usage example:

$ cat example.txt
my input file
INIT first
INIT second
stuff in between
INIT third
INIT something longer as fourth

$ ./numberinit.py < example.txt
my input file
INIT 0 first
INIT 1 second
stuff in between
INIT 2 third
INIT 3 something longer as fourth

$ ./numberinit.py 42 < example.txt
my input file
INIT 2a first
INIT 2b second
stuff in between
INIT 2c third
INIT 2d something longer as fourth

You can of course redirect the output of the command to save it in a different file, but don't use the same input and output file (will truncate the file due to how your shell handles redirections):

./numberinit.py < input.txt > output.txt


Same here. It seems to be a UI bug that storage location can't be set.

A workaround is to open dconf-editor, navigate to org/gnome/deja-dupe/drive and edit the drive name and UUID. You can find the UUID by running blkid.


Hit CTRL+ALT+T to open a terminal.

Then type:

gsettings set org.gnome.nautilus.desktop font 'Ubuntu 10'

The Ubuntu 10 is the font name and default font size.

Hope this helps :-).


How can i "spy" on my second dual monitor output from the main screen?

I'm not sure I understand this right; is your 2nd monitor way, way far away from the first and you cannot see them both at the same time? As in, one is a public display (eg. airline departures and arrivals) and the other is a (sort of) regular desktop? I will assume this is the case.

I would use one of two options:

First, assuming you have two physical display outputs on your 'local' computer, I would try to use a splitter to have the 2nd display mirrored on a 2nd local monitor as well as on the existing remote monitor. Splitters exist for both VGA, DVI, and HDMI connectors so you should be able to find something suitable.
Alternatively (if you are not able to have two physical monitors locally), I would run a VLC instance with a capture command. This would allow you to capture (all or part of) the 2nd display, and VLC would show this capture as its video. You can then move and resize the VLC window on your primary display to suit your need. The VLC command to use for this is vlc screen:// --screen-fps=5 --screen-width=1920 --screen-height=1080 --screen-left=0 --screen-top=382 - I suppose the options are sufficiently self-explanatory; you will have to specify the left/top offset according to your logical monitor layout (in the "Display" control panel). This will eat some CPU, but you can perhaps adjust the FPS to a very low level.

Good luck!


Will Ubuntu work if I install it offline?

Yes it will work, however with some restrictions.  For example there are "Must do" updates if you want to play MP3s or movie files etc. (Ubuntu Restricted Extras).

Also you need to install medabuntu libraries if you need to play DVDs.  There are others but apart from these restrictions Ubuntu will work.

I had to to this once and was able to update everything at a later date


Boot hangs for 30 seconds at "Begin: Running /scripts/local-premount"

Try the following:

open /etc/initramfs-tools/conf.d/resume
replace RESUME=UUID=xxx with RESUME=none
issue sudo update-initramfs -u
reboot your system

(create the file if it does not exist and just add RESUME=none in it)
The file should contain the UUID of your swap partition, you can check this with sudo blkid | grep swap.
I found the following bug on launchpad which is supposed to be Lubuntu specific but the commands above also resolved the same issue on my Xubuntu installation.
See comments #27 and #28.
This file seems to be related to hibernate/suspend, I can confirm suspend still works on my system after the changes.


Mounting a USB disk in a permanent location

Mount the disk using udev. Place the rules from this wiki into /etc/udev/user.rules and reboot (or reconnect the USB HDD) . There are several favors of rules in the wiki (that's why I didn't list them here), choose the one that best suits your needs (e.g. you need a specific normal user to be able to unmount it).

Perusing /lib/udev/rules.d/80-udisks.rules will help you understand what's udev doing to your hard disk.

Besides the udev rules I mentioned above I think there's another approach you can take: instruct udisks (through udev) to leave your disk alone and then mount it through fstab.

This code works on my system

ACTION!="add|change", GOTO="my_udisks_end"
SUBSYSTEM!="block", GOTO="my_udisks_end"

ENV{ID_TYPE}!="disk", GOTO="my_udisks_end"
ENV{ID_BUS}!="ata", GOTO="my_udisks_end"
ENV{DEVTYPE}!="partition", GOTO="my_udisks_end"

KERNEL=="sd*|hd*", ENV{UDISKS_PRESENTATION_NOPOLICY}="1"

LABEL="my_udisks_end"

but is generic and includes all partitions. To be able to target your particular hdd/partition use udevadm info --query=all -n /dev/sdX and then match on some of those particular atributes in the udev rules.

A good resource to help you in this is Writing udev rules. Unfortunately it contains some outdated info (udevinfo was replaced by udevadm indo). I assure you, though, it's a worthwhile read -- udev is a central piece of architecture nowadays and you can accomplish a lot by using it. It's also pretty flexible.

It's also easy to make mistakes in udev rules :). Use udevadm test $(udevadm info -q path -n /dev/sdX) to take a 'peek' at what's udev doing.


That probably means that after an upgrade (or something like this) timeout value has been changed to 0 and your boot process goes straight up to Ubuntu menu entry. You can find many solutions to the issue. For example this one https://www.howtogeek.com/196655/how-to-configure-the-grub2-boot-loaders-settings/


Two things to try (from the commandline):

Firstly:

fromdos filename.tex

(requires the tofrodos package).

Secondly:

iconv -c -f UTF-8 -t UTF-8 filename.tex > filename-copy.tex

That should remove any characters not compatible with UTF-8.

(You should also follow the advice in the other answer about putting \usepackage[utf8]{inputenc} in your .tex source.)


Online accounts in 12.10 Facebook not working

This problem is believed to have been resolved by Facebook as of February 26th.

For details about what caused the problem, see this bug report:

Facebook account setup opens in external browser, unusable


Is there a risk to run viral embedded macros on Ubuntu/LibreOffice?

Yes. However, the probability is lower. It's quite likely an exploit for MS Office won't affect LibreOffice and most .doc viruses will be for Office, but if an attacker knew what you're using, it's quite possible.

As an example, see this link.

If you want complete security, run a VM on your machine and open files there. And of course, never run LibreOffice as root.


In your BIOS two options control that. 1st - order of booting 2nd - hard drives devices. You have to find the 2nd option and change there.

Or as people said remove USB and reboot.


I finally got it! Thanks for your help cl-netbox. The USB ISO was probably corrupted so i built it using another iso (this was not at the first neither the second attempt).

When i finally got to Try withough intalling gnome (without editing the kernel to nouveau.modeset=0 and not leading to nouveau errors), i connected to internet and did on terminal:

sudo get-apt update

then I went to additional drivers and selected Nvidia recomended, rebooted and installed perfectly.


Unity "File" button opening a separate window when automounting USB

Unity added more functionality to hover scroll in many places. like: window switcher, desktop switcher, launcher icon...

Just Scroll over icon (without click)


This was fixed by the user by removing the bad partition line in /etc/fstab.


How to find out what init mode system is using?

Ubuntu 14.04 only uses Upstart. Ubuntu 15.04 onwards use systemd, but on 15.04 you can switch to Upstart. Both Upstart and systemd support sysv init scripts for backward compatibility.

The Ubuntu Wiki article on Systemd for Upstart users gives this command for identifying the current init system:

ps -p1 | grep systemd && echo systemd || echo upstart

This should always return upstart on 14.04 or 12.04 (the currently supported versions of Ubuntu not using systemd).


Quickly, Treeview and Treestore, entry text not showing

In your second screenshot, the Tree View Editor, you should right click each column you want to show text in and select Add child text to add a Gtk.CellRendererText to this column.
The first property for the cellrenderer should be a value from the liststore you want to show in that column.

Same goes for a PixBuf, Spinner, Progress, etc columns.


Ok, I wont share the time and failures on repairing a mysql install on 12.04 but here is what I did having most if not all the symptoms of multiple faulures.

  sudo apt-get --purge apparmor

(reinstall after done?)

 sudo apt-get remove --purge mysql-client-* mysql-server-* mysql-core-* mysql-workbench-*

(the * is all files related to that tag

 sudo aptitude purge ~c

(must have aptitude installed)
check removal of all files by:

 sudo dpkg --get-selections

(you can replace with sudo dpkg --get-selections | grep mysql) but i reccomend the first because a clean file structure runs well.
Then reinstall using:

 sudo apt-get install -f mysql-server-5.5

and whatever else mysql packages you need.
I have reproduced the error most of us have been getting and this fixed it each time.

NOTE!!! DO NOT STOP PASSWORD SETUP WHEN CONFIGURING MYSQL_SERVER_5.5!!!


install a second hard drive with ubuntu alongside windows 10

Presuming that your external hard drive that you said has Ubuntu installed has data that you want to keep. I recommend you boot with Grub, this is how I dual boot Ubuntu on my Windows 10 laptop.

What you need to do is:

Create a live Ubuntu USB stick
Boot into Ubuntu on the live USB stick and configure networking
Create a directory called /target on the live USB stick
sudo mkdir /target
Attach and mount your external hard drive on /target. If it auto mounts someplace else, just sudo umount /mnt/someplaceelse and mount it on /target. Eg. sudo mount /dev/sdb1 /target # If /dev/sdb1 is your external hard drives primary partition
Make a directory on /target if it does not already exist called /boot/efi
$> sudo mkdir -p /target/boot/efi
Bind mount critical live USB directories onto /target:
$> for a in /sys /proc /run /dev; do sudo mount --bind "$a" "/target${a}"; done
Use gparted to determine the location of the efi partition on
your windows hard drive
$> sudo gparted /dev/sda # If /dev/sda is your windows hard drive
Mount the Windows Boot Manager efi partition on /target/boot/efi:
$> sudo mount /dev/sdXY /target/boot/efi
Chroot to /target:
$> sudo chroot /target
On chroot:
$> sudo apt-get update
$> sudo apt-get install grub2
$> sudo update-grub2
$> exit
Reboot:
$> reboot
While rebooting pull the USB thumbdrive out of your computer - you should be brought back into Ubuntu this time on the external hard drive (not the USB thumbdrive)
Re-run an update of grub2:
$> sudo apt-get update
$> sudo update-grub2

Done.

Note: if you have trouble for any reason and you want to boot into Windows just hit escape and you should see the bootloader option screen and select Windows. If not just go into your Bios and change the boot load priority.


There are several binaries you can download to control different settings in LXQt:

lxqt-leave

deals with interrupting or terminating sessions. It comes with several options expressing the action they trigger, e. g.

--leave
 --hibernate
--shutdown
--reboot

lxqt-session

This binary is launched right at the beginning of LXQt sessions and in turn is responsible for launching and monitoring all other components constituting the sessions.

lxqt-config

is another binary which will give you the "Configuration Center" which is a GUI that has several options to choose from that allow you to control the appearance as well as other configurations. One of them being

lxqt-globalkeys

lxqt-globalkeysd

can be adjusted from section "Basic Settings" in configuration dialogue LXQt Session Settings of lxqt-session.

lxqt-config-globalkeyshortcuts

which is used to customize shortcuts can be opened from the panel's main menu - Preferences - LXQt Settings - Shortcut Keys and is provided by the Configuration Center of lxqt-config as well.

All this info and more can be found at the LXQt GitHub page or their official web-page:
LXQt(github)
LXQt(.org)


Unable to read HDD content Lubuntu 14.04

I am no expert, but It looks like the HDDs are faulty.
I had a similar problem (hdd was looped on searching) with a defective hard drive.
How many HDD are connected?
Can you remove one or more drives and try to read it on a different machine?


issues with installing digital speech Decoder

I'm guessing you are using bionic (or equivalent)? In that case there is a g++ v7 compatibility issue with IT++.

https://sourceforge.net/p/itpp/bugs/256/

You can either apply the patch listed in the bug and rebuild or just use the IT++ provided in the repos.

apt install libitpp-dev

https://github.com/szechyjs/dsd/wiki/Installation#dependency-installation-on-ubuntu-1404-and-newer


Open Synaptic Package Manager and remove that specific package (nautilus-dropbox). That will eliminate the conflict.


How can get 3D mode in Unity working again?

Ok the problem is solved now.

I had the freeze every day after 1st login and had to run the repair packages tools. But it looks like an update yesterday has fixed the bug which came with an update...


I messed up the `/usr/bin/python3` in Ubuntu 18.04, how can I install it back

This will recreate the symlink from python3 to python3.6 and reinstall the binary python3.6. It might be enough or not, depending on how much you messed the python package.

sudo rm /usr/bin/python3.6
sudo apt-get install --reinstall --download-only python3.6

That will download the deb package to /var/cache/apt/archives

Create a new directory somewhere, where you are going to unpack the .deb file and get the missing binary:

dpkg -X /var/cache/apt/archives/python3.6_3.6.9-1~18.04_amd64.deb /tmp/justforthis
cp -a /tmp/justforthis/usr/bin/python3.6 /usr/bin


Why won't the terminal display new lines?

try one or both of these:

type ctrl+c, then type reset, then press enter.
type ctrl+c, then type stty sane, then press enter.

the ctrl+c is to clear any other characters you might have typed in the command line.

reset or stty sane usually fixes a messed up terminal. Read the man page of reset and stty for more information.

Note that if the terminal is messed up enough then it might be that not even ctrl+c or enter will work as expected. There are still other methods to input characters, but they involve ancient dark magic. In that case, it is usually easier to just close the terminal and start another one.

My understanding of the inner workings of a terminal is not deep enough to explain why or how it does that.


No - it only removes/reinstalls the application itself. All your VMs and other data will remain intact.


Managed to resolve this.

So what i did:

Make #driver
Make install
modified the /etc/modules to include the module
insmod the module to load in to ensure it is ok.
depmod
reboot
done

:):)


Is the latest stable release or the latest LTS release more suitable for a development machine?

Use the latest stable release
As it is predominantly a development machine, I would go with the latest stable version, as it has more up to date libraries and programming tools. As a normal release, it is not supported for as long as the LTS. I don't see this as a problem because you will probably want to have the newer versions installed by the time the support expires.
LTS versions are more suitable for business users and home users who don't want to worry about upgrading every 6 months.


docker.io DNS doesn't work, it's trying to use 8.8.8.8

When the Ubuntu Docker package updated to using systemd, it dropped support for the /etc/default/docker config file, so the initial solution suggested by rocketman10404 will no longer work (disabling dnsmasq would still work, but it has the downside of preventing Ubuntu from automatically updating the DNS server).

Fixing in the new daemon.json config file

Find your network's DNS server:

$ nmcli dev show | grep 'IP4.DNS'
IP4.DNS[1]:                             10.0.0.2

Open or create, if it doesn't exist, /etc/docker/daemon.json and add the DNS servers that you want to use:

# /etc/docker/daemon.json
{
    "dns": ["10.0.0.2", "8.8.8.8"]
}

Restart the docker daemon:

$ sudo service docker restart

I wrote an in-depth blog post and also filed a bug about this issue if you'd like more details.

(Originally I solved it by opening up /lib/systemd/system/docker.service and add DNS settings to the ExecStart line, but that's bad - we shouldn't edit systemd files directly.)


Nemo won't show basic information about file when it was accessed or modified

I had the same problem.

From the menu select EDIT > PREFERENCES then DISPLAY

Change the date format to: YESTERDAY

Then the date will show.


You can't have multiple entries in a single cifspw file, but you can override the file the cifs kernel module reads by specifying the 'credentials=FILE' option when mounting. See "man mount.cifs" for details.

E.g. to mount while reading credentials from /tmp/foo:

mount -o credentials=/tmp/foo -t cifs //host/bar /media/bar


Ubuntu 14.04.2 freezes before log-in screen

First,
between " rescoue mode" or alternate your runlevel:
What is the difference between single user mode, recovery mode from GRUB, and booting with Ubuntu install disk?

After remove all drivers NVidia:

sudo apt-get remove nvidia-*

After install aptitude e synaptic

sudo apt-get install aptitude synaptic

aptitude: best binário installer the like-debian ever, verify high complex contexto, sample: conflict between repositories

synaptic: manager package interface Graphical.

Second:

download and install driver correct:

wget -c https:us.download.nvidia.com/XFree86/Linux-x86_64/346.59/NVIDIA-Linux-x86_64-346.59.run

after install:

sudo ./NVIDIA-Linux-x86_64-346.59.run

verify your Ubuntu is 32 or 64 bits, The links of the above are 32 bits.

After install backage NVIDIA, install manager NVIDIA:

sudo aptitude install nvidia-settings

font: http://goo.gl/qhqtnD


Ubuntu USB Expert Install - Grub2 installs on USB

If you have access to a computer already running Ubuntu, try the Startup Disc Creator. It's optimized for Ubuntu.


What happens with Windows applications installed via Wine during upgrades?

Nothing happens to the Windows Apps. Wine will be the only program updated in that sense.


I have the same problem, and have been google'ing a while now, this is what i've come to till now:
This site states that recent computers, especially those more recent than 2010 uses the UEFI-booting-system, and not MRB. This may be the cause of the problem; As it says here that wubi uses MRB to boot ubuntu (if that is true).
May be worth a shot


LibreOffice Writer dispalys Extra dash Underscore _ after each persian/arabic character!

It's probably a function of the CTL setting which can be found in Tools > Options > Language settings > Languages.  Do you have the same problem if you set this value to, e.g., "Farsi"?


Find files in particular directories and replace phrase

Try the following script:

#!/bin/bash

find . -type d -name "b" | while read Folder; do
    find "$Folder" -type f -name "a.xyz" | while read File; do
        sed -i 's/phrase1/phrase2/g' "$File"
    done
done


I cannot set up dual monitors to work with 11.10 using amdcccle 11.9

The steps that (eventually) worked for me on 11.10 (Oneiric) with a 1680x1050 22" and 1024x1280 19" (counter-clockwise ;)):

[Skip to important/troublesome steps in bold]

Install the "ATI/AMD proprietary FGLRX graphics driver" (the "post-release updates" version failed for me)
Reboot and see the horrible mirrorring at low res
Use amdcccle(adminstrative) (after experiencing the horrible crashing of this question), and

Disable the second monitor
Apply
Re-enable the monitors with all the settings that you want
Apply/OK etc

Log-off and on and see if it sticks: if it doesn't (it didn't for me)

Redo 3
Go to the normal display settings control panel and save (I don't think this is necessary, but it's what I did)
Open Terminal and

cd /etc/X11
sudo mv xorg.conf.ati xorg.conf.ati.bak
sudo cp xorg.conf xorg.conf.ati

Your settings should stick now.

I would think that simply doing step 3 then sudo rm /etc/X11/xorg.conf.ati would work, but I'm not about to mess it up :).


How do I remove YouTube sidebar integration?

Uninstall unity-webapps-youtube via synaptic or apt-get. Also if there are other site integrations which you want to remove follow the same method
sudo apt-get remove unity-webapps-<site_name>.


Pop-up notification at a specified time or after a specified timeout

Pop-up notification at a specified time:

echo 'notify-send "Go out for a coffee!"' | at 3:14PM

After a specified timeout:

echo 'notify-send "Go out for a coffee!"' | at now + 1 minutes


How to check if two or more programs are installed using a bash script?

If you want to check that all of them are installed, just do:

hash foo bar baz &>/dev/null &&
    echo "All programs installed" ||
    echo "At least one program is missing"

The &> redirects standard error and standard output to /dev/null so you don't print the output of hash. You probably only need 2> since as far as I know, hash only prints to stderr, but we may as well be on the safe side.

The && means that the next command will only be run if the previous one was successful. The || means the next command will only be run if the previous one failed. So, if one of the three (or N) programs you checked for is not installed, you will get the error message.

If you want to be told which program is not installed, use this one instead:

for p in foo bar baz; do
    hash "$p" &>/dev/null && echo "$p is installed" ||
                 echo "$p is not installed"
done

Finally, for even more fine grained control and detailed output, you could do:

i=0; n=0; progs=(foo bar baz);
for p in "${progs[@]}"; do
    if hash "$p" &>/dev/null
    then
        echo "$p is installed"
        let c++
    else
        echo "$p is not installed"
        let n++
    fi
done
printf "%d of %d programs were installed.\n"  "$i" "${#progs[@]}"
printf "%d of %d programs were missing\n" "$n" "${#progs[@]}"


Upgrading to 20.04 from 18.04 froze my laptop, can I reboot without damaging my pc/its files?

Yeah it broke everything, had to press escape on startup and then boot into recovery mode, I was able to finish installing 20.04 packages from there. I kinda hate 20.04 so I am downgrading now


Dual monitor on Ubuntu can't have the same resolution

I had the same problem only I had Nvidia gts 250 none of the drivers worked for me so this is how I fixed my issue. opened up xorg.conf by typing sudo gedit /etc/X11/xorg.conf

Found the monitor input and set the HorizSync and VertRefresh for my resolution. And everything worked for me after reboot meaning in resolution setting I was able to chose the right resolution for my second monitor.


Stuck on black screen asking for login and password

Option 1: Use boot repair.

Ubuntu was unable to boot and there is this fancy tool for such problems: boot repair. This should allow you to boot into Ubuntu again.

Option 2: Reinstall Ubuntu (you are likely to keep your personal files in the Home folder!

You can try writing either a new disk image or live USB with the version of Ubuntu you like, or use the same liveusb/DVDROM you used before and run the distribution update again. You will have the option to keep your home folder (if the hard disk is not corrupt.)


how do I load a program I have downloaded!

Python is more of a programming language than a program itself but it does have an interactive shell too. Here are your main options.

1. Interactive Shell

For playing around in Python, you can just run python and get going. Nothing is saved
Open a terminal and run python:

$ python
Python 2.7.4 (default, Jul  5 2013, 08:21:57)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> add = lambda a, b: '%d + %d = %d' % (a, b, a+b)
>>> add(3, 72)
'3 + 72 = 75'

2. As an interpreter

If you want to work out of a file you can. You can call it whatever you like and then just run:

python mypythonfile.py

ControlD to exit.

3. As a general purpose script

If you want your file to run like a command and you don't want to prepend python onto it each time, you can add a shebang at the beginning of the script:

#!/usr/bin/env python

... save that, and then in a terminal set the permissions

chmod +x mypythonfile.py

... and run it

./mypythonfile.py


I wanted to extend john smiths answer. I had made two USB sticks bootable using Ubuntus "Start media creator". It made the sticks unusable afterwards, because they were write protected and I could not format them in Ubuntu or Windows. I tried fdisk, gparted. No dice.
What helped was inserting the stick (make sure this is the only USB drive inserted), finding out where it is mounted:

df -Th

That will show you a list of devices/partitions and their mount paths/points:

udev      devtmpfs 7,8G    0 7,8G 0% /dev
...
/dev/sdb1 vfat     7,5G 4,0K 7,5G 1% /media/<USER_NAME>/<STICK_NAME_OR_ID>

Find your USB stick and remember its partition device path (here: /dev/sdb1) and mount point (here: /media/USER_NAME/STICK_NAME_OR_ID). Then unmount it:

sudo umount /media/USER_NAME/STICK_NAME_OR_ID

Now recreate the file system (FAT32 in this case):

sudo mkfs.msdos -F 32 /dev/sdb1

Wait a short time and unplug the stick. Wait again and plug it in. It should be writable now...


How do I create panes within a Nautilus window?

Open Nautilus and press F3.

Or View-->Extra Pane  As in the picture.


Ubuntu (and many other Linux distributions) will generally treat these sorts of things as network devices. You should be able to use scp or similar functions to move data between the systems. Use something like ifconfig to get the IP addresses associated with the USB bridge, and you should be good.


error while loading shared libraries: libudev.so.0 - Brackets

I found the solution
in this Github issue.

You have to link the existing libudev.so.1 to the requested libudev.so.0; to do so, run the command

ln -s /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0

NOTE: You might need to prefix this command with sudo to gain root privileges. In which case it would look like this:

sudo ln -s /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0


Wifi adapter worked from 12.04 DVD but won't connect after installing UB 12.04

I suspect the drivers for your two devices are conflicting. I suggest you blacklist the driver for the internal device. Please open a terminal Ctrl+Alt+t and do:

sudo -i
echo "blacklist rt2800pci"  >>  /etc/modprobe.d/blacklist.conf
modprobe -r rt2800pci
exit

The RT73 device may work perfectly now; if not, check the logs for useful clues:

dmesg | grep rt7

If it complains about missing firmware, please check here: rt73.bin for Ubuntu 12.04 LTS?


The simple solution is to disable Secure Boot, as described on this page of mine. To be sure, it's better to run with Secure Boot enabled, but if the feature isn't working as designed, it's a liability.

For more thorough diagnostics, I recommend you start by examining your EFI boot entries by typing sudo efibootmgr -v, as in:

$ sudo efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0003,0007,0001
Boot0000* rEFInd Boot Manager   HD(2,1f4800,82000,5f6b4992-fcfe-4a2c-9e67-98b0a30dfe7d)File(\EFI\refind\refind_x64.efi)
Boot0001* Lenovo Recovery System    HD(3,276800,1f4000,de3b7563-97f5-48c6-ab7f-2f5d6d57c644)File(\EFI\Microsoft\Boot\LrsBootMgr.efi)RC
Boot0003* ubuntu    HD(2,1f4800,82000,5f6b4992-fcfe-4a2c-9e67-98b0a30dfe7d)File(\EFI\ubuntu\shimx64.efi)RC
Boot0007* Windows Boot Manager  HD(2,1f4800,82000,5f6b4992-fcfe-4a2c-9e67-98b0a30dfe7d)File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................

Check the BootOrder line and examine each of the entires specified in order. For instance, in this example, 0000 is first, and Boot0000 launches rEFInd. What you should examine in more detail is the file that's launched, such as \EFI\refind\refind_x64.efi for this example's Boot0000. In the case of a standard Ubuntu Secure Boot launch, the file should be shimx64.efi, which of course is not the case for this example's Boot0000 -- but it is true for this example's next boot entry, Boot0003.

This example would probably produce a Secure Boot warning such as you describe on most computers, but after that warning, GRUB and Ubuntu might launch, since when Boot0000 failed, the system would move on to Boot0003, which should succeed. It's possible that something like this is happening to you -- but it's probably launching grubx64.efi first, and then either failing to move on or shimx64.efi might not have an entry. If this is the case for you, you could tweak the boot order with the -o option to efibootmgr or create a new entry entirely. The details depend on what you see from efibootmgr -v and what's actually installed on your hard disk, though.

If your efibootmgr -v output shows that the computer should be launching shimx64.efi first, then I recommend you compare that file to the EFI/BOOT/bootx64.efi file on the Ubuntu installation media that do boot. Check their file sizes with ls -l and check if they're identical with diff; for instance:

diff /mnt/cd-media/EFI/BOOT/bootx64.efi /mnt/esp/EFI/ubuntu/shimx64.efi

(The mount points are likely to be different, of course.) These files should be identical, which diff indicates by providing no output. If they aren't, you could try overwriting the shimx64.efi on the hard disk with bootx64.efi from the installation medium. If the two files are not identical because of a package upgrade, that would be cause for filing a bug report. They might not be identical for some other reason, though, like disk corruption or a (very rare) error when copying files.

If the files are identical but the external medium boots and the hard disk doesn't, then that probably means you've got a buggy EFI. You might look for an update on your manufacturer's Web site. (They probably call it a "BIOS update," although it's really not a BIOS.) If that doesn't help, you might try filing a bug report with the manufacturer.


Firefox, LibreOffice are stuck in English. I want them in Esperanto

For firefox you can get language packs and I just checked - they do have Esperanto.  Same thing for libreoffice.

https://addons.mozilla.org/en-us/firefox/language-tools/


You can create the folder under your home as /home/username/Pictures.

Then open Shutter and go to Edit menu > Preferences.

There change the save directory with automatic save to the folder you just created and save the changes made. Now it will work and save automatically to any folder you want.

If it does not work, please comment.


Unity's "File Edit View" menus in Gnome Fallback in Ubuntu 12.04?

*If you use GNOME2 or GNOME3 you can use the globalmenu package.

You can find more information here

And install instructions over here

This adds the same global menu as in Unity.*

Answered here.

Edit:

In order for this guide to work for 12.04 Precise, you also need sudo apt-get install appmenu-gtk libqtgui4 indicator-applet-appmenu indicator-appmenu and then Alt + Right-Click, Add to Panel..., and add Indicator Applet Appmenu


Screen brightness of Dell desktop monitor

Install a program that comes for ubuntu Brightness Controller

sudo add-apt-repository ppa:apandada1/brightness-controller
sudo apt-get update
sudo apt-get install brightness-controller

I am quite sure it will work as it worked for me


Is there an android emulator for Ubuntu 14.04?

Genymotion (source of this answer; website also has some images on how this looks) is a complete set of tools that provides a virtual environment for Android. It can be very useful for developers, testers, salesman or even gamers. Genymotion is free for personal use. For full features, you need to buy a license.

Features:

OpenGL acceleration to achieve the best 3D performance
Enable full screen option and improve your experience
Be precise in your UI development with the “pixel perfect” functionality
Start multiple virtual device at the same time
Override virtual device identifiers
Directly command virtual devices sensors with Genymotion Shell
Fully compatible with ADB. You can control your virtual device from the host
Manage sensors: Battery level / status, GPS, Rotation, Camera

Since 2.1:

supports copy/paste from the host to the virtual device,
  or from the virtual device to the host using Android builtin copy/paste feature.
Android 4.4 support

You need virtualbox, have to register (it is free) and download the installer to your downloads directory and then ...

cd ~/Downloads/
chmod +x genymotion-2.1.0_x64.bin
./genymotion-2.1.0_x64.bin

If you install it in Downloads you start it with:

/home/handbook/Downloads/genymotion/genymotion

It is free for personal usage and to me seems to be the better one amongst all the emulators.


Could not find valid key in user session keyring for sig specified in mount option after upgrade from 16.04 to 18.04

It looks like this bug first reported in Ubuntu 17.10: ecryptfs-mount-private fails to initialize ecryptfs keys
The error there is like your own:
[ 1265.695388] Could not find key with description: [<correct key ID>]
[ 1265.695393] process_request_key_err: No key
[ 1265.695394] Could not find valid key in user session keyring for sig specified in mount option: [<correct key ID>]
[ 1265.695395] One or more global auth toks could not properly register; rc = [-2]
[ 1265.695396] Error parsing options; rc = [-2]

You should subscribe to the bug report and make sure you mark it affects you too.
Read the messages posted by other users. There are solutions that work for some and not others.


Change Gnome panel icons to oversized faded style?

Solved it by accident.  After being frustrated with high cpu usage and overheating, I downgraded my Ubuntu Gnome installation from 16.04 to 14.04.  It seems the style that I wanted and preferred is the old style, and the new ones are the small regular icons.

I expected the style I was looking for to be a newer one since it seems more modern and looks much better, but I was wrong.

I am now using Ubuntu 14.04 with Gnome Shell 3.10, with pretty icons, a cool CPU and an OS that suspends properly out of the box

Actual screenshot:


How can I find the location of an icon of a launcher in use?

Most of the time, the icon will be chosen from your current icon theme, rather than being referred to as an absolute path.

Open Gedit

Drag the launcher into the Gedit window

Look for the Icon definition:
Icon=gnome-panel-launcher

You can then find the icon somewhere in /usr/share/icons, depending on your theme.
Here's a quick python script that finds the correct icon path for you:
import gtk

print "enter the icon name (case sensitive):"
icon_name = raw_input(">>> ")
icon_theme = gtk.icon_theme_get_default()
icon = icon_theme.lookup_icon(icon_name, 48, 0)
if icon:
    print icon.get_filename()
else:
    print "not found"

Save it somewhere and run python /path/to/script.py.
It'll look like this:
stefano@lenovo:~$ python test.py
enter the icon name (case sensitive):
>>> gtk-execute
/usr/share/icons/Humanity/actions/48/gtk-execute.svg

Alternatively, you can just rummage around in /usr/share/icons until you find the icon you're looking for.

Much easier: you can just copy and paste the launcher and change the name and command

EDIT 2018
Updated version of the script above:
#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

icon_name = input("Icon name (case sensitive): ")
icon_theme = Gtk.IconTheme.get_default()
icon = icon_theme.lookup_icon(icon_name, 48, 0)
if icon:
    print(icon.get_filename())
else:
    print("not found")


I could find an answer to solve my problem in here. Cannot connect to PostgreSQL server. The issue was pg cluster wasn't initiating.

sudo pg_ctlcluster 9.5 main start - will tell whether cluster is running
Then if it gives any errors you can view them using journalctl -xe
It shown me the error as "DETAIL:  File must have permissions u=rw (0600) or less if owned by the database user, or permissions u=rw,g=r (0640) or less if owned by root.". Then Once I changed the permission of the private key file, problem solved


Software Raid0 doesn't mount successfully in fstab

Did you remember to run update-initramfs after assembling the array as md0? if not, try stopping and re-assembling the array again and then doing so, i.e.

sudo mdadm --stop /dev/md127
sudo mdadm --assemble /dev/md0
sudo update-initramfs -u

This should make the initial root filesystem 'aware' of the array at boot time


cd ~
sudo chown -R $USER:$USER .*

The -R will do all dirs and files in dirs.
The . will alter only hidden files (since those always start with a .).
The $USER needs no changing: it will be substituted to your username.


Create a user on the server:

sudo adduser --no-create-home --disabled-password --disabled-login sambausername

Add that user to samba (you'll be asked to type a password):

sudo smbpasswd -a sambausername

Create a share by editing /etc/samba/smb.conf. For example, you can add something like this to the bottom:

[share name]
    comment = whatever
    path = /path to share
    browsable = yes
    read only = no
    guest ok = no

Now is a good idea to restart samba:

sudo service smbd force-reload

Go to the client machine and try to access the share with the username and password you've just set up.


General: Noto Sans 10pt
Fixed width: Hack 9pt
Small: Noto Sans 8pt
Toolbar,Menu,Window title: Noto Sans 10pt


VLC can't take snapshots anymore due to corrupt VDPAU video surface error

Answering myself.

The option at Preferences->Video->Use Hardware Acceleration controls how graphics are drawn on screen, not how videos are decoded. The option to disable VDPAU is at Preferences->Input & Codecs. Then look for "Hardware accelerated decoding" and change VDPAU for any of the other options, I'm using X11 VA-API.

And problem solved. I can take snapshots again. I will remain with Hardware decoding disabled until the problem is fixed, probably at the side of the VDPAU driver library (just guessing). No perceptible lag while playing videos so far.


Unfortunatly this is an old known bug in Ubuntu without workaround since version 15.04+
This is the bug report: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1113420 If you have the same problem mark you as an affected user too, so hopefully someone will fix it before we give up using Ubuntu.


How can I find all the possible cron settings?

It is mentioned in the man page, you just need to look at the right one.

From man 5 crontab:

By  default,  cron will send mail using the mail "Content-Type:" header
of "text/plain" with the "charset=" parameter  set  to  the  charmap  /
codeset  of the locale in which crond(8) is started up - ie. either the
default system locale, if no LC_* environment variables are set, or the
locale  specified  by  the LC_* environment variables ( see locale(7)).
You can use different character encodings for mailed cron job output by
setting  the  CONTENT_TYPE  and  CONTENT_TRANSFER_ENCODING variables in
crontabs, to the correct values of the mail headers of those names.

Now you might ask how do i know which one to look at. Well, from man man :

  The table below shows the section numbers of the manual followed by
  the types of pages they contain.

   1   Executable programs or shell commands
   2   System calls (functions provided by the kernel)
   3   Library calls (functions within program libraries)
   4   Special files (usually found in /dev)
   5   File formats and conventions eg /etc/passwd
   6   Games
   7   Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
   8   System administration commands (usually only for root)
   9   Kernel routines [Non standard]


Low-graphics mode error in 13.04 with no graphics card

Try to run this command: cd /etc/X11/ and run this command sudo cp xorg.conf.failsafe xorg.conf now reboot your system


Automating use of dd in a bash script with a day of month variable

Use date +FORMAT to get the current day (FORMAT would be %d in your case) and command substitution ($(...)) to build it into your command:
sudo dd bs=64K if=/dev/sda2 | gzip > /mnt/backup/backup_sda2_$(date +%d).img.gz

Note, that %d is zero-padded:

%d - day of month (e.g., 01)

Note, that this will backup the whole sda2 partition including empty space. There are surely better options, e.g. Ubuntu's Déjà Dup tool (a.k.a. "Backups"), which is doing incremental backups.


This is a current bug, see here  for info, workaround
https://bugs.launchpad.net/ubuntu/+source/ubuntu-keyring/+bug/1920640


Why is grub updating menu.lst, but not grub.cfg?

Check if grub-legacy or grub-legacy-ec2 managed to get installed at some point. If they did, they are updating the old config menu.lst, but your boot sector is starting up grub2 and looking at grub.cfg for it's list.

To fix this, simply reinstall grub2:

sudo apt-get install grub2
sudo update-grub

Then ls -l /boot/grub/grub.cfg should show a modified date of today.

Test a reboot during an appropriate maintenance window to assure it is still functioning properly.


How to work remotely on Ubuntu from another Ubuntu [14.04.3]?

You can use VNC which can be installed (server version) on the remote computer.
Meanwhile, I would recommand you setting an SSH tunnel, since VNC is all but secure !

Teamviewer also supports Linux. There is a free version, which works great on Ubuntu and Windows computers (both ways !)


How to tell if graphics processing in Ubuntu is utilizing hardware acceleration

Try the following command if you're running Unity:

/usr/lib/nux/unity_support_test -p

It will tell you if you're using a Software renderer.


apt purge/remove is not freeing up all of the space that it should

This is because Desktop Environments like Cinnamon tend to be a compilation of a lot of different programs, like file managers, terminal emulators, web browsers, etc.

After you use sudo apt-get remove cinnamon you need to also use

sudo apt-get autoremove

To remove all the packages that are no longer needed.


You cannot run it as non-root because it requires root privileges. The log files say Permission denied which mean the program does noto have permission to create directories unless they are root


Synchronising Cut-and-Paste Activities in Ubuntu One

At the moment Ubuntu One does re-upload files on move, which I agree is not great. There's no other way to cut and paste without triggering this.

We are fixing this for Natty, I expect the fix to land within the next 2 months along with many more performance improvements.


Info
The feature to save session has been removed in Ubuntu 12.04 because of a bug.

First
I have made a workaround that is a script that helps to configure your session. Just paste the command below at terminal and press Enter.

This if you are using Metacity (Unity-2d):

cd ~/ && wget -c http://dl.dropbox.com/u/4098082/session.meta.config && chmod +x ~/session.meta.config && ~/session.meta.config

.

Or this if you are using Compiz (Unity-3d):

cd ~/ && wget -c http://dl.dropbox.com/u/4098082/session.config && chmod +x ~/session.config && ~/session.config

You can view the code of script (1, 2). There are explanations in each part. It will create a startup script which will move to each viewport (or desktop) and open the specified application.

Removing

To remove any changes made by my script just delete this files (if they exists):

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

Or run this at terminal:

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

Second
There are others workarounds like TuxOnIce:

"TuxOnIce is most easily described as the Linux equivalent of Windows' hibernate functionality, but better. It saves the contents of memory to disk and powers down. When the computer is started up again, it reloads the contents and the user can continue from where they left off. No documents need to be reloaded or applications reopened and the process is much faster than a normal shutdown and start up."

See it working here.

You can install it through "tuxonice/ppa":
1) Add the ppa: sudo apt-add-repository ppa:tuxonice/ppa
2) Update: sudo apt-get update
3) Install sudo apt-get install tuxonice-userui linux-generic-tuxonice linux-headers-generic-tuxonice

Third
A third idea is to set Compiz to launch windows in selected viewports:

1) Install CompizConfig-Settings-Manager,

2) Open Alt + F2 and type ccsm and hit Enter,

3) Go to "Place Windows"

4) Select "Fixed Window Placement" > "Window with fixed viewport" > "New"

5) Select the window by class, id, title, name, type or role and set the viewport it should be placed:

6) Now add your apps to "Startup Applications" (press Super and type Startup Applications)


Cannot start Intellij on Ubuntu 14.04 with JDK 1.8

I ran into a similar problem when I uninstalled OpenJDK, and installed the latest JDK from Oracle. You'll need to change the JDK IntelliJ is configured to use. Check out this post for how to do that: https://stackoverflow.com/questions/18987228/how-do-i-change-the-intellij-idea-default-jdk

It worked like a charm for me.


The gparted partition editor, asks you to select a partition table, (importantly!) don't use the default when it shows an WARNING message, select Advanced and choose GPT (rather than the default MSDOS).

The MSDOS partition table has a maximum partition length (2.2TB):

  Create Primary Partition #1 (ntfs, 2.73 TiB) on /dev/sdd  00:00:00    ( ERROR )

  create empty partition  00:00:00    ( ERROR )
  libparted messages    ( INFO )

  partition length of 5860530176 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295

The GPT's maximum is 9.4ZB, since this is larger than 3TB you should no longer get this error.


Type alsamixer in terminal and then look for "MONO" (keep pressing left until you find it)

Press M to unmute it and Up or Down keys to change the volume.

(I have an Optiplex as well)


AMDGPU-PRO driver doesn't support Ubuntu 17.10

From this AMD tech support website an employee named Matt says:

  We don't support Ubuntu 17 yet in the latest AMDGPU-Pro, use 16.04.03
  and Kernel 4.10 and Xorg 1.19.

Install AMDGPU-PRO Linux driver under Ubuntu 16.04

From the AMD website instructions for installing under Ubuntu 16.04 are listed:

Edit /etc/default/grub as root and modify GRUB_CMDLINE_LINUX_DEFAULT in order to add "amdgpu.vm_fragment_size=9" (without the quotes). The line may look something like this after the change:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amdgpu.vm_fragment_size=9"
Update grub and reboot as root:

update-grub;reboot

Your card is verified as AMDGPU-PRO compatible

The AMDGPU-Pro Driver is compatible with the following AMD products.

AMD Product Family Compatibility

Radeon™ RX Vega Series Graphics             AMD Radeon™ Pro WX-series
Radeon™ Vega Frontier Edition               AMD FirePro™ W9100
Radeon™ RX 550/560/570/580 Series Graphics  AMD FirePro™ W8100
AMD Radeon™ RX 460/470/480 Graphics         AMD FirePro™ W7100
AMD Radeon™ Pro Duo                         AMD FirePro™ W5100
AMD Radeon™ R9 Fury/Fury X/Nano Graphics    AMD FirePro™ W4300
AMD Radeon™ R9 380/380X/390/390X Graphics   AMD FirePro™ W4100
AMD Radeon™ R9 285/290/290X Graphics        AMD FirePro™ W2100
AMD Radeon™ R7 240/250/250X/260/260X/350    AMD FirePro™ W600
AMD Radeon™ HD7700/7800/8500/8600           AMD FirePro™ S-Series
AMD Radeon™ R9 360 Graphics                 AMD Radeon™ Pro WX 9100
AMD Radeon™ R5 340


Try this:

Boot the computer from Ubuntu.

Open a terminal,Press Ctrl+Alt+T

You must determine whether your system was booted in EFI or in BIOS mode.

Run it:

sudo ls /sys/firmware

If the system was booted off of EFI, the /sys/firmware/efi directory exist, like this:

acpi  memmap efi

If the /sys/firmware/efi directory does not appear, it was booted off of BIOS.

If your system was booted in EFI mode continue running:

sudo apt-get update
sudo apt-get install --reinstall grub-efi

If your system was booted in BIOS mode continue running:

sudo apt-get update
sudo apt-get install grub-pc grub-pc-bin grub-common grub2-common
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo grub-install --recheck /dev/sda

Once reinstalled Ubuntu Grub, load gparted running:

sudo gparted

Delete the Mint partition using GParted, create a new partition ext4 file system in free space, close it and continue running:

sudo update-grub
sudo reboot

Boot the computer and mount the partition where suits you, /media/data, /home/user/data, /home/user/documents, etc.

Give permission to work on it:

Open a terminal,Press Ctrl+Alt+T

To create a mount point /media/data and give permission run:

sudo mkdir /media/data
sudo chmod -Rf 777 /media/data

To mount the partition permanently run:

sudo fdisk-l #To know how is called the partition, say it /dev/sda5
sudo blkid # To know how is UUID of the partition
sudo nano /etc/fstab

In te open file paste de following:

#/media/data was on /dev/sda5
UUID=what_reported_blkid /media/data ext4    defaults        0       2

Change the data for their own, Ctrl + O, save file. Ctrl + X, close nano.


No archiving/compressing tool in Dolphin context menu (Kubuntu 15.10)

I was missing 'extract' and 'compress' in Dolphin under Ubuntu 16.04 (not Kubuntu!) and fixed it by installing Ark:

sudo apt-get install ark


SD card is recognized but can't open it: “can't read superblock”

First: if you need to save the data on the SD card make an image of the entire sd with dd before trying to fix it so you can always restore it later.

sudo dd if=/dev/mmcblk0 of=/home/sdCard.img

Then try to fix it with fsck.

sudo fsck /dev/mmcblk0

Hope it helps.


Is there a Meter to indicate current Network Activity to the xfce4-panel

The command

ip link show

gave me an overview about the network adapter names of my computer.

From observing results of ip link show with the LAN pluged/unplugged and the WLAN enabled/disabled, I concluded that in my case enp0s25 designates my LAN adapter and wlp3s0 designates my WLAN adapter.

But the sampling time of 0.25s was a bit too short. Setting it to 1 second made the activity bar show up when I let firefox show a Bing map. One should set the upper scale ends for incoming and for outgoing traffic to what one expects. I tried it with 50 KiB/s incoming, 1 KiB/s outgoing because in most cases my question is: "is there any network activity".

It would be nice if the scales could be made logarithmic (however since the logarithm of 0 is -Infinty, clipping off all network activity below one packet per sampling)!

It is possible to place e.g. two instances of Network Monitor: one for WLAN, the other for LAN. I called them W and L. - Thank you, HattinGokbori87!


Try the following commands:

sudo apt-get clean
sudo apt-get update
sudo apt-get -f install

If that fails you will have to try running

sudo dpkg --remove --force-remove-reinstreq package

You will have to run that for each package that is giving you an error, for example

sudo dpkg --remove --force-remove-reinstreq liblockfile1
sudo dpkg --remove --force-remove-reinstreq liblouis-data

and on, one by one.

Then again

sudo apt-get -f install


How can I install avant window navigator in 12.10?

It has been dropped from Quantal:
source

Some applications including Avant Window Navigator behave erratically.
AWN has been dropped from Ubuntu as it is unmaintained and no longer builds from source with current versions of vala.

You can install the 12.04 version from here
In case you need dependencies find it from here
However - given the warning from Jeremy Bicha and the original OP - the advise is to switch to another dock such as Docky


How to start games in Steam running on Wine?

If a Steam game is able to run with Wine, and you're running the Windows version of Steam with Wine, then yes, double-clicking on the game in your game library or pressing Play will (attempt to) run the game with Wine.

This is really an instance of a more general question: What happens when a Windows program running with Wine tries to launch another Windows program; does Wine try to run that, too?

The answer is yes. Wine supports the parts of the Windows API that Windows programs use to launch new processes.

With that said, it is possible that you could have some Windows Steam game that only sort of works with Wine on Ubuntu and requires special steps to launch. In that case, you might have to do something different from just launching the game in your Steam games library. But what you'd have to do would be particular to the specific problems running the game. In general, to run a Windows Steam game from the Windows version of Steam in Wine, clicking Play is the way to do it.


I had the same trouble with an NVMe disk. That technology is quite recent and the old version of GParted in Ubuntu repo couldn't see my SSD. I resolved creating a GParted live USB with the latest version of the software.


How do I retrieve my files if mounting gives me a "bad superblock" error?

Linux partitions have a backup of the superblock.

Try typing sudo dumpe2fs /dev/sda1 | grep superblock

You should get something like this:

 Primary superblock at 0, Group descriptors at 1-6
  Backup superblock at 32768, Group descriptors at 32769-32774
  Backup superblock at 98304, Group descriptors at 98305-98310
  Backup superblock at 163840, Group descriptors at 163841-163846
  Backup superblock at 229376, Group descriptors at 229377-229382
  Backup superblock at 294912, Group descriptors at 294913-294918

Try repairing the partition using the backup superblock:

sudo fsck -b 32768 /dev/sda2

Only run this and other fsck commands while your file system is unmounted. Make the necessary changes to the block number according to your dumpe2fs output.

When it's ready, try mounting again. Hope this helps.

Source: Linux: Recover Corrupted Partition From A Bad Superblock