Open settings to add and remove a language, IBus should be shown as the default option.
Choose to add Japanese, which automatically installs fcitx-mozc.
When it's done, close the language window and reopen it. This time, fcitx will be available as an option, choose it.
Log out, log in, and there should be a small keyboard icon on the upper right.
Click it, and choose configure input method.
Click on the add language button (a small plus button on your bottom-left corner.
Uncheck the option to only show the current language (above the search bar), and type in mozc, which should show up the option mozc - Japanese.
Click OK and you should be able to use Japanese in most applications by hitting ctrl + space


How to move multiple folders to another directory?

I could type whatever was typed in this article again, but here:
https://discuss.devopscube.com/t/how-to-move-mv-multiple-directories-or-files-to-a-folder-at-a-time/100

The basic command is:

  You can do this using -t flag with the mv command.

  The syntax would look like the following.

  mv -t <destination> <src1> <src2> .... <srnN>


How to modify configuration file from command line?

sudo sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/'
  /etc/ssh/ssh_config


Software Center shows none of my purchases

A bug report has been filed for this.  It seems that a relatively small amount of people are affected by this.

Link to bug


Can your computer run from a USB? If yes, then press Delete or Esc or F12 then look for the part that say boot from device or something like that and then press F10 to save that settings then it should boot from the USB, if your computer can boot from USB.


command line calendar (cal) on M10 tablet not working

The command cal is not installed by default on Ubuntu Touch. Contrary to desktop Ubuntu you can not simply install it through apt-get.

Your options are:

wait for somebody to package it for Ubuntu Touch (unlikely, as this is not really a typical tablet/phone application)
mount your system r/w and install with apt-get (DON'T DO THIS, it will likely break your system)
install it in a container or chroot (but this is not trivial, see https://askubuntu.com/a/623311/532550 for full instructions)
install it from source in your home directory (if the necessary compilers etc. are available)
use a different application

I think your best options are 4 and 5.

P.S.: "does not work" and "fails" is not really a useful error description. To allow people to help you, include all necessary information, in this case the command you ran and the error message you got:

phablet@ubuntu-phablet:~$ cal
bash: cal: command not found


Scripts on custom shortcuts
We can use terminal commands assigned to a keyboard shortcut to read parts of the screen.
To assign a script to keyboard short cut open System Settings > Keyboard > Shortcuts to create a new shortcut with +.

Give a sensible name to the shortcut (e.g. ReadScreen). Enter the full path to one of below scripts in the command line. After we had applied the new shortcut we need to press the desired keyboard shortcut, e.g. Alt + Scroll Lock, making sure it does not yet exist.
Choose any of below scripts (or both on different keys) depending on your needs.

Case reading selected text:
Save the following script as e.g. ReadClip to a sensible place and give it executable permission.
#! /bin/bash

xclip -o | espeak

On pressing the predefined key the default speech synthesizer espeak  will read all selected text, or in case no text was selected the content of the clipboard (if text) by using xclip .
Of course we can adapt the script to use any other speech synthesizer (e.g. spd-say).

Case reading text including text on images
Save the following script as e.g. ReadShot to a sensible place and give it executable permission.
#! /bin/bash

gnome-screenshot -a --file=tmp.png &&
tesseract tmp.png stdout | espeak

On pressing the predefined key we can select an area of our screen using the default screenshot tool. The resulting image will be processed by the OCR software tesseract-ocr  and then will be read out using espeak .
The results are not quite as good as from processing text files but they still are remarkably good, and we can use this for all that is displayed on the screen including images. In case we don't want to keep the temporary image tmp.png we can add a rm tmp.png to the script.
For both, tesseract, and for espeak there are many options including support for languages other than English.


Apparently, the armhf .deb package for tftp is in the repositories:

tftpd_0.17-18ubuntu2_armhf.deb


Systemd Journald accessing wrong location - fails to open /run/log/journal file

This behaviour is normal and ok.

During the early boot phase the /var directory is not mounted and ready to write log files on the hard-disk. Therefore memory is used for storing and log-data is written to /run/log/journal. After it is mounted, all the data get's flushed into the disk (systemd-journactl-flush.service).

Afterwards the systemd service manager invokes all service processes with standard output and standard error connected to the journal by default. Hence, the data streams are piped through from the unit to the run directory, and further to /var/log.


Is there any way to re-organise the global application menu?

The application menu just displays an application's menu, it doesn't generate the menu itself.

There's no real way to do what you want other than modifying the menus in each application.


How do I install the game eggnog (without using wine)?

It seems that the game does not require installation.

Extract the eggnogg-linux.tar.gz
Open eggnogg-linux directory
Right-click on eggnogg > Properties > Permissions > Check Allow executing file as program

And it should run when double-clicked.


HTTP traffic thru redsocks service using iptables not working

The redsocks2 website (https://github.com/semigodking/redsocks) probably explains your problem. This example must be contained in the configuration file. I quote verbatim:
"To make redsocks2 works with GoAgent proxy, you need to set proxy type as 'http-relay' for HTTP protocol and 'http-connect' for HTTPS protocol
respectively. Suppose your goagent local proxy is running at the same server as redsocks2, The configuration for forwarding connections to GoAgent is like below:
    redsocks {
     bind = "192.168.1.1:1081"; //HTTP should be redirect to this port.
     relay = "192.168.1.1:8080";
     type = http-relay; // Must be 'htt-relay' for HTTP traffic.
     autoproxy = 1; // I want autoproxy feature enabled on this section.
     // timeout is meaningful when 'autoproxy' is non-zero.
     // It specified timeout value when trying to connect to destination
     // directly. Default is 10 seconds. When it is set to 0, default
     // timeout value will be used.
     timeout = 13;
    }
    redsocks {
     bind = "192.168.1.1:1082"; //HTTPS should be redirect to this port.
     relay = "192.168.1.1:8080";
     type = http-connect; // Must be 'htt-connect' for HTTPS traffic.
     autoproxy = 1; // I want autoproxy feature enabled on this section.
     // timeout is meaningful when 'autoproxy' is non-zero.
     // It specified timeout value when trying to connect to destination
     // directly. Default is 10 seconds. When it is set to 0, default
     // timeout value will be used.
     timeout = 13;
     }

"


My wifi is not functioning properly on my Lenovo Z50-70 using a Ubuntu 14.04

The only other idea I have after the backports are installed is

echo "options rtl8723be fwlps=0 swlps=0" | sudo tee /etc/modprobe.d/rtl8723.conf

Reboot


Sound settings not work on 14.04 but I have sound

Not sure what happened but it was working fine after another install. This may have to with me not checking "install updates during install" or "enable 3rd party ..." because I left both unchecked.


My nb is Asus K450J just type
echo "blacklist acer_wmi" | sudo tee -a /etc/modprobe.d/blacklist.conf
and everything fine.
credit: varunendra - ubuntu member


What version of the Realtek Audio driver is my system using?

Realtek audio device is supported by Linux kernel. There is no separate driver in Ubuntu like in Windows.

That's why the driver version will be the kernel version.

You can check it by running

lspci -knn | grep Audio -A3


I need to defragment external HDD on Kubuntu

If you have enough free disk space, you can use parted or gparted to shrink the fragmented partition by a little more than half. Then create a new ntfs partition to fill the unallocated. Format the new partition. Copy all of the files (not using dd, but with a file copy command like "cp -a") from the old partition to the new one. Now delete the fragmented partition and expand the new partition to use the original amount of disk space. The new partition will be defragmented.


Right after installing Ubuntu 14.04.1 LTS it just don't work

Looks like the display card is having some issue. Try booting the machine using a live USB bootable stick. See if that works, try re-installing the system and if terminal is accessible then do a

sudo apt-get update

followed by:

sudo apt-get upgrade

If terminal is not available, try rebooting the system and keep pressing F8 button on the keyboard and see the various boot options and select the recovery mode. See if that boots in a default resolution and then from there on you can do a update and upgrade and even search for additional drivers in the dash to check if Ubuntu finds a proprietary driver for your display driver. You could also try a full update and upgrade system from the recovery mode. You should have network mode enabled in the recovery.


There is a ”fast startup“ option in windows leaving the partition in an inconsistent state. Linux cannot write to those partitions—try do disable this option in windows.

There is a thread already dealing with this problem and explaining it in more detail.


I would like to write more, but it's already explained here:
How can I theme my Qt app to resemble one written in Gtk?

This little tool will allow you to switch to your selected gtk+ theme.


AutoKey
Recently recommended by lifehacker
It uses python on the backend and works across applications.
Also of mention is Snippits but it doesn't come with easy installing instructions.


dd or equivalent everything on a disk without dding the entire disk

You can try Clonezilla,

http://clonezilla.org

Download a Clonezilla iso file, make a CD boot disk or USB boot drive and boot from it.
Create a compressed image of the whole drive (a Clonezilla image is a directory with a number of files, where the big files are compressed). Clonezilla is smart enough to only clone the used blocks (and skip blocks, that are not used).
Test that it works to restore from the image, and when you know that it works, you can send the image to your friend.


How do I change the number of kernels that stay on boot menu?

So long as the mainline kernel does not remove the previous ones (it shouldn't by default) by replacing them (and as I said it shouldn't normally do that), you previous kernels will remain intact.

You can manage the number of kernels you have by adding or removing kernels via the package manager. You can also set limits in grub I believe (but I don't remember off hand, so I would have to update my answer).


Win10 update messed my dual boot. Help please

From your boot-repair output, I don't even see your Ubuntu install anywhere. However, you should be able to at least boot Windows from the "grub rescue>" prompt.

Try firing these three commands from grub rescue>

set root=(hd1,msdos2)
chainloader +1
boot


CTRL and ALT keys mapped to Shift for some reason

My keyboard is a Perixx P1800. It as the same lsusb identification (0c45:7603 Microdia)
Apparently, it uses the same board also as the azio L70 keyboard.

The linux driver for the keyboard was hand-made and is available at this address.

On Debian, it works very well for me (after update-initramfs) except for a single key close to Enter (* in Azerty keyboard, the * of the keypad is working well).


Huawei USB Modem E303 not working after installing JAVA

All unlocked modems are working with Ubuntu. If you want to unlock:

Download Universal master code program,type in your modem IMEI number and calculate it. Now you have generate codes, which you need write down.
Now download your modem firmware from huawei web site, then launch it. After a few minutes it'll ask for an unlock code, that you generated earlier in step 1. Now type it in and it will unlocked your modem, which then will work with/under Ubuntu.


NTFS partition got merged and contents not showing

Stop using the computer immediately!

It sounds like you did more than just create an ext4 filesystem on the 100 GB partition. You don't say how you did this, so I can't say what your (presumed) mistake was, but chances are you accidentally operated on the wrong partition or even accidentally did much more extensive partitioning operations.

I can't really be more specific without more specific information, such as a screen shot of GParted or the output of sudo parted -l. (You can do this from a boot of a live USB disk to minimize the risk of doing further damage.)

If I'm right, though, your best hope for full recovery is to restore files from a backup. If you don't have a backup, your best hope for partial recovery is to use a tool like PhotoRec to extract files from the disk onto a separate recovery medium. Some Windows-specific tools are said to do a better job recovering filenames than PhotoRec, but I don't have pointers to specific tools. If I'm right, the odds of your getting your system back to the state it was in before the accident are pretty slim, unless of course you have a recent backup, in which case you can use it.


The problem was that I had some libraries in /usr/local/lib/ that were not managed under any package, and which were shadowing the libraries where the "undefined" symbol was actually defined. Removing these libraries fixed the problem.

Thanks to this post from way back when for pointing me in the right direction.

Beware the perils of manual library installation.


Deactivate middle-button-paste on one specific HID

Use xinput list to find the device you want to disable the button on:

$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech USB-PS/2 Optical Mouse           id=8    [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=9    [slave  keyboard (3)]

I'll try this on my mouse. Next step is to get the current button map:

$ xinput get-button-map 'Logitech USB-PS/2 Optical Mouse'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Turns out my mouse is mapped in a very straightforward way: physical button 1 is logical button 1, etc. This is the default; you may see something different if you've selected left-handed mode for example.

Anyway, the middle button is mouse button 2. To disable it, you set whichever one shows 2 to 0 (disabled) instead. (Hopefully, when you're scrolling, its generating button 4 or 5 clicks, depending on if you're scrolling up or down. That's the normal way for a scroll wheel to work.)

$ xinput set-button-map 'Logitech USB-PS/2 Optical Mouse' 1 0 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Middle-clicking will now be entirely ignored on that one device. To change it back, just run that command again, but with the 2 back in its place. (You can of course also change around your button mappings however you'd like—for example, if you swap 4 & 5, you'll change the direction of the scrolling).

If this does what you want, you only need to arrange to have that last line run as part of your log-in scripts.


Unless you changed defaults, your sophos files should be under /opt/sophos-av .

Quote from manual:

  How to check if on-access scanning is active?

  Enter the following command in the ‘Terminal’.

/opt/sophos-av/bin/savdstatus

  How to start on-access scanning?

  Use the following command to enable and start the on-access scanning,
  if found that service is inactive.

/opt/sophos-av/bin/savdctl enable

/etc/init.d/sav-protect start

  How to run an on-demand scan?

  Simply enter the following command to start scanning your computer.

savscan /


Suggested solution: Try to zip each directory separately, and for sure, don't try to recursively zip all files under /

Detailed answer:

zip's manpage explain the option you used, e.g. -r means:

-r
--recurse-paths
    Travel the directory structure recursively

When you are running the following command:

zip -ur zipfile.zip /

zip tries to compress the entire files in the system (from root / and below).

zip uses a temporary file (in your case you called it "garbage file") which holds the data it gather so far. Once the zip operation completed zip moves this temporary file to the resulted zip file.

In your case, you requested zip to compress all files in your system, which includes also the temporary file created by zip.

This might cause endless loop, as zip might try to add the temporary file to itself.

Also, you might try to add devices under /dev folder and similar files which I'm not sure that you would like to zip them.


Install ubuntu inside windows comes out in ubuntu CD instead of install parallelly

Well, everything I needed was an available logical partition. I think that says it all, but the thing was that I was trying to install ubuntu without free space on my disks, so I decided to emtpy a drive, and then, with the windows CD installer (I don't know how to do it with the ubuntu CD installer) I deleted one partition. When I rebooted and inserted the ubuntu CD installer, it said: "Install Ubuntu alongside Windows Vista".


You can use Remastersys to create a bootable ISO of your current install and then install Ubuntu from that ISO on all other machines. All your installed apps will be available by default.

http://www.geekconnection.org/remastersys/ubuntu.html

Important:

Use DIST mode to create the ISO image. Do not use back-up or it will copy your home directory and users too.


Ubuntu 14 won't even detect my home wireless network

You have a wrong driver installed. Connect to the internet by wire and run in terminal

sudo apt-get purge bcmwl-kernel-source
sudo apt-get install firmware-b43-installer


The juju openstack provider can also be utilized with the nova/objectstore (s3 equiv) for deployments like these. The object storage requirements are minimal and are used primarily for distribution of charms to machines and some client metadata (ie. not much size, or bandwidth).

https://jujucharms.com/docs/stable/config-openstack


Kazam is not recording audio from Logitech USB headset

A trick of PulseAudio could be used as workaround, by creating a Virtual Sink and Loopback microphone to it.

pactl load-module module-null-sink sink_name=Virtual1
pactl load-module module-loopback latency_msec=1 sink=Virtual1

I just give it a try, after I verified the source code of those combo boxes. It does record microphone. The only problem here is "Microphone" and "Speakers" label should be swapped. You may count it as a bug!

Here is, it is already reported & fix released. lp bug#1184010

So:

Check Speakers to record microphone
Check Microphone to record speakers


Ubuntu 20.04 autoinstall fails when I try to set the storage

It sounds like, either your storage medium or installation medium is corrupted. Try these things.

Reboot your PC (you never know, you might just have to reboot)

1.5. Make sure that ALL of your components support 20.04! If any of them do not, they will not work. This includes USB controllers, CPUs, GPUs, and Harddisks. My friend once had a very similar problem whilst trying Ubuntu. It was fixed by him trying 20.10 instead. However, he also had strange lines all over his display, since it didn't support his GPU either.

Re-create the installation medium (the most likely cause is a bad installation medium) (It's also important to check the hash of your ISO files after downloading them, to make sure the ISO isn't corrupted)
Replace your hard disk or SSD (It's not very likely, but you could have a bad drive)


How to rebind ctrl+shift+q to @ using xbindkeys?

You must use only one of the lines

m:0x81 + c:11
Shift+Mod5 + 2

in ~/.xbindkeysrc, so delete or comment out (w/ #) the other (usually it doesn't matter which, but the one starting w/ m: should be more universal)


It seems to me that the mpg file that was uploaded was indeed an interlaced mpeg2 720x576 (which is 4x3 PAL DVD resolution), and not an h.264 (mpeg4 part 10) encoded file (though h.264 it seems can support interlacing).

It looked interlaced to me too using totem (on fully updated 10.04 LTS), but running it through a deinterlacing filter using mplayer

$ mplayer -vf yadif M2U00156.mpg

MPEG-PS file format detected.
VIDEO:  MPEG2  720x576  (aspect 3)  25.000 fps  9100.0 kbps (1137.5 kbyte/s)

fixes it right up for me. Optionally, you could use ffmpeg to transcode your video using a deinterlacing filter.

Deinterlacing support was added to Totem (git master) in April 2010 (so if you're running an ubuntu with gnome older than 2.32, it looks like totem won't deinterlace for you).

So I think your options are

Fiddle with the camera and see if you can't get it to save non interlaced (I suggest this as that wasn't h.264 you uploaded)
Upgrade totem
Transcode the video using ffmeg and filter it using a deinterlacing filter
Use mplayer (or other video player) with a deinterlacing filter

references:

http://www.hadess.net/2010/04/deinterlacing-now-in-totem.html
http://wiki.multimedia.cx/index.php?title=MPlayer_FAQ
http://www.michaeldvd.com.au/articles/palvsntsc/palvsntsc.asp
http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC


cp: cannot stat: No such file or directory exists

That is because the file name has spaces in it. You should either use escape character \ or use single quotes. That is either:

cp Indexing\ and\ Slicing.ipynb /home/uswang

or

cp 'Indexing and Slicing.ipynb' /home/uswang


Ubuntu Server - modprobe cdc_ether module not found :(

Usually this module is located in

 linux-image-extra-`uname -r`

Make sure you have installed it.


Aria2 is better than Axel and also with Aria2 you can combine Aria2 with uGet and get a very nice GUI for Aria2.


Errors with apt package manager: unable to open directories for installation

Check what permissions you are being given with sudo:

sudo -l

That should give you the lines:

User root may run the following commands on xyzzy:
    (ALL : ALL) ALL

If you don't get that (don't have full permission), try running apt by naming root:

sudo -g root apt ...

If you do have full permission ... well, let's get specific.

I've had a look at my system, which has libreoffice and I don't have /usr/share/libreoffice/share/config/images_helpimg.zip.dpkg-new. Everything seems to work fine for me. Nevertheless, let's have a look at the directory:

ls -l -d /usr/share/libreoffice/share/config

The first part of that response is hopefully something like

drwxr-xr-x

If it isn't, I'll leave you to make it so, using chmod (man chmod will explain how to use it).

Then take a look at the files in the directory:

ls -l /usr/share/libreoffice/share/config

My system shows:

-rw-r--r-- 1 root root 1337709 Jan 23 17:51 images_breeze.zip
-rw-r--r-- 1 root root 3084230 Jan 23 17:51 images_galaxy.zip
-rw-r--r-- 1 root root 2079435 Jan 23 17:51 images_oxygen.zip
-rw-r--r-- 1 root root 7845910 Jan 23 17:51 images_tango.zip

The important part for you is that first permissions block. Everything should be read-write for root (rw-) and at least read for others (r--r--).

If that all turned out to be OK, then all I can think to suggest is to remove libreoffice and reinstall it. But first make sure your packages are up-to-date and I would also advise a complete upgrade, just to be sure. So,

apt update
apt upgrade

See if that has fixed your problems. If not:

apt remove libreoffice

If the troublesome files are still there (ls -l /usr/share/libreoffice/share/config), then follow that up with

apt autoremove

Then put libreoffice back again

apt install libreoffice

I'll keep my fingers crossed for you.


Nexus 5 won't share internet connection anymore

just use Tethering USB and it will works! Just tried now with Google Nexus 5 connected via USB cable on a laptop with Ubuntu 16.04. You'll find that setting into Settings - Others - Tethering Hotspot or something similar (my OS is in italian).


New rig z170, 15.04 - on board sound card not recognized

OK, if anyone is having the same problem - the way I fixed it was installing the latest ALSA daily package from here,  the Vivid one.

Then I installed the .deb package using gdebi, rebooted &: issue resolved, that took a while to figure by myself since i am not too linux experienced, yet the simplest solution.

It did mess up my desktop experience somewhat, some icons in "settings" are gone, window background randomly missing etc, I fixed that by running:

sudo apt-get install ubuntu-desktop

Another thing that has gone missing is the actual sound  volume levels icon, to have it back I ran the following command via terminal, logged out and back in:

sudo apt-get install indicator-sound

So far so good


Docker Errors For Ubuntu on Sudo Apt-get update

Thanks others for the context. In case this helps, to actually resolve the error, I resolved it by running:

sudo nano /etc/apt/sources.list

Then just removing the repo source for eoan and making sure I was using the following:

deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable

After that I can run apt-get without issue.


It doesn't have anything to do with the software, but the hardware. There are a few different types of phone connector jacks - stereo, mono, and multi-channel.

Take note of the three bands on the plug and the different colored sockets. This is how you can visually identify the cable has three channels, one for the microphone and two for left and right audio. I suspect this is the kind of connector on your new headphones.

Your audio card is not designed for this kind of multi-channel connection, input and output on the same cable. If the headset didn't come with it, your local electronics store should be able to sell you an appropriate cable; it should have a port for the three-channel line (not that you'll be able to visually inspect it) and then two plugs to connect to the computer's ports.

Just make sure you don't get a simple splitter - it will only connect to the two channels, not all three. Frequently (but not always) the plugs will be different colors if it's what you need, but the same if it's just a splitter.


In 13.10 "unlock from launcher" option isn't working

This post over at bugs.lauchpad.net worked perfect for me:

https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1233199/comments/6

The above post suggests deleting the cache database:

cd ~/.local/share/zeitgeist
rm activity.sqlite

or you could back it up, if you may want to recover anything:

mv activity.sqlite activity.sqlite.bak


Why did debuild fail with "configure: error: unrecognized option:"

This is because the CMAKE_INSTALL_PREFIX option is missing for the make.
So in your ~/usbmuxd-1.1.0 add the complementary file
 CMakeCache.txt
and write in it:
 CMAKE_INSTALL_PREFIX:PATH=/usr


Not within gnome-system-monitor, no and it's actually an awful tool for monitoring resources long-term because it consumed so much CPU.

I suggest you take a look at munin. It's a simple little tool for monitoring resources on a server. It creates graphs (not as pretty System Monitor) and logs things over a long time. It generates static HTML files on a periodic basis (every 5 minutes, IIRC) which you can either browse locally or you can serve via Apache (et al) so you can view the stats over the network.

You can see more about munin in another answer of mine.


Is there an equivalent to `chkconfig --add` in Ubuntu?

update-rc.d <service> defaults

or

update-rc.d <service> start 20 3 4 5


No experience with ripole or .OLE2 documents, but from the man page it doesn't seem too hard to run from the terminal.

Have you used the terminal at all before? If not have a quick read of this

All I think you need to do is open a terminal then assuming the file is in /home/user/, make a new directory where you want the file to be extracted to (eg tmp) then run

ripole -i file.ole2 -v -d tmp

Just replace file.ole2 with your filename and tmp with the directory you want the contents to be extracted to.

Hope that helps


Is it possible to "reset" the badblocks?

ATTENTION: this is a risky operation, don't do it if you don't fully master what are the risks!

I just did:

sudo debugfs -w /dev/sdc1
clri <1>
quit

This clears the inode number 1 (the one containing bad blocks list) on your filesystem.

Then you have to run an e2fsck again to reset various things, and your are done!


How to access the Ruby Command line in ubuntu 14.04?

There are two ways of interactively using ruby on the command line (like running python or nodejs, for example):

Simply run ruby:

$ ruby
print "hello world\n"

Then press CtrlD. You will see:

hello world

The easier way is Interactive Ruby (irb):

$ irb
irb(main):001:0> print "hello\n"
hello
=> nil
irb(main):002:0>


Install ubuntu like it was bought at a store

You can use the OEM install mode by hitting F4 in the boot splash of the install CD. See also: http://www.logicsupply.com/blog/2012/03/21/how-to-create-a-custom-ubuntu-12-04-installation-image/ - just skip the clonezilla parts.


Any software for ubuntu 14.04 for doing mathematics algebric and functional graph problem with Calculus support

I use R for simple Calculus, such as defining functions, plotting functions, differentiation, etc. For instance, defining a quadratic function:

f = function(x){x^2}

And then plotting it in the [1, 10] domain:

plot(f, 0, 10)

Defining a derivative function:

D = function(f,delta=.000001){
    function(x){ (f(x+delta) - f(x-delta))/(2*delta)} }

And then plotting the derivative of f:

plot(D(f), 0, 10)

For an overview of Calculus with R you can read this presentation.

I also recommend you use a GUI, to facilitate the interaction with R and help organising your projects. I use StatET, an Eclipse plug-in; RStudio is also quite popular.

To install R you can follow the Ubuntu specific instructions at CRAN.


What's the best way to store a passphrase?

Write it down, on a bit of paper.  Put that paper somewhere safe, like where you put your passports and important papers.

Encryption keys should be copied onto a USB stick and put into the same place.

I use Password Gorilla and PasswordSafe for everyday password storage and have the password to that in my brain (its complex, the only one I have to remember and used daily) and on a safe bit of paper (in case that fabled bus hits me).


Is there any difference between OS version beside DE and support time?

All a distro is is preinstalled software, and repositories. In an LTS this software, and the software in the repos is more stable. A desktop environment is just piece of software. In Ubuntu, Unity is installed by default, in mint, cinnamon or mate. However just because unity is the only one installed by default in ubuntu doesn't mean you can't use cinnamon or mate on it. IMHO there is a lot of oh I don't like Unity time to completely reinstall my OS around, when actually all they had to do was open the software centre and install another DE.


How to use wget with GET parameter, or redirect web?

You have to use single(') or double quotes(") in URL, so the link should look like this:

$ wget "http://www.mysite.com/getFile.php?mirror=1&categori=images&file=001.zip"


Did you tried to right-click on the Dropbox icon and check if your Syncing is enabled?
You also can find more in the preferences of Dropbox.


Ubuntu 12.04 can't log into graphical user interface

Are you sure it is a problem of the graphics driver or could it be also a defect in the Desktop Environment (Unity for standard)? Maybe you could try reinstalling them, or another one alongside it, such as xfce, lxde, cinnamon, gnome, etc...


why isn't fsck running on boot like it is supposed to?

16.04 uses systemd to manage the boot process, the options you have tried are for the old SysV and early versions of upstart To force fsck on boot for systemd managed OSes  you need to pass some kernel parameters, although usually these are not necessary as file system checks are automatic. More details about the kernel parameters (fsck.mode & fsck.repair) are available here and here


Is there a way to interactively encrypt and mount a directory?

There is a project called "SiriKali"[1] that offers a GUI solution for creating and managing ecryptfs volumes among others from a normal user account and it should do what you want. For it to work,you must also install "ecryptfs-simple" tool since it the tool that actually does the volume creation and mounting.

Both projects have packages for various versions of ubuntu and i did the testing on ubuntu 16.10.

ps; i am the developer of Sirikali project.

[1] https://github.com/mhogomchungu/sirikali


Ctrl8 is not a shortcut in the usual sense. Many terminal emulators conventionally send ^? (aka Ctrl?) for Ctrl8 (see this U&L post for details). This is not usually configurable behaviour, short of modifying the source code.

^? is the control code for ASCII Del and ^H (aka CtrlH) for ASCII Backspace (see this informative post for a lot more on that).

So, if you don't want Ctrl8 to delete a character, you may need to change:

the control code your terminal sends for the Backspace key. GNOME Terminal usually defaults to ^? (ASCII DEL), IIRC, so you need to set it to ^H. In GNOME Terminal, that's in Edit -> Profile Preferences -> Compatibility:

If your terminal doesn't have an option to configure this and sends ^? for Backspace, then the next two steps will break Backspace.
the control code that the pseudo-TTY uses for erase

Check what it is now:

$ stty -a | grep erase
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;

If it's erase= ^?, you'll need to change that:

stty erase '^H'

the control code that your shell uses for erasing the previous character. In bash, that defaults to both ^H and ^? if ^? is the erase character for the controlling TTY.

Check what it is now:

$ bind -p | grep backward-del
"\C-h": backward-delete-char
"\C-?": backward-delete-char

Remove the \C-? binding, and add a \C-h binding if needed:

bind -r '\C-?'
bind '\C-h: backward-delete-char'

Add these to your .bashrc to save these settings.

Or you can change your IDE shortcut.


compiz and unity crash after AMD drivers installed

Open the terminal using Ctrl + Alt + T.

Type in this command gnome-control-center.

And you would be able to access additional drives to get back to the normal x.org driver.

Note:
if your laptop is really overheating there will be an emergency shutdown by the computer itself so don't worry :) ?


You are trying to execute a 32-bit executable on a 64-bit architecture. Get the matching 64-bit installer or install 32-bit libs.

sudo apt-get install ia32-libs


Python - access variable in another class

Just pass around your mainwindow instance, something like this:

class MyWindow(Gtk.Window):
    def __init__(self):
        # Do your thing...

        self.spam = "spam'n'eggs"

    def on_opendialog_clicked(self, widget):
        dialog = MyDialog(self)
        dialog.run()
        dialog.destroy()

class MyDialog(Gtk.Dialog):
    def __init__(self, mainwindow):
        # ...

        print(mainwindow.spam)

Have a look at my answer in this question too which is almost similar, only the other way around.


Unity and gnome-panel fighting over global bar 12.04

I ended up going with Gnome Classic and launching gnome-panel and unity-2d-shell as startup applications.  It might be perfect.  For me anyways... I get applications and places menus back on the top bar, windows key -> dash home, ALT+F2 run, and the unity launcher bar.  All of my favorite features from both environments and none of what I didn't like.


You shoul probably try to scan your memory with memtest86+. It is included in ubuntu installation DVD. Current version does not support the efi mode, so You should try to boot Ubuntu in legacy mode to get memtest grub option available.


Try to connect to another server from your computer that gives this problem. Probably, your network is under a firewall with some blocking rules.


Sound is outputting through both the built-in speakers and external speakers

I have been searching for a solution to this for over year and haven't found one yet. First, check if auto muting is enabled in alsamixer. If auto muting is enabled, then what I do is to mute a channel in ALSA mixer. The channel you have to mute you'll need to find by trial and error. Open a terminal and start the alsamixer program. Change cards if you think the channels are too few. The last few columns will contain one for the auto muting option, which can have various values. Toggle to see if any one is the effect you want. If none suit you, experiment with disabling channels until it's satisfactory. (Press 0 when a channel is highlighted to set volume to zero, or press m to mute).


What is the package name for Software & Updates and how to remove it?

The package is called software-properties-gtk.

I do not recommend removing it. It will remove ubuntu-desktop. I see no reason why remove this package even if you do not use it.


Replace commas with colons and move  all values to one line

Not sure if I understand correctly, but for the input and output you shown, the following sed command can do the transformation, taking into account that your input file contains CR-LF line terminators:

sed 's/,/:/g;s/ /,/g' <<<$(tr -d '\r' <input_file) | tee output_file.tmp
mv output_file.tmp input_file


You can find it here - it's the Index of /ubuntu/pool/main/n/network-manager


How to download playlist to mp3 format with youtube-dl?

Both parts of this question (downloading in mp3 and downloading a playlist) are supported by youtube-dl:

youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" <url to playlist>

Some notes from me and the comments:

Older versions of youtube-dl struggle with modern playlists. You might need to replace the repo version with the latest.
cmo: You can ignore missing ("unavailable in your country", or removed) videos with an -i flag.
frans: If your playlist isn't working and the URL contains a v=<ID> element, remove it so there's just the ?list=... item in the querystring.


No sound on headphones - Asus GL703GE-ES73

Issue is caused by a kernel update that is bugged. Found this workaround:

paste this line “options snd-hda-intel model=headset-mode” into file
“/etc/modprobe.d/alsa.conf” then SHUTDOWN the system, DO NOT reboot.
Then turn on the system and the sound should appear, but the
microphone in the headphones will probably no longer work.

In my case, microphone still works.
Info found here


Help. php-mbstring : Depends: php7.0-mbstring, Unable to correct problems, you have held broken packages Ubuntu 16.04

It appears that you needed to install them in a sequence so any dependencies will be taken care, so the way aught to have been:

sudo apt install php7.0-common php7.0-mbstring php-mbstring


How to run a command (that's meant for parent shell) from a shell script?

what makes a command like jobs only show jobs in that very instance of interpreter?

jobs shows the jobs the shell (that particular shell process) has started. The shell  keeps track of what commands it started, gives then numbers (job ids), and knows their status since parent processes are notified when their child processes exit.

The shell has no knowledge of processes started by other shell instances, or other programs.

  How can I get jobs command in a shell script to show all of the jobs in its parent shell?

You don't.

Of course you could browse the data in /proc or the output of ps to find the child processes of the parent, but there's no direct way for  processes don't know about their siblings. Even less about their relation to each other, e.g. which ones are part of a same pipeline.


If the drive is formatted to ext4 or ext3, Windows cannot detect it. Format using FAT file system instead.


It looks like upgrade process is trying to retrieve Ubuntu Quantal (12.10) packages.

Apparently Ubuntu 12.10 is not supported since May 16, 2014 hence it's packages are not available.

Try following this advice: Upgrading from 12.04.3 LTS to 14.04.1 LTS failure


Test your USB in other system also. Also check whether the .iso you have put on the bootable USB is not corrupt. I had experienced this problem in these two scenario only.

In general I always use this program for creating bootable USB


Problem with installing Cockatrice in Ubuntu

make can be executed as non-admin user, but make install only can be executed as root.

Try with

$ sudo make install

Good luck.


In this answer: Is there any prebuilt QEMU Ubuntu image(32bit) online? I have described the following working setups for Ubuntu 18.04 guest / host:

cloud image arm64: quickest setup to get started
debootstrap arm64: reasonably quick, but allows for more image customization

Those setups provide prebuilt disk images, and don't go through the installer. They are the best choices that I've seen so far.

Next, I've also managed to run the arm64 server image on QEMU. However, this goes through the installer, which is borderline impractically slow to do, unless you are not on an ARM host with KVM. This is specially painful because dozens of interactions are required to finish installation.

Here is the server script, tested on an Ubuntu 18.10 host:

#!/usr/bin/env bash

set -eux

# Tested on Ubuntu 18.10.
# - https://superuser.com/questions/942657/how-to-test-arm-ubuntu-under-qemu-the-easiest-way
# - https://askubuntu.com/questions/797599/how-to-run-ubuntu-16-04-arm-in-qemu

# Parameters.
id=ubuntu-18.04.1-server-arm64
#id=debian-9.6.0-arm64-xfce-CD-1
img="${id}.img.qcow2"
img_snapshot="${id}.img.snapshot.qcow2"
iso="${id}.iso"
flash0="${id}-flash0.img"
flash1="${id}-flash1.img"

# Images.
if [ ! -f "$iso" ]; then
  wget "http://cdimage.ubuntu.com/releases/18.04/release/${iso}"
fi
if [ ! -f "$img" ]; then
  qemu-img create -f qcow2 "$img" 1T
fi
if [ ! -f "$img_snapshot" ]; then
  qemu-img \
    create \
    -b "$img" \
    -f qcow2 \
    "$img_snapshot" \
  ;
fi
if [ ! -f "$flash0" ]; then
  dd if=/dev/zero of="$flash0" bs=1M count=64
  dd if=/usr/share/qemu-efi/QEMU_EFI.fd of="$flash0" conv=notrunc
fi
if [ ! -f "$flash1" ]; then
  dd if=/dev/zero of="$flash1" bs=1M count=64
fi

# Run.
#
# cdrom must be scsi or else the installation fails midway with:
#
# > Detect and mount CD-ROM
# >
# > Your installation CD-ROM couldn't be mounted. This probably means
# > that the CD-ROM was not in the drive. If so you can insert it and try
# > again.
# >
# > Retry mounting the CD-ROM?
# > Your installation CD-ROM couldn't be mounted.
#
# This is because the drivers for the default virtio are not installed in the ISO,
# because in the past it was not reliable on qemu-system-aarch64.
#
# See also:
# https://bazaar.launchpad.net/~ubuntu-testcase/ubuntu-manual-tests/trunk/view/head:/testcases/image/1688_ARM64_Headless_KVM_Guest
qemu-system-aarch64 \
  -cpu cortex-a57 \
  -device rtl8139,netdev=net0 \
  -device virtio-scsi-device \
  -device scsi-cd,drive=cdrom \
  -device virtio-blk-device,drive=hd0 \
  -drive "file=${iso},id=cdrom,if=none,media=cdrom" \
  -drive "if=none,file=${img_snapshot},id=hd0" \
  -m 2G \
  -machine virt \
  -netdev user,id=net0 \
  -nographic \
  -pflash "$flash0" \
  -pflash "$flash1" \
  -smp 2 \
;

GitHub upstream.

See also this for Raspberry Pi emulation: https://stackoverflow.com/questions/28880833/how-to-emulate-the-raspberry-pi-2-on-qemu/45814913#45814913

amd64 desktop shown at: How to run Ubuntu 16.04 Desktop on QEMU?


I have the same problem as you.

I set PKG_CONFIG_PATH and LD_LIBRARY_PATH as

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
LD_LIBRARY_PATH=/usr/local/lib

see https://stackoverflow.com/questions/11228173/how-to-find-where-older-version-of-glib-has-been-installed

But it didn't work. Then I found someone solve it as

echo $LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

see http://www.linuxquestions.org/questions/linux-software-2/how-to-set-ld_library_path-pkg_config_path-and-glib_config-937732/

And it did work!


Why is ext4's Journaling I/O usage so high when copying files to my RAID1?

The sync mount options makes writes to your disk to happen synchronously. This is a good thing if you have a reason for it. One reason for enabling this is to minimize the amount of data loss during power failures, as it will try to disable all kinds of caching features. This is useful if you're interested in the safest possible way to write data to your disk.

As you've stated, you don't have this particular requirement and you'd like to see a better performance instead. By removing the sync options, it is back to the defaults, and regular caches are not disabled explicitly. This allows data (file contents) to be written asynchronously (journal and metadata still synchronously I assume). The disadvantage of this is that more data could be lost in case of a sudden power failure. (This is only concerning the data being written at that point in time.)

Similarly, there's the async option to force writes to happen asynchronously. This is considered less safe, and should only be used if you need the extra performance it gains in your case. Stick with the defaults in case you're unsure.

Either way, the journal design of the filesystem will ensure data appearing present is not half-written or inconsistent by default. Returning from sync to the defaults is 'just safe' in these terms.


I am using asus X450cc and my wifi card it rt3290. This is what worked for me

I downloaded the rt3290 Driver from here, extracted it and entered the directory and ran

sudo ./run.sh

This requires a working ethernet connection.

Then I also tried How to install wifi driver Ralink RT3290 and How do I get an RT3290 wireless card to work?

Then I tried:

rfkill unblock all

I also tried:

sudo apt-get update
sudo apt-get install firmware-b43-installer b43-fwcutter
sudo reboot

Finally I tried:

sudo ifconfig enp3s0f0 up  #(here this is my logical name of wifi change it to your wifi name)
sudo pm-suspend

Now my wifi is working, although I still have a tiny problem; every time I boot into Ubuntu I need to suspend and resume, only then does my wifi work.


Web browser is having problem on processing js in UTF-8

The JavaScript is OK, the problem is the character encoding. Select the character encoding Unicode (UTF-16LE) in either Chromium browser or Epiphany. Firefox doesn't have the UTF-16LE character encoding.


How to resize the width of Nautilus sidebar?

Drag the sidebar to resize
Size of sidebar in nautilus is adjustable. You somehow might have changed it accidentally and it remembers your last modified settings. You can easily change it by dragging the sidebar to normal width.

Alternate Method - use dconf Editor

Install dconf Editor. It's package name is dconf-tools .
Launch dconf-editor using dash.
Select org → gnome → nautilus → window-state from left panel.
Set the value of sidebar-width to default.


im going to assume the card is a ATI Mobility Radeon M6 ; based on what i've read on the particular model

you're going to need to install the proper drivers, not only to get ubuntu running properly but to also allow for 3d acceleration

the following link may or may not help :v

http://ubuntuforums.org/showthread.php?t=246746


Ran nvidia-xconf as root, NVIDIA X-server settings utility still says I'm not using Nvidia X driver

Nvidia proprietary drivers are available through your ubuntu package manager. Open a terminal and execute the following commands:

sudo apt-get update
sudo apt-get install nvidia-current

Reboot for the changes to take effect.

If you really want to use the nvidia driver downloaded from nvidia, follow these instructions (although they might not work).

Press CTRL + ALT + F2 and sign in with your username and password.

Next, execute the following commands:

sudo service lightdm stop
sudo apt-get update
sudo apt-get install dkms linux-source

Finally, cd into the directory containing the run file and use sudo to run the file.

I don't think nvidia-xconf is usually necessary running ubuntu (but is necessary running debian).


This is application specific. Some applications will handle Alt+Tab and refuse to pass it onto the window manager, while others let it float through.

Unfortunately there isn't a good answer to this but there are options...

Control+Alt+F1..6 should work as a combination. I don't think it's even possible for an X application to block this combo. That will get you to a TTY console and from there you can... Well you can't do all that much. But you can log in and fire off commands like:

DISPLAY=:0 xdotool windowminimize $(xdotool getactivewindow)

Which you game might just ignore. Anyway, Control+Alt+F7 to get back to the desktop.
On a similar idea, you could run your game in a separate X server. Loading it on TTY8 would mean you could switch between desktop and game by smacking Control+Alt+F8 and Control+Alt+F7 respectively.


Where are image files for GNOME Boxes stored?

I found it. It is located at

/home/user/.var/app/org.gnome.Boxes/data/gnome-boxes/images

I assume it was put into this odd location because I installed gnome boxes via Flathub. I found it by running this command to look for all files in my home directory that are larger than 1 GB:

find ~ -size +1G -ls


Fractional scaling not working with Gnome 3.34

You will need to be using Wayland to use the experimental fractional scaling feature. This admittedly caught me as I've recently setup a second user account and went through enabling the experimental fractional scaling, but didn't see it come into effect.

https://www.omgubuntu.co.uk/2019/06/enable-fractional-scaling-ubuntu-19-04 describes how to setup fractional scaling.

The default login is not Wayland so on logging in, click the cog icon next to the Signup button and choose the Ubuntu on Wayland option.


bash storing array variables in rotation

One simple way would be to set an array with the four values you want to cycle through, and then use the % (modulo) operator in your for loop to determine which of the four values to assign to arr[$a]

For example:

#!/bin/bash

values=("apple", "banana", "orange", "grape")

#####################################
for((a=0;a<=100;a++))
  do
    arr[$a]=${values[$a % 4]}
done
######################################

for((i=0;i<=9;i++))
  do
    echo ${arr[$i]}
done


Laptop that comes with Windows 8 does not show grub

In Ubuntu Live from the USB stick, use a program called "Boot Repair". It'll fix the GRUB for you. But I don't know what will happen with Win8 :P Its supposed to fix it! If you dont have it on the USB, install it.


qt-unified-linux-x86-2.0.3-online.run cannot execute binary file, getting Exec format error

The qt installation you're using is built for x86 architecture, but the RaspberryPi has an arm11 processor, so you will need to cross-compile qt in order to execute it on the Pi.

I've rather looked at the route of building my applications on a normal laptop and cross-compiling those to run on the Pi, rather than putting Qt install onto the Pi.

Try this link:
https://raspberrypi.stackexchange.com/questions/1/how-do-i-build-a-gcc-4-7-toolchain-for-cross-compiling

It shows the procedure to build and install a Arm cross-compiler using gcc onto your system. I've only just finished building it, and haven't confirmed 100% functionality as yet, but will update this post once I have.


Keyboard not functioning during reboot, cannot access boot menu

Had a similar problem which I've documented here: Can't access keyboard in boot menu after update to Ubuntu 14.0.1, laptop keyboard, trackpad, network not working As you can read from the title I had some other troubles as well. The get to the GRUB menu I read up on grub and deactivated the ACPI system thusly:

edited grub configuration:

gksudo gedit /etc/default/grub

and changed this variable:

GRUB_CMDLINE_LINUX_DEFAULT="quit splash acpi=ht"


What mount points should I use to make Ubuntu put my user preferences on my SSD and home on HDD?

You will need 2 partitions (plus swap partition on your HDD - why?).

HDD:

Make an ext4 formatted partition and use it as directory root (mount point /). This will contain all stuff that is not outsourced to another partition, including /home.
SSD:

Make a partition formatted in ext4 (recommended if your data shall only be readably by Linux systems on the same computer), NTFS (if you want to share the partition with Windows systems) or FAT32 (best compatibility with all systems, but severe restrictions like max. 4GB per file) and use it as external data partition with a custom mount point (e.g. /data would be a suitable mount point). On this partition, you can create all folders you need, like Documents, Pictures, Videos and so on.

After having set up the partitions, move all your already existing data files from the current data folders in /home/USERNAME to the respective folder in /data. Then delete the folders in your home directory which you want to replace.

Now you make a symbolic link in your home directory to each folder in /data, e.g. using a command like this (replacing the folder names with your correct values):

ln -s /data/Documents ~/Documents

After this, all your data folders that were originally located in your home directory are now just symlinks to the real folders on your secondary partition on the HDD which you have mounted at /data.


Cannot set high resolution in Intel UHD graphics

As per K7AAY I tried Ubuntu 19.10 via a bootable USB stick and it worked right out of the box.  I'm in the process of updating my installation from 18.04 as shown here  (it also applies to upgrading from 18.04 to 19.04 and ultimately to 19.10)

Thanks for the help


Virtual box : Issue connecting to security.ubuntu.com

I get two different IP addresses for that query:

Non-authoritative answer:
 Name:     security.ubuntu.com
 Address:  91.189.92.167
 Name:     security.ubuntu.com
 Address:  91.189.92.166

I am also able to ping both.

What settings are you using for your network on VirtualBox? Bridged or NAT?

What, if any, settings are on your Windows 7 firewall?

I would try using a bridged connection and for testing turn the Windows firewall off briefly. (Assuming you are behind a NAT firewall.)


Bash has indeed a "cache" for recently looked up programs. You can use hash -r to clear this cache in a shell. Alternatives:

Just close the current shell and open a new one.
Supply the full path, for example: /usr/bin/pdflatex file.tex

which is an external program. It will always report the program as matched in the current state. To investigate which command is executed by the shell, use the type builtin.

Demonstration of the cache:

$ which acpidump
/usr/bin/acpidump
$ type acpidump
acpidump is /usr/bin/acpidump
$ acpidump -h &>/dev/null       # trigger a lookup
$ type acpidump
acpidump is hashed (/usr/bin/acpidump)
$ mv ~/bin/acpidump{.x,}        # make acpidump available in PATH
$ which acpidump
/home/peter/bin/acpidump
$ type acpidump
acpidump is hashed (/usr/bin/acpidump)
$ hash -r                # clear cache
$ type acpidump
acpidump is /home/peter/bin/acpidump


You can use nmcli con status to find the UUID of the current connection or nmcli con list to list all configured connections.


How do I create a file system / partition / volume that would appear in the side bar of my file manager?

Are only non-linux partitions (Windows and external drives) displayed as such in the left pane of PCManFM and Thunar?

No. Format a USB flash drive as Ext3/4 and you'll see it appear there too. If you would have another partition on your hard drive without any mount point specified in /etc/fstab it would appear there too.

The way the file manager mounts and manages the mounts as shown in the sidebar, has nothing to do with the system mounts. It's about what is mounting it. Using

gvfs-mount -l

you can see which are already managed by your desktop environment. This answer and the manpage of gvfs-mount will explain quite well how to mount filesystems the command-line way the same way as your file manager does that programmatically.

GVFS uses FUSE, an user space level filesystem approach, rather than in-kernel. It's about who manages the mounts on your system. The regular GUI file manager does not manage the system mounts (cat /proc/mounts) by design.

  Would (any) such partition be kept after reinstall?

Completely unrelated. This is an option in the installer.


if your friend is using the same computer as you get him to add you to the sudo group by

    sudo adduser <yourusername> sudo


On ubuntu 17.04 how do I get firewire ieee1394 working

I would also check

Whether firewire is enabled in system BIOS
Whether firewire device is recognized by lshw


15.04 I get terrible screen tearing on the desktop with intel graphics

NOTE: I think it is a duplicate of:
Screen tearing in Ubuntu with Nvidia/Intel graphics

But anyway.
Try adding a line:
Option "TearFree" "true" in the Device section, in the following file: /etc/X11/xorg.conf.d/20-intel.conf

For more options just man intel.

I just fixed my own setup yesterday this way. I have found useful info at the arch linux page: https://wiki.archlinux.org/index.php/Intel_graphics#Installation


I regret not by conventional means or by the use of the OS you just installed; a local data recovery service may be able to assist, but please shut that PC down and do nothing else which may write any more data to that drive.


Is there a binary package for php5-sqlite3 with fts3 enabled?

Well, I got an answer at LInux: How to install FTS3 (for sqlite3) in PHP? - Stack Overflow - and I guess, the answer is, there is no such binary package; things have to be compiled from source.


Fix Workspaces in XFCE with Multiple Monitors

Xfce 4.10 has only limited support for multiple monitors. The upcoming 4.12 is better at that. You can try installing the (unreleased) 4.12 from ppa:xubuntu-dev/xfce-4.12?

Additionally, you can set up the monitors properly by using arandr.


Installing Ubuntu in Acer Aspire v17 nitro for better compatibility with nvidia card

Your CPU is from Haswell family so I would recommend following setup:

Download any Ubuntu flavor 16.04.1 (notice the .1). I recommend this one since it defaults to 4.4.x kernel and older xorg subsystem (no hwe) which in general is more stable for Haswell type machines. For example stock Ubuntu 16.04.1 .
Install the OS
Execute sudo apt-get update
Execute sudo apt-get dist-upgrade && sudo restart

Install graphic drivers ppa and latest drivers

sudo add-apt-repository -y ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get -y install nvidia-381 nvidia-settings


How do I fix WLAN hot key to toggle wireless state instead of airplane mode?

what I understand that you have to change Fn-F9 from toggling airplane mode to toggling wireless ,, I suggest that

1) Disable Fn-F9 from toggling airplane:

open dconf-editor (install it if not) and search for WLAN (press ctrl + f and type WLAN)
then it's up to you to change the binding if you find it

2) Bind Fn-F9 to toggling wireless as in my other answer


jdk-12.0.1 installed, but java --version command showing openjdk-11.0.3

Your system-level Java is still configured as OpenJDK 11. To manage multiple Java installations properly, you should register the Oracle/Open JDK 12 that you have manually downloaded so that Ubuntu can recognize it. After that, you can configure the specific Java version that you want using update-alternatives. The commands below will register the new Java installation and set it as the first priority:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/openjdk-12.0.1/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/openjdk-12.0.1/bin/javac" 1

If you only need a single Java installation, it would be easier to install the latest Java as a system package via the official repositories or ppa:

OpenJDK 12:

sudo apt install openjdk-12-jdk

Oracle JDK 12:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt install oracle-java12-installer


manpath: can't set the locale; make sure $LC_* and $LANG are correct

Thanks to Gunnar Hjalmarsson I'm able to use this workaround:

unset LC_CTYPE in ~/.profile


What happens to masterboot after grub reinstall?

Yea if you didn't hardcode chainloading,then it is able to check all OS'es again.grub-mkconfig could done after install.Master boot record contains  several assembler commands to load outside code, which ends by JMP one to execute it(i mean it's something out of 'jump' bundle JNZ JNE or so).So you can just  save  first sector ,say with dd,put it to NASM's NDISASM,put there new sector too,compare both assembler blocks, and tell us "what happens".


xfce4:When i try to enable the execute box It's not there .-

Try setting the permission with chmod some times setting execute permission by the GUI may not work.  You need to give the full path of the file or fodder with this command.

sudo chmod ugo+wrx /home/user/Downloads/forge.jar -v

And you should be able to right click execute.


Can't set "Alt+Ctrl+T" to launch terminal in xfce4

I'd like to suggest the following steps:

go to 'Start' at the top left corner, and open Settings Manager

or

open Terminal and type xfce4-settings-manager
open Keyboard
open Application Shortcuts Tab
click Add button (with greed-icon) below
type xfce4-terminal
trigger the shortcut, which is in this (Ctrl + Alt + T)

Good luck!


To correct the unmet dependencies and install them, use the command which it gives:

sudo apt-get -f install

Then it should allow you to use Skype and to install other software.

Or if you have decided that you don't want Skype then just run:

sudo apt-get purge skype

And that should remove Skype and the error.


Make sure that you start this process without your usb plugged into the computer. Otherwise extract it.
Run:

  mount

Save somewhere the mount output or just make you open a new terminal when running mount again later. As an example output might be:

  /dev/sda6 on / type ext3 (rw,errors=remount-ro,commit=0)
  tmpfs on /lib/init/rw type tmpfs (rw,nosuid,size=5242880,mode=755,size=5242880,mode=755)
  tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=755,size=10%,mode=755)
  proc on /proc type proc (rw,noexec,nosuid,nodev)
  sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
  udev on /dev type tmpfs (rw,mode=0755)
  tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,size=20%,mode=1777,size=20%,mode=1777)
  devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620,gid=5,mode=620)
  /dev/sda9 on /home type ext3 (rw,user_xattr)
  fusectl on /sys/fs/fuse/connections type fusectl (rw)
  binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

Insert your usb. In most Gnu/Linux systems it will be automounted. Otherwise mount it manually.
Close the Nautilus / Dolphin window that has just appeared.
Run again:

  mount

Take a look at its output. As an example it might be:

  /dev/sda6 on / type ext3 (rw,errors=remount-ro,commit=0)
  tmpfs on /lib/init/rw type tmpfs (rw,nosuid,size=5242880,mode=755,size=5242880,mode=755)
  tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=755,size=10%,mode=755)
  proc on /proc type proc (rw,noexec,nosuid,nodev)
  sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
  udev on /dev type tmpfs (rw,mode=0755)
  tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,size=20%,mode=1777,size=20%,mode=1777)
  devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620,gid=5,mode=620)
  /dev/sda9 on /home type ext3 (rw,user_xattr)
  fusectl on /sys/fs/fuse/connections type fusectl (rw)
  binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
  /dev/sdc1 on /media/UNI type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,uhelper=udisks)

Compare the first and the second mount runs. Detect one more line in the second run.
Line should be something as:

  /dev/sdc1 on /media/UNI type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,uhelper=udisks)

Now let's focus at first part of it: /dev/sdc1
Usb Partition device (the mounted one) is /dev/sdc1
Usb device is /dev/sdc (Note that the partition number has been lost. That it is right.)
Umount the partition device

  sudo umount /dev/sdc1 # Ubuntu users
  umount /dev/sdc1 # Non sudo distributions

Now we are going to dump the Super Grub2 Disk.
REMEMBER THAT YOU WILL LOOSE ALL THE PENDRIVE CONTENTS
Make sure to adapt the command to your needs:
Change /home/user/Desktop for the actual path for you super grub2 disk iso file. You might want to use /tmp
Change super_grub2_disk_1.99b1.iso for the iso filename that you have downloaded.
/dev/sdc should be your usb device.

  sudo dd if=/home/user/Desktop/super_grub2_disk_1.99b1.iso of=/dev/sdc

Just to be sure we will finish with:

  sudo sync

That's it! Usb device is bootable and should contain Super Grub2 Disk.

`


As per Debian's wiki, with systemd this is the new command:

systemctl suspend

NOTE: This command still requires root privileges if there is another user's session open. It also doesn't work in Cron. In both cases you you will need to create extra settings.


Write fails to NAS drive connected with cifs

Got it to work by adding in uid=username.


How do I find and copy an arbitrary list of files in terminal?

Unfortunately the find command's -name predicate only accepts a single pattern. If you want to search for multiple files by name you'd need to chain them with the -o (logical OR) operator - something like:

find Documents/ \( -name "file2.txt" -o -name "file5.txt" -o -name "file9.txt" \) -print

This makes it tricky to construct the search programmatically from a list; the closest I can come to your attempted command is:

read the list into a shell array

mapfile -t files < list.txt

use the bash shell's printf to construct the predicate list

printf -- '-name "%s" -o ' "${files[@]}"

use eval to evaluate the resulting command string

There's a wrinkle here inasmuch as if we use printf's format re-use feature to construct the list in this way, we're left with a 'dangling' -o; we can work around this by terminating the list with a -false test (since -o -false is a Boolean no-op) so that our final predicate string becomes

"\( $(printf -- '-name "%s" -o ' "${files[@]}") -false \)"

Putting it all together - given

$ tree dir
dir
├── Folder_1
│   ├── file1.txt
│   ├── file2.txt
│   ├── file3.txt
│   └── file4.txt
├── Folder_2
│   ├── file5.txt
│   ├── file6.txt
│   └── file7.txt
└── Folder_3
    ├── file8.txt
    └── file9.txt

3 directories, 9 files

and

$ cat list.txt
file2.txt
file5.txt
file9.txt

then

$ mapfile -t files < list.txt

$ eval find dir/ "\( $(printf -- '-name "%s" -o ' "${files[@]}") -false \)" -print
dir/Folder_1/file2.txt
dir/Folder_2/file5.txt
dir/Folder_3/file9.txt

To copy files instead of just listing them, you could then do

$ mkdir newdir
$ eval find dir/ "\( $(printf -- '-name "%s" -o ' "${files[@]}") -false \)" -exec cp -t newdir/ -- {} +

resulting in

$ tree newdir
newdir
├── file2.txt
├── file5.txt
└── file9.txt

0 directories, 3 files

Note: the eval command is powerful and potentially open to abuse: use with care.

In practice, given that you appear to want to find only a small number of files, the KISS approach would be to accept the performance hit of multiple find calls and just use a loop:

while read -r f; do
  find dir/ -name "$f" -exec cp -v -- {} newdir/ \;
done < list.txt

or even using xargs

xargs -a list.txt -n1 -I@ find dir/ -name @ -exec cp -v -- {} newdir/ \;


First, understand that any directory that's not explicitly a mount point for a separate partition (or a subdirectory of such a mount point) is stored on the root (/) partition. Thus, if you've got root (/) and /home, and no other partitions, your /opt directory is simply a directory on root (/). Likewise for /tmp, /sbin, and anything else. Thus, the initial question is based on the false premise that you need separate partitions for every directory that leads off of root (/), and so can't be answered directly.

Second, /opt is used for third-party software, which in the context of Ubuntu, means precompiled software that is not distributed via Debian packages. Occasionally you'll see official program documentation that refers to /opt, but Debian packages are available that drop these files elsewhere. In such cases, you should ignore the official documentation, or at least ignore its file-location references, when you use the Debian package. Also, if you have a choice of using a precompiled package via a tarball or a Debian package, it's generally best to use the Debian package. All in all, use of /opt is pretty rare these days. If you still think you need to put files in /opt, you might do well to name the software, since people here may know whether a Debian package is available for that software.

Finally, combining the two previous points, it's very rare for Ubuntu installations to split /opt off into a separate partition because it's rare for significant amounts of data to be stored there. Most Ubuntu software goes in /usr and other locations. It was once common to split /usr into a separate partition, but that practice is pretty rare today. If you do happen to need to install lots of software in /opt, then creating a separate partition for it might make sense -- but in many cases this won't really be helpful. Separate partitions make sense if you need to handle security differently, if different filesystem features will be helpful, to share data across multiple OS installations in a multi-boot configuration, and for other reasons. Routine software installation is not likely to benefit from a separate partition; in fact, creating a separate partition for /opt could cause problems if the size consumed by software stored there changes, or if you get the size estimate wrong initially.


libgmp.so.3 is only available for 12.04, it's part of the libgmp3c2 package.

If you're running Ubuntu 12.04, try to install the missing package:

sudo apt-get install libgmp3c2

Note: As of 14.04, installing python-gmpy from Ubuntu repositories will automatically install libgmp-dev which provides libgmp.so.10.


Does it happen when you are browsing in Firefox?

I have the same problem as well.  It only seems to occur when I am browsing in FireFox and do some rapid moving around of the pages.

Also, I installed fresh Ubuntu 14.04 LTS and get a slightly different reaction.  Instead of staying frozen until I reboot the computer, if I wait ab out 5 minutes, it goes to the log-in screen.  Of course, I just remember that when it happens, before waiting, I give it a 3-key salute and leave it alone after that.

Maybe that's the escape, but not the solution.

I'm using Nvidia graphics, so I guess you just ruled out the graphics driver being the culprit.


A simple script. A simple binding. So why isn't it simple?

How about this?

#!/bin/sh
/usr/bin/nautilus ~/

Perhaps your hot-key manager isn't aware of your PATH.


Can't connect to Chrome Remote Desktop on Ubuntu 18

Here's the "fix": I've had to repeatedly uninstall Chrome Remote Desktop after each use because of the problems it's causing with auto-mounting disks. Therefore, for the most part, I've simply switched to NoMachine, which works very well on Linux, with zero bugs I have seen.
Related:

[My answer] Automount when clicking on disks in GUI file manager suddenly stopped working in Ubuntu. ("Unable to mount...Not authorized to perform operation.")


Install CUDA to different directory in 16.04

Refer the NVIDIA's CUDA Installation Guide page 32/33(_according to PDF reader page 36/37) for more details on how to install at the custom location for the CUDA libaries, and also what environment variables to set to make it work.

Update:
As per the documentation:

Runfile
The Runfile can be extracted into the standalone Toolkit, Samples and
Driver Runfiles by using the --extract parameter. The Toolkit and Samples
standalone Runfiles can be further extracted by running:

$ ./runfile.run --tar mxvf

The Driver Runfile can be extracted by running:

$ ./runfile.run -x

...
For debian systems:

$ dpkg-deb -x  package.deb output_dir
# Where package.deb is the downloaded debian package for cuda
# and output_dir is the directory where you want to extract the files.

Update 2:

As commented by the OP the installation guide page 34 ( PDF Reader Page 38) contains the necessary steps/references posted below for reference here:

How do I install the Toolkit in a different location?

The Runfile installation asks where you wish to install the Toolkit and the
Samples during an interactive install. If installing using a non-interactive
install, you can use the --toolkitpath and --samplespath parameters to
change the install location:
$ ./runfile.run --silent \
  --toolkit --toolkitpath=/my/new/toolkit \
  --samples --samplespath=/my/new/samples

The RPM and Deb packages cannot be installed to a custom install location
directly using the package managers. See the "Install CUDA to a specific
directory using the Package Manager installation method" scenario in the
Advanced Setup section for more information.


how can sed match pattern delete line plus one and insert diferent file

Instead of trying to specify the next line via an address range, try using N to pull it into the pattern space before the d:

$ sed -e '/id="8"/{r file2.txt' -e 'N;d;}' file1.txt
rrrrrrrrrrrrrrrrr
dddddddddddddddddd
123

123
cccccccccccccccccccc
xxxxxxxxxxxxxxxxxxxxx


Uninstall OpenCV 4.2.0 and its Libraries

You uninstall using the same tool you used to install. Simply use 'remove' instead of 'install'. Apt does the cleanup -- proper cleanup is a fundamental job of a package manager.
So based on what you installed:
sudo apt remove libopencv-dev python3-opencv
sudo apt remove libjpeg-dev libpng-dev libtiff-dev
sudo apt autoremove

You don't need to update your database of available packages in the repository, since you are removing packages instead of installing.

If you want to remove settings files in /etc, use purge instead of remove.

Files in your /home, if any, are NEVER removed by apt. You must delete those yourself.

autoremove removes orphaned packages, if any. An "orphaned" package is neither explicitly installed by the user nor a dependency of other packages on the system.

Note: These are not magic incantations. Each command in the sequence does something specific. Make sure you understand each command before running it. ALWAYS read and understand the output before agreeing to any changes.


How to automate installing ruby and setting it as the global system version?

Simply make sure that the ruby found in $PATH is (a link to) the right one.

On my Ubuntu 12.04 (if I disable rvm, which I'm normally using to manage rubies),

which ruby

shows /usr/bin/ruby and ls -l which ruby  reveals that it's a link to
/etc/alternatives/ruby which is again a link, whose destination is intended to be managed by the update-alternatives command.

So I can either use update-alternatives to point it to the right version (probably the preferred way to do it), create the link manually, or make sure the $PATH variable ends up at a different link (perhaps one placed in  $HOME/bin ) that points to the right ruby.
(Note: the actually binaries on my system are installed in /usr/bin and are distinguished by having their version in their name, e.g. /usr/bin/ruby1.9.3).

All of these instructions are bash commands (or references to bash commands) so automation should be just about putting those commands in a script.


I have the same problem. If I logout/login, the problem resolves. Idem on restart X Server before the first login.
Intel driver work correctly.


How can we remove text from start to some particular selected word using sed command in linux

To reverse the effect of your command AND keeping the same part of the string to be matched (assuming that this is the only fix part of the string and you want to get rid of any other part that may vary), you can do :

echo "hello world, I am just simple text for display." | sed 's/^.*\(, I am.*\)/\1/g'

Result :

, I am just simple text for display

What the regular expression is doing :

^.* : matching any character at the beginning of the string until the next expression
\( & \) : to catch the part of the string which is matched by the expression in between (must be escaped by \ or they will match the parenthesis character).
, I am.* : the match you give us,
\1 : will be replaced by the result of the match of the first sub-expression between parenthesis

This way, you have the exact reverse effect of the command in your question, using the same part of the string to do the match.


nautilus windows don't show up in Launcher

This seems to be a bug in 16.04 see #1578792 and 1572348

As a workaround till this issue is fixed you need to pin Nautilus to the Launcher.

Open Dash and search for nautilus
Drag and Drop Nautilus icon to the Launcher

Make sure you leave the nautilus icon on the Launcher (no pressing Unlock from Launcher) as otherwise the icon will disappear again.


Dell XPS 15 9570 with Ubuntu 19.04 synaptics touchpad problem

Ubuntu 19.04 should default to using the more modern xinput drivers rather than the synaptics drivers. If you upgraded from an older version of Ubuntu, you may still be using the synaptics drivers.

To move to the xinput drivers, remove xserver-xorg-input-synaptics and make sure xserver-xorg-input-libinput is installed.


how do i make an exact duplicate of a flash drive for backup purposes

A complete 1:1 clone/image of any drive or partition can be made with dd.

First find out the file descriptor corresponding with the device you want to back up. The command lsblk will be useful for that. I will assume now that you want to back up the partition /dev/sdb1, please change this value to match your configuration.

Then you can run dd like this:

sudo dd if=/dev/sdb1 of=~/my-backup.img bs=4M status=progress

Warning! Whatever you specify as of=... will get overwritten! Make sure you do not accidentally wipe your data and check the correctness of this argument twice!

Here is what the parameters mean:

if=/dev/sdb1: read from file /dev/sdb1 (which represents the raw partition)
of=~/my-backup.img: write to the specified file. File name, extension and location is arbitrary, just don't write to the same partition you are reading.
bs=4M: always process blocks of 4 MB at once. This speeds the process up.
status=progress see some progress info while it is running

When you later want to restore the image again, simply swap if= and of= so that the file gets read and you write to a partition (which should have the same size).


vmtools fail to install shareable folders as no gcc binaries are found

Much thanks to @steeldriver for the help provided. What solved the problem for me is to go back on an earlier release of xubuntu. In my case 1404 solved it (I didnt try out any other xubuntu versions in between, so maybe those work as well. I still have the 1804 machine running if someone comes up with an other idea.

Cheers


I managed to install the OS, but I can't see anything in my monitor since it says "not supported resolution"

I've had these problems before. What I had to do is that I connected a screen which was compatible, I lowered the resolution to 800x600, and then I connected my first screen.

I'm sure you could use other methods to solve the problem, such as entering the system through recovery mode and edit the resolution from there. You can do this by typing rm ~/.config/monitors.xml from a terminal, or from the recovery mode.
https://wiki.ubuntu.com/X/Config/Resolution#Resetting_an_out-of-range_resolution

You could also try another type of graphical connection (eg. HDMI/DVI instead of VGA).


Replacement for pulseaudio-dlna on Ubuntu 20.04 to stream music through DLNA

I had the same problem, as I am using Pop OS 20.04 and need to stream music to a raspberry running Volumio. The solution for me was to download the Debian version from  https://packages.debian.org/sid/all/pulseaudio-dlna/download
Greetings from Chile


How to set the first picture of every folder as its folder icon?

1. Automatically change folder icon into the first found image inside

The python script below will change the icon of all folders inside a directory (recursively) into the first found valid image file inside the folder.

The script

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

# --- set the list of valid extensions below (lowercase)
# --- use quotes, *don't* include the dot!
ext = ["jpg", "jpeg", "png", "gif","icns", "ico"]
# ---

dr = sys.argv[1]

for root, dirs, files in os.walk(dr):
    for directory in dirs:
        folder = os.path.join(root, directory)
        try:
            first = min(p for p in os.listdir(folder)
                        if p.split(".")[-1].lower() in ext)
        except ValueError:
            pass
        else:
              subprocess.Popen([
                  "gvfs-set-attribute", "-t", "string",
                  os.path.abspath(folder), "metadata::custom-icon",
                  "file://"+os.path.abspath(os.path.join(folder, first))
                  ])

Download from Pastebin

How to use

Copy the script into an empty file, save it as change_icon.py
In the head of the script, edit, if you like, the list of extensions to be used as valid icon images.
Run it with the targeted directory as an argument:

python3 /path/to/change_icon.py <targeted_directory>

That's it!

2. More advanced

...is to make it a right-click option in nautilus:

The script is slightly different then:

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

# --- set the list of valid extensions below (lowercase)
# --- use quotes, *don't* include the dot!
ext = ["jpg", "jpeg", "png", "gif", "icns", "ico"]
# ---

# retrieve the path of the targeted folder
current = os.getenv("NAUTILUS_SCRIPT_CURRENT_URI").replace("file://", "").replace("%20", " ")
dr = os.path.realpath(current)

for root, dirs, files in os.walk(dr):
    for directory in dirs:
        folder = os.path.join(root, directory)
        try:
            first = min(p for p in os.listdir(folder)
                        if p.split(".")[-1].lower() in ext)
        except ValueError:
            pass
        else:
              subprocess.Popen([
                  "gvfs-set-attribute", "-t", "string",
                  os.path.abspath(folder), "metadata::custom-icon",
                  "file://"+os.path.abspath(os.path.join(folder, first))
                  ])

Download from Pastebin

To use

Create, if it doesn't exist yet, the directory

~/.local/share/nautilus/scripts

Copy the script into an empty file, save it in ~/.local/share/nautilus/scripts as set_foldericons (no extension!), and make it executable.
Log out and back in, it works.

Notes

This will change the icon of all folders inside the right-clicked folder, not of the folder itself.
Since os.path.realpath() is used, this also works if the targeted folder is a link.

EDIT

Undo (reset) the custom icons inside a directory recursively

If, for some reason you'd like to reset the icons inside a folder to their default icon(s), use the script below. Simply:

copy it into an empty file, save it as reset_icons.py
run it by the command:

python3 /path/to/reset_icons.py <target_directory>

The script

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

dr = sys.argv[1]

for root, dirs, files in os.walk(dr):
    for directory in dirs:
        folder = os.path.join(root, directory)
        subprocess.Popen([
            "gvfs-set-attribute", os.path.abspath(folder),
            "-t", "unset", "metadata::custom-icon"
            ])


Update information is outdated - error in updating a package

Although you have removed the scitools package, you haven't removed the PPA.

To remove the scitools PPA -

sudo add-apt-repository --remove ppa:scitools/ppa


How to transfer files between an Ubuntu machine and Windows machine?

You can connect both devices via ethernet. when you configure your eth- ports so that they are in the same IP-range (e.g. winows is 192.168.1.1, Ubuntu is 192.168.1.2), you can use Nautilus to access your windows-PC and move or copy your files and directories. Another option would be to use an external USB-drive or a cloud service like Ubuntu One.


Poor Ubuntu performances on VM VirtualBox

I'd recommending using virt-manager and kvm-qemu as this seems to always be more responsive and snappier than VirtualBox for the virtual machines that I run on my x86 hardware.  I believe the virtualization is possibly more efficient with this than VirtualBox, but it depends on your hardware and what is being virtualized and/or emulated.


How can I connect to GNUnet 0.8.1 on 11.10?

Apparently, GNUnet version 0.8 is depreciated and all the effort is being invested in developing version 0.9. (Source)

I have used the steps from the installation instructions for Ubuntu from GNUnet site for installing GNUnet version 0.9.

First, make sure Subversion is installed on your system:

sudo apt-get install subversion

Then, install libextractor dependencies:

sudo apt-get install automake autopoint autoconf libtool make gcc g++ gettext texinfo
sudo apt-get install zlib1g-dev libgsf-1-dev libmpeg2-4-dev libpoppler-dev

Build libextractor:

svn checkout https://gnunet.org/svn/Extractor
cd Extractor
./bootstrap
./configure
make; sudo make install; make check
cd ..

Note that 'make check' is optional here.

Install libmicrohttpd dependencies:

sudo apt-get install gnutls-dev libcurl4-gnutls-dev

Build libmicrohttpd:

svn co https://gnunet.org/svn/libmicrohttpd
cd libmicrohttpd/
./bootstrap
./configure --with-gnutls --enable-messages --enable-curl
make; sudo make install; make check
cd ..

Again, 'make check' is optional (and may fail if you are running services already on certain ports, like 1080).

Install GNUnet dependencies:

sudo apt-get install libltdl7-dev automake autoconf libtool make gcc texinfo
sudo apt-get install libgcrypt11-dev libgmp3-dev libcurl4-gnutls-dev cvs libunistring-dev
sudo apt-get install libmysqlclient15-dev libsqlite3-dev libpq-dev
sudo apt-get install libesmtp-dev libpcap-dev

Build GNUnet:

You can specify the location of the GNUnet installation by setting the prefix when calling the configure script: --prefix=$HOME/gnbuild

To build GNUnet execute:

svn checkout https://gnunet.org/svn/gnunet/
cd gnunet/
./bootstrap
./configure --prefix=$HOME/gnbuild --with-extractor=/usr/local
make; sudo make install

You have to set the GNUNET_PREFIX environment variable according to the prefix you set for the configure script and you have to add your GNUnet installation to your search path:

export GNUNET_PREFIX=$HOME/gnbuild
export PATH=$PATH:$HOME/gnbuild/bin

Now you can test your installation by running:

make check


The most important question is, whether the data on the disk is important for you and whether you have an additional backup.

If you do not care much, get a new hard disk.
If you care and you have a backup, get a new hard disk.
If you care and you have no backup, contact a professional data recovery service.
If you care and you have no backup, but cannot afford a professional data recovery service, try to follow the steps from the second screenshot.

As a side, hard disks fail over time. At work we usually replace hard disks every three years.

Also, if you do not care about data exchange with a Windows system, I would strongly advise not to use NTFS as a file system, as Linux has way better support for native Linux file systems.


I can't find a file I moved to USB drive

Your file is still there. It's just now named /dev/sdb1 and has replaced the device special node that would otherwise be used to mount your USB disk.
You can recover it by moving it back to somewhere else, for example:
sudo mv /dev/sdb1 /home/myname/Downloads/m.mp4

Don't overwrite files in /dev as these are not normal files, but special markers which give the OS raw access to certain hardware devices. Your use of sudo mv destroyed the device special node /dev/sdb1 and replaced it with your video file.
After you move the video back to where it came from, eject and reinsert your USB stick, and you can write files to it via its mount point (typically /run/media/yourusername/USBSTICKNAME but you can run the command mount to see where it was actually mounted). Linux will recreate the device special /dev/sdb1 if necessary when you reinsert the USB stick.
Also note that if your USB stick was correctly mounted by the system, its files should be writable by your username, and you should not need to use sudo to move files to or from it.


Centering the application launchers on the panel in 16.04

This option is not available in the unity code and as unity is being retired as the default desktop environment it's not likely that development efforts will go into providing a centering option for icons in the launcher under unity. I reccommed that you revert to the solutions that you've used in the past such as cairo-dockor perhaps docky both of these are currently available in the universe repository for all currently supported versions of Ubuntu, or plank which also available in the universe repository (for 16.04 and newer versions of Ubuntu).


Intel Corporation Device [8086:0d4f] is not supported on Ubuntu 18.04.3

This Network adapter Intel Corporation Device [8086:0d4f] is new and supported by mainline Linux kernel since the 5.5 Linux kernel.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers?h=v5.5&id=914ee9c436cbe90c8ca8a46ec8433cb614a2ada5

Ubuntu maintainers backported this fix to Ubuntu 5.3 kernels that are shipped with the 19.10 Ubuntu release and will be shipped with 18.04.4 LTS shortly.

At the moment the current HWE 18.04 kernel is the 5.3.

If you connect your server to the internet by other means and do

sudo apt update && sudo apt upgrade

all should work.

If the network traffic is an issue, you can update only kernel by

sudo apt update
sudo apt install linux-generic-hwe-18.04

You can manually download the package with its dependencies https://packages.ubuntu.com/bionic-updates/linux-generic-hwe-18.04

You'll need only linux-XXX packages. Other dependencies should be already there.

Then install them using dpkg.


Audio cuts in and out when using Spotify Linux Preview

According to Spotify reps on their GetSatisfaction forum, this issue has been resolved in the 0.5.1.151 release of Spotify Preview for Linux.


How to enable global menubar for gtk apps on kubuntu 14.04

Update: As @stsloth mentioned, thanks to the tireless work of kde devs this now again works (since Plasma 5.9)

Short story: it doesn't work and there is no fix.

Warning: The following is my interpretation of the events. I might be wrong, but I've spent a lot of time googling and there seems to be almost no information. And I am definitely frustrated with what I could find...

Long Story: It is very hard to find much details on the net. From what I understand, when the ubuntu folk wanted to take menubars out of the applications they did the right thing: they sat down, talked to people and wrote a spec for exporting menus over dbus --- the dbusmenu. Then they implemented a gtk patch and paid a guy to implement a kde solution. The kde solution was accepted upstream but the gtk one remained as a downstream patch. I assume it was because the GNOME folk just weren't interested in global menubars, but I couldn't find any info on this.

Some time later, the GNOME folk suddenly decided that they wanted their applications to better blend with MAC OS, which has a global menu bar too.
(<rant>yay for compatibility with a closed source os and ignoring compatibility with an open source os</rant>). But instead of working with everyone else, they decided to go their own route and invent a new way to export menus over dbus. This of course broke the menubar integration of gtk apps in KDE. But not only this, they also declared the dbus protocol an implementation detail thus making it impossible for the kde folk to support it. Moreover, they weren't interested in any discussion at all. A bug was filed in their bugzilla [1]. This bug was closed as WONTFIX and the reporter was directed to the gtk-devel-list. The message [2] posted there got no response. And from reading the comments on the bugreport I got the idea that the GNOME folk are not interested in compatibility with other DE's at all.

Oh, and, btw, the CANONICAL folk, who everyone loves to hate for inventing their own stuff, are trying to fix this by working on a qt solution (qmenumodel)... When that will be available for kde, though, is not clear. Probably not for Trusty (as kde 4.12 is feature frozen and no new releases are planned in the kde 4.* series).

Links

https://bugzilla.gnome.org/show_bug.cgi?id=711504
https://mail.gnome.org/archives/gtk-devel-list/2013-November/msg00006.html


Simplest way to use graphic acceleration to watch videos

There are several player supporting gpu accelerated video playback. But first you (nvidia user) should install latest nvidia drivers and vdpau libries (i guess vdpau-va-driver or vdpau-video or even just libvdpau -> synaptic will tell you).

VLC Player >= v1.1.2 (supports a lot of formats) -> enable gpu acceleration
Gnome Media Player (autouse best engine vlc|xine|...)
smplayer with vdpau support

Latest nvidia packages you can find in ppa:ubuntu-x-swat/x-updates
SMPlayer with vdpau support you can find in ppa:nvidia-vdpau/ppa

Use carefully, ppa's can harm your pc.


Move all Files of same extension to a Folder

Moving files based on file type
You can batch create your directories, move the files, then delete empty directories.
ScriptRoot='/some/path'

# Create the Directories
mkdir '${ScriptRoot}/Images'
mkdir '${ScriptRoot}/Music'
mkdir '${ScriptRoot}/Documents'
mkdir '${ScriptRoot}/Videos'

# Move the files (edit to match the targeted extensions...
find '${ScriptRoot}' -name '*.mp3' -or -name '*.flac' -exec mv {} '${ScriptRoot}/Music' \;
find '${ScriptRoot}' -name '*.jpeg' -or -name '*.jpg' -or -name '*.png' -exec mv {} '${ScriptRoot}/Images' \;
# find (... and so and so for Documents and Videos)

# Delete empty directories
find '${ScriptRoot}' -depth -type d -empty -exec rmdir {} \;

Moving files based on file extension is way simpler but that is not what was asked.
To achieve what described, this can be modified with a file list generated by find, looped with a while read and several tests on file ext for moving to directories
for filename in *; do
  if [[ -f "$filename" ]]; then
    ext=${filename#$base.}
    mkdir -p "${ext}"
    mv "$filename" "${ext}"
  fi
done


The message means you already have installed virtualenv, so there's no need to install it again.

In order to activate it, try to copy + paste following commands:

virtualenv -p python3 .venv

source .venv/bin/activate

for checking your pip packages:

pip freeze

for deactivating:

deactivate

if this does not work for you try this way:

python3 -m venv .venv

but in this case try to ignore the pkg-resources==0.0.0 in your venv  otherwise it will give conflict in requirements, ones you transfer your files to someone else.


"The update information is outdated." error in ubuntu 13.04

In a terminal window, try..

sudo apt-get update

.. then go through the list some and see if you can pinpoint what specific packages are failing, which should allow you to, at least, narrow down the problem to a specific repository or failure point.  Right now, it sounds like you're not getting enough information about the error from what you've described so far.

Let us know what you see wrong, and we can continue from there.


Want to remove Folder "." and ".." which I have copied from my phone SD Card?

These are standard Linux notations for current directory (.) and parent directory (..). They have nothing to do with Android or SD card. This is just standard filesystem behavior,and they exist for every directory on the filesystem.

$ pwd
/home/xieerqi/testdir/parent
$ ls -a
./  ../
# going to . directory doesn't do anything, you remain in same place
$ cd .
$ pwd
/home/xieerqi/testdir/parent
# going to .. brings you up one level to parent folder
$ cd ..
$ pwd
/home/xieerqi/testdir

Important exception is that with / root directory, the .. will point to itself, since there's no higher directory to go to.

You cannot perform removal on them either (which wouldn't make sense, since you're trying to get rid of your current working directory or its parent):

$ pwd
/home/xieerqi/testdir/parent
$ rm -r .
rm: refusing to remove '.' or '..' directory: skipping '.'
$

So what should you do about them ? Nothing. They're part of the Linux package, so to speak. This is not broken, so don't try to fix it.

Frequent usage of . is via ./ notation. This can be used in case where you'd run a script or executable in your current working directory like ./myscript.sh or as argument to command, signifying a file in current directory, like ls ./myfile.txt. The last approach is often used with globstar to expand to multiple filenames in current directory, such as ls ./*. This approach is particularly useful with filenames that may contain leading - and thus such filenames may be misinterpreted by commands as arguments, while ./-myfile.txt avoids that issue.

It's also important to note that since filenames containing leading dot are considered hidden on Linux, these two "pointer" directories can be seen if you explicitly specify for the command that you use to process hidden filenames ( unless your command, such as find does that by default).

See also: https://unix.stackexchange.com/a/63087/85039