A script to achieve optimum image compression from command line tools

The quickest way to get off the ground is to shoot for something lossless. Resizing obviously can't help but lose data but if you use something like imagemagik to resize, leave the end quality quite high (at least 90%).

To compress, you have several options but the one I've had most luck with is Yahoo's Smush.it. It's an online webservice which means you have to upload your images. However there's a nice Python tool called Smooshy that does all this for you.

This is a lossless operation that basically keeps re-compressing the images until they start to show wear. In some cases, it can make a huge difference to filesize.

The bonus over jpegoptim is you don't have to worry about quality (it's always as good as the original) and it supports all formats. It just takes a little longer and you're bound by Yahoo's terms and conditions (they probably own your soul if you use it, etc).


Where to obtain ipython kernspec for Python 2.7

I had the same issue and it was because my version of ipython was different as it was installed with aptitude instead of pip. I saw that with :

sudo pip uninstall ipython
Not uninstalling ipython at /usr/lib/python2.7/dist-packages, owned by OS

so I uninstalled this version and reinstalled it with pip :

sudo apt-get remove ipython
sudo pip install ipython

and then you can install the python2 kernel and check it works :

sudo ipython kernelspec install-self
ipython kernelspec list

Note : you may want to use the option --user with pip if you want to avoid install as root


Preface

I believe that you are installing Ubuntu over an existing installation, without cleaning up/re-partitioning your HDD/SSD.

Formating Partitions using LiveCD

You can do the following in Ubuntu's LiveCD after installing gparted, but I prefer to use Parted Magic.  At the time of writting, you must burn this image to a CD/DVD or use the lateset UNetbootin, which is not available in the repositories.

Installing gparted on Ubuntu LiveCD

Open a terminal

Press the Windows (Super) key.
Type 'Terminal' and select 'Terminal'

Install gparted

sudo apt-get install gparted

Formatting your partitions

