cannot install Ubuntu on Acer Aspire A515-54G Laptop, hard drive not detected

sadaharu-wakisaka found a solution:

  Enable windows safe mode.

    run msconfig -
    ctrl + r -> input : msconfig
    from boot top tab -> BOOT Options -> safe mode selection button -> network -> apply -> ok -> restart + shift...

      upon restart safe mode will be indicated by 'safe mode' displayed in four corners of screen.
      NOTE: my wifi didn't work in safe mode, and I had to plug in direct ethernet.

    Don't forget to undo this config when you are done with safe mode.

  On Restart hold shift + -> select reboot to enter UEFI/BIOS on reboot.
  In the Main Tab of the BIOS, hit CTRL + S to show hidden SATA MODE option, change sata mode to ahci and then save the change.
  Windows will install the ahci driver on safe boot.

  After ensuring the AHCI driver were up to date;

    device manager ->  IDE ATA/ATAPI -> SATA AHCI controller -> Right click on it and select Update Driver Software

  Removed the safe boot option from step 1.

  After changing to AHCI mode everything went very smoothly.


Grub halts on menu until enter is pressed

There appear to be some missing (") quotation marks in your /etc/default/grub. Here's a comparison of the same section of mine which works flawlessly.

GRUB_DEFAULT="0"
#GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="10"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

and yours which doesn't

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""


Open Terminal or CTRL+ALT+T

To install Unity
sudo apt-get install ubuntu-desktop unity

To Remove Gnome
sudo apt-get remove gnome-shell ubuntu-gnome-desktop

and reboot the system sudo reboot

If followed above 3 commands, you should be greeted with Unity session after reboot. In case it still doesn't comes up, open terminal and execute unity --replace

PS: by chance anything from gnome is left, follow https://askubuntu.com/a/244658/86467


Ubuntu 20.04 upgraded some network-manager packages, now problems are ensuing

In reviewing your paste, we see:
Cell 01 - Address: <MAC 'Mike L Network-5GHz' [AC1]>
                    Channel:44
                    Frequency:5.22 GHz (Channel 44)
                    Quality=48/70  Signal level=-62 dBm
                    Encryption key:on
                    ESSID:"Mike L Network-5GHz"
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=000000226e172381
                    Extra: Last beacon: 120ms ago
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK

Your router is set to channel 44 where there are also four other competing access points. Your wireless card also is capable of many other channels:
      Channel 36 : 5.18 GHz
      Channel 40 : 5.2 GHz
      Channel 44 : 5.22 GHz
      Channel 48 : 5.24 GHz
      Channel 52 : 5.26 GHz
      Channel 56 : 5.28 GHz
      Channel 60 : 5.3 GHz
      Channel 64 : 5.32 GHz
      Channel 100 : 5.5 GHz
      Channel 104 : 5.52 GHz
      Channel 108 : 5.54 GHz
      Channel 112 : 5.56 GHz
      Channel 116 : 5.58 GHz
      Channel 120 : 5.6 GHz
      Channel 124 : 5.62 GHz
      Channel 128 : 5.64 GHz
      Channel 132 : 5.66 GHz
      Channel 136 : 5.68 GHz
      Channel 140 : 5.7 GHz

I recommend that you set your router to another fixed channel, not autoselect, away from the already crowded channel 44.
Next, the name of the SSID is Mike L Network-5GHz. I have worked on several cases where spaces in the name interfered with solid, consistent connection. I suggest that you rename the router to MikeLNetwork5 or some such without any spaces. I'd similarly rename the 2.4 GHz segment, as well. After making these changes, reboot the router.
Next, I recommend that your regulatory domain be set explicitly. Check yours:
sudo iw reg get

If you get 00, that is a one-size-maybe-fits-all setting. Find yours here: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 Then set it temporarily:
sudo iw reg set IS

Of course, substitute your country code if not Iceland. Set it permanently:
sudo nano /etc/default/crda

Change the last line to read:
REGDOMAIN=IS

Proofread carefully, save and close the text editor.
Is there any improvement?


Directory creation using mkdir and touch

Using bash brace expansion to create the directory structure:
$ mkdir -p mydir/{colors/{basic,blanded},shape,animals/{mammals,reptiles}} && \
touch mydir/{colors/{basic/{red,blue,green},blanded/{yellow,orange,pink}},shape/{circle,square,cube},animals/{mammals/{platypus,bat,dog},reptiles/{snakes,crocodile,lizard}}}

You can examine the directory structure with the tree command.


Go to

System Settings > Workspace > Shortcuts > Global Keyboard shortcuts

In KDE component choose KWin and scroll down through
the list.
You will find the options Minimize Window, Maximize Window,Move Window and Show Desktop. Click in the Global-columne right to the desired action, a small menu pops up and you can enter the desired shortcut.


How to restore session / application indicator in Ubuntu 12.04?

Alt+right-click on the panel and select 'add to panel'. From there choose "indicator applet". Refer to the following figures:

Although on 12.04 I think this applet is called "indicator-applet-complete" or something similar.


retry download failed in mozilla firefox

First of all make a copy backup from your BT5R3-GNOME-32.iso.part file, next:
Rename your copied BT5R3-GNOME-32.iso.part file to BT5R3-GNOME-32.iso and switch to Downloads directory cd /home/ramvignesh/Downloads which is your downloaded BT5R3-GNOME-32.iso file (being renamed) is there, then try to resume it by the following wget command:
wget -c "http://ftp.cc.uoc.gr/mirrors/linux/backtrack/BT5R3-GNOME-32.iso"

or use below command directly after renaming it to BT5R3-GNOME-32.iso instead:
wget -c "http://ftp.cc.uoc.gr/mirrors/linux/backtrack/BT5R3-GNOME-32.iso" -O /home/ramvignesh/Downloads/BT5R3-GNOME-32.iso


When I have 6 GB of RAM installed, why is just 3 GB available on Ubuntu?

If you have the 32bit version installed then you either need to install the 64bit version or you can just install a PAE kernel that can access all your ram.  From terminal or ALT+F2 run sudo apt-get install linux-image-generic-pae linux-headers-generic-pae and reboot

You need a pae/64bit kernel to use more than 3.2gb as 32bit can not address more than that. It's a hardware limitation, not a linux one.


Borgmatic cron job errors with python `ModuleNotFoundError`

borgmatic author here. It looks like borgmatic is installed at the system level, and some of its dependencies are installed as your personal user. But the borgmatic cron job is running as root. That's the fundamental mismatch. So my recommendation would be to uninstall any borgmatic dependencies as your personal user, and reinstall them root as per the instructions here, with or without --user. Then, when you run the cron job as the root user, it should hopefully have everything in the right paths. If not, then you can try adding relevant paths to your PYTHONPATH as steeldriver suggests above. Potentially appending paths with PYTHONPATH=$PYTHONPATH:/new/path if necessary to avoid replacing existing paths.


USB hard disk and USB flash drive keep unmounting and remounting

It actually sounds more like an issue with your computer's hardware than an Ubuntu specific issue. Do you have issues with all USB devices, or is it just disk drives?

You could plug something in and use lsusb to check if the device is actually there and unmounted or if it's physically becoming disconnected due to some fault with the USB ports.

You could also try it in a different USB port. Sorry if this sounds obvious, but sometimes the simplest solutions are the best.


From man 2 open:

O_NOATIME (since Linux 2.6.8)
       Do  not update the file last access time (st_atime in the inode)
       when the file is read(2).  This flag  is  intended  for  use  by
       indexing  or  backup  programs,  where its use can significantly
       reduce the amount of disk activity.  This flag may not be effec‐
       tive  on  all filesystems.  One example is NFS, where the server
       maintains the access time.

So the flag makes no guarantees that it will be respected and is explicitly called out as only really being important for reducing disk activity.

Sounds like you will be fine for scenario 1 where you update it anyway.

As for scenario 2, you should still be fine.  Filesystems can be mounted with a noatime flag that prevents atime from being updated.  So user code cannot assume that it absolutely will be updated.


Installing Ubuntu 12.04 without installing Grub

Run the regular LiveCD and open a terminal. Run either ubiquity -b or ubiquity --no-bootloader.


This is a confirmed bug in the gvfs package:

https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/1451087

a workaround at this moment is to first kill both gvfs deamons before trying to mount.

To do so just execute the command:

killall gvfsd

from a terminal.

Now you can find your mountpoint again in:

  /run/user/XXXX/gvfs


How can I manually tell the system which USB device is a Bluetooth adapter?

The H600 headset may use bluetooth but the pairing is coded into the dongle and appears only as a H600 audio headset, the dongle itself does not appear as bluetooth in any OS I have used.  With you pairing the headset to the iPad it must erase the pairing to the dongle and this is an undocumented feature as I have this headset and nothing about pairing without the dongle is mentioned in the guides.  The only fix I can think of is to ask logitech for the source code for the pairing tool used in windows and see if it can be compiled in Ubuntu or see if they will release a pairing tool for linux.


Delete files in a directory older than 7 days, but always leave at least 20 files intact

Here is a simple script to do this:

#!/bin/bash

IMGSPATH="/path/to/somewhere"

# count of all files within your directory
count=$(find $IMGSPATH -type f | wc -l)

# remove the ones older than of 7 days
while [ "$count" -gt "20" ]
do
 find $IMGSPATH -type f -mtime +7 -print -delete -quit
 count=$((--count))
done

First we count all files within your desired directory.
While the number of files within that directory is greater than of "20",  then do:

Find the first file older than of "7" days.
Remove it
Decrease the count of available files
Do "#2" again ...

To test it:

mkdir /tmp/lab
cd /lab
touch {1..40}
touch -d "10 days ago" {1..20}

Save the script and run it for /tmp/lab now files 1 to 20 should be deleted, run:

touch -d "10 days ago" {21..35}

run the script again, nothing will get removed cause you don't have more than of 20 files whatever they're old or not.


Battery not detected - Yoga 300-11iBR - Ubuntu LTS 14.04

I have the same problem in Xubuntu 16.10 (I also tried Xubuntu 16.04 and confirm it is a problem there as well). There are suspicious messages from dmesg:

[    2.575759] ACPI Exception: AE_AML_PACKAGE_LIMIT, Index (0x000000010) is beyond end of object (length 0xD) (20160422/exoparg2-427)
[    2.575775] ACPI Error: Method parse/execution failed [\_SB.PCI0.LPCB.H_EC.BAT1._BIX] (Node f6091408), AE_AML_PACKAGE_LIMIT (20160422/psparse-542)
[    2.575794] ACPI Exception: AE_AML_PACKAGE_LIMIT, Evaluating _BIX (20160422/battery-450)

I have googled this extensively and I think a fix to the acpi driver might be necessary, e.g.:

http://www.spinics.net/lists/linux-acpi/msg69261.html

UPDATE I have confirmed that if you apply a patch similar to the one in the link above and build a custom kernel, the battery information is available! In my case I modified the patch a little bit to make sure the "_BIF" method is used and not the "_BIX" one. Hopefully this patch can eventually become part of an official kernel.


Gimp pencil tool is not working properly

Your picture is likely color-indexed (loaded a GIF?). In that mode, the color of a pixels is one of the 256 colors (max) in the color map, so Gimp coerces your color to the closest fit in the color map. Another restriction is that transparency is binary instead of being progressive.

You can convert the image to full RGB (Image>Mode>RGB) but if you export as GIF the restrictions will hit you again and will be applied on the fly on the saved picture so you may be even more disappointed by the result.

Or make sure that the Pencil tool is in Normal mode.


Transmission web client: strange charasters in file names

Fix /usr/share/transmission/web/javascript/file-row.js:

line 140:

name = name.replace(/([\/_\.])/g, "$1&#8203 ;"); (without space before ";")

replaced

name = name.replace(/([\/_\.])/g, "$1");

Next, clear browser cache.


When you first power it on and you hit F9 to select a boot device you don't see USB as an option? What do you see at that screen?

EDIT: Try switching on legacy boot and boot from USB then.


Find the user with this cronjob

Thats the output from a cron job. do:

sudo grep -R "/usr/local/vesta/bin/v-update-sys-queue backup" /etc/cron* /var/spool/cron/crontabs

that will show hopefully what cron job is causing the output you can then ever delete it or direct its output to /dev/null

Delete the cronjob

Okay now you know the user the cronjob is under you can remove it or silence it.

sudo crontab -u admin -e

then delete the line that contains /usr/local/vesta/bin/v-update-sys-queue backup this will stop the job happening this should not be a problem as you no longer use it.

Or Silence the cronjob

or you can silence the output by adding the redirect as below:

*/5 * * * * sudo /usr/local/vesta/bin/v-update-sys-queue backup > /dev/null 2>&1


What would have to happen when closing the EULA agreement in the terminal to install wine?

dpkg-reconfigure on your package should prompt you to accept the EULA agreement again.

sudo dpkg-reconfigure <your package>

Execute :

sudo dpkg-reconfigure wine


How to download a driver when you can't boot?

The first step should here should be restoring the default drivers so you can boot to the desktop. I would recommend you log into the root recovery console and then clean up using the method described here.

Once you're back on the standard drivers, you should be able to do whatever you like.


Encrypt custom eCryptfs folder on login/logout (with filename encryption) automatically

ecryptfs-setup-private can do all those things for you, in a private folder called ~/.Private that gets mounted as ~/Private just use it, and we can modify it's folder names below.

Or even encrypt your entire home folder with ecryptfs-migrate-home would be a good idea.

They'll both do exactly what you want, auto mounting on login & unmounting on logout. Why re-invent the wheel with your own potentially unsafe (password handling can be tricky) custom scripts? And unless you're using symbolic links, if you're copying files back & forth between plain folders and encrypted folders, you'll likely be leaving behind the unencrypted deleted files, just waiting to be read with an undelete or free space search command.

A solution is to use a ~/.Private underlying directory containing encrypted data (OR a link from ~/.Private to a different folder elsewhere), but change the mountpoint folder to a different one (thanks to Sebastian):

Run ecryptfs-setup-private then
Move/create a new mountpoint folder

mv ~/Private /path/to/new/folder

Change the contents of ~/.ecryptfs/Private.mnt (file containing path of the private directory mountpoint) to the new mountpoint folder

echo /path/to/new/folder > ~/.ecryptfs/Private.mnt

If the ~/.ecryptfs/auto-mount and ~/.ecryptfs/auto-umount files exist the folder will be automatically mounted/unmounted on login/logout.

For manual mounting/decrypting (password will be required), run ecryptfs-mount-private

For manual unmounting, run ecryptfs-umount-private


Hosting web server on internet using mobile hotspot

Well i have tried every possible way to do this. Spend more than 10 hours of my time just for this. Have searched all over the internet, every forum, every related page.
Answer is NO!. you cannot do it so do not waste you time again on this.
Either you need to get a Static IP router from an ISP or you can use tunnels like NGROK.
that would make your job done but little slow


You can open a shell terminal and use the command

sudo dpkg-reconfigure keyboard-configuration

From the man pages:

  dpkg-reconfigure reconfigures packages after they have already been installed. Pass it the
         names of a package or packages to reconfigure. It will ask configuration questions, much
         like when the package was first installed.


It's a little bit late, I know, but maybe it helps others :)

As I see freenas supports NFS, so mount it as an NFS drive! There are many descriptions how to do it, e.g. http://www.markinthedark.nl/news/ubuntu-linux-unix/85-howto-mount-synology-nas-ds211j-to-ubuntu.html.

Then all photo managers should see your NAS as a local folder. Shotwell does it for sure. However, you need to power up your NAS before starting Shotwell :)


