Can't get juju to deploy, problem with ec2 keypair?

Its hard to help debug this without additional information, specifically which distro your running and the console log for the instance.

From the output it looks like the instance is running, but its not ready yet.

Keep in mind t1.micros are severely penalized for performing any interesting system activity (like install java packages which bootstrap does), such that it could take a very long time (~hr) to complete the bootstrap process. We stopped using t1.micros as the defaults for juju due to performance issues.

juju being portable across cloud providers, does not use ec2 key pairs, it relies on cloud-init to install the user key.

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


The safest way to install to USB, (and ensure everything including grub is installed in the right place), is to first unplug the internal drive, boot the Live DVD or USB installer, once booted plug in the target drive and install to it.

You might want to use "something else" while partitioning to make the first partition FAT32 or NTFT so both Windows and Ubuntu can see data on it.

If you want to use the USB as an installer, (once your friends want to install Ubuntu), you can use mkusb to make the drive. It can make a persistent partition and automatically create a windows compatible partition.


How to add “Refresh” option to right click menu in Ubuntu 15.04

This PPA doesn't contain packages for Vivid and later versions of Ubuntu. The latest supported version was Utopic1.

The latest version of nautilus-refresh was for Precise2.


How do I disable the "Fn" keys on a laptop?

Press Fn+Esc will toggle between enabling/disabling Fn-key functions.

You can also press Ctrl+Shift+T.


Where can i find the changelog of a snap package

It depends on the snap in question. Snaps are different from Debian packages in the archive in that they're not necessarily open-source. They're just blobs of bits. As a result, there is no requirement to have a changelog. Even if it does have one, it may not be within the snap itself. Let's take a look at Nextcloud as an example for where you might find one. First of all, look at the info for the snap:

$ snap info nextcloud
name:      nextcloud
summary:   Nextcloud Server - A safe home for all your data
publisher: Nextcloud✓
contact:   https://github.com/nextcloud/nextcloud-snap
[...]

Visit that "contact" url and you'll find its changelog right in the root. Each tag/release also includes the changelog snippet.

However, I reiterate: this is specific to the Nextcloud snap (which I maintain). Every snap may do it differently, and the source code (and changelog) may not be available to you.


Is there a PPA with a Wayland build I can use?

I do not think there is a ppa at this point. It would also not be very beneficial right now. What I gather from the information, I have seen so far, wayland does not yet have enough feature implemented that it could be just plugged into an Ubuntu or Kubuntu Desktop.

Hence, currently it is more something for developers to test out, who probably have no problems to just build the tarball, or clone a branch directly from the git repository.


Run it with (replace <command> with the command you use to run it):

<command> & disown


Why not

{ echo -e "$Message_Success\n\n" ; cat $Path_Log_file ; } | mail -s "$Subject" "$Recipients"


X Not Starting in VMWare After NVidia Driver Installed

You should be very careful trying to mix a legitimate Dual Boot environment with a VM environment.  VMware actually makes a note in their documentation that this can sometimes lead to 'undefined behavior' in the guest VMs and lead to other problems.  In fact, they try very hard to dissuade people from doing what you're trying.

You should pick one type of setup, or the other:

Virtual Machine
Dual Boot

Sticking to one or the other will help to protect you from having to install two sets of drivers and help stop your system from having multiple incompatible driver sets installed and running simultaneously.

You should really only be doing a Dual Boot, or a VM, and not mix-and-match the two together - it causes undefined behavior and driver conflicts like this one.

  Original content of the "Remove the nVidia drivers from the VM" answer is available here.


How can I fix errors relating to the launch of the Software Center?

If the version of python is the issue, can you please post the output of sudo update-alternatives --config python? If it shows python 3.3 as the default, change it to python 2.7 and then re-install the software-center, otherwise the version of python does not seem to be the root-cause.


How to replace every nth occurrence of pattern using sed ONLY

Isn't that a basic function..

Obviously, it isn't. But it's still possible:

sed 's/a\([^a]*\($\|a[^a]*\($\|a[^a]*\($\|a[^a]*\($\|a\)\)\)\)\)/A\1/g'

More readable with -r where we can drop the backslashes:

sed -r 's/a([^a]*($|a[^a]*($|a[^a]*($|a[^a]*($|a)))))/A\1/g'

i.e. a, followed by any number of non-a, followed by either end of line, or another a, followed by any number of non-a, etc. Everything after the first a is remembered in \1.

BTW, if Perl is available, you can use:

perl -pe 'BEGIN { @A = qw(a A) } s/a/$A[not $i++ % 5]/g'

% is the modulo operator. $i is incremented with each match, negation of the modulo is 1, 0, 0, 0, 0, 1, etc., which used as the index into @A picks the correct a or A.


How to set up an autoupdated blacklist for Dansguardian?

Run the below commands on terminal,

cd /path/to/the/directory/which/contains/bigblacklist.tar.gz
tar -xzf bigblacklist.tar.gz


How can I tell whether Ubuntu One file sync is working, and what progress it is making?

In Ubuntu, the process in charge of keeping a user's file synced with
the user's cloud storage on Ubuntu One is called the "Ubuntu One
SyncDaemon". It lives in
/usr/lib/ubuntuone-client/ubuntuone-syncdaemon, and is included in a
default Ubuntu Desktop installation. In this default install a
lightweight check is made as to whether you are signed up to Ubuntu
One, and if so the syncdaemon is started automatically for you, 30
seconds after login. The syncdaemon then checks your files for local
changes, and then connects to the server; after the initial
synchronization, everything should "just work".

  A few bugs can get in the way of things "just working"; most notable
  right now are LP:651237 (which has been fixed, and we're working on
  getting it out to everybody affected) and LP:683116 (which is in
  progress and should be fixed before 10.04.2).

There are several ways you can confirm that it is working for you. The
easiest is probably to open ubuntuone-preferences, which you can
find under System > Preferences > Ubuntu One:

ubuntuone-preferences http://ubuntuone.com/p/ScT/

Note the "Synchronization complete" label; this can change to
"Synchronization in progress..." or "Disconnected", as
appropriate. Furthermore the device with the bandwidth limits controls
and the Connect/Disconnect/Restart buttons is the local computer.

Some people want more information than "working/not working"; Roman
Yepishev developed a very nice indicator for the syncdaemon, which
you can read about on his blog and install via the ppa:
ppa:rye/ubuntuone-extras. It looks like this:

roman's indicator http://ubuntuone.com/p/J4U/

You can get a little more detail by opening a terminal and typing
u1sdtool --status. Note that is u-one-ess-dee (for Ubuntu One Sync
Daemon), not u-ell-ess-dee. One piece of valuable information you
can get from u1sdtool is the progress of individual transfers, as
you can see:

u1sdtool http://ubuntuone.com/p/Scd/

Another way is by installing
magicicada

If you're in 10.04 LTS, you can grab it off ppa:chicharreros/ppa.
magicicada connects you straight into the firehose of information
put out by the syncdaemon, so beware:

magicicada http://ubuntuone.com/p/Scc/

the future

In the brainstorm that inspired this Q/A, solution #1 looks very nice, but is
probably beyond what we can build right now (but we'd take
patches!). A variation of this might be possible by abusing the
emblems a little; it's currently being looked into.

Solution #2 has a problem that as far as I can tell makes it
unimplementable: progress of the file sync as a whole is very hard to
present to the user in a meaningful way, because the "whole" can and
will change during the synchronization process.

Solution #5 is what is coming in 11.04: we're integrating syncdaemon
with the zeitgeist engine, and will be using zeitgeist to help us
aggregate the events when necessary and present the user with useful
status information (rather than the deluge that was the applet). The
majority of this work still needs to be done, so unfortunately there
is nothing to show.

If Ubuntu gained a unified way of reporting progress),
we'd work to interface with that; this would presumably give us
notifications for large up/downloads as well


Ubuntu 16.04 secodary harddrive is not acessible after login

Thanks to the @user535733 comment I've added my new hard drive to the /etc/fstab. I follower this article:
https://www.maketecheasier.com/fstab-automount-hard-drive-linux/

How to make drive accessible right after sign in (log in )


Creating startup program for all users 12.04 - only working for 1 user

For all users, try with:

sudo cp /usr/share/applications/chromium-browser.desktop /etc/xdg/autostart

or with:

