resize Linux(/) partitition to make more space for Windows

Neither Linux nor Windows will operate on live partitions, they need to be unmounted. So, you cannot grow or shrink a partition from the OS on the partition itself.

If you need to boot from another partition, a good choice is to boot from the Ubuntu Live medium and start gparted from there because you won't have to deal with much differences to your day-to-day Ubuntu.

Boot from the Ubuntu Live medium, start gparted, shrink your Linux partition and also grow your Windows partition from gparted. Do it in one step - it helps avoiding mistakes by booting to the Windows Recovery and working with diskpart from Windows. This is a OS-agnostic step. gparted is actually the best program to deal with since it has more options and is more user-friendly than diskpart.

After this, you can reboot into the system of your choice with the new size.


You can use Aptana Studio

Highlighting HTML:

Highlighting for PHP:

Highlighting Javascript:

Highlighting CSS:

Now inorder to install it in Ubuntu please refer to how do I install Aptana Studio 3 in Ubuntu 14.04 LTS?

Else if you still using 12.04 you can check this


Calibre Hangs on Xubuntu and Cinnamon, but not Ubuntu or XFCE

Okay,  I found an answer (workaround?) to my calibre problem.

From the Mobileread forums:

In terminal I entered:

calibre-debug -c "from calibre.gui2 import gprefs; gprefs['ui_style'] = 'calibre'"

That solved my problem.  I don't know what theme I had selected instead.  Maybe 'system'?


How to install the PHP/Serialization module in Perl?

The file PHP/Serialization.pm or better /usr/share/perl5/PHP/Serialization.pm is part of the package libphp-serialization-perl.

Therefore install via

sudo apt-get install libphp-serialization-perl


Does Live CD require a hard drive to be installed?

Some laptops won't even finish POST if the hard drive doesn't respond properly during boot regardless of whether it is a boot device.

Your question is hardware specific, not specific to a LiveCD/DVD.


Can't install Ubuntu 18.04. Failed to load ldlinux.c32

Verify the hash value of your image using Hash Checker or Hash tab with these values

http://releases.ubuntu.com/18.04/MD5SUMS.

If hashes match then your image is fine and you might want to use the Universal USB Installer instead of Rufus.

In Rufus Make sure to Check the Correct Target System settings ( BIOS or UEFI ) and Partition Scheme ( MBR or GPT ).

To Create A USB Bootable stick on:

Windows

MacOS

Ubuntu


Ubuntu 14.04 theme (?) changed after restart

The default theme for Ubuntu is Ambiance. You can set it by searching for Appearance in the Launcher, run it and change the theme as shown here:


Can I limit the CPU usage of a single application?

Install cpulimit

sudo apt-get install cpulimit

It provides different methods of limiting the CPU usage of a process foo to say, 20%

By its process-name:
sudo cpulimit -e foo -l 20.
By its absolute path name:
sudo cpulimit -P /usr/bin/foo -l 20
By its PID:

Find the PID of the process: pidof foo. (say, it outputs 1881)
sudo cpulimit -p 1881 -l 20


Ubuntu touchpad issue - mouse pointer moving around

I have already posted this answer elsewhere, but I think it may also apply to this situation.
List all properties in your mouse/touchpad using xinput --list-props 11 (my touchpad ID is 11, yours will be different) and see the id of the property Device Accel Constant Deceleration.
Now type the command xinput --set-prop 11 268 0.3 (my touchpad deceleration property ID is 268, yours will be different) to decrease your mouse/touchpad deceleration.
Since it's pretty tedious to type these two commands every time you log in, put these two commands in the end of the /home/{your user name}/.bashrc file so that these get executed automatically whenever you log in.
This solution has a minor error though. With time, you'll notice that your mouse/touchpad ID will often switch between a couple of values. You may also have seen that. Workaround for this is to put the commands with all these values. For example, yesterday my Touchpad ID was 11, but today after I ran xinput --list, I saw that my touchpad ID has changed to 13. So Instead of only a single command xinput --set prop 11 268 0.3, I'll now put two commands:
xinput --set-prop 11 268 0.3
xinput --set-prop 13 268 0.3

at the end of  the ~/.bashrc file.
Now whenever you log in, you'll see something strange written over the terminal like property '268' doesn't exist, you need to specify its type and format. That's because out of those two commands you put inside the ~/.bashrc file, one doesn't have the property 268, and hence this stderr (standard error) message. If you're cool with this silly error, you may ignore it, otherwise put a clear command below those two commands in the ~/.bashrc file. Now after executing those two commands, the terminal will also be cleared every time.


Make a file with root access only and able to be accessed by another file without using a password

Let's assume we have two files A and B. The both files are located in the home directory of a regular user. The file A is owned by root and only that user has read permissions as follow:

$ cat A                   # output the content of the file
"Test content of file A"

$ chmod 400 A             # change the permissions of file A to read only by the user/owner
$ sudo chown root:root A  # change the ownership of the file to user and :group 'root'

$ ls -l A                 # check the permissions and the ownership, 'stat -c "%a %n" A' to get them in octal
-r-------- 1 root root 24 яну 22 10:17 A

$ sudo cat A              # output the content of the file A, that is ownes by 'root'
"Test content of file A"

The file B is simple script that outputs the content of A, it is owned by the regular user. B has executable permissions as follow:

$ cat B                   # output the content of the file
#!/bin/bash
cat /home/<user>/A

$ chmod +x B              # add executable permissions to the file for all users

$ ./B                     # execute file B by a regular user
cat: /home/<user>/A: Permission denied

$ sudo ./B                # execute file B with root privileges
[sudo] password for <user>:
"Test content of file A"

To execute the last command above without password we can use NOPASSWD directive within the file /etc/sudoers or we can create separate file, dedicated to this task, located in /etc/sudoers.d/ (as it is in the next example). Note, the use of the command visudo is absolutely necessary when you edit files as these. So, run the command:

$ sudo visudo -f /etc/sudoers.d/no-passwd-A-B

Add the following content inside, save and close:

<user> ALL=(ALL) NOPASSWD: /bin/cat /home/<user>/A

Now you will be able to execute the following command and you will not be asked for a password:

$ sudo ./B
"Test content of file A"

If you do not want to type sudo in front of the command, you can put it inside the script:

$ cat B                   # output the content of the file
#!/bin/bash
sudo cat /home/<user>/A

$ ./B
"Test content of file A"

  NOTE: In the previous version of the answer is described how to add NOPASSWD directive in sudoers file for a script (file B in our case), but, as @RoVo said, this approach is pretty dangerous, because if the user has write permissions to the file it can make harmful changes inside. Practically the user will be able to do/crash anything.

  If you want to use this variant, where the content of /etc/sudoers.d/no-passwd-A-B is:

<user> ALL=(ALL) NOPASSWD: /home/<user>/B

  Then for security reasons, change the ownership of the file B to root and grant it only read and execute (but not write) permissions for the other users, something like:

$ chmod 605 B
$ sudo chown root:root B

$ ls -l B
-rw----r-x 1 root root 38 яну 22 15:31 B

  Another way to add more security in your system, provided by @PerlDuck, is to have sudo check the executable against manipulation:

  For this purpose get the sha256sum of the executable file:

$ openssl dgst -binary -sha256 /home/<user>/B | openssl base64
sfDELCTNqfrDY9QKzz8Ra2wTnIpFXyyN8sG9JFxUJtA=

  Add that sha256sum to the sudoers file like so:

 <user> ALL=(ALL) NOPASSWD: sha256:sfDEL...xUJtA= /home/<user>/B

  Then sudo will complain if the sha256 of the script doesn't match the value in the sudoers file.


How to edit YAD question labels (example)?

I am not totally sure what you mean, but if I understand it correctly you want something like this:

#!/bin/bash

yad --text="Execute the file?" --button="Execute" --button="Edit"

case $? in
    0)thunar "$1"
    ;;
    1)gedit $1
    ;;
esac

I found a link (ubuntuusers.de), but it is in German. There are a few code examples and pictures though, that might help. And you can always translate it with google.

I would have written this as a comment if I could, but I am not yet allowed to.
Hope it helps.


ISO file must be defragmented!!!

   title Run Ubuntu 16.04
