How do you add/remove applications to/from the Unity Launcher from command line?

The script below can be used to either add or remove items to the launcher, depending on the argument(s):

#!/usr/bin/env python3

import subprocess
import sys

desktopfile = sys.argv[1]

def current_launcher():
    get_current = subprocess.check_output(["gsettings", "get", "com.canonical.Unity.Launcher", "favorites"]).decode("utf-8")
    return eval(get_current)

def set_launcher(desktopfile):
    curr_launcher = current_launcher()
    last = [i for i, x in enumerate(curr_launcher) if x.startswith("application://")][-1]
    new_icon = "application://"+desktopfile
    if sys.argv[2] == "a":
        if not new_icon in curr_launcher:
            curr_launcher.insert(last, new_icon)
            subprocess.Popen(["gsettings", "set", "com.canonical.Unity.Launcher","favorites",str(curr_launcher)])
    elif sys.argv[2] == "r":
        curr_launcher.remove(new_icon)
        subprocess.Popen(["gsettings", "set", "com.canonical.Unity.Launcher","favorites",str(curr_launcher)])

set_launcher(desktopfile)

How to run it

Paste the code into an empty file, save it as set_launcher.py
Run it by the command:

python3 /path/to/set_launcher.py <name_of_.desktop_file> a

to add an icon, or:

python3 /path/to/set_launcher.py <name_of_.desktop_file> r

to remove an icon

Example:

python3 /path/to/set_launcher.py gedit.desktop a

to add gedit to the launcher, or

python3 /path/to/set_launcher.py gedit.desktop r

to remove gedit from the launcher

Explanation

The list of launcher icons is defined in the key:

com.canonical.Unity.Launcher favorites

and can be fetched by the command:

gsettings get com.canonical.Unity.Launcher favorites

to set an alternative list (given the fact you use the correct format):

gsettings set com.canonical.Unity.Launcher favorites "[item1, item2, etc]"

Can you achieve this by editing a .desktop file?

No, it has nothing to do with the file itself. What matters is that the file either is in the list of launcher favourites or not.

Editing this list from command line is exactly what the script does.


Download the Oracle java from its offical website

Download Java From Official website Here

Manually Install the JDK 1.7

#java -version

#sudo mkdir -p /usr/lib/jvm

#sudo mv jdk-7u21-linux-i586.tar.gz /usr/lib/jvm

#cd /usr/lib/jvm

#sudo tar zxvf jdk-7u21-linux-i586.tar.gz

#sudo rm jdk-7u21-linux-i586.tar.gz

#ls -l

#jdk1.7.0_21

#sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_21/bin/javac" 1

#sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_21/bin/java" 1

#sudo update-alternatives --set "javac" "/usr/lib/jvm/jdk1.7.0_21/bin/javac"

#sudo update-alternatives --set "java" "/usr/lib/jvm/jdk1.7.0_21/bin/java"

#sudo vi /etc/profile

Add the following entries to the bottom of your /etc/profile file:

#JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21 PATH=$PATH:$JAVA_HOME/bin export JAVA_HOME export PATH

#. /etc/profile

#java -version

Replace the jdk1.7.0_21 With the version u have Downloaded


An example on how to recreate fstab can be found on ubuntuforums.org

You need the result of:

$ sudo blkid
/dev/sda1: LABEL="EFI" UUID="3F3C-1AF6" TYPE="vfat"
/dev/sda2: UUID="83062D46C78FDD33" LABEL="Macintosh HD" TYPE="hfsplus"
/dev/sda3: UUID="9A1C07811C075821" TYPE="ntfs"
/dev/sda4: UUID="58e05acc-a255-48c7-ac8a-acbf5a7764c9" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="dc91869f-897e-47d1-a472-98551ae03fa5"

and of:

$ cat /etc/mtab
/dev/sda4 / ext3 rw,relatime,errors=remount-ro 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,nosuid,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
lrm /lib/modules/2.6.28-17-generic/volatile tmpfs rw,mode=755 0 0
securityfs /sys/kernel/security securityfs rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
gvfs-fuse-daemon /home/dan/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=dan 0 0

With these results you can re-create a fstab file. Based on the example it would be:

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda4
UUID=58e05acc-a255-48c7-ac8a-acbf5a7764c9 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=dc91869f-897e-47d1-a472-98551ae03fa5 none swap defaults 0 0

But your /etc/fstab will be different. You will have different UUID's, different discs and can have different mount options.


How do I uninstall Studio 3T on Ubuntu 18.04

To uninstall Studio 3T open terminal in its installation directory (/opt/studio3t) and type these commands:

sudo chmod +x uninstall
sudo ./uninstall

Uninstaller will appear in separate GUI window.

I think the more recent versions of Studio 3T will not require to uninstall previous versions manually.


Is it OK using python 2.7.11 and python 3.5.2 on one computer ( Ubuntu 16.04)?

This is fine, and completely normal. Python 2.x and Python 3.x are completely separated on the file system.

It only becomes a problem if either you or a library you are using, intentionally does something wrong by crossing the paths. As long as you don't alter the standard installation, you can use either one. For new code, it is generally recommended that you should write only Python 3.x code though.


Gnome- vs Unity-panel (applet) compatibility?

Many of the gnome-applets you are familiar with use old technologies like Bonobo, etc. To bring them up to a modern standard, they would need to be rethought/rewritten/etc from scratch using newer technologies such as D-BUS.

Making the applets compatible will not improve usability but just backwards compatibility. Furthermore, "Ayatana-applets" as you call them, are not "applets" in the sense you might be thinking, but are indicators (see here). With the amount of work that would be required for bringing the old applets into new technology would be rather pointless (to quote the Bible indirectly, it's like putting new wine in old wine skins), since GNOME 3 will be basically make these obsolete.

It would also be of note that GNOME Shell will not support these old applets either.


How can I import data from one Ubuntu version (say 11.04 ) to 12.04.?

To get your files, just copy the folders that you want to save like Downloads, Documents, Music, etc. to a different partition, Re-install Ubuntu, and after the installation is done copy the folders over.

To copy browsing history, and other important info:

Firefox:
You can do that by copying the relevant data files from the profile folder on the old computer to the samet folder on the new computer. The location of the profile folder ~/.mozilla/firefox

Chrome:

The Chrome bookmarks, history, and settings are in ~/.config/google-chrome/Default .  Copy this folder, re-install chrome and put it back into the same location.

For bookmarks:

Firefox:

Chrome:

Chrome sync
To sync your information in the browser like history, passwords, bookmarks, etc. Follow these easy steps:

Click the settings button inside Chrome (the tool)
Click on settings
Sign in at the top of the page with your Google account.
Select what info you want to be synced and you are off!

Follow the same steps in the other browser to sync it.


~/.inputrc is missed in ubuntu 14.04 => Cannot create a key binding

Just do this to create it with the same access rights as .bashrc:

touch ~/.inputrc
chmod --reference=~/.bashrc ~/.inputrc

NOTE :

  --reference : it inherits permissions of specified file .


How can I use Thunderbird without an outgoing mail server?

You can use a dummy SMTP server.

DevNullSmtp
https://stackoverflow.com/questions/1006650/dummy-smtp-server-for-testing-apps-that-send-email


which ubuntu release should I install on hp compaq dc5100mt?

The latest version of Ubuntu should be fine. See the system requirements site here:

https://help.ubuntu.com/community/Installation/SystemRequirements

It shows the minimum specs:

700 MHz processor (about Intel Celeron or better)
512 MiB RAM (system memory)
5 GB of hard-drive space (or USB stick, memory card or external drive but see LiveCD for an alternative approach)
VGA capable of 1024x768 screen resolution
Either a CD/DVD drive or a USB port for the installer media

Your information clearly exceeds these by a wide margin. There shouldn't be any problem with that. I would proceed with the install from here:

http://www.ubuntu.com/download/desktop/install-ubuntu-desktop


May I DELETE the initial ADMIN ACCOUNT after having created another admin User without risks?

You can use the command "groups" to verify that your admin account is in both the 'adm' and the 'sudo' groups. e.g.
tim@horton:~/devl$ groups
tim adm dialout cdrom floppy sudo audio dip video plugdev lxd netdev

If the admin account you want to use is in both 'adm' and 'sudo' groups, you can safely delete the old admin account.
It is a good idea to have a backup admin account, as heynnema suggests.


How to create GPT partitioned bootable USB for uefi? I am on ubuntu and am trying to get back to windows

If Windows is still installed on your computer but you're unable to boot it, try using the USB flash drive version of my rEFInd boot manager. Note, however, that rEFInd requires extra configuration if Secure Boot is enabled, so if you've not already done so, you'll need to disable Secure Boot to get this to work. (Depending on what's wrong with your system now, that might get Windows booting without using rEFInd.)


Ubuntu directly boots up without giving me a chance to reach Advanced Options

Press Shift and hold while booting. For UEFI boot press Esc and hold.


Bash program to open files on a second monitor

To position a window, you can use a tool that manipulates X events such as xdotool or wmctrl. For example, with wmctrl, you can use -e:

   -e <MVARG>
          Resize  and  move  a  window  that  has been specified with a -r
          action according to the <MVARG> argument.
   <MVARG>
          A move and resize argument has the format 'g,x,y,w,h'.  All five
          components are integers. The first value, g, is the  gravity  of
          the  window,  with  0  being  the most common value (the default
          value for the window). Please see  the  EWMH  specification  for
          other values.

          The four remaining values are a standard geometry specification:
          x,y is the position of the top left corner of  the  window,  and
          w,h  is  the  width and height of the window, with the exception
          that the value of -1 in any position is interpreted to mean that
          the current geometry value should not be modified.

You can usually ignore gravity, so to place a window at the top left corner of your screen and make it 1200 x 700 pixels, you would run:

wmctrl -r :ACTIVE: -e 1,1,1,1200,700

The -r lets you select a window and :ACTIVE: means the currently focused window.

You can also simplify your script. There is no reason to parse ps, the special variable $! holds the PID of the job most recently placed in the background. In any case, parsing ps will often fail since there might be multiple processes matching Thesis.pdf. There will always be two: the evince and the grep Thesis.pdf you just ran.

So, with all that in mind, you could do:

#! /bin/bash
while true; do
    ## Open the pdf
    evince ~/doc/a.pdf &
    ## Save the PID of evince
    pid="$!"
    ## Wait for a 1.5 seconds. This is to give the window time to
    ## appear. Change it to a higher value if your system is slower.
    sleep 1.5
    ## Get the X name of the evince window
    name=$(wmctrl -lp | awk -vpid="$pid" '$3==pid{print $1}')
    ## Position the window
    wmctrl -ir "$name" -e 1,1,1,1200,700
    ## Wait
    sleep 5m
    ## Close it
    kill "$pid"
done