for user in /home/*; do sudo cp /usr/share/applications/chromium-browser.desktop $user/.config/autostart/; done

The tilde character (~) refers to your home directory, so ~ it's equivalent with /home/your_username, which mean that you created that startup program only for you.


Run program through terminal with custom name

You can add an alias for the command. Open your terminal with ctrl+alt+t and type:

nano ~/.bashrc

Find alias section and add alias:

alias ge='gedit'

Changes will take affect in the new terminal.


How to make bootable usb stick for Ubuntu Studio Eoan Ermine 19.10

At the moment, Ubuntu 19.10 looks raw and unstable, there are reports of installation problems. Created the issue on Multibootusb repo https://github.com/mbusb/multibootusb/issues/478.


How do I install 10.04 wallpapers on 11.04?

As jokerdino mentioned , it is only available for Precise and Quantal. You can download the .deb package here.

ubuntu-wallpapers (0.31.3) lucid


Recover only Java source code in photorec

Both, .java, and .html files are plain text files which will be recovered as such. Because PhotorRec only recovers file content but not file names (or extensions) we can not further narrow the recovery down.

It would be possible to add a custom file type to the recoverable files from PhotoRec which then will be given an approptiate extension on recovery but this needs files with a special signature (which usually is not the case for plain text files). Only if your source files had an own unique signature you may be able to do so.

Depending if your broken drive still allows this you may get better results in recovering files or directories from TestDisk because then filenames will be recovered too.


I used GParted in Ubuntu to reformat my partitions, now windows won't boot!

Have you tried using Boot-Repair?

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

It will automatically try some fixes for you.


From the Debian Policy Manual, chapter Control files and their fields:

  The fields in the general paragraph (the first one, for the source
  package) are:

  Source (mandatory)
  Maintainer (mandatory)
  Uploaders
  Section (recommended)
  Priority (recommended)
  Build-Depends et al
  Standards-Version (recommended)
  Homepage
  Vcs-Browser, Vcs-Git, et al.

  The fields in the binary package paragraphs are:

  Package (mandatory)
  Architecture (mandatory)
  Section (recommended)
  Priority (recommended)
  Essential
  Depends et al
  Description (mandatory)
  Homepage
  Built-Using
  Package-Type

Clearly, neither Version nor Architecture belongs in the first paragraph (the source package one). Version doesn't belong in debian/control at all. The version is determined from debian/changelog, and only the final package's generated DEBIAN/control will contain Version.

Looks like some file in debian, probably debian/changelog, isn't properly created. It uses PACKAGE as the package name, where it should be brightness-controller. Package names are always lower-case.


How to create and use casper-rw in different USB with a live usb

The above answer is probably the simplest but if you want more than 4GB persistence:

Boot Live CD or Live USB.

Plug in flash drive.

Start gparted.

Create 2 GB FAT32 partition, (on the left side of the bar). (size is optional, extra space can be used for file storage and transfer to Windows machines).

Create a 4 GB ext2 partition to the right of this, labeled it "casper-rw". (ext3 and ext4 also work).

Create a partition in the remaining space and label it "home-rw". (optional, creates a separate home partition)

Close gparted.

Un-mount and re-mount flash drive.

Start "Create a live usb startup disk", (usb-creator).

Select "Discard on shutdown".

Press "Make Startup Disk.

When usb-creator finishes replace the contents of the file syslinux.cfg with:

default persistent
label persistent
  say Booting a persistent Ubuntu session...
  kernel /casper/vmlinuz
  append  file=/cdrom/preseed/ubuntu.seed boot=casper persistent initrd=/casper/initrd.lz quiet splash noprompt --

Shutdown, remove CD, reboot.

First time booting you can go to users and groups and create an account with yourself as an Administrator, with password if desired.

Note:
The above code will bypass the Try/Install and Language screens.


Why is Wine not installable on my system?

I've been having the same issue, it turns out that with newer versions of apt and dpkg they support a feature called "Multi-arch". In simple terms, you can specify that apt pulls package info from repositories for architectures other than the native install, and install multiarch compatible packages from those repos.
For more detailed information, see:
http://wiki.debian.org/Multiarch/HOWTO

Your issue specifically, is that the wine1.5-i386 is in the 32 bit wine repository, but not in the 64 bit repo, and your dpkg/apt are not configured to deal with this for some reason. To resolve:

Check your native architecture with:

sudo dpkg --print-architecture #in your case this should return 'amd64'

Other available architectures can be shown by:

sudo dpkg --print-foreign-architectures #in your case this should not return anything

So you need to configure a new foreign architecture (quantal/12.10 or newer***):

sudo dpkg --add-architecture i386

Check your new arch is now available, update and install your package with apt:

sudo dpkg --print-foreign-architectures #now this should return 'i386'
sudo apt-get update; sudo apt-get install wine1.5 #and away you go!

=======

***Note that the Ubuntu dpkg in natty (1.16.0~ubuntu7 (reports 1.15.8.10)), oneiric and precise (1.16.1.2ubuntu7) uses a different syntax:*

echo "foreign-architecture i386" > /etc/dpkg.cfg.d/architectures


How to allocate unallocated disk space with GParted Live?

You might look at the following article to see how to configure VMWare to boot GParted Live: How to: Use Gparted, VMWare to Increase /dev/sda Partition (LVM).  You can ignore the LVM stuff, but pay attention to setting the bios.bootDelay = "5000" and "Use ISO image file" to boot GParted Live.

The steps in GParted Live are:

Grow the end of the Extended partition sda2 to the end of the disk.
Move swap logical partition sda5 to the end of the disk.
Shrink the start of the Extended partitoin sda2 to be next to the swap partition (leave 1 MiB of unallocated space for the EBR needed in an MSDOS partition table).
Grow the end of the ext4 primary partition sda1 to butt up agains extended partition sda2.

Before editing your partition table I highly recommend you make a backup of all your data just in case anything goes wrong, such as encountering a software bug, hardware failure, or a power outage.


Is it possible to schedule trash cleaning?

There is a tool for that: autotrash
pip3 install --user autotrash

(there is no apt install anymore) A cron job with
@daily ./home/rinzwind/.local/bin/autotrash -td 10

will once a day delete your trash. The -d deletes file older than 10 days. Adding -t will delete for all users. It has a couple of more features (like deleting based on entry and filesize, or on what is currently free in the trash).
There is also trash-cli
sudo apt install trash-cli

and
@daily /usr/bin/trash-empty

will delete trash once a day.

$ pip3 install --user autotrash
Collecting autotrash
  Downloading autotrash-0.4.1-py3-none-any.whl (22 kB)
Collecting arrow<0.18.0,>=0.17.0
  Downloading arrow-0.17.0-py2.py3-none-any.whl (50 kB)
     |████████████████████████████████| 50 kB 2.2 MB/s
Requirement already satisfied: python-dateutil>=2.7.0 in /usr/lib/python3/dist-packages (from arrow<0.18.0,>=0.17.0->autotrash) (2.8.1)
Installing collected packages: arrow, autotrash
  WARNING: The script autotrash is installed in '/home/rinzwind/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

and ...
rinzwind@discworld:~/.local/bin$ ./autotrash -td 10
rinzwind@discworld:~/.local/bin$


I have used crtmpserver thoroughly  , I know that _checkbw error . Although I dont know how to fix that yet but you can alternatively used the following ffmpeg command st stream to crtmpserver on rtsp and play it back from any media player including VLC and  android native media player .

ffmpeg -re -f video4linux2 -s 640x480 -i /dev/video0 -pix_fmt yuv420p -r 20 -c:v libx264 -q 1 -f rtsp -metadata title="aaa" "tcp://<server ip here>:5554"

also you can play it back via

vlc rtsp://<server ip here>:5554/flvplayback/aaa

PS : Be sure to allow traffic for these ports on the server .


You can do it simply by create symbolic link to nodejs:

First check if nodejs exist:
ls -l /usr/bin/nodejs

The create symbolic link:
sudo ln -s /usr/bin/nodejs /usr/bin/node


How can I completely remove the KDE 5.6 Plasma desktop from Ubuntu 16.04 and restore Unity?

Removing a desktop environment completely is never recommended, since it can break packages that Ubuntu or other DEs depend on. In fact, it's not really recommended that you install a second DE in the first place. If you install a DE, you should really be prepared to either reinstall Ubuntu or just keep the DE installed.

You can use the command below to remove most/all of the Kubuntu/Plasma/KDE packages. Please keep in mind that things can break.

sudo apt-get purge '^kde' '^kubuntu' '^plasma'


How to uninstall Java 7 binaries installed from Oracle?

I followed the instructions on this answer: https://askubuntu.com/a/185531/63030

Only thing I did different was that Java's files were in /usr/local/java and not /usr/lib/jvm.


Transfer files between host and guest using virtio-serial

A new solution is under development:  virtio-fs.
Not using network but FUSE.

Still not sure if it's usable in Windows guests.

PDF: Virtio-fs for Kata Containers storage


Error while moving old database out of the way

There is a wrong Symbolic Link (confirmed bug).

These commands solved the problem, in my case.

sudo mv /var/cache/app-info/xapian/default /var/cache/app-info/xapian/default_old
sudo mv /var/cache/app-info/xapian/default_old /var/cache/app-info/xapian/default

I think giving full permissions to a software database folder is not a good idea.

You may need to do this every time that you add a new repository.


How do I install my HP printer through network?

Maybe you could try to find your printer through the normal printer dialog. You can find the dialog in the upper right 'gear' menu.

Click on + Add, then go to Network printers and then select your printer.


How To Select The Same Files In Two Different Folders

What you're probably looking for is:

rsync -a --existing source/ destination

Here, the --existing option ensures that only files already present in the destination directory are copied from the source directory

-a makes the copying recursive and preserves symbolic links, special & device files, modification times, group, owner, and permissions

If you want to perform a dry-run to see what will be copied, use:

rsync -nav --existing source/ destination

In either case, notice there is no slash after specifying the destination directory.


jcontrol is a simple console program to control julius running on other
       host via network API. It can send command to Julius, and receive
       messages from Julius.

       When invoked, jcontrol tries to connect to Julius running in "module
       mode" on specified hostname. After connection established, jcontrol
       waits for user commands from standard input.

       When user types a command to jcontrol, it will be interpreted and cor-
       responding API command will be sent to Julius. When a message is
       received from Julius, its content will be output to standard output.

For the details about the API, see the related documents.

The hostname is a required parameter and as your output specifies, the default port number is 10500.

OPTIONS

        hostname
          Host name where Julius is runnning in module mode.

        portnum
          port number (default: 10500)

It's also clear the julius must be installed and running in module mode on the host specified on the command line.

Sources:

http://manpages.ubuntu.com/manpages/xenial/man1/jcontrol.1.html

http://www.jcontrol.org/documentation/index_en.html


How can I increase the size of icons and fonts in Kubuntu?

Go to System Settings by clicking K button on the left bottom.

You will have a menu like this:

Go to Application Appearance  and then there go to Icons and Advanced. There you can change Icon size.

Kde WIKI

For changing fonts again from System Settings Menu go to System Administration and then Font Management

You can change fonts and their sizes there.


Ubuntu 13.10 boots to terminal (tty1) first?

I had a similar problem after upgrading from 13.04 to 13.10. The computer would boot into tty1, waited around 30 seconds, and then would resume normal Ubuntu login screen into lightdm / graphical.

Thanks to an Ubuntu Forums' user (http://ubuntuforums.org/showthread.php?t=2182699) the solution for both of us was to remove the installed HP printer and also the "hplip" package. After a reboot, one could add the printer back, via System Settings>Printers>Add.

Boot is back to normal: a quick flash of tty1 login and then comes the prompt for normal Ubuntu login.

HTH


Stuck in login screen after 15.04 upgrade

You can login via the command line from the login screen by hitting Ctrl+Alt+F1
You can get back to the GUI with Ctrl+Alt+F7
This might make it easier to troubleshoot the problem.

The last time I had this issue I moved all of the hidden files out of my user account into a temp folder and it fixed the problem. Then I started copying them back in until I found which one was causing the problem. I think it was something in ~/.gconf


Packages are not installling on ubuntu 12.04

Run :

sudo dpkg -r nginx-common

If it is successful or not run:

gksudo gedit /var/lib/dpkg/status

In the resulting gedit remove the whole section starts with:

Package : nginx-common

then run the installation


Dependency is not satisfiable: python3 (>= 3.9~)

The package you are trying to install requires Python 3.9 or above.
https://packages.ubuntu.com/search?keywords=python3 says that Ubuntu 21.04 has python version 3.9, whereas Ubuntu 20.04 has Python 3.8 by default. You would need Ubuntu 21.04 to use the package you were trying to install.
You can also install Python 3.9 in supported LTS versions of Ubuntu with the Deadsnakes PPA, but the name of that python package will be python3.9, and the package you were trying to install will probably still refuse to install (because it requires python3 to have a version >= 3.9). In that case, you would have to download the source package, and rebuild it to work with python3.9 (that is a lot of work).
If you let us know about the package you were trying to install, we can try to help you install it.
You should not try to install .deb files built for one version of Ubuntu in another version (see this question). That may break dependency cycles, and you would have to reinstall to fix it.


Should I upgrade to ubuntu 14.10 Utopic Unicorn?

Don't upgrade to 14.10 unless you are prepared to upgrade every six months. 14.10 and future releases until the next LTS only have security support for nine months. If you do not upgrade to each successive release on the 6-monthly schedule, you will end up without support.

Another good way of thinking about this is backwards. When was the last time you upgraded before 14.04? Was it more than six months ago? In that case, 14.10 is probably not for you.

I say this because I see questions from users on older interim releases that are no longer supported. Since they did not upgrade on the six-monthly cadence, with hindsight they would clearly have been better off sticking to an LTS release.


There are two ways you can instruct VLC to quit playback after the playlist is played fully:

By supplying the --play-and-exit CLI option, e.g.:

cvlc --play-and-exit audio1.mp3 audio2.mp3

or

vlc --play-and-exit audio1.mp3 audio2.mp3

or creating a bash alias (in ~/.bashrc):

alias cvlc='cvlc --play-and-exit'

By adding the dummy item vlc://quit to your playlist, e.g.:

cvlc audio1.mp3 audio2.mp3 vlc://quit

or

vlc audio1.mp3 audio2.mp3 vlc://quit

Source: https://stackoverflow.com/q/10249261/1708932


If you're comfortable with the terminal, you can change the default locations of the documents and media directories any time after installation with the xdg-user-dirs-update command. Assuming your HDD is mounted as /mnt/bigdrive:

xdg-user-dirs-update --force --set DESKTOP /mnt/bigdrive/Desktop
xdg-user-dirs-update --force --set DOWNLOAD /mnt/bigdrive/Downloads
xdg-user-dirs-update --force --set TEMPLATES /mnt/bigdrive/Templates
xdg-user-dirs-update --force --set PUBLICSHARE /mnt/bigdrive/Public
xdg-user-dirs-update --force --set DOCUMENTS /mnt/bigdrive/Documents
xdg-user-dirs-update --force --set MUSIC /mnt/bigdrive/Music
xdg-user-dirs-update --force --set PICTURES /mnt/bigdrive/Pictures
xdg-user-dirs-update --force --set VIDEOS /mnt/bigdrive/Videos

The --force parameter will create the new directories if you haven't already created them manually.

If you already have contents in those directories, you'll need to move them manually and you'll probably want to delete the original directories in your home directory (or replace them with links to the new directories) to clear the clutter and avoid confusion.

I like to leave DESKTOP on the SSD (in this case, leave out the --set DESKTOP command above) and keep media I'm actively working with there, so you can take advantage of SSD speed while e.g. editing a video.

You can also assign the whole /home directory tree to your HDD during installation, but then it'll slow you down ever so slightly while doing common operations that read/write from/to anywhere under the home directories like $HOME/.config/.


Install CompizConfig Setting Manager from Ubuntu Software Center or through apt-get.
In CompizConfig, under the category "Desktop", go to "UBUNTU UNITY PLUGIN".
In that, under "General", you will find "Panel Opacity".
In that you can select Opacity varying from 1.0000 to 0.0000....
And to properly get result you may log out or restart your device..


connect to wifi from console without retry on wrong pwd

Well, it was simplier than I thought.

using the --wait option with a bit of tuning for the time prevent the popup.


Special directory permissions for new user

You can do this using different permissions.  Presumably, if you remove read permissions to /home for others and for the group.  This way, only the superuser will have access to read.
I tested this by creating a new user for which I assigned a folder other than the default folder.  As I was testing, I did in a folder other than my system's /home folder in case I messed up.  Here is the step-by-step of what I did and it seems to have worked:

I created a folder /private_home
Under /private_home I created another folder called user1.
Created a standard user called user1.
Assigned folder  /private_home/user1 as the home folder for the user using: sudo usermod -d /private_home/user1 user1.  This moves the home folder of user1 from /home/user1 to /private_home/user1.
Then changed the access privileges to /private_home as follows: sudo chmod 711 /private_home.

Now, when login in as user1 using su user1 I logged into that user's folder /private_home/user1 but when I try cd .. I am able to get to that folder (the shell prompts shows that) but I have no permissions to read the folder contents.  That is, when trying ls it says `Permission denied'.
Presumably you can do the same thing for all your users for that /private_home folder.
Having said so, I would not do this with / as you will run the risk to make your system unstable.
Note: I used some of the concepts in the answer in this post.


I start the operating system and it waits (ubuntu 18.04)

hello guys i have solution for that problem.

enter next filed: /lib/systemd/system
  uses next comand: vi dnsmasq.service

and add next

after=network-online.target
wants=network-online.target

in cli run next comand:
  1- systemctl enable systemd-networkd-wait-online.service.
  2- systemctl enable dnsmasq.service.
  3- systemctl start dnsmasq.service.
    3.1) last comand you have problem use next comand for configurate dns
          curl -l https://install.pihole.net | bash


Can't Install VLC In Ubuntu 16.04 [ERROR]

Short answer: You're trying to install vlc in version 3.0.0, but the vlc package depends on vlc-nox (and maybe others). apt can't find a vlc-nox package in version 3.0.0 in the repositories you configured, only one in version 2.2.4. Also, you're trying to install a vlc package meant for Ubuntu 16.10 on Ubuntu 16.04, which may cause problems.

Long answer: Packages can depend on other packages. To install vlc, you need to install vlc-nox (VLC to use without a graphical interface, "no X") as well in a corresponding version. If you, for example, want to install vlc in version 2.2.0, you need vlc-nox in version 2.2.0.

apt tries to install the latest version of a package it can get from the repositories you have configured. In your case, that is vlc 3.0.0~~git20160525+r64784+62~ubuntu16.10.1. So you would need a 3.0.0 version of vlc-nox as well. But the latest version of vlc-nox that's available from your repositories is 2.2.4-4.

Also, the 3.0.0~~git20160525+r64784+62~ubuntu16.10.1 version is meant for Ubuntu 16.10, not Ubuntu 16.04. It's always a gamble to use packages that were build for different Ubuntu versions. It may work, it may not work.

So you need to check the repositories you have installed. There might be a repository that's meant for a later Ubuntu version and doesn't work on your version.


I am assuming you are talking about data in userspace (essentially stuff that lives below /home/x3oo ).
You want to probably avoid syncing everything: There is little point in dragging cache files around. So as people have commented, you need to figure out what files you want to sync.

If it's just about firefox browser history, passwords, open tabs etc. you should look into the firefox sync. Since you indicat that you are uncomfortable with cloud storage you could also consider the more general File Synchronizer Unison. It will do most of what you need.

Unison can be set up to run automatically, on certain directories, exclude certain files, keep some backup copies and do your laundry. If you find unison might work, come back with questions about it for your particular situation.


Not able to successfully flash Snappy Core image to BBB eMMC.Image too large?

The issue is that Ubuntu Core 15.04 images are a fix 4Gb size (most of the size is void though). You can build your own image with the bbb armhf kernel and the correct bbb gadget snap as in https://developer.ubuntu.com/en/snappy/start/raspberry-pi-2/ (head over to the "Building your own image" section). ubuntu-device-flash has a way to set the size parameter.

This is going to be less a problem starting with Ubuntu Core 16.04 as the default size would be only a few hundreds of Mb, and the first boot is going to resize to available space dynamically. If you want to play with this, a first image is available at http://people.canonical.com/~mvo/all-snaps/bbb-all-snap.img.xz. Be warned though that those ones are under heavy development and not suitable for production (some breaking changes happens daily) :)


Install ADT Eclipse "You are installing software that contains unsigned content"

This is expected, and explained in ADT site:

  Read and accept the license agreements, then click Finish.

  If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.

Many Eclipse plugins are unsigned, and this is just one of them. (See also a similar question in Stack Overflow)


customized Ubuntu 14.04 - DNS doesn't work

I had the same problem in 12.04 once. I tried the following to solve the issue.

I've renamed the resolv.conf file:

$ cd /etc
$ sudo mv resolv.conf resolv.conf.backup

I've also commented out the dnsmasq from the NetworkManager.conf file with

$ sudo nano /etc/NetworkManager/NetworkManager.conf

by putting a "#". It ended up:

[main]
plugins=ifupdown,keyfile
#dns=dnsmasq

[ifupdown]
managed=false

Then I restarted the network-manager service

$ sudo restart network-manager

If that does not work, I would like a output from the nm-tool(NetworkManager Tool) you need to run.


Boot problems, win8,win10,ubuntu, efi, gpt

well, many thanks for the information shared in the answers section, I was able to recover win10, not win8 but I can now dual boot win10 and ubuntu, I used diskgenius, to create the MS reserved 16mb partition, 100 mb efi fylesystem partition and used a recovery boot cd/dvd tool and used the command:
bcdboot C:\Windows /l en-us /s k: /f ALL
disk letters need to be checked first
I found many websites with instructions but I did know what I had to fix, until I fixed all of the above I was able to boot my pc again (did not know windows used 3 partitions,   ms reserverd, efi abd C:), I had to install ubuntu on its own HDD to be sure it was going to boot, many useful commands are found here
Repair dual boot problems, windows


Dual Boot Win7/Ubuntu 12.04 hd0 out of disk error

After reading your comments, I have found that, unfortunately, it means your hard disk is malfunctioning at a very low level. If you could find another hard disk(bigger than the damaged one), and a Ubuntu live CD, you can try to get files from the disk(this assumes the failed disk is /dev/sda and the good disk is dev/sdb, and the main partition is /dev/sdb1, which is EXT4.:

sudo apt-get install ddrecue
mkdir /mnt/sdb1
mount -t ext4 /dev/sdb1 /mnt/sdb1
ddrescue /dev/sda /mnt/sdb1/sdaimage.dd /mnt/sdb1/sdaimage.dd.log

You may interrupt the last command fir any reason, and due to the logfile, it will resume at the same location. Feel free to run it a few times so that it can try to re-read bad areas.

Now, let's try to mount:
Get the info associated with the analysis in testdisk.

Now, we need to mount. Find the offset of the partition with all of your data(If you post the testdisk output, I can give you that), and use it as <offset> is the following command:

mkdir /mnt/recover
mount -o loop,ro,offset=<offset> hda.img /mnt/recover

Hopefully, your data is in /mnt/recover.

If it fails, there is another method I can add if you need it.


When you create user using adduser what happens on the system?

To know more about adduser options visit : Link
Well to change a user from ordinary user to system user use usermod -s option :
usermod -s /bin/false userName

I would suggest you also to visit : Site
bin/false :

Many times you will have a system where you need a user to exist in the account database (say, /etc/passwd) but don't want to give them shell access to your machine(s). A common solution to this is to set a user's shell to /bin/false. This has the effect of rejecting shell login attempts over ssh, telnet, or other shell-requesting protocols. It may have other side effects too, but those are beyond the scope of this article.
Simply using /bin/false as someone's shell does not keep them from using said account to authenticate over ssh and using non-shell tools such as port forwarding. A default configuration in sshd will often allow tunneling and other non-shell activity.

Reference


apt-get clean doesn't remove .lz4 files in /var/lib/apt/lists

How to remove those files

It's not a good idea to remove these files unless you're really hurting for temporary disk space or you're not going to update the system's software ever again.

If you're sure that there are no APT activities taking place, including the automatic security updates you may have set up while installing Ubuntu or the automatic you-have-updates warning window, you can remove them as follows:

sudo rm -r /var/lib/apt/lists

The next time you run sudo apt-get update, that directory's structure will be automatically recreated for you.

Why doesn't sudo apt-get clean remove those files?

sudo apt-get clean won't remove any files at all in /var/lib/apt/lists, except for those in /var/lib/apt/lists/partial. This can be seen as you pointed out with sudo apt-get -s clean:

$ sudo apt-get -s clean
Del /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/lib/apt/lists/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin

Note that /var/lib/apt/lists/* isn't listed for deletion.

This is done because the files it deletes don't prevent any APT commands from successfully running. It just has the possibility of slowing them down when things have to be redownloaded.

Deleting /var/lib/apt/lists/* actually causes errors with sudo apt-get install and apt-cache until you run sudo apt-get update again. It also makes sudo apt-get update take much longer, since it can't skip downloading files that haven't changed.


Where can I find the logs of IRC Charm School?

IRC Logs are always posted here:

https://juju.ubuntu.com/CharmSchool

I have the log for this specific session here:

https://gist.github.com/1424323

You'll want to filter out the /joins and /parts, but have fun, and enjoy reading!

There is also the entire channel log available here on irclogs.ubuntu.com


Is it possible to use Wubi to download an older version?

The ubuntu version to download is hard coded into the wubi.exe

You can download older versions from sourceforge

http://sourceforge.net/projects/wubi/files/Wubi/

I would use http://sourceforge.net/projects/wubi/files/Wubi/Wubi-8.04.503/Wubi-8.04.1-beta-rev503.exe/download


Ubuntu has an older version of hplip drivers, but better to download newer version if newer printer or even if older it may have bug fixes.

HP's newest On this website you can download the HPLIP software which supports 2,211 HP printers on nearly any Linux distribution available today.

http://hplipopensource.com/hplip-web/index.html

Ubuntu's older version

sudo apt-get install hplip-gui
gksudo hp-setup

new version

hp-upgrade

I also get no system tray error but have ignored them without issue.

No system tray error:
open up the "startup applications" editor from the admin menu.
add a new program, for the command put:

sleep 10;/usr/bin/hp-systray


How to start nautilus maximized from command line?

1. Start up nautilus with a maximized window

To start nautilus with a maximized window, you can use the script below:

#!/usr/bin/env python3
import subprocess
import time
import sys

def w_list():
    try:
        pid = subprocess.check_output(["pgrep", "nautilus"]).decode("utf-8").strip()
        w_list = subprocess.check_output(["wmctrl", "-lp"]).decode("utf-8").splitlines()
        return [l.split()[0] for l in w_list if pid in l]
    except subprocess.CalledProcessError:
        pass

relevant1 = w_list()
subprocess.Popen(["nautilus", "--new-window"])

t = 0
while t < 30:
    time.sleep(0.5)
    relevant2 = w_list()
    if all([relevant2 != None, relevant1 != None]):
        new = [w for w in relevant2 if not w in relevant1]
        if new:
            subprocess.Popen(["xdotool", "windowsize", new[0], "100%", "100%"])
            break
    relevant1 = relevant2
    t += 1

How to use

The script uses both xdotool and wmctrl, the first one to list new windows of the targeted application, the last one because I prefer the way xdotoolresizes windows.

sudo apt-get install xdotool wmctrl

Then copy the script above into an empty file, save it as start_maximized.py
Test- run the script by the command:

python3 /path/to/start_maximized.py

Now nautilus will start up with a new maximized window.
Add, if you like, the command as a quicklist (right- click) item to the Files (nautilus) launcher in the Unity Launcher.

2. Generalized version; start up any application maximized

You can startup any GUI application (+ their arguments) in the generalized script below:

#!/usr/bin/env python3
import subprocess
import time
import sys

appcommand = sys.argv[1:]
app = appcommand[0]
startup = (" ").join(appcommand)

def w_list():
    try:
        pid = subprocess.check_output(["pgrep", app]).decode("utf-8").strip()
        w_list = subprocess.check_output(["wmctrl", "-lp"]).decode("utf-8").splitlines()
        return [l.split()[0] for l in w_list if pid in l]
    except subprocess.CalledProcessError:
        pass

relevant1 = w_list()
subprocess.Popen(["/bin/bash", "-c", startup])

t = 0
while t < 30:
    time.sleep(0.5)
    relevant2 = w_list()
    if all([relevant2 != None, relevant1 != None]):
        new = [w for w in relevant2 if not w in relevant1]
        if new:
            subprocess.Popen(["xdotool", "windowsize", new[0], "100%", "100%"])
            break
    relevant1 = relevant2
    t += 1

To use it

Do the setup exactly as above (including installing wmctrl and xdotool,
but additionally use the targeted application (+ possible arguments) as an argument to run the script.

For example:

python3 /path/to/start_maximized.py nautilus --new-window

or:

python3 /path/to/start_maximized.py gedit

Additionaly, add the option to a quicklist

You can easily add the option to the nautilus quicklist. Assuming you use the second (generalized) version:

Copy the global nautilus.desktop file locally:

which is on 14.04 and 14.10 : nautilus.desktop:

cp /usr/share/applications/nautilus.desktop ~/.local/share/applications

and on 15.04 and 15.10 : org.gnome.Nautilus.desktop

cp /usr/share/applications/org.gnome.Nautilus.desktop ~/.local/share/applications

Open the file with (e.g.) gedit, look for the line:

Actions=Window;

Change it into:

Actions=Window;Open a maximized window;

Add to the very end of the file:

[Desktop Action Open a maximized window]
Name=Open a maximized window
Exec=python3 '/path/to/start_maximized.py' nautilus --new-window
OnlyShowIn=Unity;

Save and close the file.
Log out and back in.

Now you have a quicklist option like in the image.

Conceptual explanation

To maximize an existing window is not very difficult. Both wmctrl and xdotool offer options to do so.

The issue is that if you want to maximize a newly created window, you don't know the window id yet when you give the command. Therefore the script practices the following procedure:

make a list of the currently existing windows of the targeted application (if any)
give the command to open the application (or a new window of a running application)
keep an eye on new windows of the application to appear
if the new window appears, it is apparently our candidate to maximize -> maximize it.

This way, we can "smartly" maximize the application's new window, that will work no matter the computer is slow (occupied with a heavy job for example) or fast.

Finally, the script has a built in safety time-limit, to prevent waiting for ever in case the application fails to start up for some reason. After appr. 15 seconds, the script gives up and exits an way.


No internet in WINE 1.6.2 under Ubuntu 15.10

You need to install winhttp.dll, the following command would work:

winetricks winhttp

If any 404 error occurs when downloading W2KSP4_EN.EXE, try manually downloaded this file from the Wayback Machine here.
and put it under $HOME/.cache/winetricks/win2ksp4/, Then rerun winetricks winhttp.

EDIT: Some people are having trouble with the Wayback Machine link. Another source is this from the Free University of Berlin FTP Archives.


You should be launching a web browser first (Firefox/Chrome/etc), in all likelihood.

Within the browser, your access point (router, etc) should be providing you a login at that  point so you can authenticate in, get proper access out to the net, and at which point you should be able to get Software Center functionality.

Try opening a web browser, and see if you get auth requests from the access point.


Adding a number to a already present variable sed/grep/awk

awk  -v b=$b -F: '{ if ( $1 == "LookupFile" ) $0=$1":"($2+b); print $0 }' file.txt

This will print all the line and will change the line only when $1 is "LookupFile" string. Delimiter is ":"


Why is /usr/local/games after /usr/games in the default PATH?

I can't come up with any reason other than: it's a mistake.

From what I can see, /usr/local/games is a fairly late addition to /etc/environment.  A 12.04 machine of mine does not have it.

I was really struggling to find where /etc/environment comes from. Turns out it's not a file that's packaged, it's created at install time (I assume to prevent it harming existing configurations during upgrades). Thanks to this answer on Unix.SE, we can see that it's coming from libpam-modules's postinst script.

# Add PATH to /etc/environment if it's not present there or in
# /etc/security/pam_env.conf
if [ "$1" = "configure" ] && dpkg --compare-versions "$2" lt 1.1.3-7ubuntu3; then
        if ! grep -qs ^PATH /etc/security/pam_env.conf; then
                if ! grep -qs ^PATH= /etc/environment; then
                        echo 'PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"' >> /etc/environment
                elif ! grep -qs "^PATH=.*/usr/local/games" /etc/environment; then
                        sed -i '/^PATH=/ s,:/usr/games,:/usr/games:/usr/local/games,g' /etc/environment
                fi
        fi
