How to get a different Unity Launcher with different icons on each workspace?

Setting a different Unity Launcher per workspace:

1.  2.  3.  4.

The solution below makes it easily possible to have a different set of launcher icons per workspace, no matter how many workspaces you have.

The setup includes two parts:

A (one) shortcut key combination to "remember" the set of launcher icons for the current workspace.
A script to run in the background, keeping track of what is the current workspace and setting the corresponding Unity Launcher. It acts whenever the user switches workspace.

How it works

Two small scripts are involved:

The first script does one simple thing: it writes the contents of the current launcher into a (hidden) file in your home directory, named (numbered) after your current workspace.

The second script keeps an eye on what is the current workspace. If there is a workspace change, the script sees if a corresponding (launcher-) datafile  exists (created by the first script). If so, it reads the file and alters the Unity Launcher, as remembered in the file.

That's it.

How to set up

The script needs wmctrl to be installed:

sudo apt-get install wmctrl

Create a directory in which both scripts will be stored. It is importants that both scripts are kept together in one directory, since they share functionality and one imports from the other. For the same reason, it is important that you name them exactly as indicated below.
Copy each of the scripts below into a (different) empty file, save them into the directory (created in 2.), exactly named as:

set_workspace.py

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

workspace_data = os.environ["HOME"]+"/.launcher_data_"
key = ["gsettings get ", "gsettings set ", "com.canonical.Unity.Launcher favorites"]

def get_res():
    # get resolution
    xr = subprocess.check_output(["xrandr"]).decode("utf-8").split()
    pos = xr.index("current")
    return [int(xr[pos+1]), int(xr[pos+3].replace(",", "") )]

def current():
    # get the current viewport
    res = get_res()
    vp_data = subprocess.check_output(["wmctrl", "-d"]).decode("utf-8").split()
    dt = [int(n) for n in vp_data[3].split("x")]
    cols = int(dt[0]/res[0])
    curr_vpdata = [int(n) for n in vp_data[5].split(",")]
    curr_col = int(curr_vpdata[0]/res[0])+1; curr_row = int(curr_vpdata[1]/res[1])
    return str(curr_col+curr_row*cols)

def remember_current():
    currlauncher = subprocess.check_output(["/bin/bash", "-c", key[0]+key[2]]).decode("utf-8").strip()
    f = workspace_data+current()
    open(f, "w").write(currlauncher)

if __name__ == "__main__":
    remember_current()

launcher_perworkspace.py

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

workspace_data = set_workspace.workspace_data
key = set_workspace.key

def check_datafile(desktop):
    f = workspace_data+str(desktop)
    try:
        new_launcher = open(f).read()
        command = key[1]+key[2]+' "'+str(new_launcher)+'"'
        subprocess.Popen(["/bin/bash", "-c", command])
    except FileNotFoundError:
        pass

curr_dt1 = set_workspace.current()
check_datafile(curr_dt1)

while True:
    time.sleep(1)
    curr_dt2 = set_workspace.current()
    if curr_dt2 != curr_dt1:
        check_datafile(curr_dt2)
    curr_dt1 = curr_dt2

Add the first script (set_workspace.py) to a shortcut key combination of your choice: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:

python3 /path/to/set_workspace.py

Run the key combination and see if a file, like: .launcher_data_3 is created in your home directory. You will probably need to press Ctrl+H to make the file visible (files, starting with a . are invisible by default).

Navigate through your workspaces and repeat the procedure: set a combination of launcher icons, and press your key combination to "remember" the set for that specific workspace.
You're practically done now. Test-run the background script with the command (from a terminal window, keep it running):

python3 /path/to/launcher_perworkspace.py

If all works fine, and your launcher switches per workspace, add the following command to your Startup applications: Dash > Startup Applications > Add:

/bin/bash -c "sleep 15&&python3 /path/to/launcher_perworkspace.py"

Notes

If you want to alter the set of launcher icons for a specific workspace, simply navigate to the workspace, add/remove icons as you like and press your key combinbation (no need to restart the background script).
From the comment(s) I get the feeling there is some misunderstanding on the shortcut to remember the current Launcher for the current workspace. You only need one keyboard shortcut to "save" the current launcher for the current workspace. It will work exactly the same, no matter what workspace you are on. The script itself will determine what is the current workspace.

Edit

From your comment, I understand that you are unsure to run the script(s) and you are afraid you will mess up your current launcher.

I am pretty sure that is too much (or too little :)) respect for what the script is doing. However, you can simply backup yor current Unity Launcher with the command:

printf 'gsettings set com.canonical.Unity.Launcher favorites "' > ~/launcher_output&&printf "$(gsettings get com.canonical.Unity.Launcher favorites)">>~/launcher_output&&printf '"'>>~/launcher_output

This will create a file ~/launcher_output, containing the complete command to restore your Unity Launcher to the initial situation. In case of emergency, simply copy the file's content and paste it in the terminal.

But again, it is really unlikely you will mess up your launcher, unless you change the script manually.

IMPORTANT EDIT (2)

As requested in a comment, hereby a version that runs without having to use any shortcut combination; just run the script and start setting up your launchers on the specific workspaces. The script will create (invisible) files in your home directory, to remember your set of (Unity-) launchers on the different workspaces.

I tried this in "version 1" of the script, but always "embedding" the two launcher-checks between two workspace-checks turned out to be the trick to prevent unwanted behaviour (saving incorrect data) when moving quickly through the workspaces.

How to use

Like the first version, this script uses wmctrl:

sudo apt-get install wmctrl
Copy the script into an empty file, save it as launcher_toworkspace.py
Run it with the command:

python3 /path/to/launcher_toworkspace.py

If it works as expected, add the following command to your Startup Applications:

/bin/bash -c "sleep 15&&python3 /path/to/launcher_toworkspace.py"

The script

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

datadir = os.environ["HOME"]+"/.config/lswitcher"
if not os.path.exists(datadir):
    os.makedirs(datadir)
workspace_data = datadir+"/launcher_data_"

key = [
    "gsettings get ",
    "gsettings set ",
    "com.canonical.Unity.Launcher favorites",
    ]

def get_launcher():
    return subprocess.check_output(
        ["/bin/bash", "-c", key[0]+key[2]]
        ).decode("utf-8").strip()

def get_res():
    # get resolution
    xr = subprocess.check_output(["xrandr"]).decode("utf-8").split()
    pos = xr.index("current")
    return [int(xr[pos+1]), int(xr[pos+3].replace(",", "") )]

def current():
    # get the current viewport
    res = get_res()
    vp_data = subprocess.check_output(
        ["wmctrl", "-d"]
        ).decode("utf-8").split()
    dt = [int(n) for n in vp_data[3].split("x")]
    cols = int(dt[0]/res[0])
    curr_vpdata = [int(n) for n in vp_data[5].split(",")]
    curr_col = int(curr_vpdata[0]/res[0])+1
    curr_row = int(curr_vpdata[1]/res[1])
    return str(curr_col+curr_row*cols)

curr_ws1 = current()
currlauncher1 = get_launcher()

while True:
    time.sleep(1)
    currlauncher2 = get_launcher()
    curr_ws2 = current()
    datafile = workspace_data+curr_ws2
    if curr_ws2 == curr_ws1:
        if currlauncher2 != currlauncher1:
            open(datafile, "wt").write(currlauncher2)
    else:
        if not os.path.exists(datafile):
            open(datafile, "wt").write(currlauncher2)
        else:
            curr_set = open(datafile).read()
            command = key[1]+key[2]+' "'+str(curr_set)+'"'
            subprocess.Popen(["/bin/bash", "-c", command])
    curr_ws1 = curr_ws2
    currlauncher1 = get_launcher()

Note

If you set up your workspaces with the previous version of the script, they should also work for this version.

PPA

As per 2015-04-23, the nice question of Dennis J, and the encouragement of Parto, have lead to creating a ppa for the script, covered on webupd8, including a GUI to manage it.

ppa:vlijm/lswitcher

To install it, run:

sudo add-apt-repository ppa:vlijm/lswitcher
sudo apt-get update
sudo apt-get install lswitcher

Since now, it is packaged for Trusty & Utopic. I will add others after testing. I will also add a .deb installer, but I'd suggest using the ppa, since usually this kind of things is updated every now and then.

Since the location of the viewport data has changed from ~/ to ~/.config/lswitcher, you'll have to set up your Unity Launcher again if you used the previous script.


How can I remove ImageMagick from Ubuntu Unity Dash?

Application entries are usually stored in /usr/share/applications/. You could view the contents of that folder, and then remove individual entries (or, a better solution, rename them to have a different extension). Here's an example (in this case I hide and unhide Chromium - the commands would be similar for ImageMagick).

To hide:

 cd /usr/share/applications
 sudo mv chromium-browser.desktop chromium-browser.desktop.hidden

And, to unhide:

 cd /usr/share/applications
 sudo mv chromium-browser.desktop.hidden chromium-browser.desktop

Hope this helps.


You want to make Caps Lock work like Shift, so you can set the behavior to the third one.


Change partition sizes after windows removal?

I can really recommend gparted, at their homepage you can download a live-cd or live-usb image that can do it all in a nice easy to use gui tool. You have to boot from some live disk since you cant resize a partition that is already mounted.

There is some generel documentation/guide to gparted here


Battery shows charging then wall then charging then wall

Cellphones exhibit this same behaviour. It lets the battery drain some then recharges. Phones have a built in "glitch" (not the best word but it gets the point across) that still shows 100% during the top 10% or so, the. It will reach 99% after that and then starts dropping and evens out along the way.

As to why it is not still, my guess would be that the previous kernel had a fix for this and the next one either removed it or (more likely) has an error/glitch with it. Have you tried updating to 19? I have not had this issue.


I'm not sure why this isn't working for you, but here's what does work on my machine...

As you can see below, I am able to save the output to a variable and then echo the contents of that variable.

user@machine:~$ out=$(/usr/lib/command-not-found abc 2>&1)
user@machine:~$ echo "$out"
No command 'abc' found, did you mean:
 Command 'cbc' from package 'coinor-cbc' (universe)
 Command 'nbc' from package 'nbc' (universe)
 Command 'axc' from package 'afnix' (universe)
 Command 'bc' from package 'bc' (main)
 Command 'atc' from package 'bsdgames' (universe)
 Command 'ajc' from package 'aspectj' (universe)
 Command 'abe' from package 'abe' (universe)
 Command 'ab' from package 'apache2-utils' (main)
 Command 'asc' from package 'asc' (universe)
 Command 'aec' from package 'libaec-tools' (universe)
 Command 'arc' from package 'arcanist' (universe)
 Command 'arc' from package 'arc' (universe)
 Command 'abx' from package 'abx' (universe)
 Command 'alc' from package 'amule-utils-gui' (universe)
 Command 'ac' from package 'acct' (main)
abc: command not found


cannot ssh to raspberry pi 400 with ubuntu server 20.10

Use cmd to ssh to the machine. terminus is a gives an error. I don't know how it got fixed


Huawei USB modem - proper driver(module) is not loading

I got my modem working in Ubuntu Studio 16.04

In Ubuntu Studio 12.10, I installed huawei driver and it worked without any additional tweak.
In Ubuntu Studio 15.10, it just worked right after I plugged it. I didnt do anything to get it work.
In Ubuntu Studio 16.04, I did the simple steps of usb_modeswitch and modprobe to get it work. There are a number of articles and questions in forums about this. But still I want to mention how I did it and in a really detail manner. It involves three simple steps as follows,

