Need bash script output on one line - curl and >> produces 2 lines

Here's one way:

#!/bin/bash

mydate=$(date '+%Y-%m-%d %H:%M:%S')
myip=$(curl http://checkip.amazonaws.com?newline -s)

printf '%s %s\n' "$mydate" "$myip" >> /home/test_a5gh/Pub_IP.txt

FYI, you don't need sudo to chmod files you own in your own home directory.


File copy operation hangs on Kubuntu 12.04

Try to copy via terminal,

cp -Riv /path/to/the/directory/which/contains/movies /path/to/the/directory/you/want/to/paste/the/movies


Hint: When you get Unable to Locate Package xxx, goto https://packages.ubuntu.com and search for the package name. You'll find in your case that gddrescue is available under universe. Thus, we need to add it. Try the following:

sudo add-apt-repository universe
sudo apt update
sudo apt install gddrescue


0MB Free Space in partition when setting up Ubuntu/Win10 dual boot

The guide glossed over the "shrink the C drive".  Do that from Windows, defrag the drive, then shrink the partition from the right (from the end), then run chkdsk on it a few times to ensure things are OK.  Free up at least 20-30G for Ubuntu, and at least 2G for swap.  With this space left free, the installer should use it to create a root and swap.

The comment about "not creating a separate partition for your files" just means that a separate /home will not be created separate from root.  Some people prefer to keep their files separated that way, but really, you would use a separate data partition, mounted in your home so the "hidden" config files in your home will be associated with the root, and it's installed versions of programs.


How to Reset OpenVPN password in ubuntu 16.04?

If you have forgotten the password for this user on your OpenVPN Access Server you can reset the password for the "openvpn" user on the command line with :

passwd openvpn

Please note that you can not and should not use the "root" user credentials to login at the Admin UI.

Source from openvpn.net


wget is intended to fetch (=get) files (it is a "non-interactive network downloader" as stated in the man page.

You need a text based web browser, such as links2  (my choice) or lynx , or w3m .


How to change the day of the week Logrotate shifts the file when configured weekly?

Changing the time of running weekly cron jobs won't help, for the reasons you stated.

Note what the manpage of logrotate says about weekly rotation:

   weekly Log  files  are  rotated if the current weekday is less than the
          weekday of the last rotation or if more than a week  has  passed
          since  the  last rotation. This is normally the same as rotating
          logs on the first day of  the  week,  but  it  works  better  if
          logrotate is not run every night.

That's why it tends to rotate on Mondays.

What you can do, is to run a special, separate instance of logrotate on Wednesdays, which only runs for the Google logs. For example, create /etc/logrotate-google.conf, containing the configuration you have specified, and create a cron job that runs on Wednesdays (as root, so use /etc/crontab, or /etc/cron.d):

46 6 * * 3 root logrotate /etc/logrotate-google.conf


shutdown: Unable to shutdown system from root shell (init=/bin/bash). (ubuntu 14.04)

First you must activate the magic SysRq option:

echo 1 > /proc/sys/kernel/sysrq

When you are ready to reboot the machine simply run the following:

echo b > /proc/sysrq-trigger

Source.


Symlinks no longer recognised as standard home subfolders

The problem wasn't about mounting or symlinks. I found that somehow my ~/.config/user-dirs.dirs file contained blank entries for the standard subfolders. When I set them to the correct values, logged out and logged back in, the subfolders appeared as they did before.

References:

Why can't I delete the default "places" in files?
https://freedesktop.org/wiki/Software/xdg-user-dirs/ (the proper name for the standard home subfolders)


You, or someone using your computer, has installed Jitsi Meet, a videoconferencing application. The user(s) are created with the application's installation. You need them to use the software.


The package virtualbox  maintained in the Ubuntu multiverse repository will install version 4.3.10 in Ubuntu 14.04 LTS, and version 4.3.18 in Ubuntu 14.10.

We can also add the Oracle repository for recent releases and upgrades.

The application version that will be displayed by our package management will be the major release (which is 4.3. at present). Sub-release numbers may not always be displayed.

Packages for older releases are available for download from Oracle Virtual Box Old Builds (choose Ubuntu 13.04 packages for 14.04 or later until a new host platform was built).


Apt returning 404 error on apt-get install

Given the source entry:

deb URI CHANNEL [SECTION]

Apt will look at:

URI/dists/CHANNEL/Release for release information
Use URIs from the Release information for the Packages file (typically URI/dists/CHANNEL/[SECTION/]TYPE-ARCH/)
Use URIs from the Packages file for the actual packages (typically URI/pool/SECTION/*/)

You made a rather confusing situation by using the CHANNEL in the URI. That is, where one would usually see

http://myrepo.blah.com/repo1/ubuntu

You have used

http://myrepo.blah.com/repo1/lucid

So the complete source line would be:

deb http://myrepo.blah.com/repo1/lucid lucid

You can verify this by using the --print-uris option with apt:

apt-get update --print-uris


'.desktop' file doesn't show up in 'ls' command list

Instead of editing the .desktop file located at /usr/share/applications/ (can cause many issues, will be overridden after an upgrade of the associated package) you can first copy the file and paste at ~/.local/share/applications/. Then edit the copied file using gedit, sudo is not required.

Why ls doesn't list down the file:
ls lists the actual filename.desktop whereas Nautilus shows the name of the application as per the Name= field in filename.desktop. These two can be different. Here in this case Name=Visual Studio Code in the filename.desktop, but filename may be something completely different.


how to edit this rules of iptables to cover all ports?

Simple remove --dport from command

Example

sudo iptables -D tcpsyn -p tcp --dport 80 -m limit --limit 5/second --limit-burst 40 -j RETURN

then add rules

sudo iptables -N tcpsyn
sudo iptables -A INPUT -i eth0 -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j tcpsyn
sudo iptables -A tcpsyn -p tcp -m limit --limit 5/second --limit-burst 40 -j RETURN
sudo iptables -A tcpsyn -p tcp -j DROP
iptables -I INPUT -m connlimit --connlimit-above 40 --connlimit-mask 40 -j DROP

UDP do not have tcpsyn Simple add number of simultaneous connection. You can create new chain

sudo iptables -N udp

then add rules to chain

sudo iptables -A udp -p udp -m limit --limit 5/second --limit-burst 40 -j RETURN
sudo iptables -A udp -p udp -j DROP

Should be work.

EDIT 1

Rule to allow specific ip

iptables -I INPUT 1 -s xxx.xxx.xxx.xxx -j ACCEPT

Rule to allow specific ip to access to specific port

iptables -A INPUT -s XXX.XXX.XXX.XXX -m state --state NEW -m tcp -p tcp --dport 33332 -j ACCEPT

Rule to allow access to specific port

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 33332 -j ACCEPT

One rule for more ports

iptables -A INPUT -i eth0 -p tcp -m multiport --dports 22,80,443 -m state --state NEW,ESTABLISHED -j ACCEPT

-A mean append or add like last rule. IPtables go from top to the end and stop on first rule match. You can use iptables -I INPUT XX XX is number to place rule in chain.


An easy and economical method to accomplish this is:

cut -c 16- hostname.txt > altered_hostname.txt

The magic section of this simple cut command is in these 2 options:

-c,   --characters=LIST
       select only these characters
 N-    from N'th byte, character or field, to end of line


rtl8822be wifi driver ubuntu 20.04 hp 15-da1009ne

A guy called mid-kid has a GitHub repository with the RTL8822BE driver that works flawlessly in Ubuntu 20.04 for me.
Here's how to setup the driver:
sudo apt install build-essential git
git clone https://github.com/mid-kid/r8822be.git
cd r8822be
./make

# remove the misbehaving rtw88 module
sudo rmmod rtwpci rtw88

# install the r8822be module
sudo ./make install
sudo modprobe r8822be

The WiFi card should be active now.


"Server-side JavaScript" usually refers to Node.js (or the Node fork, io.js, which is being merged back into the Node project).

What is Node.js?

On its own, Node is not a server. It also isn't a language. At its core, Node is just an environment in which you can run JavaScript code. They've taken Google's open source V8 JavaScript engine (which is used in Chrome) and separated it from the browser so you can run JavaScript outside of a web browser.

Node comes bundled with some neat tools to help you interact with the filesystem and HTTP requests. There's also a huge repository of third-party modules available through npm.

Further reading:

About Node.js
Node.js on Wikipedia

Setting up Node.js on Ubuntu

There are several ways to get Node working on Ubuntu, each with pros and cons.

Install from the official repos

How: sudo apt-get install nodejs
Pro: It's easy
Con: The package is always badly out-of-date
Con: Lots of scripts expect to find node in your path, but Ubuntu uses nodejs so you have to create aliases.
Con: You install with sudo which means that globally-installed third-party packages from npm also have to be installed with sudo. Sketchy.

Install via the NodeSource repository

How: Follow these instructions
Pro: Your Node will be up-to-date
Pro: This is the semi-officially recommended method of installation
Con: You still have to use sudo to install other modules

Install via the Node Version Manager

How: Follow these instructions
Pro: Installs in your home directory, so no weird permissions
Pro: Easy to keep node up-to-date, or even run multiple version of Node
Con: Node is tied to your user account, which isn't great if you're setting up a production server
Con: It's your responsibility to keep Node updated

Creating a Server

Remember that Node itself is not a web server, however it comes with lots of handy tools for building web servers. Without any additional packages, you can save this example server (taken from the Node.js About page) as server.js and run it from the command line with node server.js (or nodejs server.js, depending on how you installed Node).

var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, "127.0.0.1");

console.log('Server running at http://127.0.0.1:1337/');

However, unless you were hoping to send plain-text responses, you'll probably want to look into a more robust solution such as Express.

Any further training at this point really depends on what you want to do with Node (and things become much less Ubuntu-specific). NodeSchool has great tutorials on everything from the basics and managing packages to web servers and databases.

And finally, a few popular packages to help you solve common problems:

socket.io for handling real-time interactions with web sockets
Passport for authenticating users
Mongo for data storage in a document-oriented (NoSQL) database


Windows open second from top when I use hotkeys

I figured it out.
Just install Compiz Config Manager

sudo apt-get install compizconfig-settings-manager

Then open it and go to General Options > Focus and Raise Behaviour
Under Focus prevention level select off.


I guess you need to disable the systemd service serial-getty@ from /lib/systemd/system/serial-getty@.service

This is what trigger the other service leading to /dev/tty<…> creation for serial communication.

We don't have a full solution yet on snappy ubuntu core side, but you probably can hack around a systemd service in /etc/systemd/system/ doing this masking until we get proper support in the plateforme itself.


View thousands of pdf files one after another from a list

Given a file with a filename per line, you could use this command:

while read file; do xdg-open "$file"; done < files.txt

You can replace xdg-open by the program of your choice, such as evince or okular.

If the PDF files are mainly text, you can also consider using the pdftotext command to convert PDF files to text files. In that way, you can use any text editor to review the contents. gedit and kate support tabs for example. Example:

while read file; do pdftotext "$file"; done < files.txt

This converts a PDF file such as foo.pdf to a text file, foo.txt.

For more details on the command invocation of pdftotext, see its manual page pdftotext(1).


You are doing it right, your problem is when you run ./configure, your user needs more permissions!
In this case the best way is just run it sudo ./configure and enter your password.
It will run your command as an administrator which solve your problem with permissions.

This word sudo will be often used if you want to be comfortable with command line.
Please comment if it doesn't work.


Getting HDTracks music download application working under wine in Ubuntu 14.04 64bit

I have been able to get the application working on a 32 bit Ubuntu but not on 64 bit.

Because I'm not really interested in having a bunch of Winjunk on my system, I make the purchase on Linux and then find a Windows PC I can use to do the download.

It appears that HDTracks is not the only organization to use this download application, made by JRiver.  I question the worth of it but anyway...


How to run/install Adobe's Illustrator cs6 and Photoshop and Flash and InDesign on Ubuntu?

Wine (Windows Compatibility layer) is a software that gives you the possibility to run Windows software in Linux and OSX.

This of course doesn't mean that every Windows software will work, specially those that require Windows features only available in, well... Windows.

According to Wine's app database:

Adobe Illustrator CS6 is rated Silver, meaning it works but up to a certain degree of functionality. (more info)
Adobe Photoshop  CS6 is also rated Silver (more info)
Flash Professionnal CS6 is rated Silver,  (more info)
Adobe InDesign CS6 is rated Bronze, meaning it runs but it's highly unstable, (more info)

If you want to use the Open Source alternatives to these softwares:

Inkscape, is a free Vector drawing program to install it: sudo apt-get install inkscape
GIMP, Pinta are free alternatives to Raster graphics editing software such as Photoshop to install any of them: sudo apt-get install gimpor sudo apt-get install pinta
Synfig Studio is an animation software resembling Flash to install it download it from their site and select the corresponding DEB file.
Scribus is a DPT, a Desktop Publishing Tool much like InDesign to install it: sudo apt-get install scribus


Aside from the non-variabled paths, there are probably other things wrong with this set of scripts.
This is not a proper recreation of how RHEL implements rwtab.

/etc/systemd/system/rwtab.service

[Unit]
Description=Configure read-only root support
DefaultDependencies=no
Conflicts=shutdown.target
Before=shutdown.target emergency.service emergency.target systemd-tmpfiles-setup.service local-fs.target systemd-random-seed.service
After=systemd-remount-fs.service

[Service]
ExecStart=/usr/local/sbin/rwtab.sh
Type=oneshot
TimeoutSec=0
RemainAfterExit=yes

[Install]
WantedBy=local-fs.target

/usr/local/sbin/rwtab.sh

#!/bin/bash

mount -n -t tmpfs none
mkdir -p /tmp/rwtab/ro
mkdir -p /tmp/rwtab/rw
mount --bind --make-private / /tmp/rwtab/ro
mount -n -t tmpfs none /tmp/rwtab/rw
for path in $(sort /etc/rwtab); do
    mkdir -p /tmp/rwtab/rw/${path%/*}
    #rsync -a /tmp/rwtab/ro/$path/ /tmp/rwtab/rw/$path
    #mount --bind /tmp/rwtab/rw/$path $path
    cp -av /tmp/rwtab/ro/$path/ /tmp/rwtab/rw/${path%/*}
    mount -v --bind /tmp/rwtab/rw/$path $path
done
umount /tmp/rwtab/*
find /tmp/rwtab -xdev -empty -delete


How do I drag and drop a file from Nautilus into a minimized window icon on the Unity taskbar?

While dragging the file, hold the "windows"-button, then press tab until the wanted window is selected on the sidebar, then release the "windows"-button. The wanted window will be restored to the screen; you can then simply drop your file.


enable to found version for ndiswrapper!

There is a GUI application for Manage ndiswrapper called ndisgtk.

So install following :

sudo apt-get install ndisgtk ndiswrapper-common ndiswrapper-dkms ndiswrapper-source ndiswrapper-utils-1.9

You can install the driver wtth :

sudo ndiswrapper -i <DRIVERNAME>.inf

BUT

TP-Link gives Linux drivers. With NDIS you installs Windows drivers. So search in http://www.tp-link.com/ support section for Linux drivers for your Card. Be pricise for the card name. There are several cards. You can find it by command lsusb

Or

You can install them from Official Ubuntu repository by installing following packages.

sudo apt-get install collectd-dev collectd-core collectd-dbg jockey-common inux-image-3.2.0-23-generic


Problem bluetooth with Logitech t651 on ubuntu 12.04

I've met a same problem, and solved using commandline tools.
Please refer Bluetooth from the command line in 12.04?

My successful steps here:

Open a terminal.
Get your bluetooth dongle device id by running: hciconfig

For example, you can get hci0.
Get T651's adress by running: hcitool scan
Run following command:

bluez-simple-agent [BT dongle id] [T651's address]
Enter the pin code: 0000
Now T651 is connected.
Click BT icon on the menubar in desktop, and turn on the switch of T651.


You need to convert the .cur files to xcursor (X11 cursor) format. You can do it e.g. with the little python tool win2xcur.
See this and/or this question on how to create (and use) your custom theme. See also the freedesktop specifications for th cursor file names.


What is the best directory to install a Bash Script?

If you intend to make it available to all users, you should place it to /usr/local/bin, excerpt from below answer.

  /usr/local/bin is for normal user programs not managed by the distribution package manager, e.g. locally compiled packages. You should not install them into /usr/bin because future distribution upgrades may modify or delete them without warning.

Taken from usr-bin-vs-usr-local-bin-on-linux


Your /etc/grub.d/10_lupin contains an error in line 26:

data otdir="${prefix}/share"

should be

datarootdir="${prefix}/share"

To restore that file just reinstall package lupin-support

sudo apt-get install --reinstall lupin-support


Best way to update files on production server from development server

You can certainly create your own apt repository and configure your production server ot use it. You do NOT need to post your debs in a public ppa (i.e., Ubuntu archive).

This wki page gives you the basic steps to create a deb repository and how to update it when you put new versions of packages in it.

The guide is about creating a local, disk-based repository. In your case I would guess you want to make it available for remote consumption - you can do that by just exposing the directory in apache2.


Configuration for green tty's foreground and boot text after grub menu

If you take a look through /etc/init folder, the command responsible for bringing up TTY is getty. For each TTY there is a *.conf file in /etc/init , so if you want colorized prompt on every TTY, you will have to edit every single one of those files.

Now, the file responsible for the contents of that appear on the screen before logging in is /etc/issue, however, getty allows specifying custom issue file with -f flag. You can either do that, or edit original /etc/issue file. Be aware that this file will be overwritten with the next upgrade to newer Ubuntu release.

As for colorizing that text, it's pretty easy: use \[ escape sequence and the code for non-print character.

In particular , to make the prompt green, do this:

sudo bash -c 'echo -e "\033[1;32m My Laptop \n \l " > /etc/issue '

Why not sudo echo ? Because redirection is done by the shell,and unless you are logged in as root, your shell doesn't have permission to write to root-owned file (same as explained here).

Why not add \033[1;32m manually ? Because then it's treated as text.

Here's hexdump before and after editing file

CURRENT DIR:[/home/xieerqi]
$ echo -e "\033[1;33m TEST MESSAGE" > issue2

CURRENT DIR:[/home/xieerqi]
$ hexdump -c issue2
0000000 033   [   1   ;   3   3   m       T   E   S   T       M   E   S
0000010   S   A   G   E  \n
0000015

CURRENT DIR:[/home/xieerqi]
$ nano issue2

CURRENT DIR:[/home/xieerqi]
$ hexdump -c issue2
0000000   ^   [   [   1   ;   3   3   m       T   E   S   T       M   E
0000010   S   S   A   G   E  \n
0000016

In simple words, we want special characters there , not just text

/etc/issue is root owned, so you will need to edit it with gksu gedit /etc/issue or sudo nano /etc/issue. You can use any text editor, but the point is - you need  sudo.

Once done, restart TTY1 form another terminal by running sudo service tty1  restart or if you are on 15.04 sudo systemctl restart tty1


Change the language of the system in Ubuntu Mate

That's actually two questions.

To change the folder names, open a terminal window and run this command:

xdg-user-dirs-update --force

If you want the dates etc. in English, and not only the display language, you can open Language Support again and select an English option in the Regional Formats tab.


No permission to /var/www/ folder even though root

Apache and similar server programs are usually not run by the root user since this could lead to a security leak if they contained a bug.

It is recommended for web pages (that are not modified by Apache) to be owned by root and have the read permissions for everyone but it does not allow the server to modify the contents.

Apache is usually run under the user www-data. To allow write access to your /var/www, you should change the ownership of the relevant data. You should limit the access to the folders you really need to modify using the server.

sudo chown -R www-data:www-data /var/www/<relevant subfolder>

To your particular questions:

  If I change the owner or group of the folders/files, will the "root" owner/group be removed, meaning they have no further access?

As long as you keep the read permissions for everyone, everyone can read them. The ownership by root is generally the most restrictive one.

  Is it possible to allow multiple groups and/or users specific permissions such as in Windows or can I only assign a single owner and a single group?

If you need multiple users to have specific permissions, you have to create a group for them in Linux.

  What If I want to have the following setup: …

This is a very specific setup and you should ask another question if it’s not just a theoretical problem. You might want to get some information about ACL first.


Cannot seem to be able to resolve tzdata installation error problem

It looks like there is something wrong with your perl configuration. Try command sudo dpkg-reconfigure perl-base then try apt-get again. If it doesn't work please post the output of both commands here.

Edit

Based on your answer - your Perl installation is missing essential files and this is preventing the package manager to fix it.

Have you tried installing perl from source or something similar?

I need more info:

What is your ubuntu version: cat /etc/issue
What is your architecture: uname -a
What is in your system perl directory: ls -l /usr/share/perl

Also check out this answer and see if somehow your perl program is looking at the wrong place.

Also try creating a brand new user with sudo rights, log-on as that new user and try again - just in case the problem is something specific to your user rather than systemwide.


I think you should not use addresses out of range: address 10.100.200.300 is not valid, every octet can be in range 0 to 255 only.


Creating ISO images from already installed Ubuntu Server 16.04 & 14.04 on commandline

It should be super easy using dd...

sudo dd if=/dev/mydrive of=image.iso

You could also clone one drive to another like this:

sudo dd if=/dev/mydrive of=/dev/myothersd

Just be careful. "if" is the input file and "of" the output file. Messing up these values could nuke your system. Make sure you know what drive is what using:

sudo fdisk -l

when you figure out what drive you want to use your command will look something like this (to clone the entire drive):

sudo dd if=/dev/sda of=mydrive.iso

DO NOT just copy and paste the above command or any dd command. When using dd ALWAYS confirm correct drive paths!

An example of cloning a partition, looks like this:

sudo dd if=/dev/sda1 of=mydrive.iso

For more information, check out the manpage

man dd

Note: When using dd, it gives you no progress or output while it's doing its thang. It will take a while and show no progress, don't worry, just wait.


How does synching with the Ubuntu Keyservers work? (Seahorse)

If you want to import keys, you will instead need to select the Remote > Find Remote Keys... option, which looks like this:

Enter the desired search string (usually an e-mail address or fingerprint) and then click Search. You will then be shown a list of keys:

From there, select the key you want to import (making sure to inspect the key first to make sure the fingerprint is correct!). Then, hit Import to grab the keys.

If you don't see the keys immediately, it's likely you're hiding keys you don't control. To show all keys your system is aware of (and not just keys you control), go to the View menu item and select Show any.

You, instead, synchronized your private keys. By doing this, you published your key records to keyservers. By doing this, you have just made your public PGP key much easier to find in the wild, as anyone can now search for your key by e-mail, fingerprint, or other methods.

Once you publish a key, you can not take it back. Keyservers will exchange keys (and others will download keys) to decentralize the system so that one keyserver being compromised or taken down does not break PGP. These keyservers will also handle key trust, and will carry records of PGP key signatures made by other people.


Go to CCSM (compiz Configuration Settings Manager) then go to the OpenGL plug in and then uncheck Sync to Vblank.

Then go back and on the Composite plug in uncheck Detect Refresh Rate


Try deleting your partition. You can do this by clicking -(minus) icon.

Then, add your partition You can do this by clicking +(plus) icon. and re size it so that you can leave certain space for making one partition into bootable and another for primary.


You could use Master PDF Editor, or FoxitReader to do this. The first, will grant to you more functionalities, like objects manipulation, similar to PhantomPDF from Foxit.


Assuming it's true that name service doesn't work, here is a generic procedure which fixes a couple of known bugs.

Is resolvconf installed?  If so then do the following.

sudo dpkg-reconfigure resolvconf

If it is not installed then do the following.

sudo apt-get install resolvconf

Now that resolvconf is installed correctly, reboot so that resolvconf will be provided with nameserver information.

If name service is still broken and you are using NetworkManager to manage networking then open /etc/NetworkManager/NetworkManager.conf in an editor and comment out the line "dns=dnsmasq". To comment it out, put a '#' character at the beginning of the line.

gksudo gedit /etc/NetworkManager/NetworkManager.conf

Next go into the connection editor and make sure that the connection you are using is properly configured. E.g., most often "network indicator | Edit Connections... | Wired | Wired connection 1 | Edit... | IPv4 Settings | Method" is set to "Automatic (DHCP)" and no "Additional DNS server" addresses are set.

Then restart network-manager.

sudo restart network-manager

Now confirm that the expected nameserver address(es) appear in /etc/resolv.conf.

If you aren't using NetworkManager to configure interfaces and you are using ifup then edit /etc/network/interfaces and include dns-nameservers and dns-search lines in the appropriate iface stanza as needed.  Make sure that /etc/resolvconf/resolv.conf.d/head only contains comment lines and that /etc/resolvconf/resolv.conf.d/base and /etc/resolvconf/resolv.conf.d/tail are absent or empty.  Then ifdown and ifup the interface. Confirm that the nameserver address(es) that you added to /etc/network/interfaces now appear in /etc/resolv.conf.

If name service still does not work then there's most likely a local problem: a misconfigured DHCP server, for example. Another known cause of problems is third-party VPN clients which trash the symbolic link /etc/resolv.conf. If your LAN seems OK and you aren't using third-party networking software then file a bug report against NetworkManager or resolvconf, whichever you think is more likely the culprit.


Detect (apparently) manually installed driver Nvidia

Open a terminal and execute :

lspci -k | grep -EA2 'VGA|3D'

The output shows something like :

00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
Subsystem: CLEVO/KAPOK Computer Device 3501
Kernel driver in use: i915

01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 860M] (rev a2)
Subsystem: CLEVO/KAPOK Computer Device 3501
Kernel driver in use: nvidia

Now you can see that the NVIDIA drivers are in use -> Kernel driver in use: nvidia

To uninstall the drivers execute :

sudo apt-get purge nvidia*
sudo reboot

This removes the nvidia-settings application as well.


Problem with file synchronization for huge amount of files using Ubuntu One in 12.04

Not sure about that, but I have a back up using Deja Dup on my Ubuntu One account (25GB). A full back up of my important files/folders (about 12GB) took me like 12 hours to complete. Yes it is slow, so for you it might take way longer (1.5days?).


My Firefox 37 has problems with Yahoo mail in 14.04

Thank you for leading me to a solution, resetting Firefox worked.

The culprit was a new setting in about:config "privacy.trackingprotection.enabled" which I had set to true.
Seems Yahoo Mail is enforcing its tracking even for paid accounts, causing such strange behaviour.


How can I restart unity after I resume from suspend?

Go to System Settings > Keyboard > Shortcuts > Custom Shortcuts

and create a new one:

then set an easy keyboard shortcut like Alt+R to easily run a quick Unity restart after suspending.

I do not suffer your bug but I need to run this command on every new session 'cos unity doesn't remember edge bindings on new sessions.


I got in contact with thefanclub and Christiaan Diedericks kindly answered with a solution that actually works! It is as follows:

  Make sure you use the latest version 3.2.3 from our website : https://www.thefanclub.co.za/overgrive

  Clear all trashed files from your Google Drive online Trash/Bin
  folder.

  Delete the following files from your local Google Drive folder restart
  the program.

  .overgrive.cache
  .overgrive.auth

  You will find the setup screen again. Do the setup and click "Start
  Sync"

  It does not download all the files again. It just "checks" every file
  and rebuilds the local cache file. It takes time, but no files will be
  downloaded if they exist already.

  You have to wait for the sync to complete before making any changes.


Open settings>Universal Access>Typing>Screen Keyboard, you'll find it On, switch it to Off.


Wine store it's icons in ~/.local/share/icons/hicolor. And becuase Wine hates you, it stores all the filetype icons not in mimetypes directory but in app directory of every resolution. In my case this file was named text-plain.png but that will depend on it's mimetype. Once you delete those files and reboot the computer, the icons should return to usual (Of course, we have simply removed the image files; somewhere, there is still an entry of that image to be used as the icon)

Another hit-and-miss solution is to change the icon theme.


How to return to normal display after HDMI disconnect?

try switching to a virtual terminal and back (Ctrl+Alt+F1 followed by Ctrl+Alt+F7)
This helps when I am disconnecting an external screen.


How can I include the cursor in the screenshots created when PrtScr is pressed?

You can do this with dconf-editor but with command line as well. Here are the gsettings effecting gnome-screenshot:

Use this command to check current settings:

gsettings get org.gnome.gnome-screenshot include-pointer
false

Use this command to turn on the option:

gsettings set org.gnome.gnome-screenshot include-pointer true

Use the same technique for the other gnome-screenshot settings.

Note you can get a list of all settings with gsettings list-recursively. For the screenshot above I used the technique in this answer:

Bash one-liner to display ALL `gsettings` in GUI dialog window

And the one-liner code (works with yad only) is:

gsettings list-recursively | sed 's/  */\n/;s/  */\n/;s/\&/\&amp;/g' | yad --list --title "gsettings" --item-seperator='\n' --width=1800 --height=800 --wrap-width=600 --column=Group --column=Key --column=Setting --no-markup


As Rinzwind already pointed out, these settings are hardcoded in unity-settings-daemon:

https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/unity-settings-daemon/vivid/view/head:/plugins/mouse/gsd-mouse-manager.c

As a workaround, rename syndaemon to syndaemon.orig

mv /usr/bin/syndaemon /usr/bin/syndaemon.orig

and create a script syndaemon that just calls the original binary with the correct parameters:

cat << EOF > /usr/bin/syndaemon
#!/bin/bash
/usr/bin/syndaemon.orig -K -R -i0.5
EOF

Make it executable with

chmod +x /usr/bin/syndaemon


Here's an article I saw with some benchmarks for gzip and some other compression algorithms: http://tukaani.org/lzma/benchmarks.html. I would assume that decompression time varies with your CPU speed. Also, if you look through the tests, it seems like decompression is almost always faster than compression.

Edit:

In response to your latest question about other ways to back up your server, I found this article that talks about various backup methods: http://www.techrepublic.com/blog/10things/10-outstanding-linux-backup-utilities/895. I'm not sure what access you have to the server, but if it is a common commercial host, you might be able to ask Tech Support how you should do it.


How to specify flac compression level when converting with avconv?

The option is -compression_level and can be set with either avconv or FFmpeg:

ffmpeg -i input.wav -c:a flac -compression_level 12 output.flac

Interestingly enough the commandline flac encoder offers compression levels of 0-8 but FFmpeg / avconv offers 0-12. The documentation can be seen in 3 places:

1. Source code:

The options for flac compression can be seen in flacenc.c:

/* set compression option defaults based on avctx->compression_level */
if (avctx->compression_level < 0)         <-------------
    s->options.compression_level = 5;     <-------------
else
    s->options.compression_level = avctx->compression_level;

level = s->options.compression_level;
if (level > 12) {                         <-------------
    av_log(avctx, AV_LOG_ERROR, "invalid compression level: %d\n",
           s->options.compression_level);
    return AVERROR(EINVAL);
}

I have 'arrowed' in the relevant sections!

2. Man pages:

The compression options can also be seen in man ffmpeg-all rather than man ffmpeg :). This man page shows:

compression_level
Sets the compression level, which chooses defaults for many other options
if they are not set explicitly. Valid values are from 0 to 12, 5 is the default.

A little confusing with multiple man pages now available for FFmpeg!

3. Online documentation:

As 'Miso Soup' pointed out there is also some documentation available online for the deeper options of flac encoding, including the compression options:

compression_level
Sets the compression level, which chooses defaults for many
other options if they are not set explicitly. Valid values
are from 0 to 12, 5 is the default.

Same as the man pages but perhaps a little easier for some to find and read!

References:

FFmpeg git: flacenc.c
FFmpeg codecs documentation: flac


Recovering data from a system corrupted by and interrupted upgrade

You do not want to read the files. You need to copy them over to another piece of storage.

Easiest method

Boot from a live DVD and mount the disk where your documents are on. You can mount this disk from the desktop by clicking on the hard disk icon it correspond. See the hard disk icons at the bottom, when you hover over them they will show the destination.

Open the one you need and select all the files with Ctrl+A and copy them with Ctrl+C. Now insert an USB into another USB port and copy your files over to this new disk with Ctrl+V. This is to create a backup of your files and to make sure any other action to restore your system can be taken regardless of your personal files.

After this is done confirm the USB has all your files, safely unplug the USB and re-install your system. You can re-install without using a format and you can install with a "preserve personal files". Both will have you keep your documents or just plain format and install.

After this is done plug the USB back into your system and copy the files over to your system and you are good to go.


How do I sync contacts with my online account?

The first time you open the Contacts app you’ll be asked if you want to sync contacts with your Google account. If you have answered “no” but change your mind later, you can do so by going to the Today scope, and setting up your Google account there. After that you can sync your contacts (and, if you want, calendar events as well).


dport is not working on iptables command

You probably need to first identify the protocol, for example TCP or UDP. You do that by using the -p <protocol> option.

I'm assuming you want TCP, so your iptables command should look like this:

iptables -A INPUT -p tcp --dport 443 -j DROP


portcommunicationserviced using too much CPU

It happened to me after installing an Epson driver. Solved removing it:

apt-get remove epson-port-communication-service


Note:

xplanet is rather old software. It doesn't work properly when desktop effects are enabled. To test this, first disable desktop effects via System → Appearance:

If you can't get it to work with desktop effects, but it works without them, consider asking another question about it.

Now, onto the problem:

From xplanet's package description:

  In order to run xplanet, you'll need at least one map file. Some maps are included in the xplanet-images package

You need to install  xplanet-images as well. Click this link to install it.

The images used by xplanet are stored in ~/.xplanet/images/ (where ~ is short-hand for your Home Directory; files and folders that start with a . are hidden, you can make Nautilus show them by pressing  Ctrl+H, again that's Your home directory → .xplanet → images)

To see if it worked, type*

xplanet -window

into a terminal. (I've tested this, but if you get any errors, add them to your - question).
Now, to show xplanet on your desktop, open* gconf-editor and navigate to Apps → Nautilus → Preferences:
There, disable show_desktop and start xplanet normally. It should now be on your desktop.

I've gone through all this, and it seems to work fine. But, as I said, only without desktop effects (but maybe that's just me).

*: to open an application, you can either hit Alt+F2, and type the command there or you can open a Terminal via Applications → Accessories → Terminal.


Ubuntu Single Boot on Mac Mini (late 2011)

Sounds like hardware problem. Are you sure you plugged EVERYTHING back in when you replaced the HDD? You computer might overheat if you forgot to plug in any cooling fan, and since computers have overheat halt, it shuts itself down so heat won't cause any damage.


How do I configure a APC Back-UPS XS 1300 with apcupsd?

1) Edit /etc/apcupsd/apcupsd.conf to include a UPSNAME, change UPSCABLE and USPTYPE to usb and comment the device line, for example:

UPSNAME KyleUPS
UPSCABLE usb
#UPSTYPE apcsmart
UPSTYPE usb
#DEVICE /dev/ttyS0

2) In /etc/default/apcupsd change  ISCONFIGURED to yes:

ISCONFIGURED=yes

3) Start apcupsd with:

sudo service apcupsd start

4) Test with the apcaccess command:

kbrandt@alpine:/var/log$ sudo apcaccess
APC      : 001,036,0901
DATE     : 2012-05-05 14:46:50 -0500
HOSTNAME : alpine
VERSION  : 3.14.10 (13 September 2011) debian
UPSNAME  : KyleUPS
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2012-05-05 14:38:45 -0500
MODEL    : Back-UPS XS 1300G
STATUS   : ONLINE
LINEV    : 115.0 Volts
LOADPCT  :  22.0 Percent Load Capacity


Had you tried to mount phisically to another computer?

You know extracting the disk and adding to the rack of a working CPU computer, that may work.


How to add online accounts behind transparent Squid proxy?

All parts of this answer have been re-worded from Fossfreedom's Answer available here. You should read it, as it gives picture examples and gives a solely command-line method as well.

Instead of running a proxy by using the GUI settings menu, you can use DConf.

First off, install dconf-tools and run dconf-editor in a console. It should open a GUI.

Under org.gnome.system.proxy, set the proxy mode to manual. Check use-same-proxy.

In http and https, set your according proxy settings.

Relog/reboot and it should be solved.


Why not simply download the Ubuntu 13.04 ISO, and then proceed like a new install? Just select the option to keep existing files and settings. I feel its much safer than online upgrades..