Duplicate the displays

Sounds to me that when you launch a window, it is opening either on your main laptop display or on the TV. If you want to see exactly what you open up and have it display on both screen exactly, then go into your display settings:

Click on Built-in Display
Then to your right, tick off the box that says Mirror displays.
Finally, click the button that says Apply

This should end your confusion, as what you see on one display, you will see on both.

Here is a visual:

Note:

Your resolution will depend on how powerful your laptop graphics card is. So if your resolution looks funny, you can adjust in the same area, Display. The maximum resolution will depend on the quality of your graphics card.


I use FreeCAD, but mostly for part design. http://www.freecadweb.org/

Sweet Home 3D might also be useful to you. http://www.sweethome3d.com/index.jsp


How can I get rid of the 'wl_80211_attach Reg CFG80211 Phy' warning during boot?

Rather than the Broadcom STA driver, I think you will have much better luck with the native driver and its firmware. Please open a terminal and do:

sudo apt-get install firmware-b43-lpphy-installer
sudo apt-get remove --purge bcmwl-kernel-source
sudo modprobe -r wl
sudo modprobe b43

It may take a reboot. Does your wireless perform better now?


You should try the following:
According to the Launchpad's Help:

Launchpad satisfies your package's Build-Depends using:

the most recent versions of the packages in the PPA you're uploading to
all sections of the primary Ubuntu archive -- i.e. main, restricted, >- universe and multiverse
optionally: other PPAs in Launchpad.

Note: If you're already familiar with uploading to the Ubuntu primary archive, you should note that PPA builds do not have any build dependency restrictions, unlike a build in the primary Ubuntu archive. If you want to build the same package in the primary Ubuntu archive at a later point you may need to revise the package's component and/or pocket.
Depending on other PPAs
If you want Launchpad to satisfy your package dependencies using one or more other PPAs, follow the Edit dependencies link on your PPA or the team's overview page.

Hope will be helpful.


I ended up deleting the file and nothing seems to have broken.

~/.config/user is not a standard Ubuntu configuration file.

The most plausible cause for its existence is that I wanted to make a backup copy of ~/.config/dconf/user and then I forgot about it.


Xubuntu 16.04 - Move icons around the indicator

You mean these?:

NOTE: Before doing this, restart the Xfce panel with xfce4-panel --restart in a Terminal.

Here, I have a video that explains the process:

Or, text explanation:

Right click any indicator → Properties, which shall get you to this:

Where you can

hide indicators by the ticking the checkbox that says Hidden next to the indicator
move indicators by selecting one and clicking the up/down arrows next to them

Indicators scattered over the panel:

You can also have two or more Indicator Plugin areas, so that (for example) one area is in the middle showing the time, one at the end showing Network and Sound etc.

When moving a whole Indicator Plugin area, move them through the Normal panel items section listed above.


The counter is an integer, and at 4.6G it wraps around back to 0 (on 32 bit systems).  The wrap around point for 64 bit systems is much higher (you should never hit it, actually).

