Algorithm to change ubuntu desktop wallpaper

What changes the wallpaper

In case of  Ubuntu's default behavior when it comes to backgrounds, that's set through gsettings. In a nut shell, it's a form of database for settings to various apps. The simple command is this:

gsettings set org.gnome.desktop.background picture-uri "$FILE"

, where "$FILE" is the shell script variable that holds full path to image in the form file:///path/to/image.png

That's somewhat different from other desktop environments. Think of Ubuntu's Unity   and Gnome as having a layer above typical X11 server ( i.e. the layer above GUI environment ). In such environments as blackbox or openbox you'd need to call an external program. For instance , feh --bg-scale /path/to/image

I assume you want to deal with default environment - Ubuntu's Unity.

Making a shell function

Here's example of what I use in my .bashrc file.

function chbackground {
    FILE="'file://$(readlink -f "$1" )'"
    echo changing to "$FILE"
    gsettings set org.gnome.desktop.background picture-uri "$FILE"
}

The function can be called like so

chbackground WALLPAPERS-FOLDER/cool-background.png

This function has two important parts. First, we can either have full path or partial path to the file - that's what readlink -f "$1" takes care of - it returns full path to image. Then we turn that into a string by combining output of readlink -f "$1" and file://. Remember, Unix path is always starting with root folder, /, so we need only leading two slashes there. Result would be file:///home/user/WALLPAPERS-FOLDER/cool-background.png string and stored in FILE variable.

Finally we call gsettings with FILE as argument.

This function can be part of any script and called with any partial or full path as parameter

Putting together a script

Here's a script I sketched out in about 15 minutes that will make a list of images , and then select random image out of that list, and set background to that image. The script is also placed in my github  , sergrep repository repository and will be developed just a little bit more to include extra functionality, but for the most part , the code version here does the big job.

In order to automate this script , refer to How do i make a program autostart every time i log in ?

#!/usr/bin/env bash
#
###########################################################
# Author: Serg Kolo , contact: 1047481448@qq.com
# Date: March 10th 2016
# Purpose: Set random wallpaper
#      To make it start automatically, add it as one of
#          the Startup Applications in Ubuntu's Unity
#          or Gnome
#
# Written for: https://askubuntu.com/q/744464/295286
# Tested on: Ubuntu 14.04 LTS
###########################################################
# Copyright: Serg Kolo , 2016
#
#     Permission to use, copy, modify, and distribute this software is hereby granted
#     without fee, provided that  the copyright notice above and this permission statement
#     appear in all copies.
#
#     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
#     THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
#     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
#     DEALINGS IN THE SOFTWARE.

ARGV0="$0"
ARGC=$#
change_background()
{
    FILE="'file://$(readlink -f "$1" )'"
    echo changing to "$FILE"
    gsettings set org.gnome.desktop.background picture-uri "$FILE"
}

make_list()
{
  # -max-depth may be optional , if you want to
  # traverse subdirectories,too
  find "$1" -maxdepth 1 -type f > "$2"
}

main()
{
  # Variables
  local DISPLAY=:0 # ensure this is set
  local DIR="$1"
  local LIST="/tmp/wallpaper.list"
  local TIME="$2"
  # cat $LIST # for debugging only
  make_list "$DIR" "$LIST"
  while true
  do
     change_background $( shuf $LIST | head -n 1   )
     sleep "$TIME"
  done
}

main "$@"


Accidantly removed SD card - Card reader not visible anymore

After the problem could not be solved by a simple reboot, the following procedure was successful:
Switching off the computer, then removing any power source for 5 min (simply plugging off power supply cord). After reconnecting and booting, the card reader was detected again.


Not asking for password in GUI for login even when there is a password set in Ubuntu 14.04

Not sure where its located in 14.04 but if you go to Settings - Users and Groups then select the user that can login without a password and where it says Password click Change. In 16.04 there is a checkbox for Don't ask for password on login If that is checked .. uncheck it and that should take care of the problem


Insert any Ubuntu LiveCD and choose Try Ubuntu without installing or something like that what you get. Then from the live session take backup of your personal files.


Open your terminal by pression Ctrl+Aly+t to open termianl and then use the following command to install Ubuntu-restricted-extras

sudo apt-get install ubuntu-restricted-extras

Actually ubuntu-restricted-extras is a software package for the computer operating system Ubuntu that allows the user to install essential software which is not already included due to legal or copyright reasons.

It is a meta-package that installs:

Support for MP3 and unencrypted DVD playback
Microsoft TrueType core fonts
Flash plugin
codecs for common audio and video files

after installing it you will be able to play audio’s and video as well.


Are all the softwares which are there for Ubuntu available on Kubuntu?

The main differences between Ubuntu and Kubuntu are the default installed packages, sponsors and the environments, which means any package that can be installed in Ubuntu it can also be installed in Kubuntu. And yes, Kubuntu and all other ubuntu like ditros use apt as their packaged manager since there all Debian derivatives.

For More details see What is the difference between Ubuntu and its derivatives? And https://help.ubuntu.com/community/MetaPackages


As already noted, postfix would be an overkill if you just need to send emails from php while developing applications on your home computer.

I personally use very simple and lightweight package ssmtp. It will use any smtp server to send outbound emails.
Install it by running:

sudo apt-get install ssmtp

Then edit /etc/ssmtp/ssmtp.conf file, comment out existing mailhub line and add the following lines (this example is for gmail smtp server):

mailhub=smtp.gmail.com:587
UseSTARTTLS=YES
AuthUser=<YOUR-EMAIL>@gmail.com
AuthPass=<YOUR-PASSWORD>

(Provide your gmail username & password. Of course you can use any other SMTP server).

Now make sure that your php.ini has correct sendmail_path. It should read as:

sendmail_path = /usr/sbin/sendmail -t

(From comments of @dima-l and @omar-sabic: You do not have to specify ssmtp here because the installation should have created a symlink for /usr/sbin/sendmail, which correctly points to ssmtp. Otherwise you have to specify sendmail_path = /usr/sbin/ssmtp -t)

Reload apache and your php should be able to send outgoing emails now.


Copy date and time of KDE calender in text format to clipboard

Why do you intend to use KDE Calendar for such a simple task? Why not to define a global shortcut

System Setting › Shortcuts and Gestures › Custom Shortcuts › Edit › New › Global Shortcut › Command / URL

for

date | xsel -i -b

?

You may use any imaginable date format if default (Fri Dec 20 09:33:37 MSK 2013)
 does not suite you, see date(1). E. g. date '+%F %T' will generate lexicographically sortable 2013-12-20 09:33:59.

Instead of xsel -i -b you also can use xclip -i -selection clipboard.

I assume you want to copy to CLIPBOARD. Use just xsel -i or xclip -i if you want to put date to PRIMARY selection.


How to install numpy, scipy, and other packages from source for Python3 in Ubuntu 14.04.2 LTS

This should do the deal. Building both numpy and scipy from git repository. About upgrading matplotlib you can read here


For whatever reason, pico2wave only accepts input as arguments. Therefore, the length of text it can process at once is limited by the max argument size. You could perhaps Use xargs to split the text into parts not exceeding this limit. Run that script using xargs this way:

xargs -a input.txt ./speech.sh

Relevant xargs option which you won't need to use:

--max-chars=max-chars
-s max-chars
      Use at most max-chars characters per command line, including the
      command  and  initial-arguments and the terminating nulls at the
      ends of the argument strings.   The  largest  allowed  value  is
      system-dependent, and is calculated as the argument length limit
      for exec, less the size of your environment, less 2048 bytes  of
      headroom.   If this value is more than 128KiB, 128Kib is used as
      the default value; otherwise, the default value is the  maximum.
      1KiB is 1024 bytes.


How to re-enable Kubuntu Application Launcher Menu shortcuts after accidentally disabling

Okay, just rubber ducked a solution here. Found the answer right after posting the question.

After pulling my hair out for an hour, I checked the Custom Shortcuts config section one more time and found a place where you can enable/disable gestures for various components. There is a KMenuEdit component that I had accidentally disabled.

So to re-enable application launcher shortcuts, just re-enable the gestures for the KMenuEdit component.


I found the problem: cups_browsed, which I guess would be fine for a laptop but totally anoying for a server (or for fixed desktops / workstations).  'sudo apt-get purge cups_browsed' cured things.


How to upgrade intel-microcode used by iucode-tool?

Usually you can download the latest intel-microcode package .deb from the latest Ubuntu distro, and just install it.  This will work as long as the first digit of the Debian/Ubuntu version number of the intel-microcode package is the same.

Also, sometimes it just doesn't make sense to keep updating older versions of Ubuntu with new microcode packages, because the kernel and other drivers on old Ubuntu don't really support your (newer) processor properly, anyway.  In that case, the recommended is to switch to a newer version of Ubuntu itself (which will also come with a newer intel-microcode package).

That said, every so often the Intel group in Canonical will request that older versions of the distro should also get the newest intel-microcode package.


Can i install "jupiter-support-eee" package on non eee laptop?

It looks as if "jupiter-support-eee" is intended only for EeePC's.

From an article on OMG Ubuntu:

*EeePC netbooks that have the addition jupiter-support-eee package installed can also benefit from the following extra features: -

Super Hybrid Engine
GMA Overclock


Primary display flickering cursor, secondary display flickering black and no signal

I also had some flickering problems with a fresh isntall of ubuntu 20.04 (see Ubuntu screen flickering). Could you try to use Wayland display server on the logging screen: click your profile > click the white weel in lower right corner > choose 'Ubuntu on Wayland' and see if it is better ?


trouble getting apt-get to work with https

After some searching I have a better idea of what is happening (but no solution yet).

I found the source code for apt at https://code.launchpad.net/~ubuntu-branches/ubuntu/lucid/apt/lucid.  It uses libcurl for ssl, which in turn uses gntls.

The error message comes from libcurl, and it is complaining about the key/password, not the CA certificate.  The line:

* found 1 certificates in /opt/CA.crt

is saying that CA.crt was correctly loaded.  The error message comes from the following:

if(gnutls_certificate_set_x509_key_file(
     conn->ssl[sockindex].cred,
     data->set.str[STRING_CERT],
     data->set.str[STRING_KEY] ?
     data->set.str[STRING_KEY] : data->set.str[STRING_CERT],
     do_file_type(data->set.str[STRING_CERT_TYPE]) ) !=
   GNUTLS_E_SUCCESS) {
  failf(data, "error reading X.509 key or certificate file");
  return CURLE_SSL_CONNECT_ERROR;
}