Boot into LiveCD
Fire up gparted
Find the HDD/SSD with your Ubuntu installation
Delete all non-essential partitions (don't remove any partitions that could contain data you need later).
Reboot into Ubuntu's LiveCD
Install Ubuntu on your fresh freespace.


The solution is

xmodmap -e "keycode 115 = Pointer_Button2"

Now my Home key is doing left click and behaves just as if I hit the mouse click and I can keep the key pressed and it highlights (copies) as expected.

I also mapped my End key to be middle click, so I can use it to paste:

xmodmap -e "keycode 110 = Pointer_Button1"

Note that it is necessary to have "mousekeys" (mouse emulation using the numeric keypad) enabled for this to work. "mousekeys" can be toggled by pressing Shift+NumLock or set explicitly by running:

dconf write /org/gnome/desktop/a11y/keyboard/mousekeys-enable true
dconf write /org/gnome/desktop/a11y/keyboard/mousekeys-enable false


Black screen after wake up and wrong resolution with the fix

I was wrestling around with this for the past two days. I've found that if you have performed a apt upgrade anytime since you first installed ubuntu, then the nvidia drivers will not work. As they are compiled for a specific kernal using a specific gcc version.

If you were to either drop back to the default linux kernal that came with your ubuntu image. (In your case Linux kernel 4.15). Or install the nvidia drivers first after a clean install without performing an upgrade, your issue will be fixed. (Please still remember to update).

I have found that using the lambda stack installer will automatically find the right nvidia driver to download and install and will automatically configure CUDA correctly.


How do I make Chromium use Flash from Google Chrome?

THIS ANSWER IS 4 YRS OLD AND MAY NOT WORK ON NEWER SYSTEMS

Download Google Chrome and extract libpepflashplayer.so from /opt/google/chrome/PepperFlash in the Chrome deb file
Copy libpepflashplayer.so to /usr/lib/chromium-browser/plugins
Make the necessary changes to the Chromium startup

sudo gedit /etc/chromium-browser/default

Add this to the CHROMIUM_FLAGS

CHROMIUM_FLAGS="--ppapi-flash-path=/usr/lib/chromium-browser/plugins/libpepflashplayer.so --ppapi-flash-version=11.5.31.2"

You can get the correct version of the flash plugin from the "version": json tag in the mainfest.json from /opt/google/chrome/PepperFlash in the Chrome deb file


Input devices stop working after logout or switch-user in ubuntu 18.04 LTS

It's a bug in gdm3: https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1776534

Known Workarounds:

Do not log out or switch user. Instead, always restart.
log on from a remote from ssh and restart gdm3
sudo systemctl restart gdm3.service

Alternatively, switch to a different display manager, lightdm for instance:

sudo dpkg-reconfigure lightdm


Updating to and using Python 2.7.11 on Ubuntu

I've decided to stick with the packages contained in Ubuntu. As dobey mentions they already contain the necessary security fixes, so trying to replace them with a slightly newer patch version doesn't seem like a good choice, especially when that version will be including in a coming update soon anyway.


How can I implement a new resolution mode using xrandr consistently?

I have solved the issue.

I managed to create a .xprofile file and saved it to the home directory. I then added

xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync

xrandr --addmode VGA1 "1280x1024_60.00"

The only trouble I had was permissions with saving a .xprofile which somehow was not an issue when I did it a second time around.

This works fine now and the new resolution is applied onto the secondary screen every time.


Does the Linux kernel load Nvidia GPU drivers (only) when needed?

So long as you did not also remove any other drivers, installing an Nvidia driver should not break your customized Lubuntu system.
Possible ways to remove other drivers including uninstalling packages that provide them and recompiling your kernel without some modules. So if you're using a custom kernel, the real answer may depend on how you've customized it. Besides that, the drivers you started with--video and otherwise--should still be present.
If this is a customized live environment, then it's made to boot successfully and be usable on as wide a range of hardware as possible. If this customized system instead is based off an installed system, it should still work; after all, replacing your video card doesn't usually prevent Ubuntu from booting.
In much the same way that adding Wi-Fi drivers needed for some but not all machines didn't break wireless networking it for the other machines, adding video drivers that only some machines can use shouldn't break anything either.
I keep saying "should." That's because you'll still have to test it to ensure everything works properly. The drivers that were present before you added another one are still present, but it's possible your customizations have accidentally removed something, or even that there is a bug lurking in one or more Ubuntu packages that never affected this system until it was triggered by something you changed.


Dependency is not satisfiable ibqt4-dbus (>= 4:4.7.4)

Have you tried installing the higher version?
Try installing libqt4-dbus (4:4.8.1-0ubuntu4.3)
package. Download the package and install it by giving the command

sudo dpkg -i "package name".deb


Error deploying juju-gui in internal openstack environment.(ERROR cannot load cookies: file locked for too long; giving up)

See https://bugs.launchpad.net/juju-core/+bug/1534643

A fix has been committed and will be released in juju 1.25.4 /

I too would like to know if there is a temporary work around as i am not sure when 1.25.4 will be released.


How do I cancel Ubuntu One Music Streaming?

You should be able to view your current subscriptions on the Ubuntu One web site at:

https://one.ubuntu.com/account/

If you click the See Details button next to the subscription you're interested in, there should be a Cancel this subscription button on the page you get sent to.

If this doesn't help, I suggest you send a support request through the web form:

https://one.ubuntu.com/help/contact/


How to do this in a single command on Ubuntu 16.04?

A Perl solution, adapting one of the string reversal solutions:

$ perl -F/ -anle 'print reverse(split("([^.]*)", $F[0])) if /\./' input
www.blendschutzrollo.com
blendtuts.com
www.blengineering.com
www.blenheimgang.com
blenheimsi.com
www.blenkov.com
www.blenoir.com
www.blentwell.com
www.blentwell.com
www.blentwell.com
www.blentwell.com
www.blentwell.com
www.blentwell.com
www.blentwell.com
blenzblog.com
www.blepharoplastyusa.com

The arguments:

-F/ -a creates an array F out of each line of input, splitting on /.
-nle runs the expression (-e <expr>) on each line of input, without automatically printing (-n), while handling the newline at the end of each line (-l)
The line is already split on /, and we only need the part before the first /, so the first element of array F: $F[0].  Then we split it on . and reverse each of those, and print if the line contains ..

Now you can sort -u this.


Shutter not including cursor when taking selection screenshot

The Shutter 0.94 source is available on Launchpad. Shutter 0.94 is available in the Ubuntu 18.04 repositories. For Ubuntu 17.04 or 16.04 (there are no packages for 17.10), you can get Shutter 0.94 from an unofficial PPA.

Regarding the cursor issue specifically, if Shutter 0.94 doesn't fix this for you, there's a workaround: after taking a screenshot, click "Edit" in the toolbar (this should open the Shutter Drawing Tool), then in the Drawing Tool, click "Insert image" at the bottom, and select the cursor you want - you can place it anywhere in your screenshot, change its size, etc.


Where can I find Ubuntu 14.04 core images?

The new all-snap Ubuntu Core does not exist for 14.04, because much of the technology that has gone into it was only recently mature.

We are also still finalising the Ubuntu Core 16 release now that classic 16.04 LTS is out. If you are interested in snaps and Ubuntu Core, my suggestion is to start with 16.04 LTS classic and learn snapcraft and the snap tools. Ubuntu Core 16 will be out shortly, and its all the same libraries and kernel etc, just pure-snap from start to finish.


How to boot from ubuntu live usb with 'try ubuntu' directly?

I wouldn't do it the way you have, but it kinda depends what you want to use the USB key for. If you want to use it to do installs on computers then the way you set up the key is right. If you want to use it as a standard desktop install, that you can use on any random (or even just a few specific) machines then use this method instead:-

For this you will need:

1xUSB key onto which you will install Ubuntu
2xCDR or DVD or USB key onto which you will put the installer
1xComputer which is capable of booting off the above device

Steps to install:

Download the ISO and burn it to a CD or DVD, or use USB startup disk creator (or unetbootin) to make an 'install USB key'
Insert the above media into a computer and boot from it
Choose 'Install Ubuntu' from the menu
Once booted to the installer, insert the USB key you want to install Ubuntu "persistent" onto
During the installer, when you get to partitioning, ensure you select the USB key inserted, to install Ubuntu onto.

Meaning, don't mistakenly install Ubuntu onto the internal hard disk on the computer

At the end of the install you need to tell the installer to put GRUB onto your USB key, and not to overwrite the bootloader on the hard disk (or indeed the USB stick you installed from - I have made that mistake!)
Once the install is done, you can shutdown, pull out all the keys and optical disks, and take that new key to any machine and boot from it.

Advantages to this method

It's a full desktop install that you can add packages to, remove packages from and generally fully customise as you would any install
You can enable encryption of the home directory during install so that if you lose the key you don't have to worry about losing your data

Disadvantages to this method

It's not as straightforward as making a persistent key, but it's no more difficult than a standard Ubuntu install
A full install on a usb flash key will cause more write cycles, and thus more wear and tear on the flash drive's memory, potentially causing it to fail much sooner


I assume that you need to set up the monitor configuration using function keys. However sometimes the live version may not have all the drivers required (for example: for the special keys)


shell script, read is not waiting with ssh

Looks like you want to exec the command via ssh on another machine. Bute there is no one who could give an answer to the read command.

Try to read the name on the local machine and put in a variable like:

remote1:

echo "give directory name"
read name
ssh username@x.x.x.x mkdir ~/$name

I cant test it now, but I think this will execute the mkdir on the remote machine directly vis ssh, without anoter script on it.


getting the following error in installing qt creator through software center

Try installing the QT-SDK from http://apt.ubuntu.com/p/qt-sdk.
I just did on Ubuntu 12.04.


After many days, perhaps even weeks, I was able to run the graphics card from AMD, and while the hybrid mechanism.

I worked on Ubuntu 14.04.1 using the latest drivers from your video card manufacturer.

Download the drivers from AMD / ATI.
Run it in the console (in graphical mode) by typing sudo sh ./amd.run (I've simplified the long file name).
Select the option to install the driver (the second option, the first is to create files for your Linux distribution).
Select auto mode
After installation of driver will be asked to restart your computer - do not do it.
In the console, type sudo aticonfig --initial -f
Restart the computer

Optional: When the computer does not start using a more powerful graphics card, you can manually run:

sudo aticonfig --px-dgpu

Strange errors? The computer detects that I am using the ATI Radeon HD7400, HD6370 when I have, but this is just a small detail not affecting the operation of the equipment.


Seems like you run into https://launchpad.net/bugs/1258867, so

sudo apt-get install gir1.2-gtk-3.0

should do it.


Run script with arguments as sudo without being asked for password

Using wildcards in the sudoers file
In the sudoers file, you can use wildcards (*), thus creating the possibility to run a script with arguments.
An example
I tested it with a shockingly simple python script. In the sudoers file I had to use the absolute path to python: /usr/bin/python in the line of the sudoers file:
jacob ALL=NOPASSWD: /usr/bin/python /home/jacob/Bureaublad/pscript_1.py*

Then my (python script) code was:
#!/usr/bin/python

import sys

s1 = sys.argv[1]
s2 = sys.argv[2]

print(s1)
print(s2)

Then I ran in a terminal:
~$ sudo python '/home/jacob/Bureaublad/pscript_1.py' monkey banana
 monkey
 banana

without asking for my password.
Similarly, you should be able to achieve what you want by adding the following line to the sudoers file:
<your_username> ALL=NOPASSWD: /path/to/java <your_script>*

And run the script by:
sudo java <script> <args>

and you will not be asked for your password.
More information
An interesting source on how to use the sudoers file might be this one.


How is it possible to know whether my computer has been infected by a Macro Virus?

The only absolutely certain way to ensure a macro is not a virus, is to examine its source code or just not use it...

LQ queue reviewers: That's it!


From a post on a Slackware forum:

  Basically, /etc/default contains some parameters that the end user or administrator is likely to change, rather than embedding the values in the actual boot scripts. In this way, changes will persist even if you upgrade the package and the boot script is replaced.

In Debian, /etc/default/ is a directory of mostly empty files.  The way it is meant to work is that each /etc/init.d/test script first sources /etc/default/test before starting/stopping the test service.  The purpose of the file is to provide extra options for starting the service, or override certain aspects of the service's startup.


Cannot access "multiverse" in the Ubuntu Software Center

Follow this tutorial: http://ubuntuforums.org/showpost.php?p=11410095&postcount=2021

After that, run in a Terminal window:

sudo apt-get update; sudo apt-get install libhighgui

Then it should install it.


If I add a user to sudoers to be able to perform root functions

No. It means that the user has the right to use the sudo command. Everything else he do on the system (without sudo) is done with his now mal privileges.


In order to use tor. Install tor  which will install polipo as a recommended package.

What you need to configure is polipo/privoxy for tor as your are using http proxy. Tor doesnot use 8118 as its port it uses 9050 and it is a socks proxy. You can use this configuration for polipo to use with tor. Just do:

sudo wget https://gitweb.torproject.org/torbrowser.git/blob_plain/HEAD:/build-scripts/config/polipo.conf -O /etc/polipo/config

sudo service tor stop && sudo service polipo stop

sudo service tor start && sudo service polipo start

tor needs to start before polipo, or else polipo will occupy the 9050 port and tor will start with errors

I am giving much focus here on polipo because tor itself recommends polipo and is installed by default on tor installation. You can use privoxy in place of polipo as well. Most of the tor users recommend using the default socks proxy if the application handles it.

If you want to connect everything through tor you need to set system proxy with System Settings > Network > Network Proxy

And then setup proxy to 127.0.0.1 and port to 8118. Use socks proxy where supported just change port to 9050 and type to socks5.

Optionally, install any browser proxy switch addons, I use chromium with proxyswitchy. Similary choose one for firefox if you use firefox. AFAIK pidgin, xchat, thunderbird support socks5 proxy. I think firefox also supports socks5.

Tor check failed though Vidalia shows green onion


How to search NTFS drives with Tracker? How to reduce the load of Tracker?

I can't answer the "How to search NTFS drives with Tracker" part, but to answer the "How to reduce the load of Tracker" question:

Since tracker-preferences/tracker-gui are not available anymore in 19.04, you can use the dconf-Editor to edit Tracker's settings. If you are concerned about battery life or notebook performance while on battery, go to /org/freedesktop/tracker/miner/files/ and set index-on-battery to False .

To reduce CPU priority of Tracker, you can set sched_idle both in /org/freedesktop/tracker/miner/files/ and /org/freedesktop/tracker/extract
to Always (as in "always set Tracker to lowest CPU-priority") so Tracker only works when the CPU is not being used by another program.

See System Resource Management here: https://wiki.gnome.org/Projects/Tracker/Documentation/Configuration


How to install / compile NVENC in ubuntu?

As always with FFmpeg continuing development shifts the goal posts many times and this is certainly true of nvenc and FFmpeg. There have been 3 phases:

Roll your own: Pre August 27th 2016 it was necessary to track down your own headers to build nvenc. Arduous and more than a little confusing.
Built into the source: August 27th 2016 saw the required headers incorporated as part of the FFmpeg source, nothing required but the ability to compile the FFmpeg source from git, or use a 'release' version cut from git at this time.
Use nv-codec-headers: On February 26th 2018 the NVidia headers were removed from the FFmpeg source. A separate git repository was created to hold continuing work with these headers. At the moment these headers must be installed as well as FFmpeg from git to get access to nvenc and friends.

Two steps are required:
1. Install the nv-codec-headers package:
Something like the following Terminal commands should suffice:
sudo apt-get install make git
mkdir $HOME/nv-codec-headers_build && cd $HOME/nv-codec-headers_build
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers
make && sudo make install

If for some reason you change your mind and wish to completely remove the installed files as well as the build directory simply run the following two Terminal commands:
sudo rm -v /usr/local/{lib/pkgconfig/ffnvcodec.pc,include/ffnvcodec/*.h}
rm -rfv $HOME/nv-codec-headers_build

And your system has been cleaned. If however you wish to continue use the following step:
2. Compile FFmpeg:
Use this very well tested guide:

Compile FFmpeg on Ubuntu, Debian, or Mint
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

The nv-codec-headers will be automagically recognised (no extra ./configure options are needed) and nvenc will be successfully built.
Testing:
I have tested this on Bionic Beaver LTS and the results are:
andrew@ilium:~$ ffmpeg -encoders 2>/dev/null | grep nvenc
 V..... h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc                NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_h264           NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_hevc           NVIDIA NVENC hevc encoder (codec hevc)
 V..... hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)
andrew@ilium:~$

And if you see a similar picture as above, and you have a supported graphics card, you are right to go :)
Notes:

The latest version corresponds to Video Codec SDK version 11.0.10 and requires NVidia drivers version 455.28 or newer.
Older versions: There is now an automated github copy of the nv-codec-headers which also creates tarballs perfect for using an older version of the headers. Great if you want the headers to sync with an older version of the NVidia drivers that you are unable or unwilling to update.
Hardware Acceleration Guide for FFmpeg: FFmpeg Wiki guide for hardware acceleration in general with FFmpeg, a canonical section for compiling and using nvenc...


When I click on Downloads, Files (File Manager) totally closes itself

I have been having the same problem with File Manager closing after trying to open the Downloads directory. What I did was run ClamTK on the Downloads directory. It found 6 threats, all related to files downloaded for one of my Windows systems. I deleted those files and now the Downloads directory opens in File Manager successfully.


I'm trying to verify my ISO for Ubuntu in windows 10 using WSL Bash command line, Im not getting a DSA key no matter what I do

I think you might be confused.

RSA/DSA have to do with authentication and encryption.  If you are trying to verify the integrity of your ISO for Ubuntu, you do that by comparing checksums.

Integrity/verification checks can be done with 100% accuracy by running a checksum function on a file and comparing the result to the published checksum for that file.

The following is a demonstration showing how a checksum function makes it easy to determine if a file is corrupted or has been altered.  Even the slightest error or alteration of a file will result in a radically different checksum:

To verify an Ubuntu ISO:

1) Obtain the published checksum.

You can navigate to the appropriate release using: https://help.ubuntu.com/community/UbuntuHashes

Assume we are checking Ubuntu 20.04 (ubuntu-20.04-desktop-amd64.iso).  You would click the link corresponding to "Ubuntu", then "20.04" (or "Focal").  Then you would open the file SHA256SUMS (or whichever checksum algorithm you are using),  Now you can see file names with their associated checksums.

2) Run the checksum function on your downloaded ISO.

You can do this using a terminal:

 sha256sum /path/to/ubuntu-20.04-desktop-amd64.iso

Wait for the checksum to be generated and you will receive a result:

 e5b72e9cfe20988991c9cd87bde43c0b691e3b67b01f76d23f8150615883ce11 ubuntu-20.04-desktop-amd64.iso

3) Compare the generated checksum to the published checksum:

You can copy-paste each into a notepad on separate lines.  If they are identical, then you can be sure that the file is not corrupted.

e5b72e9cfe20988991c9cd87bde43c0b691e3b67b01f76d23f8150615883ce11
e5b72e9cfe20988991c9cd87bde43c0b691e3b67b01f76d23f8150615883ce11


How to assign a keyboard shortcut for a Nemo script

I've realized my mistake. I haven't deleted the comment sign ";" at the beginning of the accelerators. Now all shortcuts for my scripts are working.


Updates fail due to "/etc/default/grub: splash”: not found" error

/usr/sbin/grub-mkconfig: 11: /etc/default/grub: splash”: not found

It looks like you might have a typo in /etc/default/grub?

You need to edit the file with

sudoedit /etc/default/grub

and then go to line 11 and replace the ” with a ". Basically it looks like you edited the file and some editor put in one of those smart quotes instead of a normal " quote.

Then save the file and run sudo update-grub and then reboot; then try the upgrade again.

Related bug report with a similar problem.


According to Intel own page:
https://www.intel.com/content/www/us/en/support/products/126789/graphics/graphics-for-8th-generation-intel-processors/intel-uhd-graphics-620.html
you're already pushing the limits with the (1920x1080)+(2560x1440)+(2560x1440) configuration since it mentions 4096x2304@60Hz is max of what you should be able to get.
Moreover, it will usually be limited by CPU model itself. See here which explains how some CPUs will not support 4096x2304@60Hz combination:
https://www.intel.com/content/www/us/en/support/articles/000023781/graphics.html
Therefore, I don't think your UHD is able to support combination of two external dual ultrawide monitors + built-in, sorry.


The "package index files" contain information about the packages a package repository provides. APT stores them in /var/lib/apt/lists


Ubuntu 14.04 - How can I reinstall ubuntu desktop with a live CD?

1) In Terminal mode can you not even ping www.google.com? or do you just mean you don't have a web browser?

3) You may want to look into the disk checker man fsck

If you can ping google you can check out the answer in this thread for a great detailed explanation of how to create a bootable USB you can install Ubuntu to (and then from). I find this to be the easiest way to install Linux.

With the live CD you should be able to boot up a working version of Ubuntu where you could do this through the GUI, just make sure you select your cd drive in your boot options (Mine is F12) on system startup.

Keeping regular backups is always great practice too (especially before planning to make any system changes)


You have chosen hard and long way.
According to official README -

If you want to install a package of third-party plugins (that includes Resynthesizer):
Linux: install the package "gimp-plugin-registry" (available for most distributions, including Debian and Ubuntu).

So you need to install single deb-package by
sudo apt-get install gimp-plugin-registry

and then find Resynthesizer in the GIMP menus: Filters → Map → Resynthesize.


Open the Crosh in Chrome. Type shell then after you can see the green Chronoslocal thing, then you type this in:

sudo sh ~/Downloads/crouton -n precise -u


Is there a way to keep UFW logging out of dmesg?

You can disable UFW logging with following command from shell:

sudo ufw logging off

Default loglevel is low. From UFW man page:

off    disables ufw managed logging
low    logs all blocked packets not matching the default policy (with rate limiting), as well as packets matching logged rules
medium log level low, plus all allowed packets not matching the default policy, all INVALID packets, and all new connections.  All logging is done with rate limiting.
high   log level medium (without rate limiting), plus all packets with rate limiting
full   log level high without rate limiting

You can get current log level with sudo ufw status verbose.


I had experienced the same problem running 32bit version of Kingsoft over a 64bit system. However, I use 13.04.

When I ran

  $ wps

from the terminal, I was told that libgthread-2.0.so.0 is missing. It is part of ia32-libs and basically running

  $ sudo apt-get install ia32-libs

solved the problem for me.

Note that on 13.10, according to this thread ia32-libs is considered deprecated.


PfSense architecture for small business data center

The answer to this question is YES, you can!

CARP is the Best Method for this use.

You can configure as many Firewalls as you want. All you're going to do is Mirroring the first Firewall as a clone.
Example:
you get 3 Firewalls (FW1, FW2, FW3)

FW1 is the main 0
FW2 is clone of 1
FW3 is clone of 2

So if:
1: FW1 is UP -> FW2 is UP -> FW3 is UP = FW1 is running (FW2 + FW3 as clone)
2: FW1 is DOWN -> FW2 is UP -> FW3 is UP = FW2 is running (FW3 as clone)
3: FW1 is DOWN -> FW2 is DOWN -> FW3 is UP = FW3 is running (no clone)
4: FW1 is UP -> FW2 is DOWN/UP -> FW3 is DOWN/UP = FW1 is running (FW2 + FW3 as clone)
.
.
.
and so on.

Search around for CARP+PFSense+Ubuntu as well on PFSense forums around.


How do I compile and use liboverlay-scrollbar from source?

I'm not entirely certain, as I'm not very fluent in C, but it seems like the patched GTK that Ubuntu uses to load the scrollbars has been hardcoded to look in /usr/lib/ only.

From the patch:

+  gchar *flag = (gchar*) g_getenv ("LIBOVERLAY_SCROLLBAR");
+
+  /* check if LIBOVERLAY_SCROLLBAR is set to 0 or an empty value
+     and disable the feature in this case */
+  if (flag != NULL && (*flag == '\0' || *flag == '0'))
+    return;
+
+  /* default extension library to use for this release */
+  gchar *path = "/usr/lib/liboverlay-scrollbar-0.2.so.0";
+
+  module = g_module_open (path, G_MODULE_BIND_LOCAL);
+  if (module == NULL)
+    return;

If I were you, I apply my patch to the source package of liboverlay-scrollbar.

Grab the source with bzr: bzr branch lp:ubuntu/overlay-scrollbar

Patch the source, edit debian/changelog (You can just add a +myversion1 to the existing version string or add a whole new changelog entry. The key thing is to make sure you have a higher version number the package in the archive). Then run bzr builddeb to build the Debian packages.


Absolutely it will be compatible. I created a Kali Linux bootable USB from an ISO. Just download the ISO on your mac. Unzip it if it is zipped. Then open terminal (use spotlight search if you want). Plug in a USB (be sure to back up the usb if you have anything on it). Make sure the USB is blank by opening disk utility and hitting erase. In terminal type "diskutil list" to list of all the devices plugged into your computer. Unmount the USB by typing "sudo diskutil unmountDisk /dev/yourdisk(probably something like disk1 or disk2). You may need the "sudo diskutil unmountDisk force /dev/yourdisk" option. After the USB is erased and unmounted, cd(change directory) to whatever directory your ISO is in(most likely donwloads). "cd Downloads". I suggest then renaming the ISO to something short so that it's easy to type. Then burn the ISO to the USB with "sudo dd if=nameofiso(Ubuntu) of=/dev/disk1s1(where disk1 is your disk) bs=1M". Be very careful with the dd command, make the disk is right by unplugging your usb, running "diskutil list", plugging it back in and checking again, because if you get the wrong disk, everything on it will be overwritten. "dd"'s nickname is the data destroyer for a reason. Important: do not remove the usb once you see the output, because the output can be printed before it is finished burning the image. It should take anywhere from 15 minutes to an 1 hour at most. Hope this helps.


Compiling and running camera-app with Ubuntu SDK

This message:

./camera-app: symbol lookup error: ./camera-app: undefined symbol: _ZN6QDebugD1Ev

makes me believe you compiled it with a 15.04 Kit and are trying to run on a 14.10/RTM device/emulator.

Try again with either both on 15.05 or both on 14.10.


Type Ahead search using Nautilus on Ubuntu 18.04

Type Ahead search was removed completely from Nautilus, aka GNOME Files, since Artful. Luckily, there is a patch on GitHub that adds this functionality back to Nautilus 3.26.3, the version installed by default in Ubuntu 18.04. Now if you want to apply the patch and build Nautilus from source, go ahead, but there is a guy that did the job for us and provided a PPA to install the patched Nautilus directly:

sudo add-apt-repository ppa:lubomir-brindza/nautilus-typeahead

Then upgrade using sudo apt full-upgrade and kill Files nautilus -q

Please note that this will overwrite the standard version of Nautilus 3.26 in Ubuntu 18.04 with a third-party build. If you're from the paranoid type you're better off using Nemo or Caja instead.

Source: [1]


Turkey.gov.tr libpkcs11wrapper.so Ubuntu Generic thing

To solve problem you have to copy libpkcs11wrapper.so to your compatible Java version's lib directory.

For Ubuntu 14.04 and Oracle's Java 8 lib directory is

/usr/lib/jvm/java-8-oracle/jre/lib/amd64/

not

/usr/lib


wineserver fails with socket related errors

I'm sorry, the error was my fault.

I (being a systemd newbie) issued restart instead of reload
when restaring apparmor service. The right command would be
systemctl reload apparmor.service.
My apparmor profile for wine had deny network which was the
reason the errors popped up. Before installing Ubuntu 16.04 I had not
that problem. By the way, I still denied the network using iptables.

Every thing works now. I feel kinda embarrased, I hope at least this helps somebody out there.


Cinnamon Settings Panel Blank After v 2.0.6

There is a way to solve the issue, this fix has been confirmed to work on Ubuntu 12.04 64-bit and 32-bit:

List item
Open a terminal
Issue the following command: sudo gedit /usr/lib/cinnamon-settings/cinnamon-settings.py
Enter your password
Gedit will open with elevated privileges. Go to line 325 (lines can be seen at the bottom of Gedit).
Press enter and in the newly created line add the following: widget.set_item_width(105)
Save and close.

This should do it for now.
The solution was highlighted by Bob Wanamaker pointing to a GitHub commit as follows: https://github.com/linuxmint/Cinnamon/commit/c4eac2e3ab88a2264faedf09f026432522bbe18e

NOTE: Use this fix at your own risk. Always make a copy of the original file, in case things go wrong.


18.04 hangs on boot after system software update (Linux 4.15.0-35)

I found a solution for the failed boot up that never reached the Splash screen but instead remained in a black screen state with a cursor in the upper left corner.
As mentioned earlier, there seem to be some problem with the Software updater, anyhow, after pressing:

Ctrl+Alt+F2 (or alternatively Alt+F2)

which presents the user with a log in request, proceeded by logging in, where after the following message appeared on the screen, in particular the message part at the bottom (as seen in the picture) mentioning something about:

  Failed to connect to https://changelogs.ubuntu.com/...

After some tinkering gave a try to update the Linux distro from the command line using the following 3 commands:

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

The following link helped explaining the update procedure from the command line:
How to install updates via command line?

The machine appeared to be able to do some kind of update and upgrade, where after the machine was re-booted successfully, this solved at least my problem.


Seemingly random "Authentication is required to change your own user data"

Have you tried to rewrite the permissions to your home directory?
open terminal:

cd /home/
chown -R your-account-name your-account-name


php.ini modifications has no effect on joomla

Run a PHP script in your browser containing this <?php phpinfo();?>. Then search for this string: 'Loaded Configuration File'. The value of this is the location of the loaded php.ini. You can check if you have really updated this file or not.


The welcome screen shows the "Base Database" option but actually Base is not installed by default (See the 14.04 manifest).

Open a Terminal (Ctrl+Alt+t) to install the missing package, then type:

sudo apt-get install libreoffice-base

Now you should be able to open the Base Database application:


Can you cancel an upgrade in progress? Upgrade from terminal hangs at same point, every time. Even on a fresh reinstall

Yes you can cancel upgrade that is in running. use ctrl+c to do completely stop the upgrade. But don't try unless you have no other choice because the system might become unstable or unusable.

You can also do ctrl+z that can pause the upgrade and you can resume with fg.

upgrading/updating is an atomic operation. Either it completes, or it doesn't. If the update breaks/stops then it rollbacks to the last point before update began. Because the headers (files that contain data of packages, and where to fetch them from). The packages however, begin downloading from the point that your connection broke off. But, still there's chances of harming the system.
Referred this


Where is Sphinx located after I install it?


ssh doesnot work with wifi but work fine with wired connection

It means that you don't have internet in your wifi (or at least, that host isn't accessible from your wifi). So, how to diagnostics? You can use ping and nmap, but let me tell you, apparently that host isn't public available:

ping -c2 ws.hpc.unipg.it
PING ws.hpc.unipg.it (141.250.16.254) 56(84) bytes of data.
--- ws.hpc.unipg.it ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1008ms

Here it said that the host didn't asnwer my pings

nmap -p22 ws.hpc.unipg.it

Starting Nmap 6.40 ( http://nmap.org ) at 2013-12-22 11:10 AST
Stats: 0:00:01 elapsed; 0 hosts completed (1 up), 1 undergoing Connect Scan
Connect Scan Timing: About 50.00% done; ETC: 11:10 (0:00:01 remaining)
Nmap scan report for ws.hpc.unipg.it (141.250.16.254)
Host is up (0.19s latency).
rDNS record for 141.250.16.254: gw.hpc.unipg.it
PORT   STATE    SERVICE
22/tcp filtered ssh

Nmap done: 1 IP address (1 host up) scanned in 2.34 seconds

Here it says that the port is filtered (it could be dropping my packets), hence is very likely I can't connect. When I try to connect, it will timeout my request. So, how to solve this? Contact your system administrator for guidance.


Ubuntu 16.04 with Lenovo Ideapad 500S 13 ISK keyboard backlight

Here is the file for keyboard backlight, /sys/devices/platform/thinkpad_acpi/leds/tpacpi::kbd_backlight/brightness.

I used nano editor after chmoding it to change its values.  There were 3 values (0,1,2) 2 being the brightest.

Tested for a Lenevo ThinkPad Yoga 460, on Ubuntu 18.04 LTS


There is no really really awesome video editor for Linux. There are some good ones, but most of them are either a pain to use or don't offer a whole lot of functionality. If you don't want to re-learn everything, you can also run Sony Vegas in Wine.

In my opinion, KDEnlive offers the best balance between UX and functionality, so it can be used as a drop-in replacement for Vegas. You may want to watch some YouTube tutorials on how to get started, once you get the hang of it, it's self-explanatory.

You already mentioned Openshot and Pitivi. Those are sleek, but not powerful enough for professional use.

Then, there Cinelerra and Blender VSE, both very powerful but in no way intuitive in some ways just weird.

So i recommend you use KDEnlive, it works on the Unity Desktop and offers all the functionality of Vegas (i think). But a video editor as powerful and sleek as Final Cut or Premiere is yet to be created for Linux.


“The system is running in low-graphics mode” error after installing VMware tools

I was able to solve the same situation/problem, on VMware Workstation 14 and Ubuntu 16.04, by updating the OS:

sudo apt-get update

sudo apt-get upgrade

sudo reboot

The above commands solved my issue - and I tried reinstalling desktop, reviewing logs and config files... Nothing else helped me.


JACK, PulseAudio and Firefox: Enable JACK for firefox in the near future

I use the following script I call "pulsejack".  Call it without arguments and it connects an existing jackd to PulseAudio.  Called with any arguments, it starts up jackd with those arguments and then connects it to PulseAudio.  Firefox can pick up from PulseAudio then.
#/bin/sh
if [ $# -gt 1 ]
then
    killall jackd 2> /dev/null && sleep 2
    jackd "$@" && sleep 2
fi
pactl load-module module-jack-sink channels=2
pactl load-module module-jack-source channels=2
pacmd set-default-sink jack_out
pacmd set-default-source jack_in

You may need to run
sudo apt install pulseaudio-module-jack
in order to get the respective modules.


That's Nvidia for you: instead of being compatible with VESA modes, they're only VGA (and maybe SVGA) compatible, which gives you ugly boot and shut-down screens.

See also: Linus Torvalds on Nvidia

Press c on grub to get in the console and then enter videoinfo.

Note down the highest resolution and color depth available. E.g 1920x1080x32.
Load ubuntu and enter in the terminal:

sudo nano /etc/default/grub

Find this line #GRUB_GFXMODE=640x480 and add the following:

GRUB_GFXMODE=1920x1080x32
GRUB_GFXPAYLOAD_LINUX=keep

(Add your own resolution and color depth). Save it, exit and enter in the terminal:

echo "FRAMEBUFFER=y" | sudo tee -a /etc/initramfs-tools/conf.d/splash
sudo update-grub2
sudo update-initramfs -u -k all


Google Chromium asks for keyring to unlock 14.04, but I don't want the password to be the same as my ubuntu login

Specifically for  14.04

WARNING: Do not change your password to blank, as other answers have suggested. This could be dangerous.

1.) Run Password and Keyring or seahorse (if you dont have it installed, you can install it by running following command in teminal sudo apt install seahorse)

2.) File -> New (or Ctrl+N)

3.) Name a new 'Password Keyring' as "Chromium"

4.) Enter your 'Chromium' password.