If you want to track usage, install vnstat (it's awesome).


Unable to install beautify plugin in Gimp 2.10.6

According to packages.ubuntu.com you need to install one package for libgimp/gimp.h:

sudo apt-get install libgimp2.0-dev

If this is not enough then enable Source Code repositories in Software & Updates (software-properties-gtk) and install build-dependencies of GIMP with:

sudo apt-get build-dep gimp

and then compile the plugin.


Ubuntu Installation on Dell Insipiron 14r

If you want to install Ubuntu on your system you dont have to worry about partitions of your hard disk. A very simple way to install ubuntu is given in following link. plese go through it and have your installation done

Install Ubuntu alongside Windows using "wubi"


How do adjust the launcher slide out time to be instant?

Install CompizConfig Settings
Manager.

sudo apt-get install compizconfig-settings-manager

Launch it by searching from the dash
in Unity, or Preferences >
CompizConfig Settings Manager in
Ubuntu Classic.
Navigate to Ubuntu Unity Plugin.

Click on the Experimental tab.

Adjust the Hide Animation to your
liking.

By design, there is a delay when the launcher slides out. You can always work-around this, by moving the cursor into the top-left corner of the screen instead.


graphic driver installions in HP pavilion g6 2236tx

Run this command in your Terminal:

  sudo apt-get update; sudo apt-get install fglrx-updates


why the used-space of "df -h" is larger than the result of "du -hs /"?

df and du measure two different things....

  du reports the space used by files and folders--even this is more than
  the file size. A few quick experiments on my system show that 4K is a
  minimum file size in terms of disk space.

  df reports the space used by the file system. This includes the
  overhead for journals and inode tables and such.

http://www.linuxquestions.org/questions/linux-general-1/du-vs-df-huge-difference%3B-disk-space-vanishing-539185/#post2678197


GUVCviewer - Light frequency filter set default value "50hz" not "NoFliker"

I had this same issue and solved it with the Video4Linux Control Panel in the Software Center. The changes persist between restarts, and everything 'just works' again.


You have to import the right key with the following commands:

wget http://download.opensuse.org/repositories/home:osmc/xUbuntu_14.04/Release.key
sudo apt-key add - < Release.key
sudo apt-get update

Why? That's why:

The output of dpkg -l | awk '/^ii/ {system("apt-cache policy " $2)}' tells us that the repository has one package installed in your system:

osmc-installer:
  Installed: 111
  Candidate: 111
  Version table:
 *** 111 0
        500 http://download.opensuse.org/repositories/home:/osmc/xUbuntu_14.04/  Packages
        100 /var/lib/dpkg/status

And here are the install instructions for OSMC installer and how to import the key.

If you don't need the OSMC installer, remove the package

sudo apt-get remove osmc-installer

find the repository

grep -r 'download.opensuse.org' /etc/apt

and remove the repository

sudo rm /etc/apt/sources.list.d/osmc-installer.list*


How to install studio 19.1o permanently from a Live session

This looks like a situation where you did not heed the warning in the release notes:

  A problem has been discovered with the package selection portion of
  the installer where if one package is unselected then all other
  packages within the same category (metapackage) get inadvertently
  uninstalled.

That is currently the only thing which can cause this issue. This issue has been fixed as of Ubuntu Studio 20.04 LTS.


I accidentally tried to remove all files from the root path

Hopefully you have a LiveUSB or LiveCD to boot from.  In the event that you did end up deleting enough to crash your system, you can boot to a Live media and select "Try Ubuntu".

There are some option to "undelete" files with programs like extundelete, photorec, foremost and scalpel.  But some of these can become a nightmare to use, especially if you're not even sure what got deleted.

Another option that I recommend is to reinstall, and preserve your /home directory.

Once booted to your Live media, you now have the opportunity to make a backup of your /home folder, provided it wasn't already deleted.  If you /home folder was deleted, you may want to consider using one of the above mentioned software if you feel that the files were really important.

Otherwise, go ahead and make a backup copy of your /home folder to another disk such as a USB stick, or another internal disk if you have one.

Use rsync to do this like so rsync -avz /home /location/of/where/youre/backing

Now in the Live session, there should be a shortcut on the launcher or the desktop called "Install Ubuntu".  If not, just reboot again to the Live media and select "Install Ubuntu".

In the installation portion, when you reach the partitioning page, click on "Something Else".  Here you will see your partitions.  Edit the one that had your Ubuntu installed to it, and set it as the same format as before (ext2/3 etc) and mount as root (/).  Ensure the checkbox to format is UNCHECKED!

Do the same thing with your SWAP partition.  If you had a your /home folder or any other folders mounted on other partitions, make sure you also select those to be remounted how they were before.  Again, with the format option unchecked.

Continue with the installation.  This installation will reinstall the entire OS, and will overwrite everything but it will NOT delete anything in your /home folder or anywhere else.  So all your files will still be there.  When you get to the last part of the installation to create a user, make sure you use the exact same username and same password.

Reboot and see if all your files and settings are there.  You may have to reinstall some programs, but you'll find that after you install the programs, all your settings will still be there.  Example is if you reinstall Chrome, your history, bookmarks etc will appear.

If you ARE missing files, boot back into the Live media, plug in or mount the drive where you made a backup of your home folder, mount your Ubuntu partition, and do rsync the other way around.

rsync -avz /location/of/your/backup/home /location/of/your/mounted/ubuntu

This should restore everything.


Can not make hibernate on UEFI (Secure boot)

Apparently hibernation is disabled by design with secure boot, since modifying the stored memory content is a potential attack vector.

There seem to exist some kernel patches, which implement signed hibernate images

https://lwn.net/Articles/651274/

but I don't know whether there exist any usable packaged kernels for Ubuntu, which include those.


Booting from a pendrive(USB) doesnt work !

I think you must modify how to start your computer: your hard disk dtive, your cd-dvd drive, your usb, and so on. Perhaps many computers allow to modify this list just pressing F2 at the moment of starting the machine.


How does Ubuntu's indexation work on a virtual machine?

The vast majority of programs make no distinction between running on a physical computer or a virtual machine. When a physical or virtual computer is powered off it is not powered on. It does not run programs. If the host is powered off then all virtual machines in it are also powered off. In particular, your reference points to the package locate, which includes two utilties: updatedb, which manages a database of file names and is typically run nightly by cron, and locate which uses that database to find files.

If you want your computer to run programs at night then you should keep it powered on during the night, obviously.

Read about cron and anacron and the difference between them to learn how to set up a job which runs periodically on a computer which is not powered on continuously.


Internal webcam not working on surface book 2 new ubuntu install

I bumped into your post facing the same issue.
After some research and testing I found this project addressing the many issues running Ubuntu on the Surface series:
EDITED: https://github.com/linux-surface/linux-surface/issues/91

Please note that Ubuntu does not allow unsigned kernels to be loaded. You can sign the kernel yourself, the instructions are in the corresponding read-me file.

Regarding your question about the webcam, it is not (yet) supported. I'd suggest to "watch" the project, so you will be notified when the webcam support will be released.


Ubuntu 16.04 boot as init=/root/init.sh and exec init 3 in shell, but why X11 started?

according to poettering's response to my issue at systemd: https://github.com/systemd/systemd/issues/10752

we generally read /proc/cmdline, not argv[], since the kernel removes some bits from the latter that we need to know. We essentially ignore argv[] altogether.
Hence, what you are trying to do doesn't work, you'd have to overmount /proc/cmdline instead with some file with the new arguments.

about 'overmount', according to https://unix.stackexchange.com/questions/364442/cant-mount-on-proc-cmdline/364448 ,

make a copy of /proc/cmdline at /root/cmdline
add 3 at the end of /root/cmdline
run command mount -n --bind -o ro /root/cmdline /proc/cmdline
run command exec init

now system will boot with runlevel 3.
In summary, change /root/init.sh to
#!/bin/bash
# do some task
cp /proc/cmdline /root/cmdline
sed -i.bck '$s/$/ 3/' /root/cmdline
mount -n --bind -o ro /root/cmdline /proc/cmdline
exec init

system will boot into text mode after custom job finish as I except.


Dual Booting Ubuntu 16.04 with Windows 10 - Ubuntu does not see my SSD

I experienced the same problem (on a Dell XPS 13). The issue for me was that the SATA bios setting was set to raid (which Ubuntu doesn't seem to recognize?).

The following link (second post/ first answer) explains how to change it to ahci:

http://www.eightforums.com/drivers-hardware/53429-migrating-raid-ssd-switching-ahci.html

(edit: You can ignore the unplugging of the disk in the fifth step and the seventh step completly, those are not needed to changing to ahci)

Just keep in mind to make some backups if you care about the data on your machine. Before finding the link above I did mess around a bit myself and got a few problems rebooting.

Besides that, this worked on my machine so no idea how it will fare on yours. You probably want to be extra careful if you actually have multiple disks or raid setup or something like that.

Hope this helps!


If you did not setup webmin with https you need to to connect using http://localhost:10000 instead of https://localhost:10000.

If webmin is not starting by default on your computer you need to create a script in your /etc/init.d with this content, call the script webmin

#!/bin/sh
# chkconfig: 235 99 10
# description: Start or stop the Webmin server
#
### BEGIN INIT INFO
# Provides: webmin
# Required-Start: $network $syslog
# Required-Stop: $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: Start or stop the Webmin server
### END INIT INFO

start=/etc/webmin/start
stop=/etc/webmin/stop
lockfile=/var/lock/subsys/webmin
confFile=/etc/webmin/miniserv.conf
pidFile=/var/webmin/miniserv.pid
name='Webmin'

case "$1" in
'start')
    $start >/dev/null 2>&1 </dev/null
    RETVAL=$?
    if [ "$RETVAL" = "0" ]; then
        touch $lockfile >/dev/null 2>&1
    fi
    ;;
'stop')
    $stop
    RETVAL=$?
    if [ "$RETVAL" = "0" ]; then
        rm -f $lockfile
    fi
    pidfile=`grep "^pidfile=" $confFile | sed -e 's/pidfile=//g'`
    if [ "$pidfile" = "" ]; then
        pidfile=$pidFile
    fi
    rm -f $pidfile
    ;;
'status')
    pidfile=`grep "^pidfile=" $confFile | sed -e 's/pidfile=//g'`
    if [ "$pidfile" = "" ]; then
        pidfile=$pidFile
    fi
    if [ -s $pidfile ]; then
        pid=`cat $pidfile`
        kill -0 $pid >/dev/null 2>&1
        if [ "$?" = "0" ]; then
            echo "$name (pid $pid) is running"
            RETVAL=0
        else
            echo "$name is stopped"
            RETVAL=1
        fi
    else
        echo "$name is stopped"
        RETVAL=1
    fi
    ;;
'restart')
    $stop ; $start
    RETVAL=$?
    ;;
*)
    echo "Usage: $0 { start | stop | restart }"
    RETVAL=1
    ;;
esac
exit $RETVAL

make this executable with sudo chmod 755 /etc/init.d/webmin and add it to the startup procedure with update-rc.d webmin defaults. After this webmin will start with your computer.

To avoid all these small things you can also download webmin as a debian package that you can install in your system.

Fist you need to remove the current webmin tar install

/etc/webmin/uninstall.sh

Then install all webmin dependencies

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

Download the latest deb file from here or use this command to download the current latest version (up to this date)

wget http://dfn.dl.sourceforge.net/project/webadmin/webmin/1.570/webmin_1.570_all.deb

After downloading the file you can install it with

sudo dpkg -i webmin_1.570_all.deb

webmin will install, configure all necessary scripts and be ready for you in https://localhost:10000 all the time so you can login with your username / password.


Installed from Live USB - but now 'no boot device available'

No better time than now to learn all of the power of Grub.

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

Specifically, this section:
https://help.ubuntu.com/community/Grub2#Command_Line_and_Rescue_Mode

It will at least let you see what Grub sees.


Edit /etc/network/interfaces and make sure it looks like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0

It sounds like it's blocking network-manager from configuring the interface.


It's a bug, which is reported on Launch Pad.

For the moment, it remains unclear what exactly is going on there, but from what Tony wrote on the launchpad page, it seems as though Kubuntu auto-generates two sessions per real user, of which only one gets removed when you kill the session.  This accounts for a gradually accumulation over time.


How to downgrade from ubuntu 15 to ubuntu 14 to escape systemd?

It's a risky thing to try a rollback, there's no easy way to downgrade.

Best option: After backing up your stuff, re-install the OS.

As user1362567 said on another question

"

First generate a list of what you have installed on your system. You can do this by typing the following in the terminal.

  sudo dpkg --get-selections | grep '[[:space:]]install$' | \awk '{print
  $1}' > package_list

copy your /home and /etc folder to a backup media.

Re-install the desired ubuntu version [Mentioned in the original thread : 10.04], and then run this command to install what you had before.

  cat package_list | xargs sudo apt-get install

Note that you might have to do some cleaning of the /etc and /home folder for incompatible settings.
"
I have to thank user1362567 for explaining it well.  Link to the original post : How to roll back Ubuntu to a previous version?


Switching displays while keeping windows in workspaces

Glad I'm not the only one being slowly driven insane by this!

Unfortunately, the only solution I've found is to switch away from Unity to Gnome Shell. The switch is painless, just run the the following command:

$ sudo apt-get install gnome-shell

When prompted during the installation, I'd recommend you stick with the current default login/display manager: lightdm.

And then log out. When logging in again, click the little icon next to the user's name to select the desktop environment. Select Gnome and log in as normal. Gnome Shell is pretty similar to Unity overall, and doesn't have this annoying bug. Hope it helps!


Enable Dolby 5.1 or at least subwoofer on Acer laptop?

use alsamixer but first, install the extra driver support:

sudo apt-get install alsa-firmware-loaders alsa-tools alsa-tools-gui

At this point, you may need to reboot.

Then, execute the following commands in an open terminal:

alsamixer

Then, press F6 use the arrow key to select your sound card and then press ENTER.

Next, press F5 and scroll to the right using the arrow keys until you get to Auto-Mute. Use the up arrow key to disable automute.

Finally, scroll to the subwoofer using the left or right arrow key and control the volume using the up and down arrow keys. Also, press the M key to mute or unmute each channel.


As of a long time, the Places list and Recents is hardcoded into Nautilus. There is nothing you can do about it at all.

You could theoretically modify the source code, but that is very problematic. You could theoretically use another file manager (Nemo seems good), but that seems to be your only choice if you do not want to modify source code. Or, you could just use Bookmarks like the rest of us.

If you want to try using the source code, tell me. I will post instructions here for your ease.


How do I fix Current Pending Sector Count

This is actually a long comment ;-)

IMO the filesystem should automatically take care of it in due course, especially since you have run the self test. As you can see it states remapping is done on the event of write failure so the next time it tries to attempt to write to it, it will get remapped.

Could you state the larger purpose behind doing this ? Apart from the concern on the blocks requiring remapping, is there any other annoyance / problem you are trying to solve by doing this ?

The tip in the ubuntuforums post you have quoted is safe so long as you know exactly which sector has gone bad and have a compelling reason to fix it. Typically the sector # is not reported even by file checking programs since it is abstracted and handled internally by the file system.

But if you must find the offending badblocks you can use the below steps :

Note the device file corresponding to file system. This is of the form /dev/hdc or /dev/sdb depending on the disk type. This is displayed in the Disk Utility (System -> Administration -> Disk Utility). If you click on the disk name in the list displayed in the left-side panel, the device name can be read against "Device :" on the right.
Unmount all the file-systems in that disk. The following command should return no output.

mount | grep -i <device-name>

Run the following command

badblocks -sv -b 512 <device-name>

Note The -b 512 is to align blocksize to 512 so you can use the number reported by this command as input to dd as explained in the forums post

