Bash one-liner to delete only old kernels

Looks nice enough, just a few comments. The two first comments make the command safer, while the third and fourth make it a bit shorter. Feel free to follow or ignore any one of them. Though I will strongly advise to follow the first two. You want to make sure it's as safe as possible. I mean seriously. You're throwing a sudo apt-get -y purge at some automatically generated package list. That is so evil! :)

Listing all linux-* will get you many false positives, such as (example from my output) linux-sound-base. Even though these may be filtered out later by the rest your command, I would personally feel safer not listing them in the first place. Better control what packages you want to remove. Don't do things that may have unexpected results. So I would start out with

dpkg -l linux-{image,headers}-*

Your regex to "list only the ones that have numbers" is slightly too simple in my opinion. For instance, there is the package linux-libc-dev:amd64 when you're on a 64-bit system. Your regex will match. You don't want it to match. Admittedly, if you followed my first advice, then linux-libc-dev:amd64 won't get listed anyway, but still. We know more about the structure of a version number than the simple fact "there's a number". Additionally, it's generally a good idea to quote regexes, just to prevent potential misinterpretations by the shell. So I would make that egrep command

 egrep '[0-9]+\.[0-9]+\.[0-9]+'

Then there is this sorting thing. Why do you sort? Since you're going to remove all kernels (except the current one) anyway, is it important for you to remove older ones before newer ones? I don't think it makes any difference. Or are you only doing that so you can then use sed to "Print only the results that go after the current kernel"? But IMO this feels much too complicated. Why not simply filter out the results corresponding to your current kernel, as you are already doing with grep -v anyway, and be done? Honestly, if I take the first part of your command (with my two previous suggestions integrated), on my machine I get

$ dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | sort -t- -k3,4 --version-sort -r | sed -e "1,/$(uname -r | cut -f1,2 -d"-")/d" | grep -v -e `uname -r | cut -f1,2 -d"-"`
linux-image-3.8.0-34-generic
linux-image-3.5.0-44-generic

Removing that sorting/sed stuff, I get

$ dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v -e `uname -r | cut -f1,2 -d"-"`
linux-image-3.5.0-44-generic
linux-image-3.8.0-34-generic
linux-image-extra-3.5.0-44-generic
linux-image-extra-3.8.0-34-generic

So your more complicated command would actually miss two packages on my machine, that I would want to remove (now it's possible that those linux-image-extra-* thingys depend on the linux-image-* thingys and therefore would get removed anyway, but it can't hurt to make it explicit). At any rate, I don't see the point of your sorting; a simple grep -v without fancy preprocessing should be fine, presumably even better. I am a proponent of the KISS principle. It will make it easier for you to understand or debug later. Also, without the sorting it's slightly more efficient ;)
This is purely aestethic but you will get the same output with this slightly shorter variant. :-)

$ dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r | cut -d- -f-2)
linux-image-3.5.0-44-generic
linux-image-3.8.0-34-generic
linux-image-extra-3.5.0-44-generic
linux-image-extra-3.8.0-34-generic

Consequently, I end up with the simpler and safer command

$ dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r | cut -d- -f-2) | xargs sudo apt-get -y purge

Since you actually want to clean up your /boot partition, a completely different approach would be to list the contents of /boot, use dpkg -S to determine the packages that the individual files belong to, filter out those that belong to the current kernel, and remove the resulting packages. But I like your approach better, because it will also find outdated packages such as linux-headers-*, which do not get installed to /boot, but to /usr/src.


Permanently show taskbar (Ubuntu Dock) numbers

I'm not sure whether it's currently possible (without any ugly hacks) to display the numbers permanently. But you can make them appear in a 'passive' way (i.e. just shows the numbers instead of switching to or launching the associated application) by pressing Super+Q instead of Super+number.


How can I enable Sinhala,Tamil kit for Ubuntu 15.10?

Go to System Settings
Click on Language Support

Click install/remove languages button

check the required languages

click Apply changes

give authentication for downloading and wait for installation

then goto system settings and Click on Text entry Settings

press "+" button
add required languges from the list

then click on the keyboard indicator and select language for typing


You can ask money for installing and training. You are even allowed to sell copies of Ubuntu. See Licensing for more information. More information can be found in this question. When commercialize Ubuntu watch out with using the Ubuntu brands:

Permitted use Certain usages of the Trademarks are fine and no
specific permission from us is needed.
Community advocacy.
Ubuntu is built by, and largely for, its
community. We share access to the Trademarks with the entire community
for the purposes of discussion, development and advocacy. We recognise
that most of the open source discussion and development areas are for
non-commercial purposes and will allow the use of the trademarks in
this context, provided: the Trademark is used in a manner consistent
with the Usage Guidelines below there is no commercial intent behind
the use what you are referring to is in fact Ubuntu. If someone is
confused into thinking that what isn't Ubuntu is in fact Ubuntu, you
are probably doing something wrong there is no suggestion (through
words or appearance) that your project is approved, sponsored, or
affiliated with Ubuntu or its related projects unless it actually has
been approved by and is accountable to the Ubuntu Community Council


Building Packages success in My Machine but fails on Launchpad PPA

By default, the clean target is run first, and then the build and install (or binary, I'm not sure which) are run. In your clean target, you are calling rm -rf ../data/.deps ./.deps applets/.deps common/.deps, which removes the ../data/.deps folder, and so it can't find ../data/.deps/budgie_session_dialog-budgie-session-dialog-resources.Po.

Running debuild before uploading to a PPA can help find these types of errors.


Is the HP LaserJet PRO M130fw compatible with Linux?

YES. It's working with the new LTS version of Ubuntu, 18.04, and out of the box! It appears that it gives you the option to use different printers (in reference to the drives and such), so select the appropriate one, in this case being the hp laserjet pro m130fw. Although it is using the hp laserjet m129 as its driver, you still have to point to the printer, being the m130. It'll work. Does that make sense?


Need to delete packages from '/boot' directory

I would advise you to not delete but move them instead to a temporary location (ex a USB drive or a different partition).

Removing them does not remove the package, and if you later need to remove those packages you may get some problems.

After you freed up some space, you can then try to fix your dependencies issues and then uninstall all those unneeded kernels. If you get some problem you just move the files again to /boot as needed.

Also if you have only one partiton (ie / and /boot are on the same partition) it may be easier to cleanup some space in other locations (ex: /var/cache/apt)


Cannot find libssl.so.10 on ubuntu 18.04

Seems the directory where the binary/library located has changed, try this.

cd /usr/lib/x86_64-linux-gnu
sudo ln -s libssl.so.1.0.0 /usr/lib/libssl.so.10
sudo ln -s libcrypto.so.1.0.0 /usr/lib/libcrypto.so.10


No Dropbox indicator icon in "GNOME with Xmonad" session

By comparing the sessions in /usr/share/gnome-session/sessions and trial and error, I found that the Dropbox icon could be made to reappear by adding the following line at the end of /usr/share/gnome-session/sessions/xmonad.session:

DesktopName=Unity


Cannot remove JDK – /usr/sbin/alternatives: No such file or directory

/usr/sbin/alternatives: No such file or directory

  There is no /usr/sbin/alternatives in Debian, Ubuntu, etc. Debian
  clones. Instead there is /usr/bin/update-alternatives.

  I suggest a temporary symbolic link to work around the badly converted
  RPM package:

mkdir -p /usr/sbin
ln -sT -- /usr/bin/update-alternatives /usr/sbin/alternatives

(source)


Bash scripts will not run without typing "bash" in front of it

Make sure you start the script with ./script or full path or whatever. Just script may not work (it works if the directory is in $PATH, like /usr/bin), since on UNIX systems it's not a habit to have the current directory in your path (for security reasons, and it's good!)
Make sure the script is executable, for example: chmod +x script will made it executable.
Make sure, you have #!/bin/bash as the first line in your script. Also make sure, that it's not edited with some kind of Windows editor, since those often uses the "DOS type" of eol (end of line) which differs from the UNIX one (if the checklist above is OK, but you got "bad interpreter: no such file or directory" or so, even if it's /bin/bash, this is often the reason, as the non-printable - so you usually don't see it - \r will be treated as the part of the path of the interpreter)

Others already mentioned: it's important to have /bin/bash if you use bash features, also /bin/sh was symlinked to /bin/bash, but now-a-days (as far as I noticed) it's symlinked to dash which won't provide bash compatibility, only the POSIX sh. It's quite important, even quite expensive softwares at our firm have this issue: scripts contain #!/bin/sh as the first line but it depends on bash functionalities as well.


From the VLC pages

Ubuntu Lucid Lynx 10.04 LTS

VLC version 1.0.6 in Ubuntu 10.04 is out-of-date. We recommend you install VLC 1.1.x manually.

If you wish to install VLC 1.0.6 anyway, please refer to the instructions above for Ubuntu 10.10. Note that there will be some bugs; you are on your own.

At your OWN risks, install VLC from PPA:

Command line way

% sudo add-apt-repository ppa:lucid-bleed/ppa
% sudo apt-get update
% sudo apt-get install vlc vlc-plugin-pulse mozilla-plugin-vlc

Source: http://www.videolan.org/vlc/download-ubuntu.html


Screen blinking on moving cursor from one monitor to another

Hello i had the same problem but solved it by installing latest upstream kernel from here. At this link you can find installing instruction. Right now i use 4.6.0rc4 and it works well.


desktop launcher for sudo apt-get update && apt-get upgrade

Create a text file and call it updateme.desktop. Paste the following and save it:

[Desktop Entry]
Version=1.0
Name=update system
Comment=updates system
Exec=bash -c 'sudo apt update && sudo apt upgrade -y; bash'
Terminal=true
Type=Application

Now run chmod +x /path/to/updateme.desktop

Double clicking on the file should now bring up a terminal asking for your password to execute the commands. If you want you can copy it to /usr/share/applications to make it appear in your application's menu.

Thanks to @Terrance for having corrected the Exec command.


Firefox slow down Ubuntu 17.10 as Virtualbox guest

The problem becomes only active when the Virtualbox guest 3D mode is enabled. When I disable the 3D mode, the guest is working as desired, also when Firefox browser is started.


The volume boot has only 0 bytes disk space remaining

You will have to free up some space on your /boot partition before you can do anything.

ls -lh /boot and look for large files to delete, but be careful not to delete your any of the kernels that you need.

Once you have deleted some of the kernel files that you do not need you should be able to run apt-get autoremove

Again do not delete your running kernel files, or the newest kernel files.  If you do, you will render your computer unbootable.

Good luck.


Why is VLC minimized while playing video or audio?

Can I suggest you reset to the standard interface and click the Reset Preferences button available through the Tools - Preferences menu option

You can also reset the configuration from a terminal command:

vlc --reset-config

Double check that vlc configuration has been completely regenerated:

mv ~/.config/vlc ~/.config/vlc_backup


For those who encounter the following errors,

The following packages have unmet dependencies:
zfsutils-linux : ***Depends: zfs-doc (= 0.6.4.2-0ubuntu1) but 0.6.5.3-1~wily is to be installed***
                  Depends: libnvpair1linux but it is not going to be installed
                  Depends: libuutil1linux but it is not going to be installed
                  Depends: libzfs2linux but it is not going to be installed
                  Depends: libzpool2linux but it is not going to be installed
                  Recommends: zfs-dkms but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

This is most probably due to having ppa:zfs-native/stable in your apt source repository.  Remove the ppa:zfs-native/stable from your apt repository, and re-run apt-get update.  Then proceed to install via apt-get install zfsutils-linux

That should fix it for you.


Is there a way to prevent your windows from moving when an external monitor is connected?

I did not find a "secret" setting to change the behaviour of the, as it seems, designed behaviour. It looks indeed as if the left screen is assumed to be the "base" screen.

It is however very well possible to create a workaround, with essentially the same result. You can create a script that, on the occasion of connecting a second screen, lists all windows. Subsequently, all windows that are moved initially to the left screen, are shifted back to the screen on the right, within a second or two. The size of all windows will be preserved.
That is what the script below does.

Two versions

You can restore your arranged windows in two ways:

Occasionally, with a shortcut key to run after the second screen is connected.
Automatically, running the script in the background, waiting for your screen to be connected.

How to use

preparations

Install wmctrl

sudo apt-get install wmctrl
Look up your two screens' names with the help of xrandr, the names of the screens will be just before the word "connected".
Copy Either one of the scripts below, in the head section, replace in these two lines the screen names by the correct ones:

screen_1 = "LVDS1"     # your main screen (laptop)
screen_2 = "VGA1"      # secundary screen (on the left)

save the script as move_windows.py
Make sure in display settings your secondary screen is on the left. The top lines of the two screens need to be in line (like in the first image of your question).

Run the script
- If you use the one to run occasionally, run it after your second screen is connected.

    python3 /path/to/move_windows.py

You might want to add it to a keyboard shortcut if you think it does what it should do, Choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts".
Click the "+" and add the command:

If you use the one to run in the background, also run it by the command:

python3 /path/to/move_windows.py

If it acts as you intended, add it to your start-up applications: Dash > Startup Applications > Add

I tested the script with my laptop (on the right) and two different screens (on the left). The result was the same.

laptop screen

connecting without script

connecting with the script running

After the script did its job, windows will be "left alone" (of course), and you can arrange your windows your way.

The script(s)

1. "Manual" version, to run after the screen is connected

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

#--
screen_2 = "LVDS1"       # replace with your internal screen (right)
screen_2 = "VGA1"        # replace with your external screen (left)
#--

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

def get_shift(xr_output):
    lines = [l for l in xr_output.splitlines() if " connected" in l][0].split()
    return int([it for it in lines if "x" in it][0].split("x")[0])

def shift_windows(shift):
    w_data = [l.split() for l in get("wmctrl -lG").splitlines()]
    relevant = []
    for w in w_data:
        props = get("xprop -id "+w[0])
        if (int(w[2]) < shift, "_TYPE_NORMAL" in props, "TYPE_DIALOG" in props).count(True) == 2:
            command = "wmctrl -ir "+w[0]+" -e 0,"+(",").join([str(int(w[2])+shift), w[3], w[4], w[5]])
            subprocess.Popen(["/bin/bash", "-c", command])

shift_windows(get_shift(get("xrandr")))

2. Automatic version, to run in the background

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

#--
screen_2 = "LVDS1"       # replace with your internal screen (right)
screen_2 = "VGA1"        # replace with your external screen (left)
#--

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

def get_shift(xr_output):
    lines = [l for l in xr_output.splitlines() if " connected" in l][0].split()
    return int([it for it in lines if "x" in it][0].split("x")[0])

def shift_windows(shift):
    w_data = [l.split() for l in get("wmctrl -lG").splitlines()]
    relevant = []
    for w in w_data:
        props = get("xprop -id "+w[0])
        if (int(w[2]) < shift, "_TYPE_NORMAL" in props, "TYPE_DIALOG" in props).count(True) == 2:
            command = "wmctrl -ir "+w[0]+" -e 0,"+(",").join([str(int(w[2])+shift), w[3], w[4], w[5]])
            subprocess.Popen(["/bin/bash", "-c", command])

while True:
    try:
        screen_info1 = get("xrandr")
        time.sleep(5)
        screen_info2 = get("xrandr")
        check = screen_2+" connected"
        if (check in screen_info1, check in screen_info2) == (False, True):
            time.sleep(5)
            shift_windows(get_shift(screen_info2))
    except:
        pass


How to set "MKL_THREADING_LAYER=GNU" as an environment variable for a python script?

I used

conda install mkl=2017

and it worked!


According to this thread on AMD Developer Central, this card is too old to be  supported by the proprietary fglrx driver.

Also, it's not suggested to download the driver provided on AMD website.

Therefore I think the only working driver is the open-source one.

If you're having graphical performance issue, you could:

Try older LTS version (e.g. 12.04, but I doubt it will help in this case.)
Select a light-weighted flavor Ubuntu like Xubuntu or Lubuntu, which needs less graphical power.

More information from RadeonDriver on help.ubuntu.com:

  Supported, but Hardware is Too Old for Unity

  These cards will not run Ubuntu's Unity desktop with 3D acceleration. They will still run Unity, but the CPU will be used for basic drawing and performance may suffer. If you have one of these cards, a lighter desktop (such as xfce or lxde, found in Xubuntu and Lubuntu respectively) is recommended.
  ...
  R100                     Radeon 7200
  RV100                    Radeon 7000(VE), M6, RN50/ES1000 (2D only)
  RS100                    Radeon IGP320(M)
  ...


This issue was fixed in Waking Mars version 1.0.4 which apparently hasn't been posted in the Software Center just yet.  You can grab it through the Humble Bundle website, however.

Sorry for any inconvenience,

David


You should have "Window Tiling" config options in your menu. Play around with the settings and see whether disabling snapping works better for you.


Increasing brightness to max_brightness value causes black screen

So, seems I am on my own here and as a result I've tried to write to the max_brightness file, to decrease the set value of 648 to 616 using echo 616 | sudo tee /sys/class/backlight/intel_backlight/max_brightness. Permission denied.

Re-ran this as root (i.e. after sudo -i), permission denied.  So I had the idea to go back to acpi_video0 hoping that the required max_brightness sys file would not be in use thereby allowing me to edit max_brightness (belonging to intel_backlight).

I removed "acpi_backlight=vendor", and all the tweaks for the i915 driver, followed by sudo update-grub, and rebooted.  I checked using ls /sys/class/backlight/ and the acpi_video0 folder was again listed (also was intel_backlight).

Then I repeated echo 616 | sudo tee /sys/class/backlight/intel_backlight/max_brightness. Again, permission denied (even as root).

I am guessing since the folder intel_backlight is still listed after ls /sys/class/backlight/, those files are still in use.  It would seem to be the case, since cat /sys/class/backlight/intel_backlight/brightness still reports.

Maybe there is a chance I can edit /sys/class/backlight/intel_backlight/max_brightness if I can somehow remove intel_backlight from being listed/reported?

Is there some kind of grub tweak (similar to acpi_backlight=vendor) that would work to kill intel_backlight from loading at boot?

Or would entering recovery mode allow me to edit this sys file (i.e. while offline)?

Anyone?


Which information to provide on a wireless bug report?

I finally submitted a bug report using apport. This command can be used to automatically attach some useful information to a bug. Other logs/information that turned out to be probably relevant were dmesg, lsusb and uname outputs, grepped lsmod  to show modules related to the device, and modinfo of those modules.

Finally, it turned out that the proprietary driver from Realtek worked fine. The driver can be downloaded from Realtek's website. It seems that Realtek has modified the driver so that it supports newer versions of the kernel. In previous versions, it was necessary to patch a couple of includes, as @chicoff pointed out in his answer to the question Installing Realtek 8188 wireless driver fails, and in this comment on a similar Launchpad bug report

Realtek's package provides a sh installer that compiles and installs the module into the kernel. It's necessary to blacklist the driver included in the kernel, so that it's not eligible for loading when rebooting. See this question for details on how to achieve it: How to force a proprietary driver to load on startup?.


Install the packages which contain common Webcam drivers.

sudo apt-get install build-essential linux-headers-`uname -r`


Can you change the menus in GIMP via a theme?

You can try to edit the menu definition XML files in /usr/share/gimp/2.0/menus/.

The key file for the application menu is image-menu.xml.

You will not be able to get everything this way - for example, menu entries created by plug-ins will still show up. But if you do not want a plug-in to show up there, you probably do not want it in your GIMP at all, either.

Please note: changes in these menu definition files affect all users of your system.


How retrieve files in a minimal ubuntu installation? aka how apt-get retrieves files?

apt-get uses a library, which you probably cannot use yourself since a minimal system likely does not include a compiler that you could use to build a program using that library.  Perhaps you should use apt-get to install wget or curl.


How to install XAMPP 1.8.2.0 installer.run doesn't start

To install xampp 1.8.2.0, download the Latest version of xampp 1.8.2 from the apache friends or sourceforge.  Once downloaded, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, browse to the directory where the file was downloaded, and run the command(s) below:

sudo chmod 755 xampp-linux-1.8.2.0-installer.run
sudo ./xampp-linux-1.8.2.0-installer.run

(This will extract all the packages to the /opt/lampp directory)

Then you need to go ahead, and start the service, and see if it works

/opt/lampp/lampp start

http://localhost
http://localhost/phpmyadmin

Source:How To Install XAMPP 1.8.2 On Ubuntu


Black Screen on boot fresh install 14.04.2

Your GRUB has been mistakenly installed on your USB stick. If you plug in your USB and restart it should work. To fix this, I used to remove the USB stick during installation when the GRUB settings popped up, went one step back then continued from there.


Why every new file is automatically encoded with ASCII while everything is set to UTF-8?

When all your chars are < 128 ASCII and UTF-8 are the same.
ASCII is a subset of UTF-8 (and also a subset of latin1 and many other encoding formats).

Probably everything is perfect!

The configuration command:

set fileencodings=list of encoding formats to try

is used to define the order of encoding format that vim will try to
use when opening
a file.

set fileencodings=ucs-bom,utf-8,latin1 is a better idea: first try
to use any Unicode with a BOM header, then it will try to interpret it as UTF-8, and if everything fails latin1.