find --set-root /ubuntu-16.04-desktop-amd64.iso
map --mem /ubuntu-16.04-desktop-amd64.iso (0xff) || map --heads=0 --sectors-per-track=0 /ubuntu-16.04-desktop-amd64.iso (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz.efi  file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=/ubuntu-16.04-desktop-amd64.iso splash
initrd /casper/initrd.lz


nvidia-setting not restoring settings properly after login

It looks like both XFCE and nvidia settings (or the standard xorg config) tried to apply settings here.

The XFCE settings are wrong.

After some debugging concerning another problem (Why does XFCE ignore my preferences?) I found out that I have to delete .config/xfce4/xfconf/xfce-perchannel-xml/displays.xml to solve that problem - but this also solved the problem with applying the right screen settings after login.


Sadly Adobe Flash 11.2 has a blacklist of graphics cards which it will not allow to use hardware acceleration, even with a good card, so it's just luck if yours is supported and on the white list...

You could try installing MiniTube and gstreamer0.10-ffmpeg which allows you to search and play YouTube videos full screen using system codecs instead of the flash player...


Ubuntu 12.04 on Dell Mini 9: direct me to screen aspect ratio directions?

This should install the drivers for your GPU, which is Intel Integrated(?)
Type this into terminal:

    sudo su
    apt-get update
    apt-get upgrade
    apt-get install mesa-utils

Then you should be able to set the resolution in Settings > Displays


Why did Files (Nautilus) stop updating partition's bookmarks?

I've found out that this is a known bug:

https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1246493

Despite not showing up in the nautilus bookmark pane, as described here, you can still quickly access bookmarks by right-clicking on the nautilus icon and bookmarks will be displayed as a quicklist:

But I've figured out a workaround. Would Nautilus show my bookmarks if I set my partition to be mounted at Ubuntu startup time? Yes, it would. :-)

Beware that Ubuntu mounts partitions at /media/yourusername/partitionname when you mount them by clicking on them. So, your bookmarks will point to this location. When I tested mounting my partition using udisks command, it mounted at /media/partitionname. Searching has brought this solution:

How can I change the mount point path while using udisks?

Resume: Set your partition to be mounted at startup, at Startup Applications on Ubuntu, using this command:

udisksctl mount --block-device /dev/sdaY (change Y to your partition number!)

Now my partition's bookmarks are displayed correctly.

For the ones who don't know how to add a command to be executed at startup time, I recommend reading Ubuntu documentation on Auto Mount Partitions, section Per-User Mounts, subsection Adding to startup. Section Finding the device name of your Partition explains how to find your device name (the /dev/sdaY in my example above).


You could try the Disper utility and the Disper-indicator. It won't (yet?) work with the keyboard shortcuts. Instead it gives you an indicator icon from which you can choose the desired monitor setup.

The Disper utility works with both the XRandr backend and the proprietary NVidia driver (though I have only tried it with the nvidia driver).

Check it out:

Disper ppa: https://launchpad.net/~disper-dev/+archive/ppa

Disper-indicator ppa: https://launchpad.net/~nmellegard/+archive/disper-indicator-ppa

All the best
N


Libreoffice does not detect Java on fresh install of 12.10: how to make it work?

I ran into this issue with the latest libreoffice on a production machine.
We run this in --headless mode, but should work for a GUI version

LibreOffice 5.1.6.2 10m0(Build:2)

To fix:

sudo apt -y install libreoffice-base

This will install all the requirements for libreoffice including the java-jre


When is the ubuntu os for mobiles released?

Nokia N9 uses a Cortex A8. The minimum suggested hardware is a Cortex A9 processor so most likely never.

And if anyone ever manages this (official or unofficial) it will be stripped down to get an acceptable working system, it will still take a long time and you probably already got a new phone.


Tar error while installing cpanel on fresh Ubuntu VPS

Cpanel is not designed to be used on Ubuntu systems.  It won't work.
See https://documentation.cpanel.net/display/84Docs/Installation+Guide+-+System+Requirements#InstallationGuide-SystemRequirements-Operatingsystems for supported systems.


How come I have superuser privileges without being in sudoers file

You are in the group sudo. To quote your sudoers file (I draw your attention to the helpful comment before the effective line):

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL


Designing UI using html and css and without webkit?

html5 and css requires web rendering engine in the background . So you have to use one of the web rendering engine . Webkit is the most commonly used web rendering engine because of its perfomence and portability , You can also try Gecko  from firefox but it is very hard to implement  when compared to webkit


Managing SSH Host Keys in 20.04 Autoinstall/Cloud Init

I think you should put ssh_deletekeys: false in the configuration file at /etc/cloud/cloud.cfg. At least it worked for me under Debian 10.
Example:
# The top level settings are used as module
# and system configuration.

ssh_deletekeys: false

# A set of users[...]


The terminal can be used to execute programs within a given PATH - you can find it by running echo $PATH in a bash teminal - example output:

/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/wilf/.local/bin:/home/wilf/bin:/usr/games

This is set when the terminal starts - when it using using the BASH shell (default on lots of Linux systems), it checks ~/.bashrc before starting. Then when you run a command, it searches the path for the command, and executes if it finds it.

With my example $PATH above, I can place an executable script in /home/wilf/.local/bin (e.g. extension-update from here), and then be able to run it terminal without specifying the full path to the executable (e.g. /home/wilf/.local/bin/extension-update, /usr/bin/firefox, etc)


You could delete the .xsession-errors.old file entering sudo rm ~/.xsession-errors.old in terminal.

This file was the 99% of my drive space :)


Is there an alternative to mkusb to install Ubuntu on a portable SSD that works with both UEFI and BIOS boot methods?

I've finally determined that the mkusb process linked to in my original question can indeed be used to create a 'real' Ubuntu install, on a portable USB SSD or thumb drive, that boots on both BIOS and UEFI systems.

As it turns out, my assumption as to this step in that process:

Cut grub.cfg from sdx5/boot/grub and paste to sdx3/boot/grub, overwriting the existing grub.cfg file

...was simply incorrect. One doesn't actually 'cut' the grub.cfg file from the /dev/sdx5 partition, you need to 'copy' the grub.cfg file to the /dev/sdx3 partition. As mentioned, /dev/sdx3 was not mounted after the Ubuntu installation, and /dev/sdx5 was mounted on /target. I manually mounted /dev/sdx3 on /media/ubuntu (that directory is created by the installation process it seems) and then copied the file over the mkusb iteration:

sudo mount /dev/sdx3 /media/ubuntu
sudo cp /target/boot/grub/grub.cfg /media/ubuntu/boot/grub

That simple adjustment is all that was necessary, otherwise the procedure that @C.S.Cameron detailed works perfectly well with a portable SSD!


It seems editing the browser options was enough for me.
I enabled the Notifications for URL of WhatsApp (which was in default setting and i wasn't able to get notifications). Than new messages stared to appear as other notifications.

BR,


If the page is still open, you should be able to press CTRL +  SHIFT + S.

The "Debugger" pane should show and on the left of the screen, you should be able click to select from the "Sources" list to display each javascript used.

Hopefully, they will still load.


Intermittent, but frequent touchpad problem: right-click menu keeps popping up

I had been the same problem. Looking around I found a info which helps me to solve the problem. I changed the the SoftButtonAreas as recommended and the problem disappears.

Regards Rainer


Is X11 forwarding over SSH possible in Ubuntu 15.10?

I just run the current daily-live image in VirtualBox, and it loaded X. I proceeded to install it, and the installed version also ran X:

As you can see, X11 forwarding from and to the virtual machine worked fine.

Either the integration is flawless, or Ubuntu 15.10 still uses X by default. And since the final freeze happened some weeks ago, I think we'll have to wait one more release for Mir to be default.


Can't install/try Ubuntu after dd sda hard drive

I would install Ubuntu with the USB disk, then choose the "something else" option, delete the partition table and create two new partitions: one for the system (mount point /) and a swap partition (2-4 Gb).
Should do the trick.
EDIT
If this doesn't work, using a live DVD/USB, boot and choose the "Try Ubuntu" option, then open gparted and from the device menu choose Create Partition table. Then try the install option again.


help understand diff between: sort < file.txt VS file.txt | sort

There's a typo in your example code that I'll just address first. filename | ... won't do anything other than blurt out an error and then confuse the thing on the other side of the pipe... unless that filename is also a global executable and then it's not doing what you wanted.

You'd need to cat filename | ....

Just to muddy the waters, sort can also take a filename as an argument. You could (and should, if this is your actual use case) just run sort filename > sortedfilename.

Anyway, back to redirects...

The input redirect (<) reads from a file and pipes that into stdin. To answer your question, it is directly equivalent to cat filename |.

The sort command looks for stdin in lieu of a filename argument and does the sorting and pipes that to stdout. The output redirection (>) can then be used to send that into a file rather than the screen.

If you really want to blow your mind, read TLDP's chapter on I/O redirection. It's probably a bit more raw than your book but it's solid, tested stuff. Actually (having just read it again), its explanation is pretty decent.

The position of the input is a lot more fluid than statndard pipes. The following is valid:

< filename sort > sortedfilename


meaning of different sessions in lubuntu

In short,

The Lubuntu session is LXDE+Openbox customized by the Lubuntu developers
The LXDE session is vanilla LXDE+Openbox
The Openbox session is just Openbox

Lubuntu is a distro that uses the LXDE desktop environment, customized, which, in turn, uses the Openbox window manager to manage windows.

If you don't like the customization provided by the Lubuntu team, you can use the LXDE session.

If you want a more minimal experience, login to the Openbox session. This option isn't suitable for newcomers because it's pretty basic, without a taskbar, menu launcher, etc. It's up to users to install additional software to meet their needs.

By the way, Lubuntu 18.04 is the last version of Lubuntu to use LXDE as the desktop environment. Lubuntu 19.04 and 19.10 use the LXQt desktop environment in conjunction with Openbox.

Further reading:

https://en.wikipedia.org/wiki/Lubuntu
https://lubuntu.me/


Recurring Error in Update Manager - Could Not Initialize The Package Manager

As it says, you have a mistake in your sources list.

To open the sources list in Gedit Text Editor, open a Terminal and input the command:
gksudo gedit /etc/apt/sources.list.

When the sources list is open look at line 61. Do you see a mistake? You can make this line ineffective by putting at the beginning of the line: #

If you can't see a mistake, or it is too difficult for you, Copy and Paste the list here.


NFC Host Card Emulation for ubuntu mobile devices

I'd say that this is a question for https://lists.launchpad.net/ubuntu-phone/ or #ubuntu-touch on Freenode. You'll get a quicker response there (better use the mailing lists).


There was to things:

The most obvious one was to write address with two "d" here:

subnet 192.168.42.0 netmask 255.255.255.0{
        range 192.168.42.10 192.168.42.50;
        option broadcast-adress 192.168.42.255;
        option routers 192.168.42.1;
        default-lease-time 600;
        max-lease-time 7200;
        option domain-name "local";
        option domain-name-servers 8.8.8.8, 8.8.4.4;
}

The second one was to start the wireless network by running:

sudo ifup wlan0

And I would have been able to start service isc-dhcp-server I made it thanks to this raspberrypihq tutorial to turn a RPi into a routeur.

Yet, I now have issues to run sudo update-rc.d isc-dhcpd-server enable. Any help would be warmly welcomed!


Is it possible to install Ubuntu on a Craig CLP281 netbook?

It turns out it's not possible.  I asked on superuser.com how to get it to boot from a USB stick and was told that it doesn't boot from the flash memory, only from its firmware.


From your pastebin trace it looks like you have readded a pidgin PPA.  There is no oneiric version of this PPA - so my advice is to open your software sources and untick this PPA.

i.e.

Open the Dash (click the top icon in the launcher) and search for "software"

Then find the pidgin PPA and untick it in this tab:

The rest of the trace shows that you have successfully upgraded to oneiric.

Rerun

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

Ensure you have no further errors.  Then you can cleanup outstanding packages that you no longer need and is just taking up disk-space.

sudo apt-get autoclean
sudo apt-get autoremove


Where can I find documentation for readline?

See man bash, which has an entire section on Readline:

READLINE
   This  is  the  library  that  handles  reading  input  when  using   an
   interactive  shell,  unless  the  --noediting  option is given at shell
   invocation.  Line editing is also used when using the -e option to  the
   read  builtin.

GNU Readline is a library that's developed alongside bash, but is used by a number of other programs to provide better interactive command-line usage (for example, Python's REPL loop). It can be configured using ~/.inputrc or /etc/inputrc. See the readline site for more details.


touchpad not working on acer es1-111M-c1le PLEASE help

You can try to install mainline kernel 4.5rc4

Run

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5-rc4-wily/linux-headers-4.5.0-040500rc4-generic_4.5.0-040500rc4.201602141731_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5-rc4-wily/linux-headers-4.5.0-040500rc4_4.5.0-040500rc4.201602141731_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.5-rc4-wily/linux-image-4.5.0-040500rc4-generic_4.5.0-040500rc4.201602141731_amd64.deb
sudo dpkg -i linux*.deb

Then reboot.

If the touchpad still does not work, report this issue to launchpad by running

ubuntu-bug linux


How to make windows 10 bootable usb under Ubuntu when even mkusb didn't help?