End Result is different passwords for your login and your google chrome keyring, keeping them separate.


Initial problem: Installation of QGIFer

QGIFer cannot be installed on 16.04, as it requires packages that are not co-install-able.  The dependancies cannot be resolved on any version of Ubuntu after 14.04 (Trusty).  This includes installing from source.

I have tested both the .deb installation, an compilation from source.  The dependencies are not available on 16.04.

There is no method to work around this.

Development on QGIFer ceased in 2013, then 14.04 was the predominant LTS release.

Potentially, you could install 14.04 in a Virtual Machine, and work with it that way.  14.04 is still officially supported by Canonical at the time of writing.

It MAY be possible to install the Windows version of QGIFer in Wine, but I think that is out of scope for this question, and may require a question of it's own.

Alternative Software

There are many options, but there are no other known applications that will do exactly what QGIFer did.  Here is a non-comprehensive list of applications found with a cursory Search:

GIFy

An online tool, that will allow you to upload a video and edit; add titles; add overlays etc.

EZGIF

Another online tool, that is more simple.  Upload the video, output a GIF.

IMGFlip

Just like EZGIF: upload a video, get a GIF.

GIMP

Not capable of importing video on its own, but capable of outputting Animated GIF images. There is a brief tutorial here


Its unclear on how your system32 is missing my guess is you could of deleted it, but you would need to login to ubuntu and look at the xp os driver or partition and look for the file to see if it is actually missing or some grub issue.