Note that I removed the exit 0 since, because of your while true, it will never be reached and there's no point to it. You can play with the positional arguments to figure out where you want to place the window.

Finally, a note on DISPLAY. This variables points to an X display. This is not a screen, it is the active X server. Many users might be running parallel X servers on a single machine, this allows you to choose which one of them a window should be displayed on. It has absolutely nothing to do with how many physical screens are connected, unless each screen is running a separate X  session.


Partition recovery: How can I insert existing partitions into an extended partition?

Rather than manually editing the partition tables you could just recreate your old partition table using gparted and either use cp -p or dd to copy the old partitions into the new ones.

External storage requirements

How you do so depends on your external storage capabilities.  If you have another drive that you can copy the partitions you should copy the primary partition(s) to an image (for dd) or directory (for cp) on the external drive, then create an empty logical partition and and copy the image into this new empty partition. This would be the best way to go about things.

To back partitions up as images somewhere (sda1 being the first partition on your first hard drive):

sudo dd if=/dev/sda1 of=[path to where you want to store the image] bs=1M noerror

To copy partitions to a directory (preserving permissions) first mount them then:

sudo mkdir /[path to where you want to store them]/partition-backup1
sudo cp -pr /media/mounted-partition-to-be-copied /[path to where you want to store them]/partition-backup1

See below for more information on cp and dd.

If you don't have external storage

However, if you don't have enough space/time to copy to partitions to external storage first, you could potentially use creative resizing/copying to do the entire move on the same drive.  In other words, you could resize partitions with a lot of free space down to a smaller size give you the room to create new duplicate logical partitions and then delete the old one and resize back up after the copy.  You would also need to temporarily store one partition as an image inside of another one so you could create the extended partition.

However, be careful if any of the partitions (/home, swap, etc) are encrypted.  If so it would be very, very dangerous to resize them.  There is a guide for resizing encrypted partitions here but I wouldn't recommend doing so unless you really cannot find any external storage to avoid this step.

Copying the old primary partitions into new logical partitions

First make sure you have a liveCD/USB handy, you will probably need to reinstall GRUB later.

I'm assuming here that you have assessed the method best for you and have now created an empty new logical partition and have access to either the old primary partition or an image of the partition stored externally.

You can either use cp which copies file by file or dd which copies blocks of raw data.  For any encrypted partitions you will have to use dd.  I personally feel that when used correctly dd is safer because you don't have to worry about permissions/ownership/symlinks/etc.  However if you make a mistake using dd you will break something.

To use cp: (for non-encrypted partitions) first mount both the old primary version of the partition and the new empty logical partition.  The copy the files from the old partition to the new ones. The -p option preserves the permissions and owners of the files so you don't mess up your permissions, -r just copies recursively.   However it cannot create files with owners above the permissions of whoever is running the command so you shoul run this command as root.

sudo cp -pr /media/[mounted-old-primary]/ /media/[mounted-empty-logical]/

This might take awhile.

To use dd: You need to be absolutely sure of the partition names of your old and new partitions.  You should also be cloning partitions that are exactly the same size (or to a partition that is larger--at your own risk). Do not try cloning to a partition that is smaller than the original. dd will overwrite any device it is ordered to copy to.  Either use the gparted GUI to get these right or you can run sudo fdisk -l to see the partition table.  Once you are sure of your names run the dd command (must be run as root to write directory to devices)

People googling in: DO NOT run the following commands unless you understand what they do and have changed the partition names to the partitions your want to copy/overwrite

sudo dd if=/dev/sda2 of=/dev/sda6 bs=1M noerror

In this example sda2 is the original primary partition and sda6 is the new, empty logical partition.  Be sure to check that you've changed the pathes correctly before each operations.

If you are copying from an image you backed up, run a command like this:

sudo dd if=/path/to/image.img of=/dev/sda6 bs=1M noerror

Either of these will also take awhile.  You can make sure they are still running by checking top and noting various related processes chugging along.

Cleaning up

Do not delete anything until you are sure that it has copied correctly and that you will not need the backup anymore.  That said once you've successfully copied everything onto the new logical partitions you will want to remove the old primary partitions and resize all the partitions to how you want them.

You haven't touched the MBR at all but if you've moved the partition with /boot on it, you will need to reinstall/upgrade GRUB so it points to the new partition.

Reinstall GRUB from a liveCD by mounting your / directory (replace sda3 with whatever partition it is for you)

sudo mount /dev/sda3 /mnt

At this point you could run sudo grub-install --root-directory=/mnt /dev/sda to reinstall grub but you would still need to run update-grub from the native installtion (meaning a rescue boot from the GRUB command line) to update the config files.  We can combine both these steps and use chroot to make the / partition the liveCD's / filesystem.

(This part heavily based on https://help.ubuntu.com/community/Grub2/Installing)

  Mount the critical virtual filesystems. Run the following as a single
  command:
  for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done

  Chroot into your normal system device:
  sudo chroot /mnt

  Reinstall GRUB 2:

grub-install /dev/sda

  Recreate the GRUB 2 menu file (grub.cfg)

update-grub

  Exit chroot: CTRL+D

  Reboot.

sudo reboot


Why Gnome/Ubuntu use SAMBA as default sharing service?

Most Ubuntu users will be sharing
there network with at least one
Windows or Apple machine and samba is
the only fully featured sharing
service which is capable of being
accessed by the majority of computers
what ever operating system they
happen to be using.
Also the GUI method of setting up
shares is the easiest to do for
someone new to Ubuntu which means
that they will probably have been
using one of the afore mentioned
OS's. Once you are a more experienced
user you will probably have figured
out that Ubuntu is the best OS in the
world and will have wiped and
Installed it on all their other
systems so no need for samba any more.

Just remember we were all nube's once (holds hand to chest)


14.04: password not accepted after computer wakes up from sleep

Same problem.

I found that it goes away if you try to switch account: then the password is accepted.

Do you have more than one language installed?

I was wondering about that because sometimes after loggin out I also get the wrong language activated.


Is it possible to create rounded corners for an inserted image in LibreOffice Impress?

You can give to an image the shape you like by:

insert image
Create shape that you want to give to the image, and put it above the image
Select both objects
Right-click on them, "shapes" -> "intersect"

There you go.

Using this approach you can have rounded corners or whatever other shape you like.

See screenshots:


Wireless mouse not working when plugged directly to laptop, but works fine when plugged to a USB extension hub

The solution is simple, and honestly these days, a not so common one anymore. Unfortunately for you, this is not an error that is easy to fix, but it is very easy to tell you why it is happening. USB 2.0 was built to receive only a certain amount and type of information from the device in it, while USB 3.0 was made to receive almost all of it. It seems that the extension you have turns 2.0 into 3.0. So basically, the problem is that your laptop USB 2.0, which isn't supported by your mouse. I hope this helps!


Ubuntu came with GRUB on it, so it will only load if it's the primary boot device.

Go into the BIOS and into the Boot Device Order.

Select Ubuntu's drive (It's usally /dev/sda2, but to make sure, run a LiveCD and run in a terminal fdisk) and put it in the order as the first boot device.

Save the changes and reboot.

Hopefully GRUB will come up and you will be able to choose between Windows and Ubuntu.

Hope this helps!!!


On Ubuntu 14.04

Open All Settings.
Click on Details under System.
On the next window, click on Default Applications.
Choose your desired browser.


Is there a workaround for Ubiquity hanging on laptop-detect on a Xubuntu+Ubuntu desktop?

For anyone else looking to answer this, the answer is probably to try the alternate ISO.  Given I'm using Wubi, and the alternate ISO isn't supported through it and I don't have a working CD drive the answer for me is no, there isn't a workaround.


How to get Gnome 3.14 on UbuntuGnome 14.04LTS

GNOME 3.14 was released yesterday, I think. Even Rico won't have it by now. Build from source if you must have it now, or wait for Rico's PPA to be updated.


preventing pip from removing system packages during upgrade

If you do not want pip to install or uninstall any dependencies you can use

pip install --no-deps package_name

Be ware that you are in that case responsible for making sure the different dependencies needed for the package you install are satisfied.

To use it when upgrading a package use:

pip install -U --no-deps package_name

For a similar problem, cf. Drag forward installed Python packages when upgrading


Problem with dropping internet and slow wireless connection....Complete N00B

Try to check the router's settings first. Here is the detailed instruction 192.168.l.l with its help I can solve issues with Internet connection and Wi-Fi in a few clicks. Hope it works out in your case too.


How to share a folder on Ubuntu to Raspberry Pi 3 over local WiFi network?

my favourite method is via SSHFS.

Install openssh server on your Ubuntu machine: sudo apt-get install openssh-server
Install sshfs on the Raspberry Pi (don't know the package name for the distro you're running), in Ubuntu:sudo apt-get install sshfs
Connect to your ssh server by mounting a folder:sshfs username_on_server@server_ip:/location_of/movies_on_Server  /mountpoint/on_rasberry_pi
You might have to add your Rasberry Pi user to the fuser group: sudo useradd -G {group-name} username
to unmount the remote folder: fusermount -u /mountpoint/on_rasberry_pi

Enjoy.


Downgrading kubuntu backports to official repositories: could not find package list for PPA

Solved it.
You have to re-add the PPA:
sudo add-apt-repository ppa:kubuntu-ppa/backports
sudo apt-get update

and the run ppa-purge using the PPA name, not the URL:
sudo ppa-purge ppa:kubuntu-ppa/backports


It isn't using Java or Flash. It's Three.js which uses WebGL.

It might be possible your browsers aren't seeing a 3D graphics device powerful enough, or it might be that you don't have the drivers set up correctly, or it could just be that you don't have your browser set correctly.

I'd start with the last by viewing the official WebGL support page. If that doesn't work it will direct you to your browser's settings. If that doesn't work, it's time to look at your graphics setup in Ubuntu.

It seems your Intel 945 integrated graphics might be so underpowered that it's been blacklisted to stop things grinding to a halt. It might also just not support enough features.

However you can force Firefox to ignore the blacklist by opening about:config in Firefox (put that in the address bar) and setting the following keys to true:

webgl.force-enabled
layers.acceleration.force-enabled

This may make Firefox crash however.


Can I continue booting into Ubuntu if I move my drive to another laptop?

I have done it with desktop machines and it worked fine.

You need to make sure the new device supports Ubuntu (you can test with a liveCD/usb stick).

You may get complications with display drivers and wifi drivers if they were not automagically configured by default (you had to manually configure/install).


Universal USB Installer has problems on some computers, and doesn't always let you create a bootable drive. Use Rufus, from http://rufus.akeo.ie to make a bootable Ubuntu USB drive. It's efficient, fast, easy-to-use and free.


First, remove that entry from /etc/fstab.  Then:

sudo swapoff /swap.dat
# Wait for all resources paged to that swap file to be moved to other swap files or to RAM.
sudo rm -f /swap.dat

