Is it safe to Defrag Windows 8 while dual booting Ubuntu?

Is Ubuntu installed on a different partition? if so, windows defrag shouldn't touch the other partition as it works at the filesystem level.

Defragmentation under Ubuntu is not needed (Why is defragmentation unnecessary?), but if you want to do it, you can google "defrag ubuntu" to get some ideas.


Is it reasonable to put public and private keys under different chapters in “authorized_keys”?

The authorized_keys file is only for public keys.  There is no use case for including private keys.

authorized_keys resides on the ssh server; the private keys stay on your client machine.


There are many ways to check for live hosts. Here is an example :

 #!/bin/bash

for ip in 192.168.1.{0..10};
do ping -c 1 -t 1 $ip > /dev/null && echo 'Host : ' "${ip} is up"; done

nmap -sP -n -oG - 192.168.1.0-200 | grep "Up" | awk '{print $2}' |
while read line;
do echo ' Host :' $line 'is UP';
done

for host in $(nmap -sP -n -oG - 192.168.1.0-200 | grep "Up" | awk '{print $2}')
do echo ' Host :' $host 'is UP';
done

 I hope it helps you... Regards.


I put ubuntu live USB to laptop and nothing happened

Try another USB-Slot. Only 1 of 4 works for boot from USB on my notebook (Dell)


Command 'gcc' not found, but can be installed with.. ubuntu 18.04

Sorry I can't comment yet.

But I must point out that the original ln command is incorrect, which creates an incorrect relative link usr/bin/gcc-4.8 under /usr/bin/

Correct command is

sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc

or

sudo ln -s gcc-4.8 /usr/bin/gcc


@carnendil, thanks for linking that other question. When I installed the 3.6 version of the package, everything worked fine. The download script looks a lot different compared to the 3.4 package, and it didn't have any issues with invalid content headers or hash sum mismatches.


This has been fixed by deleting the VM directly via virsh virsh undefine <VM_Name> then delete the POD from MAAS. Seems like MAAS does not fully delete pods.


Should I upgrade kernel packages on EC2 instances?

The short answer is, yes, you should keep your systems up to date with respect to security patches.

How exactly you roll out the security patches depends on your tolerance for risk.  Here are some options that I have used to answer this question in the past:

Apply the upgrades to a set of QA systems that mimic your production environment and run all your regression tests to make sure that the changes don't break any functionality or cause performance issues.  Once you're satisfied, roll out the upgrades to your production systems.
Wait a day and see if there is a public outcry about problems caused by the updates.  If all seems peaceful, upgrade your production systems.
Apply every security patch on your production systems as soon as it's available.

I have used a combination of all three of these approaches using Ubuntu, and have gradually moved towards option 3 over the years.  Security patches are heavily tested before released and great care is taken to not break existing functionality.  I've never had a problem upgrading within the Ubuntu supported images (though I did once have an issue years ago when I was using a non-Ubuntu kernel with Ubuntu on EC2).

Note that upgrading the kernel also requires a reboot to apply the changes.

The above experience and recommendations apply only to upgrading within an Ubuntu release (e.g., 11.04).  Upgrading to a new Ubuntu release is a much larger and riskier task and definitely requires testing before you roll it out to your production systems.

Here's an article on this topic that was just published by RightScale about how to manage security upgrades in their environment:

  http://blog.rightscale.com/2011/09/28/security-patching-in-the-rightscale-universe/


Is there a replacement for WUBI in Windows 10?

There are community supported versions. see wubi info


Print a group of lines if they contain specific strings

A two-part solution using Perl and grep:

perl -pe 's/^>C \d+$/\0$&/' file1 | grep -zFf file2

Since >C <some number> separates the groups, I match that and insert a ASCII nul character (\0) ahead of each group.
Then I can take advantage of grep's ability to deal with NUL-delimited lines (-z), while reading patterns from a file  (-f file2).

With awk, I'd do something similar, by using >C as the record separator and printing a NUL before each record:

awk -v RS='>C ' '{printf "\0>C %s", $0}' foo | grep -zFf ba


You didn't really explain well what your problem is, but by reading some stuff about your error, it appears that your virtual machine isn't booting up.

https://forums.virtualbox.org/viewtopic.php?f=11&t=43487
< According to that webpage, somebody solved a similar problem on their system by running chmod g-w /opt.

Though in your situation, it looks like you'd want to run chmod g-w /Applications.

(or sudo chmod g-w /Applications)


While booting and shutdown Ubuntu shows the process it is executing in black screen. Graphical page is not getting display

Solution is u have to edit grub program

cat /etc/default/grub

Change the below line

GRUB_CMDLINE_LINUX_DEFAULT="drm.debug=0xe quiet splash"

and reboot


I'm having the same trouble. I find that the problem occurred because we don't say the display that the script should use. In your case I suggest that try put DISPLAY=:0 in the call to the system function.
os.system("DISPLAY=:0 scrot '" + time + ".png'")

my script is shorter than yours, but have same effects. I save in /bin/take-screenshot
#!/bin/sh
mkdir -p $HOME/.logger/$(date +'%Y%m%d')/screenshots
DISPLAY=:0 import -window root $HOME/.logger/$(date +'%Y%m%d')/screenshots/$(date +'%H%M').png

and my cronjob is
*/5 * * * 1-5 /bin/take-screenshot

References: Scrot: A Command Line Tool to Take Desktop/Server Screenshots Automatically in Linux


Can't see any startup choices when I start-up the laptop

Hold F8 when the computer boots and the boot loader prompt should appear.


Ubuntu Server installer garbled text / glitch art - how to install?

Adding nomodeset to the kernel command line did the trick! Thanks to http://www.rodsbooks.com/linux-uefi/ (via https://askubuntu.com/a/842916/249197)

It says:

  Fixing blank displays—A problem that many people had through much of 2013 (but with decreasing frequency since then) was blank displays when booted in EFI mode. Sometimes this problem can be fixed by adding nomodeset to the kernel's command line. You can do this by typing e to open a simple text editor in GRUB. In many cases, though, you'll need to research this problem in more detail, because it often has more hardware-specific causes.

(btw, the SSD is supported in Ubuntu 17.10)


How to make youtube-viewer zip package installable for 18.04

Difficult way (you chose it)

It seems that you need to install the following packages

for libtermcap.a

sudo apt-get install libtinfo-dev

for libncurses.a

sudo apt-get install libncurses5-dev

the it may need readline/readdline.h, installable with

sudo apt-get install libreadline-dev

Do not forget to install Unicode::GCString with sudo apt-get install libunicode-linebreak-perl.

Complete method is as follows:

cd ~/Downloads
git clone https://github.com/trizen/youtube-viewer
cd youtube-viewer

sudo apt-get install libmodule-build-perl libtinfo-dev \
libncurses5-dev libreadline-dev libunicode-linebreak-perl

perl Build.PL --gtk
sudo ./Build installdeps  # hit <Enter> everywhere
sudo ./Build install

gtk-youtube-viewer # run it

It will be installed in /usr/local: executables are placed in /usr/local/bin - /usr/local/bin/gtk-youtube-viewer and /usr/local/bin/youtube-viewer.

Correct way

Wait for deb-package.

Update 2018-10-06: I sent packaging request to the ppa:nilarimogard/webupd8 owner - Alin Andrei via launchpad.


Check if you have defined utopic with the following commands (CLUSTER_UUID is your clusters uuid)

Get the id of boot-sources with:

maas <PROFILE> boot-sources read <CLUSTER_UUID>

Then get available selections:

maas <PROFILE> boot-source-selections read <CLUSTER_UUID> <ID>

If you don't have utopic listed, then you create it with:

maas <profile> boot-source-selections create <CLUSTER_UUID> <NEW-ID> \
    os=ubuntu release=utopic arches=amd64 subarches=* labels=daily

More details about this can be found at "Boot images import configuration" http://maas.ubuntu.com/docs/bootsources.html

I hope this solves your issue :)


I got it.

apt-get update
apt-get clean
apt-get autoclean
apt-get autoremove
apt-get check
apt-get -m update
apt-get dist-upgrade


Playing sounds in Python Quickly without any extra libs?

It's possible to play wav files in pure Python. This stackoverflow question provides an example. It's pretty low-level and not cross-platform though (unless extra code is added). Also, it only plays wav files. If you want more, you really need a library.


Can you restrict .bashrc type commands to a single terminal profile?

Create separate run commands (rc) file to .bashrc

Keep your ~/.bashrc as is. When opening a terminal you will have normal operations.

The lines you were thinking of appending to ~/.bashrc put into a new file instead:

# ~/.gitrc
# Call after opening terminal use ". .gitrc" when it is time to
# work on Git course labs.

# Enable tab completion
source ~/git-completion.bash

# colors!
green="\[\033[0;32m\]"
blue="\[\033[0;34m\]"
purple="\[\033[0;35m\]"
reset="\[\033[0m\]"

# Change command prompt
source ~/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
# '\u' adds the name of the current user to the prompt
# '\$(__git_ps1)' adds git-related stuff
# '\W' adds the name of the current directory
export PS1="$purple\u$green\$(__git_ps1)$blue \W $ $reset"

cd ~/gitdir

Toggle between two worlds

After opening the terminal, should you desire git prompts use: . .gitrc.

After running . .gitrc, should you want regular prompts in the same terminal session, simply use Ctrl+Shift+T. A new terminal tab will open with the regular ~/.bashrc without the ~/.gitrc modifications.

DO NOT make ~/.gitrc executable

There is no need to use chmod a+x on ~/.gitrc because you are "sourcing" it. This means it runs within the current shell and not as a sub-shell process which must be marked as executable but also means variables disappear after running.

In essence marking ~/.gitrc as an executable and then calling it with .gitrc instead of . .gitrc will break it. Keeping ~/.gitrc a regular file ensures you don't accidentally execute it as a command.


Try DownThemAll extension for Firefox. You will get better speeds, better download management and possibly will solve your problem.


Non-fatal boot automount errors generated after adding NTFS partition to fstab

I cannot recommend using pysdm as it has not been maintained for ages. It still uses devices not UUID and does not have good parameters.

Your fstab does not look at all correct. Is it as posted? Did you edit out UUID and parameters at ends of every line?

The nls.. line is not a separate line but part of the sda5 ntfs mount line.

For ntfs UUID shown is example only see below to find yours:

UUID=DA9056C19056A3B3 /media/data ntfs defaults,nls=utf8,umask=000,uid=1000,windows_names 0 0

Window_names prevents the use of invalid windows characters:
(which are the nine characters ” * / : < > ? \ | and those whose code is less than 0×20)
uid=1000 should fix the trash problems as well:

for ext4

UUID=076426af-cbc5-4966-8cd4-af0f5c879646 /media/ext4-data ext4 defaults,noatime 0 2