You should check that the image is intact by running a checksum. This answer describes how you can get a checksum from Microsoft. (I can't confirm that's how to find it, since I don't have an MSDN account.) You'll want to run sha1sum path/to/image.iso and compare the result to Microsoft's checksum. "path/to/image.iso" should be replaced with the location/name of your image. If they provide something like and MD5 or SHA256 checksum, then you'd run md5sum or sha256sum.

If you think mkusb may not be working, you could just flash the image directly using dd. The command would be sudo dd bs=4M if=path/to/image.iso of=/dev/sdx, where /dev/sdx is the USB device you want to copy to. You can find that by unplugging the USB drive, running lsblk, pluggin the USB in, and running lsblk again. The device that shows up in the second output of lsblk but not the first is your USB device. (It's also worth comparing the drive size and name. lsblk should tell you the size by default and the name if it's mounted.) Please note that you should really try to use a higher-level tool like mkusb or unetbootin first. From what I understand, dd copies byte-for-byte, ignoring partition headers. Whatever device you specify in the of= argument will become Windows, even if that's the drive your OS is on.

Since you're installing on a Macbook, it would also be worth checking that this image can be installed on there and that it's able to live-boot.

Sorry, I don't have the rep to comment directly. (Seems so backwards...)


How can i do that all ubuntu panels be
  only on laptop (first) display?

In your panel's preferences, disable streching across the whole screen temporarily. Now you can drag your panel to your laptop's screen and re-enable streching.

  On notebook resolution is 800, on display 768. Of course i have "blind" zone, where i cant see cursor.
  Nvidia settings show that resolution is 768, but i already can move cursor to this zone. How can i fix this?

because of the way multiple monitors work, I fear you can't.

  How can i install different wallpapers on each display?

Just open The Gimp and create a new picture with 2646x800 pixels. Put your first wallpaper onto the left and put your other wallpaper to the right. In your wallpaper set it so that your wallpaper is stretched over both screens-


Here is what I would personally suggest. I created an image once so that some friends could safely learn to use the terminal system, so I get what you need.

Preparing your workstation

Login as administrator and setup your system. Go through every single piece of software and clear out the ones you don't want. Your user shouldn't have access to things he shouldn't be supposed to touch. They need to use the workstation for its intended purpose.
Create a new user for your, well, users. I would suggest using a terminal for the sake of simplicity. sudo useradd sparky should do the trick, adding the user named sparky. By this method, the user will not be in any groups by default. It won't be in the sudoers -- meaning it can't do anything but run user-level programs, such as whatever is installed and doesn't require root privilege. However, it is required to set passwords anyway.
Set up the user to auto-login. Now, you won't need to give away passwords for your users, and can simply tell your users to go use any computer. This, of course, is optional to you. It makes it easier for your users, though. P.S. Now might be a good time to make a backup, in case something goes wrong. Then you won't be stuck for the many hours of work I just put you through.

Setting up auto login

  One of the reasons that Ubuntu systems are considered so secure is because they require passwords to install software or to configure the system. They also require passwords to login to the computer. If you want to bypass the login password, there is an Auto Login function you can set and use.

One of the reasons I love the terminal so much is that it makes complicated GUI tasks relatively quick. The GUI also makes complicated terminal tasks relatively quick. They each have their advantages.

Run the following to setup auto login.

sudo mkdir /etc/lightdm/lightdm.conf.d
gksudo gedit /etc/lightdm/lightdm.conf.d/50-myconfig.conf

Copy and paste the following:

[SeatDefaults]
autologin-user=USERNAME

That's all there is to it. But what do we do when the system suspends or goes into sleep mode?

Type gconf-editor in a terminal (Alt+Ctrl+T to call the terminal).
Go to apps/gnome-power-manager/locks
Check "use_screensaver_settings".
If still asked for password, you can (also in gconf-editor) go to desktop/gnome/lockdown and check: "disable_lock_screen"

And that should do it.

Partially cited and edited from the wiki page.

I hope this helps, as I put a lot of time into creating this. Should you need any assistance, please comment below! If I didn't answer your question, let me know so that I can help you figure it out.


Deleted all zmlinux's from /boot. Can't boot into anything now

Find your Ubuntu release number, codename. Boot from Live CD, download kernel package from your repository, unpack it and copy vmlinuz to /boot of your current installation. I will update answer if you need some description on each step.


Unlock Keyring Comes Thrice On Every Boot

If you aren't concerned about security you can open seahorse. You then change the password of the default one to nothing and maybe the rest. Right mouse click change password type your old one and leave the rest empty it will promt a box if you are sure.


questions about dual-boot install Ubuntu 10.04 and Windows 7 on same hard drive

Sources

The official DualBoot help guide should be on your reading list. It covers a lot more including links on how to repair things should they go wrong.

I have nothing against the "iinet" website you've linked to but several steps could be simplified. I'd personally opt to resize the Windows partition before running the installer. This will allow you to just select the "Install alongside other operating systems" option when that choice appears and that'll shave off several steps in the installer (and simplify the process).

I guess something worth mentioning is you probably shouldn't read too much. Sounds strange but there are indeed many ways to skin a cat and if you get conflicting advice from different sources, you end up confused. Pick one way and follow it.
Shrinking NTFS

If fairness to gparted (et al) they offer just as much a guarantee as Windows does resizing it itself. That is to say: none.

If you have data on there that you can't restore with just a reinstall and a small amount of time, back up your data! You don't have to go as far as cloning the whole partition (via CloneZilla et al), you can just punt your profile (documents, photos, other media, etc) off to an external disk or even an online backup service.

But for what it's worth, parted (and it's graphical counterparts) is quite a robust tool that doesn't take your data integrity lightly. It will test as much as it can before doing anything. I've never had any problems with gparted in 5 years of using it.

Either approach is equally good. Use whatever you're most comfortable with.
A /boot/ partition

I don't see any benefit of a dedicated boot partition. It's not needed.
MBR setup

I'd personally let Ubuntu claim the MBR on the disk (just do the standard setup) it should pick up Windows 7 and add it to the boot list.

Of course things can go wrong at this stage but they're usually repairable. (Unlike my usual advice) I suggest you just roll with it and worry later. A lot of work goes into making Ubuntu dual-boot in a sensible way so you shouldn't need to do anything.


Way to speed up cp -a (using cp -a within a thumb drive is very slow)

Use sync to force immediate writing to the destination
When you cp a file and it appears at the destination file-system, it is not guaranteed that the file is actually on the storage medium yet.
The reason for that is, that the data is first fetched in between various internal buffers, which is faster and user-friendlier, until it actually is on the destination storage device. Writing the data to the destination device is actually performed in the background and does not consume many CPU cycles, that's why it might be difficult to see it in the activity monitors.
You can always try to force an immediate write from the buffers to the destination storage device by using sync after the copy, e.g. cp ${QUELLE} ${ZIEL} && sync
Also, consider using rsync to only copy files to the destination that have been changed or are new.


Can anyone tell me if these files are safe to delete?

That is for you to decide.
They don't belong in /home/$USER/ though.
It looks like you open an install file in /home/$USER/.
Should be safe to remove in my opinion but you never know ;)

Even so ... from command line you can delete this with ...

rm dht.dat dht_feed.dat Release.key resume.dat rss.dat settings.dat

And if you want to make a backup first ...

mkdir ~/backup
mv dht.dat dht_feed.dat Release.key resume.dat rss.dat settings.dat ~/backup/

I left "Examples" out of it even though it is harmless to delete; it is a default directory and not part of the other files your listed.


changing keyboard languages by shortcut keys

I just changed Super+Space to Alt+Left Shiftand it works find for changing to the second language and returning to the original one.  But as I changed it to Alt+Right Shift, It just worked as you described.

Generally, it is advised to avoid Alt+Shift for this purpose since these keys are being used in some other apps as Alt+Shift+KEY.

I also suggest getting used to Super+Space.


The Online Accounts panel doesn't appear if you are using Unity. In theory, you don't need it with stock Ubuntu 12.04. However, it is useful if you have installed Evolution Mail, Contacts or Documents.

In some of these applications, like Contacts, you can open the Online Accounts panel directly from their own menus. Otherwise, you can get to it in the following ways:

If you have System Settings open, close it. Open a terminal, and run the following command:

env XDG_CURRENT_DESKTOP=GNOME gnome-control-center online-accounts

Alternatively, install GNOME Shell in Software Centre, log out, and log in again but choose the GNOME session before typing your password. (To choose a session from the login screen, click the cog icon to the top right of the password field). When you open System Settings from the user menu, you will see Online Accounts as one of the options.


How do I change the Deskbar Applet panel icon?

Check one of those:

/usr/share/icons/hicolor/16x16/apps/deskbar-applet.png
/usr/share/icons/hicolor/scalable/apps/deskbar-applet.svg
/usr/share/icons/hicolor/48x48/apps/deskbar-applet.png
/usr/share/icons/hicolor/32x32/apps/deskbar-applet.png
/usr/share/icons/hicolor/22x22/apps/deskbar-applet.png

(Found those by running sudo dpkg -L deskbar-applet.)


Right now you can use both apt & apt-get, while apt has received a lot of developer love in the past weeks/month.

Therefore, apt now comes with a progress bar, coloring, etc.

It does not fully replace apt-get so far, but will most likely in the future.  So in the long-term it might make sense to get used to apt as well and not rely only on apt-get.

In addition, please see the question If apt-get was replaced by just apt, as it covers this topic already.


High fan speed and noise after system wakeup in newly install 13.04

I've found solution for my Compaq 6720s fan and Ubuntu 13.04 here:

Create the file ”/etc/pm/sleep.d/99fancontrol.sh”, insert the code below and chmod 755 it.
Script:

#!/bin/sh
#
#

case "$1" in
 hibernate|suspend)
  # Stopping is not required.
  ;;
 thaw|resume)
# In background.
    echo -n 0 > /sys/devices/virtual/thermal/cooling_device0/cur_state;
    sleep 2
    echo -n 0 > /sys/devices/virtual/thermal/cooling_device1/cur_state;
    sleep 2
    echo -n 0 > /sys/devices/virtual/thermal/cooling_device2/cur_state;

  ;;
 *) exit $NA
  ;;
esac


hp-systray is a python script, so try:

$ gdb --args python /usr/bin/hp-systray


Get rid of unity without login-screen and root

With the NX client you can set which desktop (application) to run after the ssh connection has been established.

Open the main NX Client and click the Configure button, you will find a dialog for setting up the connection.
In the Desktop section choose "Unix" and "Custom". Then click the Settings button.
In the top section of the Custom - Settings dialog you can now select to run any arbitrary command.  That command could be any X application. I run xfce so I just enter the "startxfce4" command into the box.