(From gtls.c in http://alpha.gnu.org/gnu/gnutls/libtasn1-0.2.10.tar.gz)

The problem is with the password that is associated with that key.  I've stripped the password from the key using:

$ openssl rsa -in user.key -out user-nopasswd.key

This isn't ideal, but it seems to work.


How do I extract DNS IPs using a script?

To redirect output to a text file, add this to end of commmand you are using to view dns:

      > textfile.txt

will output to textfile.txt


Windows 8 fresh install and 12.10 dual boot

"Too much hassle" is of course subjective.

UEFI is relatively new. This means that software support in Linux distributions is still a bit rough around the edges, and documentation and help is less profuse than is the case for BIOS-mode installs. That said, installing both Windows 8 and Linux is possible. It helps to know a bit about EFI and EFI boot loaders. My own EFI Boot Loaders for Linux Web page may be a good place to start learning.

Since it sounds like you're building a computer from scratch rather than buying a system in a store with Windows 8 pre-loaded, another option is to install in BIOS/legacy boot mode. The vast majority of UEFI motherboards support BIOS/legacy-mode booting, and using this option can help you manage in the short term.

One thing to keep in mind is that you want to install both OSes in the same boot mode (EFI or BIOS/legacy). Although mixing boot modes is possible (particularly Windows in EFI and Linux in BIOS), it's awkward to set up and manage in this way. Unfortunately, most installers don't make it obvious which boot mode they're using, and therefore which way they'll set up the computer. For Windows, if you prepartition the disk, you can use the partition table type as a guide: If you set up Master Boot Record (MBR) partitions, Windows will install to the disk only if you use a BIOS-mode boot; and if you use a GUID Partition Table (GPT), Windows will install only if you use an EFI-mode boot. Linux is more flexible, which can actually cause problems for a dual-boot system. I recommend you drop to a shell and look for the directory /sys/firmware/efi. If it's present, you've booted in EFI mode; if not, you've probably booted in BIOS mode.

One final tip: When installing Linux in EFI mode, use a separate /boot partition, preferably with ReiserFS, ext2fs, or ext3fs. (FAT also works, but most Linux installers won't let you use FAT on /boot.) The reason is that there are EFI drivers for these filesystems, so using them to store your kernel can increase your options for boot loader configuration, even if the default installation doesn't make use of these options.


Feels like I found an answer (I used it for 17.10 )

In the terminal window execute this command to remove any previously installed tools:

sudo apt-get autoremove open-vm-tools

and after that execute this command to add tools:

sudo apt-get install open-vm-tools-desktop

and a final thing: do not forget to reboot.

It worked very well for me!


Create a launcher for your script then add to the startup applications


Ubuntu not showing up outside My Computer

Welcome to AskUbuntu!

You cannot run the Ubuntu you just downloaded from within Windows XP. Please read how to try Ubuntu before you install -- first, burn it on a DVD or create a bootable USB stick, so you become familiar with it and, if you like it, consider following the step-by-step guide to install it alongside your Windows.

You can try with the Long-Term support Ubuntu 12.04 or the most recent version, 13.04.

Make sure you read and understand everything before you do any changes to your computer, so you do not damage your data or current OS. Look for answers in this website or other places and, if you can't find the right answer, ask!


What does Ctrl + Alt + F11 do and why can't I log into my account with Unity any more?

Ctrl+Alt+F7 or Ctrl+Alt+F8 should find your GUI again.

The Ctrl+Alt+F# buttons bring up "TTYs" which are just terminal interfaces you can use without running gnome-terminal or another terminal program.


How to convert a iso9660 ISO to a USB ISO

Here is an answer using the same utilities from ipse lute's answer, but with a full procedure and more detail, as requested by the OP.

CAUTION: this procedure uses the dd command; please ensure that you know how to use it properly.

PURPOSE

This document explains how to "hybridize" an ISO 9660 filesystem (.iso file), such that it can be booted
from optical media and disk storage devices such as USB flash drives.  This process is achieved using tools
developed by the Syslinux Project: http://www.syslinux.org/wiki/index.php?title=The_Syslinux_Project

SOURCES

http://www.syslinux.org/wiki/index.php?title=The_Syslinux_Project
http://www.syslinux.org/wiki/index.php?title=ISOLINUX
http://www.syslinux.org/wiki/index.php?title=Isohybrid

PROCEDURE

Initial setup: Install the required software

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

sudo apt-get install syslinux isolinux syslinux-utils syslinux-efi

Determine if your ISO is non-hybridized, run:

fdisk -l <your.iso>

You will see output like (exact contents may differ):

Disk your.iso: 709.3 MiB, 743718912 bytes, 1452576 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

If you already have a hybridized ISO, you will see output like the following (Ubuntu Trusty Desktop used as an example;
all Ubuntu ISOs are hybridized; formatting from stdout has been mangled here):

Disk ubuntu-14.04.4-desktop-amd64.iso: 1020 MiB, 1069547520 bytes, 2088960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1a447608

Device                            Boot Start     End Sectors  Size Id Type
ubuntu-14.04.4-desktop-amd64.iso1 *        0 2088959 2088960 1020M  0 Empty
ubuntu-14.04.4-desktop-amd64.iso2      26268   30811    4544  2.2M ef EFI (FAT-12/16/32)

If your ISO is already hybridized, skip to step 4. If you have a non-hybridized ISO, install the appropriate packages as follows: In a Debian Linux distro, run as root (e.g with sudo):

apt-get install syslinux isolinux syslinux-utils syslinux-efi

Hybridization: If you would like to retain your original, un-hybridized ISO, first make a new copy, which we will call your.hybrid.iso.  On the new copy, Run:

isohybrid <your.hybrid.iso>

Note: this will overwrite the contents of the existing ISO.  If you don't need the original, simply operate on it.
Make a bootable disk from the ISO (e.g. USB flash drive)

Determine the device file assigned to the USB drive. Open a terminal and run

tail -f /var/log/syslog

This will allow you to be ABSOLUTELY SURE which device file the kernel assigns to the device when it is inserted.
You should see a line like:

Aug  5 11:04:34 yourbox kernel: [2407408.163088] sd 23:0:0:0: [sdX] Attached SCSI removable disk

This indicates that the USB drive was assigned /dev/sdX, where X is usually a lowercase alphabetic character.

Insert the USB drive, and note the device file /dev/sdX by watching the output of syslog.

Unmount all partitions of the flash drive, if any were automatically mounted.
Dump the file to the USB drive. Use WITH EXTREME CAUTION dd to dump the ISO to the drive

Make absolutely sure you replace X with the letter associated with your drive's device file in the following command,
and that you make NO typos (e.g. stray whitespace) in the arguments!!  If you mess up, you could destroy your whole system.
Run, as root:

dd if=<your.hybridized.iso> of=/dev/sdX bs=4M && sync

Remove the USB drive, insert it into the machine to be booted, and boot from the USB drive in BIOS mode.  By default, isohybrid will create a BIOS mode bootable drive, but there is an option to create a UEFI bootable drive. See man isohybrid for more information.
Enjoy installing your new OS!


Have I lost my entire Windows drive and all the files?

You can see all of your partitions by running System->Administration->Disk Utility. Once the window opens, click on your hard drive on the right hand side. Have a look at the partitions.

If one of the partitions is an NTFS partition, it is likely that this is your Windows partition. If it is there, you can access the partition from the Places menu.


Linux folder? windows can't access a ext4 file system. the simplest way to share between linux and windows is to make a small partition formatted to ntfs.

both systems will be able to read and write to this partition.


Why does battery power drain quicker in Ubuntu compared to WIndows in Dell Inspiron?

On some Dells the embedded controller (EC) gets confused; removing the power and the battery and leaving the machine for a few minutes for the EC to powerdown may help.

If the machine is consuming too much power it may be worth consulting: https://wiki.ubuntu.com/Kernel/PowerManagement


Make a pc on lan accessible from outside network

use service like dydns or noip, hope that help :)

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


This is an idiosyncrasy of the systemd integration of PostgreSQL in Xenial.

The postgresql service unit installed by the postgresql-common package is just a dummy service which causes the actual service postgresql@9.6-main to be started via a dependency. You can see that dependency by running the command

systemctl list-dependencies postgresql

That dependency is not permanent, but generated during system boot by the systemd generator /lib/systemd/system-generators/postgresql-generator which also comes with the postgresql-common package. The generator checks whether the startup mode in the file /etc/postgresql/9.6/main/start.conf is set to auto, and if so, sets up the dependency that subsequently causes instance 9.6-main to be started.

(More precisely, it checks all configuration subdirectories /etc/postgresql/*/* and will create dependencies for all instances that are configured for automatic startup, but in a default installation there will be just the one instance.)

Due to the limitations of systemd generators (see man systemd.generator) this process may fail, causing the dependencies to be absent after a reboot.
Systemd will then start only the dummy service, writing

systemd[1]: Starting PostgreSQL RDBMS...
systemd[1]: Started PostgreSQL RDBMS.

to the log but otherwise doing nothing.
Attempting to start the service manually by

systemctl start postgresql

will just reproduce that result.
Running the command

systemctl daemon-reload

manually as root will re-run the generator and in most cases fix the problem until the next reboot.

To solve the problem permanently you'll have to find the reason why the generator fails during boot. Possible causes can be found in the systemd.generator manpage. In my case it was the PostgreSQL config file /etc/postgresql/9.6/main/postgresql.conf which was symlinked to a different filesystem that wasn't available yet when the generator ran early during boot. postgresql-generator checks the existence of that file even though it doesn't otherwise need it.


Juju Bare Metal 14.04 behind proxy ignoring proxy settings

You could try using juju bootstrap --upload-tools as a workaround. It should avoid the need for Juju to go out to the internet for getting the tools.


Why won't strace/gdb attach to a process even though I'm root?

One reason to get the error:

attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted

is because the process has already been attached to with gdb, strace or similar. To check if this is the case, run:

grep TracerPid /proc/$THE_PID/status

If it is nonzero, that is the pid of an existing program that is already running a trace on that process.


Ubuntu ugrade 17.10 to 18.04 nvidia black screen

This bug has tormented me for a full week now, and I still had not managed to fix it after countless installs on 3 different systems. In the end I followed the tip from Terrance with some tweaks and it seemed to work for me. I decided to clean up my approach and provide it here as a full answer.

The problem seems to be with the binary nvidia binary driver version 390 which is default.

To fix the problem, simply install the next version 396. You can do this in Ubuntu 18.04LTS (Bionic Beaver) follow the steps below:

Run the following command to install a repository dedicated to the latest graphics driver versions:

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

You have to press ENTER at the prompt.

Then run the following command to update your repo locally with new ppa:

sudo apt update

Finally run the following command to install version 396 of the graphics driver:

sudo apt install nvidia-driver-396

At this stage you may be good to go, and simply go to the step with the reboot below. However, I also had to make a small change.

Run the following command to open for editing

sudo nano /usr/share/X11/xorg.conf.d/nvidia-drm-outputclass-ubuntu.conf

In that file, comment out the line that says Option "PrimaryGPU" "yes" and save/close the file with <CTRL + O> and <CTRL + X> keyboard combos.

At this stage you may also be fine, however I needed another tweak before I got it working.

Run the following command to edit your sources file>

sudo nano /etc/apt/sources.list

At the bottom of the file add a line on its own:

deb http://us.archive.ubuntu.com/ubuntu/ bionic-proposed multiverse main universe restricted

Save/close the file with <CTRL + O> and <CTRL + X> keyboard combos.

Run the following command to update your local repo agian after adding the new source. WARNING: This will add proposed versions of software to your system, which may be less stable.

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade

Run the following command to install some needed packages that may be missing:

sudo apt install libglvnd0 xserver-xorg-core libgl1-mesa-glx

Once this completes, it is time for a reboot.

After the reboot, you can run the command nvidia-smi to see what was installed:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.24                 Driver Version: 396.24                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 760     Off  | 00000000:02:00.0 N/A |                  N/A |
| 49%   51C    P0    N/A /  N/A |    262MiB /  1998MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0                    Not Supported                                       |
+-----------------------------------------------------------------------------+


Try running: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/ && sudo ldconfig && ./hon-x86_64.

The libstdc++.so file in /usr/lib/gcc/x86_64-linux-gnu/4.9.2 is not the one that should be used. Also, a file is being specified (libstdc++.so). You should be specifying the directory the file is in (/usr/lib/x86_64-linux-gnu/).

You may want to permanently append that path to the LD_LIBRARY_PATH environment variable by putting export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/libstdc++.so.6 in one of your startup files (~/.bashrc or ~/.profile for example).


How can I constrain workspace-switching animations to their respective monitors?

In ccsm's Desktop Wall>Viewport Switching, set Multimonitor behavior to Switch separately.


Unable to mount VirtualBox Guest Additions as a guest (Win7 host)

Finally, I figured it out. Here is how you get arount this. First, load Disk Utility and manually eject the disk in the CDROM, by clicking on the Eject button, after selecting the CDROM device. Then try to remount Guest Additions using the key combination Host + D and voila, Guest Additions should mount successfully.


what alternatives do I have to correctly open (for read-only purposes) a docx file?

So I found that I can export to PDF from SkyDrive. This will be the way to go, unless someone else comes up with a better alternative.


I managed to figure this out. In tomcat6, you need to set-up an admin user and go to the manager application to launch war files. Problem solved :)


That message is not from xdg-open. It is from whatever application was used to open the URL. As you are using it over SSH, it isn't opening a graphical web browser, and instead appears to be opening the URL in a console based web browser, which either does not support JavaScript or has the feature disabled.

You will need to use a browser which supports JavaScript, or enable the feature if it is disabled.


Customize software sources for Ubuntu Desktop updater to manage?

If the outside sources are PPAs, you can simply add them in the Third Party tab.  If you're compiling from source or downloading random .deb files from the Internet (not from a PPA page or Debuntu or Medibuntu, which do have full repos), then the Update Manager can't handle those.


How to find ONLY duplicate files that have different names?

If you're okay that the script prints all duplicate files with both equal and different filenames, you can use this command line:

find . -type f -exec sha256sum {} \; | sort | uniq -w64 --all-repeated=separate | cut -b 67-

For an example run, I use the following directory structure. Files with similar name (and different number) have equal content:

.
├── dir1
│   ├── uname1
│   └── uname3
├── grps
├── lsbrelease
├── lsbrelease2
├── uname1
└── uname2

And now let's watch our command doing some magic:

$ find . -type f -exec sha256sum {} \; | sort | uniq -w64 --all-repeated=separate | cut -b 67-
./lsbrelease
./lsbrelease2

./dir1/uname1
./dir1/uname3
./uname1
./uname2

Each group separated by a new line consists of files with equal content. Non-duplicate files are not listed.


Cannot install bluetooth-indicator, ubuntu-desktop or unity-control-center

All the messages were simply dependencies incompatible with this or that packet. I could not know which packet to install first. Luckily after gsettings reset com.canonical.Unity.Devices blacklist and restoring I have the state where system settings etc are available.


I also had same issue. Try disabling 'Use hardware acceleration when available' option in settings. Hope it helps.


Script to tell 12.04 Kernel to maintain battery power saving features on AC

Edit /etc/laptop-mode/laptop-mode.conf and change

ENABLE_LAPTOP_MODE_ON_AC=0

to

ENABLE_LAPTOP_MODE_ON_AC=1

Now restart laptop-mode with:

sudo /etc/init.d/laptop-mode restart

Check that it's active on AC with for example:

$ sudo laptop_mode start

which gives me:

Laptop mode
enabled,
active [unchanged]


Two finger scrolling with libinput not working, 18.04

No matter which scroll method I try to change (also as root), the result is the same:

➤ xinput set-prop 11 286 100
X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  131 (XInputExtension)
  Minor opcode of failed request:  57 ()
  Serial number of failed request:  19

No need in root. You have a typo: 100 should be 1 0 0, because it's three separate values (I think they could've been better represented as "false" and "true" strings, but oh well).

Also, you're using a number in place of device and property. It might be okay for experiments, however if you want to add this command to autostart (you probably do because xinput modifications are lost after XServer restarted), then you may find that these numbers may change from time to time, depending on curcumstances. Instead, use the actual string that identifies the device and the property.

The command you want is:

xinput set-prop "PS/2 Synaptics TouchPad" "libinput Scroll Method Enabled" 1 0 0

➤ synclient
Couldn't find synaptics properties. No synaptics driver loaded?

Oh, sorry, too many synaptics, it's confusing. Basically, the synclient was used to manage the deprecated synaptics driver, but you don't have it nor need it. It was obsoleted in preference of libinput. You may also want to read this blog-post from libinput maintainer.

Sorry, not gonna help with the xorg.conf file because IMO their syntax is a maze, and I'm not a person to advice on that. I'm personally just use xinput added to autostart. Hopefully someone will post an answer about xorg config.


Command history is generally stored on per-user basis in the .bash_history file in your home directory. Means, every user has its own set of commands he has executed.

When multiple terminal sessions are open they may show you different commands when pressing the arrow key, but when you will close all the terminal windows the history from different terminal session will be merged to a common ~/.bash_history file.


You description is a bit vague. BUt I reckon what you want to archive is to sync the remote backup folder with your PC (sync directories).

In this case, the most suitable tool would be rsync instead of scp.

Good news is that rsync works perfectly fine over SSH, your public key authentication will keep working like a charm.

You can use command like below to keep your backup on the remote server in sync with your PC

rsync -avz --delete --progress --stats some_directories host@ip-address:backupFolder/

  NOTE: be careful with rsync's trailing slash => /. Read the man pages.


Can I install Gnome 3.24 Portland in Ubuntu 16.10?

you cannot install or upgrade to GNOME 3.24 — at least, not yet. As this is open-source software it is perfectly feasible for someone to put in the effort required to maintain and distribute a GNOME 3.24 backport — but it’s highly unlikely anyone will

Source


Brightness was working but I reinstalled drivers

I can't really say which answer helped me. I made today 20 different things and nothing worked after reboots.

Installing Brightness Controller was a cheating solution which I accepted when I had enough.
One of the tips made me install some small program and add hot keys for the brightness. I try to refresh website after few hours and I start  lowering brightness (I made F5 to lower it).


Lost my Windows boot option while dual booting with Ubuntu

I have noticed that my boot was in EFI boot, but the windows was installed on legacy boot. So the answer was to disable EFI boot and do it as a legacy boot option. Then it should boot into the Ubuntu, with the grub loader but with no option about windows. Then, you just have to use boot repair. That's it!


Installation and compatibility on Acer Swift 3

Somehow the Grub menu works fine with Ubuntu, but when I enter to
  Windows, it reboots the laptop and go directly to Windows, Is this
  something that can be fixed?

Unless i did not understand your question because of bad translation, this looks perfectly normal to me. There is this Grub (GRand Unified Bootloader) menu. It lets you choose which system to boot. Boot some Linux distribution or Windows. In all cases, "it reboots the laptop and go directly to..." the chosen system. So this is not "something to be fixed", this is good, and normal.


/etc/profile has error. Can someone fix it

The first line of your file should be a comment but is missing the preceding #. In fact to return your file to it's default state replace the first line with the following:

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).


apt-cache show maven | grep Version for me shows

Version: 3.0.5-1

so the maven package is a reasonably recent version of maven 3.x.x.

apt-cache show maven3 for me yields

N: Unable to locate package maven3
E: No packages found

so trying to install maven3 will probably fail unless you have a non-standard set of repos on your search list.

Also see https://packages.debian.org/search?keywords=maven


You need to install proprietary Nvidia drivers. Run in terminal

sudo apt-get install nvidia-346

and reboot.


the keyboard is kind of awkward, especially with the special characters etc, and arrow keys would help there, I agree!

That said, the autocorrect is pretty nice, I hope you have that working at least, this is dependent on using the correct language. Especially when you use multiple languages that's not so obvious.

-Long press the globe left of the space bar, settings
(or go to system settings, language and text)

-Keyboard layouts, make sure in this menu that the languages you regularly use are selected.

-Go back to your message. If you long press the globe you see which language is selected, tap the one you want instead. Or tap the globe to change language (no feedback so you'll have to trust or check by long press or try that it is correct now)

I hope this helps. If not, it's probably best to file a bug report in launchpad, but that would require more detail on what's going wrong exactly


Installed ubuntu 16 from external drive to HP laptop stuck on grub

Powered down the computer. Unplugged the external drive that was used to install Ubuntu and then powered the computer up. Success! Ubuntu is now running


Open terminal ( Ctrl + Alt + T) and run the following commands

 sudo add-apt-repository ppa:official-toggl/ppa
 sudo apt-get update
 sudo apt-get install desktop-Toggl

This will install Toggl Desktop Client


Wi-Fi only connects when router set to TKIP, but won't use AES

This has everything to do with the RALINK RT2860 chipset (or more its driver) that's embedded in your Asus EeePC 1000H. This thread details upgrading the driver. This might seem a little extreme but from what I've seen of the RT2860, you either upgrade or forget about AES.

There are a few formatting issues, problems with files, etc with that post, so I'm rewriting it here.

Head to http://www.ralinktech.com, hover over software, click linux and look for RT2860 (current string is RT2860PCI/mPCI/CB/PCIe(RT2760/RT2790/RT2860/RT2890), version 2.4.0.0)
Download it and extract it. I had problems extracting it in Gnome. I had to rename it from .tar.bz2 to .tar.gz.
Open a terminal window, cd into the extracted directory.
Edit os/linux/config.mk and change options HAS_WPA_SUPPLICANT and HAS_NATIVE_WPA_SUPPLICANT_SUPPORT to =y
Edit common/cmm_wpa.c (gedit will throw an encoding error - select Western and click retry). Search for MIX_CIPHER_NOTUSE and replace the entire line with this:

WPA_MIX_PAIR_CIPHER FlexibleCipher = WPA_TKIPAES_WPA2_TKIPAES;

It's finally time to compile and install! Yey!

sudo apt-get install build-essential
sudo make
sudo make install
sudo ifconfig wlan0 down
sudo rmmod rt2860sta

We need to move the old driver out the way. We probably shouldn't delete it in case we need it again so:

sudo mv /lib/modules/$(uname -r)/kernel/drivers/staging/rt2860/rt2860sta.ko rt2860sta.ko.dist

If you're using a 64bit installation, you might need to change /lib/ to /lib64/
Now we just need to move in the new driver and load it.

sudo cp os/linux/rt2860sta.ko /lib/modules/$(uname -r)/kernel/drivers/staging/rt2860/

/lib64/... for 64bit installs, again.

sudo depmod -a
sudo modprobe rt2860sta

Everything should burst into life. If it doesn't you may need to run sudo ifconfig wlan0 up
For persistence run sudoedit /etc/modules and add rt2860sta as a new line at the end. This will make sure the driver gets loaded at boot.

If it all goes to pot and the new driver doesn't work, just remove the version you copied in and remove the .dist off the old version we renamed.

Note: If you change kernel a lot, you want to invest in some DKMS script to do all this. There may even be deb packages for this driver.


Since you are using NAT, you must first configure port forwarding (chapter 6.3.1 off VirtualBox manual).

You should configure a port on your Windows machine (for example 2222) to correspond to the VM's port 22.

Then you can connect with PuTTY to the IP address of your Windows host and port 2222.

Same applies to Android. You need to find an SSH application on Play Store (or whatever you use) and use the same connection details.


Terminal Error Message whilst installing Anbox

Ubuntu checks module signing by default, on kernels 4.4.0-18.34, 4.4.0-21.37, 4.2.0-42.49, 3.19.0-65.73 and 3.13.0-92.139 onwards.

Because of those changes, DKMS modules will not work on systems with Secure Boot enabled unless correctly configured.

In order to make DKMS work, Secure Boot signing keys for the system must be imported in the system firmware, otherwise Secure Boot needs to be disabled. There are several methods to configure your system to properly load DKMS modules with Secure Boot enabled.

So, you need to install:

sudo add-apt-repository ppa:morphis/anbox-support
sudo apt update
sudo apt install linux-headers-generic anbox-modules-dkms

These will add the PPA to your system and install the anbox-modules-dkms package which contains the ashmem and binder kernel modules. They will be automatically rebuild every time the kernel packages on your system update.

After you installed the anbox-modules-dkms package you have to manually load the kernel modules. The next time your system starts they will be automatically loaded.

Then you must run:

sudo modprobe ashmem_linux
sudo modprobe binder_linux

Read more at here.


dpkg is messed up, returned an error code (1)

I think the problem was with the external data. The package you installed lightdm-login-chromiumos needs external data which seemed to be either corrupted or in wrong format for unzip to handle. Anyway, since you cleared (in the chat) that they just want to abort the whole thing, You just need to tell dpkg that the package is to be removed.

Just do this in terminal

sudo dpkg -r lightdm-login-chromiumos


dpkg and apt language is different than the rest of the system

This line in the locale output is probably the culprit:

LANGUAGE=en_US:tr

You need to figure out in which file that is set, and change it to e.g.:

LANGUAGE=en_US:en


Grub Customizer will not install on Ubuntu 14.04

The images of the error in the ubuntu software center and the software settings app have been linked. This problem was resolved by typing in sudo apt-get -f install; sudo apt-get install grub-customizer; lsb_release -a; uname -a to the terminal, it then downloaded Grubb Customizer.


How do I run a single command at startup using systemd?

Your .service file should look like this:

[Unit]
Description=Spark service

[Service]
ExecStart=/path/to/spark/sbin/start-all.sh

[Install]
WantedBy=multi-user.target

Now, take a few more steps to enable and use the .service file:

Place it in /etc/systemd/system folder with say a name of myfirst.service
Make sure that your script executable with:

chmod u+x /path/to/spark/sbin/start-all.sh

Start it:

sudo systemctl start myfirst

Enable it to run at boot:

sudo systemctl enable myfirst

Stop it:

sudo systemctl stop myfirst

Notes

You don't need to launch Spark with sudo in your service, as the default service user is already root.
Look at the links below for more systemd options.

Moreover

Now what we have above is just rudimentary, here is a complete setup for spark:

[Unit]
Description=Apache Spark Master and Slave Servers
After=network.target
After=systemd-user-sessions.service
After=network-online.target

[Service]
User=spark
Type=forking
ExecStart=/opt/spark-1.6.1-bin-hadoop2.6/sbin/start-all.sh
ExecStop=/opt/spark-1.6.1-bin-hadoop2.6/sbin/stop-all.sh
TimeoutSec=30
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10

[Install]
WantedBy=multi-user.target

To setup the service:

sudo systemctl start spark.service
sudo systemctl stop spark.service
sudo systemctl enable spark.service

Further reading

Please read through the following links. Spark is a complex setup, so you should understand how it integrates with Ubuntu's init service.

https://datasciencenovice.wordpress.com/2016/11/30/spark-stand-alone-cluster-as-a-systemd-service-ubuntu-16-04centos-7/
https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files
https://www.freedesktop.org/software/systemd/man/systemd.unit.html


Installed Ubuntu 13.1 on Laptop beside Win7 - no option to boot into windows - have run boot-repair

Maybe check this link, I feel its best to have two separate hard drives one for windows one for Ubuntu to be on the safe side, you can always install Ubuntu on an external hard drive and connect it to your computer through USB and run it that way its what i do, haven't had this problem before, this might help
V
V

https://help.ubuntu.com/community/Boot-Repair


Installing CP400 printer gives 'client-error-not-possible' error

I was running into the same issue with a different printer.  Your comment about the plus sign provided me a clue. When I tried adding the plus sign to 'gutenprint52usb://' in the 'add printer' menu it looked like it didn't accept it.  So since I couldn't add a + in the menu, I subtracted it from the library name by making a copy of gutenprint52+usb without the plus sign

# cd /usr/lib/cups/backend
# cp gutenprint52+usb gutenprint52usb

After that, I just added the printer like normal (select device, find driver, save) and was able to print successfully.


mod_rewrite loaded but phpbb url rewrite option not working

Modify your configuration file and add the following lines right after the DocumentRoot directive. Then restart Apache.

DocumentRoot /var/www/html
<Directory /var/www/html>
    Options None FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

The directive AllowOverride All should allow all overrides by the .htaccess file for this directory. By default it is: AllowOverride None.

Further reading:

AllowOverride Directive
Apache HTTP Server Tutorial: .htaccess files


Wifi does not work with my Dell Latitude E5270 on Ubuntu 20.04

Intel wireless 8260 - unclaimed network should have the answer to this problem, but if it doesn't tell me and I will check.


VLC SDR 10 Bit 4k video stuttering in Ubuntu 16.04 on ThinkPad P52 with NVidia Quadro P1000

Solved:

Increased the thread count in Preferences->all->Input/Codecs->Video Codecs->FFmpeg->Decoding->Threads. I increased it to 100. After that playback is smooth.


windows 7 with deep freeze bypass from ubuntu why?

Straight from the wikipedia article, Deep Freeze cannot protect you in this case:

  Deep Freeze cannot protect the operating system and hard drive upon
  which it is installed if the computer is booted from another medium
  (such as another bootable partition or internal hard drive, an
  external hard drive, a USB device, optical media, or network server).
  In such cases, a user would have real access to the contents of the
  (supposedly) frozen system.[3] On a Windows-based computer, this
  scenario may be prevented by configuring the CMOS (nonvolatile BIOS
  memory) on the workstation to boot only to the hard drive to be
  protected, then password protecting the CMOS. This is a normal
  precaution for most public access computers. A further precaution
  would be to lock the PC case shut with a physical lock or tiedown
  cable system to prevent access to motherboard jumpers.


Any player in ubuntu 14.04 unable to play hd videos

I can play HD video files (1080) with mkv and mp4 extension by using XBMC Media Center on Ubuntu 14.04 x64 but I have my own computer that differs with yours. And even I can watch those file which are for 5.1 speakers with DOLBY quality by that software. But I am not sure about you and your computer. Maybe you can use it. Try it  and after installation, update and upgrade your ubuntu.
You can install XBMC from Ubuntu software center that I did. But I suggest you can go on this link and pay attention to some tips there . And then run these commands:

sudo apt-get update

sudo apt-get upgrade

Some people have problems with XBMC on Ubuntu 14.04 X64. But I haven't had any after installing it and updating and upgrading Ubuntu 14.04. I don't know why but first I had a problem with XBMC. Nevertheless, after some days when my Ubuntu became up-to-date the problem was solved. And no error has been detected since that time. Besides I haven't had any problem with XBMC since that time. I think that all optional-add-ons with XMBC in Ubuntu software center must be selected first that I did. Then try to install XBMC.

I hope my solution will work for you too.
So long!


It depends on the type of VPN. You may need to consult your VPN provider's documentation, or contact their support services to find out what type of VPN it is.

For a "vpnc" VPN:

Open a terminal (Alt-Ctrl-T) and type the following command, entering your password when prompted:

sudo apt-get install network-manager-vpnc-gnome

For an "openvpn" VPN:

Open a terminal and type

sudo apt-get install network-manager-openvpn-gnome

Then reboot your computer, and right-click on the network-manager icon in the taskbar. There should be a VPN option either in this menu, or under the "Add new connection" options.


I just downloaded gnu clisp via the synaptic manager. Now how do i use it?

Try looking in there official webpage:

http://www.clisp.org/


Search for "Software Sources" on the dash. On the "Additional drivers" tab, you should find your wifi card's driver, most likely disabled. Enable it and apply changes.See here


Average memory usage after complete ubuntu 12.04 start up

Yes, it's normal. Unity is a 3D desktop environment, which is resource-intensive, and Firefox is no slouch, either. Additionally, Ubuntu (and Unity itself), runs a number of things under the hood, including, but not limited to:

Ubuntu One
Search indexing
Window management
State management
Update checking/installation
Pulseaudio (audio)
Network service
SSH and SSH-Agent
Unity lenses
Online account services (email checking, chat, etc)
Security services (SELinux stuff)

All this stuff adds up. If you go into "System Monitor" and look at the running processes, you'll see a breakdown of what's using your system resources. Dollars to donuts the bulk of it is Unity and Firefox.

Also, to give you an idea of just how resource intensive a window manager and desktop environment actually is, the minimum recommended RAM for Ubuntu Desktop is 512MiB, while Ubuntu Server (which has no window manager or desktop environment by default) only requires 128MiB, and the only real difference between the two is the presence of the desktop environment and window manager.


In order to allow copy/paste in your Ubuntu VirtualBox-Guest-Machine, you'll need to install VirtualBox Guest Additions

how to install guest additions in VirtualBox VM
Detailed explanation taken from how-to-enable-copy-and-paste-in-virtualbox

Start VirtualBox.
Start the host in question.
Once the host has booted, click Devices | Insert Guest Additions CD Image.
Open up a terminal window in the guest.
Mount the CD-ROM with the command sudo mount /dev/cdrom /mnt.
Change into the mounted directory with the command cd /mnt.
Install the necessary dependencies with the command sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r).
Change to the root user with the command sudo su.
Install the Guest Additions package with the command ./VBoxLinuxAdditions.run.
Allow the installation to complete.

One the installation is finished, reboot the guest operating system.

Enable copy and paste

At this point, copy and paste (from either guest to host or host to guest) can be enabled. Start the VM, and once it's booted, click Devices | Shared Clipboard | Bidirectional

You can now copy and paste from guest to host and host to guest. No more having to retype lines of code or URLs and no more wondering why the feature wasn't working.


KDE Notifications

KDE System Settings > Notifications

Event source: Plasma Workspace

Enable the 'Play a sound' at the Login/Logout

Launch the 'Event Notifications and Actions' from terminal:

kcmshell5 kcmnotify


Which all free dual pane file managers are available in Ubuntu?

If I want multiple panels, I use SpaceFM. It supports multiple panels, including just two.
It is opensource. It is actively developed. It has branches for development and stable. It's free.
Here is an example with three panels:

It even supports plugins.
sudo apt install spacefm

If you want to see the big list of available plugins, click here.


Failed to start Redis Datastore Server (Ubuntu 16.04.1 LTS)

I had the same issue and could not find a working solution anywhere. After some searching, the following fix worked for me ( Ubuntu 16.04 )

In /etc/systemd/system/redis.service add the following under the [Service] section.

Type=forking


Try this

sudo rfkill unblock all; sudo ifconfig 0 down; sudo ifconfig 0 up; sudo iwconfig 0 mode managed


avahi-daemon repeatedly registers/withdraws address record causing network failures

I had the same problem and found your question when searching for the answer. I also found this question on serverfault:

  If your DNS server that this server uses has a .local domain then avahi will fail to work. See http://avahi.org/wiki/AvahiAndUnicastDotLocal for more info on this.

When I removed my .local domain from my DNS server the problem went away. Hopefully you have the same success.


How to get terminal access to ISO mounted with Archive Mounter?

Archive Mounter uses gvfs to mount the ISO images.

On 14.04+, you'll find it mounted under

/run/user/$(id -u)/gvfs/

Where id -u return return your username's UID. If you are the only user on the system, this is probably 1000.

There's an environment variable called XDG_RUNTIME_DIR that should hold the path /run/user/<UID>, so you can just do:

ls $XDG_RUNTIME_DIR/gvfs

And you'll find your ISO mounted there to a directory starting with archive:host=file...


change many file names to hash (sha256)?

You can actually do this with this rename command:

rename 'chomp(my $new=`sha256sum "$_" | cut -d" " -f1`); s/.*/$new.mp4/' *mp4

To preview what it will do before actually renaming, use -n. For example:

$ ls
'my movie file01.mp4'  'my movie file05.mp4'  'my movie file09.mp4'
'my movie file02.mp4'  'my movie file06.mp4'  'my movie file10.mp4'
'my movie file03.mp4'  'my movie file07.mp4'
'my movie file04.mp4'  'my movie file08.mp4'

$ rename -n 'chomp(my $new=`sha256sum "$_" | cut -d" " -f1`); s/.*/$new.mp4/' *mp4
my movie file01.mp4 -> 6a260f4adeb47000afeb9c53029ce0e14b6ea80be5c649ecdb155c8e7cfa1496.mp4
my movie file02.mp4 -> 14f24228ead10d639ef3db11ea09c6216aa80879327a2a57fb549e6474fb05b0.mp4
my movie file03.mp4 -> 6c9ecec6a75e217fa1786dd6f920a5c1db8473f17447595e0d33d7fc3530453a.mp4
my movie file04.mp4 -> 96a29ae5bc3a5e35537bcea1068c746ddba205d17fcc8e522a52402c7ed69927.mp4
my movie file05.mp4 -> 189207823129b57e52c86a743ea7154f65b8eccb5182f322abc3aae35f14057d.mp4
my movie file06.mp4 -> 93be0fd15be56bb22af94a0a0aa272d56f61e77160f1170305d41166d6135913.mp4
my movie file07.mp4 -> 05c92b5632414f14445af3facdb0e187746b3b0f40bad94a5f351aeb7f9a8847.mp4
my movie file08.mp4 -> 0d3cf9c165d4c18af8922b8daa9a6b1031c6762d179fb910b968d60af9aed255.mp4
my movie file09.mp4 -> da04afebaec6ea3d43dc3a0e66b790ab13751b00fd81aa1f882986c097c36298.mp4
my movie file10.mp4 -> 47bf532970d3e759346462a85d15ab9d9171c5a7688a6e90a1e976e071ecd167.mp4

And, to keep the original name:

$ rename -n 'chomp(my $new=`sha256sum "$_" | cut -d" " -f1`); s/.*/$_ $new.mp4/' *mp4
my movie file01.mp4 -> my movie file01.mp4 6a260f4adeb47000afeb9c53029ce0e14b6ea80be5c649ecdb155c8e7cfa1496.mp4
my movie file02.mp4 -> my movie file02.mp4 14f24228ead10d639ef3db11ea09c6216aa80879327a2a57fb549e6474fb05b0.mp4
my movie file03.mp4 -> my movie file03.mp4 6c9ecec6a75e217fa1786dd6f920a5c1db8473f17447595e0d33d7fc3530453a.mp4
my movie file04.mp4 -> my movie file04.mp4 96a29ae5bc3a5e35537bcea1068c746ddba205d17fcc8e522a52402c7ed69927.mp4
my movie file05.mp4 -> my movie file05.mp4 189207823129b57e52c86a743ea7154f65b8eccb5182f322abc3aae35f14057d.mp4
my movie file06.mp4 -> my movie file06.mp4 93be0fd15be56bb22af94a0a0aa272d56f61e77160f1170305d41166d6135913.mp4
my movie file07.mp4 -> my movie file07.mp4 05c92b5632414f14445af3facdb0e187746b3b0f40bad94a5f351aeb7f9a8847.mp4
my movie file08.mp4 -> my movie file08.mp4 0d3cf9c165d4c18af8922b8daa9a6b1031c6762d179fb910b968d60af9aed255.mp4
my movie file09.mp4 -> my movie file09.mp4 da04afebaec6ea3d43dc3a0e66b790ab13751b00fd81aa1f882986c097c36298.mp4
my movie file10.mp4 -> my movie file10.mp4 47bf532970d3e759346462a85d15ab9d9171c5a7688a6e90a1e976e071ecd167.mp4

The explanation here is a bit complicated as it requires understanding some basic Perl. The main idea is:

my $new=`sha256sum "$_" | cut -d" " -f1` : this will run the command sha256sum on each input file ($_ is Perl magic for "current thing"), and cut to keep only the hash. To illustrate:

$ sha256sum my\ movie\ file01.mp4
6a260f4adeb47000afeb9c53029ce0e14b6ea80be5c649ecdb155c8e7cfa1496  my movie file01.mp4
$ sha256sum my\ movie\ file01.mp4 | cut -d" " -f1
6a260f4adeb47000afeb9c53029ce0e14b6ea80be5c649ecdb155c8e7cfa1496

The chomp() just removes the trailing newline from the command's output. The result is stored in the variable $new.
s/.*/$new.mp4/' : substitute everything (.*) with the $new name.

Or, for the other command:

s/.*/$_ $new.mp4/' : substitute everything with the original name ($_) followed by the new one.


Can't access USB external hard drive puggled into my box with Ubuntu 20.04

I could find the answer: SMB1 is disabled by default.

To re-activate it:

Add code in the [global] section of the /etc/samba/smb.conf file:
to paste just below the line [global]

client min protocol = CORE


Recovery from hell - undeleting partition overwritten by Xubuntu 12.10 installer?

Sorry to hear about your troubles!  I found a nice little article on how to recover deleted partitions.  I've never tried it personally, but it looks promising:

http://www.dedoimedo.com/computers/linux-data-recovery.html

The software he uses is called TestDisk.  Here's the link to it:

http://www.cgsecurity.org/wiki/TestDisk

Give it a shot and let us know how it goes.

Good luck!


How to rip an audio track in flac from a DVD video?

Audacity

Install Audacity: sudo apt-get audacity
Then, play your DVD with the player you want (VLC, Totem, ...), be sure that it uses Pulse Audio for output
In Audacity, record the sound from Pulse Audio in a stereo track
Edit if necessary (face in, fade out) and export it as flac.

There is other ways. For example, you can use jackd and Ardour, if you want to record separate tracks for every 5.1 channels '6 tracks) and mix them.

VLC

Open your DVD with VLC
Select the chapter you want to rip
In options, choose the audio output -> file and select the kind of file you want (flac)
Click play
VLC will write the file


Mounting Second Hard Drive in Ubuntu 11.10

Are you setting the permissions after you mount the drive?

When you mount a drive into a directory, that directory's permission bits are changed to reflect the permissions of the drive's root directory.

The permissions of the real directory (and any contents of it) are hidden until you unmount it again.


Apparently i3 uses sh to launch stuff, and does not source $PATH from ~/.bashrc :

cat ~/.xsession-errors
(...)
/bin/sh: 1: mycommand: not found

So, just create a ~/.xsessionrc file and put something like this in it :

if [ -d "/opt/bin" ] ; then
    PATH="/opt/bin:$PATH"
fi

Then logout and back in ; It should work now.


I can connect to my web server with my internal IP, but not my external IP?

If you are connecting via a router you will have to configure that router to "forward" packets to your server. How that can be done depends on the router, sometimes you will find the setting under DMZ, sometimes under services.

It will look like:

external port (probably 80)
internal host to forward it to (192.168.0.50)
port on the destination to use (again 80)

Seth found a guide for your router: Port Forwarding the Ubee U10C022-Ambit Router for Apache


Just tried a laptop I have at home, and it worked. Keybuttons aren't recognized, but that might be a bluetooth joystick button mapping thing on a per app basis I need to investigate more.

Not sure why it didn't work on the desktop though!


boot-repair not working on hp elitebook 2170

After the repair, it should be working. Search your output for efibootmgr results. (There are three such examples, the last of which is the final state and shows an Ubuntu/GRUB entry, hence my statement that it should be working.) If it's not working at this point, I have several suggestions, which you should try in order:

Try updating your firmware to the latest version. This may get you clear of bugs in some EFIs. Note that you'll have to re-run Boot Repair once you've done this.
Try going into the firmware setup utility, locate an option to reset all the settings to their defaults, and use it. With that done, try running Boot Repair again.
(Perhaps not an option for you, given that it's a secondhand computer....) Return the computer for a refund, because it's defective. If you bought it new, I'd say to also write to the manufacturer to say why you've done so. Note that by "defective" I don't mean "sample defect," I mean "defective design."
Copy your boot loader to EFI/BOOT/bootx64.efi on the ESP. This is most easily done by launching the Boot Repair tool, entering the Advanced menu, and picking the option to copy the boot loader to backup filenames. (I don't recall the exact phrasing of the option, but it should be obvious.)

If you get to #4, it will probably work acceptably on a single-boot installation, but that's a hackish workaround for a buggy firmware that's likely to fail sooner or later if you dual-boot with any other OS.


Looking for time management / calendar software, maintained, opensource, fresh design

Kimai is a tool I used for my clients a lot:
http://www.kimai.org/

Web based open source!

Meanwhile only the times i am in the company are important, so i use TrackWorkTime from F-Droid:
http://www.zephyrsoft.org/trackworktime

It is a wifi acess point based login logoff tracking tool which makes everything automatic which i need.

But for getting all mentioned things done i would recommend redmine:
http://www.redmine.org


"To view the full contents of this document, you need a later version of the PDF viewer"

This document appears to use functions not available in the default PDF viewer (Evince) that you are using. Adobe has long stopped maintaining Reader for Linux, and removed the download links.

However, if you read this article, it is still possible to install Adobe Reader for Ubuntu. The .deb file can be found here. Hopefully, it will offer the functionality that this document requires.


Errors were found while processing: linux-image-4.15.0-36-generic

guys!

Thanks to @user535733 for the solution!

First, I uninstalled grub-common.

After, I got this message:

sudo apt-get clean E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/.

To solve this, I used sudo rm /var/lib/apt/lists/* -vf.

Finally, sudo apt-get update.
Now I can install and update apps again.

Thank you very much!


File system type and swap partition during Installation

1) Yes, you could simply install Ubuntu.

2) Yes, swap is on and you can simply use the system.

3) The partition 2 is extended partition that allows to have over 4 partitions on MBR drive. Every partition in extended partition (called "logical") has the number bigger than 4 (since numbers 1-4 are reserved to primary partitions (extended is counted as primary)). Your swap is inside the extended partition.


Install hplip-gui package with sudo apt-get install hplip-gui and add your MFP from here.

According to HP page HP LaserJet Pro MFP m127fw is fully supported.

Do not forget to install HP Driver plug-in with hp-plugin.


Is it possible to do partitioning using GParted while OS is running ?

GParted won't adjust any partition that's currently in use, but it should be able to alter partitions that are not currently mounted and create new partitions in unpartitioned areas of the disk. In some cases you can unmount a mounted partition (GParted can do this, in fact), but you will never be able to unmount your root (/) partition, and possibly not some others. If you need to adjust them, you'll need to boot from a live CD to edit the partitions.

Some other tools, such as the text-mode fdisk and gdisk, do enable you to edit partitions that are in use; however, these tools don't support filesystem resizing, and if you edit in-use partitions the kernel won't use the changes until after you reboot.

If this information isn't sufficient, you'll need to post more details about what you want to know -- what type of editing do you need to do, what are your current partitions, etc.


File manager is not recognizing the pendrive after formatting

Click on the 3 lines in the top-left corner. And then in the format disk option.

In the open window, be sure to select no partition. And select the method to format the device.

After that, click in additional partition options(gears) and select to format volume.

Choose the label name you want, and then if you'd like to erase your data and, after that, the type of format you want.


This shortcut is assigned by default to the unity task switcher as 'Go right in the switcher'
To change this, you'll need to install CompizConfig Settings Manager, then in the Desktop section, find Ubuntu Unity Plugin. Select that, and the switcher tab. Select the shortcut, and disable it.

How can I configure Unity?


After many restarts and PCI error related crashes I have my solution. Disable the onboard audio (Azalia audio on an HP mobo) and change the analog output to multichannel on alsamixer. Hopefully this helps other folks out. I was seriously worried after the crashes with BIOS errors popping up.


After a lot of searching and work it just doesn't exist. So I ended up going with Latex, come to find out for simple table printing it's not as hard as it looked. It was just a matter of learning to use margin's and how to set page sizes.

To create the latex file and for testing I used Texmaker, just seemed to be the easiest with features.

The biggest part was getting latex to margin thing's out, through help on another stack site I got the kinks out and ended up using a bash script to print the final PDF and set page size and landscape. I tried originally setting these two thing's in the latex file, but it just wouldn't work. But once I set it at the CLI to landscape and the check size it worked like a charm.

So Latex it is, seem's to be the easiest and fastest way once you know. It was so easy and fast that once I had one of my check's setup I went and copied it and setup my second bank's check's. The second time it only took me about 10 Min. to re-layout the new Tex file for the new check's.

The latex format I used was:

\documentclass[12pt]{article}

\usepackage[paperwidth=6in,paperheight=2.75in,margin=0.60in]{geometry}

\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
%\usepackage{wallpaper}
%\CenterWallPaper{1}{check53.png}

\pagestyle{empty}

\setlength{\parindent}{0pt}

\begin{document}

\begin{tabular}{ @{} p{4.05in} l @{} }
\multicolumn{2}{ l }{\hspace{3in}\textbf{#date}} \\
\rule{0pt}{0.30in}\hspace{0.30in}\textbf{#to} & \textbf{#amount} \\
\multicolumn{2}{ l }{\rule{-0.20in}{0.25in}\textbf{#letters}} \\
\end{tabular}

\end{document}

As you'll notice I have variables to replace for instance #date is the variable I replace the date with, and so forth with the other's. This allow's SED from the commandline to find them and replace real quick.

I also have wallpaper in my tex file, this is so that when testing I don't have to print out a bunch on paper and test. I can scan in my check and place it as background to the latex file, export to PDF for testing. This comes within CM's of where I needed the final at. So all in all a good way for testing.

Then the bash file was pretty straight forward, thanks to Zenity, SED and LP.

#!/bin/sh

date=$(zenity --entry --text "Date");
amount=$(zenity --entry --text "Amount for Check");
to=$(zenity --entry --text "The check is made out to");
letters=$(zenity --entry --text "Amount in Letters");

rm -f check532.pdf
cp check53.tex check532.tex
sed -i "s,#date,$date," check532.tex
sed -i "s/#amount/$amount/" check532.tex
sed -i "s/#to/$to/" check532.tex
sed -i "s,#letters,$letters," check532.tex

pdflatex check532.tex

#echo "Please put your check in the printer, right side down."
#read -p "Press any key to print... " -n1 -s
zenity --info --text "Please put your check in the printer, right side down. Then click OK to print."

lp -o media=2.75x6 -o landscape check532.pdf
rm -f check532.log check532.pdf check532.aux check532.tex

First off I use Zenity to get the parameters needed for the check; To, amount, date and the text version of amount.

Then I let SED to a search and replace after making a new copy of the file for the search and replace.  Once done I export to PDF and then print using LP commandline.

All in all it's pretty cool since I now have an icon in my Gnome bar and click it, it ask's for params then tells me to insert paper, then print's!

So it was a pain learning Latex, but I have to say until some software comes out for it this seem's to be the quickest and easiest way. Plus software might be a bit more cumbersome than just doing it this way.


Its much easier with Playonlinux.  Then you don't have to compile wine versions.  Try this

1) Download and install Playonlinux make sure you get latest version 4.0.12 see the download page for your distro at playonlinux.com

2) Launch Playonlinux  click install select internet exlorer

3) Run internet explorer then go to Onlive, signup and download setup file to desktop

4) Open Playonlinux again, select tools, then select 'manage wine versions' install version 1.3.27 rawinput on x86 and amd64 then close that window

5) On the main Playonlinux window  lick at bottom of window "Install a non-listed program"

6) Click next

7) Make sure option "Install a program in a new virtual drive" is selected and click next

8) Give it a name, e.g. "OnLive"

9) Select "Use another version of Wine" and click next

10) Select "wine 1.3.27 rawinput"

11) Browse to OnLive-Setup.exe

12) Install OnLive

13) Select the OnLive.exe, click next then type the shortcut, click next

14) Click "I don't want to make another shortcut"

And you're there :)

If you have audio problems try killing pulse audio process before launching onlive


When I reach the installation it says : "This computer currently has no detected operating systems.". What do I do to make it detect windows 8?

I see that you have somehow managed to enable "Legacy Boot" in UEFI, since you probably got here:

So, what I'd like you to do, is disable it and go back to the previous state. If you UEFI boot with a 64-bit Ubuntu image (DVD), you ought to see a GRUB menu like in this question (the OEM option won't be present, but Try Ubuntu and Install Ubuntu will be.):

To get a 64-bit image, download the AMD64 (or AMD64 + Mac) ISO from http://cdimage.ubuntu.com/releases/trusty/release/. Only the 64-bit version currently supports UEFI, and you are most likely to detect Windows 8 using it, with regular UEFI boot.


The simplest way to add shortcut to launcher, open your dash > search for the desired software > simply drag them to launcher and  you are done.


You have to install the 32-bit package with mentioned library by using commands below:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libx11-6:i386

and then try to launch the application. If issue persists with another library - repeat the search process again and install more libraries.


What is the structure of an Ubuntu repository?

Joao answered the second half of my question, so I investigated the first half on my own. At the root level, there are four directories and one file.

root
| -- dists
| -- pool
| -- indices
| -- project
| -- ls-lr.gz

(Also in my college repo, only the first two entries were there. So the last 3 seem to be non-essential to the functioning of the repo.)

The file ls-lr.gz contains the output of the ls -lr command as run on the repository root directory.

The dists directory seems to contain most of the metadata, including all the packages.gz file (which contains a list of packages) and Release.gpg/Release which signs the package. (Thanks to Joao for the info)

The pool directory contains the actual .deb files. The organization is /pool/[section]/[letter]/[group]/packagename.deb. Thus the actual location of the python-subversion package is /pool/main/s/subversion/python-subversion_1.3.2-3ubuntu2%7edapper1_amd64.deb, because subversion is the group of the python-subversion package, and s is the first letter of subversion.

The projects directory seems to contain a few files detailing how the mirror was synced to the original repo.

The indices directory contains many files, most of them empty. The non-empty files seem to supply some extra metadata for packages.


No such file or directory: '/usr/lib/python2.7/sitecustomize.py' but it is there in red color

A red name in a black background means that a file is a link to a non existent file. Please, see this question for ls output color meanings.

That means that you probably have moved the linked file or deleted it.


Deja dup can't restore files after ubuntu 17.10 upgrade

Assuming you are using a NAS drive for back-up:

Open Files application (i.e. the Ubuntu file manager)
Select 'Other Locations'
Select your backup NAS drive
Right-click on the folder/share you use for backups on your NAS and select 'Mount' (the share/folder will now appear in your favourites/shortcuts)
Open Backups application (i.e. Deja-dup)
Select 'Storage location'
In  dropdown list for 'Storage location' select 'Local folder' then select 'Choose folder'.
Navigate to 'Other Locations' and then the folder/share you mounted at step 4.  Select any relevant subfolder you stored your backup in previously.
Select 'Overview' from menu and then select 'Restore'
The 'Restore from Where?' dialog box should show the folder you selected at Step 8.  If not select 'Choose Folder' and then navigate to required folder.
Select 'Forward.'  You should now be at a point where you can restore.

I too found this process counter-intuitive; as did the poster of this similar question: Duplicity - storage location not available, waiting for Google.


Use Google Keep instead. It is much more robust and scalable.


Try this:

The network card configuration file of Ubuntu system is /etc/network/interfaces.

In the terminal run:

exec sudo -i
cat /etc/network/interfaces

Sample output:

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

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens3
iface ens3 inet dhcp

As you see in the above output, the Interface is DHCP enabled.

To assign an additional address, for example 94.23.76.87/24

Edit file /etc/network/interfaces:

exec sudo -i
nano /etc/network/interfaces

Add additional IP address.

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

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens3
iface ens3 inet dhcp

iface ens3 inet static
address 94.23.76.87/24

Save and close the file.

Run the following file to take effect the changes without rebooting:

exec sudo -i
ifdown ens3
ifup ens3


bonding virtual network interfaces in ubuntu

To bond two virtual interfaces eth0:1 and eth0:2, to create an auto failover interface, try this:

Open a terminal,Press Ctrl+Alt+T

Run it:

To enable bonding You must install the ifenslave package:

sudo apt-get update
sudo apt-get install ifenslave

To configure it, You must modify the /etc/network/interfaces file:

sudo nano /etc/network/interfaces

In the open file modify the followings lines:

auto bond0

iface bond0 inet static
    address 10.31.1.5
    netmask 255.255.255.0
    network 10.31.1.0
    gateway 10.31.1.254
    slaves eth0:1 eth0:2
    bond_mode active-backup
    bond_miimon 100
    bond_downdelay 200
    bond_updelay 200

Ctrl + O, save file. Ctrl + X, close nano.


IMHO, Ubuntu creates an EFI System Partition (ESP) that's a fraction of its proper size. I recommend creating an ESP in the range of 100-500 MiB, depending on various factors; but Ubuntu tends to make them under 50 MiB, IIRC. Ubuntu also creates FAT-16 ESPs, but the Windows installer flakes out when presented with FAT-16 ESPs -- it wants to see a FAT-32 ESP. These problems can be overcome by pre-partitioning (or at least creating the ESP ahead of time). Be aware, though, that Ubuntu 11.10 and earlier always erase the ESP, which wipes out other OSes' boot loaders. This problem has been fixed with Ubuntu 12.04. Thus, for an EFI install, I strongly recommend Ubuntu 12.04 over earlier versions.


I'd the same problem, it could be a driver touchpad issue.

--> Check also Here

In my case, I had a conflict between the old synaptic driver and the new libinput package. This topic helps me : Debian GNOME: touchpad settings missing. Use libinput instead of synaptics

After fresh install of libinput, I ran :

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

And my touchpad works again


Run bootable ubuntu setup on ubuntu machine without internet

Assuming you have access to the Ubuntu image, you can create a bootable usb using a tool like pendrivelinux.

If you don't, I believe it can also download the iso's automatically for you when you choose what OS you want the drive to have. Obviously, that would need to be done on a machine with internet access, like where you posted from.


Ubuntu 18.04 sound problem in some desktops only

I found a Fix for this from Ubuntu 17.10 Cherry Trail problem with sound - funny and sad

in etc/modprobe.d create file blacklist_hdmi.conf with contents:

blacklist snd_hdmi_lpe_audio
download and run this linixium sh script:

https://drive.google.com/file/d/0B99O3A0dDe67VUNMV2xfVjJKeVk/edit

in /usr/share/alsa/ucm/ create a bytcr-rt5651 folder with contents:

asound.state

bytcr-rt5651.conf

HiFi.conf

sudo alsa force-reload
rm -r ~/.pulse ~/.asound* ~/.pulse-cookie ~/.config/pulse
pulseaudio -k
reboot
open pavucontrol and set configuration profile to HiFi and change output from headphones to speakers.


Cannot purge nvidia-304 - DKMS issue returns a removal error

Try a reinstall of nvidia-304 first (sudo apt-get install --reinstall nvidia-304), then purge it afterwards.  I think this is caused by the DKMS module being missing so it couldn't remove fully, causing the error.


Ubuntu Keyring on Library Public Computers

Really, for a public terminal that's always logged in and running in this manner, you should probably write some custom config to the system for Chromium, to force the password management, autofill, and other sensitive options to off, so that personal details and passwords do not get saved. You'd also need to hide/disable the "sign into Google" feature of Chromium to enable sync.

Yes, being able to store any of this information on a public computer for any length of time, is a realistic concern. If one person were to enter their credit card details, or log into some site, and the data got saved, the next person sitting down could then access that information.


You said you're using EasyBCD. Add an entry that's Linux/BSD -> Wubi. If that doesn't work, use GRUB 2 instead of Wubi. FINALLY, if it still doesn't work, use GRUB legacy. If it STILL doesn't work, my well is dry. I hope this helps!


Hungarian accented letters without the physical keyboard

You can start the on-screen keyboard onboard

sudo apt install onboard

run the program from dash or a menu or from a terminal window

onboard &

and set the keyboard to Hungarian with

setxkbmap hu

and afterwards reset to for example US English with

setxkbmap us

You will see the Hungarian keys on the onboard keyboard, and you can use it by clicking with the mouse cursor or use your regular keyboard, now that you see which keys have the special Hungarian characters.

There are more special characters, if you press the Alt Gr key.


how to set up ubuntu in an empty partition i created on my laptop hd

Here is the full guide to a correct installation https://help.ubuntu.com/community/Installation

Try to read big lines and reply here for more specific things you may ask about.

Also, mind checking out some FAQ on Ask Ubuntu and on the Ubuntu forums


/ is your root partition. Your entire Ubuntu installation is in /. This includes all your applications, music, pictures, videos, etc. (Your personal files are usually stored in /home/(username)/). If you can clear/copy some of those to another location, you'll free up space in /.

You could also run sudo apt-get autoremove && sudo apt-get autoclean to free up a little more space

Your home directory is mounted on a 220G partition and your root directory(/) is mounted on a 7.4G partition. I'd recommend resizing the / partition (/dev/sda1) to 15G or so. You can use a tool like gparted to resize partitions.

If you don't want to resize the partition sudo do-release-upgrade *might* work.

Could you post your replies as comments on this post? Otherwise the original post gets cluttered.

In that case you should install gparted by running sudo apt-get install gparted. Then gparted & to run it.


Adding to @jpf137's answer, there is a way to make an existing live USB persistent.

Make a file in the root of the live USB called casper-rw using dd like this:

dd if=/dev/zero of=/path/to/casper-rw bs=1M count=512

Make a filesystem in casper-rw like this:

mkfs.ext4 /path/to/casper-rw

Edit boot/grub/grub.cfg on the USB. Look for the line starting with linux.
Before the -- at the end, add persistent;
so that the line's ending looks like: persistent --.

Done.


ahmetertem.  I did this yesterday using the package "mdadm":

sudo apt-get install mdadm
partition your intended drives (I let it default to ext4 for filesystem, and I used the package "gparted" for this, for your reference)
carefully note the device names of the drives you want to use (mine happened to be /dev/sda and /dev/sdc)
In Terminal:  sudo mdadm --create /dev/md0 --level-1 --raid-devices=2 /dev/sda /dev/sdc (Of course, you will use your own device names.)
It said something like "device /dev/md0 created" and the drives went nuts creating metadata, I assume.
format it:  sudo mkfs -text4 /dev/md0 (don't know if this is necessary, but it was when I first created RAID in 14.04.)
mount it:  sudo mount -text4 /dev/md0 /media/raid (that's where I wanted to put it)

My "proper answer" to your question ends here.

Aftermath and notes:
After rebooting, I wanted to mount the raid but discovered it was already mounted.  (Wouldn't do that in 14.04 without tweaking the /etc/fstab file).  I couldn't find the raid in /media/raid, but instead discovered that it was already mounted -- but where?  I found it in /media/me ("me" is my home folder name) as 023023-2341324-1234324-234134243 or something like that.

I tried to rename it, but the device was busy.  So, I unmounted it and then that long-name folder was gone.  Rebooted again.  It's back, and that long name is the same, so I tried changing the permissions and created a static link to it called "raid".  Still can't write to it, though, because of permissions/ownership troubles.

I'm sure I'll work it out in about a day.  I'll keep you posted.


Desktop environments that allow Drag'n'Drop across applications via Alt-Tab

It does work in Xmonad running on Kubuntu 11.04 - I'm not sure whether XMonad or KWin responsible for Drag'n'Drop behaviour in this case.


Disable Screensaver (Black Screen) in Ubuntu 12.04

After few days I succeed by running following codes in terminal,

gsettings set org.gnome.settings-daemon.plugins.power active false
gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
gsettings set org.gnome.desktop.session idle-delay 0

But in few articles I saw that we need do some extra works if those steps not working with your system as follows,

Add or edit .xsession file(which is located in your home directory) with following lines,

xset s 0 0
xset s off


Disable internet access only if its accessed via a VPN on Ubuntu 17

The solution is to use iptables to deny all outgoing traffic except when the traffic passes through the tunnel.
If the tunnel is broken, access to the Internet is no longer possible until the tunnel is established again.
I assume that you’re using TUN-based routing to connect to the OpenVPN server and that you’re using the redirect-gateway OpenVPN client option.
Create a file anywhere (eg /root/iptables.vpn), you have to change [VPN_IP] and [VPN_PORT] with the ip:port of the vpn server
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT

*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT

# Set a default DROP policy.
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]

# Allow basic INPUT traffic.
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT

# Allow basic OUTPUT traffic.
-A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -p icmp -j ACCEPT

# Allow traffic to the OpenVPN server and via the tunnel.
-A OUTPUT -o tun+ -j ACCEPT
-A OUTPUT -p udp -m udp -d [VPN_IP] --dport [VPN_PORT] -j ACCEPT

# Reject everything else.
-A INPUT -m conntrack --ctstate INVALID -j DROP
-A INPUT -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -j REJECT --reject-with icmp-port-unreachable
COMMIT

After the connection with vpn server is established you have to enable the rules:
iptables-restore < /root/iptables.vpn

All traffic now will be routed trough the tunnel.
EDIT
As the author write he runs the connection using a network manager like approach, so the problem is that he does not know the remote ip of the server, as it is grabbed from a pool. I think (but for now I have not the time to test this solution) that one approach may be:

Modify the previously created file (in our example /root/iptables.vpn), replacing [VPN_IP] with $route_vpn_gateway and [VPN_PORT] with $remote_port
Create a script (eg /etc/openvpn/route.sh):

while read line
  do eval "echo ${line}"
done < /root/iptables.vpn | /sbin/iptables-restore -v

(https://stackoverflow.com/questions/5289665/use-external-file-with-variables)

Modify (and then reload) your .openvpn file appending:

script-security 2
/etc/openvpn/route.sh

(How do I run a script after OpenVPN has connected successfully?)
The script will run every time the connection to the vpn is established.
As mentioned I've not tested this...
Remember to flush your iptables after closing the vpn connection


Screen flickering on Ubuntu Gnome 14.04 - 4K resolution

I think I've solved the issue by myself, I'm posting what I've done hoping that this will help someone else.

The solution is quite simple: the new kernel works out-of-the-box, this means that the instruction i915.enable_IPS=0 is not needed anymore.

So, to solve the problem, open a terminal and type:
gedit /etc/default/grub then search for the "i915.enable_IPS=0" and remove it.
Save, close and rebuild grub configuration with: sudo grub-mkconfig

Reboot and voilà!


Mobile-Broadband stick sometimes not detected at all

This is a common problem of Huawei dongles and there is no clearly recognized fix for this. Some Huawei dongles simply switches off when you put your laptop into sleep mode.
Here I'm explaining common workarounds you have.

After waking up from sleep, you have to usually remove and plug the 3G dongle back.
In most cases the dongle is re-detected automatically. If not you have to try following commands in your Terminal:

Restart the modem manager:

  sudo restart modemmanager

Wait few seconds, until the dongle is prepared, and flip it into modem mode:

  sudo eject sr1

(If you don't have an optical disc drive, change sr1 to sr0)

You can clearly identify whether the dongle is detected or not by reading the Linux kernel ring buffer. Execute this command in Terminal and plug in your dongle:

  watch 'dmesg | tail -f'

A sample output:

In the above image my Huawei dongle has been successfully detected.
You have to check whether your dongle gets detected like this after waking up from sleep.

It is known that some Huawei hardware doen't work properly without the proprietary driver.

You can install Huawei Mobile Partner software (which includes the driver) and try to establish Internet through it:

There is a higher chance that you can find the Huawei Mobile Partner available inside your dongle.

If you don't have the driver with you, heres how to download and install it:

Installing Huawei Mobile Partner 22

If you don't have Internet to the host machine, first click here & download the Huawei Mobile Partner 22 to your Home directory. Then execute the below command in Terminal:

tar -xvzf megafone.tar.gz; cd mp22-linux-64; chmod +x install; sudo ./install
If you already have Internet to your machine copy the below command into the Terminal at once and execute it:

wget -O mp22-linux-64.tar.gz https://db.tt/XtrP9KPw; tar -xvzf mp22-linux-64.tar.gz; cd mp22-linux-64; chmod +x install; sudo ./install

If your dongle is not detected by 22nd version of mobile partner, you may try installing 21 or 23.

Alternatively, you can use Sakis3G to connect your dongle to the Internet.


There is desktop settings and system settings, you seem to be in system settings.

To get to desktop settings, right click the desktop and then desktop settings then choose Layout.

I don't think any thing is wrong with the install, folder view is a widget and off by default.


Set default GPU for switchable ATI/Intel graphics

You can perhaps try and enter the command amdconfig --px-igpu in this file: /etc/rc.local


When I use wmctrl -s <workspace#>, my screen switches workspaces and shows this: openbox workspace swithcing notification (image)

If this is the thing you want to deactivate, open Openbox Configuration Manager from Menu > Preferences > Openbox Configuration Manager or by running obconf, go to the Desktops tab, and deselect Show a notification when switching desktops.


1) Install different desktop manager

More of a workaround than solution. Get to tty console, make sure you are connected (or connect with nmcli ). Install alternate desktop manager aka greeter. Examples:

sudo apt-get install gdm

sudo apt-get install lightdm-gtk-greeter

sudo apt-get install lightdm-webkit-greeter

Note: if you are getting gdm, you will be prompted to choose default greeter upon installation, chose gdm; if you're getting lightdm type of greeter, you may want to specify that in /etc/lightdm/lightdm.conf file; for example:

  [SeatDefaults]

  greeter-session=lightdm-gtk-greeter

2) Check permissions of your home folder:

In the example of this user, his home folder permissions were modified to be viewed only by him alone, and prevented the desktop manager from accessing relevant data. Get to the terminal and do ls -dl /home/yourusername. If you have permission set as -rw-------, you may want to do sudo chmod 755 /home/yourusername

3) Abandon the old username and reclaim the home folder

Change ownership first: chown -hR yournewusername:yournewgroup /home/youroldusername

Then copy the files into your new folder: rsync -r /home/oldusername /home/newusername/oldfiles
Note that if you have lots of data there, it might take a while, so don't freak out if rsync seems to hang; just let it finish doing its job first.


unable to connect to internet on ubuntu 13.10 but works fine on windows 7 on same computer

I encountered this issue a couple of times and I solved it by changing the password's encryption type. In Edit Connections, click on your WiFi network, then Edit, then head to the WiFi Security tab and double-check if it is set onto the correct encryption, e.g. WPA2 if that's what you have.

You can check what encryption is used on your Win7 install in the Network PrefPan. I hope this helps!

R.


How can I change the time zone of bandwidthd?

The source code does use and store timestamps, that are then provided to the C functions ctime() and localtime() in order to display the date at the top of the page, and at the bottom of the graphs.

These Unix timestamps are time-zone-less, the number of seconds since 1970-01-01.
To get a human readable time, ctime() and localtime() automatically adjust the time zone to be used according to your system time zone (via a call to tzset()).

Forcing the TZ the time of a command

You can force anyway the time zone to a given value just for the time of a command execution, or during a whole daemon session, like bandwidthd. The environment variable TZ is read by tzset() to adjust the timezone, if set.

First have a look at the time zone definitions in /usr/share/zoneinfo

Then for instance, cd to your home dir in a terminal, and do a simple ls -lrt to see the most recent files at the bottom of the list. Then set the timezone to Paris, France, for instance

export TZ="Europe/Paris"

and do another ls -lrt, the time should be different (if you happen to have a system configured with a timezone set to France you may want to choose another TZ!).

Now unset the TZ var, just to prevent some mistakes based on time displayed in the terminal.

unset TZ

Changing the TZ of bandwidthd

I assume you installed the bandwidthd package from Ubuntu apt-get, and you should have an init file for it to start as a service. Do a copy somewhere of the file and then edit it as root (vi or another editor)

sudo cp -p /etc/init.d/bandwidthd ~/bandwidthd.save
sudo vi /etc/init.d/bandwidthd

Near the top you see a few variables definitions

NAME=bandwidthd
DESC=BandwidthD
...

add one (eg, for Paris)

MYTZ="Europe/Paris"

then, further below in the startd() function, you should see

    cd $WORKDIR && start-stop-daemon --start --quiet \
            --pidfile $PIDFILE \
            --chdir $WORKDIR \
            --exec $DAEMON -- $DAEMON_OPTS

change it to

    cd $WORKDIR && start-stop-daemon --start --quiet \
            --pidfile $PIDFILE \
            --chdir $WORKDIR \
            --exec /usr/bin/env TZ="$MYTZ" $DAEMON -- $DAEMON_OPTS

(notice the /usr/bin/env TZ="$MYTZ" between --exec and $DAEMON).

Restart the process

sudo service bandwidthd restart

and, could take a few seconds, the files should be updated, in a browser open file:///var/lib/bandwidthd/htdocs/index.html (or the dir where the files are written) to check.


Subliminal does not work in Ubuntu 18.04

Answer that works not only for Ubuntu 18.04, Bionic but also any release with pip installed

The problem appears to be an incompatibility between the latest python stevedore package and guessit, as reported in the Debian Bug Report Logs

The solution would be to install an appropriate version of stevedore from the PyPi Repository, in order to do that

Uninstall the existing packages that you've obtained from apt by using sudo apt-get purge -y python3-stevedore
Install the PyPi version of subliminal with the appropriate version of stevedore by using sudo pip3 install subliminal stevedore==1.19.1

Now running subliminal from the terminal will let it run as usual:


Creating desktop launcher for jupyter-notebook, but it is inside a python virtual environment

The jupyter-notebook command gets attached to the terminal, you need to send it to the background, just add an ampersand & to the end of the line, like this:

jupyter-notebook &

Remember that now you need to quit the server from the web interface.


It is possible, I used to do it with outlook 2000, but I don't think newer versions of outlook are supported in a way that is sufficient for professional use.

Depending on the way outlook is used in your company, you might prefer switching to evolution, which is what I had done initially.
However, we use outlook as a mail client and have another groupware suite for calendar and tasks.

If you do not use an exchange server or if you have enabled imap on the exchange server you could use any mail client you prefer.

Generally, if most of the work is done on software running natively on linux a migration has good prospects. If you intend running most of the software via wine, I would not do it.


This answer on Super User by Denilson Sá Maia may be useful:

  which searches your user-specific PATH (which may include some of the locations whereis searches, and may not include others - it might also include some places that whereis doesn't search if you'd added to your PATH).

  whereis searches the standard *nix locations for a specified command.

$  whatis which
which                 (1)  - shows the full path of (shell) commands

$  whatis whereis
whereis              (1)  - locate the binary, source, and manual page files for a command

  Basically, whereis searches for "possibly useful" files, while which only searches for executables.

  I rarely use whereis. On the other hand, which is very useful, specially in scripts. which is the answer for the following question: Where does this command come from?

$  which ls
/bin/ls

$  whereis ls
ls: /bin/ls /usr/share/man/man1p/ls.1p.bz2 /usr/share/man/man1/ls.1.bz2


It just works.  Any drivers that were required must have been bundled in the Ubuntu install.  (I used v 12.04).