How to select video quality from youtube-dl?

To download a video, you type the URL after the command like so:
youtube-dl 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

To select the video quality, first use the -F option to list the available formats, here’s an example,
youtube-dl -F 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

Here’s the output:
[youtube] Setting language
[youtube] P9pzm5b6FFY: Downloading webpage
[youtube] P9pzm5b6FFY: Downloading video info webpage
[youtube] P9pzm5b6FFY: Extracting video information
[info] Available formats for P9pzm5b6FFY:
format code extension resolution  note
140         m4a       audio only  DASH audio , audio@128k (worst)
160         mp4       144p        DASH video , video only
133         mp4       240p        DASH video , video only
134         mp4       360p        DASH video , video only
135         mp4       480p        DASH video , video only
136         mp4       720p        DASH video , video only
17          3gp       176x144
36          3gp       320x240
5           flv       400x240
43          webm      640x360
18          mp4       640x360
22          mp4       1280x720    (best)

The best quality is 22 so use -f 22 instead of -F to download the MP4 video with 1280x720 resolution like this:
youtube-dl -f 22 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

Or optionally use the following flags to automatically download the best audio and video tracks that are available as a single file:
youtube-dl -f best 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

If you encounter any error during the muxing process or an issue with the video quality selection, you can use one of the following commands:
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

or as Gabriel Staples pointed out here, the following command will typically select the actual best single file video quality resolution instead of video quality bit-rate:
youtube-dl -f best 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

These commands will ensure you download the highest quality mp4 video and m4a audio from the video as a single file or will merge them back into a single mp4 (using ffmpeg in my case). If ffmpeg or avconv is not available, youtube-dl should fall back to the single file -f best option instead of the default.
Click here for more detailed information and some different examples.
Also, click to see this related answer by Gabriel Staples.

Source: www.webupd8.org/2014/02/video-downloader-youtube-dl-gets.html
Source: github.com/rg3/youtube-dl


Accidentally deleted a dependency file. What do I do now?

You can find out which package thinks it has qt5widgets.so with

dpkg -S qt5widgets.so

Then, force the reinstallation of that package with

sudo apt-get install --reinstall packagename


Ubuntu lets me know an upgrade is available; never Installs It

upgrade via the terminal then since this sounds like a bug. It might be fixed already so I suggest you upgrade and report back if it's still an issue.

check what updates that are available with (always do this first):

sudo apt-get update

install those upgrades with (this will install all upgrades available):

sudo apt-get upgrade

and install new kernels with: (Do not confuse this with do-release-upgrade since that upgrades the computer to a new release)

sudo apt-get dist-upgrade

If you wanna do it in one command here it is:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade


How to release all IP addresses in my LAN network

It is not possible to force clients to release their IP's. The client could release its own dynamic IP (ex: sudo dhclient -r eth0)

Try make small release time, ISC DHCP server has such configuration. Default is:

default-lease-time 86400;
max-lease-time 86400;

ie 24h, Try with default-lease-time 1800 ie 30min or even less.

References:

Force the DHCP server to renew the IP address of a client machine, without doing anything in client machine
isc-dhcp-server

If you using other DHCP server then ISC (or DSL routers), Most of them provide option to set Release Time.


Unfortunately, I don't know the answer to the first question (If someone knows, please edit this answer!). I do know the answer to the second.

You will need to install a utility called xclip.

Install xclip

sudo apt-get update
sudo apt-get install xclip

To view the clipboard:

xclip -o -sel p

or if nothing appears / error:

xclip -o -sel c

What these options mean:

xclip: the program
-o: Output to stdout (Standard Out, in this case, the terminal)
-sel: Select clipboard
-p: primary clipboard. Pretty much used for all copy/cut operations. (right-click, shortcut keys, etc.)
-s: secondary clipboard. Pretty much not used anymore. :)
-c: clipboard. Generally used for shortcut key copy/cut.

Which one should I care about?

The primary one. :)


How can I get my Bluetooth adapter working on a Toshiba Satellite m645?

I would strongly suggest installing blueman  - which is a Bluetooth manager with a lot of options and, in my experience, much better support for devices.

You can install the tool by clicking the little package icon in the above paragraph or opening a terminal and typing:

sudo apt-get install blueman


Can a Windows 8 partition be mounted in Ubuntu if "fast startup"is switched on?

Windows 8 - when sent to its fast-startup shutdown - does not actually shut down. It hibernates, which means that the session is stored and will be resumed - which obviously means the status of the partition should not change in the meantime.

As such, it flags the partition with a so-called hiberfile, which is a physical file on the partition that you will be prompted to delete when you try to mount a hibernated partition.

You can, however, mount the partition in question as read-only through the mount -r option. That will enable reading the files, but not writing to the partition.


After a bit of searching I found a workaround for the issue I was experiencing. Apparently there is an issue with the video drivers that are included with the steam distribution and Ubuntu past version 14.xx.

The workaround was to delete the following files from the steam directory:

~/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6
~/.steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1
~/.steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libgcc_s.so.1
~/.steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6
~/.steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libxcb.so.1

Doing so forces steam to use the drivers that the OS is using instead of the open source drivers they include.

The link that got me this information is https://github.com/ValveSoftware/steam-for-linux/issues/3820.


Firefox not closed properly when loging out

Apparently there is no dedicated file to write to like there used to be. It was the /etc/gdm/PostSession under Gnome but isn't available since apparently Unity. And placing a script under /etc/rc0.d/ and /etc/rc6.d/ will not work since they are only executed after Xserver is shut down.

However there is an event called gnome-save-yourself fired when gnome has been demanded to log out. I is what gedit for instance will implicitly call. And Seamus Phelan made a python script to listen to the event and run your script when caught.

Here's the link to the solution : Script Execution at user logout (non root user)

Follow instructions and then all you have to do is place your script that may look like this:

#! /bin/sh
#Requires wmctrl
wmctrl -c firefox;
gmusicbrowser -cmd "Quit";
exit 0;

where the option -c gently closes Firefox as does -cmd "Quit" for gMusicBroswer.
Both Firefox and gMusicBrowser need to be closed properly which they do not.

A probably better way would be to check the use of SIGTERM, SIGKILL and kill timeout in Ubuntu and the programs but I don't know enough about it.


Catalyst 13.1 Installation on Ubuntu 12.04 : debclean not found

Just try this link. It may help. At least it will guide you how to cover the problem.

Regards.

P.S.:  I have ATI  Mobility Radeon HD 4xxx series and it worked for my cause.


juju bootstrap using maas unable to ssh into nodes

Found this post as I just happen to have had the same symptoms. Maybe you have after all the same problem then.

When bootstrapping Juju I got the same ssh login attempt displayed as you. Then I had a look at my virt-manager and noticed that the machine was not start. I then tried to start the machine by using MAAS GUI. Although, within the MAAS GUI, it stated to be allocated to the user, in actual fact it didn't get started in the KVM (by checking it through virt-manager).

This confirmed to me that there is a configuration problem with MAAS rather than with Juju. I checked a couple of things and then noticed that I didn't create a user directory and SSH key for the MAAS user as outlined with https://maas.ubuntu.com/docs/nodes.html.

After having done so, MAAS could successfully start and stop my KVM machines and Juju did so likewise.

Below are the relevant lines copied from https://maas.ubuntu.com/docs/nodes.html which resolved the problem for me.

If you want to use ssh you’ll need to generate a ssh key pair for the maas user. By default there is no home directory created for the maas user:

sudo mkdir /home/maas
sudo chown maas:maas /home/maas

Add a login shell for the maas user:

sudo chsh -s /bin/bash maas

Become the maas user and generate a SSH keypair:

ssh-keygen

Then add the public key to /ubuntu/.ssh/authorized_keys on the vm server so virsh can use ssh without a password:

ssh-copy-id -i ~/.ssh/id_rsa ubuntu@10.0.0.2

As the maas user, test virsh commands against libvirt at 10.0.0.2:

virsh -c qemu+ssh://ubuntu@10.0.0.2/system list --all


unable to boot to windows, boot-repair fails

First - fix Windows booting, second - fix GRUB2. Let's start with Windows booting:

Boot from Windows 7 DVD and after choosing language options, start the console:
"Repair your computer" -> "Use recovery tools..." -> "Command prompt".
In the console run the following command to re-install Windows bootloader:

> bootrec /fixmbr

Then rebuild bootsector if it is corrupted, just to be sure:

> bootrec /fixboot

After that You should be able to boot into Windows through the standard Windows booting - no GRUB, no questions - just power on and boot into Windows as in single-boot Windows machine. Now, when Windows boots correctly, it is time to re-install GRUB2:

Boot from Ubuntu Desktop CD and run Terminal. Then mount the / filesystem of
existing Ubuntu installation (/dev/sda2 in this example, but Your case may be different) as well as additional resources:

$ sudo mkdir /mnt/ubuntu
$ sudo mount /dev/sda2 /mnt/ubuntu
$ sudo mount --bind /dev /mnt/ubuntu/dev
$ sudo mount --bind /proc /mnt/ubuntu/proc
$ sudo mount --bind /sys /mnt/ubuntu/sys

After that, chroot to mounted directory and reinstall GRUB2:

$ sudo chroot /mnt/ubuntu
# grub-install /dev/sda
# exit

Reboot and GRUB2 is back. GRUB2 installation should automatically detect all available operating systems and put them into GRUB2 boot menu.


How to Download a file from a VPS running Ubuntu 14.04 to my local machine

You said you use windows, but not which version of windows. Windows 10 has Linux subsystem. If you have Windows 10, the link should show you how to enable/use Linux subsystem under windows 10. Once you have it setup and running, you can use a program under Ubuntu called rsync to securely download file from remote linux server using ssh like this:
rsync -chavzP --stats user@remote.host:/path/to/copy /path/to/local/storage

rsync ensures integrity of the file, ssh ensures file transferred securely.
There is a second easier way to do it. but it's not too secure and file might get corrupted, if it's a large file and your internet line is dodgy.
Install apache web server on remote server sudo apt install apache2 then cp your wallet file to apache root folder like this: cp wallet.dat /var/www/html after that just open you browser and download the file by going to http://your ip of server/wallet.dat.
Hopefully one of the method works for you.


Why are Last.fm's features unavailable to Banshee users who don't subscribe to the service?

Banshee uses a newer version of the Last.fm API which requires you to be a subscriber, https://bugzilla.gnome.org/show_bug.cgi?id=541227. Rhythmbox uses (or did anyway) a deprecated version of the API that did not require you to subscribe to Last.fm.


Problem Updating Initramfs While Setting up Dual Boot Encryption

SOLVED: For some reason cryptsetup wanted 'luks-06866a0d-3196-400a-86ce-7fd6eef414d6' in the name field of crypttab instead of 'nvme0n1p6_crypt'.


How to correctly launch application using its desktop-file copied to GNOME flashback desktop?

Public bug was reported to launchpad as bug 1875317.

This functionality will be available soon in focal-updates pocket.