I would not recommend all the above since it is anyway taken care of by the normal disk operations.


multiple workspace and desktop management on additional monitors

The most practical/easiest solution I can think of for that workflow is just right clicking the title bar of the window on the monitor you want "sticky" and choosing show on all desktops/workspaces.  I know you can do that in XFCE, not sure about gnome.

I used to have a workflow like that where a movie or audio playlist played on the third monitor and an IDE and app/webpage in question on the second monitor.  That's how I did it.


Setup ubuntu server on Raspberry Pi 4 without keyboard

The "ssh" file seems to work for me. I just installed the RPi 4 with ubuntu-server 19.10.1. Here are the full instructions for anbody who finds it:

After you have installed ubuntu-server to your SD-card, mount the first partition (usually /dev/mmcblk0p1) on the machine that you installed the SD-card with.

Next, create a file called "ssh" on the filesystem root (it does not have to have any content, as long as the file is there when the pi boots the first time, it will enable ssh).

You then should find the ip address of your pi using either the web-ui on your modem, or by running the following comand from a linux box with nmap installed:
nmap -p 22 / (e.g.: nmap -p 22 192.168.1.1/24)

Now you can ssh into the machine with the username "ubuntu" and password "ubuntu". It will then ask you to change the password and disconnect you. That's it, you should have a new password.


How to push branchs for different projects?

I guess it depends a bit on whether your changes need to be reviewed first before they are merged, and what sort of access you have.

If you do not have write access to the project branch, or if your changes need review before they end up in the mainly you should create a new single branch and request for that to be merged into the project branch.


I am new to Linux, and the fonts are huge

You can install gnome tweaks. In there there are some extra configuration options including fonts. You can change values for interface text, documents, etc. and scale it too.


Kill connected ovpn client from openvpn server

Do not waste time by reading the full answer. Just read cases in bold font.

To answer your question correctly:

I've installed openvpn server, configured it and generated certificates and keys
Installed docker, downloaded ubuntu-18.04 docker image and run it with --privileged option to be able to run openvpn
Ran openvpn in docker container openvpn client.ovpn being in /etc/openvpn/client folder, where client.ovpn config file, keys and certificates are located
Added management localhost 7505 line into /etc/openvpn/server/server.conf file
Restarted my openvpn server: sudo systemctl restart openvpn-server@server
Connected to openvpn server's management port using telnet: telnet localhost 7505
Ran the next commands to temporarily stop current openvpn connection:

The status command shows who is connected:

status

Output (shrank):

CLIENT_LIST,ubuntu,172.17.0.2:37372,10.8.0.6,,22078,142535,Tue Mar 31 17:22:32 2020,1585664552,UNDEF,0,0

The next command kills client by its openvpn client name (ubuntu in my case that is next to CLIENT_LIST)

kill ubuntu
SUCCESS: common name 'ubuntu' found, 1 client(s) killed

or (use identifiers next to UNDEF)

status
CLIENT_LIST,ubuntu,172.17.0.2:38653,10.8.0.6,,40110,45567,Tue Mar 31 17:36:22 2020,1585665382,UNDEF,1,0

client-kill 1 0 "temporary"
SUCCESS: client-kill command succeeded

But they kill openvpn session temporarily. Openvpn session auto refreshes after some time.
To disconnect openvpn user, use the next commands (2 0 are identifiers that located next to UNDEF word):

status
CLIENT_LIST,ubuntu,172.17.0.2:45455,10.8.0.6,,4632,7272,Tue Mar 31 18:24:03 2020,1585668243,UNDEF,2,0

client-deny 2 0 "denying"
SUCCESS: client-deny command succeeded

My /etc/openvpn/server/server.conf:

$ cat /etc/openvpn/server/server.conf | grep -v '#' | grep -v ';' | grep -v '^[[:space:]]*$'
management localhost 7505
port 1194
proto udp
dev tun
ca ca.crt
cert serv.crt
dh dh.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
cipher AES-256-CBC
auth SHA256
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
verb 3
explicit-exit-notify 1

My client.ovpn conf:

$ cat /etc/openvpn/client/client.ovpn | grep -v '#' | grep -v ';' | grep -v '^[[:space:]]*$'
client
dev tun
proto udp
remote 172.17.0.1 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
key-direction 1
remote-cert-tls server
tls-client
tls-auth ta.key 1
cipher AES-256-CBC
auth SHA256
verb 0


Couldn't Connect to Mysql and Mysqli in My Localhost

My apologies. Turn out that I was editing at the old lampp directory which is /opt/lampp/htdocs. I supposed to clear my notepadqq and open based on new directory which is /var/www/html. My bad and my mistake. Everything is fine now. Hopefully anyone encounter this kind of issue please do check your directory of files that you do editing.

thanks


Nowadays, as of 14.04 --  redshift is in the repos by default:

sudo apt-get install redshift redshift-gtk


Yes, Teamviewer is a cross platform Remote Desktop solution, and is free (as in beer, not as in speech) for personal usage.


Find and execute multiple scripts in parallel

Inspired by choroba's answer:

find . -iname '*run.sh' -printf 'cd %h; ./%f\0' | xargs -L1 -0 -P0 bash -c

You can use -printf to build the command line. %h is the directory where the file is located, and %f is the name of the file without the path (the basename). The -P option enables parallelism in xargs, and -L1 -0 makes it use one null-terminated line of input per command.


Making the MainView fill screen on device

In non-windowed mode, meaning on a tablet or phone, the app will take up the full size of the screen, being anchored to the sides and the bottom of the top bar.

The width and height are only used by qmlscene on the desktop, meaning that is the size it will appear when run on the desktop. It should not affect the size of the app when run on a tablet or phone.

You can think of it as clicking Maximize when running on a desktop; even though you've set the size, the app can still be maximized.


apport-retrace fails with error: report file does not contain one of the required fields

This is not the answer to the OP's question. He already figured out that if you know the package name you can simply add it see

https://stackoverflow.com/questions/29571866/use-apport-crash-dump-to-debug-python-program

In my /var/crash directory I found a _usr_bin_gconftool-2.0.crash crash file and wanted to find out more details with:

 apport-retrace -g _usr_bin_gconftool-2.0.crash

I got the error message:

ERROR: report file does not contain one of the required fields: CoreDump DistroRelease Package ExecutablePath

Since searching the web pointed me to this question I got all confused about the long discussion which distracted me from the simple solution.

Just adding

Package: gconftool-2

at the start of the file allowed me to get:

...
Core was generated by `gconftool-2 --get /desktop/gnome/interface/accessibility'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f5032236428 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:54
54  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Please do not downvote this answer only since it is not a about the original questions. This is specifically for people who got here with the "normal" problem of having a crash dump from a standard package where the package name is simply missing.


Script for merging files in multiple nested directories by symbolic link

I think the following shellscript will do what you want

The original folders are in main
There can be subfolders in several levels
The merged folder is links
run the main shellscript script in the directory containing main and links

script

#!/bin/bash

mkdir -p links

find main -type d -exec bash -c \
'for pathname do
  #echo "------------------------------${pathname} ${pathname#*/*/}"
  if [ "${pathname/*\/*\/}" != "${pathname}" ]
  then
   mkdir -p "links/${pathname#*/*/}"
  fi
 done' bash {} +

find main -type f -exec bash -c \
'curdir=$(pwd)
for pathname do
  tpat=${pathname/main\/}
  ln -s "${curdir}/${pathname}" "links/${tpat#*/}" 2> /dev/null;
 done' bash {} +

find links -type l -exec bash -c \
'for pathname do
  LANG=C
  file "$pathname"|grep -o  "$pathname: broken symbolic link" > /dev/null; \
  if [ $? -eq 0 ];then rm "$pathname";fi
 done' \
 bash {} +

Demo

$ \rm -r links

$ find main
main
main/f 4
main/f 4/s 4
main/f 4/s 4/k 4
main/asdf
main/f2
main/f2/s3
main/f2/s3/h
main/f2/s3/g
main/f2/s3/ss
main/f2/s3/ss/i
main/f2/s1
main/f2/s1/c
main/f2/s1/d
main/j
main/f1
main/f1/s2
main/f1/s2/x y
main/f1/s2/f
main/f1/s2/e
main/f1/s1
main/f1/s1/a
main/f1/s1/b

$ ./script  # doing it

$ find links/ -type l -exec file {} \;
links/s2/x y: symbolic link to /media/multimed-2/test/test0/matohak/main/f1/s2/x y
links/s2/f: symbolic link to /media/multimed-2/test/test0/matohak/main/f1/s2/f
links/s2/e: symbolic link to /media/multimed-2/test/test0/matohak/main/f1/s2/e
links/s3/h: symbolic link to /media/multimed-2/test/test0/matohak/main/f2/s3/h
links/s3/g: symbolic link to /media/multimed-2/test/test0/matohak/main/f2/s3/g
links/s3/ss/i: symbolic link to /media/multimed-2/test/test0/matohak/main/f2/s3/ss/i
links/s 4/k 4: symbolic link to /media/multimed-2/test/test0/matohak/main/f 4/s 4/k 4
links/asdf: symbolic link to /media/multimed-2/test/test0/matohak/main/asdf
links/s1/a: symbolic link to /media/multimed-2/test/test0/matohak/main/f1/s1/a
links/s1/c: symbolic link to /media/multimed-2/test/test0/matohak/main/f2/s1/c
links/s1/b: symbolic link to /media/multimed-2/test/test0/matohak/main/f1/s1/b
links/s1/d: symbolic link to /media/multimed-2/test/test0/matohak/main/f2/s1/d
links/j: symbolic link to /media/multimed-2/test/test0/matohak/main/j

$ ln -s main/asdf links/asdf-b  # create a broken link

$ find links/ -type l -name "asdf*" -exec file {} \;
links/asdf-b: broken symbolic link to main/asdf
links/asdf: symbolic link to /media/multimed-2/test/test0/matohak/main/asdf

$ ./script  # this time only to remove the broken link

$ find links/ -type l -name "asdf*" -exec file {} \;
links/asdf: symbolic link to /media/multimed-2/test/test0/matohak/main/asdf
$

A case that would allow you to specify which folder under main/* to merge

#!/bin/bash
# First argument is target, following arbitrary number of target folders
# eg. ./script.sh links main/f1 main/f2 main/f3

argc=$#
argv=($@)

mkdir -p ${argv[0]}

for (( j=1; j<argc; j++ )); do

    find ${argv[j]} -type d -exec bash -c \
    'for pathname do
      #echo "------------------------------${pathname} ${pathname#*/*/}"
      if [ "${pathname/*\/*\/}" != "${pathname}" ]
      then
       mkdir -p "'${argv[0]}'/${pathname#*/*/}"
      fi
     done' bash {} +

    find ${argv[j]} -type f -exec bash -c \
    'curdir=$(pwd)
    for pathname do
      tpat=${pathname/${argv[j]}\/}
      ln -s "${curdir}/${pathname}" "'${argv[0]}'/${tpat#*/}" 2> /dev/null;
     done' bash {} +

    find ${argv[0]} -type l -exec bash -c \
    'for pathname do
      LANG=C
      file "$pathname"|grep -o  "$pathname: broken symbolic link" > /dev/null; \
      if [ $? -eq 0 ];then rm "$pathname";fi
     done' \
     bash {} +

    find ${argv[0]} -type d -empty -delete  # Removes empty dir in target

done


Try:

cd /home/MYUSERNAME/Programas_descargados

or

cd ~/Programas_descargados

The problem is you forgot to specify that you're in a subdirectory of your home directory.

Hope this helps!


Disable repeated key presses for media keys

Possibilities to customize Delay and Speed for individual keys only, if at all possible, are not exposed to the user. General settings for Keyboard Delay and Speed, however, can be found under "Universal Access" in "Settings". Click "Repeat Keys". A dialog will appear allowing you to tweak "Delay" (i.e., for how long do you need to hold the key before it starts repeating) and Speed (i.e., how fast will the key repeat).

The default for "Delay" is 500 ms, i.e. half a second. For a non-disabled person, this is plenty of time to press and release a Pause key without triggering repeats. Yours has probably been set to a very low value at some time. If, however, an ability problem is involved where the default time does not work, then try to increase the Delay value, or turn it off altogether.


Headphones automatically mute when plugged

Edit this file:

/usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf

Comment this 2 lines just putting a ; in front of the lines

[Element Speaker]
; switch = off
; volume = off

Restart pulseaudio:

killall pulseaudio
pulseaudio --start


You can do keep the D: partition. Here's how it works:

Select "Something Else" when being prompted to choose whether to remove Windows, to set up a dual boot or -  something else
Remove your Windows partition (it's probably /dev/sda1, but check first)
Create a new partition (preferrable EXT4)on the new empty space. Leave a empty area which as much space as you have RAM. (If you want SWAP)
Set the mount point of the created partition to /. This will be the partition where Ubuntu will get installed.
Create a new SWAP partition in the empty space as big as your RAM. (optional, but recommended)
Make sure the device for bootloader installation (bottom) is the same as you where you created the partitions (should be /dev/sda)
Click Install now

However, you should always make a backup of your files before installing new systems or formatting/partitioning a harddisk. Things can always go wrong.

And please notice that you won't be able to execute any scripts or programs from a NTFS partition, for it doesn't support Linux' file permissions.


Unable to connect the internet with Ralink RT2870 USB ABGN WLAN Card

This... "feature" was introduced in 17.04, somewhere around kernel version 4.10, I believe.

Try if this works for you:

Edit /etc/NetworkManager/NetworkManager.conf

And add lines:

[device]
wifi.scan-rand-mac-address=no

Then restart network-manager:

sudo service network-manager restart


so i had erorr in dell inspiron 7559 too. You can fix it:
1. boot = USB (with UEFI) and push button 'e' on your keyboard
2. find line "quiet flash" and replace as "nomodeset=0" (or "nvidia.nomodeset=0" if your graphic card is NDIVIA)
3. Press F10 and boot. Finish
good luck!


Automatically deactive the internet at 9pm, but make it hard to activate it again

How about Pluckeye?

It is an Internet content filter. Its basic functionality is to block all images and videos to avoid distractions. It uses the exact same delay system you are mentioning, meaning any changes to the configuration you make are applied after the previously set delay time.

It has CLI and from what I know you can use it to control access to the internet connection.

From their FAQ:
How can I completely cut off Internet access at night?


Many new folders in home directory after open jdk installation

They are hidden folders. Don't remove them - just press Ctrl+H to hide them again.


Remove shutdown-restart-logout-suspend prompt in greeter login screen Ubuntu 14.04 and 16.04

So i found the solution to this, was to add

"/sbin/shutdown -h now"  at the very beginning of this script:
/etc/acpi/powerbtn.sh

now no matter if the screen is locked or not yet logged in, as soon as an acpipowerbutton command is sent, or the power button of the pc is pressed, no confirmation dialogs anymore, just straight forward shutdown. finally!

References: How to enable the pc power button at the lock screen?


How do I install python in wine? I keep getting an error

actually You can use the latest python3.7 / python2.7 on wine:

basically all You need is to install python on a windows machine (for "current user" , not for "All Users"), and copy the whole directory to the wine machine.

Alternatively You can download it from Python releases download pages

Then add following paths in the wine registry : "c:\python37;C:\python37\Scripts;..."  and everything works fine.

I provided some convenient Scripts on Github to do that automatically for Ubuntu.
I would recommend to use those, because they are maintained and updated.
Since Links can change, find the current install script below.

However, You need to decide first if You want to Install WINE STABLE, WINE DEVELOP or WINE STAGING (I suggest WINE DEVELOP).

Then You need to decide which Architecture (32 Bit or 64 Bit Wine)
and then, on top of that You can install 32 or 64 Bit Python 2.7 or Python 3.7
by copying as explained before.

the whole process is a bit lengthy and there are many details You need to install, here the scripts (You need to download all of them and save them in the desired paths, because they depend on each other) :

#!/bin/bash
# ../home/install_wine.sh

function include_dependencies {
    local my_dir="$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"  # this gives the full path, even for sourced scripts
    chmod +x "${my_dir}/lib_bash/*.sh"
    source "${my_dir}/lib_bash/lib_color.sh"
    source "${my_dir}/lib_bash/lib_retry.sh"
    source "${my_dir}/lib_bash/lib_wine_install.sh"
}

include_dependencies  # me need to do that via a function to have local scope of my_dir

clr_bold clr_green "Install WINE"
check_wine_version

clr_green "add 386 Architecture"
retry sudo dpkg --add-architecture i386
clr_green "add Wine Keys"
retry wget https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'
clr_green "Wine Packages Update"
retry sudo apt-get update
clr_green "Wine Packages Install"
retry sudo apt-get install --install-recommends winehq-${wine_version}
retry sudo apt-get install -y cabextract
retry sudo apt-get install -y libxml2
retry sudo apt-get install -y libpng-dev

clr_green "Install latest Winetricks"
sudo rm -f /usr/bin/winetricks
retry sudo wget --directory-prefix=/usr/bin/ https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
sudo chmod +x /usr/bin/winetricks
retry sudo winetricks -q --self-update
clr_green "Install latest Winetricks - done"

clr_green "done"
clr_green "******************************************************************************************************************"
clr_bold clr_green "FINISHED installing WINE and WINETRICKS"
clr_green "******************************************************************************************************************"

#!/bin/bash
# ../home/install_wine_machine.sh

function include_dependencies {
    local my_dir="$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"  # this gives the full path, even for sourced scripts
    chmod +x "${my_dir}/lib_bash/*.sh"
    source "${my_dir}/lib_bash/lib_color.sh"
    source "${my_dir}/lib_bash/lib_retry.sh"
    source "${my_dir}/lib_bash/lib_wine_install.sh"
}

include_dependencies  # me need to do that via a function to have local scope of my_dir

clr_bold clr_green "Install Wine Machine"
check_wine_prefix
check_wine_arch
check_wine_windows_version
check_headless_xvfb

clr_green "Setup Wine Machine at ${WINEPREFIX}, WINEARCH=${WINEARCH}, wine_windows_version=${wine_windows_version}"
mkdir -p ${WINEPREFIX}
wine_drive_c_dir=${WINEPREFIX}/drive_c
# xvfb-run --auto-servernum winecfg # fails marshal_object couldnt get IPSFactory buffer for interface ...

if [[ ${xvfb_framebuffer_service_active} == "True" ]]; then sudo service xvfb stop ; fi   # winecfg fails if xvfb server is running
winecfg
if [[ ${xvfb_framebuffer_service_active} == "True" ]]; then sudo service xvfb start ; fi     # winecfg fails if xvfb server is running

echo "Disable GUI Crash Dialogs"
winetricks nocrashdialog

echo "Set Windows Version to ${wine_windows_version}"
winetricks -q ${wine_windows_version}

echo "Install common Packets"

retry winetricks -q windowscodecs
retry winetricks -q msxml3

clr_green "done"
clr_green "******************************************************************************************************************"
clr_bold clr_green "FINISHED installing Wine Machine ${WINEPREFIX}"
clr_green "******************************************************************************************************************"

#!/bin/bash
# ../home/install_wine_python2_preinstalled.sh

function include_dependencies {
    local my_dir="$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"  # this gives the full path, even for sourced scripts
    chmod +x "${my_dir}/lib_bash/*.sh"
    source "${my_dir}/lib_bash/lib_color.sh"
    source "${my_dir}/lib_bash/lib_retry.sh"
    source "${my_dir}/lib_bash/lib_wine_install.sh"
}

include_dependencies  # me need to do that via a function to have local scope of my_dir

# if used outside github/travis You need to set :
# WINEARCH=win32    for 32 Bit Wine
# WINEARCH=         for 64 Bit Wine
# WINEPREFIX defaults to ${HOME}/.wine   or you need to pass it via environment variable
# if running headless, the xvfb service needs to run

clr_bold clr_green "Install Python 2.7 on WINE"
check_wine_prefix
check_wine_arch

wine_drive_c_dir=${WINEPREFIX}/drive_c
decompress_dir=${HOME}/bitranox_decompress
mkdir -p ${decompress_dir}

python_version_short=python27
python_version_doc="Python 2.7"

clr_green "Download ${python_version_doc} Binaries from https://github.com/bitranox/binaries_${python_version_short}_wine/archive/master.zip"
retry wget -nc --no-check-certificate -O ${decompress_dir}/binaries_${python_version_short}_wine-master.zip https://github.com/bitranox/binaries_${python_version_short}_wine/archive/master.zip

clr_green "Unzip ${python_version_doc} Master to ${HOME}"
unzip -nqq ${decompress_dir}/binaries_${python_version_short}_wine-master.zip -d ${decompress_dir}

if [[ "${WINEARCH}" == "win32" ]]
    then
        clr_green "Joining Multipart Zip in ${decompress_dir}/binaries_${python_version_short}_wine-master/bin"
        cat ${decompress_dir}/binaries_${python_version_short}_wine-master/bin/python*_wine_32* > ${decompress_dir}/binaries_${python_version_short}_wine-master/bin/joined_${python_version_short}.zip
        add_pythonpath="c:/Python27-32;c:/Python27-32/Scripts"
    else
        clr_green "Joining Multipart Zip in ${decompress_dir}/binaries_${python_version_short}_wine-master/bin"
        cat ${decompress_dir}/binaries_${python_version_short}_wine-master/bin/python*_wine_64* > ${decompress_dir}/binaries_${python_version_short}_wine-master/bin/joined_${python_version_short}.zip
        add_pythonpath="c:/Python27-64;c:/Python27-64/Scripts"
    fi

clr_green "Unzip ${python_version_doc} to ${wine_drive_c_dir}"
unzip -qq ${decompress_dir}/binaries_${python_version_short}_wine-master/bin/joined_${python_version_short}.zip -d ${wine_drive_c_dir}

prepend_path_to_wine_registry ${add_pythonpath}

clr_green "done"
clr_green "******************************************************************************************************************"
clr_bold clr_green "FINISHED installing Python 2.7 on Wine Machine ${WINEPREFIX}"
clr_green "******************************************************************************************************************"

#!/bin/bash
# ../home/install_wine_python3_preinstalled.sh

function include_dependencies {
    local my_dir="$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"  # this gives the full path, even for sourced scripts
    chmod +x "${my_dir}/lib_bash/*.sh"
    source "${my_dir}/lib_bash/lib_color.sh"
    source "${my_dir}/lib_bash/lib_retry.sh"
    source "${my_dir}/lib_bash/lib_wine_install.sh"
}

include_dependencies  # me need to do that via a function to have local scope of my_dir

# if used outside github/travis You need to set :
# WINEARCH=win32    for 32 Bit Wine
# WINEARCH=""       for 64 Bit Wine
# WINEPREFIX defaults to ${HOME}/.wine   or you need to pass it via environment variable

# if running headless, the xvfb service needs to run

clr_bold clr_green "Install Python 3.7 on WINE"
check_wine_prefix
check_wine_arch

wine_drive_c_dir=${WINEPREFIX}/drive_c
decompress_dir=${HOME}/bitranox_decompress
mkdir -p ${decompress_dir}

python_version_short=python37
python_version_doc="Python 3.7"

clr_green "Download ${python_version_doc} Binaries from https://github.com/bitranox/binaries_${python_version_short}_wine/archive/master.zip"
retry wget -nc --no-check-certificate -O ${decompress_dir}/binaries_${python_version_short}_wine-master.zip https://github.com/bitranox/binaries_${python_version_short}_wine/archive/master.zip

clr_green "Unzip ${python_version_doc} Master to ${HOME}"
unzip -nqq ${decompress_dir}/binaries_${python_version_short}_wine-master.zip -d ${decompress_dir}

if [[ "${WINEARCH}" == "win32" ]]
    then
        clr_green "Joining Multipart Zip in ${decompress_dir}/binaries_${python_version_short}_wine-master/bin"
        cat ${decompress_dir}/binaries_${python_version_short}_wine-master/bin/python*_wine_32* > ${decompress_dir}/binaries_${python_version_short}_wine-master/bin/joined_${python_version_short}.zip
        add_pythonpath="c:/Python37-32;c:/Python37-32/Scripts"
    else
        clr_green "Joining Multipart Zip in ${decompress_dir}/binaries_${python_version_short}_wine-master/bin"
        cat ${decompress_dir}/binaries_${python_version_short}_wine-master/bin/python*_wine_64* > ${decompress_dir}/binaries_${python_version_short}_wine-master/bin/joined_${python_version_short}.zip
        add_pythonpath="c:/Python37-64;c:/Python37-64/Scripts"
    fi

clr_green "Unzip ${python_version_doc} to ${wine_drive_c_dir}"
unzip -qq ${decompress_dir}/binaries_${python_version_short}_wine-master/bin/joined_${python_version_short}.zip -d ${wine_drive_c_dir}

prepend_path_to_wine_registry ${add_pythonpath}

clr_green "done"
clr_green "******************************************************************************************************************"
clr_bold clr_green "FINISHED installing Python 3.7 on Wine Machine ${WINEPREFIX}"
clr_green "******************************************************************************************************************"

#!/bin/bash
# ../home/install_wine_git_portable.sh

function include_dependencies {
    local my_dir="$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"  # this gives the full path, even for sourced scripts
    chmod +x "${my_dir}/lib_bash/*.sh"
    source "${my_dir}/lib_bash/lib_color.sh"
    source "${my_dir}/lib_bash/lib_retry.sh"
    source "${my_dir}/lib_bash/lib_wine_install.sh"
}

include_dependencies  # me need to do that via a function to have local scope of my_dir

# if used outside github/travis You need to set :
# WINEARCH=win32    for 32 Bit Wine
# WINEARCH=         for 64 Bit Wine
# WINEPREFIX defaults to ${HOME}/.wine   or you need to pass it via environment variable

# if running headless, the xvfb service needs to run

clr_bold clr_green "Install Git Portable"
check_wine_prefix
check_wine_arch

wine_drive_c_dir=${WINEPREFIX}/drive_c
decompress_dir=${HOME}/bitranox_decompress
mkdir -p ${decompress_dir}

clr_green "Download Git Portable Binaries"
retry wget -nc --no-check-certificate -O ${decompress_dir}/binaries_portable_git-master.zip https://github.com/bitranox/binaries_portable_git/archive/master.zip

clr_green "Unzip Git Portable Binaries Master to ${decompress_dir}"
unzip -nqq ${decompress_dir}/binaries_portable_git-master.zip -d ${decompress_dir}

if [[ "${WINEARCH}" == "win32" ]]
    then
        clr_green "Joining Multipart Zip in ${decompress_dir}/binaries_portable_git-master/bin"
        cat ${decompress_dir}/binaries_portable_git-master/bin/PortableGit32* > ${decompress_dir}/binaries_portable_git-master/bin/joined_PortableGit.zip
        add_git_path="c:/PortableGit32/cmd"
    else
        clr_green "Joining Multipart Zip in ${decompress_dir}/binaries_portable_git-master/bin"
        cat ${decompress_dir}/binaries_portable_git-master/bin/PortableGit64* > ${decompress_dir}/binaries_portable_git-master/bin/joined_PortableGit.zip
        add_git_path="c:/PortableGit64/cmd"
    fi

clr_green "Unzip Git Portable Binaries to ${wine_drive_c_dir}"
unzip -qq ${decompress_dir}/binaries_portable_git-master/bin/joined_PortableGit.zip -d ${wine_drive_c_dir}

prepend_path_to_wine_registry ${add_git_path}

clr_green "done"
clr_green "******************************************************************************************************************"
clr_bold clr_green "FINISHED installing Git Portable on Wine Machine ${WINEPREFIX}"
clr_green "******************************************************************************************************************"

#!/bin/bash
# ../home/lib_bash/lib_color.sh
#
# Constants and functions for terminal colors.
# Author: Max Tsepkov <max@yogi.pw>
# Manual see https://github.com/mercuriev/bash_colors
#

CLR_ESC="\033["

# All these variables has a function with the same name, but in lower case.
#
CLR_RESET=0             # reset all attributes to their defaults
CLR_RESET_UNDERLINE=24  # underline off
CLR_RESET_REVERSE=27    # reverse off
CLR_DEFAULT=39          # set underscore off, set default foreground color
CLR_DEFAULTB=49         # set default background color

CLR_BOLD=1              # set bold
CLR_BRIGHT=2            # set half-bright (simulated with color on a color display)
CLR_UNDERSCORE=4        # set underscore (simulated with color on a color display)
CLR_REVERSE=7           # set reverse video

CLR_BLACK=30            # set black foreground
CLR_RED=31              # set red foreground
CLR_GREEN=32            # set green foreground
CLR_BROWN=33            # set brown foreground
CLR_BLUE=34             # set blue foreground
CLR_MAGENTA=35          # set magenta foreground
CLR_CYAN=36             # set cyan foreground
CLR_WHITE=37            # set white foreground

CLR_BLACKB=40           # set black background
CLR_REDB=41             # set red background
CLR_GREENB=42           # set green background
CLR_BROWNB=43           # set brown background
CLR_BLUEB=44            # set blue background
CLR_MAGENTAB=45         # set magenta background
CLR_CYANB=46            # set cyan background
CLR_WHITEB=47           # set white background

# check if string exists as function
# usage: if fn_exists "sometext"; then ... fi
function fn_exists
{
    type -t "$1" | grep -q 'function'
}

# iterate through command arguments, o allow for iterative color application
function clr_layer
{
    # default echo setting
    CLR_ECHOSWITCHES="-e"
    CLR_STACK=""
    CLR_SWITCHES=""
    ARGS=("$@")

    # iterate over arguments in reverse
    for ((i=$#; i>=0; i--)); do
        ARG=${ARGS[$i]}
        # echo $ARG
        # set CLR_VAR as last argtype
        firstletter=${ARG:0:1}

        # check if argument is a switch
        if [ "$firstletter" = "-" ] ; then
            # if -n is passed, set switch for echo in clr_escape
            if [[ $ARG == *"n"* ]]; then
                CLR_ECHOSWITCHES="-en"
                CLR_SWITCHES=$ARG
            fi
        else
            # last arg is the incoming string
            if [ -z "$CLR_STACK" ]; then
                CLR_STACK=$ARG
            else
                # if the argument is function, apply it
                if [ -n "$ARG" ] && fn_exists $ARG; then
                    #continue to pass switches through recursion
                    CLR_STACK=$($ARG "$CLR_STACK" $CLR_SWITCHES)
                fi
            fi
        fi
    done

    # pass stack and color var to escape function
    clr_escape "$CLR_STACK" $1;
}

# General function to wrap string with escape sequence(s).
# Ex: clr_escape foobar $CLR_RED $CLR_BOLD
function clr_escape
{
    local result="$1"
    until [ -z "${2:-}" ]; do
    if ! [ $2 -ge 0 -a $2 -le 47 ] 2>/dev/null; then
        echo "clr_escape: argument \"$2\" is out of range" >&2 && return 1
    fi
        result="${CLR_ESC}${2}m${result}${CLR_ESC}${CLR_RESET}m"
    shift || break
    done

    echo "$CLR_ECHOSWITCHES" "$result"
}

function clr_reset           { clr_layer $CLR_RESET "$@";           }
function clr_reset_underline { clr_layer $CLR_RESET_UNDERLINE "$@"; }
function clr_reset_reverse   { clr_layer $CLR_RESET_REVERSE "$@";   }
function clr_default         { clr_layer $CLR_DEFAULT "$@";         }
function clr_defaultb        { clr_layer $CLR_DEFAULTB "$@";        }
function clr_bold            { clr_layer $CLR_BOLD "$@";            }
function clr_bright          { clr_layer $CLR_BRIGHT "$@";          }
function clr_underscore      { clr_layer $CLR_UNDERSCORE "$@";      }
function clr_reverse         { clr_layer $CLR_REVERSE "$@";         }
function clr_black           { clr_layer $CLR_BLACK "$@";           }
function clr_red             { clr_layer $CLR_RED "$@";             }
function clr_green           { clr_layer $CLR_GREEN "$@";           }
function clr_brown           { clr_layer $CLR_BROWN "$@";           }
function clr_blue            { clr_layer $CLR_BLUE "$@";            }
function clr_magenta         { clr_layer $CLR_MAGENTA "$@";         }
function clr_cyan            { clr_layer $CLR_CYAN "$@";            }
function clr_white           { clr_layer $CLR_WHITE "$@";           }
function clr_blackb          { clr_layer $CLR_BLACKB "$@";          }
function clr_redb            { clr_layer $CLR_REDB "$@";            }
function clr_greenb          { clr_layer $CLR_GREENB "$@";          }
function clr_brownb          { clr_layer $CLR_BROWNB "$@";          }
function clr_blueb           { clr_layer $CLR_BLUEB "$@";           }
function clr_magentab        { clr_layer $CLR_MAGENTAB "$@";        }
function clr_cyanb           { clr_layer $CLR_CYANB "$@";           }
function clr_whiteb          { clr_layer $CLR_WHITEB "$@";          }

# Outputs colors table
function clr_dump
{
    local T='gYw'

    echo -e "\n                 40m     41m     42m     43m     44m     45m     46m     47m";

    for FGs in '   0m' '   1m' '  30m' '1;30m' '  31m' '1;31m' \
               '  32m' '1;32m' '  33m' '1;33m' '  34m' '1;34m' \
               '  35m' '1;35m' '  36m' '1;36m' '  37m' '1;37m';
    do
        FG=${FGs// /}
        echo -en " $FGs \033[$FG  $T  "
        for BG in 40m 41m 42m 43m 44m 45m 46m 47m; do
            echo -en " \033[$FG\033[$BG  $T  \033[0m";
        done
        echo;
    done

    echo
    clr_bold "    Code     Function           Variable"
    echo \
'    0        clr_reset          $CLR_RESET
    1        clr_bold           $CLR_BOLD
    2        clr_bright         $CLR_BRIGHT
    4        clr_underscore     $CLR_UNDERSCORE
    7        clr_reverse        $CLR_REVERSE

    30       clr_black          $CLR_BLACK
    31       clr_red            $CLR_RED
    32       clr_green          $CLR_GREEN
    33       clr_brown          $CLR_BROWN
    34       clr_blue           $CLR_BLUE
    35       clr_magenta        $CLR_MAGENTA
    36       clr_cyan           $CLR_CYAN
    37       clr_white          $CLR_WHITE

    40       clr_blackb         $CLR_BLACKB
    41       clr_redb           $CLR_REDB
    42       clr_greenb         $CLR_GREENB
    43       clr_brownb         $CLR_BROWNB
    44       clr_blueb          $CLR_BLUEB
    45       clr_magentab       $CLR_MAGENTAB
    46       clr_cyanb          $CLR_CYANB
    47       clr_whiteb         $CLR_WHITEB
'
}

function fail {
  clr_bold clr_red "${1}" >&2
  exit 1
}

## make it possible to call functions without source include
# Check if the function exists (bash specific)
if [[ ! -z "$1" ]]
    then
        if declare -f "${1}" > /dev/null
        then
          # call arguments verbatim
          "$@"
        else
          # Show a helpful error
          function_name="${1}"
          library_name="${0}"
          fail "\"${function_name}\" is not a known function name of \"${library_name}\""
        fi
    fi

#!/bin/bash
# ../home/lib_bash/lib_retry.sh

function include_dependencies {
    local my_dir="$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"  # this gives the full path, even for sourced scripts
    source "${my_dir}/lib_color.sh"
}

include_dependencies  # we need to do that via a function to have local scope of my_dir

function fail {
  clr_bold clr_red "${1}" >&2
  exit 1
}

function retry {
  local n=1
  local max=5
  local delay=5
  while true; do
    my_command="${@}"
    "$@" && break || {
      if [[ $n -lt $max ]]; then
        ((n++))
        clr_bold clr_red "Command \"${my_command}\" failed. Attempt ${n}/${max}:"
        sleep $delay;
      else
        fail "The command \"${my_command}\" has failed after ${n} attempts."
      fi
    }
  done
}

## make it possible to call functions without source include
# Check if the function exists (bash specific)
if [[ ! -z "$1" ]]
    then
        if declare -f "${1}" > /dev/null
        then
          # call arguments verbatim
          "$@"
        else
          # Show a helpful error
          function_name="${1}"
          library_name="${0}"
          fail "\"${function_name}\" is not a known function name of \"${library_name}\""
        fi
    fi

#!/bin/bash
# ../home/lib_bash/lib_wine_install.sh

function include_dependencies {
    local my_dir="$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"  # this gives the full path, even for sourced scripts
    chmod +x "${my_dir}/*.sh"
    source "${my_dir}/lib_color.sh"
    source "${my_dir}/lib_retry.sh"
}

include_dependencies  # we need to do that via a function to have local scope of my_dir

function fail {
  clr_bold clr_red "${1}" >&2
  exit 1
}

function check_wine_version {
    if [[ -z ${wine_version} ]]
        then
            clr_bold clr_red "WARNING - no wine_version in environment set - set now to default: devel"
            echo "available Versions: stable, devel, staging"
            export wine_version="devel"
        fi
}

function check_wine_prefix {
    ## set wine prefix to ${HOME}/.wine if not given by environment variable
    if [[ -z ${WINEPREFIX} ]]
        then
            clr_bold clr_red "WARNING - no WINEPREFIX in environment - set now to ${HOME}/.wine"
            export WINEPREFIX=${HOME}/.wine
        fi
}

function check_wine_arch {
    if [[ -z ${WINEARCH} ]]
        then
            clr_bold clr_red "WARNING - no WINEARCH in environment - will install 64 Bit Wine"
            clr_bold clr_red "in Order to install 32Bit You need to set WINEARCH=\"win32\""
            clr_bold clr_red "in Order to install 64Bit You need to set WINEARCH=\"\""
        fi
}

function check_wine_windows_version {
    if [[ -z ${wine_windows_version} ]]
        then
            clr_bold clr_red "WARNING - no wine_windows_version in environment - set now to win10"
            clr_bold clr_red "available Versions: win10, win2k, win2k3, win2k8, win31, win7, win8, win81, win95, win98, winxp"
            export wine_windows_version="win10"
        fi
}

function check_headless_xvfb {
    clr_green "Check if we run headless and xvfb Server is running"
    export xvfb_framebuffer_service_active="False"
    systemctl is-active --quiet xvfb && export xvfb_framebuffer_service_active="True"
    # run winetricks with xvfb if needed
    if [[ ${xvfb_framebuffer_service_active} == "True" ]]
        then
            clr_green "we run headless, xvfb service is running"
        else
            clr_green "we run on normal console, xvfb service is not running"
        fi
}

function prepend_path_to_wine_registry {
    add_pythonpath="${1}"
    clr_green "add Path Settings to Registry"
    wine_current_reg_path="`wine reg QUERY \"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\" /v PATH | grep REG_SZ | sed 's/^.*REG_SZ\s*//'`"
    wine_new_reg_path="${add_pythonpath};${wine_current_reg_path}"
    wine reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /t REG_SZ /v PATH /d "${wine_new_reg_path}" /f
    wine_actual_reg_path="`wine reg QUERY \"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\" /v PATH | grep REG_SZ | sed 's/^.*REG_SZ\s*//'`"
    clr_green "adding Path done"
    clr_bold clr_green "Wine Registry PATH=${wine_actual_reg_path}"
}

