How to check if dependencies of an app installed via software manager are removed?

The graphical software store does not have a feature to remove unneeded dependencies, I'm afraid.
For applications which were deb format and thus installed under the covers using apt / apt-get then you can issue the following command to remove unneeded dependencies:
sudo apt autoremove

If the application you removed was a snap, then the dependencies are mostly bundled with the application and get removed with it. However there are some additional snaps that get pulled in by the snap, which may or may not be used by other snaps on your system. In the case of the keepassxc snap (at the time of writing) it uses a core18 base snap, and gtk-common-themes shared content snap. It's possible to remove these if they're not in use by other snaps with the following command:
snap remove gtk-common-themes

You likely have other snaps using the core18 base snap though, so it's probably not possible or desirable to remove it.


Try to type :

sudo shutdown -h now

The -h option is for halt which means to stop.

For more info : 5 Linux commands to shutdown and reboot the system


I had exactly the same problem (although using Xubuntu 12.04).
What helped in my case was removing the keyboard-layout switch applet from my panel.
Somehow this applet periodically sets the keyboard layout thus overriding anything that is set via xmodmap.


Try installing the Proprietary Drivers for AMD.

Search for "Jockey" in the Dash, then click Additional Drivers.  Find the one that says "AMD" in the title.

Click Activate.  It should work.


Unable to install Apache in Ubuntu 12.04

The output above shows that you have already installed apache - a line near the top says:

apache2 is already the newest version.

So apache is already installed, you don't need to do anything else.

The rest of the output is apt trying to finish installing another package:

Setting up crossplatformui (1.0.27) ...

This is hitting a problem, and it would be good to clear up this mess. Your options are:

remove crossplatformui - sudo apt-get remove crossplatformui
install the dependencies that it needs to compile

It is failing to compile because:

... fatal error: linux/smp_lock.h: No such file or directory

and a quick search for ubuntu linux/smp_lock.h brings up this answer which suggests you need to edit the source of crossplatformui and change linux/smp_lock.h to linux/smp.h

You should also ensure you have the build-essential package installed, though as you already have a compiler you probably do already.


Unity is not what is started on boot. What you're looking at on boot is lightdm.

The reason you see neither of those is because Ubuntu uses a combination of Upstart and sysvinit to start services on boot. The rcX.d directories are only for things that have not been migrated to Upstart.

Lightdm is started on a bunch of hardware events by Upstart. This is done so that it can start as soon as possible and own the "console" as it shifts from the boot console (plymouth) to lightdm. This also means it can start interacting with the user while other system services are still starting. You can see how it starts up in /etc/init/lightdm.conf.