Before trying out the following steps, find out whether you have a driver for your device given by the manufacturer. for Huawei, the driver is so old and so you may follow the steps below.

Step 1: Finding whether your device is detected

Find whether your USB is detected using lsusb and usb-devices commands,

If the result shows your modem in the list, see how many interfaces(If#) it has in the usb-devices command, listed with one line for each interface, beginning with an I:.

If it has only one interface(If#) line, that has a class specification of 'Cls=08(stor.)', then its in USB-flash drive mode. You have to switch it to modem mode using the next step.

If its not listed, then your modem is faulty or has some issues.

Step 2: usb_modeswitch for switching into 'modem mode'

1)substep:

First update usb-modeswitch and usb_modeswitch-data:

If you can manage to get internet somehow, for updating you can use these commands in the terminal:
    sudo apt-get install usb-modeswitch usb-modeswitch-data

or

Download using 'Synaptic Package Manager' and install offline :

You can use any other computer with Ubuntu and internet connection. Open synaptic packet manager and type usb-modeswitch in search field and in the result mark both the packages. And while you do that, it will ask whether to mark related dependency packages. click 'Mark'. Then go to file and click 'Generate Package Download Script' and select the directory you want to save the script and give the script a name like 'deblist' and save. Then go to the script's directory. open a terminal there and type,

bash ./deblist

This will download the packages to the same directory as the script. Copy the directory to your computer and install them by opening a terminal in the same directory and typing

sudo dpkg -i package1.deb package2.deb package3.deb

Where the package1.deb, package2.deb, package3.deb and so on.., should be replaced with the names of the downloaded packages. This should install the packages. The steps above are generic for any software.

2)substep:

Then create a file named 12d1:1446 in the /etc/usb_modeswitch.d/ directory as the super user with the touch command.

sudo touch /etc/usb_modeswitch.d/12d1:1446

'12d1'is the Huawei 'vendor id' and '1446' is the 'unswitched product id' for my device and this can be obtained from the above lsusb or usb-devices commands for your device.

3)substep:

Then for switching into Modem mode, open a terminal and type

sudo usb_modeswitch -v 0x12d1 -p 0x1446 -J

usb_modeswitch command should include a switching method/message. Here the switching method is specified by -J and this is the standard Huawei switching method. It varies with different device manufacturers. Type man usb_modeswitch in the terminal for more information.

Now type usb-devices in the terminal and you should now see a new 'product id' and many interfaces(If#) for your device listed. Most of interfaces(If#) should be using the 'option' as driver. Some of these interfaces are used for internet connection and most of the time, the one used for connection has different driver like 'huawei_cdc_ncm'.

Now try connecting to the internet by setting up a 'Mobile Broadband Connection' using the 'Network Manager' of Ubuntu. If it is connected, then your job is done. but if it is not, then you may proceed to the next step.

Step 3: Getting the driver loaded

You can see what driver your mode switched modem is using from usb-devices command.

1)substep:

If it shows 'option' as driver for all the interfaces(If#), except for the ones used as usb-storage, proceed to the substep 2 given below (or) If is shows 'huawei_cdc_ncm', go to /lib/modules/(uname -r)/kernel/drivers/net/usb/ by typing,

sudo thunar /lib/modules/(uname -r)/kernel/drivers/net/usb/

or

sudo nautilis /lib/modules/(uname -r)/kernel/drivers/net/usb/

and move the 'huawei_cdc_ncm' by the 'cut and paste method' in a any other directory, as a backup.

Now remove the device, replug it and type the usb_modeswitch command. In the usb-devices command result, you should see 'none' as the driver for the interface(If#) that is used as modem.

2)substep:

Now remove the device again and type the command,

sudo rmmod option

to remove the option driver from the kernel

Now replug the device and type the usb_modeswitch command. And still you should see 'none' as driver for modem and 'option' as driver for other interfaces(If#) in the usb-devices command result.

Now open the file /sys/bus/usb-serial/drivers/option1/new_id using nano:

sudo nano /sys/bus/usb-serial/drivers/option1/new_id

type 12d1 1506 and save it using ctrl+o and exit using ctrl+x. Here 1506 is the 'modeswitched product id'. Now if you type usb-devices, you should see 'option' as the loaded driver for the modem.

3)substep:

Now use the modprobe usbserial command to get the device working with the loaded 'option' driver.

sudo modprobe usbserial vendor=12d1 product=1506

Now try connecting the modem to the Internet. Mostly it should be connected but if it doesnt, then unplug and try doing the step 3 again. Still if it doesnt connect, sometimes the process of automating these commands can connect the modem to Internet.

Step 4: Automating

To automate this process, after finishing the step 1's substep 2, copy the following lines

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1446", RUN+="/usr/sbin/usb_modeswitch -v 12d1 -p 1446 -J"

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1446", RUN+="/bin/bash -c 'modprobe option && echo 12d1 1506 > /sys/bus/usb-serial/drivers/option1/new_id'"

to /lib/udev/rules.d/40-usb_modeswitch.rules using the command

sudo mousepad /lib/udev/rules.d/40-usb_modeswitch.rules

or

sudo gedit /lib/udev/rules.d/40-usb_modeswitch.rules

Dont forget to change the 'product id' in the above lines to your 'unswitched product id' after copying.
Now if you unplug the device and plug it again, it should be connected to the internet.

Even if it does work. Sometimes its connecting only after I unplug and plug it again, after I boot the system. I think it is taking some time to load the 'option' driver.


Open a terminal by pressing ctrl+alt+t then use the following command to uninstall:

snap remove discord

For reinstalling it use:

snap install discord

If you want to know which snap packages you have installed use:

snap list


Mounting cifs share fails on boot but can be mounted by sudo, Ubuntu 17.10

Try to add parameter user to your string in /etc/fstab file: credentials=/home//.smbcredentials,iocharset=utf8,rw,uid=1000,gid=1000,nounix,_netdev,vers=3.0,x-gfvs-show,user

According to Ubuntu's official documentation by default only root user is allowed to mount as it is mentioned in the error message.


Whenever I plug my headphones, I hear static noises

Open alsamixer and zero out mic and mic-boost levels from sound card options (F6 in alsamixer menu).


I think your script hangs waiting for the first gnome-terminal command to finish.

Try to add a space then & at the end of each gnome-terminal line, so the shell will not wait there and continue.


Running Ubuntu Desktop in LXC/LXD on top of Ubuntu Server

Yes it is possible with LXD.

I have my custom LXD Image server. Please do the following:

sudo lxc remote add codedream lxdimage.codedream.ml --public
sudo lxc launch codedream:ubuntu1604-kodhe-xfcedesktop my-desktop -c "security.privileged=true" -c "security.nesting=true"

Or if you prefer unity desktop:

sudo lxc remote add codedream lxdimage.codedream.ml --public
sudo lxc launch codedream:ubuntu1604-kodhe-unitydesktop my-desktop -c "security.privileged=true" -c "security.nesting=true"

Also now have ukui:

sudo lxc remote add codedream lxdimage.codedream.ml --public
sudo lxc launch codedream:ukui my-desktop -c "security.privileged=true" -c "security.nesting=true"

After, install NoMachine, and connect to lxd container by IP and port 4000. Username=kodhe, Password=1. To view IP:

sudo lxc list my-desktop


In the hopes that this is still relevant, if not for you then for somebody else:

I personally have a T440p and I am using an UltraDock with 90W power supply. I cannot tell anything about the Dell model.

Dock display support

You are required to install a firmware update for the dock using Windows, to make the dock display work with Linux. There is a patch on the way to make the dock compatible even with the older, buggy firmware.

One (1!) external monitor works fine connected to the dock. You can NOT use more than one, as the proper support for Display Port Multi Stream Transport hubs is missing in Linux. When connecting multiple monitors to the dock, the output is cloned on all of them.

However, you can add an additional monitor by connecting it via VGA to the notebook directly. You would have to plug that manually. when un/docking.

Dock audio support

You need to do some fixing to make the docking station audio jack work.

Dock USB support

No issues.

Other (Linux) issues

More info is well documented in a github wiki page of user leoluk.


Remove user and hostname from Gnome Terminal window title?

This is pretty easy to do:

Open your Terminal (if it's not already open)

Open your .bashrc file

Find this section:
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

Remove \u@\h:

Save the file, and restart Terminal.


I struggled with the keyboard back light issue on a 2011 Macbook pro, I installed radeontool which solved the issue F4 &F5 now perform correctly.

sudo apt-get install radeontool


Do patching an installed PHP package have side-effects?

You can go ahead and patch it manually, but when the php-gettext package gets updated for any reason whatsoever, your changes will be overwritten. Apt will ask about changes to configuration files, but it simply doesn't care about any other changes (and files in /usr typically won't be marked as configuration files).

So, no, it won't affect upgrades, but you'll need to be re-apply the changes when upgrading if the new version doesn't fix the problem.


I have no idea what abuntu is, but i suppose that answer is no.
Programs from Windows are different to one from Ubuntu, but you can use Wine - Windows emulator for Ubuntu. You can create another partition for Ubuntu and use these systems both, as well you can run windows apps on linux by Wine and starting them from Windows OS partition. Only one thing to do here is to install Ubuntu next to Windows and mount your NTFS Windows partition in Ubuntu.

I hope it helped :)


You should report a bug on the synergy tracker.


Unable to install Jenkins on Ubuntu 18.04 due to Java incompatibility

I had the same issue.

Info in repositories is not right.

If you follow logs you'll find the version you're installing is an archive. For me it was u191 today: 2019/01/16 but on website it's u201 or u202.

you have to change your repo info like this:

cd /var/lib/dpkg/info
sudo sed -i 's|JAVA_VERSION=8u191|JAVA_VERSION=8u201|' oracle-java8-installer.*
sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/|PARTNER_URL=https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/|' oracle-java8-installer.*
sudo sed -i 's|SHA256SUM_TGZ="53c29507e2405a7ffdbba627e6d64856089b094867479edc5ede4105c1da0d65"|SHA256SUM_TGZ="cb700cc0ac3ddc728a567c350881ce7e25118eaf7ca97ca9705d4580c506e370"|' oracle-java8-installer.*
sudo sed -i 's|J_DIR=jdk1.8.0_191J_DIR=jdk1.8.0_201|' oracle-java8-installer.*

Information is on Oracle's download website.

See answers to Can't install Oracle Java 8 in Ubuntu 16.04


Ubuntu 12.04 unstable Display, Flickering

A simple solution would be Gnome-Tweak-Tool, also known in the software center as "Advanced Settings". Now you may use this to change the font size affecting the software center, however unfortunately all other applications as well. A recommended way to preform the font change would be to open the settings, change the font size, and then when done with the software center, return it to it's original form, or however you prefer it. If you can't get the application from the software center, due to the small size of the font just paste the following into your terminal -

sudo apt-get update
sudo apt-get install gnome-tweak-tool

Or, click the button below to install for Ubuntu!

Here is what Advanced Settings should appear as, simply click the font size next to the default font to make changes.

Well, you don't really want to mess with the other settings I'm assuming, (Graphics Drivers, or Screen Resolution) But, just to voice other solutions, you could start by seeing if this is the graphics driver, I personally use the open source one because I have no other choice than binary blobs, or the screen resolution could be toned down to make the text appear larger...

Now, as if this wasn't already long enough, Mijyn here wrote a tutorial on resetting the x configuration settings. This could also fix screen flickering. To start, we want to:

Press "Ctrl + Alt + F3"

By doing this, you're opening a virtual console, the appearance may look like DOS, but essentially it's a terminal window, gone full screen with root access. It should ask you to log in, with your password. Now the password will not appear in the window, but don't worry, it's still registering.

sudo rm -f /etc/X11/xorg.conf
sudo rm -f xorg.conf*
sudo service lightdm stop
sudo service gdm stop
sudo service kdm stop
sudo service lxdm stop
sudo service xdm stop
sudo service wdm stop
sudo Xorg -configure
[ -f xorg.conf* ] && sudo mv xorg.conf* /etc/X11/xorg.conf
sudo dpkg-reconfigure $(dpkg -l | awk '{print $2}' | grep "^xserver" | tr '\n' ' ')
sudo update-initramfs -u

Now while this seems like a lot, you can copy and paste this into the virtual console, remember, the paste function when in terminal is "Ctrl + Shift + V" instead of the common "Ctrl + V" used pretty much everywhere else.

You'll now want to restart the computer. You can regain access to the desktop using "Ctrl + Alt + F7". This should reset the X configuration.

If you would like to view MiJyn's work, it is linked here.

Hope some of this can be of help!


Run shell script on startup (Xubuntu 20.04)

Depending on what DM (Display Manager) you are using will determine what the $DISPLAY is set to.  Since your script is actually running without a shell at the time of login, there is no $DISPLAY set.  To remedy this, you may want to add the following lines below the #!/bin/sh line in your script:
#Get Display Manger
DM=$(/usr/bin/basename $(/bin/cat /etc/X11/default-display-manager))

#Set Display based on DM and login type
case $DM in
    lightdm)
        export DISPLAY=:0;;
    gdm3)
        grep -E "# AutomaticLogin|AutomaticLoginEnable = false" /etc/$DM/*.conf >/dev/null && export DISPLAY=:1 || export DISPLAY=:0;;
    *);;
esac

Through testing I found that when I log into my system with LightDM, the Display has been always :0 regardless if automatic login or not.  But with GDM3 if you have automatic login setup it has been :0 but if you don't have automatic login it has been :1.  I run a script that launches Firefox automatically at certain times, and adding this to set the $DISPLAY has made it so Firefox has launched from the script without it running in a terminal at the time.
Hope this helps!


How to create a samba that is writable by me but read only to other users?

Samba permissions work like this: operation on file needs to be allowed by BOTH samba user permissions and by underlying filesystem permissions

set the permissions of the samba share to be readable by others (chmod -R o+r)
then give your user read write permissions in samba and the other user read only access. (it's quite straightforward from the samba config gui)

good luck!


I think the question isn't necessarily about the size of the update, but the number of packages.  If you frequently update your kernel to stay with current release, a list this long should not happen.  Specifically:

linux-image-3.0.0-13-generic linux-image-3.0.0-13-generic-pae
linux-image-3.0.0-14-generic linux-image-3.0.0-14-generic-pae
linux-image-3.0.0-15-generic linux-image-3.0.0-15-generic-pae
linux-image-3.0.0-16-generic linux-image-3.0.0-16-generic-pae
linux-image-generic          linux-image-generic-pae

It seems you've missed some kernel updates or you've recently installed from non-current live media.

EDIT:
Oops.  Those were all in the removed packages list.  Looks like you were trying to dist-upgrade to 12.04, which is not yet 'stable'.  Looks like:
a)I made a mistake.
b)You're question immediately becomes a 12.04 bug report and off topic.

As the question referenced in the comments notes, it should be larger than normal.  I look at the packages, not the size though.


The fact that you do not see eth0 in the ifconfig output, at all, indicates that the wired ethernet device is unprovisioned. Perhaps there was a driver load error, due to an unforeseen condition. Try examination of the kernel log for problems with ethernet driver loading. The command below might be revealing:

dmesg | grep -i eth0


Here is the solution : I downloaded the libgcrypt11 library for Debian Wheezy and installed it via

dpkg -i libgcrypt11_1.5.0-5+deb7u1_amd64.deb


Have you tried anon_umask as suggested in the following post? https://bbs.archlinux.org/viewtopic.php?id=167389


How to login to my Ubuntu desktop like in Windows?

The idea of Automatic Login is that it will not ask you for passwords during login. But anything that requires root user (aka admin) privileges, will not be possible and will still ask you for password confirmation. (Such installing new software, updating the system, etc...)

The password manager in Firefox has nothing to do with your Ubuntu account password. It only saves the passwords you save for websites.

As a suggestion, do not use the same password for everything. And if you want to type your password during login, you need to disable the automatic login.

Go into the User Accounts, in the top right there will be a Unlock button, click it and type your password and then disable the Automatic Login.


How to restore files of failed Kazam video

Your file is kind of broken. I have same problems with many broken videos I recorded using Kazam :(
I used this http://grauonline.de/cms2/?page_id=5software to PARTIALY recover my video and:

I had no audio
Only 50% was recovered as this program in free version recovers only 1/2 of your movie.
I needed to run it in Windows (did not try wine maybe works.)

Maybe full version allows to fix all video maybe even with sound? If anyone will decide to buy it please write in comments your experiences.


I guess the issue is with the -S if you try to omit the -S option, it should ,work, even without bash -c
so try this

screen -dm sed -i 's/a/b/'g some-file.txt

That should work.
BTW screen is not updated, you should consider switching to tmux. It can provide you with much more features.

You can install tmux by typing:

sudo apt-get install tmux

So your code should look like:

tmux new-session -d -s foo 'sed -i 's/a/b/'g some-file.txt'

I could test it with

tmux new-session -d -s hello 'top'

if you type

tmux attach -t hello

It will take you to a session with top. Hope that this helps. check

man tmux

for all features
and check here for a comprehensive cheat sheet


The boot image/animation can be changed using plymouth

get a list of pre-built images for you

sudo apt list plymouth-theme*

then install

sudo apt install <name of package>

then run

sudo update-alternatives --config default.plymouth

and select your new splash screen and then to finalize

sudo update-initramfs -u

then reboot

http://ubuntuguide.net/howto-change-plymouth-themes-initial-splash-screen-in-ubuntu-10-04


Do not install bumblebee, it provides an outdated solution for NVIDIA graphics chips with Optimus support. You already have a solution for switching between the intel and NVIDIA graphics installed. The package is called nvidia-prime and should have been automatically installed when you installed the proprietary NVIDIA drivers 352 from Ubuntu repositories.
Open NVIDIA X Server Settings (PRIME Profiles) to switch between the graphics adapters.


how to remove apache2 in ubuntu its still running on localhost

Apache has commands in post-installation to drop a 'default' page into /var/www/html if there's not already content in that directory.  Other web servers like NGINX in the repos have a similar configuration step.

If you remove /var/www/html/*.html you should be able to get rid of the 'default' index page.  You can alternatively just erase that directory if you wish, but it's your choice which of these you do.

That index page though it was originally Apache installed doesn't mean Apache is still installed - if pidof apache2 doesn't return anything then Apache is not installed and the file is a leftover left in place by the package, and can be safely removed.


way to disable Hibernate from within gconf-editor so button disappears?

Open a terminal and run the following command:

gksu gedit /usr/share/polkit-1/actions/org.freedesktop.upower.policy

This opens up /usr/share/polkit-1/actions/org.freedesktop.upower.policy for editing.
In the org.freedesktop.upower.hibernate section, changed the the line <allow_active>yes</allow_active> to <allow_active>no</allow_active>:

Restart indicator-session-service so for the change to take effect:

killall indicator-session-service

That's it, there should no longer be a Hibernate item in the session menu.


Unmet Dependencies Issue -- Gnome Terminal

This usually happens when you mix up sources or sources are outdated. First run apt-get update and watch out for any error messages. Check your /etc/apt/sources.list if everything is as it should be. Check any files in /etc/apt/sources.list.d if one looks like the cause of an update error.

If update runs through without errors 'apt-get -f install' should be able to fix the problem.

If it persists, turn off sources one by one and rerun update/install until you identified the troublemaker.

When you check your sources look for wrong distributions. I run trusty and also have gnome-terminal 3.6.2-0ubuntu1. Maybe you have a source that points to a newer distribution?


How to add permission to write to /var/www for my FTP client

You could change the ownership of /var/www to be the same owner that your FTP client uses.

For example if your FTP client runs as 'nobody' then use this command:

sudo chown nobody:nobody /var/www

Be aware that this will allow your FTP client to do anything to any of the files in /var/www and subdirectories. This might be a security risk. After the install is completed, you could always switch the ownership back to the root user again with:

sudo chown root:root /var/www


Filled hard drive, LVM automatically created?

LVM is Logical Volume Management. It's an improvement over the traditional partitioning scheme supported by the BIOS of computers. It is essentially a wrapper partition, that holds the LVM data. This can be subdivided into more modules as needed by the Linux kernel. They are typically named, and not referred to by number, unlike traditional partitions.

This has been like this since the installation. It's not something that has changed by itself. It is not something you should worry about either; LVM is perfectly stable, and in many senses a great improvement over the traditional partitioning scheme, as it can hold any number of partitions, address them by name, and you can easily resize and move them on the fly.

If you insist on going back to standard partitions, you'll have to reinstall the system in question. It's not feasible to swap the system partition type on a system.

So to sum it up, it's a LVM partition you're seeing. This is perfectly normal and was done during installation of the system.


prompt changes color when I become a permanent superuser

The same way you changed bashrc for your own user, root has a bashrc:

# pwd
/root
root@schijfwereld:~# ls -la
total 28
drwx------  4 root root 4096 aug 27 20:55 .
drwxr-xr-x 26 root root 4096 sep  4 19:58 ..
-rw-------  1 root root  549 okt 15 15:36 .bash_history
-rw-r--r--  1 root root 3204 aug 27 20:55 .bashrc
drwx------  2 root root 4096 jul 29 17:10 .cache
drwxr-xr-x  4 root root 4096 aug 27 20:55 .config
-rw-r--r--  1 root root  148 aug 17  2015 .profile

Add your lines there and it will change your admin.


Wifi very slow on Ubuntu 12.04 but not on Win7, need help

I have finally fixed the problem just by disabling the "802.11 n" protocol in the router settings


How do ubuntu software center sort out packages dependencies problem?

The VLC package specifies which dependencies necessary and the apt-get command installs all packages required to fulfill these.

When building from source that can be a tedious manual task. That's why there are source packages that should ensure the dependencies for building are met.


Upgrade from Ubuntu 12.04 to 14.04 gives black screen and x cursor on startup

If either ChromeOS or the Chroot has been updated, you must go to the chrome shell and type the command:

sudo sh -e ~/Downloads/crouton -n <chroot_name> -u

Your "chroot_name" should be "precise" if defaults were used during the install. If you would like the name to match the current Ubuntu release to relieve confusion, you may use the following to rename the chroot:

sudo edit-chroot <old_chroot_name> -m <new_chroot_name>

Or in your case:

sudo edit-chroot trusty -m precise


I think you are being bitten by this bug: https://sourceforge.net/p/xournal/bugs/164/

As a developer feature, xournal loads its graphic resources from the directory where the command is located, if it is not the standard path (most likely /usr/bin/xournal).

I can only guess here because I don't know from where you are starting xournal, but is it possible that in that directory you have a file named white.png or something like this? If so: try running xournal as /usr/bin/xournal and/or remove that png file.


GNOME3: Remove Power Off button for all users from the GUI

It's answered over here How to disable shutdown/reboot/suspend/hibernate?

Just creating a new file with the given config removes the button from UI as well without even a system restart.


windows XP doesn't go up after unubtu installation,

Sounds like NTLDR is somehow messed up. Perhaps you could try using Ubuntu to download/burn Hiren's Boot CD, and boot from it. From there, see what happens when you use the "NTLDR" is missing option from the boot screen.


What's the difference between removing and then installing, and just reinstalling?

apt-get remove {package} Remove/Delete an installed package except configuration files.

Remove is identical to install except that packages are removed instead of installed. If a plus sign (+) is appended to the package name (with no intervening space), the identified package will be installed instead of removed.

--reinstall, Re-Install packages that are already installed and at the newest version.

install.  This option is followed by one or more packages desired for installation. Each package is a package name, not a fully qualified filename.

Source:Manpage


Stdout string manipulate, delete all after a word per line

This is basic sed. Using sed is not difficult once you know regular expressions. A basic sed command for reading the input and stripping every < and the following part if it exist, then printing the line (may be modified):

$ echo 'foo<....' | sed 's/<.*//'
foo