fi

So yeah, I'd suggest reporting a bug against pam.


Help with using "gnome-web-photo" with "at" to get screenshot of website at specific time

gnome-web-photo is a graphical application, but at does not provide a graphical environment. If you're sure you'll be logged in when this runs, you can cheat, and let at use your logged-in GUI.

echo "env DISPLAY=:0 $(type -p gnome-web-photo) --delay=3 https://example.com output.png" | at 01:11am


How do I handle grub rescue mode after installing burg?

user121839 is correct.

I had a similar issue on a system where I'd moved the partitions around, and ls listed all of my partitions, not just the drive (hd0).

For the benefit of future googlers:

Upon hitting

grub rescue>

Run ls to get a list of drives and partitions, for example:

(hd0) (hd0,msdos1) (hd0,msdos2)

If you only see (hd0) then you probably need to examine the drive with another computer or a Live boot.

Run set to get a look at your current boot settings:

prefix=(hd0,msdos2)/boot/grub
root=hd0,msdos2

If you have a system and a swap partition and grub is trying to boot from the swap (as with my situation), this might be the sort of issue you see.

You can use cat and ls to examine files or check for their existence:

ls (hd0,msdos1)/boot/grub/
cat (hd0,msdos1)/boot/grub/grub.cfg

Set the correct boot partition.  Note: I did not use set, just typed the environment assignments in directly (prefix=value).