Install it by this command

sudo apt install nvidia-driver-410

They changed metapackage names in this PPA.


Run sudo apt-get install --reinstall ca-certificates

Source: http://www.webupd8.org/2014/03/fix-cannot-add-ppa-please-check-that.html


Fresh install of Xubuntu on an Acer TravelMate 2410, system will not reboot or shutdown

I have an Acer TravelMate 2410 and this is the solution that worked for me:

Open 'Terminal'
Type: sudo nano /etc/modprobe.d/blacklist.conf
Add a new line at the end that says: blacklist wistron_btns
Save the file (press 'ctrl+o' and then 'enter')
Exit (press 'ctrl+x')
Reboot the laptop.

After you restart Ubuntu you can succesfully shutdown your laptop! If you are wondering why you are doing this: The module 'wistron_btns' crashes when you shutdown Ubuntu. It is supposed to manage the WiFi kill switch and "special" buttons on the laptop.

I found this solution here


I got the same problem today.

TLDR: downgrade libnl3 or upgrade network-manager.

As per this answer, problem is that a fix in libnl3 caused a regression in network-manager. Then, it was only a bug for -proposed packages, but I guess bug was tested enough that it could be introduced into regular Ubuntu ;).

Safest way is to take a step back and install earlier versions of libnl-3-200 libnl-genl-3-200 libnl-route-3-200 (see details in said answer).