sed uses regular expressions, the relevant manual page text for sed(1) that applies to the above command:

  s/regexp/replacement/
  Attempt  to match regexp against the pattern space.  If successful, replace that portion matched with replacement.  The replacement may contain the special character & to refer to that portion of the pattern space which matched, and the special escapes \1 through \9 to refer to the corresponding matching sub-expressions in the regexp

Alternative using cut (manual page for cut(1)), "split the string by < and take the 1st field.

echo 'foo<....' | cut -d'<' -f1

Alternative using grep, "match only everything containing characters of the set a to z (case insensitive)" (manual page of grep(1)):

echo 'foo<....' | grep -io '[a-z]*'

(note: I took the liberty to use [a-z]*, meaning "zero or more occurrences of a letter", because grep won't return an empty line when using the -o option)

Alternative using awk, using the same idea of cut (manual page of awk(1)):

echo 'foo<....' | awk -F '<' '{print $1}'


Clementine keyboard shortcuts not working

Met same problem in Ubuntu 11.10 with media buttons shortcuts. "Use Gnome's shortcut keys" didn't worked.
So I just set to "Disabled" Gnome's shortcuts for those keys. This solved my problem.


Multiplying numbers in file by random numbers

I'd use something like perl or awk that can handle arithmetic operations, rather than sed (which can only really do regular expression replacement).

For example, using perl

$ printf 'tree my_tree = ((t1:961.00,t2:902.00):961:00,t3:878:00);\n' |
    perl -pe 's/:([0-9.]+)/sprintf ":%.2f", $1*rand()/ge'
tree my_tree = ((t1:918.95,t2:880.40):633.34:0.00,t3:648.35:0.00);

You can replace perl's rand() by another random library function of your choice - for example, using Math::Random from the libmath-random-perl package:

$ printf 'tree my_tree = ((t1:961.00,t2:902.00):961:00,t3:878:00);\n' |
  perl -MMath::Random=random_normal -pe 's/:([0-9.]+)/sprintf ":%.2f", $1*random_normal(0.0, 1.0)/ge'
tree my_tree = ((t1:-362.08,t2:822.35):-254.87:0.00,t3:1158.46:0.00);


Here's one way:
For most users, it's MUCH easier to login the first time using the temporary 'ubuntu' user/password, and then set up your permanent admin user.

OPTIONAL steps:

// Set the timezone non-interactively
sudo ln -fs /usr/share/zoneinfo/<pick_a_timezone> /etc/localtime
sudo dpkg-reconfigure -f noninteractive tzdata

//Change the hostname
sudo hostnamectl set-hostname <new_hostname>

Add your permanent user, and then make that user an admin

// You must create a new (admin) password during this step. Don't forget it.
adduser <user_name>
adduser <user_name> sudo

On your LOCAL machine, send your ssh key to the remote machine.

local:~$ ssh-copy-id <user_name>@<pi_ip_address>

Test your key-based login:

local:~$ ssh <user_name>@<pi_ip_address>

If your key-based login is successful, time to finish your setup on the pi.

// Edit the ssh settings to disable password-based access
sudo nano /etc/ssh/sshd.config

        PermitRootLogin no
        PasswordAuthentication no

// Reload the sshd config.
sudo systemctl restart sshd

// Delete the 'Ubuntu' user
sudo deluser ubuntu --remove-home

...and now you're all set up with a unique key-based SSH login.


I had the path wrong in my service.

Description=autorip
After=network.target

[Service]
Type=simple
User=rd
WorkingDirectory=/home/rd
ExecStart=/usr/local/bin/autorip  # was /home/rd/autorip
Restart=always

[Install]
WantedBy=multi-user.target


Unable to install plasma-nm, returning an error 'E: Sub-process /usr/bin/dpkg returned an error code (1)'. Please help

As per the suggestions received from Zanna, I have tried to reinstall 'linux-image-4.8.0-46-generic' using

sudo apt install --reinstall linux-image-4.8.0-46-generic

and then

sudo apt-get autoremove

That solved my probem. I could remove the unnecessary packages


How do I install xFREERDP 11 on to Ubuntu 12.04

You can install install xFREERDP 11 using a Terminal.

Install the freerdp-x11 package using the command below.

sudo apt-get install freerdp-x11

Reference

Command syntax for freerdp-x11 is:

xfreerdp [options] server[:port] [[options] server[:port] ...]

Reference


gparted - Project web is currently offline

If you want the gparted ISO so you can burn a DVD: sourceforge.

If you only want gparted installed in your current system:

sudo apt install gparted


This looks like the case where you're trying to run a 32 bit ELF binary, on a 64 bit install, without having the 32 bit libraries installed. If that's the case, installing the package named ia32-libs should let you run this adb binary.


Is there a Persian Calendar for Ubuntu 16.04?

Jalali calendar is a small and portable free software library to manipulate date and time in Jalali calendar system. Installation:
 sudo apt-get update
 sudo apt-get install jcal

Source:
http://www.nongnu.org/jcal/


Installing generic headers without internet in ubuntu 13.04

Install all deb's at ones (try ls *.deb to get the idea of joker *)

sudo dpkg -i *.deb

or

sudo dpkg -i libc6_2.17-0ubuntu5.1_i386.deb libgcc1_4.7.3-1ubuntu1_i386.deb

Reference man dpkg (... means many)

-i, --install package-file...


Under the assumption that you have accidently enabled the 'Universal Access' zoom of the Gnome screen, you can reset this with a keyboard shortcut even though you can't see what you are doing:

Login to you computer

Press Super+Alt+8 to toggle Zoom off or on
Press Super+Alt+= to Zoom in
Press Super+Alt+- to Zoom out

The souce I found for this information was by examining  settings->Devices->Keyboard->Universal Access shortcuts, and testing this on my computer.

This can also be done from a command line, if you can see the active part of the terminal window, with the commands

gsettings set org.gnome.desktop.a11y.magnifier mag-factor 1.0

to set the magnification to 1, or

gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled false

to disable the magnification


export LC_ALL=""

Try that one, If that didn't solve that problem, you better search by this term:

  Cannot set LC_Type to default

same for others....


About swapping

A USB stick does not work well for swapping. The hardware (memory cells) is slow, and sensitive to wear (the expected lifetime in number of write cycles is low compared to other hardware). An HDD or SSD is better, but if you need fairly fast processing, increased RAM is the solution.

Renice the Blender process(es)

If you want to use the computer for other tasks while rendering, you can renice Blender (a high niceness value will give it low priority, so that other application programs will get priority to use the CPU and RAM).

The command line tool renicecan manage the niceness between -20 and 19, where 19 is the 'nicest' value visavi the other tasks alias lowest priority. You need elevated permissions (use sudo for text mode programs and sudo -H for GUI programs) to decrease the niceness. See

man renice

  Users other than the superuser may only alter the priority of
  processes they own, and can only  monotonically  increase  their
  'nice value' (for security reasons) within the range 0 to 19, unless
  a nice resource limit is set (Linux 2.6.12 and higher).  The superuser
  may alter the priority of any process and set the priority to any
  value in the range -20 to 19. Useful priorities are: 19 (the affected
  processes will run only when nothing else in the system wants to), 0
  (the ``base'' scheduling priority), anything negative (to make things
  go very fast).

It may be more convenient to install and use htop to increase the niceness of your blender process(es),

sudo apt install htop

The screenshot shows how I have reniced the htop process itself (from 0) to 5.

Select process (in your case Blender process)
Renice to a suitable value in the range 0–19
The current niceness is shown in the 'NI' column


Minecraft not working in Ubuntu 12.04 LTS - Black screen?

For some wierd reason, i had the same problem until i installed the previous version of java, OpenJDK-java-6-runtime. Try to do that, and minecraft will run pretty well for you too.

use: (in terminal)

sudo apt-get install openjdk-6-jdk
to install it, and then rightclick the minecraft file, and select run with Java 6

Good luck!


Text size in Chrome's omnibar is too small

In Ubuntu 18.04.3 enabling 'Large Text' in Settings->Universal Access enlarges font size in Chrome's and Chromium's address bar for me.


Assuming you have agent forwarding set up, and the agent is already running on your local system, you can just open a new terminal and run ssh-add in it. The agent process remains the same, so the existing agent forwarding should be able to use newly added keys:

# on server
$ git pull
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
# in new terminal
~ ssh-add
Identity added: /home/muru/.ssh/id_rsa (/home/muru/.ssh/id_rsa)
Identity added: /home/muru/.ssh/id_ed25519 (muru@ubuntu.local)
# back to the server tab
$ git pull
Already up-to-date.


There is a very nice answer here.

To summarize:

$ sudo modprobe rts5139 to load the kernel module

On my system, this was sufficient to mount the SD card.

To make the change permanent, you can modify the configuration files as shown in the link.


When I build my VMs in KVM, I use VMM (Virtual Machine Manager) it is in the Ubuntu software app, you connect to the VMhost via SSH, the only gotchas are you will want to also install Ask Pass as well, anyway, after running through all the configurations Disk size, memory etc, right before you start the VM for the first time there is a check-box that allows you to configure more settings, and below that there is a drop down for the network, I choose bridged from there.

The one gotcha to Bridged Networks and this is documented all over is that it does not work with Wireless network cards.

That being said if you are building your VMs on your laptop, are you using a wired connection or wireless.  here is a link discussing the issue:

https://help.ubuntu.com/community/KVM/Networking

I hope this helps.  Chris


sudo apt-get autoremove overlay-scrollbar*


VLC player installation error - Ubuntu 14.04

You need to have the mentioned libraries and packages already installed for the installation of vlc. You should have an active internet connection to do the following.

Try installing it from the terminal as follows:

sudo apt-get install vlc

still if you get dependency errors that may be because you need to update your repositories' package lists.

type the following to update the package list:

sudo apt-get update

and then try the first command.

If you want complete offline installation, you can use Synaptics Package Manager for that. But then also you should download the dependencies from one system with internet and then install it offline in yours. There are many posts explaining the offline installation of softwares.


How to move an EXE file to Wine's fake C: drive

The Wine folder is hidden by default. To access it, open your Home folder and press Ctrl+H. This will show all the hidden folders. Open .wine and go to the drive_c folder. Move the .exe there.

If the .exe file is from a Windows partition, you must first mount the partition to be able to access the files.


Okay I dont know why, but this worked.

I was trying to reproduce the problem.

Instead of uninstalling the sound packages and reinstalling them right away (which caused the problem in the first place) I decided to reboot the system after uninstalling the packages.

sudo apt-get --purge remove linux-sound-base alsa-base alsa-utils

Followed by a reboot. I DID NOT reinstall the packages and just checked the pavucontrol Output tab and the "Dummy Output" was gone.

I am not sure why though. If anyone knows why please comment.

Edit: It also fixed the crackling sounds. I still need to learn a lot on how linux work.


How can I remove the previous owner Adm account. So I can make changes to my P.C. Brought it from a pawn shop

I would reinstall Ubuntu. It would be pretty silly to recustomized the current Ubuntu to your needs. You reinstall by downloading the ISO, and wiping the disk in installation.


How do I create a literal control character in Kate?

It turns out the F7 to enter command mode works pretty well, after all.

The char function is not limited to just hex codes, decimal values work just as well.

Hitting F7 to enter command mode then entering char 31 produces exactly what I needed.


Why does rsa key authentication only work when samba access is made?

This seems like it is an issue with your home directory being encrypted. ssh cannot read your key when the home directory has not been decrypted. When you log in from a local terminal (or samba) it decrypts your directory. The same is true with logging in with ssh using password auth. A solution is posted on SuperUser.


The problem is that Wine's USB support is still being developed, and for now you can't use USB devices with software running with Wine. However, if you want to go through the trouble of compiling Wine from source, you can feel free to do so. More information can be found here.


How do you upgrade a Dell XPS 13 Developer Edition from Ubuntu 14.04 to 15.04?

First, be sure you've done all the 14.04 updates (I had issues just doing this, but after a bunch of reboots and upgrade attempts, you'll eventually get it done).