Naturally you will be limited to what is installed, but if the Classic Desktop is installed you can put in the command to start it. If I remember correctly it is something like

gnome-session --session=gnome-classic

You could also just set up connections for each application you want. For example, you could put "emacs" as the command and have Emacs running as a separate window on your Windows desktop.

Hope this helps and is not too late.


Concatenate a variable onto the end of another variable or string in Bash

You can use eval to evaluate the variable assignment. Below is a sample program related to your scenario.

#!/bin/bash

year=1971

for ((i=0; i<=10; i++))
do
    eval precip${year}="pr_${reg}_${glob}_1971010103.nc"
    ((year+=5))
done

Here the eval statement evaluates the variable precip${year} to precip1971 and so on.


Not enough free disk space for software update

This is probably a permission error. It is probably caused because the program you are installing doesn't have the correct permissions to install in its location and interprets this as there not being enough disk space.

To solve this, first try starting Ubuntu in recovery (safe) mode. To do this restart your computer and while Ubuntu is booting, hold the left shift key (or if that doesn't work press 'esc' repetitively). This should open a GRUB boot menu. Using the arrow keys, select recovery mode and press enter. Wait for Ubuntu to boot, login to your account and retry the installation now.

If that doesn't work, try logging in as root and doing the installation, both with recovery mode and without recovery mode.


According to the System Requirements GeForce Experience is a Windows only program and according to the Wine App Database no one has yet tried or tested it under Wine and reported the result. If you feel that you must use Geforce Experience at this point it appears that your best bet would be to dual boot a version of Windows that the program supports.


Did replacing Windows with Ubuntu completely remove Windows?

Your Data Might Still Be Recoverable (But Don't Count On It!)

Since, as you commented, your goal is to ensure that no data from the Windows system can ever be recovered:

No. Nothing you could have done with the Ubuntu installer utility can completely eradicate all possible informational trace of previous data on your disk.

You can, however, probably accomplish this, and if you wish, you can probably accomplish this with the Ubuntu live CD. (You cannot accomplish it from within a running operating system installed on the drive, like your newly installed Ubuntu system.)

To render all data on a disk permanently unrecoverable, you need to overwrite every byte on the disk. This takes a moderately long time (up to several hours, or days for disks that are really big and also really slow).

According to some respected computer engineers and data recovery specialists, to be entirely sure you're destroying all the data, you have to overwrite it with unpredictably random bytes. (On the other hand, my understanding is that some equally learned folks think that's not necessary.)

If you're really interested in doing this, see:

How can I securely erase a hard drive?

But remember that some of the information in some or all of those answers might be wrong.
How can I reliably erase all information on a hard drive?

Answers there could be wrong too, but they're more likely to have useful comments pointing out that something is wrong, because this is one of the sorts of question that really engages the Security.SE community.

But is that really what's important?

The potential recoverability of data from your old Windows system is entirely irrelevant to all of the following:

Your Ubuntu system's stability.
Your Ubuntu system's security.

(Malware on your old Windows system cannot cause itself to be run. The configuration that gave it power can no longer be attained by booting to it, unless you deliberately recovered the system to the point of being able to run, which  probably would not succeed. Even if it did, though, anyone who can perform low-level data recovery of old partitions from previous OS installations that are no longer in the partition table, can also do whatever they want to your computer. In order to perform such a recovery, you see, someone already has to have full access to read and write to any part of your hard disk and to cause your computer to perform any action or run any software. If someone wanted to take control of your computer and/or install unwanted software on it, recovering your old Windows system would be one of the least efficient and most ineffective ways imaginable to do that.)
Your Ubuntu system's performance.
The amount of disk space available to your Ubuntu system.

(If data are recoverable from the old OS, that just means that your Ubuntu system hasn't gotten around to storing its own data in all the same places on the disk that contained the old data. The physical presence of remnants of the old data does not make any difference at all to the speed with which any part of the hard drive can be accessed for [over]writing new data.)
The stability, security, performance, and disk space available to any future operating system installed on your computer, even if it is a Windows operating system. For the same reasons as explained above, any malware on you previous Windows system still has no mechanism to affect the state of a subsequent Windows OS that is written over it.

Futhermore, assuming the Ubuntu installation worked properly (which is something we can check, see below), you will not be accidentally booting into the old operating system. To get it to even start booting you'd probably have to try hard. If you got it to boot all the way, that would be truly impressive.

  Just Installing Ubuntu Over the Old System Seems Reasonable for Most Purposes

  This following paragraph pertains to law, but I am not a lawyer, this is not legal advice, and relevant law probably varies from one place to another. Please consider this section to be my personal thoughts. I am not even pretending to be able to tell you what is and is not legal.

  If your goal is to make sure you are not infringing copyright law by having an unlicensed copy of Windows, or to make sure you fulfill your end of an end user license agreement that says you must do something like "destroy all copies of the software," it is hard for me to imagine that installing Ubuntu over it, so that the partition table no longer contains any partition entries for your old system, would not fulfill that requirement. I have never heard of anyone interpreting a requirement to "destroy all copies" of a copyrighted work to require that they be destroyed beyond the possibility of even partial recovery. Right now, assuming your Ubuntu installation worked the way it should have (which you can check, see below), your situation is similar to the situation of someone who destroys a paper letter by ripping it up into a thousand pieces, burns a third of them, and then scatters the other two thirds between two separate trash cans in their house that get emptied at different times.

  Then again, I don't know everything. That's not legal advice, and the ripping-paper analogy is a technical illustration that may very well be legally irrelevant. If you need legal advice, you should consult with an attorney who practices law in your jurisdiction.

Sometimes You Really Do Have to Destroy All the Data Completely

If there is information in your old Windows system that must be kept secret, for example if you are ethically or legally obligated to ensure that it is not disclosed, then it is a good idea to scramble the disk completely (as discussed in the two questions linked above).

If there is information in your old Windows system that is so sensitive that one or more people could plausibly die as a result of its disclosure, or that something comparably bad could result, then you should scramble the disk completely. Then, you should physically destroy the disk. The reason for this is that, even if the likelihood is small, it is possible that you could make a mistake (or that your software tools could have a bug) that would cause some data to survive. I am not familiar with what techniques are recommended for physically destroying hard disks, but some government agencies and some businesses do actually have protocols for that sort of thing, some of which can be read by interested members of the public.

I am guessing your situation is not like either of those two. This section is included for completeness only (and in case you were wondering under what circumstances I recommend making sure all data on a disk are completely destroyed).

Peace of Mind Is An Acceptable Reason to Securely Erase a Disk

It takes a bit of time to read and absorb information about secure erasure techniques. But deciding what technique or utility to use is ultimately not too difficult, and most hard drives these days don't take overwhelmingly long to overwrite.

Therefore, if it makes you feel better to do it, do it!

I don't know how well this works compared to other options, as it's been some time since I read up on securely erasing disks. But many hobbyists and small businesses that resell PC's use Darik's Boot And Nuke. If you really want to securely erase your disk, you might want to use that.

Of course, this will overwrite your new Ubuntu system, too. But you just installed it, so you probably haven't customized it much yet. You could probably reinstall it without too much hassle.

It is almost certainly not necessary for you to securely erase your disk, but it's kinda cool, so if you feel like it, go ahead!

You Should Check Your Partition Table(s) to Make Sure Ubuntu Installed the Way You Wanted

Without checking your partition table, you don't know for sure if the Windows partitions themselves were really wiped out. If they weren't wiped out, your Windows system might be fully accessible and you might even end up booting to it again (though this is still not extremely likely, assuming it's not booting now and there's no menu option for it).

It's a good idea to do this. Here's how:

Boot your Ubuntu system if it's not already booted, and log on if you don't have it set to log you on automatically.
Open a Terminal window by pressing Ctrl+Alt+T.
Run this command:

sudo parted -l

(If you want to run sudo fdisk -l instead, as in fabricator4's answer, that's fine. For this purpose, choosing between them mostly comes down to personal preference.)
You'll probably be prompted for your password. This is the same password that you would use to log in, install updates, or unlock the screen. It is the password you set up when you installed Ubuntu.

As you enter it, no placeholder characters (like *) appear. That's by design. Just type the password in and press Enter.

If you know how to read the output of parted or fdisk, you will be able to see if there are any partitions still existing that belong to your old Windows system.

Otherwise, as fabricator4 said, you can make sure there are no NTFS partitions (since Windows uses NTFS partitions for its system drives, and by default for all drives).

Or, you can copy all the text from the Terminal, edit your question, paste it in, and then comment on this answer so I know you did so. I (or someone else) can then look at the output and tell you what each existing partition is for and whether or not there are any partitions that belong to a Windows system or that are likely to have existed before you installed Ubuntu.

I believe checking your partition table to make sure there are no Windows partitions left over is quite sufficient, and I think most other experienced users would agree. Please do not hesitate to ask if you want help interpreting the output of parted or fdisk.


Automatic shutdown after suspend Ubuntu 18.04

Use Autopoweroff
Autopoweroff is simple, yet useful utility which is used to poweroff, reboot, suspend, hibernate your Linux machine, or run any custom command provided by the user at a specific time. On good thing about Autopoweroff is it will shutdown the system only when certain conditions are met. If the system we intended to shutdown is being accessed/used by another system, Autopoweroff utility won’t shutdown it. Let us say you have set shutdown time at 12:00am, but some other systems on your network are still accessing it after 12:00am, then it will not shutdown. It will wait for the other systems to complete their work, and shutdown itself only if no other computer on the network is responding to ping. Sounds pretty useful, isn’t it?

Your system will shutdown, suspend, or hibernate when the following conditions are met:

Any hosts that the computer is dependent on is not answering ping anymore.
No keyboard or mouse activity has been detected on the computer for a while.
And of course, the user has not disabled Autopoweroff.
Autompoweroff should work on any modern Linux operating systems, and is free and open source. So, anyone can fork, improve the code, or add any additional features they want.

Download the latest Autopoweroff installer file for your distribution. Currently, It is available as .deb and .rpm packages.

I use Ubuntu, so I downloaded the .deb file.

 wget https://github.com/deragon/autopoweroff/releases/download/3.0.0/autopoweroff-3.0.0-1.noarch.deb

Then, install it using commands:

sudo dpkg -i autopoweroff-3.0.0-1.noarch.deb
sudo apt-get install -f

Configuration :

Once installed, open GUI configuration tool or /etc/autopoweroff.conf file and edit to your particular needs.

Here, let us follow the GUI method. Open up Autopoweroff GUI configuration tool either from the the Menu or Unity dash.


How do I set the KDE panel to be a long continuous one across dual monitors?

It's currently not possible. Apparently, it's a design decision of the KDE team.


Can't install Ubuntu Server 18.04 but can install others fine

I got the same problem on both, phisycal and virtual machines (VMWare). Usually the error ocurred during the "installing kernel" step.

I tried the suggestion found here https://askubuntu.com/a/1082599/212922 and it worked.

Steps

Start from the installation media, select languague and keyboard layout
Press Alt+F2 to open another tty
Type the following and press enter

service rsyslog stop

Press Alt+F1 to return to the installation screen, and follow the process normaly.

Hope it works for you too.


Instead of changing the background color, you could make an image the background.

Choose a  PNG image, copy it, open terminal, run the command sudo nautilus /boot/grub, input password and Nautilus (Ubuntu explorer) will be opened. Paste your image in the folder you were redirected to.

Open a new Terminal window, run sudo update-grub, wait for the process to end and reboot your computer. The chosen image should be your GRUB background then.

About the letters' color, it will be the perfect opposite of the background color.

So, if you want a black background, you could use this image.


Windows 8 VPN Client connecting to UbuntuVNP Server fine but http from client is not working

You will need to check you windows configuration.  You mos likely are using the remote gateway, you do not want to have that checked.  You want to only use the VPN tunnel when you are accessing IP's on the remote network.


certbot version updgrade not implemented

You have 270 not upgraded packages, it is possible there are some dependencies. If you need to keep the current version of some package use sudo apt-mark hold package-name and upgrade the rest. Or find the dependencies that should be upgraded.

On my server certbot was upgraded without any issues, when I've used just sudo apt upgrade.

Based on the OP's report, the concrete answer of the question is both packages python3-certbot and python3-certbot-apache must be upgraded.


Better turn off hibernation option from Windows as your windows doesn't go to shut down mode but it sleeps instead so harddisk is still holded by Windows

You can do

 sudo ntfsfix /dev/sdaX

Where x is the number shown in error

But this is highly dangerous , sometimes it might happen you save your data in Ubuntu on those drive and it wont be visible in Windows and then it vanishes from Ubuntu as well so turning off hibernation is recommended .


Dual boot Ubuntu and Windows 10 with BitLocker enabled

Using Full Disk Encryption (Linux) or BitLocker (Windows) requires that you enter the key to unlock the disk. If they key was stored somewhere on disk it would defeat the purpose of using disk encryption.


Ubuntu 14.04 USB mouse not working without power

try this

echo "on" | sudo tee /sys/bus/usb/devices/usb*/power/control

then reboot. it works for me.


Does Ubuntu install drivers automatically?

For the majority of your hardware,it will just work out of the box as the drivers are built into the Linux kernel. Should you have something that does not work, feel free to ask a new question. You can test out the hardware compatibility by booting using a live CD live or live USB stick. See the download instructions at http://ubuntu.com.


Some RAID code was interfering with the installation. I opened a terminal and entered

sudo apt-get remove dmraid

After I entered it, I tried the installation again, and it worked. I was able to select my partition and run it along with windows.


How can I do a dist-upgrade using the installation media?

You can't. The only method from the installation media is a complete install.

  I want to download once and install everywhere.

Install Puppetmaster. That let's you define all your machines in your network as slaves and you can update, upgrade, administer those slaves. You can also administer your users, lock them out, create new ones, change passwords and lots more.


I just tried installing Meld on my 12.04 installation, using sudo apt-get install meld, and it worked with no problems.

Try this.  Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install meld

If that dosen't work, try installing the latest python

sudo apt-get install python3


What is correct way to fix name resolution from Docker container?

The solution for docker run is very simple - we need to choose host network with --network host option:

docker run -it --network host ubuntu:19.04 apt update

and then the problem will be solved.

But it also should be noted that docker build has --network option only starting only from 18.04 LTS. So if we need docker build --network host for 16.04 LTS we need to use docker-ce package from docker.com.


I have a dell dimension 3000 as well and here's how I did mine, I downloaded the ISO an then downloaded pen drive linux I chose the ISO on pen drive linux and said that it was ubuntu 12.10 then I told it to write it to the usb directory.  Once it was done I restarted my pc and when it says dell press f12 and then boot from usb.  Afterwards once its booted click install and then follow the prompts from there.

I hope this helped.


Services stopped working - exec: tclsh: not found

The exec tclsh fragment tells your $SHELL to look for tclsh in each of the directories in your $PATH environment variable. Inspect your $PATH:

echo "$PATH" | tr ":" "\n"

tclsh is /usr/bin/tclsh, so /usr/bin must be in your $PATH for exec tclsh to find it.

tclsh is in the tcl package:

walt@fox:~(0)$ type -p tclsh
/usr/bin/tclsh
walt@fox:~(0)$ dpkg -S $(type -p tclsh)
tcl: /usr/bin/tclsh
walt@fox:~(0)$ dpkg -L tcl
/.
/usr
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/doc
/usr/share/doc/tcl
/usr/share/doc/tcl/README.Debian
/usr/share/doc/tcl/changelog.gz
/usr/share/doc/tcl/copyright
/usr/share/man
/usr/share/man/man1
/usr/bin
/usr/share/man/man1/tclsh.1.gz
/usr/bin/tclsh

You could reinstall the tcl package with:

sudo apt-get install --reinstall tcl


dell 3446 ubuntu 18.04 LTS integted web cam not working,any driver for that?

Try to search "Additional Drivers" on
Software & Updates


Command line tools in one language, system in another

If you run the env command, you will be given the environment variables for language.

LANGUAGE=
LANG=en_CA.UTF-8

If you set those variables to English settings, with the export command, any command called after this will be in "English mode".

export LANG=en_US.UTF-8

You can also put this also in the .bashrc or .profile file in your home directory, this will be in effect every time you open a command line terminal.


How to make terminal bell play an alert sound without PC speaker?

Edit ~/.xprofile and add the line pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg. Then when you log out and log back in, typing echo -e '\a' in the terminal will play an alert sound (glass.ogg). Then I copied bell.ogg (found with locate -i bell.ogg) to the same folder as glass.ogg and modified the above command to use bell.ogg instead. Then, you can adjust the alert volume in Sound -> Sound Effects tab.

This solution worked on Ubuntu 12.10 Quantal Quetzal 64 bit with 3.5.0-22-generic. It's from http://www.richud.com/wiki/Ubuntu_Beep_Audible_Bell_Ping_Fix.


How do I update the BIOS of a Samsung Series 9?

If the Bios updater has a version for Windows XP, you can use Hiren's Boot CD to boot a live XP and do the Bios update from there.


How to add a shell script as a command offered by a Snap?

Ok so two things were missing.

1) Under the command section the $SNAP environment variable should be used.  All the parts that you create will be stored relative to that env variable at runtime.

2) Rather than invoking the shell script directly, specify the interpreter (in this case "sh").  It failed without that.