set prefix=(hd0,x)/boot/grub
set root=(hd0,x)

Then load grub to boot.

insmod normal
normal

I hope that's helpful, citizens of the future.


How does ecryptfs impact harddisk performance?

Phoronix has run a suite of tests and a couple of articles on eCryptfs performance when encrypting home directories:

http://www.phoronix.com/scan.php?page=article&item=ubuntu_910_encryption&num=1
http://www.phoronix.com/scan.php?page=article&item=ubuntu_jaunty_encrypt&num=1

My take away from those articles is that encryption (as expected) according to the benchmarks, does impact read and write performance to a degree.  On small CPUs (Atom processors), and on fast hard drives (SSDs), this is perhaps more noticeable.  That said, by using eCryptfs, you're only paying that performance penalty when reading/writing data to your home directory (and not the rest of the system, as you would with full-disk encryption).  Furthermore, with faster processors, the amount of time spent doing that encryption/decryption often fits within the IO wait accessing the data from disk, which is usually the bottleneck.

As to your particular issue, if you're hearing a lot of "hard disk seek" noise, it sounds to me that your system is swapping data from memory to disk, and back and forth.  If you've chosen to use eCryptfs, then Ubuntu will automatically encrypt your swap space (which is required to safeguard your encrypted data).  However, encrypted swap is very expensive, too.

Personally, I overload my systems with lots of RAM (8GB on most of my systems), and disable swap entirely.


Juju add-machine does not start LXD container

Never mind ...
Inadvertently I renamed the Juju model, thus losing all the config options from config.yaml (including the proxies ...) in effect at bootstrap time that were inherited by "default" model.


Calendar app (Maya) from Elementary OS on Ubuntu 20.04

According to repology.org and then OpenSuSe Build Service this package had latest version public of 0.4.1.
The upstream repository is at GitHub - https://github.com/elementary/calendar .
In the Ubuntu is it available from  “elementary OS team” daily PPA.
So we need to get and install one dependency first:
cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/main/libh/libhandy-1/libhandy-1-0_1.0.0-2_amd64.deb
sudo apt-get install ./libhandy-1-0_1.0.0-2_amd64.deb