## make it possible to call functions without source include
# Check if the function exists (bash specific)
if [[ ! -z "$1" ]]
    then
        if declare -f "${1}" > /dev/null
        then
          # call arguments verbatim
          "$@"
        else
          # Show a helpful error
          function_name="${1}"
          library_name="${0}"
          fail "\"${function_name}\" is not a known function name of \"${library_name}\""
        fi
    fi


how do I refresh my wired ethernet connection from command line?

I'd use the nmcli commands for that purpose:

nmcli nm enable false && nmcli nm enable true

man page:

DESCRIPTION
       nmcli is a command‐line tool for controlling NetworkManager and report‐
       ing on its status.  It is not meant as a full replacement for nm‐applet
       or other similar clients but as a complementary utility to those pro‐
       grams.  The main usage for nmcli is on servers, headless machines or
       for power users who prefer the command line.

       [...]

  nm     NetworkManager
          Use this object to inquire and change state of NetworkManager.

         [...]

          enable [true|false]
                 Get networking‐enabled status or enable/disable network‐
                 ing by NetworkManager.  All interfaces managed by Net‐
                 workManager are deactivated when networking has been dis‐
                 abled.
                 Reference to D‐Bus:
                 interface: org.freedesktop.NetworkManager
                 method:    Enable
                 arguments: TRUE or FALSE