Second, go into Update Manager and tell Ubuntu to show you all available version updates, the default with the pre-installed 14.04 is to show you nothing, not even LTSes.

Then you have to remove some things that cause issues with the upgrade, install a newer kernel, and update grub: (src)

sudo dpkg -P oem-audio-hda-daily-dkms
sudo dpkg -P casper-memdisk
sudo apt-get install -f linux-image-3.19.0-20-generic
sudo update-grub

Do NOT REBOOT YET!

Now upgrade to 14.10 with:

sudo do-release-upgrade

This should bring you up to 14.10. After the reboot into 14.10, check it with lsb_release -a, it should say 14.10.

Now run sudo do-release-upgrade again to upgrade to 15.04 or run "Software Updater" and it should say 15.04 is available and ask you to upgrade (assuming you've set it to notify you of non LTS versions).

Boom, that should be it. I had no issues going this route.

If you lose wireless, apparently you can do a usb tether. Plug your phone into the usb port and turn on usb tethering, then sudo apt-get update && sudo apt-get upgrade. Did not test this.


How can I repair a Ubuntu installation that is missing numerous packages?

I suggest to install (or remove and install, if already there) the package ubuntu-desktop.

Generally this package take with it almost everything needed to have a standard Ubuntu installation.


How do I copy files onto the hard drive?

You can't Pre-Install Programs in Windows as it's Registry can't be modified properly to accommodate the new Programs. Especially on a Windows Install that doesn't yet exist. Portable Programs that don't need to be installed can be moved over though.

As for copying files to Windows, First you need to have an actual Windows Partition(If you simply wiped Windows from your Harddrive when you installed Ubuntu this is not possible). Then open Nautilus(The File Manager, Orange Folder in Dash) on the left-hand side there should be a list of other Partitions on you Computer, simply click on the Windows one and it should mount and open the folder. If it doesn't appear there, open Disk Utility and make sure that Ubuntu detects it, if not please inform me using the comments.


I don't think that you can change it, spotify really tries hard to be the less themeable as possible, something about brand management.

If you are a paying member, you can use the linux version. It has a decent resolution, grey notification icon that fits nicely with Ubuntu default themes. But they try to manage their own window, it has it's own title bar, buttons on the right and it doesn't bubble when you move it. You can force compiz to manage it, but then you have two sets of close, minimize and maximize buttons.


Command is giving me "bash: ./fwupd: cannot execute binary file"

Looks like you are sourcing the file, instead of running it.

Try executing it using the full path, something like

sudo /home/user/fwupd /dev/sda


It's possible to run gsettings without X11 using dbus-launch --exit-with-session:

dbus-launch --exit-with-session gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled true


configure wxFreeChart problem on Ubuntu 16.04

You should install all necessary build tools with

sudo apt-get install libwxgtk3.0-dev libwxbase3.0-dev build-essential

and then retry.


How do I post a report from terminal and who will help me with what it says?

I think what you refer to as the "terminal" could be the Ubuntu boot process, with the kernel kicking in and all the services starting up. If this is the case then there is no definitive "report" to send with this information (that I know of). Instead, the output to your screen during the boot process is usually saved in several log files, which can be copied to USB or stored on a network drive (if you have one available) even from a live environment.

The log files which we may find useful are:

/var/log/dmesg
/var/log/syslog
/var/log/kern.log
/var/log/boot.log

These logs contain the boot process that flies by when you start Ubuntu up. With these logs, in a new post we may be able to assist further in getting your Ubuntu install back up and running.


I set up fresh ubuntu 11.04 natty narwhale on sdb1,
but grub 1.99 still doesn't boot - I have to do it in command line.
I repaired this by installing boot-repair:
(instructions in Polish):

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


Want to access work computer: ssh and GUI or VNC

VNC by itself is generally considered insecure, partly because some clients/servers limit the password length to 8 characters. SSH is generally only terminal, but there is a feature called X11 Forwarding, which can forward any X11 application windows you open on the remove computer on your own desktop.

However, you can use VNC over an SSH connection. This gives you the benefits of a VNC connection (full control of desktop, etc.) while making it much more secure, as the connection will be encrypted by your SSH private key (hopefully, unless you're just using a password). This works by forwarding port 5900 on the remote computer to port 5900 on your remote computer in SSH. Then, in your VNC client, you use 127.0.0.1 (loopback address) as the IP address and 5900 as the port, and enter the password (if any). There should be several guides on the internet about this.


How do I start and stop a systemctl service inside a bash script?

You have multiple possibilities, depending on your needs and preferences.

An apparent approach …

… would be to run the whole script as user root by adding it to root's crontab (using sudo crontab -e). It won't need any password then when systemctl stop/start myservice.service is run. The downside is that you may need to run the backup tasks as another user (say noslenkwah) and have to switch to that other user for the backup. Example:

# Stop myservice
systemctl stop myservice.service

# Do all the backing up here...
# ... and run the backup_command as user "otheruser":
sudo -u noslenkwah /path/to/backup_command --with --some --options

# Start myservice
systemctl start myservice.service

Another approach …

… would be to add the systemctl commands to a file in the /etc/sudoers.d directory so that a specific user may run them without supplying a password.

issue sudo visudo -f /etc/sudoers.d/noslenkwah
  (The filename, noslenkwah doesn't matter, it is just a
   personal habit of mine to name the files after the "main"
   user affected by the settings in that file. It just needs
   to be a file below the directory /etc/sudoers.d.)
Add the following lines and save the file.

Cmnd_Alias MYSERVICE = \
    /bin/systemctl stop myservice.service, \
    /bin/systemctl start myservice.service

noslenkwah ALL = (root) NOPASSWD: MYSERVICE

This allows the user noslenkwah to run sudo systemctl stop myservice.service and sudo systemctl start myservice.service without a password. It defines a socalled command alias (collection of commands) named MYSERVICE and then allows

the user noslenkwah
on ALL computers
as user root
without a password
to run the commands defined by MYSERVICE

Replace noslenkwah and myservice with the actual username and service name. Note that you really must issue sudo systemctl start myservice.service for this to work (not sudo systemctl start myservice (without .service, for example).

Don't care about the "on ALL computers" part. This is relevant only if you intend to distribute the very same sudoers file to multiple computers.

You would then change your backup script to

# Stop myservice
sudo systemctl stop myservice.service

# Do all the backing up here...
/path/to/backup_command --with --some --options

# Start myservice
sudo systemctl start myservice.service

and have it run as user noslenkwah.


The gnome3-staging PPA has a nifty description in launchpad:

The packages here have been deemed not ready for general use, they have known bugs and/or regressions, sometimes of a critical nature. Mostly things should run smoothly but be prepared to use ppa-purge, when you encounter issues!

You should probably run ppa-purge against the gnome-staging PPA unless you are prepared to deal with some difficulties.


How do I make Super+W show open windows from all workspaces?

A patched compiz-core which fixes this bug is available from PPA

As mentioned, this is a Compiz bug which will not be officially fixed until 12.04.2 (expected January 2013.)

But one of the compiz-core developers has made a PPA with a fixed version of Compiz that solves this bug.

If you are unfamiliar with PPAs, you may want to read What are PPAs... and Are PPAs safe...

To install from the PPA:

Open a terminal with Ctrl+Alt+T
Add the PPA with sudo apt-add-repository ppa:bsantos/ppa
Run sudo apt-get update
Update Compiz with sudo apt-get install compiz

Note: Installing this workaround will not break any future updates to compiz; between now and the release of 12.04.2, any official compiz updates may make the old (faulty) Super+W behavior return for a few days until the developer fixes it and releases the updated version to his PPA.

Demonstration:
Terminal, Software Center, Firefox and Nautilus are open in separate workspaces:

After installing the fixed PPA version, Super+W shows all four:


Permission denied when trying to write a file from bash script run from www-data

If a script running as user www-data runs the command echo 10 | sudo tee tttt, then it's user www-data requesting root privileges through sudo, something it is probably not allowed to do.

Since the script itself is running as www-data and you want to write to a directory owned by that user, there is no need for sudo: the write operation (the command tee) will be run with the privileges of user www-data as well. So what you want is echo 10 | tee tttt, or just echo 10 > tttt.

As an aside, consider using printf instead of echo to print strings.


"remote end" is this context means the ISP of your server. i.e. the people who provide internet access for your server.
unless the domain of your sender is static.albacom.net then your server is misconfigured for reverse DNS PTR records.
The way you solve that is to contact your host/ISP and get them to setup reverse DNS for your domain.
It looks like you also have a problem with how you  are sending the mail, at the beginning of the SMTP exchange with the MTA, your email client is not declaring the proper sender host. it should be the host (domain) of the sender.
Also, it looks like you havent provided the correct sender host at the email client end, so postfix is just applying 217.221.73.77 as a fallback.


Hyperthreading Xeon CPU E5 2680 0 @ 2.7GHz

cat /proc/cpuinfo |grep 'cpu cores' -- gives you number of real cores available

cat /proc/cpuinfo |grep processor |wc -l -- gives you number of 'fake' cores

If the numbers are the same, then you don't have HT enabled.
this may not work on newer AMD processors but does on all manner of Intel processors from Xeon to i5

Enabling HT depends on your server/motherboard/bios settings.

Your network card speeds are a mixed bag - you should provide a screen dump. Best guess, your network card is 10Gbit capable, but your network is not. It could be a switch that is not capable or connecting cable, or other.


How can I make the Rox filer show up in Gnome Do or the Unity Dash?

Oh, wow.  The rox-filer package doesn't ship a .desktop file, but it does ship a Debian menu file.  Old school!  That should be filed as a (wishlist) bug against the package.

Desktop shells (like Unity) and applications (like Do) use the .desktop files to identify applications, their icons, and how to launch them.  Since rox-filer doesn't include a .desktop file, it's not listed as an application.

You can create a .desktop file for rox-filer and it'll appear in Unity and Do (after a restart of Do).  You could create a file ~/.local/share/applications/rox-filer.desktop and copy the following text into it:

[Desktop Entry]
Name=Rox Filer
Comment=A filer of some sort
Icon=user-home
Exec=rox-filer
Categories=Utility;


This script will help you build Popcorn Time dev-0.3 on Ubuntu Linux from the Github sources.

It works flawlessly on Ubuntu 12.04 and 14.04 64bits, but should work with every maintained version and every architecture.

To build and install Popcorn-Time from sources, you'll need nodejs and npm. npm uses bower and grunt-cli to build the files: that's why you can't use the usual ./configure

Note : there currently is 1 bug with the installation files : nodejs binary being misnamed, you can fix it by a simple symlink from 'nodejs' to 'node'.

Note : on 12.04, there's no libudev.so.1, so we'll need to symlink it from libudev.so.0

HOW-TO

Copy-paste the following lines into a text file, I'll name it script for the example.
Then, use your terminal and launch the script:

bash script

Follow the instructions on the screen:

Accept the disclaimer
Choose the plateform you want to build for (mac,win,linux32-64)
Install Popcorn-Time with shortcuts and commandline options if you wish
Remove building files if you don't want them anymore
Remove the packages used by this script to build PT if you don't want them in the future
voila.

This will take about 10-30min to complete.

#!/bin/bash
#Written by MrVaykadji - http://github.com/MrVaykadji
#Thanks to Andrew for func_apt, nodejs PPA and libudev fix - http://webupd8.org
#licensed under GPLv3
#for Ubuntu 12.04 and newer

installdir="/opt"
version="master"
OfficialURL="http://popcorntime.io"
githubURL="https://github.com/popcorn-official/popcorn-app"
issueURL="https://github.com/popcorn-official/popcorn-app/issues"
icon="https://github.com/popcorn-official/popcorn-app/raw/master/src/app/images/icon.png"
log="$HOME/popcorn-build.log"
buildscriptURL="https://raw.githubusercontent.com/MrVaykadji/misc/master/Popcorn-Time/0.3.0/"
buildscript="build-popcorn"
[ $(arch) == "x86_64" ] && arch=64 || arch=32
buildtime="`date +%Y.%m.%d-%Hh%M`"

#FUNCTIONS
func_apt() {
for lock in synaptic update-manager software-center apt-get "dpkg " aptitude
do
 if ps -U root -u root u | grep "$lock" | grep -v grep > /dev/null; then
  echo "
Unexpected Error:
=================
Please close $lock then try again.";
  exit 1
 fi
done
}

func_root() {
[ "$EUID" == "0" ] &&
echo "Error. You need to run this without 'root' or 'sudo' privileges." &&
exit 2
}

func_error() {
[ -n $error ] && return 0
echo "
Unexpected Error:
================="
cat $log
echo "
Please try again."
exit 1
}

func_clean() {
case $1 in
    -save)
        sudo mkdir -p /tmp/popcorn-config
        sudo cp -r $HOME/.config/Popcorn-Time/data /tmp/popcorn-config/ &> /dev/null
        sudo rm -rf $HOME/.config/Popcorn-Time/*
        sudo cp -r /tmp/popcorn-config/data $HOME/.config/Popcorn-Time/ &> /dev/null &&
        sudo chown -Rf $USER:$USER $HOME/.config/Popcorn-Time/data &&
        sudo chmod -R 774 $HOME/.config/Popcorn-Time/data
        ;;
    -all)
        sudo rm -rf $installdir/Popcorn-Time /usr/share/pixmaps/popcorntime.png /usr/bin/popcorn-time $HOME/tmp $HOME/popcorn-app-$version $HOME/npm-debug.log $HOME/.npm $HOME/.cache/bower $HOME/.config/configstore/insight-bower.yml $HOME/.config/configstore/update-notifier-bower.yml $HOME/.local/share/bower $log $HOME/$version.zip $HOME/.npm/
        ;;
    -package)
        sudo apt-get purge nodejs -y &> /dev/null &&
        sudo apt-get autoremove -y &> /dev/null &&
        sudo rm -rf /usr/bin/node &&
        sudo add-apt-repository -yr ppa:chris-lea/node.js &> /dev/null &&
        echo -e "... Done.\n"
        ;;
    -building)
 sudo rm -rf $HOME/tmp $HOME/popcorn-app-$version $HOME/npm-debug.log $HOME/.npm $HOME/.cache/bower $HOME/.config/configstore/insight-bower.yml $HOME/.config/configstore/update-notifier-bower.yml $HOME/.local/share/bower $log $HOME/.npm &&
        echo -e "... Done.\n"
        ;;
esac
}

func_ptexists() {
if [ "$1" == "-update" ] ; then
    func_clean -save
else
    [ -e "$installdir/Popcorn-Time" ] &&
    read -p "
WARNING: Popcorn-Time is already installed in '$installdir' and will be erased. Do you want to keep the configuration files (bookmarks, watched list, settings, ...) [y/n] ? "
    if [ "$REPLY" == "y" ] ; then
        func_clean -save
    else
        sudo rm -rf $HOME/.config/Popcorn-Time/
    fi
    sudo rm -rf /usr/share/applications/popcorn-time.desktop
fi
func_clean -all
}

func_dependencies() {
#package dep
[[ -n `egrep -v '^#|^ *$' /etc/apt/sources.list /etc/apt/sources.list.d/* | grep chris-lea/node.js` ]] && nodeppa=1 || nodeppa=0
if [ -n "`dpkg-query -W -f='${Status}\n' nodejs wget unzip | grep not`" ] || [ $nodeppa == "0" ] ; then
    echo "- Checking for dependencies 'nodejs', 'wget' and 'unzip'..."
    sudo apt-add-repository -y ppa:chris-lea/node.js &> $log &&
    sudo apt-get update &> $log

    sudo apt-get install nodejs wget unzip -y &> $log && echo -e "  ...Ok !" || error=1
    func_error
fi

#npm dep
if [ -e "/usr/lib/node_modules/bower" ] && [ -e "/usr/lib/node_modules/grunt-cli" ] ; then
    echo -e "\n- Updating NPM 'grunt-cli' and 'bower'..."
else
    echo -e "\n- Installing NPM 'grunt-cli' and 'bower'..."
fi
sudo npm install -g grunt-cli bower &> $log && echo -e "  ...Ok !\n" || error=1
func_error

#repair broken nodejs symlink
[ ! -e /usr/bin/node ] && sudo ln -s /usr/bin/nodejs /usr/bin/node

#symlink libudev.so on 12.04
[ `lsb_release -cs` == "precise" ] && [ ! -e /lib/$(arch)-linux-gnu/libudev.so.1 ] && sudo ln -s /lib/$(arch)-linux-gnu/libudev.so.0 /lib/$(arch)-linux-gnu/libudev.so.1
}

func_build() {
#get sources
echo "- Downloading sources (branch:$version) from GitHub..."
cd
wget $githubURL/archive/$version.zip -O $version.zip &> $log && unzip -o $version.zip &> $log && rm $version.zip && echo -e "  ...Ok !\n" || error=1
func_error

#npm
cd popcorn-app-$version
echo "- Running 'npm install'..."
sudo chown -Rf $USER:$USER $HOME/popcorn-app-$version/ $HOME/tmp $HOME/.npm
npm install --yes &> $log && echo -e "  ...Ok !\n" || error=1
func_error

#build
if [ "$1" == "-update" ] ; then
 buildcommand="linux$arch"
else
 buildvar=0
 echo -e "You can build for this machine only (linux$arch) or for all platforms, including : Mac, Windows, Linux 32-bits, Linux 64-bits.\n\nFor what platforms do you wish to build (for multiple builds, separate each platform with a comma)"
 read -p "[mac/win/linux32/linux64/all] : " input
 IFS=',' read -a options <<< "$input"
 shopt -s extglob
 for option in "${options[@]}"; do
    case "$option" in
        win|mac|linux32|linux64|all)
            buildcommand="${buildcommand:+$buildcommand,}$option"
            buildvar=1;;
        *)
            printf 'Invalid option "%s" ignored.\n' "$option";;
    esac
 done
 if (( !buildvar )); then
    echo "Incorrect input. Default build 'linux$arch' selected."
    buildcommand="linux$arch"
 fi
 [[ -n "`echo $buildcommand | grep all`" ]] && buildcommand="all"
fi

echo -e "\n- Building with 'grunt'..."
grunt build --platforms=$buildcommand &> $log && echo -e "   ...Ok !\n" || error=1
func_error

echo -e "Popcorn-Time has been built in :\n  «$HOME/popcorn-app-$version/build/releases/Popcorn-Time/»\n"
}

func_install() {
[ "`echo $buildcommand | grep -v linux$arch`" ] && exit 0

if [ "$1" != "-update" ] ; then
read -p "Do you wish to install Popcorn-Time on this computer [y/n] ? "
[ "$REPLY" != "y" ] && exit 0
fi

sudo mkdir -p $installdir
sudo cp -r $HOME/popcorn-app-$version/build/releases/Popcorn-Time/linux$arch/Popcorn-Time $installdir

echo -e "\n- Creating commandline launcher..."
echo "#!/bin/bash
echo \"Popcorn Time
============\"

[ \"\$EUID\" == \"0\" ] && echo \"Error: You need to run this without 'root' or 'sudo' privileges.\" && exit 2

helpsection() {
echo \"Version $version
Built on $buildtime from $githubURL
Official website : $OfficialURL

Options:
  -h, --help        Display this help.
  -q,--quiet        Launch Popcorn-Time without output.
  --flush       Flush databases.
  --fix-node        Fix the node-webkit 'blank' error.
  --uninstall       Uninstall Popcorn-Time.
  --issue       Report an issue.
  --build       Build latest version from sources.\"
}

flush_all() {
echo \"- Flushing databases...\"
sudo rm -rf $HOME/.config/Popcorn-Time
}

uninstall() {
echo \"- Uninstalling Popcorn-Time and removing configuration files...\"
sudo bash $installdir/Popcorn-Time/uninstall.sh
}

popcorntimequiet() {
echo \"Starting...\"
nohup $installdir/Popcorn-Time/Popcorn-Time &> /dev/null &
exit 0
}

popcorntime() {
$installdir/Popcorn-Time/Popcorn-Time
}

reportissue() {
echo \"Here is what a great bug report looks like:

###############################
Describe the problem here

Version: $version for Linux $arch bits
         Built on $buildtime
Downloaded from: $githubURL
OS: `lsb_release -si` `lsb_release -sr` `arch`
Connection: X mbps

How to reproduce:
 - Step 1
 - Step 2
 - Step 3
Actual result:
 - X goes wrong
Expected result:
 - X should go like that
###############################\"
xdg-open $issueURL &> /dev/null
}

fix_node() {
echo \"Fixing node-webkit...\"
rm -rf $HOME/.config/node-webkit
}

build_pt() {
cd
echo \"Building script fetched from GitHub...\"
wget -q $buildscriptURL$buildscript
bash $buildscript -update
}

case \$1 in
    -h|--help)
        helpsection
        ;;
    --uninstall)
        uninstall
        ;;
    --flush)
        flush_all
        ;;
    --fix-node)
        fix_node
        ;;
    --issue)
        reportissue
        ;;
    -q|--quiet)
        popcorntimequiet
        ;;
    --build)
        build_pt
        ;;
    *)
        popcorntime
        ;;
esac" | sudo tee /usr/bin/popcorn-time &> /dev/null
sudo chmod +x /usr/bin/popcorn-time
echo -e "    «/usr/bin/popcorn-time»\n"

echo "- Creating launcher... "
sudo wget $icon -qO /tmp/popcorntime.png && sudo cp /tmp/popcorntime.png /usr/share/pixmaps/
echo "[Desktop Entry]
Comment=Watch movies in streaming with P2P.
Comment[fr]=Regarder des films en streaming.
Name=Popcorn Time
Exec=/usr/bin/popcorn-time
StartupNotify=false
Type=Application
Icon=popcorntime
Actions=ForceClose;ReportIssue;FlushDB;FixNode;BuildUpdate;
Keywords=P2P;streaming;movies;tv;series;shows;
Keywords[fr]=P2P;streaming;films;séries;télévision;tv;

[Desktop Action ForceClose]
Name=Force close
Name[fr]=Forcer la fermeture
Exec=killall Popcorn-Time
OnlyShowIn=Unity;

[Desktop Action ReportIssue]
Name=Report Issue
Name[fr]=Rapporter un problème
Exec=sh -c \"popcorn-time --issue\"
OnlyShowIn=Unity;

[Desktop Action FlushDB]
Name=Flush databases
Name[fr]=Vider les bases de données
Exec=sh -c \"killall Popcorn-Time ; rm -rf $HOME/.config/Popcorn-Time ; /usr/bin/popcorn-time\"
OnlyShowIn=Unity;

[Desktop Action FixNode]
Name=Fix Node-Webkit
Name[fr]=Réparer Node-Webkit
Exec=sh -c \"rm -rf $HOME/.config/node-webkit ; killall Popcorn-Time ; /usr/bin/popcorn-time\"
OnlyShowIn=Unity;

[Desktop Action BuildUpdate]
Name=Build latest version
Name[fr]=Construire la dernière version
Exec=sh -c 'killall Popcorn-Time ; xterm -fa monaco -fs 13 -bg black -fg white -title \"Build latest Popcorn Time\" -e \"popcorn-time --build\" ; /usr/bin/popcorn-time'
OnlyShowIn=Unity;" | sudo tee /usr/share/applications/popcorn-time.desktop &> /dev/null
sudo chmod +x /usr/share/applications/popcorn-time.desktop
echo -e "    «/usr/share/applications/popcorn-time.desktop»\n"

echo "- Creating uninstall script..."
echo "#!/bin/bash
#uninstallation script for Popcorn-Time

#clean directory
sudo rm -rf $installdir/Popcorn-Time

#clean config
sudo rm -rf $HOME/.config/Popcorn-Time

#clean icon
sudo rm -rf /usr/share/pixmaps/popcorntime.png

#clean launchers
sudo rm -rf /usr/bin/popcorn-time
sudo rm -rf /usr/share/applications/popcorn-time.desktop
" | sudo tee $installdir/Popcorn-Time/uninstall.sh &> /dev/null
sudo chmod +x $installdir/Popcorn-Time/uninstall.sh
echo -e "    «$installdir/Popcorn-Time/uninstall.sh»\n"
}

func_end() {
if [ "$buildcommand" == "linux$arch" ] ; then
 if [ "$1" == "-update" ] ; then
    func_clean -building
    sudo rm -rf $0
 else
  read -p "Do you wish to remove all the building files [y/n] ? "
  [ "$REPLY" == "y" ] && func_clean -building
 fi
fi

if [ "$nodeppa" == "0" ] ; then
    read -p "Do you wish to uninstall the packages installed for this build, they will be needed in case of new build [y/n] ? "
    [ "$REPLY" == "y" ] && func_clean -package
fi
}

#SCRIPT#
func_root
func_apt

echo "
Popcorn-Time $version for Ubuntu-Linux
=====================================
Popcorn Time streams movies from Torrents.
Downloading copyrighted material may be illegal in your country.
!!! Use at your own risk !!!
"

sudo test

case $1 in
    -update)
        option="-update"
        ;;
    *)
        [ -n "$1" ] && echo -e "\nUnauthorized option '$1' will be ignored."
        ;;
esac

func_ptexists $option
func_dependencies
func_build $option
func_install $option
func_end $option

echo "=================================================
Popcorn-Time is now installed !

Type «popcorn-time --help» for more information."
exit 0

Uninstallation

A simple popcorn-time --uninstall should be enough. If not, clear those files :

/opt/Popcorn-Time
~/.config/Popcorn-Time
/usr/share/pixmaps/popcorntime.png
/usr/bin/popcorn-time
/usr/share/applications/popcorn-time.desktop


xdotool how to send Ctrl + mouse wheel up to a program?

Just had the same problem with you.
xdotool keydown ctrl click 5 keyup ctrl seems only to scroll down. So I tweaked the command a little bit to delay the releasing of ctrl.
Now xdotool keydown ctrl click 5 && xdotool keyup ctrl works for me


18.04: How to configure shortcut keys on Huion H640P tablet

Since you already know the commands you need to use (based on your question), the vast majority of the information you need is already here.
To clarify, a script is nothing more than a text file of commands that has its permissions set to executable.

To avoid having to run your script of commands every time, all you need to do is
run the script at startup.

Once you've chosen your scripting language there are numerous resources that explain the syntax. If you get stuck on the programming aspect you can always ask find answers to specific questions by utilizing for example our sister site https://stackoverflow.com/

Personally I often use bash for simple scripts such as you seem to require, Here's a command reference However in your case you might not need that much. A simple script might be described as:

#!/bin/bash
command 1
command 2
command 3
exit

where command 1 is xsetwacom set "HID 256c:006d Pad pad" button 1 key Ctrl z

I don't have your hardware and as such am unable to test it's capabilities, you however can do this with a bit of research and effort. xinput could be a useful tool for this.


Re: How can I escape meta-characters when I interpolate a variable in Perl's match operator?

You could use perl's -s flag, which acts similarly to awk's -v option
perl -i -sne 'print unless /^\Q$regex\E$/' -- -regex="$var" device_scan.txt

The -- following -e 'body' is required so that -regex is not taken as a perl option, it is left for the body.
Also, the -e body is now single quoted to keep the perl variable away from the shell
Using @steeldriver's example:
$ var='*'
$ perl -sne 'print unless /\Q$regex\E/' -- -regex="$var" <(
    printf '%s\n' foo 'bar * baz' qux
  )
foo
qux

Another way around it is to use shell parameter expansion to escape the slashes. Clearly this gets messy:
perl -ni -e "print unless /^\Q${var//\//\\/}\E$/" device_scan.txt
# ............................^^^^^^^^^^^^^^


Ctrl+Shift+C/Ctrl+Shift+V is not working in the console as soon as I set keyboard layout switch on Ctrl+Shift

I don't think I fully understand what you mean. Can you tell us a way to reproduce this issue?

As a workaround you you can select the text you want to copy and press the mouse wheel. This will copy and paste your selection.


Simple answer : You can't find the root password, If you could it would break the security model.

Also, by default root does not have a password which prevents you from logging in as root.

If you want to enable root login see this post.
How to enable root login? However its not recommended see here

If you have lost the password of all Administrative users see this post on how to fix:
How do I reset a lost administrative password?

Another option is sudo -i with your password which runs a session as root

Also take a look here RootSudo


Touch functionalities on ubuntu 15.10 desktop?

Answers and remarks:

(1) I can't make the screen rotate. What is the command?

(2) Open the dash. Type onscreen. Drag onscreen into left hand Unity application menu, thereby always making the onscreen keyboard but one onscreen button press away.

(2-hint) in onscreen settings->general click auto-show, not that this always makes the keyboard autoshow but sometimes it does.

(3) Well said. If(!) Canonical walks its talk then Ubuntu would recognise it was on a Yoga 3 Pro and auto-configure to suit. And it would know about all four physical configs and autorotate the screen as necessary. Or there would be an apt-get deb package to do same.

(4) Correct me but Ubuntu Touch is not suitable for the Yoga 3 Pro. Correct me?!


How to kill a process when I cant kill it via the GUI and kill in the terminal?

These days killall will also let you pass in a signal (to save you needing to look up a PID):

killall -9 skype


Utils installed using snap unable to write to .bashrc

Too long to comment.
Maybe, the confinements, specifically classic confinement is the thing you need. From https://docs.snapcraft.io/snap-confinement

Strict
Used by the majority of snaps. Strictly confined snaps run in complete isolation, and consequently, can not access your files, network, processes or any other system resource without requesting specific access via an interface.

Classic
Allows access to your system’s resources in much the same way traditional packages do. To safeguard against abuse, publishing a classic snap requires manual approval, and installation requires the --classic command line argument.

Devmode
A special mode for snap creators and developers. A devmode snap runs as a strictly confined snap with full access to system resources, and produces debug output to identify unspecified interfaces. Installation requires the --devmode command line argument. Devmode snaps cannot be released to the stable channel, do not appear in search results, and do not automatically refresh.

So, you just need to reinstall your vault package under classic confinement:
sudo snap install vault --classic

Hope this helps.


How do I copy a file larger than 4GB to a USB flash drive?

This is due to FAT32 limitation. Files larger than 4GB cannot be stored on a FAT32 volume. Formatting the flash drive as exFAT or NTFS will resolve this issue.

WARNING: Back up your data. Formatting will delete all the data on your device.


Are you using Google Chrome or Chromium? Anyway Google Chrome has already built-in pepperflash, which is basiclly the newest version of adobe flash player.
I've installed flash player on Chromium using the link below:
Install Pepper Flash Player For Chromium In Ubuntu Via PPA
If you want to install the newest version of flash player for firefox, do the folowing:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install freshplayerplugin


To return all to the defaults and recover your Desktop run the following single command in a Terminal window and then reboot:

xdg-user-dirs-update --set DESKTOP "$HOME/Desktop" && \
xdg-user-dirs-update --set DOWNLOAD "$HOME/Downloads" && \
xdg-user-dirs-update --set TEMPLATES "$HOME/Templates" && \
xdg-user-dirs-update --set PUBLICSHARE "$HOME/Public" && \
xdg-user-dirs-update --set DOCUMENTS "$HOME/Documents" && \
xdg-user-dirs-update --set MUSIC "$HOME/Music" && \
xdg-user-dirs-update --set PICTURES "$HOME/Pictures" && \
xdg-user-dirs-update --set VIDEOS "$HOME/Videos"

If you wish to weed out some of these you can do so judiciously by using the xdg-user-dirs-update as detailed above...


Updated. Triple-BOOT: Windows 7/8 and Ubuntu (7/8 already installed)

While some people have had success adding Linux using tools such as EasyBCD, this has never worked for me. I recommend using grub as your boot loader.

If you're willing to try grub, which should give you a menu at startup to choose between the 3 OS, boot Ubuntu from your Live Media and try using boot-repair.


VPN Service without having to set up VPN server?

If you do not want to use VPN and only want to surf from a different IP you can always setup SSH on your home computer and then log into that and run the browser on your remote machine.

Install openSSH:

sudo apt-get install openssh

Test your connection from within your local network:

ssh -x <computers IP>

Then run the command for your browser once you are logged in...

firefox

This will bring up firefox from the other computer with a secure connection between the two. Essentially you will be browsing from the other computer and all traffic will appear to be coming from the computer in your home rather than the computer you are actually on. This is not the same as a VPN but it may work for what you appear to be trying to do... and without having to setup a VPN server.

To access the computer from outside your local network you will need to open port 22 on your router/firewall and forward the traffic at that port to the machine at your home.

I use this when i am browsing the internet at a coffee shop in order to encrypt all of my browsing whether or not i am visiting a https site.

EDIT:
I think what you are looking for is a proxy service.
If you want to use a proxy service you can find those on the web (look in the comments).
To tell your Ubuntu install to use the proxy service do the following:

Go to System Settings
Select Network then Network Proxy
Under the Method pull-down select manual
Enter in the IP of the proxy you would like to use (see lists in link below)
Click Apply system wide

This will effectively route your traffic through the proxy which can be located anywhere in the world.


How can I install m2vrequantiser in Mythbuntu 12.04?

I'm having the same problem.  I fixed it by installing it manually for now, until the dependency is back in apt.

wget 'https://launchpad.net/m2vrequantiser/trunk/1.1/+download/M2VRequantiser-v1.1.tar.gz'
tar xvfz *.tar.gz
cd M2V*
make PREFIX=/usr
make PREFIX=/usr install

I also see two more bugs with the burn to dvd flow of mytharchive.  See https://bugs.launchpad.net/mythbuntu/+bug/1131280

-m


Can't get my dual monitor settings to "stick"

Not a perfect solution by any means, but I seem to have a work-around - I brought up the nvidia-settings program, and clicked on "X Server Display Configuration", made sure it was showing the layout I wanted, and clicked "Save to X Configuration File", and saved it to /etc/X11/xorg.conf.

Credit to http://www.muktware.com/articles/3081/how-set-dual-monitor-kde-nvidia-settings#.UPBmByZQAx4


How to find and download a missing plugin?

The URL is just a real website with some flash based redirection to the real URL:

http://radio.mosaiquefm.net:8000/mosalive

When you paste this, it will work.


How do I mount a folder from another partition?

Yes but before I go that far, couldn't you just symlink?

ln -s /media/tc1/folder ~/home

This link is just a file that is interpreted. It is automatically permanent (until you delete the file).

Failing that you can use mount as you described but the syntax is slightly different:

mount --bind /media/tc1/folder /home/dvad/home

This is not permanent at all, and will be nuked by a restart. If you want it to persist, you'll need something in your /etc/fstab like this:

/media/tc1/folder    /home/dvad/home    none    bind

If you're trying a mount and it's not working, you should make sure that the block-level device is mounted. You can't directly mount a subdirectory of a partition without first mounting the partition.


How do I use gparted from the command line?

The command line version of gparted (g stands for graphical) is parted. Making mistakes with parted is easy to do... make a backup of your personal files even it is not on the disk you expect to alter.

  but can't figure out how to format the second drive

You can only change disks that are not mounted.

fdisk -l | grep '^Disk' will list all disks. It could be sdb (b being the 2nd disk in your system).
Find the one you need to format. umount it if it is mounted.
fdisk /dev/sdb will let you partition sdb (change it to the one you want)
mkfs.ext4 /dev/sdb1 (change it to the one you want) will format partition 1  to ext4. If you made more do the others too.

You can use sudo in front of the commands but doing sudo -i before the commands lets you use "root".

If you have direct access to the machine you could also use a gparted live session. It works the same as an Ubuntu live session except it boots gparted.


In  your terminal type:

sudo dpkg --configure -a

Copy any errors that appear with your mouse and post them into your question.

If no errors then try your original command again.

From Linux Mint forums this answer: Re: _cache->open failed. Cannot update.

  Worked for me!

  For everyone else who comes later the command to fix this issue is:

sudo rm /var/lib/apt/lists/* -vf


Just use command in terminal sudo apt-get install steam, login, download games you want and play


Ranger file manager - getting it to open archive files with custom script?

I've solved it. For anyone interested, it was a combination of simple syntax error and having to:

Put the script, named extract.sh, in /bin/extract (without .sh)
Add an alias as such to .zshrc: alias extract="/bin/extract"
Have the following lines in .config/ranger/rifle.conf (the syntax error :):

ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has aunpack  = extract "$@"

ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip,  has tar, '   flag f = extract "$@"

label extract, ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz,  = /bin/extract


Why elFinder file manager can't save edited file, or delete a file or even create archive as it is supposed to do?

I had the same problem and It was due to the JQuery version. ElFinder seems to have issue with Jquery 1.8.x.
It works for me with 1.7.1 version of JQuery.

Hope it can help.


Ubuntu won't boot AMD FX 6100 & ASUS Radeon 6670

I would boot with the recovery mode and try to recover broken packages or even update software, for this I have to previously select to connect to the Network.

Otherwise, maybe first if I suppose that I have a good Video driver, I would type from the keyboard Control+Alt+t and then from the Terminal I would type

me@ubuntu:~$ gnome-session-save --logout


It's pretty common issue.

Please try the following:

Fix Alternative #1

Try reinstalling Alsa and Pulse audio in the following manner:

sudo apt-get remove --purge alsa-base pulseaudio

sudo apt-get install alsa-base pulseaudio

And force reload Alsa again:

sudo alsa force-reload

Fix Alternative #2

Open the terminal and edit speech-dispatcher file by using the following command:

sudo gedit /etc/default/speech-dispatcher

In here, change RUN=yes to RUN=no

Reboot.

Let me know if it have worked for you.

Source: It's FOSS

If it doesn't help you can try other solutions HERE


Is there tutorial creation software like WINK?

There are different applications to record screencasts under Ubuntu. They may not allow creating flash videos directly, but usually you can convert the screencast to flash in a separate step.

Here's a list of applications that are available via apt:

Byzanz  (creating GIF)
Istanbul  (OGG)
recordMyDesktop  (OGG)
RecordItNow  (multiple formats)
XVidCap

You may even use VLC Media Player to record screencasts.

See also the Ubuntu Wiki on Screencasts in general and on creating Screencasts, especially using Istanbul, RecordMyDesktop, XVidCap and FFmpeg.

EDIT:

There seems to be almost no application that allows for creating interactive tutorials or screencasts. There's only one project named Salasaga (see also Salasaga on Launchpad) that looks very promising, but it's still in it's alpha stage.


Try this thing:

x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0
-forever -shared -bg -o /var/log/x11vnc.log -rfbauth /etc/x11vnc.pass -rfbport 5901
-localhost

Taken from here: http://robot.wpi.edu/wiki/index.php/Setting_up_an_XUbuntu_VNC_Server

It should load the vnc on the correct display


how to get whatsapp working on ubuntu 11.04?

Currently whatsapp only supports mobile platforms. The possible solution is to run whatsapp using an android emulator.

Bluestacks is a good choice but its not available on Linux. You could try installing Genymotion which is available for all platforms viz Linux, Windows and Mac.

For detailed instructions to get whatsapp running under Linux visit this link.


Sorry, this answer is probably too late for you...

It sounds like something is preventing /boot from mounting.  But the system is presumably managing to boot the kernel from it, so it isn't fatally damaged.

Commands like these might tell you more about the state of the partition:

sudo file -s /dev/sda1           # basic "file type" detection
sudo fsck -n /dev/sda1           # read-only filesystem check
sudo mount -o ro /dev/sda1 /boot # read-only mount test
dmesg | tail                     # should tell you what went wrong with the mount

If there is any sign of an error, you might find you can fix it by running fsck /dev/sda1 and allowing it to fix any errors.


How to minimize all windows and go to the desktop using mouse on Ubuntu 18.04?

Use the 'CustomCorner' extension to apply hotkeys to all 4 corners of the screen


OpenVPN is installed but it is not an avaliable option in the network manager

You need to install the Network Manager OpenVPN plugin for Gnome.

Open a terminal with Ctrl-Alt-T
sudo apt-get install network-manager-openvpn network-manager-openvpn-gnome

Now try again.


16.10 Live USB boots into tty1 and then shuts down

It's possible that something corrupted the live image on the USB drive, or the USB drive itself has gone bad. Try with a fresh image on a new USB drive. If it still doesn't work, then you've very likely got a hardware malfunction, because the live image should be the same every time it boots.


Maintaining kernel modules submitted in the Software Center over kernel updates

In general, kernel modules have to be built for the current kernel and not simply copied.

If you need a custom module, either file a bug report or consider building a custom kernel.


Is there any way to setup a raid device after installation?

Thanks to Terrance I found this tutorial that works great

https://www.howtoforge.com/how-to-set-up-software-raid1-on-a-running-system-incl-grub2-configuration-ubuntu-10.04

basically the instructions are as follows:

    1.) Change the partition type --> fdisk /dev/sdd --> press t, select partition, l to list codes, looking for "Linux raid setup" usually fd
    2.) Do the above for every volume you plan to add --> fdisk /dev/sda | t | 1 | fd
    3.) Zero the superblock of the devices --> mdadm --zero-superblock /dev/sdd4
    4.) Create the raid device --> mdadm --create /dev/md0 --level=1 --raid-disks=2 /dev/sdd4 /dev/sda1
    5.) check to make sure device exists --> cat /proc/mdstat --> should now see your raid device
    6.) Create filesystems on our raid array --> mkfs.ntfs /dev/md0
    7.) Mount raid array --> mount /dev/md0 /srv
    8.) I recommend a benchmark for your array so you have an idea if something is going wrong


how do I run a mir application from a command line?

Mir appears to use the MIR_SOCKET environment variable, which I found on an Ubuntu phone (emulated) to be in /var/run/mir_socket.

export MIR_SOCKET=/var/run/mir_socket

and you might be set.


How do I enable multiple cores in my virtual enviroment?

To enable more than 1 CPU in your VM the following settings are needed in addition:

64-bit virtual guest hardware in General settings tab (for 64-bit guests)

enable I/O APIC in the Motherboard settings tab

enable hardware virtualization (VT-x/AMD-V) in the Acceleration tab

Note that if your run your VM on all cores available you may experience a better host performance when assigning an execution cap to the CPU.

If you had not enabled hot-plug CPU feature of virtualbox changing of the number of cores can only be done on a machine that was shut down.

A performance boost in the guest is only to be expected for software that makes use of several cores. Only then giving all cores with an execution cap makes sense.


If you are on Ubuntu 19.04 (or lower) then you are still using the old version of PolKit, where there are no .rules files but only .pkla and .conf files.

On the command prompt, do:

pkaction --version

If it says < 0.106, then you can only use the old syntax.

You can create a .pkla file in /etc/polkit-1/localauthority/


Macbook Pro 16.04 wifi driver Installed but not available

After a "fresh" installation of Ubuntu 16.04, the driver for my wifi hardware Broadcom Corporation bcm4322 was not detecting any wifi networks in my MacBook Pro (Core 2-Duo from 2010).

Fortunately, while being connected through wired Ethernet I  found a work around:

go to System Settings | Software & Updates, then pick the Additional Drivers tab.
There was a section "Broadcom Corporation: BCM4322 802.11 a/b/g/n wireless LAN Controller" with an UNSELECTED radio button labeled "Using Broadcom 802.11 wireless driver source from bcmwl-kernel-source (proprietary)" and also a SELECTED radio button labeled "Do not use the device". The only thing I did is clicked the former UNSELECTED radio button and within a few minutes it got the wifi connections worked perfectly