This leaves you with downgraded packages. Remember to not upgrade them until relevant upgrade for network-manager is available.

Alternatively (I did this), you can take a step ahead and install newer version of network-manager:
for amd64 or for i386. You can download package on different system and pass it with USB stick. Or download it with your smartphone and pass it via USB.

Install it with:

sudo dpkg -i network-manager_*.deb

You can try to get networking by just restarting NetworkManager:

sudo service network-manager restart

But I needed to reboot to get systray applet back.


replace existing ssd drive with new one and reinstall system boot problems

After some more trial and error I figured out that I didn't create UEFI partition at the beginning of my /dev/sdb

Strange, I would expect the installer should have warned me about that, not pass this silently...


You can try disabling pointer integration by pressing CTRL-I and then just not clicking into the window.  That will keep the mouse released from the window and it should work.

If not, you can try plugging your PS3 controller in during bootup before it gets to the GUI.


What you are going to do is really stupid because it tears down basic security measures in the system. But it's your choice...

1) You could log into GUI as a root (but ubuntu doesn't have normal root user you can switch into), so i guess this is out.

2) You can add your user into root/admin/whatever group thus granting him most of the privileges you need. Command is usermod with some parameters...

3) You can set privileges on each file to rwx for everybody (which is really dangerous). The commad for this is something like chmod -R 777 run in the /.

But my opinion is that if you want to use linux system the "windows way", you'll be pretty disappointed. The thing here is linux is actually pretty comfortable to use, you just have to understand and obey few basic concepts which are different from what you are used to.

More reading on the file permissions: http://www.tuxfiles.org/linuxhelp/filepermissions.html

EDIT: I know what this can do with the OS. I know running any of these commands almost sure result in nonfunctional system. I warned the reader. I've written in because this is answer to his question, which he deserves. For me, writing just "stupid idea" is not an answer. :)


How do I solve dependencies with replacements?

The version, conflicts and dependencies are included in the .deb package, more precisely in package-root/DEBIAN/control. Did you adapt these?

DPKG doesn't determine the package version by the name, but by the version specified in the control file.


Wrong Alt+Tab menu icon & text for Wine apps

It was probably some leftover value from a messed up installation of Picasa. I just did the most obvious thing - removed everything related to Wine and reinstalled.


Which Ubuntu version is suitatable for Gazebo and Ros Hydro Simulator?

The best think of ubuntu for ros hydro its 12.04 LTS. You can see the in the followed link the instructions  for instalation http://wiki.ros.org/es/hydro/Installation/Ubuntu.  Here are examples to start with gazebo "rrbot".http://gazebosim.org/tutorials/?tut=ros_urdf

If you will use Camera Stereo in gazebo Nvidia video  graphics, be necesary for it.

Right now im working with Ros Indigo. in ubuntu 14.04 LTS trusty 64 bit


Remember to reboot your computer after removal, the program could still be in memory. Then use:

sudo apt-get autoremove
sudo apt-get autoclean

And

sudo updatedb

If this dont work, It could be possible that your program "touchegg" is in the /usr/bin , /bin folder or another included in the PATH. Try, after doing the above commands, to use:

locate touchegg

It will tell you where the program, or related files containing the same name are located.


If it's only Firefox where you need to use Flash, installing the flashplugin-installer package is sufficient.

Otherwise, the easiest way to enable Canonical Partner is via the Software & Updates GUI. Just go to Other Software and check Canonical Partner.

There are other ways to install Flash, but the flashplugin-installer or adobe-flashplugin packages is the best way, since you'll get Flash updates via the ordinary package updates.

More about Flash on Ubuntu here.


There is nothing wrong with your "burn phase", you can't change the ISO content..so if on my installation I got the option to install Ubuntu o my entire HD, you'll have the same option...

32 and 64 bits have a different installation setup but both, I have tested, offers a option to install side by side with other OS or install overwriting current OS and there is a red label giving some kind of alert.

There is no possible way your ISO is different then the rest of us, if you downloaded it from Ubuntu


What settings should I use to run Ubuntu in a virtual machine?

I run Lubuntu (Ubuntu with LXDE desktop) on a 4gb machine, using a pentium g4400 (2 cores, 3.3 GHz).

I assigned 1 core out of the available 2.
1 GB ram. You can adjust this, if you won't be using other programs on the host, you can add more for the guest, up to around 2-2.5 GB just to be safe.
64 MB for graphics. I don't have a dedicated graphics card. If you do, you can be more generous.
For storage, most people will choose a dynamic disk. However, if your host is low on storage space, then it's better to create a fixed size drive with just the minimum required size (probably around 10-15 GB). For mine I chose a 25 GB fixed size drive, because why not.

This works ok for testing some stuff. I wouldn't render videos or play here.


How can I join a Skype Public chat via links?

I'm the author of Net::DBus::Skype and skype-action-handler. That was a tool to interface with DBUS to send commands to Skype via the DBUS API. The skype-action-handler does exactly what Skype 4 will do via the --call argument