Cannot install or run Ubuntu from USB flash drive

I had a similar problem  when I used the "start up disk creator" that came with ubuntu to create the live USB and strangely enough it was working fine on other devices so I also thought it was a hardware problem.

this was solved by either using  the latest version of unetbootin in Linux or Universal USB installer in windows


How to make a bootable USB drive on Ubuntu 16.04

Persistent Install vs Full install
Ubuntu can be installed to a USB in different ways. A Live install does not save between sessions. A Persistent install extracts the OS from a compressed file and saves data to an overlay file or partition each session, and a Full install installs the complete OS to the USB just like an install to internal disk.
Comparison between Persistent and Full install USB
Advantages of a persistent install:

You can use the persistent pendrive to install Ubuntu to another computer.

A persistent install takes up less space on the pendrive.

You can reset the pendrive by overwriting the old casper-rw file with a new one.

The install to pendrive takes less time.

Slightly less wear on the drive.

Advantages of a Full install:

You can update and upgrade.

If you have problems or wish to modify, the solution is the same as with an internal install, (You can ask for help in the forums).

No ugly startup / install screen.

Better security, you can use full encryption

You can use proprietary drivers.

Swapfiles and partitions work and Hibernation can be enabled.

Many persistent installs are limited to a 4GB casper-rw and a 4GB home-rw persistence file, to get more persistence requires persistence partitions. Once casper-rw is full, the drive will not boot.

More efficient usage of disk space. Does not require reserved space for persistence.

Faster boot, no automatic disk checking or Try Ubuntu/Install Ubuntu screen.

You can run VBox and use virtual machines.

Generally faster boot than Live or Persistent USB's.

More stable, better for day to day use. I have run Ubuntu off a flash drive for 5 years making only LTS upgrades.

Note that once booted, both methods run at about the same speed. If the computer has lots of RAM Ubuntu should run mainly in RAM and there will not be a big difference between running off internal HDD and USB3 flash drive f.
Full Install Method
A quick and easy method to flash a Full install to USB can be found here: Easy Full Install USB that Boots both BIOS and UEFI
A more traditional methods for creating a Full install USB from scratch can be found here: How to Create a Full Install of Ubuntu 20.04 to USB Device Step by Step


You have to run sudo deluser <username> <groupname> to delete a user from it's corresponding group. And run this sudo deluser --group <group name> command to delete a group.


How to configure (Brother) Laser Scanner

If you have correctly installed the drivers?

Open a terminal and run this sudo lsusb
Where your printer / scanner is (My scanner/printer was listed as 002/004)

sudo chmod a+w /dev/bus/usb/002/004


I can boot from USB a installation of Windows 7, but I can't do this with Ubuntu or XBMC live

If you write a bootable ISO of Ubuntu to your USB stick, and your PC can boot from USB then it will work. I am a little puzzled when you say you can install Windows from a USB stick though. Really?