find UUIDs

sudo blkid -c /dev/null -o list

And when you are done editing fstab and saving it run the following command to test for errors and mount the partitions without requiring a reboot. You will know before you reboot if something is amiss. Make sure you have partition unmounted if previously mounted:

sudo mount -a

More info and details on format of typical fstab entry.

Understanding fstab

http://www.psychocats.net/ubuntu/mountlinux

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

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

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


How can I preview HTML documents from the command line?

One solution is to use lynx -dump, as in

lynx -dump file.html

or

echo "
this is a div
" | lynx -dump -stdin

Better:

Use w3m -dump, it respects the page layout. It is awesome.

sudo aptitude install w3m
w3m -dump file.html
echo "
x
" | w3m -dump -T text/html

You can set the number of columns of the terminal for getting the better layout, for example, if you are using a full-window terminal, 200 can be a good try:

w3m -dump -cols 200 file.html


Ubuntu not recognizing the primary display

With Nvidia  the best results are using the proprietary drivers (you can select and install them via the Hardware app, if not already done so)
But that driver doesn't allow you to set the brightness by default. But there is a solution that worked on my thinkpad:

! This will only work with the proprietary drivers !

create /etc/X11/xorg.conf.d/21-Nvidia.conf:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Option         "RegistryDwords" "EnableBrightnessControl=1"
EndSection

Restart. then it should work

Update

Since you are a beginner, I'll explain how to do it:
All those things we do, we do in a terminal window. So you need to open the "terminal" app, just like any other program. Inside the terminal you type: (all grey text is what you have to enter). At the end of the gray text you have to press the "enter" or "return" button.
First create the directory:

sudo mkdir -p /etc/X11/xorg.conf.d

Then open an editor to paste the contents into (just as you did the first time)

sudo nano  /etc/X11/xorg.conf.d/21-Nvidia.conf

Now you're in a terminal editor. Copy & paste the text from the big gray box into your editor. Use the mouse & context menu to do that.

Now you have to leave the editor. Use Crtl+x (this means: Press the Crtl Key AND the X key together.

Then press "y" on the question  "Save modified buffer?"
To finally leave just press "Return"

You're done.


This will probably not work. 12.04 is ancient, and have different versions of essential libraries. I can't imagine that a PHP version linked against the libraries for 12.04 will run on 16.04.

As I see it, there's two ways to accomplish this:

Install 12.04, perhaps in a VM.
Compile PHP 5.3 from source on 16.04.

Either of these options will work. Either option is a really, really bad idea. There's a lot of security problems that are patched in later PHP releases, and you should investigate why the application is not running on PHP 5.6, and fix those issues.


18.04.1: Lenovo P1 Gen 2 No Wifi adapter found

The specs linked above in the first line of your question show it has a Mini Gigabit Ethernet port, #4 in this picture.

Attach a Gigabit Ethernet dongle to that port for the connectivity you need for the installation.


Why are Snap packages marketed as "sandboxed" when they are not sandboxed in actual usage

Snaps installed with --classic aren't sandboxed.
...from man snap
--classic
              Put snap in classic mode and disable security confinement

It makes more sense to restrict some programs, and less other ones.


security - rubber-ducky-attacks - How to block only a part of the USB ports from delivering mouse/keyboard input?

You can use the packages usbauth or usbguard to use the Linux kernel's USB authorization mechanism and the bolt or thunderbolt-tools packages to use the Linux kernel's Thunderbolt authorization mechanism.
Alas, 20.04 LTS's version of usbguard has removed the excellent Qt applet that made it very easy to use.


Try this way.

sudo apt-get install hibernate

After that just type in terminal sudo hibernate
This way work for me


sudo apt-get autoremove

Might help, it will remove old unused kernel images, but if the /boot partition is that small, you may consider resizing it.


You haven't installed Emacs with the package manager. As you have installed it from source tarball, try this way.

Check emacs version.

$ emacs --version

Download the same emacs version you have installed in the past.

$ wget https://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.xz

Extract tarball.

$ tar xJvf emacs-$VERSION.tar.xz

Run ./configure to generate the make file. If you remember the option you have given when you install it, add those command line flags, too. (e.g. --with-x=no)

$ cd emacs-$VERSION
$ ./configure

Do make uninstall to uninstall.

$ sudo make uninstall

Enjoy!


How to log in as guest user via terminal?

Ubuntu "guest users" are added and deleted on the fly. They are account without passwords (and locked so). You can find details on guest user also on Ubuntu Wiki.

If you want a fixed guest user, you should create one (you can do this via the control settings graphic interface of via commandline with adduser)


creating a shortcut in a folder in Ubuntu 14.04

The Path key of a Desktop Entry File doesn't perform tilde expansion or any other form of shell expansion. You need to specify an absolute path that will be interpreted verbatim until the next line break character, e. g.:

Path=/home/charlie/ZereneStacker

This is probably what you want because the application directory is only in your home directory, not in every user's home directory. For the same reason it may also make more sense to put the desktop entry file in ~/.local/share/applications because that's where user-specific desktop entries reside (instead of the system-wide locations /usr/share/applications and /usr/local/share/applications).

Alternatively you can remove the Path key of invoke a shell from the Exec key of and have it expand the tilde:

Exec=/bin/sh -c "cd ~/ZereneStacker && exec ./ZereneStacker.bsh"


Grub 2 menu isn't showing up after installing Ubuntu 15.04, Windows 8.1 is preinstalled

It's hidden by default. Take a look at /etc/default/grub and change it as necessary. Reference.


This will probably be file permissions, the minidlna server runs with the user:group minidlna:minidlna so if the files you have created are not either in a matching group, or are world readable then this process will not be able to scan or read them. You need execute permission on the directory to be able to list the files, and read permission on the files.
Show the permissions with stat <filename> and change the permissions with the chmod command.
To add the world readable to a file chmod a+r <filename>


The accountsservice that is responsible for showing users in login screen and user's configuration will be configured in /etc/login.defs. Here you have to change UID_MIN and GID_MIN both to values less than or equal to the ones using for 'normal' users, in your situation maybe to 500 each. See e.g. accountservice-and-uid-1000

As for root/toor, you never should login with root privilege; sudoand gksudo are the defined way if you need the privileges. And, of course, root/toor will not be shown in login screen (well you may change the values in /etc/login.defaults to 0, but that would be fatal if you do!


The dash "search your computer and online sources" simply doens't work in Ubuntu 14.04

I had a similar problem with two mirrored monitors.

I solved it by changing the order of the monitors (Settings->Monitors).


Can Snap install resume a failed download?

The latest version of Snapd supports resuming downloads. If this is not working for you, please let the Snap developers know on the Snapcraft forum.


Popup when opening files in Telegram Desktop snap

i've just figured out how to allow telegram to store files without asking using this command:

sudo snap connect telegram-desktop:home


Install Ubuntu 14.10 on secondary UEFI partition

Thanks Fabby for your response. Your answer to copy the ubuntu UEFI files to a UEFI partition is correct. However, I was only able to resolve my problem by first disconnecting the Window's hard drive altogether from the system before running the ubuntu system installer. This allowed the installer to correctly copy the grub2 UEFI files into the EFI system partition on the ubuntu hard disk. It seems that the ubuntu installer has bugs that need to be worked out with regard to dual boot configurations that rely on UEFI and Widows 8+. With regard to your comment of disk partition /dev/sdb1 not being a UEFI partition, I assume that I used the wrong term. I should have stated this as being an ESP (EFI System Partion) as stated in the disk partitioning report that I have provided a link to in my original note. The good news is that the system now dual boots properly displaying a grub menu for selecting ubuntu or windows and everything is fine :). Hope this chain helps some other frustrated users out there.

With regards,

DougC


I can't to install lubuntu on a USB drive due to a bad unsquash configuration

The problem was solved using Rufus instead of YUMI.


login to "front end gui" from ssh (together with Synergy)

I have not yet made this work, but I wanted to add what I have tried, and how it failed so far, in case this will make someone else see what I am doing wrong.

everything is based on the comment by c0rp, via this link (thanks)

I have created two bash script files like this:

1) /sbin/my_loginscript.sh (used to "log in", and open two computers)

#!/bin/bash
#
# Script to loging to my other computers when I login, save some time
#
echo "UNLocking laptop and desktop"
ssh -X myuser@192.168.12.22 "export DISPLAY=:0; gnome-screensaver; gnome-screensaver-command -d;"
ssh -X myuser@192.168.12.203 "export DISPLAY=:0; gnome-screensaver; gnome-screensaver-command -d;"
echo "Now get some back to work"

2) /sbin/my_logoutscript.sh (used to "log out" and close two computers)

#!/bin/bash
#
# Script to loging to my other computers when I login, save some time
#
echo "Locking laptop and desktop"
ssh -X myuser@192.168.12.22 "export DISPLAY=:0; gnome-screensaver; gnome-screensaver-command -l;"
ssh -X myuser@192.168.12.203 "export DISPLAY=:0; gnome-screensaver; gnome-screensaver-command -l;"
echo "Now get some rest"

Both these scripts works fairly well, and when I run them directly the two extra desktop computers "open and close" and I can use synergyto control them, this in itself is much faster than logging in manually to the two extra computers.

Now I try to automate this, and this is where I have problems.

when I log in to computer (have to log out for this to work)

I create a new file '/etc/xdg/autostart/my_script.desktop'

it looks like this:

[Desktop Entry]
Type=Application
Name=global login
Exec=sudo /sbin/my_loginscript.sh
Icon=system-run
X-GNOME-Autostart-enabled=true

and this actually works.. when I log in, the two other screens unlock like I want.

Todo: how to close it when I log out?

but also, I almost NEVER log out from my PC, I only LOCK it and UNLOCK it, so that is what I really want to fix, and this is how I have tried.

I create a new file called '/etc/pm/sleep.d/99_resume.sh`

and it looks like this:

#!/bin/bash

case "$1" in
thaw|resume)
    /sbin/my_loginscript.sh 2> /var/log/wakeup.log
    ;;
suspend|hibernate)
    /sbin/my_logoutscript.sh 2> /var/log/wakeup.log
    ;;
esac

but this does not seem to work at all, and i have a hard time troubleshooting it. if anyone have any hints or tips here, that would be very nice.

edit: Based on the comment from C0rp below, I have edited his scrip, and it can be found (edited) here:

basically after you clone or otherwise create the event_catcher.sh file, you first copy my two files my_logoutscript.shandmy_logoutscript.shas described earlier, to the/sbinfolder. Then start the daemon by running this./event_catcher.sh start`.

next time you hit Ctrl Alt L your computer will lock and also your other PCs will lock.

PS: I have assumed that you use ssh-copy-id to enable login on those PCs with out password.

so, I consider the question solved now, but I will wait a bit for c0rp to see if he want to create a very quick answer (instead of only comments), and if he does that I will give him the credit. Thanks again c0rp!


For this to work your aria2 should support option pause. Search for  --pause[=true|false] in man aria2c. It works in aria2_1.12.0-1_i386 [oneric] (and later).

First start RPC server: aria2c --enable-rpc=true (For older ver. aria2c --enable-xml-rpc=true)
Then use RPC using http://localhost:6800/jsonrpc
The following example adds http://example.org/file to aria2:
In a python console type the following

JSON RPC

import urllib2, json
jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
    'method':'aria2.addUri',
    'params':[['http://example.org/file']]})
c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
c.read()
'{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}'

The following example pause download whose GID is "3":

XML RPC

import xmlrpclib
s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
s.aria2.pause('3')

If you get somethin like below your version of aria2 doesn't support it.

xmlrpclib.Fault: <Fault 1: 'No such method: aria2.pause'

In version that use aria2c --enable-xml-rpc=true, other options can be used such as adiing files, etc. (using XML RPC).


Why do my WD blue 4tb disks show up as 2tb in gparted, gdisk, parted, and fdisk

Because I was using an old raid card. An lsi sas 3801E which only supports up to 2tb disks. See this: Broadcom.com/support/knowledgebase/1211161495837/using-drives-2tb-in-capacity-with-lsi-sas-hbas

Thanks to reddit, and everyone here


How can I resolve BUILD_EXCLUSIVE error in upgrade to 3.19.7 Kernel?

I ended up removing all files with the command below.

sudo apt-get remove linux-headers-3.19.* linux-image-3.19.* && sudo update-grub

I reverted back to 3.18.-something. I then ran through the exact same steps and it seems to have worked the second go around.

Not sure why that error came up, but removing the files and starting over helped.


Is there a program for controlling your audio volume with keys?

No such hotkey is listed at either https://wiki.gnome.org/Design/OS/KeyboardShortcuts or https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
Therefore, I bought a $10 used multimedia keyboard with dedicated volume keys (see picture).

If you are using Ubuntu 18.04 or later you can use GNOME Volume Mixer, a GNOME Shell Extension.

.


Which version are you running?  I'm running 10.04, and I can right-click on any of the menus (Applications, Places, or System) and see the option to "Edit Menus."

That gives me a window with options to hide certain entries via checkbox.


What is the "~" at the end of some files on terminal?

Many editors use file_name~ to save a temp copy of the original file.


How to re-enable FTP on secondary Ubuntu/Debian server to pull updates from Main Linux Server with Mirrored depository?

On the command line run

echo 'Dir::Bin::Methods::ftp "ftp";' | sudo tee -a /etc/apt/apt.conf.d/99local-ftp

This will create a config file named 99local-ftp (you may choose another name if you want) in folder /etc/apt/apt.conf.d/ that contains the line

Dir::Bin::Methods::ftp "ftp"

This will re-enable FTP for apt.


Installing linux on ROG GL552VW (Beginner)

I carried out a fresh install of 16.04 on my ASUS GL552VW.

The only additional GRUB parameters I entered (for installation and normal boot) were:

nouveau.modeset=0

To stop Nouveau from taking over.

Once I'd installed the nVidia 361.42 drivers, through the Additional Drivers tab in Software Updater, I had to disable Secure Boot. (Secure boot stops unsigned kernel modules loading)

With those settings, everything works. Touchpad, Skylake support, nVidia graphics @ 1920x1080, Wifi, Bluetooth, keyboard backlight.

Installation of 16.04 is much less hassle than previous versions.


Guys I discovered that Ubuntu uses another commando the debootstrap
And using them I got create the system-root.

Like this:

sudo debootstrap --arch amd64 focal system-root


How do I remotely reboot my computer if I have an encrypted HDD

There is no safe way around this.

Either you:

Enter the password automatically. Thus negating the security.
Or you manually enter it at boot.
Or you manually enter it after booting a small unencrypted partition.

The last allows you to boot a minimal system into which you can SSH and then manually mount the partitions with protected data, but it also weakens the security because people can compromise this unencrypted part and wait for you to enter the encryption password.

If your server is equipped with a remote management feature (E.g. Dells DRAC, HP ILO etc) and that is on a secure network then you can also consider using that to remotely grab the console and enter the password (A sort of remote option 2).  That assumes you trust the remote management features and network.


Well sda1, sda2 and sda3 are of SFS type.When Linux reports SFS for MS Windows machines, that generally means that the Windows machine HDD was formatted using Dynamic Volumes.
Partition type 42 is a Windows specific dynamic partitioning type that Linux may not be fully aware of or feel safe modifying.

They are Pure dynamic disks (those not containing any hard-linked partitions) have only a single partition table entry (type 42) to define the entire disk. Dynamic disks store their volume configuration in a database located in a 1-MB private region at the end of each dynamic disk.

You could follow this link to convert your Dynamic hdd to basic hdd.


Ubuntu 16.04 dualboot with Windows 10 won´t start up

On the systerm. Long press on shift. if it give you a boot option then  try doing this step, if not then i m sorry.

Select Advanced recovery option

It will give some options like ****normal start****, grub ******  select the one with grub.... it update grub sometimes it ask password, give it. restart system.


Apache displays "Default Page" when using https://www.example but works for https://example

You have this in your config:

ServerName example.com

This matches example.com, but not www.example.com. That's two different names. If you use https (as you do, based on the config), you also need either a certificate with multiple names, wildcard or separate certificates for example.com and www.example.com.

Use ServerAlias www.example.com to add an alias to the ServerName. This is also documented in the excellent apache documentation, which should be the first stop when something is not working:

  When a request arrives, the server will find the best (most specific) matching  argument based on the IP address and port used by the request. If there is more than one virtual host containing this best-match address and port combination, Apache will further compare the ServerName and ServerAlias directives to the server name present in the request.


update-manager "failed to download package files" but apt upgrade works

As N0rbert suggested in comments, IPv4 was the thing.

In the question he linked (https://unix.stackexchange.com/a/100887/57134) there are instruction to make apt-get use IPv4 by default. This also affected update-manager and the problem has been solved.

Thanks N0rbert for the help!


Black Screen After Post on Install 12 or 13.04

Boot into GRUB by pressing shift as the computer boots. In GRUB add acpi_backlight=vendor to the line that reads GRUB_CMDLINE_LINUX_DEFAULT=.

This should enable your vendor specific backlight. Once booted you can edit /etc/default/grub. After making the changes be sure to run update-grub to make the changes available to grub.


thank you for responding. the problem: I can not boot to the xubuntu live system on USB other than enabling legacy mode in bios (uefi), because the stick is not showing up in the boot menu of bios. secure boot, fast boot are deselected in this mode..


GNOME 3 16.04 LTS front end crash during logout

From the comments...

re: "My my. You've got a very unstable system. Probably due to "lots of drivers and customization to hunt down / tweak to get acceptable performance".

Please temporarily disable ALL GNOME extensions that are NOT by author fmuellner. Dash to Dock is OK, you can leave that one enabled. Run your system and see if it runs more stable. Keep in mind that you may have more than one actual problem causing your crashes.

Monitor /var/crash with ls -alt /var/crash, looking for crashes, even ones that you may not be aware of.

Once you've established a baseline that your system runs without problems, we can start enabling GNOME extensions ONE AT A TIME, until instability reoccurs again.

Update #1:

we've disabled all GNOME extensions not by author fmuellner (Dash to Dock is OK)
we've disabled Caribou, libinput-gestures, and Welcome, in Startup Applications

Update #2:

Update your question to include the latest ls -alt /var/crash so I can see what's changed.

To review syslog, in terminal type more /var/log/syslog. This will show you the current syslog (there's more than one) on your screen. Page through it, looking for some error that repeats itself a lot, or some lines that start with ERROR, WARNING, or FATAL. Pay close attention to the time on each line, and as you approach the time of the last freeze/crash/logout incident, pay closer attention to each line, looking for an event that occurred just before the freeze/crash/logout incident, or just before a reboot. That would be most important. Copy/paste any lines that you think are important for me to see.


How do I revert old theme customizations after they re-appeared in Ubuntu 11.10?

Well, since nobody else wants to answer...

I just stumbled upon the following question and I'm pretty sure the behaviour I experienced was caused by the settings being read from one config system but configuration tools changing the settings in another.

Just to quote:

  dconf is a new way for applications to store settings, and it is
  intended to replace gconf. dconf-editor and gconf-editor are for their
  respective configuration systems, and they don't talk to each other.
  At the moment that transition is still a work in progress, so many
  applications continue to use gconf. In addition, some applications
  still have settings left over in gconf even though they are using
  dconf now.

  Almost all of the software that is installed by default - everything
  that comes from GNOME - uses dconf (if anything). Almost everything
  else that is available uses gconf, though this is of course changing
  as older software is brought up to date.

If I still had that system I would install gconf-editor and dconf-editor and poked around to see where the settings in question were stored.


Matlab R2010b under Ubuntu 12.04 - installation issue

There is one point which surprises me: You seem to have mounted the MATLAB DVD image in /usr/local/matlabR2010b (or you have copied the files there). This is an unusual place to mount a DVD image. More importantly, it is the same directory where MATLAB should be installed (see the -root argument at the end of the command to run). I can’t verify it right know, but it could be that the installer doesn't do anything because of that reason.

If mounting the DVD image at some other location does not help, some ideas for further analysis of the problem: It is quite obvious from the source of the installation script that the only thing which can fail without showing a real error is the command stated as “command to run”. Therefore, you could try to run that command manually and adding the -verbose argument. However, the installation script creates some temporary files you will need beforehand. The easiest way to get these is probably commenting line 567 of the script:

rm -rf $TEMP_DIR

Then you execute it once and can afterwards execute the actual installation command with the -verbose flag.


Is it possible to set Ubuntu a way that it does not shutdown before a script is finished?

For Ubuntu 16.04+ using systemd (the default).

systemd-inhibit --why="Wait for this script to finish" bash script.sh

===

Test:

$ systemctl poweroff
Operation inhibited by "bash script.sh" (PID 23912 "systemd-inhibit", user rinzwind),
reason is "Wait for this script to finish".
Please retry operation after closing inhibitors and logging out other users.

===

There are 7 locks:

sleep inhibits system suspend and hibernation requested by (unprivileged) users
shutdown inhibits high-level system power-off and reboot requested by (unprivileged) users
idle inhibits that the system goes into idle mode, possibly resulting in automatic system suspend or shutdown depending on configuration.
handle-power-key inhibits the low-level (i.e. logind-internal) handling of the system power hardware key, allowing (possibly unprivileged) external code to handle the event instead.
handle-suspend-key inhibits the low-level handling of the system hardware suspend key.
handle-hibernate-key inhibits the low-level handling of the system hardware hibernate key.
handle-lid-switch inhibits the low-level handling of the systemd hardware lid switch.

You probably also want to prevent suspend, idle and hibernate.

Example using "package manager":

fd = Inhibit("shutdown:idle", "Package Manager", "Upgrade in progress...", "block");
/* ...
      do your work
                 ... */
close(fd);

Similar to this you can code your version and add a "shutdown" at the end of this script (or add a way to determine a shutdown needs to be the next action).


Installing ubuntu alongside Win 10 - grub_amd64_signed error

Windows ties the computer's boot mode to its partition table type:

BIOS/MBR -- Windows insists on a Master Boot Record (MBR) disk when booting in BIOS mode. This was the way most computers booted until late 2011, when manufacturers began shifting to EFI firmware in droves. Newer computers can still boot in this way via a firmware feature called the Compatibility Support Module (CSM), aka legacy-mode boot support.
EFI/GPT -- The Extensible Firmware Interface (EFI), or its version-2.x variant, the Unified EFI (UEFI), is generally booted from GUID Partition Table (GPT) disks. This is the modern way of booting computers. It has some advantages over BIOS-mode booting, but it's different enough that the learning curve is significant, particularly if you're familiar with BIOS-mode boot tricks, many of which are worthless under EFI.

Importantly, switching between boot modes is usually awkward; it may require changing the boot mode in the firmware on every boot or at least using the computer's built-in boot manager. It's also necessary to create an EFI System Partition (ESP) to hold the EFI boot loader(s), and that is fundamentally the source of your problem -- you don't mention creating an ESP, and I'd wager that's why the installation failed.

Your computer seems to have been booting Windows in BIOS mode from an MBR disk. By booting the Ubuntu installer in EFI mode, you were trying to create a mixed-mode install, with Windows in BIOS mode and Ubuntu in EFI mode (but both booting from an MBR disk). This is the hardest way to install Ubuntu, given your current configuration. In brief, you have three options (well, there are more, but the rest are even more tortuous):

Install Ubuntu in BIOS mode -- The easiest approach is to install Ubuntu in BIOS/CSM/legacy mode. You can do this by re-enabling the "legacy" option in your firmware that you noted you disabled. If you disabled this option because you couldn't get the installation medium to boot, then chances are that medium was improperly prepared. You may need to adjust options in whatever tool you used to prepare it or switch to another tool entirely.
Convert Windows to EFI mode and install Ubuntu in EFI mode -- A significantly harder approach, but one you might want to consider if you had a real reason for attempting an EFI-mode install of Ubuntu, is to convert Windows to boot in EFI mode from a GPT disk and then install Ubuntu in that mode. The Microsoft MBR2GPT program is supposed to be able to convert Windows and the disk partitioning system fairly easily; however, I've never used this tool and so I can't comment on it further. Once this conversion is done, Ubuntu should install fairly easily when you boot the installer as you did before.
Do a mixed-mode install -- In extraordinary cases, a mixed-mode installation makes sense. These circumstances include strange hardware compatibility issues or a need to boot each OS in a particular mode for some reason (say, to write software that relies on one boot mode or the other). You've noted no such reasons. Nonetheless, such an installation is possible. To do it, the key is to create an ESP on your MBR disk. (Although Windows balks at installing to an MBR disk in EFI mode, Ubuntu is more flexible about this.) Once installed, you'll need to learn to control the boot mode, which may involve using the built-in boot manager or even adjusting the boot mode on a boot-by-boot basis in the firmware. My rEFInd boot manager can help in some cases, but you'll need to adjust the configuration: Edit refind.conf, uncomment the scanfor line, and ensure that hdbios is among the options. Note that it can be tricky to get some computers to boot reliably from an MBR disk in EFI mode, so you may need to dig pretty deeply into EFI to figure that out. This is easily the worst of the options unless you have a compelling reason for a cross-boot-mode installation that you haven't mentioned.

Note that the 4-partition limit you mention applies to primary MBR partitions. One of those four primary partitions can be an extended partition, which in turn can hold an arbitrary number of logical partitions. Thus, you can create an ESP (if necessary), a Linux root (/) partition, and as many other partitions as you want, all as logical partitions. Beware, though: The standard Windows partitioning tools flake out when fed extended and logical partitions! Use Linux tools or third-party Windows tools when manipulating disks that use logical partitions. Also, Windows itself must boot from a primary partition. (Ubuntu is not so fussy, fortunately.) The primary/extended/logical partition distinction is unique to MBR; GPT disks do not make this distinction. (Many tools label all GPT partitions as being "primary," simply because the tools were originally written for MBR disks and so require that all partitions be classified as one of those three types.)

Overall, the easiest way to do what you want is probably to do a BIOS-mode install; this will require no conversion of the partition table or potentially disruptive changes to the Windows boot loader; however, booting in EFI mode can be a little faster, and GPT offers some advantages over MBR. (Most importantly, GPT supports disks larger than 2TiB, given a 512-byte sector size.) If you have a good reason for doing it, or if you simply want to experiment, converting Windows to EFI/GPT and installing Ubuntu in EFI mode is worth considering. In the long run, this may be the better option; but the advantages are likely to be modest enough that the short-term risks and time investment is unlikely to be worthwhile.


Setting up multiseat the easy way on Ubuntu 16.04

The different tutorials make multiseat more complicated than it has to be.  I wrote a GUI which simplifies the seat assignment process and called it EasySeats.

https://github.com/ezst036

You will need to change your display manager to LightDM.  The 3.x branch of GDM does not support multiseat to my knowledge.


Do I need to compile Intel Graphics drivers on Ubuntu? And if so, how?

This driver is integrated in Ubuntu, as the whole package of drivers from the Intel Linux Graphics suite is. For the very latest builds of graphics drivers, you can try X.org edgers PPA (warning: experimental1).

You should not have to compile from source for any regular piece of hardware. If you boot up Ubuntu 12.10 on this hardware it works out of the box and you should not have to worry about drivers.

1 "Experimental" when used in Ubuntu PPAs mean that the software is more or less in the "Beta/testing" phase. Therefore it's more likely to experience bugs, so you should not use them if you don't know how/don't want to take the time to fix you system if something goes wrong.


I want to triple boot Windows 7, XP and Ubuntu

Well, you should have installed both Windows first, then install Ubuntu, but you can install XP now, find a way to reinstall grub, then you can triple-boot with XP,7 and Ubuntu. There are many guides on how to reinstall grub, some are complicated and some are not complicated.


14.04 - Remote Desktop/Control to Headless Ubuntu Desktop

Assuming that ¨headless¨ means that you do not have the X.Org Display Server installed, you are not able to login with Remote Desktop, VNC, or another ¨Remote Desktop Program¨.

You have two options.

You could install a graphical environment on the server (when you are at it´s physical location), then install VNC or XRDP, and use your home computer to connect to that VNC/RDP Server. For VNC, I would recommend the TightVNC Viewer (quick Google search will do), and with XRDP installed, you can connect using Windows´ built-in ¨Remote Desktop¨.
In case that you do not want to install a desktop environment, you need to install a SSH Server. You can then download a program like PuTTY (Google search), and connect to the IP Address, with your username and password. As SSH Server I would highly recommend the openssh-server package, which can be installed by executing the following command: sudo apt-get install openssh-server. In case that you are root, you do not have to use sudo. I hope that this will help you getting a little further.

If you have any questions, you can ask them here (if you want), I will try to answer them as soon as possible.


I found the problem was related to Suspending. Somehow it was breaking Grub. Repairing Grub didn't work with the first install, did work with a broken fresh install.
So this did work: http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd
I have then edited the logind.conf with these instructions to ignore the laptop lid:

To get started:

Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run the >command below to open the configuration file via gedit editor:
sudo gedit /etc/systemd/logind.conf

Replace gedit with vi or other text editor if you’re on Server edition.

Find out the line #HandleLidSwitch=suspend, remove the # and change it to:
HandleLidSwitch=poweroff to shutdown computer when lid is closed
HandleLidSwitch=hibernate to hibernate computer when lid is closed
HandleLidSwitch=ignore to do nothing

Save the file and restart the service or just restart your laptop to apply >changes.
sudo restart systemd-logind

which I found here:
http://ubuntuhandbook.org/index.php/2014/04/shutdown-ubuntu-14-04-lts-when-the-lid-is-closed/
I think the problem is something to do with the Hybrid Video Card and Suspending. I am happy to avoid Suspending.


How do I increase the  touchpad sensitivity on Acer Aspire One 532h?

This is most likely a hardware problem or the lack of a driver to interface it

If it works fine in windows, its the lack of drivers.If it doesen't work on windows either, its a hardware problem

It will be very hard to get a driver, if you cant find the Serial Number of the Trackpad


In Awesome window manager, how do I add vicious widgets?

You've created and registered the widget, but you've not actually told Awesome where to put the widget.  You might assume it should know you want it in the default "panel", but actually you can put it in other places (like if you set up a second panel at the bottom).

In the default rc.lua (and yours hopefully, if it's not been too customized), there should be a part that says something about creating a wibox:

 -- Create the wibox
 mywibox[s] = awful.wibox({
         fg = beautiful.fg_normal, bg = beautiful.bg_normal,
         border_color = beautiful.border_focus,
         --border_width = beautiful.border_width,
         position = "top",
         --height = 20,
         screen = s
         })

[Note there is an 's' variable due to that portion being in a 'for' loop.  Same for the next code block below. ]  Then you add the widgets you've defined to the wibox as follows:

 -- Add widgets to the wibox - order matters
 mywibox[s].widgets = {
     {
         mylauncher,
         mytaglist[s], spacer,
         mylayoutbox[s],
         layout = awful.widget.layout.horizontal.leftright
     },
     mytextclock, separator,
     volwidget, volicon, separator,
     mailinfo, mailicon, separator,
     s == 1 and mysystray or nil,
     separator, upicon, netwidget, dnicon,
     -- mytasklist[s],
     layout = awful.widget.layout.horizontal.rightleft
 }

These are not all vicious widgets but some default ones and ones I've defined.  I have one set of widgets starting from the left edge of the screen and another starting from the right edge.  My tasklist used to be in the middle of the panel but I've commented it out, since now I put a tasklist on a bottom panel and use conky in the middle of the top panel.


How to make Screencast on Ubuntu 17.10 record longer than 30s?

One can adjust the recording time via gsettings.

Suppose one wants 1 minute of recording time:

$ gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length 60

sets the recording time to 60 seconds.


Here's what I would try:

sudo umount /dev/sdb
sudo dd if=/dev/zero of=/dev/sdb && sync
sudo mkfs.vfat -I -n "Xplode" /dev/sdb
mkdir ~/usb
sudo mount /dev/sdb ~/usb/

If that doesn't work, then you might have a hardware issue with it, meaning that the drive (or controller in the drive) itself is bad.  In that case, go to Amazon and order one for $6.


font config error launching google-chrome-stable from the command line on 14.04.5

The first thing I noticed was the warning regarding line 146 in /etc/fonts/fonts.conf which only had the </blank> tag on the line line so I removed it. Then I noticed the error on line 152. I attempted the accepted answer to the question linked in the question above to no positive affect so I assumed that line 152 was the problem. Upon further review of the file I noticed that line 152 only contains a </config> tag and found a corresponding <config> tag on line 80 so I decided that can't be it as everything between <config> and </config> looks pretty important. Then I noticed the <blank> tag  on line 86 and decided  that I had inadvertently broken the file by removing the ending tag with out the beginning tag. So I removed line 86 as well and saved the file.

This approach resolved the problem immediately.


Why does Linux list devices that do not exist?

You are only using 2 devices now, but system is able to work with as many as 32. Hence, name ttyS32 exists if you might need it. In old days there were just 4 Com ports, but now with hot swappable devices that can spawn synthetic ports, better if kernel claims control of the names it might use


Why is Ubuntu download hanging for hours?

I recommend to you to download it via Bittorrent.

In Ubuntu page, you can chose Torrent file, and its speed is very good.

You can select it from here: http://releases.ubuntu.com/precise/


Firstly, scan.txt is being continually monitored by scan -F, which never quits. Secondly, grep "IP:" fails - try "IP" instead, & thirdly you're generating the scan.txt file after you've checked it..

You'd need to have the dhcpdump line running as a timed process to make the first program line do anything at all.


Kernel outputting this, should I worry? - [Hardware Error]: PROCESSOR 0:406e3 TIME 1498209621 SOCKET 0 APIC 3 microcode 9e

Google search of "[Hardware Error]: PROCESSOR 0:406e3 TIME 1498209621 SOCKET 0 APIC 3 microcode 9e" gives the following:

Several things to try:

Install microcode. (askubuntu.com: installing microcode)
Check if the computer is overheating with lm-sensors (ubuntu.com: sensors howto)
bad irq settings in bios (hardware error cpu)
Someone mentioned bad power supply unit (psu) and machine check exception (mce) for hard drive in intel forum (linux machine check exception)
Overheating can cause that error (prime number calculation overheating)


Cannot update grub with parameters on live USB

You'll need to do a bit of remounting and remapping.

After booting the liveCD, we'll mount the Ubuntu partition to /mnt with:

sudo mount /dev/sd*# /mnt

where /dev/sd*# is updated to your Ubuntu partition.

If you have a separate /boot partition, we'll need to mount it in /mnt/boot as well:

sudo mount /dev/sd*# /mnt/boot

where /dev/sd*# is updated to your /boot partition.

This should mount it with enough access to get the canonical path if needed, but we'll likely not need this.

To finish up, just update grub with the correct root and target:

sudo grub-install --root-directory=/mnt /dev/sdX

where /dev/sdX is the disk(not the partition) where we want GRUB.


How to see history of snap packages updates?

snap changes will list recent changes, and snap tasks will list the steps involved in a change.

It gets garbage-collected after some time (1 day for changes that succeeded, 7 for failures), or after a certain size (500 changes), both of which are currently hardcoded, but it's the commmand you want.

I'll update lp:1771714 to reflect this.


Twitter client with Real Time Notifications?

Hotot's had support for user streams(aka real-time updates) since quite some time. If the Chrome Extension isn't not what you're looking at, you can install the native client.

It is available in Ubuntu Software Center, click here to install it


Bluetooth [0cf3:3004] turns off immediately

You do not have the firmware installed for this adapter.

You can install it this way. Run in terminal:

wget http://mirrors.kernel.org/ubuntu/pool/main/l/linux-firmware/linux-firmware_1.157_all.deb
sudo dpkg -i linux-firmware*.deb


Gnome shell extensions are disabled after reboot

Here's a workaround in the spirit of this answer. This works at least for 3.12. The idea is to export a list of the extensions you want active, then write a script that activate them at boot.

Getting extension list

First, activate the extensions you want active. We then generate a list with those:

In terminal (Ctrl + Alt + T), run

gsettings get org.gnome.shell enabled-extensions

It returns a list with your currently active extensions a la

['Bottom_Panel@rmy.pobox.com', 'impatience@gfxmonk.net']

Setting extensions

To activate exactly the extensions in the list, run

gsettings set org.gnome.shell enabled-extensions ['extension_1',  'extension_2', 'extension_3']

but with your own list, naturally :)

Script to set extensions on boot

To automate on boot, create a script running that command.

Go to e.g. your home folder, and create a new empty file. Name it script_name.sh (only the extension matters). Start the file name with a full stop . if you want it to be hidden.
In that file, write

#!/bin/bash

gsettings set org.gnome.shell enabled-extensions ['extension_1',  'extension_2', 'extension_3']

Then save the file, of course :)

Make the file executable e.g. by right click > Properties > Permissions > Check "Allow executing file as program"
Alternatively, change the permissions from terminal by running chmod ugo+x script_name.sh in the script's folder.
Make it on system start up (I don't know how else to do this): in ~/.config/autostart/ create a file called some_name2.desktop and in it put

[Desktop Entry]
Name=your_prefered_name_here
Exec=/home/your_user_name/.script_name.sh
# Terminal=false
Type=Application
Hidden=false
StartupNotify=false
Name[en_US]=your_prefered_name_here

The path after Exec= should be to where the script you created in step 2 is. Again, save the file :)

Maybe immediately or else after boot, you should see the script in Gnome Tweak Tool under Startup Applications. It should also run on startup.

Activating and Deactivating Extensions

If you want to change which extensions are run, you should re-generate the list, then insert the new list in the script run.

Final Words

I hope this works in 3.14, too.


How do I use $* while omitting certain input variables like $1 and $2 in bash script?

You can use bash Parameter Expansion to specify a range, this works with positional parameters as well. For $3…$n it would be:

"${@:3}" # expands to "$3" "$4" "$5" …
"${*:3}" # expands to "$3 $4 $5 …"

Be aware that both $@ and $* ignore the first argument $0. If you wonder which one to use in your case: it’s very probable that you want a quoted $@. Don’t use $* unless you explicitly don’t want the arguments to be quoted individually.

You can try it out as follows:

$ bash -c 'echo "${@:3}"' 0 1 2 3 4 5 6
3 4 5 6
$ echo 'echo "${@:3}"' >script_file
$ bash script_file 0 1 2 3 4 5 6
2 3 4 5 6

Note that in the first example $0 is filled with the first argument 0 while when used in a script $0 is instead filled with the script’s name, as the second example shows. The script’s name to bash of course is the first argument, just that it's normally not perceived as such – the same goes for a script made executable and called “directly”. So in the first example we have $0=0, $1=1 etc. while in the second it’s $0=script_file, $1=0, $2=1 etc.; ${@:3} selects every argument starting with $3.

Some additional examples for possible ranges:

 # two arguments starting with the third
$ bash -c 'echo "${@:3:2}"' 0 1 2 3 4 5 6
3 4
 # every argument starting with the second to last one
 # a negative value needs either a preceding space or parentheses
$ bash -c 'echo "${@: -2}"' 0 1 2 3 4 5 6
5 6
 # two arguments starting with the fifth to last one
$ bash -c 'echo "${@:(-5):2}"' 0 1 2 3 4 5 6
2 3

Further reading:

man bash/EXPANSION/Parameter Expansion
bash-hackers.org: Handling positional parameters
TLDP Advanced Bash-Scripting Guide: Parameter Substitution


Did they just remove the Background settings for Terminal?

Standard versions of Ubuntu use gnome-terminal 3.6.2. The background tab was removed in version 3.7. The ppa, as you saw, provides version 3.10.

You have a couple choices:

Purge the ppa, then run an update and an upgrade to restore the standard packages. The trade-off is that you will lose the other features of Gnome 3.10 that you may want.
Follow the instructions at How can I make the terminal transparent? to emulate the feature in 3.10 (quoted below):

  Since version 3.7 this option has been removed from the Preferences dialogue. You can however still get the same effect by setting the _NET_WM_WINDOW_OPACITY X property, for example with the Devil's Pie or Devil's Pie II tools. E.g., set up Devil's Pie to start automatically with the session, and create the file ~/.devilspie/gnome-terminal.ds with these contents:

  (if
       (matches (window_name) "gnome-terminal-window-*")
   (opacity 90)
  )

  You can also use this shell script that however only works for existing terminal windows and not automatically for newly created ones.


Remove all directories from within a parent directory except one and its descendents

Using the bash shell's extended glob features (which are enabled by default in current Ubuntu installations), given

$ tree A
A
├── B
├── C
│   ├── ac1
│   └── ac2
└── D

5 directories, 0 files

you can address everything excluding C and its contents using the glob expression A/!(C) i.e.

$ echo A/!(C)
A/B A/D

So to remove everything except directory C and its contents you can simply use

rm -rf A/!(C)

leaving

$ tree A
A
└── C
    ├── ac1
    └── ac2

3 directories, 0 files


pip is apparently installed but not working

Installing pip with apt should not be the answer.

You installed PIP right, but you have to add the executable path to you PATH variable,

export PATH=~/.local/bin:$PATH

You can add this to the end of ~/.profile to make the change permanent. You may need to run source ~/.profile in a new shell, or you can log out and back in.


Wondering, If there is a Guide out there

I would check the Ubuntu Desktop Guide.

Here is all their official documentation.


I solved the problem.
After booting I did ctrl+alt+F1

then logged in

at the prompt I entered

sudo dpkg --configure -a

After a few minutes I could get the graphical user interface.

This leaves only one more problem, my mouse is not working. I am using Microsoft wireless
mouse. I tried with a wired mouse also, but in vain.


Is this just a weird coincidence or did I answer your question in the ubuntu forum: https://ubuntuforums.org/showthread.php?t=2372142


Any way to prevent wallch to update .cache/wallpaper?

You could make a temporary filesystem on your RAM and then replace the offending directories with symbolic links (you might have to stop wallchbefore doing this)

rm ~.cache/offending-dir

ln -s /absolute/path/to/offending/dir /tmp


"xrandr: Configure crtc 0 failed" when trying to change resolution on external monitor

I found that problem with ATI video drivers, with deactivated driver all works.

Use

xrandr --verbose

to determine your ctrtc number? And try correct output syntax, e.g.:

xrandr --output CRT1 --crtc CRT1 --brightness 0.7

other outputs:

the Intel driver uses LVDS, VGA, TMDS-1 (TMDS-2, ...), TV
the ATI driver uses LVDS, VGA-0 (VGA-1, ...), DVI-0 (DVI-1, ...), S-video
the RadeonHD driver uses PANEL, VGA_1 (VGA_2, ...), DVI-I_1/digital or
DVI-I_1/analog (DVI-I_2/digital or DVI-I_1/analog, ...), TV_7PIN_DIN
the NV driver uses LVDS, VGA0 (VGA1, ...), DVI0 (DVI1, ...), ???
the MGA driver uses ???, VGA (or VGA1, VGA2, ...), DVI (or DVI1, DVI2,
...), ???
the Nouveau driver uses LVDS, VGA-1, DVI-I-1, HDMI-1, ???


error:failure reading sector 0x802 from 'hd0'

It sounds like the drive is failing. You will likely be able to confirm this way booted from live media. In order to attempt recovery of the data you will likely find this Q &A useful. If you get read errors in your attempt to create a forensic image of the drive, ddrescue may save your bacon.

If anything about this answer is unclear, drop me a comment and I'll do my best to provide clarity.


How to copy files from remote server to local machine?

I agree eith Engels Peralta, this is the simplest way.

From Nautilus go to File -> Connect to Server...

Change type to SSH, then enter your SSH details and credentials.

Now it should show up in your file system pane on the left.

You can then browse, copy or whatever. Note that you do not need to have an ssh session active before connecting, this will initiate the SSH session. Be sure to create a bookmark so you can access from the bookmark menu. I use the same method to connect to a test webserver.


Installing Nvidia driver crash system after restart. ACPI PCC probe failed

The proprietary nvidia driver should be used without KMS. You have to edit the /etc/default/grub file, use your favourite text editor (vi, nano, gedit, etc.):

sudo vi /etc/default/grub

Change the GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" line to the following:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

Save the file, then run sudo update-grub Then reboot, and it should work.

If it still doesn't solve it, then remove also "quiet splash" from the previous line, and again sudo update-grub. (This will disable the graphical boot screen.)

The recovery booting did work, because the recovery menu entry had the nomodeset parameter.
source: ACPI PPC Probe failed. Starting version 219 NVIDIA


No video on integrated DP Dell OptiPlex 790 Ubuntu 16.04

Sorry, I just realized that when I print screen it shows both screens but the screen The screen does not give video.


You can create a Service Menu to do what you want.

Create the folder ~/.local/share/kservices5
Create the folder ~/.local/share/kservices5/ServiceMenus
In ~/.local/share/kservices5/ServiceMenus create a plain text file called move.desktop

Paste the following content into move.desktop

[Desktop Action move-file]

Exec=/usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu mv "%U" /usr/share/applications

Name=Move file
Icon=document-send

[Desktop Entry]
Actions=move-file

MimeType=application/x-desktop;

ServiceTypes=KonqPopupMenu/Plugin
Type=Service
X-KDE-Priority=TopLevel

The use of MimeType=application/x-desktop; ensures that this context menu entry will be seen only when the target file is a .desktop file.

This is an image of Dolphin's context menu before creating the service menu:

In the following screenshot taken after creating the service menu you'll see an additional entry, Move file:

Clicking on Move file will prompt you for your password because you want to move a file into /usr/share/applications.

After providing your password, the selected file will be moved to /usr/share/applications:

Note that the owner isn't the same as .desktop files already there. You'll need to fix that however you choose:

In case you need to change ownership/permissions, you could modify the Exec= line like this (to change ownership):

Exec=printf %U | xsel -b -i && /usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu mv "%U" /usr/share/applications && cd /usr/share/applications && /usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu chown root:root $( basename $(xsel -b -o) )

The additional steps involve using printf and xsel to put the path of the file into the clipboard and then using basename to strip off everything but the filename. Of course, you'll need kdesu again! I don't know if there's a shorter way!


Only getting Dummy Output audio after resuming Kubuntu

After trying quite a few fixes, the solution that fixed the issue for me was running:

sudo addgroup username audio

where username is your username on your pc. After running this,  I haven't been able to crash pulseaudio in about 10+ suspend/resume cycles.


Shockwave Flash crashes with Chromium and Firefox

If You Must Use Flash

Generally speaking, my understanding is that Adobe no longer supports flash in Linux - but that the Google Chrome project has decided to integrate and support flash on their own.  So Google Chrome would be the only browser that you can use at the moment out of the box, so to speak.

I have managed to get flash to work on other browsers from a recent install on an older 32 bit machine by using a flash-sse plugin (Shockwave Flash 11.1 r102).  This build is made for chips that do not have SSE support.  I don't know what machine you are using but this is important information.

This was not on an Ubuntu machine but an Arch Linux box running Gnome, but you should be able to find an older version of flash or flash-sse for Ubuntu.

What will happen is that the newer versions of Firefox (I have v27) will block older flash versions automatically with a security warning.  You will have to click Activate ... and then Allow ... to view flash.  Personally I prefer this as I don't like flash adverts streaming to my machine and using bandwidth.

The security risk, if any, can be mitigated somewhat by sending file locations to &>/dev/null, so that all data streaming in will be shredded on arrival.

[update] I have just installed Chromium v32+ and the above setup (Shockwave Flash 11.1 r102) works for Chromium too - without the grumbling that Firefox exhibits.

For Ubuntu you might be able to find a Debian package that will work.  A good link to follow is https://wiki.debian.org/FlashPlayer.  It seems that Flash 11 is the last version to work on Linux.

Otherwise Use HTML5

Alternatively, you can enable HTML5 instead of flash on any HTML5 capable browser (especially Chromium) by following this link https://www.youtube.com/html5 and clicking Request the HTML5 Player.  From this point forward your Youtube videos and some others will play on any HTML5 capable browser, but I found on my older machine this was too resource intensive. On newer machines I don't think this will be a problem.  This is where all streaming content is headed anyway and is why Adobe Flash will be phased out in the longer term.


Wifi suddenly stopped working after Asus laptop went to sleep mode (Ubuntu 14.04) (Atheros AR9485 ath9k 168c:0032)

Some ath9k chipsets have problems with hardware encryption. Try:

echo "options ath9k nohwcrypt=1" | sudo tee /etc/modprobe.d/ath9kfix.conf > /dev/null

then reboot.


Localhost redirects to https but chromium not

My guess would be that at least one of the sites you developed and connected to on localhost had the HSTS header header set. The result of Firefox reading that header would be

  The HTTP Strict Transport Security header informs the browser that it
  should never load a site using HTTP and should automatically convert
  all attempts to access the site using HTTP to HTTPS requests instead.

To fix this on Firefox, open the browser history by pressing ctrl+shift+h. Next, locate any localhost site you've visited and right-click on that site. Lastly, click on Forget About This Site

To fix this on Chrome, go to the location bar (ctrl+l) and type chrome://net-internals/#hsts. Next, go to the Delete domain security policies-header and type localhost and click delete. If you want to see what headers are set for localhost first before you remove them, use the query-functionality under the Query HSTS/PKP domain-header.

The last thing you should do is figure out which of your sites sent/are sending the HSTS header in the first place. I don't know what language your backend is running, but something like Spring Security will add the HSTS header by default when enabling web security, for instance using the @EnableWebSecurity annotation.


Ubuntu 20.04 Remove items from application list

Its a bit difficult task to know the .desktop files of the applications that are shown in overview..

But once you know the application file names.. Its easy to hide them..
for example, I have struggled to get the Additional Drivers... file. Once I came to know that this is the file /usr/share/applications/software-properties-drivers.desktop have edited like below.. added this line NoDisplay=true

[Desktop Entry]
Keywords=Drivers;
Exec=/usr/bin/software-properties-gtk --open-tab=4
Icon=jockey
Terminal=false
Type=Application
NotShowIn=KDE;
Categories=X-XFCE;GTK;Settings;HardwareSettings
X-AppStream-Ignore=true
Name=Additional Drivers
Comment=Configure third-party and proprietary drivers
X-AppStream-Ignore=true
X-Ubuntu-Gettext-Domain=software-properties

NoDisplay=true

so in the similar way you can achieve for "Kolourpaint" also.
a basic way to search is ls /usr/share/applications/ | grep Kolour or change the word Kolour with paint etc..

for snap install you may need to check in this directory

/var/lib/snapd/desktop/applications

Further Reading: Open


Can’t select operative system at startup after repairing with boot-repair

I think almost certainly Windows has installed its own bootloader during a windows update, very annoying. I guess you are using EUFI and not BIOS, I confess to setting my machines to legacy BIOS because I am more familiar with it. I dual boot multiple linux OS and have re installed grub on many occassions and I know how it works with BIOS and MBR partitions.

In my scenario, if I wanted to re install the  grub bootloader to the MBR and have it store the config on partition 3 it would be

boot from an Ubuntu CD

sudo mount /dev/sda3 /mnt

sudo grub-install /dev/sda --boot-directory=/mnt/boot

sudo umount /mnt

Reboot

Really not sure if EUFI is works with grub in a totally different way but I offer this info as a possible starting point.


import caffe on python2.7 - ubuntu 18.04 LTS

Looking at the requirements for the caffe-cpu package (https://packages.ubuntu.com/bionic/caffe-cpu) we can see that this package actually calls in python3-caffe-cpu.  This is the Python 3 only version of the package.

I did some apt repository searches.  There is no Python 2 version of this package available in Bionic.  This is why you can't import it in Python 2 - it doesn't have a Python 2 pre-packaged version available for use.

Also, keep in mind Python 2 support dies out in a year's time; you should really be using Python 3 for your projects and not Python 2.


Kprinter is not found in Lucid because "Kprinter obviously has been removed from KDE4"
Source: kprinter tool missing


You may have been bitten by the notorious Windows 10 Anniversary Update. It's known to possibly do two things... overwrite GRUB with a Windows Boot Manager, and/or delete the Ubuntu/Linux partition.

Boot to a Ubuntu Live DVD and start gparted. Make a screenshot of your sda drive and post it here for me to review.

Cheers, Al


How do you login into /bin/bash automatically?

Open the terminal
From menu-bar, select Edit > Profiles
In opened prompt Edit > Default
In Tab "Title & Commands" -> check "Run Command as Login Shell"
Restart Terminal

Now you need not to run /bin/bash --login again .


Wallpaper slideshow software that supports changing image size

Introduction

Here's the thing: if you run in terminal dconf watch / and at the same time flip through options in Ubuntu settings for the wallpaper size ( Tile, Scale, Zoom, etc.) you will see this:

/org/gnome/desktop/background/picture-options
  'zoom'

/org/gnome/desktop/background/picture-options
  'wallpaper'

/org/gnome/desktop/background/picture-options
  'centered'

/org/gnome/desktop/background/picture-options
  'scaled'

/org/gnome/desktop/background/picture-options
  'stretched'

/org/gnome/desktop/background/picture-options
  'spanned'

What does it all mean ? This means that if you have a software that can flip through wallpaper, it also should be able to flip through those options, right ?

Well, I've written a wallpaper slide-show script some time before. In the past it had required options. For your specific question, I modified the script to also deal with size, as well as made only one option required -d which corresponds to the directory where slideshow images are supposed to live.

Basic Usage

The usage is simple: give it directory with images, give it size , and run. It is as simple as doing this:

 $ ./xml_wallpaper_maker.py -s zoom  -d ~/Pictures/wallpapers/

You can always use -h option to show help information for extra options too and in case you forget the usage:

$ ./xml_wallpaper_maker.py -h
usage: xml_wallpaper_maker.py [-h] -d DIRECTORY [-t TRANSITION] [-l LENGTH]
                              [-o] [-s SIZE]

Serg's XML slideshow creator

optional arguments:
  -h, --help            show this help message and exit
  -d DIRECTORY, --directory DIRECTORY
                        Directory where images stored. Required
  -t TRANSITION, --transition TRANSITION
                        transition time in seconds, default 2.5
  -l LENGTH, --length LENGTH
                        Time length in seconds per image, default 1800
  -o, --overlay         Enables use of overlay transition
  -s SIZE, --size SIZE  wallpaper,zoom,centered,scaled,stretched,or spanned

Script Source

The script source is available both here and on GitHub. If you have git, feel free to run git clone https://github.com/SergKolo/sergrep.git  or download the repository files from the link above. If you're copying from here, make sure you save the file as xml_wallpaper_maker.py and make it executable with chmod +x xml_wallpaper_maker.py.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

#
# Author: Serg Kolo , contact: 1047481448@qq.com
# Date: September 2 , 2016
# Purpose: A program that creates and launches XML slideshow
#
# Tested on: Ubuntu 16.04 LTS
#
#
# Licensed under The MIT License (MIT).
# See included LICENSE file or the notice below.
#
# Copyright © 2016 Sergiy Kolodyazhnyy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from gi.repository import Gio
import xml.etree.cElementTree as ET
import lxml.etree as etree
import argparse
import sys
import os

def gsettings_set(schema, path, key, value):
    """Set value of gsettings schema"""
    if path is None:
        gsettings = Gio.Settings.new(schema)
    else:
        gsettings = Gio.Settings.new_with_path(schema, path)
    if isinstance(value,list ):
        return gsettings.set_strv(key, value)
    if isinstance(value,int):
        return gsettings.set_int(key, value)
    if isinstance(value,str):
        return gsettings.set_string(key,value)

def parse_args():
        """ Parses command-line arguments """
        arg_parser = argparse.ArgumentParser(
        description='Serg\'s XML slideshow creator',
        )

        arg_parser.add_argument(
                                '-d', '--directory',
                                help='Directory where images stored. Required',
                                type=str,
                                required=True
                                )

        arg_parser.add_argument(
                                '-t','--transition',
                                type=float,
                                default=2.5,
                                help='transition time in seconds, default 2.5',
                                required=False
                                )

        arg_parser.add_argument(
                                '-l','--length',
                                type=float,
                                default=1800.0,
                                help='Time length in seconds per image, default 1800',
                                required=False
                                )

        arg_parser.add_argument(
                                '-o','--overlay',
                                action='store_true',
                                help='Enables use of overlay transition',
                                required=False
                                )

        arg_parser.add_argument(
                                '-s','--size',
                                type=str,
                                help='wallpaper,zoom,centered,scaled,stretched,or spanned',
                                default='scaled',
                                required=False
                                )
        return arg_parser.parse_args()

def main():
    """ Program entry point"""
    args = parse_args()
    xml_file = os.path.join(os.path.expanduser('~'),'.local/share/slideshow.xml')
    path = os.path.abspath(args.directory)
    duration = args.length
    transition_time = args.transition

    if not os.path.isdir(path):
       print(path," is not a directory !")
       sys.exit(1)

    filepaths = [os.path.join(path,item) for item in os.listdir(path) ]
    images = [ img for img in filepaths if os.path.isfile(img)]
    filepaths = None
    images.sort()
    root = ET.Element("background")
    previous = None

    # Write the xml data of images and transitions
    for index,img in enumerate(images):

        if index == 0:
           previous = img
           continue

        image = ET.SubElement(root, "static")
        ET.SubElement(image,"duration").text = str(duration)
        ET.SubElement(image,"file").text = previous

        if args.overlay:
            transition = ET.SubElement(root,"transition",type='overlay')
        else:
            transition = ET.SubElement(root,"transition")
        ET.SubElement(transition,"duration").text = str(transition_time)
        ET.SubElement(transition, "from").text = previous
        ET.SubElement(transition, "to").text = img

        previous = img

    # Write out the final image
    image = ET.SubElement(root, "static")
    ET.SubElement(image,"duration").text = str(duration)
    ET.SubElement(image,"file").text = previous

    # Write out the final xml data to file
    tree = ET.ElementTree(root)
    tree.write(xml_file)

    # pretty print the data
    data = etree.parse(xml_file)
    formated_xml = etree.tostring(data, pretty_print = True)
    with open(xml_file,'w') as f:
        f.write(formated_xml.decode())

    gsettings_set('org.gnome.desktop.background',None,'picture-options', args.size)
    gsettings_set('org.gnome.desktop.background',None,'picture-uri','file://' + xml_file)

if __name__ == '__main__':
    main()


You can put shell scripts in:

~/.config/plasma-workspace/env/

(these will execute at login before launching Plasma, make sure they have execute bit and ends with *.sh)


15.04 How to check if Nvidia SLI is enabled w/ proprietary drivers?

The SLI connector is a proprietary link between GPUs that transmits synchronization, display, and pixel data.
The SLI connector enables inter-GPU communication of up to 1 Gb/s, consuming no bandwidth over the PCI Express bus.
SLI is enabled by setting the SLI option in the X configuration file.
The nvidia-xconfig utility can be used to set the SLI option, rather than modifying the X configuration file by hand.
nvidia-xconfig --sli=on

The valid values for SLI are Off, On, Auto, AFR, SFR, AA, and AFRofAA.
For further information, look at man nvidia-xconfig.
Check if SLI is enabled
The only way to check if SLI is enabled is by checking first GPU and seeing what it says as the Screen0 it should say your screen model and then SLI.
Source


Probably the easiest way to get the Network folder shortcut to the desktop, is by using a third-party tool called "Myunity". It is available for free download in the Ubuntu Software Center.

When MyUnity is installed you can launch it either from the dash or from the "System Settings" where a new icon will be created for MyUnity.

To get the shortcut on the desktop you open the MyUnity app, select the "Desktop" tab on the top of app and choose "Show networking Icon".
Now you will see a Network Servers icon on you desktop.

Unfortunately the Unity Launcher does not support adding folder shortcuts by simply "Drag and drop" method.

To add the shortcut to the launcher please see this question:
How to drag a folder to the launcher from Nautilus


Unencrypted /boot partition can be infected from windows on dual-boot system?

Yes, in theory an attacker can install a modified kernel with a keylogger to your /boot partition.

If you are worried about this you might want to run Windows in a virtual machine rather than dual boot.


Cannot activate virtual environment with a shell script

The virtualenv activates by sourcing (not normally running) the virtualenv/bin/activate script. If you want to do this in your own script, then you must source that script too and not just run it. Meaning:

source startvenv.sh

The difference between running and sourcing is that running executes the script in its own separate subshell, which is isolated from the parent shell (the one from which you called it) so that e.g. environment variables and other changes inside the script do not get propagated to the parent.

Sourcing explicitly does exactly that, executing the script in your current shell, which leaves all changes to environment variables etc intact after it finishes.

Here's a shorted extract from man bash (section about Shell Builtins):

    .  filename [arguments]
   source filename [arguments]
          Read and execute commands from filename  in  the  current  shell
          environment  and return the exit status of the last command exe‐
          cuted from filename.  [ ... ]


How can I install python-dev off apt-get?

Are you sure you are doing it right?

This is my output for # apt-get install python2.7-dev

root@olympus:/home/zeus# apt-get install python2.7-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libexpat1-dev libpython2.7-dev
The following NEW packages will be installed:
  libexpat1-dev libpython2.7-dev python2.7-dev
0 upgraded, 3 newly installed, 0 to remove and 7 not upgraded.
Need to get 22.4 MB of archives.
After this operation, 35.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Try doing this as root (su)

Also, try running # apt update and make sure Multiverse and universe are enabled (See How do I enable the "Universe" repository?). I also got backports enabled in my system, not sure whether that makes a difference in this case.


Why can’t I have multiple apt installs at once?

because apt locks the cache and package lists to prevent corruption by another program making changes it doesn't know about.


For the moment g++-4.8 doesn't exist in Ubuntu repositories since is still in unstable or testing version and also there is no any PPA from where you can get g++-4.8 (even if you can find in other places that can be found in https://launchpad.net/~ubuntu-toolchain-r/+archive/test - check the link and you will see that is not there). But it can be found in Debian repositories. Depending on your system architecture, download:

g++-4.8_4.8.1-10_amd64.deb for Ubuntu 64-bit
g++-4.8_4.8.1-10_i386.deb for Ubuntu 32-bit.

More about: http://packages.debian.org/sid/g++-4.8, http://packages.debian.org/jessie/g++-4.8 (you should check also the dependencies).


Hot swap strangness going from Windows to Linux

Make sure that both Secure Boot and Fast Boot are disabled in the BIOS/firmware setup.


Ubuntu Server on laptop - power off display when close lid

Posting answer from comment above:

vbetool dpms off will power off the display – cscarney Dec 9 '11 at 20:52


Are you sure you have correctly downloaded the package at
http://www.murguu.com/linux-auto-mouse-click/download/32-bit/LinuxAutoMouseClick.zip (32-bit) or
http://www.murguu.com/linux-auto-mouse-click/download/64-bit/LinuxAutoMouseClick64Bit.zip (64-bit) ?

Extract the package once you downloaded it by right clicking on the package and selecting extract here

The folder after extraction should look like this:

Now all you have to do is double-click the AutoMouseClick file and the program should start.

(Tested just now)
If these steps don't work please edit your post to tell us which version of ubuntu you are using and also append the output of the command uname -a


Is Cairo-dock full compatible after installation of amd driver with The fan club website

BETA version of any software means its not completed its development and its in still testing.
The active volunteers will test the BETA releases and they will report to developers about their problem or BUG.

what you have to do ?

If you want to fix your issue you'd better contact the particular and you report your issue. If you contact them they will guide you on how to report.

Hope that helps.


In Ubuntu 18.04 and earlier open the terminal and type:

sudo apt install telegram-desktop

You don't have the Telegram snap package from the Ubuntu Software application installed. If you want to install the latest stable version of Telegram, the name of the snap package to install is telegram-desktop and the commands to install it are:

sudo apt install snapd
sudo snap install telegram-desktop

Telegram is a popular messaging protocol with encryption and security as its key focus. telegram-sergiusens is the latest version of Telegram, the same version as the Telegram file that is available at the official Telegram website. The command to update telegram-desktop is:

sudo snap refresh telegram-desktop


Default configuration file of Nginx in 20.10 is in the same location as older version:
/etc/nginx/nginx.conf
There you can find the logging settings (default):
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

Look in those folders for the "debugging" - i.e. /var/log/nginx/...
NGinx docs show you how to add debug:
https://docs.nginx.com/nginx/admin-guide/monitoring/debugging/


How can I install wireless adapter driver for Digisol DG-WN3150Nu in ubuntu 12.04?

Your USB wireless device works with the driver rtl8192cu in newer Ubuntu versions. Check to see if the driver in 12.04 covers your device:

sudo modprobe rtl8192cu

Does your wireless work now? Check the driver modalias:

modinfo rtl8192cu | grep 8176

If the installed driver does not cover your device, install a newer driver version. With a temporary working internet connection by ethernet, tethered or whatever means possible:

sudo apt-get install git linux-headers-generic build-essential dkms
git clone https://github.com/pvaret/rtl8192cu-fixes.git
sudo dkms add ./rtl8192cu-fixes
sudo dkms install 8192cu/1.10
sudo depmod -a
sudo cp ./rtl8192cu-fixes/blacklist-native-rtl8192.conf /etc/modprobe.d/

Reboot and tell us if it's working.


you don't need Wubi.exe because ubuntu installer is much easier today , get a flash drive and download this universal usb installer

find your linux ISO and burn it to flash drive

Warning : all your files on that USB will be removed
restart your Computer then boot to flash drive and finally  follow the instruction.


The -p option doesn't exist anymore.

Its a bug in gnome-screensaver.
http://lists.mplayerhq.hu/pipermail/mplayer-users/2012-November/085566.html


Ubuntu 16.04 doesn't see any of my hard drive partitions when installing alongside Windows 10

One possible culprit is fastboot. This is a feature of Windows 10 where it doesn't completely shut down so that it can boot up faster. Try turning off this feature (its in the advanced power options area of the control panel) or performing a hard shutdown (holding the power key down for a few seconds) before trying to boot into the live USB.


How to automate comparison of md5sum hash values for a large number of files

For example I have a file called test_binary.

MD5 sum of file test is ef7ab26f9a3b2cbd35aa3e7e69aad86c

To test it automatically run this:

$ md5sum -c <<<"ef7ab26f9a3b2cbd35aa3e7e69aad86c *path/to/file/test_binary"
test_binary: OK

or

$ echo "595f44fec1e92a71d3e9e77456ba80d1  filetohashA.txt" | md5sum -c -

Quote from man

   -c, --check
          read MD5 sums from the FILEs and check them

Quote from wiki

  Note: There must be two spaces between each md5sum value and filename
  to be compared. Otherwise, the following error will result: "no
  properly formatted MD5 checksum lines found".

Link to wiki

Also you can just read md5 hashes from file

$ md5sum -c md5sum_formatted_file.txt

It is expecting file with format:

<md5sum_checksum><space><space><file_name>

About * and <space> after MD5 sum hash. There is little note in man:

 When  checking,  the
       input  should  be a former output of this program.  The default mode is
       to print a line with checksum, a character indicating input  mode  ('*'
       for binary, space for text), and name for each FILE.

And here is link to stackoverflow where I found answer on question, why should we, sometimes, distinguish binary files and text files.


To turn off color syntax highlighting, pres ESC and type:

:syntax off

To turn it on again, type:

:syntax on

To make the changes permanently, you can create ~/.vimrc file and add the following line:

syntax off


Cannot find Apache configuration files in 15.10, did they change location?

The location for Apache configuration files has not changed - it's still /etc/apache2/....

Given your comments in response to my initial poke in the comments, it sounds like your Apache conf files were erased, which is a bad thing.  Or you have a broken package, which explains the configuration files not existing.

We can usually repair the defaults by reinstalling whatever folder contains the configurations.  Though, sometimes we have to do a complete reinstall of Apache in its entirety, by purging the existing installation and reinstalling.

First try: Package reinstall

This will reinstall the apache2 package, which I believe contains the default configuration setups; this should install new copies of configs.

sudo apt-get install --reinstall apache2

If this fails, though, and there are not new copies of default configurations available in /etc/apache2, then we need to do a more forceful approach involving a removal and purge (to get rid of any leftover configs) and then a full reinstall of the Apache core packages...

Second try: Remove apache2, and reinstall

sudo apt-get purge apache2 apache2-bin apache2-data apache2-utils
sudo apt-get clean
sudo apt-get install apache2 apache2-bin apache2-data apache2-utils


VLC plays through bluetooth speaker, but not brave browser

maybe the system is not automatically setting your speaker as volume output.
Try this method, read fully before implementing
-- install sound Input & output device chooser from gnome extensions
-- then you can manually select the volume output easily from the top panel like this

alternatively,
1..  you can do this by setting

2.. use PulseAudio  see this answer
hope this help...  :))


You can get your Terminator to run Bash as a login shell by checking the "Run a special command instead of my shell".

Open Terminator
Right click on the window and select "preferences"
Go to Profiles
Command tab
Make sure you have only the "Run a special command instead of my shell" checked.
In the command box enter /bin/bash --login
For the option labelled "When command exits" select "Hold terminal open"
Close Terminator, then re-open Terminator

This should have you running Bash in a login shell.  To Verify, in Terminator enter:

 shopt login_shell

It should return "yes" and you know you are running a login shell.


Cannot play avi or mp4 file in both Movie Player and VLC

My solution was to go to Tools > Preferences in VLC and, in the Video tab:

Check the box for Enable video (if it's unchecked).
Check the box for Window decorations (if it's unchecked).
Set the Output drop-down menu to X11 video output (XCB).

Then Save your changes. That may fix the problem.


Anthy uses previously selected (wrong) layout

Just after posting the question I found this bug report: https://bugs.launchpad.net/ubuntu/+source/ibus/+bug/1311990

Unfortunately the reporter was content with a workaround and changed the status to invalid.

The workaround is to change "Keyboard layout" under "Typing Method" to something other than "Default".


Logging out other users from the command line

this is one answer

who -u

that give you the PID

Then you can kill the user session.

kill "pid"


After update, cannot mount hard drive nor boot

I went to the technician. He could not help, he followed the same procedure. So in case someone has the same problem, I share my solution:

If you unmount the disc physically from the laptop, using IcyBox (or similar) you can turn it into an external drive. Booting still doesn't work, but in my case I could copy all the data from the disc (they were accessible).
After that I formatted the disc and with a new system everything works.


What is the difference in using cp and dd when cloning USB sticks?

In this case, the difference is that dd is constrained to reading 4096-byte blocks at a time, since you have used bs=4096. The likely effect is that dd will be much, much slower than cp. Try with a larger block size (10M, 50M?).

The particular buffer size that's best suited for the current devices might be different from cp's (or cat's). You can't easily control cp's buffering. dd's utility shines when:

you have very large devices to copy, so that experimenting to determine the best block-size is worthwhile.
you have to copy only part of a disk. You can specify count to limit how many blocks are copied.
you want to resume an interrupted copy. You can't do so with cp, but you can try with dd, by using the seek and skip options.
you want to pipe it to the standard input of something (admittedly, cat will work here too):

dd if=/dev/sda bs=10M | ssh host dd of=/dev/sdb

dd usefulness is very well discussed in this Unix and Linux post:
dd vs cat — is dd still relevant these days?


Decrypting a password protected LibreOffice Calc .ods file (forgotten password)

Opening the .ods file as root will still not allow you to retrieve the file contents because those are encrypted which is beyond the power of a root user.

MiJyn suggested the use of password crackers for OpenOffice.org. These programs often use brute-force or dictionary-based attacks. I would not use such a closed-source programs from random, untrusted sources as suggested. Virus scanners do not find everything, so you still cannot trust the executable because ClamAV detects nothing.

Since LibreOffice is open source, I'd start with looking up what kind of encryption it uses. Ubuntu 12.04 ships with LibreOffice 3.5. According to http://wiki.documentfoundation.org/ReleaseNotes/3.5#Different_Encryption_Algorithm, it uses a 256-bits AES cipher.

This mailing list post also makes clear that the password is derived using PBKDF2 which means that brute-forcing will be much slower with a sufficient high iteration count.

Since .ods files are just Zip files, I tried to encrypt the file and extracted the contents. As expected, the contents of the document are encrypted and indistinguishable from random bytes. Of course there exist some unencrypted metadata, one of them being
META-INF/manifest.xml. My example encrypted spreadsheet contained the following interested parts:

<manifest:encryption-data manifest:checksum-type="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0#sha256-1k" manifest:checksum="48KzqP1PL7Wu/YTtHzlN0buJeUmigGT247dZ6Wrj10s=">
<manifest:algorithm manifest:algorithm-name="http://www.w3.org/2001/04/xmlenc#aes256-cbc" manifest:initialisation-vector="82mrg52Yifh1iIye5W0xuw=="/>
<manifest:key-derivation manifest:key-derivation-name="PBKDF2" manifest:key-size="32" manifest:iteration-count="1024" manifest:salt="hUZrwD1BWkODYVklZiScqA=="/>
<manifest:start-key-generation manifest:start-key-generation-name="http://www.w3.org/2000/09/xmldsig#sha256" manifest:key-size="32"/>

From that we can learn that LibreOffice uses a SHA256 hashing algorithm for checking data integrity, AES256 in CBC mode. The 32-byte password is derived from your password using PBKDF2 with 1024 iterations.

A paper on decrypting ODF files is available here, these contain nice information to craft your own brute-forcer but are probably not suitable for the average user.

As with most encryption products, password recovery is near impossible. I suggest:

If the file just contains bookkeeping for a week, just start over and do not waste time on decrypting the file.
Try to recall the password if you want to decrypt the file.
If you are going to use a brute-force program, do not use a random program found on the internet. Try to find an open-source program. If you only find closed-source programs, download it from a reliable source and ensure that it has good reviews (from several sources), put it through https://www.virustotal.com and check again that the program you are trying is legit.


Enter password only once for script making many sudo calls

Use the timestamp_timeout parameter. Use visudo to edit the sudoers file:

sudo visudo

and modify the defaults line so it looks like this:

Defaults   env_reset,timestamp_timeout=60

this will keep your password for 60 minutes.

Modify this time as desired :)