If you remove the file before it is no longer in use, the disk space will remain allocated until swapoff is complete.


How to disable Postfix SPF from rejecting mail?

as far as I know, you cannot just disable spf partly, you either use it or you don't.

It's the owner of the SPF/TXT record that can choose to soft- or hardfail by using ~ or - in the dns record.

However, you could just disable spf so it won't be used by your postfix. Depending on your setup it's probably done by disabling / removing check_policy_service unix:private/policy from the smtpd_recipient_restrictions in postfix main.cf


Is it possible to pull data off a linux hard drive using windows 8.1?

Windows only naturally understands Windows file systems... but you can install more.

Ubuntu by default uses ext4 these days, so you probably need something like this :

http://www.ext2fsd.com/


Ctrl+alt+t to open terminal and type

  gnome-session-properties

a dialog box will open-up , click on add paste your command and click on ok.

this will help you to execute commands at start-up

for change to be persistent try  this https://askubuntu.com/a/151665/162137

I hope it helps!


You'll have to remove the what appears to be a bogus link from your /etc/apache2/sites-enabled file.

You can do this with:

$ sudo rm /etc/apache2/sites-enabled/testsite.com


Why did ctrl-f stop working in LibreOffice?

You need to re-map the Ctrl-F keyboard action to 'Find & Replace'.

NOTE: The dialog box (Tools >> Customize >> Keyboard) is hard to use, and I was unable to find the existing 'quick find' that is currently mapped to Ctrl-F.

After several attempts, I was able to map:

Shortcut keys: Ctrl-F - to - Category: 'Edit', Function: 'Find & Replace'
Shortcut keys: F3 - to - Category: 'Edit', Function: 'Repeat Search'
Shortcut keys: Ctrl-Shift-F - to - ( left blank )

( This clearly needs work, by the LibreOffice maintainers. )


I have install MS Office 2016 with Wine but MS Fonts are not available

Thanks for your reply. I do have ubuntu-restricted-extras installed.

I have managed to get it working now. A rather predictable answer, I rebooted and everything was working. So used to not having to reboot on Ubuntu to get things working.

If anyone is looking to get MS Office 2016 working on Ubuntu, I can recommend the article posted above. It works perfectly and not difficult to get working.


Ubuntu 12.04 and realtek rtl8723ae some networks work, some not

Update your version of the software.  Try version
rtl_92ce_92se_92de_8723ae_linux_mac80211_0007.0809.2012
(Note the last part is the date, which is later than yours).
Even later versions may exist, but the above should work.

Here's a similar problem with suggested solution:
Wireless card Realtek RTL8723AE-BT driver not compiling on Quetzal


Virtualbox hangs when shutting down after having installed guest editions

Try lo log in the VM where you installed the guest additions and re-install them using their packaged versions:

sudo apt-get install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11

Finally restart the VM to complete the installation.


Gmail in firefox showing time in UTC, but not in chromium

I found it. The entry privacy.resistFingerprinting => true in about:config  forces every website to use UTC.
There is no other way to use local time zone in Gmail without being tracked by fingerprinting services, which is an annoying bug arising from extra security, because the user may want to resist fingerprinting, but still use local time.
This answer is based on https://support.mozilla.org/en-US/questions/1212634


wifi is very poor and unstable --> after installing ubuntu mate 16.04 in HP Pavilion 15-ab032tx Notebook

I suggest that you try, from a terminal:

sudo -i
echo "options rtl8723be ant_sel=1"  >  /etc/modprobe.d/rtl8723be.conf
exit

Reboot and tell us if the performance is improved.


GRUB menu doesn't show up after upgrading to Ubuntu 19.04

Probably the Ubuntu 19.04 installation has added its own EFI boot entry, configured to not show the grub menu.

Try this: edit the file /etc/default/grub to make sure the GRUB_TIMEOUT value there is set to something larger than zero, for example GRUB_TIMEOUT=12 if you want the menu shown for 12 seconds. Then run the update-grub command:

sudo update-grub

The output from the update-grub command should say "Found linux image" and if you have Windows 10 installed it should also say "Found Windows Boot Manager". Then reboot, and the grub menu should be shown.


SOLVED: Audio input not working, "...does not have capture controls" - new 18.04 install

Solved it with the USB Audio Adapter (examples) plus using a headset with a 3.5mm splitter.


Change ownership of a large group of files

Please do not change permissions of files installed by any application!

By design all applications will be installed by root in Ubuntu. This is one of the major security features we have to prevent our system from malware and accidental file removal.

Application binaries have their defined location in the filesystem as was specified in the DEBIAN package. For any Debian related distribution we have a Filesystem Hierarchy Standard to help maintaining the system. Applications must meed this standard to be included in a distribution.

Whenever an application needs user setting they will be stored in a separate directory on your HOME directory (ususally in a hidden dot file in ~/.config/<app_name>/, or ~/.appname/).

In the rare case we need to change system-wide application settings we need to do that with root privileges which can be reached by using sudo.

  Running the chown command recursively as root bears a great risk to break your system. If any possible avoid doing that.

See also related questions:

How to understand the Ubuntu file system layout?
Why is it bad to login as root?
What are the differences between sudo, su, visudo, chroot, and gksu?


ubuntu linux updates don't update to latest version, why?

Your Ubuntu 11.04 is a LTS version. It is supposed to work with older/more stable software. The 11.10 should be a more bleding edge distribution. It depends on your usage, but what you described is the expected behavior.

If you want to upgrade from one version to another, you should follow the instructions provided by the Ubuntu developers: http://www.ubuntu.com/download/ubuntu/upgrade


SD card and build in reader disappears when resuming from suspend on my Lenovo Yoga 3 Pro

I have found a solution, or workaround rather, for this problem. The card reader on this laptop is a USB3 device and as such prone to some problems under Linux. However, I have also found out that if I remove and start the card reader USB3 device in succession it's detected and mounted as normal. My finding is based on the information found here:

http://www.zedt.eu/tech/linux/restarting-usb-subsystem-centos/

So if I run a script containing the following:

#!/bin/sh

cd /sys/bus/pci/drivers/xhci_hcd
echo -n "0000:00:14.0" > unbind
echo -n "0000:00:14.0" > bind

the card reader is detected and the card mounted as normal. I found the device ID "0000:00:14.0" with "sudo lsusb -v".

What I have not been able to do is have this run every time the laptop resumes from suspend. I assume it has to be run from /etc/pm/sleep.d but I have not been able to write a working script. If someone could show how I can write a script that is run every time the laptop resumes containing the three lines of code it would be very helpful. Right now I simply run the script when I resume to get the SD card back.


Where are desktop enviroment texture packs found?

Ubuntu themes are available in the /usr/share/themes/ directory.

All default backgrounds are in /usr/share/backgrounds/.

However the boot splash screen is not part of the usual themes and managed by low-level components (plymouth) and unless you know what you're doing it's often discouraged to change the splash screen picture.


Terminal says "Interface doesn't support scanning"

You might be better off using nmcli instead of the method described in the answer you followed.
To list available wifi access points (aka routers ) in range:

nmcli dev wifi

To connect to a network for the first time, follow the example in the man nmcli:

nmcli dev wifi con "Cafe Hotspot 1" password caffeine name "My cafe"

To check if you are connected , use nmcli device status or nmcli dev list (14.04)  , or nmcli dev show for 15.04

If you already have a connection established, nmcli con list for 14.04 or nmcli con show for 15.04.

If you want to connect to one of those connections listed by nmcli con lsit, do nmcli con up id "My Network Name"


Still having problems with chmod on ntfs drive mounted in fstab (17.04)

I think Nautilus is using the label (not the fs-name). You can try to set the label.
The permissions and ownership of Microsoft file systems in linux are set when mounting and cannot be modified (except if you unmount and mount with new settings). These settings are inherited to directories and files.
I'm not sure (yet?) what is the problem with this item. But it works for me according to this link,
How do I use 'chmod' on an NTFS (or FAT32) partition?


Key combination for Acer erecovery doesn't work after installing ubuntu

If you can boot recovery mode from GRUB - do it from there.
Alt+F10 option uses modified MBR record, it's possible to get this option only in price of lost GRUB.

See more:

http://www.tomshardware.co.uk/forum/243980-32-acer-laptop-recovery-help


The error has no relate to what have you done before in your shortcut. Instead this may happen for the system and this message box to inform you whether you want to report the error to Canonical or not.

This is related to a daemon called apport which is responsible for sending those errors. If you want to get rid of this message for future you disable it.

sudo gedit /etc/default/apport/

Then change enabled value to 0 instead of 1. so the daemon will be disabled in later reboot.

Now you can also stop it for this session using service:

sudo service apport stop


How to I configure which Audio Hardware is being used by Pulse Audio, ALSA, and Jack Audio?

I don't know if my answer if going to help you.
I was also confused with ALSA, Jack, Pulse connection / configuration.

What I read, what I use and what I got is:

ALSA / JACK mainly works with only one sound card. So, JACK expects to carry sound from the input of one card, through processors / programs to the outputs of one card.
In this link you have a bit outdated manual for Ardour 3 where I got this information and how to configure the system to use more than one sound card: Ardour 3 manual
I am using ubuntu studio 14.04 at the moment.
I got confused with mixxx and videos played on firefox (vimeo, etc.) connections.
Supposedly you can run all audio through Pulse but I got all sound "jammed" somewhere in the system.
I solved it configuring (by order):
1) Mixxx to send audio to ALSA / Pulse (so running Mixxx before QjackCtl).
2) Opening QjacCtl (that automatically connects Pulse Jack sink).
3) Setting general audio output on Ubuntu to outputthrough: Pulse Jack Sink

I don't know if there is an easier way to accomplish this.


There is a bug in ubuntu (cannot find a medium containing a live file system)

As you said, the only thing that happens it's a messenge saying  "cannot find a medium containing a live file system"

Try search the answers at this link if you doesn't ;)
Error when installing: "unable to find a medium containing a live file system"

Sorry if I can't help more than this....


Ubuntu 16.04 freezes / hangs / lags when writing / downloading large files to disk

This is a well known issue called "The pernicious USB-stick stall problem" by LWN.
A suggested workaround is limiting the amount of dirty memory that is accumulated before writing to the device:
echo 0 | sudo tee /proc/sys/vm/dirty_background_bytes
echo 0 | sudo tee /proc/sys/vm/dirty_bytes


/tmp is cleaned on every system reboot, but for systems that cannot be rebooted often, and specially if the only objective is to clean /tmp a script can be made to clean it.

No process should keep important data there but it is important that you are able to clean /tmp without disrupting any processes writing data in tmp.

I recommend to use tmpreaper for that.

You can install it with sudo apt-get install tmpreaper.