apps:
  foo:
    command: sh $SNAP/opt/foo/bin/foo.sh

parts:
  foo:
    source: .
    plugin: dump
    organize:
            foo.sh: opt/foo/bin/foo.sh

ADDENDUM 1: It turns out the really important factor for my use was that in Ubuntu 18, Snap is tied to the version of libc that is in Ubuntu 16.  This causes Snap to need to suck up Ubuntu 18's libc6 into my Snap, which in turn creates conflicts with things like bash and dash/sh.

If you are attempting to run shell scripts and are seeing segfaults, it's likely related to this.  A process tries to invoke the shell script, reads the "shebang" at the top ("#!/bin/bash") and when it runs /bin/bash it gets a libc conflict.

ADDENDUM 2: For situations where a parent process launches shell scripts, be careful that the "shebang" statement at the top will likely be invalid.  For example "#!/bin/sh" will not resolve correctly because the actual path would be "$SNAP/bin/sh", which would resolve to something like "/snap/project-name/project-revision/bin/sh".

To get around this, make sure the PATH environment is getting passed to the program with $SNAP prefixed to every relevant path.  Then adjust the parent program to invoke the script with the interpreter, for example "bash child.sh" vs. "child.sh".


"what does $(ls *.txt) do"

Short answer

$(ls *.txt) gathers a list of file names and then mangles them.  Do not use this.

Longer answer

ls is intended for human-readable output.  As one of ls's maintainers wrote in response to why ls would not offer a --null option:

  If we were to do this then this is the interface we would use. However
  ls is really a tool for direct consumption by a human, and in that
  case further processing is less useful. For futher processing, find(1)
  is more suited. [emphasis added]

In other words, use of ls for anything other than display to humans is just not supported.  ls maintainers, for example, recently changed the default output format to something they though more human-friendly without warning.  So, follow their advice: if you are going to do further processing of file names, use find instead of ls.
$(...) is command substitution.  One consequence of using command substitution is that trailing newline characters are removed.  If the last file name in the list happens to contain trailing newlines, they will be removed.
Since $(...) is not double-quoted, the text it produces will be subject to:

Word splitting
Pathname expansion

The result of both of these is further mangling of the file names.
not to mention the issues with file names starting with - because of the missing -- (for both ls and egrep as Ubuntu's egrep being the GNU implementation accepts options even after non-option arguments unless POSIXLY_CORRECT is in the environment).
also, if any of those txt files were of type directory, ls would list their content instead of themselves.
and if there's no txt files, the output of ls will be empty (though you'll see an error about a missing *.txt file) and as egrep will receive no file argument, it will look for Stuff in its standard input (and seemingly hang).

Example

Let's create 4 files containing Stuff in our directory:

$ echo Stuff | tee file1 file2 'a b c.txt' 'f* .txt'
Stuff
$ ls -Q
"a b c.txt"  "file1"  "file2"  "f* .txt"

Now, let's run the egrep command:

$ egrep "Stuff" $(ls *.txt)
grep: a: No such file or directory
grep: b: No such file or directory
grep: c.txt: No such file or directory
file1:Stuff
file2:Stuff
f* .txt:Stuff
grep: .txt: No such file or directory

Observe that we get 4 error messages about nonexistent files.  This is due to word splitting.  The result also shows matches with two files, file1 and file2 that should not have been searched because they don't end with .txt.  This is because of _pathname expansion`.

The correctly written command produces two successful matches and no errors:

$ egrep -- "Stuff" *.txt
a b c.txt:Stuff
f* .txt:Stuff

Recommended solution

Use:

egrep -- "Stuff" *.txt

or POSIXly:

grep -E -- "Stuff" *.txt

or:

grep -E -e Stuff -- *.txt

This will work with any file name and has none of the limitations of the ls approach.


How big should I make my swap partition?

See https://help.ubuntu.com/community/SwapFaq

Here is an excerpt:

How much swap do I need?

For less than 1GB of physical memory (RAM), it's highly recommended that the swap space should, as a base minimum, be equal to amount of RAM. Also, it's recommended that the swap space is maximum twice the amount of RAM depending upon the amount of hard disk space available for the system because of diminishing returns.