and then use PPA:
sudo add-apt-repository ppa:elementary-os/daily
sudo apt-get update
sudo apt-get install maya-calendar

Then run it from menu or from terminal by io.elementary.calendar.
Note: visually this application looks very similar to the default GNOME Calendar application, I'm not sure about functionality differences.


Run MongoDB service as daemon of SystemD on Ubuntu 15.10

I managed start the MongoDB service with SystemD on boot:

I uninstalled the official meta-package (mongodb-org) v3.2, then I installed the meta-package (mongodb) v2.6 from Ubuntu repository:

> sudo apt-get remove mongodb-org
> sudo apt-get install mongodb

Create the service config file as shown below:

> cd /lib/systemd/system
> sudo touch mongodb.service
> sudo nano mongodb.service
[Unit]
Description=An object/document-oriented database
Documentation=man:mongod(1)
After=network.target

[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf

[Install]
WantedBy=multi-user.target

Verify in the list if the service is enabled or disabled using the command below:

> systemctl list-unit-files --type=service
...
mongodb.service             disabled
...

If it is disabled or not in the list, enable it:

> sudo systemctl enable mongodb.service

Check again:

> systemctl list-unit-files --type=service
...
mongodb.service             enabled
...

Now you can managing the service on SystemD init process:

> systemctl status mongodb
> sudo systemctl stop mongodb
> sudo systemctl start mongodb
> sudo systemctl restart mongodb

Enjoy!


How to start GUI application on a remote Ubuntu box via SSH

A simple way to be able to start graphical programs is to start ssh like so... ssh -X -C user@MyIp it will then start your ssh session like normal, but you can then start an X program like so.. firefox & this will start firefox on the remote machine, display it local to you, and return you to the ssh prompt.


Execute bash script literally after every 3 days

To immediately abort and exit a script if the last execution was not yet at least a specific time ago, you could use this method which requires an external file that stores the last execution date and time.

Add these lines to the top of your Bash script:

#!/bin/bash

# File that stores the last execution date in plain text:
datefile=/path/to/your/datefile

# Minimum delay between two script executions, in seconds.
seconds=$((60*60*24*3))

# Test if datefile exists and compare the difference between the stored date
# and now with the given minimum delay in seconds.
# Exit with error code 1 if the minimum delay is not exceeded yet.
if test -f "$datefile" ; then
    if test "$(($(date "+%s")-$(date -f "$datefile" "+%s")))" -lt "$seconds" ; then
        echo "This script may not yet be started again."
        exit 1
    fi
fi

# Store the current date and time in datefile
date -R > "$datefile"

# Insert your normal script here:

Don't forget to set a meaningful value as datefile= and adapt the value of seconds= to your needs ($((60*60*24*3)) evaluates to 3 days).

If you don't want a separate file, you could also store the last execution time in the modification time stamp of your script. That means however that making any changes to your script file will reset the 3 counter and be treated like if the script was successfully running.

To implement that, add the snippet below to the top of your script file:

#!/bin/bash

# Minimum delay between two script executions, in seconds.
seconds=$((60*60*24*3))

# Compare the difference between this script's modification time stamp
# and the current date with the given minimum delay in seconds.
# Exit with error code 1 if the minimum delay is not exceeded yet.
if test "$(($(date "+%s")-$(date -r "$0" "+%s")))" -lt "$seconds" ; then
    echo "This script may not yet be started again."
    exit 1
fi

# Store the current date as modification time stamp of this script file
touch -m -- "$0"

# Insert your normal script here:

Again, don't forget to adapt the value of seconds= to your needs ($((60*60*24*3)) evaluates to 3 days).


Where does Gnome-To-Do stores it's file by default ?

gnome-todo using Evolution-Data-Server as its storage back-end.

Its data are stored here:

~/.local/share/evolution/tasks

For example tasks list are in below file:

~/.local/share/evolution/tasks/system/tasks.ics

And its cache are stored here:

~/.cache/evolution/tasks

For more details about Evolution-Data-Server you can see this link.


how to Setup Grub Password ONLY to access grub menu?

For the password by default everywhere , you can create a file /etc/grub.d/00_before_header

The name 00_before_header is important  , because it will before 00_headerin the alphabetic order .

#!/bin/sh
set -e
cat <<EOF
set superusers="admin"
password admin password
export superusers
EOF

and you must run chmod +x /etc/grub.d/00_before_header

This following patch will modify option named Ubuntu to have no password .

will modify /etc/grub.d/10_linux
run upgrade-grub
check that you have a menuentry with the option --unrestricted in /boot/grub/grub.cfg

The patch for /etc/grub.d/10_linux :

--- 10_linux.orig   2020-05-16 05:26:00.107936462 +0000
+++ 10_linux    2020-05-16 05:26:40.040071516 +0000
@@ -190,7 +190,12 @@
       fi
       echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
   else
+      OLD_CLASS="$CLASS"
+      if [ "$(echo "$os" | grub_quote)" = "Ubuntu" ]; then
+          CLASS="$CLASS  --unrestricted"
+      fi
       echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
+      CLASS="$OLD_CLASS"
   fi
   if [ "$quick_boot" = 1 ]; then
       echo "   recordfail" | sed "s/^/$submenu_indentation/"

PS: this solution is for Ubuntu 20.04

PS2: patch => https://en.wikipedia.org/wiki/Patch_%28Unix%29

PS3: patch format => https://stackoverflow.com/questions/987372/what-is-the-format-of-a-patch-file


I'd suggest checking the config for your "Files and Folders" plugin. The "Depth" setting on your Documents folder may not be high enough to get down to that level.


How to decrease the utilization of my SSD drive as much as possible?

/var and /tmp definitely go to HD from this perspective.


It detects that it has to run under the qemu profile (libvirt instructs things to recognize that). The profile for that is in /etc/apparmor.d/abstractions/libvirt-qemu.

In newer versions of Ubuntu you will have /etc/apparmor.d/local/abstractions/libvirt-qemu which will take your overrides to avoid conflicts on packaging upgrades. In earler versions you still need to modify /etc/apparmor.d/abstractions/libvirt-qemu directly.

A rule for the deny that you see would be

/home/probir/Downloads/qemu/qemu_kognizance/qemu_pinning/build_static/x86_64-softmmu/qemu-system-x86_64 rmix,

If you need more rules read the apparmor rules guide and the links from there.


Not bash, but you could use a Perl script in your bash script :P

First install libauthen-pam-perl

sudo apt-get install libauthen-pam-perl

After that create a new Perl script, eg. with the name foo …

#!/usr/bin/env perl
use Authen::PAM;
use POSIX qw(ttyname);

$service = "login";
$username = $ARGV[0];
$password = $ARGV[1];
$tty_name = ttyname(fileno(STDIN));

sub my_conv_func {
  my @res;
  while ( @_ ) {
      my $code = shift;
      my $msg = shift;
      my $ans = "";

      $ans = $username if ($code == PAM_PROMPT_ECHO_ON() );
      $ans = $password if ($code == PAM_PROMPT_ECHO_OFF() );

      push @res, (PAM_SUCCESS(),$ans);
  }
  push @res, PAM_SUCCESS();
  return @res;
}

ref($pamh = new Authen::PAM($service, $username, \&my_conv_func)) ||
       die "Error code $pamh during PAM init!";

$res = $pamh->pam_set_item(PAM_TTY(), $tty_name);
$res = $pamh->pam_authenticate;

if ($res == PAM_SUCCESS()) {
    printf ("%s\n","Success");
}
else {
    printf ("%s\n","Failure");
}

based on this answer with some modifications

From man foo ;)

NAME
   foo - password test

SYNOPSIS
   foo username password

DESCRIPTION
    coming soon

OPTIONS
    no options

Example:

$ sudo ./foo foo wWeErRt    # wrong password
Failure

$ sudo ./foo foo wWeErRtT   # correct password
Success

In your script:

some code

ret=$(foo "$username" "$password")

some code


GParted cannot identify swap partition on Ubuntu 13.04

It's safe to set it as swap. You should even be able to select it in Gparted, tell it to be swap and enable swap (Swapon) and go, no reboot etc needed.


Did you try to re-boot your pc and check for Ask Ubuntu Lens, if it doesn't work even after a reboot, Try to remove Ask Ubuntu Lens from Terminal and install it via the Terminal.

Try this with Terminal.

sudo add-apt-repository ppa:askubuntu-tools/ppa

sudo apt-get update

sudo apt-get install unity-lens-askubuntu

Further details on the installation are here - How do I install the Ask Ubuntu Unity Lens, and how do I use it?


What is the workaround for LXD-nested pivileged docker (/dev/.lxc/proc/ error)?

Per Stephane Graber (LXD lead developer) you don’t need the LXD docker profile any more !

See…
https://github.com/lxc/lxd/issues/3299


Is there a 'Power Monitor' for Ubuntu GNOME?

You can find the following power managers in the Ubuntu repositories :

gnome-power-manager
mate-power-manager
xfce4-power-manager

These power managers have the design as shown in your screenshots.

Alternatively you can install the powertop tool from the repositories.

PowerTOP is a Linux tool to diagnose issues with power consumption and
power management.
It reports which components in the system are most likely to blame
for higher-than-needed power consumption, ranging from software
applications to active components in the system. Detailed screens are
available for CPU states, device activity and software activity.

Additional information -> Intel Open Source PowerTOP Overview |   PowerTOP User's Guide

Tecmint -> PowerTOP Monitors Total Power Usage and Improves Linux Laptop Battery Life


The commands you are using are both correct. See also the manual.

It seems the unmask command fails when there is no existing unit file in the system other than the symlink to /dev/null. If you mask a service, then that creates a new symlink to /dev/null in /etc/systemd/system where systemd looks for unit files to load at boot. In this case, there is no real unit file.

Others seem to have similar issues

x11-common.service was also masked on my system. You can fix it like this:

First check that the unit file is a symlink to /dev/null

file /lib/systemd/system/x11-common.service

it should return:

/lib/systemd/system/x11-common.service: symbolic link to /dev/null

in which case, delete it

sudo rm /lib/systemd/system/x11-common.service

Since you changed a unit file, you need to run this:

sudo systemctl daemon-reload

now check the status:

systemctl status x11-common

if it doesn't say loaded and running (if the circle is still red), reinstall the package:

sudo apt-get install --reinstall x11-common

and reload the daemon again

sudo systemctl daemon-reload

and check status once more

systemctl status x11-common

Now it's green and running :) The service has no systemd unit file, but systemd happily uses the script for it in /etc/init.d instead.


What to do when boot-repair warns to change pc from legacy to efi mode?

Just follow the Boot-Repair instructions. When asked if you want to enable WindowsEFI renaming, answer Yes. If any issue, indicate the URL that will appear.


Chromium doesn't play Twitch.tv-Streams/Videos

I solved it by install the package "chromium-codecs-ffmpeg-extra". HTML5-Streams on Twitch.tv running excellent now.


pip3 is pointing to the wrong version of python

The best option is to use python3 -m pip to run pip with a specific python version.

The full docs on this are here: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/