From the man page:

  tmpreaper recursively searches for and removes files and empty directories which haven't been accessed for a given number of seconds.  Normally, it's used to clean up  directories which are used for temporary holding space, such as "/tmp".  Please read the WARNINGS section of this manual.

Usage normally involves invoking tmpreaper in /tmp with a time spec argument. The time spec argument can be anything from d for days, h for hours, m for minutes, or s for seconds.

Please use the --test to dry run and get an output of the results before you actually run the command. That will get you an idea of what will be deleted before you actually commit any changes to the file system.


Ubuntu 18.04 Unable to connect to specific / home WIFI / WLAN

So I was about to try various different solutions....

Before I did begin I saved my config - since I did not understand the solutions completely - and time is precious .. so:

cd /etc/
sudo git init .
sudo git add .
sudo git commit -a -m 'initial commit before experiments'

I checked this answer https://askubuntu.com/a/970718/230083 but my config matches already the solution.

Next I used this thread https://ubuntuforums.org/showthread.php?t=2363514

After the seps:

sudo apt-get update
sudo apt-get dist-upgrde
sudo apt-get autoremove
sudo apt-get autoclean

I did again a git status which showed only little changes:

modified:   fonts/conf.avail/64-language-selector-prefer.conf
modified:   fonts/conf.avail/69-language-selector-zh-hk.conf
modified:   ld.so.cache

Anyway I committet and tried connecting to the network again - and it worked !!

So I'm not sure how this got it fixed since I install updates whenever they appear in the tool "Software Update"


How to change background of nautilus in ubuntu 18.04

it should be eaiser to acheive with ~/.config/gtk-3.0/gtk.css but in my trail it is also changing and locking the desktop background.

So below is the workaround.

create the file gtk.css with below content

@import url("/usr/share/themes/Ambiance/gtk-3.20/gtk.css");
.nautilus-window { background-color: yellow; }

place this gtk.css file in the blow path.. create the directory's as necessary..
~/.themes/YELLOW/gtk-3.0/

choose this Application theme called YELLOW from gnome-tweaks or via command line..

logout and logback in may be necessary..

Edited Code:

@import url("/usr/share/themes/Ambiance/gtk-3.20/gtk.css");

.nautilus-window { background-color: yellow; }
.nautilus-window .view { background-color: purple; }


Try to execute a script (adduser.sh) in root /$

If your script is in /home/student/Scripts/ then start it from there.

cd /home/student/Scripts
./adduser.sh

Or with path

sh /home/student/Scripts/adduser.sh

I do not know what the script is. It probably will need sudo.


OpenVPN connecting but no internet access on Ubuntu 16.04 / 18.04

I'm using the gnome network manager with OpenVPN Network Manager plugin.

You can install it with:

sudo apt-get install network-manager-openvpn-gnome

My connection is working fine if I try directly with OpenVPN. But if I try using Network Manager, it works, but no internet access.

To fix this, edit the OpenVPN connection configuration on Network Manager and click in IPv4 Settings tab, then click in Routes button:

Then mark Use this connection only for resources on its network.

Click Ok, then Save and reconnect.


Ubuntu 18.04 and bluetooth speaker JBL Charge 3

The sound is distorted as long as the "bluetooth setting" windows is open and searching. Closing the windows clears the sound and stops the messages in the dmesg.

Blueman (alternative bluetooth manager) shows the same behavior while searching for devices, but the default bluetooth manager is constantly searching when open.

It would be interesting to discover if this affects only JBL speakers, and if it is a problem of some bluetooth controllers only (mine is a Intel 3165).


May be this can help:

Ctrl+F1 then login with your user
$ export DISPLAY=:0
$ sudo service lightdm restart
back to desktop: Ctrl+F7


where is my awstats 6.9.5~dfsg-5 installed?

Since you're using Synaptic there is a handy way to tell what files are installed and where.

Search for package in Synaptic
Right-click on package and select "Properties"

Click the "Installed Files" tab

That should help you figure out where your package has been installed to.


Ubuntu 14 LTS install via PXE using ks.cfg - No unity after install

A kickstart config which we used to apply had this at the end:

%packages
@ Ubuntu Desktop

This notation is for tasks and package groups, from what I can make of Where is a list of available package groups for kickstart?

So include a line like:

@ Ubuntu Desktop

or

@ ubuntu-desktop

in your kickstart file.


Help with script to make a directory, change directory, download a file, then back out of that directory

A very simple example that will help you is :
# OPTION 1
CURDIR=$( pwd )

# OPTION 2
CURDIR=$PWD

D1="XXXXXX"
D2="YYYYYY"

mkdir $D1
cd $D1

mkdir "foo_bar"
cd "foo_bar"

cd $CURDIR

mkdir $D2

3 things to know about this :
1.a) pwd is a command to display the current name of current folder
1.b) $(....) is a way to capture the output of command and transform into a string
1.c)  CURDIR is a arbitrary name i choose

$PWD is a variable usually populated  with the current dir


Unless /dev/sdb3 is actually mounted on /dev/sdb3 ( I doubt it, please research a bit on devices and mount points), you'd need to:

Find out where /dev/sdb3 is mounted. Use the mount command for this. Assume that /dev/sdb3 is mounted in /home.
Point your file writing to that place:

sudo dd if=/dev/sda6 of=/home/backup.img

Once done, verify the img file contains what you expect.

Also, is there any need to back up the entire partition? I usually find it easier and more useful to back up files using rsync or something similar, then if needed compressing the resulting backup directory. But this is really up to you.


How are USB ports related to the computer power, and why would they cause my computer to freeze?

One weird thing to check..... Look for your laptop model in Google to see if it usually has (no matter the OS) this problem. My desktop, for instance, freezes (although not always) when connecting USB devices because of.... some grounding problem with the MB and the front panel hub! In my case it's absolutely OS unrelated and the only workaround I've found is to "ground" my devices -and myself- prior to plugging them in. Nothing to lose in trying :).


Default cinnamon themes missing or not detected in Ubuntu 19.04

The Cinnamon package shipped in the Ubuntu 19.04 repositories is >= Cinnamon 3.8. This version of Cinnamon only supports window border themes which are metacity-3 compliant [1]. So, many of these window borders have gone away as they support metacity-1 or metacity-2; not metacity-3. A git repository has popped up adding metacity-3 compliance with simple instructions on reinstalling them [2].

  I'm specifically looking to use the Bluebird window borders

The Bluebird theme's upstream git repository has already been updated with metacity-3 compliance [3] but this change has not made its way into the Ubuntu package. I'm planning on sending a patch for the bluebird-gtk-theme Ubuntu package containing this fix.

  and the Blue Menta desktop theme.

This, and many of the other default Cinnamon themes I was referring to, can be installed with the mate-themes package.

[1] https://blog.linuxmint.com/?p=3557 Change log entry: "Titlebar themes are now restricted to metacity-3"

[2] https://github.com/smurphos/Window_Borders_Mint_19/

[3] https://github.com/shimmerproject/Bluebird/commit/12af472e008100153429c88eff8cd3d546b017e9


ID  Name                                   Description
0   Halt                                   Shuts down the system.
1   Single-user mode                       Mode for administrative tasks.
2   Multi-user mode                        Does not configure network interfaces and does not export networks services.
3   Multi-user mode with networking        Starts the system normally.
4   Not used/user-definable                For special purposes.
5   Start the system normally with         Same as runlevel 3 + display manager.
    appropriate display manager (with GUI)
6   Reboot                                 Reboots the system.

As you can see from the above each runlevel has what commands and programs run when started by user or any other process, as in the case of runlevel 1. Here only a single user can access the system and the commands here are barest at minimum, hence the comment that it freezes the system. Most commands you know in the 3-5 runlevel are not available here.

If you try entering this level from your current runlevel, you will see that a lot of things will not work and you most likely lose data in any open files or programs. Best tried on a virtual machine to see what it does.

Basically in Linux every runlevel is associated with certain programs or programs are associated with various runlevels. So entering that level with init 1 will kill all programs that are not designed or meant to be in that runlevel, hence the computer freeze mentioned by you.

Source: https://en.wikipedia.org/wiki/Runlevel


32-bit ARM support appears to have been or is being discontinued. All I can find currently are pre-installed server images for the Raspberry Pi, available here. As time goes by 32-bit options are disappearing. I recommend seeking out 64-bit alternatives. This old Q&A reflects some of the history of  this. Phoronix reported back in May of 2018 that armhf was proposed to be on the chopping block. If you are still running on 32-bit hardware you will find your options more and more limited as time goes by. There was a great deal of discussion topic on the developers mailing list under the topic Proposal: Let's drop i386. Desktop images such as you mention have already been dropped from development for 32-bit.


How to grep specific lines and print only those that match character

Use two greps:

grep '^FORMUL' *pdb | grep -vE 'C([3-9]|[12][0-9])'

The first lists the lines matching ^FORMUL, the second removes (-v inverts the match) those matching C followed by a digit between 3 and 9, or two digit numbers beginning with 1 or 2 (so every number from greater than 3 will be removed).


Is it possible to disable a CPU (not a core)?

Besides doing this in your BIOS grub has an option called maxcpus.

You can edit this option in when selecting your grub boot option by adding maxcpus=1 to the parameters. Random grub picture:

Choose 'e' and you get to a command line where you can add options.

You can also create permanent boot option in grub by making a copy of your current boot option and add maxcpus=1 to the boot parameters. You can name this 'Ubuntu, kernel 2.5.12-9-386 (1 cpu)' and have it amongst the other boot options like the picture shows.

You can verify running on 1 cpu by issuing:

cat /proc/cpuinfo   | grep processor this should show something like this:

processor    : 0
processor    : 1

And the 2nd line should disappear after booting with 1 CPU.


I don't have that myself, but it may be some slowness in gnome-shell or in evolution-data-server (trying to fill the calendar).
I'm pretty sure that this is a design decision. The idea is that the windows don't reshuffle too soon, because you may be in the process of closing several of them. Then it is really annoying when they move away from your cursor when you were already moving towards them.


Using external usb disk as extra partition

Take a look at this question:
http://ubuntuforums.org/showthread.php?t=1574068
There is a way to do what you ask for but not directly though.
  First you'll need to be on a Live USB session.
Now in your USB hardisk, create a Linux partition (ext4 is preferable) and copy the entire /usr directory from the flag drive to the usb drive.
After that you'll need to edit /etc/fstab to change the mount point of the existing/usr IN THE FLASH DRIVE to point it to the USB drive.

Edit:

Almost forgot, don't even think about un-mounting the hard drive once the process is done. It might be a disaster.

Edit2:

Procedure:

1) Place your Ubuntu Installation disc into the drive and boot to Live Session (Try Ubuntu).
2) Now, open the terminal (Ctrl+Alt+T) and run the below code and press Enter.

sudo passwd root