Upstart still uses runlevel, so you can look for things like start on runlevel [2345] and stop on runlevel [016] in /etc/init/* to find things to play with to test out other run levels.


Is it possible to restore config files overwritten by an upgrade?

It normally saves them with a suffix of .dpkg-old and/or .ucf-old, e.g.
$ sudo find /etc -type f -name '*.dpkg*'
/etc/update-manager/release-upgrades.dpkg-old
/etc/default/motd-news.dpkg-bak
/etc/ca-certificates.conf.dpkg-old

The correct answer however is, "restore from your backups".


It may be something like thermald that is injecting the powerclamp because of overheating.  One can turn thermald off to see if that is the problem by using:

sudo systemctl stop thermald.service

and to disable it completely:

sudo systemctl disable thermald.service


Visit the packages.ubuntu.com

Search for the needed package.

That will list the package.

Here in the Example, click on the trusty

It will bring you to the following page

http://packages.ubuntu.com/trusty/vlc

Here, the packages marked with red dots are the dependent packages for the main package. You need to install them also.


Why does the 20.04 installer think that a plain linux raid is made up of 2 x /dev/sdb2 partitions?

This issue was caused by my disks having an invalid WWN number. The developers came up with a way to work around bogus disk WWNs. Great work!

https://bugs.launchpad.net/bugs/1876848


2nd harddrive, /var/lib/mysql ownder is nvidia-persistenced when mounted, mysql when booted?

User names are actaully just mappings to UIDs stored in /etc/passwd. Similarly group names are mapped to GIDs from /etc/group. The IDs are decided as and when they are required. 0 is always root but almost everything else is decided when the user and groups are created.

These *IDs are near-arbitrary integers that the system interprets as defined users and groups. The IDs are decided as and when they are required. 0 is always root but almost everything else is decided when the user and groups are created.

When a file is written to disk, it is these UID and GID values that are stored on disk, not the string representation. And that's what is happening here. Your user→UID and group→GID mappings in  on your secondary install don't line up with the UIDs from your first install. It's mapping file ownership to the wrong users.

If your old install is never going to be a factor in this, I would simply just remap the ownership to the mysql user:

sudo chown --recursive mysql: /var/lib/mysql

I've checked a real-world MySQL install and all the files in my /var/lib/mysql were owned by mysql:mysql so I think this should be accurate.

If the old install will be used again (eg a dual-boot-style arrangement) you'll need to be more creative. In those cases you might need to alter the mapping of UIDs and GIDs to users and groups so they're the same (and then fix the corresponding files from the new system). It would be fairly tedious.


Missing operating system when computer restarts

BIOS hard disk pre-delay could be at fault - or having a USB hard drive plugged in could introduce weirdness that exhibits a lot like this.

Either way, it's hardware dependent.


How to configure a network printer in Ubuntu 14.04

Network Printers are easy to setup

Open System Settings... from the Gear/Power button on top right corner of your desktop:

Click on Printers

Click on Add

Your Wi-Fi printers should show up under Network Printers. If they don't click on Find Network Printer and enter the IP address.

If you want to share your printer that is connected to Windows, use Windows Printer Via SAMBA.

For more help see the help on network printing with Ubuntu.


Aside from a loop mount as arhimed suggests, the only way I know of doing this would be to use XFS, which supports "project quotas": quotaa for specified directory trees, not just entire filesystems.


I have formatted a partition for Ubuntu. How do I install it on that partition?

NTFS is not the right format for Ubuntu. The best course of action is to delete the 55GB partition in Windows 7 and leave it unformatted. Ubuntu will then find the empty space and create 2 partitions it needs there. One of then will be in ext4 format and the other one in Linux/Swap format.
(Update as of 2019
Recent versions of Ubuntu creates a swap file by default instead of a separate swap partition as described above.
End Update)
Boot from the Ubuntu DVD/USB and you will get the choice of Install or Try. Choose Try Ubuntu. This will run it from the DVD/USB without touching your hard drive and you can see if everything, such as, sound, video, wifi, etc. work or not. When you are satisfied, you can choose Install Ubuntu from the live session. See: How do I install Ubuntu?
During installation you should get the choice of Install side by side Windows This is the dual boot option that will find the unallocated 55GB and do the partitioning and  formatting for you.
The AMD part of AMD64 refers to the company who came up with the standard. It works in both Intel and AMD CPUs.
See: Dual Boot Installation with Win7 - Install Ubuntu in New Partition
Hope this helps


How can I have my discrete graphics card always enabled?

Go into your BIOS settings and disable the iGPU.  If the hardware cannot be found, no modules will be loaded except the discrete GPU, resulting in the GPU to be used for everything!

Low quality reviewers: That's it! ;-)


.thunderbird in my home takes up too much space

You can clean your GMail account to make free space.

Also if you want "more space" for your /home partition install GParted to manage partitions. Provided there's unallocated space or it can be carved out from other partitions, it's possible to extend /home.

sudo apt-get install gparted


Install Ubuntu 12.04 on a formerly Win XP computer

1.Insert Ubuntu Live USB and restart your computer, While restarting keep pressing ESC/F2/F9/F12 depending on your bios set up and select booting with USB.

2.In the booting option select try ubuntu. If you feel Ubuntu is working well then Click Install Ubuntu in the Harddrive.


I could not make it behave exactly like the unity battery indicator, but I've found a solution that is, at least for me, enough.

Right click on the panel.
Click on "Add to Panel..."
Select "Battery Charge Monitor"
Click on "Add"

Another battery icon should appear. Right click on it.

Click on "Preferences"
Select: "Show time/percentage:"
Close.

This should do it.


Wifi turns off automatically in Ubuntu 16.04 if speed goes above 150 Mbps

[Solved]

Updated the kernel to 5.1.3 using Ukuu Kernel Update Utility. It's been 2 days now since laptop is up and running and WiFi is not turned off. Noticed other things as well after updating the kernel. WiFi Signal is always 100% now. Earlier it was always between 80 - 90 percent. Also, boot time has reduced significantly.


Ubuntu 15.04 will NOT run on HP DV2845se with dual core AMD Turion and nvidia 630M graphics

I had to drop back to Lubuntu from Ubuntu after the Ubuntu 14.04 updates left the system too glitchy.  The Nouveau driver worked under Lubuntu, but ran too hot, but the Nvidia 304.125 was better (still warm, but runnable).  Unity is the killer for you, try another desktop, and that might be your solution also.

I did succeed in getting Ubuntu 14.04 to run by installing xfce4 and removing all the unity packages.  Dual booting that now with Lubuntu, still deciding which I like better.  Getting xfce4 installed needed to be done at a virtual terminal since there was no usable GUI until unity was totally removed.  There did seem to be some sort of glitch on the Nvidia 304 driver install -- from the GUI additional drivers it looked like it worked, but checking the actual modules the only Nvidia driver was the frame buffer one, not the normal nvidia-304.  A simple apt-get --reinstall install on it did set things right, no idea what the problem was, but do check on what video module is in use as you are working on this (with lsmod).


XSession errors filling up my disk space

The python in my error message provoked my curiosity. The NUC is used as a mediacenter and has Kodi installed and runs at startup.

Moving the kodi config folder solved the issue. I'm guessing some addon is the culprit. Since no major update has been available for kodi I'm pointing to an addon.

It could also be the cec adapter that has been soldered and it did have a recent driver update.


The problem is not urgent anymore. After playing around I found that the international version of yahoo can also be started with "www.yahoo.com". That has the same effect as "us.yahoo.com". But "us.yahoo.com" freezes firefox if LaTex is installed, while "www.yahoo.com" does that not. So I can work again.

Regards and thanks for the suggestions.


Writing a shell program in Unix to compile and run a COBOL file using the Open-Cobol a.k.a GnuCOBOL compiler

The bash sample in the question seems to have been corrected - although it is quite strange to call an executable file ".exe" in a GNU/Linux system isn't it?

If you don't need the output file to be an executable I'd suggest to do

cobc -free $1
cobcrun $(basename "$1")


Applications disappear from Gnome Panel after cloning to machines with the same hardware

there is the possibility of the folder /usr/share/applications and $HOME/.local/share/applications out of sync. That two folders are used to place 'launcher.desktop' of all the applications you install.
first of all try to compare both the folder:
1.get local dir1 md5sum

cd /usr/share/applications find . -type f -exec md5sum {} ; |sort -k2 > dir1_md5

Sample export :
c6d19fc12bbba3ba5844e9d228c10daa *./INPUT_FILE.txt
2.get remote servers dir2 md5sum

ssh username@servername "cd /usr/share/applications; find . -type f -exec md5sum {} " ; |sort -k2 > dir2_md5

3.compare :

diff dir1_md5 dir2_md5

Dont forget for $HOME/.local/share/applications to, just simply change the command /usr/share/applications with  $HOME/.local/share/applications.
If there is a different, and if you do not want to bother with the difference. simply copy and paste all the contents of the folder /usr/share/applications and $HOME/.local/applications to the target machine.
Other command to compare is :

ls -a /usr/share/applications  > dir1_md5
ssh username@servername "ls -a /usr/share/applications" > dir2_md5
diff dir1_md5 dir2_md5

but, this command  just compare the list of folders, not to difference the contents of the launcher


Dualboot windows 8 uefi and ubuntu 13.04 64-bit

I got it working using boot-repair, which uses grub to load the uefi files.

Start Ubuntu cd as livecd and install boot-repair onto the temporary live-system. Using apt-get.

Use boot-repair to get a runnable system with EFI-Support.


Cheese 3.10 ships with Ubuntu 14.04, while Cheese 3.12 ships with Ubuntu 14.10. This may explain why it stopped working.

Try this:

 sudo apt-get remove cheese
 sudo echo "deb http://fr.archive.ubuntu.com/ubuntu/ trusty main" > /etc/apt/sources.list.d/cheese.list
 sudo apt-get update
 sudo apt-get autoremove

Now install cheese 3.10 with Synaptic. If you don't have Synaptic yet, you can install it:

 sudo apt-get install synaptic

Force the version like so:
Package -> Force version (choose 3.10)

To fix broken packages, close Synaptic and do this:

 sudo apt-get -f install

Don't forget this:

 sudo rm /etc/apt/sources.list.d/cheese.list
 sudo apt-get update

Now it should work. Never update Cheese again. :) This is a guide to lock the version.

Although this method is not recommended to apply for every package, it may provide a workaround for your problem.


Installing Ubuntu-mate with dual boot option on Windows 10 - usb booting not happening

This shows both BIOS & grub boot screens and adding nomodeset boot option.
With UEFI & after install you have grub menu and have to manually add nomodeset in place of quiet splash.
At grub menu you can use e for edit, scroll to linux line and replace quiet splash with nomodeset.

My computer boots to a black screen, what options do I have to fix it?

After install,if you boot to low quality graphics you can go into System Settings, Software & Updates, additional drivers tab and add the nVidia driver.

If you only get to a terminal or have to boot using recovery mode, make sure Internet is working and download correct driver.
Do not download .run driver directly from nVidia. If newest driver required because of a very new nVidia card/chip add ppa to get newest drives.

List drivers available, same list as system settings,  software updates,  additional drivers or last tab

ubuntu-drivers devices
ubuntu-drivers devices | grep recommended

to install, if any nVidia driver previously installed you must purge old driver first:

sudo apt-get remove --purge nvidia-*
sudo ubuntu-drivers devices
sudo ubuntu-drivers autoinstall

If ppa required:
Shows standard repository versions

ubuntu-drivers devices
sudo apt-add-repository ppa:graphics-drivers/ppa

should show newest versions available in addition

ubuntu-drivers devices

If older nVidia card, best to check which legacy nVidia driver is correct. Too new or too old of driver causes issues.

Legacy drivers by GPU model

http://www.nvidia.com/object/IO_32667.html

Updated driver search by nVidia model, do not download, just check correct driver version

http://www.geforce.com/drivers

Ppa Details on why and future incorporation to Ubuntu installer

https://lists.ubuntu.com/archives/ubuntu-desktop/2015-August/004693.html

https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa


Boot from USB, but run on auxiliary hard drive

I could solve the same issue with the following method.
I'll consider that for the rest of the article (change it as per your own configuration):

the hard drive is sda and the boot partition is sda1 (which maps to (hd1,gpt1) in GRUB, (hd0) being the GRUB USB)
/dev/sda1 contains a /boot/vmlinuz kernel and /boot/initrd.img disk
the Ubuntu bootable USB is sdb under Ubuntu Live
the to-be GRUB USB is sdc under Ubuntu Live

Boot on the Ubuntu Live USB:

Insert the new USB and create on it an ext4 partition with grub_bios flag (that will be /dev/sdc1) and a second ext4 partition with "boot" flag (that will be /dev/sdc2 on which GRUB will boot)
Mount the second partition so grub-install can create the /boot/grub files: mount /dev/sdc2 /mnt
Install GRUB on it: grub-install --boot-directory=/mnt /dev/sdc
Edit file /mnt/grub/grub.cfg with the following content:

set root=(hd1,gpt1)
linux /boot/vmlinuz root=/dev/sda1
initrd /boot/initrd.img
boot

Reboot on the GRUB USB and it should be booting your hard drive.
EDIT: As per @kenn's comment: it's better to use partitions UUIDs or labels instead of direct links to hard drive. The UUIDS (and labels) are available in your Ubuntu Live under /dev/disk/by-partuuid or /dev/disk/by-partlabel. Then use in your grub.cfg:
linux /boot/vmlinuz root=PARTUUID=<partition UUID>

or:
linux /boot/vmlinuz root=PARTLABEL=<partition label>


Application "Disks" made filesystem readonly

Ok, since there was no clear sign of what the problem was, I randomly started Windows and ran chkdsk on the partition. It had no errors. I rebooted, and now Lubuntu can write to the partition. It is obviously not sure, if chkdsk has anything to do with it.


Enforce: Command Not Found - Ubuntu 18.04

You are using a wrong manual for Ubuntu.

Ubuntu manual for Apparmor can be found HERE.

Most likely you are looking for aa-enforce command.


Startup Disk Creator creates a ISO9660 image that can be hard to get rid of.
Best bet is to use the Wipe function of mkusb/dus.

https://help.ubuntu.com/community/mkusb/wipe

Wipe the first MB of the drive and then create a msdos partition table with a FAT32 partition.

The drive will end up like new.

Zeroing the first MB should be enough as zeroing the whole drive can take a long time.

Edit:

Following are instructions to install mkusb:

sudo add-apt-repository universe

sudo add-apt-repository ppa:mkusb/ppa

sudo apt-get update

  sudo apt-get install mkusb mkusb-nox usb-pack-efi


How to reject incoming e-mail with Postfix?

This is described as a null client in Postfix' documentation.

Configure postfix to only listen to loop back by changing inet_listen to

inet_listen = loopback-only

in /etc/postfix/main.cf

This effectively blocks incoming connections, disallowing mail delivery. In addition, you should set

my_destinations =

This disables all local mail delivery. This should obviously only be used if you want mail for e.g. root and similar (typically crontab-generated) to be sent to an external host. If you want local delivery of such mail, leave my_destinations as is.

Postfix' documentation has some more information about your attempted configuration, including full explanations of options.


How do I fix 'jekyll: command not found' error permanently?

You can create alias for the above three commands.

alias jekyllb='[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" && [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" && jekyll build'

Hence forth, whenever you would run jekyllb all the three commands would be run sequentially.


[19141:19141:0425/011526.129520:ERROR:sandbox_linux.cc(374) InitializeSandbox() called with multiple threads in process gpu-process

"Solving Google Chrome's gpu-process error message in Ubuntu Linux" worked for me.
google-chrome --disable-gpu --disable-software-rasterizer

It disables GPU hardware acceleration. If software renderer is not in place, then the GPU process won't launch.


pdfsandwich

Does what you want and provides Ubuntu deb packages. It uses tesseract as OCR engine. The following call adds the text layer to your scanned PDF:

pdfsandwich scanned.pdf

Following does the same but with another language (ISO 639-2 code, download tesseract-ocr-LANGCODE package) and setting the layout:

pdfsandwich  -verbose -lang spa -layout single scanned.pdf

If you get any error please download last version deb from Sourceforge.

Disclaimer: I'm the developer of pdfsandwich and therefore obviously biased.


Add and remove update channels in an easy terminal way

Nov 27, 2015 Update:

The second version of the script still left me dissatisfied with the bloatness of the source code and the fact that I had to employ several different tools. Hence I attempted to rewrite the script in AWK only.

The new script uses pure AWK, and adheres much better to the requirements. Essentially it rewrites the /etc/apt/sources.list every time it runs.

After running the script , update is required, therefore run sudo apt-get update after the script exits successfully.

The file must have executable permissions enabled with chmod +x add-update.awk and be saved in any of the directories contained in the $PATH variable. Particularly  it is advised to save the script to $HOME/bin folder ( which also must be appended to the $PATH variable).

A backup of the original /etc/apt/sources.list file is not required but strongly recommended. To backup the file do

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

Usage:

sudo ./add-update.awk -v ACTION=[enable|disable|help] -v SOURCE=[updates|backports|security|proposed]

Source on github

Demo:

sergrep:$ cat /etc/apt/sources.list
deb http://it.archive.ubuntu.com/ubuntu wily main universe
deb http://us.archive.ubuntu.com/ubuntu wily-backports main

deb-src http://it.archive.ubuntu.com/ubuntu wily main universe
deb-src http://us.archive.ubuntu.com/ubuntu wily-backports main
# removed

sergrep:$ sudo ./add-update.awk -v ACTION="enable" -v SOURCE="security"
[sudo] password for xieerqi:
/etc/apt/sources.list
<<< Script finished processing

sergrep:$ cat /etc/apt/sources.list
deb http://it.archive.ubuntu.com/ubuntu wily main universe
deb http://it.archive.ubuntu.com/ubuntu wily-security  main universe
deb http://us.archive.ubuntu.com/ubuntu wily-backports main
deb http://us.archive.ubuntu.com/ubuntu wily-security  main
deb-src http://it.archive.ubuntu.com/ubuntu wily main universe
deb-src http://it.archive.ubuntu.com/ubuntu wily-security  main universe
deb-src http://us.archive.ubuntu.com/ubuntu wily-backports main
deb-src http://us.archive.ubuntu.com/ubuntu wily-security  main

SOURCE CODE

#!/usr/bin/awk -f
#
###########################################################
# Author: Serg Kolo
# Date: Nov 27,2015
# Purpose: A script that enables/disables 4 ubuntu sources
# (namely updates, backports, proposed, and security )
# much in a way like software-properties-gtk does
# Written for:  http://paste.ubuntu.com/13434218/
###########################################################
#
# Permission to use, copy, modify, and distribute this software is hereby granted
# without fee, provided that  the copyright notice above and this permission statement
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

function printUsage() {
    print "Usage: sudo ./add-update.awk -v ACTION=[enable|disable|help] -v SOURCE=[updates|backports|security|proposed]";
    exit
}

function checkSourceEnabled()
{
    if ( $3 ~ SOURCE) {
        print SOURCE" is enabled; exiting"
        VAL = 1
    }
    else {
        VAL = 0
    }
    return VAL
}

function disableSource()
{
    if ( $0 ~ SOURCE ) $0="# removed";
    j++;
    newLines[j]=$0;
}

function listStuff () {
    for(k=4; k<=NF; k++) if ( $k~/#/  ) {break} else {
            COMPONENTS=COMPONENTS" "$k
        };
    gsub(/\-.*/,"",$3);
    STRING=$1" "$2" "$3APPEND" "COMPONENTS;
    COMPONENTS=""
               return STRING;
}

function replaceFile()
{
    command="mv  /tmp/sources.list "ARGV[1]
            system(command);
}