fresh installed ubuntu excruciatingly slow boot up

I've narrowed down the problems to a few possibilities:

Someone suggested my motherboard may be dead, or has problem(s);
16.04 specific issue, e.g some new drivers have been added to this LTS and they no longer work with my hardware;

To confirm/reject 1), I wipped out ubuntu and installed Windows 7. I am able to boot up and shut down the machine in seconds. Win 7 did not detect any hardware problem. No error message, no choke, very smooth.

Conclusion : Motherboard is OK, or at least for Win 7.

To investigate whether this is specific to 16.04, I installed Ubuntu 14.04 from a live-USB thumb drive along with my existing 16.04. I then boot into 14.04 and ran into exactly same issue. Showing splash, the dreaded line showed up again,

[  505.255296] usb 3-1: new high-speed USB device number 127 using xhci_hcd

The device number goes to 127, then repeated three times. This led me to think the problem is not specific to 16.04, thus 2) is rejected.

However, i'm really scratching my head now because just a week ago, I was using 14.04 on this box (exact same hardware) without any issue. In fact, I've been running 14.04 for nearly two yrs without ever encountered these problems.

The driver experts please weigh in on this.


Adding Icon-Counter to GNOME Desktop for Ubuntu 12.10

Greeting Jeremy, based on your requirement I'm going to suggest this solution, and I hope it will help you or give you another way to look at your problem in turn. In my suggestion you need :
1) shell-script file "bash programming".
2) for-loop counter, as you said "to see how many files have been processed" .
3) notification every X time (seconds / minutes / hours), here you need "libnotify bin".
4) keep the script running.
Now let's make the script create a file "counter.sh"

#!/bin/bash
for f in $( ls /usr/lib ); #just change the path with yours, it was just an example
do
notify-send -u critical "How many files" $f
done
sleep (1000*60) # get notification every 1 hour
counter.sh
sleep (1000*60) # get notification every 1 hour
#you can make infinite for loop here
#and put counter.sh inside it,
#just look that up on the internet (infinite loop using shell script)

Finally, to make your file running you can just run it in the terminal and let it running. Or you can add it in auto-start.  P.S : open terminal login to root 'sudo su' then "chmod 777 counter.sh" to be able to run your script.


Moving files into sorted folder based on the filename

Using BASH_REMATCH to backreference matched subexpression:

#!/bin/bash

