Python 2.7 script using curses being automatically backgrounded when halfdelay or cbreak is called

The issue was that curses was trying to hijack tty1 (which was already in use) and therefore in order to prevent the current terminal from being hijacked the OS backgrounds the problem


How do I port my settings from my Desktop to Laptop

on the old PC:

  dpkg --get-selections  > backup.pkg.lst

on the new PC - install Ubuntu with default packages
copy backup.pkg.lst from the old PC to the new one

  sudo su
  dpkg --set-selections < backup.pkg.lst
  apt-get update
  apt-get dselect-upgrade
  apt-get dist-upgrade
  apt-get upgrade

copy home directory from old PC to the new one


Yep, OpenGL http://en.wikipedia.org/wiki/OpenGL is a software API which may use hardware capabilities of the card or software emulation to render 3D scenes.

Pixel shaders http://en.wikipedia.org/wiki/Pixel_shader are one of the card's hardware features and supported by OpenGL 2.0 and above.

Mesa3D http://en.wikipedia.org/wiki/Mesa_3D is an open-source implementation of OpenGL API which has software mode and fully supports OpenGL up to 3.0, so I suppose it should be able to render shaders in one form or another.

The catch, however, is that it's going to be painfully slow - there's a reason why they call video cards "3D accelerators"


I think you are experiencing the same problem as described here which says there is some problem in the bindings/java/ivysettings.xml in locating the repositories for sqlite-jdbc-3.8.0-SNAPSHOT.jar.

Currently it looks in http://oss.sonatype.org/content/repositories/snapshots/org/xerial/sqlite-jdbc/3.8.0-SNAPSHOT/sqlite-jdbc-3.8.0-SNAPSHOT.jar

but the file Ivy wants is actually at

https://oss.sonatype.org/content/repositories/snapshots/org/xerial/sqlite-jdbc/3.8.0-SNAPSHOT/sqlite-jdbc-3.8.0-20130827.035027-1.jar


How do I update ubuntu packages 16.04 with Terminal?

Ubuntu 16.04 uses the apt package manager.  To update from the terminal command line type in the following:

sudo apt update
sudo apt upgrade

or to get a full explanation of all apt commands, run

man apt

which will show you pages like this:

APT(8)                                APT                               APT(8)

NAME
       apt - command-line interface

SYNOPSIS
       apt [-h] [-o=config_string] [-c=config_file] [-t=target_release]
           [-a=architecture] {list | search | show | update |
           install pkg [{=pkg_version_number | /target_release}]...  |
           remove pkg...  | upgrade | full-upgrade | edit-sources |
           {-v | --version} | {-h | --help}}

DESCRIPTION
       apt provides a high-level commandline interface for the package
       management system. It is intended as an end user interface and enables
       some options better suited for interactive usage by default compared to
       more specialized APT tools like apt-get(8) and apt-cache(8).

       Much like apt itself, its manpage is intended as an end user interface
       and as such only mentions the most used commands and options partly to
       not duplicate information in multiple places and partly to avoid
       overwhelming readers with a cornucopia of options and details.

       update (apt-get(8))
           update is used to download package information from all configured
           sources. Other commands operate on this data to e.g. perform
           package upgrades or search in and display details about all
           packages available for installation.

       upgrade (apt-get(8))
           upgrade is used to install available upgrades of all packages
           currently installed on the system from the sources configured via
           sources.list(5). New packages will be installed if required to
           statisfy dependencies, but existing packages will never be removed.
           If an upgrade for a package requires the remove of an installed
           package the upgrade for this package isn't performed.

       full-upgrade (apt-get(8))
           full-upgrade performs the function of upgrade but will remove
           currently installed packages if this is needed to upgrade the
           system as a whole.

       install, remove, purge (apt-get(8))
           Performs the requested action on one or more packages specified via
           regex(7), glob(7) or exact match. The requested action can be
           overridden for specific packages by append a plus (+) to the

Hope this helps!


xfce4-session segfault, suspend and hibernate not working

I think this usually happens on machines running 64 bit Ubuntu. An updated package hasn't been released yet, but the necessary patch is in git master for xfce4-session, so you could compile from there. Otherwise, probably best to use another desktop environment if you are doing critical work on your machine.