For more modern systems (>1GB), if you use hibernation, your swap space should minimum be equal to your physical memory (RAM) size, otherwise you need a minimum of round(sqrt(RAM)) and a maximum of twice the amount of RAM. The only downside to having more swap space than you will actually use is the disk space you will be reserving for it.

The "diminishing returns" means that if you need more swap space then twice your RAM size, you'd better add more RAM as Hard Disk Drive (HDD) access is about 10³ slower then RAM access, so something that would take 1 second, suddenly takes more than 15 minutes! And still more than a minute on a fast Solid State Drive (SSD).


How do I install the Firefox Developer Edition?

Firefox Developer Edition

The Firefox Developer Edition is a modified version of Firefox, specifically designed for web developers. It uses a separate profile than the regular version of Firefox. Meaning you can have both Firefox or F-beta, installed next to the developer edition. Note that your F.D.E. will be a completely UN-customized browser. To unify settings, you can use Firefox sync.

Here's one of many perks when using F.D.E:

  "By using the Developer Edition, you gain access to tools and platform features at least 12 weeks before they reach the main Firefox release channel." - Developer Edition - Mozilla | MDN#The_latest_Firefox_features

Installation

There are currently three ways to do this, manually, PPA or via Ubuntu Make.

Manually

Download from Mozilla Firefox Developer Edition webpage. Extract it with file-roller and move the folder to its final location. A good practice is to install it in /opt/ or /usr/local/.

Once you moved the files to their final location (say /opt/firefox_dev/), you can create the following file ~/.local/share/applications/firefox_dev.desktop to get a launcher with an icon distinct from normal Firefox.

[Desktop Entry]
Name=Firefox Developer
GenericName=Firefox Developer Edition
Exec=/opt/firefox_dev/firefox %u
Terminal=false
Icon=/opt/firefox_dev/browser/chrome/icons/default/default128.png
Type=Application
Categories=Application;Network;X-Developer;
Comment=Firefox Developer Edition Web Browser.
StartupWMClass=Firefox Developer Edition

Please note, that the parameter StartupWMClass is added to prevent duplicate icons in the launcher, as explained here.

To mark the launcher as trusted, make it executable:

chmod +x ~/.local/share/applications/firefox_dev.desktop

To launch it, navigate to ~/.local/share/applications/ using your "Files" application (ensure you turn on hidden folders), then double-click firefox_dev.desktop. Alternatively, search for Firefox Developer, and simply run the firefox binary, and voilà.

Note that, when you install manually, the F.D.E. does not have the unity global menu by default.

PPA

Firefox for developers currently resides in Firefox Aurora builds : “Ubuntu Mozilla Daily Build Team” team. It should be noted that:

  "Firefox Developer Edition replaces the Aurora channel in the Firefox Release Process. Like Aurora, features will land in the Developer Edition every six weeks, after they have stabilized in Nightly builds." - Developer Edition - Mozilla | MDN #The_latest_Firefox_features

Also:

  "Version 35.0a2, first offered to Firefox Developer Edition users on November 10, 2014" - Firefox — Aurora Notes (35.0a2) — Mozilla#main-content

Install the Firefox Developer Edition, formerly know as Aurora, like so:

sudo add-apt-repository ppa:ubuntu-mozilla-daily/firefox-aurora
sudo apt-get update
sudo apt-get install firefox

The Mozilla PPA only holds packages for the supported Ubuntu releases, not EOL(End Of Life) releases.

Note that installing with the aforementioned ppa, will result in your current Firefox installation being replaced!

Ubuntu Make

This method has been provided by Jorge Castro. I am adding this here, because it's also an excellent way to install the Firefox Developer Edition(and many others dev tools).

sudo add-apt-repository ppa:lyzardking/ubuntu-make
sudo apt-get update
sudo apt-get install ubuntu-make

After you have installed ubuntu-make, tell it to install the web tool firefox-dev.

umake web firefox-dev

Uninstall

If you wish to keep the Current default Firefox, because The FDE has no new features you like, or for whatever reason, here are a few ways to uninstall it.

PPA

You can remove the ppa, and its packages, using ppa-purge.

Install it like so:

sudo apt-get install ppa-purge

The following will remove the PPA, and its packages:

sudo ppa-purge ppa:ubuntu-mozilla-daily/firefox-aurora

Manually

remove the binaries with the rm command(rename the path to the location you actually extracted FDE). Or with your file-manager:

sudo rm -r /opt/firefox_dev/

Also remove the firefox_dev.desktop

sudo rm ~/.local/share/applications/firefox_dev.desktop

After that you have successfully removed the Firefox Developer Edition.

Ubuntu Make

the following command will remove Firefox Developer Edition:

umake web firefox-dev -r

You can also remove umake and its PPA (ppa-purge needed, see installation instructions above):

sudo ppa-purge ppa:lyzardking/ubuntu-make

Screenshot

 Firefox Developer Edition on Ubuntu 14.04.1

Change Theme

At the time of writing, there are three themes available for F.D.E. Here is how to enable them.

Type in the url bar:

  about:config

When in the search filter type in theme. Then double click on devtools.theme. After that, type in light, and the theme will be applied.

Screenshot with multiple themes available for F.D.E.

Features

Some - but not all - features touted by Mozilla:

WebIDE:

allows you to develop, deploy and debug Web apps directly in your browser, or on a Firefox OS device. It lets you create a new Firefox OS app (which is just a web app) from a template, or open up the code of an existing app. From there you can edit the app’s files. It’s one click to run the app in a simulator and one more to debug it with the developer tools.
Web IDE - YouTube

Valence:

(previously called Firefox Tools Adapter) lets you develop and debug your app across multiple browsers and devices by connecting the Firefox dev tools to other major browser engines. Valence also extends the awesome tools we’ve built to debug Firefox OS and Firefox for Android to the other major mobile browsers including Chrome on Android and Safari on iOS. So far these tools include our Inspector, Debugger and Console and Style Editor.
Valence - YouTube

Responsive Design Mode:

see how your website or Web app will look on different screen sizes without changing the size of your browser window.

Page Inspector:

examine the HTML and CSS of any Web page and easily modify the structure and layout of a page.

Web Console:

see logged information associated with a Web page and use Web Console and interact with a Web page using JavaScript.

JavaScript Debugger:

step through JavaScript code and examine or modify its state to help track down bugs.

Network Monitor:

see all the network requests your browser makes, how long each request takes and details of each request.

Style Editor:

view and edit CSS styles associated with a Web page, create new ones and apply existing CSS stylesheets to any page.

Web Audio Editor:

inspect and interact with Web Audio API in real time to ensure that all audio nodes are connected in the way you expect.

Reference:

Mozilla Introduces the First Browser Built For Developers: Firefox Developer Edition ✩ Mozilla Hacks – the Web developer blog
Firefox — Aurora Notes (35.0a2) — Mozilla(Firefox Developer Edition Notes)

Version 35.0a2, first offered to Firefox Developer Edition users on November 10, 2014

Firefox Developer Edition — Mozilla
Firefox Aurora builds : “Ubuntu Mozilla Daily Build Team” team
Developer Edition - Mozilla | MDN


I had the same problem .
the solution is boot-repair.
download the iso from here and then make a bootable usb (you can use UNetbootin to make it).
boot your laptop on it than choose "Recommended Repair".
it will automatically reinstall Grub and repair your laptop without erasing the storage part.
you can see this link for more informations:
https://help.ubuntu.com/community/Boot-Repair


There is possibly an easier way to do this without building from source or running a deb from a USB. Try connecting your computer via a LAN ethernet cable and try the following: (if you are simply missing dependencies that xfce used to utilise then the following two commands should work to fix application dependencies)

sudo apt-get update
sudo apt-get install -f

To install xfce4 desktop from scratch then try the following:

sudo apt-get install xfce4


Systemd runs start and stop commands simultaneously on Ubuntu 18.04 - Minecraft server issues

This might not be your systemd but might be the script it is calling that is having trouble.

/srv/minecraft/mc_server.sh

Have you tried running this directly and does that work?

Normally this should work, as I did not get to see your script calling tmux, this is what it should look like.

tmux new -s my_session
run your command to start the server
tmux detach


What is the correct location for a maintained virtualenv service?

Essentially the location of the virtualenv is irrelevant. You can place it wherever you want. You just have to run source some_venv/bin/activate and then you're set to go.

The traditional location is ~/.virtualenvs.

I use a different setup where I have a ~/projects folder which contains the different virtualenvs and contains the python code for different projects. This is nice and easy because you have everything together. For some it might look a bit cluttered, because you get a bin, local, and more folders in your venv.

I manage these using virtualenvwrapper which is in the repos. I did not get the chance to test pew, yet.

If virtualenvwrapper and virtualenv are set up correctly, the workflow is:

mkvirtualenv some_venv
workon some_venv
cdvirtualenv
deactivate


iscsiadm discovery gives multiple paths. Want to specify one

It looks like there are a couple ways of doing this. The quick and dirty way is to delete the /etc/iscsi/nodes/iqn*/whateverIP directory for each one you don't want.
Alternatively, you can edit the 'default' file under each iqn to change connection from automatic to manual. But, if you do another discovery, your changes will be overwritten.

There also appears to be a way to bind an physical NIC to an iface file which will allow you to control the network that the iscsi traffic flows.


Are the Ralink RT3090 drivers incompatible with Ubuntu 10.10?

From the bug report post #103 work fine on a MSI U210:

Go to your terminal and type in this command: lsmod | grep rt

Your output will look something similar to this one:

rt2860sta 488820 0
rt2800usb 37372 0 [...]

open your Terminal and first type in this:

 sudo modprobe rf rt2800pci
 sudo modprobe -rf rt2860sta
 sudo modprobe rt2860sta

Just as you type in this, your networkmanager connects automatically and works! But to close the whole thing up, you need to type in this command:

echo blacklist rt2800pci | sudo tee -a /etc/modprobe.d/blacklist.conf

Then you are done and your networkmanager will work for you again.


How to actually submit my app to Ubuntu app showdown?

The first thing we need do is package your application. Quickly makes packaging really easy. See the guide for Quickly. You need just one command to package using Quickly.
Run quickly submitubuntu to create your package and upload it to a PPA in Launchpad. If you have any issues, check out the troubleshooting guide.
Then you need to submit to Ubuntu Software Center. Go to My Apps portal. You will need an account. If you don't have, create one. It's free. Then you will need to create a txt file like this:

http://developer.ubuntu.com/wp-content/uploads/2012/06/Ubuntu-App-Showdown-Participation-Details.txt

Then submit it to your application field. Then in the comment field later, you will have to submit your PPA location.