You would need to follow some documentation in order to know for sure.  https://help.ubuntu.com/community/RecoveringWindows

Usually it is more of a hassle then it is worth in my opinion as I just completely switched to Ubuntu and have a different system if I need Windows.  Which for me isn't often.  Maybe if I want to watch Netflix at this point(But I have a roku).  Most games work with Wine.  It takes time to learn all the new programs but the process of rediscovery is fun and you might just learn more stuff then you knew on Windows in the process because Ubuntu/Linux people are pretty excited about the technology.

The easier questions to answer like "how can I find my files?"  or "Can I import bookarks from firefox run through xp" or "msn"

You can't see your files from XP because windows doesn't have the drivers to view the linux file systems at least drivers that are decent.  You would need to store files you want to share with XP on the actual XP drive or an NTFS partition/drive or an external drive.

You can't import your bookmarks directly, but you can keep them in sync with Firefox sync or even a cloud service like Ubuntu One.

There isn't MSN of course it is a Microsoft product and Microsoft is a competitor of Linux and Ubuntu, but there is an Instant Messaging client.  In fact there are TONS.  Try Empathy or Pidgin.  They work with TONS of different instant messagers not just MSN.

Hope this helps.


A partial answer is to make use of the apple:badmap XKB option.

Terminal command to satisfy the Mac keyboard:

gsettings set org.gnome.desktop.input-sources xkb-options "['apple:badmap']"

Terminal command to disable the option:

gsettings reset org.gnome.desktop.input-sources xkb-options

As regards making Command/Ctrl I think this question applies:

How do I switch the Command key and Control key on a MacBook Pro?


Syntax is wrong. You have to make a rule like:

iptables -A INPUT -p tcp ! -s 192.168.0.0/24  --dport 111 -j DROP

Exclamation mark needs to be prefixed, when you are trying to make oposite match.


Grub Customizer doesn't change image background

I resolved converting the image from jpeg to png ;)


The system startup scripts won't be started from your project directory, so you need to switch to it explicitly in your script.

run_ts.sh:

#!/bin/bash
cd /home/prog/OnlineAuto/Shop
rake ts:start

If this needs to be run with a specific user account rather than root, try this instead:

#!/bin/bash
su - username -c 'cd /home/prog/OnlineAuto/Shop ; rake ts:start'


Installing Ubuntu from USB stick onto itself

Things are much easier, you have a margin for mistakes, if you have two USB pendrives (and two USB ports). One of the pendrives can be cheap, small and slow with at least 2 GiB (4 GiB for Ubuntu Studio 18.04 LTS). The other one should be more powerful to serve well for an installed system. See this link,

help.ubuntu.com/community/Installation/FromUSBStick#Prerequisites

But if you really want to or have to install into the same USB pendrive, you can boot to RAM with the boot option toram. See the following link,

Boot options

This will release the live system's dependence of the boot drive, so it will be available as target for the installation.

There are more details at the following link,

Can Ubuntu be installed to the pendrive it was booted from?


Is it possible to deploy a juju service to multiple specific machines?

$ juju add-unit -h
usage: juju add-unit [options] <service name>
purpose: add a service unit

options:
-e, --environment (= "local")
    juju environment to operate in
-n, --num-units  (= 1)
    number of service units to add
--to (= "")
    the machine or container to deploy the unit in, bypasses constraints

Service units can be added to a specific machine using the --to argument.
Examples:
 juju add-unit mysql --to 23       (Add unit to machine 23)
 juju add-unit mysql --to 24/lxc/3 (Add unit to lxc container 3 on host machine 24)
 juju add-unit mysql --to lxc:25   (Add unit to a new lxc container on host machine 25)


Is there a simple way to copy files from one ubuntu computer to another?

When you say "all files", I am assuming you want to copy only your user owned files, and not root owned files. (If you are trying to copy other files, please specify in your question).
In Nuatilus (Files), press CTRLL to reveal the location bar.
Type the following and press Enter
ssh://<your remote computer>.local

Replace <your remote computer> with the name of the computer where you want to copy files from.
Alternatively, you can replace <your remote computer>.local with the IP address of the computer where you want to copy files from.
Nautilus will prompt you for a user ID and password for the user on the remote computer.
Navigate to the user owned directories where you want to copy files from.
Then, you can use usual methods to copy files:

CTRLC (copy) and CTRLV (paste)
Or drag and drop into another Natuilus window or tab on your local machine


There's way to little qml to see what's going on, especially since all components positions affect each other.

One solution would be to do the thing you did to get your flickable in the correct position, and then add the clip: true property to stop it from overlapping the header.


You can change it manually. Run this command to open it for editing:
gedit admin:///etc/default/keyboard

Then change it so it simply looks like this:
XKBLAYOUT=us
BACKSPACE=guess

Then save and reboot.


Is there a simple way for uninstalling fonts?

Search in 'Software-Center' for font-manager (font management application for the GNOME desktop) and install it, with it you should be able to easily find and delete the font.

