Run IceWM in Ubuntu minimal installation?

For minimal installations I recommend using a minimal tool named xinit.

First of all disable or remove lightdm.

Then make sure you have installed xorg related stuff, packages like:

xserver-common
xserver-xorg
xserver-xorg-core
xserver-xorg-input-all
xserver-xorg-video-all

then install xinit:

sudo apt install xinit

Now after login use:

startx

it should bring your IceWM up, if it didn't work for your then in your home directory run:

cp /etc/X11/xinit/xinitrc .xinitrc

open .xinitrc using an editor:

nano ~/.xinitrc

and comment all lines (put a # at the start of each line laking #).

then add:

exec icewm-session

and save the file, now run startx and it should work fine.

As an alternative to lightdm you can install slim, start the service or reboot the system, then login using your credentials and you should be fine to go.


Install imagemagick:

sudo apt-get install imagemagick

An a simple command:

convert <your_png> out.tiff

Or for all files in your folder:

for f in *.png; do convert "$f" "${f%%.*}.tiff"; done


Set wifi txpower from /etc/network/interfaces

Try the up option described under "IFACE OPTIONS" here: http://manpages.ubuntu.com/manpages/precise/man5/interfaces.5.html

It, and similar options like pre-up, etc. allow you to execute arbitrary commands at various points during the configuration of your interface. So your /etc/network/interfaces might look like

auto wlan0
iface wlan0 inet static
    wpa-ssid <my ssid>
    wpa-psk <my psk>
    address <address>
    netmaks <netmask>
    gateway <gateway>

    # Command options with the same label (e.g. "up", "pre-up") are executed in the
    #  order in which they're specified.
    up iw reg set ...
    up iwconfig wlan0 txpower ...

    # If you have `rfkill` installed and want to disable (all) WiFi transmission
    #  while this interface is down.
    post-down rfkill wifi

You should also be able to use the option wireless-txpower ... since you have the wireless-tools (i.e. iwconfig) package installed, but I'm not sure how the sequencing of your commands would work in that case. Some (sparse) information on the wireless-[ ] options here: http://manpages.ubuntu.com/manpages/precise/man7/wireless.7.html


I think you have a kernel bug and suggest you file a bug report. How do I report a bug?

Similar reports in Launchpad (there are others)

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/906873


16.04 LTS Auto/Manual Ethernet Configuration

One way I found after looking up on Internet:

Prelude

Ubuntu 16.04 LTS up-to-date with patches
10 Mbps Duplex Fiber Internet
D-Link DIR-615 Router

Goal

Automatic Ethernet Configuration for Internet access.

Steps that worked for me:

Bypass Ethernet from Network Manager
Define LAN DHCP on Router
Soft Reboot

Step 1 : You need root access (sudo edit)

My /etc/network/interfaces file looks like:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto enp1s0
iface enp1s0 inet dhcp

enp1s0 is my Ethernet Card ID, in most cases it's eth0.

Now, Network-Manager says device not managed for Ethernet.

Step 2 :

Router LAN Config

My Router LAN page looks like :

On top of it, I threw a static IP for my Ubuntu machine. I think you can skip this.

Step 3

Connect RJ45 cable from Router LAN ports with active Internet-session to your machine and then boot it.

PS :

I've disabled Wireless (WiFi). It'll will be enabled on Router on demand by family members. Also, I've disabled SSID-Broadcast ;-)

Let me know if there was an easier way to go about it.


Unfortunately they don't have any PPA available. Viber Support Team will sure on this:

Download Viber (*.deb) file here.

 cd ~/Downloads/
 sudo dpkg -i viber.deb

Run

Type Viber in dash. Click the launcher icon.
For Gnome, go to Applications -> Internet -> Viber

How to uninstall

sudo apt-get remove viber


Errors were encountered while processing: linux-image-3.2.0-27-generic linux-image-3.2.0-29-generic linux-image-generic inux-generic

Are you using an encrypted home directory? You could try to cd to some other directory (i.e. /) before executing sudo apt-get ...

My wild guess here is, that some package script tries to explicitly cd into the directory from which you executed the program and is not allowed to. This can be the case when the directory is on a fuse volume (i.e. an encrypted home dir) since fuse processes can deny access even to root.

It could also be unrelated to fuse and encryption when some environment variable ($CWD) is not preserved correctly over the sudo call... or similiar.

Anyway, try cd / before executing apt-get and let's see what happens.


I think you have to mount an initially empty directory to an empty mount point, then everything you copy to the mount point will be compresses on the original empty dir, but still appear and can be used as if were not on the mount point.

When you unmount with fusermount -u, the data remains in compresses state on the original directory. When you mount again it will be visible as if were not compressed on the mount point.

If you put something on the original directory it will not be compressed, being the mount active or not. Only data put on the mount point when the mount is active will be compressed.

So, to sum up the steps:

choose or create two empty directories (the first one will hold all real compressed data, so choose this one carefully);
run the command fusecompress first-dir second-dir
copy all data you want to compress to second-dir (you can move, instead of copy, if you so desire, and to free space)
when you're done, you can unmount with fusermount -u second-dir

be aware to never access directly first-dir, when you need to you have to mount again as in step 2.


Short story
No native WhatsApp application that supports receiving files as arguments is available for Ubuntu yet. All the available solutions rely on WhatsApp Web and implement some sort of web browser.
So drag and drop images from DigiKam to your WhatsApp "application" / web browser is the obvious way.
Long story
Application launchers are located in the /usr/share/applications/ directory. These launchers are files with .desktop extension and each contain something like this:
[Desktop Entry]
Name=Amazon
Comment=Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more
Type=Application
Categories=Network;
Icon=amazon-store
Exec=/usr/share/ubuntu-web-launchers/amazon-launcher
X-Ubuntu-Gettext-Domain=ubuntu-default-launchers

The above example is for the amazon app.
In order for an app to be available and usable in the open with menu when a file is selected, it needs to have two things in its .desktop launcher file:

Exec key code which is in this case %F if the app is capable of accepting multiple files as arguments or %f if it can only accept a single file as an argument. This code is added at the end of the Exec= line with a space before it. So that line from the above example will look like this:
Exec=/usr/share/ubuntu-web-launchers/amazon-launcher %F

MimeType= which specifies file type association. For images for example, this line needs to be present in the .desktop application launcher and looks like so:
MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/svg+xml;image/tiff;image/x-bmp;image/x-gray;image/x-icb;image/x-ico;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-xbitmap;image/x-xpixmap;image/x-pcx;image/x-targa;image/x-tga;image/openraster;

So the end result of the example above will look like so:
[Desktop Entry]
Name=Amazon
Comment=Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more
Type=Application
Categories=Network;
Icon=amazon-store
Exec=/usr/share/ubuntu-web-launchers/amazon-launcher %F
X-Ubuntu-Gettext-Domain=ubuntu-default-launchers
MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/svg+xml;image/tiff;image/x-bmp;image/x-gray;image/x-icb;image/x-ico;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-xbitmap;image/x-xpixmap;image/x-pcx;image/x-targa;image/x-tga;image/openraster;

What you need to do is to find the .desktop launcher file for your  application and modify it like the above example. Your application will then be available in the open with menu. That being said, your application must have the capability of accepting files as arguments and be able to handle them properly or otherwise the arguments will be ignored by the application.
One more thing: If you have installed DigiKam from snap, I would advise to remove it like so:
sudo snap remove digikam

then, reinstall it with APT like so:
sudo apt install digikam

APT installed applications provide better integration with other desktop applications.
Notice:
Amazon app is not capable of handling file arguments and I used it as just an example on how application launchers are modified, how they look and where they are located.


I'm assuming you downloaded the package from this website?
Make sure you download the package clipgrab-3.1.0.2.bz2 - you can find this under the option "Show All Available Options"

It should open in Archive Manager.  Extract it to your Downloads folder.

Then in a terminal:

cd ~/Downloads
chmod +x clipgrab-3.1.0.2

Then you can start it:

./clipgrab-3.1.0.2

...

or you could just add the current clipgrab PPA

and install via

sudo apt-get install clipgrab

If you have the PPA already installed, then run the Update Manager to get the latest version.

As an aside - remember, sometimes you may have to wait a few days for the maintainers of the PPA to update with the latest version.


apt-get update is not working - Could not resolve 'cusxwtc-mwg4'

This is related to McAfee Web Gateway installed in my organizations corp network.

I have overcome this issue by adding the following(replace domain with corps domain)

dns-search example.com

In the /etc/network/interfaces file


Sleep mode differences between systemctl and pm-suspend?

See the power management page on the Arch wiki.

systemd does not use pm-utils to put the machine to sleep when using systemctl suspend, systemctl hibernate or systemctl hybrid-sleep; pm-utils hooks, including any custom hooks, will not be run.


How do I configure ufw to allow ssh on another port?

I guess you haven't allowed the SSH port in your ufw configuration.
In the case where you have not done this, the port where SSH is running is blocked by the firewall. I guess you can't have remote access to your server...

If you have (physical) access to your server you can open the SSH port using following command:

sudo ufw allow <port number>/tcp


Brother DCP-9015CDW prints blank pages with one or two short black lines at the top of every printed page (missing driver?)

You're missing a driver for your printer.

Go to the Brother website to get the driver.
Choose Linux (as OS Family) and Linux (deb) (as OS Version) and click Search.
You want to download the Driver Install Tool so click the Click to choose link there and then English in the pop-up.
You'll be prompted to agree to the EULA. Click Agree to the EULA and Download.
Your browser should now begin to download the linux-brprinter-installer-2.1.1-1.gz file.
Open up your terminal and  enter the following commands:

cd ~/Downloads
# Unpack the downloaded archive.
gunzip linux-brprinter-installer-*.*.*-*.gz
# Run the tool.
bash linux-brprinter-installer-*.*.*-* DCP-9015CDW

You'll be asked to provide the URI of your printer. This is how I got the URI myself:

Open the Printers application.
Right-click on your printer there (my Ubuntu has already configured it although it was missing drivers) and open Properties.
You can see your printer's URI in Settings > Device URI.

Works on Debian "stretch" 9.3 as well.


In UNIX systems the "/" is always the main folder (the start of the tree).

When you are in /home/username you have to write relative path to this directory in order to navigate deeper in the tree e.g. cd Desktop (without "/" in front of Desktop) or you can use the absolute path

cd /home/username/Desktop

but absolute paths are usually not a good way to move in the tree, because if you are somewhere in a deep place in the tree you don't want to write all the folders just to get one level deeper or go to at the upper level.

To move one level upper you have to write cd ../ which is again relative to the folder where you are at the moment.


Ratio  = uploaded bytes / downloaded bytes = 629.4  / 688.3 = 0.091442685.

I would consider the 504.5 a bug and would assume it should have been 688.3.


You need a passphrase to unlock the secret key for user

If the E-Mail was send to you it was encrypted with your public key and can only be unlocked using your private key. You have to enter the passphrase you choose when creating the key pair.

If it is not encrypted with your key, the sender got it wrong or it was not meant for you in the first place. You'll have no way to decrypt it without the matching private key and it's passphrase.


Partitioning win 10 for dual boot ubuntu 20.04

Your Ubuntu installation should have the ext4 file system.
EFI is a system partition that should already exist if you have UEFI compatible firmware and Windows is installed using UEFI.
FAT32 is unable to handle UNIX permissions or ownership, so you can't use Ubuntu on a FAT32 file system.


Check this out:
https://stackoverflow.com/questions/43440534/mysql-doesn-start-at-all

The reason that service is not working is because "mysql.service: Start request
repeated too quickly."

Could you please try with systemctl:

systemctl stop mysql.service

and after that:

systemctl start mysql.service


How do install package of R language's interpreter for statistical computing?

Package you are asking of is r-base. So run the following command:

sudo apt-get install r-base

and you will have R in your system. Years ago I was also confused by this - such package name is stupid indeed.


I looked in /var/log/syslog  search for NVRM. This will give you details about the NVIDIA driver.

As of Aug 10 2013 nvidia-common (installed as part of the bumblebee install) was 304.88

Newer drivers are in testing.


Ubuntu LIVE on USB - All Storage not Available

What did you use to make the USB Live drive?

Startup Disk Creator creates a ISO9660 partition that is read only.

Unetbootin will create a drive with a read/write partition that can support persistence using a casper-rw file of maximum 4GB.

mkusb will create a drive with ISO9660 OS partition, ext4 persistence partition and NTFS storage partition that Windows can see and use.

I would recommend mkusb:   http://phillw.net/isos/linux-tools/mkusb/mkUSB-quick-start-manual-12.pdf


Does pip overwrite packages installed by apt-get?

As @Timo mentioned in his comment, python -c "import sys; print sys.path" will give you the Python module load path for your install of Python. On a relatively fresh install of 16.04, there are three directories of note (among the 10 total that were in mine):

'' (application's directory)
'/usr/local/lib/python2.7/dist-packages' (where pip installs modules)
'/usr/lib/python2.7/dist-packages' (where apt install modules)

Most important to note, however, is that '/usr/local/lib/python2.7/dist-packages' is HIGHER in precedence than '/usr/lib/python2.7/dist-packages'.

If you first install a Python package via apt(-get), it will install into '/usr/lib/python2.7/dist-packages'. If you later try and use pip to install the module, pip will initially give a warning that the dependency is already met, then exit; adding the --upgrade flag will force pip to install, installing the module into '/usr/local/lib/python2.7/dist-packages'. (Notice the output that also says that the version in '/usr/lib/python2.7/dist-packages' is not uninstalled) You can then verify that the pip-installed version is the one being used by using the following: python -c "import MODULE; print MODULE.__file__".

As such, this shows that packages installed via pip will take precedence over system-installed packages, but won't overwrite anything installed from apt(-get).


Start your laptop with Ubuntu Live CD and run Gparted from there. Then select your 20 GB partition, right click on it and click resize. Resize it to use all the free space and click apply. Reboot your system after removing the CD and thats it.


How to change color/transparency of all desktop panels?

Tweaking Plasma

A

The KDE is using the plasma themes. You could install more themes and mix different themes.

System Settings > Workspace Appearance > Desktop Theme. Theme / Details tabs.

More can be found from the KDE Userbase: http://userbase.kde.org/Plasma/TweakingPlasma.

B

The KDE plasma objects are using the svg images. You could edit the images with a svg capable picture editor (Inkscape et. al.).

More can be found from the KDE TechBase: http://techbase.kde.org/Development/Tutorials/Plasma/Theme

--- Edit ---

More examples

http://www.kubuntuforums.net/showthread.php?56120-Customize-plasma-desktop-theme


Apparently, the system wasn't loading the network driver, so the interface wasn't detected. sudo modprobe r8169 appears to have fixed it.


How to to print the size of a filesystem in bytes?

The default implementation of awk in recent versions of Ubuntu is mawk, whose default numeric output format appears to %.6g. You can alter that by setting built-in variable OFMT to something longer

Ex.

$ printf 'Block count: 243200000\nBlock size: 4096\n' |
    mawk -F: '/Block count/{count=$2} /Block size/{size=$2} END{print count*size}'
9.96147e+11

but

$ printf 'Block count: 243200000\nBlock size: 4096\n' |
    mawk -F: '/Block count/{count=$2} /Block size/{size=$2} END{print count*size}' OFMT='%.12g'
996147200000

or (using your printf approach)

$ printf 'Block count: 243200000\nBlock size: 4096\n' |
    mawk -F: '/Block count/{count=$2} /Block size/{size=$2} END{printf "%.12g\n", count*size}'
996147200000

(printf "%d\n" doesn't work because the values are converted internally to floating point, I think).

From man mawk

OFMT      format for printing numbers; initially = "%.6g"


How can I make Ubuntu 18.04 / 18.10 desktop use Unity (be like Ubuntu 14.04)?

To install Unity you need to follow these steps:

Open a terminal (Ctrl+Alt+T) and use the following command:

sudo apt install ubuntu-unity-desktop

At the installation time, you’ll be asked whether you want to switch to LightDM.

A Display manager is what you see on the login screen.

If you want Unity like login screen: select lightdm
If you want to keep the default login screen in Ubuntu 18.04: select gdm3

Just select the one you want and press enter to move ahead with the installation procedure.

Once the installation is complete, restart your system. At the login screen, click on the Ubuntu symbol in LightDM or gear symbol in GDM.

In here, you can see the option to use Unity desktop environment.

Source: It's FOSS


If you are not a power user or developer who create programs, dependency tracker is there to mark the obsolete package.

Just run

sudo apt-get autoremove to remove unused dependency.

Also if you want to clean the downloaded cache files (installers at /var/cache/apt/archives that are used for installation you can run

sudo apt-get clean


Missing 'usb.h' file: What is it, where do I get it?

GNU radio uses libusb.

$ apt-file search /usr/include/usb.h
libusb-dev: /usr/include/usb.h

That is probably the file you need, to install the package do sudo apt-get install libusb-dev


How do you configure Tracker search indexing tool?

The command tracker-preferences is from the tracker-gui package, but the package is not available for Ubuntu 17.10 Artful Aardvark. In fact in Artful, tracker is not installed by default.

For other supported versions (Trust and Xenial) You may have to install the tracker-gui package first in order to run tracker-preferences.


Override Distro Package with Custom Package?

Yes, you can provide packages in a PPA that will install over top the standard Ubuntu packages. However, you will have to take the time to keep the packages up to date whenever new versions are released into Ubuntu. You may also want to check that it is still not enabled in the packages in Trusty as well. If it's already enabled in Trusty, then when 14.04 LTS is released in April 2014, it might be better to just upgrade. If it's not already enabled, you might want to discuss with the Ubuntu security team, about getting it enabled, by filing a bug report, and subscribing them to it.

You can  do it by fixing the version number. For example, if the current version in Ubuntu is 1.0.1e-0ubuntu1, then you'll want to specify your version as 1.0.1e-0ubuntu1.1~12.04.1 for building in your PPA. Appending the .1~12.04.1 makes it higher than the current Ubuntu version, but lower than the next Ubuntu version (so that if there is a security update in Ubuntu, it will take precedence). The 12.04 portion specifies it's built for 12.04, and the final .1 is your build number (in case you make a mistake and need to rebuild the same package, you can bump this to .2 for example). You will also need to specify the appropriate release series code name in the debian/changelog file as precise for 12.04, though if building off the existing 12.04 packages, on 12.04, should be set by default already.


configure error: cannot find ssl library (gtmess)

You should install build-dependencies, clone repository, compile and install your application as follows:

sudo apt-get install git build-essential libncurses5-dev libssl1.0-dev \
libncursesw5-dev

git clone https://github.com/geotz/gtmess
cd gtmess
./configure
make
sudo make install

And then run the application with gtmess.


How do I fix my resolution after Directx install through Steam?

I am assuming you mean the xorg resolution is messed up not just the games.

If it is the whole xwin settings I would move the xorg.conf to xorg.bad and recreate it. see if no config works normaly. if no you can run the nvidia config (im assuming nvidia card) and have it recreate the xorg.conf. I have had some games mess the primary screen up and wasnt able to get in to the video mode app to restore it. xorg.conf was the only way to resolve that.

If its the game its self I have seen that to.  you may need to kill some .conf or ini files in the game.  some times I have had to edit them and forcefully change it to the resolution that works best for me.  other games dont have a conf and you either get lucky or not. startopia was like that. I always try an make a backup of the initial good ini files from install and or first run where every thing works right. its not unusual to have to restore settings for some of the pickier programs.


JuJu: How to deploy service to specific machines in "Ready" state?

You are right that you need to "see" the  machine in the juju status output before you can use the deploy --to syntax.

In your case, what you need to do is "reserve" the machine first via add-machine. If you want to reserve a specific machine, you run the command like this:

juju add-machine maas:netNode.maas

For any random machine, use:

juju add-machine

That will trigger a deploy with the juju agent, and stop there. No "payload" will be installed. It will also give you a machine number, which you can then use as the --to argument.

The general syntax for direct placement with the add-machine command is:

juju add-machine <env-name>:<hostname>


Login page for users trying to access my hotspot

How are you connected to internet? A mean is there any kind of router, or hotspot is a router itself?

If you have some kind of router (I am using PC as a router/media center) you can easily configure some kind of dhcp/proxy/etc combination on it and catch the MAC from network clients.


my top menu consists of two bluetooth but no battery indicator

Try

sudo apt-get purge indicator-power
sudo apt-get install indicator-power


How do I get the wireless card on a Lenovo S205 working?

Do you know what wireless device you are using? - run lspci (or lsusb) in terminal or something to find out.

Some drivers that are automatically installed don't work very well - check the driver  here. (you should be able to find it in the lspci (or lsusb) output - run it with the -vvv option (lspci -vvv) against the device.

For instance my lspci output for my wireless is:

02:00.0 Network controller: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter (rev 01)
...

...Kernel driver in use: bcma-pci-bridge

Also,  have a look at programs like rfkill, which can be used to block and unblock wifi. Also, some Lenovo models have a switch to turn on and off the wifi. This is a low-profile switch and is probably located near the front. Mine (for a different Lenovo model) is located underneath front near the touchpad.

Also look at this:
http://ubuntuforums.org/showthread.php?t=1850027


Sync Google Calendar Tasks with Evolution

Tasks are currently not supported in Evolution due to missing support for Google Tasks in underlying library (libgdata).See the bug here.
But it can be done using third party tool syncevolution & web service memotoo.
Google <----------> Memotoo <-----------> Evolution.
First enable universe & multiverse repo.
Then open terminal & type: sudo apt-get update.
Install syncevolution: sudo apt-get install syncevolution sync-ui. Sync-ui is the gtk-gui for syncevolution.
Now go to https://www.memotoo.com/ & U can sign up there for free or choose premium version (1 Euro/Month).Free version has some limitation (max 50 tasks).
Sign in & go to "My Tasks" & select "syncronize my task". See image below.

Select Google Task from the list.Authorize memotoo to access your google account.Select type of synchronization "both ways". You can set sync schedule as per your preference.

On the same page click "synchronize google task" to start syncing manually.At this point you can see your google task on memotoo (default task category). Now you need to sync memotoo with evolution.
Open dash, type sync-ui & from the search open syncevolution.If you open it for first time you need to select the sync service.

Click on select sync service, Select memotoo from the list. Provide memotoo username & password. De-select appointments & contacts check-boxes & finally click "save & use".

Clicking Sync-Now under action will start syncing.If you are syncing for first time it may offer slow-sync.Click on "slow sync" to perform a slow-sync.You can also enable "Automatic   sync" to sync automatically(syncevolution will be running in background). At this point, it will sync to your default task list.You can view default task list by typing "syncevolution" in the terminal.

Extra Tweaks:
You can choose to sync only uncompleted task between memotoo & evolution. To do that open syncevolution, edit memotoo, under server settings change task uri from "task" to "task.uncompleted".

DONE!


Going from single to dual monitors results in black screen after grub even when reverting to single

Disconected the DVI-I monitor.

Selected root prompt from the recovery options in grub, reinstalled nvidia driver.

HDMI monitor works. Connecting DVI-I cable after boot is not detected by os. However system is usable.


adduser is a Perl script, using Getopt::Long. Unless explicitly told to do so, Getopt::Long will accept single-hyphen long options, and adduser doesn't tell it do so. So, -ingroup will work just as well as --ingroup.

Don't rely on this to work in the future, though.


What was the reason behind this error means,you are trying to install 64 bit version of liboil0.3,but your system has already installed a 32-bit version of liboil0.3.Run the below command in terminal to fix this problem.

sudo dpkg -r liboil0.3:i386


There's an icon on the login screen that, when clicked, should give you a number of options for your session.  One of those should say kubuntu.  I think it's probably just defaulting to the last session you opened.


Ubuntu won't boot with Windows 10 hard drive connected

It seems that your UBUNTU HDD connected as slave. And Windows HDD - as master(You can check it out in BIOS). Try to switch them


How do I log all input and output in a terminal session?

When you are ready to start recording a log file, type:

script screen.log

Now, until you stop the script, all input and output in the Terminal will be stored in screen.log. When you are done, just type:

exit

Your screen.log file will stored in the local directory. If you want to redirect it, use an absolute pathname such as ~/screen.log. This will do exactly what you are looking for.

Source: Ubuntu Guide - How To Log Terminal Commands


Is there an alternative for the Windows software "hashcheck" in Ubuntu?

Most sum checking utilities are already included in Linux as command line programs - a few can be listed by running ls $(echo $PATH | sed -e s/:/' '/g) | grep sum (which searches the directories of executables to find filenames containing sum) :

sum
cksum
md5sum
md5sum-lite
sha1sum
sha224sum
sha256sum
sha384sum
sha512sum
shasum
sum

So you can get the md5 sum by running:

md5sum /PATH/TO/FILE(S)

and the sha1 sum by running:

sha1sum /PATH/TO/FILE(S)

For other commands (although these usually use a similar syntax), you can search for their usage & options online or by using manual or help commands:

man cksum
cksum --help

MD4: I do not think has been used or included much outside of Windows for a few years due security concerns, although the rhash package appears to support it.

If you want a GUI, as this suggests, you can use this:

or other similar packages like gtkhash, which look like they can integrate into Ubuntu's file managers. Otherwise, you may be able to run it under Wine


Dropbox and Ubuntu Software Center doesn't work after setting python3.4 as default

If this is the problem you are getting.

File "/usr/bin/dropbox", line 215
    except OSError, e:
                  ^
SyntaxError: invalid syntax

It may be due to update of your python from python2 to python3 and setting python3 as default python. to get rid of of this problem you can follow the below steps.

Tyr the below steps,

Open cd /usr/bin/dropbox file and in the edit mode.
Change the first line from #!/usr/bin/python to #!/usr/bin/python2
Restart the dropbox app and it should work good.


How to text to speech (pdf, docx) documents in lubuntu 12.10

You can try Festival TTS or Free TTS.
You can refer this links : http://freetts.sourceforge.net/docs/index.php & http://www.cstr.ed.ac.uk/projects/festival/


How to have a way to quickly change programs in Unity?

You [currently can't move the Launcher][1] but you can fix it in place and make it smaller.

How to resize the Unity launcher?


Installing build-essential fails in Docker

Solved this by giving --no-cache to Docker.


How should I partition my drive for my Ubuntu installation?

Are they 2 different physical disk or 2 partitions on the same disk?

During the install process you will be asked how to part the disk. the safest way is to use the automatic partitioning which detects your existing OS and does not overwrite it.

Choosing the manual way:
If it is your first installation I would keep it simple and create just a / and a /home partition, plus a small swap (at least your ram size, if you plan to hibernate).
Just be sure to double check you are not going to format the existing win partition and mount it as /windows

the installer will then take care of setting up the dual boot environment


Bash alias that calls a script versus defining the script as a function

If you define these in your ~/.bash_aliases file, which is an Ubuntu-specific thing and gets sourced by ~/.bashrc in a default Ubuntu install, then yes, there is an overhead since the file will be sourced each time you start a new interactive, non-login shell. So each time you open a new terminal window, for example. Now, with modern machines, this overhead will most likely be undetectable, but it can be an issue for older machines, embedded systems or if you start having loads of complex functions defined.

In addition, functions and aliases defined this way are not accessible to scripts by default. So if you want to use one of those functions in your scripts, you will need to source .bashrc (or .bash_aliases) explicitly. If you have them as external script files in your $PATH, that won't be needed.

My personal rule of thumb comes down to the complexity of the commands involved and whether or not the function/script I am writing is likely to be useful to non-interactive shells (e.g. other scripts). If I find myself writing several dozen lines of code, then I'll likely move it to a script. If I'm writing something that can be used in many different contexts and can likely come in handy when writing another script then, again, I'll move it to a script.

If, however, I just want a simple little function like the one you show in your question, that's only really useful when run interactively, then I'll stick to functions. So it really is a matter of your own personal preference and considering how and when you will want to use the functions you are defining.


Can I erase all photo metadata using Gimp?

GIMP 2.9.4 and later has a built-in metadata editor. It is accessed by selecting Image -> Metadata -> Edit Metadata. The GIMP Metadata Editor can edit a wide variety of image metadata fields including GPS metadata. To write metadata click the Write Metadata button in the lower right corner of the Metadata Editor window.

GIMP 2.10

GIMP 2.10 can be installed as a snap package in all currently supported versions of Ubuntu or as an apt package in Ubuntu 18.10 and later.

Image::ExifTool (libimage-exiftool-perl) is a library and program (exiftool) to read and write metadata information in multimedia files. To install libimage-exiftool-perl in all currently supported versions of Ubuntu open the terminal and type:

sudo apt install libimage-exiftool-perl

To quickly erase all of an image's metadata run this command:

exiftool -overwrite_original -all= /path/to/file


Is it possible to have 2 os in the same pc?

Yes you can have both on the same. The installer even does the partitioning for you.

Ubuntu Installer

You can find all downloads here here

There are two verisons of Ubuntu:

Ubuntu 13.04:

has the latest features
direct link 64-bit here
torrent 64-bit here

Ubuntu 12.04:

For extended support,
direct link 64-bit here
torrent 64-bit, here

Further help

As user68186 mentioned:
If you are confused on how to further install it there is a nice guide here.


Ranger does not have image previewing enabled by default. You need to enable it in its configuration file.
First, ensure that you do have a user-specific config file (~/.config/ranger/rc.conf). If you don't, create the config directory (by running mkdir -p ~/.config/ranger/) and copy the default one into it (by running cp /usr/share/doc/ranger/config/rc.conf ~/.config/ranger/), then open it (the user-specific one, that is) with your favorite text editor.
To enable image previews, find the preview_images option and change it to true. i.e. the line would read:
set preview_images true

Then, find the option preview_images_method, and set it according to your terminal to one of the values enumerated and explained in the comment block preceding it. In your case, it's urxvt. So the line would read:
set preview_images_method urxvt

After that, quit ranger and start it again for the new configuration to take effect.
If all fails, I personally use it with the Kitty terminal and it works. If you want to try it out, first install Kitty, change the aforementioned preview_images_method option to kitty, then launch kitty and start ranger in it.


my wifi is not working need help on 14.04

sudo apt-get purge bcmwl-kernel-source broadcom-sta-common broadcom-sta-dkms
sudo apt-get install firmware-b43-installer

Reboot and wifi should work.


sudo apt-get remove kdevelop and sudo apt-get purge kdevelop completely. then try locate kdevelop and remove all files and directories in the list as: sudo rm -rf /dir_path.
reboot the system and reinstall application.


Find likely processes based on snapshot in time

Python to the rescue:

python3 -c 'import sys,collections;l=[(int(L.split(None,1)[0]),L)for L in sys.stdin.readlines()];m=collections.Counter(x[0]for x in l).most_common(1)[0][0];print(*[x[1]for x in l if x[0]<m],sep="",end="")'

Alternative, uncompressed version for use as script file:

#!/usr/bin/env python3
import sys
import collections

# read lines from stdin (with trailing \n) and extract the number in their first column
items = [(int(line.split(None, 1)[0]), line) for line in sys.stdin]
# find the most common number from the first column
most_common = collections.Counter(item[0] for item in items).most_common()[0][0]
# print input lines in order, but only those with their number lower than the most common
print(*[item[1] for item in items if item[0] < most_common], sep="", end="")

The only assumption this script makes about its input, which is expected to be piped into stdin, is that each line has a valid integer number in its first whitespace-separated column. The lines are not required to be sorted in any form.

Note: If there are multiple different most common numbers in the first column with the same count, which of those two gets picked is arbitrary, but should be constant for the same input. In case this is undesired, you'd have to replace the line finding the most common value with something like this instead, to find the highest most common value:

most_common = sorted(collections.Counter(item[0] for item in items).most_common(),
                     key=lambda x:x[::-1])[-1][0]

Example input:

1 foo
3 bar
2 baz
3 apple
3 banana
2 cherry
4 beep

Example output:

1 foo
2 baz
2 cherry


OpenSSH: X-Forwarding: wrong authorisation protocol

I have found an answer.

Make sure the following is set to yes:

X11UseLocalhost yes

Make sure /etc/hosts contains the following:

127.0.0.1 localhost


What you probably want to try is tell steam to set-up a different install directory for your games. You can do this fairly easy by going to:
Settings->Downloads+Cloud->Steam Library Folders->Add Library folder.

After doing this every game you install will ask you what library folder to install into. Just select one that has plenty of space and that should do the trick.


Based on the answer to my comment above...
You should let know to the other machines on the LAN how to reach the 172.20.20.0/24 subnet.
You said that the LAN address is assigned by DHCP. So I suppose this server is not your default gateway for the LAN.
First, you should reconfigure it as a static address (say 172.20.10.100), then:

Put a route for 172.20.20.0/24 via 172.20.10.100 (the static LAN IP) on the default gateway of your LAN.

Enable ip forwarding on your server, by issueing the command:
sysctl -w net.ipv4.ip_forward=1

Note: to permanently enable ip forwarding edit the file /etc/sysctl.conf and make sure it has the line net.ipv4.ip_forward = 1.
On my ubuntu machine there's something like:
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1


You don't really need a regex for this. A simple shell glob plus parameter expansion will do it:

$ for f in *\[*\]/; do echo mv "${f}" "${f/\[*\]}"; done
mv Another.Example[app]/ Another.Example/
mv Example.of.Structure[app]/ Example.of.Structure/
mv Third.Example.of.Structure[app]/ Third.Example.of.Structure/

(remove the echo once you are happy that the proposed replacements are correct).

If you want to use a regex based tool, then the perl-based rename/prename is the obvious choice:

$ rename -n 's/\[\w+\]//' */
rename(Another.Example[app]/, Another.Example/)
rename(Example.of.Structure[app]/, Example.of.Structure/)
rename(Third.Example.of.Structure[app]/, Third.Example.of.Structure/)

(remove the -n once you are happy that the proposed replacements are correct).

Both of these match the first occurrence of the pattern. If there's a possibility that the [app] pattern can occur elsewhere, look at anchoring the match to the end of the pattern. See Start of String and End of String Anchors


find photos shot by a certain type of camera via terminal

Have a look at exiftool. Something like

sudo apt-get install exiftool
cd FOLDERWITHYOURCOLLECTION
exiftool -a -r -Model -Directory -Filename -T * |grep YOURMODELHERE > list

You will get a file list with content like:

CanoScan 5600F  1992/07/05      1992_0705_120100.jpg
CanoScan 5600F  1992/07/05      1992_0705_120400.jpg

With the model first, then the folder, then the file name.


Downloaded zip file using w3m on linux missing

Once you've opened the link and w3m is letting you browse the contents, you can use Esc-s to save the current "document" (in this case, the zip file).

If you know ahead of time that you'll want to save the endpoint of a link, you can use either a or Esc-RET to save the link.

(Source: The w3m manual)


How to extract specific numbers from files to solve an equation?

You can use the following perl script:

#!/usr/bin/perl
use strict;
use warnings;

foreach my$file (@ARGV)
{
    open(IN,'<',$file) or die $!;
    open(OUT,'>',$file.".result") or die $!;
    my$b;
    my$c;
    my$sum;
  while(<IN>)
  {
      ($b)=$_=~/(\d+)/ if $_=~/Bits/;
      ($c)=$_=~/(\d+)/ if $_=~/Mux/;
      print OUT $_;
  }
  print STDERR "found values in ",$file,":\n";
  print STDERR "Bits: ",$b,"\nMux: ",$c,"\n";

    $sum=$b * (0.004+($c * 0.00008));
    print STDERR "writing sum (",$sum,") to the output ",$file,".result\n";
    print OUT "Result: ",$sum,";\n";

    close OUT or die $!;
    close IN or die $!;
}

It searches the input file for the strings Bits and Mux, extracts the following numbers and prints the result of the equation ($sum=$b * (0.004+($c * 0.00008))) to the output file as Result: <number>;. The output file is named as input-file.result.

Running it on your example file:

$ perl myscript.pl file.txt
found values in file.txt:
Bits: 32
Mux: 8
writing sum (0.14848) to the output file.txt.result

The content of file.txt.result:

//   copyright kkshlglkf
//   lhafslghldk
//   rsghlgsrlskl
//   sgkg
//   sgrjgrs
//   Memory:   BDRAM_SP
//   Bits:     32
//   Mux:      8
//   ladhdal:  sdj
//   zdfjhael: apfiehad
     slhgslfkghlkj
     slgdhlgfdkkdf
     Dataoutstage: None;
     TransparentMode: None;
     CellName: BDRAM_SP;
MemoryTemplate(BDRAM_SP)
{
 afljefkaf
 aslhkldfjfa
 fihhfejksgj
 dfhdhsgjshgf
 zdkjjgshgf
 sjfhfjkh
 sfdkjssjfh
Result: 0.14848;

If you want to use the script with multiple input files, you can run it as

perl myscript.pl file1 file2 file3 ...

This will then create the output files file1.result, file2.result and so on


Unable to connect to Windows VPN in Ubuntu 11.10

How to set up VPN in Ubuntu (when you know the parameters to configure):

Click the network icon in the panel → VPN Connections → Configure VPN.

Go to VPN tab → Add.

Create.

Enter settings, optionally mark Connect automatically, Save.

You can connect via the network icon in the panel.

Ps. If you're trying to connect to a Windows VPN and still not working, try the below method suggested by Jason Rowe:

Try going into "Advanced" on the VPN tab and enable "Use Point-to-Point encryption (MPPE)", set security to "All Available (Default)" and tick the boxes for "Allow BSD data compression", "Allow Deflate data compression", and "Use TCP header compression".


I don't know how this happened. If you could find its reason, let me know too. I need it.

But as solution, you must be able to reset the layout to the default by going to menu: View > Load layout > Layout 1.

If you cannot see menu bar, press ALT+F10

I hope it solve your problem


Firefox cannot access a frequently visited website anymore

Probably you have an issue with the DNS resolver cache. The DNS resolver translates domain names to IP addresses and back. Probably the entry in your DNS cache is no longer valid.

You can try to refresh your cache by restarting the DNS service:

sudo service nscd restart

If that does not work, try this

sudo service network-manager restart


The reason for this is that the script runs in a subshell; & then returns to where you were...

Try . ./chdir to make it run in the current shell.


Replace audio stream from one file with audio stream from another

You'd need to extract the audio from the MKV first and then combine remux the MP4 with the new track. Something like this should work:

ffmpeg -i vid.mkv -acodec copy -vn audio.ext
ffmpeg -i vid.mp4 -i audio.ext -vcodec copy -acodec copy -map 0:1 -map 1:0 final.mp4


how would i use rm to delete all files without certain wildcard?

You can do this by enabling extended globs:

shopt -s extglob

Now you can do for instance

ls !(*.pdf)

Or in your example

rm !(*text*)


Different behavior when launched from terminal instead of Unity launcher

I found out what was wrong. I had to enter the correct StartupWMClass at the .desktop file.

For those who are struggling with it, launch the application from terminal and execute in a different terminal the command

xprop | grep WM_CLASS

Click on your application and the output of the previous command will be

WM_CLASS(STRING) = "result"

Add to the .desktop file the following line:

StartupWMClass=result

Substitute result with your output.


How to display reboot required user notification after installing a custom package in linux?

I figured out the answer for this.
Can display post install user notification using the following postinst script.

Create a file with the name postinst and copy the following script into it. This script should be copied into the right directory before creating the Debian package.

Note: This is for Debian environment.

#!/bin/sh -e

if [ -d /var/lib/update-notifier/user.d/ ]; then
   rm -rf /var/lib/update-notifier/user.d/PackageName
   cat << EOF >> /var/lib/update-notifier/user.d/PackageName
Name: PackageName Post Install Notification
Priority: High
Terminal: False
#Command: /usr/bin/PackageName
Description: Reboot is required to complete the installation.
EOF
   touch /var/lib/update-notifier/dpkg-run-stamp
fi


You almost did the job in locating it, but instead of typing

$ locate libmagick

You should have tried

$ locate magick

The output is:

/usr/lib/mime/packages/imagemagick-6.q16
/usr/lib/x86_64-linux-gnu/ImageMagick-
6.9.7/modules-Q16/coders/magick.la
/usr/lib/x86_64-linux-gnu/ImageMagick-
6.9.7/modules-Q16/coders/magick.so
...

I hope this solves your first problem. But coming to the second I have no idea how it can be done.

sorry for this partial answer.


How to create a hotspot in ubuntu 20.10 using the BCM43142

To create a hotspot (Internet sharing through Wi-Fi), you can use  linux-wifi-hotspot providing a GUI Wi-Fi Hotspot and a CLI create_ap.
sudo add-apt-repository ppa:lakinduakash/lwh
sudo apt install linux-wifi-hotspot
wihotspot

Edit:
If you get the following error:
 ERROR: Your adapter does not support AP (master) mode

That's mean your Wi-Fi card doesn't support the AP mode, you have to use a USB Wi-Fi dongle or change your PCI card.
The BCM43142 should work with brcmsmac driver which support the AP mode. Install the firmware-b43-installer package:
sudo apt install firmware-b43-installer

Load the brcmsmac driver:
sudo modprobe -rv wl b43  ssb
sudo modprobe -v brcmsmac


This is a known bug: https://bugs.launchpad.net/unetbootin/+bug/1620628.

The fix is to update from ppa:gezakovacs/ppa.

It appears this might not always work for 18.04, in which case the fix is to run it thus:
sudo QT_X11_NO_MITSHM=1 unetbootin


How can I install the development version of Node?

You have added the stable node.js PPA; for the development version you'll want to use this PPA:

https://launchpad.net/~chris-lea/+archive/node.js-devel

sudo add-apt-repository ppa:chris-lea/node.js-devel -y
sudo apt-get update
sudo apt-get install nodejs -y

You'll also likely want to remove the first PPA you added:

How can PPAs be removed?


Libraries required to compile the gem successfully:

sudo apt-get install libfcgi libfcgi-dev


I cannot create a user with an encrypted homedir

adduser is a perl script that takes care of the details of adding a user and will do what was removed in GNOME3

sudo adduser --encrypt-home USERNAME

If you upgrade to 11.10 from for example 11.04 then use

sudo adduser --uid OLD_UID --encrypt-home OLD_USERNAME

Make sure to use the same password as the old accounts, use ls -lan /home to find OLD_UID.


Radeon R7 260X - No 3D Acceleration in Ubuntu 18.04

Turned out that libegl-mesa0 wasn't installed, so:

apt-get install libegl-mesa0

fixes it.


If you really want to check password strengths, you should use cracklib-check from the cracklib-runtime package (should be installed by default):

$ echo foo | cracklib-check
foo: it is WAY too short
$ echo foobar | cracklib-check
foobar: it is based on a dictionary word
$ echo foobared | cracklib-check
foobared: it is based on a dictionary word
$ echo foobared123 | cracklib-check
foobared123: it is too simplistic/systematic
$ echo '!'foobared123 | cracklib-check
!foobared123: OK


Updating to 13.04 failed in WUBI install of Ubuntu 12.10. What should I do?

Summary of the comments as solution

You have a WUBI installation that was initially 12.04. It was upgraded from within WUBI to 12.10. However, while upgrade to 13.04 the upgrade failed. Now Ubuntu is unbootable. Windows is bootable. There is no valuable data in the Ubuntu.

Note: The way WUBI works is cumbersome and prone to breakage. It was meant for short term use to try out Ubuntu. It does not work with newer computers. So it was taken out of 13.04. That is, one cannot do a fresh WUBI install with 13.04. I am not sure if that is the reason your upgrade failed or not. In any case, upgrading WUBI install fails sometimes.

First, backup all the important (and not so important) files in Windows. To be safe, make a recovery disk for Windows as well. Even though, nothing should happen, mistakes do happen, power goes off, a cat walks over the keyboard...

Second, Uninstall the WUBI version of Ubuntu. Boot Windows and delete the WUBI installation using Add-Remove in the Control Panel. This will remove almost all of Ubuntu except the boot menu choices. The space that you allocated to Ubuntu during WUBI install should be returned to Windows. If after the uninstall disk space is not freed, remove the contents of C:\Ubuntu. See How do I uninstall Ubuntu Wubi? for full description.

Third, Install Ubuntu in its own partition as dual-boot with Windows. See the official documentation on how to install. Make sure in Step 4, you choose "Install Ubuntu alongside Windows." This will keep your Windows installation and all the data in  it. This will also make next step (partitioning the hard disk) easy. Also see How do I install Ubuntu?

Finally, Some of the things may not work in a new install of 13.04 (chrome, Skype). See 7 things to do after installing Ubuntu 13.4. for some help with those.

Best of luck.


After accidentally deleting some files from /etc/ppp Internet not working?

Use dpkg to discover what files could be related to this file:

dpkg -S "/etc/ppp"

It will result:

resolvconf, pppconfig, pppoeconf, pptp-linux, ppp: /etc/ppp

Now, since you know the packages that uses this filepath. You have to reinstall them from the repository:

sudo apt-get install --reinstall resolvconf pptp-linux pppoeconf pppconfig ppp

Hope you fix your problem.


How do I launch a web browser on my local machine that visits websites through the ip of a remote machine?

The SSH tunneling in Clemens' answer will work for one specific website, with caveats... if the site does virtual hosting, where the content depends on your HTTP request pointing at a specific hostname, simple port tunneling won't work. And it will only get you to the one site.

A more robust solution is to use OpenSSH dynamic port forwarding. The command would be:

ssh -D 1080 ssh-server.example.com

Next, set the browser on your client to use a SOCKS proxy at 127.0.0.1, port 1080.

Now, regardless of which site you're visiting, all of your browsing activity (including DNS lookups) will use the remote server.

More detail is here: SSH/OpenSSH/PortForwarding: Dynamic Port Forwarding

If you need to switch frequently between browsing normally and browsing through the remote SSH server, look into installing a plugin for your browser to do fast proxy switching. There are a lot of them.


Depending on what is broken, pkexec may still work even though sudo doesn't. Polkit (of which the pkexec command is a part) and sudo are separate mechanisms in Ubuntu that allow administrators to perform actions as root.

I don't know how you installed the fingerprint software, so I don't know how to remove it. But whatever commands you would run with sudo, you can usually run with pkexec in place of sudo, at least as long as they're not commands that run graphical applications.

That is, instead of running:

sudo some-command...

Run:

pkexec some-command...

Ubuntu users have used pkexec to solve a variety of problems where they couldn't use sudo, including sudo being uninstalled and sudo being misconfigured. But depending on what is broken, it's possible that running pkexec will fail as well; I'm not sure that can be ascertained from the information you've provided (so if it works for you it might not work for people who find this question by searching, or vice versa).

If you are able to run commands as root with pkexec but uninstalling the fingerprint software doesn't fix the problem, the next step would be to look into the file whose name is mentioned in the error message, libaudio.so.2. This file is provided by the libaudio2 package. So if you can run commands as root with pkexec, you can attempt to reinstall that package:

pkexec apt install --reinstall libaudio2

I can't really give any more specific advice than that based on the information available so far. But I can give more general advice: to find official Ubuntu packages that provide a particular file, go to Ubuntu Packages Search and search under where it says "Search the contents of packages." (I mention this for the benefit of others who find this question by searching, but also for you, in case you get additional errors messages after fixing the one you've seen so far.)


Create dd wrapper script

Open the terminal using Ctrl+Alt+T. Then call gedit with:

gksu gedit /usr/local/bin/dd

and copy and paste these commands:

#!/bin/bash

# Who called this script?
PARENT_COMMAND="$(ps -o comm= $PPID)"
if [[ $(id -u) != 0 ]]; then # Only non-root processes enter password (ie "sudo dd ..." is ok)
    echo dd must be called with sudo powers
    exit 1
fi

# log dd usage for audit trails
# log-file '"$PARENT_COMMAND"" - ""$@"' "/var/log/dd-usage"

# Display hints & arguments. Get any key to proceed or <Ctrl>+C to abort
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║                                                                ║"
echo "║                      dd - Data Duplicator                      ║"
echo "║                                                                ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo
echo " Parameter 1 hint: if=/dev/zero"
echo " Parameter 2 hint: of=/dev/sdY where Y cannot be a, b or c"
echo " Parms >2 hints:   bs=512 is default block size"
echo " Parms >2 hints:   count=100 will process 100 blocks"
echo
echo " Use /bin/dd --help for more info (don't use dd --help)"
echo
# Display drive letterss, names and sizes without partitions for guide
lsblk -ido KNAME,TYPE,SIZE,MODEL
echo
echo " Current parameters: "”$@”
echo
echo "      Press <Enter> to continue or <Ctrl>+C to abort."

read ANYKEY

if [[ "$2" != of=* ]]; then
    echo -e "\a" # PC speaker beep or pleasant bell with PulseAudio hooks
    echo "ERROR! Parameter 2 must start with 'of=' (output file=)"
    exit 2
fi

if [[ "$2" =~ "sda" ]]; then
    echo -e "\a" # PC speaker beep or pleasant bell with PulseAudio hooks
    echo "ERROR! Output file (of=) cannot be /dev/sda"
    exit 2
fi

if [[ "$2" =~ "sdb" ]]; then
    echo -e "\a" # PC speaker beep or pleasant bell with PulseAudio hooks
    echo "ERROR! Output file (of=) cannot be /dev/sdb"
    exit 2
fi

if [[ "$2" =~ "sdc" ]]; then
    echo -e "\a" # PC speaker beep or pleasant bell with PulseAudio hooks
    echo "ERROR! Output file (of=) cannot be /dev/sdc"
    exit 2
fi

# Call REAL dd command with parameters passed to this wrapper sript
/bin/dd "$@"

exit 0

Save the file and exit gedit.

Lastly mark the new dd as executable with:

sudo chmod +x /usr/local/bin/dd

What it looks like

Below is how it appears on your terminal screen when you've called the new dd script without using the protected drives.

$ sudo dd if=/dev/zero of=/dev/sdd bs=512 count=100
╔════════════════════════════════════════════════════════════════╗
║                                                                ║
║                       dd - Data Duplicator                     ║
║                                                                ║
╚════════════════════════════════════════════════════════════════╝

 Parameter 1 hint: if=/dev/zero
 Parameter 2 hint: of=/dev/sdY where Y cannot be a, b or c
 Parms >2 hints:   bs=512 is default block size
 Parms >2 hints:   count=100 will process 100 blocks

 Use /bin/dd --help for more info (don't use dd --help)

KNAME TYPE   SIZE MODEL
sda   disk 223.6G KINGSTON SHSS37A
sdb   disk 465.8G ST9500423AS
sdc   disk 119.2G KingFast
sdd   disk  29.8G USB Flash Drive
sr0   rom   1024M DVD+-RW GT80N

 Current parameters: 'if=/dev/zero of=/dev/sdd bs=512 count=100'

      Press <Enter> to continue or <Ctrl>+C to abort.

100+0 records in
100+0 records out
51200 bytes (51 kB, 50 KiB) copied, 0.00339331 s, 15.1 MB/s

Notes

Because the wrapper script is located in /usr/local/bin it is called before the regular command stored in /bin.

The second parameter must begin with of= and can not contain sda, sdb or sdc, add more drives to protect or subtract drives depending on your installation.

Line draw characters may not work on older platforms or different character sets. Use "+---+" for top and bottom lines and "|" for middle lines or remove them altogether.

log-file is a script for logging commands to audit files. You can replace it with your own command and un-comment the line by removing the leading #.


Netgear AC Wireless Adapter A6100 sill not working in Ubuntu 18.04.3

You could install the latest drivers from this GitHub repo: https://github.com/aircrack-ng/rtl8812au.git

As per the repo, this is how you can install the drivers using DKMS method:

sudo apt update
sudo apt install dkms
git clone -b v5.6.4.2 https://github.com/aircrack-ng/rtl8812au.git
cd rtl8812au
sudo ./dkms-install.sh

Your USB WiFi adapter should be working now.


USB mouse moves but doesn't accept left clicks

I had the same problem with a Microsoft keyboard when pressing any special keys like the calc button or the volume controls. The left mouse button stop responding. You can find a possible solution in the comment #49 from a bug report: https://bugs.launchpad.net/ubuntu/maverick/+source/linux/+bug/636311

The package is for x64 but I think the x86 version is available too.

It fix my problem. Let me know if it helps you.


I think iptables would do something for you.

First, activate packet forwarding:

$ echo 1 > /proc/sys/net/ipv4/ip_forward

Redirect your traffic from 50.60.70.80:105 to 10.8.0.105:80

$ iptables -t nat -A PREROUTING -d 50.60.70.80 -p tcp --dport 105 -j DNAT --to-destination 10.8.0.105:80

Make the Iptables marquerade the requisition:

$ iptables -t nat -A POSTROUTING -j MASQUERADE

Hope this help!


Ubuntu sound is locked at a certain level 14.04

Something maybe broken in your pulseaudio package install (assuming you use PulseAudio ... and since that package has a huge number of reverse dependencies, better than removing and installing it again (1), did you try (from terminal - CTRL+ALT+T):

$ sudo apt-get install --reinstall pulseaudio

See if that solves yr pbm. To go a little beyond the scope of yr question, but respecting the spirit of it, check out this, the PulseAudio equalizer, available for 14.04, I find particularly useful in relation to sound control. I think (from the sound of yr user name - pun intended) that it might prove useful to a gamer.


Unable to install internet explorer 11 in ubuntu 20.04

Best way to install IE on ubuntu is to use a VM or dual boot. Wine is not recommended.
Also from my understanding you can use the unactivated windows 10 (free) from the Windows 10 media creation tool and it should have no expiration limit.
If you use the unactivated version, you will not having access to the personalization menu and cannot change custom colors, sounds, start menu and taskbar settings, or desktop background.
Also, there will be an annoying watermark on the screen.
Other than that it should work exactly the same at least for using IE.
Bear in mind that there are many better browsers, but I assume you have a niche use for IE and have no other choice.


To do it in "one go" for multiple systems you should write a script and send it with Landscape. The "user management" interface does not support multiple computers.


Scanner not working on Xubuntu 18.04 with hplip 3.18.9

The Scanner in the M1212 is simply not supported by SANE anymore.


My Root disk space is full after an upgrade to the newest version of Ubuntu

Yes, it is possible to resize the root partition on the fly using the GNOME Disks tool. Just keep in mind that in the case your UUID of the partition changes, you need to modify /etc/fstab and your GRUB boot parameters accordingly.
By the way, if it is full due to the upgrade packages, you should be able to free some space using sudo apt clean. You can also free more space by removing old kernel versions and old snap packages (details on my website here: https://wyphan.github.io/logfile/2020/12/17/kernel-snap-cleanup.html )


Associate ready annotations with a raw PDF file with Okular

I suspect this is going to get a lot of downvotes, but

Isn't it easier to restore files with TestDisk?


How do I improve workflow when switching between programming on Ubuntu and Adobe apps on Windows?

Why do you use a dual boot?

Install virtualbox, install Windows inside virtualbox, install adobe inside windows inside virtualbox. Set up virtualbox with things like guest additions.

And you can use adobe while using Ubuntu at the same time.


Catalyst control center settings not loading on startup

Same problem here, with Ubuntu 12.04TLS amd64, on a AMD A10 with integrated AMD Radeon HD6670 video and a AOC 23" monitor connected via HDMI.

I had the same monitor on a 32bit 12.04TLS Ubuntu on a much older AMD CPU and its integrated video card, and the screen used also a part of the panel, but changing the DTV settings in Catalyst Control Center solved it and the settings were permanent.

The main difference I know of is amd64 / 32bit change, but I have no clue as to this can explain the settings not kept upon logout or reboot.

SOLUTION FOUND !
see https://help.ubuntu.com/community/BinaryDriverHowto/ATI -> 5.2. HDTV underscan

Here is what I did successfully :

sudo aticonfig --initial
sudo aticonfig --set-pcs-val=MCIL,DigitalHDTVDefaultUnderscan,0
sudo reboot

enjoy


What are the packages needed for boost headers?

To fulfil all build dependencies, my approach is always to start out asking APT to install them for the version which is in the repositories. Here's how:

sudo apt-get build-dep gearman-job-server

This may install some packages you have overlooked, but it might not install the dependencies if the version you're trying to compile from source has different requirements. I suspect you are just missing packages like libboost-thread-dev and libboost-program-options-dev, which the above command will take care of.

The version of Boost in all supported Ubuntu versions is perfectly fine for your requirement of version 1.39 and up.


How to automatically add '&' after each command in a terminal

Bind adding & and new line after pressing Enter key:

bind 'RETURN: "&\n"'


LibreOffice export compatibility with .doc

Yes you can do this easily using Save as:

Go to File--> Save as .

And there is even support for .docx.

  LibreOffice Writer is capable of opening and saving documents in a number of formats, including the OASIS Open Document Format 1.1 (its default format), Microsoft Word's DOC, DOCX, RTF and XHTML.


E: Error, pkgProblemResolver::Resolve generated breaks while uninstalling Mono

arg! It's just apt-get being silly, you need aptitude to solve problems:

sudo apt-get install aptitude
sudo aptitude -fy remove mono-runtime

That should deal with it.

A resume of the problematics packages:

libgtk2.0-cil this is really a mono dependency. Unless you use Banshee you won't need it.

  CLI binding for the GTK+ toolkit 2.12

  This package provides the atk-sharp, gdk-sharp, gtk-dotnet, gtk-sharp and
  pango-sharp assemblies that allow CLI (.NET) programs to use the
  GTK+ user interface toolkit 2.12, ATK, Pango, GTK.NET and GDK.

  GTK# 2.10 is a CLI (.NET) language binding for the GTK+ 2.10 toolkit

  This package contains the GTK# assemblies

libmono*

Just some mono dependencies, and you want to uninstall it.

All in all, all the packages are easily removable, and I'm actually thinking that they didn't get installed in the first place. You can check using:

dpkg -l libgtk2.0-cil libmono-corlib4.0-cil libmono-system-web-services4.0-cil libmono-system4.0-cil monodoc-manual | grep -v 'ii '

If no package shows, then you can be sure that none were installed in first place and is just apt-get doing your life impossible.


Compare two files line by line and show only difference from file 2

Doing line-by-line comparison using awk, you could do:

awk '{ getline x<"file2" } $0!=x{ print x}' file1

getline x<"file2" reads the entire line from file2 and holds into x variable.
print x when line from file1 differ with line in file2.

Or same but shorter:

awk '{ getline x<"file1" } $0!=x' file2


Clean up output of a command to pipe to notify-send

The script is using ANSI escape codes to colourise output. Getting rid of them is discussed here in general.

If you're able to install packages, ansi2txt from package colorized-logs as mentioned in this answer will strip them out.

Something like expressvpn status | ansi2txt | grep -i connected should give an output you can work with.


All cluster calculations are done with a help of a library like OpenMPI. You can not just take an arbitrary application and run it on several PCs at once.
OpenMPI has excellent Python bindings, you can write all you need on Python + NumPy + SciPy.


1) PulseAudio
We can define an existing AirTunes device (e.g. Airport Express) as an output audio sink for Pulse Audio by installing paprefs  and pulseaudio-module-raop  and running Pulseaudio Preferences:

In the first tab Network Access tick "Make discoverable Apple AirTunes sound devices available locally".
As soon as the device is registered in the local network we can switch to this device from Sound Settings:

Choose the name you have registered your AirTunes device (e.g. "Wohnzimmer" in this example). Note that we can not switch the output while a media player is streaming to our soundcard. Pause or stop your player before changing output sinks. Streams will have a delay of about 3 to 4 seconds.

2): VLC
The vlc  media player claims to be able to stream audio via the RAOP protocol directly to an AirTunes device. However so far I was unable to achieve this with VLC 2.0 so I can't give you directions here.

3) Stream2ip
After downloading and installing the DEBIAN package for stream2ip the application needs to be set up for streaming to the Air Tunes device by running Preferences from the man window:

Select the device Airport Express and type in the IP (the port is optional) of the device. By choosing Autoconnect and a time interval >0 seconds the application will listen for the AirTunes device on the given IP to connect as soon as the device is ready:

The advantages of stream2ip over simply using Pulseaudio Sound Settings are:

Wait for a device to connect as soon as it is present.
Re-establish an interrupted connection.
No need to stop playback of a running media player to connect.
Restore previous output when the external device is turned off


Install Wine and PlayOnLinux on server environments

If you have an application that needs a desktop environment, you can install a DE from the command line.  The typical package for the GNOME3 desktop on Ubuntu is ubuntu-desktop, but you might be interested in something lighter like ubuntu-desktop-minimal or lubuntu-desktop.
You can install the desktop environment with the following commands:
sudo apt update
sudo apt install ubuntu-desktop-minimal


How to set Display Resolution while having to use "NOMODESET" on boot

I have 4 laptops upgraded with 16.04, and they all behave a little different with what GRUB accepts. The preferred way should be to set in /etc/default/grub

GRUB_GFXMODE=1920x1080x32

with the part after the equal sign the allowed resolutions for your device. Use either c at the GRUB prompt and enter vbeinfo, or run sudo hwinfo --framebuffer from the console in linux to get a list of accepted modes.

Sometimes, even if the screen is a 16:10 1920x1200 or similar, only a resolution of 1600x1200 is accepted, so watch out for this. This is the setting for GRUB. To have it carry over to the booting system, use a line

GRUB_GFXPAYLOAD_LINUX=keep

after that.

For some devices, this (preferred) option has no effect. But for my two problem children, commenting out the GRUB_GFXMODE line, keeping the GRUB_GFXPAYLOAD_LINUX line and using the deprecated option vga= with nomodeset was sufficient:

GRUB_CMDLINE_LINUX_DEFAULT="nomodeset vga=0x35a quiet splash"

sets the tty to 1600x1200 with 24 bit. Use the hex value sudo hwinfo --framebuffer gives you.


How can I check processor flags inside a preseed install?

The problem with not having access to /proc is that you don't have any script access to the sysfs calls required to do the check. What you need to do is to make sure your chroot has access to proc.

You can do this by mounting /proc before your chroot using the late pressed command like this:

d-i preseed/late_command string chroot /target; mount proc /proc -t proc;

And also a second option: remounting proc inside the chroot like this:

mount proc /proc -t proc

in fact if it's an installed system, mount /proc alone would work.


How come my sound won't work on Lenovo ThinkPad x230?

On my X230 Tablet disabling "auto-mute" in alsa-mixer fixes the problem, that there is no sound after one sound was played. Try to plug in headphones and check if there is sound, then it could be the same problem.


How to check whether pciutils are installed in ubuntu or not?

Type in command line apt-cache policy pciutils or dpkg -l | grep pciutils.

If the package is installed, you'd see an output like this:

On the other hand, if the package is not installed, the output would be something like:


How to downgrade gcc version to 4.8 in Ubuntu 18.04

To install gcc-4.8 open the terminal and type:

sudo apt remove gcc gcc-8 g++ g++-8
sudo apt install gcc-4.8 g++-4.8

You can also have multiple versions of gcc/g++ installed alongside each other and select which version to use each time: How to use multiple instances of gcc?.


I would do it in the manual way: from the live installation open gparted. Now you have 2 options.

Use a separed /home partition. In this way you can have the same users, file and configuration in two different OS. You can follow italian instructions from ubuntu-it.org, a good video on youtube or the instructions below.
Do a normal installation.

Personally I prefer the first option. But note that it's better to do it during the installation, so in Ubuntu Gnome it won't work unless you reinstall it or you follow this guide.

If you chose the first one,

resize the first partition removing the extra space,
create two partition, one of about 10/15 GB for the system (e.g. for applications) and one for your personal files (e.g. photo, videos)
open the Kubuntu installer and select other when it ask what type of installation you want to do.
select the partition for the system, click change... and, in the box that will appear, select ext4 with journaling, in the text input type / and press Ok. It will ask you if you want to write changes on disk that are not reversible, say Ok.
select the partition for the system, click change... and, in the box that will appear, select ext4 with journaling, in the text input type /home and press Ok. It will ask you if you want to write changes on disk that are not reversible, say Ok.
if you have a swap (what is swap?) partition, select it, click change...* and, in the box that will appear, select swap and then click on Ok.
Continue the installation as you would have dove with other type of installation.

If you chose the second one,

resize the first partition removing the extra space,
create one partition, both for personal files and application (as your current partition)
open the Kubuntu installer and select other when it ask what type of installation you want to do.
select the partition you created before, click change... and, in the box that will appear, select ext4 with journaling, in the text input type / and press Ok. It will ask you if you want to write changes on disk that are not reversible, say Ok.
if you have a swap (what is swap?) partition, select it, click change...* and, in the box that will appear, select swap and then click on Ok.
Continue the installation as you would have dove with other type of installation.


Ubuntu Desktop 14 on PowerEdge doesn't boot on RAID

SOLVED

Boot into the system on one disk (ie degraded RAID array), and in /etc/default/grub, set:

GRUB_CMDLINE_LINUX=""

to

GRUB_CMDLINE_LINUX="rootdelay=90"

then run

update-grub

Once that's done, reinstall the disk you removed and re-sync the RAID array using the good disk (Should normally do this by default). Then boot like normal. This is apparently a bug in Ubuntu 14.04. They set the rootdelay to low. This appears to effect other platforms as well.

Here is the bug: https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1326199

Cheers


Do you mean the webserver(apache2) goes down? Ubuntu server is an operating system, which has some pre integrated service. I should check the apache2 log file: /var/log/apache2


Migrating from 14.04 to 16.04 on Dell Inspiron 3552

All trials I made to migrate my recently bought Inspiron 3552 to 16.04 were unsuccesfull.

After accepting from Ubuntu 14.04 to upgrade to 16.04, the laptop didn't start correctly any more. With a bootable usb-key it was posssible to "try" ubuntu 16.04, but the installation (although it finished with a report of success) systematically failed, as by the restart the PC was "unable to find any bootable devices". Various attemps were made, including with security boot disabled in the bios, with the same result.

Dell advises to check that your model is suitable for upgrade:
http://www.dell.com/support/article/be/fr/bedhs1/SLN151664/EN
but Canonical do not certify 16.04 on this laptop:
https://certification.ubuntu.com/hardware/201504-18248/
so I think it is not (yet ?) possible to upgrade.
As Ubuntu automatically suggests to upgrade, there is a heavy problem for the user unaware of the potential problem.


In a nutshell: no. At least not without some issues. (I could be wrong).

You probably could purge all compiz packages and then try compile 0.8.6 from source, but I'm not certain it would work seamlessly.


simply add /run/me to your PATH, any script put there could be simply run from any directory

how to PATH from troubleshooters.com
To add directory /data/myscripts to the beginning of the $PATH environment variable, use the following:

PATH=/data/myscripts:$PATH

To add that directory to the end of the path, use the following command:

PATH=$PATH:/data/myscripts

finally

export PATH

to have it everywhere, all the times, for your user only, add these in place the lines in that user's .bash_profile file
all users except root: add to /etc/profile
for root: only possible by root's .bash_profile

my idea for the sake of laziness (not your case of running 'every' script though): add a symbolic link from a single script there to your /home/usr/loca/bin


having trouble installing ubuntu 14.04.2 alongside Windows 7 (64 bit)

i think i may be able to help

goto windows delete the partition you created using partition magic or any software like that keep the space without partition goto ubuntu >something else>take that unformatted volume and make 3 volume >  1) /  ext4   2)  swap atleast same as ram 3)  /boot ext4  100MB  >install ubuntu grub will take care of the rest..if even then it dosent work hich is very unlikely if when you can boot into windows before you started installing ubuntu then maybe its GPT partition problem


Reformat data only drive from NTFS to whatever Linux likes?

Linux works better with a linux drive,

it is faster
you can set ownership and permissions individually for directories and files

I was in the same situation some years ago, and I changed my data partition from NTFS to ext3. Today I would change it to the ext4 file system.

-o-

Edit: I tested again, this time in a small system, installed from the Ubuntu 16.04.1 LTS amd64 iso file and not updated at all only installed into my Toshiba laptop with an SSD connected via USB 3. I created two target partitions, one 'ext4' and one 'ntfs' on the same SSD, and I copied the Ubuntu system on the root partition to these two target partitions (using rsync, so at the file level). I did it twice (and removed all files and directories between the copying). The results were quite similar between the first and second copying test.

I show the result from the second test here, and can confirm that the write speed is more than a factor 2 higher to the ext4 partition compared to the ntfs partition, total time=

1 min 06.35 sec writing to ext4
2 min 31.57 sec writing to ntfs

$ cat /media/tester/ext4/time-used
21.74user 14.54system 1:06.35elapsed 54%CPU (0avgtext+0avgdata 49788maxresident)k
7177888inputs+7351192outputs (5major+30376minor)pagefaults 0swaps

$ cat /media/tester/ntfs/time-used
22.70user 45.40system 2:31.57elapsed 44%CPU (0avgtext+0avgdata 56712maxresident)k
7178480inputs+0outputs (5major+30496minor)pagefaults 0swaps


File system on SD card full when partitioning

After reading the comment by ubfan1 I solved the issue by running the following....

resize2fs /dev/root 3G

which resized that part of the file system to 3GB.


How do I permanently enable mobile broadband on boot?

This problem is subject to a bug-report

Thus, until it is resolved upstream, a work around such as enabling mobile broadband on login will probably have to suffice.

Credit for the answer below goes to one of the bug contributors - if you have any additional information, add your details to the bug-report.  Note - the subscribers dont like "me too" answers so dont just add "me too" - just click the subscribe button for updates.

Enable your broadband by clicking "enable broadband" in the network manager indicator.

In a terminal list the configured connections in your Network Manager:

nmcli con list

This show show the following example output:

NAME UUID TYPE TIMESTAMP-REAL
Tele2 Default 1 93c93207-adce-40e4-beb5-d9f9c830d474 gsm Sat 25 Feb 2012 01:27:42 PM CET
Vipnet connection 1 054bdd1f-34e3-4db1-b18b-d38e885276c8 gsm never

In the example look for your mobile broadband - it will have gsm in the line of text.  In the example above, the first item in a row contains the gsm text and at the beginning of the line is the connection name that you will need below i.e. Tele2 Default 1

Now, create a text file (for example using gedit) that starts one of your connections after a delay of e.g. 10 seconds (maybe you'll need a longer delay if your broadband device needs more time to initialize):

#!/bin/sh
sleep 10
nmcli nm wwan on
nmcli con up id "Tele2 Default 1"

i.e. change Tele2 Default 1 for your mobile broadband name

Save the file as start_my_connection in your home folder.

Next move this file to somewhere you and others using your computer can access:

sudo mv ~/start_my_connection /usr/local/bin/start_my_connection

set the file permissions as follows:

sudo chmod 775 /usr/local/bin/start_my_connection

Finally, configure starting the script after login:

in Startup Applications Preferences add an item and enter the script path (/usr/local/bin/start_my_connection) as the program command.


Reverse Commands Which Disabled Network-Manager?

Since they both should theoretically be root owned to begin with it should be as simple as:

sudo mv /etc/init/network-manager.conf-disabled /etc/init/network-manager.conf
sudo mv /etc/xdg/autostart/nm-applet.desktop.disabled /etc/xdg/autostart/nm-applet.desktop

If they have unexpected permissions, you will have to reverse that too and accept over-writes.


How do I disable the chameleon effect in notifications and the Unity launcher?

Notifications
The chameleon effect can be removed from the notifications but it is quite an involved process involving installing an older version of the notify-osd package, a comprehensive guide can be found here: https://askubuntu.com/a/128508/40955 then the notifications will be the same dark colour as they were in 11.10 (or you can choose a custom colour)
Launcher
The instructions below currently do not work, due to Bug #975350
You can force the launcher to stay one colour and not change to imitate the wallpaper colour by installing the MyUnity tweaking tool from the Ubuntu Software Centre.
When installed navigate to the Launcher tab and click the color bar

Select your preferred colour from the colour wheel and the launcher will remain that colour no matter what the wallpaper colour is.


Python3 + ipython + pylab on Ubuntu 14.04

On Ubuntu 14.04, I could start ipython and then import PyQt5, but if I run ipython --matplotlib qt5, it states pyqt5 is not installed.

I then looked into the code and saw in the file /usr/local/lib/python3.4/dist-packages/IPython/external/qt_loaders.py, that ipython checks for QtCore, QtGui, Qtsvg and in the case of pyqt5 also for qtwidgets.
Naturally, I did have QtCore, QtGui and QtWidgets installed, but not Qtsvg. I ran synaptic and installed Qtsvg for pyqt5 (that is python3-pyqt5.qtsvg). Now it works.

TL;DR: Install the python3-pyqt5.qtsvg package:

sudo apt-get install python3-pyqt5.qtsvg


This is probably caused by Windows 10, the way it shutdown (which in reality is not a proper shutdown).

Quick way to solve it: in Win10, when you do Start -> Shutdown, keep SHIFT key pressed as you click on Shutdown. After that, when you boot into Ubuntu, you should have write access to all your disks and partitions.

If you find yourself in the situation of forgetting to press SHIFT while shutting down, you may want to read this answer to disable the fast startup.


I found the solution myself and I want to share it with you:

In the past, I entered my known hosts only in the /etc/hosts file.
After entering the same into /etc/hosts.allow file everything works fine.


Ubuntu Desktop folders, icons, and files are not visible

Login screen combo Ctrl + Alt + F1 enter username and password then run the following commands:

sudo apt-get install dconf-tools

DISPLAY=:0 dconf reset -f /org/compiz/

unity --reset-icons

setsid unity

and finally reboot


Lenovo IdeaPad P400 - Disabling the annoying requirement for the Fn key to use F1-F12

On my E540 I just press Fn+Esc keys to activate FnLock and F1-F12 works as they should. I'v found it 5 minutes ago.


Google Chrome comes with its own built-in flash player, which is currently at version 17 and regularly updated to the latest version whenever Google Chrome is updated.

For Google Chrome installation instructions see this question: How to install Chrome browser properly via command line?.

You can also install the latest version of Pepper Flash Player (the same flash player that is used in Google Chrome) in Chromium web browser directly from Ubuntu without needing to add a PPA to your software sources by following the instructions in Get latest Flash player on Ubuntu.


Can I set up 2 monitors to be 2 separate Gnome virtual desktops instead of one big?

What kind of videocard are you using? With an nVidia card I would recommend using twinview. Otherwise it should be possible to simply enable xinerama for it to work.


How to scroll in the Terminal app "top"?

I have only one suggestion: use htop instead.

sudo apt-get install htop


adjust max possible volume in pulseaudio

The maximal possible volume level we can obtain from sliding the volume control to more than 100% is approx. 153% above the normal peak limit. Provided we had set the ALSA volume with alsamixer to 100 these 100% are the level above which audio will be clipped or distorted. This also will happen when amplifying to 153% with the slider.

Nevertheless is is possible to further increase this level by setting the sink level using the follwing command in a terminal:

pacmd set-sink-volume <sink> <value>

Replace <sink> with your sink name or sink index as given from:

pacmd list-sinks

The lower limit for <value> obviously is 0, a linear volume of 100% is a value of 65536, anything higher will be further amplified. A value of 512000 will thus lead to an overamplification of 781%.

This is a very crude method to amplify sound output of varying level as overamplifying will lead not only to clipping and ugly distortion but may also damage your speakers.

Therefore it would be a better way to normalize your audio output. See the following question on how to do this with pulseaudio:

Automatically adjust the volume based on content?


kernel update failed using apt-get dist-upgrade

According to the picture the system can't boot because the kernel is unable to mount the root filesystem on sda7.

The most likely cause is that grub isn't properly configured for the new kernel. Boot from the old kernel, open a terminal and type:

sudo grup-update

If this doesn't help you, we will need some more info about how are the partitions layout in the old kernel. Please, post the output to those commands:

df

cat /etc/fstab

This error could also be caused by a problem in the initramfs, a small file that contains the drivers that the system need to boot. You can recreate it with the following command:

sudo update-initramfs -u -k 2.6.38-10-generic

Note that 2.6.38-10-generic should be the name of the kernel that doesn't boot. Be careful with this.


Can't access to Outlook or OneDrive online on Office365 on Firefox

Funnily enough the problem fixed again by itself after a while. I just installed Microsoft Teams for Linux form the Snap shop and now works.

PS/ Anyhow, I would love to know what was going on, so I really appreciate if anyone can answer.


unable to edit /etc/hosts file in ubuntu 14.10

If sudo and its graphical derivates gksu and gksudo are not working any more, the easiest solution is to use pkexec instead to open a command-line editor like nano and correct the wrong entries in the specific configuration files (like /etc/hosts or /etc/sudoers).

Note that pkexec works for terminal applications, but needs special configuration to run GUI programs. Therefore you need to use nano instead of gedit, mousepad or whatever your default editor is...


Why did the Ubuntu GNOME logo change in 15.10?

There was some discussion on the Ubuntu GNOME mailing lists about somebody selling Ubuntu GNOME for $30. One of the follow-up emails was from Patrik Bubák, an Ubuntu GNOME dev, who said:

  As far as the logo is concerned, borrowing GNOME's was a mistake from
  day 1. It's highly confusing, and due to its complexity difficult to
  work with, plus using someone else's logo as our own isn't quite all
  right, even though certain permissions have been given it will never
  be clear unless it's completely changed, which it will, soon.

Related:

Page on Behance.net by Patrik showcasing the new logo
Announcement of the new artwork on the mailing lists


Solved:
mysqld.sock is created when mysqld starts / while it is running (it's a socket!).


UbuntuOne Control Panel can't change login

If you can't change the details from the Control Panel,
you have to completely remove and reinstall the Ubuntu One client.


Apple wireless mouse and keyboard does not work

This is a known bug, and has been for about 2 years now, unfortunately:

https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/1001825

http://ubuntuforums.org/showthread.php?t=1874245


Excessive Power Consumption by ethernet socket

Well I have discovered what was causing my problems. Firstly it seems that PowerTop is misreporting power usage, the numbers never seem to add up, even after resolving this issue they still don’t.

It turns out that this issue was due to the recent update of the Intel drivers via the Intel Graphics installer. I also had Nvidia drivers and Nvidia Primus for my Nvidia card and it seems somewhere along the way they were either conflicting or had messed each other up.

Firstly I removed the Intel Drivers following the instructions in this Ask Ubuntu answer

This downgraded my drivers but didn’t completely resolve the issue. It seemed that my Nvidia card wasn’t completed being turned off, so I removed all the Nvidia drivers using:

sudo apt-get purge nvidia*

Then I installed bumblebee instead following the instructions in this Ask Ubuntu answer

Once that was done I rebooted and my Nvidia card was definitely off and my power usage was back to normal.

Ethernet power usage still seems high even at 3W, especially as I was using wifi at the time, but I think that PowerTop is just reporting it wrong. Apologies to anyone who spent time on this, I should have realised it was the graphics drivers but PowerTop threw me.


Is /etc/resolv.conf a symbolic link, and are changes to it persistent?

No no no. You don't manually edit /etc/resolv.conf.

To enter your own DNS addresses, go to the Network icon in the top panel, and select Edit Connections. Open the profile for the network where you'd like your own DNS servers defined.

Select the IPv4 tab. Set Automatic (DHCP) addresses only, and a comma-separated list of DNS servers into the DNS servers field.


Ubuntu touch mobil phone browser htaccess not accepted

Unfortunately, there is nothing you can do. Basic Auth is not yet supported in the browser. This is reported as a bug already. When it is fixed and an updated image has been pushed out to the image updates server, you will be able to then use the browser to access sites requiring Basic Auth.


Lock screen with gnome-screensaver-command as root (from /etc/pm/sleep.d script)

You need to export DBUS_SESSION_BUS_ADDRESS of the remote machine in your ssh before using dbus commands

You have to find it locally on the machine to which you want send commands remotely by typing the command:

set | grep DBUS

This will give you the shells current DBUS_SESSION_BUS_ADDRESS value which you should export in your ssh shell after connecting to the remote machine and then enjoy.


How to set up a WiFi Hotspot using Kubuntu 12.04

Click on NetworkManager icon in the tray.
Press 'Manage Connections'
Go to Wireless Tab
Press 'Add...' button but choose 'Shared'

Everything is ready, I've connected to this connection from the network manager but I dont know if that is important.


If you want GNOME Flashback (fallback), run this.

sudo apt-get update && sudo apt-get install gnome-panel gnome-flashback gnome-session-flashback indicator-applet-appmenu

You will then have options for either GNOME Flashback (Metacity) and GNOME Flashback (Compiz) available when you logout and get back to the login screen.


bison: extra operand curl. How to fix this?

Your command calls bison which doesn't take more than one operand.

I guess your goal was to install bison, build-essential, curl etc.

You forgot apt-get install in front:

sudo apt-get update
sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop maven openjdk-7-jdk openjdk-7-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev


Next steps could be:

In terminal:

mysql

In mysql shell:

use mysql;
select user,password,host from user;
update user set password=password("newpassword") where user=root;
select user,password,host from user;
flush tables;
FLUSH PRIVILEGES;
quit

In terminal:

kill -15 `pgrep -f 'skip-grant-tables'
service mysql start
mysql -u root -p


The Dash is the menu. The icon in the top left of the screen. Press the Windows Key, it should open it.


Does apt-get autoremove remove intel graphics drivers?

To focus on your past experience, if autoremove is going to remove "more than you intended", it's only doing that because those packages are no longer depended upon. That happens when you accidentally remove something :)

A common example from the good old days would be removing something Compiz-related. apt-get would show you a list of Compiz packages it was going to remove and you'd miss that ubuntu-desktop was also in there. ubuntu-desktop is just a meta-package that depends on all the packages that make up the desktop so removing it doesn't directly remove anything...

... But when you do an subsequent autoremove, all those things that ubuntu-desktop was the sole dependency... They're going bye-bye.

A few lessons:

sudo apt-get remove <package> will warn you what it's going to remove directly. It won't notify you about knock-on effects.
sudo apt-get autoremove should also warn you what it's going to do.
Use apt-get -s autoremove to do a simulated dry run if you're unsure. You can use that on all apt-get commands.
If you reboot and you're staring at TTY1 wondering what the monkeys you've nuked this time, /var/log/apt/history.log should have you most recent activity.
If in doubt, check ubuntu-desktop is installed.
Is autoremove safe? It's heavy machinery so it's only as safe as the driver... But that said, it's hard to do permanent damage.


If you do it from tty, you should provide DISPLAY env variable
lol4t0@lol4t0-nix:~$ DISPLAY=:1 xinput
Unable to connect to X server
lol4t0@lol4t0-nix:~$ DISPLAY=:0 xinput
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SYNA8006:00 06CB:CD8B Touchpad            id=11   [slave  pointer  (2)]
⎜   ↳ TPPS/2 Elan TrackPoint                    id=15   [slave  pointer  (2)]
⎜   ↳ SYNA8006:00 06CB:CD8B Mouse               id=10   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Intel HID events                          id=13   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)]
    ↳ sof-hda-dsp Headset Jack                  id=12   [slave  keyboard (3)]
    ↳ Integrated Camera: Integrated C           id=9    [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=16   [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]


Change hostname to avoid broadcasting as ubuntu.local during install

Everything relevant to hostname happens in the initrd.lz file of the iso (at least for 16.04). This is a cpio.lzma file. I don't know if it is meant to be changed.

First step, HOST and USERNAME are set to some value in scripts/casper at line 24.
You can change the value of HOST in etc/casper.conf in the initrd.lz
Second step happens in scripts/casper-bottom/18hostname where the final /etc/hostname is defined and hostname command is called.


Never run commands from the terminal prompt unless you're 100% sure what they do, before running them. You didn't say what your ran, but it really doesn't matter at this point, because you have too many problems. I'd recommend that you backup any important data, and just reinstall Ubuntu. If you do it right, it'll keep your existing home directory... but backup just in case something goes wrong. Cheers, Al


Can I use mouse click to focus on Byobu splits?

Yes, this is very much possible.

You simply need to turn on mouse support in your ~/.byobu/.tmux.conf configuration.

Add the following:

set -g mouse-select-pane on
set -g mouse-select-window on
set -g mouse-resize-pane on
set -g mouse-utf8 on

This will allow you to:

select a split by clicking in it
select a window by clicking on it in your status bar
resize a split by grabbing the border and dragging

However, you may now find it difficult to use your mouse to click on some text, and highlight (select) it.  To do this, you'll now need to use either Shift-LeftClick or Ctrl-LeftClick.

Full disclosure: I am the author and maintainer of Byobu.


Is there a way to move the unity launcher 'show' edge on multiple monitor setup?

Sounds like a bug!

The detailed multi-monitor design is being worked out now, for 12.04 LTS. You might want to take a look at the proposed design as soon as a draft is available. Check design.canonical.com for news, or hop into #ubuntu-design to see if a draft is available.


I found the solution. I just installed some updates that I were skipping all the time. Now everything is fine.


Install Node.js

On the app server, let's update the apt-get package lists with this command

sudo apt-get update

Then use apt-get to install Node.js build dependencies:

sudo apt-get install -y build-essential openssl libssl-dev pkg-config

The next step is download the source code for the latest release of Node.js.

Go to the Node.js Downloads page and find the Source Code download link. Right-click it, and copy its link address to your clipboard. After that download using wget like

cd ~
wget http://nodejs.org/dist/latest/node-v0.10.33.tar.gz

Now extract the tar archive you just downloaded with this command:

tar xvf node-v*

Configure and build Node.js with the following commands:

./configure
make

Now, to install Node.js, run this command:

sudo make install

If you want to delete the Node.js source code that you downloaded, change to your home directory and use this rm command:

cd ~
rm -rf node-v*

The Node.js runtime is now installed.


Wireless Driver for HCL ME (Realtek rtl8191sevb)?

There is a Ubuntu forum post here wireless disconnects periodically (RTL8191SEvB Wireless LAN Controller (rev 10)) which deals with your problem however I would try this first

rmmod r8192se_pci

then

modprobe r8192se_pci hwwep=0

if this doesn't work then reboot and everything will be back to normal if it works then you can add it as a permanent fix to /etc/modprobe.d/realtek.conf

and add this line

options r8192se_pci hwwep=0

Hope this helps


How to remap CapsLock key to Ctrl in Xubuntu

OK, my problem was because of xfce4-xkb-plugin. It was resetting xkb settings each time. I just installed xxkb instead of it, and now everything works absolutely fine!