skype --call "skype:echo123"
skype-action-handler skype:echo123

Except I think I handled the URL format too which I don't think --call handles. I made this library and utility because back in 2008 the Skype for Linux was not nearly so polished. Originally, I believe it only used OSS even.


How can you reverse left and right speakers from a control panel?

Edit /etc/pulse/default.pa and the following lines ...

load-module module-remap-sink sink_name=reverse-stereo master=0 channels=2 master_channel_map=front-right,front-left channel_map=front-left,front-right
set-default-sink reverse-stereo

... Then restart the pulseaudio daemon with:

$ pulseaudio -k
$ pulseaudio --start

You can also omit "set-default-sink" line above and select the reversed output in the sound settings dialog when you need it.

Reference:

Cousjava @ ubuntuforums.org


Why clamav result is not showing all files/sub-files/subdirectories count

I don't see a "sudo" in front of the command.

No "sudo" no access to files that that user does not own. And clamav is likely to silently ignore those files.


d-wx-wx---  2 root allowed   4096 mar  1 23:30 .

That directory doesn't have read permissions for anybody (that's why only root can list contents). Give read access:

sudo chmod ug+r dir1


You can use irssi to chat via terminal. You can install it via sudo apt-get install irssi and find more information about irssi on this website: http://irssi.org/


renaming network interface in Ubuntu 16.04 with systemd fails

This may or may not help .. I would check /etc/udev/rules.d and see if you have 70-persistent-net.rules. You should be able to rename them using that file

Mine looks like this:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e0:cb:ee:d7:ff:9a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

If you have the entries for your cards in this file you can change the name to what ever you want by changing the "NAME=TheNameYouWant"


"... I already tried uninstalling and reinstalling firefox."

Uninstalling and reinstalling is mostly a waste of time for problems with your browser. You should look at these two references:
Troubleshoot Firefox issues using Safe Mode
and
Use the Profile Manager to create and remove Firefox profiles

Problems with browsers commonly arise because of

some extension/plug-in the user installs or removes or which is updated or which stops working after an update to Firefox.
corruption of some aspect of the user's profile.

To elaborate, whether an add-on or plug-in is responsible for your problem, a "safe mode" is available and its usage is detailed in the first link.
A corruption of some file, a relatively rare situation, can be deduced by using a different profile as described in the second link.
Note that backing up your valuable data such as bookmarks is a must.


How can I start an executable jar file from a desktop file in Lubuntu?

You can't use the ~ in your desktop file. Replace ~ with the output of

echo /home/$USER

e.g.

Exec=java -jar /home/john/Downloads/PartyPlanner.jar

Use

Path=/home/john/Downloads/
Type=Application


Is it possible to make the desktop background transparent or otherwise hidden?

Use the same wallpaper in the VM and in the Host?


Why does my Transmission client tell me my tracker list contains invalid URLs?

Probably because it includes udp trackers, which aren't supported in Transmission until version 2.30.


I am trying to access my project index.php on local server code is not running

Steps can vary depending on your error. Check the steps below:
Check that PHP is installed. If PHP isn't installed. Steps to install PHP -> https://thishosting.rocks/install-php-on-ubuntu/
If PHP is installed, but you're still just seeing the raw text/code, it's likely that the module isn't loaded into Apache (assuming you're using Apache). Steps to do this -> https://stackoverflow.com/questions/42654694/enable-php-apache2
Use the web browser console to check the status being returned when viewing the page. It should return a 200 status. If 500 (syntax/config error), 404 (missing file), etc then troubleshoot accordingly.
Confirm Apache site root location as Apache can be configured to link to non-standard locations. Depending on your Apache version this config file location can change, but you're probably going to need to check the
/etc/apache2/sites-enabled/000-default.conf. The option you're looking for is DocumentRoot which is where the site should load in the text.
Check that .htaccess file isn't overriding your install location and setting a new document root. The easiest way to test this is if you have a .htaccess file, temporarily rename it to another name (eg. mv .htaccess .htaccess_temp) which will remove any changes implemented by the .htaccess file.
Restart Apache as changes to config files are not automatically reflected by apache. sudo service apache2 restart


Is there a way to easily switch operating systems on a duel install?

Unless you run one in a virtual machine, no. An OS needs exclusive rights to the entire cpu and root device, and if you tried to boot them simultaneously then they would completely crash the moment one of them issued an instruction after the other had, as the cpu is only meant to handle one kernel thread. Even with the fastest cpu, there is no way to run two OSs at the same time without virtualizing one of them


Installed Brother MFC-L3770CDW driver but still can't print

I ended up resolving my own problem by entering sudo apt install lprng in the terminal (and entering my password). After this I was able to print using all the versions of my installed printer.


Errors were encountered while processing: libnvidia-compute-450-server:amd64

Thanks to pavlos in Ubuntu IRC channel:
Initially, I did:
$ sudo dpkg --purge $(dpkg -l | grep nvidia | awk '{print $2}')

and
$ sudo dpkg --purge $(dpkg -l | grep libnvidia | awk '{print $2}')

Not everything was removed then:
$ sudo dpkg --purge $(dpkg -l | grep cuda | awk '{print $2}')

$ sudo dpkg --purge libcuinj64-10.1:amd64

Then, again,
$ sudo dpkg --purge $(dpkg -l | grep nvidia | awk '{print $2}')

and
$ sudo dpkg --purge $(dpkg -l | grep libnvidia | awk '{print $2}')


What are online accounts and how do they work?

Online accounts is one of the latest features of GNOME 3.2.
The release notes of GNOME 3.2 states:

Online Accounts
Documents, contacts, calendars — They can be stored
locally on the computer, but storing this type of information online
is becoming increasingly popular. In GNOME 3.2, Online Accounts
provides one place to manage these online sources. These online
accounts are automatically used by Documents, Contacts, Empathy,
Evolution as well as the calendar drop-down.

Useful links:

How to integrate gnome-online-accounts?
GNOME 3.2 Release Notes


No sound after upgrade 14.4 to 16.4 on Dell Latitude E5570

I would just like to let others who have a problem similar to mine that Dell appears to have supplied all drivers for the hardware in the standard installation of 16.4 and later, and hence this problem was (for me at least) easily solved by installing 16.4 as a fresh install from USB. I.e. just do a full install.


grep single pattern having more than one matches

Looks like grep -w does not pick up the A.0 lines because the file X.txt has trailing spaces on that line (breaking the word boundary requirement of -w). Try the "fixed string patterns" flag, -F

grep -Ff X.txt Y.txt

This also works because the files are sorted:

join X.txt Y.txt


Cannot install apt-install in Ubuntu 16.04 "waiting to install "

I'm having the same issue with Ubuntu Software with Ubuntu 16.04, but I found an easy GUI workaround in the meantime via "GDebi Package Installer" so you don't have to fiddle around with CLI with all your .deb packages and it'll capture all the dependencies so you don't have to worry about forcing apt-get installs.

run "sudo apt-get install gdebi"
In Nautilus, right-click your .deb file and select "Open With" -> "GDebi Package Installer"
Select "Install Package" to install.

Info was found here: https://unix.stackexchange.com/questions/159094/install-from-a-deb-file-by-dpkg-i-or-by-apt


Only keep last page of each section in PDF?

I solved my own problem. Wrote python code to deal with it.
Retrieving the PageLabels retrieves the Label itself which may or may not be numeric and the corresponding index where said Label starts.
I extract the start indices of the labels, and assume that the end of a section or label occurs immediately 1 page before the next label/section starts.

#!/usr/bin/python

from PyPDF2 import PdfFileWriter, PdfFileReader
import numpy as np

def printf(format, *values):
    print(format % values )

with open("in.pdf", "rb") as in_f:
    input1 = PdfFileReader(in_f)
    output = PdfFileWriter()

    numPages = input1.getNumPages()

    # The label indices occur @ even locations - generate array of form [0, 2, 4, 6, ...]
    indices = np.array(np.arange(0,np.shape(input1.trailer["/Root"]["/PageLabels"]["/Nums"])[0],2))

    # Assume end of preceding label = start of next label - 1
    pageIndices = np.array(input1.trailer["/Root"]["/PageLabels"]["/Nums"])[indices] - 1

    # ignore the first index which is now a -1
    pageIndices = pageIndices[1:]

    # there may be extra pages right after the start of the last label - add them
    pageIndices = np.append(pageIndices, np.arange(pageIndices[-1]+1, numPages))

    for _, v in enumerate(pageIndices):
        page = input1.getPage(v)
        output.addPage(page)

    with open("out.pdf", "wb") as out_f:
        output.write(out_f)


I've solved it by Getting HDMI to VGA converter and using both the displays from single graphics card.  May be Ubuntu doesn't support multiple graphics card to use with dual monitor at once, but using converter solved my issue.


Use the StrictHostKeyChecking option, for example:

ssh -oStrictHostKeyChecking=no $h uptime

This option can also be added to ~/.ssh/config, e.g.:

Host somehost
    Hostname 10.0.0.1
    StrictHostKeyChecking no

Note that when the host keys have changed, you'll get a warning, even with this option:

$ ssh -oStrictHostKeyChecking=no somehost uptime
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
31:6f:2a:d5:76:c3:1e:74:f7:73:2f:96:16:12:e0:d8.
Please contact your system administrator.
Add correct host key in /home/peter/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/peter/.ssh/known_hosts:24
  remove with: ssh-keygen -f "/home/peter/.ssh/known_hosts" -R 10.0.0.1
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
ash: uptime: not found

If your hosts are not often reinstalled, you could make this less secure (but more convenient for often-changing host keys) with the -oUserKnownHostsFile=/dev/null option. This discards all received host keys so it'll never generate the warning.

With 18.04, there's a new possibility: StrictHostKeyChecking=accept-new. From man 5 ssh_config:

If this flag is set to “accept-new” then ssh will automatically
add new host keys to the user known hosts files, but will not
permit connections to hosts with changed host keys.  If this flag
is set to “no” or “off”, ssh will automatically add new host keys
to the user known hosts files and allow connections to hosts with
changed hostkeys to proceed, subject to some restrictions.


When I am using Ubuntu for commercial reasons, do I have to pay Canonical?

The trademark policy only applies if you wanted to the use the word "Ubuntu" in the name of your product - say you called your service "Ubuntu widgets".

However if you have your own name then you don't need to pay any money to Canonical (the holder of the Ubuntu trademark). You can use as much of the Ubuntu software and platform as you want without paying a penny, though you can pay for support.


Error installing avogadro with CMake 'lconvert: could not exec No such file or directory'

You need to install package qttools5-dev-tools

Explanation:

The errror message `could not exec '/usr/lib/i386-linux-gnu/qt5/bin/lconvert': No such file or directory' is telling you that an executable named lconvert is not there.

To find out which package has the missing file use apt-file search lconvert


Securely erase single (Windows) partition

One method I could device to do this, would be to first use dd to overwrite your windows partition, and then use gparted to create a new format for use in linux, or remove the old partition and incorporate the space into your existing Linux disk.

Assuming your disk is /dev/sda and the Windows partition is /dev/sda9, you might try a command like

sudo dd --progress ifile=/dev/zero ofile=/dev/sda9 bs=4g

This will fill the partition with zero's, and continue until the partition is full and the command returns with an error.  You could do the math, and figure a blocksize (bs=) and count (count=) to fill the partition exactly.  Additionally, you could use /dev/urandom to fill the partition with random data.
But be very, very careful with dd.

Following this, you could then use gparted to format it as a file system that you would like to use for your Linux system.

Finally, be very careful with dd.  It is not a forgiving program.


Install ntfs-Config Tool from Software Center

Alternatively you can use MountManager , also available from the Software Center


I can't type a “b” when I'm in the command line

Inside the ssh session, start a cat command and see whether you can type b there. I'm almost sure it'll work, which means that it's your shell that decides not to act on b.

Assuming the default bash, you should check readline's configuration files: ~/.inputrc, /etc/inputrc, or the one referred by $INPUTRC. Chances are you'll find an accidental lone b on its own line (or something similar), instructing readline not to do anything upon encountering this character.

Update

Looks to me that the first three lines of your .inputrc are correct, it's the fourth line (bind TAB:menu-complete) causing the trouble. Change its first letter to anything else (e.g. find instead of bind) and then that letter (e.g. f) will misbehave. Apparently bind is not a recognized keyword in this context.


This issue was related to iptables that was blocking the loopback port. I needed to add :

sudo iptables -I INPUT 1 -i lo -j ACCEPT


distinguishing similar windows when there are some when using unity

In the launcher left of the icon of your program there are multiple small arrows - as many as you have windows open. If you click precisely on those, a cascade of them will appear on the screen (very similar to what happens when pressing Super + w). Clicking on one of the windows will give it highlight.

To display the titles in this view as joris said:

Enable the Text and Scale addons plugin in Compiz Config Settings Manager
In the Scale addons plugin of CCSM: set Appearance -> Window title -> Window title display to All windows


Cron has not been running since a specific date

If I read the comments correctly, you're looking for a temporary fix while you get a new server running a supported OS up and running. In that case, you might try the following

Create a script that will run an infinite loop to make your calls instead of trying to fix cron on a very obsolete OS. Something like this should do.

#!/bin/bash

while true
do
    time=$(date +%H:%M)
    hr=$(cut -f1 -d: <<< "$time")
    min=$(cut -f2 -d: <<< "$time")

    if [ "$hr" == "07"] && [ "$min" == "50" ]; then
        #run something at 7:50am
    fi

    if [ "$hr" == "05" ] && [ "$min" == "00" ]; then
        #run something at 5am
    fi

    if [ "$((min % 15))" == "0" ]; then
        #run something every quarter hour
    fi

    sleep 60
done

Then of course there is the task of running this at boot time. My 8.04 days are long past, and I can't say what worked back then. Take a look at this post though, and see if it gets you where you want to be.


Ubuntu 14.04 locks screen without dimming during fullscreen video playing?

The package Caffeine solves this exact problem.

It installs an indicator at the top right portion of the top menu, where time and battery is located. And you can enable it before playing full screen videos and during that time, it will not dim. After watching the movie or video, disable it again, to get the dimming functionality back.

In order to install Caffeine:

sudo add-apt-repository ppa:caffeine-developers/ppa
sudo apt-get update
sudo apt-get install caffeine

It will start automatically after rebooting the machine, or start it from your dash.


How can I find the driver of syntek webcam for my laptop?

My comment above suggests that the device is there but mislabelled /dev/video0 rather than /dev/video1. Check the link for more info...


Got answer from another forum, if anyone interesed here is reply

  MF79 (19d2:1405) is not a dialup modem, it is a direct ethernet adapter ie a modern Mobile Broadband device for higher speed than a dialup modem can offer.

  Ethernet does not have a management protocol so ModemManager can't do
  anything with the device, everything is handled by NetworkManager.

  You will not be able to get a public ip address with a device like
  this that has a wifi access point built in, the device has to do NAT
  and hence the address you get on the usb ethernet connection is a
  private ip from the device LAN where wifi also resides. @LOM


This was my mistake. I had forgotten that the files were on an NTFS volume where the owner cannot be changed.


You can try Evolution, it was the default mail / calendar application before 11.10, and I'm still using it at work.

It support web calendars, and if you need, also Google Calendar. For example I upload my ICS file to my web space, I configured that ICS on Google Calendar, so I can see in Evolution and if I am not at my computer also with Google web interface.

It also as calendar events integration with the datetime indicator (the clock on right-top).

Click here to install: http://apt.ubuntu.com/p/evolution


How do I use pm-suspend-hybrid by default instead of pm-suspend?

Indirect hybrid sleep

This is the older method: first suspend and then wake up to hibernate after a delay (15 minutes by default). Use this with a Linux kernel before 3.6, or if you like that it does not use any power after 15 minutes any more.

Add the file /etc/pm/config.d/00-use-suspend-hybrid:

# Always use suspend_hybrid instead of suspend
if [ "$METHOD" = "suspend" ]; then
  METHOD=suspend_hybrid
fi
# The delay after which hibernation gets triggered (default: 900 seconds, 15 minutes):
PM_HIBERNATE_DELAY=900

  You might want to make sure that the hybrid method is supported on your system via the following code. If it says "0" it should work:

sudo pm-is-supported --suspend-hybrid && echo $?

Real hybrid suspending with Linux 3.6+

If you have a Linux 3.6 kernel, you can use the following, which will suspend to both disk and RAM from the beginning.

Add the file /etc/pm/config.d/00-use-suspend-hybrid:

# WORKAROUND: always set the default hibernate mode first (normal mode)
# (not required if you have the patch mentioned by Rohan below (http://askubuntu.com/a/344879/169))
HIBERNATE_MODE=platform

# Always use hibernate instead of suspend, but with "suspend to both"
if [ "$METHOD" = "suspend" ]; then
  METHOD=hibernate
  HIBERNATE_MODE=suspend
fi

# Make sure to use the kernel's method, in case uswsusp is installed etc.
SLEEP_MODULE=kernel

This will always write the image to disk and then suspend to RAM, having the benefits that resuming will always be fast (as long as the battery does not run out) and that the machine will not wake up for a short time (after PM_HIBERNATE_DELAY) to hibernate for real.

The drawback is that the process takes longer (because it always hibernates to disk), and that your battery might run out in the long run (e.g. after 12 hours).

Corresponding blog post (not updated)


Can I install PHP 5.3.5 on Ubuntu Server 18.04 LTS?

Besides getting the usual warning regarding outdated packages, you should be able to compile PHP 5.3 on your system.

Taken from this post:

You will need these extra packages:

sudo apt-get install build-essential libxml2-dev checkinstall

Install PHP

In terminal - Download the package into tmp directory (or where ever you want it downloaded to)

cd /tmp && wget http://in1.php.net/distributions/php-5.3.29.tar.bz2

Untar and cd into directory

tar -xvf php-5.3.29.tar.bz2
cd php-5.3.29

Get everything ready and compile - if you get errors you may be missing some packages. You will have to google how to get these missing parts.

./configure
make

Create PHP 5.3 .deb file. This way you can easily uninstall later.

sudo checkinstall

I just tried to compile this on my 18.04 machine and it worked fine. But you may need certain php modules for your project and you may have to find and compile those as well.

You may have to install some missing packages for the .deb file (like Apache, etc.) You can fix that by running this after:

sudo apt-get install -f

Also, I hope this project is an internal one, and not exposed to the internet. But I am sure you are aware of the dangers, right? ;)


This is meant to be a comment but I do not have sufficient privileges to comment on this question.

I have had this issue for a while and have spent quite a bit of time debugging
this problem. Here's my progress so far:

Problem: The wpa_supplicant included with Ubuntu is too old, doesn't support EAP-FAST

Proof: From syslog

NetworkManager[1252]: <warn> EAP-FAST is not supported by the supplicant

Solution:

12.10 didn't upgrade the wpa_supplicant version, so I was left to compiling it
myself.
After a few attempts I could successfully compile the code, downloaded from this location. I then replaced the default version of wpa_supplicant manually (copied it to /sbin, luckily after having backed up the existing executable)

Complications:

Turns out, the new wpa_supplicant doesn't play well with the older parameters.
During startup, the wpa_supplicant is called as a dbus service. The exact call is
stored at /usr/share/dbus-1/system-services/fi.w1.wpa_supplicant1.service. This call fails as the older parameters passed to the wpa_supplicant no longer work. This, in turn, leaves the network manager completely unusable.
You can manually call the new wpa_supplicant with your own configuration and it does work properly, but network manager integration is missing in this scenario.
I would greatly appreciate further suggestions.


Stop Thunderbird auto start after login in Ubuntu

In Ubuntu there are basicly three places in which you can set programs to start on login:

a *.desktop file in ~/.config/autostart/ in which you define the command you want to run, these files can be set active or inactive via Startup Applications
any commands put inside .profile
as third place there is ~/.config/upstart/ which is an leftover of upstart, the init-replacement, now dropped for systemd

If nowhere there you can find an entry for thunderbird, things might have got quite funny.


Check out ZenMate for your Chrome/Chromium browser on your PC.
Tor is a possibility, but I wouldn't trust it because exit nodes can see what you're doing and who you are. You never know.
If your router supports VPN (OpenVPN) you could invest in a VPN account. There are free accounts but they're usually slow.

Answer from Martin Ravensholt on G+, not myself.


How do I install the rtl8188ce driver in ubuntu 18.04.4 if I don't have an ethernet port

Try USB tethering with your phone.

Now, you might worry about using data... Not to fear! Connect to WiFi, turn on USB tethering, and then turn off data!
Most phones should keep tethering on, but it will use WiFi instead of your precious cellular data!

If this works, you can go ahead and install git then run that command on the git page...

If that doesn't work, download the repo .zip to your phone and copy it to your computer desktop (over MTP or PTP or however you can) and install the driver.


How to install/upgrade to newest WiFi driver from wireless.wiki.kernel.org?

First of all, what you are looking at here are the firmware files, not the driver. All newer Intel devices use the same driver, iwlwifi. The features particular to the exact chip, such as your 3160, are enabled by the firmware files.

You have already linked the firmware discussions at kernel.org. Of further interest is the firmware discussion at Intel, the manufacturer of the hardware and the author of the driver and firmware: https://www.intel.com/content/www/us/en/support/articles/000005511/network-and-i-o/wireless-networking.html

As you can see, kernel.org suggests that the correct firmware for your device is -16. Intel says it is -14. In contrast, modinfo says it is -13. In fact, the driver iwlwifi and the package linux-firmware load -17!

What have we learned here? I think we have learned that there is no consensus and that there is no need and no place to download a newer firmware file.

In my experience, having used many Intel devices myself over 15 years, the firmware and driver iwlwifi are seldom the issue. In the spirit of “I'm trying to solve it on my own first”, I suggest that the solution is likely related to either:

Power saving;
The device wants to roam from among several SSIDs with the same name; for example, eduroam;
The router is set to auto select the encryption; that is WPA or WPA2, and the wireless device stumbles at the changeover;
The router is set to autoselect the channel and the device also stumbles at the changeover; or
The router is set to TKIP.

Should you wish to update the actual iwlwifi driver, first address these issues. I suspect that no update will then be required.


How to downgrade gtk+2.0 package to workaround bug #693758?

In this particular case for 32-bit:

wget http://launchpadlibrarian.net/60749847/libgtk2.0-0_2.23.2-0ubuntu4_i386.deb
sudo dpkg -i --force-all libgtk2.0-0_2.23.2-0ubuntu4_i386.deb

or for 64-bit

wget http://launchpadlibrarian.net/60749886/libgtk2.0-0_2.23.2-0ubuntu4_amd64.deb
sudo dpkg -i --force-all libgtk2.0-0_2.23.2-0ubuntu4_amd64.deb


The OP reported solving the problem (in comments) by reinstalling the indicator-session  package.

(One way to do that is to run sudo apt-get update && sudo apt-get --purge --reinstall install indicator-session.)


Unwanted dialog when clicking link to download file

That is not really a dialog box expecting an answer from you but Firefox's downloads window, which is shown by default when downloading a file. However, you can switch it off in Firefox's preferences (untick the checkbox "Show downloads windows when downloading a file"). You can find Firefox's preferences under Edit->Preferences in the menu. See the screenshot below.


installing matlab 2014 on ubuntu 14.04LTS

You must first cd to the relevant directory before running the install script.

cd /path/to/folder

sudo ./install

Alternatively, you may not have the necessary permissions to execute the file.

chmod +x install

sudo ./install


Select folder with Shotwell, and let Shotwell create folder dates and such.

as @Tom Brosmann suggested, check if you have duplicate first. See the following page for that

How to find (and delete) duplicate files


It's unity-window-decorator & (or if you cannot type anything, go to a virtual terminal and do DISPLAY=:0.0 unity-window-decorator &).


14.04 64x "Kernel panic - not syncing: Attempted to kill init! exitcode 0x000000100"

Have the same exact error on a friend's Ubuntu system that was on an outlet controlled by a light switch and powered off as such. Bad design as you can imagine, but that's literally how they turned off their computer. Long story short, the error you're seeing is possibly just the tip of the iceberg. In other words, after mounting and attempting to navigate around the drive (i.e. /home) you may start hitting Could not ls: Input/output error, etc.

Their's is an 80 GB HDD and I've already begin using PhotoRec which is pretty effective when it comes to images (not so much with *.mp4, *.mov, etc). Tried e2fsck without much success, just a large lost+found directory with missing files, and errors remaining in an attempt to fix the partitions but to no avail.

At this point I'm not too hopeful that I'll be able to "revert" the system to a usable/bootable state, but I did want to mention some data recovery tools in the event your system is beyond a simple e2fsck repair.

There is also TestDisk which comes from the same vendor as PhotoRec and claims to be able to fix partition tables. I have not actually tried it yet, but it does come on the Ubuntu Rescue Remix Live CD. I was able to locate an ISO here as their main site is currently throwing a HTTP 500.

Also wanted to mention that Ubuntu Rescue Remix comes with ddrescue which I incidentally jumped to prior to learning that conventional dd imaging does not work for the same reason (Input/output error reading /dev/sda). I can't get more than 5 MB before dd quits on me, where as ddrescue is able to skip unreadable blocks and dump the entire partition, implying data loss of course.


Certified Nvidia driver (from website) downloaded/installed and still doesnt support any graphics

You should not install the drivers directly from nvidia.com as it's not fully compatible with Ubuntu. To recover from your mistake, uninstall the driver from nvidia.com first by opening a console and running:

sudo nvidia-installer --uninstall

Then reboot. If you still do not have your graphics effects back, open a console and run:

sudo apt-get --reinstall install libgl1-mesa-glx

To install the nvidia driver on Ubuntu, open the Additional Drivers program and choose the current driver.


Change default user folder paths in Xubuntu

In principle, it is very simple: move the Documents folder and the Music folder to your Dropbox folder. However, some applications will assume the folders exist in ~/home, so you should create links in your home folder to the "real" folders.

you do that by the command:

ln -s ~/Dropbox/Documents ~/Documents

and

ln -s ~/Dropbox/Music ~/Music

(after you moved the folders to the Dropbox folder)

These links act as if they are actual folders, but the files will be stored in the Dropbox folder.

In my opinion, this would be the most elegant way. There is however a more drastic way to set the default paths to your user's directories:

mousepad ~/.config/user-dirs.dirs

you would see the contents of the file like:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Bureaublad"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Sjablonen"
XDG_PUBLICSHARE_DIR="$HOME/Openbaar"
XDG_DOCUMENTS_DIR="$HOME/Documenten"
XDG_MUSIC_DIR="$HOME/Muziek"
XDG_PICTURES_DIR="$HOME/Afbeeldingen"
XDG_VIDEOS_DIR="$HOME/Video's"

I would suggest the first option, because it gives you what you describe, without changing default settings.


Automatically rsync when hotplugging a sata drive(bay not esata)

I use a simple udev rule for this. The backup drive is marked with a specific volume label (use tune2fs to set it). The udev rule starts a script:

$ cat /etc/udev/rules.d/90-backup.rules
ACTION=="add", ENV{ID_FS_LABEL}=="backup", RUN+="/usr/local/bin/backup.sh"

(you can use ENV{ID_FS_UUID}="some-uuid" if you'd prefer not to use volume labels)

The script just runs the rsync:

$ cat /usr/local/bin/backup.sh
#!/bin/bash

mnt=/media/backup

(
mount $mnt
rsync -avx --exclude lost+found /home/ $mnt/backup/
umount $mnt
) > /dev/null 2>&1 &

udev expects the RUN="" command to be short-lived, so the script runs the rsync in the background.

This will work for any type of drive and/or interface - as long as udev gets notification that the drive has been added.


Boot off the LiveCD and try:

sudo mount errors=remount-ro /dev/sda1 /mnt

If this manages to mount the drive in read only mode, you should back up any important data that you may have which should now be accessible at /mnt/home/your_user_name/

If it complains about not knowing what the filesystem type is, try

sudo mount -t ext2 errors=remount-ro /dev/sda1 /mnt

It seems the device might be failing if it's not completely dead.  You won't know for sure until you back it up and try to reformat from scratch and test it.  Anything that says "read error" is pretty bad news and I don't think it's a good candidate for recovery as it is now.


How do you insert subscripts and superscripts into ordinary (non-formula) text in LibreOffice Writer?

Don't forget that Google is your friend.

Keyboard Shortcut

As detailed on the LibreOffice help site:

For superscript: Ctrl + SHIFT + P
For subscript: Ctrl + Shift + B


My External Hard drive was not properly removed and now will not mount

Already answered:
Fix corrupt NTFS partition without Windows

Please try and see if it matches your case, using Gparted is a highly recommended solution, saved a lot of hassle for me (although all the other options suggested there are quite good as well).


Multi Monitor: Why does a "Dragged For Fullscreen" window open on another monitor?

I had a similar problem with videos on some servers other than YouTube jumping to the laptop screen when I switch to fullscreen on TV connected via HDMI.

I discovered that you can make them stay on TV screen by opening System Settings... > Displays and moving the position of TV screen there from left to top or right.

This can perhaps be helpful to you as well.


I cannot copy files to my Android MTP files or my pen drives

So, I have been using Nemo as a file explorer and it doesn't seem to work when I use Nemo.
When I switched to Nautilus temporarily, the files transferred sucessfully.


14.04 & 15.04 usoft Wireless Keyboard doesn't work, Mouse does work

Ooops.  Check the batteries.

Principle:  If an appliance fails, check if it is plugged in.  On batteries, check the batteries.

My keyboard batteries faded out between the grub screen (they worked)
and the login to Kubuntu (they stopped working).

New batteries fixed things.  So I owe those who end up here:

These keyboards are not secure.  There is a simple Arduino keylogger.
I use my keyboard on a HTPC so it doesn't really matter.  Who cares
what I watch?
Some people have had difficulty.  Here are the best discussions I
found.

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

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


1) Install xclip and xdotool

sudo apt-get install xclip xdotool

2) Make a file myscript.sh

mkdir ~/bin
gedit ~/bin/myscript.sh

3) Copy paste this script into it

#!/bin/bash
TEXT="myname@address.com"
printf '%s' "$TEXT" | xclip -i -selection clipboard
xdotool key --clearmodifiers "ctrl+v"

4) Make the file executable

chmod +x ~/bin/myscript.sh

5) Make a shortcut

Settings -> Keyboard -> Shortcuts -> Custom shortcuts -> click [+]

Name: anything, Command: /home/USERNAME/bin/myscript.sh

Replace the USERNAME with your username

Click on the Disabled text and then press your magical keystroke. For example Ctrl-Shift-S
You may have to restart unity with setsid unity or by logging in and out to make the shortcut work. (at least i had this bug on Ubuntu 13.10)

Troubleshooting

If you have any problems with pasting the text. Try changing xdotool key to xdotool sleep 0.5 key. It gives you time to take your hands off the keyboard before xdotool tries to press "Ctrl-V"


chrome disable or change keyboard shortcut ctrl+shift+c developer tools console?

I've managed to make it work with shortkeys:

Keyboard shortcut: ctrl+shift+c
Behavior: Run JavaScript
Javascript code to run: document.execCommand('copy')

Then just hit Save and reload tabs for the new setting to take effect.


what's alternative hjsplit software for ubuntu?

The split command is part of Ubuntu core.

Example usage here http://blulin.wordpress.com/2009/02/07/split-and-join-large-files-in-gnulinux-just-using-terminal/


Option Button in Keyboard Layout > Input Sources is not pressable

Option button is only available when you have added multiple input sources.

Edit:
I found a solution for adding compose key here:
http://blogs.gnome.org/mclasen/2012/09/21/input-sources-in-gnome/


How to recursively upload a directory to a ftp server but skip hidden dot-directorys

Actually I got the idea how to do this while writing up this question. Might seem a but hacky but if I not missed something ncftp does not provide some exclude option.

So since I use a script anyway. I just deny ncftp access to that folders temporary. Resulting in creation but empty .git and .svn folders on the ftp server.

chmod 000 .svn
chmod 000 .git
ncftpput -R -v -u "user" -p "pass" ftp.own.com /ftp/folder/to/to/place/local/folder/in /local/folder/to/upload
chmod 700 .svn
chmod 700 .git


This may be counter-intuitive, but may help:

If you've been using, say, usermod -aG sudo,adm DOMAIN\\user or the same with user@DOMAIN, it doesn't seem to add them properly to sudoers.

Though there shouldn't be a local user with the same name, enter the name as if there were, like so:

usermod -aG sudo,adm user

Example: for domain ACME and user admin, in a usermod command, leave out the ACME\\ or @ACME part entirely.

Literally just figured out this worked in the last few days.


You need to give your cron a PATH. For instance:

SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin

In your case, try putting this before your command. Check the community wiki in this question for more information on why the PATH variable is needed. Here is an excerpt; essentially the idea is that cron does not read /etc/environment:

  A common "gotcha" is the PATH environment variable being different. Maybe your cron script uses the command somecommand found in /opt/someApp/bin, which you've added to PATH in /etc/environment? cron does not read that file, so running somecommand from your script will fail when run with cron, but work when run in a terminal. To get around that, just set your own PATH variable at the top of the script.


Programmatically set default applications in Gnome?

For 18.04, this works

xdg-settings set default-web-browser chromium-browser.desktop

update-alternatives sets the default browser for the soft links x-www-browser and gnome-www-browser.  But these soft links seem no longer used by the system by default.

It looks none of these is stored in the dconf system.


Authentication is implemented using PAM, the Pluggable Authentication Modules.

  Linux-PAM is a system of libraries that handle the authentication tasks of
  applications (services) on the system. The library provides a stable general
  interface (Application Programming Interface - API) that privilege granting
  programs (such as login(1) and su(1)) defer to to perform standard
  authentication tasks.

The configuration for the login service is in /etc/pam.d/login.
It's well-commented, and very informative.

It is PAM's modules that access to the password file,
when needed.
In systems with centralized authentication (for example LDAP),
the login service may never need to access the password file.

See more info in man 7 pam.


Workspace Switcher inoperative on nVidia dual displays

The problem was a compiz plug-in which was incompatible with this version of unity.


From the terminal run:

gsettings set org.gnome.settings-daemon.plugins.power button-power interactive

You can also directly edit this configuration setting as well as your entire configuration database in Ubuntu 12.04 using a GUI application called Configuration Editor which is from the dconf-tools package in the Ubuntu Software Center.


Yes you can! If your laptop runs Windows 10 pro without issues, it can definitely run Ubuntu. Another option is Ubuntu Mate (https://ubuntu-mate.org/). It's an official alternative to Ubuntu designed for low spec devices.

Also, Ubuntu Core is not particularly well suited for Desktop, so I recommend sticking with stable Desktop releases (https://www.ubuntu.com/desktop/developers).


How to Install ONE Operating System on Computer with TWO Hard Drives - NOT Dual-Boot

Simple BUT THIS IS ONLY FOR LEGACY BOOT MODE

While installing, select the Something else option or something like that (WARNING! The picture is to demonstrate. Select Something else, not in the picture)

Let's do some maths.

First, call your amount of ram X, small drive is A and large drive is B.
Your swap should be in A with a space of 2X.
Your system, which is ext3 or ext4 should be mounted as / in drive A with a space of A-2X.
Finally, your Home folders should be created as ext4, mounted
as /home in drive B at a space of B.

Now just do the installation like you would do.


md5sum of ubuntu 12.04 i386 desktop .iso does not match

Check md5 hash of your downloaded image with the official posted hashes page.

A how to guide is available here.
If the hashes matched and the problem persists, install  7zip .
Download unetbootin from here, make it executable. Launch it and create your disks. Do this only if the hashe matches


First of all the keyboard shortcut in VirtualBox to switch to TTY is "Hostkey"+Fn. The default "Hostkey" is Right-Control for example to connect to TTY1 press: Right-Control+F1

To change the windows size maybe you need to change resolution of the TTY, use this link https://unix.stackexchange.com/questions/226308/unable-to-change-screen-resolution-of-tty


How do I automate the installation of acroread?

Using expect is good and easy way of doing so. People use Expect to automate interaction with non-GUI (and typically non-cursor-controlled) applications that prompt the user for input.


Remote file transfer? (transfer files on local machine from remote machine)

When you SSH from your laptop into Barton, and issue a command, all the disk transfer is actually taking place on Barton.  It should be no different than if you are logged into Barton.

SMB is a different beast.  On Windows it can get pretty ugly if you're doing this with Windows Explorer.  The Microsoft people couldn't seem to keep it simple, and there's all this extra analysis on the files during the copy operation which adds a bunch of overhead (it's digging for file properties, icons and so forth)

SSH or local login should theoretically always be faster.


You have to use the following syntax
deb http://download.mono-project.com/repo/ubuntu bionic/snapshots/5.18 main

In the above line bionic is used because it has 5.18 branch.
But this will not work on Ubuntu 20.04 LTS because of outdated dependencies.
So you have to consider using Docker or VM with 18.04 LTS inside to proceed.


Ubuntu 18.04 missing dnsmasq service after install

Install dnsmasq via

sudo apt install dnsmasq

at it contains the required service file :

$ dpkg-query -L dnsmasq | grep service -i
/lib/systemd/system/dnsmasq.service

So the only thing you need to do is to enable the service to be executed during bootup.

 sudo systemctl enable dnsmasq

And it worked for me in ubuntu server 18.04.

Have fun using ubuntu ;)


error message " Mailing to remote domains not supported" in mutt how to fix

It would seem that the text of this error might originate from exim4 in Debian:

# fgrep remote /var/log/exim4/mainlog.1 | sed -E 's#([ <])[^ <]+@[^ >]+([ >])#\1a@b\2#g' | head -1
2019-01-08 00:47:00 1ggebk-00055M-St ** a@b <a@b> R=nonlocal: Mailing to remote domains not supported
#

It would appear that the solution would be to reconfigure exim4, and within the initial ncurses dialogue, make sure to select the internet site; mail is sent and received directly using SMTP option (in place of what is probably, the local delivery only; not on a network option):

dpkg-reconfigure exim4-config

Note that although the top option implies that mail from the internet would now be accepted, it would appear that even if selected, by default it's still limited to the localhost IPv4/IPv6 addresses for accepting the mail (if you leave the defaults in subsequent prompts of the reconfig), so, it would seem that you don't really have to worry about having the smtp port open on the server to the outside world just by selecting the top-level option (TBH, it then makes little sense why it's not even the default, as sending mail to the outside world is a pretty common operation that generally works without any extra configuration on all BSD systems, for example, unless you're using something like Google Cloud, I guess, where the outgoing SMTP ports are blocked).


Upon startup, go into the BIOS settings. Make the hard drive that has windows on it above the hard drive that has ubuntu on it in the boot order. It should boot to windows after you exit the settings.


Gnome terminal: unable to drag tab outside window

Looks like this was disabled because it causes GNOME Terminal to crash. See bug #769161:

  Christian Persch 2016-08-09 19:38:09 UTC
  I've disabled detaching a tab by DND for now until the gtk bug is
  fixed.


What is a suitable place to ask for help when getting PPA build errors?

You can try on the Launchpad Users' mailing list:
launchpad-users@lists.launchpad.net
Or the #ubuntu-packaging channel on irc.freenode.net
And of course, right here on AskUbuntu: launchpad


Booting Ubuntu 18.04 strange white/green/blue background

From the comments...

Attempt at fix #1:

Edit /etc/default/grub and change

#GRUB_GFXMODE=640x480

to

GRUB_GFXMODE=640x480

Then do

sudo update-grub
reboot

Attempt at fix #2:

Edit /etc/gdm3/custom.conf and change

#WaylandEnable=false

to

WaylandEnable=false

Reboot and see if that helps.

Attempt at fix #3:

In terminal...

sudo update-initramfs -c
reboot

Update #1:

The user is appears to be running on a USB flash drive created with mkusb, with persistence... but they're not able to do fix #3... "read only file system" error. This fix won't work on a USB Live system.

Recommend installing Ubuntu on a standard HDD or SDD.


After installing the driver, if it still doesn't work, you can try to disable the dedicated graphic card via the Catalyst Control Center (amdcccle or amdcccle-updates, depending on the driver).

In this way you will only use the Intel card integrated in the i3 CPU.

This has a couple of side effects.

almost surely suspension (and maybe even hybernation) will work
you will consume a lot less power when on battery (the AMD card will be switched off)
if you need more graphic power you can always reactivate your card via the Catalyst Control Center and reboot (with Nvidia you just need a logout-login, maybe that is enough also for AMD)


How to turn on Night Light Blue Light filter in Ubuntu 20.04

The Night Light filter, also known as Blue Light filter or Color Temperature filter, is a bit hard to find in Ubuntu 20.04. It's found here:

Open the Show Applications by clicking on the 9 dots in the lower
left of the screen.
In the 'type to search' textbox (top of screen), type 'Settings'; click on the Settings icon to open the Settings app.
In the Settings window, choose Displays in the left-side list of setting topics.
In the title bar at the very top of the window, choose the Night Light tab.
Turn on the Night Light / blue light filter using the on/off slider.

You can either use the built-in automatic schedule or switch to Manual Schedule using the combobox labeled 'Schedule'. Set the times and the color temp to your preferences. (I set the times as 00:00 to 23:59 so the filter is on all the time.


Bypass the yes/no prompt in 'apt-get upgrade'

Sure, although I have never tried it as an alias but it should work:

sudo apt-get update && sudo apt-get -y upgrade


I had this problem yesterday when attempting to upgrade, for me it seems that the connection to the Ubuntu servers was too to slow for the installer to connect properly. Either wait a few days until the hype calms down or try waiting till later on at night (when I upgraded mine) when the servers are less busy.

Another suggestion would be to try and find the best server for you area by having a look at this question. I found the second answer best as you can let the computer automatically choose the best server for your connection.

Alternatively you could download the .iso from the Ubuntu website, create a live CD or USB and upgrade that way.

Hope this answers your question.


If needed, use a liveCD and open the Disk Utility or GParted to remove or reformat partitions.
You should be able to do this during installation as well.

Your boot options are likely due to the dual boot with windows. Make sure you've assigned the boot partition to be managed by windows or it will ignore one or the other.

http://www.dedoimedo.com/computers/dual-boot-windows-7-ubuntu.html

Pay special attention to the part about configuring the bootloader.