How do I fix "The plugin "External Tools" could not be loaded. An error occured: Plugin loader "python 3" was not found)" error in GEdit?

You must and should rollback to default Python version, i.e., 3.8.2 in 20.04 since there are some libraries which are required by some packages installed in the system only for the default version of Python that may not be available or compatible with other versions. Since you've installed Python 3.8.3 from source, the files were copied in /usr/local/ and /usr/local/bin/python3 is created which a symlink, a.k.a, symbolic link or soft link, of /usr/local/bin/python3.8.
The default value of PATH contains /usr/local/bin before /usr/bin, thus given priority and the reason behind invoking Python 3.8.3 instead of 3.8.2 whenever python3 or python3.8 is called (since default Python is installed in /usr/bin).
To revert back to the default python3 won't take much time for you. You have 3 options to revert back.

Removing the symlink: Just delete /usr/local/bin/python3. Yes that's it.

Recreate symlink: You can make /usr/local/bin/python3 to point to /usr/bin/python3.8 or /usr/bin/python3 (which is already a symlink to /usr/bin/python3.8 as per your message in general room).
To recreate symlink, use ln with s and f options, i.e.,
sudo ln -sf /usr/bin/python3.8 /usr/local/bin/python3 # You may replace /usr/bin/python3.8 with /usr/bin/python3 as explained above

Giving /usr/bin priority (overkill): Edit /etc/environment and place /usr/bin before /usr/local/bin.
Warning!!! You should handle /etc/environment with care. Don't touch or do anything unless you know what you're doing.
Alternatively, you can place PATH="/usr/bin:$PATH" in /.profile.
Once done, logout and relogin to make changes take place.

Since you've installed Python 3.8.3 from source, you need to delete files manually as Python don't provide uninstall option for make. To delete them run:
# From /usr/local/bin
cd /usr/local/bin
sudo rm 2to3 2to3-3.8 easy_install-3.8 idle3 idle3.8 pip3 pip3.8 pydoc3 pydoc3.8 python3 python3.8 python3.8-config python3-config
# From /usr/local/include
sudo rm -r /usr/local/include/python3.8
# From /usr/local/lib
cd /usr/local/lib
sudo rm -r libpython3.8.a pkgconfig python3.8
# From /usr/local/man/man1
cd /usr/local/man/man1
sudo rm -r python3.1 python3.8.1
# From /usr/local/share/man/man1
cd /usr/local/share/man/man1
sudo rm -r python3.1 python3.8.1


How do I make package files install to the correct location?

I'd be able to give you a more complete answer if I could see the package. From what you've provided, your package.install file should look like:

foo.py     usr/bin
debian/app.desktop     usr/share/applications

Also make sure that package.install (replace package with the actual name of your package) is in the debian/ dir.

You should take a look at the packaging guide and the man page for dh_install


installing linux to usb, didn't change boot loader installation, can't get into windows

You have a UEFI capable machine, and is sounds like you did a full install to the USB stick.  You select whether you are running in UEFI mode in the UEFI Settings/BIOS (not the legacy or compatiblity setting).  You did not have the USB present when you ran boot report, so we can't tell how it was created, but for UEFI, at a minimum it should have an EFI partition, a swap partition, and the root partition.