This is explained in Step 4 on the main Ubuntu App Showdown page.


Cannot sudoedit config file due to symbolic links linking to eachother

As per our discussion in the comments:

I think the file that you're actually looking to edit is /etc/mysql/conf.d/mysql.cnf

Cheers, Al


Building qBitorrent with qt5 fails (qt4 works)

Building qbittorrent against qt5 on Trusty Tahr requires some careful preparation. First create a build area:

mkdir -pv $HOME/Desktop/qbittorrent_build/{qbittorrent,libtorrent-rasterbar}

The download all of the required dependencies with this single command:

sudo apt-get install build-essential checkinstall libboost-dev \
     libboost-system-dev qtbase5-dev qttools5-dev-tools python \
     geoip-database libssl-dev libgeoip-dev pkg-config

Then compile and install the required newer version of libtorrent-rasterbar with the following single command (agreeing with all of the checkinstall defaults):

cd $HOME/Desktop/qbittorrent_build/libtorrent-rasterbar && \
wget https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_0_9/libtorrent-rasterbar-1.0.9.tar.gz && \
tar xvf libtorrent-rasterbar-1.0.9.tar.gz && \
cd libtorrent-rasterbar-1.0.9 && \
./configure --disable-debug --prefix=/usr --with-libgeoip=system && \
make && sudo checkinstall

Release Version qbittorrent:

If you wish to compile qbittorrent 'release' version 3.3.3 then use  the following single command (again agreeing with all of the checkinstall defaults):

cd $HOME/Desktop/qbittorrent_build/qbittorrent && \
wget http://downloads.sourceforge.net/qbittorrent/qbittorrent-3.3.3.tar.gz && \
tar xvf qbittorrent-3.3.3.tar.gz && cd qbittorrent-3.3.3 && \
./configure --prefix=/usr && make && \
sudo checkinstall

If you like then you can delete the folder $HOME/Desktop/qbittorrent_build although personally I would keep the files for further experimentation with the build.

Below is a screenshot of my own successful installation:

Development Version qbittorrent:

If however you would like to compile and install the development version of qbittorrent, currently 3.4.0alpha, then tun the following single command:

sudo apt-get install git && \
cd $HOME/Desktop/qbittorrent_build/qbittorrent && \
git clone https://github.com/qbittorrent/qBittorrent --depth 1 && \
cd qBittorrent && ./configure --prefix=/usr && make && \
sudo checkinstall --pkgversion 3.4.0alpha

And this will install 3.4.0alpha; remember if you wish to update your git clone in the future to manipulate the --pkgversion option of checkinstall so you can achieve incremental upgrades. Best using the date command...

Below is a screenshot of the alpha version in operation:

And remember to keep all of your torrenting legal :).


How can I add a picture as folder background in Ubuntu?

This function has been removed in the latest Nautilus that is part of Gnome3. This means that this is not at all possible with now, at least not by default, and I could not find any plugins that would make it possible otherwise.

The other, similar file managers like Marlin and Thunar do not have this function either. The KDE file manager, Dolphin, does not, to my knowledge, have this, or at least not by default.

Sorry, but it appears that none allow this right now.


To try a new prefix.

Open a terminal and type pwd you will get a line similar to this /home/username, take note of this.
Type sudo apt-get install winetricks to install Winetricks, we will need this tool later
Type WINEPREFIX=/home/YourUser/WoWPrefix winecfg to create a new prefix. Where it says YourUser you write the name we got at step 1.
Click Cancel to "Wine Mono Installer" and "Wine Gecko Installer". When the "Wine configuration" window appears set the Windows Version to Windows 7, then click OK.
Now, go to your file manager and copy the WoW installation folder to WoWPrefix/drive_c/Program Files/put it here. The WoW installation may be at .wine/drive_c/Program Files/Blizzard/World of Warcraft if you can't see the .wine folder inside your home folder, press Ctrl + H. Folders whose name begin with . are hidden.
You have WoW in a new prefix now! So lets follow the advice given at Wine HQ and install the required components:
WINEPREFIX=/home/YourUser/WoWPrefix winetricks corefonts
Open Wine Config again WINEPREFIX=/home/YourUser/WoWPrefix winecfg and navigate to the Libraries tab.
Copy and paste the following items in the "New override" camp one by one and click "Add": *msvcr90 d3dcompiler_46 dbghelp msvcp100
Select them and click Edit to set the values to each one to match the following list:

*msvcr90=native,builtin
d3dcompiler_46=disabled
dbghelp=native,builtin
msvcp100=native,builtin

Done, run it! WINEPREFIX=/home/YourUser/WoWPrefix wine 'WoWPrefix/drive_c/World of Warcraft/Wow.exe'


Remove Ubuntu 14.04 bootloader entry in Windows 8.1 Bootloader EFI Entry?

You need to remove the ubuntu folder in the efi partition.

And in UEFI remove the ubuntu entry.

sudo efibootmgr -v

The "-v" option displays all the entries so you can confirm you're deleting the right one, and then you use the combination of "-b ####" (to specify the entry) and "-B" (to delete it).

Examples #5 is delete which is deleting the entry  4 or 0004.

efibootmgr -b 4 -B

http://linux.dell.com/cgi-bin/gitweb/gitweb.cgi?p=efibootmgr.git;a=blob_plain;f=README;hb=HEAD

http://software.intel.com/en-us/articles/efi-shells-and-scripting/

Launch EFI Shell from File System Device

https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#UEFI_Shell


best practices to execute the almost the same command several times

It all depends on your requirements. But writing a script is rarely a bad idea, especially for repetitive tasks.

But between ; and &&, it is a completely different result.

; is a command separator
&& is a conditional operator (so is ||)

For example:

If you try the following command:

touch /var/no-permission; echo "It works!"

The first part of the line (before the semicolumn) will fail since you won't have access to create files in /var (as long as you aren't logged in as root of course). But you will see the line "t works! printed in your console because the semicolumn is just a separator and doesn't care if the previous command works or not.

However, if you try the following command:

touch /var/no-permission && echo "It works!"

This won't do anything so you won't see It works! in your console. Since the first command will fail, the && operator will not try to run the next command. (You can also use || instead of && to do its opposite. So the second command only runs when the first fails)

So if one of the commands fails, all the others should stop, then use &&. If they should continue, use ;.

Not: If you can write each command on a new line, it's as if you separate them by a semicolumn. For example,

touch /var/no-permission; echo "It works!"

Is the same as

touch /var/no-permission
echo "It works!"


Lenovo Yoga 3 14 Keyboard and mouse freezing

Maybe you can do something similar with Yoga

Lenovo Ideapad  320
Problem: Elan Touchpad (and a cursor, of course) randomly freezes, The system (ubuntu 18.04) needs to be rebooted.

My workaround solution (with modprobe) is:

to make 2 scripts- I named them touchactive.sh and touchactive2.sh
in /bin ( do it with sudo gedit...or something)

touchactive.sh (that contains this...)

#!/bin/bash
modprobe -r elan_i2c

(and...)

touchactive2.sh

#!/bin/bash
modprobe elan_i2c[/b]

then in terminal:  sudo visudo

you add these lines:

vader ALL=(ALL) NOPASSWD: /bin/touchactive.sh
vader ALL=(ALL) NOPASSWD: /bin/touchactive2.sh

vader is my user name, so you change it with yours...
 ..and save it

open system settings -> keyboard -> "+" -> and create shortcuts with keybinding:

name "Touchpad Elan Restart" 1 with keys Super+z
command: sudo /bin/touchactive.sh
and... "Touchpad Elan Restart 2" with keys Super+x
command: sudo /bin/touchactive2.sh

Restart computer

(this is my example you can choose different option and names)

so when all freezes, you can just use keys Super+z then Super+x and your touchpad / cursor restarts without rebooting the whole system.

This is my solution and some relief (not very elegant, though...) so I can work normally until release of a next kernel ( there is some hope...).


Ensure your computer is running the latest BIOS available. This is important because an out-of-date BIOS can have bugs, and those bugs sometimes affect things like UEFI, non-Windows operating systems, or other components.
★ Make sure your USB is bootable. Make a Pendrive Bootable

Condition 1:

If You selected Target System BIOS (or UEFI-CSM). (When Making USB Bootable.)

Change Your PC BIOS boot mode to UEFI.   Change Pc BIOS Boot Mode
Now, Retry to boot with USB.

Condition 2:

If You selected Target System MBR. (When Making USB Bootable.)

Change Your PC BIOS boot mode to Legacy.   Change Pc BIOS Boot Mode
Now, Retry to boot with USB.


mouse touch pad becomes unresponsive some times

try to install synaptics touch pad driver

sudo apt-get install xserver-xorg-input-synaptics


Ubuntu Server upgrade 14.04 to 16.04 (in a container) did not update Kernel

I'm at fault. The vserver is of course running in a container, which means that there is no way to access the kernel, since the kernel belongs to the container host.


16.04 - boot stops at "A start job is running for Hold until boot process finishes up(time/no limit)

I fixed it myself. This is what I did

From the GRUB menu , I selected recovery mode
At the recovery menu , I selected the 'networking' option, and then root shell.
I then typed

dpkg-reconfigure lightdm

At the prompt I selected 'lightdm'
And voila! Problem solved.


Hang with 5 Red Dots after installing AMD Propetiary Driver

It sounds like you have 1 or more conflicting drivers fighting each other.  You need to purge all old drivers from the system and install NEW driver using (Software & Updates) Additional drivers box.


Ubuntu 16.04 not detecting SATA drives on Integrated SAS Controller

The only solution I could find was to upgrade to Ubuntu 18.04. That solved the problem like a breeze.


root is full in ubuntu 18.04 after trying to increase swap area

Probably you also created a swap file in your root partition.