for i in movies/*; do
    if [[ $i =~ \(([0-9]{4})\) ]]; then
        mkdir -p year/${BASH_REMATCH[1]}
           mv -t year/${BASH_REMATCH[1]} "$i"
    else
        echo "Sort panic!"
    fi
done


If external display is connected {"Lid is closed : Do nothing" } else{ "Lid is closed: Suspend" }?

whatever happened since this post first appeared and after making the obvious changes in settings, it now looks as if plugging a mouse and keyboard in is enough to wake the external monitor up whilst keeping the laptop lid closed and its screen off.


Getting Java working again in 10.10? (or force newest version of OpenJDK?)

I "fixed" this problem by upgrading to 11.10 on my dads computer. All works fine now with the Open Java.


Kubuntu w/ backports == KDE Neon (At least in terms of KDE version?)

This issue has been discussed in some forums. For example, reddit, kubuntuforums etc.

What they essentially said is -

  From a user point of view, Neon is more bleeding edge but mostly
  stable, Kubuntu + backports should be reasonably up to date without
  being the absolute latest version of each package, and a little bit
  more stable due to extra testing.

  you may agree that Kubuntu 16.04 LTS with the backports installed may
  be closest to KDE Neon User LTS Edition but the former includes a lot
  of software not present in KDE Neon because KDE Neon's primary focus
  appears to be to provide a way to experience KDE, per se, rather than
  to be used for "productivity".

I found a important bit of information in linustechtips. It said,

  You won't get new KDE software as soon with Kubuntu, even with the
  Kubuntu backports PPA, but you will get new non-KDE software sooner
  since KDE neon is based on LTS Ubuntu.

So, My understanding is,

KDE Neon gives you the freshest (KDE) apps straight from the devs. So, KDE app in KDE Neon are more up to date than Kubuntu + Backport.
non-KDE app in Kubuntu or Kubuntu + Backport are more up to date than KDE Neon.

Please note that all these information are from forums. So, you might have to Take with a grain of salt.

The best solution would be to check both their software repository -

install both KDE Neon and Kubuntu + Backport side by side.
Update them both to the latest.
Compare the version of random KDE application in KDE Neon with Kubuntu + Backport.
I do not think KDE Neon has Non-KDE application in its software store. If it has then you can also compare their version with Kubuntu + Backport.


The correct way to build this driver is, with a working internet connection:

sudo apt-get install build-essential linux-headers-generic
cd ~/Desktop/AX88179_178A_LINUX_DRIVER_v1.9.0_SOURCE

...or wherever you extracted the package, if not desktop.

make

The driver ax88179_178a is present in Ubuntu 13.10, so if you re-install, compiling will be unnecessary.

Most Makefiles have a process to make, clean, install and uninstall. Yours evidently does not. First, let's test the driver to see if it drives the device correctly:

cd ~/Desktop/AX88179_178A_LINUX_DRIVER_v1.9.0_SOURCE
sudo modprobe usbnet
sudo insmod ax88179_178a.ko

Does your device work correctly? If so, we'll install it the hard way:

sudo cp ax88179_178a.ko  /lib/modules/`uname -r`/kernel/drivers/net/usb/

Those backticks are on the left side of my US keyboard on the same key with ~. This will overwrite your previous attempt, if any.

It seems that your device connects and immediately drops. I noticed this bug report: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1269883 Evidently, the poster had better luck with a USB 2.0 port. Please try.

Aside from that, I suggest you contact ASIX, as they are the author of the driver we compiled.


What do I need to do to get Intel AX200 PCIe to work with Ubuntu 20.04?

I faced the same issue with my HP ProBook 650 g5.
I is using the AX200 Intel Wifi-Card too.
After I download all realded firmdriver from GIT
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/
and did a
sudo cp iwlucode /lib/firmware/
it works. dmesg | grep wifi shows this line:
[    8.809876] iwlwifi 0000:01:00.0: loaded firmware version 48.4fa0041f.0 op_mode iwlmvm
According to this page:
https://github.com/woodsts/linux-firmware/commit/2ae99744efc14e5329a551251e22b33213224f11
This is this driver:
@@ -1072,6 +1072,27 @@ Version: 48.4fa0041f.0
File: iwlwifi-QuZ-a0-jf-b0-48.ucode
Version: 48.4fa0041f.0


Reset or restore previous installation of Ubuntu 14.04

When booting with the Live CD there's an option there that Erase Ubuntu installation and reinstall and that solved my problem.


PowerTOP: what is "System baseline power"?

Sounds like it's the minimum power needed by the system.  That is, it's the power that would be used if you were to disable unnecessary hardware like bluetooth and wifi, and turn the screen brightness down.  And 23.2W is not to much.


nmcli provides the -f <field, ...> option to specify columns.
So here, it would be
nmcli -f SSID device wifi list

If you want to cut off the SSID header, you can then pipe the result through sed -n '1!p', to remove the first line of output, like so
nmcli -f SSID device wifi list | sed -n '1!p'


How do i find all files in a folder recursively by the specific name and rename them?

The full solution would look as follows

find -name '*.file.php' -exec rename 's/\.file\.php$/.file1.php/' {} \;


Download driver from my.okidata.com, it works good for Ubuntu 16.04 and other.

https://my.okidata.com/dsdownWeb.nsf/MOC-Lookup/90B6329133696B8585257A8000721484?OpenDocument


Ubuntu 13.10/Gnome shell keeps asking me for my e-mail accounts passwords but says they are wrong. How can I fix this?

Try this.
Go to the shell/terminal

$ cd .config
$ cd goa-1.0
$ mv accounts.conf ../../Desktop

Let me know if that works for you.

Jon


Ubuntu16.04 Internal Realtek SD card reader rts522a still problem

With official kernel drivers update today(11/08/2016) the problem seems solved.


I used to have a similar problem with MSI U100 but an upgrade... well, I believe from Karmic to Lucid fixed it. Or maybe I somehow fixed it and forgot how. I do not have that laptop anymore. Maybe the problem was re-introduced after that or maybe (less likely) your problem is a separate one.

If you search internet you'll find that there are numerous reports of people having this problem with U100 and U120 netbooks, with different Linux distributions.

Some reports suggest that upgrading BIOS fixes the problem. In case you decide to proceed you can get the new BIOS from the MSI website


For Point 1 - your editor is making a backup files. Backup file are normally pre-seeded with a ~ symbol. Like for example using gedit, kate or bluefish. They make a ~ file AND additionally add the dot sign in the front to make it invisible so it does not bother the programmer as a backup file. You can remove this behaviour form any editor in the preference/configuration/settings options where it mentions the way to SAVE/LOAD files. normally it will say something about "Make a backup with the ~ prefix"

For Point 2 - You can NOT open a php file using firefox because a PHP file is first processed by a server, normally a server that has apache+php services. Firefox first sends the info that it wants to see the php file, the php service processes the php information and then it sends it to apache which sends it to you and it firefox renders the page for you.

Does not matter if you are in windows/mac/linux in all cases the PC where you want to see (Or correctly PROCESS the php file) should have the services needed for it AND the php file in a directory read by the html service.

In the case on Ubuntu, you will need for example the apache + php services installed AND the php in the directory that http://localhost points to so it KNOWS it is serving the php file as a web service. That way apache and php take care to correctly process the php file and send it to the browser so it can render it.

Verify in your case that you have php/apache in the place where you are running the browser AND verify that the php file is in the web directory (normally in /var/www or /home/USER/www)

Start the browser with http://localhost and browse THROUGH there to the php file.

EDIT: Just read your edit. Make sure that the virtual Ubuntu has an IP that when you type it in the host it goes to the Virtual ubuntu. that way you have a Virtual PC where you can make the web and the host who is the client. For example:

HOST - 192.168.0.1
VIRTUAL - 192.168.0.10

WebSite: http://192.168.0.10


Is there a way to get an access token via Ubuntuone oauth?

There is. As a web app, you may use the standard OAuth dance against Ubuntu One to obtain an OAuth token.

Use URLs https://one.ubuntu.com/oauth/request to get a token, redirect the user to https://one.ubuntu.com/oauth/authorize/?description=yourappname to have it authorized, and https://one.ubuntu.com/oauth/access/ to convert it to a real token which you can save and use to authenticate requests on the user's behalf.


Ubuntu Studio 20.04, getting Pulse Audio and JACK to play nice

If you scroll down in this blog post, it says how to use both together: https://www.fossbox.org.uk/?p=240

By default, Jack and Pulse can’t normally run at the same time. However, as our web browser is a Pulse app and we wish to use Jack for routing, we’ll need to overcome that. One relatively easy route to achieving this uses QJackctl. In settings, under the option tab, go to Execute Script after startup. Paste in pactl load-module module-jack-sink channels=2; pactl load-module module-jack-source channels=2; pacmd set-default-sink jack_out.

This will create two separate Pulse channels, called “sinks”.

Once you’ve changed the settings, you’ll want to test if things have worked. Start Jack and then open any normal audio application such as your mp3 player. Try playing some sound. If you hear anything, it worked.

Now, if you’re using a pro audio application like SuperCollider, PD or Reaper, go start it and turn on the Audio engine. In Qjackctl, click on connections and open the Audio tab. You’ll see a list of inputs and outputs on your system, including your audio application, the pulse sinks, and the system (ie, the physical inputs and outputs).

Use Qjackctl to draw connections between the sinks and your Jack applications.


Ubuntu 14.04.3 startup slow ('dmesg': "self-detected stall on cpu", maybe because of 'alsa-sink'?)

This might be a hardware emulation problem. In my case, I chose to use USB 3.0 that started the problem.

After switching over to USB 2.0, the problem went away.


You can do this, the only problem is getting an output from ls that is the
same on the remote and on your local machine. My ls has an option
--time-style=+%s that shows the last modified time of the file in seconds
since the epoch, which should match on both machines.  I'm assuming you
only want to do this for one directory, otherwise find would be more
appropriate if you have that command.

On the remote do the ls in the required directory into a file:

cd ... # cd to the directory to list
ls -l --time-style=+%s . >/tmp/listfile

On the local machine, copy the remote /tmp/listfile to local /tmp/listfile, then use
awk to suppress the first 4 columns of output and sort the list of file
size, date and filename. (I'm assuming you might have filenames with
spaces hence the bizarre awk).

awk '{$1="";$2="";$3="";$4="";print}' </tmp/listfile | sort >/tmp/a

In the mirrored directory get the same listing:

cd ... # cd to same directory we listed remotely
ls -l --time-style=+%s . | awk '{$1="";$2="";$3="";$4="";print}' | sort >/tmp/b

Compare the two sorted lists and drop the lines that are the same with
comm. Drop the size and date columns (and incidentally the tab at the
start of lines in /tmp/b not in /tmp/a, and 2 inter-column spaces) and drop
duplicate filenames with uniq. (You dont need to sort again as the
duplicate lines are adjacent).

comm -3 /tmp/a /tmp/b | awk '{$1="";$2="";print substr($0,3)}' | uniq >/tmp/c

The list in /tmp/c is all files that are new, of different size or
timestamp, or have been removed. Pass each one to wget to fetch (still in
the appropriate directory).

while read file
do  rm -f "$file"
    wget -N --no-directories ..../"$file" # non recursive single file to .
done </tmp/c

You should configure your wget mirror to no longer fetch this directory.

If you can do find ... -printf '%9s %T+ %p\n', you could use this sort of
technique, starting at the top of the mirror directory, to effectively do the
mirroring yourself.


Blank screen problem in Ubuntu 15.04 after selecting Ubuntu from GRUB menu

I also faced this problem. It's because of the graphics driver for your AMD graphics card.

You should try to update and then upgrade through virtual terminal by pressing Alt+Ctrl+F2.

You may need to reinstall the driver through terminal by searching for the correct package for it. Installing the AMD driver through their official website should be the last resort, as it mostly doesn't work.


How can I restrict an LXD guest to using a single public IP address?

You probably want to route that public IP to your container, so make sure the host itself doesn't have it in its network configuration, then do something like:

ip route add IP/32 via CONTAINER-IP dev lxcbr0

You may then add the public IP to the container's network config by adding this to its network config under the eth0 section:

post-up ip addr add IP/32 dev eth0

At which point you should be able to ping the container using the public IP.

You'll want to make sure the host doesn't NAT traffic coming from that IP and as for restricting access to other resources from the container, you'd have to do that with iptables on the host. Note that one nice property of Linux bridges is that iptables does get called on intra-bridge traffic, so you can absolutely firewall the container from accessing any neighbor.


adduser username sudo adds username to the sudo group. Members of the sudo group are allowed sudo access in the default sudoers file:

%sudo   ALL=(ALL:ALL) ALL

You shouldn't remove this line just to deny this user sudo access. Instead, undo the group addition:

sudo deluser username sudo


What should I do when I see blank screen?

REISUB time!!!

Just press ALT+Pet Sys and type slowly REISUB, one key at time. If it happens often you should probably investigate why is it happening. Ubuntu (and linux) is supposed to be rock-solid because it's usually rock-solid ;). This behaviour is anything but normal.


Cannot reboot after installing gnome-shell

Solved:

Boot in recovery mode and open root.
Mount / as read-write: mount -o remount -rw / as enzotib said in a comment here.
Now I can uninstall gnome via apt: apt remove gnome-shell.
reboot.


How do I get palm rejection on my Dell Inspiron laptop?

It's an old question, but seems to be unanswered so I'll throw in my two cents:

I'm running an Asus Q501D with 16.04, and I found that following this guide solved the issue.

The essence of it is modifying your xinput touchpad, which you find by running xinput list in the terminal and locating your touchpad device, whatever it be named, and its id in the output.

Then you modify the parameters using xinput set-prop [id] [prop] [setting] to enable palm rejection and change the dimensions of the palm region.  You can see all of your touchpad's props in the output xinput list-props [touchpad device id].

The relevant props were "Synaptics Palm Detection" and "Synaptics Palm Dimensions".  You'll want "Synaptics Palm Detection" 1 and "Synaptics Palm Dimensions" #, # to be something that actually rejects your palm (5, 5 worked for me and the author of the article).

Then it's just a matter of adding those prop-setting commands to your Startup Applications so that they run when you reboot (and thus preserve your settings).

Again, the linked guide has a few more details and screenshots, so definitely look there if I've botched up the explanation.  As a sidenote: The guide is written for 14.04, though, so maybe isn't compatible with all laptop makes depending on drivers?  Users in the comment section of the guide seem to have mixed results, but could just be user error, worked just fine for my machine.  Hope this helps!


Is there way to compile Qt5 programs, written with c++, to Ubuntu Touch?

The easy way
You can use an experimental feature of the Ubuntu SDK Alpha. The beauty of it is that you don't need to cross-compile.
First connect to your device:

Plug in your device to your computer's USB port
Start Qt Creator
Click on the devices tab
Click the Enable button to enable developer mode
Go to Tools > Ubuntu > Device > Enable > Cpp compiling on Ubuntu device (experimental)

Then start hacking:

Open your app's project in Qt Creator
Go to Build > Ubuntu > Build C++ project on Ubuntu device (experimental)

And off you go! :-)
If you like a challenge
You could conceivably compile the apps on the device by hand. You might want to try the following (untested) steps:

SSH into your device running the Ubuntu Touch Developer Preview

Install the required development packages. Depending on what you need, you might need to add packages to the list, but here's a first shot:
sudo apt-get install qt5-default qtbase5-dev libqt5v8-5-dev qtdeclarative5-dev libqt5xmlpatterns5-dev qtscript5-dev qttools5-dev qt3d5-dev qtmultimedia5-dev libqt5svg5-dev qtdeclarative5-dev-tools qttools5-dev-tools qtlocation5-dev qtsensors5-dev qtpim5-dev qt-components-ubuntu

Build your C++ app with your build system of choice (cmake, qmake, etc...)


The *.pdf will be expanded by the shell before executing the script, so the script won't see *.pdf, it will see the matching filenames directly:

$ cat foo.sh
#! /bin/sh

printf "|%s|\n" "$@"
$ touch {1..10}.pdf
$ ./foo.sh 1.pdf
|1.pdf|
$ ./foo.sh *.pdf
|1.pdf|
|10.pdf|
|2.pdf|
|3.pdf|
|4.pdf|
|5.pdf|
|6.pdf|
|7.pdf|
|8.pdf|
|9.pdf|

Within a bash script, you can use "$@" to get all the arguments passed to it, or use $1, $2, etc. to access the first, second, etc. argument directly.

You can just loop over all arguments with a plain for:

for i     # Or, for i in "$@"
do
    echo "Processing argument $i"
done

Will output:

Processing argument 1.pdf
Processing argument 10.pdf
Processing argument 2.pdf
Processing argument 3.pdf
Processing argument 4.pdf
Processing argument 5.pdf
Processing argument 6.pdf
Processing argument 7.pdf
Processing argument 8.pdf
Processing argument 9.pdf


Is there any user friendly alternative to screen?

Tmux is a rewrite of GNU Screen, tmux offers a variety of improvements. Some of the most important include a client-server model, which allows you to connect to a tmux session from multiple locations, and a cleaner configuration file format. Check out tmux’s FAQ to discover a list of ways it differs from GNU Screen.
Use this command to install tmux on Ubuntu:
sudo apt-get install tmux

How to on howtogeek. That link also has something on Dvtm & Dtach (Dvtm is a console multiplexer inspired by tiling window managers, and dtach adds the ability to detach from and reattach to dvtm sessions).


How to make Chrome/Chromium remember passwords in the gnome seahorse keyring?

According to http://www.omgubuntu.co.uk/2010/07/chrome-dev-channel-adds-gnome-keyring-support-for-saving-passwords/ , that is available, you will need to update the chrome launcher to use –password-store=gnome.

There was a Firefox addon providing gnome keyring integration, I can no longer find it.

EDIT: Added link to Firefox addon code and bugzilla ticket

https://github.com/mdlavin/firefox-gnome-keyring

https://bugzilla.mozilla.org/show_bug.cgi?id=309807


Unable to update Anaconda packages on Ubuntu 17.04

Though Djokester's answer should work fine, it seems like terrible overkill to me.
One could just do:

sudo chown -R username:username anaconda3

Where username is your users name.


I have come up with a way to solve this :
here check it up on my blog :)

http://worldofenggcodes.blogspot.in/2014/05/for-all-people-with-power-problems.html

Share the answer if it works :)


How to remove proxy from git I try, but still showing the error how to resolve it?

After using these comands

git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global --unset core.gitproxy

These two commands work for me after --unset the proxy


No, there is no necessity that an MX record should begin with mail.. As per your settings

dig mx example.com

should give

example.com. some_ttl IN      MX    some_priority  example.com.

and

dig example.com

should give

example.com.   some_ttl IN  A   216.x.x.x

for emails from outside world to reach you. Hope that helps.


What computer languages do Linux-based OSes use?

Linux (the kernel) is essentially written in C with a little of assembly code.
The lower layer of userland, usually GNU (glibc and other libraries plus standard core commands) are almost exclusively written in C and shell scripting.
The remaining of the Gnu/Linux distributions userland is written in any language developers decide to use (still a lot of C and shell but also C++, python, perl, javascript, java, C#, golang, whatever ...)


How to make dbus commands persistent. GNOME

I'll post this as a temporary answer to get you started. My only dbus script monitors for when gnome or unity resets xrandr screen brightness and then overrides it with custom brightness and gamma. You would need something similar for when dash or panel is reset:

#!/bin/bash

# NAME: eyesome-dbus.sh
# PATH: /usr/local/bin
# DESC: Watch dbus for monitor color events
# CALL: Automatically started as deamon by eyesome.sh
# DATE: October 8, 2018. Modified October 22, 2018.

source eyesome-src.sh # Common code for eyesome___.sh bash scripts

Type="method_call"
Interface="org.freedesktop.ColorManager"
DirPath="/org/freedesktop/ColorManager"
Member="FindDeviceByProperty"
Watch="type=${Type}, interface=${Interface}, path=${DirPath}, member=${Member}"

# When NewTimeSTamp - OldTimeStamp > 5 seconds a new group of events occurs
# Wake up eyesome.sh to spam monitors
OldTimeStamp=$(printf '%(%s)T')

# Wait for user to sign on then get Xserver access for xrandr calls
UserName=""
iEventCnt=0

OneTimeWakeup () {

    # Wakeup eyesome.sh once for every group of commands
    # If the elapsed time between groups is > 5 seconds we assume a new group
    # of events has begun. Unplugging a monitor can create 5 DBUS events in
    # less than a second and we don't want to wakeup eyesome.sh 5 times.

    NewTimeStamp=$(printf '%(%s)T')
    secElapsed=$(( NewTimeStamp - OldTimeStamp ))
    # log "OneTimeWakeup Elapsed: $secElapsed New Stamp: $NewTimeStamp"
    OldTimeStamp="$NewTimeStamp"
    (( iEventCnt++ ))

    [[ "$secElapsed" -lt 6 ]] && return # If less than 5 seconds get more events

    log "Event Count: $iEventCnt over: $secElapsed seconds"
    iEventCnt=0

    # Has user signed on?
    if [[ "$UserName" == "" ]] ; then
        # Check if user has signed in
        UserName="$(who -u | grep -F '(:0)' | head -n 1 | awk '{print $1}')"

        if  [[ "$UserName" == "" ]] ; then
            LastLoginWait="$NewTimeStamp"
            log "Waiting for user to log in, not waking up eyesome"
            return
        else
            # There may not be events after user first logs in with external
            # monitor(s) disconnected. If monitor connected after logging in
            # then we want to wakeup eyesome daemon below.
            LastModificationSeconds=$(date +%s -r "$EyesomeUser")
            sec=$(( NewTimeStamp - LastModificationSeconds ))
            if [[ "$sec" -lt 15 ]] ; then
                log "$UserName logged in $sec seconds, not waking eyesome"
                return
            else
                log "$UserName logged in for $sec seconds, waking eyesome"
            fi
        fi
    fi

    # Wakeup eyesome.sh after dbus searched Xrandr monitor properties
    echo YES > "$EyesomeDbus"
    sync -d "$EyesomeDbus"      # Flush buffer immediately
    $WakeEyesome post eyesome-dbus.sh spam &

} # OneTimeWakeup

log "Starting DBUS-Monitor using $Watch"

dbus-monitor --system "${Watch}" | \
(
    while read line; do
       OneTimeWakeup
    done
)

log "Ending DBUS-Monitor" # This should never happen

exit 0


I had same problem but it got solved after I installed python-imaging: sudo apt install python-imaging


How can I install TextWrap plugin in Gedit?

Just installed Text Wrap in Gedit and it's working fine for me! Follow these steps to install:

Download Text Wrap and put both files (toggletextwrap.plugin and toggletextwrap.py) in your home directory.

Hit Alt+Ctrl+T to open terminal and run following command:
sudo mv ~/toggletextwrap.plugin toggletextwrap.py /usr/lib/gedit/plugins

Now open Gedit and navigate to Edit > Preferences > Plugins

Scroll down and enable Text Wrap. That's it!


Is Ubuntu 16.04 supported by HP360 gen8 Using RAID

Untill now only upto Ubuntu 14.04 is supported. So I am afraid if you want things to work you have to downgrade to Ubuntu 14.04

Then do the following:

Add this PPA to your repository:

ppa:hp-iss-team/hpvsa-update
apt update

Then install the driver hpvsa

apt install hpvsa


How to Quit Startup Application Automatically on Shutdown?

For a simple way you can create a .bash_logout file in your home dir that tells transmission to quit, e.g.:

transmission -q

or

transmission --quit

If the system does not run the .bash_logout, add it to /etc/gdm/PostSession/Default so it executes the logout script properly.

Another way is to add your command to the file /etc/gdm/PostSession/Default before the exit 0 line.


UID of script "/var/www/html/phpinfo.php" is smaller than min_uid

Sounds like you're running suPHP judging by the error. www-data has a uid and gid of less than 500. Create a new user for that website with a uid over 500 and associated group with a gid higher than 500, and chown those files to that new user. There may be some other settings that need changing (been a little while since I've used suphp), but that's the crux of your problem - uid and gid of www-data are below 500.


In order to turn off Ubuntu error sound in Ubuntu 18.04 you need to go
Setting > Sound > Sound Effects > Alert Volume > Off.


I had this problem i solved it by restarting the snapd service

sudo systemctl restart snapd.service


Copying a list of test/path/to/files to list of prod/path/to/files

I don't quite understand your use of xargs, and particularly the meaning of %.

But about cp, yes it will overwrite the destination files. However, cp has several options to take care of this:

-b or --backup[=CONTROL] : make a backup of each existing destination file
-i or --interactive : prompt before overwrite (overrides a previous -n option)
-n or --no-clobber : do not overwrite an existing  file
-u or --update : copy only when the SOURCE file is  newer than  the destination file or when the destination file is missing

See man cp for more.

As for your ultimate goal, I think that what you mean is to copy some files under "test/" listed in your input.txt file, to the same path under "prod/". For that, it seems rsync might be better suited. It has tons of options. A few of those which may be relevant :

-b, --backup            make backups (see --suffix & --backup-dir)
--backup-dir=DIR        make backups into hierarchy based in DIR
--suffix=SUFFIX         backup suffix (default ~ w/o --backup-dir)
--files-from=FILE       read list of source-file names from FILE
-R, --relative`         use relative path names
-u, --update            skip files that are newer on the receiver
-n, --dry-run           perform a trial run with no changes made
[etc]


Does getdeb change applications that do not need it?

Would using getdeb cause my existing applications to be updated from different repositories?

Yes, potentially, if Getdeb offers a newer version of something than what is in the official repositories, apt may install that newer version when you do an update. (Be default, Ubuntu will use the newest version of packages).

If you use apt-get install in a terminal to install / update things (instead of the GUI), it will always tell you what it's going to do, before it does anything, so you can be sure.

You could either download the .deb file yourself, and install that, or add the Getdeb repository, install the package you want, and then disable the Getdeb repository afterwards.

There's also a PPA for RubyRipper, which I think would be a better choice (more up to date, contains only that package, directly from the author). Note that neither Getdeb nor the PPA have builds for the latest versions of Ubuntu, and the PPA says:

  Development has slowed down considerably at the time I'm writing this. The best current way to rip audio is Morituri, which is available in Precise and beyond.

so maybe there are other options for ripping audio ?


Howto handle packaging and development in one git repository?

Actually, there is a section in the git-buildpackage documentation matching your use case.

Basically, the difference is that, when importing a new release into your debian branch, you will merge modifications from a tag corresponding to the new release of your software instead of a tarball. As no tarball is involved, there is no need to use git-import-orig.

Just make sure that your branches and tag naming matches what git-buildpackage expects. If this is not the case, you will have to override the default configuration with your own configuration file. The syntax is explained in the documentation and the configuration file is searched at various locations. See git-buildpackage man page to know where (section CONFIGURATION FILES).


Module already installed but python program is still telling me to install

The output of head -n 1 on your python application indicates it's a Python 2 application.

You have installed the Python 3 versions of the specified libraries, but not the Python 2 versions.  Python 2 and Python 3 interpreters are different and you need to make sure you install the proper libs for the proper interpreters.

Install Python 2 and its corresponding pip if it's not already installed, then install the corresponding Python modules you need:

sudo apt install python-all python-pip
pip install colorama pysnmp

Then run your application.  Provided that this runs properly, it should 'just work' now provided you actually provide proper arguments to the program to do things as it indicates in the last line of its error message.


What's the difference between mkfs and mkdosfs?

mkfs is a command to make a file system, and is a front end for the more specific mkfs.file_type (mkfs.vfat , mkfs.ext4, etc)

  In actuality, mkfs is simply a front-end for the  various  file  system
         builders (mkfs.fstype) available under Linux.  The file system-specific
         builder is searched for in a number of directories like perhaps  /sbin,
         /sbin/fs,  /sbin/fs.d,  /etc/fs,  /etc  (the precise list is defined at
         compile time but at least contains /sbin and /sbin/fs), and finally  in
         the  directories  listed  in the PATH environment variable.  Please see
         the file system-specific builder manual pages for further details.

mkfs.vfat is a symbolilc link to mkdosfs

They are the same

ls -l /sbin/mkfs.vfat
lrwxrwxrwx 1 root root 7 2011-10-29 23:13 /sbin/mkfs.vfat -> mkdosfs

For additional information see

man mkfs


New to UBUNTU, problems installing steam

Try this:

sudo apt-get install libglapi-mesa libcheese-gtk23 libcheese7 libgl1-mesa-glx unity-control-center

then do whatever Steam thing you needed to do.

Also, please tell me if it doesn't work, and provide the following information in that case:

64bit or 32bit?
Basic hardware information?
Anything else that might be helpful?


Why does Firefox display an й instead of an é?

Check the character codification settings. Open the menu Edit | Preferences and select the tab Content. There click on the Advanced... button under Fonts and Colors (highlighted in the image, below).

The Typography window will open and there you can check/adjust the character codification. Or perhaps you would need to change any of the other settings, like default fonts or not allowing webpages to show their own fonts.

Another possibility is that the Firefox is using the wrong character encoding for those webpages. You can check what character encoding (if any) those sites use by right-clicking anywhere on the page and selecting "View page source".

You might also want to check the settings under the menu View | Character encoding to see if the encoding selected corresponds to the one set by the webpage (here, whatever is selected would probably be different for different webpages), and under Autodetect to see if autodetecting is deactivated.


Where did the Jamendo/Magnatune plugins go in Rhythmbox?

The Magnatune plugin caused Rhythmbox to crash in 11.10, so it was disabled [source]. The issue should be fixed in the development version which, as far as I can find, is only available in 12.04.

The Jamendo plugin has been discontinued [source].


You can try using Boot-Repair

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

(Tutorial is on the link)


How to find the original file of a soft link?

Command for following chains of links is named nameiManPage. Examples:

$ touch a
$ ln -s a b
$ ln -s b c
$ ln -s c d
$ namei ./d
f: ./d
 d .
 l d -> c
   l c -> b
     l b -> a
       - a
$ namei /usr/bin/java
f: /usr/bin/java
 d /
 d usr
 d bin
 l java -> /etc/alternatives/java
   d /
   d etc
   d alternatives
   l java -> /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java
     d /
     d usr
     d lib
     d jvm
     d java-7-openjdk-i386
     d jre
     d bin
     - java


Unable to Install Ubuntu in my Windows 7 system

I would suggest installing Ubuntu off of a USB drive rather than a DVD.
Linux Live USB is a pretty easy usb drive creator. Just download the Ubuntu Image (sever or desktop from their site).

A helpful write up about Dual booting and partition set up


The problem might not be with the PHP.

Upload a static html file or a picture to /var/www/html and try accessing it through the browser - if it shows then it is probable a PHP problem and if it displays another 404 it might be a problem with the apache config... For example the default site that is enabled might reside in another folder.