############
#  MAIN
#############
BEGIN {

# argument checking sequence
# must remain written in if-else
# structure rather than case,
# to consider users who may not be able
# to install gawk due to broken sources.list
# which is what this script should be aimed at

# actions checked first so that
# help message can be printed
 if ( ACTION ==  "enable" ||
      ACTION == "disable" ||
      ACTION == "default"  ) {

    print "<<< ACTION ARG OK"
  }
  else if (ACTION == "help" ){
    printUsage()
    exit
  }

  if ( SOURCE == "update" ||
       SOURCE == "security" ||
       SOURCE == "backports" ||
       SOURCE == "proposed" ) {
       print "<<< SOURCE ARG OK"

  }

   else if ( ACTION != "default"  || ACTION != "help" ) {
        print "<<< E: SOURCE ARG INCORRECT";
        printUsage();
        exit 1   }

    # static filename to operate on
    ARGV[ARGC++]="/etc/apt/sources.list";

    if (ACTION == "enable" ) {
        APPEND="-"SOURCE;
    } else{
        APPEND="";
    }

} # END OF BEGIN

$0~/^deb*/ && $0!~/partner/ && $0!~/extra/ {

    if ( ACTION == "enable" ) {
        j++;
        ARRAY[j]=$0
        ENABLED=checkSourceEnabled();

        if ( ENABLED ) {
            exit 1
        }
        else {
            j++;
            ARRAY[j]=listStuff();
        }

    }
    else if ( ACTION == "disable" ){
        disableSource() ;
    }
    else if ( ACTION == "default" && SOURCE == "default" ) {
        j++;
        defaultsArray[j]=$0;
        j++;
        defaultsArray[j]=listStuff();
    }
}

END {
    print "<<< Script finished processing" ;
    if ( ACTION =="enable" && ENABLED == 0 ){
     for(i=1;i<=j;i++)
        print ARRAY[i] |  "sort -u > /tmp/sources.list ";
     replaceFile();
     }
     else if ( ACTION == "disable" ) {
       for ( i=1;i<=j;i++  ) print newLines[i] | "sort -u > /tmp/sources.list"
       replaceFile();
     }
     else if (ACTION == "default" ){
        for ( i=1;i<=j;i++  ) print defaultsArray[i] | "sort -i -u > /tmp/sources.list"
        replaceFile();
     }
}

# END OF MAIN

--

Previous versions

Version #1 on github (bash script with AWK and SED)

Version #2 on github (also bash script)


How to Install Oculus SDK 0.4.4 and run something on DK2

The world demo button in RiftConfigUtil will be grayed out initially until a user profile is created.  Click the button labelled '+' and fill out your info first.

Assuming you have an Nvidia card, the easiest way to modify your display settings is with the nvidia-settings program that is installed along with the proprietary nvidia drivers. In order to get full framerate and no "judder", you really need a new/beefy gaming video card.

I have only been able to get 75 hz refresh when setting the rift as another X11 display 'X Screen 1'.  My monitors are only capable of 60Hz which might be limiting framerate when not using two explicit X11 screens. eg, :0.0 and :0.1.  Make sure to leave the Rift in vertical/portrait non-rotated mode for best performance.

You can then run oculusd on the second display via:
DISPLAY=:0.1 ./oculusd

Launch the world demo in the same way after compiling it:
DISPLAY=:0.1 Release/OculusWorldDemo_x86_64_Release

F9 will then put the Tuscany demo into fullscreen and rotated properly. I hope you get it working.

And now for the bad news... there aren't many games being released for Linux+Oculus currently.  I'm hopeful either Steam or some open source games will start supporting it soon.


The kidle_inj processes, one per CPU, are one way to achieve thermal throttling to help keep your processor cooler. Typically, invoked by thermald, the actual method used is a function of the CPU frequency scaling driver, with possible overides via the /etc/thermald/thermal-cpu-cdev-order.xml file.

Let's work through a couple of examples. Even under 100% load on all CPUs, my test server doesn't overheat, so I will set a low thermal trip point of 55 degrees for this.

First using the intel_pstate CPU frequency scaling driver and the powersave governor:

doug@s15:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
intel_pstate
doug@s15:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
powersave
powersave
powersave
powersave
powersave
powersave
powersave
powersave

Now use turbostat to monitor things, and also watch the maximum performance setting (maximum allowed CPU frequency as a percent). It starts un-throttled:

doug@s15:~$ cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
100

.

doug@s15:~$ sudo turbostat --quiet --Summary --show Busy%,Bzy_MHz,PkgTmp,PkgWatt --interval 5
Busy%   Bzy_MHz PkgTmp  PkgWatt
0.02    1600    26      3.70
0.03    1600    26      3.70
2.21    3737    38      6.87
38.89   3564    48      42.70
94.64   3500    50      58.54 <<< Load being ramped up.
100.00  3500    52      58.49 <<< Processor package temperature going up.
100.00  3500    53      58.78
100.00  3500    56      59.04
100.00  3500    56      59.27
100.00  3123    53      51.18 <<< Notice throttling via clock frequency
100.00  2969    56      47.32
100.00  2693    52      41.90
100.00  2009    53      28.98
100.00  2489    55      37.90
100.00  2431    54      36.82
100.00  2620    54      40.50
100.00  2409    55      36.39
100.00  2511    54      38.47
100.00  2569    57      39.61
100.00  2301    53      34.57
100.00  1682    53      23.64
100.00  2089    54      30.52
100.00  2569    56      39.59
100.00  2301    52      34.55
87.08   1671    53      22.98
48.70   2037    52      24.04
5.58    2318    44      7.50
0.02    1603    40      3.88
0.03    1600    40      3.87
0.02    1600    39      3.85
^C0.04  1600    38      3.86

And during the above the max percent was reduced, until after the load was removed, and the processor temperature dropped:

doug@s15:~$ cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
60
doug@s15:~$ cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
60
doug@s15:~$ cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
100

Second, use the acpi-cpufreq CPU scaling driver and ondemand governor:

doug@s15:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
acpi-cpufreq
acpi-cpufreq
acpi-cpufreq
acpi-cpufreq
acpi-cpufreq
acpi-cpufreq
acpi-cpufreq
acpi-cpufreq
doug@s15:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
ondemand
ondemand
ondemand
ondemand
ondemand
ondemand
ondemand
ondemand

