Hosting a NodeJS application in different location is not working with Nginx

The problem is that the path may still have /sublocation in the query.
simple for nginx, complex for express
Try:
    location /sublocation {
        proxy_pass http://localhost:3040/sublocation;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header  X-Forwarded-Proto https;
        proxy_set_header  X-Forwarded-For $remote_addr;
        proxy_set_header  X-Forwarded-Host $remote_addr;
        proxy_cache_bypass $http_upgrade;
    }

But inside your express aplication you must put /sublocation as root!
You can do something like:
    var mainApp = express();
    mainApp.use(bodyParser.urlencoded({extended:true, limit: '50mb'}));
    //...
    var app = express(); // your current app
    mainApp.use('/sublocation',be.app); // here is the magic
    //rest of your app


Mouse and keyboard not working after 10 minutes

Try shutting down and restarting the laptop.

Check the logs for errors.

Run a memory test. If you can't find the memtest86+ option on the menu see this.

Check smart status of drives.

In case of overheating, blow out the vents and consider installing TLP.


How to force the installation of a modified .bin file?

Manipulating installation files is a bad idea in most cases like this. As you already noticed, this broke the checksum (maintained to ensure noone tampered with it and possibly introduced malicious code). A much better idea is to solve such issues outside, either by adjusting path variables (which would not work in this case), or by the use of symbolic links.

In your case, the solution is as easy as

ln -s /lib/i386-linux-gnu/libc.so.6 /lib/libc.so.6

So when looking for /lib/libc.so.6, the binary finds the symlink and "gets redirected" to /lib/i386-linux-gnu/libc.so.6 (to put it into easy words -- how it works exactly, you can read in the linked Wikipedia page; but for your understanding it suffices to think of it as a special kind of "bookmark" -- so even if the file itself gets replaced, the symlink stays valid, pointing to the updated file then).


You put all of these users in the same GROUP

usermod -g {group} {user}

That way all users have the same permissions. We generally use the group apache is set up with (www-data or apache).

Any changes in permissions to a file or directory on the group will change it for all.

In general files in /var/www/ can have 664 as minimum. And directories 775. Never put any of them on 777 but you can go lower.


Could my partition setup on my Hitachi Travelstar be causing SMART spinup problems?

No; if the SMART health says it is failing with too long of a spinup time, then it is time to replace the drive.


How to reach a host in the same network by hostname?

Your /etc/nsswitch.conf should already have this for mDNS (avahi):

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

Just install avahi-daemon on the machines you want talking to eachother, and you should be set to use HOSTNAME.local like this:

ssh yourmachine.local


One thing you might consider is running Windows from an SSD partition of around 50 GB and installing Ubuntu into the remaining 14 GB.  (Personally, I find Ubuntu runs easily in a 10GB partition.)  This will give very fast boot times for both operating systems.  You have lots of space on the HDD's for data files, etc.

If space is critical on the SSD, and since you have lots of RAM (which defines the size of the page file and hibernation file), you can move the Windows page file to the HDD.  With 16 GB of RAM, you may never use the page file; however, I read that some programs insist on the file being available.  On my desktop system I also erased the hibernation file since I never use that feature on the desktop machine.

I have Windows 7 (36 GB), a shared data drive (8GB), Ubuntu (10 GB) and a swap area (1.8 GB) all running happily on an SSD, with the Windows page file and tons of data/backup space on an secondary HDD.


It seems to be an issue with the 12.04 kernel which I read has been fixed in 12.10 kernel. Best option is probably manage the situation until 12.10 is released in 3 weeks or so. Hope this helps


MediaWiki installation error: MySQL not identified

This one is the one you want: /usr/lib/php5/20121212+lfs/mysql.so

Uncommenting in this case means removing the semicolon. Whitespaces are not required, so this one:

;   extension=msql.so

Should become this one:

extension=mysql.so

(notice the missing y in the original)

And this one:

; extension_dir = "./"

Should become this one:

extension_dir = "/usr/lib/php5/20121212+lfs/"

Notice that this prevents other PHP extensions to be added using additional extension=<extension>.so lines in php.ini (unless the related static library is present in /usr/lib/php5/20121212+lfs/), so if you need more extensions you should workaround a way to have all the extensions in a (possibly new) unique folder (i.e.: copying all static libraries needed in such folder)


You say that you accidentally changed your path environment variable. In order to fix this problem correctly,  we need a little more information. What happened? How did you manage to change the path environment variable?

I have had a similar experience when the .Xauthority in my home directory mysteriously changed ownership to root.

Login as root and check ownership of your. Xauthority file

ls -l should show your user name something like this (assuming a username of "yourname"):

cd /home/yourname
ls -l .Xauthority
-rw------- 1 yourname yourname 270 Dec 23 03:00 .Xauthority

If it looks like the following, you will have trouble and a login loop:

cd /home/yourname
ls -l .Xauthority
-rw------- 1 root root 270 Dec 23 03:00 .Xauthority

If you see

ls -l .Xauthority
-rw------- 1 root root 270 Dec 23 03:00 .Xauthority

You will need to change ownership of .Xauthority back to your user account by this command:

chown yourname:yourname .Xauthority

Then log out of root or reboot and attempt to login by your user account.


Can I install Ubuntu over Mint without formatting the partition?

You could move /home to its own partition, then do a Something Else install, formatting only the / partition.

The wiki article here https://help.ubuntu.com/community/Partitioning/Home/Moving explains in painstaking detail how to move /home. I've done it successfully several times.


I cannot install Chromium or Chrome on Ubuntu 16.04 LTS

Yes, the problem was dependencies, these are fixed with

sudo apt -f install

The second issue was some left over file from apt's failed attempt to install in /var/cache/apt/archives, to fix this run

sudo rm /var/cache/apt/archives/chromium*

Now Chromium will install

sudo apt install chromium-browser

VOTERS

Please consider giving this answer some love, it really helped with this question.


ModuleNotFoundError: No module named 'pandas' (only as root)

Regardless of your purpose, tt's probably a safer choice to not use root to run any scripts on your server.

(I don't actually know if running cron scripts with root can create a vulnerability or not, but better safe than sorry i guess).

With that in mind, I think you could solve this by either

1) setting the permission for your user (the one that runs the script successfully) in the cron.allow file:

  usually in the path /usr/lib/cron/cron.allow, simply adding the username in a separate line.

or

2) setting a custom env for the script:

HOME=user-home-directory
LOGNAME=user-login-id
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh
PYTHONPATH=/usr/lib/pythonX.X

For more detailed information check this crontrab reference.

Hope that helps.


Restore 'cd ..' functionality after following a symbolic link

See https://stackoverflow.com/questions/10456784/behavior-of-cd-bash-on-symbolic-links.

You can use 'cd -P' to go to the "real" parent directory.
See the first comment on the top answer on how to make this the default behavior.


After Ubuntu One Music purchase, sync seems to be incomplete

If the download list says that the item is queued, that means that it hasn't yet been transferred from the store to your cloud storage.  Until that happens, there is nothing for the Ubuntu One client to copy to your local system (that is why u1sdtool says it is idle).  Once the song is transferred, your local client should start downloading it right away.

If the songs don't change from the "queued" state, consider filing a support request asking for it to be looked into:

https://one.ubuntu.com/help/contact/

Remember to use the email address associated with your Ubuntu One account so that we can easily locate the problem songs.


What does "i915_program_error: Exceeded max nr indirect texture lookups" mean and can I solve it?

I meet exactly the same error when running it on fedora x64 from the .bin setup of HIB

With some test I finaly got a very very very ugly slow game (truly unplayable) when running it with:
./braid -windowed -half -15fps -width 1024 -height 768

Any ideas ?

Thanks


I had the same problem with apt allways giving this error when trying to install something.
I was able to fix it by creating the directory it was complaining about:
sudo mkdir /var/run/spice-vdagentd