Extra note for other readers: (If you are using the xfce 4.10 ppa on 12.04, the fixed package has been released; I'm not sure whether there has been an official update yet for 13.04)

Compilation from git:

(For build-dep to work, you need to go to software sources and enable source code by checking the box. Then run sudo apt-get update and any subsequent build-dep commands should work.)

sudo apt-get install build-essential git xfce4-dev-tools libxfce4ui-1-dev libxfce4util-dev checkinstall
sudo apt-get build-dep xfce4-session

Now, gain the source from git and build (I compared the default options from the package source and they are no significant differences, apart from debug level)

git clone git://git.xfce.org/xfce/xfce4-session
cd xfce4-session
./autogen.sh --prefix=/usr --sysconfdir=/etc
make
sudo apt-get remove --purge xfce4-session
sudo checkinstall --pkgname=xfce4-session --pkgversion=4.10.1 --provides=xfce4-session

Now logout and login to activate the new session.

As this is development code, there might be other issues. So if you have any problems preventing you login at the lightdm screen with this new xfce4-session, press ctrl-alt-f1 and login at the console and remove this package and reinstall the normal repository version. Then return to the lightdm screen with alt+f7.

This package may be overwritten (depending on the versions) when the official fix comes out, but that will be fine.

You can of course remove this version and reinstall the package version, although this new version should solve most of the issues.


How to write bash script to open vi and edit document?

you might want to use ed (which is designed to automate scripting):
ed < edit.sed filename.pdf

where edit.sed is:
4,7d
a
<<>>
.
w
q

This will insert <<>> in the fifth line.


Bluetooth only recognized after waking from suspend

So the problem solved itself when upgrading from 16.04 to 18.04. Sorry I cannot give more details. Before (years ago) when I used linuxmint with the same computer I did not have this problem which came when I switched to ubuntu (I think it was 16.04 back then), so there must be a way to solve this.

Good luck


The easy way

Polly recently added a PPA - to add it, run the following:

sudo add-apt-repository ppa:conscioususer/polly-daily && sudo apt-get update && sudo apt-get install polly

Then, just select "Polly" to run from the Unity Dash, or run polly from a terminal if you want to catch the messages/output/etc.

Outdated instructions that are being kept for future reference:

Fairly simple to run it. This won't install it properly, it'll just download the python files to your home directory and run them. But it works.

cd ~
sudo apt-get install python-socksipy python-oauth2 python-numpy bzr
bzr branch lp:polly

~/polly/polly

If you want to make a launcher, just have it run ~/polly/polly or /home/username/polly/polly.

You'll want to keep it updated on a regular basis. To do that, run:

cd ~/polly && bzr update


Just simply rm '1.abc!``!+123'. Note about '

Note:Quoting is used to remove the special meaning of certain characters or words to the shell. Quoting can be used to disable  special  treatment for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion. Some special characters are: $ ` " !


Create a launcher icon for PS3 media server

Foud that installing the version here http://www.ps3mediaserver.org/forum/viewtopic.php?f=3&t=13046 installs the program as a system utility allowing a icon to be locked to the launcher.


Problem during installation from USB: BOOT ERROR

My suggestion is to use Unetbootin:

Install unetbootin. You can download for windows from here.
Open the software, choose your ISO and USB-drive. After that click "ok".
Restart your computer and make it so the computer runs from the USB at start-up. (You'll need to go to the BIOS)

About you being unable to open ubuntu-documentation, we need more information.


Yes there is, read-edid hardware information-gathering tool for VESA PnP monitors. This tool have two commands: get-edid and parse-edid:  tools to retrieve and interpret monitor specifications using the VESA VBE DDC protocol. EDID (Extended Display Identification Data) is a metadata format for display devices to describe their capabilities to a video source.

First:

sudo apt-get install read-edid

Then try:

sudo get-edid | parse-edid


I would like to add the following lines to the /etc/apt/sources.list.d

You can add this way.  Open System Settings, and click on Software & Updates, and add the following lines as shown in the images below.

deb http://files.freedv.org/debian/ precise main
deb-src http://files.freedv.org/debian/ precise main

You may be asked for your password.


Speakers make tiny crackle noise every second, then trackpad stops working on a Dell Studio XPS 1640

OP's question first:

The ticking is most probably caused by one of three factors:

PulseAudio/Alsa problem, but muting should usually fix that
Driver/hardware problem, e.g. with the Realtek codec chip -- not fixable without further troubleshooting, may not even be fixable.
Electrical/RF interference issue, like the clicking you hear in unshielded speakers when a GSM cell phone is nearby and is transmitting/receiving -- this would be the most likely explanation considering that a touchpad failure always follows. Perhaps something wrong with the touchpad's USB or PS/2 connection, or its driver?

Your (function)'s issue:

Since you're sure this seems to be a Google Chrome issue, you should check by installing the pavucontrol package, starting Pulse Audio Volume Control and Chrome, and checking to see if you see sources like the below in the Playback tab, along with associated VU meter activity:

If you see any, try with Chromium too and consider filing a bug.
If not, this may not be a Chrome issue and you may have problems similar to the OP's.


How do I get Realtek RTL8723BE wireless card to work on 18.04?

I was able to answer my own question. I should have taken more time to think through what the ppa was doing in the first place. Here are the steps:

Go to the the webpage:
https://launchpad.net/~hanipouspilot/+archive/ubuntu/rtlwifi/+packages
Expand the arrow to the left of the listed driver:
rtl8192eu-dkms - 4.3.1.1.11320.20140505~trusty1
Scroll down to the third driver listed under "Packages" named:
rtl8192eu-dkms_4.3.1.1.11320.20140505~trusty1_all.deb (1.0 MiB)
click on it to download it.
change directory in terminal so you are in the same folder as the downloaded deb file and add executable rights with chmod +x rtl8192eu-dkms_4.3.1.1.11320.20140505~trusty1_all.deb
Then run the command sudo dpkg -i rtl8192eu-dkms_4.3.1.1.11320.20140505~trusty1_all.deb (it will produce an error)
Next execute sudo apt --fix-broken install
Then run the command sudo dpkg --configure -a
Now rerun the command sudo dpkg -i rtl8192eu-dkms_4.3.1.1.11320.20140505~trusty1_all.deb this time will it will get a lot further. However it still produces an error.

Even though there were errors when I followed the above steps my card started working. I found my access point and joined it. It is working normally now. I hope this helps anyone having similar issues with the realtek cards.


3.12 isn't that different from 3.10, so you can just install Gnome Shell from the official repositories without using the PPAs:

sudo apt-get install gnome-shell gnome-tweak-tool

To install GNOME 3.12 on Ubuntu 14.04, you have to use the GNOME3 Staging PPA (which itself depends on the GNOME3 PPA). Be warned that this can break things.

sudo add-apt-repository ppa:gnome3-team/gnome3
sudo add-apt-repository ppa:gnome3-team/gnome3-staging
sudo apt-get update
sudo apt-get install gnome-shell gnome-tweak-tool


About installing packages in Ubuntu 18.04

You can download most ubuntu packages from this sight. Download form a connected machine and copy to usb/dvd etc.
and then install them using the terminal command dpkg
The catch is you'll have to make sure that all dependencies are met. Which can be very time consuming.  It would be much better to find a way to connect the machine at least temporarily to the internet.


I would recommend either making an init startup script or adding it via the "Startup Applications" program which is built in.
Since you are using a sudo command I believe you will need to edit the sudoers to allow that command without asking for a password.
This link has some additional info.

We could make a program to do it easily so that it can be run as an application?

    //resetbt.c
    #include <stdio.h>
    #include <stdlib.h>
    int main(void)
    {
      int x;
      int attempts = 0;
      while(attempts < 20)
      {
        x = system("hcitool scan");
        usleep("500000"); //added a little wait state
        printf("%d", x);
        if(x != -1 && x == THE_CORRECT_VALUE_OF_X_FOR_SUCCESS_OF_FIRST_COMMAND) //the printf echos a number, check for when its working and when its not. Change the value to be the one it returns when its working
        {
          system("sudo hidd --connect AA:BB:CC:DD:EE:FF");
          exit(EXIT_SUCCESS);
        }
        attempts++;
      }
    }

Compiled with gcc:

    gcc resetbt.c -o reset.bin


Cannot increase partition size although there is free space

I think you are confused because the empty space is not easily accessible. You need to move all the partitions around to expand the one you want. But just to be sure, I tried a test run on a blank disk.

In short, you need to:

Move sdb6 and sdb5 all the way to the right
Resize sdb2 (the extended partition) to open up space at its start (left side)
Expand sdb1 into the space we just opened up

Screenshots:

Setup

About to apply changes

Done

BTW, the disk name "sdb" just happened to match. I didn't plan that.


Gave up waiting for root device, ubuntu--vg-root doesnt exist

In certain Ubuntu versions (e.g. Xubuntu 18.10) this issue might be caused by an apt autoremove. Due to this bug apt will suggest to remove
cryptsetup cryptsetup-bin cryptsetup-initramfs cryptsetup-run dmeventd libdevmapper-event1.02.1 liblvm2app2.2 liblvm2cmd2.02 libreadline5 lvm2

which makes the system non-bootable (because the root partiation cannot be mounted and unencrypted using LVM).
If you are not using LVM and disk encryption this answer is probably not for you.
I was able to fix it by re-installing cryptsetup and lvm2 in a chroot environment: boot from a live USB stick, run commands below in a terminal, reboot.
# find root partition
sudo fdisk -l

# unencrypt partition
#   Note: replace /dev/nvme0n1p3 with your disk
#         replace "nvme0n1p3_crypt" with the correct name
#         check by running this in chroot:
#         $ cat /etc/crypttab | cut -f1 -d " "
#         nvme0n1p3_crypt
sudo cryptsetup luksOpen /dev/nvme0n1p3 nvme0n1p3_crypt

# mount root partition
sudo vgscan
sudo vgchange -ay
sudo mount /dev/mapper/xubuntu--vg-root /mnt

# prepare chroot environment
sudo mount /dev/nvme0n1p2 /mnt/boot/   # replace nvme0n1p2 with your boot partition!
sudo mount -o rbind /dev/ /mnt/dev/
sudo mount -t proc proc /mnt/proc/
sudo mount -t sysfs sys /mnt/sys/

# make dns available in chroot
sudo cp /etc/resolv.conf  /mnt/etc/resolv.conf

# enter chroot
sudo chroot /mnt /bin/bash

# re-install missing packages
apt install cryptsetup lvm2

# re-generate  (this might be done also by apt in the step before, I'm not sure)
update-initramfs -u -k all

# Leave chroot environment - not sure if the following is really necessary...
exit
# Write buffers to disk
sudo sync
# Unmount file systems
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt/boot

This Q&A helped me collecting the commands.
This Q&A is kind of related, but maybe not relevant for you anylonger if you are having this issue already.


I assume that you are planning to use WUBI from within Windows.

It's not necessary to uninstall Ubuntu from that partition. You can simply stop using it. It causes no difficulty to have several Ubuntu versions on one disk. In fact I do that all of the time. You should probably, simply, install WUBI and use that by booting into Windows at your current prompt.

You might want to make windows your default boot entry for your convenience. See How do I set Windows to boot as the default in the boot loader? I understand that this is a way to make your system boot into Windows the way it originally did.


MAAS can't deploy Ubuntu Server due to missing boot kernel

Yes, maas-import-pxe-files should download all these files, for the Ubuntu releases listed in /etc/maas/import_pxe_files.

So edit that file and make sure the setting for RELEASES includes quantal!  Then run the import script again, and see if it fixes the problem.


How to import bookmarks from HTML in Firefox?

See if you can access:

Open Firefox and hover over the top left bar, under Bookmarks,
select Show All Bookmarks.
Maximize the Library window.
Click onto the Library window at the top to select it, now the top
menu changes as you hover over the top left bar again, select Import
and Backup and import your HTML.


I am also new to Linux. I think I have the same issue as you. I confront it while solving the blue screen issue following the last answer to this post
Stuck on blue screen while booting the system .

When I saw this information, I simply restart the computer by pressing the button and it recovered from the blue screen issue.

Hope this helps.


VirtualBox won't boot the VM, I tried almost everything

I had this problem after updating Ubuntu:

Please, try reinstalling virtualbox-dkms:
sudo apt-get install --reinstall virtualbox-dkms

I found this suggestion here: https://ubuntuforums.org/showthread.php?t=2320523.


Thumb Drive install not recognizing my computer's HDD

This might be an odd suggestion but I've had it happen, use a gparted live cd to format the harddrive to ntfs. Then try to install from your external drive. Hope this helps.


Qt/KDE camera app alternative to Cheese in Kubuntu 18.04?

According to the description in apt show kamoso, it's a "tool to take pictures and videos from your webcam".

If you want to read about it before installing, the man page for 18.04 is here: http://manpages.ubuntu.com/manpages/bionic/en/man1/kamoso.1.html.

There's also https://userbase.kde.org/Kamoso and https://github.com/KDE/kamoso/

sudo apt install kamoso


With the budgie 10.x series there is not a way to autohide the top-panel.

If vertical screen estate is your key issue then I would suggest you checkout budgie-pixel-saver-applet.  It is available in the 17.04 backports repository.  For non CSD apps - the top-bar in maximized apps like chromium are combined with the top-panel.

Backports can be enabled through the welcome application - it is in the Recommendations part of the app.


The most easy to deploy and use tool is TeamViewer (which is crossplatfrom). You don't need to register, bring up tunnels or anything else (of course if you don't have restrictions in your home network). You just should have running TeamViewer on another computer and have automatically-generated number and password of remote machine.

The other ways is to bring up VNC server on remote machine, but you should make VNC ports forwarded to machine's public address or bring DDNS on remote router (and forward ports too), which one way is harder then first.

There is also RDP protocol realisation on Linux (Ubuntu as well), way to make it works same as VNC.

And of course CLI access done by ssh. Bring up SSH server on remote computer, forward it's port to public address and do your best, you can't access desktop in that case, but can run X11 applications of remote computer via SSH, see SSH X11 forwarding for that case.


How can I change the color of my cursor in gnome-terminal?

There's an escape sequence for that:

echo -ne '\e]12;#ffcc00\a'

or you can also use symbolic color names:

echo -ne '\e]12;pink\a'


APCUPSD: Cannot find UPS on ANY serial port

Note to self: don't expect an RS232 cable to work with an RS422 port.

Solved by using an RS232 port.


Cannot adjust screen brightness 20.04 AMD APU

I have the same laptop as yours and to fix the brightness problem you can upgrade to latest kernel (I use 5.8) by using various kernel updater such as (https://github.com/bkw777/mainline or https://github.com/pimlie/ubuntu-mainline-kernel.sh)
Example instruction using https://github.com/pimlie/ubuntu-mainline-kernel.sh
sudo apt install wget
wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh
chmod +x ubuntu-mainline-kernel.sh
sudo mv ubuntu-mainline-kernel.sh /usr/local/bin/

sudo ubuntu-mainline-kernel.sh -i


How to run java 1.5 applets inside my web browser?

You don't need to downgrade your Java. Java 6 can run Java 5 (or 1.5) applet. You just need to install the plug-in for your browser.

It depends on which flavour of Java you're using:

if using openjdk, install icedtea6-plugin
if using sun-java6, install sun-java6-plugin

Both packages are installable via Synaptics or the command line using apt-get.

If you're using the Ubuntu Software Centre look for respectively:

Icedtea Java Plugin
Sun Java 6.0 Plugin


Swiched off power during suspend, now only booting into emergency mode

It seems to have been some strange file system or partitioning issue.  After commenting out all partitions except / in the fstab, I could boot normally, except for /home being present, of course.  All partitions did (where possible) check fine with Gparted's file system checking utility.
Reactivating all partitions one after the other, I found out -- nothing.  It just works again.
Whatever that was...

Update: the fact that the mainboard failed one day after this experience likely has something to do with this.


Unlike those in user's crontabs, jobs in /etc/cron.d (like those in the /etc/crontab system-wide crontab file) need an additional field to specify the user e.g.

* * * * * root touch /var/www/html/myFile

From man 8 cron:

   Additionally, in Debian, cron reads the files in the /etc/cron.d direc‐
   tory.  cron treats the files in /etc/cron.d as in the same way  as  the
   /etc/crontab  file  (they  follow the special format of that file, i.e.
   they  include  the  user  field).


Sadly nor the window manager ( metacity or compiz ) nor Xorg serve that purpose.

In Ubuntu ( and any GNU/Linux in general ) remembering the last window location is up to the application. (As far as I can remember Firefox do that, and so Gedit ).

As you said Compiz has fine control on where to place which application window, but not the simple option of remembering its last status.

Please refer also to these idea in Brainstorm:

http://brainstorm.ubuntu.com/idea/25654/
http://brainstorm.ubuntu.com/idea/1442/

and this bug ( marked as Wontfix ):

https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/124315


How to set LC_NUMERIC to English permanently?

Append the value to your ~/.bashrc file:

echo 'export LC_NUMERIC="en_US.UTF-8"' >>~/.bashrc

To make it applicable from the current session of bash, source the ~/.bashrc file:

source ~/.bashrc

Example: Here i am changing from en_US.UTF-8 to C:

$ locale | grep LC_NUMERIC
LC_NUMERIC="en_US.UTF-8"

$ echo 'export LC_NUMERIC="C"' >>~/.bashrc

$ source ~/.bashrc

$ locale | grep LC_NUMERIC
LC_NUMERIC=C

This will change the locale for only the user running the command, for system wide change you need to add the value to /etc/default/locale, check the added portion below.

You can also add the value to the systmwide locale file, /etc/default/locale, which will be read at start. To put it there:

echo 'LC_NUMERIC="en_US.UTF-8"' | sudo tee -a /etc/default/locale

Or

sudo bash -c 'echo "LC_NUMERIC=\"en_US.UTF-8\"" >>/etc/default/locale'


When I turn on my VPN, I lose internet connection

Fixed by moving file /etc/systemd/system/openvpn-iptables.service .
Note that this will probably not help you. This was only a problem because I was experimenting and accidentally created that file, but it still is worth checking for it.


how to copy a folder into another folder

sudo cp -Rpf /home/practice/app/asset /var/www/html/


To share a printer attached to a computer on the network open the printer dialog from the menu on the cogwheel on the to panel side. Choose the printer with a right click and tick "Share" to enable sharing. Mext open "Server -> Settings..." from the panel menu as shown here:

This will open the following window

Select "Show printers shared by other systems" on the remote client, or "Publish shared printers cnnected to to this system" to make them visible to others on the net.


kubuntu 12.10 - problem with netbeans 7.3 and java

Install packages java-7-installer and java-7-set-default.

You can remove java-8-installer, as Java 8 is not yet officialy released.


The software-center will have only the versions of software as available at the time of release of the distro.  These versions are considered stable and only stability & security fixes are released.

Very rarely are complete new versions made available on stable releases - this is especially true for LTS releases.

The normal mechanism to test new versions of software is via testing PPAs - you can search for these on launchpad.net

I've had a quick look but have not found a v4 of python-envisage  that has been backported for Lucid.

Thus a number of possible solutions (although not exhaustive...) are:

stick with the version you are using
upgrade to 11.10 (through 10.10 & 11.04)
install a virtualisation solution to run 11.10
dual boot with 11.10
... and if you are feeling particularly brave - compile from source.


My suggestion is the following script that will get the data of incoming and outgoing traffic from ifconfig interface-name and will compare the sum with a predefined limit value. This action will be repeated every 5 seconds (for example).

When the amount of the traffic (income+outcome) becomes equal or greater than the limit, the script will disable the target interface and exit. The maximum discrepancy between the actual value at which the interface will be disabled and the limit value will be equal to 5s x MaxSpeed.

The script can be executed by Cron job. So you will be able to set different job for each day of the week, etc. Additionally when the limit is reached you can run the script manually with an additional amount of traffic.

The script name should be traffic-watch, otherwise you should change its 5th line. My suggestion is to place it in /usr/local/bin, thus it will be available as shell command. Don't forget to make it executable: chmod +x /usr/local/bin/traffic-watch.

The script should be executed as root (sudo). It creates a log file: /tmp/traffic-watch-interface-name.log, where you can check the last action. The script has two input variables:

$1=$LIMIT - the value of the traffic limit in MB - the default value is 400.
$2=$IFACE - the name of the target network interface - the default value is eth0.
If you want to override these values during the execution of the script, use these formats:

traffic-watch "250" "enp0s25"
traffic-watch "250"
traffic-watch "" "enp0s25"

Use 'traffic-watch' with 'crontab'. If you want to run the script every morning at 6:30, open root's Crontab (sudo crontab -e) and add this line:

30 6 * * * /usr/local/bin/traffic-watch 2>/dev/null

Use 'traffic-watch' manually. To run the script as root and push it into the background we shall use sudo -b:

sudo -b traffic-watch "150" 2>/dev/null

The content of the script 'traffic-watch' is:

#!/bin/bash

# Initialize
[ -z "${1}" ] && LIMIT="400"  || LIMIT="$1" # Set the total traffic daily limit in MB
[ -z "${2}" ] && IFACE="eth0" || IFACE="$2" # Set the name of the target interface
LOG="/tmp/traffic-watch-$IFACE.log"         # Set the log file name
LANG=C                                      # Set envvar $LANG to `C` due to grep, awk, etc.
IPPT='[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'       # Set IP address match pattern #IPPT='[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'

NIC="$(/sbin/ethtool -i "$IFACE" | awk 'FS=": " {print $2; exit}')" # Get the $IFACE (NIC) driver

# Function: Get the current traffic
get_traffic(){
    RX="$(/sbin/ifconfig "$IFACE" | grep -Po "RX bytes:[0-9]+" | sed 's/RX bytes://')" # Get the incoming traffic
    TX="$(/sbin/ifconfig "$IFACE" | grep -Po "TX bytes:[0-9]+" | sed 's/TX bytes://')" # Get the outgoing traffic
    XB=$(( RX + TX ))                                                            # Calculate the total traffic
    XM=$(( XB / ( 1000 * 1000 ) ))                                               # Convert the total traffic in MB
}

# Functions: Disable the interface
interface_down(){ /sbin/ifconfig "$IFACE" down 2>/dev/null && exit; }

# Function: Reset the traffic and enable the interface
reset_traffic_interface_up(){ /sbin/modprobe -r "$NIC" 2>/dev/null && /sbin/modprobe "$NIC" 2>/dev/null && /sbin/ifconfig "$IFACE" up 2>/dev/null; }

# Function: Get the IP address
get_ip(){ /sbin/ifconfig "$IFACE" 2>/dev/null | grep -Po "${IPPT}" | head -1; }

# --- The main program ---

reset_traffic_interface_up

# Wait until the IP address is obtained
until [[ "$(get_ip)" =~ ${IPPT} ]]; do sleep 1; done

# While the interface has IP address == while it is up; check if it is up on every 5 seconds (the `time` of the cycle is about 75 ms)
while [[ "$(get_ip)" =~ ${IPPT} ]]; do

    get_traffic

    # Start logging
    printf '\n%s\n\nI-face:\t%s\nDriver:\t%s\nIP:\t%s\n' "$(date)" "$IFACE" "$NIC" "$(get_ip)" > "$LOG"
    printf '\nRX:\t%s\nTX:\t%s\nXB:\t%s\nXM:\t%s\n' "$RX" "$TX" "$XB" "$XM" >> "$LOG"

    if (( XM >= LIMIT )); then
        printf '\nThe daily limit of %s MB was reached.' "$LIMIT" >> "$LOG"
        printf '  The interface %s was disabled!\n\n' "$IFACE" >> "$LOG"
        interface_down
    else
            printf '\n%s MB remains on %s.\n\n' "$(( LIMIT - XM ))" "$IFACE" >> "$LOG"
    fi

    # Debug:    cat "$LOG"

    sleep 5 ## *Adjust this value* ##

done; interface_down

Notes:

Disable the script when you update and upgrade the system! The lack of internet could be cause of broken packages.
It is a good idea to attempt to kill the previous instance of the script (just in case its limit is not reached) before run a new:

sudo pkill traffic-watch
sudo -b traffic-watch "150" 2>/dev/null

29 6 * * * /usr/bin/pkill traffic-watch 2>/dev/null
30 6 * * * /usr/local/bin/traffic-watch 2>/dev/null

Probably 2>/dev/null is not obligatory, because, I think all, errors are redirected to /dev/null by the script itself.
To check the remaining traffic remotely you can use this command:

ssh user@host.or.ip tail -n3 /tmp/traffic-watch-eth0.log

Thanks to @Dessert for this idea! (Replace eth0 with the actual interface in use.)
To get back your network interface UP: First ise ifconfig -a to find its name. Then sudo ifconfig INTERFACE up.
This script could be recreated to work with iptables instead ofifconfig - up/down. This will be a powerful solution.
The script is available as GitHub repository at: https://github.com/pa4080/traffic-watch
Another script, based on the current, that only will get the traffic for a period of time is provided here: How to get the current network traffic via the commandline in a simple format.

References:

How to reset ifconfig counters?
execute script when network interface is up
More about the calculations
How to get TX/RX bytes without ifconfig


How do I change default printer resolution in Ubuntu 12.04?

Launch your web-browser.
Type "localhost:631" in the web-browser's address bar and press ENTER key. CUPS page will open. CUPS is the standards-based, open source printing system.
In the main menu click on the "Printers" menu.
Click on the name of printer you want to modify.
Click on "Administration" and choose option "Set default options"
Set settings and click on button "Set Default Options"


Problem with the keyboard layout in Emacs (ubuntu 12.04)

Workaround: Put Dvorak as first layout, not as second or third. At least while using Emacs.

I have the same problem. It also happens in other applications, so I think it is an issue of the whole graphical environment.

For example, in the Firefox tool to find a word in the current page (to use it press Control-F and then type the word), you can check that to find the next appearance (Alt-N) you have to press the physical N key, disregarding the fact that you are currently using Dvorak layout.

So a more precise description of the feature/bug is the following: In the graphical environment, pressing Alt reverts to the primary layout (which is usually the physical layout, that is, when the behaviour of the keys matches the labels of the physical keyboard).

I guess this makes sense for someone since the Alt key is almost exclusively used to interact with the desktop environment, for example Alt+TAB to switch windows, and this is sometimes done without previously placing the hands in the touch-type position. In that case it is useful to be able to locate the key by sight instead of by thought.

I don't think it is effective overall, since for example Control-C is also used very often to copy text that has been selected with the mouse, so in this case users will still have to locate the C by thought.

Anyway, the real problem comes in mainly when using Emacs, in which the Alt key (called Meta) is used while the hands are in the touch-type position. For example you press M-x to enter a command by name, M-b to move backwards by a word, M-e to move to the end of the sentence, etc..

In my case, I have a Spanish physical keyboard and use Spanish as first layout and Dvorak Spanish as second layout. I touch-type Dvorak, but want the system to start with the behaviour of the keys matching their label since it would be otherwise annoying, especially to other users. So it seems that in Ubuntu 12.04 I have to drop this pretension to have a usable Emacs.


What media (music and video) players are there?

VLC Media Player

VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols.
Features:

Simple, fast and powerful media player.

Plays everything: Files, Discs, Webcams, Devices and Streams.

Plays most codecs with no codec packs needed: MPEG-2, DivX, H.264,
MKV, WebM, WMV, MP3...

Runs on all platforms: Windows, Linux, Mac OS X, Unix...

Completely Free, 0 spyware, 0 ads and no user tracking.

Can do media conversion and streaming.

From the VLC media player home page.

(source: hostmar.co)
I was using it the other day to play back 3 720p videos simultaneously on a 1 1/2 year old HP notebook. Performance was flawless.
Very advanced customizations/settings.

Separate window that includes playlist, file browser, external devices and local network access, internet features (radios, postacasts, Freebox TV channels for registered users)

(Using skins reduces the easy access to some of these features.)
VLC media player supports many audio and video compression methods and file formats, including DVD-video, video CD and streaming protocols. It is able to stream over computer network and to transcode multimedia files. (from Wikipedia)

It can use extensions, plugins and skins - to be downloaded from addons.videolan.org.
Among these, some that can find movie subtitles. (More answers on this: here and here.)


Clamav False Positive and Linux Viruses statistics

Is there some "Official" web page where we could find all the known Linux viruses status (real known malware, etc)? Is there something like this, where? ???

Wikipedia has a good run down on threats and the likes and they also keep a list of virus and other malware (the list is not complete but there are 27 noteworthy). None of them you will find on your system as most "never left the laboratory ". Most will work but require effort from the owner of the machine to make it work (like actually downloading and installing the virus yourself).

There is a more detailed description on unixmen on the most important. Do look at the dates: most are ancient. Security updates are quick to arrive on our machines so if someone found a security hole it will be plugged quickly.

If you start looking for an actual list: do not trust the owners of virus scanners. They make up stuff. A lot. Just to make you sell their scanners.


How to get the download file name of apt-get download?

Here is a script named downloadthis.

#!/bin/bash
for i in $(apt-cache show $1 | grep Version | sed 's/^Version..//g')
 do apt-get download $1
 dpkg-deb -x "$1"*"$i"*deb $2
 done

Don't forget to make it executable.

Here is an example of use:

./downloadthis libopencv-dev

The script will create a directory named libopencv-dev in your home directory. You can edit the script and change ~/$1 to another path (like /my/path for example).

Alternatively, you could edit the script and change ~/$1 to ~/$2 to allow you to specify the extract directory when you run the script.

Here is an example of this use:

./downloadthis libopencv-dev /my/path


Why a system crash after latest kernel upgrade to 4.15.0-24?

I had the same problem. In my considered opinion, the issue is related to the incompatibility between the 4.15 kernel and the Nvidia driver (340, in my case).
Steps I took to solve the problem:

At the boot I pressed Esc and went to the grub options.
I chose the 4.13 kernel and the system booted up.
I installed grub-customizer and changed the kernel position at boot, to avoid do the same each time... But this process is not so complicated because we had already the previous 4.13 kernel installed, because this was not a 18.04 fresh install.

Optional:

You may enter the following command in a terminal:
 sudo apt install haveged,

as described in this bug here


Can I allocate everything to '/' and a small amount to '/home'?

/home is the place for the users' personal data e.g. Documents, Music and Movies as well as the programs configuration files.

Programs are installed in /usr/bin or /usr/local/bin (--> in the / partition).

20G for the system and programs in my opinion is just not enough. 30G should be enough, but it depends on how much and what type of programs you want to install.

You can change the size of the / partition only by booting from a live system. Use gparted to change the disk sizes.

I personally stopped using separate partitions (then /home will be part of /), but rather do a regular backup of my personal files in /home to an external drive.


Click the anchor icon to bring up the preferences window, click on the dock you want to configure, then tick the '3D Background' box. This option is only available if the dock is on the bottom side of the screen.


After installing eclipse in Ubuntu 18.04 using synaptics, application is unable to launch, showing error

The version of eclipse in Ubuntu 18.04 (and 18.04.1) is broken.

Almost noone use the version of eclipse provided by ubuntu. You should follow the procedure at https://doc.ubuntu-fr.org/eclipse#installation_par_le_nouvel_outil_eclipse_installer and install a more recent version.


Integrate Ubuntu desktop to a Windows network

I use Likewise Open.  Likewise Open website here

Download the free version. I normally extract the download into my home directory.  You can then open terminal, path to the LikewiseOpen directory and follow the below commands.

# chmod  +x LikewiseOpen.sh

# ./LikewiseOpen.sh

Follow the prompts.


Can't add NetworkManager applet to gnome panel

You'll need to start the network manager applet.  It's started by default, although it sounds like you've done some customisation.  Here's a screenshot of my entry :

This is available through system/preferences/startup applications.


I want to change some of the linux files, how to recompile the linux and reinstall it

Ubuntu and Debian have thier own way to rebuild kernel. Methods from other distros DO NOT apply. Here is the right procedure, follow the apt-src way.


Clickable notifications that allow to interact with programs which have spawned them?

KDE notifications

KDE doc page: http://docs.kde.org/development/en/kde-runtime/kcontrol/kcmnotify/index.html

KDE UserBase page: http://userbase.kde.org/System_Settings/Application_and_System_Notifications

Alternative notifications

Colibri: http://kde-apps.org/content/show.php/Colibri?content=117147+kde-apps.org+page

  Colibri notifications look lighter and are completely passive: they do
  not provide any buttons. You may or may not like this...

Ubuntu package available: http://packages.ubuntu.com/search?keywords=colibri&searchon=names&suite=all&section=all

USU Notifications: http://kde-apps.org/content/show.php/?content=158063

  Alternative KDE notifications, based on QML and org.kde.notofications,
  but with more features...

The USU notifications seem to have the option 'to click that notification for the extracted files to be opened in a file manager'

It is a scrip -> Add Widgets > Get New widgets...

Right click the System Tray
System Tray Settings
Disable the standard notifications and enable the USU


I am guessing you are looking for jockey ?

If so

sudo apt-get install jockey-gtk

If not , perhaps gnome-device-manager

sudo apt-get install gnome-device-manager


Why does CTRL not work in VirtualBox VMs?

I have figured out the problem!

The problem was that for some reason when one has the Show location of pointer option enabled in the gnome-tweak-tool, as this is assigned to CTRL, for some reason this prevents programs from capturing this key. So disabling that option in the gnome-tweak-tool fixes the issue.


Ok, I was just being an idiot. I didn't want set bufhidden=hide in my vimrc - that's just for a single buffer. Now that I've changed it to set hidden everything works as I felt it should.


You can resolve this error by removing an extra space after -D
Try running:
cmake -DCMAKE_BUILD_TYPE=RELEASE \
      -DCMAKE_INSTALL_PREFIX=/usr/local \
      -DINSTALL_C_EXAMPLES=ON \
      -DINSTALL_PYTHON_EXAMPLES=ON \
      -DWITH_TBB=ON \
      -DWITH_V4L=ON \
      -DWITH_QT=ON \
      -DWITH_OPENGL=ON \
      -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
      -DBUILD_EXAMPLES=ON ..


How do I set up WiFi on Ubuntu 16.04? It worked fine on Windows and now that I've switched I'm having extremely slow speeds and frequent disconnects

ok, the default drivers in the repository don't work well. you need to install updated drivers.

first you need to be sure to have installed required software.
sudo apt-get install git make dkms

also be sure you have the headers for your kernel installed.
linux-headers-common linux-headers-amd64(if 64bit) kbuild and linux-compiler
they usually auto install each other

WARNING: kernels newer than 4.4 will refuse to load unsigned modules when secure boot is enabled.

next  get the drivers:
git clone https://github.com/lwfinger/rtlwifi_new

navigate to the folder just made 'rtlwifi_new'
cd ~/rtlwifi_new
 and type make then sudo make install

reboot and all should be working


We gonna make Chromium to create new settings to see if we can solve this don't worry for your previous settings you will not lose them if it is not work.

Close Chromium, use Firefox for now or take a photo or a screenshot of my answer before you close it.

Press CtrlAltT to open a terminal:

cd .config
mv chromium chromium_orig

Do not close the terminal yet.

See if Youtube works properly.

If indeed works like it should close terminal and change your settings as you prefer to Chromium

Done.

If still not shows youtube like it should restore to your previous settings:

Close Chromium.

In the opened terminal type:

rm -r chromium
mv chromium_orig chromium

Try to update and reinstall Chromium:

sudo apt-get update
sudo apt-get install --reinstall chromium-browser

Try again Chromium and see if the problem have been solved.


How can I edit a root file on a non-jailbroken iPad?

That is the whole idea of jail breaking: the ability to edit files on the disc that are owned by root. Either you jailbreak the iPad and you can edit the files in /var directly or you can not.
Unless you find out the root password ;)

Regarding the link in comment.

There are 3 situations:

The software you get when you buy Apple products.
3rd party software that replaces the software Apple put on the device and enhance the current features. These use the permissions and or directories that are already open on the device. This includes (but is not limited to) tethering (browsing over the iPad; basically this is telling the kernel to use a module), adding music or pictures, manage installed applications, synch  addressbook/calendars/notes and bookmarks. These things can be added without having root access. They add files to userspace.
Software Apple does not want you to install on the device. These are for instance rootkits, ssh and/or telnet connections. These require you to jailbreak so you can become the root user of the device.

The partition where /var/ is located is most likely mounted as Read Only (heck you can even assume that the whole system is mounted Read Only and only the user partition is Read/Write). To change this you need to jailbreak: then you can umount the partition, remount it as read-write and change content to it. Any Apple product that is capable of writing to /var/ (if they even make this possible) is more than likely going to do something similar: remount the partition to read-write , write the files and remount read-only whilst making sure along the way it is done with untampered software Apple wrote.


for loop doesn't work when "{0..$var}" is used

It is not working as expected, because brace expansion is done before variable substitution.
You could use seq or a for-loop instead:
for level in $(seq 0 $((${#missing_filters[@]}-1))); ...

or
for (( level=0;level<="$((${#missing_filters[@]}-1))";level++ )); ...

For more details, see this answer to another question.

Also "${#missing_filters[$level]}" will not give 1 2 3 4, but expand to the number of characters in each value --> 8 4 8 14. Better use $((level+1)).

However, you could more easily loop the array keys:
for k in "${!missing_filters[@]}"; do
    printf '%s | %s\n' "$((k+1))" "${missing_filters[$k]}"
done


What type of memory module do I have - DDR3 or DDR 4 RAM?

When you execute sudo lshw -class memory, you receive an information similar to this one :

 `*-memory
       description: System Memory
       physical id: 18
       slot: System board or motherboard
       size: 16GiB
     *-bank:0
          description: DIMM DDR3 Synchronous 1600 MHz (0,6 ns)
          product: CT102464BF160B.C16
          vendor: Conexant (Rockwell)
          physical id: 0
          serial: 118048000000
          slot: ChannelA-DIMM0
          size: 8GiB
          width: 8 bits
          clock: 1600MHz (0.6ns)
     *-bank:1
          description: DIMM [empty]
          product: [Empty]
          vendor: [Empty]
          physical id: 1
          serial: [Empty]
          slot: ChannelA-DIMM1
     *-bank:2
          description: DIMM DDR3 Synchronous 1600 MHz (0,6 ns)
          product: CT102464BF160B.C16
          vendor: Conexant (Rockwell)
          physical id: 2
          serial: 082048000000
          slot: ChannelB-DIMM0
          size: 8GiB
          width: 8 bits
          clock: 1600MHz (0.6ns)
     *-bank:3
          description: DIMM [empty]
          product: [Empty]
          vendor: [Empty]
          physical id: 3
          serial: [Empty]
          slot: ChannelB-DIMM1

In this example from my machine you can see that the modules are DIMM DDR3 RAM. When the command for whatever reason doesn't give you sufficient information, another option would be to look it up in the BIOS or on the module itself.
Learn more about DDR3 and DDR4 RAM here ->

Difference Between DDR3 and DDR4


iPhone 3G does not see transferred songs

Go to your home folder.
Press Ctrl+H to show hidden files.
Navigate to .gconf/apps/banshee/state/ipod.
Delete the %gconf.xml file (it will be recreated the next time you start Rhythmbox).
Restart Rhythmbox. If it isn't plugged in already, plug in your iPhone.

Now you should be able to view your music files on your iPhone.


Curl request from cron job is not working,but works manually

Add a shebang line and explicitly use bash (on Ubuntu /bin/sh links to dash).

#!/usr/bin/env bash

or

#!/bin/bash

The first will search the environment for bash.


Irssi: Pressiing CTRL + 2 makes further keyboard input impossible

This is a bug in a library (GLib) installed on your Ubuntu. Looks like they are already working on a fix here : https://bugs.launchpad.net/ubuntu/+source/irssi/+bug/1882401


Ubuntu14.04 compile openjdk ERROR：FreeType version 2.3.0 or higher is required

Even though I'm using Fedora, simply installing cups-devel solved the problem. Try installing the equivalent on Ubuntu.

sudo apt-get install libcups2-dev


I found the answer!

We have to use the command:

mode("logo")

With this the turtle starts with its north up to the upper side of the graphics screen.


nrerror: root must be bracketed by zbrent

Now I started googling the right things, it turns out that the line below is a way of handling errors where an expected input is missing that is often used in Fortran based code.

nrerror:root must be bracketed by zbrent

The second line (below) is a formulaic abort code in fortran which you can find in "Numerical Recipies in Fortran 90" W.H. Press (1996)

STOP: program terminated by nrerror

If you try to look up the two things together you won't get anywhere.

If anyone else encounters this error I recommend looking at a difference checker with a working and a non-working input file for a mistake in whatever input file you are using. (If I'd looked a bit closer then I would have seen that in a line I deliberately changed a 0.0d6, was missing.)

Hopefully others can learn from my mistakes.


Battery indicator doesn't change its status (but after reboot)

This might be a little weird better answer if your problem is still not solved. I wrote a small python script to show the battery status and its percentage.
But the only problem is that you need to run the script every time you need to see the status.

from subprocess import Popen,PIPE
process=Popen(['upower','-i','/org/freedesktop/UPower/devices/battery_BAT0'],stdout=PIPE)
process1=Popen(['grep','-E','state|to\ full|percentage'],stdin=process.stdout,stdout=PIPE)

answer=process1.stdout.read().split('\n')
answer.pop()
final=[]
for i in range(len(answer)):
    temp=answer[i].split(':')
    final.append(temp[0].strip(' ')+' : '+temp[1].strip(' '))

string=''
for i in final:
    string+=i+'\n
string=string.strip('\n')

Popen(['notify-send',string])


Groff can be found and installed from the Ubuntu Software Center - open the program and type 'groff'


Create a Live USB instead of a Live CD.  Ubuntu's Startup Disk Creator application will let you do this, and it allows you to save data as well as a persistent storage medium.  You will need to load the ISO onto the USB and run it, install the NVidia drivers and you can then reuse it.  It effectively becomes a portalable Ubuntu.

Here are some instructions on the Ubuntu Help website:

https://help.ubuntu.com/community/Installation/FromUSBStick


If the other packages were installed only as dependencies of openjdk-7-jre and you have removed openjdk-7-jre, you should be able to remove those now-unnecessary packages with:

sudo apt-get autoremove

If you want to remove their systemwide configuration files too, run this instead:

sudo apt-get --purge autoremove


How to suspend my laptop when I close the lid?

A lot of the settings (including whether to suspend when the lid is closed, iirc) that were hidden by both Unity and GNOME 3 are still available in gconf.  Install the gnome-tweak-tool package to change them.


Why does running `time` and `/usr/bin/time` give different results?

Because time and /usr/bin/time run different code. In order to determine it, do the following:

type time

It will show you that:

time is a shell keyword

Thus, it doesn't run /usr/bin/time if you simply call time.

They are different things...


How do I automatically exit a bash script that ends with a less

You can do this, which still have less page the output, but it will exit when it hits eof.
LESS=-E ./test.sh

or
./test.sh | cat

which just dumps the output to the screen.


Fontconfig error: line 126: junk after document element

Actually I think this is related to some font which is used when rendering that file on your machine, i.e. there is some font configuration file for that font with a bad syntax. There have been several bug reports about this issue in the past; this is one example. If you have installed fonts manually, it could be a possible explanation.

In any case: It's just a warning, and nothing to worry about.


Terminal prompt messed up after changing value of PS1

$PS1 is an environment variable that tells yours shell how to format the prompt. Changing the value with export, as you did, only applies to that session; so you can just open up a new shell (not a sub-shell) and see a familiar prompt.

Otherwise, if you really want your prompt back in this session itself, just rerun your shell's preferences file. For Bash users, that is:

. ~/.bashrc

I don't know if that will work (at least, without causing other issues) for Byobu; but you can just set the prompt to a sane value like this:

export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Or, if you don't want to or can't have a colour prompt, a simpler one would be:

export PS1='\u@\h:\w\$ '

where \u is your username, \h is your hostname, and \w is the full (logical) path of your current working directory.


How can I change the file ownership to root on ubuntu 14.04

Use the command:

sudo chown root file.name

chown is tool for changing ownership. As root account is superuser type to change ownership to root you need to run chown command as superuser with sudo.


How and why to create -dbg, -dev, -doc packages?

Idea & Purpose

The main reason for separating out these different packages has to do with disk space and download speed. In particular, it is a big concern for mirror space since it means distributing multiple copies of the data. By making the foo-common, foo-data, or  foo-doc packages Architecture: all, we only keep one copy of of the data in the archive instead of having it copied with each architecture (e.g. i386, amd64, ect...). Debugging symbols are not needed by most users and just end up making the package download take longer.

For packages in the official Ubuntu archives, there is actually no reason to create -dbg packages manually. The build machines automatically strip out the debugging symbols and put them into -dbgsym packages hosted on ddebs.ubuntu.com. (See: Debug Symbol Packages) -dbg packages that do exist are usually simply carried over from Debian.

Instructions

As for implementation, take a look at this question:

How to have Debian packaging generate two packages given an upstream source archive?

Briefly, new stanzas need to be created in debian/control for each package. Then debian/foo-*.install files need to be created as well. This will allow dh_install to put the right contents into the right packages.

The foo.install for the main binary package might look like:

usr/bin/
usr/lib/

foo-common.install, foo-data.install, foo-doc.install, or whatever:

/usr/share/doc/
/usr/share/icons/
/usr/share/foo/
/usr/share/locale/

And for foo-dev:

/usr/include/
/usr/lib/pkgconfig
/usr/lib/*.so

Creating the foo-dbg package requires editing debian/rules as normally dh_strip will strip out debugging symbols. So we need to override that behavior:

.PHONY: override_dh_strip
override_dh_strip:
        dh_strip --dbg-package=foo-dbg

Further reading: http://wiki.debian.org/DebugPackage


unable to install grub in /dev/sda Ubuntu 18.10

Since you already have windows boot, which also has its own partition for boot, in this case you should not assign another boot partition for boot because they are not compatible.  Doing so may damage your windows boot or ubuntu boot. So if you manually configuration ubuntu alongside windows, all you have to do is to assign your root and/or swap.


You need to make sure you have the driver which is known to work with macbook pros. Since presumably your laptop is not connected to the internet, first you need to have it temporarily connected to the internet using USB.

If you have a mobile phone which you can use as a "persnoal hotspot" temporarily, then you may connect it to your laptop by USB to get connected to the internet temporarily and in a terminal, type:

sudo apt-get update
sudo apt-get install -y bcmwl-kernel-source

Hopefully this will get your wifi up and running.


How to shutdown computer when users are logged on?

Open a terminal (ctrl + alt + T) or use a TTY (ctrl + alt + F1.) Then you have to login using administrative account or root.

sudo shutdown -P now


Is it possible to use a bluetooth-enabled phone as handset?

It is unlikely that the phone is configured to be used as Bluetooth handset.  Typical cellphone profiles include storage devices (access to directories on the cellphone), smartphone, and data links (Tethered internet).  It is unlikely to provide a headset over Bluetooth.

A Bluetooth headset should work well.


Yes you can.  Easiest tool to do so I find is gparted, so if you think you need to add more space or you need more space in windows you can do so on the fly.

Just search for 'gparted' in the software center.
If for whatever reason you like using terminal,

sudo apt-get update
sudo apt-get install gparted


It's simple, but you need an additional tool.

Install the package xsel which provides an easy command to access the clipboard:

sudo apt-get install xsel

Find out which $DISPLAY your desktop is using. Usually it should be :0, but you can check it by running this command in a terminal emulator on your GUI desktop:

echo $DISPLAY

I will assume the output is :0, replace that with your actual output in the following commands if it's different.
Copy the command you would like to execute in the TTY, e.g. using Ctrl+C.
Switch to the TTY you want to use, e.g. to TTY1 using Ctrl+Alt+F1.
Log in by typing your username and password.
Enter the full command you wish to run, but replace the part you want to insert from the clipboard with $(DISPLAY=:0 xsel -ob).

For example if you copied a large list of packages to install, you could type this into the TTY:

sudo apt-get update && sudo apt-get install $(DISPLAY=:0 xsel -ob)

The clipboard snippet does not necessarily have to be at the end of your command though, it may appear anywhere.

To simplify things further, let's move this still a bit complicated DISPLAY=:0 xsel -ob to a script. I'll name it PASTE (because paste is already taken), but you can also call it differently.

To create the script file in a location where every user can run it without having to specify the full path (I recommend /usr/local/bin for this) and to make it executable, simply run those two commands:

( echo '#!/bin/bash' && echo 'DISPLAY=:0 xsel -ob' ) | sudo tee /usr/local/bin/PASTE
sudo chmod +x /usr/local/bin/PASTE

Now you can simply embed $(PASTE) into your commands on a TTY to insert the clipboard content from your desktop there.


Is the update for a point release automatic or should I download and install?

Install updates using "Update Manager" is enough. It will install new added package in Ubuntu 12.04.1 for you. Be sure you Ubuntu is always update.


inconsistent appearance of Horizon dashboard!

Problem found : Django Compressor Not Regenerating Compressed CSS

the directory '/var/lib/openstack-dashboard/static/scss' is empty, while ''/var/lib/openstack-dashboard/static/js' contains .js files.

Still searching for a solution !!!


Install Canon Pixma MX350 series printer in ubuntu 20.04

Problem solved. A work-around but it did the trick: create a Windows virtual machine (Wine's a pain so not an option), run the .exe printer setup by capturing the host optical drive and install. I wasn't looking forward to printing from within a VM however, and was hoping my Ubuntu host machine would register the drivers being installed in the VM. As the print setup finished in the VM, the printer was also added to my Ubuntu host.


why kernel assigns 250 as a major number in device driver

250 is taken by default, when you have not specified the Major number while registering the device or while creating the node (mknod).

For Ex: To register a Character device driver, the function syntax is

register_chrdev(Major Number, Name of the driver, File operations);

This has to be done in module_init calling function.

To create a node, after you load that module is

sudo mknod -m 666 /dev/char_driver c 240 0

Here,

666 - permission
char_driver - name of the driver (can be of any name)
c - Says that its a character driver
240 - Major number (same as if in register_chrdev)
0 - Minor number.

This should probably work.


I turn off my computer while I was upgrading, what do I do?

It wants you to fix broken or missing packages before upgrade. In terminal run:

sudo apt-get -f install
sudo apt-get update
sudo apt-get autoclean
sudo apt-get upgrade
sudo apt-get dist-upgrade


How to Prevent Ubuntu (running in VMware) shutt down when the PC is shut down accidentally?

If the host operating system shuts down uncontrolled (you say accidentally) be it by an unwanted manual shut down, after an application crash, or worst a power failure, there is no way any guest operating system (not even Ubuntu) can detect and react on such an incident. All data from the guest OS will be lost.

To prevent this we need to at least save the guest session prior to shut down of the host. Depending on the host OS it may be done automatically by including this into the shutdown routine (which of course needs time to finish before the host machine was powered off).


For email, there is a thunderbird addon called Enigmail which performs email encryption or signing, and is quite nicely integrated. Install it from the Software Center or with sudo apt-get install enigmail.

Seahorse still exists (it is called "Passwords and Keys" if you search in the dash), but does appear to have lost built-in support for text encryption/signing (I think - I don't have a GPG key on this system to test with).

This thread gives the syntax for signing, encrypting, verifying and decrypting text in the console with the gpg command.

This answer explains how to add gpg integration to gedit, although I must admit I was expecting to find better plugin support for encrypt/sign in both gedit and tomboy notes without obvious success.


Ubuntu 18.04.1 won't install on Dell Precision M6500

I had the same problem with my desktop. Have you tried using a USB to install ubuntu on. This for some reason was what worked it for me. I used rufus to flash the ISO file to the usb and then rebooted the machine.


Install English Macintosh keyboard layout on Ubuntu 18.04

Two different points are being conflated in this question, AFAICS.

[1] Yes, Ubuntu 18.04 does have English (UK, Macintosh) in its list. You can see it in the screenshot here:
https://linoxide.com/linux-how-to/configure-keyboard-ubuntu/

I am running Ubuntu on a 2008 Macbook at home with the Mac layout.

You can add both and switch between them:
https://linuxconfig.org/how-to-add-and-switch-keyboard-layout-on-ubuntu-18-04-bionic-beaver-linux

[2] However, this will not automatically redefine keys for you. Mac keyboards have both Control (Ctrl) and Cmd (Command) keys. "Cmd" is equivalent to the "Windows" key on modern PC keyboards, or what very old-timers call the "Super" key.

On a Mac running Ubuntu, or an Ubuntu PC with a Mac keyboard, Ctrl-C is still Ctrl-C. If you want macOS-style keystrokes (Cmd-C to copy, etc.) then you must remap Ctrl to Cmd and (I would suggest) Cmd to Ctrl.

That is described here:
How to remap Super(left) key to control key

N.B. If you are using GNOME, then the easiest method by far is in the last answer, right at the bottom.


Can't shutdown Ubuntu (Wubi Installation)

I would guess it is cuz of kernel options.

Just read this page and try some of them.

Boot Options

I once needed the following. (But you have to find out yours for yourself - as long as no one pops up with the same model and knows which one to add exactly)

irqpoll
nolapic
noapic

They tell you on this page how to get along. Hope that fixes this nasty problem.


Try this. Once you are booted up to the blank desktop... press CTRL + ALT + F1.

apt-get install --reinstall ubuntu-desktop
apt-get install unity
apt-get purge nvidia* bumblebee*
apt-get install nvidia-prime
shutdown -r now

Hope this helps!


This was fixed in a later update. The update is already included in 12.10. For 12.04 I only needed to update to the latest packages.


Ubuntu 14.04 - Strange problem - browsing makes screen go black!

Add the xorg edgers ppa to your system and update it like this:

sudo add-apt-repository ppa:xorg-edgers/ppa

sudo apt-get update

sudo apt-get dist-upgrade

After the new intel video drivers have been installed, reboot your system.

This should fix the problem, leaving a small remaining bug that can be fixed by installing kernel 3.19.  In a few days it will be released for 14.04 by Canonical officially and you will be able to install it.  Alternatively, you can install the mainline kernel but this is not recommended since it's not 100% sure the rest of the system will function ok after that.


Try changing the theme in System Settings > Appearance.  You should immediately see the results.


Ubuntu crashed for no apparent reason, unsure of how to get it back

It's probably not a hardware problem, considering Windows boots & runs fine on the same drive. There are some Windows and linux tools to check a drive's SMART data that are an option too. But just in case I'd try data recovery first before doing any write tests to the drive.

When you boot from a live iso (USB/CD) if you can paste the mount errors (from the terminal, or probably in /dev/log/syslog too) that should help a lot.

Mounting read-only (ro) might allow access to copy off your data files at least, if you don't have a backup already.  This should work if you're booting live:

Find out which drive partition you'd like to mount (the /dev/sdx# name).  In a terminal, run (as root or with sudo) some of these to find out what device/partition (like /dev/sda1) you're after. The linux partitions are probably an ext3/4 format, windows usually NTFS:

lsblk or blkid or fdisk -l or parted -l
Make a mountpoint sudo mkdir /mountpoint (for example, often the're in /media/ somewhere, may work better in there).
Try mounting it read-only with the device & mountpoint from earlier

mount -o ro /dev/sdx# /mountpoint

Watch for any error messages here. If it mounted ok you should be able to read & copy your data from /mountpoint

It may need a filesystem check before it wants to mount (see man fsck & the other tools like fsck.ext3, fsck.<morenames>). But those could write to the filesystem, possibly overwriting your data you'd like to recover first, so that wouldn't be a "best practice" of data recovery.

If it wouldn't mount, other tools like testdisk or photorec could be used to try & read the data anyway. See this Ubuntu Data recovery page, or the testdisk or photorec documentation/help for more info.

And with "mount: ... failed: invalid argument" you might want to take a look at your /etc/fstab file... maybe edit that into your Q?

Or a tool like Boot Repair could help for GRUB boot problems, but that may not be the problem here (could even mess up Windows booting which still works now).


How to turn off Cursor Blinking in Lubuntu?

There's a short answer and a long answer to this.

Short answer

Lubuntu 18.04/LXDE

Sorry, there is no easily accessible option.

However, there is a hidden feature in LXSession that can help. You can change the config like so:

~/.config/lxsession/Lubuntu/desktop.conf

[GTK]
iNet/CursorBlink=no

and log out and log back in again to make the change.

Lubuntu >18.04/LXQt

lxqt-config-input offers an option to adjust the blink rate. To set it to non-blinking:

Navigate to Menu » Preferences » LXQt Settings » Keyboard and Mouse » Keyboard.
Set the Cursor flash time to 0ms.
Click Apply.
Click Close.

The Lubuntu Manual covers lxqt-config-input in greater detail.

Long answer

Technically, both solutions are only changing the settings for the underlying toolkit— GTK and Qt, respectively. In ≤18.04/LXDE, Lubuntu used mostly GTK apps, while after it was mostly Qt apps. That doesn't mean you couldn't install Qt apps in the mainly GTK system and vice versa. The changes above would not affect those "foreign" apps. The more general solution for the two respective toolkits follows.

GTK

Change the config for both current GTK versions:

~/.config/gtk-2.0/settings.ini and ~/.config/gtk-3.0/settings.ini

[Settings]
gtk-cursor-blink = false

Qt

This should be a simple matter of changing the Qt config with the likes of the following:

~/.qt/qtrc

[General]
cursorFlashTime=0

~/.config/Trolltech.conf and ~/.config/QtProject.conf

[Qt]
cursorFlashTime=0

or through the qtconfig application (see the qt-qt4config package in 18.04) via Interface » Cursor Flash Time » No Blinking but I could not get this to work in 18.04.

There is a page that covers this topic more generally for a variety of different applications, toolkits, and desktop environments that would be good to consult for any edge cases.


Is Quickly a Python-only development tool?

Quickly is extensible to provide a template infrastructure to allow the use of different technologies, but right now the ubuntu-application template is based on Python and GTK+.

You can see more detail on the technologies it puts together here:

Getting started with Quickly
Quickly workflow

That said, the flexibility of Quickly's template system makes it easy for anyone to create new templates with other technology choices. Check these out:

How to create a new Quickly template
Quickly community templates

On the last link you'll see that there is work in progress to extend the core set of templates to provide apps based on different tech, such as an HTML5 app, or a Qt app, but until they're finished, the recommendation is to use the ubuntu-application template based on Python and GTK.


You can't able to resize a mounted partition on Gparted.In gparted you can easily unmount any partition other than your installed Ubuntu root partition.To unmount your root partition,you have to boot from Ubuntu live disk or Gparted live disk.
After booting from any one live cd's.Resize the partition you want.I think it's /dev/sda1.After resizing,an unallocated space will be  created just below to your /dev/sda1 partition.
From that unallocated space create a new ntfs Primary partition.So that your Windows Os will be installed and booted up.
After that insert your windows installation disk and choose custom option on startup.
Install Windows on the created ntfs partition.
Atlast don't forget to run boot-repair.So that both the OS's will be shown on startup.


Is it safe to upgrade Wubi install from 12.04LTS to 14.04LTS?

Simply running sudo do-release-upgrade -d from the terminal prompt will take care of it for you. Try to run it from the console on the computer you're upgrading, since if you do it via a terminal session from another system (via ssh or something similar) if the upgrade has issues, or your connection drops, recovering could be problematic.

It worked for me, but not before without issues, as my ssh session timed out multiple times duing the upgrade.  I discovered the best way to handle it was to run screen, then run the do-release-upgrade -d from within screen, that way, if you do loose your connection, a simple screen -d will give you back your previous screens, all nice and orderly as they should be.

I did the 12.04 LTS upgrade to 14.04 LTS, but then (accidentally) wound upgrading again to the latest unicorn release too, as I wound typing do-release-upgrade -d again, with my scrollback buffer, so now I'm running a full-blown test release, and having issues, but that's not the fault of the initial do-release-upgrade run.

I hope this helps.


...cannot copy extracted data for './boot/vmlinuz-3.13.0-112-generic' to '/boot/vmlinuz-3.13.0-112-generic.dpkg-new': failed to write (No space left on device)...

You have to free some space.

(Im on the phone atm, I'll edit the answer later to add further info)


I cant mount my newly created partition in gparted

I'm not an expert, but I don't think you can mount a partition in GParted. You can only unmount one which is required before you can do anything with it. So, you're going to have to mount your partition manually. Here's the command that's used to do that:

$ sudo mount -t auto \
> -o rw \
> /dev/[BLOCK_DEVICE][PARTITION_NUMBER] [MOUNT_POINT] \
> -v

If your partition is /dev/sdb1, you mount it at the mnt directory like this:

$ sudo mount -t auto \
> -o rw \
> /dev/sdb1 /mnt \
> -v


Fetcher in Currency Converter Ubuntu app

The use of the data is documented on the ecb stats page. From http://www.ecb.int/stats/html/escbstats.en.html:

Policy regarding the reuse of ESCB statistics
The European System of Central Banks (ESCB) releases its statistics
and related methodologies via the websites of the European Central
Bank (ECB) and the national central banks (NCBs), and the ESCB makes
continuous efforts to facilitate their use. Against this background,
the ESCB would like to set out its common policy regarding the reuse
of ESCB statistics.
Policy regarding the reuse of ESCB statistics

The ESCB is committed to
providing its statistics free of charge as a public good of high
quality irrespective of any subsequent commercial or non-commercial
use.
The ESCB subscribes to a policy of free access and free reuse
regarding its publicly released statistics, subject to the conditions
described below.
The ESCB attaches great importance to the quality of
its statistics, in accordance with the principles set out in the
Public commitment on European Statistics by the ESCB.

Common conditions for the reuse of ESCB statistics
All publicly available ESCB statistics may be reused free of charge on
the condition that the source is quoted (e.g. “Source: ECB
statistics.”) and that the statistics (including metadata) are not
modified. The policy of free access and free reuse does not imply a
right to obtain confidential data.
The following additional rules apply:

The right of free reuse refers
to statistics as made available to the public in standard format,
which must be used in accordance with the respective disclaimers
issued by the ECB and the NCBs. Disclaimer & copyright
The right of
free reuse does not apply to third-party data without a prior
permission from the originator.
Users are not entitled to expect
continuity of all ESCB statistics published and should note that
statistics may be changed as a result of revisions or other updates.
Access to ESCB statistics may be restricted in exceptional
circumstances, for example if a user is acting in a manner contrary to
the interests of other users.


How to make the argument as optional in bash?

If you won't pass arguments with spaces:

sum() {
[[ -n $2 ]] && echo $(( $(tr ' ' '+' <<<"$@") ))
}

Effect:

$ sum 1 2 3
6

Explanation:

<<<"some string" feeds in only "some string" as the input. Think of it as shorthand for echo "some string" |. It is called a Here String.
"$@" expands into all the positional parameters, separated by spaces.  It is equivalent to "$1 $2 ...".
Hence, tr ' ' '+' <<<"$@" outputs "$1+$2+$3...", which is evaluated by the outer $(( )).
[[ -n $2 ]] tests if the second parameter is non-empty. You could replace [[ -n $2 ]] && with [[ -z $2 ]] ||.

Another way:

sum() {
[[ -n $2 ]] && (IFS=+; echo $(( $* )))
}

Explanation:

$* is just like $@, except that the parameters are not separated by spaces, but by the first character of the Internal Field Separator (IFS). With IFS=+, it expands to "$1+$2+...". See What is the difference between $* and $@?
We set IFS in a subshell (note the surrounding parentheses) so that the main shell isn't affected. IFS is, by default: \t\n (space, tab, newline). This is an alternative to using local variables.

Now to answer your question:

You can use a default value for any variable or parameter.
Either:

SUM() {
 echo "The sum is $(($1+$2+${3:-0}+${4:-0}+${5:-0}+${6:-0}+${7:-0}+${8:-0}+${9:-0}))" || false
}

Or:

SUM() {
 echo "The sum is $(($1+$2+${3:=0}+${4:=0}+${5:=0}+${6:=0}+${7:=0}+${8:=0}+${9:=0}))" || false
}


access to ntfs using ubuntu as the sole operating system

Yes, Ubuntu will read from and write to NTFS just fine.

However, Ubuntu's ability to repair or recover data from a damaged NTFS partition is not as great. So you might want to use a filesystem like ext4, assuming you don't need to access it from other operating systems.

Another benefit of ext4 over NTFS is that Ubuntu will use CPU resources more efficiently to access ext4 (and most filesystems) than NTFS. But this is insignificant, in most use cases.


If you want to use amixer to control the volume, this should work in a terminal:

amixer -D pulse sset Master 0%

(0% to mute or use any percentage you like)

To reduce/increase the volume, you can add - or + after % (but that doesn't work to increase the sound beyond 100%).


“This computer currently has no detected operating systems.”

I am using the same kind of configuration having Elementary OS as primary and Windows 10 as secondary OS although my laptop came bundled with original Windows 10.
I use Windows just for some rare gaming and storing personal photos etc. I manage this with some 500GB but it can work even with 200GB and the remaining can be used for Linux. And yes, you can re-partition after installing OS.

I hope you are following these steps:

Freeing some space on the drive using Windows partiton tool.
Do not format this space i.e keep it unallocated.
Prepare your Ubuntu installation USB drive.
Insert and switch ON the PC. Let it boot into the Ubuntu installation.
While installing, just select the option "Something else".
There, select the unallocated space that you created using Windows
tool.
Let the installation proceed.


ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

If your file my.cnf (usually in the /etc/mysql/ folder) is correctly
  configured with

socket=/var/lib/mysql/mysql.sock

  you can check if mysql is running with the following command:

mysqladmin -u root -p status

  try changing your permission to mysql folder. If you are working
  locally, you can try:

sudo chmod -R 755 /var/lib/mysql/

https://stackoverflow.com/questions/5376427/cant-connect-to-local-mysql-server-through-socket-var-mysql-mysql-sock-38


Error on local repository and download packages 32 and 64 not solving the problem

I solved doint this things.

I pointed the sources.list to look inside deb file:///media/isan/EXTRA/xenial-repo/mirror/espejo.mycompany.cu/~ubuntu xenial main restricted universe multiverse
Erase all the content of the folder /var/lib/apt/lists using (sudo rm -R /var/lib/apt/lists)
i Used apt update instead of apt-get update, don't know if that's is a factor

i still have some warnings but it works, i think that getting the repo from an offline repository in an external HDD requires some permissions or more work to do..

i hope this helps somebody


Change GNOME Flashback panels configuration for new users

Default panel configuration is stored in /usr/share/gnome-panel/panel-default-layout.layout file.

You can edit it, but better idea might be copy this file to ~/.config/gnome-panel/panel-default-layout.layout and only then edit it.

That will allow you to change default applets and panel size. But this file must be available before user logs in session (before gnome-panel is started).

For background color you can use schema override. Background schema id is org.gnome.gnome-panel.toplevel.background. To set black background you need to change two keys:

type from none to color
color from rgba(255,255,255,.2) to rgba(0,0,0,1)

But currently there is no way to change text color on panel. This might be or might not be problem - depends on theme you will use. So better idea might be to create ~/config/gtk-3.0/gtk.css and set desired style with css.


VirtualBox and Skype are bad rendered after sometime

I had the same problems around that time with virtualbox.

I do not have that problem anymore. I notice in my /var/log/dpkg.log.1, that virutalbox-qt was upgraded on Nov 28 to version "4.3.34-dfsg-1+deb8u1ubuntu1.14.04.1". I suppose that upgrade fixed it, while a previous upgrade of either qt or virtualbox broke it.


Software for manual audio transcription (speech, interviews etc.)

When you have to transcribe, i.e. type, content that comes from an audio file, you want to

be able to control audio (stop, pause, play) via the keyboard while typing the text (so you do not have to leave the text editor and switch to an audio application to do just that).
You might also want to adjust the audio speed (to speed up slow speech and slow down too fast speech).
You want the audio position to be a little bit rewinded when you continue audio playback, just to be sure you didn't miss anything.

I found that a software called transcribe (launchpad) provides the solution I was looking for.

You type the text in a text editor while transcribe plays the audio file in another window. To pause or continue audio playback, you use any keyboard shortcut that you configured system-wide for audio in the system settings. I use F7 to pause, F8 to continue.

To install transcribe:

First, you have to add a PPA:

sudo add-apt-repository ppa:frederik-elwert/transcribe
sudo apt-get update

Then you can install it:

sudo apt-get install transcribe


For Ubuntu 13.04 I faced the same problem.

Please use this:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi_osi=Linux acpi_backlight=vendor“

It works for my Acer Aspire.

I have also updated:
http://nikunjlahoti.com/2012/04/29/ubuntu-12-04-fix-fn-brightness-keys/


There is a plan to audit truecrypt regarding the security of the software and a review of the wording of its license, which you may find interesting.

Here's how I successfully compiled it on 12.04, but it should work for later versions of Ubuntu:

sudo apt-get install build-essential nasm libfuse-dev wx-common wx2.8-headers libwxbase2.8-dev libwxsvg-dev libwxgtk2.8-0 libwxgtk2.8-dev

You also need some particular PKCS-11 header files from the official RSA site. You can get them all at once with wget, which can use * with ftp downloads:

mkdir -p $HOME/src/pkcs-11
wget 'ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11*' -P $HOME/src/pkcs-11

Now download the source code from the truecrypt site and verify it with gpg after getting the public key, if necessary. Then perhaps extract it to your ~/src.

You need to supply the name of that pkcs-11 folder containing the header files when running make, so give the correct path if it is different to below. Of course, replace Truecrypt_source with your own real path in the cd command and in the cp command below. (The Truecrypt binary will be found in the Main folder of the source folder.)

cd Truecrypt_source
make PKCS11_INC=$HOME/src/pkcs-11
sudo cp Truecrypt_source/Main/truecrypt /usr/local/bin

Occasionally you might have to add to the make command-line LIBS=-ldl as in this question.

Now your newly compiled truecrypt will be ready to use and you can be confident it has no backdoors.

NOTE: Before installing the new version, you should uninstall truecrypt if it is already installed with the provided uninstall script that was installed with the binary:

sudo /usr/bin/truecrypt-uninstall.sh


acer aspire one d270: Ubuntu 12.04 or 12.10?

Strong Recommendation:

First install 12.04 LTS ..

This will be good for the next 2-3 years, without any issues.

If you also want to try 12.10, and 13.04 (in a few months), and then 13.10 (later next year) you can.

But, if your target audience (your wife) just wants to use a computer, they may not want you mucking with it every six months.

You could also try (and not initially install) 12.10 (and 13.04), to see if there are any new must have features. Examples in future may include major 'improvements' to the user interface, better multi-touch support, etc.

If might be better to have a second netbook for you to 'play' on ..


Do:

echo "options rt2800pci nohwcrypt=y" | sudo tee /etc/modprobe.d/rt2800pci.conf
sudo modprobe -rfv rt2800pci
sudo modprobe -v rt2800pci

that command changes encryption from hardware to software.

Do:

gksudo gedit /etc/pm/power.d/wireless

(this will create or edit a configuration file that will override the default power management behavior) and enter the following:

#!/bin/sh

/sbin/iwconfig wlan0 power off

above exit0, then save gedit, close.

Set your wireless settings in network manager to match the screenshots.

Reboot


Try this:
Download the LibreOffice packages again, suppose they are downloaded at ~ / Downloads.
https://ftp.nluug.nl/office/libreoffice/libreoffice/stable/7.0.1/deb/x86_64/LibreOffice_7.0.1_Linux_x86-64_deb.tar.gz
https://ftp.nluug.nl/office/libreoffice/libreoffice/stable/7.0.1/deb/x86_64/LibreOffice_7.0.1_Linux_x86-64_deb_helppack_en-GB.tar.gz
https://ftp.nluug.nl/office/libreoffice/libreoffice/stable/7.0.1/deb/x86_64/LibreOffice_7.0.1_Linux_x86-64_deb_langpack_en-GB.tar.gz
Then run in a terminal
sudo apt-get -f install

sudo apt remove --purge libreoffice*

sudo apt remove --purge libobasis*

sudo apt autoremove

cd ~/Downloads

for x in *.tar.gz; do tar xfv $x; done

sudo dpkg -i LibreOffice_*/DEBS/*.deb


How do I increase the refresh rate to 240Hz with a GeForce RTX 2070 SUPER?

Currently this is limitation of current drivers (nvidia driver 455.45.01). I tried everything, even managed to compile nvidia driver 455.45.01 with kernel 5.10


How to down tune power consumption on laptop home server

This may be what you are looking for;

http://www.linrunner.de/en/tlp/tlp.html

TLP is a power management tool for Linux. It brings you the benefits of advanced power management without the need to understand every technical detail.

sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp

Run PowerTOP before & after to see difference. Power settings will be re-profiled by TLP upon fresh boot.


Ubuntu Touch - change ebay from US locale to UK

Are you using the browser? As if so you can just type ebay.co.uk rather than ebay or ebay.com.


You may be able to convert ttf to eot, woff and svg with Ruby:
sudo apt install ruby
gem install convert_font
convert_font convert -i folder/font-file.ttf -f eot,woff,svg

Note that convert_font is not longer developed and outdated (as of today, december 2020, there was no update since 7 years - apparently this fork was updated since then), I hope you'll find a way to make it work with your setup


How to permanently unlock partitions from launcher in 16.04

Although the solution below is not a fix to what seems to be a minor bug, you can use it as a workaround to automatically blacklist devices on startup (log in).

The solution

...is a small script that remembers your blacklisted items on log in. It runs with two arguments: get and set. The first is to read the current blacklisted items, the second will (re-) set the list to the last read version.

In practice

Remove the devices from the Unity Launcher like you are used to.
Run the command /path/to/remember_blacklist.sh get
This will make a snapshot of the currently blacklisted devices.

Now the next time you log in or restart, the blacklisted devices are automatically removed. Of course you can add the command to a shortcut.

How to use / set up

Copy the script below into an empty file, save it as remember_blacklist.sh

#!/bin/bash

arg=$1
blacklist=~/.currblacklist
key="com.canonical.Unity.Devices blacklist"

if [ "$arg" == "get" ]
then
 printf "$(gsettings get $key)" > $blacklist
elif [ "$arg" == "set" ]
then
  if [ "$(cat $blacklist)" == "@as" ]
  then
    gsettings set $key []
  else
    gsettings set $key "$(cat $blacklist)"
  fi
fi

make it executable (!)
Add the following to Startup Applications Dash > Startup Applications > Add. Add the command

/bin/bash -c "sleep 10 && /path/to/remember_blacklist.sh set"

Remove the devices from the launcher as usual
To remember, run: /path/to/remember_blacklist.sh get

Explanation

If you remove a device from the launcher, it is blacklisted. You can read the current list of blacklisted devices with the command:

gsettings get com.canonical.Unity.Devices blacklist

This will output something like

['0A444ED409660B91-intern_1', '2899FAA548C61099-intern_2']

What the script does is:

when run with the argument get: it reads the current blacklist and saves the output in a hidden file: ~/.currblacklist
when run with the argument set: it reads the content of the file ~/.currblacklist and sets the blaclist with the command:

gsettings set com.canonical.Unity.Devices blacklist <content_of_the_file>


How to execute script on my Ubuntu via PHP from site

I've tested your code and in my server it works correctly. It gives the following output:

Output: apps awstats cgi-bin clients conf error html icons ispconfig manual mauco.org med-01.uc.cl php-fcgi-scripts usage

That are the folders in /var/www

I think you may have a privileges issue. What happens if you try with this command:

  $output = shell_exec("ls /tmp");

You can also check if what user is being used by apache/nginx

 $output = shell_exec("whoami");

Please include screenshots of your results.


Does the update manager handle updates for third party applications?

Short answer: yes it does provided we had added the third party repository to our sources, and updates are made available from there.

From the "Settings..." menu in Update Manager we can define how often we need it to check for updates available. Make sure to not choose "Never" to get notified if any newer versions are available for your release.

By doing so we get regular updates, e.g. for Virtual Box, or applications loaded from the Medibuntu, or the getdeb repositories. In case a third party repository is down or we do not want an update notification we may temporarily disable this repository by unticking it in the "Other Software" tab.


Your only have the first part of a two-part Offline eBIRForms Package v6.1 setup.exe archive in your working directory. The error message is telling you that you need to download part 2 of the same archive to your working directory, so that you will be able to extract all of the files from that two-part archive.


Utorrent server downloads and uploads stuck at <1%

I edited my post with an obvious answer: give utorrent write access to my 'downloads' folder.
Since I have seen this question many times before,so I just used chown:

sudo chown -R utorrent:utorrent /home/***/Downloads

Where *** is my username.


How to display the name of file which I am currently editing with vim on terminal title?

You must to have/create a file named .vimrc in your home directory with the following code inside:

let &titlestring = $USER . "@" . hostname() . " " . expand("%:p")
if &term == "screen"
  set t_ts=^[k
  set t_fs=^[\
endif
if &term == "screen" || &term == "xterm"
  set title
endif

Source: gnome-terminal does not allow changing the title


In-application Icons not viewable in ReText under Kubuntu 16.10

Ok, so after setting the icon set in KDE to Breeze and then resetting it to Breeze Dark, ReText picked up and now it shows the icons....

Thank you for pointing me in the right direction.


Failed to mount Windows share: Connection timed out

Edit and add the below entries to /etc/samba/smb.conf, under [global]
It should look like

[global]
client min protocol = SMB3
client max protocol = SMB3


It seems like you have two independent application switchers running in parallel, so you may want to disable/uninstall one, or re-assign keyboard shortcuts.

To change shortcuts for the default switcher, you can use the Unity Tweak Tool (sudo apt install unity-tweak-tool). After opening it, click on "Switcher" and adjust "Window switching shortcuts".


How to install wireless driver on Compaq nx6120 laptop

The model of laptop you have has a hardware switch that can be toggled to turn the wireless function on and off - it also has a LED on it to indicate status.

It is located on the top edge above the keyboard - third button along from the left hand side.

Here is an image that should help you locate it.


Move windows to specific screens using the command line

Moving all windows of a specific window class to a specific screen by (screen-) name

The script below will send windows, belonging to a specific WM_CLASS (application), to a specific screen, by the screen's name. How that is done is explained in the script and also further below.

The script assumes the screens are arranged horizontally, and more or less top- aligned (with a difference < 100 PX).

The script

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

# just a helper function, to reduce the amount of code
get = lambda cmd: subprocess.check_output(cmd).decode("utf-8")

# get the data on all currently connected screens, their x-resolution
screendata = [l.split() for l in get(["xrandr"]).splitlines() if " connected" in l]
screendata = sum([[(w[0], s.split("+")[-2]) for s in w if s.count("+") == 2] for w in screendata], [])

def get_class(classname):
    # function to get all windows that belong to a specific window class (application)
    w_list = [l.split()[0] for l in get(["wmctrl", "-l"]).splitlines()]
    return [w for w in w_list if classname in get(["xprop", "-id", w])]

scr = sys.argv[2]

try:
    # determine the left position of the targeted screen (x)
    pos = [sc for sc in screendata if sc[0] == scr][0]
except IndexError:
    # warning if the screen's name is incorrect (does not exist)
    print(scr, "does not exist. Check the screen name")
else:
    for w in get_class(sys.argv[1]):
        # first move and resize the window, to make sure it fits completely inside the targeted screen
        # else the next command will fail...
        subprocess.Popen(["wmctrl", "-ir", w, "-e", "0,"+str(int(pos[1])+100)+",100,300,300"])
        # maximize the window on its new screen
        subprocess.Popen(["xdotool", "windowsize", "-sync", w, "100%", "100%"])

How to use

The script needs both wmctrl and xdotool:

sudo apt-get install xdotool wmctrl

Copy the script below into an empty file, save it as move_wclass.py
Run it by the command:

python3 /path/to/move_wclass.py <WM_CLASS> <targeted_screen>

for example:

python3 /path/to/move_wclass.py gnome-terminal VGA-1

For the WM_CLASS, you may use part of the WM_CLASS, like in the example. The screen's name needs to be the exact and complete name.

How it is done (the concept)

The explanation is mostly on the concept, not so much on the coding.

In the output of xrandr, for every connected screen, there is a string/line, looking like:

VGA-1 connected 1280x1024+1680+0

This line gives us information on the screen's position and its name, as explained here.

The script lists the information for all screens. When the script is run with the screen and the window class as arguments, it looks up the (x-) position of the screen, looks up all windows (-id's) of a certain class (with the help of wmctrl -l and the output of xprop -id <window_id>.

Subsequently, the script moves all windows, one by one, to a position on the targeted screen (using wmctrl -ir <window_id> -e 0,<x>,<y>,<width>,<height>) and maximizes it (with xdotool windowsize 100% 100%).

Note

The script worked fine on the tests I ran it with. Using wmctrl, and even xdotool, on Unity can have some stubborn peculiarities however that sometimes need to be solved by experiment rather than reasoning. If you might run into exceptions, please mention.


I had this exact problem and was able to fix it using a bind mount instead of a symlink. In my case I had a symlink for my home dir to /data/home. Remove the symlink, then create an empty directory for the mount point;

rm /home
mkdir /home

Then edit your /etc/fstab and add the line;

/data/home      /home   none    bind

Then reboot or enter the following command and /data/home will be mounted to /home.

mount /home

After that the snap applications will work.


By changing GUI manually, you can install Pulse Audio Volume Control

sudo apt install pavucontrol

Open application and select which audio stream to be set.

To set a certain output at startup, you can write the code into the startup items or ~/.bashrc or ~/.profile, even registering some shortcuts to switch between outputs are useful.

Set shortcut Settings > Keyboard > Shortcuts > Custom Shortcuts Alt+L.

 pactl set-sink-port 0 analog-output-speaker

Set Alt+H

pactl set-sink-port 0 analog-output-headphones

Also you can make the speaker priority higher than headphones.

How can I change PulseAudio port priorities?


When I disable my touch screen, I logout automatically

After much searching, I finally found a solution to it. According to it you have to create a file called hid_multitouch.conf in /etc/modprobe.d.

Inside the file add the following text:

blacklist hid-multitouch

After saving it, do a reboot. That's all. The touchscreen will be disabled peermanently.


go to [install dir]/.xinstall/Vivado_2018.2/bin and run terminal from there and put the ff command:

"sudo ./xsetup -Uninstall"


Very low external microphone volume in Xubuntu 20.04

I don't have an answer, but I just added a USB webcam to my Xubuntu 20.04 desktop system and used it for the first time on a Zoom call.  I kept manually setting the mic volume to 100% in the Pulseaudio volume control and then a few minutes later it was reset to a very low setting.  This kept happening repeatedly.  Any idea why the volume would auto-adjust downward and how to stop this?  This is with a Larmtek W5 webcam.  I'm posting here as it seems possibly related.


Replacing Windows 7 64 bit with Ubuntu 32 bit

For RAMs lesser than 2GBs it is recommended to use 32-Bit Operating Systems

Use Unetbootin to make a bootable image of Ubuntu , once booted use 'Try Ubuntu without installing' option and later on install it into your partition.