The Ubuntu bootloaders should have been installed to the USB's EFI partition, but a common problem is that they instead get copied to the internal disk's EFI partition, which looks like what happened (The files under /EFI/ubuntu/...  These bootloaders are just files, so you can copy them to the same directory on the USB's EFI partition.  Also, put them into the USB's /EFI/Boot directory:  Copy shimx64.efi into /EFI/Boot/bootx64.efi and also copy grubx64.efi to /EFI/Boot/grubx64.efi.  This will work whether or not secure boot is enabled.  This should run grub off the grub config file in /EFI/ubuntu/grub.cfg.

The MBR bootloader on SDA is useless on a GPT disk without a grub-bios partition, and for UEFI, should be ignored.

Somewhere along the line, the Windows nvram entry to boot Windows got deleted (see the efibootmgr listing in boot-repair's report).  You can add it back yourself with efibootmgr   (use bootmgfw.efi, see below).  The efibootmgr may be run in a terminal off the live media.  Of course, the Ubuntu entry is wrong, there is no Ubuntu on the disk, so maybe you can just change it (name and bootloader) to a Windows entry.  The Ubuntu entries on the hard disk's EFI may be ignored, delete them if you need the room, but usually, there's plenty of room in the EFI partition.  Below is an example with Windows being the 004 entry, yours will be different.

Boot0004* Windows Boot Manager  HD(2,e1800,82000,04b9edc2-fc48-11e1-8ec1-e7137b3aaf29)
File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS....

In the UEFI settings, for boot order, put the USB (and DVD) before the hard disk, and you should boot into grub when the USB is present, and boot Windows without the USB.

Sounds like a reinstall fixed things up for you.


ubuntu 14.04 Dash default file options change?

First install dconf:

sudo apt-get install dconf-editor

then run it by searching the dash for dconf, or with the command dconf-editor.

Navigate to Com -> Canonical -> Unity and change the double-click-activate value (untick it).

Source.


Is it necessary to upgrade to 15.10 from 14.04?

The answer is 100% NO.  Do not upgrade to 15.10.  14.04 is an LTS release which means you'll have full support till 2019.  15.10 is not LTS and support for it has already ended since July 28.

The only release you could consider upgrading to is 16.04 but if you're ok with 14.04, you can definitely continue using it without hesitation.


You can achieve this in two ways: symbolic links and bind mounts. The former is easier to setup and from my experience causes less issues with Nautilus. The latter is subjectively more stable and probably faster. If you are not too familiar with Ubuntu and Linux I suggest you to go with the first option.

Symbolic links

Let's say you already mounted your second hard drive on /mnt/hdd. You could create a new directory for your own user for ease of use.

sudo mkdir /mnt/hdd/username
sudo chown username:username /mnt/hdd/username

Where username is your system user.

Now create the directories you want on the second harddrive, eg: Downloads and Video

mkdir /mnt/hdd/username/{Downloads,Videos}

At this point you are ready to create the symbolic link. Delete the Downloads and Videos folder from your home directory, if you have any content in them copy it on the new directories on the second hard drive first. You can use Nautilus for that.

rm -rf ~/{Videos,Downloads}
ln -s /mnt/hdd/username/{Videos,Downloads} /home/username/

Now you can access the Videos and Downloads directories from your home directory like they were on your primary hard disk.

Bind mounts

This is a bit more complex solution but it looks more solid to me. I wouldn't suggest you to follow this route if you consider yourself a newbie.

Again let's assume your second hard drive is mounted in /mnt/hdd. Create a directory for your user and the media directories like before.

sudo mkdir /mnt/hdd/username
sudo chown username:username /mnt/hdd/username
mkdir /mnt/hdd/username/{Downloads,Videos}

Now copy any content in your user's Downloads and Videos folders to the new locations on the second harddrive and delete the directories in your home folder.

Now we need to modify the fstab.

You need to find the UUID of your second hard drive with:

ls -l /dev/disk/by-uuid

You'll get the list of all your partitions sorted by UUID. The list will be something like this:

lrwxrwxrwx 1 root root 10 ott  3 20:21 2de34713-f0ee-4a12-9214-21a5431a7b7b -> ../../sdb1
lrwxrwxrwx 1 root root 10 ott  3 20:21 5467abe5-4732-4594-8d7a-c2db5a2e01f0 -> ../../sda3
lrwxrwxrwx 1 root root 10 ott  3 20:21 729efb0c-3f58-40e9-8b85-af62a321e135 -> ../../sda2

In this case my second HDD is sdb1 so I use the 2de34713-f0ee-4a12-9214-21a5431a7b7b UUID.

It is very likely that your second hard drive will be already listed in the fstab, so find the entry for it

sudo nano /etc/fstab

It will be something like this:

UUID=2de34713-f0ee-4a12-9214-21a5431a7b7b /mnt/hdd       ext4    relatime,errors=remount-ro 0 2

If you don't have it you need to add that entry manually, be careful to use the right filesystem (probably ext4 or ext3).

Below that line you can add the bind partitions like so:

/mnt/hdd/username/Downloads     /home/username/Downloads    none        bind,rw     0 0
/mnt/hdd/username/Videos        /home/username/Videos       none        bind,rw     0 0

Save the changes and restart your system.

The easy route

You can also change the location of the Nautilus bookmarks like suggested by Mitch, that is definitely simpler but it wouldn't be a system wide change, as various software will continue to use the default directories in the home folder.


The bad news is that some of your data may already by irretrievably lost. The good news is you may be able to recover some if not all of what remains. It's quite likely that you will have to reinstall your OS and server software however:

The first thing to do is insure that you don't lose any more data by taking a forensic copy of the drive. I described this process in some detail in this answer. By using this method we can work on the forensic copy (whether on a spare drive by mounting the device) or on an image by mounting the image via the loopback device. Then we can take a number of steps to attempt recovery of the missing data ranging from running the appropriate fsck to using other data recovery tools such as testdisk

If the attempt to image results in errors you can try again using ddrescue

If you don't have current backups, I cannot stress the importance of this step enough.

Once we have the copy we begin with an analysis of the layout of the partitions.

I prefer to use either parted or fdisk for this step. I have no doubt that there are other approaches.

sudo fdisk -l DeviceOrFile

OR

sudo parted DeviceOrFile followed by the commands

unit selecting B and then print

will do the trick where  DeviceOrFile is the device or image file that contains our forensic image.

The latter will be better if working on a multi-partition image, the first provides enough info for working with a physical drive.

Lets check the file system.

For a device just fsck /dev/sdXy where /dev/sdXy is the device parition whose file system we wish to check.

For an image file we first need to setup the loop device.

$ sudo losetup -o 1048576 /dev/loop0 Stover14.04.img
$ fsck /dev/loop0

If somehow we've made thing worse we still have the original drive and we can start over, however that's not the expected result.

Our next step will be to mount the partition that contains the (possibly repaired filesystem) data we require. How we go about this depends on whether our copy is on a physical device or contained in an image file.

For a device we mount the partition we want normally although we may wish to include the ro option to avoid inadvertent writes to the device as explained below.

For an image file:

We need to ascertain if we have a loop device available to mount to:

$ sudo losetup -f
[sudo] password for me:
/dev/loop1

If for some odd reason we don't have a loop device we need to create one

we will require the numbers obtained with the parted approach mentioned above. Let's say for example we have a partition table like this:

$ sudo parted /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit
Unit?  [compact]? B
(parted) print
Model: ATA TOSHIBA THNSNH12 (scsi)
Disk /dev/sda: 128035676160B
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start         End            Size           Type     File system  Flags
 1      1048576B      13317963775B   13316915200B   primary  ext4
 2      13317963776B  128034963967B  114717000192B  primary  ext4         boot

The number in the start column is important as we will use it in the offset of the following mount command.

You'll note that I've previously created the directory /mnt/boot-sav/sda1 I'll assume you know how to do this or can find that information by consulting man mkdir (hint: -p might be required)

sudo mount -o loop,ro,offset=1048576 Stover14.04.img /mnt/boot-sav/sda1

the -o indicates that options will follow separated by commas.
loop indicates that we are mounting to the loop device
ro indicates the mount will be read-only to allow us to poke around looking for files without making any changes to the image.
the offset parameter indicates the byte position of the beginning of the file system on the partition in question that we are mounting which completes the options I am using.

All this is followed by the name of the image file and the path to mount to.

At this point we can see if we can locate our missing data by perusing from the mount point or utilizing data recovery tools such as testdisk directly on the file system or loop device depending on the tool and your forensic copy approach.

Sources:

http://www.andremiller.net/content/mounting-hard-disk-image-including-partitions-using-linux

https://www.systutorials.com/docs/linux/man/8-losetup/

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


To check the file system on your Ubuntu partition...

boot to the GRUB menu
choose Advanced Options
choose Recovery mode
choose Root access
at the # prompt, type sudo fsck -f /
repeat the fsck command if there were errors
type reboot

If for some reason you can't do the above...

boot to a Ubuntu Live DVD/USB
start gparted and determine which /dev/sdaX is your Ubuntu EXT4 partition
quit gparted
open a terminal window
type sudo fsck -f /dev/sdaX # replacing X with the number you found earlier
repeat the fsck command if there were errors
type reboot


Missing options in "NVIDIA X Server Settings"

I've resolved the issue when I installed Xubuntu 16.10, I needed to remove nomodeset from kernel option in grub that after installing the drivers.


How do I get the current power consumption in the status bar? (Developing a status icon)

Instead of counting monkeys :-), I modified the second script from L. D. James's answer to show the current power consumption of my laptop in watts.

The script works with Ubuntu 16.04 and probably the only system specific thing is the file where the value of the current power consumption is stored. In my case I found it by the help of tlp:

$ sudo tlp stat | grep -P '\[m(W|A)\]'    # Output on Lenovo ThinkPad X230 Tablet
/sys/class/power_supply/BAT0/power_now                      =  11246 [mW]

$ sudo tlp stat | grep -P '\[m(W|A)\]'    # Output on Dell Vostro 3350 Laptop
/sys/class/power_supply/BAT0/power_now                      =  6700 [mA]

Note some devices provide the current power consumption in watts, but some devices provide the current values of the voltage and the current (amps) - and the script covers these cases.

Further I created the GitHub Project PowerNow and added additional options: to execute htop, powertop or tlp stat within a gnome-terminal.

Installation of the Python script powerNow and optionally Startup Applications (and ~/Desktop) .desktop files:

Copy the script to /usr/local/bin to make it accessible as shell command system wide:

sudo wget https://raw.githubusercontent.com/pa4080/powerNow/master/powerNow.py -O /usr/local/bin/powerNow
sudo chmod +x /usr/local/bin/powerNow

Copy the script to ~/bin to make it accessible only for the current user:

wget https://raw.githubusercontent.com/pa4080/powerNow/master/powerNow.py -O $HOME/bin/powerNow
chmod +x $HOME/bin/powerNow

Copy the desktop file to ~/Desktop (the script is required):

wget https://raw.githubusercontent.com/pa4080/powerNow/master/powerNow.desktop -O $HOME/Desktop/powerNow.desktop
chmod +x $HOME/Desktop/powerNow.desktop

Copy the desktop file to ~/.config/autostart (the script is required):

wget https://raw.githubusercontent.com/pa4080/powerNow/master/powerNow.desktop -O $HOME/.config/autostart/powerNow.desktop
chmod +x $HOME/.config/autostart/powerNow.desktop


How do I create app folders in the GNOME application menu?

I. Native GNOME Method:
(GNOME <= v. 3.32)

Run Ubuntu/GNOME Software

Go to Installed tab and click in right-top corner button with "tick" icon
 :

Select application to group in folder.

Click in left-bottom corner button Add to Folder... :

Type name of new folder...

II. Not Native, But Most Comfortable Method:
(need additional software, Ubintu <= v. 20.x, GNOME <= v. 3.32)
I recommend to use Appfolders Management extension by Maestroschan If You not familiar with GNOME extension, just follow link above and simple instructions. (You will need install recommended special browser Extension which help install this Gnome extension).
Use right mouse click on app and folder icons to get this options:


Is there a GTK-Theme preview application?

You can just install the The Widget Factory with

sudo apt-get install thewidgetfactory

And run it in your terminal with

twf


Record stream with avconv stops prematurley

Try running the following command:

avconv -rtsp_transport tcp -i

This works for me.


USB device on LXD container inaccessible when in privileged mode

My issue was solved by granting access to the USB device using the relevant cgroup entry on my container configuration. In summary what was needed for my device to work in a privileged container was doing:

lxc config edit <container>

to edit the container configuration and add:

config:
  raw.lxc: lxc.cgroup.devices.allow = c XXX:* rwm
devices:
  some_device_name:
    mode: "0777"
    path: /dev/bus/usb/004/002
    type: unix-char

where XXX = the "major" part of the major:minor id found using ls -la /dev/bus/usb/004/002

Credits for this go to https://askubuntu.com/a/545802/671072


Deleting a directory + unlinking the files

To unlink files,

unlink /path/to/the/link_file

If you delete the dir it doesn't unlink themselves.And if you click on the link after deleting dir,it will shows like this,


My Thinkpad X1 Extreme has Nvidia 1050ti and iGPU. How to enable hybrid automatic and manual switching of the GPUs?

I saw that there are many posts around asking about how to set up correctly the Thinkpad X1E with Ubuntu. These are my installation instructions (note, I use the Nvidia X Server to switch between intel and nvidia graphics - which still requires a log out and log in).

My Laptop: Thinkpad X1E (Gen 1)
Laptop           = LENOVO ThinkPad X1 Extreme 20MGS0EQ00
BIOS             = N2EET42W (1.24 )
Operating System = Dual Boot - Windows 10 / Ubuntu 18.04.3 LTS

Relevant status on Ubuntu 18.04.3:
  * System running on BIOS > Hybrid Graphics
  * Can switch between intel and nvidia using the Nvidia X Server application (requires log out/log in)
  * External monitor can be connected through the HDMI port (only available when nvidia card is used) [R2]
  * Power-saving mode is automatically switched on when on battery by TLP [R1]

[R1] https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html
[R2] (pomm0's answer) https://www.dell.com/community/Precision-Mobile-Workstations/External-Monitor-not-working-Ubuntu-nvidia/td-p/6241315

Installation instructions:
 ** 0. First install Windows 10 or stick to pre-installed Windows 10  **
 ** 1. Update the BIOS firmware to the latest version **
    A short google query will let you know that Lenovo had problems with some old BIOS version that would render your
laptop unsuble if you tried to switch the Graphics Device on the BIOS to "Discrete". The fact that a lot of people
recommended switching to "Discrete" graphics during the Ubuntu installation did not help.
    Anyway, short answer: update the BIOS firmware to the latest version.
 ** 2. Set the Graphics Device on the BIOS to "Hybrid Graphics" **
    BIOS/System Setup > Config > Display > Graphics Device > Hybrid Graphics
 ** 3. Test boot using Ubuntu live stick with "nomodeset" **
    In Grub (the menu that appears when you boot from the stick before starting Ubuntu) click "e" with the option
"Try Ubuntu without installing", and add "nomodeset" in the GRUB in the line that has "quiet splash ---". Then press
F10 to proceed with the boot (and try Ubuntu without installing). If the Ubuntu desktop loads normally then you are
good to go.
    Note: with the "nomodeset" option, only the intel graphics can be used.
    Note-2: even once Ubuntu is installed, you can still use the "nomodeset" option to make sure that the nvidia card
will not be used (once the system is set up correctly there is no need to do this anymore).
 ** 4. Install Ubuntu as usual, with a separate swap partition of size equals to your RAM size (16 GB for me) **
 ** 5. Try booting Ubuntu normally (without adding "nomodeset") **
    If it boots normally, then try to install the nvidia-driver-390.
    Note: I have tested also the latest driver recommended by "ubuntu-drivers devices" (nvidia-driver-440) and it also
          works fine. It seems to consume more power than he 390 driver though, and the output of the command
          "lshw -numeric -C display" looks different (nvidia card appears as UNCLAIMED when in intel graphics).
    Approximate instructions:
      sudo apt update
      sudo apt upgrade
      sudo add-apt-repository ppa:graphics-drivers/ppa
      sudo apt update
      ubuntu-drivers devices
      sudo apt install nvidia-driver-390
      sudo apt upgrade
      (unsure about the necessity of this) Blacklist nouveau driver using GRUB config. In /etc/default/grub look for a line GRUB_CMDLINE_LINUX . Add nouveau.blacklist=1 into that parameter. If the line is not present add this line GRUB_CMDLINE_LINUX="nouveau.blacklist=1"
      (unsure about the necessity of this) sudo update-grub
    restart the computer. Hopefully you can get back to the Ubuntu desktop screen without problems.
 ** 6. Test switching from intel to nvidia graphics using the "Nvidia X Server" application **
    Result: can switch between intel and nvidia graphics using the Nvidia X Server application (requires log out/log in)
    Additionally: Check output of the command: "lshw -numeric -C display"
    Remark: for me, the nvidia graphics card appears on the lshw output only when nvidia graphics is selected.
    Remark 2: After restart the last setting, intel or nvidia graphics, stays.
 ** 7. Change configuration as reparted in [R2] to make HDMI port accessible in Ubuntu **
    Result: External monitor can be connected through the HDMI port (only available when nvidia card is selected on the
            Nvidia X Server)
    [R2] (pomm0's answer) https://www.dell.com/community/Precision-Mobile-Workstations/External-Monitor-not-working-Ubuntu-nvidia/td-p/6241315
    Open the file in your favorite editor (vim, nano, gedit, etc.).
      sudo nano /lib/modprobe.d/nvidia-kms.conf
    And comment out the the nvidia-drm modeset option.
      # This file was generated by nvidia-prime
      # Set value to 0 to disable modesetting
      # options nvidia-drm modeset=1
 ** 8. Best power-saving options using TLP [R1] - should work great on thinkpads **
    [R1] https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html#check
    Installation:
      sudo add-apt-repository ppa:linrunner/tlp
      sudo apt-get update
      sudo apt-get install tlp tlp-rdw
      # For ThinkPads an additional
      sudo apt-get install acpi-call-dkms
      # Installing the tp-smapi-dkms package might be useless depending on your laptop model, see comments from linrunner below. For the Lenovo X1E it is useless, so I scrapped the corresponding line from the instructions.
      (restart and test commands listed on [R1])
    To test power consumption
      sudo apt install powertop
      sudo powertop
      # powertop: when running on battery consumption is displayed on the "Device Stats" tab
      sudo tlp-stat -s  # check that laptop detects being on battery or on AC (conntected to power supply)
      # powertop: check the "Tunables" tab, when on battery or on AC, this are configuration changes to make your laptop
                  consume less power
      # powertop: check power consumption with/without WiFi, min to max brightness and on intel or nvidia graphics.
    Note on power consumption with my laptop:
      Consumption of computer WITHOUT Nvidia card in idle: min brightness, min reading 7.1W. (lowest ever reading 4-5W)
      Consumption of computer WITH Nvidia card in idle: min brightness, 11-20W. (min reading 11W)
 ** 9. Done! - Enjoy your well configured laptop - Additional tips are wellcome! **


How to install & upgrade my Video Driver

You have the most current stable driver version - mesa 8.0 is part of the latest stable graphics stack, so probably your Intel driver version is 2.17. Upgrading the driver usually involves upgrading the entire stack, from the kernel to the X server. Driver-only upgrades are possible, but you don't get the full benefits of the upgrade since some improvements depend on changes to a different part of the stack.

First of all, I would discourage upgrading if there is no good reason to do so. Your driver version is current, so you may want to double-check with this person in the forum in case they made a mistake or meant something else. There are very good reasons why each Ubuntu release sticks to a given version of its packages instead of constantly releasing them in the archives, the relevant point being that you get a new well-tested software stack every 6 months, which in my opinion strikes excellent balance between stability and how long you have to wait for new software versions.

Now if you are absolutely sure you want to upgrade your graphics stack, visit:

This PPA which will upgrade your driver, bringing your Intel driver from the 2.17 version in precise to 2.19
The xorg-edgers PPA which will upgrade your entire graphics stack, including the 2.19 Intel driver, plus mesa 8.1, linux 3.5 and a large number of other packages

More importantly, be aware of the following:

PPAs can be uninstalled with ppa-purge
If your installation is 64-bit, bear in mind that ppa-purge does not get along well with precise's multiarch (see note at top of xorg-edgers PPA, which states the situation a bit more dramatically), and the uninstallation of a PPA may force you to uninstall a bunch of unrelated i386 packages


Issues with Gnome Night Light and DisplayPort to HDMI cables

After reading up on active vs passive DisplayPort adaptors, I've concluded that the issue is related to how the graphics card handles passive DisplayPort to HDMI adaptors. This system is called DisplayPort dual mode, or DP++.

  The theory of DP++ is actually quite simple: when the device detects an HDMI adapter attached to it, the graphics card or GPU (Graphical Processing Unit) will automatically make a translation and send HDMI TMDS signals via the video output. The pins of the DisplayPort connector are then mapped onto the HDMI pins, making the transition very simple. [1]

Since the adaptor cables I purchased were cheap and not advertised as active, I'm going to assume they're passive. The issue seems to be that most graphics cards only support passive adaptors (using DP++) through a maximum of one or two ports at a time.

  RX 570 can handle up to 6 displays. Two of them can use HDMI/DVI or passive adapters.  This limitation does not apply if the displays are all identical. [2]

My displays are identical, and although they seem to work using three passive adaptors, I have to conclude this limitation is the cause of Night Light not working in the scenarios described in my question. Using an active DisplayPort to DVI adaptor, along with normal HDMI and DVI cables—only two HDMI/DVI or passive adaptors—gets Night Light working correctly on all screens.

Sources

barco.com - DisplayPort to HDMI conversion
reddit.com - How many displays can an RX 570 handle?


windows clients in local network are losing connection to samba shares on Ubuntu

The crux of the issue was the conflict of two similar services based on same components.

the components here being samba and two conflicting services being samba share and nautilus share.

those who have tried to share the directories etc through built-in GUI of the properties window of a directory will at first instance prompt to install a service saying service is not installed.

looked into details it downloads samba common etc.

it works perfectly well in linux only network.

however it will face trouble if network have windows clients as well.
MS Windows will specifically look for samba share configured through '/etc/samba/smb.conf'.

If that is configured MS windows will have no problem but linux machines will not be able to connect detecting two overlapping services on same platform for same purpose. conflict to choose a process: nautilus share or samba share.

the simple and logical solution is to unshare everything done/shared through nautilus share (using built in sharing in GUI window for properties of the shared directory.

given the smb.conf is written well there should not be any problem.

this is the finding of and simple solution to my mind boggling struggle.

hope this will serve to any help.


Why is there no output when entering # in bash

Directly from man bash:

  COMMENTS

  In a non-interactive shell, or an interactive shell in which the interactive_comments option to the shopt builtin is enabled (see SHELL BUILTIN COMMANDS below), a word beginning with # causes that word and all remaining characters on that line to be ignored.
  An interactive shell without the interactive_comments option enabled does not allow comments. The interactive_comments option is on by default in interactive shells.


Input/output error while executing cp command

Separate the 2 commands. On separate lines or with a ; or with &&. Need to be in a writable directory to run them.

Let's just get and unpack in $HOME dir for now. cd with no args will change to homedir.

cd
wget http://cdimage.ubuntu.com/ubuntu-core/releases/13.04/release/ubuntu-core-13.04-core-armhf.tar.gz
tar -xzf ubuntu-core-13.04-core-armhf.tar.gz

Or:

cd && wget http://cdimage.ubuntu.com/ubuntu-core/releases/13.04/release/ubuntu-core-13.04-core-armhf.tar.gz && tar -xzf ubuntu-core-13.04-core-armhf.tar.gz

Next part of problem. Writing to sdcard mount.

Maybe it is mounted so that only root user can write to it.
So try:

cd /mnt/sdcard
sudo touch TEST # will prompt for your password
ls -al

Do you get an error when you do touch command? Maybe it is not writable by any user if so.

So now if you successfully (hopefully, maybe) can write to /mnt/sdcard do:

cd /mnt/sdcard
sudo wget http://cdimage.ubuntu.com/ubuntu-core/releases/13.04/release/ubuntu-core-13.04-core-armhf.tar.gz
sudo tar -xzf ubuntu-core-13.04-core-armhf.tar.gz

Or better skip the wget if you already did wget in your $HOME dir. Do:

cd /mnt/sdcard
# ~ is shorthand for your $HOME dir
sudo tar -xzf ~/ubuntu-core-13.04-core-armhf.tar.gz

Sorry too detailed but hope you can do that and root can write to sdcard. . . If you get errors please post them and the ls -al result of or in /mnt/sdcard. The mount options can be changed to mount it as writable if needed . . . Will require another part of answer!


The PS1 variable isn't what you want to change - it only affects what prompt is displayed, not what directory you're in. Adding

cd ~/Desktop

to the end of your .bashrc should do what you want.


Cannot boot to SteamOS after upgrade to 15.04

Eventually I ran lsblk and saw that there was a cryptswap1 device under /dev/sda5. Sure enough, /etc/crypttab had the line

cryptswap1 /dev/sda5 /dev/urandom swap,cipher=aes-cbc-essiv:sha256

I commented this line out, rebooted, and ran fsck on /dev/sda5, and this time it worked as expected.

I'm still not sure why this broke after the upgrade to 15.04, maybe something in a new version of cryptsetup. In any case, that line in /etc/crypttab wasn't doing anything anyways.


Slow USB Speed Likely due to uhci driver being loaded

I was finally able to solve it. Buried in the BOIS under the Southbridge settings the USB2.0 controller was disabled. D'oh!


Does every program have to go through the shell to complete the process they willing to make?

Nope. Only users have to go through a shell to communicate with the Kernel. Applications use APIs.

For example, if I want to delete a file, I have to use one shell or the other, and then an application to delete the file:

With a Command-Line Interface (CLI) shell, such as bash, I can use the rm command to delete the file.
With a GUI shell (like Unity, or GNOME Shell), I can use something else, such as the File Manager to delete the file. The GUI shell does not, in turn, need to use a CLI shell.

Both the File Manager and rm in turn may use the unlink(3) (or the higher level remove(3)) function (or system call) to do the actual work.


Repair and consulting service for home-users?

I found Canonical's Ubuntu Desktop Service useful last year.  Friendly, prompt response.

http://www.ubuntu.com/business/services/desktop

Currently $105/ year


How to remove typed-in URLs from browser history in Firefox?

As all things accessible via Firefox's default interface seemed to fail, I decided to take the "deep-dive" approach. So I installed the SQLite Manager plugin, opened the places.sqlite file from within my firefox user profile directory (Menü: Database → Connect Database), and checked the moz_places table (select it in the left pane of SQLite manager) via the search function (in the big right pane: Tab Browse and Search, there the "Search" button) for the "offending" url. The corresponding SQL-Statement (for the Execute SQL tab) would have been:

SELECT * FROM moz_places WHERE url LIKE '%readwrite.com%';

For users prefering the graphical way:

Screenshot of the search filter (click image to enlarge)

As it turned out, there was exactly one hit with a full URL, which did not show up when filtering the browser history/bookmarks! So I took the freedom to delete that record, and tried my urlbar again: Yeah, looks like that solved the issue! But why so difficult, Mozilla?

EDIT: Keep in mind that "operating directly at the heart" you might "kill the cat". Be careful modifying Firefox' databases directly -- or you might end up with inconsistent bookmarks or worse! Always cross-check before deleting, for example.


I have found this same problem on my System76 laptop. There is no setting control to turn this on and off. The only solution I found was to install Lubuntu 18.04 LTS instead.


Option 1 - Reinstall Ubuntu desktop

Instead of logging into Ubuntu through the GUI, once you are at the login page:

Press CTRL + ALT + F1
On the shell prompt, input your user and password
Try reinstalling Ubuntu Desktop:

  sudo apt-get update

  sudo apt-get install --reinstall ubuntu-desktop

Option 2 - GUI Still broken

Assuming you have another computer, just download 15.10 Version from www.ubuntu.com, burn it to an USB using unetbootin http://unetbootin.org/, and boot your Ubuntu-PC with the USB plugged in. On the Ubuntu installation, choose the option "Reinstall".

This will keep all your files and upgrade your whole system.

If you cannot boot from the USB, change your boot settings in the bios.

Hope it helps.

Regards


Step 1 : Remove the currently installed NVIDIA drivers.

Highlight the Ubuntu menu entry and  press the E key.
Add nouveau.modeset=0 at the end of the linux line.
Press the F10 key to boot into the Ubuntu system.

When the login screen appears press Ctrl+Alt+F1.
Enter your user name and password and then execute :

sudo apt-get purge nvidia*
sudo reboot

Step 2 : Reinstall the NVIDIA drivers for GEFORCE 840M.

Highlight the Ubuntu menu entry and  press the E key.
Add nouveau.modeset=0 at the end of the linux line.
Press the F10 key to boot into the Ubuntu system.

When the login screen appears press Ctrl+Alt+F1.
Enter your user name and password and then execute :

sudo apt-get update
sudo apt-get install nvidia-352 nvidia-prime
sudo reboot

Now you do not have to add the boot parameter anymore when you boot the Ubuntu system.
Don't forget to put a Space between the last sign of the linux line and nouveau.modeset=0.


Install lm-sensors

sudo apt-get install lm-sensors

After installation type the following in terminal

sudo sensors-detect

You may also need to run

sudo service kmod start

It will ask you few questions. Answer Yes for all of them. Finally to get your CPU temperature type sensors in your terminal.

sensors

Output:

$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +41.0°C  (high = +78.0°C, crit = +100.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Core 1:      +41.0°C  (high = +78.0°C, crit = +100.0°C)

w83627dhg-isa-0290
Adapter: ISA adapter
Vcore:       +1.10 V  (min =  +0.00 V, max =  +1.74 V)
in1:         +1.60 V  (min =  +1.68 V, max =  +1.44 V)   ALARM
AVCC:        +3.30 V  (min =  +2.98 V, max =  +3.63 V)
VCC:         +3.28 V  (min =  +2.98 V, max =  +3.63 V)
in4:         +1.85 V  (min =  +1.66 V, max =  +1.11 V)   ALARM
in5:         +1.26 V  (min =  +1.72 V, max =  +0.43 V)   ALARM
in6:         +0.09 V  (min =  +1.75 V, max =  +0.62 V)   ALARM
3VSB:        +3.30 V  (min =  +2.98 V, max =  +3.63 V)
Vbat:        +3.18 V  (min =  +2.70 V, max =  +3.30 V)
fan1:          0 RPM  (min = 10546 RPM, div = 128)  ALARM
fan2:        892 RPM  (min = 2136 RPM, div = 8)  ALARM
fan3:          0 RPM  (min = 10546 RPM, div = 128)  ALARM
fan4:          0 RPM  (min = 10546 RPM, div = 128)  ALARM
fan5:          0 RPM  (min = 10546 RPM, div = 128)  ALARM
temp1:       +36.0°C  (high = +63.0°C, hyst = +55.0°C)  sensor = diode
temp2:       +39.5°C  (high = +80.0°C, hyst = +75.0°C)  sensor = diode
temp3:      +119.0°C  (high = +80.0°C, hyst = +75.0°C)  ALARM  sensor = thermistor
cpu0_vid:   +2.050 V

To see HDD temperature Install hddtemp

sudo apt-get install hddtemp

Output:

$ sudo hddtemp /dev/sda
/dev/sda: ST3160813AS: 34°C


Try looking in sound preferences (click the volume applet and select Sound Settings).  From there, look in the output tab and make sure HDMI is selected.  If that doesn't work, try looking in the hardware tab, which should contain a dropdown, where you should see HDMI. Select that and it should work


Ubuntu with no window manager 95% of time

You can install a simple window manager into Ubuntu Server, and start it only when you need it. I think it might be enough to install fluxbox, xinit, xterm (and the packages that they want)
sudo apt update && sudo apt upgrade
sudo apt install fluxbox xinit xterm

and you can start the graphical window manager with
startx

The following link is describing a system, where this is available via a text mode menu
help.ubuntu.com/community/Installation/UEFI-and-BIOS
but you can do it manually like it is described in this answer.


How to set NetBeans as a default editor in FileZilla

When you right-click on a file of the type that you mention, it should give you the option to select the default program to open files of that type. If this does not help, you may wish to check the documentation for FileZilla, which can be found here:

https://wiki.filezilla-project.org/Documentation


The high CPU use could be due to fallback to the software renderer. You can verify whether or not you're using the software renderer by executing the following command on the command-line:

/usr/lib/nux/unity_support_test -p

If the result is as follows:

Not software rendered:    no

That indicates that the software renderer is being used (nice use of a double negative there). In that case, installing the latest version of the Intel graphics drivers, as recommended in another comment, should help. However, as of November 28, Ubuntu 13.10 is not yet supported by the Installer. It appears to be one of those "any time now" situations.

In the meantime, I was able to fix the problem on my system (ThinkPad T420S) by installing the drivers via the oibaf ppa which supports Ubuntu 13.10. unity_support_test now verifies that software rendering is disabled. Hope this helps and let us know if you managed to fix the issue, as well.


How to run a bash .sh after starting a program in PlayOnLinux?

I don't use PlayOnLinux, but maybe a generic approach will be of some use.

The basic idea is to replace the invoking script - the one that runs your program now - with a new one that runs your your new script before or after running the invoking script (whichever best suits what you want to accomplish - probably after, in your case).

If your script can run before your program, then all you have to do is find the script or program that invokes your program and replace it by another script (with a different name, if possible, so as not to cause confusion or worse).

The new script would run your setup script and then run the original script to invoke your program (using the full path to the invoking script if your new script has the same name as the original one - to avoid an infinite loop.)

If your script has to run after your program has started (as it might in your case), that's a lot trickier. I have no idea how to do that, but I'd start looking by getting the program's process number and seeing if I could look up the window from the process number. (I have not used xdotool, but looking at its description suggests that maybe using xdotool search or xdotool getactivewindow windowmove ... might be useful. It looks like you can do anything you want as long as you know the window's unique name.)

If you can get that to work, then invoking it would just involve invoking the original script and then your script. To do that, your new invoking script would invoke the original script then your new script. But, your invoking script probably won't relinquish control back to your script until your program is completely finished and it's too late to run your new script.

If you can run your invoking script with an & after it to let it run in background, then control will come right back to your script and you can immediately run your new script to modify the window. If this works, then $! will contain the process number of your invoking script, if that helps.

HTH


Slow wifi connection in ubuntu 14.04 installed in HP pavilion

My Pavilion has a buggy driver.  The suggestion here in #3 worked for me.

Good luck.


The site you are trying to download from is having technical problems. If you try again later you shouldn't run into this.

From the Launchpad status page:

  Launchpad.net status
  (launchpadstatus)'s status on
  Wednesday, 16-Feb-11 23:56:37 UTC

  We've had to restart all our front end
  HTTP and HTTPS services, there would
  have been a 10 seconds or so down.
  Sorry, but was needed.


Stop touchpad from treating dust or fingerprints as finger

you can lower the touchpad sensitivity by lowering the MaxTapTime parameter with synclient, by running syclient MaxTapTime=value.

If you set the value to 0 it disables the "tap to click" feature


I'm not an expert at this, but I see no one has answered your questions so I'll tell you how it works for me.

I use a for-pay VPN and it works perfectly with the settings below. One thing you didn't mention is if you installed OpenVPN. That might be something you want to try. Here are the instructions on how to setup a VPN in 12.04/14.04 according to my VPN provider (I followed these to the letter and it connected just fine the first time and every time since).

Open a Terminal, and run: sudo apt-get install openvpn network-manager-openvpn network-manager-openvpn-gnome. This will prompt for both your password, and a Y/n answer, please provide it with your password, and Y
Once installed, open System Settings, then Network. Press the + symbol to add a new connection, and select the VPN Interface, then press Create. Choose OpenVPN as your VPN Connection Type, and press Create
The following will walk you though all configuration steps needed for the VPN.

Gateway: Select one of the Hostnames provided on the Network page

Authentication Type: Password

Username: The username provided with your account

Password: The password provided with your account

CA Certificate: Extract the ca.crt file to somewhere it won't be deleted. We suggest your Home folder. If you extract this to your home folder, when searching for it, please click on your username on the left side, which will take you right to the home folder, then select the ca.crt file from the options on the right.

Advanced: Under the general tab, check the Use LZO data compression

IPv4 Settings: Method: Automatic (VPN) Addresses Only

I did check out that site you used (freevpnnetwork) and I don't see anywhere to download the certificate so I'm not sure how that works. As far as I know you need a trusted certificate somewhere on your machine when setting up a VPN this way.

Good luck!


I'm assuming you are still using lucid:

You can now install the 2.6.38 kernel from synaptic manager without needing to add PPAs or needing to download the kernel itself from the mainline kernel repository.

Start Synaptic Manager and search for "2.6.38".  Install the generic linux 2.6.38 image and headers packages.  If necessary, also install the backports wireless package.

Retry installing the recommended catalyst driver from "Additional Hardware Drivers".


You don't normally access your primary disk from /dev, which tends to be for specialist use.

Your primary disk is automatically mounted when you start your computer.

Your root (the equivalent of C:\ in Windows) is identified, simply, as /. All of the users' home folders (with the exception of the special user root) are stored within a folder called /home (the equivalent of C:\Users within Windows). Your own home folder will be in in your name; suppose your username is fred, then your home folder is /home/fred.

If you like the terminal, you can access these folders with the command cd and list their contents with ls. So, try these commands (ignore the bits starting with #, as they are for description only):

cd /           # Take you to the root folder.
pwd            # Show where you are right now, i.e. "/".
ls -l          # List all the folders and files within the root folder.
cd /home       # Take you to the main home folder.
ls -l          # List all the users' home folders (probably just yours).
cd ~           # The tilde is a short-cut for "/home/fred" (or whatever your username is).
               # This is also called your home folder (rather than the /home folder).
cd /home/fred  # Equivalent to the previous command.
cd             # Also equivalent to the previous command, because the default for
               #    cd is to change to your home folder.
pwd            # Show where you are right now, i.e. "/home/fred".
ls -l          # List all of your own folders and files.
ls -lA         # Again list, but include all of the hidden folders and files.
               # All hidden files and folders begin with a dot.
ls -la         # As previous, but include the two special folders "." and "..".
               # "." simply means "this folder", while ".." means the parent folder.
cd .           # Change to the current folder; i.e. do nothing.
pwd            # Still shows "/home/fred".
cd ..          # Change to the parent folder; in this case, to /home.
pwd            # Shows "/home".
mount          # View all of your mounted partitions.

If you prefer the GUI to the terminal, you can access your folders and files through the Files manager (technically called Nautilus). Click on the Files icon in your Launcher at the top right of your screen:

This takes you straight to your home folder, where you can see all of your (unhidden) folders and files. You can toggle between viewing or hiding hidden folders and files either through the menu (View > Show Hidden Files), or by pressing Ctrl+H.

By the way…

It may be useful for you to learn the difference between disks and partitions. Windows confuses the two, calling them both "disks". /dev/sda is your primary disk, which contains various partitions numbered /dev/sda1, /dev/sda2, and so forth. The numbers do not have to be sequential.

On your installation, probably /dev/sda1 is your root, /dev/sda2 is /home, and /dev/sda5 is the Linux swap area, but the combination of mount and sudo fdisk -l (or sudo parted --list) would tell you for sure.


Windows 10, when booted by EFI, "helpfully" restores the default EFI boot entry to what I thinks is the one true default (ie itself).
You can change what Windows considers to be default by running (in an Administrator command prompt) something similar to this:

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

The exact path (after the word "path") may vary. I believe the above is the default for a Ubuntu install though.

Note that this will be reset with EVERY build update (approximately 6 months apart for normal users). You need to re-run this EVERY time these major updates install.


I had this same symptom and the problem turned out to be that the spdif outputs were muted in alsamixer.


Why don't the Nvidia official instructions to install CUDA 11 on Ubuntu 16.04 work?

Run the NVIDIA-Linux-x86_64-450.51.05.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-version-check in Terminal with the driver file to see if the driver alone installs. If so the the additional --install-libglvnd is broken. Either way Nvidia needs to be contacted to fix their broken instructions in the package they give for this. They have broken driver or you have incompatible card which causes driver install to fail, or the last part of it is broken the libglvnd install. Actually Nvidia only needs to be contacted if it is their problem and not a compatibility problem with your card.


You are trying to setup public domain on localhost. So, it fails to resolve from other locations. If you need it only for LAN, configure bind, and make all LAN PC(or routers) use that bind as DNS server.
In other case, if you trying to setup public domain, google for domain parking. Its possible to park domain on your own server, but it must have public IP, and it worst idea.

Edit(according to comment): I think it works fine, loopback interface respond on many addresses:

 leonid  JabbaDesktop  ~  $  ifconfig lo
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 27078  bytes 2265065 (2.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27078  bytes 2265065 (2.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 leonid  JabbaDesktop  ~  $  ping -c 1 127.0.123.1
PING 127.0.123.1 (127.0.123.1) 56(84) bytes of data.
64 bytes from 127.0.123.1: icmp_seq=1 ttl=64 time=0.060 ms
 leonid  JabbaDesktop  ~  $  ping -c 1 127.0.123.2
PING 127.0.123.2 (127.0.123.2) 56(84) bytes of data.
64 bytes from 127.0.123.2: icmp_seq=1 ttl=64 time=0.060 ms


The python version was 2.7.9, Ubuntu 14.04. After updating to 2.7.10 the error was gone.


Does Ubuntu Update the Official Download Version to Reflect Changes

Not for the 6 monthly releases, for example 13.04 won't get updated, but soon we should get 13.10.
The LTS versions do get updates.

https://wiki.ubuntu.com/Releases


VSFTPD: default to local user subdirectory

The answer is to install an earlier version of vsftpd!

I had originally just done an install of vsftpd and got versison 2.3.5.  When I got the OOPS message about a writable root I made the user's home directory not writable, etc., ending up with the situation described above.  Further research had me read more closely the commentary on solving the OOPS problem.  One correspondent pointed out that the previous version of vsftpd did not have the constraint on writable roots.  So I dug into the history files to find version 2.3.2.  That version gives me the results I was looking for.

btw, I did try installing version 3.0.2 of vsftpd on my 32-bit virtual machine installation and got an error related to not finding 'crypt'.  Since I was already in way over my head I did not try to resolve that error.  Going backwards, in this case, was better than trying to go forwards.

g


Dual-boot Windows 8 and Ubuntu, separate HDD, Win8 boot failure from GRUB

You can use EasyBCD (freeware) to add Ubuntu to the Windows 8 bootloader. Be sure to add the entry as GRUB2 and not Grub Legacy (the default).

(Disclosure: I'm the author)


Could you paste error logs ?
When booting, you can try to check your disk if it comes from it, but certainly not, as your Windows is still OK.
You might have to reinstall your system; don't forget to backup your Ubuntu data before doing that (external HD, for example).


You should install as much as possible from the ubuntu repositories.

To find packages search here:

https://packages.ubuntu.com

Kmymoney is in the repos

https://packages.ubuntu.com/search?keywords=kmymoney

So ....

sudo apt install kmymoney


Nagios configuration file resides in /usr/local/nagios/etc/nagios.cfg

It is the base for all Nagios configuration files.

For detailed info please see Here


This is the download link for Ubuntu 15.10 desktop 64bit: http://www.ubuntu.com/download/desktop/thank-you?version=15.10&architecture=amd64

Just download that. Ignore what WinRAR says.

Next, you burn the ISO file to a DVD. In a recent Windows version: right-click on the file you downloaded, and choose 'Open with > Windows Disc Image Burner'. That's all there is to it.


Lirc is conflicted by some default ir-controlling module so that it only sends keyboard input

Per this thread:
http://ubuntuforums.org/showthread.php?p=10709651

You need to add this line to /etc/rc.local:

echo lirc > /sys/class/rc/rc0/protocols

You also might need to add sleep 10 right above that line. Try it without it first and then add it if you need it. I needed it but others didn't.


14.04.01 32-bit: Missing g++ 64-bit include files when cross-compiling

The 64-bit bits/c++config.h file is provided on 32-bit systems (and vice-versa) by installing the g++-multilib package, so you need to install that package either using Software Center, Synaptic, or via the terminal using

sudo apt-get install g++-multilib

This is just a dependency package that resolves to g++-4.8-multilib for the default gcc/g++ version, and in turn depends on lib64stdc++-4.8-dev (64-bit compilation on 32-bit) or libx32stdc++-4.8-dev (32-bit compilation on 64-bit) - it is these that contain the actual header files.

There is an equivalent set of packages for the plain C compiler gcc.


Rotate just one monitor with Ubuntu/Nvidia worked for me on Ubuntu 10.10; YMMV. Please note that Xinerama conflicts with Compiz - I no longer get desktop effects. Posted a separate question about this issue.


Disable Nouveau Kernel Driver on Ubuntu 16.04.02

First make sure you have the restricted repositories enabled.
they are in /etc/apt/sources.list, and probably commented out with a #.  Delete the # at the beginning of the line.  You may have a few like:

deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main universe multiverse restricted #Added by software-properties
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main universe multiverse restricted #Added by software-properties
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb-src http://security.ubuntu.com/ubuntu xenial-security main universe multiverse restricted #Added by software-properties

Then update your package index:

sudo apt-get update

The nvidia 375 pacakges are the ones which are the latest available in the standard repositories, but 381 is available if you want to try -- it fixes some sleep induced artifacts, but is not as well tested.

My setup is a quadro 1000M, and the nvidia 375 packages I have are:

nvidia-375
nvidia-375-dev
nvidia-modprobe
nvidia-opencl-icd-375
nvidia-prime
nvidia-settings

Clean out all the previous nvidia package you installed, and check that there are no blacklist lines for nvidia in any file in /etc/modprobe.d
Install all the above with:

sudo apt-get install nvidia-375 nvidia-375-dev nvidia-modprobe nvidia-opencl-icd-375 nvidia-prime nvidia-settings

Reboot and see if the nvidia driver is being used:

sudo lshw -C video

You should have in /etc/modprobe.d two files, nvidia-375_hybrid.conf and nvidia-375_hybrid.conf which have a lines which blacklist the nouveau driver and remove any alias.  Check that no nouveau is in /etc/modules and that there is nothing in /etc/rc.local that loads nouveau.  Finally, check the dmesg output, no nouveau should be seen:

dmesg |grep nouveau

The dmesg output for nvidia should look something like:

$ dmesg |fgrep -i nvidia
[    1.145050] nvidia: module license 'NVIDIA' taints kernel.
[    1.150438] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    1.154278] nvidia 0000:01:00.0: enabling device (0000 -> 0003)
[    1.154407] nvidia-nvlink: Nvlink Core is being initialized, major device number 244
[    1.154417] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  375.39  Tue Jan 31 20:47:00 PST 2017 (using threaded interrupts)
[    1.155859] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  375.39  Tue Jan 31 19:41:48 PST 2017
[    1.156840] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[   14.454118] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 240
[   35.821752] nvidia-modeset: Allocated GPU:0 (GPU-821d0db5-a56d-9fdf-72cc-d0eab575873a) @ PCI:0000:01:00.0

Finally, lsmod should contain several nvidia modules and no nouveau.

With the nvidia driver installed, you should be able to install the Intel cuda .deb package.  with dpkg -i

Then using apt-get install the cuda and cuda-toolkit, those should bring in many other cuda packages.

Read the Intel instructions, adding the CUDA location to your PATH and LD_LIBRARY_PATH
Copy the samples from the cuda install directory to your home or any place you have write permission, so you can run the make to build the samples. Also, I assume you have your g++ installed, and maybe build-essential  The gcc should be present by default, and 16.04 has the right versions (5) for the compilers.


How to upgrade several versions at once?

Since you have already erased the operating system, then do a fresh install of the desired Ubuntu version. I have seen Ubuntu fail to upgrade a few times. It is probably some unknown bug.  Ubuntu 13.04 (Raring) is a reliable version, so a fresh install should work well.


When shuting down a black screen with a broken pipe message shows for half second

I am proud to announce that I solved my problem. All I had to do was booting in GRU mode and select repair broken packages, and that was it.


In regards to running Ubuntu as root, or creating "Authentication" this might be a feature that could be added, but doesn't seem like a safe thing to do.

There are some thoughts on the subject of running Ubuntu as root that can be found here.

Does this answer your question?


I believe the problem was that step 2 of the "create a new token" workflow, defined on https://one.ubuntu.com/developer/account_admin/issue_tokens/cloud/, was failing with a 503 for you because the service was down at a couple of points this weekend. You'll need to trap this situation and deal with it (a 503 indicates that you should retry the request later, as per standard HTTP).

I've tested the below PHP (beware: I am not a PHP hacker, so it might not be the most idiomatic code) and it works fine for me. It goes through three steps:

Create a new token in Ubuntu SSO (login.ubuntu.com) (API docs)
Tell Ubuntu One about that new token (API docs)
Use that new token to sign a request to the Ubuntu One files API (API docs)

You'll see the individual parts commented below. Remember that this requests and gets a brand new token; once you have the token (after step 2), save it somewhere; don't request a new one every time.

<?php
function curlPetition($arr){
    $curl = curl_init($arr['URL']);
    if($arr['USERPWD']){curl_setopt($curl, CURLOPT_USERPWD, $arr['USERPWD']);}
    curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,FALSE);
    curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,2);
    curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
    $out = curl_exec($curl);
    curl_close($curl);
    $data['responseBody'] = $out;
    return $data;
}

/* Define username and password details */
$email_address = 'stuart.langridge@canonical.com';
$password = 'MY PASSWORD';

/* Step 1: Get a new OAuth token from Ubuntu Single-Sign-On */
$url = 'https://login.ubuntu.com/api/1.0/authentications?ws.op=authenticate&token_name=Ubuntu%20One%20@%20try1';
$data = curlPetition(array('URL'=>$url,'USERPWD'=> $email_address.':'.$password));
$tokenA = json_decode($data['responseBody'],1);

/* Set up that new token for use in OAuth requests */
$conskey = $tokenA['consumer_key'];
$conssec = $tokenA['consumer_secret'];
$token = $tokenA['token'];
$secret = $tokenA['token_secret'];
$oauth = new OAuth($conskey,$conssec,OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_URI);
$oauth->enableDebug();
$oauth->enableSSLChecks();
$oauth->setToken($token,$secret);

/* Step 2: tell Ubuntu One about the new token (signed with the token itself) */
$tell_u1_about_token_url = 'https://one.ubuntu.com/oauth/sso-finished-so-get-tokens/' . $email_address;
$oauth->fetch($tell_u1_about_token_url);
print_r($oauth->getLastResponse());

/* Step 3: use the token to make a request to the Files API */
$api_url = 'https://one.ubuntu.com/api/file_storage/v1/';
$oauth->fetch($api_url.'~/Ubuntu%20One/');
print_r($oauth->getLastResponse());
?>


the "Password for root" is the password for whichever account you logged in and has the admin/root permissions

Let's say I have my user named Wattana Gaming and I want to install software or use sudo command it would asksomething like "Password for Wattana" right? That's the root(my account) password.
But be warned, if your account isn't an administrator account then you're done. go ask whoever own the PC to get the root password

If you want me to explain it shortly. it asking for your password


Unity Tweak Tool changed fonts and can't get Ubuntu back to normal

Try these commands to reset those settings to default:

cd ~/.config/dconf
mv user user.bak

And then relogin.


Python error when launching gnome-tweak-tool on Debian

This post might be useful :

  Go to /usr/lib/python2.7/dist-packages/gtweak/tweakview.py & find the line,
  that generated an error: self._right_header.props.decoration_layout =
  ":" + tokens[1]

  One line before that there should be if tokens != None: Change that to
  if not tokens:

  The first one doesn't account for tokens being empty, which, for some
  reason, is the case. Hope that helped.


Step 1: Install Language Support
Go to System Settings...> Language Support > Install Languages and install Polish (or any other language).
Step 2: Install Keyboard Layout
Go to System Settings... > Keyboard > Text Entry (at the very bottom left) > The + sign at the bottom left and add the keyboard layout of your choice.
Step 3: Find the keyboard layout chart
In Unity, this can be accessed by clicking on the tiny keyboard indicator icon at the top right part of the desktop panel. It looks like En for English. Clicking on it gives you a drop down menu, where you will see keyboard layout chart
The Polish keyboard layout you have has the following chart:

Step 4: Understand the keyboard layout chart
Each key in the keyboard has four letters written in the following four positions:
2    4
1    3
These are called four “levels” of the key. Level 1 is accessed without modifiers, level 2 is accessed with Shift, level 3 with AltGr (which is called “third level chooser” in the X lingo), and level 4 with Shift+AltGr.
The AltGr is the Alt on the right side of the keyboard.
Source: http://marcinwolinski.pl/keyboard/rational_keyboard.pdf
and: https://en.wikipedia.org/wiki/AltGr_key
Hope this helps


Install printer driver packages:

sudo apt-get install printer-driver-all-enforce cups-client cups-common cups-core-drivers cups-daemon cups-filters cups-ppdc cups-server-common debconf ghostscript libavahi-client3 libavahi-common3 libc-bin libc6 libcups2 libcupscgi1 libcupsimage2 libcupsmime1 libcupsppdc1 libgcc1 libstdc++6 libusb-1.0-0 lsb-base poppler-utils procps

Then use the printer with the application, system-config-printer-gnome


Thank you very much. Sharing my solution for others who might stumble on the same issue:
You add the interface to the interfaces file, as usual. Continuing with the example above:
auto br1
iface br1 inet static
address 10.10.10.1
netmask 255.255.255.0
network 10.10.10.0
broadcast 10.10.10.255

So far so good, but this won't work by itself. This is the configuration of the device, but the device won't have been created on bootup.
The key is to use the pre-up command. From the manpage:
pre-up command
   Run command before bringing the interface up.  If this command fails
   then  ifup  aborts, refraining  from marking the interface as configured,
   prints an error message, and exits with status 0.
   This behavior may change in the future.

So you can use this hook to execute the ip link commands you'd normally execute at runtime.
pre-up ip link add dev br1 type bridge


The dotnet package is not found in the default repository. You need to add it first.

For ubuntu 16.10:

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ yakkety main" > /etc/apt/sources.list.d/dotnetdev.list'

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893

sudo apt-get update

As a side note: the dotnet 1.0.0 preview2 is quite old. The current version is 1.0.4

sudo apt-get install dotnet-dev-1.0.4

Good luck!


Works...

I was installed Empathy package and this combo be available. On Empathy I was configured my Google Account and linked with Web Account (managed on system).

Now I'll test the messages receive like e-mails, chat, etc. to check if it's working.

Leveraging this question, default Gnome-shell doesn't have a zipped files viewer, and I don't want install all ubuntu-desktop package, only a simple viewer for this.

Someone know a name of zip|tar| viewer like 'Ark' of KDE ?


How can I install the latest wkhtmltopdf on Ubuntu 16.04?

Steps to install wkhtmltopdf 0.12.3 on Ubuntu 16.04.

Log in as root, then:

cd ~
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
tar vxf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
cp wkhtmltox/bin/wk* /usr/local/bin/

And you can confirm with:

$ wkhtmltopdf --version
wkhtmltopdf 0.12.3 (with patched qt)

By the way, I chose 0.12.3 instead of 0.12.4 because of a strange page sizing issue, discussed on the wkhtmltopdf GitHub.


I don't think you can fix this problem via some software setting - for one thing, rotating the screen "just a little" would require quite a bit of processing power - and it still would be a picture rotated inside the skewed rectangle your monitor displays - hope you see what I'm trying to say.

In other words, it's most likely an electrical problem which can only be fixed by adjusting some pots inside the monitor, not via software.


The package system is broken Ubuntu 16.04

sudo apt-get install -f will remedy the 'broken package' issue. You must run it with elevated rights, hence the sudo prefix to the command which provides you with elevated rights as if you were the root user.

Once you've done that, launch the Synaptic Package Manager (in the System menu), then select Settings, Repositories. Pick all the third-party repositories, and delete them.


How to list directory contents recursively?

Install the tree package :

sudo apt-get install tree

Command :

 $ tree -l

The "l" option:

  -l     Follows  symbolic links if they point to directories, as if they
              were directories. Symbolic links that will result  in  recursion
              are avoided when detected.

Output :

.
├── 1
│   ├── 1.png
│   └── Untitled Document
├── 10271474_10154132320890137_6530350599362308925_n.jpg
└── f
    ├── a.html
    ├── b.html
    └── d.css

2 directories, 6 files

I have 2 directories :

1 and f and a jpg file in ~/Desktop  and list file in 1 and f


How to merge partitions without losing data?

If unallocated space is beside your NTFS partition, you can extend it using gparted. If not, you better make a screenshot of you gparted window, then some specific directions can be made.

And noone will give 100% guarantee that the data won't be lost. It is recommended to backup your data. But in most cases it works OK. It is your decision.

Based on your information you can do it, but some moving is needed. Boot from Ubuntu LiveCD, start gparted, do not click any partitions, so they do not mount and do:

Click swap partition and disable swap.
Delete /dev/sda5 partition.
Delete /dev/sda3 partition
Extend your /dev/sda2 partition left.
Press apply button. It will take some time.

We removed your swap partition. It is too small to be relevant (165 MB). It is not needed this small anyway.

Now run

sudo gedit /etc/fstab

And remove the line with the swap partition and save the file.

Now we are done. If you want to have swap, you can leave some space at the end and create a swap partition. Then you will need to add it to /etc/fstab file with UUID, which you can find in gparted same way as it was made before. Size of swap depends on you ram size, and maybe you don't need it at all. Anyway swap should be not less than 1GB. Smaller makes no sense at all.


I managed to make it working by editing /etc/rc.local and adding following:

sudo ifdown wlan0
sudo ifup -v wlan0 --force

above exit 0.


When you did the sudo modprobe -r iwlwifi you removed the wifi driver module from the kernel. Why did you do that? Don't ever type commands in the terminal if you're not 100% what they do.

To reload it, type sudo modprobe iwlwifi. Or, reboot the computer.

Regarding the wifi password, assure that your CAPS LOCK key is off, and assure that you're typing the correct password, including any upper/lower case letters. The password is case-sensitive. Assure that both sides of the wifi connection are using WPA2. Reset the wifi password if necessary.

Update #1:

we found that Secure Boot had been enabled.

Update #2:

You updated/upgraded the kernel from 5.0.0-1030-oem-osp1 to 5.3.0-26-generic.
dkms status shows us backport-iwlwifi.

sudo dkms remove backport-iwlwifi/7906 --all

reboot

Update #3:

And from Laptop cannot init iwlwifi we get:

wget http://security.ubuntu.com/ubuntu/pool/main/l/linux-firmware/linux-firmware_1.183.2_all.deb
sudo dpkg -i linux*.deb

Thanks @chili555


Yes you can in Ubuntu at least. That is if you can start Grub in 'Recovery Mode'. After initialisation you can see a 'Options Menu'. Choose option 'Start Root Terminal' or something at the bottom. Now you are in the root shell where you can edit grub configuration files. Put the 'boot command line' back to normal or whatever you need and afterwards execute the 'update-grub' command... And done... I hope.
You can also edit tge 'boot command line' when you select the 'first menu option and than push the 'e'-key on your keyboard... Thre you can edut the 'BCL' to serve your needs... This is not a permanent option and it will be lost on the next bootup...


"dpkg-source: unrepresentable changes to source" when trying to debuild a modified package

Thanks to joeytwiddle's answer as it gave me a great place to start in my solution to this issue.

In my Python project that I attempted to create a debian package for, I am using:

pybuild to prepare the debian package before running debuild
git for version control
PyCharm IDE for the Python development

git creates a .git directory, pybuild creates a .pybuild directory and PyCharm creates a .idea directory all in the root of my project.

Because joeytwiddle mentioned that debuild didn't like a certain file (in his case a swp file) then I felt it probably had a fit about the hidden directories. I found out that for git, you can do: debuild -i and it ignores version control directories for as for the pybuild and idea directories, I have not found another option yet. So for my solution, I copied over my project to a blank directory, deleted .git, .idea, and .pybuild directories and success!


After update Ubuntu 12.04, 3D has disabled

Nice rig! It would a shame to use in 2D mode. Few things to try:

Boot with an older kernel. Easy to do if you have ever updated your kernel - just choose "Previous Linux versions" in the Grub menu and then choose any of those listed. What you see there are older kernel versions that still exist in your system.
If you are using proprietary graphics driver, remove and see whether it changes anything. Use Additional driver/jockey to do that. Idea is to test whether it is a driver issue or something else.
Try some apt-get commands to see if it reports any error. Something like(updates packages index and then installs available updates with required dependencies):

sudo apt-get update && sudo apt-get dist-upgrade

Even if no error is reported it might fix your problem.

PS! Sorry for the late follow-up.


Postfix / Dovecot configure email for non-existing user

You need to use a mechanism in Posftix called virtual aliases if

your system handles mail for domain.com (i.e., a MX record points to it); and
you want to redirect all mail sent to @domain.com addresses to other, "real" addresses (no matter whether they're also hosted on your system or somewhere else such as on Gmail).

It's quite easy to do, there are mostly three steps.

Add the domain domain.com to the virtual_alias_domains directive in your Postfix configuration, and remove it from the mydestination directive if it is there.
Create the virtual aliases file for example at /etc/postfix/virtual_aliases. In it, put lines like this

foo@domain.com real@address.com

Mail sent to any address not explicitly mapped in the file will be rejected, but you can also add a catch-all address like this

@domain.com catchall@address.com

Then do sudo postmap /etc/postfix/virtual_aliases to create the hashed version of the file, which Postfix will actually use.
Add hash:/etc/postfix/virtual_aliases to the virtual_alias_maps directive in your Postfix configuration.

And after reloading Postfix it should do what you want.


Running stockfish/rykba engines with eboard

Stockfish mentions that it can be run with eboard, but it took me a while to figure out how.

Stockfish uses the UCI chess protocol, but eboard speaks xboard. You need to use the polyglot package to play stockfish on eboard.

To install the software:

sudo apt-get install eboard polyglot stockfish

Then you need to create a polyglot.ini in your home directory:

[PolyGlot]

EngineDir = .
EngineCommand = /usr/games/stockfish

Book = false
BookFile = book.bin

Log = false
LogFile = stockfish.log

Resign = true
ResignScore = 600

[Engine]

Use Search Log = false
Search Log Filename = SearchLog.txt
Book File = book.bin
Best Book Move = false
Contempt Factor = 0
Mobility (Middle Game) = 100
Mobility (Endgame) = 100
Passed Pawns (Middle Game) = 100
Passed Pawns (Endgame) = 100
Space = 100
Aggressiveness = 100
Cowardice = 100
Min Split Depth = 4
Max Threads per Split Point = 5
Threads = 1
Use Sleeping Threads = true
Hash = 128
Ponder = true
OwnBook = false
MultiPV = 1
Skill Level = 20
Emergency Move Horizon = 40
Emergency Base Time = 200
Emergency Move Time = 70
Minimum Thinking Time = 20
UCI_Chess960 = false
UCI_AnalyseMode = false

Then when you open eboard, go to:
Play against engine > Generic Engine > Engine Command

Type in "polyglot" in the part called "Engine command line".

That should allow you to play against stockfish using eboard.


How do I include a comma in an Apt pin definition?

Not quite what you were trying to do but it may work as well for you, try:

Pin: origin dl.google.com

I settled on this after giving up trying to pin it by release and it has the same effect as long as you haven't any other repos from this host...


Nautilus-Actions Configuration Tool -- Archive Manager -- Show a specific option in selected cases

You can use the Mimetypes settings for that action. You'll need to add all the archive types you wish to see the action  on individually. (adding in this case is easier than excluding.

Screen shows adding for .zip, .tar.xz, .tar.gz & .tar.bz2


As you can read here:

Disable auto maximizing windows

you have to do install CCSM:

sudo apt-get install compizconfig-settings-manager

After installation, launch it and go to panel for configuration of the plugin Grid.

Select the tab edges, then look for the resize actions and set, as you prefer, the values of corners and edges of your screen.

To settle things once and for all, I suggest you to disable Grid plugin.


You are installing your software on a NTFS partition and that system is mounted using a FUSE driver.
You can disable this test by opening the PlayOnLinux console and typing:

POL_Config_Write NO_FSCHECK TRUE

But you will get no support if you use this since Wine does not guarantee correct execution of programs on anything but POSIX filesystems so it throws an error.

Source 1 and source 2

  Regarding the edit

You need to take a close look at the installation script. If you trying to install the 64bit version or the professional version of Office 2010 only the 32bit normal version is supported.


Just installed 13.10 and everything is fine except I cannot connect to the internet. Any thoughts?

Are you only using IPV6? If that is not intentional then you have not assigned or leased an IPV4 IP address from your router / dhcp server. Have you also verified your DNS is correct?

Just found this link that might help... HERE


Does "erasing 10.04 and installing 11.04" erase document from my windows installation?

Just to clarify:

The option "upgrade 10.04 to 11.04" is not like upgrading 10.04 to 11.04 via an upgrade to 10.10.. This option means that all data from your /home will be preserved but you will have to reinstall your idividual applications and you will also have to create your users again. User setting from these applications (including passwords in the keyring) will be preserved.

"Upgrade from 10.04 to 11.04" therefore is like a clean installation (i.e. "Erase Ubuntu and reinstall") but without formatting your drive and without erasing /home.

As with all OS upgrades it is strongly recommended to backup your data before you proceed.

Your Windows partition(s) will only be touched and deleted by choosing "Erase everything".


How can I stream from computer through Command line?

This is the command line to stream from my computer:

cvlc v4l2:///dev/video0 :v4l2-standard= :inputlave=alsa://hw:0,0 :live-caching=300 :sout="#transcode{vcodec=WMV2,vb=800,scale=1,acodec=wma2,ab=128,channels=2,samplerate=44100}:http{dst=:8080/stream.wmv}"

I then set up port forwarding on my network to the particular computer I wanted

Then went into vlc on my work computer and opened up to my computers ip address.

as per:
http://xmodulo.com/2013/09/live-stream-video-webcam-linux.html


How to actually overwrite when pasting from clipboard in overwrite mode

There is no way to achieve this functionality in an elegant way (one could always script something using xdotool). This is not how it works. It would be a rather dangerous option. If your clipboard contained a lot of text, the reminder of your file could be overwritten upon pasting.

You will need to adapt your workflow and either select what you want to be deleted before pasting, or paste, then delete.

For a smarter workflow that is much more based on "telling" the editor to do what you want, (e.g. "replace next six characters with the clipboard contents"), consider learning and using Vim.


You can try to download all the packages manually and try. this type of installation you dont get 'unable to locate somePackage'

go to this link

(assuming you want to install latest mysql version)

Then select your platform as "Ubuntu Linux". And download all the
packages according to Ubuntu version and whether your computer is 64bit or 32bit.
(dont worry there might be around 11 packages)
copy all packages to folder temp(for example) in your home directory.
open terminal. then type cd temp
then type sudo dpkg -i *
by this all packages will be installed and so will the latest stable mysql version.


This is what "switch to previous layout" should do but it does not on Ubuntu. It just doesn't work.

It does work great in OSX. It loops through the layouts you 've used lately(usually two).


Can these Chinese cameras be used as webcams?

I did in fact buy one, and it works fine as a webcam on my box, at full resolution and frame rate. Also mounts as an external (MTP) drive perfectly.


open terminal and execute:

gksudo gedit /etc/default/grub

and modify this line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.reset"

save and close.
after, execute on terminal

sudo update-grub

reboot machine for apply


FSL installation in Ubuntu FAILED message

FSL requires python2.7 which can be installed in Ubuntu with sudo apt update && sudo apt install python2.7

FSL is installed to the /usr/local/ directory by default, so instead of starting the FSL install script with python fslinstaller.py start the install script with sudo python fslinstaller.py, otherwise you will get an error message because you haven't given the FSL install script permission to unpack FSL to the /usr/local/ directory.

When the FSL installation is finished, bring up a simple GUI which is just a menu of the main individual FSL GUI tools by opening the terminal and  running fsl.


Automate Google Chrome installation on 14.04

Chrome has a configuration directory, ~/.config/google-chrome where it stores the settings - including whether it has been run for the first time or not. So you could:

create an base configuration directory, by copying the existing config directory elsewhere and setting it up a blank one as you want, and then have it copied to the computer on which it is Chrome is being installed - this may have issues if the machines have are very different.
Create a blank directory and file to fool it into thinking it has already been run for the first time:

mkdir $HOME/.config/google-chrome
touch "$HOME/.config/google-chrome/First Run"


Command is available as user, but not sudo?

As it turns out, the original "make" only modified the user's PATH environment variable and not root's!

I found this out by using the command:

printenv

on each account and then I noticed the different path variables, from there I modified the root path by logging in as a root user and issuing the following:

export PATH=$PATH:/usr/games:/usr/local/games

Where /usr/games and /usr/local/games were the two directories that were missing!


How to install MacBuntu on an Ubuntu minimal install?

Install McMojave theme in 18.04 and later

Download the McMojave theme package from McMojave - Gnome.look.org to your ~/Downloads directory. Click the download button and choose one of the following four McMojave theme packages.

Mojave-light: light version
Mojave-light-solid: light version without transparence
Mojave-dark: dark version
Mojave-dark-solid: dark version without transparence

Run the following commands

sudo apt update
sudo apt install gnome-tweak-tool gtk2-engines-murrine gtk2-engines-pixbuf plank
cd ~/Downloads/
tar xf Mojave-light.tar.xz # replace Mojave-light.tar.xz with the theme that you downloaded
mkdir ~/.themes
mv Mojave-light ~/.themes/
Launch Tweaks from the Dash and change to Applications theme appearance to Mojave-light.
Download the macOS Mojave CT icons. Once again pick any icon style and save the package into your ~/Downloads directory.
Run these commands to install the macOS Mojave CT icons:

tar xf Mojave-CT-light.tar.xz
mkdir ~/.icons
mv Mojave-CT-light ~/.icons/
Change the icons to macOS Mojave theme in the Tweaks application.
Download the macOS cursor set package. Pick any cursor style and save the package into your ~/Downloads directory.
Run these commands to install it:

unzip -qq macOS\ Cursor\ Set.zip
mv macOS\ Cursor\ Set ~/.icons/
Change the cursor to macOS Cursor Set in the Tweaks application.
Download the Mojave wallpaper. Change  the wallpaper from Settings → Background → Picture tab → select a picture → press Select button (in 18.04) or Settings → Background → Add Picture (in 20.04).
Open Plank from the Dash. At this point you should see the macOS panel at the bottom of your desktop. Press the left Ctrlkey, and right-click the bottom macOS panel to open up Preferences. Customize the macOS panel to fit your desired look and feel. If you wish to take yet another step further install the optional macOS Plank theme.
Remove the default GNOME dock panel.

sudo apt remove gnome-shell-extension-ubuntu-dock
Configure the Plank application to start automatically after reboot.

Source: revised from How to install macOS theme on Ubuntu 20.04 Focal

MacBuntu has been discontinued, and it has been replaced by the MBuntu Transformation Pack for Ubuntu 14.04-17.04. The MBuntu Transformation Pack transforms the default Unity or GNOME desktop environment into a desktop environment theme which resembles Mac OS X Yosemite.

The Themes Collection by NoobsLab PPA has an interesting selection of themes for Ubuntu, including MBuntu. The same PPA has a selection of theme packages resembling MAC OS X Lion for Ubuntu 12.04-18.04. To add this PPA to your software sources, open the terminal and run the following commands:

sudo add-apt-repository ppa:noobslab/themes
sudo apt-get update

Then you can install any of five different MBuntu packages or any of nine different Mac OS X theme packages for Ubuntu 12.04 from the Ubuntu Software Center.

Features

Themes are shiny, smooth, fast, and look like the latest Mac
Mac Boot Splash auto configuration
Mac theme for LightDM-webkit auto configuration
Separate GTK themes for each desktop (Unity, Gnome Classic, Linux Mint)
Latest icon set
Auto set themes and icons script