user294425 you may want to run dmesg and provide additional info.... also I had a similar problem where wifi worked then was greyed out.  you may want to check your bios wifi settings seems ubuntu desktop10.10 and now 14.04 has a bug that changes bios setting for wifi on some computers (especially HP) (see this solved thread - http://ubuntuforums.org/archive/index.php/t-1667464.html )

pretty_whistle
January 19th, 2011, 05:50 AM
I've solved this whole thing -
The problem is this Ubuntu version has a bug, which I'll be reporting.
The bug is that when Ubuntu is installed, it makes a change in the BIOS. It 'disables' >the Internal Network Adapter Boot - a.k.a. network adapter.
With this disabled, the computer cannot connect via wifi.
...........

i reset my bios setting to default and my wifi in ubuntu returned, no longer greyed out. Windows xp,7,and 8 can reset your bios for you if you have installed on the machine (windows vista will create the same bios problem in some cases and will likely NOT fix the issue in for you.)


Reorganize photos from an existing folder structure into a new structure

Script to reorganize photos into /year/month directories

The script below does the following:

It determines the month the picture was taken
Inside your targeted directory, it creates (if necessary) sub directories per year (if photos were found)
Inside these year directories, it creates sub directories per month
If the script is unable to find an appropriate date, it creates a folder named "undetermined"

Folders per year

Sub folders per month

Handling duplicates:

An important thing is to take care of duplicates in an appropriate way: digital cameras take shots in similarly named series (like IMG_1.jpeg, IMG_2.jpeg etc). Therefore duplicates need to be automatically renamed, or either the script will break or a large number of photo's will be lost.
The script renames duplicates like:

IMG_1.jpeg, duplicate_1_IMG_1.jpeg, duplicate_2_IMG_1.jpeg etc

How to use

The script uses exif to read the meta-data:

sudo apt-get install exif

copy the script below into an empty file.
In the head section of the script, define the directory where you want the photos to be copied to (targeted directory):

#---
save_to = "/targeted/directory"
#---

save the script as reorganize.py.
Create the targeted (superior) directory if necessary
Run the script, with the source directory (the folder with your photos) as an argument, by the command:

python3 /path/to/reorganize.py <source_directory>

I made the target directory set in the script, because you might want to add other dorectories (new pictures) to the same directory, organized automatically, while the source directory will be different in future situations.

Important notes

The dat format can differ slightly per camera. In the script, I took into account the following formats:

Datum en tijd       |2013:08:18 15:58:46

and

Datum en tijd       |2013-08-18 20:21:32

It might be different on other cameras. If the script does not work properly, you need to post the output of the command exif <image>, but most likely, it will work as it should.
The script as it is copies the photos into the new (sub) directorie(s), since you probably don't want to mess with the original directory until you verified all went well. I f you want to move the files however, replace the line:

shutil.copyfile(file, newfile)

by:

shutil.move(file, newfile)

The script

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

#---
save_to = "/targeted/directory"
#---

directory = sys.argv[1]
if not os.path.exists(save_to):
    os.mkdir(save_to)

get = lambda cmd: subprocess.check_output(["/bin/bash", "-c", cmd]).decode("utf-8")

def check_dir(dr):
    if not os.path.exists(dr):
        os.mkdir(dr)

def rename_dups(target_dir, name):
    n = 1; name_orig = name
    while os.path.exists(target_dir+"/"+name):
        name = "duplicate_"+str(n)+"_"+name_orig
        n = n+1
    return target_dir+"/"+name

for root, dirs, files in os.walk(directory):
    for name in files:
        file = root+"/"+name
        try:
            date = [l for l in get("exif "+'"'+file+'"').splitlines()\
                    if "Dat" in l][0].split("|")[1].split()[0]
            if "-" in date:
                date = date.split("-")[:2]
            elif ":" in date:
                date = date.split(":")[:2]
            targeted_dir = save_to+"/"+date[0]
            check_dir(targeted_dir)
            sub_dir = targeted_dir+"/"+date[1]
        except:
            sub_dir = save_to+"/"+"undetermined"
        check_dir(sub_dir)
        newfile = rename_dups(sub_dir, name)
        shutil.copyfile(file, newfile)


If you look at the Ambiance theme, the theme-ing of nautilus requires a separate .css file or specific theming.  Look at /usr/share/themes/Ambiance/gtk-3.0/apps/nautilus.css to see it.

You would need to copy that and correct the values for Adwaita.

Not all themes being completely converted for all the special cases with Gtk3 is probably why they are disabled by default.

Edit: I took a look at Adwaita and it's movie player that's not conforming.  I had it backwards, but the point remains the same.  You can add a totem.css to correct it.


Installing and activating themes on Ubuntu 14.04 64-bit Unity, how to do?

To install a new theme it would suffice to copy it to ~/.local/share/themes, and activate it using Unity Tweak Tool. Running update-alternatives won't be necessary.

Some themes are available via PPAs. Numix for example.

PPAs usually install them in /usr/share/themes and /usr/share/icons/, so it seems to me that your ~/icons folder is one created by yourself

Furthermore .$HOME/themes and $HOME/icons paths are deprecated and will not be read in future releases.


Cannot install Ubuntu 19.10 after changing graphic card

Not sure how to fix your current problem, but I have a similar problem to the original login issue that you had  but only with Auto Login enabled. If you find yourself back in that situation, this post may help

After upgrade to 19.10, still get login screen after enabling Auto Login, but can't log in


Install the aircrack package first, then you will be able to use the airmon-ng command.

Here's how

Open a terminal and type:

sudo apt-get install aircrack-ng

You may now use the command.

sudo airmong-ng start wlan0


I have the same problem. A not so elegant but working solution, is to use ssh tunneling to connect to the Xen server like this:

ssh -L 8080:localhost80 <ip-of-xcp-server>

After you connected, instruct your OpenXenManager to connect to "localhost" and port 8080.
Use your root username and password and you are in.


Remote ubuntu (Mint) becomes unreachable after running upgrade to oneiric

Remote ubuntu (Mint) becomes unreachable

Linux Mint is actually a derivative of Ubuntu; I don't think it allows you to do a do-release-upgrade the way Ubuntu does. So it's quite possible the upgrade to "Ubuntu" from "Mint" messed something up which.... (see below)

  ssh: connect to host xxx.xxx.xxxx port 22: Network is unreachable

...left the remote computer unable to connect to the internet (which is exactly what this error means). Since it's not connected, the only way to troubleshoot this is if you (or someone else) can somehow access the Mint computer locally. Is there a way to do so?


Your TV might be advertising a mode 1024x768 that it is not able to show.

You can use one of these commands to see if your TV can show the other modes:

xrandr --output HDMI1 --mode 1920x1080i
xrandr --output HDMI1 --mode 1280x720
xrandr --output HDMI1 --mode 1024x768 --rate 60


Ubuntu not showing up on boot menu after Wubi installation

For XP, right click My Computer, click on Properties, click the Advanced tab, Startup & Recovery settings.

Make sure that the Time to display operating systems is 10.

If the timeout is not zero, then in rare cases there is a line missing from the end of the C:\boot.ini required to boot Ubuntu:
C:\wubildr.mbr = "Ubuntu"

If you decide to edit the boot.ini, make sure you back it up, and edit it from the same place.

It should look something like this:

[boot loader]
timeout=10
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
C:\wubildr.mbr = "Ubuntu"

For Windows 7, right click on Computer, Properties, Advanced system settings (on the left):

Then click on Startup & Recovery settings:

Make sure the Time to display list of operations systems is set to 10 or above. If that's not the problem, run CMD.EXE selecting to Run as an administrator, then enter bcdedit to make sure there is an entry for Ubuntu.


Such an update should pose no more of a problem than on an earlier computer or earlier updates (say, 11.04 to 11.10 on a BIOS-based computer). Of course, should doesn't always pan out in the real world.

In theory, you should (there's that word again) have been able to install Ubuntu 13.04 with Secure Boot enabled; since version 12.10 (including 12.04.2, but not 12.04), Ubuntu has supported Secure Boot. In practice, this doesn't always work, although I've not studied Ubuntu's Secure Boot problems in enough detail to know why. Certainly there's no need to enable Secure Boot for an update, though; there are plenty of EFI/UEFI systems that lack Secure Boot entirely, so it would be insane of the Ubuntu developers to require that Secure Boot be active in future updates. If you're booting with Secure Boot turned off, an update should still work with Secure Boot disabled.


How to get verbose output on Ubuntu Server while booting?

Add to /etc/default/grub

GRUB_TERMINAL=console

Then run

sudo update-grub2

This will show kernel debug messages.


To add a scanner icon to your .desktop file you may add the following line:

Icon=scanner

This will render the default scanner icon (depending on your theme):

Shown for default 12.04 Unity/GNOME

To add a custom icon replace this line by:

Icon=/full/path/to/icon


Not Working Indicator Minbar Application Ubuntu

You need to install the package libappindicator1, log out and log back in. That should fix it. You can install it right from the Ubuntu Software Center, too.


Could not run the cron file in Ubuntu server using PHP

As you said the php script is running fine in termnial and you want to run the cronjob in every minute, please edit your cronjob as follows.

* * * * * /usr/bin/php /var/www/example.com/public_html/spesh/mobileapi/specialcron.php > /dev/null 2>&1

reference link


Ubuntu on Windows: How can I set the title bar to a remote server prompt?

Install 'xtitle' package first:

sudo apt-get install xtitle

#or from ubuntu 16+
sudo apt install xtitle

Then run this command to change the bash window title:

xtitle SOME_TITLE


Show all windows from all workspaces [Super + Shift + w] in Ubuntu 18.04.2 as in Ubuntu 16.04

You might try a gnome tweak: Overview All Windows

That gives you a list in the top bar of all windows in all workspaces. You can then select from that.
It needs a mouse to activate first though.
A further refinement would be a keyboard shortcut to use xdotool to do the mouse click.  It's not easy as that moves when the normal window max/min/fullscreen is showing to the right of it

Edit: additional

xdotool getmouselocation

Mine was:

x:1910 y:16 screen:0 window:0

xdotool mousemove 1910  16 && xdotool click 1

for multi monitors a refinement would be to focus the primary screen and execute it or find a way to get the top bar in both monitors and make the script get the coordinates of the currently focused screen.
my script which works ok for me when on primary monitor

#!/bin/bash
xdotool mousemove 1910  16
sleep 1
xdotool click 1

managed to get the primary screen focused.#bin/bash - need to inquire which is the primary screen as I change it around. alternatively do a different shortcut key for a different setup.

Get screen id from xrandr.

xdotool mousemove 1910  16 --screen HMDI-A-0
sleep 1
xdotool click 1

and execute it with keyboard shortcut.

bash "/home/<yourplace>/<yourscriptname>.sh"

the issue I had with the showallwindows icon being not in the top right corner was the gnome tweak Unite, and I had show window buttons in top bar, which I have disabled.

Got it to select the primary display

xrandr | grep primary |   cut -d " " -f1

so the hotkeyed script it now

#!/bin/bash
primaryscreen=$(xrandr | grep primary |   cut -d " " -f1)
echo "$screen"
xdotool mousemove 1910  16 --screen $primaryscreen
sleep 1
xdotool click 1

next step is to get those screen top left coordinates automatically

got it now only took 2 hours finds the primary screen's resolution, gets the coordinate of max x less 10, and takes 10 as the y coordinate which equates with the top left corner of the primary screen which has the top bar, and is the location of the showallwindows tweak icon.

#!/bin/bash
primaryscreen=$(xrandr | grep primary |   cut -d " " -f1)

coords=$(xrandr --current | sed -n 's/.* connected \([0-9]*\)x\([0-9]*\)+.*/\1x\2/p' )
xcoords=$(echo $coords | cut -d 'x' -f1)
ycoords=$(echo $coords | cut -d 'x' -f2)

xcoords=`expr $xcoords - 10`
# not used as only needs to be 10 ycoords=`expr $ycoords - 10`

xdotool mousemove  --sync  $xcoords 10 --screen $primaryscreen
sleep 1
xdotool click 1


You could try this command in terminal (found in http://ubuntuforums.org/showthread.php?t=1971196 this thread)

sudo apt-get install xserver-xorg-input-synaptics

Does your laptop by any chance have a built in keystroke (button press, combination of buttons to press etc) to enable/disable the touchpad?


Installed Ubuntu alongside Windows 10 and now Windows doesn't boot

I always get the same problem when I install Ubuntu to my nvme ssd hard drive alongside Windows 10.
I think the problem is related to uefi or mbr or efi or legacy which I know nothing about
But after searching for hours I always fix this problem with this method:
NOTE: this method not the easiest or the best, but at least it works

Burn Windows to USB

Plug the USB into your computer

Start the computer and press Esc (or whatever key you use to access the boot menu)

Select the USB in the boot menu

Choose language and press next

Select Repair your computer

Select Advanced

Select Command prompt

Enter the following commands:
bootrec /fixmb
bootrec /fixboot

Note: it's ok if the above step returned access denied or something like that
bootrec /rebuildbcd
bcdboot c:\windows /s c:

Then reboot and repeat the steps from number 3 to 7
Now instead of opening the command prompt choose Fix startup problems
After that you are done.


How to delete table cells in libreoffice draw?

Right click on a row, then go to Row >> Delete. The selected row will be deleted.

done!


Desktop icons shifting when external monitor is plugged in

I have the same issue when I connect my 2nd monitor, haven't found a solution yet but I did found a workaround, there is a package called ARandR that helps. Its in Ubuntu's repository, so to install it you only need to run the following command:

sudo apt-get install arandr

Then run it using:

arandr

Once you run the command it will open a window on which you will able to position your laptop display up and down and avoid the desktop Icons moving to any extended portion. The Downside of this workaround is that once you unplug the 2nd monitor the desktop icons will shift to the extended portion of you laptop screen.


What are the partitions to create if I want to dual boot ubuntu 12.10 with Windows 7?

I'd recommend having at least 4 primary partitions for a dual-booting computer: 1st for windows OS; 2nd for the Ubuntu file system (plus a logical partition to serve as a swap); a 3rd as a shared Data partition in NTFS to serve both operating systems -- vital for both security of data and to not have redundancies with my programs that sync massive amounts of data locally (Zotero, Dropbox, etc); and 4th as a /home/ folder for Ubuntu.

However, you may have discovered that Windows takes more than one primary partition (it gobbled up 3 in my case, and I was able to reduce it to just 2), which means you may have to set up /home/ partition as a logical partition under the Ubuntu partition. When doing future re-installations of Ubuntu, just make sure to not erase the logical partition for home, and remember to mount it as /home. This can be done during the 'do something else' stage of installing Ubuntu when you specify under which partitions to install Ubuntu and mount-points.


Package expect is not installed in gnome connectiom manager

The error message tell you that you must install expect package .
so the simple way to do is apt-get install expect .
Why did you not run apt-get install gnome-connection-manager  ?
apt-get will download and install all depencies


15.04 vivid vervet intermittent selective network outages

Since upgrading to Ubuntu 15.04 I have experienced similar problems of intermittent internet outages. I believe in my case this is an issue with the routing. The problem for me only happens when I am connected on the internet both through ethernet and through WiFi. The symptom is that I would occasionally lose internet connection for a few seconds. I clearly have a problem with the routing, as my WiFi connection shares priority with my ethernet connection for the addresses related to the DNS server. Check your DNS server address with:

cat /etc/resolv.conf

And your routing table with:

route -n

This issue seems related to a failure of network manager to set priority of ethernet over WiFi since the update to Ubuntu 15.04 and it is being described here:

  https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1436330

I have installed network-manager_0.9.10.0-4ubuntu16_amd64.deb libnm-util2_0.9.10.0-4ubuntu16_amd64.deb but I believe the issue is still not thoroughly fixed yet.


How to install a firmware update from an .exe file?

You're not going to be able to install it from the EXE file directly. Although WINE can run some Windows programs, it certainly is not going to support the low-level calls that the EXE would perform to initiate the update.
You have a couple options:

Many OEMs include a feature in the BIOS which lets the BIOS update itself from the update file on a USB flash drive. You might check to see if your BIOS supports this.
You might try booting a live Windows PE environment to run the update file from there.
Install a full copy of Windows 10 temporarily to a USB hard drive, and install from there
If you're adventurous you could try unpacking the actual BIOS ROM file from the EXE and flashing it directly to the BIOS EMMC block with dd, but I wouldn't really recommend that.


Why does switching users completely hang my system every time?

When you log out -> the login screen settings are governed by the root user(I think).
So any video settings relevant would be "different" (from the settings to your monitors and graphics as /user)
So if i were to take a stab in the dark, I would say general "Graphics error" (because i dont know enough information)
I recommend troubleshooting by logging in as "Ubuntu 2D" (As unity) or "Gnome Classic (no effects) if you have it installed, and then see if the 2D environment also crashes.
If they still crash, next successful logon change window managers via

    sudo dpkg-reconfigure gdm

Pending you have Gnome manager installed.
Mind you: this is, of course, only what i would do to try to deduce the problem.
The only thing that makes sense to me, is that somehow it wont let go of the video or a device.
Other ideas include -> removing extra USB devices(Ive personally had weird frezes because of different USB devices, one time a webcam.
let me know...


How to install Ktechlab in ubuntu 13.04?

In Browser: Go to http://apt-web.dahsy.at/ and search for ktechlab. Download all links.
In terminal :

cd files_path ; example : cd Downloads

Install all from terminal with:

dpkg -i *.deb

Note: You can use another apt-web website, if it's available in your country


"mcp power or thermal limit exceeded" excessive in messages.log

I found a possible solution in this blog post, to blacklist a particular kernel module.

It works for me.

Edit the file /etc/modprobe.d/blacklist.conf
Add at the end of the file add the text

blacklist intel_ips

Save the file and restart.


Best way to configure apache2 access rights

Usually, it is a bad idea to give write access to the account running the Web Server (www-data under Ubuntu).

For your scenario, I would change the owner of /var/www/html to the ftpuser with a read-write for him, read only for the group and the others. Apache needs at least to be able to read in this directory.

UPD: If you have more than one user to give access to, put them all in the same group, change the group ownership to this group and give the group read & write access too.

Security-wise, it is a bad idea to give Apache write access to all files he can access. If someone is able to do "nasty things" with your web server, at least he won't be able to change the files using Apache directly.

Don't forget to secure the installation of the FTP server you intend to use to let ftpuser upload files.

If Mediawiki needs to write on some files, I would give to these files only the read-write rights for the www-data user (by setting the owner of these files to www-data). If you cannot predict which files need to be writable by the web application, you'd better to isolate this application into a subfolder of ´/var/www/html´.

By experience, I know that when right access is needed on some of the file, usually the documentation of the application details exactly which ones.


Middle mouse button emulated even though disabled in xinput/libinput

It just occurred to me to test out with another mouse. No middle click.

This seems to be a physical (mis)feature of the PixArt Microsoft USB Optical Mouse.


How do I get the brightness keys working on an Acer AspireOne D255?

It seems as though this is a problem with at least a few different models of Acer laptops.  This is what worked for me.

When booting, hold down shift to enter GRUB (if it doesn't automatically), click 'e' in GRUB and add the following to the line that begins with 'linux':

acpi_osi=Linux acpi_backlight=vendor

NOTE: The 'L' in 'acpi_osi=Linux' needs to be capitalized.

Now hit go ahead save and boot.  Give it 30+ seconds to complete the boot process and then try to change the brightness using your keyboard (NOTE: Sometimes the increase and decrease brightness buttons are reversed.

If this works, add the proceeding line to your /etc/default/grub.

Hope this helps!


In order to install an application on the phone it has to be specifically compiled for Ubuntu Touch, so this ANJAL client (which is not for mobile but for netbooks from what I've read) won't work here.

So far the only native email client for Ubuntu Touch (though still in beta) is Dekko - https://uappexplorer.com/app/dekko.dekkoproject and you can install it from the app store.


You must be more precise. Generally answer is to enable firewall.
Ubuntu buildin firewall is ufw

With command

 sudo ufw enable

you will block all inbound traffic. Then you can allow traffic from only one host on port 80 with command

sudo ufw allow from ip_address_of_host to any port 80

or allow only port 22 on server from any host

sudo ufw allow 22/tcp

on allow trafic from some network range

sudo ufw allow from 192.168.1.0/24

For more complex rules you can also use iptables

Example, deny ping response to server with iptables

iptables -A OUTPUT -p icmp -o eth0 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -s 0/0 -i eth0 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type destination-unreachable -s 0/0 -i eth0 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type time-exceeded -s 0/0 -i eth0 -j ACCEPT
iptables -A INPUT -p icmp -i eth0 -j DROP

To deny access from specific host you can add rule

 sudo ufw deny from ip_address_of_host to any

To deny access from host to port 80

  sudo ufw deny from ip_address_of_host to any port 80

To see status of ufw

  sudo ufw status numbered

To delete some rule, list first numbered and after delete with

  sudo ufw delete number_of_rule

You can insert rule before existing

  sudo ufw insert 1 deny from ip_address_of_host to any port 80

then

  sudo ufw insert 2 allow 80

Rules on this way will deny ip_address_of_host to access server on port 80, but will allow any other

If you need more help, please comment my answer


problem installing Collada-dom 2.4.4 headers and build tools

The following worked for me:

sudo dpkg --purge --force-all collada-dom2.4-sp-dev

Then try

sudo apt-get install -f

I found this solution on the ROS forums at collada-dom2.4-sp-dev causes dist-upgrade to fail on ubuntu 14.04 Check there for more information.


Playonlinux website wont load? - change DNS nameserver

You mean http://www.playonlinux.com ? I can access it. Try again, maybe the server was just temporarily not available. And yes, you need wine, as playonlinux is just more or less a frontend to simplify handling wine.

ANSWER 2 - Setting a custom DNS nameserver:

Please follow those steps:

sudo cp /etc/resolv.conf /etc/resolv.backup to create a backup of the DNS configuration file.
sudo cp /etc/resolv.conf /etc/resolv.default to create another copy of the DNS configuration file.
sudo sed /nameserver/s/\b69.89.215.3\b/8.8.4.4/g /etc/resolv.default
sudo nano /etc/resolv.default opens an editor. Replace the old nameserver addresses (69.89.215.3,...) with the line nameserver 8.8.4.4.
To save, press [Ctrl]+[o] and hit enter. Exit with [Ctrl]+[x].
sudo echo "#!/bin/sh
cp /etc/resolv.default /etc/resolv.conf" > /etc/network/if-up.d/setnameserver.sh
sudo nano /etc/network/if-up.d/setnameserver.sh opens an editor on a new file. Please type the following:

#!/bin/sh
cp /etc/resolv.default /etc/resolv.conf

To save, press [Ctrl]+[o] and hit enter. Exit with [Ctrl]+[x].
This is to create a bash script that automatically replaces the current config file with our prepared default-copy on every network startup.
sudo chmod +x /etc/network/if-up.d/setnameserver.sh to make the script executable.

Maybe you have to do a reboot or at least reconnect to your network. After this, try again to browse the playonlinux.com site or test it with ping, traceroute or nslookup.


I want U1 to delay before uploading files

The easiest option is not to edit files inside of the Ubuntu One directory directly.

Edit them in another directory and just copy them to the Ubuntu One directory once you think that they should be synced.

There is no option to delay the upload of dirty files inside of the Ubuntu One directory.


Regexxer stopped working - it doesn't find the string

I don't have the program installed to test, but from a glance, it appears the problem in your example is the parentheses (). In most flavours of regex, parens are special characters that indicate a match group. So try escaping them:

If you can't see the \(Facebook\) Comments Box here

Otherwise, try a single word for example, like Facebook or Firefox or something.


Is there a file exists command in Ubuntu Terminal?

You can use the test command of the shell bash.

$ test -e ~/.bashrc && echo file exists || echo file not found
file exists
$ test -e ~/.bashrcx && echo file exists || echo file not found
file not found

The command

help test

prints a help text with the different options, that you can use with the test command.

You may also find the following help texts useful, as well as the links in a comment by @dessert,

help [

and

help [[

You can use the find command if you don't know where the file is (so that you must search for it in several directories) or you want to find different versions of the file.

$ sudo find / -name .bashrc
[sudo] password for sudodus:
/etc/skel/.bashrc
/root/.bashrc
find: ”/run/user/1002/gvfs”: Permission denied
/media/multimed-2/test/test/2015-04/colour-prompt/home/guru/.bashrc
/media/multimed-2/test/test/2015-04/colour-prompt/root/.bashrc
/media/multimed-2/test/test/2015-04/colour-prompt/etc/skel/.bashrc
/media/multimed-2/rsync-bup/nio/.bashrc
/home/lfs/.bashrc
/home/myself/.bashrc
/home/nio/.bashrc
/home/sudodus/.bashrc


I have installed Catalyst, but my GPU is not used (HD 7970M)

Open amdcccle(admin)
Enter Your Password
Go to Switchable Graphics
Select High Performance GPU for optimal graphics performance.
Press OK and reboot

Best of Luck


How do I run an I/O intensive application only when the computer is idle?

Use the ionice utility to set a command's I/O priority to idle - this way it won't hog your hard disk when you are working, potentially slowing you down.

The syntax is:

ionice -c 3 command-name

-c 3 sets I/O priority to idle. See man ionice for more information.
Don't forget to prefix sudo if the command itself requires sudo, e.g. updatedb
You can also use nice at the same time to set CPU priority to "idle" too, e.g.

sudo nice -19 ionice -c 3 updatedb

  Note: if the application is run via cron, you should also consider changing the scheduled time to when you least use your computer.


The mysql-server package isn't itself reconfigurable: as noted in apt show mysql-server it is just a dependency package:

 This is an empty package that depends on the current "best" version of
 mysql-server (currently mysql-server-5.7), as determined by the MySQL
 maintainers. Install this package if in doubt about which MySQL version
 you need. That will install the version recommended by the package
 maintainers.

You can see what the actual reconfigurable server package is by querying the debconf database:

$ debconf-show --listowners | grep mysql
mysql-server-5.7

So, in my case it should be

dpkg-reconfigure mysql-server-5.7


How can I check if a device is managed through NetworkManager?

grep -i renderer /etc/netplan/*.yaml will tell you if NetworkManager has been chosen. Also, your ethernet would show up as disabled or unmanaged if somebody wasn't managing it.

Create this file...

sudo -H gedit /etc/network/interfaces

add the following...

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

Reboot, or restart NetworkManager. Then nmcli device should show lo as managed. lo is the loopback device.


BOOT Error on (Failed to open \EFI\BOOT\mmx64.efi - Not found)

To fix this you will need to have a Live USB or Live DVD handy. Fortunately, it's not too difficult. Here's what you need to do:

Boot the machine using the Live USB / Live DVD and select "Try Ubuntu"

Once the Live session has finished booting, open a terminal

List the partitions on your notebook using fdisk:
sudo fdisk -l

You should see something like this:
Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1      2048    2000895   1998848   976M EFI System
/dev/nvme0n1p2   2000896  936214527 934213632 445.5G Linux filesystem
/dev/nvme0n1p3 936214528 1000214527  64000000  30.5G Linux swap

Note: Your machine might show device names like /dev/sda1, /dev/sda2, and so on.

Identify the device that is of type EFI System. This is where your computer boots from.

Mount the EFI System partition to /mnt so that you can access it:
sudo mount /dev/nvme0n1p1 /mnt

Note: Be sure to replace /dev/nmve0n1p1 with the proper device name for your computer's EFI System partition.

Switch to the super user:
sudo su

Change to the /boot/efi/EFI/ubuntu directory on the EFI partition:
cd /mnt/boot/efi/EFI/ubuntu

List the contents of the directory using ll. You should see something like this:
drwx------ 3 root root    4096  1月  6 14:39 ./
drwx------ 4 root root    4096  7月  2  2019 ../
-rwx------ 1 root root     108 10月  2 11:38 BOOTX64.CSV*
drwx------ 2 root root    4096  1月 20 00:20 fw/
-rwx------ 1 root root   60602  6月 19  2020 fwupdx64.efi*
-rwx------ 1 root root     117 10月  2 11:38 grub.cfg*
-rwx------ 1 root root 1681280 10月  2 11:38 grubx64.efi*
-rwx------ 1 root root 1277024 10月  2 11:38 mmx64.efi*
-rwx------ 1 root root 1341560 10月  2 11:38 shimx64.efi*

Identify and copy an .efi file.
• Do you have an mmx64.efi file in the list? Copy it to /boot/efi/EFI/BOOT:
cp mmx64.efi /mnt/boot/efi/EFI/BOOT/mmx64.efi

• If you do not have an mmx64.efi file but you do have grubx64.efi, copy that to /boot/efi/EFI/BOOT with the name mmx64.efi:
cp grubx64.efi /mnt/boot/efi/EFI/BOOT/mmx64.efi

Reboot the machine, remembering to remove the Live USB / DVD so that you boot from the hard drive.

This should resolve the issue.


I think you can try apt-get -f install linux-server.


I encountered the same problem. It seems to be regarding font choices for terminal. I found a pretty helpful site here:
Https://www.tecmint.com/change-console-fonts-in-Ubuntu-server/
I just went with the ‘UTF-8’, which I think is the default. And if you went to the site, it has a bunch of other windows that follow, I didn’t get any of those, just the first one.


PocketSphinx homepage
pocketsphinx package
Old thread but interesting: Pocketsphinx - Adding words and Improving accuracy


How to remove Firefox from update manager?

From the command line CTRL+ALT+T, what does the following buy you?

sudo apt-get install deborphan debfoster
sudo apt-get remove --purge firefox
sudo apt-get clean

The later will clean the /var directory.

sudo debfoster

The above command will show files and libraries still left after the apt-get remove --purge.  If you don't recognize a library, keep it.  Later on, deborphan will give you a list of 'orphaned' libraries that are hanging with no use, and are safe to nuke.

If you make a mistake with debfoster, type 'u' and will ask you again if you want to keep it. When you are thru with it, invoke deborphan.

sudo deborphan

The above command will give a list of libraries that are hanging just taking space.  To get rid of them, use the following command:

sudo deborphan | xargs apt-get -y remove purge
sudo apt-get clean


Error on Integer Expression and Unary Operator

Use shellcheck: (Read man shellcheck)

walt@bat:~(0)$ cat >foo.sh
#!/bin/sh
#!/bin/bash

echo "File size you want to archive"
read size

echo "File name to archive"
read name

echo "Path to archive"
read path

echo "Size is: $size filename is: $name path is: $path"

a=99k
b=100k

if [ $size -lt $a] #line 19
then
echo "Refused to archive"
elif [ $size -lt $b] #line 22
then
find $path -type f -size +$size | tar cvzf ~/$name.tar.gz
else
echo "Wrong input"
fi
walt@bat:~(0)$ shellcheck foo.sh

In foo.sh line 18:
if [ $size -lt $a] #line 19
^-- SC1009: The mentioned parser error was in this if expression.
   ^-- SC1073: Couldn't parse this test expression.
                  ^-- SC1020: You need a space before the ].
                  ^-- SC1072: Missing space before ]. Fix any mentioned problems and try again.

walt@bat:~(1)$


You want to enable xenial-updates for universe packages in your apt sources.list, you can do this either by going into /etc/apt/sources.list and adding xenial-updates. Here are some lines to add to your /etc/apt/sources.list that would enable -updates for main, universe and multiverse using the main archive:

deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial-updates main restricted
deb http://archive.ubuntu.com/ubuntu xenial-updates universe
deb-src http://archive.ubuntu.com/ubuntu xenial-updates universe
deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-updates multiverse

Then run

apt update
apt install snapcraft

Alternatively,

open "Software & Updates"
go to the "Updates" tab
click on "Recommended updates (xenial-updates)"

apt install snapcraft from a terminal


How can I set up dual-boot with Windows on my SSD and Ubuntu on my HDD?

You would choose something else:

At the partition table you will recognize your free space on /dev/sdb unallocated space.

Make a new partition on this as big as your ram size and choose SWAP.

Then make a new partition about 500MB and choose EFI

Finally make a partition with filesystem EXT4 and mountpoint should be /
filling the rest of your unallocated space.

Make sure it says install bootloader on /dev/sda at the bottom or if it asks where


Problem loading Upwork in Ubuntu 16.04 Xenial

As I found an answer at Upwork Community Forum posted by Dmitriy K :

  In ubuntu 16.04 Xenial Xerus (should work also on debian-based
  systems).

  Issue resolved by downgrading libnss3 package to 3.19. This can be
  done by entering these commands.

Unhold previously holded packages:

apt-mark unhold libnss3 libnss3-nssdb

(for 64 bit)

mkdir -p /tmp/libnss-tmp
wget http://security.ubuntu.com/ubuntu/pool/main/n/nss/
libnss3_3.19.2-1ubuntu1_amd64.deb -O /tmp/libnss-tmp/libnss3_amd64.deb
dpkg -x /tmp/libnss-tmp/libnss3_amd64.deb /tmp/libnss-tmp
sudo cp -rf /tmp/libnss-tmp/usr/lib/x86_64-linux-gnu/* /usr/share/upwork
rm /tmp/libnss-tmp -rf

(for 32 bit)

mkdir -p /tmp/libnss-tmp
wget http://security.ubuntu.com/ubuntu/pool/main/n/nss
/libnss3_3.19.2-1ubuntu1_i386.deb -O /tmp/libnss-tmp/libnss3_i386.deb
dpkg -x /tmp/libnss-tmp/libnss3_i386.deb /tmp/libnss-tmp
sudo cp -rf /tmp/libnss-tmp/usr/lib/i386-linux-gnu/* /usr/share/upwork
rm /tmp/libnss-tmp -rf

The answer for Ubuntu 15.10 is here - Problem Loading UPWORK


How do I call `dbus` code that monitors when screen is locked/unlocked?

The script

As mentioned in comments, a slightly improved version is posted here (with the help of @Serg and @muru):

dbus-monitor --session "type='signal',interface='com.ubuntu.Upstart0_6'" | \
(
  while read X; do
    if [[ "$X" =~ desktop-lock ]]; then
      SCREEN_LOCKED;
    elif [[ "$X" =~ desktop-unlock ]]; then
      SCREEN_UNLOCKED;
    fi
  done
)

Where to store it?

You can store it anywhere you like in your $HOME directory if it is for your user only, or in /usr/local/bin if you want it to be available for other users.

When to run?

dbus-monitor runs locally. I would therefore simply add the script to Startup Applications: Dash > Startup Applications > Add. Add the command to run the script, best make it executable, and subsequently simply add the command:

/path/to/script

Possibly, since the script involves the GUI, you need to wait until the UI is fully loaded. In that case, use:

/bin/bash -c "sleep 10 && /path/to/script"

Note

All the script does is wait for the state to change, listening to the communication between processes on your system. It does not add any noticeable burden to your system.


Can't shrink ubuntu 14.10 partition, GParted shows drive is full but only 6.6GB is used

You are using Logical Volumes and GParted doesn't know about them.

Use the Logical Volume Manager's UI: system-config-lvm to manage this kind of volume instead of gparted.


How can I enable brightness hotkeys for Asus ROG 752 in Ubuntu 16.04?

I had the same problem but updated to kernel 4.12 and most of the problems went away. I followed the instructions suggested here.

Don't forget to update grub after the kernel installation and before reboot with

sudo update-grub


After installing mysqli phpmyadmin stop loading

php5-mysqli has been replaced by php5-mysql

Install your php5 again using :

sudo apt-get install php5

Install php5-mysql using :

sudo apt-get install php5-mysql


The symptoms you describe are a lot like the bugs http://pad.lv/360253 and http://pad.lv/625192 so I suggest you add some debugging information to the latter.  See https://wiki.ubuntu.com/Apport for how to get a crash file to attach to the bug.

  As an aside, how can I make zsh the default terminal?

It's a shell, not a terminal.  But to change it just for your account, you want

chsh -s /bin/sh

and to change it for newly-added accounts, change DSHELL in /etc/adduser.conf.


I cannot delete anything in my archive folder

open the terminal and type

sudo -i

Enter the required password for your system. then type

cd /var/cache/apt/archives/

To check the whole list of packages in the archive folder, type

ls

To remove any package, Type

rm package_name.deb

Hope it helps.


Introduction

The script bellow waits for user-defined device to be connected and sets appropriate values , continuously repeating the process , thus allowing the user to connect and disconnect device multiple time during session.

It reads user - defined settings in ~/.xinputmonrc file, which must be created before launching the script

Usage

As shown by -h option:

usage: xinput_monitor.py [-h] [-q] -d DEVICE

Script that waits for presence of user device and sets preferences as defined in
~/.xinputmonrc file

optional arguments:
  -h, --help            show this help message and exit
  -q, --quiet           Blocks on-screen notifications
  -d DEVICE, --device DEVICE
                        device name

NOTE: As stated in the description, the file reads ~/.xinputmonrc where ~ is your home directory. Example of such file (note array usage for properties that require multiple values):

{
 "Device Accel Constant Deceleration":5,
 "Evdev Scrolling Distance":[1,1,1]
}

Suppose we have Logitech USB Receiver device listed in xinput output. The script can be called like so:

python3 xinput_monitor.py -d "Logitech USB Receiver"

The script will issue a notification that monitoring has started:

Once the device is connected, it will issue notification that device has been detected:

If everything is OK , the script proceeds silently and waits till device is disconnected：

The -q option allows silencing all the notification bubbles.

Obtaining the script

The source code is available in this post and as Gist on Github

You can copy the source code from here, save it as xinput_monitor.py , and make executable with chmod +x xinput_monitor.py terminal command in whichever directory you saved it.

Source code

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: Sergiy Kolodyazhnyy
Date:  August 2nd, 2016
Written for: https://askubuntu.com/q/806212/295286
Tested on Ubuntu 16.04 LTS

usage: xinput_monitor.py [-h] [-q] -d DEVICE

Script that waits for presence of user device
and sets preferences as defined
in ~/.xinputmonrc file

optional arguments:
  -h, --help            show this help message and exit
  -q, --quiet           Blocks on-screen notifications
  -d DEVICE, --device DEVICE
                        device name

"""
from __future__ import print_function
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
import subprocess
import argparse
import time
import json
import os

def send_notif(n,title, text):
    try:
        if Notify.init(__file__):
            # n = Notify.Notification.new("Notify")
            n.update(title, text)
            n.set_urgency(2)
            if not n.show():
                raise SyntaxError("sending notification failed!")
        else:
            raise SyntaxError("can't initialize notification!")
    except SyntaxError as error:
        print(error)
        if error == "sending notification failed!":
            Notify.uninit()
    else:
        Notify.uninit()

def run_cmd(cmdlist):
    """ Reusable function for running shell commands"""
    try:
        stdout = subprocess.check_output(cmdlist)
    except subprocess.CalledProcessError as pserror:
        return pserror.output.decode().strip()
        #sys.exit(1)
    else:
        if stdout:
            return stdout.decode().strip()

def list_ids(mouse_name):
    """ Returns list of ids for the same device"""
    #while True:
    mouse_ids = []
    for dev_id in run_cmd(['xinput','list','--id-only']).split('\n'):
        if mouse_name in run_cmd(['xinput','list','--name-only',dev_id]):
           mouse_ids.append(dev_id)
    return mouse_ids

def read_config_file(notif):

    """ reads ~/.xinputmonrc  file """
    rcfile = os.path.join( os.path.expanduser('~'),'.xinputmonrc')
    try:
        with open(rcfile) as config_file:
            config_data = json.load(config_file)
    except IOError as error:
        send_notif(notif, __file__ , error.__repr__()  )
    else:
        if config_data:
            return config_data

def set_props(notif,device):
    """Sets properties per each device is
       given by list_ids() function"""

    props = read_config_file(notif)
    # Thiscan also be set manually as in
    # commented-out example below

    #props = { 'Device Accel Profile':'-1',
    #          'Device Accel Constant Deceleration':'3.5',
    #          'Device Accel Velocity Scaling':'1.0'   }

    if not props:
        send_notif(notif,'Reading ~/.xinputmonrc failed',
                   'Please write proper rc file.')
        return None
    """ set all property-value pair per each device id
        Uncomment the print function if you wish to know
        which ids have been altered for double-checking
        with xinput list-props"""
    for dev_id in list_ids(device):
        # print(dev_id)
        for prop,value in props.items():
            if type(value) is not list:
                value = [value]
            run_cmd(['xinput','set-prop',dev_id,prop] +
                    [str(item) for item in value ])

def parse_args():
    """ Parse command line arguments"""
    arg_parser = argparse.ArgumentParser(
                 description="""Script that waits for """ +
                             """presence of user device """+
                             """and sets preferences as """ +
                             """defined in ~/.xinputmonrc file""")
    arg_parser.add_argument(
                '-q','--quiet', action='store_true',
                help='Blocks on-screen notifications',
                required=False)

    arg_parser.add_argument(
                '-d','--device',
                help='device name',
                type=str,
                required=True)
    return arg_parser.parse_args()

def main():
    notif = Notify.Notification.new("Notify")
    args = parse_args()
    while True:
         if not args.quiet:
             send_notif(notif, __file__ ,
                        'Wating for ' + args.device )
         while args.device not in run_cmd(['xinput','list','--name-only']):
             time.sleep(0.25)
             pass
         time.sleep(0.25) # let xinput catch up
         if not args.quiet:
             send_notif(notif, __file__,
                        args.device + ' connected. Setting values')
         # set props here
         set_props(notif,args.device)
         while args.device in run_cmd(['xinput','list','--name-only']):
             time.sleep(0.25)
             pass
         if not args.quiet:
             send_notif( notif , __file__ , args.device +
                         ' disconnected. Resuming monitoring' )

if __name__ == '__main__':
    main()

Notes

Multiple instances can be started to monitor multiple devices but this is not recommended because multiple instances read the same config file.
Script is python 3 and python 2 compatible, can run with either.
Consult How can I edit/create new launcher items in Unity by hand? for creating a launcher or desktop shortcut for this script , if you desire to launch it with double-click
In order to link this script to a keyboard shortcut for easy access, consult  How to add keyboard shortcuts?


System refuses to boot at the first attempt

Reiserfs support in grub does not get much testing as Reiserfs usage has been declining. GRUB 1.99 rc1 (shipped in Ubuntu 11.04) contains some Reiserfs fixes, though I don't think that the bug fixed would present itself with your precise symptoms. Please try upgrading to grub 1.99 rc1 or newer and if you can still reproduce the problem please file a bug report.

That said though, I'd recommend going with ext{3,4} for production systems as it's just better supported in general.


How to store downloaded data in bootable usb ubuntu 20.04 while trying it without installing

The installer LiveUSB is READ-ONLY.

You cannot save data to the USB stick, sorry.
Advice: Save it to someplace online before you end your session.

It is possible to create a writable partition to the USB stick (we call that persistence.) However, that must be done when creating the USB installer on the stick. After booting from the USB stick is much too late.


I just found out that with the F4 key, a user can toggle between terminal visibility options.


What is responsible for mounting disks listed in fstab?

It is the upstart job configured in

/etc/init/mountall.conf

that in turn calls the ELF executable /sbin/mountall.


You can try nmap, it's console based, but you can install nmapsi4 which is a very easy to use gui.

sudo apt-get install nmapsi4

This will install both packages.


Why does LibreOffice Calc paste a cell as a graphic?

Because you are experiencing a bug. You did not tell, but you are using Ubuntu 19.10 or later. The Gnome developpers recoded clipboard functionality in a more recent version of window manager mutter, and as a result, the clipboard is a little broken right now. One of the more visible side effects is what you see now in Calc, but also in other occasions, you will experience that sometimes some older entry than the one you see are pasted. You will, like myself, blame it on yourself, but no, it is a current issue. I hope it will be corrected anytime soon. Currently, also Ubuntu 20.04 is plagued.

Workaround:

Use the Wayland display server instead of Xorg (but that has other issues). The issue of mutter is only with xorg.
Alternatively, be very careful with copy/paste and double check. Systematically pressing Ctrl+c twice will in most cases be fine.

See the Ubuntu bug report here.


Keyboard, Touchpad and external mouse not working after Nvidia driver uninstallation, xorg reinstallation

I also had the same problem. Just reinstall your desktop environment and it'll be solved.
sudo apt-get install <Your Desktop Environment name>


Internet not working (partially) on Ubuntu 16.04

Edit the /etc/resolv.conf file and change the first: nameserver to nameserver 8.8.8.8 save and exit and try to ping www.google.com again. If that works you need to fix your DHCP to send this as DNS (if you are using DHCP and not static).

If you are using static ip, you have to set the following parameter in the /etc/network/interfaces file:

dns-nameserver 8.8.8.8


Black Screen on Ubuntu Install + garbled installer

To fix the issue I used nomodeset in the grub menu on the 'linux' line. This puts it in a worse graphics mode but only to install. I then installed my drivers when installed.


Pipelight stopped functioning after HBO new web update in mid April, 2015

I tried a few different solutions and the one that I found worked the best was to install Play On Linux first. Once you install that, install Firefox in Play on Linux. I tried it with IE, but the version was too old.


Cloning Textmate's functionality with Vim

snipMate.vim

For Textmate style snippet expansion in Vim.

http://www.vim.org/scripts/script.php?script_id=2540


No audio after "apt upgrade --with-new-pkgs" (Ubuntu 20.04 LTS)

Not a fix, but a workaround : if you still have the previous kernel image (5.4.0-59 in my case), you can boot with it by selecting it from the Grub menu. As a bonus, it also solves the Bluetooth issue.
By chance, I didn't run apt autoremove...
D.


Enable VNC on Ubuntu 18.04 Minimal Installation

To your working ssh setup, add a vnc server like x11vnc to your server and a viewer like xtightvncviewer to your remote machine. For outside the local network, ensure you have a passthrough for your ssh (port 5900 will be tunneled, so nothing special needed for it).
X should be running on the server, but no existing login is needed (you will connect to the login screen).  No other special services needed on the server.

From the remote, use ssh to start the x11vnc server, and tunnel port 5900 back to the remote (assumed to be on ...131 on the local network). In a terminal type:

ssh -t -L 5900:localhost:5900 192.168.1.131 "sudo x11vnc -localhost -create -auth guess  -display :0"

The output should indicate a successful connection. Leave this terminal and in another, start the vnc viewer on the (tunneled local port 5900):

xtightvncviewer -encodings RRE -bgr233 localhost::5900

The encodings and option improve performance for me, but are optional.  A new window should open with the server login screen displayed.  Login to the desktop you set up.

If you want to leave the server program running over multiple invocations of the viewer, you may use the -forever option, but with the above, the server will close the x11vnc program when the viewer exits.


How to fix Apache active (exited) error?

I just solved it myself, in my case it turns out that I accidently messed up with apache2.conf file in etc/apache2 so one of the things that can be done is to first delete your config files and then reinstall Apache again.

Steps:

Stopping Apache if already running with sudo service apache2 stop

Checking Apache's status to confirm if it is stopped with sudo service apache2 status

Deleting the config files with sudo apt purge apache2

Removing Apache with sudo apt remove apache2

Reinstalling it with sudo apt install apache2

Setup your config files, and then try running the server again.


unable to connect mobile broadband ubuntu 12.10

first be sure to have all info about your contract with provider, than click on network button on top of the screen, and select : edit connections.

when that window is opened select: mobile broadband.

next click on add.

then select your device or select any if not on list.

select your country, provider and contract type in next steps, than just create. also check on that network menu (after clicking on network button on top of screen) that:

first- networking is enabled (checked)

also- mobilebroadband is enabled (checked)

after creating, unplug and plug device back in, after few seconds, click network button, and click on that created network when you see it on the list. if not work this, leave me comment i will see what could be.


/etc/apt/preferences.d/99-Prohibit-Snapd

Package: snapd
Pin: release a=*
Pin-Priority: -10

This config prohibits snapd installation completely.
So any package depend on it could not be installed whith error message:

The following packages have unmet dependencies:
 some-package: PreDepends: snapd but it is not installable
E: Unable to correct problems, you have held broken packages.


There is one workaround: start your system and wait until it boots up. Press ctrl+alt+F1 to switch to a text console. Log in with your user, and after using sudo, use your favorite editor to edit the xorg.conf.
For example:

sudo nano /etc/x11/xorg.conf

About the other question regarding why you can't edit the file from the live cd: there can be more reasons you cannot edit your installed system's files.

Some of these reasons can be:

When you boot from the live cd the user that the installer uses when launching a terminal is not root. Therfore you have to execute "sudo -s" at the terminal window to become root so you can edit the file on the already mounted FS.
The FS (filesystem)  that contains your installed OS is mounted as read-only. In this case you have to remount it as rw.

To detect if a FS is mounted as read-only:

sudo mount /mnt/mount_point | grep ro

If this command returns a line then the mounted FS is mounted as read-only.

To remount a read-only mounted FS as writable:

sudo mount /dev/block_device_id /mnt/ -o remount,rw


The problem has been solved by adding those strings:

-A INPUT -p udp -m udp --dport 1024:65535 --sport 53 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 1024:65535 --sport 53 -j ACCEPT
-A INPUT -i lo -j ACCEPT


You can do it by a terminal command in a directory where these files are located.

rename 's/^video_//' *.mp4

That means select all filenames started with video_ and replace video_ with nothing. I guess s is for "substitute".

^ shows the beginning of string. If you omit ^, the first occurrence of video_ will be removed no matter where it is located in the string. But in your case it does not really matter.

Note: Ubuntu versions above 17.04 don't ship with rename package, however you can still install it from default repositories via sudo apt install rename


How to completely remove Xubuntu and install Ubuntu (including boot screen etc.)

Best way to do this is to open up /var/log/apt/history.log (or history.log.[n].gz) and find the command you ran to install xubuntu-desktop. There's a list of packages there that were specifically installed due to this command. You can run sudo apt-get remove with the packages here, and then sudo apt-get install ubuntu-desktop to restore your system to the earlier state.


Cant change name of internal webcam via udev rules Ubuntu 14.04

Try dmesg | grep udev ...

I am getting:

  [   20.553766] systemd-udevd[291]: NAME="video1" ignored, kernel device nodes can not be renamed; please fix it in /etc/udev/rules.d/99-internal-webcam.rules:2

You will notice in the documentation that only network devices can be renamed... for the others, you only have the choice to create a symlink and use that to identify your device.


SFTP Default Folder & Limiting Access With chroot

I believe you need to change the entry 'ChrootDirectory /var/sftp/' in sshd_config to something like 'ChrootDirectory /var/sftp/my_username'


I found this manual which helped me much

https://www.debian.org/doc/manuals/repository-howto/repository-howto.en.html


Now with Gnome in Ubuntu 18.04 how to Integrate wine systray with real one

You can use the Tray Icons extension by zhangkaizhao.
TopIcons, which sjuk's earlier answer recommends, doesn't work anymore.
Tray Icons is based on an older extension, TopIcons Plus, which is similar to TopIcons. As the Tray Icons README says:

Tray Icons
Simple version of TopIcons
Plus.
Base on TopIcons Plus v22 from GNOME Shell
Extensions.
Keep it as simple as possible.


How can I create a symlink to the location that Ubuntu 10.10 mounts a CD?

Tried /etc/fstab yet? For a CD-RW...

sudo mkdir /media/cdrw
gksudo gedit /etc/fstab

Add a line...

/dev/sdc /media/cdrw udf,iso9660 users,noauto,rw 0 0

Save and pop in a CD.


How can I remove the default indicators and add custom ones?

You can no longer add/remove indicators or panels by right-clicking like you used to with older Ubuntu versions before 11.10.

  Warning: The default indicators (messages, networking, power, sound, user accounts, etc.) are tightly integrated with Unity since Ubuntu 11.10, and trying to remove them may cause problems.

You can remove these default indicators without affecting the rest of the system:

Messages: Remove package indicator-messages
Sound: Remove package indicator-sound
Power: Remove package indicator-power
Print Jobs: Remove package indicator-printers
Date/Time: Simply enable/disable from System Settings...Time & Date:

Removing these default indicators is NOT recommended or not possible without serious adverse effects:

Networking: Provided by package network-manager-gnome. DO NOT remove unless you have a desktop with one wired ethernet connection and do not use VPNs.
User Accounts and System: Both provided by the package indicator-session. Removing this package will remove the Shutdown, Logout, etc. options as well!

Editing the list shown in the System Menu (Startup Applications, Printers, etc.) is NOT possible without modifying the source.

Adding other indicators

Please see this question for a master-list of all the different indicators -- each answer/comments will tell you if it is available from PPAs or the Software Center:

  What Application Indicators are available?


Why my windows os was recovered to Ubuntu through dell recovery?

There is a hidden partition on your system where Dell put an ISO into of the version of the operating system that originally was on that system (in your case Ubuntu).

Your operating system has a couple of function keys during boot set to do something special. Enter the BIOS for instance. And one to restore to factory settings. In GRUB it is a special line:

Mind though that, for this to work from Ubuntu, you need to do more than just that. From the dell site:

You will also need to confirm the restore.

  Is it because my windows license has expired?

No, it is because of an action you did.

How Windows does this is not up to us to answer ;)


Did you change the theme with the Appearance manager?

If you changed it, try to change it back to the standard theme.

If it really has to do with your GPU, I'd install "Additional Drivers".

Unity isn't stable yet, so that could also be a bug, if nothing of these suggestions worked, please create a bug report:
https://bugs.launchpad.net/unity

I hope this helped you,
Daniel


how can i use a domain to point to my server?

This is a general DOMAIN NAME  question not specific for Ubuntu.

You need to login to your registrar account and create an A record for server.domain.com pointing to your home static public IP address provided by your ISP/Telco. The 192.168.2.47 is a private ip address therefore you can't point your domain name A record into it.


There are 2 ways you can upgrade to 16.04 LTS, using software and update or terminal

Software and update

In software and update window on the 3rd tab you can find the os updates just click install.

Update Ubuntu using software and update

Terminal

Check this article hope that I helps you

For short here are some commads to do upgrade from ubuntu 15.10 wily werewolf to ubuntu 16.04 xenial xerus (LTS), open a new Terminal and type them one by one

sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade

at last :

sudo update-manager -d

and click upgrade and continue by choosing upgrade and start upgrade till it starts upgrading


What is the most appropriate git server for Ubuntu 14.04?

I use Gitlab (which used to be based on gitolite but now uses their own gitlab-shell). The Community Edition is relatively easy to set up on Ubuntu (compared to, say Gitorious), since it is a monolithic Debian package. The software is well-maintained (I think at least a release around every couple of months).

Of course, whether you need the features (web UI, LDAP, etc.) that Gitlab offers is open to debate.

I should also point out that the LTS Server Guide uses Gitolite for setting up a git server ("[the] suggested solution"). This should not be seen as an official endorsement, since the LTS guide also ignores nginx in favour of Apache when it comes to web servers.


Found a workaround here which is based on an Arch thread here. From what I understood, it's just a problem with Firefox not properly supporting a certain mime-type.

Edit /usr/share/mime/packages/freedesktop.org.xml as root and replace the following:

<mime-type type="application/vnd.adobe.flash.movie">

With:

<mime-type type="application/x-shockwave-flash">

And then run:

sudo update-mime-database /usr/share/mime

Got local .swf files working properly now.


Xenial (16.04) cannot find package libboost-all-dev

Try adding the repository (http://packages.ubuntu.com/search?keywords=libboost-all-dev)

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install libboost-all-dev


How to get File Size in BASH with readable size not in bytes

You cannot set a shell variable from a child process - so setting FILESIZEINGB wouldn't work anyway (and it wouldn't work because that means something else in awk syntax).

Just use du -h:

FILESIZEINGB=$(du -h "$FILENAME" | awk '{print $1}')

Also:

You shouldn't have a space after =.


While this is not Ubuntu specific, a similar question is 264258. Just like you edit ~/.vimrc before, put in your own commands:

  set background=dark
  highlight Normal ctermfg=grey ctermbg=white

The help file might can give you more background.

  :help vimrc-intro


Crash after modifying rc.local file to solve overheating issue

Linux now supports Hybrid Graphics Systems. For Nvidia Hybrid Graphics you need following packages.

sudo apt-get install nvidia-319 nvidia-settings-319 nvidia-prime

you can find a review about the working and functioning of the Nvidia Hybrid Graphics on Ubuntu on Webupd8.


Should I re-install GRUB when installing new linux distro?

There is no problem in installing Grub again.

Infact it will automatically detect previous installations, i.e.:

Kali Linux
Ubuntu
Windows 8 loader

and make all entries available in grub.


How to check which application will open when I click on Launcher Icon?

First run the following command and find the .desktop file associated to the launcher

gsettings get com.canonical.Unity.Launcher favorites

(I presume the unknown app icon is pinned to the Unity launcher).

Then look for the .desktop file in /usr/share/applications/ or ~/.local/share/applications/. Once you found the correct .desktop file, open it with a text-editor and look for the Exec= line. That should tell you about the application.


Clear your apt cache

sudo apt-get clean

Install Ubuntu desktop and force a re-install

sudo apt-get install --reinstall ubuntu-desktop

This will install all the packages necessary from the desktop to run, you should see Ubuntu as an option next time you reboot.


What is the difference between Ubuntu+XFCE and Xubuntu?

There is an xubuntu live (desktop) cd available here :

http://xubuntu.org/getxubuntu/

xfce is a desktop environment , see http://www.xfce.org/ and http://xwinman.org/

So when you install xfce you get xfce.

xubuntu, however, is an additional set of packages and customizations to make the xfce experience more rich. xubuntu-desktop is a meta package and you can see the entire list of packages here

http://www.ubuntu.com/about/about-ubuntu/derivatives

As you can see the list includes xfce + a number of additional packages.

See also https://help.ubuntu.com/community/Installation/LowMemorySystems#XFCE

Use which ever you prefer, from your post I would suggest you stay with Ubuntu (unity).


Windows not booting in dual boot with Ubuntu 12.04 and Windows 7

Try opening Ubuntu terminal and executing command

  sudo update-grub


Ubuntu auto-detect Nvidia driver version for install

Run

ubuntu-drivers devices

This should recommend the right driver.


How are bugs classified as "by 12.04 standards"?

Bugreport explains it:

This is a special case of the general problem, "show me errors, in version Y, of types that were also captured in version X".
For a particularly thorny example, imagine that Ubuntu 12.10 reports hangs of 30 seconds or longer, while Ubuntu 13.04 ratchets that down to 10 seconds or longer. On the graph, hangs of over 30 seconds should show up on the "13.04 by 12.10 standards" line, while hangs of between 10 and 30 seconds should not.

and

This is fixed in production. We now have a separate line for "by 12.04 standards." Matthew, you mentioned that we need some way of tracking the usage of recoverable errors, as we don't want its usage growth among developers to add noise to the graph. I've filed bug 1084079 for that.

There is also bugreport that has an explanation:

Error reports collected from Ubuntu 12.04 include application crashes and thread crashes.
Error reports collected from Ubuntu 12.10 include application crashes, thread crashes, and recoverable application errors.
This may account for much of the current difference between Ubuntu 12.04 and 12.10 in the http://errors.ubuntu.com/ graph, since the two most common errors currently are recoverable application errors in Ubuntu Software Center.
This can be fixed by Ubuntu 12.10 having a "by 12.04 standards" dotted line on the graph.


A utility that has been a great success for many users with a modern scanner is sane-airscan. The file you want to install is here.
If it works for you, I would be very interested in the outputs you get for scanimage -L and airscan-discover. It would help other users.


How do I change the date format in Gnome 3 shell?

Open a terminal and set

gsettings set org.gnome.desktop.interface clock-show-date true

YMMW - this did work for me on Fedora 19.


Ubuntu 16.04 not showing up 1650x1080 res

After do this, you should change a file. To do this put in terminal:

gedit /etc/X11/xorg.conf

And in the line "Modes ..." put "1650x1080@75" the first element.
The line will be:

Modes "1650x1080@75" "..." ...

After modificate, save the changes and restart your computer.

Good luck!


Upgrade to Ubuntu Gnome 16.04 LTS from 15.10

Go under SystemSettings -> Software&Updates to "Ubuntu Software" tab. Try setting there the in "Download from" field to "Main Server". I had similar problem with my preset server not working always. You can also select the "Other.." option instead of "Main Server". A window will open where you can click on "Select Best Server" and let Ubuntu find the best/closest/fastest option.


Lubuntu is radically faster than most other desktops and requires very little RAM. It's the same operating system, though. It's just a different desktop. You can install the LXDE desktop in Ubuntu by following this link: https://apps.ubuntu.com/cat/applications/natty/lxde/

Note that this will not be the same as Lubuntu. Lubuntu contains Chromium instead of Firefox, etc. Installing LXDE will not install those extra packages, only the desktop. You can then choose to login with LXDE by pressing the button next to the password field when you log into Ubuntu. Note that Lubuntu also uses some nice themes and things that aren't part of the LXDE package.

To install the entire Lubuntu package, use this link: https://apps.ubuntu.com/cat/applications/natty/lubuntu-desktop/


My ubuntu on PC boots to a black screen, after installing firmware-b43-installer

The issue has fixed using the following page:
How to Fix Display Problems on Ubuntu
Thanks a lot her/him.


Downloaded, burned to DVD - rebooted but when I choose CD to boot it just goes back to windows

It seems like you're just copying the ISO file to a DVD or USB.  As you're currently running XP, just install ImgBurn, open the ISO file in there and then burn it and boot with that.

Alternatively, if you want to use the USB use UNetbootin (it has a Windows version) and use that to put the ISO file on there.

Why?  An ISO file is an image that contains the files you need to run (like a ZIP file)


Blackberry, Barry Desktop, UBUNTU 14, OpenSync

My blackberry is french so not sure of the name of the files.

On your BB:
- Go to parameters / Storage and acess
- here you have to enable Wifi access
- Change the wifi password
- Then click on network information to get your domain name and user name.

Then connect with USB your BB to the computer.

On the computer:
- Clic on your file directory
- Then clic on "Parcourir le réseau" in french so maybe "explore the network" ?
- Explore the different directories (there's one named "windows network" ?)
- Find your Blackberry directory and clic on it, a pop up will ask you your User name, Domain name and password you found and changed on your BB.

Then it works for me.


How can I pair up wiimote plus to my Ubuntu 12.04 machine?

You can try to use the GetDeb installer for wiican here if you want, according to the WiiCan project on Launchpad, GetDeb manages the debian packages for that project.

I noticed you mentioned 'wiican' in your question, so I thought I'd help out here.

To use the GetDeb Package and Repository on 12.04:(http://www.getdeb.net/updates/Ubuntu/12.04/#how_to_install)
Use the following instructions:

1: Install the getdeb package.

Or configure the repository manually:

  Go to System-Administration-Software Sources, Third-Party Software tab, Add:
      deb http://archive.getdeb.net/ubuntu precise-getdeb apps

  Add the repository GPG key, open a terminal window and type:
      wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -

2: Run sudo apt-get update in terminal.

3: Click the "Install this now" button below the screenshot of the desired application.

4: If you are using Kubuntu please check bug 476853.

5: If the application cannot be found, run this command and try again: sudo apt-get update

Then try installing the package you are looking to install (wiican).

If that doesn't work, you may need to google around to find the correct pairing pin for the wiimote.  (note that for almost every bluetooth device, a secure pairing pin is used.  it prevents malicious access to devices)


How to install Edubuntu from normal Ubuntu

Open a terminal and enter

sudo apt-get update

Then once you're sure all your repositories are up to date enter

sudo apt-get install edubuntu-desktop

Doing that should get you the Edubuntu desktop, as installing the other desktops from a default Ubuntu install are pretty much the same, just with the name of the desktop, such as

sudo apt-get install xubuntu-desktop

to install Xubuntu on top of a default Ubuntu install, or

sudo apt-get install kubuntu-desktop

to install the Kubuntu desktop on top a default Ubuntu install


Save each PDF file of a directory as another PDF (operation similar to print a PDF as a PDF)

You can achieve what you want most easily with the help of Ghostscript. I successfully tested this with Ghostscript version 9.26:

gs                  \
  -o out.pdf        \
  -sDEVICE=pdfwrite \
   in.pdf

I must admit, I do not really comprehend your problem with the EOF marker in the unmodified example file here, because I can clearly see this EOF marker being present in it.

However, I see an additional problem which shows in your 'corrected' example file here: this one now uses a page size of A4 (595 x 842 pts) with large white margins, whereas your unmodified file has small margins and a page size of 362 x 558 pts (which is less than half of A4!)

My method has the advantage to preserve the original page sizes.

To apply it to all PDF files in the current directory, including all sub-directories, use the following command:

find . -name "*.pdf" -type f | while read line; do
    gs -o mod-${line} -sDEVICE=pdfwrite "${line}"
done


Wi-fi not working on Lubuntu 20.04 with Lenovo Ideapad 130s (RTL8821CE)

Reboot in the BIOS/UEFI and make sure that secure boot is off. You might have to set an administrator password for this.
Press F10 or F12 to save and exit
Once the machine has booted into Ubuntu, establish a temporary ethernet connection by plugging your cellphone into the USB port and settings >>> connections >>>> mobile hotspot and tethering >>> USB tethering.
Open a terminal.
Paste this line into the terminal :
sudo apt-get install rtl8821ce-dkms

Press Enter
After it installs, reboot your computer. Your WiFi card should work now.


How to install graphic drivers for Intel GM45

intel graphic cards are not very good - you may be better off using a better one. does the graphics card work with more Linux compatible games - e.g FlightGear?

Found a review here - it says that it only runs Call of Duty 4 at half a decent frame-rate on a Windows PC, using the same graphics card and similar processor.

Running things using wine can be a tad tricky, as it does not fully interface with the computer.

Sorry, not very experienced with this stuff, but hope this helps.


Password generator combining actual words

Locally installed dictionaries are stored in /usr/share/dict/, for example:

$ ls -1 /usr/share/dict/
american-english
british-english
cracklib-small
README.select-wordlist
words
words.pre-dictionaries-common

Here the first two are interesting, those dictionaries are simple word lists with one word per line. We can use shuf to output 4 random lines from one of them (and awk to replace newlines with spaces):

shuf -n4 /usr/share/dict/american-english | awk NF=NF RS= OFS=' '

Here's some example output:

contributions autumn's catalepsy's hemline's
footlights Levi's awfuller rascals
fogies flavoring preregistering requital's
Coleman's cartel halfpennies Williamson
étude's maintainers reviler's dapperest
pizazz Galahads McDowell derby
corroborate bureaucracies anchovy meager
filet Tawney feudalistic backstabbing
Beatriz sitcom surpasses guttural's
warehouse's unfamiliarity's Ashlee's sanguinary


Will upgrading to a newer version delete my files, apps, or settings?

You should always backup your personal files even when not upgrading. Better safe than sorry.

Upgrading normally does not delete files. If needed upgrading will disable 3rd party applications (and not delete them).


Starting Daily apt upgrade and clean activities stopping mysql service

I'm not sure it's possible to stop mysql from being killed by the update process.  I've had the same problem and I disabled unattended updates entirely so that I can do them on my own schedule (after also testing them in a qa environment).  To disable the automatic daily updates entirely:

sudo apt-get remove unattended-upgrades
sudo systemctl stop apt-daily.timer
sudo systemctl disable apt-daily.timer
sudo systemctl disable apt-daily.service
sudo systemctl daemon-reload


livepatch (Canonical Livepatch has experienced an internal error)

I am new to ubuntu 20.04 just a few days old and I encountered the same problem.
Here is a quick fix that worked for me. Fire up terminal and run
sudo canonical-livepatch refresh


How to access Ubuntu desktop from a Windows system?

Yes, it is possible. You can use Teamviewer or VNC to do just that in a Windows system.


Does pm-powersave start automatically when running on battery?

It does not run on my system when I plug and unplug my power adapter. You can check whether it is run or not by looking at /var/log/pm-powersave.log. Type tail -f /var/log/pm-powersave.log and then plug/unplug your power adapter, it will shows what scripts are run and their output. If you got nothing, then it means nothing is run.

You can create a new udev rules file to make scripts in /usr/lib/pm-utils/power.d/ and /etc/pm/power.d run. As root, create /etc/udev/rules.d/99-powersave.rules, and put the following content into this file:

SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/usr/sbin/pm-powersave true"
SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/usr/sbin/pm-powersave false"

Now try to put your system into battery mode and you should be able to see output in /var/log/pm-powersave.log, which means the scripts have been executed.


Install MediaWiki with PostgreSQL instead of MySQL

You can do:

apt-get --ignore-depends install <pkg>

This will ignore all dependencies the only problem is that MySQL may not be the only one.  So to avoid that I would suggest:

apt-get -d install <pkg>

Then once all the packages are downloaded.  Install each one individually doing:

dpkg --ignore-depends <individual package>

Personally I think installing MySQL and then simply reconfigure MediaWiki to use PostgreSQL if it is possible might be a better solution.


btrfs incremental snapshots: find UUID in sent data

starting from the code from btrfs-snapshots-diff.py [github.com] is was able to make a script tailored to my needs. i can use it this way to get the uuids:

with BtrfsStream('snapshot_0-1.data') as btrfs_stream:
    print(btrfs_stream.get_send_command())
# ('BTRFS_SEND_C_SNAPSHOT',
#      (UUID('01234567-89ab-cdef-0123-456789abcdef'),
#       UUID('fedcba98-7654-3210-fedc-ba9876543210')))

with the class BtrfsStream as below.

i made some modifications to the original code:

python 3 (instead of python 2)
iterating over the file instead of reading all of it into the memory
added contextmanager features in order to use it in a with satement

the code is used is then:

from struct import unpack
import io
from uuid import UUID

class BtrfsStream:

    # From btrfs/send.h
    send_cmds = (
        'BTRFS_SEND_C_UNSPEC BTRFS_SEND_C_SUBVOL BTRFS_SEND_C_SNAPSHOT '
        'BTRFS_SEND_C_MKFILE BTRFS_SEND_C_MKDIR BTRFS_SEND_C_MKNOD '
        'BTRFS_SEND_C_MKFIFO BTRFS_SEND_C_MKSOCK BTRFS_SEND_C_SYMLINK '
        'BTRFS_SEND_C_RENAME BTRFS_SEND_C_LINK BTRFS_SEND_C_UNLINK '
        'BTRFS_SEND_C_RMDIR BTRFS_SEND_C_SET_XATTR BTRFS_SEND_C_REMOVE_XATTR '
        'BTRFS_SEND_C_WRITE BTRFS_SEND_C_CLONE BTRFS_SEND_C_TRUNCATE '
        'BTRFS_SEND_C_CHMOD BTRFS_SEND_C_CHOWN BTRFS_SEND_C_UTIMES '
        'BTRFS_SEND_C_END BTRFS_SEND_C_UPDATE_EXTENT').split()

    send_attrs = (
        'BTRFS_SEND_A_UNSPEC BTRFS_SEND_A_UUID BTRFS_SEND_A_CTRANSID '
        'BTRFS_SEND_A_INO BTRFS_SEND_A_SIZE BTRFS_SEND_A_MODE '
        'BTRFS_SEND_A_UID BTRFS_SEND_A_GID BTRFS_SEND_A_RDEV '
        'BTRFS_SEND_A_CTIME BTRFS_SEND_A_MTIME BTRFS_SEND_A_ATIME '
        'BTRFS_SEND_A_OTIME BTRFS_SEND_A_XATTR_NAME '
        'BTRFS_SEND_A_XATTR_DATA BTRFS_SEND_A_PATH BTRFS_SEND_A_PATH_TO '
        'BTRFS_SEND_A_PATH_LINK BTRFS_SEND_A_FILE_OFFSET BTRFS_SEND_A_DATA '
        'BTRFS_SEND_A_CLONE_UUID BTRFS_SEND_A_CLONE_CTRANSID '
        'BTRFS_SEND_A_CLONE_PATH BTRFS_SEND_A_CLONE_OFFSET '
        'BTRFS_SEND_A_CLONE_LEN').split()

    # From btrfs/ioctl.h:#define BTRFS_UUID_SIZE 16
    BTRFS_UUID_SIZE = 16
    HEADER_SIZE = 17

    # Headers length
    l_head = 10
    l_tlv = 4

    def __init__(self, path):
        '''
        '''

        self.path = path
        self._stream = None

    def __enter__(self):
        '''
        enter for context manager
        '''

        self._stream = open(self.path, 'rb')
        self._read_header()
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        '''
        exit for context manager
        '''

        self._stream.close()

    def _read_header(self):
        '''
        read the header
        '''

        header = self.read(BtrfsStream.HEADER_SIZE, assert_lengh=False)

        if len(header) < BtrfsStream.HEADER_SIZE:
            raise IOError('Invalid stream length\n')

        magic, null, self.version = unpack('<12scI', header)
        if magic != b'btrfs-stream':
            raise IOError('Not a Btrfs stream!')

    def seek(self, offset, whence=io.SEEK_SET):
        '''
        seek to a given point
        '''

        self._stream.seek(offset)

    def tell(self):
        '''
        tell where we are
        '''

        return self._stream.tell()

    def read(self, n_bytes, assert_lengh=True):
        '''
        try to read n_bytes
        '''

        tell_before = self.tell()
        btes = self._stream.read(n_bytes)

        if assert_lengh is True and len(btes) != n_bytes:
            msg = ('could only read {} instead of {} at offset {}'
                   ).format(len(btes), n_bytes, tell_before)
            raise IOError(msg)
        return btes

    def tlv_get(self, attr_type):
        attr, l_attr = unpack('<HH', self.read(BtrfsStream.l_tlv))
        if self.send_attrs[attr] != attr_type:
            raise ValueError('Unexpected attribute %s' % self.send_attrs[attr])
        ret, = unpack('<H', self.read(2))
        return ret

    def _tlv_get_string(self, attr_type):
        attr, l_attr = unpack('<HH', self.read(BtrfsStream.l_tlv))
        if self.send_attrs[attr] != attr_type:
            raise ValueError('Unexpected attribute %s' % self.send_attrs[attr])
        ret, = unpack('<%ds' % l_attr, self.read(l_attr))
        return ret

    def _tlv_get_u64(self, attr_type):
        attr, l_attr = unpack('<HH', self.read(BtrfsStream.l_tlv))
        if self.send_attrs[attr] != attr_type:
            raise ValueError('Unexpected attribute %s' % self.send_attrs[attr])
        ret, = unpack('<Q', self.read(l_attr))
        return ret

    def _tlv_get_uuid(self, attr_type):
        attr, l_attr = unpack('<HH', self.read(BtrfsStream.l_tlv))
        if self.send_attrs[attr] != attr_type:
            raise ValueError('Unexpected attribute %s' % self.send_attrs[attr])
        return UUID(bytes=self.read(l_attr))

    def get_send_command(self):
        '''
        search uuids only.
        '''
        # start at the right point in the file
        self.seek(BtrfsStream.HEADER_SIZE)

        while True:

            l_cmd, cmd, crc = unpack('<IHI', self.read(BtrfsStream.l_head))
            tell_before_cmd = self.tell()

            try:
                command = self.send_cmds[cmd]
            except:
                raise ValueError('Unkown command %d' % cmd)

            if command == 'BTRFS_SEND_C_SNAPSHOT':
                self._tlv_get_string('BTRFS_SEND_A_PATH')
                uuid = self._tlv_get_uuid('BTRFS_SEND_A_UUID')
                self._tlv_get_u64('BTRFS_SEND_A_CTRANSID')
                clone_uuid = self._tlv_get_uuid('BTRFS_SEND_A_CLONE_UUID')
                return 'BTRFS_SEND_C_SNAPSHOT', (uuid, clone_uuid)

            elif command == 'BTRFS_SEND_C_SUBVOL':
                self._tlv_get_string('BTRFS_SEND_A_PATH')
                uuid = self._tlv_get_uuid('BTRFS_SEND_A_UUID')
                return 'BTRFS_SEND_C_SUBVOL', (uuid, )

            elif command == 'BTRFS_SEND_C_CLONE':
                self._tlv_get_string('BTRFS_SEND_A_PATH')
                self._tlv_get_u64('BTRFS_SEND_A_FILE_OFFSET')
                self._tlv_get_u64('BTRFS_SEND_A_CLONE_LEN')
                clone_uuid = self._tlv_get_uuid('BTRFS_SEND_A_CLONE_UUID')
                return 'BTRFS_SEND_C_CLONE', (clone_uuid, )

            elif command == 'BTRFS_SEND_C_END':
                return

            self.seek(tell_before_cmd + l_cmd)


How to retrieve public URL of a file via cmd line?

To get a public URL for a file via the commandline, you do

u1sdtool --publish-file=filename

if the file is already published, it will return the existing URL; otherwise, it will publish the file and return the newly created URL.


10.04 -> 12.04 Upgrade . Server. do-release-upgrade fail. What sources to change

It fails because you are on 10.10 (Maverick) and not 10.04 (Lucid). Upgrading from 10.10 to 12.04 is unsupported, while 10.04 -> 12.04 should work.

10.10 is no longer supported, and there is no upgrade path to any supported currently release. Just backup, and reinstall.

12.04 will be supported until Aprl 2015.

To upgrade from 10.04 server to the next LTS, install update-manager-core,
then edit /etc/update-manager/release-upgrades, and set Prompt=lts.

You'll obviously have to edit the /etc/apt/sources.list and reset every line back to lucid first.


There is another way to set it. Please try this command:

gsettings set org.gnome.desktop.input-sources xkb-options "['grp:alt_shift_toggle']"