Alternatively you can install it in Terminal by:

sudo apt install font-manager


How do I burn the Windows 10 ISO to a USB?

I tried all the ways in this thread and none worked (and seriously, the question is about specifically writing to an USB key, why would people propose copying the ISO to another partition instead ??).

The solution that did the trick for me (assuming your USB drive is /dev/sdc):

Run gparted
Create a new partition table on sdc, type msdos
Create a NTFS partition, set the boot flag on it
Extract the iso (can be done with 7z x windows10.iso)
Copy the content (via cp, rsync, a GUI, whatever) to the mounted NTFS partition (certainly /dev/sdc1)
The last, critical step, taken from this post : https://superuser.com/a/817656/248812 is :

sudo ms-sys -7 /dev/sdc.

ms-sys is available in a ppa :
https://launchpad.net/~lenski/+archive/ubuntu/ms-sys

Without ms-sys, blinking cursor on boot when the USB key is inserted.

With it, windows logo shows up.


Don't worry about the /var/cache/apt/pkgcache.bin and /var/cache/apt/srcpkgcache.bin files.It would be automatically created after running sudo apt-get update and sudo apt-get install package-name commands.

This is not the cause of your software-center not working problem.


Search for Power in dash from that you can change the suspend time(suspend when inactive for) .

Try the below command to suspend your pc for 1 hour,

sudo rtcwake -u -s 3600 -m mem


Simple MAAS setup in Ubuntu 13.04 and Virtual Box

There is no username and password by default.  Either use juju (preferred) or if you are starting nodes via the MAAS ui then you need to make sure you add your public SSH key to your user preferences.

You can ignore the ipmi error.


How can you monitor total internet data usage across reboots?

vnStat - Light Weight Console-based Network Monitor

vnStat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s). It uses the network interface statistics provided by the kernel as information source. This means that vnStat won't actually be sniffing any traffic and also ensures light use of system resources.

In this tutorial we'll review:

Features
Installation
Configuration
Start Systemd Service
Usage (from command line)
Conky example

Features

quick and simple to install and get running
gathered statistics persists through system reboots
can monitor multiple interfaces at the same time
several output options
summary, hourly, daily, monthly, weekly, top 10 days
optional png image output (using libgd)
months can be configured to follow billing period
light, minimal resource usage
same low cpu usage regardless of traffic
can be used without root permissions
online color configuration editor

Installation

nvStat is in the official repositories so no need to link to a new ppa. To install create a Terminal instance using Ctrl+Alt+T and type at the prompt:

sudo apt-get install vnstat

After installation, keep your Terminal open for the following sections. There is no need to reboot.

Configuration

Pick a preferred network interface and edit the Interface variable in the  /etc/vnstat.conf accordingly. To the list all interfaces available to vnstat, use:

vnstat --iflist

To start monitoring a particular interface you must initialize a database first. Each interface needs its own database. The command to initialize one for the eth0 interface is:

sudo vnstat -u -i eth0

Start Systemd Service

After introducing the interface(s) and checking the config file. You can start the monitoring process via systemd:

sudo systemctl start vnstat.service

To make this service permanent use:

sudo systemctl enable vnstat.service