If that is the case you will need to make some room first, for example by doing an rm /var/cache/apt/archives/* (it's like apt-clean but simpler). If not even that will work, try to cd /var/cache/apt/archives/ then do ls and try to remove a couple of files individually, before you retry the rm /var/cache/apt/archives/*

Then, you have to remove the swap file (not partition). Try to find a huge file in your disk with something like:

$ sudo find / -type f -size +1G

If you find it, you remove it and you will reclaim the space. You might have to do a

$ swapoff -a

before you cat remove it.


Can't mount NTFS partition with write permissions

If the NTFS drives are mounting as read-only, its probably because Ubuntu thinks their filesystems are unclean, probably due to hibernation, or a damaged file system. Do this:
in Windows

boot into Windows
open the Power control panel
choose change what the power buttons do
choose change options that are unavailable
uncheck fast startup
close the Power control panel
open an administrative command prompt window
type powercfg /h off
type chkdsk /f c:
approve to run chkdsk at next reboot
type chkdsk /f x: (replacing "x" with drive letters of other visible NTFS partitions)
reboot into Windows to let chkdsk run on drive C:


How can I create a directory and change my working directory to the new directory?

If you really want it to be just one command, I suggest adding something like this to your .bashrc:

md () { mkdir -p "$@" && cd "$1"; }

Entering md foo on the command line will then create a directory called foo and cd into it immediately afterwards. Please keep in mind, that you will have to reload your .bashrc for the changes to take effect (i.e. open a new console, or run source ~/.bashrc).

Cf. http://www.commandlinefu.com/commands/view/3613/create-a-directory-and-change-into-it-at-the-same-time for possible alternatives, too.


Terminal - Cycle through possible options

So I saw this post to help with a similar concept that might answer your question, hopefully it works on your OS:

How to make terminal autocomplete when there are several files/directory?


Open a terminal running a command if a systemd service fails

Firstly, your service should be a user service instead. System services cannot open a terminal to do what you want. If it must be a system service, you'll need to create a method of sending yourself a notification when you log in to the system, so that you can perform the task and restart the service. As a user service though, it will run while you are logged in, and you can use the following method to pop a terminal up when you log in if the service fails to start.

Your service file should have PartOf=graphical-session.target in the [Unit] section of the service, and Restart=always in [Service] with your ExecStart= pointing to a shell script which runs

/home/adamfg/bin/unison default || gnome-terminal -e "bash -c 'genkey_command && exit 1'"

Or similar. This will cause your service to start when you log into the graphical session, and if it fails, open a terminal with genkey_command awaiting input, but will always exit 1, causing the service to restart after generating the new key.

You could also make the shell script more complex so it starts directly instead of relying on systemd service restarting, after generating the new key, and exits cleanly, instead.


Changes with xinput randomly revert back to default

This appears to be a bug (the fact that the touchscreen device randomly disconnects and reconnects as a new device, which has the side-effect of resetting all settings to default).

As a workaround, you can create your own udev rule (file name based on these suggestions by Daniel Drake) that will run a script that re-applies the xinput changes whenever the touchscreen reconnects:

sudo nano /etc/udev/rules.d/10-custom-elan.rules

and add this line which contains "idVendor" and "idProduct" information (from your syslog). The absolute path to "elan.sh" must be used.

ATTRS{idVendor}=="04f3", ATTRS{idProduct}=="2073", RUN+="/home/username/elan.sh"

(which roughly translates to ""when a device that matches the specified attributes is found, run the designated script").

Then create the actual script to run xinput:

nano /home/username/elan.sh

with the following lines:

#!/usr/bin/env bash

#These lines allow the script to be called by udev rules
export DISPLAY=":0"
export XAUTHORITY="/home/username/.Xauthority"

#Command to remap buttons
xinput set-button-map "ELAN Touchscreen Pen" 1 3 2 4 5

And of course make it executable:

chmod +x /home/username/elan.sh

Without the export lines, the script works when called by you (the active user) directly, but it doesn't work when called by udev (the root user). Details can be found in this and this answer, but here's a brief summary:

To launch a graphical program on a user's desktop, you need two things: the address (what display the user's desktop is on) and authorisation. When a user logs in, the login manager authorises a connection to the X server by generating a cookie, adding it to the server and passing it to the user by writing it to $HOME/.Xauthority. The root user should, then, be able to connect by knowing the display used by the user and by having access to the Xauthority cookie. This is what the export lines achieve.

Note: the fact that the display number is hardcoded might cause a problem under some circumstances, but in this usage scenario (single user of a personal laptop) it will probably be OK.


I think you are looking for the light-dm-webkit greeter. You can find packages here. The current version as of this writing is 0.1.2-0ubuntu2 and it appears it's available in the universe repository as well so you can install it through the software center:

You'll need it to develop a face browser theme to arrive at your desired solution but this should help you get started.


When using && and sudo on the first command, is the second command run as sudo too?

TL;DR: NO

The first command is

sudo some-command

The second command is

some-other-command

The command sudo takes the following command and executes it with elevated privileges. The &&, however, doesn't belong to a command and is interpreted by the shell, before executing the first command. It tells bash to first execute the first command, and on success the second one.

So the sudo doesn't know about the && some-other command. When the elevated process terminates, bash takes its return value, and then executes the other command, which again doesn't know of the first one.

This can be demonstrated easily:

$ sudo whoami && whoami
root
username

To reach what you want, you can start an elevated bash, and let it execute both commands:

$ sudo bash -c 'whoami && whoami'
root
root

So now, both commands are executed as root, as the whole process described above is executed in an elevated process, i.e. the bash session started with this command, which immediately exits after finishing. Still, the both whoamis don't know of each others existence.

This does not suit any purpose but for this demonstration, the easier way is to simply do

sudo some-command && sudo some-other-command


How to run a script after the system resumes from hibernate (suspent-to-disk)?

You can do this by creating a script in /etc/pm/sleep.d

sudo nano /etc/pm/sleep.d/99_hdparm_thaw

Use this as your base:

#!/bin/sh

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "${1}" in
        hibernate)
                # this is where you put something you want to run before hibernating
                ;;
        resume|thaw)
                # this is where you put something you want to run on resume/thaw
                ;;
esac

You will then need to make sure it is executable:

sudo chmod +x /etc/pm/sleep.d/99_hdparm_thaw

There are other scripts in that directory, which is where I came up with the base. You may be able to use those for ideas.

Also, those scripts are run in alphabetical order. This is why I chose to name it 99_hdparm_thaw, so it will be the last run script.


How can I record a video like output of top command for set time period?

The regular mode of operation of top is not suitable for saving the output in a file.

You can use the -b (batch) mode of top along with appropriate time interval for checking (-d) and the number of iterations for count (-n).

You can also mention specific PIDs (-p) to check only.

For example:

top -b -d 5 -n 3 -p 1089,2345 >output.txt

will run top in batch mode, will do 3 iterations after 5 seconds each, and will only monitor two mentioned PIDs (1089,2345). The output will be saved in output.txt.

Change the values to fit your need.


Why disk space is not released after deleting virtual disk

I wouldn't recommend a virtual disk of that size. Wubi installs sometimes get corrupted and you don't want to risk losing 165 GB of data. For the most part, data that size can be stored anywhere e.g. on the /host partition or another NTFS partition. Then if your Wubi install gets corrupted this important data is not lost.

But to get to your main problem. I think there are some issues with large file creation via Ubuntu. I have deleted a virtual disk before and found that Windows' chkdsk will later recover it (and move it to a \found.000 folder) - so whatever is doing the rm is doing something that Windows doesn't quite believe is complete.

What I would recommend in this case is to boot Windows, run a chkdsk /f and then make sure that the file hasn't been recovered. When it's done you should have your space back. Then I would do something other than creating a 165 GB virtual disk. (This is a single file that is larger than most hard disks were only 5 years or so ago).


Having a couple of these myself, unfortunately you either need to use Windows to write the firmware or you could try and reverse engineer the firmware yourself using Flashrom or similar to bitbang it.

You could also try and use the software through something like Virtualbox or WINE by doing a passthru of the USB drive, but with the extra layer the firmware reprogramming is much less likely to work.

Your best bet might be to make a temporary bootable Windows PE repair/recovery disk and put the software you linked on it to run against the USB (you'll need at least 2 USB ports on your system for this to work).


How can I publish a newsletter through the Ubuntu Software Center?

http://developer.ubuntu.com/publish/

This should get you going...


Upgraded from 10.04 to 12.04 and grub drops to BusyBox prompt without error

I finally found my answer not long after posting. This Ubuntu bug report suggested to remove the "quiet" and "splash" options from the boot arguments. I did and the error was made known:

Apparently the new kernel detects degraded software RAID volumes and will display a prompt with a 20 second timeout behind the splash screen. It's unfortunate it cannot be seen normally, and it looks like the problem has been reported (and fixed) in a past release. Also, the prompt did not accept my input. The default "N" response also didn't happen, since the RAID volumes actually do start (degraded).

If anyone is wondering, I was previously using software RAID with this system, but switched to a hardware RAID later and never went through the unnecessary risk of removing the software RAID from a working system.

Hopefully this info will help anyone else with a similar invisible boot problem.


How to undo: sudo chown -R username:username on home

I found a solution to the most troubling consequences.
Apache access problem solution (new files wasn't owned by the same group):

chgrp www-data ~/projects
chmod g+s ~/projects

Insufficient permission for .git/objects:

git config --global core.sharedRepository group


No sound notification in KDE Plasma Desktop

Starting Plasma 5.4 the new plasma-pa package was introduced to replace kmix.

Remove kmix, install plasma-pa and restart plasmashell to see changes:

sudo apt-get remove kmix
sudo apt-get install plasma-pa
killall plasmashell
plasmashell &


System services (including SSH) not starting after editing /etc/resolv.conf and rebooting

I managed to fix this. Turns out it wasn't the /etc/resolv.conf at all, it was my /etc/fstab. I had to remove a rogue partition and it all booted fine.


If your applications (Which can't add) installed using snap, you can use the following steps to solve the problem.

Copy the .desktop file into /usr/local/share/applications/ from /var/lib/snapd/desktop/applications/.
or make a link by using ln -s command.

For example:

sudo ln -s /var/lib/snapd/desktop/applications/postman_postman.desktop /usr/local/share/applications/postman.desktop

Add the application by Pin to Dock option.


I had the same problem and this commands worked for me.
Socket is enabled by default:

$ systemctl --user status pulseaudio.socket

If you want pulseaudio to start right after login:

$ systemctl --user enable pulseaudio

ArchLinux source


I could not find a solution for nano, but a workaround:

Use a shell function and test before opening, if the file is writable.

Open your .bashrc

nano ~/.bashrc

and add the code below

mynano() {
    if [ -w "$1" ]; then
            nano -t "$1"
    else
            echo "$1 isn't writable"
    fi
}

save the file and reload the configuration.

source ~/.bashrc

Example

$ ls -la foo
-rw-rw-r-- 1 root root 4 Sep 12 14:01 foo

$ whoami
notroot

$ mynano foo
foo isn't writable


Pop OS theme for Ubuntu 18.04 boot problem

Do not use the system76/pop theme on Ubuntu. It is designed for the Pop!_OS! Linux distribution, which while based on Ubuntu, isn't Ubuntu. The maintainers of the ppa added the following warning to the PPA home screen.

WARNING: This PPA is for Pop!_OS, and it may cause breakage on other Ubuntu-based OS's. Use of this repository on non-Pop_OS installations is at your own risk!


[Taken from comments:]

  Looks like you'll have to learn to edit xorg.conf. Lots of guides out there to assist you. https://wiki.ubuntu.com/X/Config/Resolution#statically_setup_in_xorg.conf