After "security update" to 4.15.0-24-generic #26-Ubuntu screen shows log content not login

Hey I just had the same problem. I didn't investigated but I think the problem is GDM and maybe the kernel.

A quick workaround I use:

(Re-)start computer.
Press Shift till you get the Grub menu.
Choose a previous kernel 4.15.0.23. (This may not be necessary, but I get weird behaviour with the 4.15.0.24 kernel.)
When you see the log or boot screen press Ctrl+Alt+F2 till you get a login shell. (If nothing happens just press Ctrl+Alt+F1, Ctrl+Alt+F2, Ctrl+Alt+F1, Ctrl+Alt+F2 and so on till you get the login shell.)
In the login shell enter your user name and password. (If it seems that it is frozen and not reacting any more just hit Ctrl+Alt+F2 again.)
Enter:

sudo systemctl stop gdm

Now just install a new display manager:

sudo apt install lightdm

If LightDM is already installed run:

sudo dpkg-reconfigure lightdm

It will ask you which one to use as default, GDM or LightDM, choose LightDM.
Maybe not required but I removed the kernel:

sudo apt purge linux-image-4.15.0-24-generic linux-headers-4.15.0-24\*

If you booted with this kernel 4.15.0-24 the removal process will ask your to confirm the dangerous removal of a currently running kernel. Abort and don't confirm this operation, which is the default option!
After this just reboot.

@David Foerster Thanks looks much better now


Some appilications auto start itself repeatedly after login

I'm not sure why you get 15 instances of applications, but you've most likely set the setting "On Login" setting to "Restore previous session" which is the default.

Change it to "Start with an empty session" and applications from previous sessions won't be started again.

The location is marked with a red circle in the screenshot below.


It will be impossible to get working through Wine:

"Game is unplayable because it relies on BattleEye anticheat which does not work through Wine."

WineHQ

As far as it goes for Windows gaming: buy a license for Windows and set your system up as a dual boot for the best experience. A slightly less optimal method would be to install Fortnite in Windows in VirtualBox or VM Player in Ubuntu.


C++ code cannot create output file on Ubuntu 16.04

Check the code in the main-loop

    for (unsigned int i = 0; i < times; ++i)
    {
        total += measure::ms(it->second, args[2].c_str(), dest.c_str(), inBuffer);
        ::unlink(dest.c_str());
    }

The ::unlink(dest.c_str()) removes the file after the test.

If you run the test for a very long time, you can see the files during the execution:

$ test_io.exe c big.bin 10000 &
$ ls -la
-rw-r--r-- 1 user group 134217724 Jul 23 13:45 big.bin
-rw-r--r-- 1 user group  70254592 Jul 23 13:54 big.bin.copy


configure remote server's apache and php to locate a website

Ubuntu and CentOS use different configurations and paths for Apache and PHP for example Ubuntu lists each virtualhost in the /etc/apache2/sites-available and CentOS stores the virtualhost config in the main /etc/httpd/httpd.conf file.

In order to setup the Apache config on CentOS you need to copy the content of the /etc/apache2/sites-available/your-site and paste it in the /etc/httpd/httpd.conf file and restart Apache on CentOS

For PHP you need to compare the configs from Ubuntu located at /etc/php5/apache2/php.ini with the one from CentOS located at /etc/php.ini.


dpkg -r giving warnings while removing package

According to this post dpkg tries to remove a package
from a directory which is not used by any other Debian package, thus it
looks empty to dpkg, but if you've placed other software under /opt it's
not empty on the file-system layer.

Thus, dpkg will keep going up the file system directory hierarchy until it
deletes all ancestors of the installation unless there is another package
that is also installed under an ancestor.

To see which packages depend on /opt:

$ dpkg -S /opt

One solution, taken from this post, is to create a "core-custom" package, which will hold the /opt, and be required by all the other custom packages. You can also use that package as a meta-package to install all the regular packages you like. Not like the warning is a big deal, but the cleaner the better.


Running Ubuntu On My OCZ RevoDrive 2 - No such drivers exist?

The RevoDrives rely on so called "FakeRAID" to run. They work just fine but require you to install dmraid package before Ubuntu can use it.

To install upon it, this basically requires you to:

Run "Try Ubuntu" first. You can't skip straight to installation.
Open a terminal and run sudo apt-get install dmraid.
Then run the installer. It should detect the new disk for what it is.


After installing system update I can't login to my user

Can you try (Control+Alt F1) to get to the console. Can you log in in?

If you can then something is broken with the Desktop or the Desktop Startup. You can try sudo apt-get upgrade to see if there are any updates.

you can also try tail -200 /var/log/syslog and see if you spot any errors in the file.

You can reboot your system using this command sudo reboot

This is something Quick to try, and not a solution.

to get out from Console Mode do (Control+Alt F7)


Changing Ubuntu locale settings by GUI crashes the accounts-daemon