The links below do give some caveats, some hardware just will not work, but basically, the idea is to run the installer (like Windows, the Ubuntu installer will let you wipe and create partitions for your install. I can't understand what you mean by running startup disk creator - are you saying you have an install image or you are failing to create one?)

This link will talk you through how to create a bootable USB Ubuntu stick from Windows or Mac, then the full article shows how to run a full installation from that USB stick.


After removing a folder (apache2 I think) I'm having PHP and LAMP trouble

mysqli is included in the php5-mysql package. Run a php script containing phpinfo() and check if MySQLi support is enabled.

If it is not, you must edit your PHP configuration. If it is not present add the following line to your php.ini file :

extension=mysqli.so

(restart Apache afterwards)


reinstalling Ubuntu dual-boot goes to initramfs

I was able to manually delete enough Ubuntu-related files in Windows and reinstall from a USB.  I used Windows Explorer to search grub and ubuntu to do so.


Start multiple apps running in shells split in one console

You can make a custom screen config file that will open up multiple splits and launch your scripts in them. It would look something like this:

screen script1.sh # Open first screen and launch first script
split             # Make second split
focus             # Switch to second split
screen script2.sh # Open second screen and launch second script
split             # Make third split
focus             # Switch to third split
screen script3.sh # Open third screen and launch third script

Put this in a file called myscripts and launch screen with screen -c myscripts. If you prefer vertical splits, just add -v to the split commands.

If you'd like a grid layout, try something like this:

screen script1.sh # Open first screen and launch first script
split -v          # Make second split
focus             # Switch to second split
screen script2.sh # Open second screen and launch second script
split             # Make third split
focus             # Switch to third split
screen script3.sh # Open third screen and launch third script
focus             # Cycle back to first split
split             # Split first split horizontally
focus             # Switch to new split
screen script4.sh # Open fourth screen and launch fourth script


Is having Unity/awesome wm together possible? how can I do this?

This isn't possible, Unity needs Compiz as it's a plugin, sorry!


All the connections related to Ubuntu One are encrypted. The data is stored unencrypted, however.


Why does Ubuntu keep creating a 'Downloads' directory in my home directory?

Why does Ubuntu insist on recreating the 'Downloads' folder, even when nothing has been added there? Perhaps alternatively, what processes are trying to access this directory, and ensuring that it exists?

It is a default recovery method; you can remove any normal directory inside /home/$USER/ and the system will recreate it when you log into the desktop.

  How can I reassign whatever special status 'Downloads' holds to my new 'dls'?

See ~./config/users-dirs.dirs and change the one that is about DOWNLOADS to what you want (my directories are on my 2nd disk on not on my boot disk):

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="/discworld/Desktop"
XDG_DOWNLOAD_DIR="/discworld/Downloads"
XDG_TEMPLATES_DIR="/discworld/Templates"
XDG_PUBLICSHARE_DIR="/discworld/Public"
XDG_DOCUMENTS_DIR="/discworld/Documents"
XDG_MUSIC_DIR="/discworld/Music"
XDG_PICTURES_DIR="/discworld/Pictures"
XDG_VIDEOS_DIR="/discworld/Videos"

  (and would like all my directories to start with lower-case characters.)

Obviously you can change all of them. Mind the comments: only 2 methods are supported: either relative $USER or absolute (a dir from /).


.desktop files are very important. When you search the Dash for programs, or click a program in the Launcher at the side, you are using a .desktop file.

In Ubuntu, most programs can be launched with a command from terminal - for example firefox can be opened with the command firefox in terminal, and Chrome is google-chrome.

A .desktop launcher does this for you. When you click, it runs the command - so you don't have to interact with the terminal at all.

This is a basic .desktop file. The # signs are comments that I've added.

[Desktop Entry]    # Tell the computer what file this is (a launcher)
 Encoding=UTF-8
 Version=1.0
 Type=Application  # Specifies what to do when clicked (there is also Link and Directory).
 Terminal=false    # Whether to open a terminal and run the command, or just run without
 Exec=firefox      # The command to run
 Name=Firefox      # A name to display
 Icon=/usr/share/icons/firefox.png  # Location of the icon

These files are clearly important - and you can create them yourself to run custom commands.

You can put one of these files (from /usr/share/applications) onto the "Desktop" and then use that to launch the program. It sounds like what you did was the following:

There is already a .desktop file, unrelated to the following download.
You download a file - and then list the files and see something like this:

firefox.desktop
trivial.jpg
My Document.odt

That .desktop file is unrelated to the download.
Moving the .jpg understandably does nothing - the files are unrelated. If you post a screenshot of your Desktop and also the output of the command ls Desktop, we can have a look and compare the two.

Note that the name of the .desktop file when you look with the terminal can be completely different from the displayed name of the .desktop launcher. For example, Google Chrome extensions will show as their name, for example "Chrome Remote Desktop", but the file name will be gbchcmhmhahfdphkhkmpfmihenigjmpp.desktop. This could be happening here - a weird saved name that doesn't seem to link to the launcher you would recognise.

My pronouns are He / Him


How can I remove my php7.1 from my Ubuntu 18 server?

TL;DR: The packages that you're looking to remove were already removed (or never installed in the first place).

Explanation

If you look at the column headers at the beginning of the output of dpkg -l (see below) you'll see that r and c are shorthands for the desired and the actual package statuses. The explanation of those shorthands is also included in the column title: remove and conf-files.

Unfortunately the header is hidden by grep, but you can use dpkg -l '*php*' to achieve mostly the same effect. As a bonus, columns are abbreviated to allow the table to fit into the width of your current terminal (without output redirection).

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                   Version          Architecture     Description
+++-======================-================-================-=================================================
[...]


When using a shell script, minecraft/java throws errors

The error seems to be related to not having enough permissions. This is likely due to you not using sudo at the start of the line. This is required for Minecraft to operate as intended. There are mulitple instances in your code that go as follows:

2020-06-11 09:50:54,060 main ERROR Cannot access RandomAccessFile java.io.FileNotFoundException: logs/debug.log (Permission denied) java.io.FileNotFoundException: logs/debug.log (Permission denied)

Notice how it says (Permission denied) in some parts of the log. This is because, as the name implies, you don't have permission to do the requested task. This is usually taken care of by using sudo to gain root priviliges.

In your case, the correct code would be:

#!/bin/sh

sudo java -Xms1024M -Xmx4096M -jar forge-1.12.2-14.23.5.2854.jar nogui

At the start of the program's execution, it will ask you for your password in order to gain root priviliges. This is perfectly normal.


Pairing Bluetooth Keyboard That Needs code "Failed to pair: org.bluez.Error.AuthenticationFailed"

You could try one of these two solutions: http://www.roydoer.com/microsoft-surface-ergonomic-bluetooth-keyboard-on-linux/  which mentions two options:

getting a usb-bluetooth adapter that works nicely on linux, e.g. (google for one, i can't add the second link) IOGEAR GPU531 , it worked for me on one version of Linux Mint and didn't work with a newer one
installing the driver from vendor's site, e.g. I followed instructions from http://www.slackwiki.com/Btfirmware-nonfree - apparently my lenovo w530 was having same broadcom controller as T430s.

Once the above is done, go with usual steps:

$ bluetoothctl
# power on
...
# agent on
...
# default-agent
...
# scan on
Discovery started
[CHG] Controller 5C:F3:70:81:1A:F4 Discovering: yes
[NEW] Device F6:6B:77:FF:50:4B Ergonomic Keyboard
[bluetooth]# pair F6:6B:77:FF:50:4B
Attempting to pair with F6:6B:77:FF:50:4B
[CHG] Device F6:6B:77:FF:50:4B Connected: yes
[agent] Passkey: 910013

One thing to note above: if you are using black-on-white theme in konsole, the passkey might be invisible because it's printed in white foreground. Change your console's colors to something else, say green-on-black.

Enter the passkey, hit Enter and voila - I'm typing from the MS surface ergonomic keyboard. Almost the year of Linux on desktop! ;)


You can set the MAILTO variable in your crontab.

Just type the following at the top of your crontab (crontab -e):

MAILTO=""

and cron will not send any mail for any of the jobs. If you have to disable mails for a specific task, use the following:

@hourly /path/to/script.sh >/dev/null 2>&1


can't install Openstack on Ubuntu server 16.04

Here is the solution:

sudo apt install conjure-up
conjure-up openstack


How to make the laptop beep when battery is fully charged

So, you are following the suggestion at How can I get notification when my laptop battery gets fully charged?

Create the file named return0whencharging.sh with a text editor program, so you could write this to a brand new file of that name, located in your path (a directory such as /usr/local/sbin ). For example, from within a terminal window, enter this line:

sudo nano /usr/local/sbin/return0whencharging.sh

which will put that script where it will be automagically found when desired.


Can't execute file as a program in Ubuntu 13.04

First you need to check the file is marked as executable.
In Raring Nautilus (the file manager)  by default opens text files in gedit even if they are marked executable.

To change this From the "File" menu select preferences then the "Behaviour" Tab

Now change "Executable Text Files" to either "Run" or "Ask each time" as you prefer.

You only have to do this once.


Lost access to ubuntu when changing home partition

You can start the computer using a live system (cd, dvd, usb-stick), mount your partitions and order the mess, i.e. copying your files to your intended destination and/or change fstab.


Space is not the issue here. You have a directory with very many empty (or near-empty) files. Each of them takes an inode, and you have used them all. Find that directory:

for i in /* ; do echo "$i" ; find "$i" | wc -l ; done

(You should do this as root). This will probably list one directory with a large number of files. Drill down until you find the files that have depleted your inodes. Delete all those files. Then you'll be OK for the moment. Where these files come from is, of course, another story.


Is this possible to uninstall one package during another package is installing

No, it isn't. The package manager exclusively locks its database, therefore only a single package operation can happen at a time. Yes, it is a little inconvenient, but the system is more robust that way.


Check for the file ended with deb.list.bck in /etc/apt/sources.list.d directory.If you found any then move it to another directory(Home).

It allow only the files ended with .list, .list.save, .list.bak.

OR

Try this simple command to move all the files ended with .bck in /etc/apt/sources.list.d directory to your ~/Desktop directory.

sudo find /etc/apt/sources.list.d/ -type f -name "*.bck" -exec mv {} ~/Desktop \;


Ubuntu can not ping Host Name but can ping IP?

The problem described here may not be related to DNS at all.

You have to know that Windows can resolve the Windows hostname to its IP via other mechanisms than standard DNS : NetBIOS lookup, WINS, ...

As you said you have Samba installed on your Ubuntu, this is probably what's happening. On all of your Windows machine, it is possible, out-of-the-box, to have the Windows name resolved to its IP address. As Samba is installed on Ubunut, for your Windows PC, they see the Ubuntu PC as a Windows PC and the same resolution is possible.

You tell that you run net view on Windows and you see your Ubuntu PC, so the NetBIOS name is well published on your network, so it works from Windows.

To achieve the same behaviour on Ubuntu as on Windows, you have to install and configure additional pieces of software. What you need is to add a lookup library that will allows Ubuntu to convert NetBIOS names to IP. This library is contained into the libnss-winbind package.

As any other Ubuntu packages, you install it by doing sudo apt-get install libnss-winbind. May be the library is already installed, you can check it presence by doing dpkg -l|grep libnss-winbind.

Once the library is installed, you have to enable it in the /etc/nsswitch.conf file. This file is the configuration file for the NSS (Name Service Switch), which defines from which sources Linux is able to resolve hostname, usernames, groupnames and so on.
In this file, you already have a line starting by hosts:, probably looking like this

hosts:          files dns

This tells your system to first look into the /etc/hosts file and then into the configured DNS to resolve hostnames.
You have to modify this way :

hosts:          files dns wins

Note that the order of the words files, dns and wins are important. First, the system will check the local file for resolution, then will ask the DNS server and finally, if not yet found, will perform NetBIOS lookup.

Once this is updated, to function correctly, you also need to have the winbind service running. The package containing it is a dependency of libnss-winbind, so it has been installed along it.
Do service winbind start to activate it.


How to upgrade Ubuntu machine from another machine which is already upgraded?

You could use something like apt-cacher-ng on the first machine and then import the packages from apt's cache into apt-cacher-ng using the following instructions:

https://www.unix-ag.uni-kl.de/~bloch/acng/html/howtos.html#imp

You can find the local archive cache in the following location:

/var/cache/apt/archives

Then just tell the second machine to use apt-cacher-ng on the first machine as an apt proxy, if you set up both machines to use it as a proxy this will also ensure you will only need to download packages once for future updates too saving you and the ubuntu mirrors time and bandwidth.


Installing Python3.4 + Pygame on Ubuntu 15.04

It appears that the released version of Pygame does not support Python 3. The latest release is already packaged in Ubuntu, and you can install it with python-pygame, however there it is for Python 2.x only.

You need to run your script with python instead of python3.


How do I clean Ubuntu installation of Viruses / Miners?

TL;DR: Set up a new VPS and set up the CMS again from scratch.

Especially if you don't know how to clean the system yourself the safest and easiest approach would be to set up a new VPS. If you don't know what you have to look for and how an infection works, it is very easy to miss something when doing the cleanup and then the infection can start again from these left overs. It is very hard to find and remove all traces of an infection from a system. I have done so for some of our customers, it is possible, but it takes time and knowledge.

If you set up a new VPS don't put the old, outdated CMS installation on that new VPS, as it will only take a couple of hours or days to be infected as well. You have to update the CMS to a supported, secure version and clean out any back doors the attackers have planted. Again, if you don't know how to do this, the easiest way might be to install the CMS on the new VPS and copy the contents from the old installation to the new one. Do not copy the whole database or files as both might contain back doors depending on the CMS in question.

If you have a clean, uninfected copy of the CMS you can copy that to the new VPS.

If you have a copy but it is outdated and you want to keep your old content, you can try to compare the copy with the infected installation. diff -ru copy infected might help here, but again you need to know what you are looking for.

With or without a copy, you can also try to list all files that were modified in the past month (or longer if the infection happend some while ago) with find -mtime -30. This is however not safe, as the attacker might have faked the modification time of files.

If you see some garbled lines in .php files this is often a sign for infected files. Something similar to below is a pretty sure sign of an infected file.

eval(base64_decode('ZWNobyAiSGVsbG8gTHViV24sIHRoaXMgaXMgaG93IGNvZGUgb2Z0ZW4gbG9va3MgbGlrZSBpZiBhbiBhdHRhY2tlciB3YW50cyB0byBoaWRlIHdoYXQgdGhlIGNvZGUgZG9lcyBmcm9tIHlvdXIgcHJ5aW5nIGV5ZXMuIjs='));

Of course you can grep -r eval . for those lines but again not all infections necessarily contain eval. There are other ways to execute random code, too, and the attacker might have added code that is not obfuscated.

Please be aware that if you go down this road you have to find all places where the attacker manipulated your CMS and clean them up, otherwise the infection may continue.

In your case there might be a middle way, too. Assuming the attacker has not gained root privileges (an assumption that of course is not safe, but as the miners run as www-data it is possibly true), you can backup and then remove all files belonging to www-data. The backup should of course be on a different system and the CMS should not be run from that backup. You should also clear out the crontab of www-data (crontab -e -u www-data). If only user www-data is infected this should completely remove the infection from your system and you can start installing a new CMS on the VPS. If the infection continues, you should set up a new VPS and do the CMS installation again.

Regarding clamav: you can try to run it, but it most probably won't clear out the infection, so your net gain is probably zero.


Unity Panel Disappeared After Losing My Home Folder

The problem is solved although I'm not sure what caused it.  It was quite simple; at the password prompt to log in, just above and to the right is an icon to choose the login options.  That was set to 'User Defined Session'.  By simply choosing Unity instead I was able to log in and the unity panel displays as normal.  I never created any kind of user defined session in the past that I know of but after choosing the Unity option just one time it's now become the default, so everything is back to normal.
Thanks Superaxander


TouchScreen recognized, but not working in 13.04

You can fix the KVM error by going into BIOS by pressing the recovery button and enable Intel Virtualization option. I have the same touchscreen and I found out that it takes over 10 seconds for touchscreen to load. Try shut the lid for while and reopen and in my case it works. We need to find a way to make the module wait longer before reporting TIMEOUT. Will look more into this issue.

EDIT by OP: It appears that your recommendation about 'shutting the lid' was really just suspending the system.  That immediately activates my touchscreen every time.  Try just using 'Suspend' from the Power menu if you have that option enabled, and see if yours behaves similarly?

Doesn't give us a definitive answer, but I can use LaunchPad to report the bug, and mark your solution as at least a temporary workaround.  Note:  I had 'lid close' set to shutdown, so I would never have seen this work on my system.


Decode MCE (Machine Check Exception) in Ubuntu 18.04

mcelog can still be compiled and executed manually. If you have git and a build toolchain installed, you can run:

git clone git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git
cd mcelog
make
./mcelog --ascii < /path/to/logfile

The logfile should contain content similar to:

CPU 0: Machine Check: 0 Bank 4: e600000000020408
TSC 0 ADDR fef13b80
PROCESSOR 0:506c9 TIME 1565455642 SOCKET 0 APIC 0 microcode 38

mcelog will print decoded information to stdout.


ubuntu 15.10: How to set alt+tab to switch windows only in the current workspace?

I found that I could set it under unity-tweak-tool


Check the Answer in this question.
This can be help full if someone still facing the same problem in Ubuntu 2020.


generalizing from an answer answer from this forum:
convert orig_file.jpg -blur 0x8 blured_file.jpg

or
convert orig_file.jpg -filter Gaussian -blur 0x8 blured_file.jpg

where 0x8 defines radiusxsigma from the imagemagick documentation:

The Sigma value is the important argument, and determines the actual amount of blurring that will take place.
The Radius is only used to determine the size of the array which will hold the calculated Gaussian distribution. It should be an integer. If not given, or set to zero, IM will calculate the largest possible radius that will provide meaningful results for the Gaussian distribution.
The larger the Radius the radius the slower the operation is. However too small a Radius, and severe aliasing effects may result. As a guideline, Radius should be at least twice the Sigma value, though three times will produce a more accurate result.


Why does asterisk produce unexpected results in find?

Without quotes, the shell expands *.htm to a list of files and passes this list to find.  With quotes, the shell provides the five character string *.htm as an argument to find.

For example, with quotes:

$ ls
a.htm  b.htm
$ echo find . -iname '*.htm'
find . -iname *.htm
$ find . -iname '*.htm'
./b.htm
./a.htm

The above works as desired.  Without quotes, find is given arguments that it does not know how to process:

$ echo find . -iname *.htm
find . -iname a.htm b.htm
$ find . -iname *.htm
find: paths must precede expression: b.htm
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]


Thanks, One of the issues is I should have been using :

ssh ubuntu@ec2---*-.us-west-2.compute.amazonaws.com -i f:tproxy.pem -L50000:localhost:8118 -f -N


To solved it,

First Step
Check all package source using:

rgrep 'xenial' /etc/apt

cause i used trusty instead xenial, so i remove all sources that of snapd* using

sudo add-apt-repository -r 'deb [some link xenial] xenial Release or inRelease'

Next Step

and i can purge and remove snapd to solved that.

dpkg --purge --force-all snapd
sudo apt install --fix-broken

run sudo apt-get update,after updated it's solved to me.


CuPy - import error - nvidia lib. not found

I reinstalled the NVIDIA drivers and it worked out..


How to Make Capslock Control without xmodmap/XKBOPTIONS?

Add 'caps:ctrl_modifier' to the value of org.gnome.desktop.input-sources xkb-options in gsettings, for example

 gsettings set org.gnome.desktop.input-sources xkb-options "['compose:ralt', 'caps:ctrl_modifier']"

You can use

gsettings set org.gnome.desktop.input-sources xkb-options "$(gsettings get org.gnome.desktop.input-sources xkb-options | sed "s/]/, 'caps:ctrl_modifier']/")"

to append on to the current value of xkb-options. You can find more possible option in the "OPTIONS" section of the xkeyboard-config manpage

To change your keyboard layout you need to set the value of org.gnome.desktop.input-sources sources, e.g.

gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us+dvorak')]"

if you want to only use Dvorak or

gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us+dvorak'), ('xkb', 'us')]"

if you want to be able to switch between Dvorak and standard layout.

See the "LAYOUTS" section of the xkeyboard-config manpage for more layouts. You need to substitute the parents so that e.g. us(dvorak) becomes us+dvorak.

The XKB settings from gsettings are loaded by GNOME at startup and overwrite any previous settings. To use setxkbmap you need to make sure that your setxkbmap are run after the GNOME settings are applied. I don't know how to do this.


secure erase with hdparm - can still see file content

I think you needed the reboot for the new mapping of the hard disk drive to be seen by the system.

If you want to, you can try to recover files from the 'drive surface' with PhotoRec,

http://cgsecurity.org

or look at the following link,

Re: best way to wipe a drive

which also shows checking the result with xxd

roten@my-precise:~$ sudo hdparm -I /dev/sdb
...
Security:
    Master password revision code = 65534
        supported
    not    enabled
    not    locked
    not    frozen
    not    expired: security count
    not    supported: enhanced erase
    88min for SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 50000391f340058c
    NAA        : 5
    IEEE OUI    : 000039
    Unique ID    : 1f340058c
Checksum: correct
roten@my-precise:~$ sudo hdparm --user-master u --security-set-pass Eins /dev/sdb security_password="Eins"

/dev/sdb:
 Issuing SECURITY_SET_PASS command, password="Eins", user=user, mode=high
roten@my-precise:~$ sudo hdparm -I /dev/sdb
...
Security:
    Master password revision code = 65534
        supported
        enabled
    not    locked
    not    frozen
    not    expired: security count
    not    supported: enhanced erase
    Security level high
    88min for SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 50000391f340058c
    NAA        : 5
    IEEE OUI    : 000039
    Unique ID    : 1f340058c
Checksum: correct
roten@my-precise:~$ sudo time hdparm --user-master u --security-erase Eins /dev/sdb security_password="Eins"

/dev/sdb:
 Issuing SECURITY_ERASE command, password="Eins", user=user
0.00user 0.00system 1:11:03elapsed 0%CPU (0avgtext+0avgdata 2432maxresident)k
0inputs+0outputs (0major+200minor)pagefaults 0swaps
...
Security:
    Master password revision code = 65534
        supported
    not    enabled
    not    locked
    not    frozen
    not    expired: security count
    not    supported: enhanced erase
    88min for SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 50000391f340058c
    NAA        : 5
    IEEE OUI    : 000039
    Unique ID    : 1f340058c
Checksum: correct
roten@my-precise:~$ sudo time xxd -a /dev/sdb
[sudo] password for roten:
0000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
1000000000000 0000 0000 0000 0000 0000 0000 0000  ................
2000000000000 0000 0000 0000 0000 0000 0000 0000  ................
3000000000000 0000 0000 0000 0000 0000 0000 0000  ................
54272.57user 343.93system 15:10:36elapsed 99%CPU (0avgtext+0avgdata 2096maxresident)k
488398400inputs+0outputs (0major+179minor)pagefaults 0swaps
roten@my-precise:~$


Gwibber is not able to connect to facebook

It is a bug. A fix should come soon.

https://bugs.launchpad.net/ubuntu/+source/gwibber/+bug/1058672


Why is double-finger scrolling smooth in some applications but in others not so much?

The scrolling behaviour varies by each application because it relies on the app-specific implementation. In Chrome, for instance, you can activate experimental smooth scrolling support from the flags menu, which you can access by typing chrome://flags/ in your address bar.


TL-WN8200ND has RTL8192CU (Realtek) chipset (see here: https://wikidevi.com/wiki/TP-LINK_TL-WN8200ND)

You can download the Linux driver here: http://www.realtek.com/downloads/downloadsView.aspx?Langid=1&PNid=21&PFid=48&Level=5&Conn=4&DownTypeID=3&GetDown=false&Downloads=true#2772

Just unzip and run sudo bash install.sh inside the uncompressed directory.

It works OK for me under Debian Wheezy, I think it should work on Ubuntu also.


how to install RADEON Open Source and Ati Catalyst (fglrx) together?

I am sorry to say, but you can't basically. The only thing I could imagine is if you have vt-d to use one in a xen vm.


You should be able to copy the original file from your /usr/share/readline directory:
$ diff -s /usr/share/readline/inputrc /etc/inputrc
Files /usr/share/readline/inputrc and /etc/inputrc are identical


My C code working on Windows perfectly but isn't working on Ubuntu exactly

Your program has many errors in it, here are a few:

FILE *file= fopen("hw4_disordered_people.txt","r");

while(c!=EOF){  // how many of struct

Here you don't check if opening the file succeeded and you begin to make use of the uninitialized variable c, which can technically have any value sitting in memory assigned to it. Even with the assumed value of 0 this is also still wrong since this assumes that a file is at least 1 byte large meaning this program may do strange things with an empty file passed to it.

while(c!=EOF){  // how many of struct
    c = fgetc(file);

    if(c=='\n'){
      ++count;
    }
}

The correct way to write this would be closer to:

while ((c = fgetc(file)) != EOF) {
  ++count;
}

It's also worth noting that this portion of the program can be replaced by using the wc -l command, which counts how many lines exist in a file.

if (str1[j+1] == '\n')

There is no guarantee that j+1 is a valid index into this array.

char str[250];

There is no guarantee that a line in the file won't be 248 characters or longer (including the newline and null terminator)

Person person[300];

There is no guarantee that the input file will be 300 or less lines.

str[k] = '\0';

k may now point outside the bounds of the character array, although the input needed to do it is a pretty specific edge case.

strcpy(person[index].id,str);

Buffer overflow if index is out of range (300)

for(i=1;i<=count;++i){

This likely attempts to access data outside the bounds of the array. The fact you increment early in the loop and discard index 0 of the array is strange, but not technically an error, but the fact that you are willing to access count + 1 as a valid address is an error and if you were using malloc without a fixed array size or processing a file with 300 inputs this would segmentation fault / crash the program.

You should compile your code with gcc -Wall and you will likely get a lot of these warnings automatically.

If your course material allows it you should be using C++ with the Standard Template Library (STL) in which case this entire program would be a few lines of code that have strong guarantees that it won't have many of the memory errors presented here since it would use std::string and std::istream to make this less of an issue along with std::unordered_map to make lookups faster.


Why do I sometimes log in twice (instead of once)?

I had the same issue due to some mixup of keyrings.

Go to System / Preferences / Passwords and Encryption Keys.

I had two keyrings there, one called "login" with no keys in it, and another called "default" with several keys, for example the password for my wifi.

Copy the passwords of all the keys in the "default" keyring (for backup)
Delete the default keyring
Logout
Login, and re-enter passwords when asked, for example for your wifi, etc

From this point on your keys and passwords will be stored in the "login" keyring. This keyring is unlocked when you login to Ubuntu, so you only have to enter your password once.


How do I connect to my Brother MFC-6800 over USB?

I found the MFC-6800 in this list under "laser1".  So, then I installed the package brother-lpr-drivers-laser1 using the Software Center.  After that, when I added the printer, Ubuntu automatically recognized it.


Dell XPS 9575 + Ubuntu 20.04.1: Keyboard/trackpad unresponsive on boot

In order to get the keyboard/trackpad working on Ubuntu 20.04.1, the workaround is to add "blacklist intel_vbtn" to `/etc/modprobe.d/blacklist.conf.
I was able to find this link below that helped me to solve my problem. Workaround seems to be necessary for all but the latest linux kernels.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1822394


While my solution won't remove the disk encryption (I'm pretty sure you have to do a block copy of your unencrypted version over your encrypted disk to do that), you can make your system decrypt itself at boot time.

The process documented in
How to configure LVM & LUKS to autodecrypt partition? should be of use to work around this issue. When your system boots, it will find the key and decrypt the drive (instead of prompting for a password).


Two processes doing extensive calculations - I want one to get ~100% of processor time - how?

Thanks to @ubfan1 I have explored different scheduling strategies, and here is the best result I have achieved so far:

process 1 is running with SCHED_BATCH policy
process 2 is running with SCHED_RR policy

results: when both processes are running simultaneously:
 - process 1 is given with ca. 5% of CPU
 - process 2 is given with ca. 95% of CPU

and
when only process 1 is performing calculations (process 2 is waiting for my input to start calculations) - process 1 is using 100% of CPU

If someone is interested more, read this:

http://manpages.ubuntu.com/manpages/xenial/man8/schedtool.8.html
http://man7.org/linux/man-pages/man7/sched.7.html


Actually no need flint. Just do md5sum and a get list of I/O errors, then process to delete those files.

~/usr/mnt5/DCIM/104APPLE$ md5sum *
md5sum: IMG_4001.JPG: Input/output error
md5sum: IMG_4002.JPG: Input/output error
md5sum: IMG_4003.JPG: Input/output error
md5sum: IMG_4004.JPG: Input/output error
md5sum: IMG_4005.JPG: Input/output error
md5sum: IMG_4006.JPG: Input/output error
md5sum: IMG_4007.JPG: Input/output error
md5sum: IMG_4008.JPG: Input/output error
md5sum: IMG_4009.JPG: Input/output error


Do I have to partition the drive in windows before installing Ubuntu?

I would use the advanced partitioning tool in the installer, it works.

!!! Warning: If for some reason Ubuntu doesn't recognize Windows, do not try to partition it. This will ruin your data !!!

As far as I remember, the 64-bit version recognizes UEFI, but 32-bit doesn't.


How do I auto run a program when I log into a specific console?

Put this in ~/.bashrc

[[ $(tty) == '/dev/tty1' ]] && /full/path/to/HomeAuto


Configure a live USB to install add repos and install software

Here is a way of copying from one computer to another one. In a simple way:

Make a copy of your installed packages

sudo dpkg --get-selections | sed "s/.*deinstall//" | sed "s/install$//g" > ~/pkglist

then a copy of your config  /etc/apt/sources.list. Save these two files on any  repository and use them every time you install new computer by running

sudo aptitude update && cat pkglist | xargs sudo aptitude install -y

Make sure you put your sources.list in your new computer's.


If the BIOS cannot see the SSD, as you claim in the comments, then the problem you have is one with your hardware and not with Ubuntu. You will need to identify what the problem is, which could be anything from a loose/damaged connection to a broken SSD, and then take the appropriate action. Perhaps you could try plugging the SSD into the slot you usually use for your HDD; this would allow you to determine if the fault is with the connection or the SSD itself.


What you describe sounds less like something to be done by a PDF viewer. How about enabling thumbnails for pdf in your Filemanager? In Dolphin (the KDE default file manager) you can do this by executing the following commands:

sudo apt install kdegraphics-thumbnailers
sudo ln -s /usr/lib/x86_64-linux-gnu/plugins/* /usr/lib/x86_64-linux-gnu/qt5/plugins/

and then going to configure Dolphin --> General--> Preview and enabling for pdf.

I am confident that it is as easy in Nautilus.

Another alternative might be organizing your pdf library in Calibre. Calibre will create a thumbnail from the first page of each pdf file (like a filemanager would do too).


You can set field-separator using -F option. Use the following commands in terminal,

$ awk -F "::" 'NR==1 {print $1}' logfile.txt
1
$ awk -F "::" 'NR==2 {print $1}' logfile.txt
10
$ awk -F "::" 'NR!=1 && NR!=2 {print $1}' logfile.txt
127.0.0.1
172.17.1.1

NR variable stores the line number. For example consider your file, with :: as
field-separator

        $1          $2        $3
NR=1    1
NR=2    10
NR=3    127.0.0.1
NR=4    172.17.1.1

and so on.

If you use . as field-separator it will be like,

        $1          $2        $3     $4
NR=1    1::
NR=2    10::
NR=3    127         0          0      1
NR=4    172         17         1      1


Is there any known way to get around the limitations of the gnome custom key bindings?

There are alternatives to dconf's binding functionality if you run Gnome on X-server. You could use xbindkeys or sxhkd, daemons that are configured using a text file, and can be loaded automatically on log in. Both will work well in Gnome running on X, but may not work on Wayland.

You can assign your custom commands to Shift+key keys. However, these utilities do not allow to discriminate between left and right modifier keys.


How to move directories that were listed in a .txt file?

I'd suggest a while loop

while IFS= read -r dir; do
  echo mv -t /media/skipped/ "$dir"
done < yourfile.txt

The echo is there so you can test the command - if it runs OK and lists out the correct sequence of moves, remove the word echo to make it run for real.

Example:

$ ls -l olddir/
total 8
drwxrwxr-x 2 user user 4096 Jul 27 12:32 subdir
drwxrwxr-x 2 user user 4096 Jul 27 12:32 subdir with spaces

with a list of files like

$ cat dirlist.txt
olddir/subdir with spaces
olddir/subdir

then

$ while IFS= read -r dir; do mv -vt newdir/ "$dir"; done < dirlist.txt
`olddir/subdir with spaces' -> `newdir/subdir with spaces'
`olddir/subdir' -> `newdir/subdir'

and verifying

$ ls -l newdir/
total 8
drwxrwxr-x 2 user user 4096 Jul 27 12:32 subdir
drwxrwxr-x 2 user user 4096 Jul 27 12:32 subdir with spaces


Can't access internet on my college wifi. Login page doesn't show up

I assume that you are expecting a website page to pop open for login to the college network and that it is not popping open. I believe new connections are forced to a login page by a redirect link sent to your web browser (so you cannot access other pages until you successfully get through that login).

If all of this is correct and the browser redirect is not working for whatever reason, you may be able to learn the URL of the login page from a system administrator (or knowledgeable user at the college) or to see what it is from a newly connected user who gets redirected to the page and then to manually enter the URL into your browser.

I have heard that some browsers may prevent access to some login-type pages. You may wish to try opening up a different browser and heading to a favorite web page just to see if the redirect to the login takes over. (I hope that's helpful.)


Try "unetbootin".

sudo apt-get install unetbootin

Hope this will help you if I didn't misunderstand what you mean.


How to prevent unity changing workspace when activating window previously partially draged across two workspaces

I don't think there is a work-around besides just having only one workspace because of the nature of "Workspace application-switching", or however you wish to word it. I can see how it would make sense that the workspace with the majority of the window is viewed as the workspace that window is in, but could also see how it would be frustrating. I don't know if "Workspace application-switching" is a feature you can turn off, but that would be the only other solution I could think conceivable.


Ubuntu 14.04 On Acer Aspire TImelinex 3830T Microphone

Install pavucontrol, go to the recording options, disable "Lock channels together" or something like that. Put one channel (left or right) in half the other channel.

If I understand correctly your problem, it can be because when the 2 channels of the mic are in the same level, they cancel each other. I have a  5830TG and had the same problem, and fixed that way, no need to disable the PulseAudio


I need to run a security erase tool on my drive

If your SSD supports it, use the ATA Secure Erase command; assuming that your drive is /dev/sda:

Boot Ubuntu from a Live DVD
Open a Terminal with Ctrl+Alt+t
Check that your drive is not frozen: hdparm -I /dev/sda (look for the frozen or not frozen line)
If your device is frozen, you can try:

Suspend and resume
Hot replug the SATA cable (i.e. with the system loaded, unplug the SATA cable an plug it again)

Set a user password: hdparm --user-master u --security-set-pass <password> /dev/sda (replace <password> with the chosen password)
Check that security has been enabled: hdparm -I /dev/sda (look for the enabled or not enabled line)
Issue the Secure Erase command: hdparm --user-master u --security-erase <password> /dev/sda (replace <password> with the chosen password)
Check that security has been disabled: hdparm -I /dev/sda (look for the enabled or not enabled line)

This is the best method to wipe a SSD, since Secure Erase runs at firmware level and has access to all the storage areas of the device, while regular software tools don't. For further reading: ATA Secure Erase - ata Wiki and SSD Data Wiping: Sanitize or Secure Erase SSDs? | Kingston Technology


How do I change the @INC variable to use BioPerl?

The variable @INC is defined when Perl is compiled and it is embedded in the binary code.

The @inc array can be changed by modifying the PERL5LIB variable, from the command line, like so:

export PERL5LIB=/home/foobar/code

You can add this to either your ~/.bashrc or ~/.bash_profile(the preferred location) to make this change permanent.

Additionally, you can use the following in your script code:

use lib '/home/foobar/code';


How to remove ubuntu and make Windows bootable again?

This happened to me once. What I did was I booted from the USB that I had used to install Ubuntu. From there, I installed another version of Ubuntu onto the hard drive and then used the grub from this version of Ubuntu to access my other OS (I was using Elementary OS).


Cannot see USB drive (even with sudo fdisk -l command)

USB keys should automagically be mounted and added to "Places", /media/ or /media/username  and the like.

A nice tool to use when handling USB devices is lsusb. It shows you all your hubs (USB ports) and connected devices. Use:

lsusb -v

for a very verbose output etc. As always man <command>, <command> --help.

In your case however, it seems like there are some trouble. Try:

tail -f /var/log/{kernel,dmesg,syslog}

(Ctrl+C when done)

Then unplug and insert the USB device. You should see some messages, and as it is not mounted, probably some notes about why. Update question with output if you are unsure.

To output it to file, so that you do not have to copy it from terminal, you could use tee:

tail -f /var/log/{kernel,dmesg,syslog} | tee some_file_to_print_to.txt

Then update question with output:

Open file in e.g. gedit, gvim etc.
Click edit below your question.
Paste in the contents of the file.
Mark the text and press "Code sample" (<$>) from the menu line.

If it is very long paste it to paste.ubuntu.com and update question with the resulting URL (or URL's if you paste more then one).

Another nifty tool is:

udevadm monitor

Same procedure (if the output seems to be relevant).

If mounted you should also, beside fdisk and the less user-friendly /proc/partitions by:

ls -la /dev/disk/by-id

lsblk is another way to list disks in a nice way.


usr/bin/env: ‘python’: No such file or directory # error while doing Sony AOSP project

issue is resolved now. it was a system path configuration issue. Just run these three cmd & you are good to go.
1: sudo apt update
2: sudo apt install python3
3: sudo ln -s /usr/bin/python3 /usr/bin/python


I've partially solved this, at least so that the installed kernels doesn't use the DKMS module anymore. I still can't remove the package but that doesn't matter anymore, at least I've remove the DKMS module.

I remove the module by issuing sudo dkms remove -m ax88179_178a -v 1.7.0 --all and the module was removed from all installed kernels.


How to completely uninstall and reinstall Firefox?

First try moving his profile data out of the way, it may be corrupted. One easy way to do it is to rename the .mozilla directory, on a terminal:

mv ~/.mozilla ~/mozilla-backup

When you restart Firefox it will rebuild a new profile.

If you want to completely wipe out and reinstall firefox, on the terminal do this:

sudo apt-get purge firefox firefox-globalmenu firefox-gnome-support

This will remove all traces of the Firefox system files. Then, to reinstall:

sudo apt-get install firefox firefox-globalmenu firefox-gnome-support


well, its a bash script, so i'd recommend you to debug the program by executing line by line by copying line by line into a terminal and see where it is that it fails,

for example, one potential cause of the problem is that in centos, for some reason it's not finding any files/folders, so manually execute the find . -name "www" -type d instruction and see if it returns an expected result.

Repeat that process for every instruction in your program, it shouldn't take long since its a small program.


Ubuntu snap plugin 'autotools' default 'make install' to be skipped while building with snapcraft

You can override what is done in the install stage with an install: stanza which you could leave empty or so nothing but echo a blank line, showing you're skipping that. Alternatively if the Makefile has no install stanza, then you can use the install stanza to do whatever is required e.g.

parts:
  foo:
    source: .
    plugin: autotools
    install: |
      cp -a somebinary $SNAPCRAFT_PART_INSTALL/bin
      cp -a somesupportfiles $SNAPCRAFT_PART_INSTALL/foo

This will just use the shell cp command to do the installation.


Foxit icon picture is missing from Dashboard

I too faced a similar problem when installing FoxitReader in Ubuntu 12.04. I dug out a solution by going through the .desktop launcher file.

There will probably be 2 FoxitReader.desktop files on your system.

The global one at /usr/share/applications/FoxitReader.desktop, and
The local one at ~/.local/share/applications/FoxitReader.desktop which overrides the global one

In my case the local file had its Icon pointing to a non-existent png file ~/.local/share/icons/hicolor/64x64/apps/FoxitReader.png. I just copied the icon file from the /usr/share/icons/hicolor/64x64/apps directory to the pointed to location with

mkdir -p ~/.local/share/icons/hicolor/64x64/apps
cp /usr/share/icons/hicolor/64x64/apps/FoxitReader.png ~/.local/share/icons/hicolor/64x64/apps`

and Voila! The icon started showing again.

EDIT:

I just checked and simply setting Icon=FoxitReader as done in the global .desktop file is enough


The kernel log doesn't show any kernel related delay issues, the problem is more likely to be in the userspace size of the boot.  One can see what consumes the most time in the boot using:

systemd-analyze blame

or a more graphical way:

systemd-analyze  plot > plot.svg
eog plot.svg


apt asks to upgrade same package over and over again

You were using apt-get's -y option there. In apt-get manual page, this has been written about -y option

-y, --yes, --assume-yes
           Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing
           a held package, trying to install a unauthenticated package or removing an essential package occurs then apt-get will abort.
           Configuration Item: APT::Get::Assume-Yes.

From your output, it's clear that some packages are unauthenticated and thus apt-get aborting the operation. Since it's aborting, you're getting the same output again and again.

To force apt-get to install unauthenticated package silently, you need to use --allow-unauthenticated option with existing -y option. From manual page, it is

--allow-unauthenticated
       Ignore if packages can't be authenticated and don't prompt about it. This can be useful while working with local repositories, but is a
       huge security risk if data authenticity isn't ensured in another way by the user itself. The usage of the Trusted option for
       sources.list(5) entries should usually be preferred over this global override. Configuration Item: APT::Get::AllowUnauthenticated.


How do I run Tomboy in the notification area at startup?

There is an undocumented option --icon that makes tomboy start without showing a window. It HAD a bug (bug #566421), which has now been resolved.

Also, you can use the tomboy applet: Right click on the panel, choose “Add to Panel” and select “Tomboy Notes“. The panel applet looks similar to the notification area icon and provides the same functionality (hotkeys and popup menu).


How to write a script to "listen" to battery status and alert me when it's above 60% or below 40%?

If I understood your question correctly, you want to check the battery status in every X interval of time. It's easiest way that you run it in the background, inside a while loop:
while true
 do
    # Any script or command
    sleep [number of seconds]
 done

And if you want to run the script on startup and from then on every 5 minutes, so the construction would be:

Add a line in /etc/rc.local to call your script (your battery_status.sh) + "&" to make it exit.
Add the commands you want to run in the battery_status.sh to execute in a while loop (inside battery_status.sh).

Note that if you want to run it from cron, you need to set the full path, since cron runs with a limited set of environment variables.
Example
#!/bin/bash
while true
do
    battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'`
    if [ $battery_level -ge 60 ]; then
       notify-send "Battery is above 60%!" "Charging: ${battery_level}%"
    elif [ $battery_level -le 40 ]; then
       notify-send "Battery is lower 40%!" "Charging: ${battery_level}%"
    fi

    sleep 300 # 300 seconds or 5 minutes
done

Save this file by named battery_status.sh in your favorite location (mine is home directory) and add this line in /etc/rc.local file (in my example, just replace your battery_status.sh location by /home/username/):
sh /home/username/battery_status.sh &

That's all. Reboot and see the magic.
If you don't have instell acpi, just install that using sudo apt-get install acpi
One BONUS
If you want to run make this script responsible with AC adapter,you don't need an extra variable to check that run for one time. If your AC adapter is plugged and battery charged above 60% it makes a alert to "Unplug your adapter!" until you don't unplug that. If alert tell you

just unplug AC adapter then you will see the message alert don't appear again until your battery charge down to 40%. Then another message alert and tell you

if you don't unplug AC adapter on above 60% or don't plug AC adapter below 40%, the alert message shown every 5 minutes (you can adjust that for yourself in code, see sleep [seconds]) show and Will remind you.
 #!/bin/bash

    while true
    do
        export DISPLAY=:0.0
        battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'`
        if on_ac_power; then
            if [ $battery_level -ge 60 ]; then
                notify-send "Battery charging above 60%. Please unplug your AC adapter!" "Charging: ${battery_level}% "
                sleep 20
                if on_ac_power; then
                    gnome-screensaver-command -l   ## lock the screen if you don't unplug AC adapter after 20 seconds
                fi
             fi
        else
             if [ $battery_level -le 40 ]; then
                notify-send "Battery is lower 40%. Need to charging! Please plug your AC adapter." "Charging: ${battery_level}%"
                sleep 20
                if ! on_ac_power; then
                    gnome-screensaver-command -l   ## lock the screen if you don't plug AC adapter after 20 seconds
                fi
             fi
        fi

        sleep 300 # 300 seconds or 5 minutes
    done


Run application on local machine and show GUI on remote display

Variant A - Shooting X Windows to another DISPLAY:

See to it, that the Xserver on your Laptop starts up listening to tcp connections. Sadly X11-Networking is disabled by default in most distributions. Since the Xserver is started by your display manager (gdm, lightdm) this has to be configured there:

Whatever display manager you use, some configuration file in /etc/ will probably contain the responsible XServer parameter. Run grep -r 'nolisten tcp' /etc/ on your Laptop to find out which config file is responsible and remove the part where it says -nolisten tcp (not the entire line, just this parameter). Restart X on your Laptop.

Your Laptop should now have a display running on tcp port 6000 (try running nmap -p6000 Laptop on your Desktop PC, if the port reported as "open", you came this far).
Make your X-display available to the desktop computer. X11 uses an authentication mechanism to grant access to a display. You have to allow the desktop PC to shoot Windows onto the Laptop. Normally by exchanging a display cookie.

For starters perform this step with hands on your notebook. Once you have gotten the concept with the DISPLAY variable and everything, you can do this via ssh.

Quick and dirty: You can run xhost +desktops.computers.ip.address on your laptop to grant X access to the desktop computer. Note that every user on your laptops computer can use your laptops X display this way. Note that this is sufficient i.e. for installing a keylogger on your laptops display. Use this method only for testing.

Correct and secure: run xauth extract cookie-file :0 on your laptop to export your display access secret to "cookie-file". Transfer the cookie to your Desktop machine. Run xauth merge cookie-file. Or in one short step (from your desktop) ssh Laptop xauth extract - :0 |xauth merge - Note: if your laptop and desktop are sharing a home directory i.e. via nfs you don't need to exchange any credentials. The credential database is the .Xauthority file in your home dir, and can be shared among different machines.
Run the program: In a terminal on your desktop PC run export DISPLAY=Your.Laptops.IP.Address:0, run any X program in the same terminal. It should appear on the notebooks display.

Variant B - Using SSH with a twist.

SSH accomplishes X11 forwarding by forwardin a local X11 socket (normally a Unix Domain Socket) to a local TCP socket on the remote machine, then negotiating the display cookie, then setting the DISPLAY-Environment on the remote machine. This way all X11 traffic is encrypted over the ssh tunnel. The normal use case is to forward the local display to the remote machine (meaning allow remote applications to display x windows locally).

The advantage of using ssh is, that you don't need to put your X-Server into tcp listen mode (since the unix socket is used). And ssh handles the credential exchange.

SSH to your laptop from your desktop computer (you don't need to use -X yet).
In the remote shell enter export DISPLAY=:0 this makes the already running display on your notebook available to the shell you got via ssh. If you run any X command now, it will already appear on your notebook screen, but still run on your laptop (try it out to be safe).
From this shell ssh back to your desktop computer, use -X this time. You now have a shell on the machine on which the ssh session originated but this time with working X. Run xeyes or xcalc to test it.
echo $DISPLAY shows you the designation, your laptops X display has now on your desktop computer. I.e. :10 or :11.
You can minimize the terminal now. Anytime you enter export DISPLAY=:10 (see what display number you got) on your desktop computer now, each program you run afterwards in the same shell will appear on you notebooks screen.

This Variant is easy but slow, since all X11 traffic is forwarded via SSH.

Variant C - The original thinclient concept:

You can use your laptop to Open a desktop session running entirely on your desktop computer.

Configure the display manager on your Desktop to answer to XDMCP Broadcasts. How to do this depends on your display manager. Some display managers don't support this at all, i.e. slim. XDM, KDM, WDM, GDM do support it.
Start a X-Server on your Laptop, which requests the display manager from your desktop. Either a nested X: Xephyr :1 -query desktop or Xephyr :1 -broadcast
Or by shutting down your Notebooks X-Server and enter on a System Terminal sudo Xorg :0 -broadcast

The display manager will see to it, that credentials are generated and exchanged and everything. Congrats, you should now see a login window provided by your desktop computer.


Why do the "used size" in partitioning on installation don't match the values I see in Windows?

Because you are using the Windows "Dynamic Disk" partitioning scheme, which the Linux partitioning tools do not yet understand ( it's proprietary and only partially reverse engineered ).

You will need to reduce the number of partitions to 3, then convert it back to a basic disk, then you can create an extended partition and fill it with logical partitions.


bash: /usr/bin/php: No such file or directory

You did four commands.

The first one simply renamed 'php' to 'php.old'. That's why the system cannot find 'php' anymore - it's called something else now.

The other three commands did nothing because you entered nonsense. There is no such path as '/path/to/php/'. You were supposed to change that to reflect the REAL path to php.

Use mv to restore your php: mv /usr/bin/php.old /usr/bin/php. Since this is outside your /home directory, you must prepend sudo.

It's wise to avoid magic shell incantations until you understand:

Exactly what the command does, and exactly what each element of the command does.
How to undo it if you make a mistake.

One more thing: Since the first command worked, that seems to indicate that you are using root instead of sudo. Run away from any instructions for new users to use root in Ubuntu. Non-judicious use of root risks destroying your system with ordinary human typographic mistakes...which newer users make frequently. You made three among those four commands!


I had pretty much the same problem as you, and presumably at the same time (around the 20 or 21st - around 7 days ago), i started getting exactly the same artifacts - though not on chrome, just everything else. If my memory serves, this may be because chrome wrote its own window decorations and I do wonder if that has to do with why its not effected the same.

Im running a similar (but not identical) config, 960M gpu, same CPU. What worked for me was similar to the first post you refer to but used the 370 drivers:

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

I also found reverting to the Nouveau drivers worked.

I dont think its the best solution ever (I dont like pulling drivers from ppa's for my graphics, but it surfices until the nvidia driver is fixed)

Interesting to note that the same set of updates also broke dns for me. The dnsmasq that network manager runs wasnt surviving suspend/resume either (removing that from network manager has solved the issue, but I dont exactly like that as a fix)


Only send openvpn ip private ip traffic through tunnel

I was able to resolve this:
Here is a related post:
https://superuser.com/questions/457020/openvpn-only-route-a-specific-ip-addresses-through-vpn

route-nopull
I added:
route-nopull

I also installed NGINX using the following command:

sudo apt-get install Nginx -y

After installation, I remained connected to the VPN

My IP address was: 10.8.0.34 and I was successfully able to browse to the webpage using the public IP address, and ping the VPN IP 10.8.0.34, from the server to the client.

I consider this question 'answered'


Install/copy Ubuntu 16.04 LTS (official) on Rasperry Pi 2 Type B

So, I ended up letting it run for about 10 hours, and when I woke up everything seemed to be copied. Don't know why it took so long, as its a Class 10 card - but anyway; now it works!


How to add default gateway with trailing zero(s)?

Well you wont be able to add 192.168.2.0 as a GW if this is a /24 network. In /24 this is network address. Broadcast is at 192.168.2.255. If the router is using this as it's IP then you must have DHCP misconfigured. You probably want a /23 network in this case.


Setting Up Loopback to Function When Ethernet Disconnected

The loopback interface is always up unless you're somehow explicitly disabling it. However, only local addresses (127.x.x.x, ::1) are routable on it.


Replacement for non-interactive "chpasswd -e"?

Use a simple script like this one I just wrote:

#!/bin/bash

USER=$1
if [[ -z "$USER" ]]; then
  echo "From which user should I clear the password?"
  read USER
fi
if chpasswd -e -h > /dev/null 2>&1; then
  echo "$USER:*"|chpasswd -e
else
  passwd -d $USER
  cp /etc/shadow /etc/shadow.old
  USEROLD=$USER::
  USERNEW=$USER:*:
  sed -i "s/$USEROLD/$USERNEW/g" /etc/shadow.old
  cp /etc/shadow.old /etc/shadow
fi

The use of the script is at own risk.


Ubuntu 16.04 systemd in degraded state because dns-clean service failed

the command mkdir return an error if the directory exist.
You can avoid this error using mkdir -p. just edit /lib/systemd/system/dns-clean.service and ajust the line ExecStartPre=/bin/mkdir -p /var/run/pppconfig


Ubuntu 16.04: unattended task eating CPU

I found this answer in another post.  Apparently with 16.04 an automatic apt-get update & upgrade that is performed twice a day.  https://github.com/chef/bento/issues/609

I have not addressed this problem on my install as yet, but wanted to relay this information.

dpkg and apt-get were unlocked on my install after a 5 minute delay after startup.


Can't zoom with Thinkpad T480s touchpad in 18.04

sudo sh -c 'echo -n "elantech"> /sys/bus/serio/devices/serio1/protocol'


I executed 'dd' on my /dev/sda and now I get "unknown filesystem" error

I finally solved it. I followed the instructions in this link.

Basically I had to:

sudo fsck.ext4 -v /dev/sda1

After a lot of fixing (and answering 'yes') I got a final message similar to this:

/dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda1: 88123/761856 files (1.5% non-contiguous), 2038341/3044128 blocks

Then reboot and everything was fine.


You can see where CPU is being consumed in even more detail using "perf":

Install perf:

sudo apt-get install linux-tools-$(uname -r)

Next, start the program that consumes all the CPU resources

Next, run perf and capture all scheduling events for say 60 seconds:

sudo perf record -a sleep 60

Once that has completed, you can get a log of all the perf events using:

sudo perf script > perf.log

and you can look at that, or better, one can interactively look at the CPU hotspots using:

sudo perf report


How can I send a custom desktop notification?

There are a bunch of other cool features with notify-send

We can run a command and make it display in the notification:

notify-send <title> <`command`>
notify-send Date "`date`"
notify-send Disk "`df / -H`"

We can use icons with the notifications

notify-send -i <icon> <Message>
notify-send -i face-wink "Hello! January"

Really annoying pop up

notify-send  -t 0 "Bringing down the system"

and

notify-send <title> <message>
notify-send "who am i" "I am January"

For more options check here


As part of the package upgrade process, if you have modified a configuration file you will be asked if you wish to keep the modified file, or install the new version, and have the opportunity to view the differences.

This wiki page shows the support periods of all the Ubuntu versions - wiki

Standard releases, e.g. 9.10, are supported for 18 months.  LTS releases are supported for 3 years on the desktop and 5 years as server.  Upgrading to 10.04 has the advantage of this being LTS.


Magic Mouse inertial scrolling and multi-touch gestures


I have not enough reputation to make a comment, but it seems to me that you need to put your script in /usr/local/bin.

From man hier(7)

/bin
    This  directory contains executable programs which are needed in
    single user mode and to bring the system up or repair it.

/usr/local/bin
    Binaries for programs local to the site.

You know, copy with sudo cp and check the permissions.

But if you want to use the program just for yourself, put in on /home/$USER/bin folder.

Also, you can make a symlink from your script to a path in /usr/local/bin

ln -s /full/path/to/your-script.sh /usr/local/bin/<empty or optional name>

How to put executable to /usr/local/bin?
Differences between /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin
https://unix.stackexchange.com/questions/8656/usr-bin-vs-usr-local-bin-on-linux


Maya 2017 doesn't support installation on Ubuntu. The sytems supported include:

Microsoft® Windows® 7 (SP1) and Windows® 10 Professional operating system
Apple® Mac OS® X 10.10.5, and 10.11.x operating system
Red Hat® Enterprise Linux® 6.5  & 7.2 WS operating system
CentOS 6.5  & 7.2 Linux operating system

See the system requirements.

One alternative would be to run a supported OS on a VM, and install it on that. However, since you downloaded via torrent there's no guarantee that you have what you think you have. You might be better served by downloading from the source.


Some applications (Anki, Okular, Calibre) start very slowly

The problem disappeared by itself.
I have no idea why this is. Simply rebooting didn't do the trick.

Thanks @ObsessiveSSOℲ for trying to help!


How do I enable the libreoffice quickstarter in unity?

I managed to fix it by whitelisting all applications and restarting my computer. Seems unity (3D) needed a few updates to make it work correctly).

NB: I was also able to get it to work with a somewhat crude method of whitelisting:

soffice.bin, Soffice.bin, soffice --quickstarter, soffice.bin --quickstarter Soffice --quictkstarter, Soffice.bin --quickstarter

I'm not sure which one exactly did it, but I would have to do further testing with individual values to find the exact value.


Change password for User and Root in Ubuntu 18.04

During installation of Ubuntu, you don't set any password for root, the account is disabled for logins and you also don't need that. You can check if that is the case:
sudo passwd -S root

-S, --status
Display account status information. The status information consists
of 7 fields. The first field is the user's login name. The second
field indicates if the user account has a locked password (L), has
no password (NP), or has a usable password (P).

If the second field is an L, the account is locked and you don't need to do anything. If the second field has NP or P, you may want to lock it with this command:
sudo passwd -l root

See here for more information on why root is disabled by default in Ubuntu.
Then you can simply change your user password, and you're good.

Another option (or better additional measure) would be to change your ssh-server's settings (in /etc/ssh/sshd_config):
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes

Also check ~/.ssh/authorized_keys file if your friends installed password-less authentication on your system. However, if you consider your "friends" could have installed some backdoor, you should follow @guiverc's advice ...


Can I take an image of the person trying to log in after 3 login attempts fail?

#!/bin/bash
ts=`date +%s`

ffmpeg -f video4linux2 -s vga -i /dev/video0 -vframes 3 /home/sachin/Desktop/vid-$ts.%01d.jpg

reboot -f

exit 0

I use the above script to take an image of the person and suddenly reboot the system. But I don't know how to execute this script at login time providing 3 login attempts fail, so would appreciate any help with that.


Trying to make a bootable usb that I can use for Ubuntu

I would recommend using UNetBootin (https://unetbootin.github.io/) on Windows 8. To be sure, I usually ran this as Administrator and usually formatted the USB stick before hand even though the software will do this.


run windows game on wine with nvidia propetary driver

Try lutris:
https://lutris.net/

It installs wine and all needed components automatically.

Try installing nvidia driver from ppa repository:

https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux


Since what time or date updates have been available on the system?

Not really, because it depends when you did an apt update which overwrites the database each time.
You could look at the mailing list which shows all updates to Focal. This shows when packages are promoted to the archive, in chronological order.


I had a go running the same program. It worked fine for me.

According to the 'README-linux.txt' file:

  The Firestorm Linux client can entirely run from the directory you have
  unpacked it into - no installation step is required Run ./firestorm from the >installation >directory to start Firestorm.

So in my case, running the program was relatively simple:

Go to the Downloads folder, extract the archive, and then go into the extracted Phoenix folder:

cd ~/Downloads/
tar -xvf Phoenix_Firestorm-Release*.tar.bz2
cd ./Phoenix_Firestorm-Release*

Provide a script with permission to execute. Executing the script then adds Firestorm to the menu.

chmod u+x ./etc/refresh_desktop_app_entry.sh
./etc/refresh_desktop_app_entry.sh

After that Firestorm should appear in your menu. It can then be run directly from the extracted archive.

I think your problem with logging in may related to this output:

  parent@ubuntu:~$ sudo '/home/parent/Downloads/Phoenix_Firestorm-Release_i686_4.2.1.29803/install.sh'
  Enter the desired installation directory [/opt/firestorm-install]: /home/parent
  - Backing up previous installation to /home/parent.backup-2012-08-27
  - Installing to /home/parent
  cp: cannot stat `/home/parent/Downloads/Phoenix_Firestorm-Release_i686_4.2.1.29803/*': No such file or directory
  Failed

In particular, it seems as if you choose to install the program in the same location as your home directory (due to typing '/home/parent' at the command prompt). Therefore, the installer moved the contents of the home directory to "/home/parent.backup-2012-08-27", which would have lead to some important files being moved.