Now use turbostat to monitor things, and also watch the kidle_inject threads.
Notice that the turbostat output has an added column , %C6 which is the deepest idle state my processor goes into (done via "hide" instead of via "show" because "show" method doesn't work).

doug@s15:~$ sudo turbostat --Summary --quiet --hide IRQ,Avg_MHz,SMI,GFXMHz,TSC_MHz,GFXWatt,CorWatt,POLL%,CPU%c1,CPU%c3,CPU%c7,CoreTmp,GFX%rc6,Pkg%pc2,Pkg%pc3,Pkg%pc6,POLL,C1,C1E,C3,C6,C1%,C1E%,C3%,C6% --interval 5
Busy%   Bzy_MHz CPU%c6  PkgTmp  PkgWatt
0.05    1602    99.83   26      3.71
0.04    1600    99.87   28      3.71
0.05    1600    99.83   26      3.71
0.05    1601    99.84   26      3.71
24.67   3591    52.79   45      30.24
93.87   3500    0.00    47      58.30  <<< Load ramped up
100.00  3500    0.00    50      58.42
100.00  3500    0.00    53      58.70
100.00  3500    0.00    55      58.99
100.00  3500    0.00    56      59.23
93.72   3424    6.18    56      54.44  <<< Now some C6 idle time is forced via kidle_inj
81.41   3223    18.32   54      44.49
77.81   3179    21.82   56      42.02
83.82   3348    15.90   57      48.14
78.87   3278    20.78   54      44.52
66.34   3061    33.15   54      35.02
62.65   2898    36.78   54      30.80
61.20   2856    38.20   53      29.63
63.71   3051    35.73   54      33.36
61.67   2938    37.76   54      30.90
61.92   2929    37.53   52      30.95
63.47   3039    35.97   55      33.17
60.87   2862    38.52   56      29.60
62.90   3073    36.56   53      33.40
62.36   2964    37.09   55      31.61
61.16   2866    38.24   53      29.78
63.98   3099    35.43   55      34.28
56.37   2708    43.01   52      25.80
52.01   2616    47.29   53      23.07
58.24   2738    41.15   53      26.86
65.39   3143    34.05   56      35.60
68.01   3209    31.50   56      38.09
58.62   2949    40.79   53      29.83
58.43   2730    40.95   53      26.88
48.87   3158    36.84   53      33.68
14.74   2642    70.22   43      14.77
0.37    1602    99.10   42      4.02
0.29    1601    99.30   40      3.97
0.23    1602    99.43   40      3.94
0.17    1601    99.58   39      3.91
0.17    1686    99.56   38      3.91
0.06    1601    99.79   38      3.85
0.04    1602    99.87   36      3.83
0.04    1600    99.88   36      3.83
0.09    1750    99.75   35      3.85
0.04    1600    99.89   35      3.82
0.04    1600    99.85   36      3.82
0.04    1600    99.88   34      3.81
0.04    1600    99.86   35      3.80
^C0.04  1600    99.87   33      3.80

And during throttling, the kidle_inj tasks force the deep idle state and the processor power goes down.

doug@s15:~$ ps aux | grep kidle
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      3005 33.2  0.0      0     0 ?        S    00:19   0:32 [kidle_inj/0]
root      3006 33.2  0.0      0     0 ?        S    00:19   0:32 [kidle_inj/1]
root      3007 33.2  0.0      0     0 ?        S    00:19   0:32 [kidle_inj/2]
root      3008 33.2  0.0      0     0 ?        S    00:19   0:32 [kidle_inj/3]
root      3009 33.2  0.0      0     0 ?        S    00:19   0:32 [kidle_inj/4]
root      3010 33.2  0.0      0     0 ?        S    00:19   0:32 [kidle_inj/5]
root      3011 33.2  0.0      0     0 ?        S    00:19   0:32 [kidle_inj/6]
root      3012 33.2  0.0      0     0 ?        S    00:19   0:32 [kidle_inj/7]

doug@s15:~$ ps aux | grep kidle
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      3005 33.5  0.0      0     0 ?        S    00:19   0:35 [kidle_inj/0]
root      3006 33.5  0.0      0     0 ?        S    00:19   0:35 [kidle_inj/1]
root      3007 33.5  0.0      0     0 ?        S    00:19   0:35 [kidle_inj/2]
root      3008 33.5  0.0      0     0 ?        S    00:19   0:35 [kidle_inj/3]
root      3009 33.5  0.0      0     0 ?        S    00:19   0:35 [kidle_inj/4]
root      3010 33.5  0.0      0     0 ?        S    00:19   0:35 [kidle_inj/5]
root      3011 33.5  0.0      0     0 ?        S    00:19   0:35 [kidle_inj/6]
root      3012 33.5  0.0      0     0 ?        S    00:19   0:35 [kidle_inj/7]

doug@s15:~$ ps aux | grep kidle
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      3005 29.1  0.0      0     0 ?        S    00:19   0:44 [kidle_inj/0]
root      3006 29.1  0.0      0     0 ?        S    00:19   0:44 [kidle_inj/1]
root      3007 29.1  0.0      0     0 ?        S    00:19   0:44 [kidle_inj/2]
root      3008 29.1  0.0      0     0 ?        S    00:19   0:44 [kidle_inj/3]
root      3009 29.1  0.0      0     0 ?        S    00:19   0:44 [kidle_inj/4]
root      3010 29.1  0.0      0     0 ?        S    00:19   0:44 [kidle_inj/5]
root      3011 29.1  0.0      0     0 ?        S    00:19   0:44 [kidle_inj/6]
root      3012 29.1  0.0      0     0 ?        S    00:19   0:44 [kidle_inj/7]

doug@s15:~$ ps aux | grep kidle
... throttling over, processes gone ...

You should not disable whatever thermal protection method you are using, but you could clean your fans and such to help keep the processor cooler. Also, if you have the option to use the pstate method of throttling, the remaining performance is typically higher than the kidle_inj method. For example, and for the workflow used for the above, the pstate method outperforms the intel_powerclamp kidle_inj method by 33%.

Now, if for whatever reason your processor is capable of using the intel_pstate CPU frequency scaling driver, but you have chosen not to, then the suggestion is to use the intel_cpufreq driver (which is just the intel_pstate driver in passive mode) and the ondemand governor. Why? Because then the pstate throttling method will be used. On my system, resulting in about 28% performance improvement over the kidle_inject method under the same throttling conditions.

How to change from intel_pstate to intel_cpufreq?

doug@s15:~$ cat /sys/devices/system/cpu/intel_pstate/status
active
doug@s15:~$ echo passive | sudo tee /sys/devices/system/cpu/intel_pstate/status
passive

And set the governor:

doug@s15:~$ sudo su
root@s15:/home/doug# for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "ondemand" > $file; done
root@s15:/home/doug# exit
exit
doug@s15:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
intel_cpufreq
intel_cpufreq
intel_cpufreq
intel_cpufreq
intel_cpufreq
intel_cpufreq
intel_cpufreq
intel_cpufreq
doug@s15:~$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
ondemand
ondemand
ondemand
ondemand
ondemand
ondemand
ondemand
ondemand

Why is there such a significant difference in performance? Because the kidle_inj method wastes a lot of time and energy going into and exiting the deep idle state, whereas the pstate method does not.

And for users seeing "idle_inject" instead of, or in addition to, "kidle_inj":

doug@s15:~$ ps aux | grep idle
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root        12  0.0  0.0      0     0 ?        S    09:07   0:00 [idle_inject/0]
root        16  0.0  0.0      0     0 ?        S    09:07   0:00 [idle_inject/1]
root        22  0.0  0.0      0     0 ?        S    09:07   0:00 [idle_inject/2]
root        28  0.0  0.0      0     0 ?        S    09:07   0:00 [idle_inject/3]
root        34  0.0  0.0      0     0 ?        S    09:07   0:00 [idle_inject/4]
root        40  0.0  0.0      0     0 ?        S    09:07   0:00 [idle_inject/5]
root        46  0.0  0.0      0     0 ?        S    09:07   0:00 [idle_inject/6]
root        52  0.0  0.0      0     0 ?        S    09:07   0:00 [idle_inject/7]

That is relatively recent, as of kernel 4.19, and the kernel configuration parameter is "CONFIG_IDLE_INJECT", which is set for Ubuntu kernels, but I don't yet know the purpose.

EDIT (2019.08.09, Aug 9th):

Readers, please be aware that for the intel_cpufreq CPU frequency scaling driver (intel_pstate in passive mode), and the acpi-cpufreq driver and schedutil governor some bugs may cause thermald to not work correctly. A reduction in the maximum allowed CPU frequency might not be honored by the system. Patches to fix these issues are in progress, but will take awhile to propagate.


Thanks for translate. You problem is that CA Certificate box is empty.
Read this: https://openvpn.net/index.php/open-source/documentation/howto.html#pki
Is the best source for your problem.


Evolution Mail and Calendar Authentication Error

First try enabling access to your Google account for so-called 'less secure apps' on https://www.google.com/settings/security/lesssecureapps

Then, can you share how you have set up your Gmail account? Did you use the general Online Accounts section on the Ubuntu settings screen or did you configure your Gmail account in Evolution manually without it being mentioned in the Online Accounts list?

In some forum threads about similar issues it is reported that setting up a Google account in Evolution works while going via the Online Accounts setup does not...


Setting up server, so no gui. Trying to copy output to paste in config file via terminal

I assume that your conf file resides in /etc which is writable with sudo. If so, please do:

curl -s https://api.wordpress.org/secret-key/1.1/salt/ | sudo tee /etc/some_file.conf

Of course, substitute the exact name and location of your file here. If you are adding the text to the end of an existing file, use -a for 'append':

curl -s https://api.wordpress.org/secret-key/1.1/salt/ | sudo tee -a /etc/some_file.conf


Python script (save it and execute it).

I found it on bug page for launchpad with the following comment:

  Untill banshee supports this natively the attached python snippet will do the job. It has a known problem that it will launch banshee when you lock the screen if it is not already running. I don't know enough about dbus to prevent this, and it doesnt bother me enough to make me figure it out (banshee is always running anyways).

Code of the script can be found here.

Regarding comment:

It might be worth while asking this on coding stackexchange.

But the relevant part of it is this:

def Bconnect(session_bus):
  if not session_bus.name_has_owner("org.bansheeproject.Banshee"):
    return None
  banshee = session_bus.get_object("org.bansheeproject.Banshee", "/org/bansheeproject/Banshee/PlayerEngine")
  return banshee


How can I get Gnome Shell to look like Budgie without Budgie DE?

Try the following.

Change your application theme (GTK+) and shell theme to Arc (preferably "Dark" or "Darker" variant) using (GNOME) Tweaks. To install the theme on Ubuntu 17.10 and later from the Universe repository run

sudo apt install arc-theme

Ubuntu 16.04 requires adding the repo

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /' > /etc/apt/sources.list.d/home:Horst3180.list"
sudo apt-get update
sudo apt install arc-theme

Change your icon theme to Moka. For Ubuntu 17.10 and later, it's available from the Universe repository, the pocillo-icon-theme package will install the Moka and Faba icon-sets

sudo apt install pocillo-icon-theme

On older Ubuntu releases, install them from Sam Hewitt's PPA by running

sudo add-apt-repository ppa:snwh/ppa
sudo apt update
sudo apt-get install moka-icon-theme faba-icon-theme faba-mono-icons

Make the Ubuntu dock (on Ubuntu 17.10 and later) flexible following this Q&A: How can I stop Ubuntu Dock from extending to the edges? Also perhaps reduce the size of app icons in the dock from Settings > Dock.
For earlier Ubuntu releases, use the GNOME shell extension called Dash to Dock.
The top bar in GNOME has dynamic transparency feature nowadays by default. If you want to have more control over its transparency use the Dynamic Panel Transparency extension (see this for reference).


BLACK SCREEN when trying to install Ubuntu Mate 19.04 over Manjaro 18

If you cannot boot into a live USB, it is very likely that your problem is one or more of the following:

Wrong/Corrupted .ISO

Make certain that you have downloaded the correct .ISO for your hardware.  For example, older computers with i386 architecture cannot run the .ISO file for x64 systems.
Before writing the .ISO to DVD or USB,  verify the checksum for your ISO.

.ISO Written Improperly to Disk

To Burn a DVD, use Brasero to "Burn Image" (Burn an existing CD/DVD image to disk)
To make a bootable USB, use an automated tool like Etcher to select your .ISO file and the USB device.

Faulty/Misconfigured Hardware

The USB flash drive that you are using may have bad sectors.
The DVD you burned may have encountered an error during burning
Your hard drive, motherboard, power supply, etc may have hardware problems, unrelated to software, that do not allow the installer to continue.
Your motherboard BIOS may be set to only boot to UEFI or BIOS (compatibility-mode), and you selected the option that is not allowed, so you must change the settings in the motherboard firmware to allow the mode you want to boot from.


df shown size much smaller than partition size, /home full

Get a backup of all your data  [ THIS IS IMPORTANT DO NOT SKIP IT ]
Boot your system using a live Ubuntu disk
Run:

lsblk /dev/sda1 -o size

It should return:

SIZE
238,5G

Now that we are 100% sure that /dev/sda1 is the actually your home partition we will continue.
Run check disk on your home partition:

sudo e2fsck /dev/sda1

Run:

sudo resize2fs /dev/sda1

Mount the partition:

sudo mount /dev/sda1 /mnt

Check the size of filesystem:

df -h --out=size /mnt

It might help fix the issue.


MySQL is started by upstart. You can find the configuration file at /etc/init/mysql.conf


Is there any useful software for filling out pdf-forms other than Adobe Reader?

Evince Document Viewer (Installed by Default)

Here is a screenshot of an editable PDF file being filled in my desktop for you to see Evince Document Viewer in action.

Like this, there should be some other good PDF readers that will allow you to perform this task, but this is working for me and it is really lightweight.

Good luck!


Is there any way to install latest LXqt 0.10 on ubuntu 14.04?

First thing to point out is, lxqt is still early in development, you will face issues with this desktop and should not replace your default desktop, please see the comment by DK_bose for some details

For 16.04 the latest lxqt is in the default repository

sudo apt-get install lxqt

For older versions of Ubuntu, add the Lubuntu development PPA to get up to date versions.

sudo add-apt-repository -y ppa:lubuntu-dev/lubuntu-daily && sudo apt-get update

Then install these packages

sudo apt-get install lxqt-metapackage lxqt-panel openbox

Now log out and you can choose lxqt as your desktop.

Source


Scratch 1.4 not available on Ubuntu 13 anymore?

You can easily just do this(I don't think there us a problem in software center). You just seem that you are not enabling the universe repoisoty.

But please be sure you enable the universe repository(if it's enabled skip this step). To enable universe repository do this

 sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

Update the package index:

sudo apt-get update

Install scratch:

sudo apt-get install scratch

Anyway if you like to install the binary(.deb) directly you can download:

scratch1.4 32bit or scratch1.4 64bit according to your needs.

Now you have the .deb file you can install by the command:

sudo dpkg -i ~/Downloads/scratch*.deb


Snap store app are not installing through the online snap store

Try reinstalling snapd :
$ sudo apt-get install snapd
and run
$ systemctl enable --now snapd apparmor
Restart your system and It should work


How do you force apt-get source to get the package you ask for

There is not a 1-to-1 relationship between binary packages and their corresponding source packages.  Reasons for this include:

In some cases, multiple binary packages will be derived from a single source
The names will be slightly different to reflect versioning of the binary packgage
Some packages do not directly include binaries, but instead only specify dependency packages which should be installed.

I am not able to reproduce your specific issue, maybe because I have a newer version of Ubuntu installed.  Below is a walk-through of a similar issue with a similar library (note that everything in my example is already installed, but the displayed information about mapping and dependencies is still relevant).  This should give some good hints about how to deal with this type of issue.

I have successfully installed a package called libjpeg8:

$ sudo apt-get install libjpeg8
Reading package lists... Done
Building dependency tree
Reading state information... Done
libjpeg8 is already the newest version.

I try to get the source, but it is remapped to something with the suffix -empty.

$ apt-get source libjpeg8
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'libjpeg8-empty' as source package instead of 'libjpeg8'
Skipping unpack of already unpacked source in libjpeg8-empty-8c

I list the dependencies of the desired package, and notice libjpeg-turbo8:

$ apt-cache depends libjpeg8
libjpeg8
  Depends: libjpeg-turbo8
  Replaces: libjpeg8:i386
  Breaks: libjpeg8:i386

I install the source for libjpeg-turbo8, and I get the source that I needed:

$ apt-get source libjpeg-turbo8
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'libjpeg-turbo' as source package instead of 'libjpeg-turbo8'
Skipping unpack of already unpacked source in libjpeg-turbo-1.3.0


How can I connect a Wiimote to my computer to control an audio-player?

Edit: Rinzwind tipped me off on a launchpad project called "wiican". Apparently it is implemented as an indicator applet and allows to customise your wii-actions. You could bind e.g. amarok -t to a wiibutton.

You're in luck, and you don't even know how much. It took me a while and a bit of research but: I wrote a script to do just that a while back. It works with Amarok and Totem, though it could easily be modified to control other players (provided they have a command line interface). Give me a few minutes to write a few comments together. Then I will edit this answer and post it.

Features:

Check battery status of the Wiimote.
Switch an led on the Wiimote.
Start Amarok.
Pause/contiue playing.
Skip to next/last track.
Control the system volume over alsamixer

You will need python and python-cwiid  / sudo apt-get install python-cwiid installed. You can do that while waiting.

Below is the script. Just run it in a terminal.

#!/usr/bin/python
# indent-mode: spaces, indentsize: 4, encoding: utf-8
# © 2011 con-f-use@gmx.net.
# Use permitted under MIT license:
# http://www.opensource.org/licenses/mit-license.php (NO WARRANTY IMPLIED)
"""A Wiimote script to control totem and amarok under Ubuntu.

Provides a rudimentary interface to:
-Check battery status of the Wiimote.
-Switch an led on the Wiimote.
-Start Amarok.
-Pause/contiue playing.
-Skip to next/last track.
-Control the system volume over pulseaudio

Needs the package 'python-cwiid', 'amarok' and or 'totem' to be installed.

Globals:

wiimote -- the wiimote object
led -- the status of the led (on/off)

"""

import cwiid
import sys
import os

def main():
    """PC-side interface handles interaction between pc and user.

    b -- battery status
    l -- toggle led
    q -- quit
    h -- print help
    """
    global wiimote
    connect_wiimote()

    #Print help text ont startup
    print 'Confirm each command with ENTER.'
    hlpmsg =    'Press q to quit\n'\
                'b for battery status\n'\
                'l to toggle the led on/off\n'\
                'h or any other key to display this message.'
    print hlpmsg

    #Main loop for user interaction
    doLoop = True
    while doLoop:
        c = sys.stdin.read(1)
        if c == 'b':    # battery status
            state = wiimote.state
            bat = int(100.0 * state['battery'] / cwiid.BATTERY_MAX)
            print bat
        elif c == 'l':  # toggle led
            toggle_led()
        elif c == 'q':  # exit program
            doLoop = False
        elif c == '\n': # ignore newlines
            pass
        else:           # print help message when no valid command is issued
            print hlpmsg

    #Close connection and exit
    wiimote.close()

def connect_wiimote():
    """Connets your computer to a Wiimote."""
    print 'Put Wiimote in discoverable mode now (press 1+2)...'
    global wiimote
    while True:
        try:
            wiimote = cwiid.Wiimote(#add address of Wiimote here for speedup)
            break
        except:
            continue
    wiimote.mesg_callback = callback
    #Set Wiimote options
    global led
    led = True
    wiimote.led = cwiid.LED1_ON
    wiimote.rpt_mode = cwiid.RPT_BTN
    wiimote.enable(cwiid.FLAG_MESG_IFC)

def callback(mesg_list, time):
    """Handels the interaction between Wiimote and user.

    A and B together    -- toggle led
    A                   -- play/pause
    up / down           -- fast forward / backward
    right / left        -- next / previous trakc
    + / -               -- increase / decreas volume

    """
    for mesg in mesg_list:
        # Handle Buttonpresses - add hex-values for simultaneous presses
        # Buttons not listed: 0x4 - B, 0x1 - 2, 0x2 - 1 | just babytown frolics
        if mesg[0] == cwiid.MESG_BTN:
            if mesg[1] == 0x8:      # A botton
                player_control('playpause')
            elif mesg[1] == 0xC:    # A and B together
                toggle_led()
            elif mesg[1] == 0x800:  # Up botton
                player_control('ffwd')
            elif mesg[1] == 0x100:  # Left botton
                player_control('lasttrack')
            elif mesg[1] == 0x200:  # Right botton
                player_control('nexttrack')
            elif mesg[1] == 0x400:  # Down botton
                player_control('fbwd')
            elif mesg[1] == 0x10:   # Minus botton
                change_volume(-1)
            elif mesg[1] == 0x1000: # Plus botton
                change_volume(1)
            elif mesg[1] == 0x80:   # home botton
                shut_down()
        # Handle errormessages
        elif mesg[0] == cwiid.MESG_ERROR:
            global wiimote
            wiimote.close()
            connect_wiimote()

def change_volume(change):
    """Changes system's master volume."""
    cmd = "amixer get Master | grep 'Front Left' | grep -oP '(?<=Playback\ )\d+'"
    fin,fout = os.popen4(cmd)
    currVol = int( fout.read() )
    newVol = currVol + change
    os.system( "amixer set Master "+str(newVol) )

def toggle_led():
    """Toggles first led on Wiimote on/off."""
    global led
    if led == True:
        led = False
        wiimote.led = 0
    else:
        led = True
        wiimote.led = cwiid.LED1_ON

def player_control(action):
    """Controls Amarok or Totem - depending on wich one is running.

    Totem takes precedence over Amarok if running. If none is running, Amarok
    will be started ant take the command.

    """
    print action
    # Check if totem is running
    cmd = "ps -A | grep -oP 'totem'"
    fin,fout = os.popen4(cmd)
    isTotem = fout.read()
    isTotem = isTotem.find('totem') != -1
    # Do the actual player action
    if action == 'nexttrack':
        if isTotem:
            cmd = "totem --next"
        else:
            cmd = "amarok -f"
    elif action == 'lasttrack':
        if isTotem:
            cmd = "totem --previous"
        else:
            cmd = "amarok -r"
    elif action == 'playpause':
        if isTotem:
            cmd = "totem --play-pause"
        else:
            cmd = "amarok -t"
    elif action == 'ffwd':
        if isTotem:
            cmd = "totem --seek-fwd"
    elif action == 'fbwd':
        if isTotem:
            cmd = "totem --seek-bwd"
    os.system(cmd)

main()


Where to start with creating a server from which I can retrieve pictures/videos?

Assuming you are looking for:

file transfer over internet securely
a nice browser based interface for uploading/checking/modifying files

I would suggest Owncloud. (Official website)

(Many would think it is overkill but I believe once one tries out such high end tool, other things are trivial and easy.)

For me installing and running Owncloud was not too difficult and I enjoyed learning.

What it has and how it works:
It works using database module (open-source) and php (a programming language). Information of files uploaded is stored in the database. Access is provided via web-interface available on browser or mobile applications. Installing it requires installation of webserver, php and mysql database followed by Owncloud itself.

Files can be uploaded by browser.
Apps available for android, iOS, blackberry, and of course linux and Windows.
Link for video introduction Owncloud 9- youtube.

If you are not running another server applications then setting a server dedicated for owncloud is pretty straightforward.


grub unknown filesystem, Boot-Repair fails

It appears that there is a mixture of efi  and MBR booting this is supported but it is very complicated to set up.
If you have no valuable information on the disk I would recommend a complete reinstall of you OS after you have recreated the disk partition table and reformatted the partitions.  Obviously you will lose all info currently on the disk.  If you wish to recover the info then you can attempt to repair the portion table by other means.  This is not a trivial task and should not be undertaken lightly.  If you wish to pursue this route then I would recommend a considerable amount of research prior to attempting any repair.  It is very easy to make matters worse. A good starting place is Rods Books on EFI and GPT.  There are a number of excellent articles on these topics with instructions and help in implementing both.
You have probably tried to use an MBR type repartitioning tool on a hot portioned disk.  Usually this fails without causing damage as the GPT spec has provision for a protective MBR.  I do not know what the boot repair tool did but it seems to have made matters worse.
Before you start to reinstall decide if you want to use GPT or MBR disk partitions and then use appropriate tools.  Also you should decide on the type of booting you are using.  (EFI or MBR).
By the way is there a particular reason to use Ubuntu 14.04. If not then I recommend using 16.04 the latest LTS release.
Hope this gives you some pointers and goes some way to help you.


Install grub on a multi-partition and multiboot USB flash drive

Multi Install to USB - BIOS/UEFI

Mkusb makes a great base for custom Multi Boot USBs. The following shows how to make a Full install USB, that boots both BIOS and UEFI and then further modify it as a Multi Booter, that even boots ISOs using grub2.

Use mkusb to make a Live system on the Installer USB (2GB or larger).
Use mkusb to make a Persistent system on the Target 128GB USB using default settings with ~25GB persistence, (remaining NTFS partition is used as Windows accessible data partition).

As soon as mkusb finishes, open GParted and delete sdx4, the ISO9660 partition and expand sdx5 into the recovered space, sdx being the device name of the Target drive.

Unplug or remove HDD before proceeding further, (optional but recommended, highly recommended in UEFI mode).
Boot Installer drive, select Try.
Insert Target drive

Start Install Ubuntu...

Select Something else.
Select sdx5, (on the target drive), and click Change.

Select Use as: ext4, Format and Mount point: /.

Don't touch any other partitions (unless adding a /home partition).

Select sdx5 as Device for boot loader installation.
Complete installation.
Cut grub.cfg from sdx5/boot/grub and paste to sdx3/boot/grub, overwriting the existing grub.cfg file.
Boot the target drive and run sudo update-grub to add all drives to boot menu.

Multi Boot

Multiple OS, both Full install and Live/Persistent can be added to the USB.

Create a drive as suggested above, then divide the expanded partition into parts, (sdx5, sdx6, sdx7... in this case).

You can then install Ubuntu on one partition and other OS on the other partition(s).

Divide sdx5 into as many ext4 partitions as you have OS. Size should be about 8GB each or larger.
Boot Live mkusb installer and insert the target drive.
At partitioning selected "Something else".
Choose sdx5 for /.
Install bootloader to sdx5.
Leave all other partition's format boxes unchecked.
Repeat this with sdx6, sdx7, etc, and the OS's you choose to install.
After the last install cut grub.cfg from sdx6/boot/grub and paste to sdx3/boot/grub, overwriting the existing grub.cfg file.
Boot the flash drive and do an update-grub. This will add all the OS to grub.

You can add a few OS ISO's if you wish:

Create a folder in the NTFS partition sdx1 named isos.
Add a few ISO's.
Edit sdx3/boot/grub adding menuentries similar to the following:

menuentry "xubuntu-18.04.1-desktop-amd64 Partition 6" {
 set isofile="/isos/xubuntu-18.04.1-desktop-amd64.iso"
 set root='(/dev/sdx,msdos2)'
 search --no-floppy --fs-uuid --set=root XXXX-XXXX
 loopback loop ($root)$isofile
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
 initrd (loop)/casper/initrd.lz
}

Substitute your sixth, (seventh and eighth), partition's UUID for XXXX-XXXX
vmlinuz may need to be vmlinuz.efi for some versions.
Each ISO can have it's own casper-rw and home-rw persistence files if desired, but it starts to get a little more complicated as you need to add the "persistent-path" to each menuentry.


It looks like you need to set your wifi interface to ad-hoc mode. Below are the instructions step by step to setup an ad-hoc network from Ubuntu Documentation

Linux to Linux peers

tested on 10.04 Netbook Remix using the Broadcom B43 proprietary driver. Broadcom STA did not work properly

Right-mouse click the NetworkManager icon (top right)
Select "Edit Connections"
Click the "Wireless" tab
Click "Add" to edit a new wireless connection
On the wireless dialogue give the connection a name, e.g "Mochudi".

SSID: "Mochudi". The SSID will appear on the NetworkManager for your other
Peers
Mode: Ad Hoc
BSSID: leave blank
MAC Address: leave blank
MTU: leave as automatic

Click "Apply"
Click "Close"

If fixed IP addresses are required edit the IPv4 Settings Tab before closing NetworkManager above:

...as above then...

6a. Click "IPv4 Settings Tab"

Select Method "Manual"
Under Addresses click Add
Type your Address: 10.42.43.1
Type the Netmask: 255.255.255.0

Gateway: leave blank or 0.0.0.0

6b. Click "Apply"

Click "Close"

Do the above for each machine joining your fixed IP address Ad-Hoc network except assign a unique Address to each machine, so 10.42.43.1 becomes 10.42.43.2 for the second computer, 10.42.43.3 for the third, etc.


Email client that supports Gmail in 20.04

Try Mailspring. It's fast, modern, and works with most email services (including Gmail).


You don't have the right to read the directory, that's why you can't see what's inside.
From your terminal, you can use the chmod tools like this :

chmod -R +r android-sdk-linux

This will give you the read right (+r) on all the directory inside the SDK (-R) and you will be able to enter the folder.


Maybe this WebcamStudio software could help:

https://sourceforge.net/projects/webcamstudio/

"WebcamStudio For GNU/Linux creates a virtual webcam that can mix several video sources together and can be used for live broadcasting"


systemd-networkd - interface goes down while renewing lease

I placed the file in the wrong place, it needed to be put here:

/etc/systemd/network/*.network

Where * can be whatever you like.  For me, I named it default (default.network).


How to increase python output lines in terminal ubuntu from an AWS instance?

Did you try setting HISTSIZE=10000 HISTFILESIZE=8000 in .bashrc and .profile in AWS?


If the message is unable to find init, and assuming you have other kernels which are working well then the init in question is likely to be the one in the initramfs for the kernel.  I would compare the sizes of the initramfs files for each kernel in /boot.  You may be able to recover the situation by running update-initramfs -e -k <version> (remember to use the version you are trying to fix).


OP was connecting to vpn.ht VPN via manual PPTP configuration, and having difficulty.

vpn.ht distributes configuration files as .ovpn (OpenVPN). .ovpn files can be downloaded from their servers page.

OP should be configuring as OpenVPN using these .ovpn files. Check here for instructions.


Printing from an HP Desktjet 1000 Laser printer from a notebook running lubuntu 12.04 x86

I just had the same problem, although mine was an HP Deskjet 1300, and was able to solve it after installing the HP CUPS packages found in Synaptic, and the hplip package.

Afterwards I opened "printing", just as you did, but instead of going to properties of the identified printer, I decided to add another one. This time I chose "USB" as the root for the printer, and then, after the system searched for the drivers, I selected the box for "Duplexer Installed".

I changed the name of the printer by adding a letter "a", so I did not get confused in between the printers installed, and it worked just fine.

I am not a pro, I just messed around a bit and I am not sure if the packages I downloaded had anything to do, however, I had not seen the "Duplexer Installed" box before.

Finally, I just removed the previous installed printer.

Good luck!


How to list currently not installed packages?

This should be it:

aptitude -F %p search '!~i'

This will list all packages currently not installed (including virtual packages and packages that have only their configuration files installed). If you don't want virtual packages (that's what Synaptic shows as Not installed), extend the search pattern to:

aptitude -F %p search '!~i!~v'

You probably need to install aptitude, as it's no longer part of the default installation as of Ubuntu 10.10.


Which version of Ubuntu should I use on an old MAcbook pro?

Xubuntu. It's based on Debian and Ubuntu, but it's much faster and reliable. https://xubuntu.org/requirements/


I'd try

pip install python3.3.2 --user

or

wget http://python.org/ftp/python/3.3.2/Python-3.3.2.tar.bz2
tar xf Python-3.3.2.tar.bz2
cd Python-3.3.2
./configure --prefix=/usr/local
make && sudo make altinstall

In both cases You should then try to start it with

$ python3.3


How to install the latest version of Blender in Ubuntu, instead of the old version in the official repositories?

Summary - If you are confused by so many options, simply add the PPA (described below) and update your computer, and everything will be automatically taken care of.
To remove apt version of blender

Use the command
sudo apt purge blender

to remove blender and all its configuration files. Then, you can also run
sudo apt autoremove

to remove the unused dependencies of blender (and also of other apps).
To install the latest version of blender

Extract the .tar.gz file in your home folder. Rename the new directory to blender. Edit the Exec entry of blender.desktop to Exec=/home/your-username/blender/blender %f, and the Icon entry to Icon=/home/your-username/blender/blender.svg.

Then place the .desktop file in .local/share/applications in your home folder, so that it can be searched in the menu. Alternatively, you can also place it in /usr/share/applications (you will need to have sudo access to do that), if you want all users to access it.
To call blender from command line, you can either copy the blender binary file in the extracted folder, or create a symbolic link to it, at /usr/local/bin/blender.
To create a symbolic link, run the command sudo ln -s /home/your-username/blender/blender /usr/local/bin/blender
You can also place the extracted folder to any other location of your choice. Then you would have to edit the .desktop file accordingly.

If you prefer traditional package, you can use the unofficial Blender PPA instead.

sudo add-apt-repository ppa:savoury1/blender
sudo apt update
sudo apt install blender

You can also use the Appimage instead. Download (it is a single file) and double click to run.

You can also use the snap or flatpak versions

sudo snap install blender

or
flatpak install flathub org.blender.Blender

There is no need to set any environment variable or symbolic links. If you use the blender-x.tar.gz, you can simply create a .desktop file and save it in .local/share/applications. If you use the PPA, appimage, or snap or flatpak, that would be taken care of automatically.


How to generate new files from a list in bash

To create an emtpy file, you can use touch. Use xargs to read a file and run a command on each line.

xargs touch < list


Lightdm: Select Window Manager (disappeared?)

The icon does not appear if you don't have any other session type available. This is what happens after a clean install.

You need to install some other packages providing entries in /usr/share/xsessions, you find which packages with apt-file search /usr/share/xsessions.


will reinstalling ubuntu mess with grub?

will this mess with grub?(more unusable boot options or something)

Probably not, GRUB is generally pretty good at working after an upgrade or similar

  is it safer to use windows disk mannager application for formating the partitions instead of gpart?

Most definitely not. Windows Disk Management cannot create ext4 or swap partitions as you would need to run Ubuntu. You would be better off using GParted from the LiveCD when you install Ubuntu or even the partitioner in the Ubuntu installer

  imagine I can't install ubuntu after I formatted the partitions, will this make my machine unbootable? how do I solve this?

You can use Boot Repair from here


I solved it by going to https://www.ubuntu.com/server/livepatch.

I went to "Generate your credentials" and followed the instructions there.

Then I opened my terminal and typed this two commands:

sudo snap install canonical-livepatch
sudo canonical-livepatch enable [TOKEN]

You get [TOKEN] by following the instructions on "Generate your credentials".


how to save CPU logs or GPU usage values?

First decide which CPU stats you want to log

You can choose different statistics to log:

CPU speed (frequency in Mhz or Ghz)
CPU utilization percentage
CPU temperature
CPU average load factor
Further these stats can be segmented for each CPU, ie #1 to #8 for
quad-core hyper-threaded CPU.

For simplicity sake, I'll base this answer using average load factor similar to the answer in: How to log CPU load?

Create a loop for two hours logging every second

You'll need a bash script to loop 7,200 seconds (2 hours) which would look like this:

#!/bin/bash

for ((i=0; i<7200; i++))
do
    uptime >> /home/user/cpuload.log
    sleep 1
done

Parse the data in a spreadsheet

To look at your output use the command:

$ cat cpuload.log
 20:04:06 up 2 days, 14 min,  1 user,  load average: 1.39, 1.12, 0.95

The load average is reporting three variables--last minute, last five minutes and last fifteen minutes. For simplicity sake only consider the last minute load average which is reported every second in our loop.

You can import the file cpuload.log into a spreadsheet and graph the data points over the two hours or simply scroll over the data.
I use Libre Office Calc but all modern spreadsheets can import the file.

Brief points about load average

In the example above the one minute load average is 1.39. This appears dangerously high because anything over .70 deserves investigation and 1.00 means there is a bottle-neck and processes aren't being served and have to wait.

However in your spreadsheet you'll have to divide the load average by the number of CPUs you have. To quickly find this out use the command:

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
2074968
2133093
2094750
1863843
1728562
1855875
1849125
1778156

This shows there are 8 CPUs (it's a quad-core hyper-threaded Intel i-7 3630QM laptop CPU running 1200 Mhz to 3400 Mhz). In this snapshot CPU#1 (called CPU0 internally) is running at 2,0749.68 Mhz and CPU#8 is running at 1,7781.56 Mhz. But I digress, the important thing is to count how many CPUs there are which is 8.

So divide the load average 1.39 by 8 and the TRUE load average is 0.17 which is very respectable. Once again any value over 0.70 deserves investigation and when it hits 1.00 your system is stalling. You can read further here

Using top command to see top 10 processes

To use the top command to see the 10 most resource intensive processes use this command instead of the uptime command:

top -n 1 -b | head -n 17 | tail -n 10 >> /home/user/top10.log

The file /home/user/top10.log will look something like this (repeated every second for two hours):

$ top -n 1 -b | head -n 17 | tail -n 10
 6170 rick      20   0 1437432 537000 126060 S  62.5  6.7   8:50.24 chrome
 2466 rick      20   0 1210040 140568  61864 S   6.2  1.8  22:16.88 compiz
 4111 rick      20   0  742396 248724 185820 S   6.2  3.1  36:26.68 chrome
 6280 rick      20   0   41800   3668   3124 R   6.2  0.0   0:00.01 top
10096 root      20   0       0      0      0 S   6.2  0.0   0:00.47 kworker/0:2
    1 root      20   0  120064   6244   4000 S   0.0  0.1   0:02.23 systemd
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.05 kthreadd
    3 root      20   0       0      0      0 S   0.0  0.0   0:01.31 ksoftirqd/0
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:+
    7 root      20   0       0      0      0 S   0.0  0.0   1:39.28 rcu_sched

NOTE: replace user with your actual user name.

Using top command to get us, sy, id and si CPU values

Similar to the first section, create a bash script to loop 7,200 seconds:

#!/bin/bash

# NAME: ~/bin/cpu-top-summary
# DATE: June 13, 2017
# DESC: Call `top` command every second to obtain CPU(s) stats for
#       us, sy, ni, id, wa, hi, si, and st. Log to /tmp/top-cpu-summary.log
#       with time stamp in hh:mm:ss 24 hour format.
# PARM: $1 number of seconds to run, ie 2 hours = 7200

now="$(date +'%d/%m/%Y')"
printf "top CPU(s) summary for %s\n" "$now" > /tmp/top-cpu-summary.log
for ((i=0; i<$1; i++))
do
    TimeStamp=`date +"%H:%M:%S"`
    printf "$TimeStamp - " >> /tmp/top-cpu-summary.log
    top -n 1 -b | head -n 3 | tail -n 1 >> /tmp/top-cpu-summary.log
    sleep 1
done

When you call the bash script using top-cpu-summary 10 you can see the output for 10 seconds using:

$ cat /tmp/top*
top CPU(s) summary for 13/06/2017
19:17:34 - %Cpu(s): 25.0 us,  9.2 sy,  0.0 ni, 65.4 id,  0.2 wa,  0.0 hi,  0.2 si,  0.0 st
19:17:35 - %Cpu(s): 25.0 us,  9.2 sy,  0.0 ni, 65.4 id,  0.2 wa,  0.0 hi,  0.2 si,  0.0 st
19:17:36 - %Cpu(s): 25.0 us,  9.2 sy,  0.0 ni, 65.4 id,  0.2 wa,  0.0 hi,  0.2 si,  0.0 st
19:17:37 - %Cpu(s): 25.0 us,  9.2 sy,  0.0 ni, 65.4 id,  0.2 wa,  0.0 hi,  0.2 si,  0.0 st
19:17:38 - %Cpu(s): 25.0 us,  9.2 sy,  0.0 ni, 65.4 id,  0.2 wa,  0.0 hi,  0.2 si,  0.0 st
19:17:39 - %Cpu(s): 25.0 us,  9.2 sy,  0.0 ni, 65.4 id,  0.2 wa,  0.0 hi,  0.2 si,  0.0 st
19:17:41 - %Cpu(s): 25.0 us,  9.2 sy,  0.0 ni, 65.4 id,  0.2 wa,  0.0 hi,  0.2 si,  0.0 st
19:17:42 - %Cpu(s): 24.9 us,  9.2 sy,  0.0 ni, 65.4 id,  0.2 wa,  0.0 hi,  0.2 si,  0.0 st
19:17:43 - %Cpu(s): 24.9 us,  9.2 sy,  0.0 ni, 65.4 id,  0.2 wa,  0.0 hi,  0.2 si,  0.0 st
19:17:44 - %Cpu(s): 24.9 us,  9.2 sy,  0.0 ni, 65.4 id,  0.2 wa,  0.0 hi,  0.2 si,  0.0 st


Fixed this! Just needed to install another version of the package. Then just execute

packettracer

And everything will work fine!


How to dual boot Kubuntu without booting into GRUB when I turn on my computer?

go into terminal and  run command

sudo gedit /etc/default/grub

and change GRUB_TIMEOUT value lesser by default it wait for 10 sec so you can reduce it   if you don't want to see grub menu then do

GRUB_HIDDEN_TIMEOUT=3
GRUB_HIDDEN_TIMEOUT_QUIET=true

then run

sudo update-grub

and restart system

it will not show grub menu if you want to start Kubuntu then you have to press key within 3 second otherwise default OS will start
if you want to know how to change default OS then refer this link


Speakers and Headphones play at the same time. Lenovo ThinkPad

On my Lenovo G700 the combination microphone / headphone jack ("combo audio jack") does not automatically mute when plugging in headphones. The workaround for this is pretty low-level and you will need to be very comfortable with admin-ing your machine. Here is how to do it:

First download and build the "hda-verb" binary, which is a low-level debugging tool:

ftp://ftp.suse.com/pub/people/tiwai/misc/hda-verb-0.4.tar.gz

Next take a look at your sound card's codec information under "/proc/asound". For my setup this was the command:

$ less /proc/asound/card0/codec#0

Look for the node number that has "OUT EAPD Balanced" or "Speaker at Int ATAPI" labels. On my setup, this was the node "0x0d".

Now look for your sound card's device path under "/dev/snd". Experiment with anything that has a name like "/dev/snd/hwC0D0", which was my setup.

Run this command to mute the internal speakers:

$ sudo hda-verb /dev/snd/hwC0D0 0x0d SET_CONN 1

Here you want to replace the "0x0d" with whatever node number you found above, and you will want to experiment with different device paths if necessary. Use "SET_CONN 0" at the end to unmute the internal speakers. If you have done this right, the headphone audio output will not change.

I created "mute_internal_speakers" and "unmute_internal_speakers" scripts to simplify this.


Run this in terminal: env LD_PRELOAD='/usr/$LIB/libstdc++.so.6' steam


Sharing files in LAN through Samba or SSH

First of all: if you want to share files, there are several different protocols of interest: Samba (SMB), NFS, FTP, SSH/sFTP/SCP. Samba is the easiest if a Windows computer is involved, but you can use it also between two Ubuntu (and even Mac OS) machines. SSH is a nice thing for Ubuntu, because it's a very powerful tool - e.g. running rsync over SSH is a command method to keep two directories synchronised. But I'd choose SMB because you mention Windows and probably setting up one protocol/server is enough for the beginning.

Only three important hints for further research about other protocols:

Think about encryption - is it necessary that the protocol is encrypted or do you want to trust your LAN? (FTP is not encrypted, SSH/sFTP/SCP is)
Do need to transfer huge files? (SCP is really slow compared to SMB in Gigabit networks! Google benchmarks if you are interested.)
Is it necessary to keep the file permissions of the files transferred?

Now your questions:

1. When I share files between two Ubuntu machines via LAN, do I need Samba on both machines?

No, not the Samba server. There will be always a server and a client. You can access the shared folders on the server from the client - not the other way around. In other words: the copying progress bar will be always on the client, never on the server. But with two Ubuntu machines, both of them can be client and server at the same time, if you want. The client is shipped with Ubuntu per default, the server is installed automatically when you share a folder for the first time with Nautilus.

2. Without Defining permission on computer 1 I can see all files under / on computer 2. Is their any way to stop that visibility?

That's not true for SMB/Samba. There are certain shared folders and only these are visible to the clients. Check the folder /var/lib/samba/usershares/ and the file /etc/samba/smb.conf, if the path / is shared. Probably you are connecting with SSH and not with SMB. Then you are right, usually everything is visible and you have to set the file and directory permissions correctly. You can find more details about this here: Simple & easy way to jail users

3. Which user and password do I have to use while accessing other Ubuntu machine through Samba?

Usually it's simple: just use any user and password of the other machine. Only in very special cases the user's normal password differs from his Samba password. You can change the Samba password separately with the command smbpasswd, but you should really have good reasons to use two different passwords.

You can allow shares without password. There are many things to say about this, but probably this Nautilus screenshot helps for the beginning:

4. How to share files without GUI using the terminal?

The most common use case is SSH/SCP then probably. Just type the following in the client's terminal to copy /path/to/file1 on the client to /path/to/file2 on the server:

scp /path/to/file1 server:/path/to/file2

server can be an IP address or a domain name. Or another method already mentioned in other answers with rsync:

rsync /path/to/file1 server:/path/to/file2

With Samba you probably would use smbmount (which is not shipped with Samba per default) in order to mount a network share on the client. Then you can use it normally. There are many ways to mount a Samba share. If you are using Gnome, gvfs-mount might be the easiest method:

gvfs-mount smb://server/nameOfsharedFolder
cd ~/.gvfs/*

5. Why is the server not showing up in Nautilus / Network on the client?

As far as I know, the first time it doesn't show up there. After connecting to it once, you'll find it there. The first time, you will have to click "Windows Network", then "Workgroup" and then you'll see your server - hopefully. At least this was the result of my tests.

6. How to find the other system without knowing name or IP of the other system in LAN?

You can use nmap in the terminal, for example:

nmap 192.168.0.*

if 192.168.0.0 is your LAN. This will print you all network clients in your LAN (which can be discovered). Sometimes this might help, if other machines don't show up under Network.


I think this is because gconf-editor is being phase out in favor of dconf-editor. I had a similar problem (actually the opposite, I was trying to disable auto_raise and it wouldn't work). It seems that the setting in gconf-editor is overwritten by the setting in dconf-editor.

sudo apt-get update
sudo apt-get install dconf-tools
dconf-editor

Navigate to org/gnome/desktop/wm/preferences.


Problem importing Firefox bookmarks to Chromium

I just updated Ubuntu (not upgraded, I still have 13.04) and Chromium updated to 30.0.1599.114 (Developer Build 30.0.1599.114-0ubuntu0.13.04.2) Ubuntu 13.04 and I can now import from Firefox!

Thanks to @ChrisCarter for attempting to help me solve my issue, update did it!


I imagine that the OP meant he want have the Gnome Desktop environment on his or her Ubuntu 14.04.

There are two possible answers here:

Use the version distributed by Ubuntu Gnome 14.04, which is the Gnome 3.10 version. This is recommended as it does not need to add PPAs.

sudo apt-get install ubuntu-gnome-desktop

which should work out of the box. This will install the gnome-shell and a series of default applications for the Gnome Desktop experience. You can install just gnome-shell if you want, but be warned that this would be an untested (and unsupported) configuration - the desktop configuration is made assuming the presence of the default apps(1).

This will install a package called gdm too, which is the "Display Manager" (the program that shows you the login screen --- and that will setup the basic graphic environment), and will ask you if you want to use gdm or lightdm (the original Display Manager of Unity). In principle you can choose one of them; in practice sometimes the Gnome Desktop misbehaves if you do not use gdm.
Use the new Gnome 3.12, with the PPA.  These are experimental packages, you can break your system, and you are supposed to do that only if you are confident you can manage the breakage (as clearly stated in https://launchpad.net/~gnome3-team/+archive/gnome3-staging)

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

If they break your system, you get to keep both halves.

Footnotes:

(1) consider that this is normally not a problem. Linux application for one desktop will generally run on all the others --- I have Ubuntu Gnome with Thunar File Manager (from Xubuntu) and digiKam (from Kubuntu) photo manipulation program, and the only problem is that the "graphical appearance" could be a bit inconsistent... which I really don't care.


Why does Updating force the user to download complete cache packages

I'm afraid this isn't a feature of a Debian-based system. STATUS_ACCESS_DENIED is correct about integrity checking. gpg keys are stored for repositories. Release files are stored in repositories and are signed. Those release files contain checksums for the various Package files, which contain lists of packages. Each package description contains checksums for each component as a whole.

Debian has done work to reduce the bandwidth required for apt-get by using package diffs, but they don't seem to reduce the bandwidth required to do an apt-get upgrade, only apt-get update (not the packages themselves, only the Package files). I've been told that Ubuntu doesn't support this. For a description see http://www.debian-administration.org/articles/439

You may be interested in the Exherbo or Funtoo. See https://unix.stackexchange.com/questions/36357/git-based-package-manager-installer-for-linux. Git wasn't around when the debian project was created. It signs individual objects and keeps a chain of checksums to ensure integrity.


How to cat file with limit of printed characters from each line?

With the cut tool you can limit the output to 100. Since you only interested in the characters hence the columns they occupy this should do that nicely:

cut -c-100 file

In case you wish to remove the spaces in there this would help:

sed 's/ //g' file | cut -c-100

See: man cut

Using awk:

awk '{ print substr( $0, 0, 100 ) }' file

Getting rid of spaces again if required:

awk '{ gsub (" ", "", $0); print substr( $0, 0, 100 ) }' file

AWK:

gsub (" ", "", $0): find " "(spaces) and replace with "" globally in target string $0.

substr( $0, 0, 100 ): it returns 100 number of chars from string $0, starting at position 0.


For 11.10

The version packaged for 10.04 seems to work in oneric (11.10). You can use it to install the older Glade:

Download the .deb file, you can find it here, please click on your architecture.
Install the new deb by double-clicking on it.
Pin it to avoid it from updating.

You need to do it from the command line, pinning it from synaptic as I wrote in a comment will only work while updating in synaptic (as I learned today):

echo "glade hold" | sudo dpkg --set-selections

Note that this approach is not very good: you will not receive security updates to glade (it doesn't look like a risky package) and if some package depends on the new glade version it's not going to be upgraded/installed.


I interpreted the ps output in a wrong way - I tought the number represented the used port, instead it was the PID.

The NGINX problem had a different source (still strange), and this solved the problem:

sudo fuser -k 80/tcp


We see that there are two wireless networks with the same name: SKY7D544. I am quite confident that most of the reason for the disconnects is that your wireless device is roaming between them, always searching for a better connection.

If these are routers over which you have administration priveleges, I suggest that you rename one or both; something like SKY7D544A and SKY7D544B. Then ask your wireless to connect to the strongest of the two and I'm confident it will stay and not disconnect.

If you are unable to rename them, I suggest you ask Network Manager to bind to the stronger of the two like this: Ubuntu connect drops. Worked for a while then started dropping again


There is an open bug in Ubuntu Launchpad:
Ubuntu 16 Kernel BUG (“Oops: 0000 [#1] SMP”) related to amdgpu

The workaround to fix the issue is installing the latest kernel package from mainline repository.


Mikogo support helped me. From Does Mikogo run with 64bit Linux? – Mikogo Help Desk:

  You have to install the 32bit libraries with the following command:

sudo apt-get install ia32-libs

  Starting with version 13.x, the ia32-libs can no longer be
  installed. If you are using a 64bit Linux system with version 13 or
  higher, please enter the following command:

sudo apt-get install libgtk2.0-0:i386 libnss3:i386 libcurl3-gnutls:i386 libidn11:i386 libpango1.0-0:i386

  libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 librtmp0:i386 libxft2:i386

  followed by this command:

sudo apt-get install libxtst6:i386


How do I install Ubuntu and Windows on separate hard drives?

Here's my recommendation, assuming any data on the XP drive is already backed up.

With only the 250GB drive connected, use the XP CD-ROM to format the drive and install XP from scratch.
Now, connect the 2TB drive and set the hard disk boot order in the BIOS so that it boots from the 2TB drive first. What should happen after that is that Windows XP will no longer boot (only temporary :)
Boot from the Ubuntu Live CD, and start the installer.
You will get one of the below two screens. Choose the highlighted option (don't worry, we won't delete Windows...)

This is the important part: Select the correct (blank) hard disk by checking the size displayed, as shown below:

Once done, reboot, and at boot up you should get a menu allowing you to choose between booting Ubuntu, or booting Windows.

Explanation:

Installing Windows first is necessary because if installed after Ubuntu, it will overwrite Ubuntu's bootloader (Grub) and require you to use the LiveCD to fix it. Ubuntu on the other hand will detect Windows on the other hard disk automatically and add it as a boot option.


Flash player not detected for some sites and youtube videos in Chromium

you need to install pepperflash for chromium now because it no longer accepts Netscape like plug-ins (the Firefox flash plug-in)

sudo apt-get install pepperflashplugin-nonfree

Restart chromium after installation for the changes to take effect.


Try GMapCatcher https://code.google.com/p/gmapcatcher/. It has support for downloading maps from various providers, including OpenStreetMaps. I found it to be quite fast even when browsing online, as compared to the web version of google maps.

It has lots of options (https://code.google.com/p/gmapcatcher/wiki/User_Guide). I have not tested all of them, but it seems to be promising.


Ubuntu 17.10 solution:

Run ibus-setup
Disable shortcut for changing layouts (delete it).
Set Super+Space shortcut in System Settings -> Keyboard.

It's a conflict between IBus and System Settings shortcuts.


Latest kernels should fix that, as mentionned on Launchpad.

Reported working on 3.17-rc6

You can find 3.17 kernel in DEB package on http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17-utopic/

Piece of warning: you might encounter some issues with kernels not released by Canonical (ubuntu), but it should anyhow "work".


This was quite the annoying one, but:

sudo apt-get install kdelibs5-plugins kdelibs5-data oxygen-icon-theme


Add categories to gnome shell (within activities view)

This is a feature that comes only with older versions of GNOME. The screenshot you are looking at is of an older version of GNOME Shell. In versions of GNOME prior to 3.8, there was a category selector on the right side as your screenshot shows. In GNOME 3.8, the category filter was removed and applications can now be launched using either a "Frequent" or "All" filter.

Compare the following two screenshots of the GNOME Activities Overview from two successive releases of GNOME.

GNOME 3.6 Activities Overview

This screenshot from the GNOME 3.6 Activities Overview Release Notes shows the application categories on the right side.

GNOME 3.8 Activities Overview

This screenshot from the GNOME 3.8 Release Notes shows the lack of categories and the "Frequent" and "All" filters at the bottom of the screen instead.

This change in the Activities Overview was an intentional design change. More can be read about this design change in the "Stage 2" section of this application picker design document on the GNOME wiki.


It is available at various 'flash sales' at a price of €169.90 . The last sale was on for a limited time on the 11th of Feburary, they may be another some time soon.

You can find out more here:

https://insights.ubuntu.com/2015/02/06/bqs-new-aquaris-e4-5-ubuntu-edition-the-smartphone-that-puts-content-and-services-at-your-fingertips/
http://www.bq.com/gb/ubuntu.html

I think it is only available from BQ.com:

  9th February 2015, London and Madrid: The world’s first Ubuntu phone – the Aquaris E4.5 Ubuntu Edition – will be available across Europe from BQ.com through a series of Flash Sales over the coming weeks
   ....
  Operators such as 3 Sweden, amena.com in Spain, giffgaff in the UK and Portugal Telecom are offering SIM bundles at purchase, exclusively from the BQ website, for buyers in those regions.


Not sure if it will apply to your situation but yesterday I had to format my USB drive to FAT / FAT32 for Ubuntu 14.04.3 to be able to read it - I had to create a formatted USB to then allow me to then create a Live USB stick.
I was on a Mac and used the Disk Utility to do it. Mac > Applications > Utilities > Disk Utility. So maybe could look at that possibility?>
Maia


MySQL phpMyAdmin not showing in web browser in Ubuntu LAMP server

LAMP means "Linux Apache MySQL PHP" and PhpMyAdmin is not a part of it.

The command for PhpMyAdmin installation is:

sudo apt install phpmyadmin

For more detailed steps, here you are a good guide.


I ran into this problem as well.

It seems like apache2-dev-2.4.4-6ubuntu5 (the new version just uploaded today) now conflicts with and provides apache2-prefork-dev. See here.


Have you tried sudo apt-get install connman? You can also look for it in the software center.


Unable to Install UBUNTU on asus vivobook X510U dual bootable

after starting the setup when it asks "Installation type", look for the option "Something else" and continue. Then on the next screen you will see your created partition. Format/"New Partition Table" the new partition/freespace to ext4 format and set the mount point to "/". Select the primary hard drive for "Device for boot loader installation:". In case you have only single hard drive it will be selected by default. Then continue with the "Install Now". Rest process with be self explanatory.


The issue turned out to be that the OP's computer ran out of RAM, as evidenced by these lines from the syslog:

Mar 28 15:43:50 hugues-HP-ProBook-4530s kernel: [ 5020.228198] Out of memory: Kill process 25673 (node) score 426 or sacrifice child
Mar 28 15:43:50 hugues-HP-ProBook-4530s kernel: [ 5020.228234] Killed process 25673 (node) total-vm:1714884kB, anon-rss:501900kB, file-rss:0kB, shmem-rss:0kB
Mar 28 15:43:50 hugues-HP-ProBook-4530s kernel: [ 5020.264947] oom_reaper: reaped process 25673 (node), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Mar 28 15:43:57 hugues-HP-ProBook-4530s kernel: [ 5028.658675] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
Mar 28 15:43:58 hugues-HP-ProBook-4530s kernel: [ 5029.400548] sysrq: SysRq : This sysrq operation is disabled.
Mar 28 15:43:58 hugues-HP-ProBook-4530s kernel: [ 5029.752964] sysrq: SysRq : This sysrq operation is disabled.
Mar 28 15:43:59 hugues-HP-ProBook-4530s kernel: [ 5030.203206] sysrq: SysRq : This sysrq operation is disabled.
Mar 28 15:43:59 hugues-HP-ProBook-4530s kernel: [ 5030.733980] sysrq: SysRq : Emergency Sync

In the chat, the OP said he only has 4GB of RAM and disabled swap, so running out of memory was definitely the issue.

The only fix here is to buy some more RAM.


Getting error while starting Ubuntu 18.04.2 LTS

In terminal...

gedit /home/usr/.profile

Open gedit preferences, and enable line numbering...

Locate lines 29-30.

Copy lines 25-35 to the clipboard.

Edit your question here, paste in the clipboard, select the pasted text, hit the {} icon to make the text human readable.

I'll look at it and suggest a fix.

Update #1:

Remove the two lines at the end of .profile...

eval $(E: Linuxbrew directory detected, but it seems broken.
   Try to remove '/home/linuxbrew/.linuxbrew' and install again./bin/brew shellenv)


What do I need to get started with thin clients?

You can use X2Go for thin clients, both on the server and on the clients. You'd probably network the servers to add a shared storage using nfs or similar, and LDAP for users and groups. Then you install the software you need on all the computers. That means your user can log onto any server with his username and password and get his desktop and files. Then you can use DNS for load balancing, for instance.

There are many ways of doing it. The more specified your question is, the more detailed the answer can be.

I think actually X2Go has load balancing included, but I've never tried it. www.x2go.org has more info.


Annotating PDFs in Evince and then viewing the output in Acrobat / Adobe products

I believe you can do what you want with master-pdf-editor. It will annotate and play nicely with Adobe. Only snag is that it is free as in beer, but not as in speech,

http://code-industry.net/free-pdf-editor.php


Rotate touchscreen and disable the touchpad on Yoga 2 Pro in rotated mode

Info:

I think the Hotkey Fn+F6 works since some time If you install the latest Ubuntu updates.

Rotate the screen and touchscreen input 180 degrees

create the script /usr/local/bin/rotate-screen.sh
(I enhanced that script there at gist so it rotates 90° also)

#!/bin/bash
# This script rotates the screen and touchscreen input 180 degrees, disables the touchpad, and enables the virtual keyboard
# And rotates screen back if the touchpad was disabled

isEnabled=$(xinput --list-props 'SynPS/2 Synaptics TouchPad' | awk '/Device Enabled/{print $NF}')

if [ $isEnabled == 1 ]
then
    echo "Screen is turned upside down"
    xrandr -o inverted
    xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
    xinput disable 'SynPS/2 Synaptics TouchPad'
    # Remove hashtag below if you want pop-up the virtual keyboard
    # onboard &
else
    echo "Screen is turned back to normal"
    xrandr -o normal
    xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
    xinput enable 'SynPS/2 Synaptics TouchPad'
    # killall onboard
fi

and give it executable rights:

sudo chmod +x /usr/local/bin/rotate-screen.sh

then

1.

create *.desktop file in /usr/share/applications/

gksudo gedit /usr/share/applications/rotate-screen.desktop

2.

Paste below text:

[Desktop Entry]
Type=Application
Terminal=false
Icon=/usr/share/icons/hicolor/48x48/apps/un-reboot.png
Name=rotate-screen
Exec=/usr/local/bin/rotate-screen.sh
Categories=Utility;

Then run the script via the Unity launcher startmenu (type "rotate-screen")

Source:

https://askubuntu.com/a/446125/34298


You should move your /home directory to the other partition.  See How can I move my /home directory to another partition if it's already part of the / partition?.