I had the same problem after upgrading my system (xubuntu 12.04, using likewise open): I had no problems if I logged in with my system account, but if I logged in with an AD account I couldn't make the locale settings work (my default setting is it_IT, but somehow it was changed to en_US).

I tried the same commands you report with no success, but finally changing my display manager make it.

I supposed it was a problem with lightdm, so I tried switching to an other DM (slim):

sudo dpkg-reconfigure slim

and after a reboot I found that the system was set with the right language.

I decided to switch back to lightdm because I had problems with my screen's resolution and after running

sudo dpkg-reconfigure lightdm

and a reboot everything was fine.

Maybe it could be right just to run the reconfiguration of lightdm.


Small white line flashing top of screen Ubuntu 14.04

I am just posting this as an answer since @Lotus didn't post it as an answer. What lotus suggested totally worked for me on Fedora Workstation 29 with gnome-shell, bumblebee, nvidia drivers and wayland. Switchting resolution to something else, and then back again removed the blinking white line at the top (left) of the screen.


How do I find out what filesystem my partitions are using?

There are a number of ways to do this from the command line (Ctrl+Alt+t):

The command df -T will print your filesystem types, as follows:

~$ df -T
Filesystem     Type      1K-blocks       Used Available Use% Mounted on
/dev/sda1      ext4      190230236  102672812  77894244  57% /
udev           devtmpfs    1021128         12   1021116   1% /dev
tmpfs          tmpfs        412884        816    412068   1% /run
none           tmpfs          5120          0      5120   0% /run/lock
none           tmpfs       1032208       2584   1029624   1% /run/shm
cgroup         tmpfs       1032208          0   1032208   0% /sys/fs/cgroup
/dev/sdb1      fuseblk  1953480700 1141530424 811950276  59% /home/user/storage

This article sums up several other methods of obtaining this information.

Here are a couple of other examples that I use occasionally:

~$ mount | grep "^/dev"
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
/dev/sdb1 on /home/user/storage type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)

~$ sudo file -sL /dev/sda1
/dev/sda1: Linux rev 1.0 ext4 filesystem data, UUID=b53ecdf7-5247-4d65-91a6-be9264c84dea (extents) (large files) (huge files)


Ubuntu 12.04 LTS install failed. swap partition failed

An I/O error when creating a partition suggests a hardware problem -- most likely a dead or dying hard disk. You can test this by running a SMART test with a tool like GSmartControl or smartctl, but the results can be difficult to interpret. You may want to run sudo smartctl -a /dev/sda > output.txt (which generates a report on /dev/sda), post output.txt to a text file-sharing site, and post the link here for interpretation.


how to make external monitor primary (xubuntu)

I suggest to use the programme ArandR. It is a simple graphical programme ideally suited for Xubuntu. I have been using it without problems for two monitors at home and at work. It even allows me to save custom configurations, so I can easily switch between different set-ups.

It is available through the Ubuntu Software Centre.


How to save output to file that required root access

The redirection is not part of the sudo command. Depending on the operation you can do:

sudo bash -c 'crontab -l >/var/backup/crontab'

Or if the command doesn't need sudo:

crontab -l | sudo tee /var/backup/crontab


Problem fixed!

On another computer, I downloaded this resolvconf package, copied it onto a USB and then from the USB to my broken machine. Then I installed those packages using: sudo dpkg -i /path/to/deb/file followed by sudo apt-get install -f. Then I used sudo resolvconf -u and then sudo dpkg-reconfigure resolvconf.

I do not know what the commands sudo resolvconf -u and sudo dpkg-reconfigure resolvconf do, but they worked for me!

If anyone cares to explain, I am eager to hear.


My Dell laptop Inspiron 6000 won't go past the logo page

Try one of the steps:

1) when it is on the Ubuntu logo page where comes 4 dots that shows loading, press ESC on keyboard, you will see everything that is running there at the start of the Ubuntu, you will eventually see the program that is taking or halting the system, you can tell us that operation.

2) when the grub loads in, goto "Advanced versions" if this version is not there then this might be there-> "PREVIOUS VERSIONS OF UBUNTU", then select a previous kernel, your system will be loaded there, if you get through log in and see your desktop then

a) copy all your essential data in case of worst case scenario.

b) try restarting the system normally into your default kernel, if success then Voila! :P

3) Download the latest kernel iso, make a bootable usb, and when you get to the installation type, select "upgrade ubuntu 14" and in this way you MAY save your data and your ubuntu.

4) WORST CASE SCENARIO: you might have to reinstall ubuntu, the thing is you can have your data and that depends if you want to proceed, if yes, then please let me know I will provide you necessary steps to get through it..


How do I get rid of unused space on LVM2 PV?

I suggest using lvm resize from a terminal or use a GUI package

You can install system-config-lvm:

sudo apt-get install system-config-lvm

You can also manage your encrypted disks via cryptsetup and lvm package

For more information on how to use it, see man cryptsetup and man lvm.


Cannot install VLC on Ubuntu 18.04 - missing dependencies

With the help of the answers from here I fixed it this way:

sudo apt remove vlc*
sudo apt autoclean
sudo apt autoremove
sudo apt install vlc*

Thank you very much people!


This will do the job:

Firstly: Install rename by running the following command in the terminal:

sudo apt install rename

Secondly: In the terminal,cd to the directory containing your files.

Finally: Rename the files to your desired format by running the following command in the terminal:

rename 's/^(.+)\.(.+)\.(.+)\.(.+)\.(.+)\.mp4$/$1$2.mp4/' *

Done

Notice:

To see how the rename command will operate on your files but without really renaming them ( just print the output to the terminal ), you can add the option -n after it. Like so:

rename -n 's/^(.+)\.(.+)\.(.+)\.(.+)\.(.+)\.mp4$/$1$2.mp4/' *

Explanation - as requested by Hamza:

Part # 1:

's/ORIGINAL/NEW/'

Substitutes the ORIGINAL string with the NEW string.

To see how it works as simple as it gets:

Please run in the terminal rename -n 's/file.number1.2010.720p.otherinfo.mp4/NEW.mp4/' *
Assuming you have a file named file.number1.2010.720p.otherinfo.mp4 in the current directory.
The output would be rename(file.number1.2010.720p.otherinfo.mp4, NEW.mp4)

Part # 2:

^(.+)\.(.+)\.(.+)\.(.+)\.(.+)\.mp4$

Starts at the beginning of the string ^ and then matches one or more character/s ( any character ) (.+) before the dot \.

This group is put into a variable $1 and repeated four more times ( five in total ) each group is put into a variable ( $2, $3, $4, $5 ) until .mp4 represented as \.mp4 is reached.

Makes sure the string ends with .mp4 by using the $ symbol which matches the end of the string.

This part is, however, a bit flexible and will give you undesired results if the file naming is inconsistent and you have files with more than five parts separated by dots in their names like file.number1.2010.720p.otherinfo.extrainfo.mp4

If this is the case, please substitute this part with the more strict regular expression below. This way it will only operate on files with five parts separated by dots in their names only:

^([^.]+)\.([^.]+)\.([^.]+)\.([^.]+)\.([^.]+)\.mp4$

Part # 3:

$1$2.mp4

Defines the new file name as what is under the variable for the first group $1 ( in this case file ) + what is under the variable for the second group $2 ( in this case number(x) ) + .mp4

Part # 4:

*

Operates on all the files in the current directory.


Bind Alt-N to Nth window in byobu/screen

First check what octal code is generated when you press alt+1, type in the following:

echo -n C-qM-1 | od -t o1

(If that makes no sense to you: instead of writing C-q, press ctrl-q and for M-1 substitute alt-1, and some character should show up). For example, I have Finnish keyboard and en_US.UTF-8 locale and get:

0000000 302 261

so I put in my .screenrc:

bindkey "\302\261" select 1

Note: by default this will not work in a gnome-terminal at all, since alt+number changes the tab and screen (or bash) doesn't get a chance to see the keypress. Go to Edit > Keyboards Shortcuts... to change the shortcuts.


How to create or simulate a unified inbox in Evolution 3.2?

I run Evolution 3.2.3 -- and the menu you described as "not existing" is there (Edit->SeachFolders). And SearchFolders would be exactly what you want. You can check with the Online Documentation on how to create them.


Why do I not have any directory except 'home' with new user?

Downloads, Desktop, Music, and the other directories are not part of /etc/skel, and they are not created by useradd (or adduser, for that matter). These directories, collectively known as the XDG user directories can be created using the xdg-user-dirs-update command, run as that user:

sudo -iu <user> xdg-user-dirs-update

For example:

# useradd -m foo
# getent passwd foo
foo:x:1001:1003::/home/foo:/bin/bash
# ls /home/foo/ -l
total 0
# sudo -iu foo xdg-user-dirs-update
# ls /home/foo/ -l
total 32
drwxr-xr-x 2 foo foo 4096 Jun  7 14:43 Desktop
drwxr-xr-x 2 foo foo 4096 Jun  7 14:43 Documents
drwxr-xr-x 2 foo foo 4096 Jun  7 14:43 Downloads
drwxr-xr-x 2 foo foo 4096 Jun  7 14:43 Music
drwxr-xr-x 2 foo foo 4096 Jun  7 14:43 Pictures
drwxr-xr-x 2 foo foo 4096 Jun  7 14:43 Public
drwxr-xr-x 2 foo foo 4096 Jun  7 14:43 Templates
drwxr-xr-x 2 foo foo 4096 Jun  7 14:43 Videos


My wifi connection goes really slow at times. Can I set the powersaving option off permanently?

As you already have a bash script add it to the startup applications. So the script will be run when booting up the computer.or add into the command line of the startup application xterm -e followed byiwconfig eth1 power off.


Connecting to a Remote Server for the First Time

To connect a remote server:
Type the following command in your terminal

ssh remote_username@remote_host

which ssh is the command and is a shortend for secure shell
replace remote_username and remote_host with proper UserName and HosName


Yes, it's gone forever unless you have a support contract with Oracle.

Java 6 is no longer provided to the general public by Oracle because it reached end-of-life way back in February 2013, so you can't download it from Oracle unless you have a support contract with Oracle, which allows you to manually download it (after logging in) until December 2018.

I'd recommend using Java 8 or later. It still gets security updates, and it will compile and run Java 6 programs just fine. If you need to compile something so that it will run on a Java 6 JVM, you just need to add -target 1.6 to your javac line.


In the specific case of a desktop file (and icon), you can place them in the snap/gui directory in your project tree, and you won't need to run the post-install script. If it's another type of file, you can add another part (files from all parts are added to the same location in the stage step).


I feel like an idiot. After reading every forum post on WOL that every existed and spending hours on this:

I determined that packet was being sent via Wireshark
I needed to know if NIC was still on even though the computer was off... Pretty orange light when on; nothing when off
Decided it was probably something in the BIOS... Went through EVERY menu option and found whole 'nother page of settings that I wouldnt've have thought to look for. Found what I needed in there.

To anyone with a similar problem:

Make sure packet is broadcasted
Go through all settings in your BIOS just to be sure


Menubar and sidebar disappeared in Ubuntu 14.04

I have figured out a work around to this problem after going through so many forums.
I got to run ccsm command so that i could enable the unity plugin in settings manager.
But it seems ccsm doesnt work in tty (Ctrl+Alt+F1) and you are unable to open terminal using Ctrl+Alt+T.
Here comes the use of Emacs GUI where you can instantiate shell and run ccsm.
And the problem solved.


This is a detailed guide to flash a bios using ubuntu.