From now on vnstat will be gathering network usage in the background using such a small percentage of CPU it doesn't show up on conky's (system monitor's) top 9 list of processes (on my machine).

Usage (from Command Line)

Query the network traffic:

vnstat -q

Viewing live network traffic usage:

vnstat -l

To find more options, use:

vnstat --help

Monthly Totals

To see monthly totals, use:

rick@dell:~$ vnstat -m

 eth0  /  monthly

       month        rx      |     tx      |    total    |   avg. rate
    ------------------------+-------------+-------------+---------------
      Nov '16     76.31 MiB |    2.03 MiB |   78.35 MiB |   10.45 kbit/s
    ------------------------+-------------+-------------+---------------
    estimated      3.13 GiB |      84 MiB |    3.21 GiB |

Conky example

Conky is a popular light-weight System Monitor used across many Linux distributions. You can vnStat bandwidth totals to your conky display like this:

Note when picture was taken Yesterday was Sunday which explains why the Weekly total is less.

The conky code to achieve this is:

${color orange}${voffset 2}${hr 1}
${color1}Network using vnStat "-i", "-w" and "-m"
${color}${goto 5}Today ${goto 100}Yesterday ${goto 225}Week ${goto 325}Month ${color green}
${execi 300 vnstat -i eth0 | grep "today" | awk '{print $8" "substr ($9, 1, 1)}'} ${goto 110}${execi 300 vnstat -i eth0 | grep "yesterday" | awk '{print $8" "substr ($9, 1, 1)}'} ${goto 220}${execi 300 vnstat -i eth0 -w | grep "current week" | awk '{print $9" "substr ($10, 1, 1)}'} ${goto 315}${execi 300 vnstat -i eth0 -m | grep "`date +"%b '%y"`" | awk '{print $9" "substr ($10, 1, 1)}'}
${color orange}${voffset 2}${hr 1}

To save space on my narrow window I used "G" instead of "GiB", "M" instead of "MiB", etc. If you have more screen realestate change substr ($10, 1, 1) to $10 and the same for $9.

You may have to change eth0 to wlan0 or eth1, etc. depending on your network name reported by ifconfig.


What is a script and how do I write one?

There is number of scripting languages available. The most common under Linux might be Bash, Phyton and Perl. They all have their advantages and disadvantages. It is a very vast field. For starters I'd recommend the Bash Guide for Beginners to learn how to automate routine tasks. Bash is ideal because it is present in almost all Linux distributions and often even the default shell - when you learn bash scripting you also learn how to use the shell very effectively. So that's a plus with Bash. Personally I like Perl the most.

What all scripting languages  have in common is that you write a regular text file containing commands. These files are called scripts A script file should start with a line specifying the interpreter of your choice  language (i.e. the program that executes the command in your text file). An example for this line would be this:

#!/bin/bash

That tells your computer the following lines are bash commands to be executed with bash shell. What the available commands are can be learned in the various guides.

Once you have written that file, you need to make it executable. Say your file is named foo.sh than this line in a shell would make it executable:

chmod +x foo.sh

After that you can run the script typing:

./foo.sh

hitting ENTER afterwards. A very easy example for a full script would be:

#!/bin/bash
# This script prints "Hallo world X" five times
#+where 'X' is a number from 1 to 5.
for i in 1 2 3 4 5; do
    echo "Hallo world $i"
done

And that's how I wrote and executed it in gnome-terminal, which is the default graphical terminal in Ubuntu:


USB Drives Inaccessible to Multiple Users

All you have to do is take out the usb and plug it back in! That should fix your problem, as for why this specific feature/problem/annoyance exists? I think it is for security reasons.


Cannot join wireless networks on Ubuntu 14.10. Macbook pro 7.1

I don't know much about ubuntu as I am trying it I installed it on my lenovo dual boot with windows and had the same issue. I did some search and fixed it by using the b43 answer i forgot all details how. but i did install ubuntu again in my other presario old laptop dual boot aswell and had the same problem. here what solved the issue for me: you have to install the b43 driver and remove the STA driver to make your wireless detected and connect wirelessely.

To install the b43 drivers
1. sudo apt-get firmware-b43-installer

To remove the STA drivers
2. sudo apt get remove bcmwl-kernel-source

Restart your computer.

It worked for me, and hope it will help others.. sorry if its not what you are looking for.


Cannot download files to SMB shared folder

I tried to mount the network share in /etc/fstab so its mounted at start up and that solved the problem and I can now download to the share.


Bengali Avro Keyboard not working in Lubuntu 14.04

Installation

Open Terminal and enter the following commands one by one.

Add ibus-avro repository

sudo add-apt-repository "deb http://download.opensuse.org/repositories/home:/sarimkhan/xUbuntu_14.04/ ./"

Add key

wget -q http://download.opensuse.org/repositories/home:/sarimkhan/xUbuntu_14.04/Release.key -O- | sudo apt-key add -

Update package list

sudo apt-get update

Install ibus-avro

sudo apt-get install ibus-avro-trusty

Now you need to logout and login again or restart your computer.

Using ibus-avro

Click the IM icon in menubar and Select Text Entry Setting
In Text Entry Setting window click + icon (marked by arrow) in left pane. Write avro in the search box (marked by arrow). Choose Bengali (Avro Phonetic) from the list and press Add button to add Avro to the list.
(Optional) The keyboard shortcut to switch input method has been changed to Super+Space since Ubuntu 13.10. You can change it to your preference from Text Entry Setting window.
Open any text editing software (like, gedit). Now Press Super+Space to toggle between English and Avro (Bengali)
Enjoy Avro


Why is the joydev module enabled on Ubuntu Server?

If it's showing up in lsmod output, then you have either a sound card with joystick device support, or your motherboard has an optional joystick port, and it is not disabled in the BIOS. Module loading depends on your hardware. All modules that are built from the kernel are shipped together, and will be available on the system, whether you have the hardware or not.


I need help resurrecting an old Asus Eee PC that already has Ubuntu

This can be done without reinstalling.
Follow this tutorial.

Basically, when booting, you press shift then mount the partition and you are logged in as root without asking for the password. Then you just passwd and set a new password.


Anyhow, following inotifywait logs I found one by one the processes (there were many!) writing to the file system. I remapped each directory to a tmpfs with a boot script, copying files to the tmpfs and remounting it instead of the file system location and then copying files back at shutdown. This has caveats, but it'll do for now.


USB Flash Drive - emptied but there's no free space (and no used space?!) on it

If you have nothing important on the drive that you are trying to recover, just reformat the drive. Since you said you are not very technical I'll give you some easy to follow instructions on how to do so.

First off, open up a terminal (ctrl + alt + t) and type the following commands:

sudo apt-get install gparted
sudo gparted

This will install and open a program called gparted which is a very simple to use yet very powerful piece of software that will allow you to reformat you USB. The sudo command will prompt you for a password which should be the same as you login password.

Once gparted is open, select your USB in the dropdown menu in the top right corner of the screen.

The USB will need to be unmounted for you to perform any actions on it so keep that in mind. Be absolutely sure that the device you select is your USB! I have learned from personal experience that lack of attention during this step can be disastrous (accidentally wiped my entire hard drive :/).

After selecting you have selected the USB device, click on one of the colored rectangles that represent the different partitions on your USB. Your USB should only have one.

Then click on the Partition option on the menu at the top of the screen and followed by a click on the Format to option within that menu. There are several formats that will be made available to you but most USBs come pre-formatted as FAT32 so I would suggest just sticking with the default.

Now that you have selected FAT32 as the format, click on the green check mark just below the Partition menu option and gparted will do the rest!

Unless something is wrong with the hardware of the USB, this should fix your problem. I actually had this same issue just a couple days ago. Hope this helps and welcome to Ubuntu!


Open Unity Tweak tool.
Go to Window Manager section
Click on Window Snapping
Under Behaviour, There is screen. On the top of it, There is a pop-up selection menu.
Select Do Nothing from that menu.
You can repeat selecting Do Nothing for other sides if you want.

If you don't have Unity Tweak Tool installed, install it with

sudo apt install unity-tweak-tool

command in a terminal

Here is a screenshot of that settings window


Boot with a previous kernel using grub menu and upate nvidia drivers by

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


The specs of your Dell Latitude reads that your system may have one of the following:

  Video Card NVIDIA® NVS 3100M 512MB DDR3  Intel® HD Graphics

  (Seen at:
  http://www.dell.com/us/business/p/latitude-e6510/pd#TechSpec)

If you are of the lucky guys who owns an nVidia based Video card, you can achieve what you wish by using the nVidia xServer Settings. I am assuming that you have the latest nVidia Drivers installed, so, try setting up your nVidia Settings by dropping the next in a terminal:

sudo nvidia-settings

After entering your password the nVidia X Server Settings window will appear, click on the "X Server Display Configuration" in the left pane and you will have the options to choose between: twin view (clone), extended desktop or simply turn off a monitor, after changing something, clic the "Apply" button in order to perform a test and don't be afraid if your monitors flickers. When you are satisfied with the configuration just save your changes by clicking the "Save to X Configuration File" button.

IMPORTANT NOTE: either that you can drop the single nvidia-settings command in the terminal, it won't allow you to save the changes. Do it as suggested and let's see what you get.

EDIT: I was writing my answer when you said that you own the Intel Based Graphics Card. So, I would suggest you to use the System/Preferences/Monitors tool, which should allow you to do what you wish. In all cases, make sure you have connected the external monitor before doing this, sorry if my first answer wasn't helpful for you. I didn't wish to erase it as this can be helpful for somebody else. Thank you.


How to find top-level dependencies in a list of deb packages?

I created a script that does exactly what you want: https://gist.github.com/kotarou3/2b311fb7b79ae6b682246b32acf0b7e9

python3-apt and python3-networkx are the dependencies. It uses the apt package cache as the source of package information.

Package names themselves are output one per line to stdout, while any comments about them (such as if they are part of a cycle) are to stderr

Example:

$ ./find-top-level-packages.py nginx nginx-core zlib1g firefox
firefox
nginx
$ ./find-top-level-package.py -h
usage: find-top-level-packages.py [-h] [--root-dir dir]
                                  [--follow-unspecified-packages]
                                  [--no-use-recommends]
                                  [--show-missing-recommends]
                                  [package [package ...]]

Find top-level packages of the dependency graph

positional arguments:
  package               package names to use (default: all installed packages)

optional arguments:
  -h, --help            show this help message and exit
  --root-dir dir        act as if chrooted in the specified directory
  --follow-unspecified-packages
                        follow dependencies of packages not part of the
                        initial input
  --no-use-recommends   don't use recommended packages for the dependency
                        graph
  --show-missing-recommends
                        list missing recommended packages suffixed with a dash


No verbose output on startup after upgrade to 15.04

Log out of your graphical session and go to TTY1 whith Ctrl+Alt+F1.

Log in and edit the file /etc/default/grub:

sudo nano /etc/default/grub

or if you like vi:

sudo vim /etc/default/grub

Remove the values for GRUB_CMDLINE_LINUX_DEFAULT:

GRUB_CMDLINE_LINUX_DEFAULT=""

Then update GRUB and reboot:

sudo update-grub
sudo reboot


Guess currently multimedia keys work with rhythmbox, but not audacious or banshee.


Help with sed script to remove Wikipedia citation numbers

You went the Wrong direction, you should learn XML/XSLT instead :)  (XML Style Sheet). Either for use with ODT or XHTML. For ODT, a macro may be be better, but I don't know it.

Make a look on this accepted answer: RegEx match open tags except XHTML self-contained tags

The solution in this answer for How to replace all images in Libreoffice with their description should work for you too with little modification.


How to Automatically run two commands after login?

Adding the autossh Command

On the panel select System --> Preferences --> Startup Applications.
Under the Startup Programs tab select the Add button.
Choose any Name you want and paste in your command (the Comment is optional)
Click the Add button.

Note for newer versions of Ubuntu

You can find this application by searching for "Startup Applications" in the dash. Also,
you can always launch it by pressing Alt + F2 (or opening a terminal) and running gnome-session-properties.

Mounting the Partition

Option 1: Add partition to /etc/fstab

See How to mount NTFS drive at startup if it is a Windows partition.
Ubuntu Community Fstab documentation

Option 2: Use udisks

Add this startup command as shown previously:

udisks --mount /dev/sda2


unable to use wifi on sony vaio duo 13 SVD13215CGB

Go to system > Administration > Additional Drivers/Hardware Drivers.

It will fetch the Broadcom drivers for your wifi. Select and install it. And Reboot the system


How to get text buffer from file and loading into TextView using python and Gtk+3

You can get the contents of a TextBuffer using get_text():

        start_iter = self.textbuffer.get_start_iter()
        end_iter = self.textbuffer.get_end_iter()
        text = self.textbuffer.get_text(start_iter, end_iter, True)

And save it like any other text file:

        with open(save_file, 'w') as f:
            f.write(text)

I suggest that you take a look at the TextBuffer api docs. As well as the Python GTK+ 3 Tutorial. It can show you how to use the FileChooserDialog.

Here is a very basic Python Gtk+3 text editor example that can open and save a text file:

#! /bin/python

from gi.repository import Gtk

class TextViewWindow(Gtk.Window):

    def __init__(self):
        Gtk.Window.__init__(self, title="TextView Example")

        self.set_default_size(500, 350)

        self.box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        self.add(self.box)

        toolbar = Gtk.Toolbar()
        open_btn = Gtk.ToolButton.new_from_stock(Gtk.STOCK_OPEN)
        open_btn.connect("clicked", self.on_open_clicked)
        toolbar.insert(open_btn, 0)
        save_btn = Gtk.ToolButton.new_from_stock(Gtk.STOCK_SAVE)
        save_btn.connect("clicked", self.on_save_clicked)
        toolbar.insert(save_btn, 1)
        self.box.pack_start(toolbar, False, True, 0)

        scrolledwindow = Gtk.ScrolledWindow()
        scrolledwindow.set_hexpand(True)
        scrolledwindow.set_vexpand(True)

        self.textview = Gtk.TextView()
        self.textbuffer = self.textview.get_buffer()
        scrolledwindow.add(self.textview)
        self.box.pack_start(scrolledwindow, True, True, 0)

    def on_open_clicked(self, widget):
        dialog = Gtk.FileChooserDialog("Please choose a file", self,
            Gtk.FileChooserAction.OPEN,
            (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
             Gtk.STOCK_OPEN, Gtk.ResponseType.OK))

        filter_text = Gtk.FileFilter()
        filter_text.set_name("Text files")
        filter_text.add_mime_type("text/plain")
        dialog.add_filter(filter_text)

        response = dialog.run()
        if response == Gtk.ResponseType.OK:
            selected_file = dialog.get_filename()
            with open(selected_file, 'r') as f:
                data = f.read()
                self.textbuffer.set_text(data)
        elif response == Gtk.ResponseType.CANCEL:
            dialog.destroy()

        dialog.destroy()

    def on_save_clicked(self, widget):
        dialog = Gtk.FileChooserDialog("Save file", self,
        Gtk.FileChooserAction.SAVE,
        (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
         Gtk.STOCK_SAVE, Gtk.ResponseType.OK))

        response = dialog.run()
        if response == Gtk.ResponseType.OK:
            save_file = dialog.get_filename()
            start_iter = self.textbuffer.get_start_iter()
            end_iter = self.textbuffer.get_end_iter()
            text = self.textbuffer.get_text(start_iter, end_iter, True)
            with open(save_file, 'w') as f:
                f.write(text)
        elif response == Gtk.ResponseType.CANCEL:
            dialog.destroy()

        dialog.destroy()

win = TextViewWindow()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()


NVIDIA graphics card memory usage applet / application?

I haven't seen an applet but you can run the following in the terminal window:

nvidia-smi

Perhaps this will help you search for the exact thing you're looking for.

I did find this http://www.matrix44.net/blog/?p=876 but not sure what desktop you are using

If you are using gnome 3 then you might want to hack this https://extensions.gnome.org/extension/82/cpu-temperature-indicator/ to use nvidia-smi information instead (see comments at the bottom of that page - people discussing nvidia-smi)


Removable Drive Menu is a status menu for accessing and unmounting removable devices. The Removable Drive Menu status menu is accessed by clicking its icon in the Panel notification area as shown in the below screenshot. The Removable Drive Menu GNOME Shell extension can be installed from Ubuntu Software.

It appears that this GNOME Shell extension extension is sometimes either delaying or interfering with the normal loading of other notification icons in the GNOME shell Panel. This problem is not necessarily related to the Removable Drive Menu extension specifically as other GNOME shell extensions have been known to cause the same problem. The way to restore the missing networking icon to the Panel is by running the following command:

setsid gnome-shell --replace

After it comes back press the Enter key before closing the terminal.


go to the terminal and type    unity --reset-icons


How to remove all files without deleting the directory?

Use wildcard (*)

rm /path/to/dir/*

Will remove all file under /path/to/dir directory.


How to see real time updates of file system at terminal?

You can use the watch command for that.
In the default setting it executes the trailing command every 2 seconds. The time can be specified with -n.

To use it to monitor your filesystem you may either use ls -1 (if you want to see only one directory) or find (if you also want to watch subdirectories) as the command.

To check for changes in /tmp and all of its subdirectories in (near)real time execute watch -n 0.1 find /tmp. An interval of 0.1 seconds is the fastest, watch can go and should be sufficient for any human. And I assume you are human, aren't you?


Prevent users from changing the desktop background on Ubuntu 18.04

You can't prevent users from changing your desktop background without preventing your own account from making a change.  If they are using your account, they have the same access that you have.
Solution 1:
Give them their own separate login ID.  This way your environment will never be affected their settings.
Solution 2:
Activate a script that will check for a change and periodically change it back to your preferred background.
You can find an example of such a script in this answer:
How can I get one wallpaper for each day of the week?
Instead of having the script change daily, just have it periodically set the background to your choice.


Apache2 - AH00112: Warning: DocumentRoot does not exist

Look closely at the output - there is an error in your file name.
pubic_html vs. public_html

This may be an error. Correct this and restart apache.

Third one is not fatal, but you may want to look at ServerName variable for your virtual hosts and in global configuration file.


You probably have been playing with the OnBoard keyboard with your screensaver and have enabled it to appear -

The solution would be the reverse of the linked Q&A - thus copy and paste the following into a terminal:

gsettings set org.gnome.desktop.screensaver embedded-keyboard-enabled false

Linked Question:

How to embed on-screen keyboard into gnome-screensaver 3.x unlock screen?


Trouble with Ubuntu installation in VirtualBox

3D acceleration in a VM

When installing more recent versions of Ubuntu we do rely on the presence of a graphics card capable of 3D acceleration needed for Compiz and Unity.

In a bare metal installation such a graphics adapter almost always is present. Ubuntu will then load the appropriate driver on boot. This is different in a virtualized machine where a virtual graphic card providing (limited) 3D capabilities will only be installed with a driver provided by the guest additions.

Guest Additions from root shell

As we can not log in or boot the graphical desktop to aid us with mounting the Guest Additions iso we will have to do that from the command line after we boot into a root shell.

We first have to load the Guest Additions .iso from Virtual Box Manager ("Devices") to be presented as /dev/cdrom (alternatively /dev/sr0) to the guest OS. We then additionally need to mount the CD in our guest Ubuntu to be able to install them.

From a root shell where we gained read/write access to our virtual hard disk (see link above) we can do so with the following commands:

mount /dev/cdrom /mnt              # or any other mountpoint
cd /mnt
./VBoxLinuxAdditions.run
reboot

Troubleshooting

Sometimes we still may not be able to boot to the desktop. Then we may try if an update of Ubuntu resolves the issue. From a root shell run:

apt-get update && apt-get dist-upgrade
reboot

If we still can't log in, we may try if we can do so from TTY. Enter the virtual terminal by pressing HOST + F1. Login with the administrator user and password you gave on installation of Ubuntu (the password will not be displayed, not even asterisks). Then start the login manager lightdm as follows:

sudo lightdm

Sometimes after we had done this once, we may be able to do a normal reboot and login as usual.
If we are unable to even start the graphical installer we may have an issue with the host graphics driver. We can try to install with  a text based installation or in 12.04 from the Alternate CD. You may also try with nomodeset on boot.

Related Questions

How do I boot into a root shell?
How do I install Guest Additions in a VirtualBox VM?
Can't install Ubuntu since 10.10


I also had the same problem, but I can't seem to reproduce it now, so I haven't tested what I'm about to mention. But yeah, I think I've found the culprit.

After doing a simple locate steam to find all files that have the word steam in them, I found this file:

/var/lib/update-notifier/user.d/steam-install-notify

The contents of this file are:

Name: Steam Installer
Priority: Medium
Command: /usr/bin/steam
DontShowAfterReboot: False
ButtonText: Start Steam
DisplayIf: test ! -x ~/.steam/steam/ubuntu12_32/steam
OnlyAdminUsers: False
Description:
 Start Steam to complete installation of the Steam for the current user.

I'm not familiar with the files in /var/lib/update-notifier, but this page: Ubuntu Wiki - InteractiveUpgradeHooks explains a bit.

So, what you can do to remove that window you're getting is to either:

Rename or move the /var/lib/update-notifier/user.d/steam-install-notify file (or just delete it, but renaming/moving is a safer way, in case something goes wrong and you need the file back).
Change DontShowAfterReboot: False to be DontShowAfterReboot: True. An educated guess would be that doing this change will not show the notification you're getting at every login.
Use another DisplayIf test that will always be true.


Uncompressed ISO onto a disk doesn't make it bootable.

Please have a read http://www.ubuntu.com/download/help/create-a-usb-stick-on-windows

There are some other programs also to create bootable USB disk for ubuntu.

LILI
UnetBootin


Share an audio playback stream through a live audio (video) conversation like Skype

Check id's

$ pactl list short sources
0   alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor    module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED
1   alsa_output.pci-0000_00_1b.0.analog-stereo.monitor  module-alsa-card.c  s16le 2ch 44100Hz   IDLE
2   alsa_input.pci-0000_00_1b.0.analog-stereo   module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED
3   combined.monitor    module-combine-sink.c   s16le 2ch 44100Hz   SUSPENDED

$ pactl list short sinks
0   alsa_output.pci-0000_01_00.1.hdmi-stereo    module-alsa-card.c  s16le 2ch 44100Hz   RUNNING
1   alsa_output.pci-0000_00_1b.0.analog-stereo  module-alsa-card.c  s16le 2ch 48000Hz   RUNNING
2   combined    module-combine-sink.c   s16le 2ch 44100Hz   IDLE

Make 2 virtual sinks, (Virtual1 mic+music, Virtual2 music)

pactl load-module module-null-sink sink_name=Virtual1 sink_properties=device.description=Virtual1
pactl load-module module-null-sink sink_name=Virtual2 sink_properties=device.description=Virtual2

Loopback mic to Virtual1

pactl load-module module-loopback latency_msec=1 sink=Virtual1

Loopback Virtual2.monitor to Virtual1

pactl load-module module-loopback latency_msec=1 sink=Virtual1 source=Virtual2.monitor

Loopback Virtual2.monitor to Analog Stereo (In my case)

pactl load-module module-loopback latency_msec=1 sink=1 source=Virtual2.monitor

Then open pavucontrol:

Input Device: set fallback to Virtual1.monitor or using CLI:

pactl set-default-source Virtual1.monitor

Output Devices: set default to Analog Stereo (In my case) or using CLI:

pactl set-default-sink 1

Recording: confirm Skype from Virtual1.monitor or using CLI (I remove some lines from results, avconv as example):

$ pactl list short clients
23  protocol-native.c   chromium-browser
24  protocol-native.c   chromium-browser
45  protocol-native.c   pavucontrol
237 protocol-native.c   avconv
239 protocol-native.c   pactl

$ pactl list short source-outputs
35  0   45  protocol-native.c   float32le 1ch 25Hz
36  1   45  protocol-native.c   float32le 1ch 25Hz
37  2   45  protocol-native.c   float32le 1ch 25Hz
38  3   45  protocol-native.c   float32le 1ch 25Hz
39  4   45  protocol-native.c   float32le 1ch 25Hz
41  0   45  protocol-native.c   float32le 1ch 25Hz
42  1   45  protocol-native.c   float32le 1ch 25Hz
52  1   45  protocol-native.c   float32le 1ch 25Hz
54  1   237 protocol-native.c   s16le 2ch 48000Hz

$ pactl move-source-output 54 Virtual1.monitor

Playback: set music player to Virtual2 (2nd null device), and confirm Skype in Analog Stereo. or through CLI (chromium as example, see previous pactl list short clients):

$ pactl list short sink-inputs
17  3   24  protocol-native.c   s16le 2ch 44100Hz
58  0   -   module-combine-sink.c   s16le 2ch 44009Hz
59  1   -   module-combine-sink.c   s16le 2ch 44100Hz

$ pactl move-sink-input 17 Virtual2

Simple Diagram (/,\ loopbacks from left to right):

            Microphone      ---
                               \
            Virtual1.mon    ------  Virtual1    >   Skype
                               /
    VLC   > Virtual2.mon    ------  Virtual2
                               \
    Skype > AnalogSt.mon    ------  AnalogSt    >   Headset

To switch back (normal use), see Pulseaudio loopback unload audio output devices

Check module id:

pactl list short modules

Unload single module (or one by one)

pactl unload-module id

Or (reload with default modules):

pulseaudio -k

Notes:

I have use sink id (Eg: 1) but if you want make a script it's better to use names. (I avoided that here because they are long).
How do I switch to another audio output sink in XFCE? contains nice script to get stream id from name to be used with move-sink-input and move-source-output.
I have used latency_msec=1 which may lead to high CPU usage. In audio conversation, you may not care about delay between music and microphone. You can remove it or increase it. But for recording mix, You may look for very small delay between music & microphone.

As I have tested it, the delay is near half to one second.
I think some times its hard to figure out what going on like with Jack tools. It will be clear with graphic map:


SFTP connection successful, but can't upload files

Your chroot path must be owned by root and have permissions of 755 or 750. If you change that sshd will reject connections, because such a chrooted environment is considered insecure. Writing to the chrooted directory with sftp is not possible.

You should make a new subdirectory under the chroot directory, and that directory's ownership and permissions can be changed to anything. So you can write to that subdirectory.


Script error: –le: binary operator expected

The source of the error: [: –le: binary operator expected is the fact you are using the unicode version of – instead of the regular -

Note: The same apply for the unicode ” you are using instead of regular "

I've reformat your code to be as follows:

#!/bin/bash
echo "enter a value"
read -r n
s=0
i=0
while [ $i -le "$n" ]
  do
  if [ "$(expr $i%2)" -eq 0 ]
  then
    s=$(expr $s + $i)
  fi
  i=$(expr $i + 1)
done
echo "sum of n even numbers"
echo "$s"

I made the following changes:

Replaced the unicode version of chars you used
Added #!/bin/bash
Deleted space after the = sign
Some extra improvements.


Press CtrlC to cancel input, and you'll get back to the present.


Does losing an ssh session kills commands running in tmux?

Basically after losing an ssh connection the child process will receive a SIGHUP. This signal causes tmux to detach itself from the lossen ssh session.

So tmux's session will stay persistent on a remote machine even if ssh session gets terminated.

Test it yourself:

Open a terminal and run tmux.
In your "tmux" session run sleep 100.
Open another terminal and run: pkill -1 tmux.

Now tmux has been closed in the first terminal.

Run tmux ls to see that your sessions is still there.

Or tmux attach to bring it up.

I have also tested the actual losing ssh session scenario on a remote machine, result is the same.


SOLUTIONS:

I got into recovery mode. Then installed 4 debs files for 4.19 Kernel from this site and at the end installed/activated lightdm

uname -mrs diplsays me that kernel was upgraded to

  4.19.0-041900-generic x86_64

now doing sudo reboot and observe what happens

So, all steps which were given by @manowar_manowar were completely and successfully done. Unfortunately It didn't help

Then I tried to update NVidie GPU drivers with current long-lived branch release: as was suggested by Dream Machines Team

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install nvidia-396
sudo reboot

after 3 days of installation process I was able to get it work Believe my issue will help someone.


Early user terminals connected to computers were electromechanical teleprinters or teletypewriters (TeleTYpewriter, TTY), and since then TTY has continued to be used as the name for the text-only console although now this text-only console is a virtual console not a physical console.

There are 6 virtual consoles in Ubuntu accessed by the keyboard shortcuts Ctrl+Alt+F1 to Ctrl+Alt+F6. You can move away from a virtual console (move the console to the background) by using the keyboard shortcut Ctrl+Alt+F7.

In Ubuntu 17.10 the login screen now uses virtual terminal 1. In Ubuntu 17.10 and later press Ctrl+Alt+F3 up to Ctrl+Alt+F6 for accessing a virtual console and press Ctrl+Alt+F2 to go back to the desktop environment.

Ubuntu 18.04 virtual console


How do I get conky to display the CPU frequency per core in GHz?

As per the list of variables, you need to use the freq_g variable instead of freq to display in GHz instead of MHz.

Also, as per the documentation, to show each core separately you would add multiple entries like ${freq_g 1} or ${freq_g 32}, depending on how many cores you have.


How can I get my system performance back again?

System performance, as I'm sure you are aware is a very complicated subject.

However, I think that it would be fair to say that at a basic level it's the result of three things;

CPU Utilization
Memory Utilization
Disk Utilization

Use, the information below only as a guide to what May be slowing things down.

Ubuntu has a package called top for monitoring system processes and their CPU and Memory % utilization More information on the top command.

Using top you should be able to identify any processor, or memory hogging tasks.

Open a terminal prompt,
type $ top,
Look at the top processes and their CPU and Memory utilization

Obviously, the list should not add up to 100% of CPU or Memory ;o).

If it does (or close >80%) you may look to increase the resources or reduce the load.

To reduce the load;

Locate the processes that you do not need and make a note of its name,
Exit $ top using (Ctrl-C),
Get the process details, type $ sudo ps -ef | grep my-unwanted-process-name,
Stop the unwanted process, type $ sudo pkill my-unwanted-process-name,

Lastly, you may want to also Check Ubuntu 12.04 system requirements.

I hope that this helps to start you in the right direction.


(Solved) Difficulty installing BCM43142 offline for Ubuntu 18.04

Please open a terminal and run:

cd ~/Desktop
sudo dpkg -i dkms*.deb
sudo dpkg -i bcmwl*.deb

Please post any errors.

EDIT: Please download build-essential and all its dependencies, marked with red dots, and transfer them to your desktop. https://packages.ubuntu.com/bionic/build-essential Install them as above:

cd ~/Desktop
sudo dpkg -i some_package*.deb

Of course, if you can even temporarily get an internet connection by ethernet or tethering, it is as simple as:

sudo apt update
sudo apt install bcmwl-kernel-source

All the dependencies will be resolved automatically.

EDIT 2: I believe that most, perhaps all, of the packages are on the install DVD. Insert the DVD and run:

sudo apt-cdrom -m -d /media/cdrom add
sudo apt install bcmwl-kernel-source

Post any errors or warnings.


Permission problems installing with sudo between 14.04 and 16.04

The problem you are facing seems to be with the default value of root umask

The permissions which were created in the 14.04 version, are equal to umask of 0022 which should the be default root value from umask

# umask
0022

It seems like your default umask in the 16.04 is 0027, which can be checked by running in the root prompt:

umask

in order to change the default behavior, you'll need to check root start scripts (profile, login, etc) and find where this value was set, and to change it to be:

umask 0022

Instead of:

umask 0027

More info can be found in understanding linux umask value usage

Example:

root@ubuntu:~# umask
0022
root@ubuntu:~# mkdir /tmp/z123
root@ubuntu:~# ll -ld /tmp/z123
drwxr-xr-x 2 root root 4096 Jan  3 14:51 /tmp/z123/
root@ubuntu:~# umask 0027
root@ubuntu:~# umask
0027
root@ubuntu:~# mkdir /tmp/a123
root@ubuntu:~# ll -ld /tmp/a123
drwxr-x--- 2 root root 4096 Jan  3 14:54 /tmp/a123/


When writing your own applications, I recommend installing your own Perl. This was once a major pain, but no more. Nowadays, you can use perlbrew to build Perl for you.

On Ubuntu, I think you'll need the build-essential package first, if you don't already. After that, you can use the instructions on the perlbrew docs linked above to install it (or use cpan App::perlbrew).

Once installed you can run:

perlbrew init
perlbrew install perl-5.12.2
perlbrew switch perl-5.12.2

Once you do that and make sure Perlbrew's bashrc is loaded into your bashrc, you should be ale to run:

perl -v

and see that you're running 5.12.

The official perlbrew website is https://perlbrew.pl and it suggests installing by running

wget --no-check-certificate -O - http://install.perlbrew.pl | bash

Then you will still need to

perlbrew install perl-5.12.2
perlbrew switch perl-5.12.2

of course. Finally if you have multiple cores (and who doesn't these days) you can run

perlbrew install -j N perl-5.12.2

where N is the number of jobs requested, often the number of cores you have plus one. I use -j 5 on my quad-core and -j 3 on my dual-core netbook.


How to disable overlay scrollbar hiding behavior

Here I did this a while back. This it what I used

sudo su
echo "export LIBOVERLAY_SCROLLBAR=0" > /etc/X11/Xsession.d/80overlayscrollbars

now logout & login


Ssh X11 forwarding very slow using Xshell

First of all you should read ssh manpage.
-C (capital) enable zlib compression, this means server and client will spend time doing
   data compression/decompression. Since you want to speed up and - i guess - bandwith is
   not a problem you should not use it

-c arcfour,blowfish-cbc is to specify a different cipher to encrypt. while those cipher
   could be faster,they are known to be insecure. Unless you know what you are doing you
   should not use them

Last, those are option for ssh not xshell which is a totally different program


Screen almost black when external monitor is disconnected

Removing the contents of ~/.local/share/kscreen/ before shutting down with external monitor connected worked.

(s. https://forum.kde.org/viewtopic.php?f=289&t=128190)


How can I install software (made for Mac OS) in Ubuntu?

Wine can run windows applications, but there is no robust equivalent allowing Mac applications to run on Linux. Some projects that try to change this are:

Mac-on-Linux
Darling
http://opensource.apple.com/ - not an 'emulator' but provides the iOS/OSX kernels, licensed under free software licenses


As you already experienced, you had to disable advanced graphic virtualization.
Now that you have working VM, look for Oracle support docs, and find VM driver packages. Most well known hypervisors have some way of supporting some of most popular OS versions.
I am (was?)  a bit confused by Oracle, but since Win 7 is mentioned as host, I assume we're talking about VirtualBox.
In that case install this inside Ubuntu VM:
sudo apt install virtualbox-guest-additions-iso
It's set of tools to help host and guest... Get along better.
After install and a reboot (to check if you see any improvements), you can try enabling 3D acceleration again.
In any case, these additional tools will help you with more than just graphics.
Edit: official docs nkw VirtualBox was confirmed:
https://www.virtualbox.org/manual/ch04.html
Once virtualbox additions are installed you get an ISO in VM. Then you need to mount ISO (either inside VM, or through the host and VirtualBox GUI), and install packages from mounted device.
ISO will install in the directory /usr/share/virtualbox/VBoxGuestAdditions.iso


Can't get apache to serve pages on multi-interface VM

I figured this out. This is a lab environment, all external access is via web proxy. The 2nd interface's IP was not included in the "no_proxy" statements in /etc/environment. WORKING NOW! :)

The way I figured this out was to completely disable the 1st interface. Without being able to reach the proxy at all, curl to the 2nd interface IP printed an error saying as much, making a lightbulb go on in the dim recesses of my brain. While with the first interface up, it just sat there hung up for quite a while, then finally gave me a 'gateway timeout' page, which didn't occur to me to have come from our web proxy.


How to change network configurations, in my case, i want to change Gateway IP Address

You should be able to go to Menu --> Settings --> Network connections and click on the wired interface you are changing then click edit. In here you want to click on ipv4 then setup its IP address, network mask and default gateway.


My new server has ssh_host_ecdsa_key and ssh_host_rsa_key files on it already, is this normal?

The keys are generated automatically when you install the openssh-server.

To manually make a new set of keys,

First, delete the old ssh host keys. On the server,

sudo rm -f /etc/ssh/ssh_host_*

Then make new keys

sudo dpkg-reconfigure openssh-server

You will see

  Creating SSH2 RSA key; this may take some time ...
  Creating SSH2 DSA key; this may take some time ...
  Restarting OpenBSD Secure Shell server: sshd.

Your clients may get an message when they log in:

  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
  Someone could be eavesdropping on you right now (man-in-the-middle attack)!
  It is also possible that the RSA host key has just been changed.

  ...

If so, have the clients run

ssh-keygen -R hostname

where hostname is the name of the server.


After a day of shamanism with a tambourine, I've finally figured out: default driver is old radeon driver, instead of actual amdgpu (probably just because "it would show picture everywhere"). So basically you have to take following steps:

sudo nano /etc/modprobe.d/blacklist.conf
Add the following line: blacklist radeon
sudo update-initramfs -u
sudo nano /etc/grub/default
Add options, based on your graphics card. (for my 390 i have to enable CIK)
sudo update-grub
sudo reboot

After it you should be using amdgpu. To check currently selected driver, use:

$ lspci -v | grep -i VGA -A 12

Kernel driver in use: amdgpu
Kernel modules: radeon, amdgpu

To get vulkan SDK on Ubuntu (you would require at least glslc), no need to bother with tar - just check out premade packages. Bionic 18.04 packages are confirmed to work well on my fresh lubuntu 20.04

PS.


chroot just uses your current Kernel. That's just how it works. If you need to change the enveloping kernel, you're going to need to virtualise (through something like kvm or VirtualBox)... Or roll your kernel back to the version your chroot is using (though this sounds painful for the versions we're talking about).

I would personally just look at building for the right script. If you're using DKMS for this, it's fairly simple to just tell it which kernel and arch to build for:

sudo dkms install nvidia-337 -k 2.6.31-20-generic

The dkms {remove,build,install,uninstall,status,...} subcommands all take a -k option for specifying the kernel and arch. See man dkms for a bit more information.

For a list of the installed kernels, ls /lib/modules should get you moving in the right direction though it may feature kernels that are no longer installed. If you want a more packaged list, you can use a previous answer of mine:

dpkg -l | awk '/^.i +linux-(im|he)/ && $2~/[0-9]/ {print $2}'


powerd.service takes eternity to start at boot

I know Vivid isn't already supported, but I think problem is in all releases. Anyway, for future reference: powerd it's a service for phablet, so it's not available in standard installation.

I opened a bug to report the strange behavior.


How do I share my ethernet connection with my Android phone?

Check "Router - Official Ubuntu Documentation" and "Internet/ConnectionSharing - Official Ubuntu Documentatio...". I have used the latter in the past to great success.

You would also need to set up an access point, I'd recommend hostapd.


I would like to give the crontab command priority over current audio stream Ubuntu 18.04

Direct output to current running display

According to this post:

sox failing to execute as a cron entry while another sound app running

Running sox/play from a cronjob requires one to export the DISPLAY variable as if you were running a GUI application from crontab. Simply add export DISPLAY=:0 && to the beginning of your command like so:

*/10 7-21 * * * export DISPLAY=:0 && /usr/bin/play /home/mo/document/1.mp3

Also, please note, that when dealing with cronjobs it is best to use absolute paths (/usr/bin/play) so that cron doesn't get confused.


Printing photos to the photo tray (of HP Photosmart)?

The version of the lucid hplip package which is used to provide your printer capabilities is quite old (3.10.2).  Specific support for your printer was added in version 3.10.9.

I would try the latest hplip package from the hplip team PPA.

Related Questions:

 Are "PPA's" safe to add to my system, and what are some "red flags" to watch out for?
 How to install ppa packages in an apt-get style


sudo emacs crashes with tramp when I start a line with /

Someone was kind enough to answer this on Stack Overflow:

https://stackoverflow.com/questions/20500805/every-time-i-type-a-comment-in-emacs-tramp-freezes-it

It turned out to be auto-complete.


I made two mistakes. The solution revolves around installing Ubuntu on a template machine and then copping the entire root partition from this machine to the NFS share.

Do not do the copy from the machine when it is running. Use a live CD or other separate bootable environment to copy the root partition.

Use cp -a. The a is important because it preserves all of the file permissions, including the SUID bits that allows key executable to run as root.