Type in a password for the root account (moving /usr directory is best using su rather than sudo as it might not turn out well and so, we defined a root password.

3) Now, connect the external hard disk and wait for it to show up. Backup any data on the drive as we will be FORMATTING it soon.

4) a) Next step is locating the root partition (/ partition). In the terminal, run su - and type in the root password you have set up in step 2.
   b) Type fdisk -l /dev/sda  where /dev/sda is the internal disk of the computer.
   c)  (i)   It will list out all the partitions of your hard drive. Here, use the trial and error method, we will determine the / partition.
       (ii)  Type mkdir temp in the terminal. This will create a directory called temp at /root/.
       (iii) Type mount /dev/sdax temp (where x is any linux partition you found in step 4.b
       (iv)  Type ls temp and see if you have lot of directories like bin, etc, usr, etc.
       (v) If yes, proceed to step 5 or type umount temp and go back to step 4.3 (increment the value of x this time).
Note: The umount command is important to free the temp folder we created for mounting the partitions

5) Since you have the found the root partition, it is time to create a Linux partition on the external harddrive. Install gparted from the commands:

apt-get update && apt-get install gparted -y

gparted is recommended to perform such delicate operations as there is a chance of ERASING THE WRONG PARTITION.

6) Open gparted by typing gparted on the terminal. You will see a window like this:
   Here, change the device to your external harddrive by using the drop down list on the top-right of gparted.
7) Click on each partition in the list (like /dev/sda1,/dev/sda2 etc.) and press the Delete key on the keyboard.
Repeat the step to delete all the partitions and goto Partition>New.
8) Select ext4 on "File System" drop-down list at the window.
9) Click on the green tick mark to confirm the actions and wait while the external harddisk is partitioned.
10) Now close gparted and open Nautilus and mount the newly created hard drive.
11) Now, on the terminal type 'mv /usr /dev/sdb1 --verbose (mostly the external harddrive WILL be /dev/sdb1 but make sure you are mounting the right one.)
12) Wait patiently until the directory is moved to the hard drive.
13) Now, we have to edit the mount points to add the new path of /usr directory.
14) Type sudo blkid > ids on the terminal to print the UUID of all the devices connected to Ubuntu. This step is mandatory as by default, UUID's are used by Ubuntu in /etc/fstab
15) Open the ids file we created in step 14 using gedit or Nautilus (your wish and copy the UUID part of the external harddrive)
16) Now, go to the previously opened terminal (or if it is busy or you closed it, open the terminal again and type su -c)
17) Type gedit /etc/fstab to open the fstab file and now add the /usr entry as:

<uuid-here> /usr            ext4    rw              0       1

and save the file.
18) Now, reboot the desktop. Don't unplug the USB HDD but take out the installation disc from the cd drive.

IF everything works out, you will see the Ubuntu login screen. Good luck!


Updated snes9x today, it crashes when I try to open a rom now

Unless you have very good reasons to choose Snes9x instead, I suggest using ZNES that works flawlessly on my machine (I have revision 1.51, USB joypad works fine).


Forget that its wireless for the moment, to any computer its just a printer on the network as such it should have an IP address (host address), you may be able to find it by using an ipscanner or it maybe you can drive the menu on the device itself to reveal its IP address. Enter the IP address into the host field.


Dropped my Dell dual boot Vista /Ubuntu 12.04 Vista will not boot, only Ubuntu

From dual boot Vista/Ubuntu experience be careful about how the dual installation is made. I would suggest making the second operating system installation as independent of the other operating system as possible. Make Ubuntu independent of Vista.


Remote desktop connection over Internet through VPN

When in a VPN you don't have to worry about other than the internal IPs or worry about port forwarding. Those concepts are fundamental for connecting from the outside of said network without a VPN.

  Previously (...) I could connect to the VPN (...) using the Windows Remote Desktop, enter the internal IP of my desktop, and get connected.

This means the desktop you want to remotely access is already set up for allowing such remote connections.

You can do the same with Remmina in Ubuntu. It is usually installed by default but if not it can be installed from the Ubuntu Software or using sudo apt install remmina. Just configure a new connection for the same IP and using the same protocol and settings as before. Having used the Windows app before you'll find Remmina quite familiar.


Can't get bonding and bridging to work for KVM

I ran into a similar problem a while back with Debian (4.something I think?) and it took me forever to realise the cisco catalyst switch's ports the NICs were plugged into didn't support the right configuration to allow this type of bonding. The bond0 would continuously cycle same as shown in your snippet. The version of IOS needed wasn't supported on that model Catalyst. Just something to check...


dd if=/dev/zero of=/dev/sdb bs=4M count=1

that should make /dev/sdb a very blank thing indeed. Assuming /dev/sdb is the flash drive. If not, you've just wiped something important.

Gparted should be able to partition it, though I believe it does have some bug in resizing partitions.


How to Fix error related to libicudata.so

libicudata.so.55 comes from the libicu55 package which is only available in the development version of Ubuntu, wily werewolf. You can get the .deb manually from here but it is not going to work because of the dependency problem. You will have to install those dependencies as well.

To remain on a stable release of Ubuntu (or any other debian system) while grabbing packages from a more recent version, you should use "Pinning" as described in the wiki.


unable to create usb stick for windows 7 from ubuntu 14.04

Try dd command.

The dd command copies a file, converting the format of the data in the process, according to the operands specified.

Operands:

if=FILE -- Read from file instead of stdin.

of=FILE -- Write to file instead of stdout

bs=BYTES -- Read and write bytes at a time.

count=BLOCKS -- Copy only input blocks.

sync -- Use synchronized I/O for metadata.

Example:

Open a terminal.

Run it:

sudo -i

fdisk -l  (Identify your usb-stick, suppose is /dev/sdb)

dd if=/path-to-your-iso/Win_7_64Bit.iso of=/dev/sdb bs=4M; sync

Note: Always clearly identify the usb-stick with fdisk -l command, improperly entering the wrong values could inadvertently overwrite the data on the hard drive.


How to install python2.7 in Ubuntu 16.04

Try to remove mongodb-compass with

sudo apt-get purge mongodb-compass

Then check that everything is in place with

sudo apt-get install -f
sudo apt-get check


Installation of Ubuntu 13.04 and Windows 7 on same partition

I dont't think you can do that. When you have issues partitioning you hard drive from within Windows, try the GParted Live CD. Simply boot from the CD and create partitions as you like.

With this, it is also possible to shrink your existing Windows partition, even if that is not possible from within Windows. In the newly created free space, you can set up a partition for Ubuntu. BTW, you should probably also create another partition for your data (documents, music, movies, ...) which can be used from both Windows and Ubuntu, and which is safe in case one of your system partitions needs to be formatted for, say, a reinstallation. (Windows needs a reinstall from time to time to be happy...)

The Ubuntu installer will take care of setting up a dual-boot configuration during installation, so you can choose which OS to start at boot time.


Problems with a HFS+ hdd on Ubuntu Server 14.04

Try adding hfsutils, hfsutils-tcltk, libhfsp-dev, and maybe tmfs will bring in some dependency that will help with your situation:

sudo apt-get install hfsutils hfsutils-tcltk libhfsp-dev tmfs


As the conflict seems to arise from the anaconda2 folder, I issued the following commands and it seems to be working now:

mv ~/anaconda2 ~/anaconda2_tmp
curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-luajit+torch | PREFIX=~/torch bash

And it appears to be working. Move the anaconda2 folder back after you are done.


Don't use plain sudo in scripts, run the whole script with root permissions instead and use sudo -u YOURUSERNAME to execute commands without root permissions if that's really necessary.

Write a script like this:

#!/bin/bash
npm start

Save it, make it executable with chmod +x /path/to/script and start it with root permissions with:

sudo /path/to/script    # from a terminal
gksudo /path/to/script  # without terminal (e.g. for a starter)
kdesudo /path/to/script # without terminal, KDE equivalent

That's all what it takes.

You may add further commands to the script, you could for example check whether it was started as root and exit else (thanks to PerlDuck):

[[ $EUID -ne 0 ]] && echo "This script must be run as root." && exit 1


How do I create an ISO (or similar) DVD of an Ubuntu setup on VirtualBox

The simplest way is to copy the cache packages (.deb files) in your virtual machine and install it in your physical machine.
To do this first remove all absolute packages from /var/cache/apt/archives in your virtual machine

sudo apt-get autoclean

and copy the .deb files to your physical system and do

cd <path to deb files>
sudo dpkg -i *.deb

this will install all the packages to your physical system


Hotkey for "Kde button" menu? And default shortcut-keys cheatsheets?

There's no hotkey by default, you can configure a hotkey though. Right-click the KDE launcher button and select "Application Launcher Settings". Then go the Keyboard Shortcut tab.

  I've found it surprisingly hard to find some basic hotkey cheatsheets for my shiny new install of Kubuntu... Anybody know of any?

In any application, you can go to Settings→Configure Shortcuts to view the shortcuts. To view global shortcuts, you can open the "Global Shortcuts" configuration module from System Settings.


Configuration tools for multiple monitors for X / Linux

I don't know if it still exists, but I have a application
called "ARandR" in the "system" section of 9.10 Netbook remix.
You could look for thr package arandr and eventually install it.


well, after further fiddling around with this issue i finally got everything back to work (meaning being able to connect to encrypted wifi-networks using nm-applet) but what led to the success is not entirely clear as i've tried several things some of which i am unaware of how to revert.

there seem to be four factors that (in some combination) lead to a solution for me:

changing the corresponding line in /etc/xdg/autostart/nm-applet.desktop to Exec=dbus-launch nm-applet as mentioned in my orig. question
disabling the application Network that is listed in the autostart-tab in the Default applications for LXsession dialogue (i had re-enabled this before after it did't seem to help when disabled alone earlier!) and manually adding the entry of nm-applet to autostarted applications-list instead
removing the plugin Indicator applets from the LXpanel (right-click on panel -> Add / Remove Panel Items)
i then killed the nm-applet process manually after a system-restart and started it manually via terminal. this led me to a dialogue that did never show up before asking me to setup a keyring (-> password). after doing so and further trying with running nm-applet through sudo i ended up restarting my system and afterwards i could eventually connect to wifi-networks (after entering my keyring-password).

i can't recall i've changed any settings that would require the explicit use of the password-protected keyring-storage but i'm thankful things are back to normal for me.

hope this may be of help for some folks who happen to stumble across the same issues...


Is there a way to reset sound settings : Xubuntu 14.04

All references to Applications in this answer refer to the applications menu item in the control panel.

Xfce - Audio Mixer
(See note below)
As Xubuntu uses Xfce desktop environment you could install Audio Mixer, xfce4-mixer, if it has been removed (optionally with --reinstall).
$ sudo apt-get install xfce4-mixer

and use the Audio Mixer found under

Applications -> Multimedia -> Audio Mixer

or:
$ xfce4-mixer

then tweak around.
Control panel
To add it to your control panel go to settings manager:

Applications -> Settings -> Settings Manager

Select Panels

or:

Applications -> Settings -> Panels

or:
$ xfce4-panel -p

Then select the Items tab and add (the [+] button) where you select Audio Mixer.
This is a very minimal audio controller. (Volume up/down - what else does one need?). To configure simply right-click the control-icon and select Properties, or select Run Audio Mixer if need be.
PA - pavucontrol
If you run Pulse Audio (Wikipedia) you could also use the PulseAudio Volume Control. Should be under Multimedia if installed, or start it from command line by:
$ pavucontrol

If not installed the package has the same name.
$ sudo apt-get install pavucontrol

This is the one I mainly use to adjust sound settings by GUI. (When not using JACK)
Note: Audio Mixer
As per Xfce 4.12 release notes:

“Due to gstreamer1.0 having dropped the mixer-interface entirely, and xfce4-mixer and xfce4-volumed relying on this interface with gstreamer0.10, our mixer application and volume daemon cannot be ported to 1.0 and are consequently not maintained anymore.”

As such I guess it would be best to rely on other controls such as pavucontrol in the future unless Xfce comes along with a new one.
But, it should work, and works fine here. I have both gstreamer 0.10  and 1.
Only to note that it could disappear in future releases.

Sub note:
After last update the audio settings was all re-configured as well as several others - such as keyboard tuning (I have for example a much lower repeat delaaaaaaaaaaaaaaay then default etc.)
Audio card was switched to HDMI (on monitor) instead of internal. Disabled audio such as input microphone was switched on etc.
Passed by here as I wondered if anyone else had similar issues.


Cannot mount USB drive with "wrong fs type, bad option, bad superblock" error message

The USB drive seems to be partitioned. Do not mount the device directly, but the partition /dev/sdb1 instead:

mount /dev/sdb1 /mnt


They are symbolic links to Linux kernels and initial RAM disks. They are normal in Ubuntu. You should leave them alone.


Gnome 3 - Multiple Video Cards - Xinerama -- Forced Fallback Mode

The issue from what I could make out was with Xorg itself. X.Org does NOT support composite extension when xinerama is enabled.
And all the new desktops like Unity,Gnome Shell etc. REQUIRE composite to work in the "full" feature mode. In my dual-monitor setup I could just use twinview and everything is fine with Unity and Gnome Shell since composite extension works with twinview.
However for anyone have 3+ monitors who NEEDS to use xinerama , I strongly reccomend using XFCE under xubuntu-desktop . XFCE has solid xinerama support and can work just fine without composite extension. Also , it supports something out of the box I haven't found in any other "new" shell - the ability to set wallpapers "per" monitor.


How to recover after Ubuntu freeze on boot after installing broadcom STA driver

I had the same problem, and was able to remove it by typing "sudo apt-get remove bcmwl-kernel-source"(remove the quotes)

Unfortunately, I don't know how to do this via busybox.


You need to move your Dropbox folder to a native Linux Filesystem such as an EXT4 partition for Dropbox syncing to work. You can check which filesystem is in use in each partition by running Disks.

The move can be achieved as follows:

Click the Dropbox icon in the system tray or menu bar.
Click Preferences
Click Sync
Click Move…

Select the new location for your Dropbox folder.
Let Dropbox move your folder and its contents to the new location.

You may need to type a definitive path to the new location in Directory: dependant on where the mount point is for the intended new location rather than just use the Look in: drop down. The Choose button will only become highlighted when you have selected a valid directory.

It goes without saying that you need to select a valid mount point and directory structure present on your own system rather than just copy what is shown in the graphic.

Extract from Dropbox Help Center


Installation of Ubuntu 12.04 terminates every time

you have to follow the instructions you find at the following link:
https://help.ubuntu.com/community/WindowsDualBoot


After upgrading from Ubuntu 16.04 to 18.04 internet no longer connects

First, I would suggest you reboot your modem and see what that effect has.  Leave it disconnected from power for a full half minute.
Secondly, you can ensure that you have networking enabled, and if that does nothing, try disabling your wired connection,(usually named "1") Then re-enable it.
You might also next try deleting the wired connection and then recreating a new one.
Did you enable your firewall?  GUFW.  Ensure you have outgoing connections allowed.


Elegant way of copying list of directories to target directory

Using -t

beet ls -ap added:2016-01 | xargs cp -R -t /target/directory

From man cp

-t, --target-directory=DIRECTORY
    copy all SOURCE arguments into DIRECTORY


If you want to disable to the GUI shutdown/reboot options, use Polkit policies. Create a .pkla file in /etc/polkit-1/localauthority/50-local.d (say 00-disable-shutdown.pkla) containing:

[Disable Shutdown, etc.]
Identity=unix-user:*
Action=org.freedesktop.login1.reboot;org.freedesktop.login1.reboot-multiple-sessions;org.freedesktop.login1.power-off;org.freedesktop.login1.power-off-multiple-sessions;org.freedesktop.login1.suspend;org.freedesktop.login1.suspend-multiple-sessions;org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions
ResultAny=no
ResultInactive=no
ResultActive=no

You can add further sections which allow specific users or groups to use the buttons, or you can instead use unix-user:guest-* to specifically restrict guest users (whose names are usually guest- followed by a random string).

The button will still be present, but a shutdown/reboot option won't be:

See this bug.


Moving files to /dev/shm ramdisk doesn't increase RAM usage?

Don't use /dev/shm, that's for a special purpose.

Instead, do something like this if you want to experiment:

sudo mkdir /ram
sudo mount -t tmpfs none /ram

Files stored in tmpfs are stored in either ram or (if there's too much memory pressure) in swap.

I don't know why you don't see an increase.  Please post the actual commands you used, plus the output of the free -m shell command before and after.

You might like to read this post about understanding free memory in Linux too.

The memory will be used to cache the files from disk, so it is actually in a sense helping, assuming your load has a multi-GB working set of files.  However, even heavily cached files do do some hard IO, and a ramdisk can be faster.


Yes it is possible to extend Xubuntu remix to take the whole disk. Dont forget to backup your data before starting..

Resize and extend partitions

First boot into a live ubuntu, unmount all the partitions
using gparted delete the partation containing xubuntu (in your case sda6,sda5,and sda2)
now right click in the partition containing xubuntu remix(sda1) and select resize/move
then drag the end of partition to take all the space

Install grub

sudo grub-install /dev/XXX(sda)

where XXX is the disk where xubuntu remix is installed (eg. sda,sdb...etc)

Or use sudo update-grub


Ubuntu 14.04 Virtualbox Guest USB Drive Mounting Works For Some Devices but Not Others

I'm not entirely sure about why Ubuntu would see one USB versus another other than perhaps file system type or limitations in the guest addition USB handlers.

The solution I use is to mount the USB drive (or partition) as an OSX volume and then access it from Ubuntu via VirtualBox. In other words, a bit roundabout compared to mounting the USB drive directly in Ubuntu. But this approach has an  additional benefits - both OSX and Ubuntu can see the same drive and can use it for easily sharing data between host and guest.

If using the USB partition frequently in Ubuntu and in OSX then should make the partition case-sensitive. An optional bonus is encrypting the partition if you're into that sort of thing.

Steps:

OSX: Mount the partition normally in Finder.
           OSX typically automounts a USB drive to /Volumes ... Example: /Volumes/MyUsbPartition.
           See also: http://osxdaily.com/2013/05/13/mount-unmount-drives-from-the-command-line-in-mac-os-x/
OSX: Share that volume via VirtualBox Manager
    Open VirtualBox
    Add '/Volumes/MyUsbPartition' as a ShareFolder (with full access).
        I enable "Auto Mount" and "Make Permanent" but if only mounting it termporarily, don't make it permanent.
            This means the "shared folder" will appear automatically in Ubuntu as /media/sf_MyUsbOsxPartition (permissions: user:root, group:vboxsf).
        NOTE: Requires "Guest Extensions". See selected answer for http://askubuntu.com/questions/22743/how-do-i-install-guest-additions-in-a-virtualbox-vm
            Summary: Ubuntu APT install  virtualbox-guest-additions-iso (places ISO in /usr/share/virtualbox).
            Mount this as a CD (sudo mount /usr/share/virtualbox/VBoxGuestAdditions.iso /mnt)
            Run the install (./VBoxLinuxAdditions.run)
Ubuntu:
    Login as your normal user (example: "MySelf")
    Add user to the vboxsf group (usermod -aG vboxsf MySelf; # Or edit /etc/groups directly)
        Only need to do this once since will remain for future cases

At this point the drive can be accessed directly from either OSX or Ubuntu.

The downside is the extra step to add it as a shared folder in VirtualBox. This isn't generally a severe drawback in my use case but your mileage may vary.


Dual boot Windows 7 or 10 alongside Ubuntu

This is defiantly possible!

You have to have a spare partition or drive for Windows to install on in the first place.

The tricky part is that Windows as you stated does not "like" to be installed alongside Ubuntu. The problem is that when installing Windows aside a Ubuntu system it will override Grub with the Windows boot loader, which makes Ubuntu inaccessible.

See this question for more infos on how to install Windows after Ubuntu: How can I install Windows after I've installed Ubuntu?


Zesty DNS resolution no longer accepts search domain setting from DHCP

I have U17.04 zesty and my IP is static.  This network does not have a DHCP server or IP Helper to a DHCP server, and Ubuntu's Global DNS Servers are Googles public 8.8.8.8 and 8.8.4.4.  The /etc/systemd/resolved.conf file indicates these are the #FallbackDNS settings.  I was able to change mine to a local DNS server, remove the #, and reboot and resolve my local hostnames (that are not on this broadcast domain).

Also my systemd-resolve --status indicates the MulticastDNS setting is disabled and LLMNR/IPv4 and LLMNR/IPv6 LLMNR settings are enabled so you and I have slightly different situations (static vs dynamic IP) yet the apparently opposite systemd-resolve defaults.  You could modify your /etc/systemd/resolved.conf file to enable LLMNR.  Following which, Man for systemd-resolve indicates that by default the lookup is done via all protocols suitable for the lookup.

Hey thanks for posting "As we all know, Zesty's name resolution changed from dnsmasq (via NetworkManager) to systemd-resolved."  This helped me.


Why doesn't Ubuntu 16.04 in Windows have ubuntu.exe?

Why doesn't Ubuntu 16.04 have ubuntu.exe inside the iso?

Wubi is no longer supported and was only meant to be used for testing, not for permanent use.

At this time, Wubi does not work with the Windows 8 or Windows 10 default bootloader. Thus at this point Wubi would not work on a new Windows 8/10 machine. An alternative way of installing Ubuntu in Windows 10 is with Windows Subsystem for Linux 2 which features a true Linux kernel. You would be able to install, but not reboot into Ubuntu.Wubi Guide

An important reason for including Wubi in the Ubuntu installation media has disappeared. Now that most computers have ample disk space, it is not so important to give Windows users a way of installing Ubuntu within the existing Windows partition without making an extra partition.

The default repositories in all currently supported versions of Ubuntu have an alternate package for testing the Ubuntu iso called Test Drive. However Test Drive only runs from Ubuntu and runs the test iso in a virtual machine.


Is there a command that will list all files I modified this year?

If you want to find files, the find command is a powerful tool. You can look through a directory and print out the paths of all files that match some tests:

# find all files in /some/directory whose name starts with 'project_b'
find /some/directory -iname 'project_b*'

# find all files in /some/directory which are owned by user 'joe'
find /some/directory -user joe

# find all files in /some/directory whose name starts with 'project_b'
# but which are *not* owned by user 'joe'
find /some/directory -iname 'project_b*' -and -not -user joe

To get the date of the last modification of a file (or more precise, the last modification of a file's content), you can check for the mtime timestamp. find has a test for mtime:

# find all files, whose mtime is less than 365 days back
find /some/directory -mtime -365

That so far gives you a list of all files you want to backup. Now for the backup itself. find brings an option called -exec that applies a command to every file it finds:

find /some/directory -iname '*.txt' -exec cp {} /somewhere/else \;

If the find command finds test.txt, other.txt and something.txt, the -exec part would execute:

cp test.txt /somewhere/else
cp other.txt /somehwere/else
cp something.txt /somewhere/else

As you probably can see, the {} is replaced with the file in question.

EDIT: You probably need to find a better solution than just cp for the backup itself, because cp would just copy every file to /somewhere/else without keeping the directory structure.

Overall, a dedicated backup program might be a better choice.


Ubuntu 19.10 KWorker bug. Want to ditch Linux and reinstall Windows10 please help

I found a solution. This took me a long time, jakeday is very outdated. Anyone reading this should not use his repo. It won't work. Look for the surface-linux subreddit and you will find a github repo to a different kernel named surface-linux.

Follow the directions there and DO NOT create a secure boot. Holding down a combination of keys to get you to the UEFI boot menu, and continue from there. You will see a way to redirect your kernel to point at the appropriate one you require.

DM me if you need help. This is a fairly complicated process. My discord is gsand#8300


Google Hangouts Video Call: extrem jitter

Sorry, this was not related to google hangout video call.

There was a custom service restarting over and over again consuming a lot of resources on the laptop.

This was not noticable until the video call started.

After disabling the service the video calls work perfectly even with Chromium. I have not tried google chrome, since the issue is resolved now.


Replace text before a specific word in Geany?

You can use the cut command in the terminal and write the output to another file which can be used. This will preserve your original file as is.

In your case specifically I see that the ID is 20 characters long, counting the characters till name it comes out to be 28.

Go to the terminal and use the following command in the directory where your json file is located :
cut -c29- filename.json > newfilename.json

This will remove first 28 characters from each line in the file, which should leave you with the desired result. For clarity, -c29- is not a mistake - the 29th character is excluded.

Hope this helps.


You can alternatively add a shebang at the start of your Python script and mark the script executable, which will cause it to run correctly when executed normally.

Add this line to the top of the script:

#!/usr/bin/env python

Note that due to difference between Python 2.x and 3, usually that will default to Python 2.7, so use this if you want Python 3:

#!/usr/bin/env python3

Then make it executable.  This tells the shell/GUI that this is a program that can be executed.

chmod a+x <name of script>

Then you can run it without putting "python " in front - either by just typing <name of script> at the prompt or double-clicking or whatever in the GUI.

Whether you do this or not is a matter of taste, you may prefer to invoke them with python <name of script> or by this method.


I Need Help To Install Wine, Synaptic, And Samsung SCX-340SW Driver

So, spelling is important here.

First open a terminal window (press ctrl+alt+t)

To install Synaptic package manager, enter the command

sudo apt-get install synaptic

To install vine, goto te website http://bitblaze.cs.berkeley.edu/release/vine-1.0/howto.html to learn about how to download, compile and install that version of linux.

If, on the otherhand, you are trying to install Wine, use the command

sudo apt-get install wine

The samsung printer is not mentioned at http://www.openprinting.org/printers, so support for that particular printer may be difficult.


Why does installation of Unity Tweak Tool fail with Ubuntu 19.10?

You are not using Unity, so don't install Unity Tweak Tool as it's for the Unity desktop.

From the screenshot I can see that you're using the GNOME desktop. In this case if you want to tweak some desktop settings you'll want to install GNOME Tweaks:

sudo apt install gnome-tweaks


How to roll back intel microcode update on Ubuntu 18.04

You need any System with internet access. Direkt download link intel-microcode_3.20180312.0~ubuntu18.04.1_amd64.deb 64-bit

or for 32-bit intel-microcode_3.20180312.0~ubuntu18.04.1_i386.deb

Save the file to an usb-stick. boot your bionic in recovery-mode. Make sure /-partition in mount rw. mount -o remount,rw / mount the usb-stick and install the package directly with dpkg


You can write an awk script in the same way that you write a shell script, using a shebang to tell the system to interpret it using awk
Ex. create file.awk with the following contents
#!/usr/bin/awk -f

/chevy/

(which executes the default action {print} for records matching /chevy/); make it executable
chmod +x file.awk

then run it as
./file.awk cars


In case someone has multiple keyboard layouts - this solution worked for me.

I have two keyboard layouts: English (us) and Ukrainian (uk). The first one was set as default in system settings. However, in Wine games the letter keys (q,w,e,r,t,y,etc.) didn't work at all.

Based on Alex's answer, I found the way to determine my current X keyboard layout settings:

setxkbmap -v

It showed me the following:

Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete+numpad(microsoft)
compat:     complete
symbols:    pc+ua+us:2+inet(evdev)+group(alt_shift_toggle)
geometry:   pc(pc101)

I noticed that the symbols line has ua (not us) on the first place. Assuming that Wine always uses the first specified layout, I just needed to change the layout precedence:

setxkbmap us,ua

And it worked. However, after reboot it was reset back to its default state. Thus, I have to do it each time after boot. I'll try to find a way to store those settings by default.


Boot to command line 12.04 (grub options not working)

Change the line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash text"

then update grub:

sudo update-grub and reboot.


It was much easier than I thought. I just had to search for "Printers" in the Ubuntu dash, clicked "Add", searched for network printers, clicked on mine, and voila. That's pretty much it.

Then I just used the following command and everything worked great:

lp -d PRINTER_NAME PDF_FILES


Can't correctly compare two text files using 'cmp'

If you run cmp without the -s option, it'll explain why it thinks the files are different.

From your code posted in your comments, Here's what your files look like with a hex editor:

res_op_file is 12 bytes long and ends with a \n (0a):

0000000: 4865 6c6c 6f20 576f 726c 640a            Hello World.

op_file is 11 bytes long and doesn't have the \n:

0000000: 4865 6c6c 6f20 576f 726c 64              Hello World

diff has the -Z option, "--ignore-trailing-space" which will ignore any whitespace at the end of a line. If you don't care about diff's output, just put > /dev/null to the end of the command, like:

if diff -Z file1 file2 > /dev/null
 then
echo "Accepted"
 else
echo "Wrong Answer"
fi


Cannot find Windows 8 option in GRUB menu after installing 13.04

You will need to manually put the entry back into your grub file.  Edit /boot/grub/grub.cfg

In fact, Ubuntu has a nasty habit of changing your grub.cfg even for a minor header update to your existing kernel.  Though minor updates do not cause you to lose boot partition info (as apparently happened with your update to 13.X), the updates still change your default boot kernel, without asking or presenting an option to keep the grub.cfg the way it is/was.

For instance, I have a custom network driver, and I always end up with a networkless PC if I take the default grub config after a kernel header update.

Thus, be sure to SAVE your grub.cfg somewhere outside of the /boot partition. If you accept the kernel header updates, you can restore your grub.cfg to as it was before the updates, if you saved a copy of it somewhere beforehand.


How to search previous terminal commands like on a Mac? (alt. to CTRL+R)

Open the $HOME/.inputrc file in a text editor (e.g. gedit ~/.inputrc) and add these two lines:
"\e[A": history-search-backward
"\e[B": history-search-forward

Now, save and close the file and open a new terminal. You know how pressing the up arrow key cycles through the command history? Now with these lines, if you start typing and then press the up arrow key, only commands that started with what you've typed will be shown. Typing ping and then pressing the up arrow key again will show the next to last ping command, and it goes back to the preceding ping command each time you press the up arrow key again. This makes it very easy to find the specific commands you were after.
Example

Type sudo.
sudo

Press the up arrow key to autocomplete sudo to the last command that started with sudo.
sudo apt update && sudo apt upgrade

Please note that for commands that start with sudo you will be asked to authenticate with your user password as usual before the command can be executed.


Citing man tail:

  use -c +NUM to output starting with byte NUM of each file

Citing man head:

  -c (…) [-]NUM
  with the leading '-', print all but the last NUM bytes of each file(…)

The logic with

tail -c +1

is to print all from byte number 1, i.e. the first byte, while with

head -c -1

it’s to print all but the last 1 byte.


When installing 18.04 alongside Windows 10, Grub is booted

When you get the grub boot menu, there will be 2 options for booting from usb.
One is legacy boot and one is uefi.
Boot the uefi one.I had the same problem.
This helped me.


You can stop the running unity desktop with:

adb shell
su - phablet
stop unity8

Now you can start up whatever you want, as long as it runs with Mir. Everything supporting Qt5 shouldn't be a problem at this point and other toolkits will be supported in the future.


Get command coloured output in a variable

Add double quotes around your commands:

res="$(script -q /dev/null mocha $(find "tests/non-ui" -name "*.js"))"

echo "$res"

This will preserve the ANSI colors.


How to find a string(pattern) in all type of folders(no archives) from the current directory

You shouldn't need a shell loop here: grep has a -r option for recursive search and a -l option to print the names of files with matches.

I would probably add -I as well, to exclude binary files from the search. So

grep -Irl "$1" . > test.txt

(. standing for the current directory; change this to whatever directory you wish to start the search from).


Freeze/lag issues with Minecraft on 12.10

Try using Oracle instead of JDK?

In console,

sudo apt-get purge openjdk*

removes openjdk

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

installs oracle


I found out the issue.

I tried boot-repair but it threw

GPT detected. Please create a BIOS-Boot partition

I searched again and read through a lot. Every discussion eventually ended up with Legacy / UEFI boot methods.

Finally, I saw that under the BIOS setting  - under Boot Menu - UEFI Boot option was disabled. I enabled it again and it went through


Shorcut to insert bullet point • into text in Linux (Ubuntu 18.04LTS)

One way is to define a compose key. Then you can do:

Compose followed by . followed by = => •

This page lists characters you can type in Gtk using a compose key:

https://help.ubuntu.com/community/GtkComposeTable


sometimes some isp's will throttle your bittorrent traffic.  some isps can be tricked by forcing your bittorrent traffic to another port and encrypting it.

what i do is force encryption and use the openvpn port tcp/1194 for my communications.  this seems to work for some places.


How to mimic the "Install Ubuntu" application inside a full installation of Ubuntu 14.04 LTS?

As it turns out it's as easy as:

sudo apt-get install ubiquity ubiquity-frontend-gtk

Then ubiquity gtk_ui will bring up the exact same installer as the one from the Live USB.

Or alternatively you can copy the ubiquity.desktop file from the desktop of the Live USB if you want a nice GUI way of launching the installer.


Bleachbit 1.6 fails at "Running deep scan"

This traceback shows an error checking for updates that could be caused by a firewall, proxy, or being offline.

As far as the freeze, do you have any special file systems mounted under your ~ folder?  This includes gvfs, which may mount remote SSH, WebDAV,SMB, etc.

Also for the freeze, you should confirm it is the deep scan by right clicking on one deep scan option (in the left navigation) and choosing preview.

Report any BleachBit bugs here: http://bleachbit.sourceforge.net/help


Solution

Remove Everything you've done if you have the Professional Edition,
Read the Creating Flask Project help file
Add the bootstrap extension

No need to use npm unless you're using the Community or Educational version.  If you've already followed the steps I outlined above, please update your question with your PyCharm version, and your error log.


How can I change file types of multiple files at once?

I am assuming:

you just want to insert 0 after the . in all the filenames
A represents whatever is before the . and it is the same every time and has no special characters (for example, there is only one .)

If this is true it is very easy to replace A. with A.0 in all the file names.

(However, you should definitely do what steeldriver says, as there's no doubt it's an entirely superior method)

Make sure you are in the directory where the files are (open a terminal and cd to the right directory, or navigate to it in Nautilus and then right click and select "open in terminal") by doing ls - you should see the files you want to rename. You can use a for loop

for f in A*; do mv "$f" "${f/A./A.0}"; done

Or even easier, use rename

rename 's/A\./A.0/' A*


Boot with the USB, opened a terminal window and run

sudo grub-install /dev/sda && sudo update-grub

It seems that Ubuntu Studio has a bug that installs GRUB onto the USB key and not the hard drive. The command installs GRUB on the MBR of the hard disk, making it bootable.

Apologies for the duplicate of Ubuntu 12.04 boot only when USB drive is connected, only found it after.


Is it recommended to back up my files before dual boot with ubuntu?

You should always back up any personal files from your operating system to an external hard drive or USB. This is a really good habit to have because it can save you from otherwise devastating issues while installing another operating system. It's extremely risky to leave personal files only on the computer that you're modifying. This goes for any time you modify a computer on a level of partitioning and operating systems. Hope this helps to guide you to perform a successful dual-boot.


How to make geany or vi understand Maxima (or any other less known) syntax

I found a syntax highlighting file for gedit at this link:
https://www.ma.utexas.edu/pipermail/maxima/2013/031644.html
https://www.dropbox.com/s/thoibnymcigd457/maxima.lang

(Place maxima.lang into /usr/share/gtksourceview-3.0/language-specs/ for
gedit3 or /usr/share/gtksourceview-2.0/language-specs/ for gedit2).

I have not tried this myself, but I saw it is indeed a text highlighting file for gedit and it should work.

edit: just for completeness, here http://www.vim.org/scripts/script.php?script_id=398 is one for vi, even though it seems quite old.


Newer Windows has a separate Boot partition with these files.
Vista/7/8/10 BIOS (with 7, 8 or 10 the first two files are usually in a separate 100MB boot partition)

/bootmgr /Boot/BCD /Windows/System32/winload.exe

You are missing the first two boot files which normally are in Windows boot partition. Was the Windows Boot partition on the now Ubuntu drive?
Windows puts Boot partition on drive set as default in BIOS and installs files into partition with boot flag.

You do not have to have separate Boot partition. But need to make sure BIOS is set to boot Windows drive first, that boot flag is on NTFS partition and then run the full set of Windows repairs. That should restore bootmgr & BCD.

Grub does not use boot flag to know Windows partition to chainload into, but looks for the first two boot files. So after update on Windows drive, you should be able to boot Ubuntu drive from BIOS and run sudo update-grub to add Windows to Boot menu.

You want to keep Windows boot manager on sda Windows drive. Grub only boots working Windows. So when Windows breaks & needs chkdsk or if it turns fast start up back on, then from BIOS you may be able to directly boot it, and  use f8 for internal repair console.

But best to have current repair disk or live installer for every operating system you have installed. And good backups.


Aptoncd not reflecting all applications installed in 12.04

aptoncd uses apt cache for backuping the programs . When you run apt-get clean all . Cache is cleared . So you should download packages


Rhythmbox won't import or play flac files

Please give us the output of dpkg --get-selections | grep -i flac so we can see whether you've got the correct libraries installed or not.

For reference, I'm running Ubuntu Precise, and I have:

me~banshee:~$ dpkg --get-selections | grep flac
flac                            install
libflac8                        install
libflac8:i386                   install

... and Rhythmbox plays flac fine for me.


nvme ssd, doesn't show up upon installing

So with some help I was able to figure out the answer. Basically my SSD turns into some sort of power saving monde so you have to add nvme_core.default_ps_max_latency_us=200 to GRUB and that's it.


Where is dnsmasq started and configured?

The dnsmasq startup script is /etc/init.d/dnsmasq.  It's called by symlinks from the /etc/rcX.d/ directories, for example: /etc/rc2.d/S15dnsmasq

If you don't want it to start, you can remove the package with sudo apt-get remove dnsmasq.  Or you can leave it installed and just remove all symlinks from the /etc/rcX.d/ directories with the command: update-rc.d -f dnsmasq remove.

You can also edit /etc/default/dnsmasq and change "ENABLED=1" to "ENABLED=0" which will also tell it not to run in daemon mode.

Lastly, you can disable just the DHCP function by editing /etc/dnsmasq.conf and adding lines for your interfaces that you don't want DHCP on by adding, for example: "no-dhcp-interface=eth0".  You might do this if you still wanted to use the DNS functionality.

Note:  sometimes dnsmasq is installed as dnsmasq-base instead of dnsmasq in order to work with other packages such as NetworkManager (when sharing an internet connection) or Libvirt (for giving addresses to virtual machines).


Does not boot after installation on Dell Precision T3500

Passing the following parameters to the kernel on the 'linux' line solved the problem:

pci=noacpi,nocrs acpi=off pcie_aspm=off

For good measure I also removed these items from the 'linux' line:

quiet
splash
vt.handoff=7

I also changed the 'gfxpayload' to 'text'.  This allowed me to actually see what was going on at boot.


What is the difference between fglrx* and fglrx?

The * is a "wildcard" character, it basically means "any number of characters".

For example, let's say you have three packages/programs installed called fglrx and fgrlx-updates, and fglrx-amdcccle. If you only want to remove fglrx, you will use apt-get remove fglrx. If you want to remove all three of them, you'll have to do apt-get remove fglrx fglrx-updates fglrx-amdcccle. However, an easier way would be to do apt-get remove fglrx*, which means remove all packages that start with fglrx.

In the steps of the link you provided, the person mentioned sudo apt-get --purge remove fglrx*. This is to ensure that you remove all packages related to fglrx, so you can start all over and install only the needed packages. So to answer your question, yes, that command removed your ATI graphics drivers, and made Ubuntu use the open source drivers, that's why the quality of the desktop environment changed.

I suggest you now run the command sudo apt-get --purge remove fglrx*, then sudo apt-get autoremove, then restart, then use the Additional Drivers to install, then reboot.


GIMP 2.8 doesn't allow to save usual image file formats (jpg, png) via Save dialog

I remember reading on heise (german) that someone wrote a plugin to revert back to the old functionality.

Runnning the following commands in a terminal will download the latest version of the plugin to Gimp 2.8's config directory and make it executable:

gimp_dir=".gimp-2.8"
wget https://github.com/akkana/gimp-plugins/raw/master/save-export-clean.py -O ~/${gimp_dir}/plug-ins/save-export-clean.py
chmod a+x ~/${gimp_dir}/plug-ins/save-export-clean.py

But I have to say that it's not a big deal learning the new shortcut Ctrl+E. Also having a clean distinction between destructive export and save is actually a good thing.


For your first question, you have a few options. First, you can open a new instance of any application by middle clicking. It will open in a new workspace, and once you close it you'll land back where you were.

If you install the application called gnome-contacts, you can search for your contacts from the overview. (Unfortunately, gnome-contacts doesn't sort by status at the moment, so that isn't ideal).

For your second question, you can get Empathy to always open chats in new windows. Open Empathy, go to Edit›Preferences in the menu and uncheck “Display incoming events in the notification area.” It's a little counter-intuitive, but what that does is your new messages will still appear in the message tray but their corresponding windows will open immediately.


Firefox can export passwords to a CSV file.
I am not sure how to import from CSV to Seahorse. It expects some kind of XML, but I have no idea where to find its specification. In any case, it would require writing some script to convert from CSV to XML.
The other option would be to put together a keyring manually, based on keyring specifications (well known but complicated) then open it in Seahorse and give it a (master) password.
All painfully complicated solutions, to be sure.
The trouble is, once those passwords are in Seahorse/Gnome Keyring, they will not be accessible to Firefox AFAIK. That's why I use Keepass, and ignore Seahorse.
Maybe someone will one day write a Firefox-accessible password manager that uses keyrings for storage, but I couldn't find one yet.
And the idea of allowing Firefox to use keyring passwords directly is a "won't fix"


I deleted the Libvirt user, and now virt-manager throws `Unable to connect to libvirt qemu:///system.`

You need to reconfigure LibVirt package to run post installation script:

For Ubuntu 16.04 LTS you need to run:

sudo dpkg-reconfigure libvirt-bin

For Ubuntu 18.04 LTS you need to run:

sudo dpkg-reconfigure libvirtd-daemon-system


Try clearing the thumbnail cache by typing this in the terminal:

sudo rm -r $HOME/.thumbnails/fail
sudo rm -r $HOME/.thumbnails/normal

Close any Nautilus window and now check your video series.


Another way to install Brackets without having to physically install libcrypt11 is to get the latest fixed .deb Brackets files for 64 bit and 32 bit systems here.


This options are available in GNOME Tweaks (gnome-tweak-tool package).

You can use search in GNOME Tweaks, or navigate to Keyboard & Mouse and set Compose Key here.